Changeset 205374 in webkit


Ignore:
Timestamp:
Sep 2, 2016 2:50:13 PM (8 years ago)
Author:
Alan Bujtas
Message:

ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
https://bugs.webkit.org/show_bug.cgi?id=149462
<rdar://problem/27710841>

Reviewed by David Hyatt.

Source/WebCore:

In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
check is not sufficient to decide if some content has already been committed to the current line.
This patch adds a flag to indicate if we ever committed to the current line.

Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html

  • rendering/line/BreakingContext.h:

(WebCore::BreakingContext::handleText):

  • rendering/line/LineWidth.h:

(WebCore::LineWidth::hasCommitted):

LayoutTests:

  • fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt: Added.
  • fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205373 r205374  
     12016-09-02  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
     4        https://bugs.webkit.org/show_bug.cgi?id=149462
     5        <rdar://problem/27710841>
     6
     7        Reviewed by David Hyatt.
     8
     9        * fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt: Added.
     10        * fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html: Added.
     11
    1122016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r205373 r205374  
     12016-09-02  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
     4        https://bugs.webkit.org/show_bug.cgi?id=149462
     5        <rdar://problem/27710841>
     6
     7        Reviewed by David Hyatt.
     8
     9        In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
     10        check is not sufficient to decide if some content has already been committed to the current line.
     11        This patch adds a flag to indicate if we ever committed to the current line.
     12
     13        Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html
     14
     15        * rendering/line/BreakingContext.h:
     16        (WebCore::BreakingContext::handleText):
     17        * rendering/line/LineWidth.h:
     18        (WebCore::LineWidth::hasCommitted):
     19
    1202016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/Source/WebCore/rendering/line/BreakingContext.h

    r205282 r205374  
    582582        }
    583583        if (downcast<RenderListMarker>(*m_current.renderer()).isInside())
    584             m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
     584            m_width.addUncommittedWidth(replacedLogicalWidth);
    585585    } else
    586         m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
     586        m_width.addUncommittedWidth(replacedLogicalWidth);
    587587    if (is<RenderRubyRun>(*m_current.renderer())) {
    588588        m_width.applyOverhang(downcast<RenderRubyRun>(m_current.renderer()), m_lastObject, m_nextObject);
     
    801801    bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == SPACE;
    802802    // Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
    803     // which is only possible if the word is the first thing on the line, that is, if |w| is zero.
     803    // which is only possible if the word is the first thing on the line.
    804804    bool breakWords = m_currentStyle->breakWords() && ((m_autoWrap && !m_width.hasCommitted()) || m_currWS == PRE);
    805805    bool midWordBreak = false;
  • trunk/Source/WebCore/rendering/line/LineWidth.cpp

    r197462 r205374  
    3838LineWidth::LineWidth(RenderBlockFlow& block, bool isFirstLine, IndentTextOrNot shouldIndentText)
    3939    : m_block(block)
    40     , m_uncommittedWidth(0)
    41     , m_committedWidth(0)
    42     , m_overhangWidth(0)
    43     , m_trailingWhitespaceWidth(0)
    44     , m_trailingCollapsedWhitespaceWidth(0)
    45     , m_left(0)
    46     , m_right(0)
    47     , m_availableWidth(0)
    4840    , m_isFirstLine(isFirstLine)
    4941    , m_shouldIndentText(shouldIndentText)
     
    137129    m_committedWidth += m_uncommittedWidth;
    138130    m_uncommittedWidth = 0;
    139     if (m_hasUncommittedReplaced) {
    140         m_hasCommittedReplaced = true;
    141         m_hasUncommittedReplaced = false;
    142     }
     131    m_hasCommitted = true;
    143132}
    144133
  • trunk/Source/WebCore/rendering/line/LineWidth.h

    r197464 r205374  
    6060    float logicalLeftOffset() const { return m_left; }
    6161   
    62     bool hasCommitted() const { return m_committedWidth > 0 || m_hasCommittedReplaced; }
     62    bool hasCommitted() const { return m_hasCommitted; }
    6363
    6464    void updateAvailableWidth(LayoutUnit minimumHeight = 0);
     
    6767    {
    6868        m_uncommittedWidth += delta;
    69     }
    70     void addUncommittedReplacedWidth(float delta)
    71     {
    72         addUncommittedWidth(delta);
    73         m_hasUncommittedReplaced = true;
    7469    }
    7570    void commit();
     
    9085
    9186    RenderBlockFlow& m_block;
    92     float m_uncommittedWidth;
    93     float m_committedWidth;
    94     float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
    95     float m_trailingWhitespaceWidth;
    96     float m_trailingCollapsedWhitespaceWidth;
    97     float m_left;
    98     float m_right;
    99     float m_availableWidth;
    100     bool m_isFirstLine;
    101     bool m_hasUncommittedReplaced { false };
    102     bool m_hasCommittedReplaced { false };
     87    float m_uncommittedWidth { 0 };
     88    float m_committedWidth { 0 };
     89    float m_overhangWidth { 0 }; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
     90    float m_trailingWhitespaceWidth { 0 };
     91    float m_trailingCollapsedWhitespaceWidth { 0 };
     92    float m_left { 0 };
     93    float m_right { 0 };
     94    float m_availableWidth { 0 };
     95    bool m_isFirstLine { true };
     96    bool m_hasCommitted { false };
    10397    IndentTextOrNot m_shouldIndentText;
    10498};
Note: See TracChangeset for help on using the changeset viewer.