Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014, Google Inc. All rights reserved. | 2 * Copyright (C) 2014, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 | 83 |
| 84 using namespace HTMLNames; | 84 using namespace HTMLNames; |
| 85 | 85 |
| 86 // static | 86 // static |
| 87 PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCacheImpl::create(Document& docume nt) | 87 PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCacheImpl::create(Document& docume nt) |
| 88 { | 88 { |
| 89 return adoptPtrWillBeNoop(new AXObjectCacheImpl(document)); | 89 return adoptPtrWillBeNoop(new AXObjectCacheImpl(document)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 AXObjectCacheImpl::AXObjectCacheImpl(Document& document) | 92 AXObjectCacheImpl::AXObjectCacheImpl(Document& document) |
| 93 : m_document(document) | 93 : m_document(&document) |
| 94 , m_modificationCount(0) | 94 , m_modificationCount(0) |
| 95 #if ENABLE(ASSERT) | 95 #if ENABLE(ASSERT) |
| 96 , m_hasBeenDisposed(false) | 96 , m_hasBeenDisposed(false) |
| 97 #endif | 97 #endif |
| 98 , m_notificationPostTimer(this, &AXObjectCacheImpl::notificationPostTimerFir ed) | 98 , m_notificationPostTimer(this, &AXObjectCacheImpl::notificationPostTimerFir ed) |
| 99 { | 99 { |
| 100 } | 100 } |
| 101 | 101 |
| 102 AXObjectCacheImpl::~AXObjectCacheImpl() | 102 AXObjectCacheImpl::~AXObjectCacheImpl() |
| 103 { | 103 { |
| 104 ASSERT(m_hasBeenDisposed); | 104 ASSERT(m_hasBeenDisposed); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void AXObjectCacheImpl::dispose() | 107 void AXObjectCacheImpl::dispose() |
| 108 { | 108 { |
| 109 m_notificationPostTimer.stop(); | 109 m_notificationPostTimer.stop(); |
| 110 | 110 |
| 111 HashMap<AXID, RefPtr<AXObject>>::iterator end = m_objects.end(); | 111 for (auto& entry : m_objects) { |
|
haraken
2015/06/09 02:25:45
(This is a question not related to this CL.)
Sigb
| |
| 112 for (HashMap<AXID, RefPtr<AXObject>>::iterator it = m_objects.begin(); it != end; ++it) { | 112 AXObject* obj = entry.value.get(); |
| 113 AXObject* obj = (*it).value.get(); | |
| 114 obj->detach(); | 113 obj->detach(); |
| 115 removeAXID(obj); | 114 removeAXID(obj); |
| 116 } | 115 } |
| 117 | 116 |
| 118 #if ENABLE(ASSERT) | 117 #if ENABLE(ASSERT) |
| 119 m_hasBeenDisposed = true; | 118 m_hasBeenDisposed = true; |
| 120 #endif | 119 #endif |
| 121 } | 120 } |
| 122 | 121 |
| 123 AXObject* AXObjectCacheImpl::root() | 122 AXObject* AXObjectCacheImpl::root() |
| 124 { | 123 { |
| 125 return getOrCreate(&m_document); | 124 return getOrCreate(m_document); |
| 126 } | 125 } |
| 127 | 126 |
| 128 AXObject* AXObjectCacheImpl::focusedImageMapUIElement(HTMLAreaElement* areaEleme nt) | 127 AXObject* AXObjectCacheImpl::focusedImageMapUIElement(HTMLAreaElement* areaEleme nt) |
| 129 { | 128 { |
| 130 // Find the corresponding accessibility object for the HTMLAreaElement. This should be | 129 // Find the corresponding accessibility object for the HTMLAreaElement. This should be |
| 131 // in the list of children for its corresponding image. | 130 // in the list of children for its corresponding image. |
| 132 if (!areaElement) | 131 if (!areaElement) |
| 133 return 0; | 132 return 0; |
| 134 | 133 |
| 135 HTMLImageElement* imageElement = areaElement->imageElement(); | 134 HTMLImageElement* imageElement = areaElement->imageElement(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 // FIXME: This probably belongs on Node. | 270 // FIXME: This probably belongs on Node. |
| 272 // FIXME: This should take a const char*, but one caller passes nullAtom. | 271 // FIXME: This should take a const char*, but one caller passes nullAtom. |
| 273 bool nodeHasRole(Node* node, const String& role) | 272 bool nodeHasRole(Node* node, const String& role) |
| 274 { | 273 { |
| 275 if (!node || !node->isElementNode()) | 274 if (!node || !node->isElementNode()) |
| 276 return false; | 275 return false; |
| 277 | 276 |
| 278 return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role); | 277 return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role); |
| 279 } | 278 } |
| 280 | 279 |
| 281 PassRefPtr<AXObject> AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutO bject) | 280 PassRefPtrWillBeRawPtr<AXObject> AXObjectCacheImpl::createFromRenderer(LayoutObj ect* layoutObject) |
| 282 { | 281 { |
| 283 // FIXME: How could layoutObject->node() ever not be an Element? | 282 // FIXME: How could layoutObject->node() ever not be an Element? |
| 284 Node* node = layoutObject->node(); | 283 Node* node = layoutObject->node(); |
| 285 | 284 |
| 286 // If the node is aria role="list" or the aria role is empty and its a | 285 // If the node is aria role="list" or the aria role is empty and its a |
| 287 // ul/ol/dl type (it shouldn't be a list if aria says otherwise). | 286 // ul/ol/dl type (it shouldn't be a list if aria says otherwise). |
| 288 if (nodeHasRole(node, "list") || nodeHasRole(node, "directory") | 287 if (nodeHasRole(node, "list") || nodeHasRole(node, "directory") |
| 289 || (nodeHasRole(node, nullAtom) && (isHTMLUListElement(node) || isHTMLOL istElement(node) || isHTMLDListElement(node)))) | 288 || (nodeHasRole(node, nullAtom) && (isHTMLUListElement(node) || isHTMLOL istElement(node) || isHTMLDListElement(node)))) |
| 290 return AXList::create(layoutObject, this); | 289 return AXList::create(layoutObject, this); |
| 291 | 290 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 return AXProgressIndicator::create(toLayoutProgress(cssBox), this); | 326 return AXProgressIndicator::create(toLayoutProgress(cssBox), this); |
| 328 | 327 |
| 329 // input type=range | 328 // input type=range |
| 330 if (cssBox->isSlider()) | 329 if (cssBox->isSlider()) |
| 331 return AXSlider::create(toLayoutSlider(cssBox), this); | 330 return AXSlider::create(toLayoutSlider(cssBox), this); |
| 332 } | 331 } |
| 333 | 332 |
| 334 return AXLayoutObject::create(layoutObject, this); | 333 return AXLayoutObject::create(layoutObject, this); |
| 335 } | 334 } |
| 336 | 335 |
| 337 PassRefPtr<AXObject> AXObjectCacheImpl::createFromNode(Node* node) | 336 PassRefPtrWillBeRawPtr<AXObject> AXObjectCacheImpl::createFromNode(Node* node) |
| 338 { | 337 { |
| 339 if (isMenuListOption(node)) | 338 if (isMenuListOption(node)) |
| 340 return AXMenuListOption::create(toHTMLOptionElement(node), this); | 339 return AXMenuListOption::create(toHTMLOptionElement(node), this); |
| 341 | 340 |
| 342 return AXNodeObject::create(node, this); | 341 return AXNodeObject::create(node, this); |
| 343 } | 342 } |
| 344 | 343 |
| 345 PassRefPtr<AXObject> AXObjectCacheImpl::createFromInlineTextBox(AbstractInlineTe xtBox* inlineTextBox) | 344 PassRefPtrWillBeRawPtr<AXObject> AXObjectCacheImpl::createFromInlineTextBox(Abst ractInlineTextBox* inlineTextBox) |
| 346 { | 345 { |
| 347 return AXInlineTextBox::create(inlineTextBox, this); | 346 return AXInlineTextBox::create(inlineTextBox, this); |
| 348 } | 347 } |
| 349 | 348 |
| 350 AXObject* AXObjectCacheImpl::getOrCreate(Widget* widget) | 349 AXObject* AXObjectCacheImpl::getOrCreate(Widget* widget) |
| 351 { | 350 { |
| 352 if (!widget) | 351 if (!widget) |
| 353 return 0; | 352 return 0; |
| 354 | 353 |
| 355 if (AXObject* obj = get(widget)) | 354 if (AXObject* obj = get(widget)) |
| 356 return obj; | 355 return obj; |
| 357 | 356 |
| 358 RefPtr<AXObject> newObj = nullptr; | 357 RefPtrWillBeRawPtr<AXObject> newObj = nullptr; |
| 359 if (widget->isFrameView()) { | 358 if (widget->isFrameView()) { |
| 360 FrameView* frameView = toFrameView(widget); | 359 FrameView* frameView = toFrameView(widget); |
| 361 | 360 |
| 362 // Don't create an AXScrollView for a FrameView that isn't attached to a frame, | 361 // Don't create an AXScrollView for a FrameView that isn't attached to a frame, |
| 363 // for example if it's in the process of being disposed. | 362 // for example if it's in the process of being disposed. |
| 364 if (frameView->frame().view() != frameView || !frameView->layoutView()) | 363 if (frameView->frame().view() != frameView || !frameView->layoutView()) |
| 365 return 0; | 364 return 0; |
| 366 | 365 |
| 367 newObj = AXScrollView::create(toFrameView(widget), this); | 366 newObj = AXScrollView::create(toFrameView(widget), this); |
| 368 } else if (widget->isScrollbar()) | 367 } else if (widget->isScrollbar()) |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 394 | 393 |
| 395 if (node->layoutObject()) | 394 if (node->layoutObject()) |
| 396 return getOrCreate(node->layoutObject()); | 395 return getOrCreate(node->layoutObject()); |
| 397 | 396 |
| 398 if (!node->parentElement()) | 397 if (!node->parentElement()) |
| 399 return 0; | 398 return 0; |
| 400 | 399 |
| 401 if (isHTMLHeadElement(node)) | 400 if (isHTMLHeadElement(node)) |
| 402 return 0; | 401 return 0; |
| 403 | 402 |
| 404 RefPtr<AXObject> newObj = createFromNode(node); | 403 RefPtrWillBeRawPtr<AXObject> newObj = createFromNode(node); |
| 405 | 404 |
| 406 // Will crash later if we have two objects for the same node. | 405 // Will crash later if we have two objects for the same node. |
| 407 ASSERT(!get(node)); | 406 ASSERT(!get(node)); |
| 408 | 407 |
| 409 getAXID(newObj.get()); | 408 getAXID(newObj.get()); |
| 410 | 409 |
| 411 m_nodeObjectMapping.set(node, newObj->axObjectID()); | 410 m_nodeObjectMapping.set(node, newObj->axObjectID()); |
| 412 m_objects.set(newObj->axObjectID(), newObj); | 411 m_objects.set(newObj->axObjectID(), newObj); |
| 413 newObj->init(); | 412 newObj->init(); |
| 414 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); | 413 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); |
| 415 | 414 |
| 416 if (node->isElementNode()) | 415 if (node->isElementNode()) |
| 417 updateTreeIfElementIdIsAriaOwned(toElement(node)); | 416 updateTreeIfElementIdIsAriaOwned(toElement(node)); |
| 418 | 417 |
| 419 return newObj.get(); | 418 return newObj.get(); |
| 420 } | 419 } |
| 421 | 420 |
| 422 AXObject* AXObjectCacheImpl::getOrCreate(LayoutObject* layoutObject) | 421 AXObject* AXObjectCacheImpl::getOrCreate(LayoutObject* layoutObject) |
| 423 { | 422 { |
| 424 if (!layoutObject) | 423 if (!layoutObject) |
| 425 return 0; | 424 return 0; |
| 426 | 425 |
| 427 if (AXObject* obj = get(layoutObject)) | 426 if (AXObject* obj = get(layoutObject)) |
| 428 return obj; | 427 return obj; |
| 429 | 428 |
| 430 RefPtr<AXObject> newObj = createFromRenderer(layoutObject); | 429 RefPtrWillBeRawPtr<AXObject> newObj = createFromRenderer(layoutObject); |
| 431 | 430 |
| 432 // Will crash later if we have two objects for the same layoutObject. | 431 // Will crash later if we have two objects for the same layoutObject. |
| 433 ASSERT(!get(layoutObject)); | 432 ASSERT(!get(layoutObject)); |
| 434 | 433 |
| 435 getAXID(newObj.get()); | 434 getAXID(newObj.get()); |
| 436 | 435 |
| 437 m_layoutObjectMapping.set(layoutObject, newObj->axObjectID()); | 436 m_layoutObjectMapping.set(layoutObject, newObj->axObjectID()); |
| 438 m_objects.set(newObj->axObjectID(), newObj); | 437 m_objects.set(newObj->axObjectID(), newObj); |
| 439 newObj->init(); | 438 newObj->init(); |
| 440 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); | 439 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); |
| 441 | 440 |
| 442 return newObj.get(); | 441 return newObj.get(); |
| 443 } | 442 } |
| 444 | 443 |
| 445 AXObject* AXObjectCacheImpl::getOrCreate(AbstractInlineTextBox* inlineTextBox) | 444 AXObject* AXObjectCacheImpl::getOrCreate(AbstractInlineTextBox* inlineTextBox) |
| 446 { | 445 { |
| 447 if (!inlineTextBox) | 446 if (!inlineTextBox) |
| 448 return 0; | 447 return 0; |
| 449 | 448 |
| 450 if (AXObject* obj = get(inlineTextBox)) | 449 if (AXObject* obj = get(inlineTextBox)) |
| 451 return obj; | 450 return obj; |
| 452 | 451 |
| 453 RefPtr<AXObject> newObj = createFromInlineTextBox(inlineTextBox); | 452 RefPtrWillBeRawPtr<AXObject> newObj = createFromInlineTextBox(inlineTextBox) ; |
| 454 | 453 |
| 455 // Will crash later if we have two objects for the same inlineTextBox. | 454 // Will crash later if we have two objects for the same inlineTextBox. |
| 456 ASSERT(!get(inlineTextBox)); | 455 ASSERT(!get(inlineTextBox)); |
| 457 | 456 |
| 458 getAXID(newObj.get()); | 457 getAXID(newObj.get()); |
| 459 | 458 |
| 460 m_inlineTextBoxObjectMapping.set(inlineTextBox, newObj->axObjectID()); | 459 m_inlineTextBoxObjectMapping.set(inlineTextBox, newObj->axObjectID()); |
| 461 m_objects.set(newObj->axObjectID(), newObj); | 460 m_objects.set(newObj->axObjectID(), newObj); |
| 462 newObj->init(); | 461 newObj->init(); |
| 463 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); | 462 newObj->setLastKnownIsIgnoredValue(newObj->accessibilityIsIgnored()); |
| 464 | 463 |
| 465 return newObj.get(); | 464 return newObj.get(); |
| 466 } | 465 } |
| 467 | 466 |
| 468 AXObject* AXObjectCacheImpl::rootObject() | 467 AXObject* AXObjectCacheImpl::rootObject() |
| 469 { | 468 { |
| 470 if (!accessibilityEnabled()) | 469 if (!accessibilityEnabled()) |
| 471 return 0; | 470 return 0; |
| 472 | 471 |
| 473 return getOrCreate(m_document.view()); | 472 return getOrCreate(m_document->view()); |
| 474 } | 473 } |
| 475 | 474 |
| 476 AXObject* AXObjectCacheImpl::getOrCreate(AccessibilityRole role) | 475 AXObject* AXObjectCacheImpl::getOrCreate(AccessibilityRole role) |
| 477 { | 476 { |
| 478 RefPtr<AXObject> obj = nullptr; | 477 RefPtrWillBeRawPtr<AXObject> obj = nullptr; |
| 479 | 478 |
| 480 // will be filled in... | 479 // will be filled in... |
| 481 switch (role) { | 480 switch (role) { |
| 482 case ImageMapLinkRole: | 481 case ImageMapLinkRole: |
| 483 obj = AXImageMapLink::create(this); | 482 obj = AXImageMapLink::create(this); |
| 484 break; | 483 break; |
| 485 case ColumnRole: | 484 case ColumnRole: |
| 486 obj = AXTableColumn::create(this); | 485 obj = AXTableColumn::create(this); |
| 487 break; | 486 break; |
| 488 case TableHeaderContainerRole: | 487 case TableHeaderContainerRole: |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 AXID axID = m_widgetObjectMapping.get(view); | 569 AXID axID = m_widgetObjectMapping.get(view); |
| 571 remove(axID); | 570 remove(axID); |
| 572 m_widgetObjectMapping.remove(view); | 571 m_widgetObjectMapping.remove(view); |
| 573 } | 572 } |
| 574 | 573 |
| 575 void AXObjectCacheImpl::remove(AbstractInlineTextBox* inlineTextBox) | 574 void AXObjectCacheImpl::remove(AbstractInlineTextBox* inlineTextBox) |
| 576 { | 575 { |
| 577 if (!inlineTextBox) | 576 if (!inlineTextBox) |
| 578 return; | 577 return; |
| 579 | 578 |
| 579 #if ENABLE(OILPAN) | |
| 580 remove(m_inlineTextBoxObjectMapping.get(inlineTextBox)); | |
|
dmazzoni
2015/06/08 15:25:49
What's wrong with the code to remove by AXID? I do
keishi
2015/06/09 05:51:19
Sorry, this was left over from my previous patch.
| |
| 581 #else | |
| 580 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox); | 582 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox); |
| 581 remove(axID); | 583 remove(axID); |
| 584 #endif | |
| 582 m_inlineTextBoxObjectMapping.remove(inlineTextBox); | 585 m_inlineTextBoxObjectMapping.remove(inlineTextBox); |
| 583 } | 586 } |
| 584 | 587 |
| 585 // FIXME: Oilpan: Use a weak hashmap for this instead. | 588 |
| 586 void AXObjectCacheImpl::clearWeakMembers(Visitor* visitor) | 589 void AXObjectCacheImpl::clearWeakMembers(Visitor* visitor) |
| 587 { | 590 { |
| 588 Vector<Node*> deadNodes; | |
| 589 for (HashMap<Node*, AXID>::iterator it = m_nodeObjectMapping.begin(); it != m_nodeObjectMapping.end(); ++it) { | |
| 590 if (!Heap::isHeapObjectAlive(it->key)) | |
| 591 deadNodes.append(it->key); | |
| 592 } | |
| 593 for (unsigned i = 0; i < deadNodes.size(); ++i) | |
| 594 remove(deadNodes[i]); | |
| 595 | |
| 596 Vector<Widget*> deadWidgets; | 591 Vector<Widget*> deadWidgets; |
| 597 for (HashMap<Widget*, AXID>::iterator it = m_widgetObjectMapping.begin(); | 592 for (auto& entry : m_widgetObjectMapping) { |
|
haraken
2015/06/09 02:25:45
Why do we still need the weak processing for m_wid
keishi
2015/06/09 05:51:19
Done. I thought I needed this but I I think I was
| |
| 598 it != m_widgetObjectMapping.end(); ++it) { | 593 if (!Heap::isHeapObjectAlive(entry.key)) |
| 599 if (!Heap::isHeapObjectAlive(it->key)) | 594 deadWidgets.append(entry.key); |
| 600 deadWidgets.append(it->key); | |
| 601 } | 595 } |
| 602 for (unsigned i = 0; i < deadWidgets.size(); ++i) | 596 for (unsigned i = 0; i < deadWidgets.size(); ++i) |
| 603 remove(deadWidgets[i]); | 597 remove(deadWidgets[i]); |
| 604 } | 598 } |
| 605 | 599 |
| 606 AXID AXObjectCacheImpl::platformGenerateAXID() const | 600 AXID AXObjectCacheImpl::platformGenerateAXID() const |
| 607 { | 601 { |
| 608 static AXID lastUsedID = 0; | 602 static AXID lastUsedID = 0; |
| 609 | 603 |
| 610 // Generate a new ID. | 604 // Generate a new ID. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 void AXObjectCacheImpl::childrenChanged(AXObject* obj) | 700 void AXObjectCacheImpl::childrenChanged(AXObject* obj) |
| 707 { | 701 { |
| 708 if (!obj) | 702 if (!obj) |
| 709 return; | 703 return; |
| 710 | 704 |
| 711 obj->childrenChanged(); | 705 obj->childrenChanged(); |
| 712 } | 706 } |
| 713 | 707 |
| 714 void AXObjectCacheImpl::notificationPostTimerFired(Timer<AXObjectCacheImpl>*) | 708 void AXObjectCacheImpl::notificationPostTimerFired(Timer<AXObjectCacheImpl>*) |
| 715 { | 709 { |
| 716 RefPtrWillBeRawPtr<Document> protectorForCacheOwner(m_document); | 710 RefPtrWillBeRawPtr<Document> protectorForCacheOwner(m_document.get()); |
|
dmazzoni
2015/06/08 15:25:49
Can we just delete this line of code in oilpan? Th
haraken
2015/06/09 02:25:45
You're right.
We had a similar discussion before
| |
| 717 | 711 |
| 718 m_notificationPostTimer.stop(); | 712 m_notificationPostTimer.stop(); |
| 719 | 713 |
| 720 unsigned i = 0, count = m_notificationsToPost.size(); | 714 unsigned i = 0, count = m_notificationsToPost.size(); |
| 721 for (i = 0; i < count; ++i) { | 715 for (i = 0; i < count; ++i) { |
| 722 AXObject* obj = m_notificationsToPost[i].first.get(); | 716 AXObject* obj = m_notificationsToPost[i].first.get(); |
| 723 | 717 |
| 724 if (!obj->axObjectID()) | 718 if (!obj->axObjectID()) |
| 725 continue; | 719 continue; |
| 726 | 720 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 if (AXObject* obj = get(layoutObject)) { | 1100 if (AXObject* obj = get(layoutObject)) { |
| 1107 if (!obj->needsToUpdateChildren()) { | 1101 if (!obj->needsToUpdateChildren()) { |
| 1108 obj->setNeedsToUpdateChildren(); | 1102 obj->setNeedsToUpdateChildren(); |
| 1109 postNotification(layoutObject, AXChildrenChanged); | 1103 postNotification(layoutObject, AXChildrenChanged); |
| 1110 } | 1104 } |
| 1111 } | 1105 } |
| 1112 } | 1106 } |
| 1113 | 1107 |
| 1114 Settings* AXObjectCacheImpl::settings() | 1108 Settings* AXObjectCacheImpl::settings() |
| 1115 { | 1109 { |
| 1116 return m_document.settings(); | 1110 return m_document->settings(); |
| 1117 } | 1111 } |
| 1118 | 1112 |
| 1119 bool AXObjectCacheImpl::accessibilityEnabled() | 1113 bool AXObjectCacheImpl::accessibilityEnabled() |
| 1120 { | 1114 { |
| 1121 Settings* settings = this->settings(); | 1115 Settings* settings = this->settings(); |
| 1122 if (!settings) | 1116 if (!settings) |
| 1123 return false; | 1117 return false; |
| 1124 return settings->accessibilityEnabled(); | 1118 return settings->accessibilityEnabled(); |
| 1125 } | 1119 } |
| 1126 | 1120 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1226 | 1220 |
| 1227 AXObject* focusedObject = focusedUIElementForPage(page); | 1221 AXObject* focusedObject = focusedUIElementForPage(page); |
| 1228 if (!focusedObject) | 1222 if (!focusedObject) |
| 1229 return; | 1223 return; |
| 1230 | 1224 |
| 1231 postPlatformNotification(focusedObject, AXFocusedUIElementChanged); | 1225 postPlatformNotification(focusedObject, AXFocusedUIElementChanged); |
| 1232 } | 1226 } |
| 1233 | 1227 |
| 1234 void AXObjectCacheImpl::handleInitialFocus() | 1228 void AXObjectCacheImpl::handleInitialFocus() |
| 1235 { | 1229 { |
| 1236 postNotification(&m_document, AXObjectCache::AXFocusedUIElementChanged); | 1230 postNotification(m_document, AXObjectCache::AXFocusedUIElementChanged); |
| 1237 } | 1231 } |
| 1238 | 1232 |
| 1239 void AXObjectCacheImpl::handleEditableTextContentChanged(Node* node) | 1233 void AXObjectCacheImpl::handleEditableTextContentChanged(Node* node) |
| 1240 { | 1234 { |
| 1241 AXObject* obj = get(node); | 1235 AXObject* obj = get(node); |
| 1242 while (obj && !obj->isNativeTextControl() && !obj->isNonNativeTextControl()) | 1236 while (obj && !obj->isNativeTextControl() && !obj->isNonNativeTextControl()) |
| 1243 obj = obj->parentObject(); | 1237 obj = obj->parentObject(); |
| 1244 postNotification(obj, AXObjectCache::AXValueChanged); | 1238 postNotification(obj, AXObjectCache::AXValueChanged); |
| 1245 } | 1239 } |
| 1246 | 1240 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1360 { | 1354 { |
| 1361 AXObject* obj = getOrCreate(element); | 1355 AXObject* obj = getOrCreate(element); |
| 1362 if (!obj) | 1356 if (!obj) |
| 1363 return; | 1357 return; |
| 1364 | 1358 |
| 1365 obj->setElementRect(rect); | 1359 obj->setElementRect(rect); |
| 1366 } | 1360 } |
| 1367 | 1361 |
| 1368 DEFINE_TRACE(AXObjectCacheImpl) | 1362 DEFINE_TRACE(AXObjectCacheImpl) |
| 1369 { | 1363 { |
| 1364 #if ENABLE(OILPAN) | |
| 1365 visitor->trace(m_document); | |
| 1366 visitor->trace(m_objects); | |
| 1367 visitor->trace(m_widgetObjectMapping); | |
| 1368 visitor->trace(m_nodeObjectMapping); | |
|
dmazzoni
2015/06/08 15:25:49
Why not m_inlineTextBoxObjectMapping here too?
haraken
2015/06/09 02:25:45
It is not on the oilpan's heap, so don't need to t
| |
| 1369 visitor->trace(m_notificationsToPost); | |
| 1370 visitor->trace(m_textMarkerNodes); | |
| 1371 #endif | |
| 1370 visitor->template registerWeakMembers<AXObjectCacheImpl, &AXObjectCacheImpl: :clearWeakMembers>(this); | 1372 visitor->template registerWeakMembers<AXObjectCacheImpl, &AXObjectCacheImpl: :clearWeakMembers>(this); |
| 1371 AXObjectCache::trace(visitor); | 1373 AXObjectCache::trace(visitor); |
| 1372 } | 1374 } |
| 1373 | 1375 |
| 1374 } // namespace blink | 1376 } // namespace blink |
| OLD | NEW |