Title: [125160] trunk
- Revision
- 125160
- Author
- [email protected]
- Date
- 2012-08-09 00:58:50 -0700 (Thu, 09 Aug 2012)
Log Message
Use m_everHadLayout in RenderObject::checkForRepaintDuringLayout()
https://bugs.webkit.org/show_bug.cgi?id=20885
Reviewed by Dan Bernstein.
Source/WebCore:
Fix FIXME in checkForRepaintDuringLayout, making RenderObjects
no longer paint on first layout, but instead require their
parent containers to paint them.
This appears to have fixed one minor SVG overpainting issue
in svg/use-detach-expected.png.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::checkForRepaintDuringLayout):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::layoutChildren):
LayoutTests:
Updated result. Appears to be a progression. I suspect
we were over-drawing the <g> container before and now we're
just drawing the two objects which change.
* platform/chromium-mac/svg/custom/use-detach-expected.png:
* platform/chromium-linux/svg/custom/use-detach-expected.png:
* platform/mac/svg/custom/use-detach-expected.png:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (125159 => 125160)
--- trunk/LayoutTests/ChangeLog 2012-08-09 07:47:55 UTC (rev 125159)
+++ trunk/LayoutTests/ChangeLog 2012-08-09 07:58:50 UTC (rev 125160)
@@ -1,3 +1,18 @@
+2012-08-09 Eric Seidel <[email protected]>
+
+ Use m_everHadLayout in RenderObject::checkForRepaintDuringLayout()
+ https://bugs.webkit.org/show_bug.cgi?id=20885
+
+ Reviewed by Dan Bernstein.
+
+ Updated result. Appears to be a progression. I suspect
+ we were over-drawing the <g> container before and now we're
+ just drawing the two objects which change.
+
+ * platform/chromium-mac/svg/custom/use-detach-expected.png:
+ * platform/chromium-linux/svg/custom/use-detach-expected.png:
+ * platform/mac/svg/custom/use-detach-expected.png:
+
2012-08-08 Arko Saha <[email protected]>
Microdata: PropertyNodeList cache should be invalidated on id attribute change.
Modified: trunk/LayoutTests/platform/chromium-linux/svg/custom/use-detach-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/chromium-mac/svg/custom/use-detach-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/svg/custom/use-detach-expected.png
(Binary files differ)
Modified: trunk/Source/WebCore/ChangeLog (125159 => 125160)
--- trunk/Source/WebCore/ChangeLog 2012-08-09 07:47:55 UTC (rev 125159)
+++ trunk/Source/WebCore/ChangeLog 2012-08-09 07:58:50 UTC (rev 125160)
@@ -1,3 +1,23 @@
+2012-08-09 Eric Seidel <[email protected]>
+
+ Use m_everHadLayout in RenderObject::checkForRepaintDuringLayout()
+ https://bugs.webkit.org/show_bug.cgi?id=20885
+
+ Reviewed by Dan Bernstein.
+
+ Fix FIXME in checkForRepaintDuringLayout, making RenderObjects
+ no longer paint on first layout, but instead require their
+ parent containers to paint them.
+ This appears to have fixed one minor SVG overpainting issue
+ in svg/use-detach-expected.png.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::checkForRepaintDuringLayout):
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::layoutChildren):
+
2012-08-08 Arko Saha <[email protected]>
Microdata: PropertyNodeList cache should be invalidated on id attribute change.
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (125159 => 125160)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-08-09 07:47:55 UTC (rev 125159)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-08-09 07:58:50 UTC (rev 125160)
@@ -1420,7 +1420,7 @@
if (!relayoutChildren && simplifiedLayout())
return;
- LayoutRepainter repainter(*this, everHadLayout() && checkForRepaintDuringLayout());
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
if (recomputeLogicalWidth())
relayoutChildren = true;
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (125159 => 125160)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2012-08-09 07:47:55 UTC (rev 125159)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2012-08-09 07:58:50 UTC (rev 125160)
@@ -1453,10 +1453,7 @@
bool RenderObject::checkForRepaintDuringLayout() const
{
- // FIXME: <https://bugs.webkit.org/show_bug.cgi?id=20885> It is probably safe to also require
- // m_everHadLayout. Currently, only RenderBlock::layoutBlock() adds this condition. See also
- // <https://bugs.webkit.org/show_bug.cgi?id=15129>.
- return !document()->view()->needsFullRepaint() && !hasLayer();
+ return !document()->view()->needsFullRepaint() && !hasLayer() && everHadLayout();
}
LayoutRect RenderObject::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (125159 => 125160)
--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2012-08-09 07:47:55 UTC (rev 125159)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2012-08-09 07:58:50 UTC (rev 125160)
@@ -207,6 +207,7 @@
for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
bool needsLayout = selfNeedsLayout;
+ bool childEverHadLayout = child->everHadLayout();
if (transformChanged) {
// If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
@@ -232,15 +233,19 @@
}
}
- if (needsLayout) {
+ if (needsLayout)
child->setNeedsLayout(true, MarkOnlyThis);
+
+ if (child->needsLayout()) {
child->layout();
- } else {
- if (child->needsLayout())
- child->layout();
- else if (layoutSizeChanged)
- notlayoutedObjects.add(child);
- }
+ // Renderers are responsible for repainting themselves when changing, except
+ // for the initial paint to avoid potential double-painting caused by non-sensical "old" bounds.
+ // We could handle this in the individual objects, but for now it's easier to have
+ // parent containers call repaint(). (RenderBlock::layout* has similar logic.)
+ if (!childEverHadLayout)
+ child->repaint();
+ } else if (layoutSizeChanged)
+ notlayoutedObjects.add(child);
ASSERT(!child->needsLayout());
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes