Bug 17840 - [Transforms] Modifying transform values on relatively positioned elements fails to redraw
Summary: [Transforms] Modifying transform values on relatively positioned elements fai...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on: 21942
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-13 21:47 PDT by David Beck
Modified: 2008-11-12 12:29 PST (History)
2 users (show)

See Also:


Attachments
Example page (953 bytes, text/html)
2008-03-13 21:49 PDT, David Beck
no flags Details
Simpler testcase (917 bytes, text/html)
2008-11-11 20:56 PST, Simon Fraser (smfr)
no flags Details
Testcase to exercise the offsetForPositionedInContainer() code path (1.17 KB, text/html)
2008-11-11 23:02 PST, Simon Fraser (smfr)
no flags Details
Patch (12.26 KB, patch)
2008-11-11 23:27 PST, Simon Fraser (smfr)
hyatt: review+
Details | Formatted Diff | Diff
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect() (5.58 KB, patch)
2008-11-11 23:32 PST, Simon Fraser (smfr)
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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)