Bug 96669

Summary: [CSS Exclusions] Add shape-inside tests for rounded rectangles
Product: WebKit Reporter: Bear Travis <betravis>
Component: CSSAssignee: Bear Travis <betravis>
Status: RESOLVED FIXED    
Severity: Normal CC: donggwan.kim, giles_joplin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 89256, 89707, 98462    
Attachments:
Description Flags
Adding rounded rectangle tests
none
Updating tests
none
Adding shape outline none

Description Bear Travis 2012-09-13 10:48:17 PDT
Shape-inside should work for rounded rectangles. Support should mostly be in with the addition of the shapes module, but it needs testing.
Comment 1 Bear Travis 2012-10-02 15:23:24 PDT
Created attachment 166763 [details]
Adding rounded rectangle tests
Comment 2 Hans Muller 2012-10-03 11:12:30 PDT
(In reply to comment #1)
> Created an attachment (id=166763) [details]
> Adding rounded rectangle tests

These tests look good to me although you might want make the height of one of the test case shapes greater than its width.  Likewise for the corner radii.

And it would simple and useful to verify that setting either corner radius value to zero produced the same results as a simple rectangle.

> "The expected results use float "sandbags" to mark off the shape-inside area."
You might qualify this, since shape-inside-rounded-rectangle-001-expected.html doesn't use sandbags, just carefully placed breaks.
Comment 3 Bear Travis 2012-10-04 16:33:12 PDT
Created attachment 167201 [details]
Updating tests

Incorporating feedback from Hans.
* Making one of the test cases have height > width and cornerRadiusY > cornerRadiusX
* Testing the case where cornerRadiusX or cornerRadiusY is 0
* Fixing up the comments to be more specific about only some of the tests using float sandbags
Corner radii greater than half their dimension (shape width or height) currently produce odd results. Linking to new bug 98462.
Comment 4 Bear Travis 2012-10-05 11:05:08 PDT
Created attachment 167353 [details]
Adding shape outline

Updating patch to use the ::before pseudo element to represent the outline of the shape inside.
Comment 5 Levi Weintraub 2012-10-05 12:22:54 PDT
Comment on attachment 167353 [details]
Adding shape outline

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

> LayoutTests/fast/exclusions/shape-inside/shape-inside-rounded-rectangle-002-expected.html:15
> +    function createSimulatedShapeElement() {
> +        var stylesheet = document.getElementById("stylesheet");
> +        var dimensions = {  width: 200, height: 300,
> +                            shapeX: 25, shapeY: 45,
> +                            shapeWidth: 100, shapeHeight: 200,
> +                            shapeRadiusX: 0, shapeRadiusY: 55 };
> +        generateSimulatedShapeElement("shape-inside1", stylesheet.sheet, dimensions, 9);
> +        dimensions.shapeRadiusX = 55;
> +        dimensions.shapeRadiusY = 0;
> +        generateSimulatedShapeElement("shape-inside2", stylesheet.sheet, dimensions, 9);

Super cool way to do ref expectations.
Comment 6 Dirk Schulze 2012-10-05 14:47:49 PDT
Comment on attachment 167353 [details]
Adding shape outline

Just setting cq+
Comment 7 WebKit Review Bot 2012-10-05 15:00:56 PDT
Comment on attachment 167353 [details]
Adding shape outline

Clearing flags on attachment: 167353

Committed r130557: <http://trac.webkit.org/changeset/130557>
Comment 8 WebKit Review Bot 2012-10-05 15:01:01 PDT
All reviewed patches have been landed.  Closing bug.