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

Unified Diff: LayoutTests/fast/css/style-scoped/style-scoped-detach.html

Issue 317143002: Revert of Remove scoped styles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: LayoutTests/fast/css/style-scoped/style-scoped-detach.html
diff --git a/LayoutTests/fast/css/style-scoped/style-scoped-detach.html b/LayoutTests/fast/css/style-scoped/style-scoped-detach.html
new file mode 100644
index 0000000000000000000000000000000000000000..b21bae8e40718d2363dee6a9c767e619524e6393
--- /dev/null
+++ b/LayoutTests/fast/css/style-scoped/style-scoped-detach.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script type="text/javascript">
+ function log(msg)
+ {
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+ }
+
+ function test(id)
+ {
+ var elem = document.getElementById(id);
+ log(id + ': ' + document.defaultView.getComputedStyle(elem, null).getPropertyValue('color'));
+ }
+
+ function testAll()
+ {
+ test('S1');
+ test('P1');
+ test('S2');
+ test('P2');
+ test('S3');
+ test('P3');
+ }
+
+ function runTests()
+ {
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ log('--- ORIGINAL ---');
+ testAll();
+
+ log('--- AFTER DETACHING <STYLE SCOPED> ---');
+ var divElem = document.getElementById('DIV');
+ var styleElem = document.getElementById('STYLE');
+ divElem.removeChild(styleElem);
+ setTimeout(function() {
+ testAll();
+ log('--- FINISHED ---');
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }
+ </script>
+ <style type="text/css" scoped>
+ body { color: black; }
+ </style>
+</head>
+<body onload="runTests();">
+ <p>Test detaching a &lt;style scoped&gt; element</p>
+ <div>
+ <span id="S1">Text</span>
+ <p id="P1">Text</p>
+ </div>
+ <div id="DIV">
+ <style id="STYLE" type="text/css" scoped>
+ div { color: red; }
+ p { color: green; }
+ </style>
+ <span id="S2">Text</span>
+ <p id="P2">Text</p>
+ </div>
+ <div>
+ <span id="S3">Text</span>
+ <p id="P3">Text</p>
+ </div>
+ <pre id="console"></pre>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698