Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Unified Diff: Source/core/dom/Document.cpp

Issue 240243004: Update HTMLElement.dir / Document.dir to return only known values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use fastGetAttribute Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/element-attribute-js-null-expected.txt ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « LayoutTests/fast/dom/element-attribute-js-null-expected.txt ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698