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

Unified Diff: Source/core/html/HTMLMapElement.cpp

Issue 189923002: Use new Traversal<HTML*Element> API in HTML code (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMapElement.cpp
diff --git a/Source/core/html/HTMLMapElement.cpp b/Source/core/html/HTMLMapElement.cpp
index 00f7032c8087ddc0773a7a9d044e7bbb7bae11fa..02c70e977a7fe086c09bb0e45555cba40f0364e2 100644
--- a/Source/core/html/HTMLMapElement.cpp
+++ b/Source/core/html/HTMLMapElement.cpp
@@ -54,15 +54,12 @@ HTMLMapElement::~HTMLMapElement()
bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HitTestResult& result)
{
HTMLAreaElement* defaultArea = 0;
- Element* element = this;
- while ((element = ElementTraversal::next(*element, this))) {
- if (element->hasTagName(areaTag)) {
- HTMLAreaElement* areaElt = toHTMLAreaElement(element);
- if (areaElt->isDefault()) {
- if (!defaultArea)
- defaultArea = areaElt;
- } else if (areaElt->mapMouseEvent(location, size, result))
- return true;
+ for (HTMLAreaElement* area = Traversal<HTMLAreaElement>::firstWithin(*this); area; area = Traversal<HTMLAreaElement>::next(*area, this)) {
+ if (area->isDefault()) {
+ if (!defaultArea)
+ defaultArea = area;
+ } else if (area->mapMouseEvent(location, size, result)) {
+ return true;
}
}
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.cpp ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698