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

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

Issue 2856503003: Nodes with IDs should not be excluded as they might be the target of in-page links and attributes s… (Closed)
Patch Set: Fixed Blink test. Created 3 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 | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 Element* element = ToElement(node_); 1018 Element* element = ToElement(node_);
1019 // We exclude elements that are in the shadow DOM. 1019 // We exclude elements that are in the shadow DOM.
1020 if (element->ContainingShadowRoot()) 1020 if (element->ContainingShadowRoot())
1021 return false; 1021 return false;
1022 1022
1023 if (isHTMLAnchorElement(element)) { 1023 if (isHTMLAnchorElement(element)) {
1024 HTMLAnchorElement* html_element = toHTMLAnchorElement(element); 1024 HTMLAnchorElement* html_element = toHTMLAnchorElement(element);
1025 return html_element->HasName() || html_element->HasID(); 1025 return html_element->HasName() || html_element->HasID();
1026 } 1026 }
1027 1027
1028 if (element->HasID() && (IsLandmarkRelated() || isHTMLDivElement(element))) 1028 if (element->HasID() && (IsLandmarkRelated() || isHTMLSpanElement(element) ||
1029 isHTMLDivElement(element))) {
1029 return true; 1030 return true;
1031 }
1030 return false; 1032 return false;
1031 } 1033 }
1032 1034
1033 bool AXNodeObject::IsMenu() const { 1035 bool AXNodeObject::IsMenu() const {
1034 return RoleValue() == kMenuRole; 1036 return RoleValue() == kMenuRole;
1035 } 1037 }
1036 1038
1037 bool AXNodeObject::IsMenuButton() const { 1039 bool AXNodeObject::IsMenuButton() const {
1038 return RoleValue() == kMenuButtonRole; 1040 return RoleValue() == kMenuButtonRole;
1039 } 1041 }
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 2484
2483 // If this element is an ARIA text box or content editable, post a "value 2485 // If this element is an ARIA text box or content editable, post a "value
2484 // changed" notification on it so that it behaves just like a native input 2486 // changed" notification on it so that it behaves just like a native input
2485 // element or textarea. 2487 // element or textarea.
2486 if (parent->IsNonNativeTextControl()) 2488 if (parent->IsNonNativeTextControl())
2487 cache.PostNotification(parent_node, AXObjectCacheImpl::kAXValueChanged); 2489 cache.PostNotification(parent_node, AXObjectCacheImpl::kAXValueChanged);
2488 } 2490 }
2489 } 2491 }
2490 2492
2491 void AXNodeObject::UpdateAccessibilityRole() { 2493 void AXNodeObject::UpdateAccessibilityRole() {
2494 role_ = DetermineAccessibilityRole();
2492 bool ignored_status = AccessibilityIsIgnored(); 2495 bool ignored_status = AccessibilityIsIgnored();
2493 role_ = DetermineAccessibilityRole();
2494 2496
2495 // The AX hierarchy only needs to be updated if the ignored status of an 2497 // The AX hierarchy only needs to be updated if the ignored status of an
2496 // element has changed. 2498 // element has changed.
2497 if (ignored_status != AccessibilityIsIgnored()) 2499 if (ignored_status != AccessibilityIsIgnored())
2498 ChildrenChanged(); 2500 ChildrenChanged();
2499 } 2501 }
2500 2502
2501 void AXNodeObject::ComputeAriaOwnsChildren( 2503 void AXNodeObject::ComputeAriaOwnsChildren(
2502 HeapVector<Member<AXObject>>& owned_children) const { 2504 HeapVector<Member<AXObject>>& owned_children) const {
2503 if (!HasAttribute(aria_ownsAttr)) 2505 if (!HasAttribute(aria_ownsAttr))
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 return String(); 3219 return String();
3218 return ToTextControlElement(node)->StrippedPlaceholder(); 3220 return ToTextControlElement(node)->StrippedPlaceholder();
3219 } 3221 }
3220 3222
3221 DEFINE_TRACE(AXNodeObject) { 3223 DEFINE_TRACE(AXNodeObject) {
3222 visitor->Trace(node_); 3224 visitor->Trace(node_);
3223 AXObject::Trace(visitor); 3225 AXObject::Trace(visitor);
3224 } 3226 }
3225 3227
3226 } // namespace blink 3228 } // namespace blink
OLDNEW
« 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