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 410463 57ed35189e19d5c2095b10b98e5a98b42c1e6979
parent 410462 09a4620de25d4cf792e4187fec26a600eb2da97d
child 410464 0595e5ad5cb45b4de9489b22c494dfb5c247a7d3
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [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);