OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <div> |
| 4 <div id="outerAuto" dir="auto"> |
| 5 <div id="textInsertionPoint"></div> |
| 6 <div id="affectedByAuto"></div> |
| 7 <div id="explicitLTR" dir="ltr"> |
| 8 <div></div> |
| 9 <div></div> |
| 10 <div></div> |
| 11 <div></div> |
| 12 </div> |
| 13 </div> |
| 14 </div> |
| 15 <script> |
| 16 description("Style invalidation when inserting RTL text descendant of dir=au
to"); |
| 17 |
| 18 shouldBeEqualToString("getComputedStyle(outerAuto).direction", "ltr"); |
| 19 shouldBeEqualToString("getComputedStyle(textInsertionPoint).direction", "ltr
"); |
| 20 shouldBeEqualToString("getComputedStyle(affectedByAuto).direction", "ltr"); |
| 21 shouldBeEqualToString("getComputedStyle(explicitLTR).direction", "ltr"); |
| 22 |
| 23 document.body.offsetTop; // force style and layout clean. |
| 24 |
| 25 textInsertionPoint.innerHTML = "؄ل"; |
| 26 |
| 27 if (window.internals) |
| 28 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4"); |
| 29 |
| 30 shouldBeEqualToString("getComputedStyle(outerAuto).direction", "rtl"); |
| 31 shouldBeEqualToString("getComputedStyle(textInsertionPoint).direction", "rtl
"); |
| 32 shouldBeEqualToString("getComputedStyle(affectedByAuto).direction", "rtl"); |
| 33 shouldBeEqualToString("getComputedStyle(explicitLTR).direction", "ltr"); |
| 34 |
| 35 debug("\nForcing everything back to LTR with dir attribute:\n"); |
| 36 |
| 37 document.body.offsetTop; // force style and layout clean. |
| 38 |
| 39 textInsertionPoint.dir = "ltr"; |
| 40 |
| 41 if (window.internals) |
| 42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4"); |
| 43 |
| 44 shouldBeEqualToString("getComputedStyle(outerAuto).direction", "ltr"); |
| 45 shouldBeEqualToString("getComputedStyle(textInsertionPoint).direction", "ltr
"); |
| 46 shouldBeEqualToString("getComputedStyle(affectedByAuto).direction", "ltr"); |
| 47 shouldBeEqualToString("getComputedStyle(explicitLTR).direction", "ltr"); |
| 48 </script> |
OLD | NEW |