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

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

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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) 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 AXObject* AXNodeObject::activeDescendant() const 146 AXObject* AXNodeObject::activeDescendant() const
147 { 147 {
148 if (!getNode() || !getNode()->isElementNode()) 148 if (!getNode() || !getNode()->isElementNode())
149 return nullptr; 149 return nullptr;
150 150
151 const AtomicString& activeDescendantAttr = getAttribute(aria_activedescendan tAttr); 151 const AtomicString& activeDescendantAttr = getAttribute(aria_activedescendan tAttr);
152 if (activeDescendantAttr.isNull() || activeDescendantAttr.isEmpty()) 152 if (activeDescendantAttr.isNull() || activeDescendantAttr.isEmpty())
153 return nullptr; 153 return nullptr;
154 154
155 Element* element = toElement(getNode()); 155 Element* element = toElement(getNode());
156 Element* descendant = element->treeScope().getElementById(activeDescendantAt tr); 156 Element* descendant = element->treeScopeOrDocument().getElementById(activeDe scendantAttr);
157 if (!descendant) 157 if (!descendant)
158 return nullptr; 158 return nullptr;
159 159
160 AXObject* axDescendant = axObjectCache().getOrCreate(descendant); 160 AXObject* axDescendant = axObjectCache().getOrCreate(descendant);
161 return axDescendant; 161 return axDescendant;
162 } 162 }
163 163
164 String AXNodeObject::ariaAccessibilityDescription() const 164 String AXNodeObject::ariaAccessibilityDescription() const
165 { 165 {
166 String ariaLabelledby = ariaLabelledbyAttribute(); 166 String ariaLabelledby = ariaLabelledbyAttribute();
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 return true; 643 return true;
644 } 644 }
645 645
646 HTMLLabelElement* AXNodeObject::labelForElement(const Element* element) const 646 HTMLLabelElement* AXNodeObject::labelForElement(const Element* element) const
647 { 647 {
648 if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable()) 648 if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable())
649 return 0; 649 return 0;
650 650
651 const AtomicString& id = element->getIdAttribute(); 651 const AtomicString& id = element->getIdAttribute();
652 if (!id.isEmpty()) { 652 if (!id.isEmpty()) {
653 if (HTMLLabelElement* labelFor = element->treeScope().labelElementForId( id)) 653 if (HTMLLabelElement* labelFor = element->treeScopeOrDocument().labelEle mentForId(id))
654 return labelFor; 654 return labelFor;
655 } 655 }
656 656
657 HTMLLabelElement* labelWrappedElement = Traversal<HTMLLabelElement>::firstAn cestor(*element); 657 HTMLLabelElement* labelWrappedElement = Traversal<HTMLLabelElement>::firstAn cestor(*element);
658 if (labelWrappedElement && labelWrappedElement->control() == toLabelableElem ent(element)) 658 if (labelWrappedElement && labelWrappedElement->control() == toLabelableElem ent(element))
659 return labelWrappedElement; 659 return labelWrappedElement;
660 660
661 return 0; 661 return 0;
662 } 662 }
663 663
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 return placeholder; 2788 return placeholder;
2789 } 2789 }
2790 2790
2791 DEFINE_TRACE(AXNodeObject) 2791 DEFINE_TRACE(AXNodeObject)
2792 { 2792 {
2793 visitor->trace(m_node); 2793 visitor->trace(m_node);
2794 AXObject::trace(visitor); 2794 AXObject::trace(visitor);
2795 } 2795 }
2796 2796
2797 } // namespace blink 2797 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XPathFunctions.cpp ('k') | third_party/WebKit/Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698