Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: LayoutTests/fast/regions/script-tests/css-regions-disabled.js

Issue 16690004: [CSS Regions] Rename region-overflow to region-fragment (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 description('Test that parsing of css regions related properties is disabled by default.'); 1 description('Test that parsing of css regions related properties is disabled by default.');
2 2
3 if (window.testRunner) 3 if (window.testRunner)
4 window.testRunner.overridePreference("WebKitCSSRegionsEnabled", "0"); 4 window.testRunner.overridePreference("WebKitCSSRegionsEnabled", "0");
5 5
6 function testWebKitFlowInto(declaration) { 6 function testWebKitFlowInto(declaration) {
7 var div = document.createElement("div"); 7 var div = document.createElement("div");
8 div.setAttribute("style", declaration); 8 div.setAttribute("style", declaration);
9 return div.style.webkitFlowInto; 9 return div.style.webkitFlowInto;
10 } 10 }
11 11
12 function testWebKitFlowFrom(declaration) { 12 function testWebKitFlowFrom(declaration) {
13 var div = document.createElement("div"); 13 var div = document.createElement("div");
14 div.setAttribute("style", declaration); 14 div.setAttribute("style", declaration);
15 return div.style.webkitFlowFrom; 15 return div.style.webkitFlowFrom;
16 } 16 }
17 17
18 function testWebKitRegionOverflow(declaration) { 18 function testWebKitRegionFragment(declaration) {
19 var div = document.createElement("div"); 19 var div = document.createElement("div");
20 div.setAttribute("style", declaration); 20 div.setAttribute("style", declaration);
21 return div.style.webkitRegionOverflow; 21 return div.style.webkitRegionFragment;
22 } 22 }
23 23
24 function testComputedStyleWebKitFlowInto(value) { 24 function testComputedStyleWebKitFlowInto(value) {
25 var div = document.createElement("div"); 25 var div = document.createElement("div");
26 document.body.appendChild(div); 26 document.body.appendChild(div);
27 div.style.setProperty("-webkit-flow-into", value); 27 div.style.setProperty("-webkit-flow-into", value);
28 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-int o"); 28 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-int o");
29 document.body.removeChild(div); 29 document.body.removeChild(div);
30 return computedValue; 30 return computedValue;
31 } 31 }
32 32
33 function testComputedStyleWebKitFlowFrom(value) { 33 function testComputedStyleWebKitFlowFrom(value) {
34 var div = document.createElement("div"); 34 var div = document.createElement("div");
35 document.body.appendChild(div); 35 document.body.appendChild(div);
36 div.style.setProperty("-webkit-flow-from", value); 36 div.style.setProperty("-webkit-flow-from", value);
37 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-fro m"); 37 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-flow-fro m");
38 document.body.removeChild(div); 38 document.body.removeChild(div);
39 return computedValue; 39 return computedValue;
40 } 40 }
41 41
42 function testComputedStyleWebKitRegionOverflow(value) { 42 function testComputedStyleWebKitRegionFragment(value) {
43 var div = document.createElement("div"); 43 var div = document.createElement("div");
44 document.body.appendChild(div); 44 document.body.appendChild(div);
45 div.style.setProperty("-webkit-region-overflow", value); 45 div.style.setProperty("-webkit-region-fragment", value);
46 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-region-o verflow"); 46 var computedValue = getComputedStyle(div).getPropertyValue("-webkit-region-f ragment");
47 document.body.removeChild(div); 47 document.body.removeChild(div);
48 return computedValue; 48 return computedValue;
49 } 49 }
50 50
51 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: none")', ""); 51 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: none")', "");
52 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: first-flow")', "") ; 52 shouldBeEqualToString('testWebKitFlowInto("-webkit-flow-into: first-flow")', "") ;
53 shouldBeEqualToString('testComputedStyleWebKitFlowInto("none")', "none"); 53 shouldBeEqualToString('testComputedStyleWebKitFlowInto("none")', "none");
54 shouldBeEqualToString('testComputedStyleWebKitFlowInto("first-flow")', "none"); 54 shouldBeEqualToString('testComputedStyleWebKitFlowInto("first-flow")', "none");
55 55
56 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: first-flow")', "") ; 56 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: first-flow")', "") ;
57 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: none")', ""); 57 shouldBeEqualToString('testWebKitFlowFrom("-webkit-flow-from: none")', "");
58 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("first-flow")', "none"); 58 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("first-flow")', "none");
59 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("none")', "none"); 59 shouldBeEqualToString('testComputedStyleWebKitFlowFrom("none")', "none");
60 60
61 shouldBeEqualToString('testWebKitRegionOverflow("-webkit-region-overflow: auto") ', ""); 61 shouldBeEqualToString('testWebKitRegionFragment("-webkit-region-fragment: auto") ', "");
62 shouldBeEqualToString('testWebKitRegionOverflow("-webkit-region-overflow: break" )', ""); 62 shouldBeEqualToString('testWebKitRegionFragment("-webkit-region-fragment: break" )', "");
63 shouldBeEqualToString('testComputedStyleWebKitRegionOverflow("auto")', "auto"); 63 shouldBeEqualToString('testComputedStyleWebKitRegionFragment("auto")', "auto");
64 shouldBeEqualToString('testComputedStyleWebKitRegionOverflow("break")', "auto"); 64 shouldBeEqualToString('testComputedStyleWebKitRegionFragment("break")', "auto");
65 65
66 // Test that region styling rules are not parsed. 66 // Test that region styling rules are not parsed.
67 var styleElement = document.createElement("style"); 67 var styleElement = document.createElement("style");
68 document.head.appendChild(styleElement); 68 document.head.appendChild(styleElement);
69 var stylesheet = styleElement.sheet; 69 var stylesheet = styleElement.sheet;
70 webkitRegionRuleIndex = -1; 70 webkitRegionRuleIndex = -1;
71 try { 71 try {
72 webkitRegionRuleIndex = stylesheet.insertRule("@-webkit-region #region3 { p { color: red; } }"); 72 webkitRegionRuleIndex = stylesheet.insertRule("@-webkit-region #region3 { p { color: red; } }");
73 } catch(err) { 73 } catch(err) {
74 } 74 }
75 75
76 shouldBe("webkitRegionRuleIndex", "-1"); 76 shouldBe("webkitRegionRuleIndex", "-1");
77 77
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698