Bug 17840

Summary: [Transforms] Modifying transform values on relatively positioned elements fails to redraw
Product: WebKit Reporter: David Beck <davbeck>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.5   
Bug Depends on: 21942    
Bug Blocks:    
Attachments:
Description Flags
Example page
none
Simpler testcase
none
Testcase to exercise the offsetForPositionedInContainer() code path
none
Patch
hyatt: review+
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect() hyatt: review+

Description David Beck 2008-03-13 21:47:53 PDT
When changing the the value of a transform, such as rotate, on an element that has been positioned relatively, the areas outside where the element would be if it was not positioned at all, witll not change from the previous value.

I encountered this using the nightly build from 3-13-08 on Mac OS X 10.5.2
Comment 1 David Beck 2008-03-13 21:49:59 PDT
Created attachment 19755 [details]
Example page

Example of when the failure occurs
Comment 2 Simon Fraser (smfr) 2008-11-11 20:56:24 PST
Created attachment 25084 [details]
Simpler testcase
Comment 3 Simon Fraser (smfr) 2008-11-11 23:02:39 PST
Created attachment 25088 [details]
Testcase to exercise the offsetForPositionedInContainer() code path
Comment 4 Simon Fraser (smfr) 2008-11-11 23:27:19 PST
Created attachment 25089 [details]
Patch

In RenderBox::computeAbsoluteRepaintRect(), the transform block clobbered topLeft after it had been adjusted for relative positioning, and for the offsetForPositionedInContainer().

The patch moves the topLeft adjustments until after the transform has been applied.
Comment 5 Simon Fraser (smfr) 2008-11-11 23:32:18 PST
Created attachment 25090 [details]
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect()

This is a follow-up patch that clean up RenderBox::computeAbsoluteRepaintRect():
* Do early return of container() is null
* if/else on style()->position()
* Make use of layer()->scrolledContentOffset()
Comment 6 Dave Hyatt 2008-11-12 11:31:34 PST
Comment on attachment 25089 [details]
Patch

r=me
Comment 7 Dave Hyatt 2008-11-12 11:32:24 PST
Comment on attachment 25090 [details]
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect()

r=me
Comment 8 Simon Fraser (smfr) 2008-11-12 12:23:19 PST
First patch: 

Committed r38338
	M	WebCore/rendering/RenderBox.cpp
	M	WebCore/ChangeLog
	A	LayoutTests/platform/mac/fast/repaint/transform-relative-position-expected.txt
	A	LayoutTests/platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.checksum
	A	LayoutTests/platform/mac/fast/repaint/transform-relative-position-expected.checksum
	A	LayoutTests/platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.png
	A	LayoutTests/platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.txt
	A	LayoutTests/platform/mac/fast/repaint/transform-relative-position-expected.png
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/repaint/transform-relative-position.html
	A	LayoutTests/fast/repaint/transform-absolute-in-positioned-container.html
r38338 = 71b2cc0a2f9a6d581a875f1c054e89e4e66a1d8c (trunk)

I fixed the tests to be real repaint tests.
Comment 9 Simon Fraser (smfr) 2008-11-12 12:29:07 PST
Second patch:
Committed r38339
	M	WebCore/rendering/RenderBox.cpp
	M	WebCore/ChangeLog
r38339 = a9261be41e86e2e97995671feb4eef8b3eaa2e45 (trunk)