Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 306860296d33ebc428b319f6d705faa3a51f6e33
      
https://github.com/WebKit/WebKit/commit/306860296d33ebc428b319f6d705faa3a51f6e33
  Author: Megan Gardner <[email protected]>
  Date:   2023-09-29 (Fri, 29 Sep 2023)

  Changed paths:
    A LayoutTests/fast/repaint/highlight-paint-after-range-change-expected.txt
    A LayoutTests/fast/repaint/highlight-paint-after-range-change.html
    M Source/WebCore/Modules/highlight/Highlight.cpp
    M Source/WebCore/Modules/highlight/Highlight.h
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/Range.cpp
    M Source/WebCore/dom/Range.h

  Log Message:
  -----------
  Highlights are not repainted if associated live ranges are changed.
https://bugs.webkit.org/show_bug.cgi?id=262168
rdar://116108148

Reviewed by Wenson Hsieh.

When a range is changed, we need to repaint the previous and the new range.
Fortunately, we already had a mechanism to get Positions from the ranges
so that we have the information we need at paint time. We can use these
stale positions to know what the range was before updating, and repaint the old
range, as well as the new range.
Also a rename for more clarity around setting flags for highlights in Range.

* LayoutTests/fast/repaint/highlight-paint-after-range-change-expected.txt: 
Added.
* LayoutTests/fast/repaint/highlight-paint-after-range-change.html: Added.
* Source/WebCore/Modules/highlight/Highlight.h:
(WebCore::HighlightRange::HighlightRange):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::collectHighlightRangesFromRegister):
(WebCore::repaintRange):
(WebCore::Document::updateHighlightPositions):
(WebCore::Document::collectRangeDataFromRegister): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::updateAssociatedHighlight):
(WebCore::Range::setStart):
(WebCore::Range::setEnd):
(WebCore::Range::nodeChildrenChanged):
(WebCore::Range::nodeChildrenWillBeRemoved):
(WebCore::Range::nodeWillBeRemoved):
(WebCore::Range::textInserted):
(WebCore::Range::textRemoved):
(WebCore::Range::textNodesMerged):
(WebCore::Range::textNodeSplit):
* Source/WebCore/dom/Range.h:

Canonical link: https://commits.webkit.org/268660@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to