Remove the CSS selector profiler.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 20:09:09 +0000 (20:09 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 20:09:09 +0000 (20:09 +0000)
<https://webkit.org/b/127039>

Source/WebCore:

The selector profiler was painting a mostly fictional picture of what
selectors we were spending time on. It never really grokked the fast
path selectors, nor did it understand recent additions like the extra
cascading pass or the selector JIT.

Somewhat ironically, this may end up making some selectors run faster
since it removes a number of brances in hot code.

Reviewed by Sam Weinig.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
* css/ElementRuleCollector.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/protocol/CSS.json:

Source/WebInspectorUI:

Purge selector profiler code from the new Web Inspector UI.

Reviewed by Sam Weinig.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/CSSSelectorProfileObject.js: Removed.
* UserInterface/CSSSelectorProfileType.js: Removed.
* UserInterface/CSSSelectorProfileView.js: Removed.
* UserInterface/ContentView.js:
(WebInspector.ContentView):
(WebInspector.ContentView.isViewable):
* UserInterface/InspectorWebBackendCommands.js:
* UserInterface/InstrumentSidebarPanel.js:
(WebInspector.InstrumentSidebarPanel):
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedOver):
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedDown):
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphClicked):
(WebInspector.InstrumentSidebarPanel.prototype._profileTypeWasSelected):
(WebInspector.InstrumentSidebarPanel.prototype._profilesCleared):
* UserInterface/Main.html:
* UserInterface/ProfileManager.js:
(WebInspector.ProfileManager):
(WebInspector.ProfileManager.prototype.initialize):
(WebInspector.ProfileManager.prototype._checkForInterruptions):
(WebInspector.ProfileManager.prototype._attemptToResumeProfiling):
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/ElementRuleCollector.cpp
Source/WebCore/css/ElementRuleCollector.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorCSSAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/protocol/CSS.json
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/CSSSelectorProfileObject.js [deleted file]
Source/WebInspectorUI/UserInterface/CSSSelectorProfileType.js [deleted file]
Source/WebInspectorUI/UserInterface/CSSSelectorProfileView.js [deleted file]
Source/WebInspectorUI/UserInterface/ContentView.js
Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js
Source/WebInspectorUI/UserInterface/InstrumentSidebarPanel.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/ProfileManager.js
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters

index 8d5ea3d8336ce62ed227f9a094cbfba4f57205ca..5ceb7b3ebc7bdc85dfaa5945fccbb07b23730334 100644 (file)
@@ -1,3 +1,28 @@
+2014-01-15  Andreas Kling  <akling@apple.com>
+
+        Remove the CSS selector profiler.
+        <https://webkit.org/b/127039>
+
+        The selector profiler was painting a mostly fictional picture of what
+        selectors we were spending time on. It never really grokked the fast
+        path selectors, nor did it understand recent additions like the extra
+        cascading pass or the selector JIT.
+
+        Somewhat ironically, this may end up making some selectors run faster
+        since it removes a number of brances in hot code.
+
+        Reviewed by Sam Weinig.
+
+        * css/ElementRuleCollector.cpp:
+        (WebCore::ElementRuleCollector::collectMatchingRulesForList):
+        * css/ElementRuleCollector.h:
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        * inspector/InspectorInstrumentation.h:
+        * inspector/protocol/CSS.json:
+
 2014-01-15  Frédéric Wang  <fred.wang@free.fr>
 
         [SVG] Accept HTML and MathML namespaces as valid requiredExtensions
index 036764bfa82d4616192d661bcaff1546eb0a8207..ba9b7a22bd878f2f11895355dea8ea27a9a04c36 100644 (file)
@@ -360,16 +360,6 @@ inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, PseudoId
 }
 
 void ElementRuleCollector::collectMatchingRulesForList(const Vector<RuleData>* rules, const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange)
-{
-    if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
-        doCollectMatchingRulesForList<true>(rules, matchRequest, ruleRange);
-        return;
-    }
-    doCollectMatchingRulesForList<false>(rules, matchRequest, ruleRange);
-}
-
-template<bool hasInspectorFrontends>
-void ElementRuleCollector::doCollectMatchingRulesForList(const Vector<RuleData>* rules, const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange)
 {
     if (!rules)
         return;
@@ -382,9 +372,6 @@ void ElementRuleCollector::doCollectMatchingRulesForList(const Vector<RuleData>*
             continue;
 
         StyleRule* rule = ruleData.rule();
-        InspectorInstrumentationCookie cookie;
-        if (hasInspectorFrontends)
-            cookie = InspectorInstrumentation::willMatchRule(&document(), rule, m_inspectorCSSOMWrappers, document().styleSheetCollection());
         PseudoId dynamicPseudo = NOPSEUDO;
         if (ruleMatches(ruleData, dynamicPseudo)) {
             // For SharingRules testing, any match is good enough, we don't care what is matched.
@@ -395,25 +382,16 @@ void ElementRuleCollector::doCollectMatchingRulesForList(const Vector<RuleData>*
 
             // If the rule has no properties to apply, then ignore it in the non-debug mode.
             const StyleProperties& properties = rule->properties();
-            if (properties.isEmpty() && !matchRequest.includeEmptyRules) {
-                if (hasInspectorFrontends)
-                    InspectorInstrumentation::didMatchRule(cookie, false);
+            if (properties.isEmpty() && !matchRequest.includeEmptyRules)
                 continue;
-            }
             // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the only reason this is needed.
-            if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin()) {
-                if (hasInspectorFrontends)
-                    InspectorInstrumentation::didMatchRule(cookie, false);
+            if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin())
                 continue;
-            }
             // If we're matching normal rules, set a pseudo bit if
             // we really just matched a pseudo-element.
             if (dynamicPseudo != NOPSEUDO && m_pseudoStyleRequest.pseudoId == NOPSEUDO) {
-                if (m_mode == SelectorChecker::CollectingRules) {
-                    if (hasInspectorFrontends)
-                        InspectorInstrumentation::didMatchRule(cookie, false);
+                if (m_mode == SelectorChecker::CollectingRules)
                     continue;
-                }
                 if (dynamicPseudo < FIRST_INTERNAL_PSEUDOID)
                     state.style()->setHasPseudoStyle(dynamicPseudo);
             } else {
@@ -424,13 +402,9 @@ void ElementRuleCollector::doCollectMatchingRulesForList(const Vector<RuleData>*
 
                 // Add this rule to our list of matched rules.
                 addMatchedRule(&ruleData);
-                if (hasInspectorFrontends)
-                    InspectorInstrumentation::didMatchRule(cookie, true);
                 continue;
             }
         }
-        if (hasInspectorFrontends)
-            InspectorInstrumentation::didMatchRule(cookie, false);
     }
 }
 
index b5d2656bed39519cb80a73a86e981216e0750c43..25c546323fe652db4cf9199ba27965818967b5e5 100644 (file)
@@ -44,7 +44,6 @@ public:
         : m_state(state)
         , m_ruleSets(styleResolver->ruleSets())
         , m_selectorFilter(styleResolver->selectorFilter())
-        , m_inspectorCSSOMWrappers(styleResolver->inspectorCSSOMWrappers())
         , m_scopeResolver(styleResolver->scopeResolver())
         , m_isPrintStyle(false)
         , m_regionForStyling(0)
@@ -88,13 +87,9 @@ private:
     void addMatchedRule(const RuleData*);
     void clearMatchedRules();
 
-    template<bool hasInspectorFrontends>
-    void doCollectMatchingRulesForList(const Vector<RuleData>*, const MatchRequest&, StyleResolver::RuleRange&);
-
     const StyleResolver::State& m_state;
     DocumentRuleSets& m_ruleSets;
     SelectorFilter& m_selectorFilter;
-    InspectorCSSOMWrappers& m_inspectorCSSOMWrappers;
     StyleScopeResolver* m_scopeResolver;
 
     bool m_isPrintStyle;
index b395d14fecac9aa9edc8c23b185ce3e50fd133eb..c0849900b8064259f2cc3a1ff76ade50fa9ded88 100644 (file)
@@ -76,61 +76,6 @@ enum ForcePseudoClassFlags {
     PseudoVisited = 1 << 3
 };
 
-struct RuleMatchData {
-    String selector;
-    String url;
-    unsigned lineNumber;
-    double startTime;
-};
-
-struct RuleMatchingStats {
-    RuleMatchingStats()
-        : lineNumber(0), totalTime(0.0), hits(0), matches(0)
-    {
-    }
-    RuleMatchingStats(const RuleMatchData& data, double totalTime, unsigned hits, unsigned matches)
-        : selector(data.selector), url(data.url), lineNumber(data.lineNumber), totalTime(totalTime), hits(hits), matches(matches)
-    {
-    }
-
-    String selector;
-    String url;
-    unsigned lineNumber;
-    double totalTime;
-    unsigned hits;
-    unsigned matches;
-};
-
-class SelectorProfile {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    SelectorProfile()
-        : m_totalMatchingTimeMS(0.0)
-    {
-    }
-    virtual ~SelectorProfile()
-    {
-    }
-
-    double totalMatchingTimeMs() const { return m_totalMatchingTimeMS; }
-
-    String makeKey();
-    void startSelector(const CSSStyleRule*);
-    void commitSelector(bool);
-    void commitSelectorTime();
-    PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> toInspectorObject() const;
-
-private:
-
-    // Key is "selector?url:line".
-    typedef HashMap<String, RuleMatchingStats> RuleMatchingStatsMap;
-
-    double m_totalMatchingTimeMS;
-    RuleMatchingStatsMap m_ruleMatchingStats;
-    RuleMatchData m_currentMatchData;
-};
-
-
 static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray)
 {
     DEFINE_STATIC_LOCAL(String, active, (ASCIILiteral("active")));
@@ -160,72 +105,6 @@ static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray)
     return result;
 }
 
-inline String SelectorProfile::makeKey()
-{
-    return makeString(m_currentMatchData.selector, "?", m_currentMatchData.url, ":", String::number(m_currentMatchData.lineNumber));
-}
-
-inline void SelectorProfile::startSelector(const CSSStyleRule* rule)
-{
-    m_currentMatchData.selector = rule->selectorText();
-    CSSStyleSheet* styleSheet = rule->parentStyleSheet();
-    String url = emptyString();
-    if (styleSheet) {
-        url = InspectorStyleSheet::styleSheetURL(styleSheet);
-        if (url.isEmpty())
-            url = InspectorDOMAgent::documentURLString(styleSheet->ownerDocument());
-    }
-    m_currentMatchData.url = url;
-    m_currentMatchData.lineNumber = rule->styleRule()->sourceLine();
-    m_currentMatchData.startTime = monotonicallyIncreasingTimeMS();
-}
-
-inline void SelectorProfile::commitSelector(bool matched)
-{
-    double matchTimeMS = monotonicallyIncreasingTimeMS() - m_currentMatchData.startTime;
-    m_totalMatchingTimeMS += matchTimeMS;
-
-    RuleMatchingStatsMap::AddResult result = m_ruleMatchingStats.add(makeKey(), RuleMatchingStats(m_currentMatchData, matchTimeMS, 1, matched ? 1 : 0));
-    if (!result.isNewEntry) {
-        result.iterator->value.totalTime += matchTimeMS;
-        result.iterator->value.hits += 1;
-        if (matched)
-            result.iterator->value.matches += 1;
-    }
-}
-
-inline void SelectorProfile::commitSelectorTime()
-{
-    double processingTimeMS = monotonicallyIncreasingTimeMS() - m_currentMatchData.startTime;
-    m_totalMatchingTimeMS += processingTimeMS;
-
-    RuleMatchingStatsMap::iterator it = m_ruleMatchingStats.find(makeKey());
-    if (it == m_ruleMatchingStats.end())
-        return;
-
-    it->value.totalTime += processingTimeMS;
-}
-
-PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> SelectorProfile::toInspectorObject() const
-{
-    RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::SelectorProfileEntry>> selectorProfileData = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::SelectorProfileEntry>::create();
-    for (RuleMatchingStatsMap::const_iterator it = m_ruleMatchingStats.begin(); it != m_ruleMatchingStats.end(); ++it) {
-        RefPtr<Inspector::TypeBuilder::CSS::SelectorProfileEntry> entry = Inspector::TypeBuilder::CSS::SelectorProfileEntry::create()
-            .setSelector(it->value.selector)
-            .setUrl(it->value.url)
-            .setLineNumber(it->value.lineNumber)
-            .setTime(it->value.totalTime)
-            .setHitCount(it->value.hits)
-            .setMatchCount(it->value.matches);
-        selectorProfileData->addItem(entry.release());
-    }
-
-    RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> result = Inspector::TypeBuilder::CSS::SelectorProfile::create()
-        .setTotalTime(totalMatchingTimeMs())
-        .setData(selectorProfileData);
-    return result.release();
-}
-
 class UpdateRegionLayoutTask {
 public:
     UpdateRegionLayoutTask(InspectorCSSAgent*);
@@ -642,8 +521,6 @@ void InspectorCSSAgent::willDestroyFrontendAndBackend()
     m_backendDispatcher.clear();
 
     resetNonPersistentData();
-    String errorString;
-    stopSelectorProfilerImpl(&errorString, false);
 }
 
 void InspectorCSSAgent::discardAgent()
@@ -1082,52 +959,6 @@ void InspectorCSSAgent::getNamedFlowCollection(ErrorString* errorString, int doc
     result = namedFlows.release();
 }
 
-void InspectorCSSAgent::startSelectorProfiler(ErrorString*)
-{
-    m_currentSelectorProfile = adoptPtr(new SelectorProfile());
-}
-
-void InspectorCSSAgent::stopSelectorProfiler(ErrorString* errorString, RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile>& result)
-{
-    result = stopSelectorProfilerImpl(errorString, true);
-}
-
-PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> InspectorCSSAgent::stopSelectorProfilerImpl(ErrorString*, bool needProfile)
-{
-    if (!m_currentSelectorProfile)
-        return 0;
-    RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> result;
-    if (m_frontendDispatcher && needProfile)
-        result = m_currentSelectorProfile->toInspectorObject();
-    m_currentSelectorProfile.clear();
-    return result.release();
-}
-
-void InspectorCSSAgent::willMatchRule(StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& styleSheetCollection)
-{
-//    printf("InspectorCSSAgent::willMatchRule %s\n", rule->selectorList().selectorsText().utf8().data());
-    if (m_currentSelectorProfile)
-        m_currentSelectorProfile->startSelector(inspectorCSSOMWrappers.getWrapperForRuleInSheets(rule, styleSheetCollection));
-}
-
-void InspectorCSSAgent::didMatchRule(bool matched)
-{
-    if (m_currentSelectorProfile)
-        m_currentSelectorProfile->commitSelector(matched);
-}
-
-void InspectorCSSAgent::willProcessRule(StyleRule* rule, StyleResolver& styleResolver)
-{
-    if (m_currentSelectorProfile)
-        m_currentSelectorProfile->startSelector(styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(rule, styleResolver.document().styleSheetCollection()));
-}
-
-void InspectorCSSAgent::didProcessRule()
-{
-    if (m_currentSelectorProfile)
-        m_currentSelectorProfile->commitSelectorTime();
-}
-
 InspectorStyleSheetForInlineStyle* InspectorCSSAgent::asInspectorStyleSheet(Element* element)
 {
     NodeToInspectorStyleSheet::iterator it = m_nodeToInspectorStyleSheet.find(element);
index 0cd64221940be0dc825a6650de188018ad2b66bd..ee12d925f9a6b1900023dd93216989f71598d622 100644 (file)
@@ -58,7 +58,6 @@ class InstrumentingAgents;
 class NameNodeMap;
 class Node;
 class NodeList;
-class SelectorProfile;
 class StyleResolver;
 class StyleRule;
 class UpdateRegionLayoutTask;
@@ -128,15 +127,6 @@ public:
     virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<Inspector::InspectorArray>& forcedPseudoClasses);
     virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::NamedFlow>>& result);
 
-    virtual void startSelectorProfiler(ErrorString*);
-    virtual void stopSelectorProfiler(ErrorString*, RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile>&);
-
-    PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> stopSelectorProfilerImpl(ErrorString*, bool needProfile);
-    void willMatchRule(StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
-    void didMatchRule(bool);
-    void willProcessRule(StyleRule*, StyleResolver&);
-    void didProcessRule();
-
 private:
     class StyleSheetAction;
     class SetStyleSheetTextAction;
@@ -195,8 +185,6 @@ private:
     OwnPtr<ChangeRegionOversetTask> m_changeRegionOversetTask;
 
     int m_lastStyleSheetId;
-
-    OwnPtr<SelectorProfile> m_currentSelectorProfile;
 };
 
 #endif
index bbe885fb250cef895b0ad72a93000f9468447695..4685f72836fc468fde419041c5db9da5f7adb829 100644 (file)
@@ -550,42 +550,6 @@ void InspectorInstrumentation::didScheduleStyleRecalculationImpl(InstrumentingAg
         resourceAgent->didScheduleStyleRecalculation(document);
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willMatchRuleImpl(InstrumentingAgents* instrumentingAgents, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& sheetCollection)
-{
-    InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent();
-    if (cssAgent) {
-        cssAgent->willMatchRule(rule, inspectorCSSOMWrappers, sheetCollection);
-        return InspectorInstrumentationCookie(instrumentingAgents, 1);
-    }
-
-    return InspectorInstrumentationCookie();
-}
-
-void InspectorInstrumentation::didMatchRuleImpl(const InspectorInstrumentationCookie& cookie, bool matched)
-{
-    InspectorCSSAgent* cssAgent = cookie.instrumentingAgents()->inspectorCSSAgent();
-    if (cssAgent)
-        cssAgent->didMatchRule(matched);
-}
-
-InspectorInstrumentationCookie InspectorInstrumentation::willProcessRuleImpl(InstrumentingAgents* instrumentingAgents, StyleRule* rule, StyleResolver& styleResolver)
-{
-    InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent();
-    if (cssAgent) {
-        cssAgent->willProcessRule(rule, styleResolver);
-        return InspectorInstrumentationCookie(instrumentingAgents, 1);
-    }
-
-    return InspectorInstrumentationCookie();
-}
-
-void InspectorInstrumentation::didProcessRuleImpl(const InspectorInstrumentationCookie& cookie)
-{
-    InspectorCSSAgent* cssAgent = cookie.instrumentingAgents()->inspectorCSSAgent();
-    if (cssAgent)
-        cssAgent->didProcessRule();
-}
-
 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents* instrumentingAgents, String* media)
 {
     if (InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent())
index 7131bcd538da84be9a105b12a7f9857a3d77310d..5eaeff4144b85b525858a0ff13a15b80b70064a2 100644 (file)
@@ -159,10 +159,6 @@ public:
     static InspectorInstrumentationCookie willRecalculateStyle(Document*);
     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculation(Document*);
-    static InspectorInstrumentationCookie willMatchRule(Document*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
-    static void didMatchRule(const InspectorInstrumentationCookie&, bool matched);
-    static InspectorInstrumentationCookie willProcessRule(Document*, StyleRule*, StyleResolver&);
-    static void didProcessRule(const InspectorInstrumentationCookie&);
 
     static void applyEmulatedMedia(Frame*, String*);
     static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
@@ -349,10 +345,6 @@ private:
     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Frame*);
     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
-    static InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
-    static void didMatchRuleImpl(const InspectorInstrumentationCookie&, bool matched);
-    static InspectorInstrumentationCookie willProcessRuleImpl(InstrumentingAgents*, StyleRule*, StyleResolver&);
-    static void didProcessRuleImpl(const InspectorInstrumentationCookie&);
 
     static void applyEmulatedMediaImpl(InstrumentingAgents*, String*);
     static void willSendRequestImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
@@ -1172,60 +1164,6 @@ inline void InspectorInstrumentation::didScheduleStyleRecalculation(Document* do
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willMatchRule(Document* document, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& styleSheetCollection)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willMatchRuleImpl(instrumentingAgents, rule, inspectorCSSOMWrappers, styleSheetCollection);
-#else
-    UNUSED_PARAM(document);
-    UNUSED_PARAM(rule);
-    UNUSED_PARAM(inspectorCSSOMWrappers);
-    UNUSED_PARAM(styleSheetCollection);
-#endif
-    return InspectorInstrumentationCookie();
-}
-
-inline void InspectorInstrumentation::didMatchRule(const InspectorInstrumentationCookie& cookie, bool matched)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.isValid())
-        didMatchRuleImpl(cookie, matched);
-#else
-    UNUSED_PARAM(cookie);
-    UNUSED_PARAM(matched);
-#endif
-}
-
-inline InspectorInstrumentationCookie InspectorInstrumentation::willProcessRule(Document* document, StyleRule* rule, StyleResolver& styleResolver)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    if (!rule)
-        return InspectorInstrumentationCookie();
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willProcessRuleImpl(instrumentingAgents, rule, styleResolver);
-#else
-    UNUSED_PARAM(document);
-    UNUSED_PARAM(rule);
-    UNUSED_PARAM(styleResolver);
-#endif
-    return InspectorInstrumentationCookie();
-}
-
-inline void InspectorInstrumentation::didProcessRule(const InspectorInstrumentationCookie& cookie)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.isValid())
-        didProcessRuleImpl(cookie);
-#else
-    UNUSED_PARAM(cookie);
-#endif
-}
-
 inline void InspectorInstrumentation::applyEmulatedMedia(Frame* frame, String* media)
 {
 #if ENABLE(INSPECTOR)
index 445e1239feb121704186e3ec659c796842281ea9..f9c2629bc645d051c8090edb80c14719ce73879a 100644 (file)
             ],
             "description": "CSS media query descriptor."
         },
-        {
-            "id": "SelectorProfileEntry",
-            "type": "object",
-            "properties": [
-                { "name": "selector", "type": "string", "description": "CSS selector of the corresponding rule." },
-                { "name": "url", "type": "string", "description": "URL of the resource containing the corresponding rule." },
-                { "name": "lineNumber", "type": "integer", "description": "Selector line number in the resource for the corresponding rule." },
-                { "name": "time", "type": "number", "description": "Total time this rule handling contributed to the browser running time during profiling (in milliseconds.)" },
-                { "name": "hitCount", "type": "integer", "description": "Number of times this rule was considered a candidate for matching against DOM elements." },
-                { "name": "matchCount", "type": "integer", "description": "Number of times this rule actually matched a DOM element." }
-            ],
-            "description": "CSS selector profile entry."
-        },
-        {
-            "id": "SelectorProfile",
-            "type": "object",
-            "properties": [
-                { "name": "totalTime", "type": "number", "description": "Total processing time for all selectors in the profile (in milliseconds.)" },
-                { "name": "data", "type": "array", "items": { "$ref": "SelectorProfileEntry" }, "description": "CSS selector profile entries." }
-            ]
-        },
         {
             "id": "Region",
             "type": "object",
             ],
             "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser."
         },
-        {
-            "name": "startSelectorProfiler"
-        },
-        {
-            "name": "stopSelectorProfiler",
-            "returns": [
-                { "name": "profile", "$ref": "SelectorProfile" }
-            ]
-        },
         {
             "name": "getNamedFlowCollection",
             "parameters": [
index a39152a42e943be1540b525baf4f671956e2e224..ca80d273c60341f20696258d2a1907cb0cca5e91 100644 (file)
@@ -1,3 +1,36 @@
+2014-01-15  Andreas Kling  <akling@apple.com>
+
+        Remove the CSS selector profiler.
+        <https://webkit.org/b/127039>
+
+        Purge selector profiler code from the new Web Inspector UI.
+
+        Reviewed by Sam Weinig.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/CSSSelectorProfileObject.js: Removed.
+        * UserInterface/CSSSelectorProfileType.js: Removed.
+        * UserInterface/CSSSelectorProfileView.js: Removed.
+        * UserInterface/ContentView.js:
+        (WebInspector.ContentView):
+        (WebInspector.ContentView.isViewable):
+        * UserInterface/InspectorWebBackendCommands.js:
+        * UserInterface/InstrumentSidebarPanel.js:
+        (WebInspector.InstrumentSidebarPanel):
+        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedOver):
+        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedDown):
+        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphClicked):
+        (WebInspector.InstrumentSidebarPanel.prototype._profileTypeWasSelected):
+        (WebInspector.InstrumentSidebarPanel.prototype._profilesCleared):
+        * UserInterface/Main.html:
+        * UserInterface/ProfileManager.js:
+        (WebInspector.ProfileManager):
+        (WebInspector.ProfileManager.prototype.initialize):
+        (WebInspector.ProfileManager.prototype._checkForInterruptions):
+        (WebInspector.ProfileManager.prototype._attemptToResumeProfiling):
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
+
 2014-01-13  Timothy Hatcher  <timothy@apple.com>
 
         Snap time dividers to nearest numbers instead of just dividing the time span into max density slices.
index 94d8865857e5f0633bee0abf0dd9e7cf3373df9a..c123b2eb49391ab6d909b16865d912bed1098fb3 100644 (file)
Binary files a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js and b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js differ
diff --git a/Source/WebInspectorUI/UserInterface/CSSSelectorProfileObject.js b/Source/WebInspectorUI/UserInterface/CSSSelectorProfileObject.js
deleted file mode 100644 (file)
index 6f087d0..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.CSSSelectorProfileObject = function(title, id, recording, data, totalTime)
-{
-    WebInspector.ProfileObject.call(this, WebInspector.CSSSelectorProfileType.TypeId, title, id, recording);
-
-    this._data = data || [];
-    this._totalTime = totalTime || 0;
-};
-
-WebInspector.CSSSelectorProfileObject.prototype = {
-    constructor: WebInspector.CSSSelectorProfileObject,
-    
-    get data()
-    {
-        return this._data;
-    },
-
-    set data(data)
-    {
-        this._data = data;
-    },
-
-    get totalTime()
-    {
-        return this._totalTime;
-    },
-
-    set totalTime(totalTime)
-    {
-        this._totalTime = totalTime;
-    }
-};
-
-WebInspector.CSSSelectorProfileObject.prototype.__proto__ = WebInspector.ProfileObject.prototype;
diff --git a/Source/WebInspectorUI/UserInterface/CSSSelectorProfileType.js b/Source/WebInspectorUI/UserInterface/CSSSelectorProfileType.js
deleted file mode 100644 (file)
index 85039b5..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All Rights Reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @constructor
- */
-WebInspector.CSSSelectorProfileType = function()
-{
-    WebInspector.ProfileType.call(this, WebInspector.CSSSelectorProfileType.TypeId, WebInspector.UIString("Collect CSS Selector Profile"));
-    this._recording = false;
-    this._profileUid = 1;
-    WebInspector.CSSSelectorProfileType.instance = this;
-}
-
-WebInspector.CSSSelectorProfileType.TypeId = "SELECTOR";
-
-WebInspector.CSSSelectorProfileType.prototype = {
-    get buttonTooltip()
-    {
-        return this._recording ? WebInspector.UIString("Stop CSS selector profiling.") : WebInspector.UIString("Start CSS selector profiling.");
-    },
-
-    buttonClicked: function()
-    {
-        if (this._recording)
-            this.stopRecordingProfile();
-        else
-            this.startRecordingProfile();
-    },
-
-    get treeItemTitle()
-    {
-        return WebInspector.UIString("CSS SELECTOR PROFILES");
-    },
-
-    get description()
-    {
-        return WebInspector.UIString("CSS selector profiles show how long the selector matching has taken in total and how many times a certain selector has matched DOM elements (the results are approximate due to matching algorithm optimizations.)");
-    },
-
-    reset: function()
-    {
-        this._profileUid = 1;
-    },
-
-    nextProfileId: function()
-    {
-        return this._profileUid++;
-    },
-
-    isRecordingProfile: function()
-    {
-        return this._recording;
-    },
-
-    setRecordingProfile: function(isProfiling)
-    {
-        this._recording = isProfiling;
-    },
-
-    startRecordingProfile: function()
-    {
-        this._recording = true;
-        CSSAgent.startSelectorProfiler();
-    },
-
-    stopRecordingProfile: function(callback)
-    {
-        this._recording = false;
-        CSSAgent.stopSelectorProfiler(callback);
-    },
-
-    createSidebarTreeElementForProfile: function(profile)
-    {
-        return new WebInspector.ProfileSidebarTreeElement(profile, profile.title, "profile-sidebar-tree-item");
-    },
-
-    createView: function(profile)
-    {
-        return new WebInspector.CSSSelectorProfileView(profile);
-    }
-}
-
-WebInspector.CSSSelectorProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype;
diff --git a/Source/WebInspectorUI/UserInterface/CSSSelectorProfileView.js b/Source/WebInspectorUI/UserInterface/CSSSelectorProfileView.js
deleted file mode 100644 (file)
index fb16770..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All Rights Reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @constructor
- * @extends WebInspector.DataGridNode
- * @param {WebInspector.CSSSelectorProfileView} profileView
- */
-WebInspector.CSSSelectorDataGridNode = function(profileView, data)
-{
-    WebInspector.DataGridNode.call(this, data, false);
-    this._profileView = profileView;
-}
-
-WebInspector.CSSSelectorDataGridNode.prototype = {
-    get data()
-    {
-        var data = {};
-        data.selector = this._data.selector;
-        data.matches = this._data.matchCount;
-
-        if (this._profileView.showTimeAsPercent.value)
-            data.time = Number(this._data.timePercent).toFixed(1) + "%";
-        else
-            data.time = Number.secondsToString(this._data.time / 1000, true);
-
-        return data;
-    },
-
-    get rawData()
-    {
-        return this._data;
-    },
-
-    createCell: function(columnIdentifier)
-    {
-        var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
-        if (columnIdentifier === "selector" && cell.firstChild) {
-            cell.firstChild.title = this.rawData.selector;
-            return cell;
-        }
-
-        if (columnIdentifier !== "source")
-            return cell;
-
-        cell.removeChildren();
-
-        if (this.rawData.url) {
-            var wrapperDiv = cell.createChild("div");
-            wrapperDiv.appendChild(this._linkifyLocation(this.rawData.url, this.rawData.lineNumber));
-        }
-
-        return cell;
-    },
-
-    _linkifyLocation: function(url, lineNumber)
-    {
-        // FIXME: SelectorProfileEntry need columnNumbers.
-        return WebInspector.linkifyLocation(url, lineNumber, 0);
-    }
-}
-
-WebInspector.CSSSelectorDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
-
-/**
- * @constructor
- * @extends WebInspector.View
- * @param {CSSAgent.SelectorProfile} profile
- */
-WebInspector.CSSSelectorProfileView = function(profile)
-{
-    console.assert(profile instanceof WebInspector.CSSSelectorProfileObject);
-
-    WebInspector.ProfileView.call(this, profile, "css-selector-profiler-show-time-as-percent");
-}
-
-WebInspector.CSSSelectorProfileView.prototype = {
-    constructor: WebInspector.CSSSelectorProfileView,
-
-    updateLayout: function()
-    {
-        if (this.dataGrid)
-            this.dataGrid.updateLayout();
-    },
-
-    get recordingTitle()
-    {
-        return WebInspector.UIString("Recording CSS Selector Profile\u2026");
-    },
-
-    displayProfile: function()
-    {
-        var columns = { "selector": { title: WebInspector.UIString("Selector"), width: "550px", sortable: true },
-                        "source": { title: WebInspector.UIString("Source"), width: "100px", sortable: true },
-                        "time": { title: WebInspector.UIString("Total"), width: "72px", sort: "descending", sortable: true },
-                        "matches": { title: WebInspector.UIString("Matches"), width: "72px", sortable: true } };
-
-        this.dataGrid = new WebInspector.DataGrid(columns);
-        this.dataGrid.element.classList.add("selector-profile-view");
-        this.dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortProfile, this);
-
-        this.element.appendChild(this.dataGrid.element);
-        this.dataGrid.updateLayout();
-
-        this._createProfileNodes();
-        this._sortProfile();
-    },
-
-    _createProfileNodes: function()
-    {
-        var data = this.profile.data;
-        if (!data) {
-            // The profiler may have been terminated with the "Clear all profiles." button.
-            return;
-        }
-
-        this.profile.children = [];
-        for (var i = 0; i < data.length; ++i) {
-            data[i].timePercent = data[i].time * 100 / this.profile.totalTime;
-            var node = new WebInspector.CSSSelectorDataGridNode(this, data[i]);
-            this.profile.children.push(node);
-        }
-    },
-
-    rebuildGridItems: function()
-    {
-        this.dataGrid.removeChildren();
-
-        var children = this.profile.children;
-        var count = children.length;
-
-        for (var index = 0; index < count; ++index)
-            this.dataGrid.appendChild(children[index]);
-    },
-
-    refreshData: function()
-    {
-        var child = this.dataGrid.children[0];
-        while (child) {
-            child.refresh();
-            child = child.traverseNextNode(false, null, true);
-        }
-    },
-
-    toggleTimeDisplay: function(event)
-    {
-        WebInspector.ProfileView.prototype.toggleTimeDisplay.call(this, event);
-        this.showTimeAsPercent.value = !this.showTimeAsPercent.value;
-        this.refreshData();
-    },
-
-    _sortProfile: function()
-    {
-        var sortAscending = this.dataGrid.sortOrder === "ascending";
-        var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
-
-        function selectorComparator(a, b)
-        {
-            var result = b.rawData.selector.localeCompare(a.rawData.selector);
-            return sortAscending ? -result : result;
-        }
-
-        function sourceComparator(a, b)
-        {
-            var aRawData = a.rawData;
-            var bRawData = b.rawData;
-            var result = bRawData.url.localeCompare(aRawData.url);
-            if (!result)
-                result = bRawData.lineNumber - aRawData.lineNumber;
-            return sortAscending ? -result : result;
-        }
-
-        function timeComparator(a, b)
-        {
-            const result = b.rawData.time - a.rawData.time;
-            return sortAscending ? -result : result;
-        }
-
-        function matchesComparator(a, b)
-        {
-            const result = b.rawData.matchCount - a.rawData.matchCount;
-            return sortAscending ? -result : result;
-        }
-
-        var comparator;
-        switch (sortColumnIdentifier) {
-        case "time":
-            comparator = timeComparator;
-            break;
-        case "matches":
-            comparator = matchesComparator;
-            break;
-        case "selector":
-            comparator = selectorComparator;
-            break;
-        case "source":
-            comparator = sourceComparator;
-            break;
-        }
-
-        this.profile.children.sort(comparator);
-
-        this.rebuildGridItems();
-    }
-}
-
-WebInspector.CSSSelectorProfileView.prototype.__proto__ = WebInspector.ProfileView.prototype;
index 50e972732b83ab70eb3a311095d62cedc6a36602..2bd7efa4c668d8307f6b58a1fe7771e4b8fb781c 100644 (file)
@@ -66,9 +66,6 @@ WebInspector.ContentView = function(representedObject)
         if (representedObject instanceof WebInspector.JavaScriptProfileObject)
             return new WebInspector.JavaScriptProfileView(representedObject);
 
-        if (representedObject instanceof WebInspector.CSSSelectorProfileObject)
-            return new WebInspector.CSSSelectorProfileView(representedObject);
-
         if (representedObject instanceof WebInspector.CanvasProfileObject)
             return new WebInspector.CanvasProfileView(representedObject);
 
@@ -125,8 +122,6 @@ WebInspector.ContentView.isViewable = function(representedObject)
         return true;
     if (representedObject instanceof WebInspector.JavaScriptProfileObject)
         return true;
-    if (representedObject instanceof WebInspector.CSSSelectorProfileObject)
-        return true;
     if (representedObject instanceof WebInspector.CanvasProfileObject)
         return true;
     if (representedObject instanceof WebInspector.ContentFlow)
index ef8f4989f8d303bdec6d3d854310f7da171531d7..1b3a31576b27773e00c69c7b58f59160062c873c 100644 (file)
@@ -45,8 +45,6 @@ InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "typ
 InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
 InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
 InspectorBackend.registerCommand("CSS.forcePseudoState", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "forcedPseudoClasses", "type": "object", "optional": false}], []);
-InspectorBackend.registerCommand("CSS.startSelectorProfiler", [], []);
-InspectorBackend.registerCommand("CSS.stopSelectorProfiler", [], ["profile"]);
 InspectorBackend.registerCommand("CSS.getNamedFlowCollection", [{"name": "documentNodeId", "type": "number", "optional": false}], ["namedFlows"]);
 
 // Canvas.
index c0b80de85e9a4fe13acfccdf362293ede086666c..7b388aa0099b0b2c30a7936280e19f20aca3e8cc 100644 (file)
@@ -99,18 +99,12 @@ WebInspector.InstrumentSidebarPanel = function()
     startJavaScriptProfileOption.value = WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue;
     startJavaScriptProfileOption.selected = false;
     
-    var startCSSSelectorProfileOption = document.createElement("option");
-    startCSSSelectorProfileOption.textContent = WebInspector.UIString("Start CSS Selector Profile");
-    startCSSSelectorProfileOption.value = WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue;
-    startCSSSelectorProfileOption.selected = false;
-
     var startCanvasProfileOption = document.createElement("option");
     startCanvasProfileOption.textContent = WebInspector.UIString("Start Canvas Profile");
     startCanvasProfileOption.value = WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue;
     startCanvasProfileOption.selected = false;
 
     this._recordProfileGlyphElement.add(startJavaScriptProfileOption);
-    this._recordProfileGlyphElement.add(startCSSSelectorProfileOption);
     this._recordProfileGlyphElement.add(startCanvasProfileOption);
 
     profilesTitleBarElement.appendChild(this._recordProfileGlyphElement);
@@ -155,7 +149,6 @@ WebInspector.InstrumentSidebarPanel.ColorsIconStyleClass = "colors-icon";
 WebInspector.InstrumentSidebarPanel.ScriptIconStyleClass = "script-icon";
 WebInspector.InstrumentSidebarPanel.ProfileIconStyleClass = "profile-icon";
 WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue = "start-javascript-profile";
-WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue = "start-css-selector-profile";
 WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue = "start-canvas-profile";
 
 WebInspector.InstrumentSidebarPanel.SelectedTimelineCookieKey = "instrument-sidebar-panel-selected-timeline";
@@ -306,7 +299,7 @@ WebInspector.InstrumentSidebarPanel.prototype = {
     {
         this._recordProfileGlyphElement.classList.remove(WebInspector.InstrumentSidebarPanel.RecordGlyphRecordingForcedStyleClass);
 
-        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCSSSelectors() || WebInspector.profileManager.isProfilingCanvas())
+        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas())
             this._recordProfileStatusElement.textContent = WebInspector.UIString("Stop Profiling");
         else
             this._recordProfileStatusElement.textContent = WebInspector.UIString("Start Profiling");
@@ -329,7 +322,7 @@ WebInspector.InstrumentSidebarPanel.prototype = {
         
         // We don't want to show the select if the user is currently profiling. In that case,
         // the user should just be able to click the record button to stop profiling.
-        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCSSSelectors() || WebInspector.profileManager.isProfilingCanvas())
+        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas())
             event.preventDefault();
         else {
             // When a select is opened, a click event will be fired when the select is closed,
@@ -351,8 +344,6 @@ WebInspector.InstrumentSidebarPanel.prototype = {
 
         if (WebInspector.profileManager.isProfilingJavaScript())
             WebInspector.profileManager.stopProfilingJavaScript();
-        if (WebInspector.profileManager.isProfilingCSSSelectors())
-            WebInspector.profileManager.stopProfilingCSSSelectors();
         if (WebInspector.profileManager.isProfilingCanvas())
             WebInspector.profileManager.stopProfilingCanvas();
     },
@@ -366,8 +357,6 @@ WebInspector.InstrumentSidebarPanel.prototype = {
         var selectedValue = this._recordProfileGlyphElement.options[selectedIndex].value;
         if (selectedValue === WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue)
             WebInspector.profileManager.startProfilingJavaScript();
-        else if (selectedValue === WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue)
-            WebInspector.profileManager.startProfilingCSSSelectors();
         else {
             console.assert(selectedValue === WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue);
             WebInspector.profileManager.startProfilingCanvas();
@@ -509,7 +498,6 @@ WebInspector.InstrumentSidebarPanel.prototype = {
         this._profileTreeElementMap = {};
         
         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.JavaScriptProfileView);
-        WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CSSSelectorProfileView);
         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CanvasProfileView);
         
         this.updateEmptyContentPlaceholder(WebInspector.UIString("No Recorded Profiles"));
index d5329b6ed0d257525a55c2000f18ddbe3b9b35ee..e27be082242f652609ae4f7e5f25b1f24cb11942 100644 (file)
     <script src="ProfileView.js"></script>
     <script src="JavaScriptProfileType.js"></script>
     <script src="JavaScriptProfileView.js"></script>
-    <script src="CSSSelectorProfileType.js"></script>
-    <script src="CSSSelectorProfileView.js"></script>
     <script src="CanvasDataGridNode.js"></script>
     <script src="CanvasProfileType.js"></script>
     <script src="CanvasProfileView.js"></script>
     <script src="ProfileObject.js"></script>
     <script src="JavaScriptProfileObject.js"></script>
-    <script src="CSSSelectorProfileObject.js"></script>
     <script src="CanvasProfileObject.js"></script>
     <script src="DebuggerSidebarPanel.js"></script>
     <script src="BreakpointTreeElement.js"></script>
index 56e5263a0f100ae7247ebd9bd830df3202f0fa95..5a982a4ddcbb732ebcfa15e7f77adb5232aa63da 100644 (file)
@@ -28,7 +28,6 @@ WebInspector.ProfileManager = function()
     WebInspector.Object.call(this);
 
     this._javaScriptProfileType = new WebInspector.JavaScriptProfileType;
-    this._cssSelectorProfileType = new WebInspector.CSSSelectorProfileType;
     this._canvasProfileType = new WebInspector.CanvasProfileType;
 
     ProfilerAgent.enable();
@@ -60,13 +59,10 @@ WebInspector.ProfileManager.prototype = {
         this._checkForInterruptions();
 
         this._recordingJavaScriptProfile = null;
-        this._recordingCSSSelectorProfile = null;
         this._recordingCanvasProfile = null;
 
         this._isProfiling = false;
 
-        this._cssSelectorProfileType.reset();
-
         this.dispatchEventToListeners(WebInspector.ProfileManager.Event.Cleared);
     },
 
@@ -85,45 +81,6 @@ WebInspector.ProfileManager.prototype = {
         this._javaScriptProfileType.stopRecordingProfile();
     },
 
-    isProfilingCSSSelectors: function()
-    {
-        return this._cssSelectorProfileType.isRecordingProfile();
-    },
-
-    startProfilingCSSSelectors: function()
-    {
-        this._cssSelectorProfileType.startRecordingProfile();
-        
-        var id = this._cssSelectorProfileType.nextProfileId();
-        this._recordingCSSSelectorProfile = new WebInspector.CSSSelectorProfileObject(WebInspector.UIString("CSS Selector Profile %d").format(id), id, true);
-        this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasAdded, {profile: this._recordingCSSSelectorProfile});
-        
-        this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingStarted);
-    },
-    
-    stopProfilingCSSSelectors: function()
-    {
-        function cssProfilingStopped(error, profile)
-        {
-            if (error)
-                return;
-
-            console.assert(this._recordingCSSSelectorProfile);
-
-            this._recordingCSSSelectorProfile.data = profile.data;
-            this._recordingCSSSelectorProfile.totalTime = profile.totalTime;
-            this._recordingCSSSelectorProfile.recording = false;
-            
-            this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasUpdated, {profile: this._recordingCSSSelectorProfile});
-
-            this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingEnded, {profile: this._recordingCSSSelectorProfile});
-
-            this._recordingCSSSelectorProfile = null;
-        }
-
-        this._cssSelectorProfileType.stopRecordingProfile(cssProfilingStopped.bind(this));
-    },
-
     isProfilingCanvas: function()
     {
         return this._canvasProfileType.isRecordingProfile();
@@ -247,9 +204,6 @@ WebInspector.ProfileManager.prototype = {
         if (this._recordingJavaScriptProfile) {
             this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
             this._javaScriptProfileType.setRecordingProfile(false);
-        } else if (this._recordingCSSSelectorProfile) {
-            this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCSSSelectorProfile});
-            this._cssSelectorProfileType.setRecordingProfile(false);
         } else if (this._recordingCanvasProfile) {
             this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCanvasProfile});
             this._canvasProfileType.setRecordingProfile(false);
@@ -262,8 +216,6 @@ WebInspector.ProfileManager.prototype = {
 
         if (this._recordingJavaScriptProfile)
             this.startProfilingJavaScript();
-        else if (this._recordingCSSSelectorProfile)
-            this.startProfilingCSSSelectors();
         else if (this._recordingCanvasProfile)
             this.startProfilingCanvas();
     }
index 97947a4169074e7f75e354e827013ac1835d5d00..43d6f2453907207d8924b4c7b65cdfff387d139c 100644 (file)
     <None Include="..\UserInterface\CSSObserver.js" />
     <None Include="..\UserInterface\CSSProperty.js" />
     <None Include="..\UserInterface\CSSRule.js" />
-    <None Include="..\UserInterface\CSSSelectorProfileObject.js" />
-    <None Include="..\UserInterface\CSSSelectorProfileType.js" />
-    <None Include="..\UserInterface\CSSSelectorProfileView.js" />
     <None Include="..\UserInterface\CSSStyleDeclaration.js" />
     <None Include="..\UserInterface\CSSStyleDeclarationSection.css" />
     <None Include="..\UserInterface\CSSStyleDeclarationSection.js" />
index f2a260a0657bc181841e001c1791192c17e279dd..b50a60ce060adcfd9b05d1151852e7f63308816a 100644 (file)
     <None Include="..\UserInterface\CSSRule.js">
       <Filter>UserInterface</Filter>
     </None>
-    <None Include="..\UserInterface\CSSSelectorProfileObject.js">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSSelectorProfileType.js">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSSelectorProfileView.js">
-      <Filter>UserInterface</Filter>
-    </None>
     <None Include="..\UserInterface\CSSStyleDeclaration.js">
       <Filter>UserInterface</Filter>
     </None>