Make parsing color presentation attributes do less pointless work.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2012 01:40:12 +0000 (01:40 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2012 01:40:12 +0000 (01:40 +0000)
commite2340dcad98e1a6f877561284290e9a3b8fac320
tree725ca10398312c0cd183067cd14a806916f54e82
parent14bdb67569e11d9529076a487a2bd07332bc9d06
Make parsing color presentation attributes do less pointless work.
<http://webkit.org/b/79304>

Reviewed by Antti Koivisto.

Let HTMLElement::addHTMLColorToStyle() construct the color CSSValue directly
rather than passing a string that has to go through CSSParser.

* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::setProperty):
* css/StylePropertySet.h:

    Added a setProperty(propertyID, CSSValue) overload that expands shorthand
    properties if necessary. Also added a little comment about the behavior
    differences between setProperty() overloads.

* html/HTMLElement.cpp:
(WebCore::parseColorStringWithCrazyLegacyRules):

    Changed this to return an RGBA32.

(WebCore::HTMLElement::addHTMLColorToStyle):

    Figure out the RGB value and construct a (pooled) CSSValue directly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/html/HTMLElement.cpp