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

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: Moved position handling to AXRadioInput 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "modules/accessibility/AXInlineTextBox.h" 58 #include "modules/accessibility/AXInlineTextBox.h"
59 #include "modules/accessibility/AXLayoutObject.h" 59 #include "modules/accessibility/AXLayoutObject.h"
60 #include "modules/accessibility/AXList.h" 60 #include "modules/accessibility/AXList.h"
61 #include "modules/accessibility/AXListBox.h" 61 #include "modules/accessibility/AXListBox.h"
62 #include "modules/accessibility/AXListBoxOption.h" 62 #include "modules/accessibility/AXListBoxOption.h"
63 #include "modules/accessibility/AXMediaControls.h" 63 #include "modules/accessibility/AXMediaControls.h"
64 #include "modules/accessibility/AXMenuList.h" 64 #include "modules/accessibility/AXMenuList.h"
65 #include "modules/accessibility/AXMenuListOption.h" 65 #include "modules/accessibility/AXMenuListOption.h"
66 #include "modules/accessibility/AXMenuListPopup.h" 66 #include "modules/accessibility/AXMenuListPopup.h"
67 #include "modules/accessibility/AXProgressIndicator.h" 67 #include "modules/accessibility/AXProgressIndicator.h"
68 #include "modules/accessibility/AXRadioInput.h"
68 #include "modules/accessibility/AXSVGRoot.h" 69 #include "modules/accessibility/AXSVGRoot.h"
69 #include "modules/accessibility/AXSlider.h" 70 #include "modules/accessibility/AXSlider.h"
70 #include "modules/accessibility/AXSpinButton.h" 71 #include "modules/accessibility/AXSpinButton.h"
71 #include "modules/accessibility/AXTable.h" 72 #include "modules/accessibility/AXTable.h"
72 #include "modules/accessibility/AXTableCell.h" 73 #include "modules/accessibility/AXTableCell.h"
73 #include "modules/accessibility/AXTableColumn.h" 74 #include "modules/accessibility/AXTableColumn.h"
74 #include "modules/accessibility/AXTableHeaderContainer.h" 75 #include "modules/accessibility/AXTableHeaderContainer.h"
75 #include "modules/accessibility/AXTableRow.h" 76 #include "modules/accessibility/AXTableRow.h"
76 #include "wtf/PassRefPtr.h" 77 #include "wtf/PassRefPtr.h"
77 78
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader")) 299 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader"))
299 return AXARIAGridCell::create(layoutObject, *this); 300 return AXARIAGridCell::create(layoutObject, *this);
300 301
301 // media controls 302 // media controls
302 if (node && node->isMediaControlElement()) 303 if (node && node->isMediaControlElement())
303 return AccessibilityMediaControl::create(layoutObject, *this); 304 return AccessibilityMediaControl::create(layoutObject, *this);
304 305
305 if (isHTMLOptionElement(node)) 306 if (isHTMLOptionElement(node))
306 return AXListBoxOption::create(layoutObject, *this); 307 return AXListBoxOption::create(layoutObject, *this);
307 308
309 if (isHTMLInputElement(node) && toHTMLInputElement(node)->isRadioButton())
310 return AXRadioInput::create(layoutObject, *this);
311
308 if (layoutObject->isSVGRoot()) 312 if (layoutObject->isSVGRoot())
309 return AXSVGRoot::create(layoutObject, *this); 313 return AXSVGRoot::create(layoutObject, *this);
310 314
311 if (layoutObject->isBoxModelObject()) { 315 if (layoutObject->isBoxModelObject()) {
312 LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject); 316 LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject);
313 if (cssBox->isListBox()) 317 if (cssBox->isListBox())
314 return AXListBox::create(toLayoutListBox(cssBox), *this); 318 return AXListBox::create(toLayoutListBox(cssBox), *this);
315 if (cssBox->isMenuList()) 319 if (cssBox->isMenuList())
316 return AXMenuList::create(toLayoutMenuList(cssBox), *this); 320 return AXMenuList::create(toLayoutMenuList(cssBox), *this);
317 321
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 919
916 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select) 920 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select)
917 { 921 {
918 AXObject* obj = get(select); 922 AXObject* obj = get(select);
919 if (!obj || !obj->isAXListBox()) 923 if (!obj || !obj->isAXListBox())
920 return; 924 return;
921 925
922 toAXListBox(obj)->activeIndexChanged(); 926 toAXListBox(obj)->activeIndexChanged();
923 } 927 }
924 928
929 void AXObjectCacheImpl::radiobuttonRemovedFromGroup(HTMLInputElement* groupMembe r)
930 {
931 AXObject* obj = get(groupMember);
932 if (!obj || !obj->isAXRadioInput())
933 return;
934
935 // The 'posInSet' and 'setSize' attributes should be updated from the first node,
936 // as the removed node is already detached from tree.
937 HTMLInputElement* firstRadio = toAXRadioInput(obj)->findFristFocusableRadioB uttonInGroup(groupMember);
938 AXObject* firstObj = get(firstRadio);
939 if (!firstObj || !firstObj->isAXRadioInput())
940 return;
941
942 toAXRadioInput(firstObj)->updatePosAndSetSize(1);
943 postNotification(firstObj, AXAriaAttributeChanged);
944 toAXRadioInput(firstObj)->requestUpdateToNextNode(true);
945 }
946
925 void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject) 947 void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject)
926 { 948 {
927 if (!layoutObject) 949 if (!layoutObject)
928 return; 950 return;
929 951
930 m_modificationCount++; 952 m_modificationCount++;
931 953
932 // Create the AXObject if it didn't yet exist - that's always safe at the en d of a layout, and it 954 // Create the AXObject if it didn't yet exist - that's always safe at the en d of a layout, and it
933 // allows an AX notification to be sent when a page has its first layout, ra ther than when the 955 // allows an AX notification to be sent when a page has its first layout, ra ther than when the
934 // document first loads. 956 // document first loads.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 visitor->trace(m_nodeObjectMapping); 1284 visitor->trace(m_nodeObjectMapping);
1263 #endif 1285 #endif
1264 1286
1265 visitor->trace(m_objects); 1287 visitor->trace(m_objects);
1266 visitor->trace(m_notificationsToPost); 1288 visitor->trace(m_notificationsToPost);
1267 1289
1268 AXObjectCache::trace(visitor); 1290 AXObjectCache::trace(visitor);
1269 } 1291 }
1270 1292
1271 } // namespace blink 1293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698