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

Unified Diff: third_party/WebKit/LayoutTests/svg/css/viewBox-attribute-selector.html

Issue 2490393002: Match camelCased SVG attributes selectors in html documents. (Closed)
Patch Set: Rebased and fixed return statement Created 4 years, 1 month 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/svg/css/viewBox-attribute-selector.html
diff --git a/third_party/WebKit/LayoutTests/svg/css/viewBox-attribute-selector.html b/third_party/WebKit/LayoutTests/svg/css/viewBox-attribute-selector.html
new file mode 100644
index 0000000000000000000000000000000000000000..2f08fa2dbb5ae437f6826a8eb7c285bdadaa4432
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/css/viewBox-attribute-selector.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+ [viewBox] { color: green }
+ [VIEWBOX] { background-color: green }
+</style>
+<div viewBox id="t1"></div>
+<div viewbox id="t2"></div>
+<svg viewBox="0 0 800 10" id="t3"></svg>
+<svg VIEWBOX="0 0 800 10" id="t4"></svg>
+<script>
+ test(() => {
+ assert_equals(t1.attributes[0].name, "viewbox");
+ assert_equals(t2.attributes[0].name, "viewbox");
+ assert_equals(t3.attributes[0].name, "viewBox");
+ assert_equals(t4.attributes[0].name, "viewBox");
+ }, "Normalization of viewBox on html and svg elements in html documents.");
+
+ test(() => {
+ assert_equals(getComputedStyle(t1).color, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(t2).color, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(t2).backgroundColor, "rgb(0, 128, 0)");
+ }, "viewBox attribute without namespace on html element matches case-insensitively in html document.");
+
+ test(() => {
+ assert_equals(getComputedStyle(t3).color, "rgb(0, 128, 0)");
+ }, "Camel-cased viewBox on svg in html document matches sensitively.");
+
+ test(() => {
+ assert_equals(getComputedStyle(t3).backgroundColor, "rgb(0, 128, 0)");
+ }, "Camel-cased viewBox on svg in html document should match case-sensitively. Intentional deviation from the spec.");
+
+ test(() => {
+ assert_equals(getComputedStyle(t4).color, "rgb(0, 128, 0)", "Attribute is normalized to camelCase.");
+ }, "Normalized camel-cased viewBox on svg in html document matches case-sensitively.");
+
+ test(() => {
+ assert_equals(getComputedStyle(t4).backgroundColor, "rgb(0, 128, 0)", "Attribute is normalized to camelCase.");
+ }, "Normalized camel-cased viewBox on svg in html document should match case-sensitively. Intentional deviation from the spec.");
+</script>

Powered by Google App Engine
This is Rietveld 408576698