Index: LayoutTests/fast/css/getComputedStyle/script-tests/getComputedStyle-text-decoration.js |
diff --git a/LayoutTests/fast/css/getComputedStyle/script-tests/getComputedStyle-text-decoration.js b/LayoutTests/fast/css/getComputedStyle/script-tests/getComputedStyle-text-decoration.js |
index 7635d28d40f04f1d4902e1e06d50f2f3e4cd6d3f..36bd93ddd8ae2070c310ff4dc582ed32b4fac2cf 100644 |
--- a/LayoutTests/fast/css/getComputedStyle/script-tests/getComputedStyle-text-decoration.js |
+++ b/LayoutTests/fast/css/getComputedStyle/script-tests/getComputedStyle-text-decoration.js |
@@ -1,19 +1,7 @@ |
-function testElementStyle(propertyJS, propertyCSS, type, 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) |
+function testComputedStyle(propertyJS, value) |
{ |
computedStyle = window.getComputedStyle(e, null); |
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.") |
@@ -25,75 +13,63 @@ document.body.appendChild(testContainer); |
testContainer.innerHTML = '<div id="test">hello world</div>'; |
debug("Initial value:"); |
e = document.getElementById('test'); |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)"); |
debug(''); |
debug("Initial value (explicit):"); |
e.style.textDecoration = 'initial'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'none':"); |
e.style.textDecoration = 'none'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'underline':"); |
e.style.textDecoration = 'underline'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'overline':"); |
e.style.textDecoration = 'overline'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "overline solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "overline solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'line-through':"); |
e.style.textDecoration = 'line-through'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "line-through solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "line-through solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'underline overline line-through':"); |
e.style.textDecoration = 'underline overline line-through'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline overline line-through solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "underline overline line-through solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value 'blink' (valid but ignored):"); |
e.style.textDecoration = 'blink'; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)"); |
debug(''); |
debug("Value '':"); |
e.style.textDecoration = ''; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "none solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "none solid rgb(0, 0, 0)"); |
debug(''); |
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:"); |
e = document.getElementById('test-parent'); |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)"); |
debug(''); |
debug("Ancestor should explicitly inherit value from parent when 'inherit' value is used:"); |
e = document.getElementById('test-ancestor'); |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSValueList]", "underline solid rgb(0, 0, 0)"); |
+testComputedStyle("textDecoration", "underline solid rgb(0, 0, 0)"); |
debug(''); |
debug("Ancestor should not implicitly inherit value from parent (i.e. when value is void):"); |
e.style.textDecoration = ''; |
-testElementStyle("textDecoration", "text-decoration", null, ''); |
-testComputedStyle("textDecoration", "text-decoration", "[object CSSPrimitiveValue]", "none"); |
+testComputedStyle("textDecoration", "none"); |
debug(''); |
document.body.removeChild(testContainer); |