Make elements that don't have attributes smaller.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 15:42:07 +0000 (15:42 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 15:42:07 +0000 (15:42 +0000)
commit324cb0bfcbaedb15a068086a8d4fadea1895d6d4
treeff352ff14ddfffdbd3926394ea953989e525c1c9
parent9d43511c96dfa379a617c0b9213cda69e32b60c2
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@105738 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