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

Unified Diff: LayoutTests/fast/css/shorthand-setProperty-important.html

Issue 180353002: Make getProperty more strict when handling the priority parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add idl change to distinguish between null and empty string 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/css/shorthand-setProperty-important.html
diff --git a/LayoutTests/fast/css/shorthand-setProperty-important.html b/LayoutTests/fast/css/shorthand-setProperty-important.html
new file mode 100644
index 0000000000000000000000000000000000000000..4864486911d4dc5102860b8df426fd28b6106e86
--- /dev/null
+++ b/LayoutTests/fast/css/shorthand-setProperty-important.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+
+description("Verify that the priority parameter is a case-insensitive match to 'important' or the empty string.");
+
+var testContainer = document.createElement("div");
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello</div>';
+
+e = document.getElementById('test');
+
+// Test "important" strictness
+e.style.borderBottomStyle = "";
+e.style.setProperty("border-bottom-style", "solid", "!important");
+shouldBe("e.style.getPropertyValue('border-bottom-style')", "null");
+shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
+
+e.style.borderBottomStyle = "";
+e.style.setProperty("border-bottom-style", "solid", "very important");
+shouldBe("e.style.getPropertyValue('border-bottom-style')", "null");
+shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
+
+e.style.borderBottomStyle = "";
+e.style.setProperty("border-bottom-style", "solid", "impORTANT");
+shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
+shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'");
+
+e.style.borderBottomStyle = "";
+e.style.setProperty("border-bottom-style", "solid", "random");
+shouldBe("e.style.getPropertyValue('border-bottom-style')", "null");
+shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''");
+
+document.body.removeChild(testContainer);
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/fast/css/shorthand-priority.html ('k') | LayoutTests/fast/css/shorthand-setProperty-important-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698