[Webkit-unassigned] [Bug 70103] [chromium] Implement position:fixed in compositor thread

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 25 12:19:41 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=70103





--- Comment #12 from Vangelis Kokkevis <vangelis at chromium.org>  2011-10-25 12:19:41 PST ---
> I agree, that matches what I was expected too..
> 
> Actually I'm not so sure about separating the logic for transformation of position:fixed elements (i.e. walk up the tree and walk down again to recompute transformation with scroll). I worry that we'll have to duplicate the logic for transformation in two places.. note that calculateDrawTransformsAndVisibilityInternal has side effect and I don't think it's suitable for re-computation of transformation without scroll delta.
> 
> On the other hand, if we maintain a nonscrolled transformation, most of the time it'll just be a copy of the scrolled, so we can probably shortcut the extra matrix multiplications.

The code in CCLayerTreeHostCommon computes a "screenspace" transform for every layer, which accounts for the entire chain of transforms from the root to the layer.

To adjust the position of a fixed layer, we need to subtract the scroll offset of the scrolling container from the layer's current position.  However, the layer's position is expressed in the layer's parent coordinate system so we cannot apply the scroll offset directly.  We could however presumably use the screenspace transform of the parent and that of the scrolling container to compute the offset in the right space.

So if the scroll offset expressed in the container's coordinate system is given by vector o(c) and we have the following screen space matrices:

M(c) : screen space matrix for scrolling container
M(p) : screen space matrix for the parent of the fixed layer

Then: o(p) = M(p)^-1 * M(c) * o(c)

should the the scroll offset expressed in the layer's parent coordinate system.  We should be able to subtract o(p) from the current layer position to get it to stay fixed.  

This should avoid additional (and possibly unnecessary) matrix math going down the hierarchy.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list