Chromium Code Reviews| 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"; |
| } |
| } |