Bug 100039

Summary: [CSS Exclusions] Multiple segment polygon layout does not get all segments
Product: WebKit Reporter: Bear Travis <betravis>
Component: CSSAssignee: Hans Muller <giles_joplin>
Status: RESOLVED FIXED    
Severity: Normal CC: donggwan.kim, eric, giles_joplin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 89256, 91878, 100763    
Attachments:
Description Flags
Test case
none
Patch
none
Patch
none
Patch
none
Patch none

Description Bear Travis 2012-10-22 15:36:54 PDT
In this test case the layout code is only seeing the rightmost leg of a "U" shape when layout begins.
Comment 1 Bear Travis 2012-10-22 15:37:46 PDT
Created attachment 170002 [details]
Test case

text layout should begin in the left leg of the 'U'
Comment 2 Hans Muller 2012-10-29 10:02:45 PDT
Created attachment 171271 [details]
Patch

This patch includes versions of the test case that can be verified with the existing layout support for shape-inside.
Comment 3 WebKit Review Bot 2012-10-29 10:06:12 PDT
Attachment 171271 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1
Source/WebCore/rendering/ExclusionPolygon.cpp:116:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Source/WebCore/rendering/ExclusionPolygon.cpp:121:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
Source/WebCore/rendering/ExclusionPolygon.cpp:127:  An else should appear on the same line as the preceding }  [whitespace/newline] [4]
Total errors found: 3 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Hans Muller 2012-10-29 10:20:51 PDT
Created attachment 171277 [details]
Patch

Corrected check-webkit-style problems.
Comment 5 Dirk Schulze 2012-10-29 23:14:08 PDT
Comment on attachment 171277 [details]
Patch

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

The patch looks great. Still have some questions.

> Source/WebCore/rendering/ExclusionPolygon.cpp:112
> +static bool getVertexIntersectionVertices(const EdgeIntersection& intersection, FloatPoint& prevVertex, FloatPoint& thisVertex, FloatPoint& nextVertex)

Can this be inline?

> Source/WebCore/rendering/ExclusionPolygon.cpp:119
> +    const ExclusionPolygon& polygon = *(intersection.edge->polygon);
> +    const ExclusionPolygonEdge& thisEdge = *(intersection.edge);

I am not sure how EdgeIntersection is implemented. Do we want it to be RefCounted?
Comment 6 Hans Muller 2012-10-30 09:05:06 PDT
(In reply to comment #5)
> (From update of attachment 171277 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=171277&action=review
> 
> The patch looks great. Still have some questions.
> 
> > Source/WebCore/rendering/ExclusionPolygon.cpp:112
> > +static bool getVertexIntersectionVertices(const EdgeIntersection& intersection, FloatPoint& prevVertex, FloatPoint& thisVertex, FloatPoint& nextVertex)
> 
> Can this be inline?

Yes, given how it's used it should be inline.

> 
> > Source/WebCore/rendering/ExclusionPolygon.cpp:119
> > +    const ExclusionPolygon& polygon = *(intersection.edge->polygon);
> > +    const ExclusionPolygonEdge& thisEdge = *(intersection.edge);
> 
> I am not sure how EdgeIntersection is implemented. Do we want it to be RefCounted?

The lifetime of the EdgeIntersections that are being referred to here are defined by the caller,
ExclusionPolygon::computeXIntersections().  In general, the EdgeIntersection objects do not 
persist longer than the main ExclusionShape entry point methods, getIncluded,ExcludedIntervals() 
and they are strictly private to the ExclusionPolygon implementation.  I don't think they need 
to be ref-counted.
Comment 7 Hans Muller 2012-10-30 09:28:30 PDT
Created attachment 171470 [details]
Patch

Made getVertexIntersectionVertices() inline.
Comment 8 Hans Muller 2012-10-30 16:40:29 PDT
Created attachment 171546 [details]
Patch

Renamed ExclusionPolygonEdge fields: vertex1Index => vertexIndex1, vertex2Index => vertexIndex2
Comment 9 Dirk Schulze 2012-10-30 16:44:46 PDT
Comment on attachment 171546 [details]
Patch

LGTM. r=me.
Comment 10 WebKit Review Bot 2012-10-30 18:38:11 PDT
Comment on attachment 171546 [details]
Patch

Clearing flags on attachment: 171546

Committed r132971: <http://trac.webkit.org/changeset/132971>
Comment 11 WebKit Review Bot 2012-10-30 18:38:15 PDT
All reviewed patches have been landed.  Closing bug.