RESOLVED FIXED 140922
Document.dir should reflect the 'dir' attribute of the root html element
https://bugs.webkit.org/show_bug.cgi?id=140922
Summary Document.dir should reflect the 'dir' attribute of the root html element
Chris Dumez
Reported 2015-01-26 20:09:36 PST
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.
Attachments
Patch (7.29 KB, patch)
2015-01-26 20:45 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-01-26 20:45:06 PST
Chris Dumez
Comment 2 2015-01-26 21:54:05 PST
Comment on attachment 245408 [details] Patch Clearing flags on attachment: 245408 Committed r179166: <http://trac.webkit.org/changeset/179166>
Chris Dumez
Comment 3 2015-01-26 21:54:12 PST
All reviewed patches have been landed. Closing bug.
Sam Weinig
Comment 4 2015-02-11 10:48:03 PST
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.
Chris Dumez
Comment 5 2015-02-11 11:53:14 PST
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.
Note You need to log in before you can comment on or make changes to this bug.