Cache <font face> family lists in CSSValuePool.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 07:33:56 +0000 (07:33 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 07:33:56 +0000 (07:33 +0000)
commit31b46fa2dea1f6aa56eefcde951bd453408c4e97
treed0d28187700ba3c79038d68473d8f8caebfb0ea5
parente254f1a1b7f4e99a2464c38841f5cc37a09a2611
Cache <font face> family lists in CSSValuePool.
<http://webkit.org/b/79195>

Reviewed by Antti Koivisto.

HTMLFontElements with "face" attributes are very common in legacy web content.
Add a String->CSSValue cache for these in CSSValuePool and use it to avoid
reparsing and recreating duplicate font face values.

This knocks 20ms (~1.5%) worth of samples off of the Moz page cycler on my system.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceValue):
* css/CSSParser.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFaceValue):
* css/CSSValuePool.h:
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::collectStyleForAttribute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSValuePool.cpp
Source/WebCore/css/CSSValuePool.h
Source/WebCore/html/HTMLFontElement.cpp