Bug 73703

Summary: StyledElement: Simplify addCSSColor().
Product: WebKit Reporter: Andreas Kling <kling>
Component: DOMAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+, kling: commit-queue-

Description Andreas Kling 2011-12-02 14:18:00 PST
StyledElement: Simplify addCSSColor().
Comment 1 Andreas Kling 2011-12-02 14:19:06 PST
Created attachment 117689 [details]
Patch
Comment 2 Darin Adler 2011-12-02 14:32:01 PST
Comment on attachment 117689 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=117689&action=review

> Source/WebCore/dom/StyledElement.cpp:374
> +    // An empty string doesn't apply a color. (Only whitespace does, which is why this check occurs before trimming.)

This wording (and the old wording) is terribly confusing.

The phrase “only whitespace applies a color” is not what we mean here. What we mean is “A string containing only whitespace applies a color”. So we need to word it that way: “A string containing only”, “One containing only”, “A string with only”, or “One with only”.

The term “trimming” is confusing, since the function called below is stripWhiteSpace, and does not use the word “trim”.

> Source/WebCore/dom/StyledElement.cpp:388
> +    Color color(colorString);

I think I’d call this local variable parsedColor.
Comment 3 Andreas Kling 2011-12-02 15:48:55 PST
Committed r101870: <http://trac.webkit.org/changeset/101870>