Bug 1358993 - (Part 3) Call ServoStyleSheet::ReparseSheet in inDOMUtils::ParseStyleSheet. r=heycam
authorKuoE0 <kuoe0.tw@gmail.com>
Thu, 25 May 2017 10:55:57 +0800
changeset 412799 b7dfffc23174d96c9f85ce362f96c3751be7d113
parent 412798 d617eb9b8f0593115f29213d38c82181043ceb01
child 412800 9d870a4f252676c11ccb0d6835bffc89ca3f6c15
child 412807 5b2a51457534b90f0d0325ced99a26bded26010c
child 412834 4a153e231a306587f5ef53b9bfc352d566648db3
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1358993
milestone55.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 1358993 - (Part 3) Call ServoStyleSheet::ReparseSheet in inDOMUtils::ParseStyleSheet. r=heycam MozReview-Commit-ID: KRDBy8k4lHa
layout/inspector/inDOMUtils.cpp
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -1364,20 +1364,29 @@ inDOMUtils::ClearPseudoClassLocks(nsIDOM
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 inDOMUtils::ParseStyleSheet(nsIDOMCSSStyleSheet *aSheet,
                             const nsAString& aInput)
 {
-  RefPtr<CSSStyleSheet> sheet = do_QueryObject(aSheet);
-  NS_ENSURE_ARG_POINTER(sheet);
+  RefPtr<CSSStyleSheet> geckoSheet = do_QueryObject(aSheet);
+  if (geckoSheet) {
+    NS_ENSURE_ARG_POINTER(geckoSheet);
+    return geckoSheet->ReparseSheet(aInput);
+  }
 
-  return sheet->ReparseSheet(aInput);
+  RefPtr<ServoStyleSheet> servoSheet = do_QueryObject(aSheet);
+  if (servoSheet) {
+    NS_ENSURE_ARG_POINTER(servoSheet);
+    return servoSheet->ReparseSheet(aInput);
+  }
+
+  return NS_ERROR_INVALID_POINTER;
 }
 
 NS_IMETHODIMP
 inDOMUtils::ScrollElementIntoView(nsIDOMElement *aElement)
 {
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
   NS_ENSURE_ARG_POINTER(content);