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

Unified Diff: LayoutTests/fast/dom/shadow/pseudo-attribute.html

Issue 187573002: Revert "Reverting custom pseudo element". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/dom/shadow/pseudo-attribute.html
diff --git a/LayoutTests/fast/dom/shadow/pseudo-attribute.html b/LayoutTests/fast/dom/shadow/pseudo-attribute.html
new file mode 100644
index 0000000000000000000000000000000000000000..58e2537da6d58bff53b353f163bbdf6fa60456ce
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/pseudo-attribute.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../../resources/js-test.js"></script>
+
+<p>This test checks pseudo attribute is exposed correctly.</p>
+
+<pre id="console"></pre>
+
+<script>
+var div = document.createElement('div');
+
+shouldBe("div.pseudo", "''");
+shouldBe("div.getAttribute('pseudo')", "null");
+
+div.setAttribute("pseudo", "foo");
+shouldBe("div.pseudo", "'foo'");
+shouldBe("div.getAttribute('pseudo')", "'foo'");
+
+div.pseudo = "bar";
+shouldBe("div.pseudo", "'bar'");
+shouldBe("div.getAttribute('pseudo')", "'bar'");
+
+div.removeAttribute('pseudo');
+shouldBe("div.pseudo", "''");
+shouldBe("div.getAttribute('pseudo')", "null");
+
+// Checks pseudo accepts known pseudo-element word.
+div.pseudo = 'first-letter';
+shouldBe("div.pseudo", "'first-letter'");
+
+finishJSTest();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698