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

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

Issue 18888002: Introduce isHTMLAnchorElement and toHTMLAnchorElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 15 matching lines...) Expand all
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/accessibility/AccessibilityNodeObject.h" 30 #include "core/accessibility/AccessibilityNodeObject.h"
31 31
32 #include "core/accessibility/AXObjectCache.h" 32 #include "core/accessibility/AXObjectCache.h"
33 #include "core/dom/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
34 #include "core/dom/Text.h" 34 #include "core/dom/Text.h"
35 #include "core/dom/UserGestureIndicator.h" 35 #include "core/dom/UserGestureIndicator.h"
36 #include "core/html/HTMLAnchorElement.h"
36 #include "core/html/HTMLFrameElementBase.h" 37 #include "core/html/HTMLFrameElementBase.h"
37 #include "core/html/HTMLInputElement.h" 38 #include "core/html/HTMLInputElement.h"
38 #include "core/html/HTMLLabelElement.h" 39 #include "core/html/HTMLLabelElement.h"
39 #include "core/html/HTMLSelectElement.h" 40 #include "core/html/HTMLSelectElement.h"
40 #include "core/html/HTMLTextAreaElement.h" 41 #include "core/html/HTMLTextAreaElement.h"
41 #include "wtf/text/StringBuilder.h" 42 #include "wtf/text/StringBuilder.h"
42 43
43 using namespace std; 44 using namespace std;
44 45
45 namespace WebCore { 46 namespace WebCore {
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 { 1362 {
1362 Node* node = this->node(); 1363 Node* node = this->node();
1363 if (!node) 1364 if (!node)
1364 return 0; 1365 return 0;
1365 1366
1366 AXObjectCache* cache = axObjectCache(); 1367 AXObjectCache* cache = axObjectCache();
1367 1368
1368 // search up the DOM tree for an anchor element 1369 // search up the DOM tree for an anchor element
1369 // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElem ent 1370 // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElem ent
1370 for ( ; node; node = node->parentNode()) { 1371 for ( ; node; node = node->parentNode()) {
1371 if (node->hasTagName(aTag) || (node->renderer() && cache->getOrCreate(no de->renderer())->isAnchor())) 1372 if (isHTMLAnchorElement(node) || (node->renderer() && cache->getOrCreate (node->renderer())->isAnchor()))
1372 return toElement(node); 1373 return toElement(node);
1373 } 1374 }
1374 1375
1375 return 0; 1376 return 0;
1376 } 1377 }
1377 1378
1378 Document* AccessibilityNodeObject::document() const 1379 Document* AccessibilityNodeObject::document() const
1379 { 1380 {
1380 if (!node()) 1381 if (!node())
1381 return 0; 1382 return 0;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 useTextUnderElement = true; 1666 useTextUnderElement = true;
1666 1667
1667 if (useTextUnderElement) { 1668 if (useTextUnderElement) {
1668 String text = textUnderElement(); 1669 String text = textUnderElement();
1669 if (!text.isEmpty()) 1670 if (!text.isEmpty())
1670 textOrder.append(AccessibilityText(text, ChildrenText)); 1671 textOrder.append(AccessibilityText(text, ChildrenText));
1671 } 1672 }
1672 } 1673 }
1673 1674
1674 } // namespace WebCore 1675 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/DOMUtilitiesPrivate.cpp ('k') | Source/core/accessibility/AccessibilityRenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698