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

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

Issue 18251004: Introduce isHTMLAreaElement and toHTMLAreaElement (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
« no previous file with comments | « Source/core/html/HTMLAreaElement.h ('k') | Source/core/page/FocusController.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, 2007, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2010 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 HTMLMapElement::~HTMLMapElement() 56 HTMLMapElement::~HTMLMapElement()
57 { 57 {
58 } 58 }
59 59
60 bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HitTestResult& result) 60 bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HitTestResult& result)
61 { 61 {
62 HTMLAreaElement* defaultArea = 0; 62 HTMLAreaElement* defaultArea = 0;
63 Element* element = this; 63 Element* element = this;
64 while ((element = ElementTraversal::next(element, this))) { 64 while ((element = ElementTraversal::next(element, this))) {
65 if (element->hasTagName(areaTag)) { 65 if (isHTMLAreaElement(element)) {
66 HTMLAreaElement* areaElt = static_cast<HTMLAreaElement*>(element); 66 HTMLAreaElement* areaElt = toHTMLAreaElement(element);
67 if (areaElt->isDefault()) { 67 if (areaElt->isDefault()) {
68 if (!defaultArea) 68 if (!defaultArea)
69 defaultArea = areaElt; 69 defaultArea = areaElt;
70 } else if (areaElt->mapMouseEvent(location, size, result)) 70 } else if (areaElt->mapMouseEvent(location, size, result))
71 return true; 71 return true;
72 } 72 }
73 } 73 }
74 74
75 if (defaultArea) { 75 if (defaultArea) {
76 result.setInnerNode(defaultArea); 76 result.setInnerNode(defaultArea);
77 result.setURLElement(defaultArea); 77 result.setURLElement(defaultArea);
78 } 78 }
79 return defaultArea; 79 return defaultArea;
80 } 80 }
81 81
82 HTMLImageElement* HTMLMapElement::imageElement() 82 HTMLImageElement* HTMLMapElement::imageElement()
83 { 83 {
84 RefPtr<HTMLCollection> images = document()->images(); 84 RefPtr<HTMLCollection> images = document()->images();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) 139 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint)
140 { 140 {
141 if (insertionPoint->inDocument()) 141 if (insertionPoint->inDocument())
142 treeScope()->removeImageMap(this); 142 treeScope()->removeImageMap(this);
143 HTMLElement::removedFrom(insertionPoint); 143 HTMLElement::removedFrom(insertionPoint);
144 } 144 }
145 145
146 } 146 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAreaElement.h ('k') | Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698