Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Unified Diff: Source/core/dom/Element.cpp

Issue 859943002: Use the composed tree for the title attributes in Shadow DOM (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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:

Powered by Google App Engine
This is Rietveld 408576698