1 description('Test that parsing of css regions related properties is disabled by default.');
4 window.testRunner.overridePreference("WebKitCSSRegionsEnabled", "0");
6 function testWebKitFlowInto(declaration) {
7 var div = document.createElement("div");
8 div.setAttribute("style", declaration);
9 return div.style.webkitFlowInto;
12 function testWebKitFlowFrom(declaration) {
13 var div = document.createElement("div");
14 div.setAttribute("style", declaration);
15 return div.style.webkitFlowFrom;
18 function testWebKitRegionFragment(declaration) {
19 var div = document.createElement("div");
20 div.setAttribute("style", declaration);
21 return div.style.webkitRegionFragment;
24 function testComputedStyleWebKitFlowInto(value) {
25 var div = document.createElement("div");
26 document.body.appendChild(div);
27 div.style.setProperty("-webkit-flow-into", value);
28 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-into");
29 document.body.removeChild(div);
33 function testComputedStyleWebKitFlowFrom(value) {
34 var div = document.createElement("div");
35 document.body.appendChild(div);
36 div.style.setProperty("-webkit-flow-from", value);
37 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-from");
38 document.body.removeChild(div);
42 function testComputedStyleWebKitRegionFragment(value) {
43 var div = document.createElement("div");
44 document.body.appendChild(div);
45 div.style.setProperty("-webkit-region-fragment", value);
46 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-region-fragment");
47 document.body.removeChild(div);
51 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: none")', "");
52 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: first-flow")', "");
53 shouldBeEqualToString('testComputedStyleWebKitFlowInto("none")', "none");
54 shouldBeEqualToString('testComputedStyleWebKitFlowInto("first-flow")', "none");
56 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: first-flow")', "");
57 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: none")', "");
58 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("first-flow")', "none");
59 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("none")', "none");
61 shouldBeEqualToString('testWebKitRegionFragment("-webkit-region-fragment: auto")', "");
62 shouldBeEqualToString('testWebKitRegionFragment("-webkit-region-fragment: break")', "");
63 shouldBeEqualToString('testComputedStyleWebKitRegionFragment("auto")', "auto");
64 shouldBeEqualToString('testComputedStyleWebKitRegionFragment("break")', "auto");
66 // Test that region styling rules are not parsed.
67 var styleElement = document.createElement("style");
68 document.head.appendChild(styleElement);
69 var stylesheet = styleElement.sheet;
70 webkitRegionRuleIndex = -1;
72 webkitRegionRuleIndex = stylesheet.insertRule("@-webkit-region #region3 { p { color: red; } }");
76 shouldBe("webkitRegionRuleIndex", "-1");