Summary: | Crash when setting 'flex' CSS property to 'calc(2 * 3) calc(2 * 3)' | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
Component: | CSS | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, commit-queue, darin, kling, koivisto, sam | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 138778 | ||||||||||
Attachments: |
|
Description
Chris Dumez
2014-12-01 16:32:32 PST
Created attachment 242364 [details]
Patch
Comment on attachment 242364 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=242364&action=review > Source/WebCore/css/CSSParser.cpp:6948 > const double result = m_parsedCalculation ? m_parsedCalculation->doubleValue() : v->fValue; Seems overkill to say const here. Just to emphasize that it’s not changed in the next three lines of code in this tiny function? > Source/WebCore/css/CSSParser.cpp:6950 > + m_parsedCalculation.clear(); Or maybe just = nullptr. Also, the argument name here is “v” and the definition of the argument is formatted incorrectly (with a space before the *), and the argument should be a reference not a pointer. And passing an argument to tell this to release the parsed calculation is just strange. Two separate functions would be much better. > And passing an argument to tell this to release the parsed calculation is
> just strange. Two separate functions would be much better.
I agree this needs refactoring. However, I'd like to handle this separately because it does not only affect this function. The same pattern is used for:
- validCalculationUnit()
- validUnit()
- parsedDouble()
I need to think a bit more about this to come up with a nicer proposal.
Created attachment 242426 [details]
Patch
Created attachment 242429 [details]
Patch
Comment on attachment 242429 [details] Patch Clearing flags on attachment: 242429 Committed r176674: <http://trac.webkit.org/changeset/176674> All reviewed patches have been landed. Closing bug. |