[CSSRegions]-webkit-flow-into initial value should be none instead of auto
[WebKit-https.git] / LayoutTests / fast / regions / script-tests / webkit-flow-parsing.js
1 description('Test parsing of the CSS webkit-flow-into property.');
2
3 function test(declaration) {
4     var div = document.createElement("div");
5     div.setAttribute("style", declaration);
6     return div.style.webkitFlowInto;
7 }
8
9 function testComputedStyle(value) {
10     var div = document.createElement("div");
11     document.body.appendChild(div);
12     div.style.setProperty("-webkit-flow-into", value);
13     var webkitFlowComputedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-into");
14     document.body.removeChild(div);
15     return webkitFlowComputedValue;
16 }
17
18 function testNotInherited(parentValue, childValue) {
19     var parentDiv = document.createElement("div");
20     document.body.appendChild(parentDiv);
21     parentDiv.style.setProperty("-webkit-flow-into", parentValue);
22
23     var childDiv = document.createElement("div");
24     parentDiv.appendChild(childDiv);
25     childDiv.style.setProperty("-webkit-flow-into", childValue);
26
27     var childWebKitFlowComputedValue = getComputedStyle(childDiv).getPropertyValue("-webkit-flow-into");
28
29     parentDiv.removeChild(childDiv);
30     document.body.removeChild(parentDiv);
31
32     return childWebKitFlowComputedValue;
33 }
34
35 shouldBeEqualToString('test("-webkit-flow-into: none")', "none");
36 shouldBeEqualToString('test("-webkit-flow-into: first-flow")', "first-flow");
37 shouldBeEqualToString('test("-webkit-flow-into: \'first flow\'")', "");
38 shouldBeEqualToString('test("-webkit-flow-into: ;")', "");
39 shouldBeEqualToString('test("-webkit-flow-into: 1")', "");
40 shouldBeEqualToString('test("-webkit-flow-into: 1.2")', "");
41 shouldBeEqualToString('test("-webkit-flow-into: -1")', "");
42 shouldBeEqualToString('test("-webkit-flow-into: 12px")', "");
43
44 shouldBeEqualToString('testComputedStyle("none")', "none");
45 shouldBeEqualToString('testComputedStyle("")', "none");
46 shouldBeEqualToString('testComputedStyle("\'first-flow\'")', "none");
47 shouldBeEqualToString('testComputedStyle("first-flow")', "first-flow");
48 shouldBeEqualToString('testComputedStyle("12px")', "none");
49
50 shouldBeEqualToString('testNotInherited("none", "none")', "none");
51 shouldBeEqualToString('testNotInherited("none", "child-flow")', "child-flow");
52 shouldBeEqualToString('testNotInherited("parent-flow", "none")', "none");
53 shouldBeEqualToString('testNotInherited("parent-flow", "child-flow")', "child-flow");