Changeset 208170 in webkit


Ignore:
Timestamp:
Oct 31, 2016 1:16:37 PM (7 years ago)
Author:
Alan Bujtas
Message:

ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
https://bugs.webkit.org/show_bug.cgi?id=164076

Reviewed by Antti Koivisto.

Source/WebCore:

FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
measure text with zero font size at all.

Test: fast/text/simple-line-layout-with-zero-sized-font.html

  • rendering/SimpleLineLayoutTextFragmentIterator.cpp:

(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
(WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):

LayoutTests:

  • fast/text/simple-line-layout-with-zero-sized-font-expected.txt: Added.
  • fast/text/simple-line-layout-with-zero-sized-font.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208159 r208170  
     12016-10-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
     4        https://bugs.webkit.org/show_bug.cgi?id=164076
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/text/simple-line-layout-with-zero-sized-font-expected.txt: Added.
     9        * fast/text/simple-line-layout-with-zero-sized-font.html: Added.
     10
    1112016-10-31  Nan Wang  <n_wang@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r208169 r208170  
     12016-10-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
     4        https://bugs.webkit.org/show_bug.cgi?id=164076
     5
     6        Reviewed by Antti Koivisto.
     7
     8        FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
     9        measure text with zero font size at all.
     10
     11        Test: fast/text/simple-line-layout-with-zero-sized-font.html
     12
     13        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
     14        (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
     15        (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
     16
    1172016-10-31  Dave Hyatt  <hyatt@apple.com>
    218
  • trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp

    r204531 r208170  
    150150    ASSERT(segment.start <= from && from <= segment.end && segment.start <= to && to <= segment.end);
    151151    ASSERT(is<RenderText>(segment.renderer));
     152    if (!m_style.font.size())
     153        return 0;
    152154    if (m_style.font.isFixedPitch() || (from == segment.start && to == segment.end))
    153155        return downcast<RenderText>(segment.renderer).width(from - segment.start, to - from, m_style.font, xPosition, nullptr, nullptr);
     
    197199float TextFragmentIterator::runWidth(const FlowContents::Segment& segment, unsigned startPosition, unsigned endPosition, float xPosition) const
    198200{
     201    ASSERT(m_style.font.size());
    199202    ASSERT(startPosition <= endPosition);
    200203    if (startPosition == endPosition)
Note: See TracChangeset for help on using the changeset viewer.