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

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

Issue 137433008: Have HTMLCollection::item() return an Element as per specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 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/HTMLFormElement.idl ('k') | Source/core/html/HTMLSelectElement.h » ('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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (defaultArea) { 69 if (defaultArea) {
70 result.setInnerNode(defaultArea); 70 result.setInnerNode(defaultArea);
71 result.setURLElement(defaultArea); 71 result.setURLElement(defaultArea);
72 } 72 }
73 return defaultArea; 73 return defaultArea;
74 } 74 }
75 75
76 HTMLImageElement* HTMLMapElement::imageElement() 76 HTMLImageElement* HTMLMapElement::imageElement()
77 { 77 {
78 RefPtr<HTMLCollection> images = document().images(); 78 RefPtr<HTMLCollection> images = document().images();
79 for (unsigned i = 0; Node* curr = images->item(i); i++) { 79 for (unsigned i = 0; Element* curr = images->item(i); i++) {
80 if (!curr->hasTagName(imgTag)) 80 if (!curr->hasTagName(imgTag))
81 continue; 81 continue;
82 82
83 // The HTMLImageElement's useMap() value includes the '#' symbol at the beginning, 83 // The HTMLImageElement's useMap() value includes the '#' symbol at the beginning,
84 // which has to be stripped off. 84 // which has to be stripped off.
85 HTMLImageElement* imageElement = toHTMLImageElement(curr); 85 HTMLImageElement* imageElement = toHTMLImageElement(curr);
86 String useMapName = imageElement->getAttribute(usemapAttr).string().subs tring(1); 86 String useMapName = imageElement->getAttribute(usemapAttr).string().subs tring(1);
87 if (equalIgnoringCase(useMapName, m_name)) 87 if (equalIgnoringCase(useMapName, m_name))
88 return imageElement; 88 return imageElement;
89 } 89 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) 133 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint)
134 { 134 {
135 if (insertionPoint->inDocument()) 135 if (insertionPoint->inDocument())
136 treeScope().removeImageMap(this); 136 treeScope().removeImageMap(this);
137 HTMLElement::removedFrom(insertionPoint); 137 HTMLElement::removedFrom(insertionPoint);
138 } 138 }
139 139
140 } 140 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormElement.idl ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698