Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 94af56c0c40277a1b7c5976aefe59891e6418b9f..42743cb011574c585b48ca725e3881ffcac71507 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -125,6 +125,7 @@ |
#include "core/html/HTMLDocument.h" |
#include "core/html/HTMLFrameOwnerElement.h" |
#include "core/html/HTMLHeadElement.h" |
+#include "core/html/HTMLHtmlElement.h" |
#include "core/html/HTMLIFrameElement.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLLinkElement.h" |
@@ -1394,10 +1395,8 @@ void Document::removeTitle(Element* titleElement) |
const AtomicString& Document::dir() |
{ |
Element* rootElement = documentElement(); |
- if (isHTMLHtmlElement(rootElement)) { |
- // FIXME(crbug.com/363628): document.dir should only return known values. |
- return rootElement->getAttribute(dirAttr); |
- } |
+ if (isHTMLHtmlElement(rootElement)) |
+ return toHTMLHtmlElement(rootElement)->dir(); |
return nullAtom; |
} |
@@ -1405,7 +1404,7 @@ void Document::setDir(const AtomicString& value) |
{ |
Element* rootElement = documentElement(); |
if (isHTMLHtmlElement(rootElement)) |
- rootElement->setAttribute(dirAttr, value); |
+ toHTMLHtmlElement(rootElement)->setDir(value); |
} |
PageVisibilityState Document::pageVisibilityState() const |