Bug 124021 - Layer contentsScale can differ between first paint and repaints
Summary: Layer contentsScale can differ between first paint and repaints
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 16:16 PST by Tim Horton
Modified: 2013-11-07 16:24 PST (History)
2 users (show)

See Also:


Attachments
repro (650 bytes, text/html)
2013-11-07 16:17 PST, Tim Horton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-11-07 16:16:33 PST
Steps to Reproduce:

1. Open the attached test case.
2. Cmd-A.
3. Cmd-R.
4. Goto 2.

Expected:

The text should not shift.

Actual:

The text shifts.

It's pretty imperceptible, but if you do some logging, you can see that the layer has "root-relative scale factor"=1.411765 during the initial paint and "root-relative scale factor"=1.2 in subsequent paints.

More logging shows that the transform that maxScaleFromTransform decomposes is:

[1.20 0.00 0.00 0.00]
[0.00 1.20 0.00 0.00]
[-0.82 -0.35 1.20 -0.00]
[-93.83 -46.95 120.00 0.85]

in the bad case, and:

[1.20 0.00 0.00 0.00]
[0.00 1.20 0.00 0.00]
[0.00 0.00 1.20 0.00]
[-20.00 -20.00 120.00 1.00]

subsequently. Dean thinks it's odd that m44 is non-1 in the bad case, but it's also bad that this changes between paints, because it means things shift (and could be blurry in the initial paint, if drawn too large and scaled down awkwardly).
Comment 1 Tim Horton 2013-11-07 16:17:05 PST
Created attachment 216341 [details]
repro
Comment 2 Tim Horton 2013-11-07 16:24:53 PST
In updateRootRelativeScale

 - unanimated transform:
[1.20 0.00 0.00 0.00]
[0.00 1.20 0.00 0.00]
[0.00 0.00 1.20 0.00]
[-20.00 -20.00 120.00 1.00]

 - transform from root:
[1.00 0.00 0.00 0.00]
[0.00 1.00 0.00 0.00]
[-0.49 -0.29 1.00 -0.00]
[8.00 8.00 0.00 1.00]

then we multiply them, and end up with: (does this even make sense? where does the .85 come from?)

[1.20 0.00 0.00 0.00]
[0.00 1.20 0.00 0.00]
[-0.59 -0.35 1.20 -0.00]
[-71.33 -46.95 120.00 0.85]

So the crazypants is coming from the transform that's passed in to updateRootRelativeScale.