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

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

Issue 1761633002: One accessibility tree per frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix is-richly-editable test Created 4 years, 9 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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 3e2e08c5fd83597ce751980686ab01c35092cef5..85872f18179bc4ea129f9572fcc591b5c599cc6b 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2322,31 +2322,14 @@ void Document::removeAllEventListeners()
Document& Document::axObjectCacheOwner() const
{
- // FIXME(dmazzoni): Currently there's one AXObjectCache per page, owned
- // by the top document, but with --site-isolation the top document may
- // be a remote frame. As a quick fix we're making the local root the owner
- // of the AXObjectCache (http://crbug.com/510410), but the proper fix
- // will be for each Document to have its own AXObjectCache
- // (http://crbug.com/532249).
- Document* top = const_cast<Document*>(this);
- LocalFrame* frame = this->frame();
- if (!frame)
- return *top;
-
- // This loop is more efficient than calling localFrameRoot.
- while (frame && frame->owner() && frame->owner()->isLocal()) {
- HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(frame->owner());
- top = &owner->document();
- frame = top->frame();
- }
-
- if (top->frame() && top->frame()->pagePopupOwner()) {
- ASSERT(!top->m_axObjectCache);
- return top->frame()->pagePopupOwner()->document().axObjectCacheOwner();
+ // Every document has its own axObjectCache if accessibility is enabled,
+ // except for page popups, which share the axObjectCache of their owner.
+ Document* doc = const_cast<Document*>(this);
+ if (doc->frame() && doc->frame()->pagePopupOwner()) {
+ ASSERT(!doc->m_axObjectCache);
+ return doc->frame()->pagePopupOwner()->document().axObjectCacheOwner();
}
-
- ASSERT(top);
- return *top;
+ return *doc;
}
void Document::clearAXObjectCache()

Powered by Google App Engine
This is Rietveld 408576698