Bug 76043 - CSSStyleSelector constructor and appendAuthorStylesheets() contain duplicated code
Summary: CSSStyleSelector constructor and appendAuthorStylesheets() contain duplicated...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Roland Steiner
URL:
Keywords:
Depends on:
Blocks: 73190
  Show dependency treegraph
 
Reported: 2012-01-11 02:33 PST by Roland Steiner
Modified: 2012-01-16 04:05 PST (History)
6 users (show)

See Also:


Attachments
Patch (6.76 KB, patch)
2012-01-11 02:37 PST, Roland Steiner
no flags Details | Formatted Diff | Diff
new patch, smaller (2.50 KB, patch)
2012-01-15 18:19 PST, Roland Steiner
no flags Details | Formatted Diff | Diff
new patch, fixed (2.50 KB, patch)
2012-01-15 19:38 PST, Roland Steiner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Steiner 2012-01-11 02:33:14 PST
The end of the constructor and appendAuthorStylesheets contain what is essentially the same code. It should be possible to use a common function that handles appending author stylesheets.
Comment 1 Roland Steiner 2012-01-11 02:37:54 PST
Created attachment 121998 [details]
Patch
Comment 2 Antti Koivisto 2012-01-12 04:26:02 PST
Comment on attachment 121998 [details]
Patch

I don't think this is right factoring. We will need to do collectFeatures differently in append case to avoid going through all the stylesheets again. We don't generally use iterators with Vectors. I'd like to eliminate the pointless StyleSheetVector typedef.
Comment 3 Roland Steiner 2012-01-15 18:19:54 PST
Created attachment 122579 [details]
new patch, smaller

New, smaller patch. Adds a const-accessor for the vector to StyleSheetList. Perhaps not terribly elegant, but it's a) const only and b) there's a precedent with StyleSheetList::swap(). This way no iterators are necessary (still using 'StyleSheetVector' within StyleSheetList for consistency).
Comment 4 Gyuyoung Kim 2012-01-15 18:24:35 PST
Comment on attachment 122579 [details]
new patch, smaller

Attachment 122579 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11214031
Comment 5 Early Warning System Bot 2012-01-15 18:24:39 PST
Comment on attachment 122579 [details]
new patch, smaller

Attachment 122579 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11251031
Comment 6 WebKit Review Bot 2012-01-15 18:44:18 PST
Comment on attachment 122579 [details]
new patch, smaller

Attachment 122579 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11254025
Comment 7 Roland Steiner 2012-01-15 19:38:27 PST
Created attachment 122583 [details]
new patch, fixed
Comment 8 Antti Koivisto 2012-01-16 03:29:17 PST
Comment on attachment 122583 [details]
new patch, fixed

r=me
Comment 9 WebKit Review Bot 2012-01-16 04:05:21 PST
Comment on attachment 122583 [details]
new patch, fixed

Clearing flags on attachment: 122583

Committed r105052: <http://trac.webkit.org/changeset/105052>
Comment 10 WebKit Review Bot 2012-01-16 04:05:26 PST
All reviewed patches have been landed.  Closing bug.