Commit 5e40b650 authored by timloh@chromium.org's avatar timloh@chromium.org

Don't require getPropertyCSSValue in fast tests

As getPropertyCSSValue is no longer web-exposed we shouldn't require it
in tests so we can delete the interface.

BUG=428595

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 00a1fc83
......@@ -104,4 +104,4 @@ function runTests() {
<pre id="console">
</pre>
</body>
</html>
\ No newline at end of file
</html>
......@@ -12,8 +12,6 @@ TEST SUCCEEDED: The value was the string 'null'. [tested CSSStyleRule.selectorTe
TEST SUCCEEDED: The value was the empty string. [tested CSSStyleDeclaration.cssText]
TEST SUCCEEDED: The value was the string 'black'. [tested CSSValue.cssText]
TEST SUCCEEDED: The value was the empty string. [tested MediaList.mediaText]
......@@ -60,7 +60,6 @@
var pageRule = rules[3];
var charsetRule = document.styleSheets[2].cssRules[0];
var style = rule.style;
var value = style.getPropertyCSSValue('color');
var mediaList = mediaRule.media;
var listing = [
......@@ -108,15 +107,6 @@
{name: 'cssText', expectedNull: ''}
]
},
{
type: 'CSSValue',
elementToUse: value,
attributes: [
// for now, setting cssText does not doing anything. When it gets implemented, the expectedNull
// should become the empty string.
{name: 'cssText', expectedNull: 'black'}
]
},
{
type: 'MediaList',
elementToUse: mediaList,
......
......@@ -31,7 +31,6 @@ PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty
PASS: document.body.children.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be 1 and is.
PASS: document.body.style.myCustomProperty should be 1 and is.
PASS: document.body.style.getPropertyCSSValue('color').myCustomProperty should be 1 and is.
PASS: document.styleSheets.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules.myCustomProperty should be 1 and is.
......@@ -67,7 +66,6 @@ PASS: document.getElementsByTagName('table')[0].tBodies[0].rows.myCustomProperty
PASS: document.body.children.myCustomProperty should be 1 and is.
PASS: document.getElementsByTagName('map')[0].areas.myCustomProperty should be 1 and is.
FAIL: document.body.style.myCustomProperty should be 1 but instead is undefined.
FAIL: document.body.style.getPropertyCSSValue('color').myCustomProperty should be 1 but instead is undefined.
PASS: document.styleSheets.myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].myCustomProperty should be 1 and is.
PASS: document.styleSheets[0].cssRules.myCustomProperty should be 1 and is.
......
......@@ -143,7 +143,6 @@ var objectsToTest = [
[ "document.getElementsByTagName('map')[0].areas", "allow custom" ],
[ "document.body.style", "allow custom" ],
[ "document.body.style.getPropertyCSSValue('color')", "allow custom" ],
[ "document.styleSheets", "allow custom" ],
[ "document.styleSheets[0]", "allow custom" ],
[ "document.styleSheets[0].cssRules", "allow custom"],
......
......@@ -58,10 +58,6 @@ function test()
cssRule = document.styleSheets[0].cssRules[0];
shouldBe("window.CSSRule.prototype.isPrototypeOf(cssRule)", true);
cssPrimitiveValue = cssRule.style.getPropertyCSSValue("color");
shouldBe("window.CSSValue.prototype.isPrototypeOf(cssPrimitiveValue)", true);
shouldBe("window.CSSPrimitiveValue.prototype.isPrototypeOf(cssPrimitiveValue)", true);
cssStyleDeclaration = cssRule.style;
shouldBe("window.CSSStyleDeclaration.prototype.isPrototypeOf(cssStyleDeclaration)", true);
......
......@@ -19,7 +19,6 @@ PASS nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)') is 'any t
PASS nonNumericPolicy('createCSSStyleSheet().deleteRule(x)') is 'any type allowed (but not omitted)'
PASS nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)') is 'any type allowed'
PASS nonNumericPolicy('createCSSStyleSheet().removeRule(x)') is 'any type allowed'
PASS nonNumericPolicy('createCSSValueList().item(x)') is 'any type allowed (but not omitted)'
PASS nonNumericPolicy('document.elementFromPoint(x, 0)') is 'any type allowed'
PASS nonNumericPolicy('document.elementFromPoint(0, x)') is 'any type allowed'
PASS nonNumericPolicy('document.body.scrollLeft = x') is 'mixed'
......
......@@ -2,9 +2,6 @@ This test checks some DOM object prototypes that WebKit has gotten wrong in the
PASS: Object.prototype.isPrototypeOf(window.DOMException) should be true and is.
PASS: Object.prototype.isPrototypeOf(window.Option) should be true and is.
PASS: Object.prototype.isPrototypeOf(cssValue) should be true and is.
PASS: Object.prototype.isPrototypeOf(rgbColor) should be true and is.
PASS: Object.prototype.isPrototypeOf(rect) should be true and is.
PASS: Object.prototype.isPrototypeOf(styleSheetList) should be true and is.
PASS: Object.prototype.isPrototypeOf(styleSheet) should be true and is.
PASS: Object.prototype.isPrototypeOf(cssRule) should be true and is.
......
......@@ -34,18 +34,6 @@ function test()
shouldBe("Object.prototype.isPrototypeOf(window.DOMException)", true);
shouldBe("Object.prototype.isPrototypeOf(window.Option)", true);
div = document.createElement('div');
div.style.color = "rgb(0, 0, 0)";
cssValue = div.style.getPropertyCSSValue('color'); // actually a CSSPrimitiveValue
shouldBe("Object.prototype.isPrototypeOf(cssValue)", true);
rgbColor = div.style.getPropertyCSSValue('color').getRGBColorValue();
shouldBe("Object.prototype.isPrototypeOf(rgbColor)", true);
div.style.clip = "rect(0, 0, 0, 0)";
rect = div.style.getPropertyCSSValue('clip').getRectValue();
shouldBe("Object.prototype.isPrototypeOf(rect)", true);
styleElement = document.createElement('style');
styleElement.appendChild(document.createTextNode("* {}"));
headElement = document.getElementsByTagName('head')[0];
......
......@@ -133,12 +133,6 @@ function createCSSMediaRule()
return rule;
}
function createCSSValueList()
{
// FIXME: Not working in Firefox, not sure why.
return createFromMarkup("<style>a { font-family: b, c }</style>").sheet.cssRules.item(0).style.getPropertyCSSValue("font-family");
}
function createMediaList()
{
return createCSSMediaRule().media;
......@@ -208,10 +202,6 @@ shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type a
shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)')", "'any type allowed'");
shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type allowed'");
// CSSValueList
shouldBe("nonNumericPolicy('createCSSValueList().item(x)')", "'any type allowed (but not omitted)'");
// Document
shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allowed'");
......
Tests to ensure that a '-webkit-user-modify' CSS porperty is not inherited across shadow boundaries.
Tests to ensure that a '-webkit-user-modify' CSS property is not inherited across shadow boundaries.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false"), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true"), userModifyPropertyName) is "read-write"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName) is "read-write"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null)) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false")) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true")) is "read-write"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null)) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false")) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true")) is "read-write"
PASS getUserModifyProperty("child-a") is "read-write"
PASS getUserModifyProperty("child-b") is "read-write"
PASS getUserModifyProperty("child-c") is "read-only"
......
......@@ -16,21 +16,16 @@
<div id="sandbox2"></div>
<pre id="console"></pre>
<script>
description("Tests to ensure that a '-webkit-user-modify' CSS porperty is not inherited across shadow boundaries.");
description("Tests to ensure that a '-webkit-user-modify' CSS property is not inherited across shadow boundaries.");
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 computedStyle(element) {
return window.getComputedStyle(element).webkitUserModify;
}
function getUserModifyProperty(id) {
return computedStyle(document.getElementById(id), userModifyPropertyName);
return computedStyle(document.getElementById(id));
}
function prepareNodeInShadowRoot(host, contentEditableAttributeValueForNode) {
......@@ -43,14 +38,12 @@ function prepareNodeInShadowRoot(host, contentEditableAttributeValueForNode) {
return nodeInShadow;
}
var userModifyPropertyName = '-webkit-user-modify';
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false"), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true"), userModifyPropertyName)', 'read-write');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName)', 'read-write');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null))', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false"))', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true"))', 'read-write');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null))', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"))', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"))', 'read-write');
document.getElementById('sandbox').appendChild(
createDOM('div', {'id': 'host', 'contenteditable': 'true'},
......
......@@ -47,7 +47,6 @@
var sPropertyName = oStyleDeclaration.item(i);
var dxPropertyAttributes = {
'value': oStyleDeclaration.getPropertyValue(sPropertyName),
// 'CSS value': oStyleDeclaration.getPropertyCSSValue(sPropertyName),
'priority': oStyleDeclaration.getPropertyPriority(sPropertyName)
};
dxStyleProperties[sPropertyName] = dxPropertyAttributes;
......
......@@ -14,7 +14,7 @@
var divComputedStyle = window.getComputedStyle(divElement);
test(function() {
assert_true(divComputedStyle.getPropertyCSSValue('background-color').getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) == 255,
assert_true(divComputedStyle.backgroundColor == "rgb(255, 0, 0)",
"Div should have rgb(255, 0, 0) background color.")
},
"Testing that background color is red. Media query \"all and (color)\"");
......@@ -23,7 +23,7 @@
styleElement.setAttribute("media", "(monochrome) and (color)");
test(function() {
assert_true(divComputedStyle.getPropertyCSSValue('background-color').getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) == 0,
assert_true(divComputedStyle.backgroundColor == "rgba(0, 0, 0, 0)",
"New media query doesn't match, div should not have background color.")
},
"Testing that updated media query doesn't match and background color is not red. Media query \"(monochrome) and (color)\"");
......
......@@ -3,20 +3,16 @@ Test calling getPropertyValue on computed styles for -webkit-border-image proper
-webkit-box-reflect: none;
-webkit-box-reflect
getPropertyValue: none
getPropertyCSSValue: [object CSSPrimitiveValue]
-webkit-box-reflect: below;
-webkit-box-reflect
getPropertyValue: below 0px none
getPropertyCSSValue: [object CSSValue]
-webkit-box-reflect: right 50%;
-webkit-box-reflect
getPropertyValue: right 50% none
getPropertyCSSValue: [object CSSValue]
-webkit-box-reflect: below 5px -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 stretch stretch;
-webkit-box-reflect
getPropertyValue: below 5px -webkit-gradient(linear, 0 0, 0 0) 25 fill / auto / 0px stretch
getPropertyCSSValue: [object CSSValue]
......@@ -18,7 +18,6 @@
{
log(' ' + prop);
log(' getPropertyValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyValue(prop));
log(' getPropertyCSSValue: ' + document.defaultView.getComputedStyle(ob, null).getPropertyCSSValue(prop));
}
function test(id, val)
......
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