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

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

Issue 325663003: Remove scoped styles (retry) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test (and expectation) 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/basic-attribute.html
diff --git a/LayoutTests/fast/css/style-scoped/basic-attribute.html b/LayoutTests/fast/css/style-scoped/basic-attribute.html
deleted file mode 100644
index b2fd3696c722023b88cd0c587460cb8d1c41498f..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/css/style-scoped/basic-attribute.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<html>
-<head>
- <script src="../../../resources/js-test.js"></script>
-</head>
-<body>
- <p>Basic test for the &lt;style scoped&gt; attribute.</p>
- <div id="scope">
- <style id="global1"></style>
- <style scoped='scoped' id="scoped1"></style>
- </div>
-
- <div id="console"></div>
-
- <script>
- function testBooleanAttribute(elem, attr)
- {
- var val = elem.getAttribute(attr);
- if (val === null)
- return false
- if (val === '' || val === attr)
- return true;
- throw "Illegal value for boolean attribute!";
- }
-
- var scope = document.getElementById('scope');
-
- var global1 = document.getElementById('global1');
- var scoped1 = document.getElementById('scoped1');
-
- var global2 = document.createElement('style');
- var scoped2 = document.createElement('style');
- scoped2.setAttribute('scoped', 'scoped');
- var scoped3 = document.createElement('style');
- scoped3.scoped = true;
-
- debug("--- Initial ---");
- shouldBeNull("global1.getAttribute('scoped')");
- shouldBeFalse("global1.scoped");
- shouldBeNull("global2.getAttribute('scoped')");
- shouldBeFalse("global2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped1, 'scoped')");
- shouldBeTrue("scoped1.scoped");
- shouldBeTrue("testBooleanAttribute(scoped2, 'scoped')");
- shouldBeTrue("scoped2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped3, 'scoped')");
- shouldBeTrue("scoped3.scoped");
-
- debug("--- After insertion into tree ---")
- scope.appendChild(global2);
- scope.appendChild(scoped2);
- scope.appendChild(scoped3);
-
- shouldBeNull("global1.getAttribute('scoped')");
- shouldBeFalse("global1.scoped");
- shouldBeNull("global2.getAttribute('scoped')");
- shouldBeFalse("global2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped1, 'scoped')");
- shouldBeTrue("scoped1.scoped");
- shouldBeTrue("testBooleanAttribute(scoped2, 'scoped')");
- shouldBeTrue("scoped2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped3, 'scoped')");
- shouldBeTrue("scoped3.scoped");
-
- debug("--- Inverting 'scoped' attribute while in tree ---");
- scoped1.scoped = null;
- scoped2.scoped = false;
- scoped3.removeAttribute('scoped');
- global1.scoped = true;
- global2.setAttribute('scoped', 'scoped');
-
- shouldBeTrue("testBooleanAttribute(global1, 'scoped')");
- shouldBeTrue("global1.scoped");
- shouldBeTrue("testBooleanAttribute(global2, 'scoped')");
- shouldBeTrue("global2.scoped");
- shouldBeNull("scoped1.getAttribute('scoped')");
- shouldBeFalse("scoped1.scoped");
- shouldBeNull("scoped2.getAttribute('scoped')");
- shouldBeFalse("scoped2.scoped");
- shouldBeNull("scoped3.getAttribute('scoped')");
- shouldBeFalse("scoped3.scoped");
-
- debug("--- After removal from tree (attribute is still inverted) ---");
- scope.removeChild(global1);
- scope.removeChild(global2);
- scope.removeChild(scoped1);
- scope.removeChild(scoped2);
- scope.removeChild(scoped3);
-
- shouldBeTrue("testBooleanAttribute(global1, 'scoped')");
- shouldBeTrue("global1.scoped");
- shouldBeTrue("testBooleanAttribute(global2, 'scoped')");
- shouldBeTrue("global2.scoped");
- shouldBeNull("scoped1.getAttribute('scoped')");
- shouldBeFalse("scoped1.scoped");
- shouldBeNull("scoped2.getAttribute('scoped')");
- shouldBeFalse("scoped2.scoped");
- shouldBeNull("scoped3.getAttribute('scoped')");
- shouldBeFalse("scoped3.scoped");
-
- debug("--- Inverting 'scoped' attribute again, while outside tree ---");
- scoped1.scoped = true;
- scoped2.scoped = true;
- scoped3.setAttribute('scoped', 'scoped');
- global1.scoped = false;
- global2.removeAttribute('scoped');
-
- shouldBeNull("global1.getAttribute('scoped')");
- shouldBeFalse("global1.scoped");
- shouldBeNull("global2.getAttribute('scoped')");
- shouldBeFalse("global2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped1, 'scoped')");
- shouldBeTrue("scoped1.scoped");
- shouldBeTrue("testBooleanAttribute(scoped2, 'scoped')");
- shouldBeTrue("scoped2.scoped");
- shouldBeTrue("testBooleanAttribute(scoped3, 'scoped')");
- shouldBeTrue("scoped3.scoped");
-
- debug("--- DONE ---");
- var successfullyParsed = true;
- </script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698