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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 495763005: Switch to using accessibilityEnabled and inlineTextBoxAccessibilityEnabled from settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 void Document::clearAXObjectCache() 2272 void Document::clearAXObjectCache()
2273 { 2273 {
2274 ASSERT(&axObjectCacheOwner() == this); 2274 ASSERT(&axObjectCacheOwner() == this);
2275 // Clear the cache member variable before calling delete because attempts 2275 // Clear the cache member variable before calling delete because attempts
2276 // are made to access it during destruction. 2276 // are made to access it during destruction.
2277 m_axObjectCache.clear(); 2277 m_axObjectCache.clear();
2278 } 2278 }
2279 2279
2280 AXObjectCache* Document::existingAXObjectCache() const 2280 AXObjectCache* Document::existingAXObjectCache() const
2281 { 2281 {
2282 if (!AXObjectCache::accessibilityEnabled())
2283 return 0;
2284
2285 // If the renderer is gone then we are in the process of destruction. 2282 // If the renderer is gone then we are in the process of destruction.
2286 // This method will be called before m_frame = 0. 2283 // This method will be called before m_frame = 0.
2287 if (!axObjectCacheOwner().renderView()) 2284 if (!axObjectCacheOwner().renderView())
2288 return 0; 2285 return 0;
2289 2286
2290 return axObjectCacheOwner().m_axObjectCache.get(); 2287 return axObjectCacheOwner().m_axObjectCache.get();
2291 } 2288 }
2292 2289
2293 AXObjectCache* Document::axObjectCache() const 2290 AXObjectCache* Document::axObjectCache() const
2294 { 2291 {
2295 if (!AXObjectCache::accessibilityEnabled()) 2292 Settings* settings = this->settings();
2293 if (!settings || !settings->accessibilityEnabled())
2296 return 0; 2294 return 0;
2297 2295
2298 // The only document that actually has a AXObjectCache is the top-level 2296 // The only document that actually has a AXObjectCache is the top-level
2299 // document. This is because we need to be able to get from any WebCoreAXOb ject 2297 // document. This is because we need to be able to get from any WebCoreAXOb ject
2300 // to any other WebCoreAXObject on the same page. Using a single cache allo ws 2298 // to any other WebCoreAXObject on the same page. Using a single cache allo ws
2301 // lookups across nested webareas (i.e. multiple documents). 2299 // lookups across nested webareas (i.e. multiple documents).
2302 Document& cacheOwner = this->axObjectCacheOwner(); 2300 Document& cacheOwner = this->axObjectCacheOwner();
2303 2301
2304 // If the document has already been detached, do not make a new axObjectCach e. 2302 // If the document has already been detached, do not make a new axObjectCach e.
2305 if (!cacheOwner.renderView()) 2303 if (!cacheOwner.renderView())
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2587 if (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->rende rer()->needsLayout())) { 2585 if (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->rende rer()->needsLayout())) {
2588 updateRenderTreeIfNeeded(); 2586 updateRenderTreeIfNeeded();
2589 2587
2590 // Always do a layout after loading if needed. 2588 // Always do a layout after loading if needed.
2591 if (view() && renderView() && (!renderView()->firstChild() || renderView ()->needsLayout())) 2589 if (view() && renderView() && (!renderView()->firstChild() || renderView ()->needsLayout()))
2592 view()->layout(); 2590 view()->layout();
2593 } 2591 }
2594 2592
2595 m_loadEventProgress = LoadEventCompleted; 2593 m_loadEventProgress = LoadEventCompleted;
2596 2594
2597 if (frame() && renderView() && AXObjectCache::accessibilityEnabled()) { 2595 if (frame() && renderView() && settings()->accessibilityEnabled()) {
2598 // The AX cache may have been cleared at this point, but we need to make sure it contains an 2596 // The AX cache may have been cleared at this point, but we need to make sure it contains an
2599 // AX object to send the notification to. getOrCreate will make sure tha t an valid AX object 2597 // AX object to send the notification to. getOrCreate will make sure tha t an valid AX object
2600 // exists in the cache (we ignore the return value because we don't need it here). This is 2598 // exists in the cache (we ignore the return value because we don't need it here). This is
2601 // only safe to call when a layout is not in progress, so it can not be used in postNotification. 2599 // only safe to call when a layout is not in progress, so it can not be used in postNotification.
2602 if (AXObjectCache* cache = axObjectCache()) { 2600 if (AXObjectCache* cache = axObjectCache()) {
2603 cache->getOrCreate(renderView()); 2601 cache->getOrCreate(renderView());
2604 if (this == &axObjectCacheOwner()) { 2602 if (this == &axObjectCacheOwner()) {
2605 cache->postNotification(renderView(), AXObjectCache::AXLoadCompl ete, true); 2603 cache->postNotification(renderView(), AXObjectCache::AXLoadCompl ete, true);
2606 } else { 2604 } else {
2607 // AXLoadComplete can only be posted on the top document, so if it's a document 2605 // AXLoadComplete can only be posted on the top document, so if it's a document
(...skipping 3201 matching lines...) Expand 10 before | Expand all | Expand 10 after
5809 using namespace blink; 5807 using namespace blink;
5810 void showLiveDocumentInstances() 5808 void showLiveDocumentInstances()
5811 { 5809 {
5812 WeakDocumentSet& set = liveDocumentSet(); 5810 WeakDocumentSet& set = liveDocumentSet();
5813 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5811 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5814 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5812 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5815 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5813 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5816 } 5814 }
5817 } 5815 }
5818 #endif 5816 #endif
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698