[webkit-changes] [WebKit/WebKit] e29577: Prototype selection API for shadow DOM

Ryosuke Niwa noreply at github.com
Fri Feb 10 11:46:09 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e29577b1a051a4c2cbec70904df6e2f7cf8b5102
      https://github.com/WebKit/WebKit/commit/e29577b1a051a4c2cbec70904df6e2f7cf8b5102
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    A LayoutTests/fast/shadow-dom/selection-direction-expected.txt
    A LayoutTests/fast/shadow-dom/selection-direction.html
    A LayoutTests/fast/shadow-dom/selection-getComposedRanges-expected.txt
    A LayoutTests/fast/shadow-dom/selection-getComposedRanges.html
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/dom/ShadowRoot.idl
    M Source/WebCore/page/DOMSelection.cpp
    M Source/WebCore/page/DOMSelection.h
    M Source/WebCore/page/DOMSelection.idl

  Log Message:
  -----------
  Prototype selection API for shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=251997

Reviewed by Wenson Hsieh.

Prototype Selection.prototype.getComposedRanges and Selection.prototype.direction as spec'ed here:
https://w3c.github.io/selection-api/#dom-selection-getcomposedrange
https://w3c.github.io/selection-api/#dom-selection-direction

One notable difference is that we support returning a sequence of StaticRanges as opposed to
a single range so the method name is accordingly getComposedRange"s".

* LayoutTests/fast/shadow-dom/selection-direction-expected.txt: Added.
* LayoutTests/fast/shadow-dom/selection-direction.html: Added.
* LayoutTests/fast/shadow-dom/selection-getComposedRanges-expected.txt: Added.
* LayoutTests/fast/shadow-dom/selection-getComposedRanges.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/dom/ShadowRoot.idl:
* Source/WebCore/dom/StaticRange.h:
* Source/WebCore/page/DOMSelection.cpp:
(WebCore::DOMSelection::direction const):
(WebCore::DOMSelection::setBaseAndExtent):
(WebCore::DOMSelection::getComposedRanges):
* Source/WebCore/page/DOMSelection.h:
* Source/WebCore/page/DOMSelection.idl:

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




More information about the webkit-changes mailing list