| Summary: | Crash when setting '-webkit-line-clamp' 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 10:37:48 PST
Created attachment 241683 [details]
Patch
Comment on attachment 241683 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241683&action=review > LayoutTests/fast/css/webkit-line-clamp-calculated-value.html:16 > +shouldBeEmptyString("testDiv.style['-webkit-line-clamp']"); > +evalAndLog("testDiv.style['-webkit-line-clamp'] = 'calc(10% * 2)'"); > +shouldBeEqualToString("testDiv.style['-webkit-line-clamp']", "calc(20%)"); > +shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('-webkit-line-clamp')", "20%"); > +evalAndLog("testDiv.style['-webkit-line-clamp'] = 'calc(2 * 3)'"); > +shouldBeEqualToString("testDiv.style['-webkit-line-clamp']", "calc(6)"); > +shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('-webkit-line-clamp')", "6"); I suggest building this by having an array [input, expectedStyle, computedStyle] and stress test the hell out of it (all operator and units combinations). Since this is returning and integer, I would also test: boundaries integers values. Boundary floating point values, NaN, etc. Comment on attachment 241683 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241683&action=review >> LayoutTests/fast/css/webkit-line-clamp-calculated-value.html:16 >> +shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('-webkit-line-clamp')", "6"); > > I suggest building this by having an array [input, expectedStyle, computedStyle] and stress test the hell out of it (all operator and units combinations). > > Since this is returning and integer, I would also test: boundaries integers values. Boundary floating point values, NaN, etc. We already have extensive testing for calc() support (operators, ...). (In reply to comment #3) > We already have extensive testing for calc() support (operators, ...). I certainly hope so :) But apparently LineClampValue's testing is lacking or we would have discovered this problem sooner. (In reply to comment #4) > (In reply to comment #3) > > We already have extensive testing for calc() support (operators, ...). > > I certainly hope so :) > > But apparently LineClampValue's testing is lacking or we would have > discovered this problem sooner. Right, the issue is with the *type* of value that is expected for each CSS property. This is why I am fuzzy testing all CSS properties an finding these bugs. Testing support for different calc operators or corner cases is out-of-scope here IMHO, this is an orthogonal issue and already well tested. (In reply to comment #5) > Right, the issue is with the *type* of value that is expected for each CSS > property. This is why I am fuzzy testing all CSS properties an finding these > bugs. Testing support for different calc operators or corner cases is > out-of-scope here IMHO, this is an orthogonal issue and already well tested. You are right, testing all cases of calc() is not enough. Ideally we should test all keywords in addition to calc, and do that for every property. Maybe you should write a test script listing all CSS keyword, some useful values (boundaries, negative, etc) and all CSS property. Then have tests trying all combinations (ideally split on multiple files or it will timeout). (In reply to comment #6) > (In reply to comment #5) > > Right, the issue is with the *type* of value that is expected for each CSS > > property. This is why I am fuzzy testing all CSS properties an finding these > > bugs. Testing support for different calc operators or corner cases is > > out-of-scope here IMHO, this is an orthogonal issue and already well tested. > > You are right, testing all cases of calc() is not enough. > > Ideally we should test all keywords in addition to calc, and do that for > every property. > > Maybe you should write a test script listing all CSS keyword, some useful > values (boundaries, negative, etc) and all CSS property. Then have tests > trying all combinations (ideally split on multiple files or it will timeout). This sounds like the test I am currently running locally to find all these. However, it is crashing like crazy at the moment. Comment on attachment 241683 [details]
Patch
Let's fix all the bugs and land your test afterwards then.
Comment on attachment 241683 [details]
Patch
Thanks, I am trying to file more bugs now in case people want to help.
Comment on attachment 241683 [details] Patch Clearing flags on attachment: 241683 Committed r176165: <http://trac.webkit.org/changeset/176165> All reviewed patches have been landed. Closing bug. |