Bug 1304792: Minimal Loader and CSSParser cleanup. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 13 Dec 2016 12:14:36 +0100
changeset 450612 12842bada6e12b9f7a31d532c8edc11ef4983336
parent 450611 68bcd9b4cf53c8c4532499c5685402e51bc8a4d7
child 450613 e08073d52373a972ff45789985db2c2be8d84643
push id38922
push userbmo:emilio+bugs@crisal.io
push dateSat, 17 Dec 2016 10:01:32 +0000
Bug 1304792: Minimal Loader and CSSParser cleanup. MozReview-Commit-ID: DYOh8BtK7NT Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1421,18 +1421,16 @@ Loader::InsertChildSheet(StyleSheet* aSh
   // child sheets should always start out enabled, even if they got
   // cloned off of top-level sheets which were disabled
   aParentRule->SetSheet(aSheet->AsGecko()); // This sets the ownerRule on the sheet
   LOG(("  Inserting into parent sheet"));
-  //  LOG(("  Inserting into parent sheet at position %d", insertionPoint));
   return NS_OK;
  * LoadSheet handles the actual load of a sheet.  If the load is
  * supposed to be synchronous it just opens a channel synchronously
  * using the given uri, wraps the resulting stream in a converter
  * stream and calls ParseSheet.  Otherwise it tries to look for an
@@ -1986,17 +1984,17 @@ Loader::LoadInlineStyle(nsIContent* aEle
                         const nsAString& aTitle,
                         const nsAString& aMedia,
                         Element* aScopeElement,
                         nsICSSLoaderObserver* aObserver,
                         bool* aCompleted,
                         bool* aIsAlternate)
-  NS_ASSERTION(mParsingDatas.Length() == 0, "We're in the middle of a parse?");
+  MOZ_ASSERT(mParsingDatas.IsEmpty(), "We're in the middle of a parse?");
   *aCompleted = true;
   if (!mEnabled) {
     LOG_WARN(("  Not enabled"));
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -3791,18 +3791,18 @@ void
 CSSParserImpl::ProcessImport(const nsString& aURLSpec,
                              nsMediaList* aMedia,
                              RuleAppendFunc aAppendFunc,
                              void* aData,
                              uint32_t aLineNumber,
                              uint32_t aColumnNumber)
   RefPtr<css::ImportRule> rule = new css::ImportRule(aMedia, aURLSpec,
-                                                       aLineNumber,
-                                                       aColumnNumber);
+                                                     aLineNumber,
+                                                     aColumnNumber);
   (*aAppendFunc)(rule, aData);
   // Diagnose bad URIs even if we don't have a child loader.
   nsCOMPtr<nsIURI> url;
   // Charset will be deduced from mBaseURI, which is more or less correct.
   nsresult rv = NS_NewURI(getter_AddRefs(url), aURLSpec, nullptr, mBaseURI);
   if (NS_FAILED(rv)) {