[Mac] Avoid creating DOMCSSStyleDeclaration in WebHTMLConverter
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 19:31:25 +0000 (19:31 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 19:31:25 +0000 (19:31 +0000)
commit9b568069325de42f27d3df6cb261f3d1bd9e1a41
treee397823255c1aae629673e35a0986a34ba1a514e
parentbcac739d614f1f7671af5f6c9e24eb330af3f762
[Mac] Avoid creating DOMCSSStyleDeclaration in WebHTMLConverter
https://bugs.webkit.org/show_bug.cgi?id=130226

Reviewed by Andreas Kling.

Extracted HTMLConverterCaches in C++ that directly calls getPropertyCSSValue on computed style
and inline style to avoid creating Objective-C wrappers for CSSComputedStyleDeclaration.

This improves the runtime of PerformanceTests/Interactive/CopyAll.html from 31-32s to 25-26s (20%).

* platform/mac/HTMLConverter.h:
* platform/mac/HTMLConverter.mm:
(HTMLConverterCaches::computedStylePropertyForElement):
(HTMLConverterCaches::inlineStylePropertyForElement):
(stringFromCSSValue):
(-[WebHTMLConverter _computedStringForNode:property:]):
(floatValueFromPrimitiveValue):
(_getFloat):
(-[WebHTMLConverter _getComputedFloat:forNode:property:]):
(-[WebHTMLConverter _computedColorForNode:property:]):
(-[WebHTMLConverter dealloc]):
(-[WebHTMLConverter init]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/mac/HTMLConverter.h
Source/WebCore/platform/mac/HTMLConverter.mm