Reviewed by Darin.
- repaint test and updated results for http://bugs.webkit.org/show_bug.cgi?id=13655
Incomplete repaint when text-shadow is used in a render layer with explicit height
* fast/repaint/layer-full-repaint-expected.checksum: Added.
* fast/repaint/layer-full-repaint-expected.png: Added.
* fast/repaint/layer-full-repaint-expected.txt: Added.
* fast/repaint/layer-full-repaint.html: Added.
* fast/repaint/repaint-resized-overflow-expected.checksum:
* fast/repaint/repaint-resized-overflow-expected.png:
WebCore:
Reviewed by Darin.
- fix http://bugs.webkit.org/show_bug.cgi?id=13655
Incomplete repaint when text-shadow is used in a render layer with explicit height
Test: fast/repaint/layer-full-repaint.html
Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
knows how to do everything we need now. The only catch is that we cannot
rely on its "do a full repaint if the object needs layout" behavior, since
by the time we call it, the needs layout flag has been reset. The solution
is to cache the need for a full repaint in the layer.
* page/FrameView.cpp:
(WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::checkForRepaintOnResize): Removed.
(WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
flag with a m_needsFullRepaint flag, which indicates that the layer needs
to do a full repaint in the next call to updateLayerPositions().
(WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
m_needsFullRepaint.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::setNeedsFullRepaint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21390
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-05-10 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Darin.
+
+ - repaint test and updated results for http://bugs.webkit.org/show_bug.cgi?id=13655
+ Incomplete repaint when text-shadow is used in a render layer with explicit height
+
+ * fast/repaint/layer-full-repaint-expected.checksum: Added.
+ * fast/repaint/layer-full-repaint-expected.png: Added.
+ * fast/repaint/layer-full-repaint-expected.txt: Added.
+ * fast/repaint/layer-full-repaint.html: Added.
+ * fast/repaint/repaint-resized-overflow-expected.checksum:
+ * fast/repaint/repaint-resized-overflow-expected.png:
+
2007-05-10 Justin Garcia <justin.garcia@apple.com>
Reviewed by ggaren
--- /dev/null
+ac11919b3374bdf25310762585898e18
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x116
+ RenderBlock {HTML} at (0,0) size 800x116
+ RenderBody {BODY} at (8,8) size 784x100
+layer at (8,8) size 100x100
+ RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13655</title>
+ <style type="text/css">
+ div {
+ position: relative;
+ height: 100px;
+ width: 100px;
+ background-color: red;
+ }
+
+ div.selected {
+ background-color: green;
+ text-shadow: red 5px 5px 0;
+ }
+ </style>
+ <script src="repaint.js" type="text/javascript"></script>
+ <script>
+ function repaintTest()
+ {
+ document.getElementById('test').className = "selected";
+ }
+ </script>
+</head>
+<body onload="runRepaintTest();">
+ <div id="test"></div>
+</body>
+</html>
-4a08fade6137f2ea6dca995ae001e2e6
\ No newline at end of file
+7bcff2ca869022f6515c572a36c58b4c
\ No newline at end of file
+2007-05-10 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Darin.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=13655
+ Incomplete repaint when text-shadow is used in a render layer with explicit height
+
+ Test: fast/repaint/layer-full-repaint.html
+
+ Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
+ knows how to do everything we need now. The only catch is that we cannot
+ rely on its "do a full repaint if the object needs layout" behavior, since
+ by the time we call it, the needs layout flag has been reset. The solution
+ is to cache the need for a full repaint in the layer.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::checkForRepaintOnResize): Removed.
+ (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
+ flag with a m_needsFullRepaint flag, which indicates that the layer needs
+ to do a full repaint in the next call to updateLayerPositions().
+ (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
+ Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
+ m_needsFullRepaint.
+ * rendering/RenderLayer.h:
+ (WebCore::RenderLayer::setNeedsFullRepaint):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
+
2007-05-10 Justin Garcia <justin.garcia@apple.com>
Reviewed by ggaren
RenderLayer* layer = root->enclosingLayer();
- if (!d->doFullRepaint)
- layer->checkForRepaintOnResize();
-
pauseScheduledEvents();
if (subtree)
, m_isOverflowOnly(shouldBeOverflowOnly())
, m_usedTransparency(false)
, m_inOverflowRelayout(false)
- , m_repaintOverflowOnResize(false)
+ , m_needsFullRepaint(false)
, m_overflowStatusDirty(true)
, m_visibleContentStatusDirty(true)
, m_hasVisibleContent(false)
ASSERT(!m_clipRects);
}
-void RenderLayer::checkForRepaintOnResize()
-{
- // FIXME: The second part of the condition is probably no longer needed. The first part can be
- // done when the object is marked for layout instead of walking the tree here.
- m_repaintOverflowOnResize = m_object->selfNeedsLayout() || m_object->hasOverflowClip() && m_object->normalChildNeedsLayout();
- for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
- child->checkForRepaintOnResize();
-}
-
void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
{
if (doFullRepaint) {
IntRect newOutlineBox = m_object->absoluteOutlineBox();
if (checkForRepaint) {
if (view && !view->printing()) {
- bool didMove = newOutlineBox.location() != m_outlineBox.location();
- if (!didMove && !m_repaintOverflowOnResize)
- m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_outlineBox);
- else if (didMove || newRect != m_repaintRect) {
+ if (m_needsFullRepaint) {
view->repaintViewRectangle(m_repaintRect);
- view->repaintViewRectangle(newRect);
- }
+ if (newRect != m_repaintRect)
+ view->repaintViewRectangle(newRect);
+ } else
+ m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_outlineBox);
}
}
m_repaintRect = newRect;
m_repaintRect = IntRect();
m_outlineBox = IntRect();
}
+
+ m_needsFullRepaint = false;
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->updateLayerPositions(doFullRepaint, checkForRepaint);
void updateLayerPosition();
void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
- void checkForRepaintOnResize();
void relativePositionOffset(int& relX, int& relY) { relX += m_relX; relY += m_relY; }
void updateHoverActiveState(const HitTestRequest&, HitTestResult&);
IntRect repaintRect() const { return m_repaintRect; }
+ void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
int staticX() const { return m_staticX; }
int staticY() const { return m_staticY; }
// we ended up painting this layer or any descendants (and therefore need to
// blend).
bool m_inOverflowRelayout : 1;
- bool m_repaintOverflowOnResize : 1;
+ bool m_needsFullRepaint : 1;
bool m_overflowStatusDirty : 1;
bool m_horizontalOverflow : 1;
bool alreadyNeededLayout = m_needsLayout;
m_needsLayout = b;
if (b) {
- if (!alreadyNeededLayout && markParents)
- markContainingBlocksForLayout();
+ if (!alreadyNeededLayout) {
+ if (markParents)
+ markContainingBlocksForLayout();
+ if (hasLayer())
+ layer()->setNeedsFullRepaint();
+ }
} else {
m_posChildNeedsLayout = false;
m_normalChildNeedsLayout = false;