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

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: Incorporated review comments 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..7897c291ab79fcaf7e2e9fa390879098ef769cec 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,15 @@ 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 (isHTMLInputElement(*m_private)) {
Sunil Ratnu 2014/08/07 07:06:18 Can we have it like this as well? if (RenderStyle
tkent 2014/08/07 07:13:46 No. It doesn't work if m_private is not HTMLTextF
+ if (RenderStyle* style = constUnwrap<HTMLInputElement>()->renderStyle())
+ return style->isLeftToRightDirection() ? "ltr" : "rtl";
+ }
+ if (isHTMLTextAreaElement(*m_private)) {
+ if (RenderStyle* style = constUnwrap<HTMLTextAreaElement>()->renderStyle())
+ return style->isLeftToRightDirection() ? "ltr" : "rtl";
+ }
+ return "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