Skip to content

Commit

Permalink
Change expectation for invalid/missing shadowRootMode IDL to null
Browse files Browse the repository at this point in the history
Per the spec discussion:

whatwg/html#5465 (comment)

this changes the expectation for the tests to be:

document.createElement("template").shadowRootMode === ""

rather than === null.

Note that this CL does not change Chromium's behavior, and as such
I cannot check if there are other tests that implicitly also
do a similar check. More tests might need to change once I (or
someone) implements this new behavior in a browser.

Bug: 1379513
Change-Id: I0ea1371d612d524fdecc287f3f1790d601c64982
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4954120
Commit-Queue: Mason Freed <masonf@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1213658}
  • Loading branch information
Mason Freed authored and Chromium LUCI CQ committed Oct 23, 2023
1 parent 42e0dab commit 3bd92c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This is a testharness.js-based test.
[PASS] Declarative Shadow DOM: Basic test
[PASS] Declarative Shadow DOM: Feature detection
[FAIL] Shadowrootmode reflection
assert_equals: Invalid values map to empty string expected (string) "" but got (object) null
[PASS] Declarative Shadow DOM: Fragment parser basic test
[PASS] Declarative Shadow DOM: Invalid shadow root attribute
[PASS] Declarative Shadow DOM: Closed shadow root attribute
[PASS] Declarative Shadow DOM: Missing closing tag
[PASS] Declarative Shadow DOM: delegates focus attribute
[PASS] Declarative Shadow DOM: Multiple roots
[PASS] Declarative Shadow DOM: template containing declarative shadow root
[PASS] Declarative Shadow DOM: template containing (deeply nested) declarative shadow root
[PASS] Declarative Shadow DOM: template containing a template containing declarative shadow root
[PASS] Declarative Shadow DOM: template containing declarative shadow root and UA shadow root
[PASS] Declarative Shadow DOM: template containing closed declarative shadow root and UA shadow root
[PASS] Declarative Shadow DOM: template root element
Harness: the test ran to completion.

Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
t.setAttribute('shadowrootmode','OpEn');
assert_equals(t.shadowRootMode,'open','Case insensitive');
t.setAttribute('shadowrootmode','INVALID');
assert_equals(t.shadowRootMode,null,'Invalid values map to null');
assert_equals(t.shadowRootMode,'','Invalid values map to empty string');
t.removeAttribute('shadowrootmode');
assert_equals(t.shadowRootMode,null,'No shadowrootmode attribute maps to null');
assert_equals(t.shadowRootMode,'','No shadowrootmode attribute maps to empty string');
}, 'Shadowrootmode reflection');

test(() => {
Expand Down

0 comments on commit 3bd92c0

Please sign in to comment.