Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index c3848e786e7c5dc45f6e3d87db757a574632ec2a..fab67142222848293ead73cf2a67d91890024378 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -72,6 +72,7 @@ |
| #include "core/dom/Text.h" |
| #include "core/dom/custom/CustomElement.h" |
| #include "core/dom/custom/CustomElementRegistrationContext.h" |
| +#include "core/dom/shadow/ComposedTreeTraversal.h" |
| #include "core/dom/shadow/InsertionPoint.h" |
| #include "core/dom/shadow/ShadowRoot.h" |
| #include "core/editing/FrameSelection.h" |
| @@ -2578,7 +2579,7 @@ AtomicString Element::computeInheritedLanguage() const |
| value = toDocument(n)->contentLanguage(); |
| } |
| - n = n->parentNode(); |
| + n = ComposedTreeTraversal::parent(*n); |
|
hayato
2015/01/21 09:04:50
One tough issue around here is that ComposedTreeTr
kojii
2015/01/21 16:46:20
Understood, thank you for this.
I originally trie
|
| } while (n && value.isNull()); |
| return value; |
| @@ -2847,8 +2848,10 @@ SpellcheckAttributeState Element::spellcheckAttributeState() const |
| bool Element::isSpellCheckingEnabled() const |
| { |
| - for (const Element* element = this; element; element = element->parentOrShadowHostElement()) { |
| - switch (element->spellcheckAttributeState()) { |
| + for (const Node* node = this; node; node = ComposedTreeTraversal::parent(*node)) { |
| + if (!node->isElementNode()) |
| + continue; |
| + switch (toElement(node)->spellcheckAttributeState()) { |
| case SpellcheckAttributeTrue: |
| return true; |
| case SpellcheckAttributeFalse: |