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

Side by Side Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 515843002: Adds accessibility role for figure tag and handles its children as a group. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added role for some case without renderer Created 6 years, 3 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 | « Source/core/accessibility/AXObject.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // The HTML element should not be exposed as an element. That's what the Ren derView element does. 381 // The HTML element should not be exposed as an element. That's what the Ren derView element does.
382 if (isHTMLHtmlElement(node)) 382 if (isHTMLHtmlElement(node))
383 return IgnoredRole; 383 return IgnoredRole;
384 384
385 if (node && node->hasTagName(iframeTag)) 385 if (node && node->hasTagName(iframeTag))
386 return IframeRole; 386 return IframeRole;
387 387
388 if (isEmbeddedObject()) 388 if (isEmbeddedObject())
389 return EmbeddedObjectRole; 389 return EmbeddedObjectRole;
390 390
391 if (node && node->hasTagName(figureTag))
392 return FigureRole;
393
391 // There should only be one banner/contentInfo per page. If header/footer ar e being used within an article or section 394 // There should only be one banner/contentInfo per page. If header/footer ar e being used within an article or section
392 // then it should not be exposed as whole page's banner/contentInfo 395 // then it should not be exposed as whole page's banner/contentInfo
393 if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articl eTag) && !isDescendantOfElementType(sectionTag)) 396 if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articl eTag) && !isDescendantOfElementType(sectionTag))
394 return BannerRole; 397 return BannerRole;
395 if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articl eTag) && !isDescendantOfElementType(sectionTag)) 398 if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articl eTag) && !isDescendantOfElementType(sectionTag))
396 return FooterRole; 399 return FooterRole;
397 400
398 if (isHTMLAnchorElement(node) && isClickable()) 401 if (isHTMLAnchorElement(node) && isClickable())
399 return LinkRole; 402 return LinkRole;
400 403
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 if (hasContentEditableAttributeSet()) 671 if (hasContentEditableAttributeSet())
669 return false; 672 return false;
670 673
671 // List items play an important role in defining the structure of lists. The y should not be ignored. 674 // List items play an important role in defining the structure of lists. The y should not be ignored.
672 if (roleValue() == ListItemRole) 675 if (roleValue() == ListItemRole)
673 return false; 676 return false;
674 677
675 if (roleValue() == DialogRole) 678 if (roleValue() == DialogRole)
676 return false; 679 return false;
677 680
681 if (roleValue() == FigureRole)
682 return false;
683
678 // if this element has aria attributes on it, it should not be ignored. 684 // if this element has aria attributes on it, it should not be ignored.
679 if (supportsARIAAttributes()) 685 if (supportsARIAAttributes())
680 return false; 686 return false;
681 687
682 // <span> tags are inline tags and not meant to convey information if they h ave no other aria 688 // <span> tags are inline tags and not meant to convey information if they h ave no other aria
683 // information on them. If we don't ignore them, they may emit signals expec ted to come from 689 // information on them. If we don't ignore them, they may emit signals expec ted to come from
684 // their parent. In addition, because included spans are GroupRole objects, and GroupRole 690 // their parent. In addition, because included spans are GroupRole objects, and GroupRole
685 // objects are often containers with meaningful information, the inclusion o f a span can have 691 // objects are often containers with meaningful information, the inclusion o f a span can have
686 // the side effect of causing the immediate parent accessible to be ignored. This is especially 692 // the side effect of causing the immediate parent accessible to be ignored. This is especially
687 // problematic for platforms which have distinct roles for textual block ele ments. 693 // problematic for platforms which have distinct roles for textual block ele ments.
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 if (label && label->renderer()) { 2320 if (label && label->renderer()) {
2315 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2321 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2316 result.unite(labelRect); 2322 result.unite(labelRect);
2317 } 2323 }
2318 } 2324 }
2319 2325
2320 return result; 2326 return result;
2321 } 2327 }
2322 2328
2323 } // namespace blink 2329 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXObject.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698