Bug 23307 - [Transforms] Repaint issue with relative position and transform
Summary: [Transforms] Repaint issue with relative position and transform
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-13 16:33 PST by Simon Fraser (smfr)
Modified: 2009-04-02 22:40 PDT (History)
1 user (show)

See Also:


Attachments
Testcase (762 bytes, text/html)
2009-01-13 16:33 PST, Simon Fraser (smfr)
no flags Details
Another testcase -- same issue? (774 bytes, text/html)
2009-01-13 16:34 PST, Simon Fraser (smfr)
no flags Details
Patch, testcase, changelog (5.19 KB, patch)
2009-04-02 22:32 PDT, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-01-13 16:33:01 PST
The attached testcase shows a problem repainting a relatively positioned element with a transform when innerText changes.
Comment 1 Simon Fraser (smfr) 2009-01-13 16:33:18 PST
Created attachment 26688 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2009-01-13 16:34:07 PST
Created attachment 26689 [details]
Another testcase -- same issue?
Comment 3 Simon Fraser (smfr) 2009-03-26 21:29:07 PDT
This is a LayoutState issue. Towards the end of RenderBlock::layoutBlock(), after we've popped the layout state, we're doing a repaintRectangle(). The current element has a transform, so we'd normally have disabled the layout state, but we after the pop, so we think it's ok to use the LayoutState in the repaint.
Comment 4 Simon Fraser (smfr) 2009-03-26 22:29:16 PDT
This seems to be an issue with LayoutState and transforms. This change fixes it but maybe we can do something more subtle.

diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 48d6d57..3e7b2de 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1170,7 +1170,15 @@ void RenderObject::repaintRectangle(const IntRect& r, bool immediate)
     dirtyRect.move(view->layoutDelta());
 
     RenderBoxModelObject* repaintContainer = containerForRepaint();
+    
+    if (hasTransform())
+        view->disableLayoutState();
+
     computeRectForRepaint(repaintContainer, dirtyRect);
+
+    if (hasTransform())
+        view->enableLayoutState();
+
     repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);
 }
 
Comment 5 Simon Fraser (smfr) 2009-04-02 22:32:00 PDT
Created attachment 29219 [details]
Patch, testcase, changelog

This patch fixes both testcases in this bug.
Comment 6 Simon Fraser (smfr) 2009-04-02 22:40:18 PDT
http://trac.webkit.org/changeset/42197