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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 void Document::removeAllEventListeners() 2315 void Document::removeAllEventListeners()
2316 { 2316 {
2317 ContainerNode::removeAllEventListeners(); 2317 ContainerNode::removeAllEventListeners();
2318 2318
2319 if (LocalDOMWindow* domWindow = this->domWindow()) 2319 if (LocalDOMWindow* domWindow = this->domWindow())
2320 domWindow->removeAllEventListeners(); 2320 domWindow->removeAllEventListeners();
2321 } 2321 }
2322 2322
2323 Document& Document::axObjectCacheOwner() const 2323 Document& Document::axObjectCacheOwner() const
2324 { 2324 {
2325 // FIXME(dmazzoni): Currently there's one AXObjectCache per page, owned 2325 // Every document has its own axObjectCache if accessibility is enabled,
2326 // by the top document, but with --site-isolation the top document may 2326 // except for page popups, which share the axObjectCache of their owner.
2327 // be a remote frame. As a quick fix we're making the local root the owner 2327 Document* doc = const_cast<Document*>(this);
2328 // of the AXObjectCache (http://crbug.com/510410), but the proper fix 2328 if (doc->frame() && doc->frame()->pagePopupOwner()) {
2329 // will be for each Document to have its own AXObjectCache 2329 ASSERT(!doc->m_axObjectCache);
2330 // (http://crbug.com/532249). 2330 return doc->frame()->pagePopupOwner()->document().axObjectCacheOwner();
2331 Document* top = const_cast<Document*>(this);
2332 LocalFrame* frame = this->frame();
2333 if (!frame)
2334 return *top;
2335
2336 // This loop is more efficient than calling localFrameRoot.
2337 while (frame && frame->owner() && frame->owner()->isLocal()) {
2338 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(frame->owner());
2339 top = &owner->document();
2340 frame = top->frame();
2341 } 2331 }
2342 2332 return *doc;
2343 if (top->frame() && top->frame()->pagePopupOwner()) {
2344 ASSERT(!top->m_axObjectCache);
2345 return top->frame()->pagePopupOwner()->document().axObjectCacheOwner();
2346 }
2347
2348 ASSERT(top);
2349 return *top;
2350 } 2333 }
2351 2334
2352 void Document::clearAXObjectCache() 2335 void Document::clearAXObjectCache()
2353 { 2336 {
2354 ASSERT(&axObjectCacheOwner() == this); 2337 ASSERT(&axObjectCacheOwner() == this);
2355 // Clear the cache member variable before calling delete because attempts 2338 // Clear the cache member variable before calling delete because attempts
2356 // are made to access it during destruction. 2339 // are made to access it during destruction.
2357 if (m_axObjectCache) 2340 if (m_axObjectCache)
2358 m_axObjectCache->dispose(); 2341 m_axObjectCache->dispose();
2359 m_axObjectCache.clear(); 2342 m_axObjectCache.clear();
(...skipping 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
5996 #ifndef NDEBUG 5979 #ifndef NDEBUG
5997 using namespace blink; 5980 using namespace blink;
5998 void showLiveDocumentInstances() 5981 void showLiveDocumentInstances()
5999 { 5982 {
6000 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5983 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6001 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5984 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6002 for (Document* document : set) 5985 for (Document* document : set)
6003 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5986 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6004 } 5987 }
6005 #endif 5988 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698