Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 9d708509afd13473ba6435c070254941081a3ec8..19b24fb15909a94498c317fc0d3b31d76adc7cd8 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -2233,12 +2233,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); |
dcheng
2015/09/17 21:54:08
If this method can return a mutable ref to this, i
dmazzoni
2015/09/17 22:11:57
Yeah, note that topDocument() is doing a const_cas
|
} |
void Document::clearAXObjectCache() |
@@ -3528,7 +3527,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()); |