Chromium Code Reviews| Index: Source/core/html/HTMLElement.cpp |
| diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp |
| index 7d741fc5342614a92de9e35a0a1acfe0b8eed8c1..3fbe0cacaaa543fa1d2fd148656c8a0fcfe01852 100644 |
| --- a/Source/core/html/HTMLElement.cpp |
| +++ b/Source/core/html/HTMLElement.cpp |
| @@ -38,6 +38,7 @@ |
| #include "core/dom/ExceptionCode.h" |
| #include "core/dom/NodeTraversal.h" |
| #include "core/dom/Text.h" |
| +#include "core/dom/shadow/ShadowRoot.h" |
| #include "core/editing/markup.h" |
| #include "core/events/EventListener.h" |
| #include "core/events/KeyboardEvent.h" |
| @@ -637,9 +638,6 @@ static void setHasDirAutoFlagRecursively(Node* firstNode, bool flag, Node* lastN |
| Node* node = firstNode->firstChild(); |
| while (node) { |
| - if (node->selfOrAncestorHasDirAutoAttribute() == flag) |
| - return; |
| - |
| if (elementAffectsDirectionality(node)) { |
| if (node == lastNode) |
| return; |
| @@ -753,7 +751,15 @@ void HTMLElement::calculateAndAdjustDirectionality() |
| { |
| Node* strongDirectionalityTextNode; |
| TextDirection textDirection = directionality(&strongDirectionalityTextNode); |
| - setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); |
| + if (hasDirectionAuto()) { |
| + setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); |
| + if (userAgentShadowRoot()) |
| + setHasDirAutoFlagRecursively(userAgentShadowRoot(), true); |
|
esprehn
2014/06/11 17:38:07
This should be doing:
for(ShadowRoot* root = youn
Habib Virji
2014/06/11 17:48:11
Done.
|
| + } else { |
| + setHasDirAutoFlagRecursively(this, false, strongDirectionalityTextNode); |
| + if (userAgentShadowRoot()) |
| + setHasDirAutoFlagRecursively(userAgentShadowRoot(), false); |
| + } |
| if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) |
| setNeedsStyleRecalc(SubtreeStyleChange); |
| } |