| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 49 #include "core/accessibility/AXScrollView.h" | 49 #include "core/accessibility/AXScrollView.h" | 
| 50 #include "core/accessibility/AXScrollbar.h" | 50 #include "core/accessibility/AXScrollbar.h" | 
| 51 #include "core/accessibility/AXSlider.h" | 51 #include "core/accessibility/AXSlider.h" | 
| 52 #include "core/accessibility/AXSpinButton.h" | 52 #include "core/accessibility/AXSpinButton.h" | 
| 53 #include "core/accessibility/AXTable.h" | 53 #include "core/accessibility/AXTable.h" | 
| 54 #include "core/accessibility/AXTableCell.h" | 54 #include "core/accessibility/AXTableCell.h" | 
| 55 #include "core/accessibility/AXTableColumn.h" | 55 #include "core/accessibility/AXTableColumn.h" | 
| 56 #include "core/accessibility/AXTableHeaderContainer.h" | 56 #include "core/accessibility/AXTableHeaderContainer.h" | 
| 57 #include "core/accessibility/AXTableRow.h" | 57 #include "core/accessibility/AXTableRow.h" | 
| 58 #include "core/dom/Document.h" | 58 #include "core/dom/Document.h" | 
|  | 59 #include "core/frame/FrameView.h" | 
| 59 #include "core/frame/LocalFrame.h" | 60 #include "core/frame/LocalFrame.h" | 
| 60 #include "core/frame/Settings.h" | 61 #include "core/frame/Settings.h" | 
| 61 #include "core/html/HTMLAreaElement.h" | 62 #include "core/html/HTMLAreaElement.h" | 
| 62 #include "core/html/HTMLImageElement.h" | 63 #include "core/html/HTMLImageElement.h" | 
| 63 #include "core/html/HTMLInputElement.h" | 64 #include "core/html/HTMLInputElement.h" | 
| 64 #include "core/html/HTMLLabelElement.h" | 65 #include "core/html/HTMLLabelElement.h" | 
| 65 #include "core/page/Chrome.h" | 66 #include "core/page/Chrome.h" | 
| 66 #include "core/page/ChromeClient.h" | 67 #include "core/page/ChromeClient.h" | 
| 67 #include "core/page/FocusController.h" | 68 #include "core/page/FocusController.h" | 
| 68 #include "core/page/Page.h" | 69 #include "core/page/Page.h" | 
| 69 #include "core/rendering/AbstractInlineTextBox.h" | 70 #include "core/rendering/AbstractInlineTextBox.h" | 
| 70 #include "core/rendering/RenderListBox.h" | 71 #include "core/rendering/RenderListBox.h" | 
| 71 #include "core/rendering/RenderMenuList.h" | 72 #include "core/rendering/RenderMenuList.h" | 
| 72 #include "core/rendering/RenderProgress.h" | 73 #include "core/rendering/RenderProgress.h" | 
| 73 #include "core/rendering/RenderSlider.h" | 74 #include "core/rendering/RenderSlider.h" | 
| 74 #include "core/rendering/RenderTable.h" | 75 #include "core/rendering/RenderTable.h" | 
| 75 #include "core/rendering/RenderTableCell.h" | 76 #include "core/rendering/RenderTableCell.h" | 
| 76 #include "core/rendering/RenderTableRow.h" | 77 #include "core/rendering/RenderTableRow.h" | 
| 77 #include "core/rendering/RenderView.h" | 78 #include "core/rendering/RenderView.h" | 
| 78 #include "platform/scroll/ScrollView.h" |  | 
| 79 #include "wtf/PassRefPtr.h" | 79 #include "wtf/PassRefPtr.h" | 
| 80 | 80 | 
| 81 namespace blink { | 81 namespace blink { | 
| 82 | 82 | 
| 83 using namespace HTMLNames; | 83 using namespace HTMLNames; | 
| 84 | 84 | 
| 85 AXObjectInclusion AXComputedObjectAttributeCache::getIgnored(AXID id) const | 85 AXObjectInclusion AXComputedObjectAttributeCache::getIgnored(AXID id) const | 
| 86 { | 86 { | 
| 87     HashMap<AXID, CachedAXObjectAttributes>::const_iterator it = m_idMapping.fin
      d(id); | 87     HashMap<AXID, CachedAXObjectAttributes>::const_iterator it = m_idMapping.fin
      d(id); | 
| 88     return it != m_idMapping.end() ? it->value.ignored : DefaultBehavior; | 88     return it != m_idMapping.end() ? it->value.ignored : DefaultBehavior; | 
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 334 AXObject* AXObjectCache::getOrCreate(Widget* widget) | 334 AXObject* AXObjectCache::getOrCreate(Widget* widget) | 
| 335 { | 335 { | 
| 336     if (!widget) | 336     if (!widget) | 
| 337         return 0; | 337         return 0; | 
| 338 | 338 | 
| 339     if (AXObject* obj = get(widget)) | 339     if (AXObject* obj = get(widget)) | 
| 340         return obj; | 340         return obj; | 
| 341 | 341 | 
| 342     RefPtr<AXObject> newObj = nullptr; | 342     RefPtr<AXObject> newObj = nullptr; | 
| 343     if (widget->isFrameView()) | 343     if (widget->isFrameView()) | 
| 344         newObj = AXScrollView::create(toScrollView(widget)); | 344         newObj = AXScrollView::create(toFrameView(widget)); | 
| 345     else if (widget->isScrollbar()) | 345     else if (widget->isScrollbar()) | 
| 346         newObj = AXScrollbar::create(toScrollbar(widget)); | 346         newObj = AXScrollbar::create(toScrollbar(widget)); | 
| 347 | 347 | 
| 348     // Will crash later if we have two objects for the same widget. | 348     // Will crash later if we have two objects for the same widget. | 
| 349     ASSERT(!get(widget)); | 349     ASSERT(!get(widget)); | 
| 350 | 350 | 
| 351     // Catch the case if an (unsupported) widget type is used. Only FrameView an
      d ScrollBar are supported now. | 351     // Catch the case if an (unsupported) widget type is used. Only FrameView an
      d ScrollBar are supported now. | 
| 352     ASSERT(newObj); | 352     ASSERT(newObj); | 
| 353     if (!newObj) | 353     if (!newObj) | 
| 354         return 0; | 354         return 0; | 
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 799     postNotification(node, AXSelectedChildrenChanged, false); | 799     postNotification(node, AXSelectedChildrenChanged, false); | 
| 800 } | 800 } | 
| 801 | 801 | 
| 802 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) | 802 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) | 
| 803 { | 803 { | 
| 804     // postToElement is false so that you can pass in any child of an element an
      d it will go up the parent tree | 804     // postToElement is false so that you can pass in any child of an element an
      d it will go up the parent tree | 
| 805     // to find the container which should send out the notification. | 805     // to find the container which should send out the notification. | 
| 806     postNotification(renderer, AXSelectedChildrenChanged, false); | 806     postNotification(renderer, AXSelectedChildrenChanged, false); | 
| 807 } | 807 } | 
| 808 | 808 | 
| 809 void AXObjectCache::handleScrollbarUpdate(ScrollView* view) | 809 void AXObjectCache::handleScrollbarUpdate(FrameView* view) | 
| 810 { | 810 { | 
| 811     if (!view) | 811     if (!view) | 
| 812         return; | 812         return; | 
| 813 | 813 | 
| 814     // We don't want to create a scroll view from this method, only update an ex
      isting one. | 814     // We don't want to create a scroll view from this method, only update an ex
      isting one. | 
| 815     if (AXObject* scrollViewObject = get(view)) { | 815     if (AXObject* scrollViewObject = get(view)) { | 
| 816         m_computedObjectAttributeCache->clear(); | 816         m_computedObjectAttributeCache->clear(); | 
| 817         scrollViewObject->updateChildrenIfNecessary(); | 817         scrollViewObject->updateChildrenIfNecessary(); | 
| 818     } | 818     } | 
| 819 } | 819 } | 
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1020     postPlatformNotification(focusedObject, AXFocusedUIElementChanged); | 1020     postPlatformNotification(focusedObject, AXFocusedUIElementChanged); | 
| 1021 } | 1021 } | 
| 1022 | 1022 | 
| 1023 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) | 1023 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) | 
| 1024 { | 1024 { | 
| 1025     // The anchor node may not be accessible. Post the notification for the | 1025     // The anchor node may not be accessible. Post the notification for the | 
| 1026     // first accessible object. | 1026     // first accessible object. | 
| 1027     postPlatformNotification(AXObject::firstAccessibleObjectFromNode(anchorNode)
      , AXScrolledToAnchor); | 1027     postPlatformNotification(AXObject::firstAccessibleObjectFromNode(anchorNode)
      , AXScrolledToAnchor); | 
| 1028 } | 1028 } | 
| 1029 | 1029 | 
| 1030 void AXObjectCache::handleScrollPositionChanged(ScrollView* scrollView) | 1030 void AXObjectCache::handleScrollPositionChanged(FrameView* scrollView) | 
| 1031 { | 1031 { | 
| 1032     postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged); | 1032     postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged); | 
| 1033 } | 1033 } | 
| 1034 | 1034 | 
| 1035 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject) | 1035 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject) | 
| 1036 { | 1036 { | 
| 1037     postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
      ; | 1037     postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
      ; | 
| 1038 } | 1038 } | 
| 1039 | 1039 | 
| 1040 void AXObjectCache::setCanvasObjectBounds(Element* element, const LayoutRect& re
      ct) | 1040 void AXObjectCache::setCanvasObjectBounds(Element* element, const LayoutRect& re
      ct) | 
| 1041 { | 1041 { | 
| 1042     AXObject* obj = getOrCreate(element); | 1042     AXObject* obj = getOrCreate(element); | 
| 1043     if (!obj) | 1043     if (!obj) | 
| 1044         return; | 1044         return; | 
| 1045 | 1045 | 
| 1046     obj->setElementRect(rect); | 1046     obj->setElementRect(rect); | 
| 1047 } | 1047 } | 
| 1048 | 1048 | 
| 1049 } // namespace blink | 1049 } // namespace blink | 
| OLD | NEW | 
|---|