Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipa ge/elements.html#dom-document-dir"/> | 3 <link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipa ge/elements.html#dom-document-dir"/> |
| 4 <script> | 4 <script> |
| 5 var headReadDocumentDir = document.dir; | 5 var headReadDocumentDir = document.dir; |
| 6 document.dir = "rtl"; | 6 document.dir = "rtl"; |
| 7 var headWriteDocumentDir = document.dir; | 7 var headWriteDocumentDir = document.dir; |
| 8 </script> | 8 </script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 debug(""); | 21 debug(""); |
| 22 | 22 |
| 23 debug("Read document.dir in body"); | 23 debug("Read document.dir in body"); |
| 24 shouldBeEqualToString("document.dir", "rtl"); | 24 shouldBeEqualToString("document.dir", "rtl"); |
| 25 debug(""); | 25 debug(""); |
| 26 | 26 |
| 27 debug("Read document.documentElement.dir in body"); | 27 debug("Read document.documentElement.dir in body"); |
| 28 shouldBeEqualToString("document.documentElement.dir", "rtl"); | 28 shouldBeEqualToString("document.documentElement.dir", "rtl"); |
| 29 debug(""); | 29 debug(""); |
| 30 | 30 |
| 31 debug("Read document.documentElement.getAttribute('dir') in body"); | |
| 32 shouldBeEqualToString("document.documentElement.getAttribute('dir')", "rtl"); | |
| 33 debug(""); | |
| 34 | |
| 31 debug("Read document.body.dir in body"); | 35 debug("Read document.body.dir in body"); |
| 32 shouldBeEqualToString("document.body.dir", ""); | 36 shouldBeEqualToString("document.body.dir", ""); |
| 33 debug(""); | 37 debug(""); |
| 34 | 38 |
| 35 debug("Write document.dir in body"); | 39 debug("Write document.dir in body"); |
| 36 document.dir = "ltr"; | 40 document.dir = "ltr"; |
| 37 shouldBeEqualToString("document.dir", "ltr"); | 41 shouldBeEqualToString("document.dir", "ltr"); |
| 38 debug(""); | 42 debug(""); |
| 39 | 43 |
| 40 debug("Read document.documentElement.dir in body"); | 44 debug("Read document.documentElement.dir in body"); |
| 41 shouldBeEqualToString("document.documentElement.dir", "ltr"); | 45 shouldBeEqualToString("document.documentElement.dir", "ltr"); |
| 42 debug(""); | 46 debug(""); |
| 43 | 47 |
| 44 debug("Read document.body.dir in body"); | 48 debug("Read document.body.dir in body"); |
| 45 shouldBeEqualToString("document.body.dir", ""); | 49 shouldBeEqualToString("document.body.dir", ""); |
| 46 debug(""); | 50 debug(""); |
| 47 | 51 |
| 52 debug("Read document.documentElement.getAttribute('dir') in body"); | |
| 53 shouldBeEqualToString("document.documentElement.getAttribute('dir')", "ltr"); | |
| 54 debug(""); | |
| 55 | |
| 48 debug("Write non-canonical case document.dir in body"); | 56 debug("Write non-canonical case document.dir in body"); |
| 49 shouldNotThrow("document.dir = 'RTL'"); | 57 shouldNotThrow("document.dir = 'RTL'"); |
|
philipj_slow
2015/11/03 11:00:23
After this and the WRONG case, test that the conte
tanay.c
2015/11/03 11:32:58
Done.
| |
| 50 shouldBeEqualToString("document.dir", "rtl"); | 58 shouldBeEqualToString("document.dir", "rtl"); |
| 51 debug(""); | 59 debug(""); |
| 52 | 60 |
| 53 debug("Write invalid document.dir in body"); | 61 debug("Write invalid document.dir in body"); |
| 54 shouldNotThrow("document.dir = 'WRONG'"); | 62 shouldNotThrow("document.dir = 'WRONG'"); |
| 55 shouldBeEqualToString("document.dir", ""); | 63 shouldBeEqualToString("document.dir", ""); |
| 56 debug(""); | 64 debug(""); |
| 57 | 65 |
| 58 debug("Write non-canonical case document.body.dir in body"); | 66 debug("Write non-canonical case document.body.dir in body"); |
| 59 shouldNotThrow("document.body.dir = 'RTL'"); | 67 shouldNotThrow("document.body.dir = 'RTL'"); |
| 60 shouldBeEqualToString("document.body.dir", "rtl"); | 68 shouldBeEqualToString("document.body.dir", "rtl"); |
| 61 debug(""); | 69 debug(""); |
| 62 | 70 |
| 63 debug("Write invalid document.body.dir in body"); | 71 debug("Write invalid document.body.dir in body"); |
| 64 shouldNotThrow("document.body.dir = 'WRONG'"); | 72 shouldNotThrow("document.body.dir = 'WRONG'"); |
| 65 shouldBeEqualToString("document.body.dir", ""); | 73 shouldBeEqualToString("document.body.dir", ""); |
| 66 debug(""); | 74 debug(""); |
| 75 | |
| 76 document.dir = null; | |
| 77 debug("Read document.dir in body"); | |
| 78 shouldBeEqualToString("document.dir", ""); | |
| 79 debug(""); | |
| 80 | |
| 81 debug("Read document.documentElement.getAttribute('dir') in body"); | |
| 82 shouldBeEqualToString("document.documentElement.getAttribute('dir')", "null"); | |
| 83 debug(""); | |
| 84 | |
| 67 </script> | 85 </script> |
| 68 </body> | 86 </body> |
| 69 </html> | 87 </html> |
| OLD | NEW |