[webkit-changes] [WebKit/WebKit] 919c3b: Make RemoveFormat command to work with mixed editable

Ahmad Saleem noreply at github.com
Tue Dec 6 01:00:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 919c3b81c0474dfbe49620a512bdfad1c0f23d0f
      https://github.com/WebKit/WebKit/commit/919c3b81c0474dfbe49620a512bdfad1c0f23d0f
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    A LayoutTests/editing/execCommand/remove-format-mixed-editable-crash-expected.txt
    A LayoutTests/editing/execCommand/remove-format-mixed-editable-crash.html
    M Source/WebCore/editing/ApplyStyleCommand.cpp

  Log Message:
  -----------
  Make RemoveFormat command to work with mixed editable

Make RemoveFormat command to work with mixed editable
https://bugs.webkit.org/show_bug.cgi?id=202901

Reviewed by Ryosuke Niwa.

Merge - https://src.chromium.org/viewvc/blink?view=revision&revision=177448

This patch changes assertion in |ApplyStyleCommand::removeInlineStyle()| to
consider |PositionIsBeforeChildren| as same as |PositionIsBeforeAnchor| and
|offsetInContainerNode <= 0|.

In the attached test case, |firstPositionInOrBeforeNode(next.get())| returns
|PositionIsBeforeChildren| for B element. When we don't have uneditable
element, inline styles are removed by |removeInlineStyleFromElement| for
BODY element rather than each child in BODY element. Webkit doesn't go the path
contains the assertion.

* Source/WebCore/editing/ApplyStyleCommand.cpp:
(ApplyStyleCommand::removeInlineStyle): Update Assertion
* LayoutTests/editing/execCommand/remove-format-mixed-editable-crash.html: Add Test Case
* LayoutTests/editing/execCommand/remove-format-mixed-editable-crash-expected.txt: Add Test Case Expectation

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




More information about the webkit-changes mailing list