On Tuesday 2012-10-09 17:06 -0700, Seth Fowler wrote:
> > I'm assuming that you're talking about nsStyleContext lazily
> > computing the results of GetStyle*() when those functions are called
> > rather than computing it at the time the style context is created
> > (which is itself buffered up in ways that are very important).
> 
> Indeed.
> 
> > Off the top of my head, I think the biggest reason for this is that
> > it's probably a bit of a savings in memory use, since there are a
> > bunch of structs that we won't create for many elements -- though as
> > bz said, I'm not sure how true that is anymore.
> 
> That makes perfect sense, but what isn't immediately clear to me is whether
> there are any cases where an eager CSS implementation couldn't determine
> in advance that a given style struct wouldn't be needed. If so, laziness is 
> just
> an implementation strategy for this optimization and not a requirement.

We can never determine for sure that a given struct will
never need a struct, since a page can always ask for a style in it
via getComputedStyle (except for the rare style context that
couldn't potentially be used from a getComputedStyle call).  So I
don't see how we can keep the space optimization without also
keeping the ability to compute lazily.

That said, some of the advantages of computing eagerly might remain.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to