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

Unified Diff: Source/core/html/HTMLTextFormControlElement.cpp

Issue 419023007: Autocomplete confused about direction if inline style and inherited dir attribute are mixed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 6067d4792f8f78123e55300d0031c63204f73310..eca3a5bc8031ac89b02fef3b210d6d63fab30b9c 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -31,6 +31,7 @@
#include "core/accessibility/AXObjectCache.h"
#include "core/dom/Document.h"
#include "core/dom/NodeList.h"
+#include "core/dom/NodeRenderStyle.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -656,17 +657,9 @@ static const HTMLElement* parentHTMLElement(const Element* element)
String HTMLTextFormControlElement::directionForFormData() const
{
for (const HTMLElement* element = this; element; element = parentHTMLElement(element)) {
- const AtomicString& dirAttributeValue = element->fastGetAttribute(dirAttr);
- if (dirAttributeValue.isNull())
- continue;
-
- if (equalIgnoringCase(dirAttributeValue, "rtl") || equalIgnoringCase(dirAttributeValue, "ltr"))
- return dirAttributeValue;
-
- if (equalIgnoringCase(dirAttributeValue, "auto")) {
- bool isAuto;
- TextDirection textDirection = element->directionalityIfhasDirAutoAttribute(isAuto);
- return textDirection == RTL ? "rtl" : "ltr";
+ RenderStyle* style = element->renderStyle();
+ if (style) {
Inactive 2014/08/06 20:51:43 I cannot say if the change is good or not. However
Sunil Ratnu 2014/08/07 05:20:56 Done.
+ return style->isLeftToRightDirection() ? "ltr" : "rtl";
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698