Commit 15fc1f42 authored by timloh@chromium.org's avatar timloh@chromium.org

Remove some testing of getPropertyCSSValue in fast/css/getComputedStyle

As getPropertyCSSValue is no longer web-exposed we should stop testing
it so we can delete the interface.

BUG=428595

Review URL: https://codereview.chromium.org/703793002

git-svn-id: svn://svn.chromium.org/blink/trunk@184888 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0972cdbe
...@@ -3,53 +3,38 @@ Test calling getPropertyValue on computed styles for background-position propert ...@@ -3,53 +3,38 @@ Test calling getPropertyValue on computed styles for background-position propert
background-position: 0; background-position: 0;
background-position background-position
getPropertyValue: 0px 50% getPropertyValue: 0px 50%
getPropertyCSSValue: [object CSSValueList]
background-position-x background-position-x
getPropertyValue: 0px getPropertyValue: 0px
getPropertyCSSValue: [object CSSValueList]
background-position-y background-position-y
getPropertyValue: 50% getPropertyValue: 50%
getPropertyCSSValue: [object CSSValueList]
background-position: 0 0; background-position: 0 0;
background-position background-position
getPropertyValue: 0px 0px getPropertyValue: 0px 0px
getPropertyCSSValue: [object CSSValueList]
background-position-x background-position-x
getPropertyValue: 0px getPropertyValue: 0px
getPropertyCSSValue: [object CSSValueList]
background-position-y background-position-y
getPropertyValue: 0px getPropertyValue: 0px
getPropertyCSSValue: [object CSSValueList]
background-position: 15px; background-position: 15px;
background-position background-position
getPropertyValue: 15px 50% getPropertyValue: 15px 50%
getPropertyCSSValue: [object CSSValueList]
background-position-x background-position-x
getPropertyValue: 15px getPropertyValue: 15px
getPropertyCSSValue: [object CSSValueList]
background-position-y background-position-y
getPropertyValue: 50% getPropertyValue: 50%
getPropertyCSSValue: [object CSSValueList]
background-position: 10px 20px; background-position: 10px 20px;
background-position background-position
getPropertyValue: 10px 20px getPropertyValue: 10px 20px
getPropertyCSSValue: [object CSSValueList]
background-position-x background-position-x
getPropertyValue: 10px getPropertyValue: 10px
getPropertyCSSValue: [object CSSValueList]
background-position-y background-position-y
getPropertyValue: 20px getPropertyValue: 20px
getPropertyCSSValue: [object CSSValueList]
No background-position set No background-position set
background-position background-position
getPropertyValue: 0% 0% getPropertyValue: 0% 0%
getPropertyCSSValue: [object CSSValueList]
background-position-x background-position-x
getPropertyValue: 0% getPropertyValue: 0%
getPropertyCSSValue: [object CSSValueList]
background-position-y background-position-y
getPropertyValue: 0% getPropertyValue: 0%
getPropertyCSSValue: [object CSSValueList]
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
{ {
log(' ' + prop); log(' ' + prop);
log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log(' getPropertyCSSValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
} }
function test(id, single, pair) function test(id, single, pair)
......
Test calling getPropertyValue on computed styles for -webkit-backround-size properties. Test calling getPropertyValue on computed styles for -webkit-backround-size properties.
getPropertyValue(-webkit-background-size): 10px 20px getPropertyValue(-webkit-background-size): 10px 20px
getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
getPropertyValue(-webkit-background-size): 10px 10px getPropertyValue(-webkit-background-size): 10px 10px
getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
Test getting background size of 0. Test getting background size of 0.
getPropertyValue(-webkit-background-size): 0px 0px getPropertyValue(-webkit-background-size): 0px 0px
getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
getPropertyValue(-webkit-background-size): 0px 0px getPropertyValue(-webkit-background-size): 0px 0px
getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
Test getting initial value of the background size. Test getting initial value of the background size.
getPropertyValue(-webkit-background-size): auto getPropertyValue(-webkit-background-size): auto
getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
{ {
var ob = document.getElementById(id + 'Pair'); var ob = document.getElementById(id + 'Pair');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
ob = document.getElementById(id + 'Single'); ob = document.getElementById(id + 'Single');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
} }
function runTests() function runTests()
...@@ -40,7 +38,6 @@ ...@@ -40,7 +38,6 @@
log('Test getting initial value of the background size.') log('Test getting initial value of the background size.')
var ob = document.getElementById('sizeInit'); var ob = document.getElementById('sizeInit');
log('getPropertyValue(-webkit-background-size): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue('-webkit-background-size')); log('getPropertyValue(-webkit-background-size): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue('-webkit-background-size'));
log('getPropertyCSSValue(-webkit-background-size): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue('-webkit-background-size'));
} }
</script> </script>
</head> </head>
......
...@@ -3,25 +3,20 @@ Test calling getPropertyValue on computed styles for -webkit-border-image proper ...@@ -3,25 +3,20 @@ Test calling getPropertyValue on computed styles for -webkit-border-image proper
-webkit-border-image: none; -webkit-border-image: none;
-webkit-border-image -webkit-border-image
getPropertyValue: none getPropertyValue: none
getPropertyCSSValue: [object CSSPrimitiveValue]
-webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 stretch stretch; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 stretch stretch;
-webkit-border-image -webkit-border-image
getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 1 / 0px stretch getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 1 / 0px stretch
getPropertyCSSValue: [object CSSValueList]
-webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 50 repeat; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 50 repeat;
-webkit-border-image -webkit-border-image
getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 1 / 0px repeat getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 1 / 0px repeat
getPropertyCSSValue: [object CSSValueList]
-webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 / 20 20 20 20 repeat; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 / 20 20 20 20 repeat;
-webkit-border-image -webkit-border-image
getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 20 / 0px repeat getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 20 / 0px repeat
getPropertyCSSValue: [object CSSValueList]
-webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 50 / 20 stretch stretch; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 50 / 20 stretch stretch;
-webkit-border-image -webkit-border-image
getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 20 / 0px stretch getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 20 / 0px stretch
getPropertyCSSValue: [object CSSValueList]
...@@ -4,47 +4,26 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ...@@ -4,47 +4,26 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS computedStyle.getPropertyValue('border-image-slice') is '10' PASS computedStyle.getPropertyValue('border-image-slice') is '10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10'
PASS computedStyle.getPropertyValue('border-image-slice') is '30%' PASS computedStyle.getPropertyValue('border-image-slice') is '30%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30%'
PASS computedStyle.getPropertyValue('border-image-slice') is '10' PASS computedStyle.getPropertyValue('border-image-slice') is '10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10'
PASS computedStyle.getPropertyValue('border-image-slice') is '10 30%' PASS computedStyle.getPropertyValue('border-image-slice') is '10 30%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10 30%'
PASS computedStyle.getPropertyValue('border-image-slice') is '30%' PASS computedStyle.getPropertyValue('border-image-slice') is '30%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30%'
PASS computedStyle.getPropertyValue('border-image-slice') is '10' PASS computedStyle.getPropertyValue('border-image-slice') is '10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10'
PASS computedStyle.getPropertyValue('border-image-slice') is '30% 10 10' PASS computedStyle.getPropertyValue('border-image-slice') is '30% 10 10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30% 10 10'
PASS computedStyle.getPropertyValue('border-image-slice') is '10 30%' PASS computedStyle.getPropertyValue('border-image-slice') is '10 30%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10 30%'
PASS computedStyle.getPropertyValue('border-image-slice') is '30% 30% 30% 10' PASS computedStyle.getPropertyValue('border-image-slice') is '30% 30% 30% 10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30% 30% 30% 10'
PASS computedStyle.getPropertyValue('border-image-slice') is '10' PASS computedStyle.getPropertyValue('border-image-slice') is '10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10'
PASS computedStyle.getPropertyValue('border-image-slice') is '30% 30% 30% 10' PASS computedStyle.getPropertyValue('border-image-slice') is '30% 30% 30% 10'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30% 30% 30% 10'
PASS computedStyle.getPropertyValue('border-image-slice') is '30%' PASS computedStyle.getPropertyValue('border-image-slice') is '30%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30%'
PASS computedStyle.getPropertyValue('border-image-slice') is '30% fill' PASS computedStyle.getPropertyValue('border-image-slice') is '30% fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30% fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '10 fill' PASS computedStyle.getPropertyValue('border-image-slice') is '10 fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10 fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '2 4 8% 16% fill' PASS computedStyle.getPropertyValue('border-image-slice') is '2 4 8% 16% fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '2 4 8% 16% fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '30% fill' PASS computedStyle.getPropertyValue('border-image-slice') is '30% fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '30% fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '10 fill' PASS computedStyle.getPropertyValue('border-image-slice') is '10 fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '10 fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '2 4 8% 16% fill' PASS computedStyle.getPropertyValue('border-image-slice') is '2 4 8% 16% fill'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '2 4 8% 16% fill'
PASS computedStyle.getPropertyValue('border-image-slice') is '100%' PASS computedStyle.getPropertyValue('border-image-slice') is '100%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '100%'
PASS computedStyle.getPropertyValue('border-image-slice') is '100%' PASS computedStyle.getPropertyValue('border-image-slice') is '100%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '100%'
PASS computedStyle.getPropertyValue('border-image-slice') is '100%' PASS computedStyle.getPropertyValue('border-image-slice') is '100%'
PASS computedStyle.getPropertyCSSValue('border-image-slice').cssText is '100%'
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -25,7 +25,6 @@ for (i = 0; i < testValues.length; i++) { ...@@ -25,7 +25,6 @@ for (i = 0; i < testValues.length; i++) {
e.style.borderImageSlice = ""; e.style.borderImageSlice = "";
e.style.borderImageSlice = testValues[i]; e.style.borderImageSlice = testValues[i];
shouldBe("computedStyle.getPropertyValue('border-image-slice')", expectedValues[i]); shouldBe("computedStyle.getPropertyValue('border-image-slice')", expectedValues[i]);
shouldBe("computedStyle.getPropertyCSSValue('border-image-slice').cssText", expectedValues[i]);
} }
document.body.removeChild(testContainer); document.body.removeChild(testContainer);
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
{ {
log(' ' + prop); log(' ' + prop);
log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log(' getPropertyCSSValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
} }
function test(id, val) function test(id, val)
......
Test calling getPropertyValue on computed styles for -webkit-backround-size properties. Test calling getPropertyValue on computed styles for -webkit-backround-size properties.
getPropertyValue(border-spacing): 10px 20px getPropertyValue(border-spacing): 10px 20px
getPropertyCSSValue(border-spacing): [object CSSValueList]
getPropertyValue(border-spacing): 10px 10px getPropertyValue(border-spacing): 10px 10px
getPropertyCSSValue(border-spacing): [object CSSValueList]
Test getting border-spacing of 0. Test getting border-spacing of 0.
getPropertyValue(border-spacing): 0px 0px getPropertyValue(border-spacing): 0px 0px
getPropertyCSSValue(border-spacing): [object CSSValueList]
getPropertyValue(border-spacing): 0px 0px getPropertyValue(border-spacing): 0px 0px
getPropertyCSSValue(border-spacing): [object CSSValueList]
Test getting initial value of the background size. Test getting initial value of the background size.
getPropertyValue(border-spacing): 0px 0px getPropertyValue(border-spacing): 0px 0px
getPropertyCSSValue(border-spacing): [object CSSValueList]
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
{ {
var ob = document.getElementById(id + 'Pair'); var ob = document.getElementById(id + 'Pair');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
ob = document.getElementById(id + 'Single'); ob = document.getElementById(id + 'Single');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
} }
function runTests() function runTests()
...@@ -40,7 +38,6 @@ ...@@ -40,7 +38,6 @@
log('Test getting initial value of the background size.') log('Test getting initial value of the background size.')
var ob = document.getElementById('spacingInit'); var ob = document.getElementById('spacingInit');
log('getPropertyValue(border-spacing): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue('border-spacing')); log('getPropertyValue(border-spacing): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue('border-spacing'));
log('getPropertyCSSValue(border-spacing): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue('border-spacing'));
} }
</script> </script>
</head> </head>
......
Test calling getPropertyValue on computed styles for border radius properties. Test calling getPropertyValue on computed styles for border radius properties.
getPropertyValue(-webkit-border-top-right-radius): 10px 20px getPropertyValue(-webkit-border-top-right-radius): 10px 20px
getPropertyCSSValue(-webkit-border-top-right-radius): [object CSSValueList]
getPropertyValue(-webkit-border-top-right-radius): 10px getPropertyValue(-webkit-border-top-right-radius): 10px
getPropertyCSSValue(-webkit-border-top-right-radius): [object CSSPrimitiveValue]
getPropertyValue(-webkit-border-top-left-radius): 10px 20px getPropertyValue(-webkit-border-top-left-radius): 10px 20px
getPropertyCSSValue(-webkit-border-top-left-radius): [object CSSValueList]
getPropertyValue(-webkit-border-top-left-radius): 10px getPropertyValue(-webkit-border-top-left-radius): 10px
getPropertyCSSValue(-webkit-border-top-left-radius): [object CSSPrimitiveValue]
getPropertyValue(-webkit-border-bottom-right-radius): 10px 20px getPropertyValue(-webkit-border-bottom-right-radius): 10px 20px
getPropertyCSSValue(-webkit-border-bottom-right-radius): [object CSSValueList]
getPropertyValue(-webkit-border-bottom-right-radius): 10px getPropertyValue(-webkit-border-bottom-right-radius): 10px
getPropertyCSSValue(-webkit-border-bottom-right-radius): [object CSSPrimitiveValue]
getPropertyValue(-webkit-border-bottom-left-radius): 10px 20px getPropertyValue(-webkit-border-bottom-left-radius): 10px 20px
getPropertyCSSValue(-webkit-border-bottom-left-radius): [object CSSValueList]
getPropertyValue(-webkit-border-bottom-left-radius): 10px getPropertyValue(-webkit-border-bottom-left-radius): 10px
getPropertyCSSValue(-webkit-border-bottom-left-radius): [object CSSPrimitiveValue]
Test getting 0px value border radius. Test getting 0px value border radius.
getPropertyValue(-webkit-border-top-left-radius): 0px getPropertyValue(-webkit-border-top-left-radius): 0px
getPropertyCSSValue(-webkit-border-top-left-radius): [object CSSPrimitiveValue]
getPropertyValue(-webkit-border-top-left-radius): 0px getPropertyValue(-webkit-border-top-left-radius): 0px
getPropertyCSSValue(-webkit-border-top-left-radius): [object CSSPrimitiveValue]
...@@ -22,10 +22,8 @@ ...@@ -22,10 +22,8 @@
{ {
var ob = document.getElementById(id + 'Diff'); var ob = document.getElementById(id + 'Diff');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
ob = document.getElementById(id + 'Same'); ob = document.getElementById(id + 'Same');
log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop)); log('getPropertyValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log('getPropertyCSSValue(' + prop + '): ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
} }
function runTests() function runTests()
......
...@@ -4,7 +4,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ...@@ -4,7 +4,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS computedStyle.getPropertyValue('outline-offset') is '2px' PASS computedStyle.getPropertyValue('outline-offset') is '2px'
PASS computedStyle.getPropertyCSSValue('outline-offset').getFloatValue(CSSPrimitiveValue.CSS_PX) is 2
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -20,7 +20,6 @@ e.contentEditable = true; ...@@ -20,7 +20,6 @@ e.contentEditable = true;
e.style.outlineOffset = "2px"; e.style.outlineOffset = "2px";
computedStyle = window.getComputedStyle(e); computedStyle = window.getComputedStyle(e);
shouldBe("computedStyle.getPropertyValue('outline-offset')", "'2px'"); shouldBe("computedStyle.getPropertyValue('outline-offset')", "'2px'");
shouldBe("computedStyle.getPropertyCSSValue('outline-offset').getFloatValue(CSSPrimitiveValue.CSS_PX)", "2");
document.body.removeChild(testContainer); document.body.removeChild(testContainer);
......
...@@ -4,76 +4,40 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ...@@ -4,76 +4,40 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Initial value: Initial value:
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none solid rgb(0, 0, 0)'
Initial value (explicit): Initial value (explicit):
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none solid rgb(0, 0, 0)'
Value 'none': Value 'none':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none solid rgb(0, 0, 0)'
Value 'underline': Value 'underline':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline solid rgb(0, 0, 0)'
Value 'overline': Value 'overline':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'overline solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'overline solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'overline solid rgb(0, 0, 0)'
Value 'line-through': Value 'line-through':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'line-through solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'line-through solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'line-through solid rgb(0, 0, 0)'
Value 'underline overline line-through': Value 'underline overline line-through':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'underline overline line-through solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'underline overline line-through solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline overline line-through solid rgb(0, 0, 0)'
Value 'blink' (valid but ignored): Value 'blink' (valid but ignored):
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none solid rgb(0, 0, 0)'
Value '': Value '':
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'none solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'none solid rgb(0, 0, 0)'
Parent gets 'underline' value: Parent gets 'underline' value:
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline solid rgb(0, 0, 0)'
Ancestor should explicitly inherit value from parent when 'inherit' value is used: Ancestor should explicitly inherit value from parent when 'inherit' value is used:
PASS e.style.getPropertyCSSValue('text-decoration') is null
PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)' PASS computedStyle.textDecoration is 'underline solid rgb(0, 0, 0)'
PASS computedStyle.getPropertyCSSValue('text-decoration').toString() is '[object CSSValueList]'
PASS computedStyle.getPropertyCSSValue('text-decoration').cssText is 'underline solid rgb(0, 0, 0)'
Ancestor should not implicitly inherit value from parent (i.e. when value is void): Ancestor should not implicitly inherit value from parent (i.e. when value is void):
PASS e.style.getPropertyCSSValue('text-decoration') is null
FAIL computedStyle.textDecoration should be none. Was none solid rgb(0, 0, 0). FAIL computedStyle.textDecoration should be none. Was none solid rgb(0, 0, 0).
FAIL computedStyle.getPropertyCSSValue('text-decoration').toString() should be [object CSSPrimitiveValue]. Was [object CSSValueList].
FAIL computedStyle.getPropertyCSSValue('text-decoration').cssText should be none. Was none solid rgb(0, 0, 0).
PASS successfullyParsed is true PASS successfullyParsed is true
......
function testElementStyle(propertyJS, propertyCSS, type, value) function testComputedStyle(propertyJS, value)
{
if (type != null) {
shouldBe("e.style." + propertyJS, "'" + value + "'");
shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
} else
shouldBeNull("e.style.getPropertyCSSValue('" + propertyCSS + "')");
}
function testComputedStyle(propertyJS, propertyCSS, type, value)
{ {
computedStyle = window.getComputedStyle(e, null); computedStyle = window.getComputedStyle(e, null);
shouldBe("computedStyle." + propertyJS, "'" + value + "'"); shouldBe("computedStyle." + propertyJS, "'" + value + "'");
shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
} }
description("Test to make sure text-decoration property returns values properly.") description("Test to make sure text-decoration property returns values properly.")
...@@ -25,75 +13,63 @@ document.body.appendChild(testContainer); ...@@ -25,75 +13,63 @@ document.body.appendChild(testContainer);
testContainer.innerHTML = '<div id="test">hello world</div>'; testContainer.innerHTML = '<div id="test">hello world</div>';
debug("Initial value:"); debug("Initial value:");
e = document.getElementById('test'); e = document.getElementById('test');
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Initial value (explicit):"); debug("Initial value (explicit):");
e.style.textDecoration = 'initial'; e.style.textDecoration = 'initial';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'none':"); debug("Value 'none':");
e.style.textDecoration = 'none'; e.style.textDecoration = 'none';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'underline':"); debug("Value 'underline':");
e.style.textDecoration = 'underline'; e.style.textDecoration = 'underline';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'overline':"); debug("Value 'overline':");
e.style.textDecoration = 'overline'; e.style.textDecoration = 'overline';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "overline solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "overline solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'line-through':"); debug("Value 'line-through':");
e.style.textDecoration = 'line-through'; e.style.textDecoration = 'line-through';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "line-through solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "line-through solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'underline overline line-through':"); debug("Value 'underline overline line-through':");
e.style.textDecoration = 'underline overline line-through'; e.style.textDecoration = 'underline overline line-through';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "underline overline line-through solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline overline line-through solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value 'blink' (valid but ignored):"); debug("Value 'blink' (valid but ignored):");
e.style.textDecoration = 'blink'; e.style.textDecoration = 'blink';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Value '':"); debug("Value '':");
e.style.textDecoration = ''; e.style.textDecoration = '';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)");
debug(''); debug('');
testContainer.innerHTML = '<div id="test-parent" style="text-decoration: underline;">hello <span id="test-ancestor" style="text-decoration: inherit;">world</span></div>'; testContainer.innerHTML = '<div id="test-parent" style="text-decoration: underline;">hello <span id="test-ancestor" style="text-decoration: inherit;">world</span></div>';
debug("Parent gets 'underline' value:"); debug("Parent gets 'underline' value:");
e = document.getElementById('test-parent'); e = document.getElementById('test-parent');
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Ancestor should explicitly inherit value from parent when 'inherit' value is used:"); debug("Ancestor should explicitly inherit value from parent when 'inherit' value is used:");
e = document.getElementById('test-ancestor'); e = document.getElementById('test-ancestor');
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)");
testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)");
debug(''); debug('');
debug("Ancestor should not implicitly inherit value from parent (i.e. when value is void):"); debug("Ancestor should not implicitly inherit value from parent (i.e. when value is void):");
e.style.textDecoration = ''; e.style.textDecoration = '';
testElementStyle("textDecoration", "text-decoration", null, ''); testComputedStyle("textDecoration", "none");
testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none");
debug(''); debug('');
document.body.removeChild(testContainer); document.body.removeChild(testContainer);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment