0
Files
src/third_party/blink/web_tests/shadow-dom/attach-shadow-mode.html
Mason Freed a07ffcdb87 Mechanically replace Shadow DOM v0 with v1 in web_tests [CL 3 of 3]
This CL is the result of the following mechanical replacements, within
the third_party/blink/web_tests folder, on only .html and .js files:

'.createShadowRoot()'               -> '.attachShadow({mode: 'open'})'
'document.createElement('content')' -> 'document.createElement('span')'

Several web_tests did not pass after the above replacements were made.
Those tests were reverted - the changes in this CL are only the tests
that pass in the same way that they did prior to the replacements.
The only exceptions, which were re-baselined here, had *only* a
console warning message like this, which is now missing:

CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated
and will be removed in M80, around February 2020. Please use...

In addition, most of the same test expectations files were completely
removed from the virtual/web-components-v0-disabled folder, since these
tests no longer depend on WCv0 features, and no longer fail.

Bug: 937746
Change-Id: I157b48633206ddb249c55a7728c94955e88746b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2211053
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771452}
2020-05-25 01:22:53 +00:00

20 lines
634 B
HTML

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="host1"></div>
<div id="host2"></div>
<div id="host3"></div>
<input id="input">
<script>
test(function() {
host1.attachShadow({mode : 'open'});
var closedShadowRoot = host2.attachShadow({mode : 'closed'});
host3.attachShadow({mode: 'open'});
assert_equals(host1.shadowRoot.mode, 'open');
assert_equals(closedShadowRoot.mode, 'closed');
assert_equals(host3.shadowRoot.mode, 'open');
}, 'ShadowRoot.mode should return open or closed, and only open if v0.');
</script>