Hi everyone,I am transcribing a discussion that some folks had while I was visiting some Blink engineers in Mountain View (they are cced).We can potentially enable StyleSharing for a limited set of pages, by restricting it to pages that only use simple selectors (IDs, Classes, Tags, Attributes, ::before and ::after nodes). Since this information is local to a node we don't have to incur maintenance cost of editing the StyleSharing code each time we change around how Style resolution happens.
The idea is, if we find that the page only uses simple selectors we can flip a bit on Document and cache all nodes that map to an ID, class, etc on the Document too. If the page has a more complex selector, we can clear this cache. The lookup should be a relatively free operation.
--
You received this message because you are subscribed to the Google Groups "style-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to style-dev+...@chromium.org.
To post to this group, send email to styl...@chromium.org.
To view this discussion on the web, visit https://groups.google.com/a/chromium.org/d/msgid/style-dev/CANMdWTv-dxpVwAm8mZAktWAnh5bpok-wi9bN_VLKSzK3BxNnFQ%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/a/chromium.org/d/msgid/style-dev/CAMO7KM-cX%2BHwGbqHN-ENBy2Mop0hYyqbDtzyq%3DShkSt3ufj%3DEA%40mail.gmail.com.
A few cons/questions from my perspective:1. It doesn't seem as simple as stated here, e.g. these styles that might otherwise be shared could diverge due to inherited CSS variables.
2. UA sheets are not made up of only simple selectors, so I'm not sure there can be any pages that use only simple selectors?
To view this discussion on the web, visit https://groups.google.com/a/chromium.org/d/msgid/style-dev/CAMs_2YUmBU4yUwguy_4fC%2BmQpazoQYD%3DCx5BUKqC-vrgrjV%3D-g%40mail.gmail.com.
On Mon, Nov 6, 2017 at 2:43 PM Douglas Stockwell <dstoc...@chromium.org> wrote:A few cons/questions from my perspective:1. It doesn't seem as simple as stated here, e.g. these styles that might otherwise be shared could diverge due to inherited CSS variables.Didn't think of this at all. I didn't think about custom properties.
2. UA sheets are not made up of only simple selectors, so I'm not sure there can be any pages that use only simple selectors?I think that's a fair comparison to make, but yeah you are right we might be hard pressed to find a site that matches the case at hand.
3. The optimization seems weak. These sharing cases would already be covered by the matched property cache. I think we'll still end up evaluating even the simple selectors, what are we saving?