Consider adding getMatchedCSSRules API for extensions? |
||||
Issue descriptionIn issue 437569 , the getMatchedCSSRules API is being removed from blink - it has failed to become part of the interoperable web platform. However there is some risk of this breaking some Chrome extensions (see discussion in issue 437569 ). Do we have any stats on how many Chrome extensions use this API today? Perhaps we should consider providing such an API to extensions only?
,
Oct 30 2017
Hi Eddy, did the stats that you collected for getMatchedCSSRules usage include anything on extensions?
,
Oct 31 2017
Unfortunately not - HTTPArchive only looks at archived web pages. I believe the reason we wanted to remove getMatchedCSSRules in the first place was it a) adds complexity (We don't store enough information do get the result without a lot of work, but keeping it around means more memory usage for a rare feature), so b) it's really slow (n^2 by number of rules) shend, I vaguely remember you had a previous conversation with devlin about extensions-only getMatchedCSSRules - what was the outcome of that?
,
Oct 31 2017
Sorry, hit post too early - for point 1: ... and we don't get the benefit of deprecate + remove we were originally going for if we keep it around for extensions.
,
Oct 31 2017
Yes, I did talk with Devlin about an extension-only API and he basically said what you said in #c3 (complexity and efficiency). Also, my understanding is that it doesn't belong naturally to any of the existing extension APIs.
,
Oct 31 2017
Yeah, when we chatted, there were the same concerns around whether removing it for web pages but keeping it around for extension usage would yield much value (beyond removing a non-standardized exposed method). Additionally, both Elliot Sprehn and Rob Wu raised concerns about the performance of the current API, and suggested that having authors implement their own in JS could be more efficient (especially if it can be tailored to the uses of the extension). Given these, I'm not sure it's worth keeping it around, exposed specifically to extensions. But I'm open to discussing further.
,
Nov 10 2017
rbyers@, given the discussion above, is this still something we want to discuss?
,
Nov 11 2017
It's your call. It sounds like both Extensions and Style leads agree that this is not a capability they want to expose to extensions. So this is 'WontFix' for now. Developers/users impacted by this decision should 'star' this bug and we can revisit the star count at some point to see if the demand is high enough to warrant reconsidering. |
||||
►
Sign in to add a comment |
||||
Comment 1 by rbyers@chromium.org
, Oct 30 2017