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)
commit77cb026e9f80a20d6ccd60e11d040d5348d0d508
treeff352ff14ddfffdbd3926394ea953989e525c1c9
parentee26ccecec7596d2e439de7282a1da37c96fb2c3
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: https://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