1 function checkValues(element, property, propertyID, value, computedValue)
3 window.element = element;
4 var elementID = element.id || "element";
5 shouldBeEqualToString("element.style." + property, value);
6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('" + propertyID + "')", computedValue);
9 function checkBadValues(element, property, propertyID, value)
11 element.style[property] = value;
12 checkValues(element, property, propertyID, "", "start");
15 function checkInitialValues(element, property, propertyID, value, initial)
17 element.style[property] = value;
18 checkValues(element, property, propertyID, value, value);
19 element.style[property] = "initial";
20 checkValues(element, property, propertyID, "initial", initial);
23 function checkInheritValues(property, propertyID, value)
25 var parentElement = document.createElement("div");
26 document.body.appendChild(parentElement);
27 parentElement.style[property] = value;
28 checkValues(parentElement, property, propertyID, value, value);
30 var element = document.createElement("div");
31 parentElement.appendChild(element);
32 element.style[property] = "inherit";
33 checkValues(element, property, propertyID, "inherit", value);
36 function checkLegacyValues(property, propertyID, value)
38 var parentElement = document.createElement("div");
39 document.body.appendChild(parentElement);
40 parentElement.style[property] = value;
41 checkValues(parentElement, property, propertyID, value, value);
43 var element = document.createElement("div");
44 parentElement.appendChild(element);
45 checkValues(element, property, propertyID, "", value);
48 function checkSupportedValues(elementID, property)
50 var value = eval("window.getComputedStyle(" + elementID + " , '').getPropertyValue('" + property + "')");
51 var value1 = eval("window.getComputedStyle(" + elementID + " , '')");
52 shouldBeTrue("CSS.supports('" + property + "', '" + value + "')");