WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
120215
MediaQuery::expressions() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=120215
Summary
MediaQuery::expressions() should return a reference
Pratik Solanki
Reported
2013-08-23 11:28:27 PDT
Code ensures that m_expressions is never null so we can just return a reference.
Attachments
Patch
(4.62 KB, patch)
2013-08-23 11:35 PDT
,
Pratik Solanki
no flags
Details
Formatted Diff
Diff
Patch
(6.13 KB, patch)
2013-08-23 12:29 PDT
,
Pratik Solanki
andersca
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Pratik Solanki
Comment 1
2013-08-23 11:35:44 PDT
Created
attachment 209479
[details]
Patch
Andreas Kling
Comment 2
2013-08-23 11:39:44 PDT
Comment on
attachment 209479
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209479&action=review
> Source/WebCore/css/MediaQueryEvaluator.cpp:145 > - const Vector<OwnPtr<MediaQueryExp> >* exps = query->expressions(); > + const Vector<OwnPtr<MediaQueryExp> >& exps = query->expressions();
Since you are touching every line with this variable on it, you could also rename it to "expressions" while you're here :)
Early Warning System Bot
Comment 3
2013-08-23 11:41:18 PDT
Comment on
attachment 209479
[details]
Patch
Attachment 209479
[details]
did not pass qt-ews (qt): Output:
http://webkit-queues.appspot.com/results/1523967
Early Warning System Bot
Comment 4
2013-08-23 11:42:20 PDT
Comment on
attachment 209479
[details]
Patch
Attachment 209479
[details]
did not pass qt-wk2-ews (qt-wk2): Output:
http://webkit-queues.appspot.com/results/1542358
EFL EWS Bot
Comment 5
2013-08-23 11:56:20 PDT
Comment on
attachment 209479
[details]
Patch
Attachment 209479
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/1558051
EFL EWS Bot
Comment 6
2013-08-23 12:14:59 PDT
Comment on
attachment 209479
[details]
Patch
Attachment 209479
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/1555303
Pratik Solanki
Comment 7
2013-08-23 12:29:49 PDT
Created
attachment 209491
[details]
Patch
WebKit Commit Bot
Comment 8
2013-08-23 12:32:29 PDT
Attachment 209491
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/MediaList.cpp', u'Source/WebCore/css/MediaQuery.cpp', u'Source/WebCore/css/MediaQuery.h', u'Source/WebCore/css/MediaQueryEvaluator.cpp']" exit_code: 1 Source/WebCore/css/MediaQueryEvaluator.cpp:145: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/MediaList.cpp:331: Missing spaces around >> [whitespace/operators] [3] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Anders Carlsson
Comment 9
2013-08-23 15:59:35 PDT
Comment on
attachment 209491
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209491&action=review
> Source/WebCore/css/MediaQuery.cpp:82 > +MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<ExpressionVector> exprs)
Didn’t we decide that this should be PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>>?
Pratik Solanki
Comment 10
2013-08-23 16:25:31 PDT
Comment on
attachment 209491
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209491&action=review
>> Source/WebCore/css/MediaQuery.cpp:82 >> +MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<ExpressionVector> exprs) > > Didn’t we decide that this should be PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>>?
Since this was in MediaQuery.cpp, I felt it was okay to use the internal typedef ExpressionVector. Header says PassOwnPtr<Vector<OwnPtr<MediaQueryExp>>> for clarity.
Pratik Solanki
Comment 11
2013-08-23 16:32:49 PDT
Actually, MediaQuery.h uses ExpressionVector in some of it's public methods. We should just use Vector<OwnPtr<MediaQueryExp>> there to be clearer for callers. I'll make that change and land. Thanks for the review.
Pratik Solanki
Comment 12
2013-08-23 17:13:12 PDT
Committed
r154533
: <
http://trac.webkit.org/changeset/154533
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug