-This tests:
-Bug 9954 REGRESSION: document.dir should return empty string in <head>
-https://bugs.webkit.org/show_bug.cgi?id=9954
+document.dir should reflect the 'dir' content attribute of the <html> element and should be settable in <head>.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
Read document.dir in head
-PASS headReadDocumentDir is ''
+PASS headReadDocumentDir is ""
Write document.dir in head
-PASS headWriteDocumentDir is ''
+PASS headWriteDocumentDir is "rtl"
Read document.dir in body
-PASS document.dir is ''
+PASS document.dir is "rtl"
+
+Read document.documentElement.dir in body
+PASS document.documentElement.dir is "rtl"
Read document.body.dir in body
-PASS document.body.dir is ''
+PASS document.body.dir is ""
Write document.dir in body
-PASS document.dir is 'ltr'
+PASS document.dir is "ltr"
+
+Read document.documentElement.dir in body
+PASS document.documentElement.dir is "ltr"
Read document.body.dir in body
-PASS document.body.dir is 'ltr'
+PASS document.body.dir is ""
+
+Write non-canonical case document.dir in body
+PASS document.dir = 'RTL' did not throw exception.
+PASS document.dir is "rtl"
+
+Write invalid document.dir in body
+PASS document.dir = 'WRONG' did not throw exception.
+PASS document.dir is ""
+
+Write non-canonical case document.body.dir in body
+PASS document.body.dir = 'RTL' did not throw exception.
+PASS document.body.dir is "rtl"
+
+Write invalid document.body.dir in body
+PASS document.body.dir = 'WRONG' did not throw exception.
+PASS document.body.dir is ""
PASS successfullyParsed is true