[webkit-changes] [WebKit/WebKit] 3a11cf: Cherry-pick 262573 at main (c48d7192b129). https://bu...

Ryosuke Niwa noreply at github.com
Wed Apr 5 06:02:51 PDT 2023


  Branch: refs/heads/webkitglib/2.40
  Home:   https://github.com/WebKit/WebKit
  Commit: 3a11cf01b0e2dcc7db44fc5d1dcb9e6b643f2ba7
      https://github.com/WebKit/WebKit/commit/3a11cf01b0e2dcc7db44fc5d1dcb9e6b643f2ba7
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-04-05 (Wed, 05 Apr 2023)

  Changed paths:
    A LayoutTests/fast/shadow-dom/selection-collapse-expected.txt
    A LayoutTests/fast/shadow-dom/selection-collapse.html
    M Source/WebCore/page/DOMSelection.cpp

  Log Message:
  -----------
  Cherry-pick 262573 at main (c48d7192b129). https://bugs.webkit.org/show_bug.cgi?id=254957

    REGRESSION(259904 at main): Comment editor on huffpost.com doesn't update the caret position after inserting new line
    https://bugs.webkit.org/show_bug.cgi?id=254957
    <rdar://106426103>

    Reviewed by Wenson Hsieh.

    The bug was caused by DOMSelection::collapse exiting early due to the node being inside a shadow tree.
    When live range selection is enabled, we exit early if frame->document()->contains(*node) isn’t true.
    Fixed the bug by relaxing this restriction to allow a connected node of the same document.

    This patch also relaxes the same restriction on DOMSelection::extend.

    * LayoutTests/fast/shadow-dom/selection-collapse-expected.txt: Added.
    * LayoutTests/fast/shadow-dom/selection-collapse.html: Added.
    * Source/WebCore/page/DOMSelection.cpp:
    (WebCore::DOMSelection::collapse): Fixed the bug by relaxing the condition for an early exit when
    selectionAPIForShadowDOMEnabled returns true. Also made the check slightly more efficient by avoiding
    the tree walk to find the root node in most cases.
    (WebCore::DOMSelection::extend): Ditto.

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


  Commit: 768963a39cda2396c5d8190db8db5a3996435c7d
      https://github.com/WebKit/WebKit/commit/768963a39cda2396c5d8190db8db5a3996435c7d
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-04-05 (Wed, 05 Apr 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/editing/other/editable-state-and-focus-in-shadow-dom-in-designMode.tentative-expected.txt
    M Source/WebCore/html/HTMLElement.cpp

  Log Message:
  -----------
  Cherry-pick 262563 at main (155c4f42d9ef). https://bugs.webkit.org/show_bug.cgi?id=254966

    designMode should not affect shadow tree
    https://bugs.webkit.org/show_bug.cgi?id=254966

    Reviewed by Wenson Hsieh.

    Even when the document is in design mode, its shadow trees shouldn't be considered as editable.

    * LayoutTests/imported/w3c/web-platform-tests/editing/other/editable-state-and-focus-in-shadow-dom-in-designMode.tentative-expected.txt:
    * Source/WebCore/html/HTMLElement.cpp:
    (WebCore::HTMLElement::editabilityFromContentEditableAttr):

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


Compare: https://github.com/WebKit/WebKit/compare/988cb56ec61c...768963a39cda


More information about the webkit-changes mailing list