Bug 117573 - [CSS Shapes] Shape's content gets extra left offset when left-border is positive on the content box
Summary: [CSS Shapes] Shape's content gets extra left offset when left-border is posit...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Bear Travis
URL:
Keywords:
Depends on:
Blocks: 89256
  Show dependency treegraph
 
Reported: 2013-06-12 17:53 PDT by Zoltan Horvath
Modified: 2013-09-03 15:13 PDT (History)
6 users (show)

See Also:


Attachments
Initial patch (16.61 KB, patch)
2013-07-11 12:03 PDT, Bear Travis
no flags Details | Formatted Diff | Diff
Updated patch (17.94 KB, patch)
2013-07-23 11:50 PDT, Bear Travis
no flags Details | Formatted Diff | Diff
Updating changelogs (17.98 KB, patch)
2013-07-23 13:24 PDT, Bear Travis
no flags Details | Formatted Diff | Diff
Updated patch (17.82 KB, patch)
2013-08-15 11:45 PDT, Bear Travis
no flags Details | Formatted Diff | Diff
Updated patch (17.74 KB, patch)
2013-08-30 11:31 PDT, Bear Travis
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 2013-06-12 17:53:53 PDT
I will attach a test file later.
Comment 1 Bear Travis 2013-06-17 12:39:16 PDT
I think this may be related to bug 110475
Comment 2 Bear Travis 2013-07-11 12:03:24 PDT
Created attachment 206482 [details]
Initial patch
Comment 3 Dave Hyatt 2013-07-12 10:46:24 PDT
Comment on attachment 206482 [details]
Initial patch

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

r-

> Source/WebCore/rendering/RenderBlock.cpp:1439
> +LayoutSize RenderBlock::offsetFromShapeAncestorContainer(const RenderBlock* container) const

Please rename this to logicalOffsetFromShapeAncestorContainer to reflect that you're putting the y into the width() variable in vertical writing modes.

> Source/WebCore/rendering/RenderBlock.cpp:1442
> +    LayoutRect blockRect(0, 0, currentBlock->width(), currentBlock->height());

This is borderBoxRect(), so you can initialize to that, e.g., LayoutRect blockRect(currentBlock->borderBoxRect());

> Source/WebCore/rendering/RenderBlock.cpp:1450
> +        LayoutPoint currentBlockLocation = currentBlock->location();
> +
> +        blockRect.moveBy(currentBlockLocation);

This doesn't work when you cross writing mode boundaries. Remember that block coordinates can be flipped. When you cross into writing modes with different flips, you have to adjust accordingly. You'll want to test with mixed vertical-rl and vertical-lr and/or horizontal-tb/horizontal-bt to see what I mean.

> Source/WebCore/rendering/RenderBlock.cpp:2741
> +    LayoutSize childOffset = child->location() - oldRect.location();
> +    if (childOffset.width() && childRenderBlock && layoutShapeInsideInfo() && !childRenderBlock->shapeInsideInfo()) {
> +        childRenderBlock->setNormalChildNeedsLayout(true);
> +        childRenderBlock->markShapeInsideDescendantsForLayout();
> +        childRenderBlock->layoutIfNeeded();
> +    }

Put this in a helper function. Also, why are you only checking width? Is the intent to look for a change in logical left position? If so, you need to check height() if vertical.

> Source/WebCore/rendering/RenderBlock.h:591
> +    LayoutSize offsetFromShapeAncestorContainer(const RenderBlock* container) const;

logicalOffset...

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1688
> +    shapeInsideInfo->computeSegmentsForLine(lineLeft, lineTop, lineHeight);

Use a LayoutSize rather than two arguments here.

> Source/WebCore/rendering/shapes/ShapeInsideInfo.h:71
> +    bool computeSegmentsForLine(LayoutUnit lineLeft, LayoutUnit lineTop, LayoutUnit lineHeight)

Why not combine lineLeft/lineTop into a LayoutSize offset?
Comment 4 Bear Travis 2013-07-23 11:50:34 PDT
Created attachment 207341 [details]
Updated patch
Comment 5 Bear Travis 2013-07-23 13:24:09 PDT
Created attachment 207344 [details]
Updating changelogs
Comment 6 Bear Travis 2013-08-15 11:45:57 PDT
Created attachment 208828 [details]
Updated patch
Comment 7 Build Bot 2013-08-23 08:08:32 PDT
Comment on attachment 208828 [details]
Updated patch

Attachment 208828 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/1544282
Comment 8 Bear Travis 2013-08-30 11:31:41 PDT
Created attachment 210139 [details]
Updated patch
Comment 9 Dave Hyatt 2013-09-03 14:47:06 PDT
Comment on attachment 210139 [details]
Updated patch

r=me
Comment 10 WebKit Commit Bot 2013-09-03 15:13:51 PDT
Comment on attachment 210139 [details]
Updated patch

Clearing flags on attachment: 210139

Committed r155002: <http://trac.webkit.org/changeset/155002>
Comment 11 WebKit Commit Bot 2013-09-03 15:13:54 PDT
All reviewed patches have been landed.  Closing bug.