Bug 128815 - [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box
Summary: [CSS Regions] The box decorations of an element overflowing a region should b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Radu Stavila
URL:
Keywords: AdobeTracked
Depends on:
Blocks: 57312
  Show dependency treegraph
 
Reported: 2014-02-14 07:05 PST by Radu Stavila
Modified: 2014-02-17 11:41 PST (History)
5 users (show)

See Also:


Attachments
Patch (23.73 KB, patch)
2014-02-17 07:45 PST, Radu Stavila
abucur: review-
Details | Formatted Diff | Diff
Patch (24.95 KB, patch)
2014-02-17 08:43 PST, Radu Stavila
abucur: review+
Details | Formatted Diff | Diff
Patch for landing (24.96 KB, patch)
2014-02-17 08:55 PST, Radu Stavila
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Patch
Comment 2 Andrei Bucur 2014-02-17 08:25:57 PST
Comment on attachment 224368 [details]
Patch

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]
Patch
Comment 4 Andrei Bucur 2014-02-17 08:47:16 PST
Comment on attachment 224377 [details]
Patch

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>