Skip to content

Commit

Permalink
Sync and remove [NotEnumerable] from toString as per Selection API …
Browse files Browse the repository at this point in the history
…IDL Specification

https://bugs.webkit.org/show_bug.cgi?id=264991

Reviewed by Ryosuke Niwa.

This change is to align WebKit with Gecko / Firefox, Blink / Chromium and Web-Specification [1] by removing
[NoEnumerable] from 'toString' (stringifier).

[1] https://w3c.github.io/selection-api/#selection-interface

* Source/WebCore/page/DOMSelection.idl:
* LayoutTests/js/dom/toString-dontEnum.html: Rebaselined
* LayoutTests/js/dom/toString-dontEnum-expected.txt: Rebaselined

Canonical link: https://commits.webkit.org/270933@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Nov 18, 2023
1 parent c96f1c5 commit 6b9b667
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion LayoutTests/js/dom/toString-dontEnum-expected.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This tests that the toString() function does not enumerate.

PASS: the toString function is not enumerable for Selection.
PASS: the toString function is not enumerable for HTMLDivElement.
PASS: the toString function is not enumerable for HTMLDocument.
PASS: the toString function is not enumerable for Object.
Expand Down
3 changes: 0 additions & 3 deletions LayoutTests/js/dom/toString-dontEnum.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
if (window.testRunner)
testRunner.dumpAsText();

// DOM objects with custom toString() functions
test(window.getSelection(), "Selection");

// Other DOM objects
test(document.createElement('div'), "HTMLDivElement");
test(document, "HTMLDocument");
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/page/DOMSelection.idl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// https://www.w3.org/TR/selection-api/#idl-def-Selection
// https://w3c.github.io/selection-api/#selection-interface
[
GenerateIsReachable=ReachableFromDOMWindow,
InterfaceName=Selection,
Expand Down Expand Up @@ -67,7 +67,7 @@
[CEReactions=Needed] undefined deleteFromDocument();
boolean containsNode(Node node, optional boolean allowPartialContainment = false);

[NotEnumerable] DOMString toString();
DOMString toString();

// Non-standard methods and attributes.

Expand Down

0 comments on commit 6b9b667

Please sign in to comment.