Bug 1468780: Add labels to QuerySelector / QuerySelectorAll. r=mstange
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 14 Jun 2018 10:16:49 -0700
changeset 479321 f7a132050e9608f3ebbb1b45123a1847084d2940
parent 479320 e05d3484f97acb89c5e1b65b0737cd1418cac401
child 479322 c0c1dea29b1728bc69f13dd4cf0f2eb9756f29bf
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1468780
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468780: Add labels to QuerySelector / QuerySelectorAll. r=mstange It's very useful to see what the selector is in the profile. MozReview-Commit-ID: KRp6A91jzP
dom/base/nsINode.cpp
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -2485,28 +2485,34 @@ FindMatchingElementWithId(const nsAStrin
     }
   }
   return nullptr;
 }
 
 Element*
 nsINode::QuerySelector(const nsAString& aSelector, ErrorResult& aResult)
 {
+  AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING(
+      "nsINode::QuerySelector", DOM, aSelector);
+
   const RawServoSelectorList* list = ParseSelectorList(aSelector, aResult);
   if (!list) {
     return nullptr;
   }
   const bool useInvalidation = false;
   return const_cast<Element*>(
     Servo_SelectorList_QueryFirst(this, list, useInvalidation));
 }
 
 already_AddRefed<nsINodeList>
 nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
 {
+  AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING(
+      "nsINode::QuerySelectorAll", DOM, aSelector);
+
   RefPtr<nsSimpleContentList> contentList = new nsSimpleContentList(this);
   const RawServoSelectorList* list = ParseSelectorList(aSelector, aResult);
   if (!list) {
     return contentList.forget();
   }
 
   const bool useInvalidation = false;
   Servo_SelectorList_QueryAll(this, list, contentList.get(), useInvalidation);