Bug 1266248 part 1: Rename MapSinglePropertyInto() args, to make src-vs-target distinctions clearer. r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 21 Apr 2016 11:43:24 -0700
changeset 332241 91b6739888bf9fbb9dd2a92c0a7aa422b239ad15
parent 332240 b341e24b1241986591eb00866e2a8df584f7b4dc
child 332242 97a73074dc7cdf184edd8d615a6a0a2df20ab865
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1266248, 1208344
milestone48.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 1266248 part 1: Rename MapSinglePropertyInto() args, to make src-vs-target distinctions clearer. r=heycam (This commit is effectively re-landing changeset b3a36d79154f, aka bug 1208344 part 3. This re-landed version of the patch simply has unbitrotting fixes for indentation changes.) MozReview-Commit-ID: BszOC5wyvBA
layout/style/nsCSSDataBlock.cpp
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -120,56 +120,56 @@ ShouldStartImageLoads(nsRuleData *aRuleD
   //      where we wouldn't have started the load initially, which makes
   //      which links are visited detectable to Web pages (see bug
   //      557287)
   return !aRuleData->mStyleContext->IsStyleIfVisited() &&
          nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_START_IMAGE_LOADS);
 }
 
 static void
-MapSinglePropertyInto(nsCSSProperty aProp,
-                      const nsCSSValue* aValue,
-                      nsCSSValue* aTarget,
+MapSinglePropertyInto(nsCSSProperty aTargetProp,
+                      const nsCSSValue* aSrcValue,
+                      nsCSSValue* aTargetValue,
                       nsRuleData* aRuleData)
 {
-  MOZ_ASSERT(aValue->GetUnit() != eCSSUnit_Null, "oops");
+  MOZ_ASSERT(aSrcValue->GetUnit() != eCSSUnit_Null, "oops");
 
-  // Although aTarget is the nsCSSValue we are going to write into,
+  // Although aTargetValue is the nsCSSValue we are going to write into,
   // we also look at its value before writing into it.  This is done
-  // when aTarget is a token stream value, which is the case when we
+  // when aTargetValue is a token stream value, which is the case when we
   // have just re-parsed a property that had a variable reference (in
   // nsCSSParser::ParsePropertyWithVariableReferences).  TryToStartImageLoad
   // then records any resulting ImageValue objects in the
   // CSSVariableImageTable, to give them the appropriate lifetime.
-  MOZ_ASSERT(aTarget->GetUnit() == eCSSUnit_TokenStream ||
-             aTarget->GetUnit() == eCSSUnit_Null,
-             "aTarget must only be a token stream (when re-parsing "
+  MOZ_ASSERT(aTargetValue->GetUnit() == eCSSUnit_TokenStream ||
+             aTargetValue->GetUnit() == eCSSUnit_Null,
+             "aTargetValue must only be a token stream (when re-parsing "
              "properties with variable references) or null");
 
-  if (ShouldStartImageLoads(aRuleData, aProp)) {
+  if (ShouldStartImageLoads(aRuleData, aTargetProp)) {
     nsIDocument* doc = aRuleData->mPresContext->Document();
-    TryToStartImageLoad(*aValue, doc, aRuleData->mStyleContext,
-                        aProp,
-                        aTarget->GetUnit() == eCSSUnit_TokenStream);
+    TryToStartImageLoad(*aSrcValue, doc, aRuleData->mStyleContext,
+                        aTargetProp,
+                        aTargetValue->GetUnit() == eCSSUnit_TokenStream);
   }
-  *aTarget = *aValue;
-  if (nsCSSProps::PropHasFlags(aProp,
+  *aTargetValue = *aSrcValue;
+  if (nsCSSProps::PropHasFlags(aTargetProp,
         CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
       ShouldIgnoreColors(aRuleData))
   {
-    if (aProp == eCSSProperty_background_color) {
+    if (aTargetProp == eCSSProperty_background_color) {
       // Force non-'transparent' background
       // colors to the user's default.
-      if (aTarget->IsNonTransparentColor()) {
-        aTarget->SetColorValue(aRuleData->mPresContext->
-                               DefaultBackgroundColor());
+      if (aTargetValue->IsNonTransparentColor()) {
+        aTargetValue->SetColorValue(aRuleData->mPresContext->
+                                    DefaultBackgroundColor());
       }
     } else {
       // Ignore 'color', 'border-*-color', etc.
-      *aTarget = nsCSSValue();
+      *aTargetValue = nsCSSValue();
     }
   }
 }
 
 /**
  * If aProperty is a logical property, converts it to the equivalent physical
  * property based on writing mode information obtained from aRuleData's
  * style context.