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

Unified Diff: Source/web/WebFormControlElement.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: Fix Windows Build 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/web/WebFormControlElement.cpp
diff --git a/Source/web/WebFormControlElement.cpp b/Source/web/WebFormControlElement.cpp
index 34ec147ad70ecc8ccc350e28cf3e0e9f7755f729..997b1f5738b9366fc8a352325bff3ca840ecb17b 100644
--- a/Source/web/WebFormControlElement.cpp
+++ b/Source/web/WebFormControlElement.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "public/web/WebFormControlElement.h"
+#include "core/dom/NodeRenderStyle.h"
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLInputElement.h"
@@ -171,11 +172,9 @@ int WebFormControlElement::selectionEnd() const
WebString WebFormControlElement::directionForFormData() const
{
- if (isHTMLInputElement(*m_private))
- return constUnwrap<HTMLInputElement>()->directionForFormData();
- if (isHTMLTextAreaElement(*m_private))
- return constUnwrap<HTMLTextAreaElement>()->directionForFormData();
- return WebString();
+ if (RenderStyle* style = constUnwrap<HTMLFormControlElement>()->renderStyle())
+ return style->isLeftToRightDirection() ? WebString::fromUTF8("ltr") : WebString::fromUTF8("rtl");
+ return WebString::fromUTF8("ltr");
}
bool WebFormControlElement::isActivatedSubmit() const
« 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