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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2234913002: Added support for header and footer inside other sections, according to HTML API Mappings 1.0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test expectations. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 244c2c3a731c171ece97d7ab10945c1043fd8d86..0ca8a506dedafc2216565f14e76941951ad830b5 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -494,12 +494,22 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const
}
// There should only be one banner/contentInfo per page. If header/footer are being used within an article or section
- // then it should not be exposed as whole page's banner/contentInfo
- if (getNode()->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
+ // then it should not be exposed as whole page's banner/contentInfo but as a group role.
+ if (getNode()->hasTagName(headerTag)) {
+ if (isDescendantOfElementType(articleTag) || isDescendantOfElementType(sectionTag)
+ || (getNode()->parentElement() && getNode()->parentElement()->hasTagName(mainTag))) {
+ return GroupRole;
+ }
return BannerRole;
+ }
- if (getNode()->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
+ if (getNode()->hasTagName(footerTag)) {
+ if (isDescendantOfElementType(articleTag) || isDescendantOfElementType(sectionTag)
+ || (getNode()->parentElement() && getNode()->parentElement()->hasTagName(mainTag))) {
+ return GroupRole;
+ }
return FooterRole;
+ }
if (getNode()->hasTagName(blockquoteTag))
return BlockquoteRole;
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698