<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>114508</bug_id>
          
          <creation_ts>2013-04-12 06:49:28 -0700</creation_ts>
          <short_desc>[meta] Re-engineer StyleBuilder into something maintainable</short_desc>
          <delta_ts>2017-07-18 08:27:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>114532</dependson>
    
    <dependson>114715</dependson>
          <blocked>54707</blocked>
    
    <blocked>102844</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dirk Schulze">krit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>bjonesbe</cc>
    
    <cc>hugo.lima</cc>
    
    <cc>kling</cc>
    
    <cc>koivisto</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>psolanki</cc>
    
    <cc>rniwa</cc>
    
    <cc>vivekg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>874626</commentid>
    <comment_count>0</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2013-04-12 06:49:28 -0700</bug_when>
    <thetext>Join StyleBuilder with StyleResolver again.

* In a first step we should move all properties back into a giant switch statement.
* We should rename StyleResolver to StyleBuilder
* Experiment with better ways to build style in branch after this move</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874938</commentid>
    <comment_count>1</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2013-04-12 13:59:54 -0700</bug_when>
    <thetext>As I mentioned in webkit-dev, I don&apos;t think joining them is a good idea. The problem is that the current style building implementation sucks, not that separating it is was a bad idea itself. I think this one should be WONTFIX.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874939</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-04-12 14:01:30 -0700</bug_when>
    <thetext>Yeah, I think we can instead move the entire switch statement out of the StyleResolver and move it to StyleBuilder.  In fact, we can just repurpose this bug to do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874946</commentid>
    <comment_count>3</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2013-04-12 14:12:07 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; As I mentioned in webkit-dev, I don&apos;t think joining them is a good idea. The problem is that the current style building implementation sucks, not that separating it is was a bad idea itself. I think this one should be WONTFIX.

Oh, maybe I misunderstood you.

(In reply to comment #2)
&gt; Yeah, I think we can instead move the entire switch statement out of the StyleResolver and move it to StyleBuilder.  In fact, we can just repurpose this bug to do that.

Yes, that would work as well. Antti, what do you think about that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>875156</commentid>
    <comment_count>4</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2013-04-13 08:02:35 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Yeah, I think we can instead move the entire switch statement out of the StyleResolver and move it to StyleBuilder.  In fact, we can just repurpose this bug to do that.

I looked a bit in moving applyProperty(CSSPropertyID id, CSSValue* value) from StyleResolver to StyleBuilder.

Doing that would require to
* move some inline and static functions from StyleResolver to StyleBuilder
* make the shared StyleBuilder to a not constant resource (atm: const StaticBuilder&amp; in StyleResolver)
* solve some circular dependencies

All together, it is a quite complex move with a lot of refactoring. Therefore, we should be sure that this is the way to go. Further more, when the template and the switch are in one place, what is the next step?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>875166</commentid>
    <comment_count>5</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2013-04-13 08:55:10 -0700</bug_when>
    <thetext>If it was an easy refactoring it would have been done long time ago. :)

I think this should be done in steps, something like this:

1) rename StyleBuilder -&gt; DeprecatedStyleBuilder
2) create new StyleBuilder (it forwards to DeprecatedStyleBuilder for properties that are still implemented there) 
3) move the giant switch and the related functions from StyleResolver to StyleBuilder
4) move individual properties from DeprecatedStyleBuilder to StyleBuilder until nothing remains
5) delete DeprecatedStyleBuilder

We&apos;ll have DeprecatedStyleBuilder and the new StyleBuilder side by side for a while and can verify it is actually better.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>