From a79f6e43a05be3401ace0ec816b8b2f6499246f4 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 9 Nov 2015 16:39:48 -0800 Subject: [PATCH] Tests. --- tests/wpt/mozilla/meta/MANIFEST.json | 24 ++++++++++ .../mozilla/tests/css/restyle_hints_attr.css | 44 +++++++++++++++++++ .../mozilla/tests/css/restyle_hints_attr.html | 35 +++++++++++++++ .../tests/css/restyle_hints_attr_ref.html | 16 +++++++ .../tests/css/restyle_hints_state.html | 3 +- 5 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 tests/wpt/mozilla/tests/css/restyle_hints_attr.css create mode 100644 tests/wpt/mozilla/tests/css/restyle_hints_attr.html create mode 100644 tests/wpt/mozilla/tests/css/restyle_hints_attr_ref.html diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 340cbde980b..4dcc6df054e 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -3119,6 +3119,18 @@ "url": "/_mozilla/css/quotes_simple_a.html" } ], + "css/restyle_hints_attr.html": [ + { + "path": "css/restyle_hints_attr.html", + "references": [ + [ + "/_mozilla/css/restyle_hints_attr_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/restyle_hints_attr.html" + } + ], "css/restyle_hints_state.html": [ { "path": "css/restyle_hints_state.html", @@ -8052,6 +8064,18 @@ "url": "/_mozilla/css/quotes_simple_a.html" } ], + "css/restyle_hints_attr.html": [ + { + "path": "css/restyle_hints_attr.html", + "references": [ + [ + "/_mozilla/css/restyle_hints_attr_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/restyle_hints_attr.html" + } + ], "css/restyle_hints_state.html": [ { "path": "css/restyle_hints_state.html", diff --git a/tests/wpt/mozilla/tests/css/restyle_hints_attr.css b/tests/wpt/mozilla/tests/css/restyle_hints_attr.css new file mode 100644 index 00000000000..64d332c31f7 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/restyle_hints_attr.css @@ -0,0 +1,44 @@ +div { + background-color: black; + padding: 10px; + width: 50px; + height: 50px; + color: gray; +} + +div[foo=kokosnuss] { + background: black; +} + +div[foo][bar] { + background: red; +} + +div[foo=kokosnuss][bar~=fett] { + background: green; +} + +div[bar] > div[baz] div { + color: cyan; +} + +div[foo][bar~=butter] div { + background: purple; + color: white; +} + +div[foo][bar~=butter] > div { + background: yellow; +} + +div[bar~=butter][foo=kokosnuss] + div { + background: pink; +} + +div[foo=kokosnuss] ~ div { + background: green; +} + +div + div[foo=keine][bar=ahnung] { + background: lavender; +} diff --git a/tests/wpt/mozilla/tests/css/restyle_hints_attr.html b/tests/wpt/mozilla/tests/css/restyle_hints_attr.html new file mode 100644 index 00000000000..d9c55498f8f --- /dev/null +++ b/tests/wpt/mozilla/tests/css/restyle_hints_attr.html @@ -0,0 +1,35 @@ + + + + + + +
+
+
some text
+
+
+
+
+
+ + + diff --git a/tests/wpt/mozilla/tests/css/restyle_hints_attr_ref.html b/tests/wpt/mozilla/tests/css/restyle_hints_attr_ref.html new file mode 100644 index 00000000000..2d87a0f4526 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/restyle_hints_attr_ref.html @@ -0,0 +1,16 @@ + + + + + +
+
+
some text
+
+
+
+
+
+ + + diff --git a/tests/wpt/mozilla/tests/css/restyle_hints_state.html b/tests/wpt/mozilla/tests/css/restyle_hints_state.html index 52f82bc905d..480d1675bb5 100644 --- a/tests/wpt/mozilla/tests/css/restyle_hints_state.html +++ b/tests/wpt/mozilla/tests/css/restyle_hints_state.html @@ -30,8 +30,9 @@ * implement attribute-based restyle hints, we can stop dirtying the subtree * on attribute modifications, and these tests will start to be more useful. */ + window.dummy = 0; var $ = document.getElementById.bind(document); - function syncRestyle() { window.dummy != $("fs2").offsetTop; } + function syncRestyle() { window.dummy += $("fs2").offsetTop; } syncRestyle(); $('fs1').disabled = true; syncRestyle();