Changeset 189847 in webkit


Ignore:
Timestamp:
Sep 15, 2015 11:07:16 PM (9 years ago)
Author:
Alan Bujtas
Message:

Simple line layout: Glitch selecting long text.
https://bugs.webkit.org/show_bug.cgi?id=149204
rdar://problem/22646472

Reviewed by Antti Koivisto.

When long text is split into multiple RenderText objects, we ignore renderer boundaries while
collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
This patch ensures that fragments with hypen character ignore renderer boundaries too.

Source/WebCore:

Test: fast/text/multiple-renderers-with-hypen-on-boundary.html

  • rendering/SimpleLineLayoutTextFragmentIterator.cpp:

(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):

LayoutTests:

  • fast/text/multiple-renderers-with-hypen-on-boundary-expected.html: Added.
  • fast/text/multiple-renderers-with-hypen-on-boundary.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r189842 r189847  
     12015-09-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        Simple line layout: Glitch selecting long text.
     4        https://bugs.webkit.org/show_bug.cgi?id=149204
     5        rdar://problem/22646472
     6
     7        Reviewed by Antti Koivisto.
     8
     9        When long text is split into multiple RenderText objects, we ignore renderer boundaries while
     10        collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
     11        This patch ensures that fragments with hypen character ignore renderer boundaries too.
     12
     13        * fast/text/multiple-renderers-with-hypen-on-boundary-expected.html: Added.
     14        * fast/text/multiple-renderers-with-hypen-on-boundary.html: Added.
     15
    1162015-09-15  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r189843 r189847  
     12015-09-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        Simple line layout: Glitch selecting long text.
     4        https://bugs.webkit.org/show_bug.cgi?id=149204
     5        rdar://problem/22646472
     6
     7        Reviewed by Antti Koivisto.
     8
     9        When long text is split into multiple RenderText objects, we ignore renderer boundaries while
     10        collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
     11        This patch ensures that fragments with hypen character ignore renderer boundaries too.
     12
     13        Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
     14
     15        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
     16        (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
     17
    1182015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
    219
  • trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp

    r185593 r189847  
    162162        nextPosition = m_currentSegment->text.is8Bit() ? nextNonWhitespacePosition<LChar>(*m_currentSegment, currentPosition) : nextNonWhitespacePosition<UChar>(*m_currentSegment, currentPosition);
    163163    else if (positionType == Breakable) {
     164        nextPosition = m_currentSegment->text.is8Bit() ? nextBreakablePosition<LChar>(*m_currentSegment, currentPosition) : nextBreakablePosition<UChar>(*m_currentSegment, currentPosition);
    164165        // nextBreakablePosition returns the same position for certain characters such as hyphens. Call next again with modified position unless it's the end of the segment.
    165         nextPosition = m_currentSegment->text.is8Bit() ? nextBreakablePosition<LChar>(*m_currentSegment, currentPosition) : nextBreakablePosition<UChar>(*m_currentSegment, currentPosition);
     166        if (nextPosition == currentPosition && nextPosition < m_currentSegment->end)
     167            nextPosition = m_currentSegment->text.is8Bit() ? nextBreakablePosition<LChar>(*m_currentSegment, currentPosition + 1) : nextBreakablePosition<UChar>(*m_currentSegment, currentPosition + 1);
    166168        // We need to know whether the word actually finishes at the end of this renderer or not.
    167169        if (nextPosition == m_currentSegment->end) {
     
    169171            if (nextSegment != m_flowContents.end() && !isHardLineBreak(nextSegment))
    170172                overlappingFragment = nextPosition < (nextSegment->text.is8Bit() ? nextBreakablePosition<LChar>(*nextSegment, nextPosition) : nextBreakablePosition<UChar>(*nextSegment, nextPosition));
    171         } else if (nextPosition == currentPosition) {
    172             if (++nextPosition < m_currentSegment->end)
    173                 nextPosition = m_currentSegment->text.is8Bit() ? nextBreakablePosition<LChar>(*m_currentSegment, currentPosition + 1) : nextBreakablePosition<UChar>(*m_currentSegment, currentPosition + 1);
    174173        }
    175174    }
Note: See TracChangeset for help on using the changeset viewer.