Add ElementAttributeData class to replace internal uses of NamedNodeMap
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 03:53:40 +0000 (03:53 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 03:53:40 +0000 (03:53 +0000)
commit1590c1febe59989b06980c0b2354384660021825
tree297a8da4dad9e8c01202ef38aec9ceb6cab3411d
parentd3d539d4c228520e034cd3cca02aa28e9978b0bd
Add ElementAttributeData class to replace internal uses of NamedNodeMap
https://bugs.webkit.org/show_bug.cgi?id=77233

Reviewed by Andreas Kling.

Move part of non-DOM functionality of NamedNodeMap into a separate class. This is
the first step toward the goal of separating NamedNodeMap from internal attribute
storage, as described in https://bugs.webkit.org/show_bug.cgi?id=75069.

The internal attribute storage is exposed as attributeData() in Element, and when
necessary (because it has no back pointer to Element) via methods in Element.

No new tests. Except from setClass() change this is just moving the code, no new
feature was added.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Element.cpp:
(WebCore::Element::idAttributeChanged):
* dom/Element.h:
(WebCore::Element::attributeData):
(WebCore::Element::ensureAttributeData):
(Element):
(WebCore::Element::idForStyleResolution):
* dom/ElementAttributeData.cpp: Added.
(WebCore):
(WebCore::ElementAttributeData::setClass): the only caller of this function
already deal with the case when the element has no class, so don't do it here.
* dom/ElementAttributeData.h: Added.
(WebCore):
(ElementAttributeData):
(WebCore::ElementAttributeData::clearClass):
(WebCore::ElementAttributeData::classNames):
(WebCore::ElementAttributeData::idForStyleResolution):
(WebCore::ElementAttributeData::setIdForStyleResolution):
(WebCore::ElementAttributeData::ElementAttributeData):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::clearAttributes):
* dom/NamedNodeMap.h:
(WebCore::NamedNodeMap::attributeData):
(NamedNodeMap):
* dom/StyledElement.cpp:
(WebCore::StyledElement::classAttributeChanged):
* dom/StyledElement.h:
(WebCore::StyledElement::classNames):
* html/ClassList.cpp:
(WebCore::ClassList::classNames):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementAttributeData.cpp [new file with mode: 0644]
Source/WebCore/dom/ElementAttributeData.h [new file with mode: 0644]
Source/WebCore/dom/NamedNodeMap.cpp
Source/WebCore/dom/NamedNodeMap.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/html/ClassList.cpp