Commit 8cea92a4 authored by timloh@chromium.org's avatar timloh@chromium.org

Continue removing testing of getPropertyCSSValue

As getPropertyCSSValue is no longer web-exposed, we should stop testing
it so we can delete the interface. Instead of using getPropertyCSSValue
and calling cssText on the returned value, we can use getPropertyValue
or the direct accessors.

BUG=428595

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184988 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent de260be7
......@@ -3,7 +3,7 @@ This test checks that content-editable is not propagated from shadow host to a s
This p is required to produce the issue.
This div and parent div are required to produce the issue.
PASS computedStyle(nodeInShadowRoot1, userModifyPropertyName) is "read-only"
PASS getComputedStyle(nodeInShadowRoot1).webkitUserModify is "read-only"
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -17,15 +17,6 @@
if (window.testRunner)
testRunner.dumpAsText();
function computedStyle(element, style) {
var cs = window.getComputedStyle(element);
if (!cs)
return '(NA)';
if (cs.getPropertyCSSValue(style))
return cs.getPropertyCSSValue(style).cssText;
return undefined;
}
function prepareNodeInShadowRoot(host) {
var shadowRoot = host.createShadowRoot();
var nodeInShadow = document.createElement('div');
......@@ -38,8 +29,7 @@ function prepareNodeInShadowRoot(host) {
document.body.offsetLeft;
var nodeInShadowRoot1 = prepareNodeInShadowRoot(document.getElementById('host1'));
var userModifyPropertyName = '-webkit-user-modify';
shouldBeEqualToString('computedStyle(nodeInShadowRoot1, userModifyPropertyName)', 'read-only');
shouldBeEqualToString('getComputedStyle(nodeInShadowRoot1).webkitUserModify', 'read-only');
var successfullyParsed = true;
</script>
......
Test for WebKit bug 18294 : Strange Result for getComputedStyle on borderWidth set in em
PASS computedStyle.getPropertyValue('border-width') is '12000px 11000px 10000px 9010px'
PASS computedStyle.getPropertyCSSValue('border-top-width').cssText is '12000px'
PASS computedStyle.getPropertyCSSValue('border-right-width').cssText is '11000px'
PASS computedStyle.getPropertyCSSValue('border-bottom-width').cssText is '10000px'
PASS computedStyle.getPropertyCSSValue('border-left-width').cssText is '9010px'
PASS computedStyle.borderTopWidth is '12000px'
PASS computedStyle.borderRightWidth is '11000px'
PASS computedStyle.borderBottomWidth is '10000px'
PASS computedStyle.borderLeftWidth is '9010px'
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -20,10 +20,10 @@
test.style.borderWidth = "120em 110em 100em 90.1em";
var computedStyle = window.getComputedStyle(test, null);
shouldBe("computedStyle.getPropertyValue('border-width')", "'12000px 11000px 10000px 9010px'");
shouldBe("computedStyle.getPropertyCSSValue('border-top-width').cssText","'12000px'");
shouldBe("computedStyle.getPropertyCSSValue('border-right-width').cssText","'11000px'");
shouldBe("computedStyle.getPropertyCSSValue('border-bottom-width').cssText","'10000px'");
shouldBe("computedStyle.getPropertyCSSValue('border-left-width').cssText","'9010px'");
shouldBe("computedStyle.borderTopWidth","'12000px'");
shouldBe("computedStyle.borderRightWidth","'11000px'");
shouldBe("computedStyle.borderBottomWidth","'10000px'");
shouldBe("computedStyle.borderLeftWidth","'9010px'");
// clean up after ourselves
var tests_container = document.getElementById("tests_container");
tests_container.parentNode.removeChild(tests_container);
......
......@@ -31,34 +31,6 @@ PASS computedFont('10px/100% sans-serif') is 'normal normal normal normal 10px/1
PASS computedFont('10px/100px sans-serif') is 'normal normal normal normal 10px/100px sans-serif'
PASS computedFont('10px/normal sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFont('10px/normal sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('10px sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('10px sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('10px SANS-SERIF') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('12px sans-serif') is 'normal normal normal normal 12px/normal sans-serif'
PASS computedFontCSSValue('12px sans-serif') is 'normal normal normal normal 12px/normal sans-serif'
PASS computedFontCSSValue('10px sans-serif, sans-serif') is 'normal normal normal normal 10px/normal sans-serif, sans-serif'
PASS computedFontCSSValue('10px sans-serif, serif') is 'normal normal normal normal 10px/normal sans-serif, serif'
PASS computedFontCSSValue('12px ahem') is 'normal normal normal normal 12px/normal ahem'
PASS computedFontCSSValue('12px unlikely-font-name') is 'normal normal normal normal 12px/normal unlikely-font-name'
PASS computedFontCSSValue('100 10px sans-serif') is 'normal normal 100 normal 10px/normal sans-serif'
PASS computedFontCSSValue('200 10px sans-serif') is 'normal normal 200 normal 10px/normal sans-serif'
PASS computedFontCSSValue('300 10px sans-serif') is 'normal normal 300 normal 10px/normal sans-serif'
PASS computedFontCSSValue('400 10px sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('normal 10px sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('500 10px sans-serif') is 'normal normal 500 normal 10px/normal sans-serif'
PASS computedFontCSSValue('600 10px sans-serif') is 'normal normal 600 normal 10px/normal sans-serif'
PASS computedFontCSSValue('700 10px sans-serif') is 'normal normal bold normal 10px/normal sans-serif'
PASS computedFontCSSValue('bold 10px sans-serif') is 'normal normal bold normal 10px/normal sans-serif'
PASS computedFontCSSValue('800 10px sans-serif') is 'normal normal 800 normal 10px/normal sans-serif'
PASS computedFontCSSValue('900 10px sans-serif') is 'normal normal 900 normal 10px/normal sans-serif'
PASS computedFontCSSValue('italic 10px sans-serif') is 'italic normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('small-caps 10px sans-serif') is 'normal small-caps normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('italic small-caps 10px sans-serif') is 'italic small-caps normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('italic small-caps bold 10px sans-serif') is 'italic small-caps bold normal 10px/normal sans-serif'
PASS computedFontCSSValue('10px/100% sans-serif') is 'normal normal normal normal 10px/10px sans-serif'
PASS computedFontCSSValue('10px/100px sans-serif') is 'normal normal normal normal 10px/100px sans-serif'
PASS computedFontCSSValue('10px/normal sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS computedFontCSSValue('10px/normal sans-serif') is 'normal normal normal normal 10px/normal sans-serif'
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -3,8 +3,8 @@ Test that page-break-inside property is not inherited
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS window.getComputedStyle(parent).getPropertyCSSValue('page-break-inside').getStringValue() is "avoid"
PASS window.getComputedStyle(child).getPropertyCSSValue('page-break-inside').getStringValue() is "auto"
PASS window.getComputedStyle(parent).pageBreakInside is "avoid"
PASS window.getComputedStyle(child).pageBreakInside is "auto"
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -9,15 +9,6 @@ function computedFont(fontString) {
return window.getComputedStyle(testDiv).getPropertyValue('font');
}
function computedFontCSSValue(fontString) {
testDiv.style.font = 'bold 600px serif';
testDiv.style.font = fontString;
var cssValue = window.getComputedStyle(testDiv).getPropertyCSSValue('font');
if (cssValue === null)
return null;
return cssValue.cssText;
}
shouldBe("computedFont('10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFont('10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFont('10px SANS-SERIF')", "'normal normal normal normal 10px/normal sans-serif'");
......@@ -46,32 +37,3 @@ shouldBe("computedFont('10px/100% sans-serif')", "'normal normal normal normal 1
shouldBe("computedFont('10px/100px sans-serif')", "'normal normal normal normal 10px/100px sans-serif'");
shouldBe("computedFont('10px/normal sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFont('10px/normal sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px SANS-SERIF')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('12px sans-serif')", "'normal normal normal normal 12px/normal sans-serif'");
shouldBe("computedFontCSSValue('12px sans-serif')", "'normal normal normal normal 12px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px sans-serif, sans-serif')", "'normal normal normal normal 10px/normal sans-serif, sans-serif'");
shouldBe("computedFontCSSValue('10px sans-serif, serif')", "'normal normal normal normal 10px/normal sans-serif, serif'");
shouldBe("computedFontCSSValue('12px ahem')", "'normal normal normal normal 12px/normal ahem'");
shouldBe("computedFontCSSValue('12px unlikely-font-name')", "'normal normal normal normal 12px/normal unlikely-font-name'");
shouldBe("computedFontCSSValue('100 10px sans-serif')", "'normal normal 100 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('200 10px sans-serif')", "'normal normal 200 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('300 10px sans-serif')", "'normal normal 300 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('400 10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('normal 10px sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('500 10px sans-serif')", "'normal normal 500 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('600 10px sans-serif')", "'normal normal 600 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('700 10px sans-serif')", "'normal normal bold normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('bold 10px sans-serif')", "'normal normal bold normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('800 10px sans-serif')", "'normal normal 800 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('900 10px sans-serif')", "'normal normal 900 normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('italic 10px sans-serif')", "'italic normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('small-caps 10px sans-serif')", "'normal small-caps normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('italic small-caps 10px sans-serif')", "'italic small-caps normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('italic small-caps bold 10px sans-serif')", "'italic small-caps bold normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px/100% sans-serif')", "'normal normal normal normal 10px/10px sans-serif'");
shouldBe("computedFontCSSValue('10px/100px sans-serif')", "'normal normal normal normal 10px/100px sans-serif'");
shouldBe("computedFontCSSValue('10px/normal sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
shouldBe("computedFontCSSValue('10px/normal sans-serif')", "'normal normal normal normal 10px/normal sans-serif'");
......@@ -7,7 +7,7 @@ var child = document.createElement("div");
parent.appendChild(child);
document.body.appendChild(parent);
shouldBe("window.getComputedStyle(parent).getPropertyCSSValue('page-break-inside').getStringValue()", '"avoid"');
shouldBe("window.getComputedStyle(child).getPropertyCSSValue('page-break-inside').getStringValue()", '"auto"');
shouldBe("window.getComputedStyle(parent).pageBreakInside", '"avoid"');
shouldBe("window.getComputedStyle(child).pageBreakInside", '"auto"');
document.body.removeChild(parent);
PASS test('test1a', 'margin-left') is "0px"
PASS test('test1b', 'margin-left') is "0px"
PASS test('test2a', 'margin-left') is "5px"
PASS test('test2b', 'margin-left') is "5px"
PASS test('test3a', 'margin-left') is "10px"
PASS test('test3b', 'margin-left') is "10px"
PASS test('test1a') is "0px"
PASS test('test1b') is "0px"
PASS test('test2a') is "5px"
PASS test('test2b') is "5px"
PASS test('test3a') is "10px"
PASS test('test3b') is "10px"
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -38,13 +38,12 @@ Test that the matched declaration cache handles explicitly inherited properties
<script>
function test(e, p) {
var testDiv = document.getElementById(e);
var cssValue = window.getComputedStyle(testDiv).getPropertyCSSValue(p);
return cssValue.cssText;
return getComputedStyle(testDiv).marginLeft;
}
shouldBeEqualToString("test('test1a', 'margin-left')", "0px");
shouldBeEqualToString("test('test1b', 'margin-left')", "0px");
shouldBeEqualToString("test('test2a', 'margin-left')", "5px");
shouldBeEqualToString("test('test2b', 'margin-left')", "5px");
shouldBeEqualToString("test('test3a', 'margin-left')", "10px");
shouldBeEqualToString("test('test3b', 'margin-left')", "10px");
shouldBeEqualToString("test('test1a')", "0px");
shouldBeEqualToString("test('test1b')", "0px");
shouldBeEqualToString("test('test2a')", "5px");
shouldBeEqualToString("test('test2b')", "5px");
shouldBeEqualToString("test('test3a')", "10px");
shouldBeEqualToString("test('test3b')", "10px");
</script>
......@@ -12,8 +12,8 @@ if (window.testRunner)
<script>
function test(e, p) {
var testDiv = document.getElementById(e);
var cssValue = window.getComputedStyle(testDiv).getPropertyCSSValue(p);
document.write(e + " " + p + ": " + cssValue.cssText + "<br>");
var value = window.getComputedStyle(testDiv).getPropertyValue(p);
document.write(e + " " + p + ": " + value + "<br>");
}
test('test1', '-webkit-font-feature-settings');
......@@ -22,4 +22,4 @@ test('test1', '-webkit-font-smoothing');
test('test2', '-webkit-font-smoothing');
test('test1', '-webkit-text-orientation');
test('test2', '-webkit-text-orientation');
</script>
\ No newline at end of file
</script>
......@@ -20,8 +20,8 @@
var output = document.getElementById('output');
var rule = document.styleSheets[0].cssRules[0];
output.innerHTML += rule.style.getPropertyCSSValue('border-top-left-radius').cssText + "<br>";
output.innerHTML += rule.style.getPropertyCSSValue('border-top-right-radius').cssText;
output.innerHTML += rule.style.borderTopLeftRadius + "<br>";
output.innerHTML += rule.style.borderTopRightRadius;
</script>
</body>
</html>
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