[webkit-changes] [WebKit/WebKit] 96703a: [Live Range Selection] Debug assertion failure in ...

Ryosuke Niwa noreply at github.com
Thu Oct 6 10:16:55 PDT 2022


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

  Changed paths:
    A LayoutTests/editing/execCommand/insert-list-nested-with-orphaned-live-range-expected.txt
    A LayoutTests/editing/execCommand/insert-list-nested-with-orphaned-live-range.html
    A LayoutTests/editing/selection/select-start-remove-root-crash-live-range-expected.txt
    A LayoutTests/editing/selection/select-start-remove-root-crash-live-range.html
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/FrameSelection.cpp

  Log Message:
  -----------
  [Live Range Selection] Debug assertion failure in FrameSelection::setSelectionWithoutUpdatingAppearance
https://bugs.webkit.org/show_bug.cgi?id=246132

Reviewed by Wenson Hsieh and Darin Adler.

The assertion failure was caused by VisibleSelection::validate not clearing orphaned anchor & focus.
Fixed the bug by adding an explicit check for orphaned anchor & focus to avoid setting selection.

* LayoutTests/editing/execCommand/insert-list-nested-with-orphaned-live-range-expected.txt: Added.
* LayoutTests/editing/execCommand/insert-list-nested-with-orphaned-live-range.html: Added.
* LayoutTests/editing/selection/select-start-remove-root-crash-live-range-expected.txt: Added.
* LayoutTests/editing/selection/select-start-remove-root-crash-live-range.html: Added.

* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::changeSelectionAfterCommand): Use isOrphan which checks orphaned-ness of anchor & focus.

* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectAll): Don't update the selection if the new selection is already orphaned.

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




More information about the webkit-changes mailing list