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

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 nullAtom for consistency 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
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();
Inactive 2014/04/16 18:05:54 By not using [Reflect] for HTMLElement.dir, I can
sof 2014/04/16 18:19:05 The binding layer will implement the limited-to-on
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

Powered by Google App Engine
This is Rietveld 408576698