⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283087 in webkit


Ignore:
Timestamp:
Sep 26, 2021, 6:47:42 AM (5 years ago)
Author:
Antti Koivisto
Message:

Line iterator firstRun/lastRun may return runs from wrong lines
https://bugs.webkit.org/show_bug.cgi?id=230770
<rdar://problem/83509753>

Reviewed by Alan Bujtas.

Source/WebCore:

In some situation line iterator firstRun/lastRun could return runs from different lines.
This could lead to inconsistencies like firstRun being non-null while lastRun is null.

Test: editing/iterator-line-start-end.html

  • layout/integration/LayoutIntegrationLineIteratorModernPath.h:

(WebCore::LayoutIntegration::LineIteratorModernPath::firstRun const):
(WebCore::LayoutIntegration::LineIteratorModernPath::lastRun const):

Take care to only return runs from this line.

LayoutTests:

  • editing/iterator-line-start-end-expected.txt: Added.
  • editing/iterator-line-start-end.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283079 r283087  
     12021-09-26  Antti Koivisto  <antti@apple.com>
     2
     3        Line iterator firstRun/lastRun may return runs from wrong lines
     4        https://bugs.webkit.org/show_bug.cgi?id=230770
     5        <rdar://problem/83509753>
     6
     7        Reviewed by Alan Bujtas.
     8
     9        * editing/iterator-line-start-end-expected.txt: Added.
     10        * editing/iterator-line-start-end.html: Added.
     11
    1122021-09-23  Tim Nguyen  <ntim@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r283084 r283087  
     12021-09-26  Antti Koivisto  <antti@apple.com>
     2
     3        Line iterator firstRun/lastRun may return runs from wrong lines
     4        https://bugs.webkit.org/show_bug.cgi?id=230770
     5        <rdar://problem/83509753>
     6
     7        Reviewed by Alan Bujtas.
     8
     9        In some situation line iterator firstRun/lastRun could return runs from different lines.
     10        This could lead to inconsistencies like firstRun being non-null while lastRun is null.
     11
     12        Test: editing/iterator-line-start-end.html
     13
     14        * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
     15        (WebCore::LayoutIntegration::LineIteratorModernPath::firstRun const):
     16        (WebCore::LayoutIntegration::LineIteratorModernPath::lastRun const):
     17
     18        Take care to only return runs from this line.
     19
    1202021-09-25  Alan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h

    r282961 r283087  
    103103        auto runIterator = RunIteratorModernPath { *m_inlineContent, line().firstBoxIndex() };
    104104        if (runIterator.box().isInlineBox())
    105             runIterator.traverseNextLeaf();
     105            runIterator.traverseNextOnLine();
    106106        return runIterator;
    107107    }
     
    114114        auto runIterator = RunIteratorModernPath { *m_inlineContent, line().firstBoxIndex() + boxCount - 1 };
    115115        if (runIterator.box().isInlineBox())
    116             runIterator.traversePreviousLeaf();
     116            runIterator.traversePreviousOnLine();
    117117        return runIterator;
    118118    }
Note: See TracChangeset for help on using the changeset viewer.