[webkit-changes] [WebKit/WebKit] d18706: REGRESSION (Safari 17): getRangeAt(0) returns the ...

Ryosuke Niwa noreply at github.com
Thu Oct 31 21:59:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d187066ee9b041caa56406b480f595e7e1dda16a
      https://github.com/WebKit/WebKit/commit/d187066ee9b041caa56406b480f595e7e1dda16a
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-10-31 (Thu, 31 Oct 2024)

  Changed paths:
    A LayoutTests/editing/selection/update-selection-with-find-dissociates-range-expected.txt
    A LayoutTests/editing/selection/update-selection-with-find-dissociates-range.html
    A LayoutTests/editing/selection/update-selection-with-modify-dissociates-range-expected.txt
    A LayoutTests/editing/selection/update-selection-with-modify-dissociates-range.html
    M Source/WebCore/editing/FrameSelection.cpp
    M Source/WebCore/editing/FrameSelection.h

  Log Message:
  -----------
  REGRESSION (Safari 17): getRangeAt(0) returns the same JS object even after selection changes, differs from Chrome and Firefox
https://bugs.webkit.org/show_bug.cgi?id=273469
<rdar://problem/127314280>

Reviewed by Wenson Hsieh.

This PR makes WebKit's behavior match Gecko's and Blink's behaviors by dissociating live ranges when updating selection except
when we're updating as a result of DOM mutation or via manipulation of live ranges.

* LayoutTests/editing/selection/update-selection-with-find-dissociates-range-expected.txt: Added.
* LayoutTests/editing/selection/update-selection-with-find-dissociates-range.html: Added.
* LayoutTests/editing/selection/update-selection-with-modify-dissociates-range-expected.txt: Added.
* LayoutTests/editing/selection/update-selection-with-modify-dissociates-range.html: Added.
* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::respondToNodeModification):
(WebCore::FrameSelection::textWasReplaced):
(WebCore::FrameSelection::updateFromAssociatedLiveRange):
(WebCore::FrameSelection::updateAssociatedLiveRange): Deleted.
* Source/WebCore/editing/FrameSelection.h:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list