Index: Source/core/html/HTMLElement.cpp |
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp |
index f9dff426403e18215fdd92b3f3597386140f0978..445382ac9026dc4739efd221cd7ada7f6a4e9b86 100644 |
--- a/Source/core/html/HTMLElement.cpp |
+++ b/Source/core/html/HTMLElement.cpp |
@@ -50,6 +50,7 @@ |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLMenuElement.h" |
#include "core/html/HTMLTemplateElement.h" |
+#include "core/html/HTMLTextAreaElement.h" |
#include "core/html/HTMLTextFormControlElement.h" |
#include "core/html/parser/HTMLParserIdioms.h" |
#include "core/rendering/RenderObject.h" |
@@ -687,10 +688,20 @@ TextDirection HTMLElement::directionality(Node** strongDirectionalityTextNode) c |
{ |
if (isHTMLInputElement(*this)) { |
HTMLInputElement* inputElement = toHTMLInputElement(const_cast<HTMLElement*>(this)); |
+ if (inputElement->isTextField() || inputElement->isSearchField() |
+ || inputElement->isURLField() || inputElement->isEmailField()) { |
+ bool hasStrongDirectionality; |
+ TextDirection textDirection = determineDirectionality(inputElement->value(), hasStrongDirectionality); |
+ if (strongDirectionalityTextNode) |
+ *strongDirectionalityTextNode = hasStrongDirectionality ? inputElement : 0; |
+ return textDirection; |
+ } |
+ } else if (isHTMLTextAreaElement(*this)) { |
+ HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(const_cast<HTMLElement*>(this)); |
bool hasStrongDirectionality; |
- TextDirection textDirection = determineDirectionality(inputElement->value(), hasStrongDirectionality); |
+ TextDirection textDirection = determineDirectionality(textAreaElement->value(), hasStrongDirectionality); |
if (strongDirectionalityTextNode) |
- *strongDirectionalityTextNode = hasStrongDirectionality ? inputElement : 0; |
+ *strongDirectionalityTextNode = hasStrongDirectionality ? textAreaElement : 0; |
return textDirection; |
} |