W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: [selectors] Proposal :enter and :leave

From: John Fischer <jfroffice@gmail.com>
Date: Sun, 21 Dec 2014 23:59:55 +0100
Cc: www-style@w3.org
Message-Id: <C5E4C06F-314E-43CC-A9DC-B258D5D850EA@gmail.com>
To: Benjamin Poulain <benjamin@webkit.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC