WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158021
[css-grid] Simplify grid track sizes parsing
https://bugs.webkit.org/show_bug.cgi?id=158021
Summary
[css-grid] Simplify grid track sizes parsing
Manuel Rego Casasnovas
Reported
2016-05-24 04:18:47 PDT
This is a port from a Blink patch:
https://codereview.chromium.org/1998033003/
Attachments
Patch
(10.78 KB, patch)
2016-05-24 04:36 PDT
,
Manuel Rego Casasnovas
no flags
Details
Formatted Diff
Diff
=Patch for landing
(10.92 KB, patch)
2016-05-25 01:50 PDT
,
Manuel Rego Casasnovas
no flags
Details
Formatted Diff
Diff
Patch
(10.92 KB, patch)
2016-05-25 06:12 PDT
,
Manuel Rego Casasnovas
no flags
Details
Formatted Diff
Diff
Patch
(10.90 KB, patch)
2016-05-25 07:11 PDT
,
Manuel Rego Casasnovas
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Manuel Rego Casasnovas
Comment 1
2016-05-24 04:36:14 PDT
Created
attachment 279644
[details]
Patch
Sergio Villar Senin
Comment 2
2016-05-25 00:47:57 PDT
Comment on
attachment 279644
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=279644&action=review
> Source/WebCore/css/CSSParser.cpp:5823 > + const CSSPrimitiveValue& primitiveValue = value.isPrimitiveValue()
I think we could use here auto& as it's pretty clear from the right side that we have a CSSPrimitiveValue.
> Source/WebCore/css/CSSParser.cpp:5830 > return true;
Perhaps adding and ASSERT just before the return here?
> Source/WebCore/css/CSSParser.cpp:5867 > + allTracksAreFixedSized = isGridTrackFixedSized(*value);
What about allTracksAreFixedSized = allTracksAreFixedSized && isGridTrackFixedSized(*value);
> Source/WebCore/css/CSSParser.cpp:5925 > + allTracksAreFixedSized = isGridTrackFixedSized(*trackSize);
Ditto.
> Source/WebCore/css/CSSParser.cpp:5995 > return CSSValuePool::singleton().createIdentifierValue(value.id);
You should remove the braces as there is only one instruction in the if block.
Manuel Rego Casasnovas
Comment 3
2016-05-25 01:50:49 PDT
Created
attachment 279748
[details]
=Patch for landing
Manuel Rego Casasnovas
Comment 4
2016-05-25 01:51:27 PDT
Comment on
attachment 279644
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=279644&action=review
Thanks for the quick review!
>> Source/WebCore/css/CSSParser.cpp:5823 >> + const CSSPrimitiveValue& primitiveValue = value.isPrimitiveValue() > > I think we could use here auto& as it's pretty clear from the right side that we have a CSSPrimitiveValue.
Done.
>> Source/WebCore/css/CSSParser.cpp:5830 >> return true; > > Perhaps adding and ASSERT just before the return here?
Yeah, I'll add it.
>> Source/WebCore/css/CSSParser.cpp:5867 >> + allTracksAreFixedSized = isGridTrackFixedSized(*value); > > What about > > allTracksAreFixedSized = allTracksAreFixedSized && isGridTrackFixedSized(*value);
In that case, even when allTracksAreFixedSized is FALSE, we'll be calling isGridTrackFixedSized() over and over. With the current code, once allTracksAreFixedSized is FALSE, we don't call isGridTrackFixedSized() anymore.
>> Source/WebCore/css/CSSParser.cpp:5925 >> + allTracksAreFixedSized = isGridTrackFixedSized(*trackSize); > > Ditto.
Ditto. :-)
>> Source/WebCore/css/CSSParser.cpp:5995 >> return CSSValuePool::singleton().createIdentifierValue(value.id); > > You should remove the braces as there is only one instruction in the if block.
Done.
WebKit Commit Bot
Comment 5
2016-05-25 02:21:29 PDT
Comment on
attachment 279748
[details]
=Patch for landing Clearing flags on attachment: 279748 Committed
r201373
: <
http://trac.webkit.org/changeset/201373
>
WebKit Commit Bot
Comment 6
2016-05-25 02:21:32 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7
2016-05-25 03:52:57 PDT
Comment on
attachment 279748
[details]
=Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=279748&action=review
> Source/WebCore/css/CSSParser.cpp:5822 > + ASSERT(value.isPrimitiveValue() || (value.isFunctionValue() && downcast<CSSFunctionValue>(value).arguments()));
After this landed, we are hitting this assertion in isGridTrackFixedSized in parseGridTrackList in multiple tests. Because of that we will probably need to roll this change out. The problem is that parseGridTrackList calls parseGridBreadth, which can return a numeric value. Then this function incorrectly asserts that it’s not a numeric value.
WebKit Commit Bot
Comment 8
2016-05-25 04:13:12 PDT
Re-opened since this is blocked by
bug 158064
Manuel Rego Casasnovas
Comment 9
2016-05-25 06:12:30 PDT
Created
attachment 279762
[details]
Patch
Manuel Rego Casasnovas
Comment 10
2016-05-25 06:13:03 PDT
View in context:
https://bugs.webkit.org/attachment.cgi?id=279748&action=review
> Source/WebCore/css/CSSParser.cpp:5830 > + ASSERT(primitiveValue.isLength());
We were actually hitting this ASSERT, as it's not enough to check that the CSSPrimitiveValue is length, it doesn't include percentages or calc(). I've modified it to check the 3 cases and now the tests are passing in debug here.
Sergio Villar Senin
Comment 11
2016-05-25 06:33:55 PDT
(In reply to
comment #4
)
> Comment on
attachment 279644
[details]
> >> Source/WebCore/css/CSSParser.cpp:5867 > >> + allTracksAreFixedSized = isGridTrackFixedSized(*value); > > > > What about > > > > allTracksAreFixedSized = allTracksAreFixedSized && isGridTrackFixedSized(*value); > > In that case, even when allTracksAreFixedSized is FALSE, we'll be calling > isGridTrackFixedSized() over and over. > With the current code, once allTracksAreFixedSized is FALSE, we don't call > isGridTrackFixedSized() anymore.
The && operator in C++ shortcircuits meaning that the second part won't be evaluated.
Manuel Rego Casasnovas
Comment 12
2016-05-25 07:11:43 PDT
Created
attachment 279767
[details]
Patch
WebKit Commit Bot
Comment 13
2016-05-25 07:43:40 PDT
Comment on
attachment 279767
[details]
Patch Clearing flags on attachment: 279767 Committed
r201382
: <
http://trac.webkit.org/changeset/201382
>
WebKit Commit Bot
Comment 14
2016-05-25 07:43:44 PDT
All reviewed patches have been landed. Closing bug.
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