Bug 86804

Summary: Web Inspector: CSS profiles don't include time spent in querySelector[All]
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: apavlov, bburg, bweinstein, joepeck, keishi, loislo, paulirish, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Description Adam Roben (:aroben) 2012-05-17 22:03:31 PDT
It looks like CSS profile data is only collected in WebCore::StyleResolver member functions. But StyleResolver isn't used for document.querySelector[All] and element.querySelector[All]. For that we need to instrument WebCore::SelectorDataList (I believe).

It would be great to include querySelector[All] time in CSS profiles.
Comment 1 Alexander Pavlov (apavlov) 2012-06-04 09:33:39 PDT
It looks like SelectorDataList (as well as SelectorQuery and SelectorChecker) operate CSSSelector's, and CSSRule instances, which we need to provide meaningful profile data, are not available there...

If you or anyone involved with this topic has an insight of how CSSRule's of interest could be accessed, your comments are most welcome.
Comment 2 Adam Roben (:aroben) 2014-02-05 08:08:04 PST
I'm not sure CSSRules are actually needed in this case.

StyleResolver::applyProperties calls InspectorInstrumentation::{will,did}ProcessRule so that the Inspector can attribute the time spent *to that rule*. But for querySelector[All], we don't want to attribute time to a rule; instead we want to attribute time spent to querySelector[All] itself, perhaps with a way to distinguish what actual selectors were passed to cause the time to be spent.

I think we'd need some new InspectorInstrumentation calls, something like:

void willQuerySelector[All](const AtomicString& selectors);
void didQuerySelector[All](const InspectorInstrumentationCookie&);
Comment 3 Timothy Hatcher 2014-02-05 11:07:52 PST
CSS profiling has been removed.