From e2bfe7b3d06bb26ff4d800087df6aad417feadfa Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Fri, 7 May 2021 10:47:29 -0700 Subject: [PATCH] Upstream and expand outerText tests This accompanies https://github.com/whatwg/html/pull/6653. Fixed: 710764 Change-Id: I7168df9bbaeef12ed256b7f2fb9c2c43c9d6b227 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2875725 Reviewed-by: Mason Freed Commit-Queue: Domenic Denicola Cr-Commit-Position: refs/heads/master@{#880460} --- custom-elements/reactions/HTMLElement.html | 9 +- .../dynamic-getter.html | 5 +- .../getter-first-letter-marker-multicol.html | 5 +- .../getter-tests.js | 0 .../getter.html | 5 +- .../innertext-setter-tests.js} | 0 .../innertext-setter.html} | 2 +- .../multiple-text-nodes.window.js | 3 +- .../outertext-setter.html | 140 ++++++++++++++++++ 9 files changed, 155 insertions(+), 14 deletions(-) rename html/dom/elements/{the-innertext-idl-attribute => the-innertext-and-outertext-properties}/dynamic-getter.html (93%) rename html/dom/elements/{the-innertext-idl-attribute => the-innertext-and-outertext-properties}/getter-first-letter-marker-multicol.html (69%) rename html/dom/elements/{the-innertext-idl-attribute => the-innertext-and-outertext-properties}/getter-tests.js (100%) rename html/dom/elements/{the-innertext-idl-attribute => the-innertext-and-outertext-properties}/getter.html (92%) rename html/dom/elements/{the-innertext-idl-attribute/setter-tests.js => the-innertext-and-outertext-properties/innertext-setter-tests.js} (100%) rename html/dom/elements/{the-innertext-idl-attribute/setter.html => the-innertext-and-outertext-properties/innertext-setter.html} (98%) rename html/dom/elements/{the-innertext-idl-attribute => the-innertext-and-outertext-properties}/multiple-text-nodes.window.js (80%) create mode 100644 html/dom/elements/the-innertext-and-outertext-properties/outertext-setter.html diff --git a/custom-elements/reactions/HTMLElement.html b/custom-elements/reactions/HTMLElement.html index 5fe422cdfc1df5..bd252282161b59 100644 --- a/custom-elements/reactions/HTMLElement.html +++ b/custom-elements/reactions/HTMLElement.html @@ -28,12 +28,9 @@ customElement.parentNode.innerText = ''; }, 'innerText on HTMLElement'); -if ('outerText' in HTMLElement.prototype) { - // Not yet to be in the standard but all but Gecko supports this property: https://github.com/whatwg/html/issues/668 - testNodeDisconnector(function (customElement) { - customElement.outerText = ''; - }, 'outerText on HTMLElement'); -} +testNodeDisconnector(function (customElement) { + customElement.outerText = ''; +}, 'outerText on HTMLElement'); diff --git a/html/dom/elements/the-innertext-idl-attribute/dynamic-getter.html b/html/dom/elements/the-innertext-and-outertext-properties/dynamic-getter.html similarity index 93% rename from html/dom/elements/the-innertext-idl-attribute/dynamic-getter.html rename to html/dom/elements/the-innertext-and-outertext-properties/dynamic-getter.html index b3e96f94a80501..e34fcf5ac1e444 100644 --- a/html/dom/elements/the-innertext-idl-attribute/dynamic-getter.html +++ b/html/dom/elements/the-innertext-and-outertext-properties/dynamic-getter.html @@ -1,5 +1,5 @@ -innerText getter test with dynamic style changes +innerText/outerText getter test with dynamic style changes
@@ -19,7 +19,8 @@ if (!e) { e = container.firstChild; } - assert_equals(e.innerText, expectedPlain); + assert_equals(e.innerText, expectedPlain, "innerText"); + assert_equals(e.outerText, expectedPlain, "outerText"); container.textContext = ''; }, msg + ' (' + format_value(html) + ')'); } diff --git a/html/dom/elements/the-innertext-idl-attribute/getter-first-letter-marker-multicol.html b/html/dom/elements/the-innertext-and-outertext-properties/getter-first-letter-marker-multicol.html similarity index 69% rename from html/dom/elements/the-innertext-idl-attribute/getter-first-letter-marker-multicol.html rename to html/dom/elements/the-innertext-and-outertext-properties/getter-first-letter-marker-multicol.html index 77a815c5410aac..3b579dca1c5e4d 100644 --- a/html/dom/elements/the-innertext-idl-attribute/getter-first-letter-marker-multicol.html +++ b/html/dom/elements/the-innertext-and-outertext-properties/getter-first-letter-marker-multicol.html @@ -1,5 +1,5 @@ -Test innerText for a combination of a list item with ::first-letter in multicol +Test innerText/outerText for a combination of a list item with ::first-letter in multicol @@ -12,6 +12,7 @@
PASS
diff --git a/html/dom/elements/the-innertext-idl-attribute/getter-tests.js b/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js similarity index 100% rename from html/dom/elements/the-innertext-idl-attribute/getter-tests.js rename to html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js diff --git a/html/dom/elements/the-innertext-idl-attribute/getter.html b/html/dom/elements/the-innertext-and-outertext-properties/getter.html similarity index 92% rename from html/dom/elements/the-innertext-idl-attribute/getter.html rename to html/dom/elements/the-innertext-and-outertext-properties/getter.html index c84bb04a2f4740..ffb3d34fe94143 100644 --- a/html/dom/elements/the-innertext-idl-attribute/getter.html +++ b/html/dom/elements/the-innertext-and-outertext-properties/getter.html @@ -1,5 +1,5 @@ -innerText getter test +innerText/outerText getter test