Move has_before_or_after_ from CSSLazyParsingState to CSSLazyPropertyParserImpl
This patches moves the bool maintaining state about the prelude of the block we are parsing (whether or not the prelude include a ::{before,after}) from CSSLazyParsingState to CSLazyPropertyParserImpl. This is as we have one CSSLazyParsingState per stylesheet, making this the incorrect place to maintain the flag. Before this patch if even one block in the stylesheet had ::{before,after} we would lazily parse all blocks in the stylesheet if the other conditions in CSSLazyPropertyparserImpl::parseProperties was met. Since each block gets an instance of the CSSLazyPropertyParser we maintain the information there instead. The drawback to this is increased memory use. There is a CSSLazyPropertyParser per declaration list, so that adds 1 byte of memory for a stylesheet with N deferred lists. However N will usually be small as can be seen in histograms tracked under Style.TotalLazyRules Bug: 642722 Change-Id: Ief6272dd2ae24a31479d9f0c072c1562632a49c1 Reviewed-on: https://chromium-review.googlesource.com/686196 Commit-Queue: Darren Shen <shend@chromium.org> Reviewed-by:Charlie Harrison <csharrison@chromium.org> Reviewed-by:
Rune Lillesveen <rune@opera.com> Cr-Commit-Position: refs/heads/master@{#504892}
Showing
Please register or sign in to comment