Summary: | Crash when setting 'order' CSS property to a calculated value | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | CSS | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | benjamin, commit-queue, darin, dino, kling | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 138778 | ||||||||
Attachments: |
|
Description
Chris Dumez
2014-11-16 12:24:07 PST
Created attachment 241684 [details]
Patch
Comment on attachment 241684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241684&action=review > Source/WebCore/ChangeLog:15 > + valid in the CSS Parser intead but this would have brought issues: Typo: instead > Source/WebCore/ChangeLog:16 > + - The calculated value needs to be adjused to INT_MIN + 2 if it is less typo: adjusted > Source/WebCore/css/CSSParser.cpp:2507 > + double result = std::max<double>(std::numeric_limits<int>::min() + 2, parsedDouble(value, ReleaseParsedCalcValue)); I find the parsedDouble function confusing. It seems hard to use it correctly. Also, none of the callers use DoNotReleaseParsedCalcValue. I think the function should be renamed to takeParsedDouble, the argument should be changed to a CSSParserValue&, and the enum should be removed. And even after those fixes, I think it remains a function that implements a confusing pattern. For some reason we put the calculated value into CSSParser state, but the non-calculate value into a local variable; this is a messy pattern. Comment on attachment 241684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241684&action=review >> Source/WebCore/css/CSSParser.cpp:2507 >> + double result = std::max<double>(std::numeric_limits<int>::min() + 2, parsedDouble(value, ReleaseParsedCalcValue)); > > I find the parsedDouble function confusing. It seems hard to use it correctly. Also, none of the callers use DoNotReleaseParsedCalcValue. I think the function should be renamed to takeParsedDouble, the argument should be changed to a CSSParserValue&, and the enum should be removed. > > And even after those fixes, I think it remains a function that implements a confusing pattern. For some reason we put the calculated value into CSSParser state, but the non-calculate value into a local variable; this is a messy pattern. Ok, I will look into this in a follow-up. Created attachment 241689 [details]
Patch
Comment on attachment 241689 [details] Patch Clearing flags on attachment: 241689 Committed r176171: <http://trac.webkit.org/changeset/176171> All reviewed patches have been landed. Closing bug. |