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

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

Issue 1004803004: Add handling to respect role attribute in AXObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role); 252 return equalIgnoringCase(toElement(node)->getAttribute(roleAttr), role);
253 } 253 }
254 254
255 PassRefPtr<AXObject> AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutO bject) 255 PassRefPtr<AXObject> AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutO bject)
256 { 256 {
257 // FIXME: How could layoutObject->node() ever not be an Element? 257 // FIXME: How could layoutObject->node() ever not be an Element?
258 Node* node = layoutObject->node(); 258 Node* node = layoutObject->node();
259 259
260 // If the node is aria role="list" or the aria role is empty and its a 260 // If the node is aria role="list" or the aria role is empty and its a
261 // ul/ol/dl type (it shouldn't be a list if aria says otherwise). 261 // ul/ol/dl type (it shouldn't be a list if aria says otherwise).
262 if (node && ((nodeHasRole(node, "list") || nodeHasRole(node, "directory")) 262 if (nodeHasRole(node, "list") || nodeHasRole(node, "directory")
263 || (nodeHasRole(node, nullAtom) && (isHTMLUListElement(*node) || isHTMLO ListElement(*node) || isHTMLDListElement(*node))))) 263 || (nodeHasRole(node, nullAtom) && (isHTMLUListElement(node) || isHTMLOL istElement(node) || isHTMLDListElement(node))))
264 return AXList::create(layoutObject, this); 264 return AXList::create(layoutObject, this);
265 265
266 // aria tables 266 // aria tables
267 if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid")) 267 if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid"))
268 return AXARIAGrid::create(layoutObject, this); 268 return AXARIAGrid::create(layoutObject, this);
269 if (nodeHasRole(node, "row")) 269 if (nodeHasRole(node, "row"))
270 return AXARIAGridRow::create(layoutObject, this); 270 return AXARIAGridRow::create(layoutObject, this);
271 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader")) 271 if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || no deHasRole(node, "rowheader"))
272 return AXARIAGridCell::create(layoutObject, this); 272 return AXARIAGridCell::create(layoutObject, this);
273 273
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) 1121 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect)
1122 { 1122 {
1123 AXObject* obj = getOrCreate(element); 1123 AXObject* obj = getOrCreate(element);
1124 if (!obj) 1124 if (!obj)
1125 return; 1125 return;
1126 1126
1127 obj->setElementRect(rect); 1127 obj->setElementRect(rect);
1128 } 1128 }
1129 1129
1130 } // namespace blink 1130 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXMenuList.cpp ('k') | Source/modules/accessibility/AXProgressIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698