Bug 1304792: Minimal Loader and CSSParser cleanup. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 13 Dec 2016 12:14:36 +0100
changeset 454553 3b6992f9c1d3c12eb80ed71c79b5b59e838f314e
parent 454380 94459122fed6b6fbfa5c73c6b1eed0e75d09e357
child 454554 c472a313eb5d62fe2b8d7d5814f53a399a0a9a97
push id39971
push userbmo:emilio+bugs@crisal.io
push dateThu, 29 Dec 2016 17:39:02 +0000
reviewersheycam
bugs1304792
milestone53.0a1
Bug 1304792: Minimal Loader and CSSParser cleanup. r?heycam MozReview-Commit-ID: DYOh8BtK7NT
layout/style/Loader.cpp
layout/style/nsCSSParser.cpp
--- 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
   aSheet->AsGecko()->SetEnabled(true);
 
   aParentSheet->AppendStyleSheet(aSheet);
   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)
 {
   LOG(("css::Loader::LoadInlineStyle"));
-  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"));
     return NS_ERROR_NOT_AVAILABLE;
   }
 
--- 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)) {