| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 Apple 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 AccessibilityObject* AXObjectCache::getOrCreate(Widget* widget) | 310 AccessibilityObject* AXObjectCache::getOrCreate(Widget* widget) |
| 311 { | 311 { |
| 312 if (!widget) | 312 if (!widget) |
| 313 return 0; | 313 return 0; |
| 314 | 314 |
| 315 if (AccessibilityObject* obj = get(widget)) | 315 if (AccessibilityObject* obj = get(widget)) |
| 316 return obj; | 316 return obj; |
| 317 | 317 |
| 318 RefPtr<AccessibilityObject> newObj = 0; | 318 RefPtr<AccessibilityObject> newObj = 0; |
| 319 if (widget->isFrameView()) | 319 if (widget->isFrameView()) |
| 320 newObj = AccessibilityScrollView::create(static_cast<ScrollView*>(widget
)); | 320 newObj = AccessibilityScrollView::create(toScrollView(widget)); |
| 321 else if (widget->isScrollbar()) | 321 else if (widget->isScrollbar()) |
| 322 newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget))
; | 322 newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget))
; |
| 323 | 323 |
| 324 // Will crash later if we have two objects for the same widget. | 324 // Will crash later if we have two objects for the same widget. |
| 325 ASSERT(!get(widget)); | 325 ASSERT(!get(widget)); |
| 326 | 326 |
| 327 getAXID(newObj.get()); | 327 getAXID(newObj.get()); |
| 328 | 328 |
| 329 m_widgetObjectMapping.set(widget, newObj->axObjectID()); | 329 m_widgetObjectMapping.set(widget, newObj->axObjectID()); |
| 330 m_objects.set(newObj->axObjectID(), newObj); | 330 m_objects.set(newObj->axObjectID(), newObj); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 if (!obj->axObjectID()) | 628 if (!obj->axObjectID()) |
| 629 continue; | 629 continue; |
| 630 | 630 |
| 631 if (!obj->axObjectCache()) | 631 if (!obj->axObjectCache()) |
| 632 continue; | 632 continue; |
| 633 | 633 |
| 634 #ifndef NDEBUG | 634 #ifndef NDEBUG |
| 635 // Make sure none of the render views are in the process of being layed
out. | 635 // Make sure none of the render views are in the process of being layed
out. |
| 636 // Notifications should only be sent after the renderer has finished | 636 // Notifications should only be sent after the renderer has finished |
| 637 if (obj->isAccessibilityRenderObject()) { | 637 if (obj->isAccessibilityRenderObject()) { |
| 638 AccessibilityRenderObject* renderObj = static_cast<AccessibilityRend
erObject*>(obj); | 638 AccessibilityRenderObject* renderObj = toAccessibilityRenderObject(o
bj); |
| 639 RenderObject* renderer = renderObj->renderer(); | 639 RenderObject* renderer = renderObj->renderer(); |
| 640 if (renderer && renderer->view()) | 640 if (renderer && renderer->view()) |
| 641 ASSERT(!renderer->view()->layoutState()); | 641 ASSERT(!renderer->view()->layoutState()); |
| 642 } | 642 } |
| 643 #endif | 643 #endif |
| 644 | 644 |
| 645 AXNotification notification = m_notificationsToPost[i].second; | 645 AXNotification notification = m_notificationsToPost[i].second; |
| 646 postPlatformNotification(obj, notification); | 646 postPlatformNotification(obj, notification); |
| 647 | 647 |
| 648 if (notification == AXChildrenChanged && obj->parentObjectIfExists() &&
obj->lastKnownIsIgnoredValue() != obj->accessibilityIsIgnored()) | 648 if (notification == AXChildrenChanged && obj->parentObjectIfExists() &&
obj->lastKnownIsIgnoredValue() != obj->accessibilityIsIgnored()) |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) | 968 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) |
| 969 { | 969 { |
| 970 // The anchor node may not be accessible. Post the notification for the | 970 // The anchor node may not be accessible. Post the notification for the |
| 971 // first accessible object. | 971 // first accessible object. |
| 972 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode(
anchorNode), AXScrolledToAnchor); | 972 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode(
anchorNode), AXScrolledToAnchor); |
| 973 } | 973 } |
| 974 | 974 |
| 975 } // namespace WebCore | 975 } // namespace WebCore |
| 976 | 976 |
| 977 #endif // HAVE(ACCESSIBILITY) | 977 #endif // HAVE(ACCESSIBILITY) |
| OLD | NEW |