Chromium Code Reviews| 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) |