Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index 98cd8dd6a9e2cff06694ae5b82d463c4df0a3985..0ffed934991ab3043156260707ee2bc28a9f61c9 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -2245,12 +2245,11 @@ void Document::removeAllEventListeners() |
Document& Document::axObjectCacheOwner() const |
{ |
- Document& top = topDocument(); |
- if (top.frame() && top.frame()->pagePopupOwner()) { |
- ASSERT(!top.m_axObjectCache); |
- return top.frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
+ if (frame() && frame()->pagePopupOwner()) { |
+ ASSERT(!m_axObjectCache); |
+ return frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
} |
- return top; |
+ return *const_cast<Document*>(this); |
} |
void Document::clearAXObjectCache() |
@@ -3542,7 +3541,7 @@ bool Document::setFocusedElement(PassRefPtrWillBeRawPtr<Element> prpNewFocusedEl |
} |
} |
- if (!focusChangeBlocked && m_focusedElement) { |
+ if (!focusChangeBlocked) { |
// Create the AXObject cache in a focus change because Chromium relies on it. |
if (AXObjectCache* cache = axObjectCache()) |
cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFocusedElement.get()); |