Bug 82940

Summary: Simplify CSSStyleSelector constructor through the use of a helper function
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: aa, abarth, gustavo, macpherson, menard, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Eric Seidel (no email) 2012-04-02 13:36:49 PDT
Simplify CSSStyleSelector constructor through the use of a helper function
Comment 1 Eric Seidel (no email) 2012-04-02 13:37:34 PDT
Created attachment 135171 [details]
Patch
Comment 2 Alexis Menard (darktears) 2012-04-02 13:55:18 PDT
Comment on attachment 135171 [details]
Patch

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

> Source/WebCore/css/CSSStyleSelector.cpp:410
> +void CSSStyleSelector::addAuthorRulesAndCollectUserRulesFromSheets(const Vector<RefPtr<CSSStyleSheet> >* userSheets, RuleSet& userStyle)

While I see the benefit of the patch to avoid code duplication, I'm not sure whether it's part of the usage to pass a object by reference to modify it.
Comment 3 Eric Seidel (no email) 2012-04-02 13:57:35 PDT
See http://www.webkit.org/coding/coding-style.html "Pointers and References" for minimal guidance on the subject.  In short: yes, we do pass by reference at times.
Comment 4 Eric Seidel (no email) 2012-04-02 13:58:09 PDT
"An out argument of a function should be passed by reference except rare cases where it is optional in which case it should be passed by pointer." seems to suggest that we prefer references to pointers. :)
Comment 5 Gustavo Noronha (kov) 2012-04-02 14:56:51 PDT
Comment on attachment 135171 [details]
Patch

Attachment 135171 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12310679
Comment 6 Eric Seidel (no email) 2012-04-02 15:10:11 PDT
Comment on attachment 135171 [details]
Patch

gtk lies!
Comment 7 WebKit Review Bot 2012-04-03 05:11:28 PDT
Comment on attachment 135171 [details]
Patch

Clearing flags on attachment: 135171

Committed r113016: <http://trac.webkit.org/changeset/113016>
Comment 8 WebKit Review Bot 2012-04-03 05:11:34 PDT
All reviewed patches have been landed.  Closing bug.