- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Fri, 13 Jan 2012 14:41:08 -0500
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- CC: Sylvain Galineau <sylvaing@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
On 1/13/12 2:34 PM, Tab Atkins Jr. wrote: > Actually, I'd expect both of those to act the same, since the style > wasn't flushed between the two declarations. Aaaand here we go. ;) The fact that style computation is lazy and might need flushing is an implementation detail. It's neither required nor forbidden by the spec at the moment, and until the introduction of transitions wasn't observable. But transitions punch a big hole through and make it all observable, of course... In particular it makes it possible to tell apart eager and lazy computation, to tell when lazy computation does or does not take place, etc. > I'd prefer the latter behavior, though I recognize that it is more > complex, as it would probably require doing a double layout (once with > the display changed, then once with the rest of the properties > applied). I'm not sure I follow. Why would it need that? > WebKit and Firefox should both align with this "you haven't flushed > the styles yet" behavior Why would they? There's no spec for it, and at least in Gecko there are various things that may involve style flushes which may not be obvious to a casual observer. For example, getting or setting the .value of an HTMLInputElement involved flushing styles for a while. I don't know whether it still does or not. I fully expect that it's trivial to write testcases in which some operation has the side effect of flushing styles in WebKit but not Gecko, and vice versa. > I know that Opera is unpredictable, > as it will interrupt the script at arbitrary points to do a style > flush and layout (which, I believe, violates run-to-completion > semantics). I don't think it does, unless a style flush or layout can reenter the script. Observable behavior to the script is the same whether flushes are lazy or done off a timer, as long as querying style/layout information immediately flushes. Again, all this modulo transitions, which expose flush timing. -Boris
Received on Friday, 13 January 2012 21:06:03 UTC