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

Side by Side Diff: Source/core/html/HTMLAreaElement.cpp

Issue 476273004: Use Traversal<>::firstAncestor() API more in the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | Source/core/html/HTMLLegendElement.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 break; 168 break;
169 case Unknown: 169 case Unknown:
170 break; 170 break;
171 } 171 }
172 172
173 return path; 173 return path;
174 } 174 }
175 175
176 HTMLImageElement* HTMLAreaElement::imageElement() const 176 HTMLImageElement* HTMLAreaElement::imageElement() const
177 { 177 {
178 Element* mapElement = parentElement(); 178 if (HTMLMapElement* mapElement = Traversal<HTMLMapElement>::firstAncestor(*t his))
179 while (mapElement && !isHTMLMapElement(*mapElement)) 179 return mapElement->imageElement();
180 mapElement = mapElement->parentElement(); 180 return 0;
181
182 if (!mapElement)
183 return 0;
184
185 return toHTMLMapElement(*mapElement).imageElement();
186 } 181 }
187 182
188 bool HTMLAreaElement::isKeyboardFocusable() const 183 bool HTMLAreaElement::isKeyboardFocusable() const
189 { 184 {
190 return isFocusable(); 185 return isFocusable();
191 } 186 }
192 187
193 bool HTMLAreaElement::isMouseFocusable() const 188 bool HTMLAreaElement::isMouseFocusable() const
194 { 189 {
195 return isFocusable(); 190 return isFocusable();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return; 223 return;
229 224
230 HTMLImageElement* imageElement = this->imageElement(); 225 HTMLImageElement* imageElement = this->imageElement();
231 if (!imageElement) 226 if (!imageElement)
232 return; 227 return;
233 228
234 imageElement->updateFocusAppearance(restorePreviousSelection); 229 imageElement->updateFocusAppearance(restorePreviousSelection);
235 } 230 }
236 231
237 } 232 }
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | Source/core/html/HTMLLegendElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698