Bug 139898 - Move color CSS properties to the new StyleBuilder
Summary: Move color CSS properties to the new StyleBuilder
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 137910
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-22 19:59 PST by Chris Dumez
Modified: 2014-12-23 20:59 PST (History)
7 users (show)

See Also:


Attachments
Patch (31.23 KB, patch)
2014-12-22 22:20 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (31.27 KB, patch)
2014-12-23 09:07 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (1.55 KB, patch)
2014-12-23 13:45 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-12-22 19:59:06 PST
Move color CSS properties to the new StyleBuilder.
Comment 1 Chris Dumez 2014-12-22 22:20:14 PST
Created attachment 243665 [details]
Patch
Comment 2 Antti Koivisto 2014-12-23 04:25:58 PST
Comment on attachment 243665 [details]
Patch

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

> Source/WebCore/css/CSSPropertyNames.in:69
> +// * ColorProperty:
> +// Indicates that this CSS property is a color property with a
> +// "setVisitedLinkXXX()" setter on RenderStyle to be called when
> +// StyleResolver::applyPropertyToVisitedLinkStyle() return true.
> +// The regular setter on RenderStyle will only be called if
> +// StyleResolver::applyPropertyToRegularStyle() returns true.

I think this should have a name that indicates that the property works for visited links. VisitedLinkSupportingColorProperty or something.
Comment 3 Chris Dumez 2014-12-23 09:07:47 PST
Created attachment 243677 [details]
Patch
Comment 4 Chris Dumez 2014-12-23 09:08:24 PST
(In reply to comment #2)
> Comment on attachment 243665 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=243665&action=review
> 
> > Source/WebCore/css/CSSPropertyNames.in:69
> > +// * ColorProperty:
> > +// Indicates that this CSS property is a color property with a
> > +// "setVisitedLinkXXX()" setter on RenderStyle to be called when
> > +// StyleResolver::applyPropertyToVisitedLinkStyle() return true.
> > +// The regular setter on RenderStyle will only be called if
> > +// StyleResolver::applyPropertyToRegularStyle() returns true.
> 
> I think this should have a name that indicates that the property works for
> visited links. VisitedLinkSupportingColorProperty or something.

I used "VisitedLinkColorSupport" in the latest patch.
Comment 5 WebKit Commit Bot 2014-12-23 10:37:24 PST
Comment on attachment 243677 [details]
Patch

Clearing flags on attachment: 243677

Committed r177687: <http://trac.webkit.org/changeset/177687>
Comment 6 WebKit Commit Bot 2014-12-23 10:37:29 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2014-12-23 11:57:35 PST
Comment on attachment 243665 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.h:2086
> +    static Color invalidColor() { static Color invalid; return invalid; }

I just noticed this pointless global variable. How about just this?

    static Color invalidColor() { return Color(); }
Comment 8 Chris Dumez 2014-12-23 13:45:53 PST
Reopening to attach new patch.
Comment 9 Chris Dumez 2014-12-23 13:45:55 PST
Created attachment 243689 [details]
Patch
Comment 10 Chris Dumez 2014-12-23 13:47:40 PST
(In reply to comment #7)
> Comment on attachment 243665 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=243665&action=review
> 
> > Source/WebCore/rendering/style/RenderStyle.h:2086
> > +    static Color invalidColor() { static Color invalid; return invalid; }
> 
> I just noticed this pointless global variable. How about just this?
> 
>     static Color invalidColor() { return Color(); }

My guess is that the idea was to avoid calling the Color constructor every time. However, the default Color constructor is really cheap so this is likely not worth it.

I uploaded another patch to fix this here.
Comment 11 WebKit Commit Bot 2014-12-23 20:58:54 PST
Comment on attachment 243689 [details]
Patch

Clearing flags on attachment: 243689

Committed r177720: <http://trac.webkit.org/changeset/177720>
Comment 12 WebKit Commit Bot 2014-12-23 20:59:00 PST
All reviewed patches have been landed.  Closing bug.