Make elements that don't have attributes smaller.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 14:56:34 +0000 (14:56 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 14:56:34 +0000 (14:56 +0000)
commit007f8ca3d322a26653ca7765deb64c36cb3bd56b
tree29d9a5debe77fae17bb0b3c3b2e9dbace2b0faf5
parent85ae42dc1e94feacb19373bab159a0f78549a776
Make elements that don't have attributes smaller.
<http://webkit.org/b/76876>

Reviewed by Antti Koivisto.

Move the inline style declaration from StyledElement to NamedNodeMap, since having
an inline style declaration also implies having a style attribute on the element.
This saves one CPU word per element that has no attributes.

This reduces memory consumption by 412 kB (on 64-bit) when viewing the full
HTML5 spec at <http://whatwg.org/c>.

* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::ensureInlineStyleDecl):
(WebCore::NamedNodeMap::destroyInlineStyleDecl):
(WebCore::NamedNodeMap::createInlineStyleDecl):
* dom/NamedNodeMap.h:
(WebCore::NamedNodeMap::inlineStyleDecl):
* dom/StyledElement.cpp:
(WebCore::StyledElement::updateStyleAttribute):
(WebCore::StyledElement::addSubresourceAttributeURLs):
* dom/StyledElement.h:
(WebCore::StyledElement::inlineStyleDecl):
(WebCore::StyledElement::ensureInlineStyleDecl):
(WebCore::StyledElement::destroyInlineStyleDecl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/NamedNodeMap.cpp
Source/WebCore/dom/NamedNodeMap.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h