Use more references instead of pointers in DocumentOrderedMap
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 02:59:02 +0000 (02:59 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 02:59:02 +0000 (02:59 +0000)
commit0c22e63f7ca9eade70e93da9e00ecb3a15dd808e
treed241d0fbb6e0297da2cf6874dbf8c1105f9fa772
parentba783defc15da5b3d75f2c853b1fe443d6171d0d
Use more references instead of pointers in DocumentOrderedMap
https://bugs.webkit.org/show_bug.cgi?id=122368

Reviewed by Andreas Kling.

Use AtomicStringImpl& instead of AtomicString* or AtomicString& to eliminate
assertions and nullity checks.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::canGetItemsForName):
(WebCore::JSHTMLDocument::nameGetter):
* dom/Document.cpp:
(WebCore::Document::addImageElementByLowercasedUsemap):
(WebCore::Document::removeImageElementByLowercasedUsemap):
(WebCore::Document::imageElementByLowercasedUsemap):
* dom/Document.h:
* dom/DocumentOrderedMap.cpp:
(WebCore::keyMatchesId):
(WebCore::keyMatchesName):
(WebCore::keyMatchesMapName):
(WebCore::keyMatchesLowercasedMapName):
(WebCore::keyMatchesLowercasedUsemap):
(WebCore::keyMatchesLabelForAttribute):
(WebCore::keyMatchesWindowNamedItem):
(WebCore::keyMatchesDocumentNamedItem):
(WebCore::DocumentOrderedMap::add):
(WebCore::DocumentOrderedMap::remove):
(WebCore::DocumentOrderedMap::get):
(WebCore::DocumentOrderedMap::getElementById):
(WebCore::DocumentOrderedMap::getElementByName):
(WebCore::DocumentOrderedMap::getElementByMapName):
(WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
(WebCore::DocumentOrderedMap::getElementByLowercasedUsemap):
(WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
(WebCore::DocumentOrderedMap::getElementByWindowNamedItem):
(WebCore::DocumentOrderedMap::getElementByDocumentNamedItem):
(WebCore::DocumentOrderedMap::getAllElementsById):
* dom/DocumentOrderedMap.h:
(WebCore::DocumentOrderedMap::containsSingle):
(WebCore::DocumentOrderedMap::contains):
(WebCore::DocumentOrderedMap::containsMultiple):
* dom/Element.cpp:
(WebCore::Element::updateNameForTreeScope):
(WebCore::Element::updateNameForDocument):
(WebCore::Element::updateIdForTreeScope):
(WebCore::Element::updateIdForDocument):
(WebCore::Element::updateLabel):
* dom/IdTargetObserverRegistry.cpp:
(WebCore::IdTargetObserverRegistry::notifyObserversInternal):
* dom/IdTargetObserverRegistry.h:
(WebCore::IdTargetObserverRegistry::notifyObservers):
* dom/TreeScope.cpp:
(WebCore::TreeScope::getElementById):
(WebCore::TreeScope::getAllElementsById):
(WebCore::TreeScope::addElementById):
(WebCore::TreeScope::removeElementById):
(WebCore::TreeScope::getElementByName):
(WebCore::TreeScope::addElementByName):
(WebCore::TreeScope::removeElementByName):
(WebCore::TreeScope::addImageMap):
(WebCore::TreeScope::removeImageMap):
(WebCore::TreeScope::getImageMap):
(WebCore::TreeScope::addLabel):
(WebCore::TreeScope::removeLabel):
(WebCore::TreeScope::labelElementForId):
* dom/TreeScope.h:
(WebCore::TreeScope::hasElementWithId):
(WebCore::TreeScope::containsMultipleElementsWithId):
(WebCore::TreeScope::hasElementWithName):
(WebCore::TreeScope::containsMultipleElementsWithName):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::namedItem):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::addDocumentNamedItem):
(WebCore::HTMLDocument::removeDocumentNamedItem):
(WebCore::HTMLDocument::addWindowNamedItem):
(WebCore::HTMLDocument::removeWindowNamedItem):
* html/HTMLDocument.h:
(WebCore::HTMLDocument::documentNamedItem):
(WebCore::HTMLDocument::hasDocumentNamedItem):
(WebCore::HTMLDocument::documentNamedItemContainsMultipleElements):
(WebCore::HTMLDocument::windowNamedItem):
(WebCore::HTMLDocument::hasWindowNamedItem):
(WebCore::HTMLDocument::windowNamedItemContainsMultipleElements):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedInto):
(WebCore::HTMLImageElement::removedFrom):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
(WebCore::HTMLMapElement::parseAttribute):
(WebCore::HTMLMapElement::insertedInto):
(WebCore::HTMLMapElement::removedFrom):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentOrderedMap.cpp
Source/WebCore/dom/DocumentOrderedMap.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/IdTargetObserverRegistry.cpp
Source/WebCore/dom/IdTargetObserverRegistry.h
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/dom/TreeScope.h
Source/WebCore/html/HTMLCollection.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLDocument.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLMapElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp