From dccbc0f8e44f7820d9eea9f93a11b5821ba8f48b Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 30 Dec 2015 23:36:31 -0800 Subject: [PATCH] Bug 1208344 part 1: Make EnsurePhysicalProperty() return the property directly, instead of using in/out-param. r=heycam --- layout/style/nsCSSDataBlock.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp index d2953eb13109..e8f50d0d1197 100644 --- a/layout/style/nsCSSDataBlock.cpp +++ b/layout/style/nsCSSDataBlock.cpp @@ -168,12 +168,12 @@ MapSinglePropertyInto(nsCSSProperty aProp, } /** - * If aProperty is a logical property, converts it to the equivalent physical + * If aProperty is a logical property, returns the equivalent physical * property based on writing mode information obtained from aRuleData's * style context. */ -static inline void -EnsurePhysicalProperty(nsCSSProperty& aProperty, nsRuleData* aRuleData) +static inline nsCSSProperty +EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData) { bool isAxisProperty = nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_AXIS); @@ -231,7 +231,7 @@ EnsurePhysicalProperty(nsCSSProperty& aProperty, nsRuleData* aRuleData) "unexpected logical group length"); } #endif - aProperty = props[index]; + return props[index]; } void @@ -252,7 +252,7 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const if (nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[iProp]) & aRuleData->mSIDs) { if (nsCSSProps::PropHasFlags(iProp, CSS_PROPERTY_LOGICAL)) { - EnsurePhysicalProperty(iProp, aRuleData); + iProp = EnsurePhysicalProperty(iProp, aRuleData); // We can't cache anything on the rule tree if we use any data from // the style context, since data cached in the rule tree could be // used with a style context with a different value. @@ -715,7 +715,7 @@ nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSProperty aPropID, nsCSSProperty physicalProp = aPropID; if (nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_LOGICAL)) { - EnsurePhysicalProperty(physicalProp, aRuleData); + physicalProp = EnsurePhysicalProperty(physicalProp, aRuleData); uint8_t wm = WritingMode(aRuleData->mStyleContext).GetBits(); aRuleData->mConditions.SetWritingModeDependency(wm); }