Bug 136087 - [CSS Shapes] Negative raster shape height leads to crash
Summary: [CSS Shapes] Negative raster shape height leads to crash
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Bem Jones-Bey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-19 17:50 PDT by Zoltan Horvath
Modified: 2015-01-07 14:30 PST (History)
6 users (show)

See Also:


Attachments
backtrace (19.10 KB, text/plain)
2014-08-19 17:53 PDT, Zoltan Horvath
no flags Details
Patch (6.51 KB, patch)
2014-08-19 18:11 PDT, Zoltan Horvath
no flags Details | Formatted Diff | Diff
Cleaned up test case (498 bytes, text/html)
2015-01-07 12:07 PST, Bem Jones-Bey
no flags Details
Patch (5.43 KB, patch)
2015-01-07 12:51 PST, Bem Jones-Bey
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Horvath 2014-08-19 17:50:07 PDT
The original test was provided by the u-szeged fuzzer. I reduced the test case and handled the negative margin-IntRect case in the shapes code.
Comment 1 Zoltan Horvath 2014-08-19 17:53:08 PDT
Created attachment 236839 [details]
backtrace
Comment 2 Zoltan Horvath 2014-08-19 18:11:58 PDT
Created attachment 236842 [details]
Patch
Comment 3 Bem Jones-Bey 2014-08-20 08:08:39 PDT
Comment on attachment 236842 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=236842&action=review

Given the complexity of the test case, I'm not convinced this is the proper fix.

> Source/WebCore/ChangeLog:9
> +        The original test was provided by the u-szeged fuzzer. I reduced the test
> +        case and handled the negative margin-IntRect case in the shapes code.

Can you give a better description of what this is fixing?

> LayoutTests/fast/shapes/shape-outside-floats/shape-outside-raster-shape-negative-height.html:3
> +* {

This test seems way too complex, especially since you're matching everything here. Are you sure you couldn't get something simpler? If you can't reduce it to simply a single float with shape-outside and a negative height margin box, I wonder if there is something more complex here than just having the height be negative. Is there a condition before it even gets to the shapes code that is failing?

> LayoutTests/fast/shapes/shape-outside-floats/shape-outside-raster-shape-negative-height.html:17
> +<button>a</button>

Does this have to be a button for this to fail, or would a <span> work? (Or do you even need it at all?)

> LayoutTests/fast/shapes/shape-outside-floats/shape-outside-raster-shape-negative-height.html:20
> +<p style="position: absolute; top: 100px;">

I wouldn't muck around with absolute positioning. Just have this paragraph in here, and dumpAsText() the entire test. You're not gaining anything from it being a ref test except complexity.
Comment 4 Bem Jones-Bey 2015-01-07 12:07:55 PST
Created attachment 244174 [details]
Cleaned up test case
Comment 5 Bem Jones-Bey 2015-01-07 12:51:30 PST
Created attachment 244179 [details]
Patch
Comment 6 Zoltan Horvath 2015-01-07 12:55:49 PST
Comment on attachment 244179 [details]
Patch

Thanks! Looks good!
Comment 7 WebKit Commit Bot 2015-01-07 14:30:33 PST
Comment on attachment 244179 [details]
Patch

Clearing flags on attachment: 244179

Committed r178054: <http://trac.webkit.org/changeset/178054>
Comment 8 WebKit Commit Bot 2015-01-07 14:30:37 PST
All reviewed patches have been landed.  Closing bug.