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

Unified Diff: LayoutTests/fast/dom/custom/unresolved-pseudoclass.html

Issue 14846002: Implement the Custom Elements :unresolved pseudoclass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adds a test and fixes style sharing. Created 7 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: LayoutTests/fast/dom/custom/unresolved-pseudoclass.html
diff --git a/LayoutTests/fast/dom/custom/unresolved-pseudoclass.html b/LayoutTests/fast/dom/custom/unresolved-pseudoclass.html
new file mode 100644
index 0000000000000000000000000000000000000000..54a716711e42630fbe0e2e8c3ba459492cad9ae9
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/unresolved-pseudoclass.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<style>
+x-x {
+ color: rgb(0, 222, 0);
+}
+
+[is=x-y]:not(:unresolved) {
+ color: rgb(0, 111, 0);
+}
+
+:unresolved {
+ color: rgb(0, 0, 222);
+}
+
+[is=x-y]:unresolved {
+ border-color: rgb(0, 0, 111);
+}
+</style>
+<script src="../../js/resources/js-test-pre.js"></script>
+<div id="container"></div>
+<x-x id="a"></x-x>
+<span id="b" is="x-y"></span>
+<script>
+description('Tests the :unresolved pseudoclass.');
+
+var a = document.querySelector('#a');
+shouldBe('document.querySelector("x-x:unresolved")', 'a');
+shouldBe('window.getComputedStyle(a).color', '"rgb(0, 0, 222)"');
+
+var b = document.querySelector('#b');
+shouldBe('window.getComputedStyle(b).color', '"rgb(0, 0, 222)"');
+shouldBe('window.getComputedStyle(b).borderColor', '"rgb(0, 0, 111)"');
+
+var X = document.webkitRegister('x-x', {prototype: Object.create(HTMLElement.prototype)});
+var c = new X();
+document.body.insertBefore(c, b);
+shouldBe('window.getComputedStyle(c).color', '"rgb(0, 222, 0)"');
+
+var Y = document.webkitRegister('x-y', {prototype: Object.create(HTMLSpanElement.prototype)});
+var d = new Y();
+document.body.insertBefore(d, b);
+shouldBe('window.getComputedStyle(d).color', '"rgb(0, 111, 0)"');
+
+// FIXME: When upgrade is implemented check that a and b's styles have changed.
+
+successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>

Powered by Google App Engine
This is Rietveld 408576698