diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/HTMLMapElement.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/HTMLMapElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLMapElement.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/WebCore/html/HTMLMapElement.cpp b/Source/WebCore/html/HTMLMapElement.cpp index ecc875296..bb1ba20bb 100644 --- a/Source/WebCore/html/HTMLMapElement.cpp +++ b/Source/WebCore/html/HTMLMapElement.cpp @@ -25,12 +25,11 @@ #include "Attribute.h" #include "Document.h" #include "ElementIterator.h" -#include "GenericCachedHTMLCollection.h" #include "HTMLAreaElement.h" +#include "HTMLCollection.h" #include "HTMLImageElement.h" #include "HitTestResult.h" #include "IntSize.h" -#include "NodeRareData.h" namespace WebCore { @@ -42,14 +41,14 @@ HTMLMapElement::HTMLMapElement(const QualifiedName& tagName, Document& document) ASSERT(hasTagName(mapTag)); } -Ref<HTMLMapElement> HTMLMapElement::create(Document& document) +PassRefPtr<HTMLMapElement> HTMLMapElement::create(Document& document) { - return adoptRef(*new HTMLMapElement(mapTag, document)); + return adoptRef(new HTMLMapElement(mapTag, document)); } -Ref<HTMLMapElement> HTMLMapElement::create(const QualifiedName& tagName, Document& document) +PassRefPtr<HTMLMapElement> HTMLMapElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(*new HTMLMapElement(tagName, document)); + return adoptRef(new HTMLMapElement(tagName, document)); } HTMLMapElement::~HTMLMapElement() @@ -78,8 +77,10 @@ bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HTMLImageElement* HTMLMapElement::imageElement() { if (m_name.isEmpty()) - return nullptr; - return document().imageElementByCaseFoldedUsemap(*AtomicString(m_name.string().foldCase()).impl()); + return 0; + AtomicString lowercasedName = m_name.lower(); + ASSERT(lowercasedName.impl()); + return document().imageElementByLowercasedUsemap(*lowercasedName.impl()); } void HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value) @@ -87,8 +88,8 @@ void HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicStrin // FIXME: This logic seems wrong for XML documents. // Either the id or name will be used depending on the order the attributes are parsed. - if (name == HTMLNames::idAttr || name == HTMLNames::nameAttr) { - if (name == HTMLNames::idAttr) { + if (isIdAttributeName(name) || name == nameAttr) { + if (isIdAttributeName(name)) { // Call base class so that hasID bit gets set. HTMLElement::parseAttribute(name, value); if (document().isHTMLDocument()) @@ -99,7 +100,7 @@ void HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicStrin String mapName = value; if (mapName[0] == '#') mapName = mapName.substring(1); - m_name = document().isHTMLDocument() ? mapName.foldCase() : mapName; + m_name = document().isHTMLDocument() ? mapName.lower() : mapName; if (inDocument()) treeScope().addImageMap(*this); @@ -109,9 +110,9 @@ void HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicStrin HTMLElement::parseAttribute(name, value); } -Ref<HTMLCollection> HTMLMapElement::areas() +PassRefPtr<HTMLCollection> HTMLMapElement::areas() { - return ensureRareData().ensureNodeLists().addCachedCollection<GenericCachedHTMLCollection<CollectionTypeTraits<MapAreas>::traversalType>>(*this, MapAreas); + return ensureCachedHTMLCollection(MapAreas); } Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode& insertionPoint) |