Bug 82940 - Simplify CSSStyleSelector constructor through the use of a helper function
Summary: Simplify CSSStyleSelector constructor through the use of a helper function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 13:36 PDT by Eric Seidel (no email)
Modified: 2012-04-03 05:11 PDT (History)
7 users (show)

See Also:


Attachments
Patch (4.18 KB, patch)
2012-04-02 13:37 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.