aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-11-04 16:06:34 +0100
committerSimon Sapin <simon.sapin@exyr.org>2015-11-06 23:01:55 +0100
commit3973085cb69ab06b998e62ebf0c65e1a099a7af0 (patch)
treeb1c999f4a0d7f096831cdf43b2c68be276998f32
parent40e6cc118e1cef9486c62d54670a85b9e6afdbbb (diff)
downloadservo-3973085cb69ab06b998e62ebf0c65e1a099a7af0.tar.gz
servo-3973085cb69ab06b998e62ebf0c65e1a099a7af0.zip
Fix double /**//**/
-rw-r--r--components/style/custom_properties.rs5
-rw-r--r--tests/wpt/mozilla/meta/css/test_variable_serialization_computed.html.ini53
2 files changed, 5 insertions, 53 deletions
diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs
index 8d0b2aba500..fbcf4c46b0e 100644
--- a/components/style/custom_properties.rs
+++ b/components/style/custom_properties.rs
@@ -74,6 +74,11 @@ impl ComputedValue {
fn push(&mut self, css: &str, css_first_token_type: TokenSerializationType,
css_last_token_type: TokenSerializationType) {
+ // This happens e.g. between to subsequent var() functions: `var(--a)var(--b)`.
+ // In that case, css_*_token_type is non-sensical.
+ if css.is_empty() {
+ return
+ }
self.first_token_type.set_if_nothing(css_first_token_type);
// If self.first_token_type was nothing,
// self.last_token_type is also nothing and this will be false:
diff --git a/tests/wpt/mozilla/meta/css/test_variable_serialization_computed.html.ini b/tests/wpt/mozilla/meta/css/test_variable_serialization_computed.html.ini
deleted file mode 100644
index 5c5d1ba2ebf..00000000000
--- a/tests/wpt/mozilla/meta/css/test_variable_serialization_computed.html.ini
+++ /dev/null
@@ -1,53 +0,0 @@
-[test_variable_serialization_computed.html]
- type: testharness
- [subtest #20 with `--a: var(--b)var(--c); --b:orange; --c:red;`]
- expected: FAIL
-
- [subtest #21 with `--a: var(--b)var(--c,red); --b:orange;`]
- expected: FAIL
-
- [subtest #22 with `--a: var(--b,orange)var(--c); --c:red;`]
- expected: FAIL
-
- [subtest #24 with `--a: var(--b)var(--c); --c:[c\]; --b:('ab`]
- expected: FAIL
-
- [subtest #25 with `--a: '`]
- expected: FAIL
-
- [subtest #26 with `--a: '\\`]
- expected: FAIL
-
- [subtest #27 with `--a: \\`]
- expected: FAIL
-
- [subtest #28 with `--a: "`]
- expected: FAIL
-
- [subtest #29 with `--a: "\\`]
- expected: FAIL
-
- [subtest #30 with `--a: /* abc `]
- expected: FAIL
-
- [subtest #31 with `--a: /* abc *`]
- expected: FAIL
-
- [subtest #32 with `--a: url(http://example.org/`]
- expected: FAIL
-
- [subtest #33 with `--a: url(http://example.org/\\`]
- expected: FAIL
-
- [subtest #34 with `--a: url('http://example.org/`]
- expected: FAIL
-
- [subtest #35 with `--a: url('http://example.org/\\`]
- expected: FAIL
-
- [subtest #36 with `--a: url("http://example.org/`]
- expected: FAIL
-
- [subtest #37 with `--a: url("http://example.org/\\`]
- expected: FAIL
-