Diff
Modified: trunk/LayoutTests/ChangeLog (160013 => 160014)
--- trunk/LayoutTests/ChangeLog 2013-12-03 18:09:28 UTC (rev 160013)
+++ trunk/LayoutTests/ChangeLog 2013-12-03 18:28:54 UTC (rev 160014)
@@ -1,3 +1,17 @@
+2013-12-03 Radu Stavila <[email protected]>
+
+ 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 <[email protected]>
AX: aria-hidden=false does not work as expected
Added: trunk/LayoutTests/fast/regions/relative-borders-overflow-expected.html (0 => 160014)
--- trunk/LayoutTests/fast/regions/relative-borders-overflow-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/relative-borders-overflow-expected.html 2013-12-03 18:28:54 UTC (rev 160014)
@@ -0,0 +1,28 @@
+<!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
Added: trunk/LayoutTests/fast/regions/relative-borders-overflow.html (0 => 160014)
--- trunk/LayoutTests/fast/regions/relative-borders-overflow.html (rev 0)
+++ trunk/LayoutTests/fast/regions/relative-borders-overflow.html 2013-12-03 18:28:54 UTC (rev 160014)
@@ -0,0 +1,30 @@
+<!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
Added: trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow-expected.html (0 => 160014)
--- trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow-expected.html 2013-12-03 18:28:54 UTC (rev 160014)
@@ -0,0 +1,37 @@
+<!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
Added: trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow.html (0 => 160014)
--- trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow.html (rev 0)
+++ trunk/LayoutTests/fast/regions/relative-in-absolute-borders-overflow.html 2013-12-03 18:28:54 UTC (rev 160014)
@@ -0,0 +1,40 @@
+<!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
Modified: trunk/Source/WebCore/ChangeLog (160013 => 160014)
--- trunk/Source/WebCore/ChangeLog 2013-12-03 18:09:28 UTC (rev 160013)
+++ trunk/Source/WebCore/ChangeLog 2013-12-03 18:28:54 UTC (rev 160014)
@@ -1,3 +1,18 @@
+2013-12-03 Radu Stavila <[email protected]>
+
+ 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 <[email protected]>
Web Inspector: Get rid of 'hasFrontend()' in InspectorController and WorkerInspectorController
Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (160013 => 160014)
--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2013-12-03 18:09:28 UTC (rev 160013)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2013-12-03 18:28:54 UTC (rev 160014)
@@ -1282,26 +1282,33 @@
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;
}