Re: [selectors] Proposal :enter and :leave

Benjamin,


     Effectively this proposal seems to be a feature expensive as we need to have 2 -passes of computation at minimal.

     :hover seems to be moreless the same problem . So.

     Maybe we could find a way to limit computation.

     Thank you for your feedback.

     John
     

> Le 19 déc. 2014 à 23:23, Benjamin Poulain <benjamin@webkit.org> a écrit :
> 
> You should not have selectors depending on finished layout, that is backward.
> 
> The style is resolved first based on static properties. Then the content is laid out based on the style.
> 
> Take the following rule for example:
> 
>    body:enter {
>        position: absolute;
>        left: -10000px;
>    }
> 
> To make it work, you would need to:
> 1) Resolve the style first ignoring this rule.
> 2) Lay out the content.
> 3) Find if the element is in the viewport.
> 4) Resolve the style again, this time with the rule body:enter.
> 5) Lay out again.
> 6) The element is now out of the viewport.
> 7) Resolve the style again.
> etc
> 
> There is already similar problem with :hover.
> 
> Another issue with this proposal is the definition of "element in the viewport" makes many operations extremely inefficient in the general case.
> 
> I hope this helps,
> Benjamin

Received on Sunday, 21 December 2014 23:02:15 UTC