[webkit-dev] StyleBuilder vs StyleResolver

Benjamin Poulain benjamin at webkit.org
Thu Apr 11 22:32:08 PDT 2013


On Thu, Apr 11, 2013 at 9:36 PM, Dirk Schulze <dschulze at adobe.com> wrote:

> The style of CSS properties is either set in StyleBuilder/CSSProperty or
> in StyleResolver (alias CSSStyleSelector).
>
> StyleResolver has a giant switch statement to handle all CSS property
> values and set the style. It is the historical way to build the style.
>
> StyleBuilder was introduced ~2 years ago. Instead of a giant switch to
> handle all property styles, it has a concept of template to combine CSS
> property handling.
>
> In these last two years new properties were mainly added to StyleBuilder,
> older properties were left alone in StyleResolver. The concept of
> StyleBuilder was always controversial[1][2]. A lot of people had concerns
> that StyleBuilder is less readable and makes it harder to understand the
> code.
>
> I personally am more worried that we still have two ways to set the style.
> I think it is bad to keep half of the properties in StyleResolver and the
> other half in StyleBuilder. We may use the general "spring cleanup" to
> revalidate the concept of StyleBuilder and StyleResolver and decide to use
> the one or the other concept.
>
> Any thoughts?
>

I agree with you this is an issue.

It would be great to remove StyleBuilder's bazillion classes or at least
change it to something a little more sane.
Are you volunteering to experiment with this? :)

Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130411/1607b7b2/attachment.html>


More information about the webkit-dev mailing list