OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/accessibility/InspectorAccessibilityAgent.h" | 5 #include "modules/accessibility/InspectorAccessibilityAgent.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/dom/AXObjectCache.h" | 8 #include "core/dom/AXObjectCache.h" |
9 #include "core/dom/DOMNodeIds.h" | 9 #include "core/dom/DOMNodeIds.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 if (!m_domAgent->enabled()) { | 375 if (!m_domAgent->enabled()) { |
376 *errorString = "DOM agent must be enabled"; | 376 *errorString = "DOM agent must be enabled"; |
377 return; | 377 return; |
378 } | 378 } |
379 Node* node = m_domAgent->assertNode(errorString, nodeId); | 379 Node* node = m_domAgent->assertNode(errorString, nodeId); |
380 if (!node) | 380 if (!node) |
381 return; | 381 return; |
382 | 382 |
383 Document& document = node->document(); | 383 Document& document = node->document(); |
| 384 document.updateStyleAndLayoutIgnorePendingStylesheets(); |
| 385 DocumentLifecycle::DisallowTransitionScope disallowTransition(document.lifec
ycle()); |
384 std::unique_ptr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(doc
ument); | 386 std::unique_ptr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(doc
ument); |
385 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); | 387 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); |
386 AXObject* axObject = cacheImpl->getOrCreate(node); | 388 AXObject* axObject = cacheImpl->getOrCreate(node); |
387 if (!axObject || axObject->accessibilityIsIgnored()) { | 389 if (!axObject || axObject->accessibilityIsIgnored()) { |
388 *accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl
); | 390 *accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl
); |
389 return; | 391 return; |
390 } | 392 } |
391 | 393 |
392 std::unique_ptr<protocol::Array<AXProperty>> properties = protocol::Array<AX
Property>::create(); | 394 std::unique_ptr<protocol::Array<AXProperty>> properties = protocol::Array<AX
Property>::create(); |
393 fillLiveRegionProperties(axObject, properties.get()); | 395 fillLiveRegionProperties(axObject, properties.get()); |
394 fillGlobalStates(axObject, properties.get()); | 396 fillGlobalStates(axObject, properties.get()); |
395 fillWidgetProperties(axObject, properties.get()); | 397 fillWidgetProperties(axObject, properties.get()); |
396 fillWidgetStates(axObject, properties.get()); | 398 fillWidgetStates(axObject, properties.get()); |
397 fillRelationships(axObject, properties.get()); | 399 fillRelationships(axObject, properties.get()); |
398 | 400 |
399 *accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, std::move
(properties)); | 401 *accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, std::move
(properties)); |
400 } | 402 } |
401 | 403 |
402 DEFINE_TRACE(InspectorAccessibilityAgent) | 404 DEFINE_TRACE(InspectorAccessibilityAgent) |
403 { | 405 { |
404 visitor->trace(m_page); | 406 visitor->trace(m_page); |
405 visitor->trace(m_domAgent); | 407 visitor->trace(m_domAgent); |
406 InspectorBaseAgent::trace(visitor); | 408 InspectorBaseAgent::trace(visitor); |
407 } | 409 } |
408 | 410 |
409 } // namespace blink | 411 } // namespace blink |
OLD | NEW |