From 37d8ee9037deb78c70be2d1af05f6428d5f94720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 27 Mar 2017 03:54:27 +0200 Subject: [PATCH] style: Test a few more properties, and update expectations. --- .../metadata/cssom/serialize-values.html.ini | 8 -------- tests/wpt/mozilla/meta/mozilla/calc.html.ini | 13 +----------- tests/wpt/mozilla/tests/mozilla/calc.html | 20 ++++++++++++++----- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/tests/wpt/metadata/cssom/serialize-values.html.ini b/tests/wpt/metadata/cssom/serialize-values.html.ini index 6fe7f6507d9..07880ae3d38 100644 --- a/tests/wpt/metadata/cssom/serialize-values.html.ini +++ b/tests/wpt/metadata/cssom/serialize-values.html.ini @@ -1,13 +1,5 @@ [serialize-values.html] type: testharness - [border-spacing: 0px] - expected: FAIL - - [border-spacing: 1px] - expected: FAIL - - [border-spacing: .1em] - expected: FAIL [content: url("http://localhost/")] expected: FAIL diff --git a/tests/wpt/mozilla/meta/mozilla/calc.html.ini b/tests/wpt/mozilla/meta/mozilla/calc.html.ini index fdbc5b7b464..d977fc79221 100644 --- a/tests/wpt/mozilla/meta/mozilla/calc.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/calc.html.ini @@ -1,14 +1,3 @@ [calc.html] type: testharness - [calc for border-width] - expected: FAIL - - [calc for column-width] - expected: FAIL - - [calc for column-gap] - expected: FAIL - - [calc for column-count] - expected: FAIL - + prefs: [layout.column-count.enabled:true,layout.column-width.enabled:true,layout.column-gap.enabled:true] diff --git a/tests/wpt/mozilla/tests/mozilla/calc.html b/tests/wpt/mozilla/tests/mozilla/calc.html index 59903490fd4..9826168e24b 100644 --- a/tests/wpt/mozilla/tests/mozilla/calc.html +++ b/tests/wpt/mozilla/tests/mozilla/calc.html @@ -6,6 +6,10 @@ #outer { width: 1000px; } +#inner { + border-style: solid; /* So used border == computed border */ + outline-style: solid; /* So used outline-width == computed outline-width */ +} @@ -76,7 +80,9 @@ var lengthProperties = [ lengthProperties.forEach(function(prop) { test(function() { div.style.setProperty(prop, 'calc(1px)'); - assert_equals(div.style.getPropertyValue(prop), 'calc(1px)'); + assert_equals(div.style.getPropertyValue(prop), 'calc(1px)', div.style.getPropertyValue(prop)); + let computed = getComputedStyle(div).getPropertyValue(prop); + assert_equals(computed, '1px', prop + ': expected 1px, got ' + computed); }, 'calc for ' + prop); }); @@ -112,12 +118,14 @@ var timeProperties = [ timeProperties.forEach(function(prop) { test(function() { div.style.setProperty(prop, 'calc(1s)'); - assert_equals(div.style.getPropertyValue(prop), '1s'); + assert_equals(div.style.getPropertyValue(prop), 'calc(1s)'); + assert_equals(getComputedStyle(div).getPropertyValue(prop), '1s'); }, 'calc for ' + prop); }); var numberProperties = [ 'z-index', + 'order', 'column-count', 'opacity', ]; @@ -126,12 +134,13 @@ numberProperties.forEach(function(prop) { test(function() { div.style.setProperty(prop, 'calc(1)'); assert_equals(div.style.getPropertyValue(prop), 'calc(1)'); + assert_equals(getComputedStyle(div).getPropertyValue(prop), '1'); }, 'calc for ' + prop); }); var otherProperties = [ - ['border-width', 'calc(1px)', '1px 1px 1px 1px'], - ['border-spacing', 'calc(1px)', 'calc(1px) calc(1px)'], + ['border-width', 'calc(1px)', 'calc(1px)'], + ['border-spacing', 'calc(1px)', 'calc(1px)'], ['transform-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50% 0px'], ['perspective-origin', 'calc(1px + 0%)', 'calc(1px + 0%) 50%'], ['background-size', 'calc(1px + 0%)', 'calc(1px + 0%) auto'], @@ -140,6 +149,7 @@ var otherProperties = [ ['border-bottom-left-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'], ['border-top-right-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'], ['border-bottom-right-radius', 'calc(1px + 0%)', 'calc(1px + 0%) calc(1px + 0%)'], + ['counter-increment', 'foo calc(1 + 1)', 'foo calc(2)'], ]; otherProperties.forEach(function(testcase) { @@ -150,7 +160,7 @@ otherProperties.forEach(function(testcase) { }); /* TODO: test these: - counter-increment, counter-reset, + counter-reset, color, box-shadow, clip, text-shadow, transform transition-timing-function angles