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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/styles/test-005.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/styles/test-005.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/styles/test-005.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/styles/test-005.html
index 77614e4a02e3a2b82a521bf1a121988ec55405e8..a66be2288cabf8cb75c0e2947ed56af575bb6f9f 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/styles/test-005.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/styles/test-005.html
@@ -16,45 +16,46 @@ policies and contribution forms [3].
<meta name="assert" content="Styles:CSS rules declared in a shadow root style sheets must not apply in the document tree,">
<script src="../../../../../resources/testharness.js"></script>
<script src="../../../../../resources/testharnessreport.js"></script>
-<script src="../testcommon.js"></script>
+<script src="../../../html/resources/common.js"></script>
+<script src="../../resources/shadow-dom-utils.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//check querySelector method
test(unit(function (ctx) {
- var d = newRenderedHTMLDocument(ctx);
+ var d = newRenderedHTMLDocument(ctx);
d.body.innerHTML =
- '<div>' +
- '<span class="invis" id="theTreeSpan">This is an element in the document tree</span>' +
- '</div>' +
- '<div id="sr">' +
- '</div>';
-
- var host = d.querySelector('#sr');
-
- //Shadow root to play with
- var s = host.createShadowRoot();
-
- var style = d.createElement('style');
- style.innerHTML ='.invis {display:none}';
- s.appendChild(style);
-
- var span = d.createElement('span');
- span.setAttribute('id', 'theShadowSpan');
- span.setAttribute('class', 'invis');
- s.appendChild(span);
-
- //theTreeSpan should be visible, theShadowSpan not
- assert_true(d.querySelector('#theTreeSpan').offsetTop > 0,
- 'CSS styles declared in shadow tree must not be applied to the elements ' +
- 'in the document tree');
-
- //theTreeSpan should be visible, theShadowSpan not
- assert_equals(s.querySelector('#theShadowSpan').offsetTop, 0,
- 'CSS styles declared in shadow tree must be applied to the element ' +
- 'in the same shadow tree');
+ '<div>' +
+ '<span class="invis" id="theTreeSpan">This is an element in the document tree</span>' +
+ '</div>' +
+ '<div id="sr">' +
+ '</div>';
+
+ var host = d.querySelector('#sr');
+
+ //Shadow root to play with
+ var s = host.attachShadow({mode: 'open'});
+
+ var style = d.createElement('style');
+ style.innerHTML ='.invis {display:none}';
+ s.appendChild(style);
+
+ var span = d.createElement('span');
+ span.setAttribute('id', 'theShadowSpan');
+ span.setAttribute('class', 'invis');
+ s.appendChild(span);
+
+ //theTreeSpan should be visible, theShadowSpan not
+ assert_true(d.querySelector('#theTreeSpan').offsetTop > 0,
+ 'CSS styles declared in shadow tree must not be applied to the elements ' +
+ 'in the document tree');
+
+ //theTreeSpan should be visible, theShadowSpan not
+ assert_equals(s.querySelector('#theShadowSpan').offsetTop, 0,
+ 'CSS styles declared in shadow tree must be applied to the element ' +
+ 'in the same shadow tree');
}), 'A_06_00_06_T01');
</script>

Powered by Google App Engine
This is Rietveld 408576698