Document.dir should reflect the 'dir' content attribute of the root html element as per the specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-dir Currently, WebKit reflects the 'dir' content attribute of the body element. Firefox (tested v28) and IE (tested v11) and Chrome match the spec.
Created attachment 245408 [details] Patch
Comment on attachment 245408 [details] Patch Clearing flags on attachment: 245408 Committed r179166: <http://trac.webkit.org/changeset/179166>
All reviewed patches have been landed. Closing bug.
This caused a regression where we crash if the document has no root element when calling document.dir. Filed https://bugs.webkit.org/show_bug.cgi?id=141480.
Comment on attachment 245408 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245408&action=review > Source/WebCore/html/HTMLDocument.cpp:111 > + if (!is<HTMLHtmlElement>(*documentElement)) We need to stop dereferencing documentElement here as documentElement can be null. is<>() will take care of the null-check for us.