Commit e018cb5e authored by stavila@adobe.com's avatar stavila@adobe.com

The overflow border of a relatively positioned element inside a region is not painted

https://bugs.webkit.org/show_bug.cgi?id=124919

Source/WebCore:

Relative positioned elements have self-painting layers that don't propagate the visual overflow
so the layer's position should be used when determining the clipping rectangle for box decorations.

Reviewed by Mihnea Ovidenie.

Test: fast/regions/relative-borders-overflow.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::decorationsClipRectForBoxInRegion):

LayoutTests:

Added new tests for correct painting of the borders of a relatively positioned element inside a region.

Reviewed by Mihnea Ovidenie.

* fast/regions/relative-borders-overflow-expected.html: Added.
* fast/regions/relative-borders-overflow.html: Added.
* fast/regions/relative-in-absolute-borders-overflow-expected.html: Added.
* fast/regions/relative-in-absolute-borders-overflow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c783015a
2013-12-03 Radu Stavila <stavila@adobe.com>
The overflow border of a relatively positioned element inside a region is not painted
https://bugs.webkit.org/show_bug.cgi?id=124919
Added new tests for correct painting of the borders of a relatively positioned element inside a region.
Reviewed by Mihnea Ovidenie.
* fast/regions/relative-borders-overflow-expected.html: Added.
* fast/regions/relative-borders-overflow.html: Added.
* fast/regions/relative-in-absolute-borders-overflow-expected.html: Added.
* fast/regions/relative-in-absolute-borders-overflow.html: Added.
2013-12-03 Chris Fleizach <cfleizach@apple.com>
AX: aria-hidden=false does not work as expected
......
<!DOCTYPE html>
<style>
#regionFlow {
border: 1px solid brown;
width: 180px;
height: 140px;
}
#article {
border: 2px solid green;
width: 210px;
height: 150px;
position: relative;
left: 30px;
top: 20px;
padding: 3px;
}
</style>
<body>
<p>The test passes if all borders are completely visible and the text <span style="color:brown"><b>THE END</b></span> is visible</p>
<div id="regionFlow">
<div id="article">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
</div>
</div>
</body>
\ No newline at end of file
<!DOCTYPE html>
<style>
#regionFlow {
-webkit-flow-from: flow2;
border: 1px solid brown;
width: 180px;
height: 140px;
}
#article {
-webkit-flow-into: flow2;
border: 2px solid green;
width: 210px;
height: 150px;
position: relative;
left: 30px;
top: 20px;
padding: 3px;
}
</style>
<body>
<p>The test passes if all borders are completely visible and the text <span style="color:brown"><b>THE END</b></span> is visible</p>
<div id="regionFlow"></div>
<div id="article">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
</div>
</body>
\ No newline at end of file
<!DOCTYPE html>
<style>
#regionFlow {
border: 1px solid brown;
width: 190px;
height: 150px;
}
#article {
border: 2px solid green;
width: 210px;
height: 150px;
position: relative;
left: 30px;
top: 20px;
padding: 3px;
}
#abs {
border: 2px solid magenta;
position: absolute;
top: 66px;
left: 24px;
}
</style>
<body>
<p>The test passes if all borders are completely visible and the text <span style="color:brown"><b>THE END</b></span> is visible</p>
<div id="regionFlow">
<div id="abs">
<div id="article">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
</div>
</div>
</div>
</body>
\ No newline at end of file
<!DOCTYPE html>
<style>
#regionFlow {
-webkit-flow-from: flow2;
border: 1px solid brown;
width: 180px;
height: 140px;
padding: 5px;
}
#article {
border: 2px solid green;
width: 210px;
height: 150px;
position: relative;
left: 30px;
top: 20px;
padding: 3px;
}
#abs {
-webkit-flow-into: flow2;
border: 2px solid magenta;
position: absolute;
top: 10px;
left: 10px;
}
</style>
<body>
<p>The test passes if all borders are completely visible and the text <span style="color:brown"><b>THE END</b></span> is visible</p>
<div id="regionFlow"></div>
<div id="abs">
<div id="article">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span style="color:brown"><b>THE END</b></span>.
</div>
</div>
</body>
\ No newline at end of file
2013-12-03 Radu Stavila <stavila@adobe.com>
The overflow border of a relatively positioned element inside a region is not painted
https://bugs.webkit.org/show_bug.cgi?id=124919
Relative positioned elements have self-painting layers that don't propagate the visual overflow
so the layer's position should be used when determining the clipping rectangle for box decorations.
Reviewed by Mihnea Ovidenie.
Test: fast/regions/relative-borders-overflow.html
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::decorationsClipRectForBoxInRegion):
2013-12-03 Seokju Kwon <seokju@webkit.org>
Web Inspector: Get rid of 'hasFrontend()' in InspectorController and WorkerInspectorController
......@@ -1282,26 +1282,33 @@ LayoutRect RenderFlowThread::decorationsClipRectForBoxInRegion(const RenderBox&
else
visualOverflowRect.moveBy(LayoutPoint(width(), 0));
}
const RenderBox* iterBox = &box;
while (iterBox && iterBox != this) {
RenderBlock* containerBlock = iterBox->containingBlock();
LayoutRect currentBoxRect = iterBox->frameRect();
if (iterBox->style().isFlippedBlocksWritingMode()) {
if (iterBox->style().isHorizontalWritingMode())
currentBoxRect.setY(currentBoxRect.height() - currentBoxRect.maxY());
else
currentBoxRect.setX(currentBoxRect.width() - currentBoxRect.maxX());
// FIXME: This doesn't work properly with flipped writing modes.
// https://bugs.webkit.org/show_bug.cgi?id=125149
if (box.isRelPositioned()) {
// For relative-positioned elements, just use the layer's location.
visualOverflowRect.moveBy(box.layer()->absoluteBoundingBox().location());
} else {
const RenderBox* iterBox = &box;
while (iterBox && iterBox != this) {
RenderBlock* containerBlock = iterBox->containingBlock();
LayoutRect currentBoxRect = iterBox->frameRect();
if (iterBox->style().isFlippedBlocksWritingMode()) {
if (iterBox->style().isHorizontalWritingMode())
currentBoxRect.setY(currentBoxRect.height() - currentBoxRect.maxY());
else
currentBoxRect.setX(currentBoxRect.width() - currentBoxRect.maxX());
}
if (containerBlock->style().writingMode() != iterBox->style().writingMode())
iterBox->flipForWritingMode(currentBoxRect);
visualOverflowRect.moveBy(currentBoxRect.location());
iterBox = containerBlock;
}
if (containerBlock->style().writingMode() != iterBox->style().writingMode())
iterBox->flipForWritingMode(currentBoxRect);
visualOverflowRect.moveBy(currentBoxRect.location());
iterBox = containerBlock;
}
return visualOverflowRect;
}
......
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