Commit 35793310 authored by zoltan@webkit.org's avatar zoltan@webkit.org

Source/WebCore: [CSS Regions][CSS Shapes] Layout error when the shape has...

Source/WebCore: [CSS Regions][CSS Shapes] Layout error when the shape has negative top coordinate and it's applied on the second region
<https://webkit.org/b/123346>

Reviewed by David Hyatt.

We have a layout error when there is a shape applied on the second region, and it has a negative 'top' coordinate.
Since shapeInsideInfo::shapeLogicalTop() can return negative numbers, we need to check for it, when we're positioning
the first line in the region.

Test: fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread):

LayoutTests: [CSS Regions][CSS Shapes] Layout error when the shape has negative top coordinate and it's applied on the second region
<http://webkit.org/b/123346>

Reviewed by David Hyatt.

We have a layout error when there is a shape applied on the second region, and it has a negative 'top' coordinate.
Since shapeInsideInfo::shapeLogicalTop() can return negative numbers, we need to check for it, when we're positioning
the first line in the region.

* fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top-expected.html: Added.
* fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1e43bbd3
2013-10-29 Zoltan Horvath <zoltan@webkit.org>
[CSS Regions][CSS Shapes] Layout error when the shape has negative top coordinate and it's applied on the second region
<http://webkit.org/b/123346>
Reviewed by David Hyatt.
We have a layout error when there is a shape applied on the second region, and it has a negative 'top' coordinate.
Since shapeInsideInfo::shapeLogicalTop() can return negative numbers, we need to check for it, when we're positioning
the first line in the region.
* fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top-expected.html: Added.
* fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top.html: Added.
2013-10-29 Ryosuke Niwa <rniwa@webkit.org>
Add a failing test expectation on editing/execCommand/insert-list-xml.xhtml
......
<!DOCTYPE html>
<html>
<head>
<style>
article { font: 10px Ahem, sans-serif; }
.regions {
width: 260px;
margin: 0px 20px 20px;
padding: 7px;
background-color: #b0dcff;
-webkit-shape-inside: polygon(20px -62px, 314px -62px, 314px 152px, 44px 152px);
height: 200px;
}
.overflow {
margin-top: -34px;
margin-left: 20px;
padding: 7px;
}
</style>
</head>
<body>
<article>
<div class="regions">
<p>
CSS Pseudo-elements is a new proposal by Adobe to the W3C that allows multiple "before" and "after" pseudo-elements to be generated by a single element.
In this example you can see how another region (the blue one) is added after the page is loaded and the CSSRegions object is
</div>
<div class="regions">
created.
<a href="http://example.org">This is a very long link!</a>
</p>
<p>
Multiple pseudo-elements cover use cases collected on css-tricks.com.
</p>
<p>
This is a prototype JavaScript implementation to give you a feel for how the code will look like and behave. Please keep in mind that
</div>
<div class="overflow">
this is just... . . .
</div>
</article>
<p style="margin-top: 30px">
We have two regions, a polygon shape with negative top coordinates is applied on the regions. The content should flow from the first shape to the second shape. The overflow should
be pushed down below the content box.
</p>
<p>Bug <a href="http://webkit.org/b/123103">123103</a>: [CSS Shapes][CSS Regions] Don't apply shape-inside when we have multiple auto-height regions and the height is not resolved</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
#source {
font: 10px Ahem, sans-serif;
-webkit-flow-into: article;
}
.regions {
-webkit-flow-from: article;
width: 260px;
margin: 0px 20px 20px;
padding: 7px;
background-color: #b0dcff;
-webkit-shape-inside: polygon(20px -62px, 314px -62px, 314px 152px, 44px 152px);
height: 200px;
}
</style>
</head>
<body>
<article>
<div class="regions"></div>
<div class="regions"></div>
</article>
<div id="source">
<p>
CSS Pseudo-elements is a new proposal by Adobe to the W3C that allows multiple "before" and "after" pseudo-elements to be generated by a single element.
In this example you can see how another region (the blue one) is added after the page is loaded and the CSSRegions object is created.
<a href="http://example.org">This is a very long link!</a>
</p>
<p>
Multiple pseudo-elements cover use cases collected on css-tricks.com.
</p>
<p>
This is a prototype JavaScript implementation to give you a feel for how the code will look like and behave. Please keep in mind that this is just... . . .
</p>
</div>
<p style="margin-top: 40px;">
We have two regions, a polygon shape with negative top coordinates is applied on the regions. The content should flow from the first shape to the second shape. The overflow should
be pushed down below the content box.
</p>
<p>Bug <a href="http://webkit.org/b/123103">123103</a>: [CSS Shapes][CSS Regions] Don't apply shape-inside when we have multiple auto-height regions and the height is not resolved</p>
</body>
</html>
2013-10-29 Zoltan Horvath <zoltan@webkit.org>
[CSS Regions][CSS Shapes] Layout error when the shape has negative top coordinate and it's applied on the second region
<https://webkit.org/b/123346>
Reviewed by David Hyatt.
We have a layout error when there is a shape applied on the second region, and it has a negative 'top' coordinate.
Since shapeInsideInfo::shapeLogicalTop() can return negative numbers, we need to check for it, when we're positioning
the first line in the region.
Test: fast/regions/shape-inside/shape-inside-on-multiple-regions-with-negative-shape-top.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread):
2013-10-29 Brady Eidson <beidson@apple.com>
Get IDBTransactionBackendLevelDBOperations *almost* ready to go cross platform.
......
......@@ -1443,7 +1443,8 @@ void RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsi
// We position the first line to the top of the shape in the region or to the previously adjusted position in the shape
if (isFirstLineInRegion || isFirstLineAdjusted) {
LayoutUnit shapeTopOffset = layoutState.adjustedLogicalLineTop();
if (!shapeTopOffset)
if (!shapeTopOffset && (shapeInsideInfo->shapeLogicalTop() > 0))
shapeTopOffset = shapeInsideInfo->shapeLogicalTop();
LayoutUnit shapePositionInFlowThread = currentRegion->logicalTopForFlowThreadContent() + shapeTopOffset;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment