Skip to content

Commit

Permalink
Remove createShadowRoot() from shadow-dom/resources/shadow-dom.js
Browse files Browse the repository at this point in the history
This resource file affects many tests, most of which have changes to
their expectations files simply removing the console warning about the
usage of Shadow DOM v0.

Other small related changes in this patchset:
 - Several tests in virtual/web-components-v0-disabled virtual suite have
   their expectations change to "working" because the corresponding
   non-virtual suite test no longer uses web components v0. Several
   still fail, just differently now.
 - One test (fast/dom/shadow/attr-dir-inherit.html) is moved to the
   web-components-v0-only folder, as it is very v0-specific, and because
   there are better WPT tests at [1].

[1] https://source.chromium.org/search?q=f:external%2Fwpt%20rtl%20shadow%20f:html$&sq=&ss=chromium

Bug: 937746
Change-Id: I6936eaf982d30895055f7b618bc7f56c522da085
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2240140
Commit-Queue: Stephen Chenney <[email protected]>
Reviewed-by: Stephen Chenney <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#777196}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d7aeb3b01a3965e69b6bcbbadecd235c2015695d
  • Loading branch information
mfreed7 authored and Commit Bot committed Jun 11, 2020
1 parent b22168e commit ca66a16
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
This is a testharness.js-based test.
Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "DIV"
PASS DIV
Expand Down
4 changes: 2 additions & 2 deletions blink/web_tests/shadow-dom/resources/shadow-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function convertTemplatesToShadowRootsWithin(node) {
parent.removeChild(template);
var shadowRoot;
if (!mode || mode == 'v0') {
shadowRoot = parent.createShadowRoot();
shadowRoot = parent.attachShadow({mode: 'open'});
} else {
shadowRoot =
parent.attachShadow({'mode': mode, 'delegatesFocus': delegatesFocus});
Expand Down Expand Up @@ -75,7 +75,7 @@ function createTestTree(node) {
let shadowRoot;
if (template.getAttribute('data-mode') === 'v0') {
// For legacy Shadow DOM
shadowRoot = parent.createShadowRoot();
shadowRoot = parent.attachShadow({mode: 'open'});
} else if (template.getAttribute('data-slot-assignment') === 'manual') {
shadowRoot =
parent.attachShadow({mode: template.getAttribute('data-mode'),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This is a testharness.js-based test.
PASS dir=rtl inherits into shadow trees
FAIL dir=rtl applies to the distributed content assert_equals: dir=rtl should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
FAIL dir=rtl applies to the distributed content (multiple levels) assert_equals: dir=rtl should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
PASS dir=auto the first character in the shadow trees
FAIL dir=auto the first character in the distributed content assert_equals: Hebrew text should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
FAIL dir=auto the first character in the distributed content with multiple levels of shadow roots assert_equals: Hebrew text should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
Harness: the test ran to completion.

0 comments on commit ca66a16

Please sign in to comment.