Changeset 162084 in webkit


Ignore:
Timestamp:
Jan 15, 2014 12:09:09 PM (10 years ago)
Author:
akling@apple.com
Message:

Remove the CSS selector profiler.
<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:
Location:
trunk/Source
Files:
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r162083 r162084  
     12014-01-15  Andreas Kling  <akling@apple.com>
     2
     3        Remove the CSS selector profiler.
     4        <https://webkit.org/b/127039>
     5
     6        The selector profiler was painting a mostly fictional picture of what
     7        selectors we were spending time on. It never really grokked the fast
     8        path selectors, nor did it understand recent additions like the extra
     9        cascading pass or the selector JIT.
     10
     11        Somewhat ironically, this may end up making some selectors run faster
     12        since it removes a number of brances in hot code.
     13
     14        Reviewed by Sam Weinig.
     15
     16        * css/ElementRuleCollector.cpp:
     17        (WebCore::ElementRuleCollector::collectMatchingRulesForList):
     18        * css/ElementRuleCollector.h:
     19        * inspector/InspectorCSSAgent.cpp:
     20        (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
     21        * inspector/InspectorCSSAgent.h:
     22        * inspector/InspectorInstrumentation.cpp:
     23        * inspector/InspectorInstrumentation.h:
     24        * inspector/protocol/CSS.json:
     25
    1262014-01-15  Frédéric Wang  <fred.wang@free.fr>
    227
  • trunk/Source/WebCore/css/ElementRuleCollector.cpp

    r161917 r162084  
    362362void ElementRuleCollector::collectMatchingRulesForList(const Vector<RuleData>* rules, const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange)
    363363{
    364     if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
    365         doCollectMatchingRulesForList<true>(rules, matchRequest, ruleRange);
    366         return;
    367     }
    368     doCollectMatchingRulesForList<false>(rules, matchRequest, ruleRange);
    369 }
    370 
    371 template<bool hasInspectorFrontends>
    372 void ElementRuleCollector::doCollectMatchingRulesForList(const Vector<RuleData>* rules, const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange)
    373 {
    374364    if (!rules)
    375365        return;
     
    383373
    384374        StyleRule* rule = ruleData.rule();
    385         InspectorInstrumentationCookie cookie;
    386         if (hasInspectorFrontends)
    387             cookie = InspectorInstrumentation::willMatchRule(&document(), rule, m_inspectorCSSOMWrappers, document().styleSheetCollection());
    388375        PseudoId dynamicPseudo = NOPSEUDO;
    389376        if (ruleMatches(ruleData, dynamicPseudo)) {
     
    396383            // If the rule has no properties to apply, then ignore it in the non-debug mode.
    397384            const StyleProperties& properties = rule->properties();
    398             if (properties.isEmpty() && !matchRequest.includeEmptyRules) {
    399                 if (hasInspectorFrontends)
    400                     InspectorInstrumentation::didMatchRule(cookie, false);
     385            if (properties.isEmpty() && !matchRequest.includeEmptyRules)
    401386                continue;
    402             }
    403387            // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the only reason this is needed.
    404             if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin()) {
    405                 if (hasInspectorFrontends)
    406                     InspectorInstrumentation::didMatchRule(cookie, false);
     388            if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin())
    407389                continue;
    408             }
    409390            // If we're matching normal rules, set a pseudo bit if
    410391            // we really just matched a pseudo-element.
    411392            if (dynamicPseudo != NOPSEUDO && m_pseudoStyleRequest.pseudoId == NOPSEUDO) {
    412                 if (m_mode == SelectorChecker::CollectingRules) {
    413                     if (hasInspectorFrontends)
    414                         InspectorInstrumentation::didMatchRule(cookie, false);
     393                if (m_mode == SelectorChecker::CollectingRules)
    415394                    continue;
    416                 }
    417395                if (dynamicPseudo < FIRST_INTERNAL_PSEUDOID)
    418396                    state.style()->setHasPseudoStyle(dynamicPseudo);
     
    425403                // Add this rule to our list of matched rules.
    426404                addMatchedRule(&ruleData);
    427                 if (hasInspectorFrontends)
    428                     InspectorInstrumentation::didMatchRule(cookie, true);
    429405                continue;
    430406            }
    431407        }
    432         if (hasInspectorFrontends)
    433             InspectorInstrumentation::didMatchRule(cookie, false);
    434408    }
    435409}
  • trunk/Source/WebCore/css/ElementRuleCollector.h

    r159856 r162084  
    4545        , m_ruleSets(styleResolver->ruleSets())
    4646        , m_selectorFilter(styleResolver->selectorFilter())
    47         , m_inspectorCSSOMWrappers(styleResolver->inspectorCSSOMWrappers())
    4847        , m_scopeResolver(styleResolver->scopeResolver())
    4948        , m_isPrintStyle(false)
     
    8988    void clearMatchedRules();
    9089
    91     template<bool hasInspectorFrontends>
    92     void doCollectMatchingRulesForList(const Vector<RuleData>*, const MatchRequest&, StyleResolver::RuleRange&);
    93 
    9490    const StyleResolver::State& m_state;
    9591    DocumentRuleSets& m_ruleSets;
    9692    SelectorFilter& m_selectorFilter;
    97     InspectorCSSOMWrappers& m_inspectorCSSOMWrappers;
    9893    StyleScopeResolver* m_scopeResolver;
    9994
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp

    r161768 r162084  
    7777};
    7878
    79 struct RuleMatchData {
    80     String selector;
    81     String url;
    82     unsigned lineNumber;
    83     double startTime;
    84 };
    85 
    86 struct RuleMatchingStats {
    87     RuleMatchingStats()
    88         : lineNumber(0), totalTime(0.0), hits(0), matches(0)
    89     {
    90     }
    91     RuleMatchingStats(const RuleMatchData& data, double totalTime, unsigned hits, unsigned matches)
    92         : selector(data.selector), url(data.url), lineNumber(data.lineNumber), totalTime(totalTime), hits(hits), matches(matches)
    93     {
    94     }
    95 
    96     String selector;
    97     String url;
    98     unsigned lineNumber;
    99     double totalTime;
    100     unsigned hits;
    101     unsigned matches;
    102 };
    103 
    104 class SelectorProfile {
    105     WTF_MAKE_FAST_ALLOCATED;
    106 public:
    107     SelectorProfile()
    108         : m_totalMatchingTimeMS(0.0)
    109     {
    110     }
    111     virtual ~SelectorProfile()
    112     {
    113     }
    114 
    115     double totalMatchingTimeMs() const { return m_totalMatchingTimeMS; }
    116 
    117     String makeKey();
    118     void startSelector(const CSSStyleRule*);
    119     void commitSelector(bool);
    120     void commitSelectorTime();
    121     PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> toInspectorObject() const;
    122 
    123 private:
    124 
    125     // Key is "selector?url:line".
    126     typedef HashMap<String, RuleMatchingStats> RuleMatchingStatsMap;
    127 
    128     double m_totalMatchingTimeMS;
    129     RuleMatchingStatsMap m_ruleMatchingStats;
    130     RuleMatchData m_currentMatchData;
    131 };
    132 
    133 
    13479static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray)
    13580{
     
    161106}
    162107
    163 inline String SelectorProfile::makeKey()
    164 {
    165     return makeString(m_currentMatchData.selector, "?", m_currentMatchData.url, ":", String::number(m_currentMatchData.lineNumber));
    166 }
    167 
    168 inline void SelectorProfile::startSelector(const CSSStyleRule* rule)
    169 {
    170     m_currentMatchData.selector = rule->selectorText();
    171     CSSStyleSheet* styleSheet = rule->parentStyleSheet();
    172     String url = emptyString();
    173     if (styleSheet) {
    174         url = InspectorStyleSheet::styleSheetURL(styleSheet);
    175         if (url.isEmpty())
    176             url = InspectorDOMAgent::documentURLString(styleSheet->ownerDocument());
    177     }
    178     m_currentMatchData.url = url;
    179     m_currentMatchData.lineNumber = rule->styleRule()->sourceLine();
    180     m_currentMatchData.startTime = monotonicallyIncreasingTimeMS();
    181 }
    182 
    183 inline void SelectorProfile::commitSelector(bool matched)
    184 {
    185     double matchTimeMS = monotonicallyIncreasingTimeMS() - m_currentMatchData.startTime;
    186     m_totalMatchingTimeMS += matchTimeMS;
    187 
    188     RuleMatchingStatsMap::AddResult result = m_ruleMatchingStats.add(makeKey(), RuleMatchingStats(m_currentMatchData, matchTimeMS, 1, matched ? 1 : 0));
    189     if (!result.isNewEntry) {
    190         result.iterator->value.totalTime += matchTimeMS;
    191         result.iterator->value.hits += 1;
    192         if (matched)
    193             result.iterator->value.matches += 1;
    194     }
    195 }
    196 
    197 inline void SelectorProfile::commitSelectorTime()
    198 {
    199     double processingTimeMS = monotonicallyIncreasingTimeMS() - m_currentMatchData.startTime;
    200     m_totalMatchingTimeMS += processingTimeMS;
    201 
    202     RuleMatchingStatsMap::iterator it = m_ruleMatchingStats.find(makeKey());
    203     if (it == m_ruleMatchingStats.end())
    204         return;
    205 
    206     it->value.totalTime += processingTimeMS;
    207 }
    208 
    209 PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> SelectorProfile::toInspectorObject() const
    210 {
    211     RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::SelectorProfileEntry>> selectorProfileData = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::SelectorProfileEntry>::create();
    212     for (RuleMatchingStatsMap::const_iterator it = m_ruleMatchingStats.begin(); it != m_ruleMatchingStats.end(); ++it) {
    213         RefPtr<Inspector::TypeBuilder::CSS::SelectorProfileEntry> entry = Inspector::TypeBuilder::CSS::SelectorProfileEntry::create()
    214             .setSelector(it->value.selector)
    215             .setUrl(it->value.url)
    216             .setLineNumber(it->value.lineNumber)
    217             .setTime(it->value.totalTime)
    218             .setHitCount(it->value.hits)
    219             .setMatchCount(it->value.matches);
    220         selectorProfileData->addItem(entry.release());
    221     }
    222 
    223     RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> result = Inspector::TypeBuilder::CSS::SelectorProfile::create()
    224         .setTotalTime(totalMatchingTimeMs())
    225         .setData(selectorProfileData);
    226     return result.release();
    227 }
    228 
    229108class UpdateRegionLayoutTask {
    230109public:
     
    643522
    644523    resetNonPersistentData();
    645     String errorString;
    646     stopSelectorProfilerImpl(&errorString, false);
    647524}
    648525
     
    1081958
    1082959    result = namedFlows.release();
    1083 }
    1084 
    1085 void InspectorCSSAgent::startSelectorProfiler(ErrorString*)
    1086 {
    1087     m_currentSelectorProfile = adoptPtr(new SelectorProfile());
    1088 }
    1089 
    1090 void InspectorCSSAgent::stopSelectorProfiler(ErrorString* errorString, RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile>& result)
    1091 {
    1092     result = stopSelectorProfilerImpl(errorString, true);
    1093 }
    1094 
    1095 PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> InspectorCSSAgent::stopSelectorProfilerImpl(ErrorString*, bool needProfile)
    1096 {
    1097     if (!m_currentSelectorProfile)
    1098         return 0;
    1099     RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> result;
    1100     if (m_frontendDispatcher && needProfile)
    1101         result = m_currentSelectorProfile->toInspectorObject();
    1102     m_currentSelectorProfile.clear();
    1103     return result.release();
    1104 }
    1105 
    1106 void InspectorCSSAgent::willMatchRule(StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& styleSheetCollection)
    1107 {
    1108 //    printf("InspectorCSSAgent::willMatchRule %s\n", rule->selectorList().selectorsText().utf8().data());
    1109     if (m_currentSelectorProfile)
    1110         m_currentSelectorProfile->startSelector(inspectorCSSOMWrappers.getWrapperForRuleInSheets(rule, styleSheetCollection));
    1111 }
    1112 
    1113 void InspectorCSSAgent::didMatchRule(bool matched)
    1114 {
    1115     if (m_currentSelectorProfile)
    1116         m_currentSelectorProfile->commitSelector(matched);
    1117 }
    1118 
    1119 void InspectorCSSAgent::willProcessRule(StyleRule* rule, StyleResolver& styleResolver)
    1120 {
    1121     if (m_currentSelectorProfile)
    1122         m_currentSelectorProfile->startSelector(styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(rule, styleResolver.document().styleSheetCollection()));
    1123 }
    1124 
    1125 void InspectorCSSAgent::didProcessRule()
    1126 {
    1127     if (m_currentSelectorProfile)
    1128         m_currentSelectorProfile->commitSelectorTime();
    1129960}
    1130961
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.h

    r161784 r162084  
    5959class Node;
    6060class NodeList;
    61 class SelectorProfile;
    6261class StyleResolver;
    6362class StyleRule;
     
    129128    virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::NamedFlow>>& result);
    130129
    131     virtual void startSelectorProfiler(ErrorString*);
    132     virtual void stopSelectorProfiler(ErrorString*, RefPtr<Inspector::TypeBuilder::CSS::SelectorProfile>&);
    133 
    134     PassRefPtr<Inspector::TypeBuilder::CSS::SelectorProfile> stopSelectorProfilerImpl(ErrorString*, bool needProfile);
    135     void willMatchRule(StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
    136     void didMatchRule(bool);
    137     void willProcessRule(StyleRule*, StyleResolver&);
    138     void didProcessRule();
    139 
    140130private:
    141131    class StyleSheetAction;
     
    196186
    197187    int m_lastStyleSheetId;
    198 
    199     OwnPtr<SelectorProfile> m_currentSelectorProfile;
    200188};
    201189
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r161733 r162084  
    551551}
    552552
    553 InspectorInstrumentationCookie InspectorInstrumentation::willMatchRuleImpl(InstrumentingAgents* instrumentingAgents, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& sheetCollection)
    554 {
    555     InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent();
    556     if (cssAgent) {
    557         cssAgent->willMatchRule(rule, inspectorCSSOMWrappers, sheetCollection);
    558         return InspectorInstrumentationCookie(instrumentingAgents, 1);
    559     }
    560 
    561     return InspectorInstrumentationCookie();
    562 }
    563 
    564 void InspectorInstrumentation::didMatchRuleImpl(const InspectorInstrumentationCookie& cookie, bool matched)
    565 {
    566     InspectorCSSAgent* cssAgent = cookie.instrumentingAgents()->inspectorCSSAgent();
    567     if (cssAgent)
    568         cssAgent->didMatchRule(matched);
    569 }
    570 
    571 InspectorInstrumentationCookie InspectorInstrumentation::willProcessRuleImpl(InstrumentingAgents* instrumentingAgents, StyleRule* rule, StyleResolver& styleResolver)
    572 {
    573     InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent();
    574     if (cssAgent) {
    575         cssAgent->willProcessRule(rule, styleResolver);
    576         return InspectorInstrumentationCookie(instrumentingAgents, 1);
    577     }
    578 
    579     return InspectorInstrumentationCookie();
    580 }
    581 
    582 void InspectorInstrumentation::didProcessRuleImpl(const InspectorInstrumentationCookie& cookie)
    583 {
    584     InspectorCSSAgent* cssAgent = cookie.instrumentingAgents()->inspectorCSSAgent();
    585     if (cssAgent)
    586         cssAgent->didProcessRule();
    587 }
    588 
    589553void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents* instrumentingAgents, String* media)
    590554{
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r161697 r162084  
    160160    static void didRecalculateStyle(const InspectorInstrumentationCookie&);
    161161    static void didScheduleStyleRecalculation(Document*);
    162     static InspectorInstrumentationCookie willMatchRule(Document*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
    163     static void didMatchRule(const InspectorInstrumentationCookie&, bool matched);
    164     static InspectorInstrumentationCookie willProcessRule(Document*, StyleRule*, StyleResolver&);
    165     static void didProcessRule(const InspectorInstrumentationCookie&);
    166162
    167163    static void applyEmulatedMedia(Frame*, String*);
     
    350346    static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
    351347    static void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
    352     static InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection&);
    353     static void didMatchRuleImpl(const InspectorInstrumentationCookie&, bool matched);
    354     static InspectorInstrumentationCookie willProcessRuleImpl(InstrumentingAgents*, StyleRule*, StyleResolver&);
    355     static void didProcessRuleImpl(const InspectorInstrumentationCookie&);
    356348
    357349    static void applyEmulatedMediaImpl(InstrumentingAgents*, String*);
     
    11731165}
    11741166
    1175 inline InspectorInstrumentationCookie InspectorInstrumentation::willMatchRule(Document* document, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection& styleSheetCollection)
    1176 {
    1177 #if ENABLE(INSPECTOR)
    1178     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    1179     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
    1180         return willMatchRuleImpl(instrumentingAgents, rule, inspectorCSSOMWrappers, styleSheetCollection);
    1181 #else
    1182     UNUSED_PARAM(document);
    1183     UNUSED_PARAM(rule);
    1184     UNUSED_PARAM(inspectorCSSOMWrappers);
    1185     UNUSED_PARAM(styleSheetCollection);
    1186 #endif
    1187     return InspectorInstrumentationCookie();
    1188 }
    1189 
    1190 inline void InspectorInstrumentation::didMatchRule(const InspectorInstrumentationCookie& cookie, bool matched)
    1191 {
    1192 #if ENABLE(INSPECTOR)
    1193     FAST_RETURN_IF_NO_FRONTENDS(void());
    1194     if (cookie.isValid())
    1195         didMatchRuleImpl(cookie, matched);
    1196 #else
    1197     UNUSED_PARAM(cookie);
    1198     UNUSED_PARAM(matched);
    1199 #endif
    1200 }
    1201 
    1202 inline InspectorInstrumentationCookie InspectorInstrumentation::willProcessRule(Document* document, StyleRule* rule, StyleResolver& styleResolver)
    1203 {
    1204 #if ENABLE(INSPECTOR)
    1205     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    1206     if (!rule)
    1207         return InspectorInstrumentationCookie();
    1208     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
    1209         return willProcessRuleImpl(instrumentingAgents, rule, styleResolver);
    1210 #else
    1211     UNUSED_PARAM(document);
    1212     UNUSED_PARAM(rule);
    1213     UNUSED_PARAM(styleResolver);
    1214 #endif
    1215     return InspectorInstrumentationCookie();
    1216 }
    1217 
    1218 inline void InspectorInstrumentation::didProcessRule(const InspectorInstrumentationCookie& cookie)
    1219 {
    1220 #if ENABLE(INSPECTOR)
    1221     FAST_RETURN_IF_NO_FRONTENDS(void());
    1222     if (cookie.isValid())
    1223         didProcessRuleImpl(cookie);
    1224 #else
    1225     UNUSED_PARAM(cookie);
    1226 #endif
    1227 }
    1228 
    12291167inline void InspectorInstrumentation::applyEmulatedMedia(Frame* frame, String* media)
    12301168{
  • trunk/Source/WebCore/inspector/protocol/CSS.json

    r159233 r162084  
    190190        },
    191191        {
    192             "id": "SelectorProfileEntry",
    193             "type": "object",
    194             "properties": [
    195                 { "name": "selector", "type": "string", "description": "CSS selector of the corresponding rule." },
    196                 { "name": "url", "type": "string", "description": "URL of the resource containing the corresponding rule." },
    197                 { "name": "lineNumber", "type": "integer", "description": "Selector line number in the resource for the corresponding rule." },
    198                 { "name": "time", "type": "number", "description": "Total time this rule handling contributed to the browser running time during profiling (in milliseconds.)" },
    199                 { "name": "hitCount", "type": "integer", "description": "Number of times this rule was considered a candidate for matching against DOM elements." },
    200                 { "name": "matchCount", "type": "integer", "description": "Number of times this rule actually matched a DOM element." }
    201             ],
    202             "description": "CSS selector profile entry."
    203         },
    204         {
    205             "id": "SelectorProfile",
    206             "type": "object",
    207             "properties": [
    208                 { "name": "totalTime", "type": "number", "description": "Total processing time for all selectors in the profile (in milliseconds.)" },
    209                 { "name": "data", "type": "array", "items": { "$ref": "SelectorProfileEntry" }, "description": "CSS selector profile entries." }
    210             ]
    211         },
    212         {
    213192            "id": "Region",
    214193            "type": "object",
     
    385364        },
    386365        {
    387             "name": "startSelectorProfiler"
    388         },
    389         {
    390             "name": "stopSelectorProfiler",
    391             "returns": [
    392                 { "name": "profile", "$ref": "SelectorProfile" }
    393             ]
    394         },
    395         {
    396366            "name": "getNamedFlowCollection",
    397367            "parameters": [
  • trunk/Source/WebInspectorUI/ChangeLog

    r161893 r162084  
     12014-01-15  Andreas Kling  <akling@apple.com>
     2
     3        Remove the CSS selector profiler.
     4        <https://webkit.org/b/127039>
     5
     6        Purge selector profiler code from the new Web Inspector UI.
     7
     8        Reviewed by Sam Weinig.
     9
     10        * Localizations/en.lproj/localizedStrings.js:
     11        * UserInterface/CSSSelectorProfileObject.js: Removed.
     12        * UserInterface/CSSSelectorProfileType.js: Removed.
     13        * UserInterface/CSSSelectorProfileView.js: Removed.
     14        * UserInterface/ContentView.js:
     15        (WebInspector.ContentView):
     16        (WebInspector.ContentView.isViewable):
     17        * UserInterface/InspectorWebBackendCommands.js:
     18        * UserInterface/InstrumentSidebarPanel.js:
     19        (WebInspector.InstrumentSidebarPanel):
     20        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedOver):
     21        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedDown):
     22        (WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphClicked):
     23        (WebInspector.InstrumentSidebarPanel.prototype._profileTypeWasSelected):
     24        (WebInspector.InstrumentSidebarPanel.prototype._profilesCleared):
     25        * UserInterface/Main.html:
     26        * UserInterface/ProfileManager.js:
     27        (WebInspector.ProfileManager):
     28        (WebInspector.ProfileManager.prototype.initialize):
     29        (WebInspector.ProfileManager.prototype._checkForInterruptions):
     30        (WebInspector.ProfileManager.prototype._attemptToResumeProfiling):
     31        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
     32        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
     33
    1342014-01-13  Timothy Hatcher  <timothy@apple.com>
    235
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r161673 r162084  
    6161localizedStrings["Bubbling"] = "Bubbling";
    6262localizedStrings["CANVAS PROFILES"] = "CANVAS PROFILES";
    63 localizedStrings["CSS SELECTOR PROFILES"] = "CSS SELECTOR PROFILES";
    64 localizedStrings["CSS Selector Profile %d"] = "CSS Selector Profile %d";
    65 localizedStrings["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.)"] = "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.)";
    6663localizedStrings["Cached"] = "Cached";
    6764localizedStrings["Call"] = "Call";
    6865localizedStrings["Call Stack"] = "Call Stack";
    6966localizedStrings["Calls"] = "Calls";
     67localizedStrings["Cancel Automatic Continue"] = "Cancel Automatic Continue";
    7068localizedStrings["Canvas Profile %d"] = "Canvas Profile %d";
    7169localizedStrings["Canvas profiles allow you to examine drawing operations on canvas elements."] = "Canvas profiles allow you to examine drawing operations on canvas elements.";
     
    8179localizedStrings["Code"] = "Code";
    8280localizedStrings["Collapse columns"] = "Collapse columns";
    83 localizedStrings["Collect CSS Selector Profile"] = "Collect CSS Selector Profile";
    8481localizedStrings["Collect Canvas Profile"] = "Collect Canvas Profile";
    8582localizedStrings["Collect JavaScript Profile"] = "Collect JavaScript Profile";
     
    246243localizedStrings["Main Frame"] = "Main Frame";
    247244localizedStrings["Manifest URL"] = "Manifest URL";
    248 localizedStrings["Matches"] = "Matches";
    249245localizedStrings["Media: "] = "Media: ";
    250246localizedStrings["Memory"] = "Memory";
     
    304300localizedStrings["Recalculate Styles"] = "Recalculate Styles";
    305301localizedStrings["Recording"] = "Recording";
    306 localizedStrings["Recording CSS Selector Profile\u2026"] = "Recording CSS Selector Profile\u2026";
    307302localizedStrings["Recording Canvas Profile…"] = "Recording Canvas Profile…";
    308303localizedStrings["Recording JavaScript Profile\u2026"] = "Recording JavaScript Profile\u2026";
     
    336331localizedStrings["Secure"] = "Secure";
    337332localizedStrings["Security Issue"] = "Security Issue";
    338 localizedStrings["Selector"] = "Selector";
    339333localizedStrings["Self"] = "Self";
    340334localizedStrings["Semantic Issue"] = "Semantic Issue";
    341335localizedStrings["Session"] = "Session";
    342336localizedStrings["Session Storage"] = "Session Storage";
     337localizedStrings["Set to Automatically Continue"] = "Set to Automatically Continue";
    343338localizedStrings["Shadow Content"] = "Shadow Content";
    344339localizedStrings["Show All"] = "Show All";
     
    360355localizedStrings["Socket"] = "Socket";
    361356localizedStrings["Sockets"] = "Sockets";
    362 localizedStrings["Source"] = "Source";
    363357localizedStrings["Source Code"] = "Source Code";
    364 localizedStrings["Start CSS Selector Profile"] = "Start CSS Selector Profile";
    365 localizedStrings["Start CSS selector profiling."] = "Start CSS selector profiling.";
    366358localizedStrings["Start Canvas Profile"] = "Start Canvas Profile";
    367359localizedStrings["Start Canvas profiling."] = "Start Canvas profiling.";
     
    375367localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)";
    376368localizedStrings["Step over (%s or %s)"] = "Step over (%s or %s)";
    377 localizedStrings["Stop CSS selector profiling."] = "Stop CSS selector profiling.";
    378369localizedStrings["Stop Canvas profiling."] = "Stop Canvas profiling.";
    379370localizedStrings["Stop JavaScript profiling."] = "Stop JavaScript profiling.";
  • trunk/Source/WebInspectorUI/UserInterface/ContentView.js

    r159151 r162084  
    6767            return new WebInspector.JavaScriptProfileView(representedObject);
    6868
    69         if (representedObject instanceof WebInspector.CSSSelectorProfileObject)
    70             return new WebInspector.CSSSelectorProfileView(representedObject);
    71 
    7269        if (representedObject instanceof WebInspector.CanvasProfileObject)
    7370            return new WebInspector.CanvasProfileView(representedObject);
     
    125122        return true;
    126123    if (representedObject instanceof WebInspector.JavaScriptProfileObject)
    127         return true;
    128     if (representedObject instanceof WebInspector.CSSSelectorProfileObject)
    129124        return true;
    130125    if (representedObject instanceof WebInspector.CanvasProfileObject)
  • trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js

    r161691 r162084  
    4646InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
    4747InspectorBackend.registerCommand("CSS.forcePseudoState", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "forcedPseudoClasses", "type": "object", "optional": false}], []);
    48 InspectorBackend.registerCommand("CSS.startSelectorProfiler", [], []);
    49 InspectorBackend.registerCommand("CSS.stopSelectorProfiler", [], ["profile"]);
    5048InspectorBackend.registerCommand("CSS.getNamedFlowCollection", [{"name": "documentNodeId", "type": "number", "optional": false}], ["namedFlows"]);
    5149
  • trunk/Source/WebInspectorUI/UserInterface/InstrumentSidebarPanel.js

    r160025 r162084  
    100100    startJavaScriptProfileOption.selected = false;
    101101   
    102     var startCSSSelectorProfileOption = document.createElement("option");
    103     startCSSSelectorProfileOption.textContent = WebInspector.UIString("Start CSS Selector Profile");
    104     startCSSSelectorProfileOption.value = WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue;
    105     startCSSSelectorProfileOption.selected = false;
    106 
    107102    var startCanvasProfileOption = document.createElement("option");
    108103    startCanvasProfileOption.textContent = WebInspector.UIString("Start Canvas Profile");
     
    111106
    112107    this._recordProfileGlyphElement.add(startJavaScriptProfileOption);
    113     this._recordProfileGlyphElement.add(startCSSSelectorProfileOption);
    114108    this._recordProfileGlyphElement.add(startCanvasProfileOption);
    115109
     
    156150WebInspector.InstrumentSidebarPanel.ProfileIconStyleClass = "profile-icon";
    157151WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue = "start-javascript-profile";
    158 WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue = "start-css-selector-profile";
    159152WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue = "start-canvas-profile";
    160153
     
    307300        this._recordProfileGlyphElement.classList.remove(WebInspector.InstrumentSidebarPanel.RecordGlyphRecordingForcedStyleClass);
    308301
    309         if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCSSSelectors() || WebInspector.profileManager.isProfilingCanvas())
     302        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas())
    310303            this._recordProfileStatusElement.textContent = WebInspector.UIString("Stop Profiling");
    311304        else
     
    330323        // We don't want to show the select if the user is currently profiling. In that case,
    331324        // the user should just be able to click the record button to stop profiling.
    332         if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCSSSelectors() || WebInspector.profileManager.isProfilingCanvas())
     325        if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas())
    333326            event.preventDefault();
    334327        else {
     
    352345        if (WebInspector.profileManager.isProfilingJavaScript())
    353346            WebInspector.profileManager.stopProfilingJavaScript();
    354         if (WebInspector.profileManager.isProfilingCSSSelectors())
    355             WebInspector.profileManager.stopProfilingCSSSelectors();
    356347        if (WebInspector.profileManager.isProfilingCanvas())
    357348            WebInspector.profileManager.stopProfilingCanvas();
     
    367358        if (selectedValue === WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue)
    368359            WebInspector.profileManager.startProfilingJavaScript();
    369         else if (selectedValue === WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue)
    370             WebInspector.profileManager.startProfilingCSSSelectors();
    371360        else {
    372361            console.assert(selectedValue === WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue);
     
    510499       
    511500        WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.JavaScriptProfileView);
    512         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CSSSelectorProfileView);
    513501        WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CanvasProfileView);
    514502       
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r160552 r162084  
    357357    <script src="JavaScriptProfileType.js"></script>
    358358    <script src="JavaScriptProfileView.js"></script>
    359     <script src="CSSSelectorProfileType.js"></script>
    360     <script src="CSSSelectorProfileView.js"></script>
    361359    <script src="CanvasDataGridNode.js"></script>
    362360    <script src="CanvasProfileType.js"></script>
     
    364362    <script src="ProfileObject.js"></script>
    365363    <script src="JavaScriptProfileObject.js"></script>
    366     <script src="CSSSelectorProfileObject.js"></script>
    367364    <script src="CanvasProfileObject.js"></script>
    368365    <script src="DebuggerSidebarPanel.js"></script>
  • trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js

    r153928 r162084  
    2929
    3030    this._javaScriptProfileType = new WebInspector.JavaScriptProfileType;
    31     this._cssSelectorProfileType = new WebInspector.CSSSelectorProfileType;
    3231    this._canvasProfileType = new WebInspector.CanvasProfileType;
    3332
     
    6160
    6261        this._recordingJavaScriptProfile = null;
    63         this._recordingCSSSelectorProfile = null;
    6462        this._recordingCanvasProfile = null;
    6563
    6664        this._isProfiling = false;
    6765
    68         this._cssSelectorProfileType.reset();
    69 
    7066        this.dispatchEventToListeners(WebInspector.ProfileManager.Event.Cleared);
    7167    },
     
    8480    {
    8581        this._javaScriptProfileType.stopRecordingProfile();
    86     },
    87 
    88     isProfilingCSSSelectors: function()
    89     {
    90         return this._cssSelectorProfileType.isRecordingProfile();
    91     },
    92 
    93     startProfilingCSSSelectors: function()
    94     {
    95         this._cssSelectorProfileType.startRecordingProfile();
    96        
    97         var id = this._cssSelectorProfileType.nextProfileId();
    98         this._recordingCSSSelectorProfile = new WebInspector.CSSSelectorProfileObject(WebInspector.UIString("CSS Selector Profile %d").format(id), id, true);
    99         this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasAdded, {profile: this._recordingCSSSelectorProfile});
    100        
    101         this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingStarted);
    102     },
    103    
    104     stopProfilingCSSSelectors: function()
    105     {
    106         function cssProfilingStopped(error, profile)
    107         {
    108             if (error)
    109                 return;
    110 
    111             console.assert(this._recordingCSSSelectorProfile);
    112 
    113             this._recordingCSSSelectorProfile.data = profile.data;
    114             this._recordingCSSSelectorProfile.totalTime = profile.totalTime;
    115             this._recordingCSSSelectorProfile.recording = false;
    116            
    117             this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfileWasUpdated, {profile: this._recordingCSSSelectorProfile});
    118 
    119             this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingEnded, {profile: this._recordingCSSSelectorProfile});
    120 
    121             this._recordingCSSSelectorProfile = null;
    122         }
    123 
    124         this._cssSelectorProfileType.stopRecordingProfile(cssProfilingStopped.bind(this));
    12582    },
    12683
     
    248205            this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
    249206            this._javaScriptProfileType.setRecordingProfile(false);
    250         } else if (this._recordingCSSSelectorProfile) {
    251             this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCSSSelectorProfile});
    252             this._cssSelectorProfileType.setRecordingProfile(false);
    253207        } else if (this._recordingCanvasProfile) {
    254208            this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCanvasProfile});
     
    263217        if (this._recordingJavaScriptProfile)
    264218            this.startProfilingJavaScript();
    265         else if (this._recordingCSSSelectorProfile)
    266             this.startProfilingCSSSelectors();
    267219        else if (this._recordingCanvasProfile)
    268220            this.startProfilingCanvas();
  • trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj

    r160655 r162084  
    306306    <None Include="..\UserInterface\CSSProperty.js" />
    307307    <None Include="..\UserInterface\CSSRule.js" />
    308     <None Include="..\UserInterface\CSSSelectorProfileObject.js" />
    309     <None Include="..\UserInterface\CSSSelectorProfileType.js" />
    310     <None Include="..\UserInterface\CSSSelectorProfileView.js" />
    311308    <None Include="..\UserInterface\CSSStyleDeclaration.js" />
    312309    <None Include="..\UserInterface\CSSStyleDeclarationSection.css" />
  • trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters

    r160557 r162084  
    277277      <Filter>UserInterface</Filter>
    278278    </None>
    279     <None Include="..\UserInterface\CSSSelectorProfileObject.js">
    280       <Filter>UserInterface</Filter>
    281     </None>
    282     <None Include="..\UserInterface\CSSSelectorProfileType.js">
    283       <Filter>UserInterface</Filter>
    284     </None>
    285     <None Include="..\UserInterface\CSSSelectorProfileView.js">
    286       <Filter>UserInterface</Filter>
    287     </None>
    288279    <None Include="..\UserInterface\CSSStyleDeclaration.js">
    289280      <Filter>UserInterface</Filter>
Note: See TracChangeset for help on using the changeset viewer.