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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1628283002: posinset and setsize for input type, radio, exposed in AX tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed isRadiobutton() Created 4 years, 9 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
OLDNEW
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 11 matching lines...) Expand all
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "modules/accessibility/AXObjectCacheImpl.h" 29 #include "modules/accessibility/AXObjectCacheImpl.h"
30 30
31 #include "core/HTMLNames.h" 31 #include "core/HTMLNames.h"
32 #include "core/InputTypeNames.h"
32 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
33 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
34 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
35 #include "core/frame/Settings.h" 36 #include "core/frame/Settings.h"
36 #include "core/html/HTMLAreaElement.h" 37 #include "core/html/HTMLAreaElement.h"
37 #include "core/html/HTMLImageElement.h" 38 #include "core/html/HTMLImageElement.h"
38 #include "core/html/HTMLInputElement.h" 39 #include "core/html/HTMLInputElement.h"
39 #include "core/html/HTMLLabelElement.h" 40 #include "core/html/HTMLLabelElement.h"
40 #include "core/html/HTMLOptionElement.h" 41 #include "core/html/HTMLOptionElement.h"
41 #include "core/html/HTMLSelectElement.h" 42 #include "core/html/HTMLSelectElement.h"
(...skipping 16 matching lines...) Expand all
58 #include "modules/accessibility/AXInlineTextBox.h" 59 #include "modules/accessibility/AXInlineTextBox.h"
59 #include "modules/accessibility/AXLayoutObject.h" 60 #include "modules/accessibility/AXLayoutObject.h"
60 #include "modules/accessibility/AXList.h" 61 #include "modules/accessibility/AXList.h"
61 #include "modules/accessibility/AXListBox.h" 62 #include "modules/accessibility/AXListBox.h"
62 #include "modules/accessibility/AXListBoxOption.h" 63 #include "modules/accessibility/AXListBoxOption.h"
63 #include "modules/accessibility/AXMediaControls.h" 64 #include "modules/accessibility/AXMediaControls.h"
64 #include "modules/accessibility/AXMenuList.h" 65 #include "modules/accessibility/AXMenuList.h"
65 #include "modules/accessibility/AXMenuListOption.h" 66 #include "modules/accessibility/AXMenuListOption.h"
66 #include "modules/accessibility/AXMenuListPopup.h" 67 #include "modules/accessibility/AXMenuListPopup.h"
67 #include "modules/accessibility/AXProgressIndicator.h" 68 #include "modules/accessibility/AXProgressIndicator.h"
69 #include "modules/accessibility/AXRadioInput.h"
68 #include "modules/accessibility/AXSVGRoot.h" 70 #include "modules/accessibility/AXSVGRoot.h"
69 #include "modules/accessibility/AXSlider.h" 71 #include "modules/accessibility/AXSlider.h"
70 #include "modules/accessibility/AXSpinButton.h" 72 #include "modules/accessibility/AXSpinButton.h"
71 #include "modules/accessibility/AXTable.h" 73 #include "modules/accessibility/AXTable.h"
72 #include "modules/accessibility/AXTableCell.h" 74 #include "modules/accessibility/AXTableCell.h"
73 #include "modules/accessibility/AXTableColumn.h" 75 #include "modules/accessibility/AXTableColumn.h"
74 #include "modules/accessibility/AXTableHeaderContainer.h" 76 #include "modules/accessibility/AXTableHeaderContainer.h"
75 #include "modules/accessibility/AXTableRow.h" 77 #include "modules/accessibility/AXTableRow.h"
76 #include "wtf/PassRefPtr.h" 78 #include "wtf/PassRefPtr.h"
77 79
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader")) 300 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader"))
299 return AXARIAGridCell::create(layoutObject, *this); 301 return AXARIAGridCell::create(layoutObject, *this);
300 302
301 // media controls 303 // media controls
302 if (node && node->isMediaControlElement()) 304 if (node && node->isMediaControlElement())
303 return AccessibilityMediaControl::create(layoutObject, *this); 305 return AccessibilityMediaControl::create(layoutObject, *this);
304 306
305 if (isHTMLOptionElement(node)) 307 if (isHTMLOptionElement(node))
306 return AXListBoxOption::create(layoutObject, *this); 308 return AXListBoxOption::create(layoutObject, *this);
307 309
310 if (isHTMLInputElement(node) && toHTMLInputElement(node)->type() == InputTyp eNames::radio)
311 return AXRadioInput::create(layoutObject, *this);
312
308 if (layoutObject->isSVGRoot()) 313 if (layoutObject->isSVGRoot())
309 return AXSVGRoot::create(layoutObject, *this); 314 return AXSVGRoot::create(layoutObject, *this);
310 315
311 if (layoutObject->isBoxModelObject()) { 316 if (layoutObject->isBoxModelObject()) {
312 LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject); 317 LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject);
313 if (cssBox->isListBox()) 318 if (cssBox->isListBox())
314 return AXListBox::create(toLayoutListBox(cssBox), *this); 319 return AXListBox::create(toLayoutListBox(cssBox), *this);
315 if (cssBox->isMenuList()) 320 if (cssBox->isMenuList())
316 return AXMenuList::create(toLayoutMenuList(cssBox), *this); 321 return AXMenuList::create(toLayoutMenuList(cssBox), *this);
317 322
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 930
926 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select) 931 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select)
927 { 932 {
928 AXObject* obj = get(select); 933 AXObject* obj = get(select);
929 if (!obj || !obj->isAXListBox()) 934 if (!obj || !obj->isAXListBox())
930 return; 935 return;
931 936
932 toAXListBox(obj)->activeIndexChanged(); 937 toAXListBox(obj)->activeIndexChanged();
933 } 938 }
934 939
940 void AXObjectCacheImpl::radiobuttonRemovedFromGroup(HTMLInputElement* groupMembe r)
941 {
942 AXObject* obj = get(groupMember);
943 if (!obj || !obj->isAXRadioInput())
944 return;
945
946 // The 'posInSet' and 'setSize' attributes should be updated from the first node,
947 // as the removed node is already detached from tree.
948 HTMLInputElement* firstRadio = toAXRadioInput(obj)->findFirstRadioButtonInGr oup(groupMember);
949 AXObject* firstObj = get(firstRadio);
950 if (!firstObj || !firstObj->isAXRadioInput())
951 return;
952
953 toAXRadioInput(firstObj)->updatePosAndSetSize(1);
954 postNotification(firstObj, AXAriaAttributeChanged);
955 toAXRadioInput(firstObj)->requestUpdateToNextNode(true);
956 }
957
935 void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject) 958 void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject)
936 { 959 {
937 if (!layoutObject) 960 if (!layoutObject)
938 return; 961 return;
939 962
940 m_modificationCount++; 963 m_modificationCount++;
941 964
942 // Create the AXObject if it didn't yet exist - that's always safe at the en d of a layout, and it 965 // Create the AXObject if it didn't yet exist - that's always safe at the en d of a layout, and it
943 // allows an AX notification to be sent when a page has its first layout, ra ther than when the 966 // allows an AX notification to be sent when a page has its first layout, ra ther than when the
944 // document first loads. 967 // document first loads.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 visitor->trace(m_nodeObjectMapping); 1295 visitor->trace(m_nodeObjectMapping);
1273 #endif 1296 #endif
1274 1297
1275 visitor->trace(m_objects); 1298 visitor->trace(m_objects);
1276 visitor->trace(m_notificationsToPost); 1299 visitor->trace(m_notificationsToPost);
1277 1300
1278 AXObjectCache::trace(visitor); 1301 AXObjectCache::trace(visitor);
1279 } 1302 }
1280 1303
1281 } // namespace blink 1304 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698