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

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

Issue 189463011: Use new Traversal<HTML*Element> API more in accessibility (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 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 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 void AXRenderObject::addImageMapChildren() 2149 void AXRenderObject::addImageMapChildren()
2150 { 2150 {
2151 RenderBoxModelObject* cssBox = renderBoxModelObject(); 2151 RenderBoxModelObject* cssBox = renderBoxModelObject();
2152 if (!cssBox || !cssBox->isRenderImage()) 2152 if (!cssBox || !cssBox->isRenderImage())
2153 return; 2153 return;
2154 2154
2155 HTMLMapElement* map = toRenderImage(cssBox)->imageMap(); 2155 HTMLMapElement* map = toRenderImage(cssBox)->imageMap();
2156 if (!map) 2156 if (!map)
2157 return; 2157 return;
2158 2158
2159 for (Element* current = ElementTraversal::firstWithin(*map); current; curren t = ElementTraversal::next(*current, map)) { 2159 for (HTMLAreaElement* area = Traversal<HTMLAreaElement>::firstWithin(*map); area; area = Traversal<HTMLAreaElement>::next(*area, map)) {
2160 // add an <area> element for this child if it has a link 2160 // add an <area> element for this child if it has a link
2161 if (isHTMLAreaElement(*current) && current->isLink()) { 2161 if (area->isLink()) {
2162 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole)); 2162 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole));
2163 areaObject->setHTMLAreaElement(toHTMLAreaElement(current)); 2163 areaObject->setHTMLAreaElement(area);
2164 areaObject->setHTMLMapElement(map); 2164 areaObject->setHTMLMapElement(map);
2165 areaObject->setParent(this); 2165 areaObject->setParent(this);
2166 if (!areaObject->accessibilityIsIgnored()) 2166 if (!areaObject->accessibilityIsIgnored())
2167 m_children.append(areaObject); 2167 m_children.append(areaObject);
2168 else 2168 else
2169 axObjectCache()->remove(areaObject->axObjectID()); 2169 axObjectCache()->remove(areaObject->axObjectID());
2170 } 2170 }
2171 } 2171 }
2172 } 2172 }
2173 2173
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 if (label && label->renderer()) { 2319 if (label && label->renderer()) {
2320 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2320 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2321 result.unite(labelRect); 2321 result.unite(labelRect);
2322 } 2322 }
2323 } 2323 }
2324 2324
2325 return result; 2325 return result;
2326 } 2326 }
2327 2327
2328 } // namespace WebCore 2328 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698