OLD | NEW |
1 description("Test that only non-replaced block elements can be transformed into
regions."); | 1 description("Test that only non-replaced block elements can be transformed into
regions."); |
2 | 2 |
3 function createRegionElement(elementType, displayType) | 3 function createRegionElement(elementType, displayType) |
4 { | 4 { |
5 var element = document.createElement(elementType); | 5 var element = document.createElement(elementType); |
6 var textElement = document.createTextNode("inside element"); | 6 var textElement = document.createTextNode("inside element"); |
7 element.appendChild(textElement); | 7 element.appendChild(textElement); |
8 element.style.setProperty("display", displayType); | 8 element.style.setProperty("display", displayType); |
9 document.body.appendChild(element); | 9 document.body.appendChild(element); |
10 | 10 |
11 // Transform the element into a region. | 11 // Transform the element into a region. |
12 element.style.setProperty("-webkit-flow-from", "no-flow"); | 12 element.style.setProperty("-webkit-flow-from", "no-flow"); |
13 | 13 |
14 // The region element was created if the length of inner text is 0. | 14 // The region element was created if the length of inner text is 0. |
15 var regionCreated = element.innerText.length == 0; | 15 var regionCreated = element.innerText.length == 0; |
16 | 16 |
17 document.body.removeChild(element); | 17 document.body.removeChild(element); |
18 | 18 |
19 return regionCreated; | 19 return regionCreated; |
20 } | 20 } |
21 | 21 |
22 shouldBeFalse('createRegionElement("div", "none")'); | 22 shouldBeFalse('createRegionElement("div", "none")'); |
23 shouldBeTrue('createRegionElement("div", "block")'); | 23 shouldBeTrue('createRegionElement("div", "block")'); |
24 shouldBeTrue('createRegionElement("div", "inline-block")'); | 24 shouldBeTrue('createRegionElement("div", "inline-block")'); |
25 shouldBeFalse('createRegionElement("div", "compact")'); | |
26 shouldBeFalse('createRegionElement("div", "inline")'); | 25 shouldBeFalse('createRegionElement("div", "inline")'); |
27 shouldBeFalse('createRegionElement("div", "table")'); | 26 shouldBeFalse('createRegionElement("div", "table")'); |
28 shouldBeFalse('createRegionElement("div", "inline-table")'); | 27 shouldBeFalse('createRegionElement("div", "inline-table")'); |
29 shouldBeTrue('createRegionElement("div", "table-cell")'); | 28 shouldBeTrue('createRegionElement("div", "table-cell")'); |
30 shouldBeTrue('createRegionElement("div", "table-caption")'); | 29 shouldBeTrue('createRegionElement("div", "table-caption")'); |
31 shouldBeTrue('createRegionElement("div", "list-item")'); | 30 shouldBeTrue('createRegionElement("div", "list-item")'); |
32 shouldBeFalse('createRegionElement("div", "-webkit-box")'); | 31 shouldBeFalse('createRegionElement("div", "-webkit-box")'); |
33 shouldBeFalse('createRegionElement("div", "-webkit-inline-box")'); | 32 shouldBeFalse('createRegionElement("div", "-webkit-inline-box")'); |
34 shouldBeFalse('createRegionElement("div", "-webkit-flex")'); | 33 shouldBeFalse('createRegionElement("div", "-webkit-flex")'); |
35 shouldBeFalse('createRegionElement("div", "-webkit-inline-flex")'); | 34 shouldBeFalse('createRegionElement("div", "-webkit-inline-flex")'); |
36 // FIXME: Also add grid and inline grid when it is enabled by default | 35 // FIXME: Also add grid and inline grid when it is enabled by default |
OLD | NEW |