- Revision
- 96718
- Author
- [email protected]
- Date
- 2011-10-05 10:05:29 -0700 (Wed, 05 Oct 2011)
Log Message
https://bugs.webkit.org/show_bug.cgi?id=68731
Outline sides not painted for region. Fix the painting and hit testing code for regions to add in
the maximalOutlineSize on unclipped sides. Also fix some math errors with the computation of the
translation offset and clip rects when overflow or outlines spill out.
Reviewed by Darin Adler.
Source/WebCore:
Added new test in fast/regions.
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::paintIntoRegion):
(WebCore::RenderFlowThread::hitTestRegion):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::regionOverflowRect):
LayoutTests:
* fast/regions/outline-sides-in-region.html: Added.
* platform/mac/fast/regions/outline-sides-in-region-expected.png: Added.
* platform/mac/fast/regions/outline-sides-in-region-expected.txt: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (96717 => 96718)
--- trunk/LayoutTests/ChangeLog 2011-10-05 16:52:16 UTC (rev 96717)
+++ trunk/LayoutTests/ChangeLog 2011-10-05 17:05:29 UTC (rev 96718)
@@ -1,3 +1,17 @@
+2011-10-05 David Hyatt <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=68731
+
+ Outline sides not painted for region. Fix the painting and hit testing code for regions to add in
+ the maximalOutlineSize on unclipped sides. Also fix some math errors with the computation of the
+ translation offset and clip rects when overflow or outlines spill out.
+
+ Reviewed by Darin Adler.
+
+ * fast/regions/outline-sides-in-region.html: Added.
+ * platform/mac/fast/regions/outline-sides-in-region-expected.png: Added.
+ * platform/mac/fast/regions/outline-sides-in-region-expected.txt: Added.
+
2011-10-05 Csaba Osztrogonác <[email protected]>
[Qt][WK2] Unreviewed gardening.
Added: trunk/LayoutTests/fast/regions/outline-sides-in-region.html (0 => 96718)
--- trunk/LayoutTests/fast/regions/outline-sides-in-region.html (rev 0)
+++ trunk/LayoutTests/fast/regions/outline-sides-in-region.html 2011-10-05 17:05:29 UTC (rev 96718)
@@ -0,0 +1,29 @@
+<!-- this test should display two identical yellow squares -->
+<style type="text/css">
+
+ h1{
+ outline: 5px solid yellow;
+ }
+
+ #source{
+ -webkit-flow: "body";
+ }
+
+ #region{
+ content:-webkit-from-flow("body");
+ }
+ div{
+ width:200px;
+ height:200px;
+ }
+</style>
+<body>
+ <div id="source">
+ <h1> </h1>
+ </div>
+
+ <div id="region"></div>
+ <div>
+ <h1> </h1>
+ </div>
+</body>
\ No newline at end of file
Added: trunk/LayoutTests/platform/mac/fast/regions/outline-sides-in-region-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/regions/outline-sides-in-region-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/fast/regions/outline-sides-in-region-expected.txt (0 => 96718)
--- trunk/LayoutTests/platform/mac/fast/regions/outline-sides-in-region-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/regions/outline-sides-in-region-expected.txt 2011-10-05 17:05:29 UTC (rev 96718)
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderRegion {DIV} at (0,0) size 200x200
+ RenderBlock {DIV} at (0,221) size 200x200
+ RenderBlock {H1} at (0,0) size 200x37
+ RenderText {#text} at (0,0) size 8x37
+ text run at (0,0) width 8: " "
+Flow Threads
+ Thread with flow-name 'body'
+ layer at (0,0) size 200x200
+ RenderFlowThread at (0,0) size 200x200
+ RenderBlock {DIV} at (0,21) size 200x200
+ RenderBlock {H1} at (0,0) size 200x37
+ RenderText {#text} at (0,0) size 8x37
+ text run at (0,0) width 8: " "
+ Regions for flow 'body'
+ RenderRegion {DIV} #region with index 0
Modified: trunk/Source/WebCore/ChangeLog (96717 => 96718)
--- trunk/Source/WebCore/ChangeLog 2011-10-05 16:52:16 UTC (rev 96717)
+++ trunk/Source/WebCore/ChangeLog 2011-10-05 17:05:29 UTC (rev 96718)
@@ -1,3 +1,21 @@
+2011-10-05 David Hyatt <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=68731
+
+ Outline sides not painted for region. Fix the painting and hit testing code for regions to add in
+ the maximalOutlineSize on unclipped sides. Also fix some math errors with the computation of the
+ translation offset and clip rects when overflow or outlines spill out.
+
+ Reviewed by Darin Adler.
+
+ Added new test in fast/regions.
+
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::paintIntoRegion):
+ (WebCore::RenderFlowThread::hitTestRegion):
+ * rendering/RenderRegion.cpp:
+ (WebCore::RenderRegion::regionOverflowRect):
+
2011-10-05 Yury Semikhatsky <[email protected]>
Unreviewed. Build fix: make InspectorStateClient.h Private in XCode project.
Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (96717 => 96718)
--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2011-10-05 16:52:16 UTC (rev 96717)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2011-10-05 17:05:29 UTC (rev 96718)
@@ -421,7 +421,7 @@
// adjusted with the region padding and border.
LayoutRect regionRect(region->regionRect());
LayoutRect regionOverflowRect(region->regionOverflowRect());
- LayoutRect regionClippingRect(paintOffset, regionOverflowRect.size());
+ LayoutRect regionClippingRect(paintOffset + (regionOverflowRect.location() - regionRect.location()), regionOverflowRect.size());
PaintInfo info(paintInfo);
info.rect.intersect(regionClippingRect);
@@ -438,9 +438,9 @@
if (style()->isFlippedBlocksWritingMode()) {
LayoutRect flippedRegionRect(regionRect);
flipForWritingMode(flippedRegionRect);
- renderFlowThreadOffset = LayoutPoint(regionClippingRect.location() - flippedRegionRect.location());
+ renderFlowThreadOffset = LayoutPoint(paintOffset - flippedRegionRect.location());
} else
- renderFlowThreadOffset = LayoutPoint(regionClippingRect.location() - regionRect.location());
+ renderFlowThreadOffset = LayoutPoint(paintOffset - regionRect.location());
context->translate(renderFlowThreadOffset.x(), renderFlowThreadOffset.y());
info.rect.moveBy(-renderFlowThreadOffset);
@@ -455,7 +455,7 @@
{
LayoutRect regionRect(region->regionRect());
LayoutRect regionOverflowRect = region->regionOverflowRect();
- LayoutRect regionClippingRect(accumulatedOffset, regionOverflowRect.size());
+ LayoutRect regionClippingRect(accumulatedOffset + (regionOverflowRect.location() - regionRect.location()), regionOverflowRect.size());
if (!regionClippingRect.contains(pointInContainer))
return false;
@@ -463,9 +463,9 @@
if (style()->isFlippedBlocksWritingMode()) {
LayoutRect flippedRegionRect(regionRect);
flipForWritingMode(flippedRegionRect);
- renderFlowThreadOffset = LayoutPoint(regionClippingRect.location() - flippedRegionRect.location());
+ renderFlowThreadOffset = LayoutPoint(accumulatedOffset - flippedRegionRect.location());
} else
- renderFlowThreadOffset = LayoutPoint(regionClippingRect.location() - regionRect.location());
+ renderFlowThreadOffset = LayoutPoint(accumulatedOffset - regionRect.location());
LayoutPoint transformedPoint(pointInContainer.x() - renderFlowThreadOffset.x(), pointInContainer.y() - renderFlowThreadOffset.y());
Modified: trunk/Source/WebCore/rendering/RenderRegion.cpp (96717 => 96718)
--- trunk/Source/WebCore/rendering/RenderRegion.cpp 2011-10-05 16:52:16 UTC (rev 96717)
+++ trunk/Source/WebCore/rendering/RenderRegion.cpp 2011-10-05 17:05:29 UTC (rev 96718)
@@ -65,17 +65,20 @@
LayoutRect flowThreadOverflow = m_flowThread->visualOverflowRect();
// Only clip along the flow thread axis.
+ LayoutUnit outlineSize = maximalOutlineSize(PaintPhaseOutline);
LayoutRect clipRect;
if (m_flowThread->isHorizontalWritingMode()) {
- LayoutUnit minY = isFirstRegion() ? flowThreadOverflow.y() : regionRect().y();
- LayoutUnit maxY = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxY() : regionRect().maxY();
- clipRect = LayoutRect(clipX ? regionRect().x() : flowThreadOverflow.x(), minY,
- clipX ? regionRect().width() : flowThreadOverflow.width(), maxY - minY);
+ LayoutUnit minY = isFirstRegion() ? (flowThreadOverflow.y() - outlineSize) : regionRect().y();
+ LayoutUnit maxY = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? (flowThreadOverflow.maxY() + outlineSize) : regionRect().maxY();
+ LayoutUnit minX = clipX ? regionRect().x() : (flowThreadOverflow.x() - outlineSize);
+ LayoutUnit maxX = clipX ? regionRect().maxX() : (flowThreadOverflow.maxX() + outlineSize);
+ clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
} else {
- LayoutUnit minX = isFirstRegion() ? flowThreadOverflow.x() : regionRect().x();
- LayoutUnit maxX = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxX() : regionRect().maxX();
- clipRect = LayoutRect(minX, clipY ? regionRect().y() : flowThreadOverflow.y(),
- maxX - minX, clipY ? regionRect().height() : flowThreadOverflow.height());
+ LayoutUnit minX = isFirstRegion() ? (flowThreadOverflow.x() - outlineSize) : regionRect().x();
+ LayoutUnit maxX = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? (flowThreadOverflow.maxX() + outlineSize) : regionRect().maxX();
+ LayoutUnit minY = clipY ? regionRect().y() : (flowThreadOverflow.y() - outlineSize);
+ LayoutUnit maxY = clipY ? regionRect().maxY() : (flowThreadOverflow.maxY() + outlineSize);
+ clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
}
return clipRect;