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

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

Issue 1883083002: Introduce Node::containingTreeScope(), which asserts that the node's root is a tree scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index fe8f945943988dc2dfd501ec228d51f66d6d92c7..9694d1407ad4c4e5844fc8192a7563917e211943 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2209,7 +2209,7 @@ void Element::parseAttribute(const QualifiedName& name, const AtomicString&, con
int tabindex = 0;
if (value.isEmpty()) {
clearTabIndexExplicitlyIfNeeded();
- if (treeScope().adjustedFocusedElement() == this) {
+ if (isInTreeScope() && rootTreeScope().adjustedFocusedElement() == this) {
esprehn 2016/04/27 07:52:23 Why do we need to add the check here? We do adjust
hayato 2016/05/23 06:22:09 Done. Yeah, TreeScope::adjustedFocusedElement() c
// We might want to call blur(), but it's dangerous to dispatch
// events here.
document().setNeedsFocusedElementCheck();
@@ -2407,7 +2407,7 @@ void Element::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior)
void Element::blur()
{
cancelFocusAppearanceUpdate();
- if (treeScope().adjustedFocusedElement() == this) {
+ if (isInTreeScope() && rootTreeScope().adjustedFocusedElement() == this) {
Document& doc = document();
if (doc.page())
doc.page()->focusController().setFocusedElement(0, doc.frame());
@@ -3129,7 +3129,7 @@ inline void Element::updateId(const AtomicString& oldId, const AtomicString& new
if (oldId == newId)
return;
- updateId(treeScope(), oldId, newId);
+ updateId(rootTreeScope(), oldId, newId);
}
inline void Element::updateId(TreeScope& scope, const AtomicString& oldId, const AtomicString& newId)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/LiveNodeListBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698