Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html

Issue 1899623002: Import latest web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle new failures Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
index f923323eb07df7f2e918337b131337a9ccd79bda..8963cee476983bf606e043a914e0fd16163a7b00 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
@@ -19,7 +19,7 @@ policies and contribution forms [3].
<meta name="assert" content="Upper-boundary encapsulation: The shadow nodes and named shadow elements are not accessible using shadow host's document DOM tree accessors.">
<script src="../../../../../../resources/testharness.js"></script>
<script src="../../../../../../resources/testharnessreport.js"></script>
-<script src="../../testcommon.js"></script>
+<script src="../../../../html/resources/common.js"></script>
</head>
<body>
<div id="log"></div>
@@ -66,7 +66,6 @@ var HTML_CONTENT = [
'<embed></embed>',
'<form></form>',
'<script><' + '/script>',
- '<applet></applet>',
'</body>'
].join('\n');
@@ -91,7 +90,7 @@ function populateTestContentToShadowRoot(shadowRoot) {
function createDocumentForTesting() {
var doc = document.implementation.createHTMLDocument('');
populateTestContentToHostDocument(doc);
- var shadowRoot = doc.documentElement.createShadowRoot();
+ var shadowRoot = doc.body.attachShadow({mode: 'open'});
populateTestContentToShadowRoot(shadowRoot);
return doc;
}
@@ -121,13 +120,17 @@ test(function () {
test(function () {
var doc = document.implementation.createHTMLDocument('');
populateTestContentToHostDocument(doc);
- var shadowRoot = doc.documentElement.createShadowRoot();
+
+ // Note: this test is originally written to replace document.documentElement
+ // with shadow contents, but among Shadow DOM V1 allowed elements body is the
+ // most approximate to it, though some test may make lesser sense.
+ var shadowRoot = doc.body.attachShadow({mode: 'open'});
populateTestContentToShadowRoot(shadowRoot);
// Replace the content of <title> to distinguish elements in a host
// document and a shadow tree.
doc.getElementsByTagName('title')[0].textContent = 'Title of host document';
- shadowRoot.getElementsByTagName('title')[0].textContent =
+ shadowRoot.querySelector('title').textContent =
'Title of shadow tree';
assert_equals(doc.title, 'Title of host document');
@@ -165,7 +168,7 @@ test(function () {
generate_tests(
testHTMLCollection,
- ['anchors', 'applets', 'all'].map(
+ ['anchors', 'all'].map(
function (accessor) {
return [
'Elements in a shadow tree should not be accessible from ' +
@@ -196,7 +199,7 @@ test(function () {
body.appendChild(pHost);
doc.documentElement.appendChild(body);
- var shadowRoot = body.createShadowRoot();
+ var shadowRoot = body.attachShadow({mode: 'open'});
var pShadow = doc.createElementNS(namespace, 'p');
pShadow.className = "shadow";
shadowRoot.appendChild(pShadow);
@@ -210,10 +213,10 @@ test(function () {
test(function () {
var doc = document.implementation.createHTMLDocument('');
populateTestContentToHostDocument(doc);
- var shadowRoot = doc.documentElement.createShadowRoot();
+ var shadowRoot = doc.body.attachShadow({mode: 'open'});
populateTestContentToShadowRoot(shadowRoot);
- shadowRoot.getElementsByTagName('p')[0].id = 'test-id';
+ shadowRoot.querySelectorAll('p')[0].id = 'test-id';
assert_equals(doc.getElementById('test-id'), null);
},
'Elements in a shadow tree should not be accessible from owner ' +

Powered by Google App Engine
This is Rietveld 408576698