Changeset 162084 in webkit
- Timestamp:
- Jan 15, 2014 12:09:09 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r162083 r162084 1 2014-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 1 26 2014-01-15 Frédéric Wang <fred.wang@free.fr> 2 27 -
trunk/Source/WebCore/css/ElementRuleCollector.cpp
r161917 r162084 362 362 void ElementRuleCollector::collectMatchingRulesForList(const Vector<RuleData>* rules, const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange) 363 363 { 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 {374 364 if (!rules) 375 365 return; … … 383 373 384 374 StyleRule* rule = ruleData.rule(); 385 InspectorInstrumentationCookie cookie;386 if (hasInspectorFrontends)387 cookie = InspectorInstrumentation::willMatchRule(&document(), rule, m_inspectorCSSOMWrappers, document().styleSheetCollection());388 375 PseudoId dynamicPseudo = NOPSEUDO; 389 376 if (ruleMatches(ruleData, dynamicPseudo)) { … … 396 383 // If the rule has no properties to apply, then ignore it in the non-debug mode. 397 384 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) 401 386 continue; 402 }403 387 // 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()) 407 389 continue; 408 }409 390 // If we're matching normal rules, set a pseudo bit if 410 391 // we really just matched a pseudo-element. 411 392 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) 415 394 continue; 416 }417 395 if (dynamicPseudo < FIRST_INTERNAL_PSEUDOID) 418 396 state.style()->setHasPseudoStyle(dynamicPseudo); … … 425 403 // Add this rule to our list of matched rules. 426 404 addMatchedRule(&ruleData); 427 if (hasInspectorFrontends)428 InspectorInstrumentation::didMatchRule(cookie, true);429 405 continue; 430 406 } 431 407 } 432 if (hasInspectorFrontends)433 InspectorInstrumentation::didMatchRule(cookie, false);434 408 } 435 409 } -
trunk/Source/WebCore/css/ElementRuleCollector.h
r159856 r162084 45 45 , m_ruleSets(styleResolver->ruleSets()) 46 46 , m_selectorFilter(styleResolver->selectorFilter()) 47 , m_inspectorCSSOMWrappers(styleResolver->inspectorCSSOMWrappers())48 47 , m_scopeResolver(styleResolver->scopeResolver()) 49 48 , m_isPrintStyle(false) … … 89 88 void clearMatchedRules(); 90 89 91 template<bool hasInspectorFrontends>92 void doCollectMatchingRulesForList(const Vector<RuleData>*, const MatchRequest&, StyleResolver::RuleRange&);93 94 90 const StyleResolver::State& m_state; 95 91 DocumentRuleSets& m_ruleSets; 96 92 SelectorFilter& m_selectorFilter; 97 InspectorCSSOMWrappers& m_inspectorCSSOMWrappers;98 93 StyleScopeResolver* m_scopeResolver; 99 94 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r161768 r162084 77 77 }; 78 78 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 134 79 static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray) 135 80 { … … 161 106 } 162 107 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() const210 {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 229 108 class UpdateRegionLayoutTask { 230 109 public: … … 643 522 644 523 resetNonPersistentData(); 645 String errorString;646 stopSelectorProfilerImpl(&errorString, false);647 524 } 648 525 … … 1081 958 1082 959 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();1129 960 } 1130 961 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.h
r161784 r162084 59 59 class Node; 60 60 class NodeList; 61 class SelectorProfile;62 61 class StyleResolver; 63 62 class StyleRule; … … 129 128 virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::CSS::NamedFlow>>& result); 130 129 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 140 130 private: 141 131 class StyleSheetAction; … … 196 186 197 187 int m_lastStyleSheetId; 198 199 OwnPtr<SelectorProfile> m_currentSelectorProfile;200 188 }; 201 189 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r161733 r162084 551 551 } 552 552 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 589 553 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents* instrumentingAgents, String* media) 590 554 { -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r161697 r162084 160 160 static void didRecalculateStyle(const InspectorInstrumentationCookie&); 161 161 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&);166 162 167 163 static void applyEmulatedMedia(Frame*, String*); … … 350 346 static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&); 351 347 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&);356 348 357 349 static void applyEmulatedMediaImpl(InstrumentingAgents*, String*); … … 1173 1165 } 1174 1166 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 #else1182 UNUSED_PARAM(document);1183 UNUSED_PARAM(rule);1184 UNUSED_PARAM(inspectorCSSOMWrappers);1185 UNUSED_PARAM(styleSheetCollection);1186 #endif1187 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 #else1197 UNUSED_PARAM(cookie);1198 UNUSED_PARAM(matched);1199 #endif1200 }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 #else1211 UNUSED_PARAM(document);1212 UNUSED_PARAM(rule);1213 UNUSED_PARAM(styleResolver);1214 #endif1215 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 #else1225 UNUSED_PARAM(cookie);1226 #endif1227 }1228 1229 1167 inline void InspectorInstrumentation::applyEmulatedMedia(Frame* frame, String* media) 1230 1168 { -
trunk/Source/WebCore/inspector/protocol/CSS.json
r159233 r162084 190 190 }, 191 191 { 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 {213 192 "id": "Region", 214 193 "type": "object", … … 385 364 }, 386 365 { 387 "name": "startSelectorProfiler"388 },389 {390 "name": "stopSelectorProfiler",391 "returns": [392 { "name": "profile", "$ref": "SelectorProfile" }393 ]394 },395 {396 366 "name": "getNamedFlowCollection", 397 367 "parameters": [ -
trunk/Source/WebInspectorUI/ChangeLog
r161893 r162084 1 2014-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 1 34 2014-01-13 Timothy Hatcher <timothy@apple.com> 2 35 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r161673 r162084 61 61 localizedStrings["Bubbling"] = "Bubbling"; 62 62 localizedStrings["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.)";66 63 localizedStrings["Cached"] = "Cached"; 67 64 localizedStrings["Call"] = "Call"; 68 65 localizedStrings["Call Stack"] = "Call Stack"; 69 66 localizedStrings["Calls"] = "Calls"; 67 localizedStrings["Cancel Automatic Continue"] = "Cancel Automatic Continue"; 70 68 localizedStrings["Canvas Profile %d"] = "Canvas Profile %d"; 71 69 localizedStrings["Canvas profiles allow you to examine drawing operations on canvas elements."] = "Canvas profiles allow you to examine drawing operations on canvas elements."; … … 81 79 localizedStrings["Code"] = "Code"; 82 80 localizedStrings["Collapse columns"] = "Collapse columns"; 83 localizedStrings["Collect CSS Selector Profile"] = "Collect CSS Selector Profile";84 81 localizedStrings["Collect Canvas Profile"] = "Collect Canvas Profile"; 85 82 localizedStrings["Collect JavaScript Profile"] = "Collect JavaScript Profile"; … … 246 243 localizedStrings["Main Frame"] = "Main Frame"; 247 244 localizedStrings["Manifest URL"] = "Manifest URL"; 248 localizedStrings["Matches"] = "Matches";249 245 localizedStrings["Media: "] = "Media: "; 250 246 localizedStrings["Memory"] = "Memory"; … … 304 300 localizedStrings["Recalculate Styles"] = "Recalculate Styles"; 305 301 localizedStrings["Recording"] = "Recording"; 306 localizedStrings["Recording CSS Selector Profile\u2026"] = "Recording CSS Selector Profile\u2026";307 302 localizedStrings["Recording Canvas Profile…"] = "Recording Canvas Profile…"; 308 303 localizedStrings["Recording JavaScript Profile\u2026"] = "Recording JavaScript Profile\u2026"; … … 336 331 localizedStrings["Secure"] = "Secure"; 337 332 localizedStrings["Security Issue"] = "Security Issue"; 338 localizedStrings["Selector"] = "Selector";339 333 localizedStrings["Self"] = "Self"; 340 334 localizedStrings["Semantic Issue"] = "Semantic Issue"; 341 335 localizedStrings["Session"] = "Session"; 342 336 localizedStrings["Session Storage"] = "Session Storage"; 337 localizedStrings["Set to Automatically Continue"] = "Set to Automatically Continue"; 343 338 localizedStrings["Shadow Content"] = "Shadow Content"; 344 339 localizedStrings["Show All"] = "Show All"; … … 360 355 localizedStrings["Socket"] = "Socket"; 361 356 localizedStrings["Sockets"] = "Sockets"; 362 localizedStrings["Source"] = "Source";363 357 localizedStrings["Source Code"] = "Source Code"; 364 localizedStrings["Start CSS Selector Profile"] = "Start CSS Selector Profile";365 localizedStrings["Start CSS selector profiling."] = "Start CSS selector profiling.";366 358 localizedStrings["Start Canvas Profile"] = "Start Canvas Profile"; 367 359 localizedStrings["Start Canvas profiling."] = "Start Canvas profiling."; … … 375 367 localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)"; 376 368 localizedStrings["Step over (%s or %s)"] = "Step over (%s or %s)"; 377 localizedStrings["Stop CSS selector profiling."] = "Stop CSS selector profiling.";378 369 localizedStrings["Stop Canvas profiling."] = "Stop Canvas profiling."; 379 370 localizedStrings["Stop JavaScript profiling."] = "Stop JavaScript profiling."; -
trunk/Source/WebInspectorUI/UserInterface/ContentView.js
r159151 r162084 67 67 return new WebInspector.JavaScriptProfileView(representedObject); 68 68 69 if (representedObject instanceof WebInspector.CSSSelectorProfileObject)70 return new WebInspector.CSSSelectorProfileView(representedObject);71 72 69 if (representedObject instanceof WebInspector.CanvasProfileObject) 73 70 return new WebInspector.CanvasProfileView(representedObject); … … 125 122 return true; 126 123 if (representedObject instanceof WebInspector.JavaScriptProfileObject) 127 return true;128 if (representedObject instanceof WebInspector.CSSSelectorProfileObject)129 124 return true; 130 125 if (representedObject instanceof WebInspector.CanvasProfileObject) -
trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js
r161691 r162084 46 46 InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]); 47 47 InspectorBackend.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"]);50 48 InspectorBackend.registerCommand("CSS.getNamedFlowCollection", [{"name": "documentNodeId", "type": "number", "optional": false}], ["namedFlows"]); 51 49 -
trunk/Source/WebInspectorUI/UserInterface/InstrumentSidebarPanel.js
r160025 r162084 100 100 startJavaScriptProfileOption.selected = false; 101 101 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 107 102 var startCanvasProfileOption = document.createElement("option"); 108 103 startCanvasProfileOption.textContent = WebInspector.UIString("Start Canvas Profile"); … … 111 106 112 107 this._recordProfileGlyphElement.add(startJavaScriptProfileOption); 113 this._recordProfileGlyphElement.add(startCSSSelectorProfileOption);114 108 this._recordProfileGlyphElement.add(startCanvasProfileOption); 115 109 … … 156 150 WebInspector.InstrumentSidebarPanel.ProfileIconStyleClass = "profile-icon"; 157 151 WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue = "start-javascript-profile"; 158 WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue = "start-css-selector-profile";159 152 WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue = "start-canvas-profile"; 160 153 … … 307 300 this._recordProfileGlyphElement.classList.remove(WebInspector.InstrumentSidebarPanel.RecordGlyphRecordingForcedStyleClass); 308 301 309 if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingC SSSelectors() || WebInspector.profileManager.isProfilingCanvas())302 if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas()) 310 303 this._recordProfileStatusElement.textContent = WebInspector.UIString("Stop Profiling"); 311 304 else … … 330 323 // We don't want to show the select if the user is currently profiling. In that case, 331 324 // the user should just be able to click the record button to stop profiling. 332 if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingC SSSelectors() || WebInspector.profileManager.isProfilingCanvas())325 if (WebInspector.profileManager.isProfilingJavaScript() || WebInspector.profileManager.isProfilingCanvas()) 333 326 event.preventDefault(); 334 327 else { … … 352 345 if (WebInspector.profileManager.isProfilingJavaScript()) 353 346 WebInspector.profileManager.stopProfilingJavaScript(); 354 if (WebInspector.profileManager.isProfilingCSSSelectors())355 WebInspector.profileManager.stopProfilingCSSSelectors();356 347 if (WebInspector.profileManager.isProfilingCanvas()) 357 348 WebInspector.profileManager.stopProfilingCanvas(); … … 367 358 if (selectedValue === WebInspector.InstrumentSidebarPanel.StartJavaScriptProfileValue) 368 359 WebInspector.profileManager.startProfilingJavaScript(); 369 else if (selectedValue === WebInspector.InstrumentSidebarPanel.StartCSSSelectorProfileValue)370 WebInspector.profileManager.startProfilingCSSSelectors();371 360 else { 372 361 console.assert(selectedValue === WebInspector.InstrumentSidebarPanel.StartCanvasProfileValue); … … 510 499 511 500 WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.JavaScriptProfileView); 512 WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CSSSelectorProfileView);513 501 WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CanvasProfileView); 514 502 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r160552 r162084 357 357 <script src="JavaScriptProfileType.js"></script> 358 358 <script src="JavaScriptProfileView.js"></script> 359 <script src="CSSSelectorProfileType.js"></script>360 <script src="CSSSelectorProfileView.js"></script>361 359 <script src="CanvasDataGridNode.js"></script> 362 360 <script src="CanvasProfileType.js"></script> … … 364 362 <script src="ProfileObject.js"></script> 365 363 <script src="JavaScriptProfileObject.js"></script> 366 <script src="CSSSelectorProfileObject.js"></script>367 364 <script src="CanvasProfileObject.js"></script> 368 365 <script src="DebuggerSidebarPanel.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/ProfileManager.js
r153928 r162084 29 29 30 30 this._javaScriptProfileType = new WebInspector.JavaScriptProfileType; 31 this._cssSelectorProfileType = new WebInspector.CSSSelectorProfileType;32 31 this._canvasProfileType = new WebInspector.CanvasProfileType; 33 32 … … 61 60 62 61 this._recordingJavaScriptProfile = null; 63 this._recordingCSSSelectorProfile = null;64 62 this._recordingCanvasProfile = null; 65 63 66 64 this._isProfiling = false; 67 65 68 this._cssSelectorProfileType.reset();69 70 66 this.dispatchEventToListeners(WebInspector.ProfileManager.Event.Cleared); 71 67 }, … … 84 80 { 85 81 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));125 82 }, 126 83 … … 248 205 this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile}); 249 206 this._javaScriptProfileType.setRecordingProfile(false); 250 } else if (this._recordingCSSSelectorProfile) {251 this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCSSSelectorProfile});252 this._cssSelectorProfileType.setRecordingProfile(false);253 207 } else if (this._recordingCanvasProfile) { 254 208 this.dispatchEventToListeners(WebInspector.ProfileManager.Event.ProfilingInterrupted, {profile: this._recordingCanvasProfile}); … … 263 217 if (this._recordingJavaScriptProfile) 264 218 this.startProfilingJavaScript(); 265 else if (this._recordingCSSSelectorProfile)266 this.startProfilingCSSSelectors();267 219 else if (this._recordingCanvasProfile) 268 220 this.startProfilingCanvas(); -
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
r160655 r162084 306 306 <None Include="..\UserInterface\CSSProperty.js" /> 307 307 <None Include="..\UserInterface\CSSRule.js" /> 308 <None Include="..\UserInterface\CSSSelectorProfileObject.js" />309 <None Include="..\UserInterface\CSSSelectorProfileType.js" />310 <None Include="..\UserInterface\CSSSelectorProfileView.js" />311 308 <None Include="..\UserInterface\CSSStyleDeclaration.js" /> 312 309 <None Include="..\UserInterface\CSSStyleDeclarationSection.css" /> -
trunk/Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters
r160557 r162084 277 277 <Filter>UserInterface</Filter> 278 278 </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>288 279 <None Include="..\UserInterface\CSSStyleDeclaration.js"> 289 280 <Filter>UserInterface</Filter>
Note: See TracChangeset
for help on using the changeset viewer.