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: third_party/WebKit/LayoutTests/fast/css/preferred-stylesheet-reversed-order.html

Issue 1769843002: Added tests for preferred sheet insertion order. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/fast/css/preferred-stylesheet-reversed-order.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/preferred-stylesheet-reversed-order.html b/third_party/WebKit/LayoutTests/fast/css/preferred-stylesheet-reversed-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..f327880195ba0a154924044b695c441113cfe171
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/preferred-stylesheet-reversed-order.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<div id="t1">This text should be green</div>
+<script>
+description("Preferred stylesheet where insertion order is tree order");
+
+function createStyleElement(text, title) {
+ var elm = document.createElement("style");
+ elm.setAttribute("title", title);
+ elm.appendChild(document.createTextNode(text));
+ return elm;
+}
+
+document.head.insertBefore(createStyleElement("#t1 {color:green}", "preferred"), document.head.firstChild);
+document.head.insertBefore(createStyleElement("#t1 {color:red}", "notpreferred"), document.head.firstChild);
+
+shouldBeEqualToString("getComputedStyle(t1).color", "rgb(0, 128, 0)");
+shouldBeEqualToString("document.preferredStylesheetSet", "preferred");
+shouldBeEqualToString("document.selectedStylesheetSet", "preferred");
+</script>

Powered by Google App Engine
This is Rietveld 408576698