Bug 114402 - [CSS Exclusions] polygon shape-inside layout fails
Summary: [CSS Exclusions] polygon shape-inside layout fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-10 17:57 PDT by Hans Muller
Modified: 2013-04-16 17:08 PDT (History)
2 users (show)

See Also:


Attachments
Test case screenshot. (142.56 KB, image/png)
2013-04-10 17:57 PDT, Hans Muller
no flags Details
Test case. (2.19 KB, text/html)
2013-04-10 17:58 PDT, Hans Muller
no flags Details
Simplified test case screenshot. (54.70 KB, image/png)
2013-04-16 11:21 PDT, Hans Muller
no flags Details
Simplified test case. (547 bytes, text/html)
2013-04-16 11:23 PDT, Hans Muller
no flags Details
Patch (7.88 KB, patch)
2013-04-16 12:27 PDT, Hans Muller
krit: review+
krit: commit-queue-
Details | Formatted Diff | Diff
Patch (7.95 KB, patch)
2013-04-16 15:44 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 Hans Muller 2013-04-10 17:57:29 PDT
Created attachment 197456 [details]
Test case screenshot.

As can be seen in the attached screenshot, there's a large gap in the text where no gap should be.
Comment 1 Hans Muller 2013-04-10 17:58:33 PDT
Created attachment 197457 [details]
Test case.
Comment 2 Hans Muller 2013-04-16 11:21:06 PDT
Created attachment 198349 [details]
Simplified test case screenshot.
Comment 3 Hans Muller 2013-04-16 11:23:16 PDT
Created attachment 198350 [details]
Simplified test case.

This version of the test case uses the Ahem font and just a few single-character lines of text to demo the problem.
Comment 4 Hans Muller 2013-04-16 12:27:37 PDT
Created attachment 198388 [details]
Patch
Comment 5 Hans Muller 2013-04-16 12:28:48 PDT
Comment on attachment 198388 [details]
Patch

The firstIncludedIntervalLogicalTop() method's implementation relied on optimistic assumptions about floating point accuracy which, in rare cases, caused it to discard first-fit locations based on the intersection of the minLogicalIntervalTop offset edge and a polygon offset edge. Now: we do not verify that first-fit locations based on the intersection of an offset edge and the minLogicalIntervalTop offset edge are below the horizontal minLogicalIntervalTop line. They're essentially below the line "by definition".
Comment 6 Dirk Schulze 2013-04-16 15:23:47 PDT
Comment on attachment 198388 [details]
Patch

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

r=me. Just some editorial change requests.

> Source/WebCore/ChangeLog:18
> +        (WebCore::ExclusionPolygon::firstIncludedIntervalLogicalTop): Avoid floating point problems when checking intersections with the offset edge based on minLogicalIntervalTop.

Split the comment into two lines.

> Source/WebCore/ChangeLog:21
> +        (WebCore::OffsetPolygonEdge::basis): Report what the offset edge is "based on": a polygon edge, the top of the line, or a (reflex) vertex.

Ditto.

> Source/WebCore/rendering/ExclusionPolygon.h:41
> +    enum Basis { Edge, Vertex, LineTop };

I'd like to have a new line for each enum item. This is usually used nowadays.
Comment 7 Hans Muller 2013-04-16 15:44:12 PDT
Created attachment 198447 [details]
Patch

Made the changes that Dirk suggested.
Comment 8 WebKit Commit Bot 2013-04-16 17:08:30 PDT
Comment on attachment 198447 [details]
Patch

Clearing flags on attachment: 198447

Committed r148582: <http://trac.webkit.org/changeset/148582>
Comment 9 WebKit Commit Bot 2013-04-16 17:08:32 PDT
All reviewed patches have been landed.  Closing bug.