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 |