Bug 100039 - [CSS Exclusions] Multiple segment polygon layout does not get all segments
Summary: [CSS Exclusions] Multiple segment polygon layout does not get all segments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hans Muller
URL:
Keywords:
Depends on:
Blocks: 89256 91878 100763
  Show dependency treegraph
 
Reported: 2012-10-22 15:36 PDT by Bear Travis
Modified: 2012-10-30 18:38 PDT (History)
4 users (show)

See Also:


Attachments
Test case (409 bytes, text/html)
2012-10-22 15:37 PDT, Bear Travis
no flags Details
Patch (24.41 KB, patch)
2012-10-29 10:02 PDT, Hans Muller
no flags Details | Formatted Diff | Diff
Patch (24.32 KB, patch)
2012-10-29 10:20 PDT, Hans Muller
no flags Details | Formatted Diff | Diff
Patch (24.30 KB, patch)
2012-10-30 09:28 PDT, Hans Muller
no flags Details | Formatted Diff | Diff
Patch (24.35 KB, patch)
2012-10-30 16:40 PDT, Hans Muller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.