Bug 128815

Summary: [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box
Product: WebKit Reporter: Radu Stavila <stavila>
Component: CSSAssignee: Radu Stavila <stavila>
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan, WebkitBugTracker
Priority: P2 Keywords: AdobeTracked
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 57312    
Description Flags
abucur: review-
abucur: review+
Patch for landing none

Description Radu Stavila 2014-02-14 07:05:39 PST
Currently, the contents of the box is correctly clipped by the region at the border box. However, the box decorations are clipped at the content box.
Comment 1 Radu Stavila 2014-02-17 07:45:16 PST
Created attachment 224368 [details]
Comment 2 Andrei Bucur 2014-02-17 08:25:57 PST
Comment on attachment 224368 [details]

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

> Source/WebCore/rendering/RenderRegion.cpp:525
>          mappedRect.intersect(flowThreadPortionRect());

I think the correct order of operations is to expand the flowThreadPortionRect() with the paddings and then intersect. This way:
1. You expand only when actually clipping
2. You don't expand a rectangle already intersected with the flowThreadPortionRect() that doesn't need the extra space to display correctly.

> Source/WebCore/rendering/RenderRegion.cpp:533
> +        if (isFirstRegion()) {

This should be startRegion.

> Source/WebCore/rendering/RenderRegion.cpp:543
> +        if (isLastRegion()) {

This should be lastRegion.
Comment 3 Radu Stavila 2014-02-17 08:43:40 PST
Created attachment 224377 [details]
Comment 4 Andrei Bucur 2014-02-17 08:47:16 PST
Comment on attachment 224377 [details]

r=me. Before committing, please update the CL with the new helper you implemented. Thanks!
Comment 5 Radu Stavila 2014-02-17 08:55:42 PST
Created attachment 224381 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2014-02-17 11:05:30 PST
Comment on attachment 224381 [details]
Patch for landing

Clearing flags on attachment: 224381

Committed r164231: <http://trac.webkit.org/changeset/164231>