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

Unified Diff: LayoutTests/fast/css/attribute-selector-case-insensitive.html

Issue 330043003: Add support for case-insensitive attribute value selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move zero-initialization of m_bits to RareData constructor (explicitly). Created 6 years, 5 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/attribute-selector-case-insensitive.html
diff --git a/LayoutTests/fast/css/attribute-selector-case-insensitive.html b/LayoutTests/fast/css/attribute-selector-case-insensitive.html
new file mode 100644
index 0000000000000000000000000000000000000000..96326d5d133e01ecbab7e80c230437364ed8ff77
--- /dev/null
+++ b/LayoutTests/fast/css/attribute-selector-case-insensitive.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+
+<style type="text/css">
+ div { border: 2px solid red; }
+ div[attr1="LOWER"] { border-top-color: yellow }
+ div[attr1="lower"] { border-top-color: green }
+ div[attr2="upper"] { border-right-color: yellow }
+ div[attr2="UPPER"] { border-right-color: green }
+ div[attr3="lower" i] { border-bottom-color: green }
+ div[attr4="UPPER" i] { border-left-color: green }
+
+ div[attr-list~="BaR" i] { border: 2px solid green; }
+ div[attr-hyphen|="FoO" i] { border: 2px solid green; }
+ div[attr-begin^="FoO" i] { border: 2px solid green; }
+ div[attr-end$="BaR" i] { border: 2px solid green; }
+ div[attr-contain*="OoB" i] { border: 2px solid green; }
+</style>
+
+<div id="element-exact" attr1="lower" attr2="UPPER" attr3="LOWER" attr4="upper"></div>
+<div id="element-list" attr-list="foo bar"></div>
+<div id="element-hyphen" attr-hyphen="foo-bar"></div>
+<div id="element-begin" attr-begin="foobar"></div>
+<div id="element-end" attr-end="foobar"></div>
+<div id="element-contains" attr-end="foobar"></div>
+
+<p>
+ PASS if all elements borders are all green, not red.
+</p>
+
+<script src="../../resources/js-test.js"></script>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function checkBorders(elementId) {
+ debug("Testing " + elementId.split('-')[1] + " attribute selector.");
+ element = document.getElementById(elementId);
+ shouldBe("window.getComputedStyle(element).borderTopColor", "'rgb(0, 128, 0)'");
+ shouldBe("window.getComputedStyle(element).borderRightColor", "'rgb(0, 128, 0)'");
+ shouldBe("window.getComputedStyle(element).borderBottomColor", "'rgb(0, 128, 0)'");
+ shouldBe("window.getComputedStyle(element).borderLeftColor", "'rgb(0, 128, 0)'");
+ }
+
+ checkBorders("element-exact");
+ checkBorders("element-list");
+ checkBorders("element-hyphen");
+ checkBorders("element-begin");
+ checkBorders("element-end");
+ checkBorders("element-contains");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/attribute-selector-case-insensitive-expected.txt » ('j') | Source/core/css/CSSSelector.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698