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

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

Issue 1125673004: Makes AXNodeObject test if it's a table cell or row before calling isPresentationalInTable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (ariaRoleAttribute() != UnknownRole) 254 if (ariaRoleAttribute() != UnknownRole)
255 return 0; 255 return 0;
256 256
257 AXObject* parent = parentObject(); 257 AXObject* parent = parentObject();
258 if (!parent) 258 if (!parent)
259 return 0; 259 return 0;
260 260
261 HTMLElement* element = nullptr; 261 HTMLElement* element = nullptr;
262 if (node() && node()->isHTMLElement()) 262 if (node() && node()->isHTMLElement())
263 element = toHTMLElement(node()); 263 element = toHTMLElement(node());
264 if (!parent->hasInheritedPresentationalRole() 264 if (!parent->hasInheritedPresentationalRole()) {
265 && !isPresentationalInTable(parent, element)) 265 if (!layoutObject() || !layoutObject()->isBoxModelObject())
266 return 0; 266 return 0;
267
268 LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject());
269 if (!cssBox->isTableCell() && !cssBox->isTableRow())
270 return 0;
271
272 if (!isPresentationalInTable(parent, element))
273 return 0;
274 }
267 // ARIA spec says that when a parent object is presentational and this objec t 275 // ARIA spec says that when a parent object is presentational and this objec t
268 // is a required owned element of that parent, then this object is also pres entational. 276 // is a required owned element of that parent, then this object is also pres entational.
269 if (isRequiredOwnedElement(parent, roleValue(), element)) 277 if (isRequiredOwnedElement(parent, roleValue(), element))
270 return parent; 278 return parent;
271 return 0; 279 return 0;
272 } 280 }
273 281
274 bool AXNodeObject::isDescendantOfElementType(const HTMLQualifiedName& tagName) c onst 282 bool AXNodeObject::isDescendantOfElementType(const HTMLQualifiedName& tagName) c onst
275 { 283 {
276 if (!node()) 284 if (!node())
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2218 ariaLabeledByElements(elements); 2226 ariaLabeledByElements(elements);
2219 2227
2220 for (const auto& element : elements) { 2228 for (const auto& element : elements) {
2221 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element); 2229 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element);
2222 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement)); 2230 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement));
2223 } 2231 }
2224 } 2232 }
2225 } 2233 }
2226 2234
2227 } // namespace blink 2235 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698