--- a/dom/animation/AnimValuesStyleRule.h
+++ b/dom/animation/AnimValuesStyleRule.h
@@ -3,17 +3,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_AnimValuesStyleRule_h
#define mozilla_AnimValuesStyleRule_h
#include "mozilla/StyleAnimationValue.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSPropertySet.h"
#include "nsIStyleRule.h"
#include "nsISupportsImpl.h" // For NS_DECL_ISUPPORTS
#include "nsRuleNode.h" // For nsCachedStyleData
#include "nsTArray.h" // For nsTArray
namespace mozilla {
@@ -31,25 +31,25 @@ public:
// nsIStyleRule implementation
void MapRuleInfoInto(nsRuleData* aRuleData) override;
bool MightMapInheritedStyleData() override;
#ifdef DEBUG
void List(FILE* out = stdout, int32_t aIndent = 0) const override;
#endif
- void AddValue(nsCSSProperty aProperty, const StyleAnimationValue &aStartValue)
+ void AddValue(nsCSSPropertyID aProperty, const StyleAnimationValue &aStartValue)
{
PropertyStyleAnimationValuePair pair = { aProperty, aStartValue };
mPropertyValuePairs.AppendElement(pair);
mStyleBits |=
nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]);
}
- void AddValue(nsCSSProperty aProperty, StyleAnimationValue&& aStartValue)
+ void AddValue(nsCSSPropertyID aProperty, StyleAnimationValue&& aStartValue)
{
PropertyStyleAnimationValuePair* pair = mPropertyValuePairs.AppendElement();
pair->mProperty = aProperty;
pair->mValue = Move(aStartValue);
mStyleBits |=
nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]);
}
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -13,17 +13,17 @@
#include "mozilla/EffectCompositor.h" // For EffectCompositor::CascadeLevel
#include "mozilla/LinkedList.h"
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
#include "mozilla/dom/AnimationBinding.h" // for AnimationPlayState
#include "mozilla/dom/AnimationTimeline.h" // for AnimationTimeline
#include "mozilla/DOMEventTargetHelper.h" // for DOMEventTargetHelper
#include "mozilla/dom/KeyframeEffect.h" // for KeyframeEffectReadOnly
#include "mozilla/dom/Promise.h" // for Promise
-#include "nsCSSProperty.h" // for nsCSSProperty
+#include "nsCSSPropertyID.h" // for nsCSSPropertyID
#include "nsIGlobalObject.h"
// X11 has a #define for CurrentTime.
#ifdef CurrentTime
#undef CurrentTime
#endif
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -56,17 +56,17 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(E
// Helper function to factor out the common logic from
// GetAnimationsForCompositor and HasAnimationsForCompositor.
//
// Takes an optional array to fill with eligible animations.
//
// Returns true if there are eligible animations, false otherwise.
bool
FindAnimationsForCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsTArray<RefPtr<dom::Animation>>* aMatches /*out*/)
{
MOZ_ASSERT(!aMatches || aMatches->IsEmpty(),
"Matches array, if provided, should be empty");
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects || effects->IsEmpty()) {
return false;
@@ -428,40 +428,40 @@ EffectCompositor::AddStyleUpdatesTo(Rest
elementSet.Clear();
// Note: mElement pointers in elementsToRestyle might now dangle
}
}
/* static */ bool
EffectCompositor::HasAnimationsForCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
return FindAnimationsForCompositor(aFrame, aProperty, nullptr);
}
/* static */ nsTArray<RefPtr<dom::Animation>>
EffectCompositor::GetAnimationsForCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
nsTArray<RefPtr<dom::Animation>> result;
#ifdef DEBUG
bool foundSome =
#endif
FindAnimationsForCompositor(aFrame, aProperty, &result);
MOZ_ASSERT(!foundSome || !result.IsEmpty(),
"If return value is true, matches array should be non-empty");
return result;
}
/* static */ void
EffectCompositor::ClearIsRunningOnCompositor(const nsIFrame *aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects) {
return;
}
for (KeyframeEffectReadOnly* effect : *effects) {
effect->SetIsRunningOnCompositor(aProperty, false);
@@ -611,17 +611,17 @@ EffectCompositor::ComposeAnimationRule(d
}
/* static */ void
EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
EffectSet& aEffectSet,
nsCSSPropertySet&
aPropertiesOverridden)
{
- AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
+ AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertySet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {
for (const AnimationProperty& property : effect->Properties()) {
if (nsCSSProps::PropHasFlags(property.mProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
!propertiesToTrackAsSet.HasProperty(property.mProperty)) {
propertiesToTrackAsSet.AddProperty(property.mProperty);
@@ -743,17 +743,17 @@ EffectCompositor::GetPresContext(Element
return nullptr;
}
return shell->GetPresContext();
}
/* static */ void
EffectCompositor::SetPerformanceWarning(
const nsIFrame *aFrame,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const AnimationPerformanceWarning& aWarning)
{
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects) {
return;
}
for (KeyframeEffectReadOnly* effect : *effects) {
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -7,17 +7,17 @@
#ifndef mozilla_EffectCompositor_h
#define mozilla_EffectCompositor_h
#include "mozilla/EnumeratedArray.h"
#include "mozilla/Maybe.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/PseudoElementHashEntry.h"
#include "mozilla/RefPtr.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDataHashtable.h"
#include "nsIStyleRuleProcessor.h"
#include "nsTArray.h"
class nsCSSPropertySet;
class nsIFrame;
class nsIStyleRule;
@@ -157,24 +157,24 @@ public:
void AddStyleUpdatesTo(RestyleTracker& aTracker);
nsIStyleRuleProcessor* RuleProcessor(CascadeLevel aCascadeLevel) const
{
return mRuleProcessors[aCascadeLevel];
}
static bool HasAnimationsForCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
static nsTArray<RefPtr<dom::Animation>>
GetAnimationsForCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
static void ClearIsRunningOnCompositor(const nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
// Update animation cascade results for the specified (pseudo-)element
// but only if we have marked the cascade as needing an update due a
// the change in the set of effects or a change in one of the effects'
// "in effect" state.
// |aStyleContext| may be nullptr in which case we will use the
// nsStyleContext of the primary frame of the specified (pseudo-)element.
//
@@ -207,17 +207,17 @@ public:
// animations.
static Maybe<NonOwningAnimationTarget>
GetAnimationElementAndPseudoForFrame(const nsIFrame* aFrame);
// Associates a performance warning with effects on |aFrame| that animates
// |aProperty|.
static void SetPerformanceWarning(
const nsIFrame* aFrame,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const AnimationPerformanceWarning& aWarning);
private:
~EffectCompositor() = default;
// Rebuilds the animation rule corresponding to |aCascadeLevel| on the
// EffectSet associated with the specified (pseudo-)element.
static void ComposeAnimationRule(dom::Element* aElement,
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -487,17 +487,17 @@ KeyframeEffectReadOnly::SetKeyframes(nsT
if (aStyleContext) {
UpdateProperties(aStyleContext);
MaybeUpdateFrameForCompositor();
}
}
const AnimationProperty*
-KeyframeEffectReadOnly::GetAnimationOfProperty(nsCSSProperty aProperty) const
+KeyframeEffectReadOnly::GetAnimationOfProperty(nsCSSPropertyID aProperty) const
{
for (size_t propIdx = 0, propEnd = mProperties.Length();
propIdx != propEnd; ++propIdx) {
if (aProperty == mProperties[propIdx].mProperty) {
const AnimationProperty* result = &mProperties[propIdx];
if (!result->mWinsInCascade) {
result = nullptr;
}
@@ -720,17 +720,17 @@ KeyframeEffectReadOnly::IsRunningOnCompo
if (property.mIsRunningOnCompositor) {
return true;
}
}
return false;
}
void
-KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSProperty aProperty,
+KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSPropertyID aProperty,
bool aIsRunning)
{
MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
"Property being animated on compositor is a recognized "
"compositor-animatable property");
for (AnimationProperty& property : mProperties) {
if (property.mProperty == aProperty) {
@@ -1000,17 +1000,17 @@ KeyframeEffectReadOnly::GetTarget(
default:
NS_NOTREACHED("Animation of unsupported pseudo-type");
aRv.SetNull();
}
}
static void
-CreatePropertyValue(nsCSSProperty aProperty,
+CreatePropertyValue(nsCSSPropertyID aProperty,
float aOffset,
const Maybe<ComputedTimingFunction>& aTimingFunction,
const StyleAnimationValue& aValue,
AnimationPropertyValueDetails& aResult)
{
aResult.mOffset = aOffset;
nsString stringValue;
@@ -1127,17 +1127,17 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
JS::Rooted<JSObject*> keyframeObject(aCx, &keyframeJSValue.toObject());
for (const PropertyValuePair& propertyValue : keyframe.mPropertyValues) {
const char* name = nsCSSProps::PropertyIDLName(propertyValue.mProperty);
// nsCSSValue::AppendToString does not accept shorthands properties but
// works with token stream values if we pass eCSSProperty_UNKNOWN as
// the property.
- nsCSSProperty propertyForSerializing =
+ nsCSSPropertyID propertyForSerializing =
nsCSSProps::IsShorthand(propertyValue.mProperty)
? eCSSProperty_UNKNOWN
: propertyValue.mProperty;
nsAutoString stringValue;
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
@@ -1347,17 +1347,17 @@ KeyframeEffectReadOnly::GetPresContext()
if (!shell) {
return nullptr;
}
return shell->GetPresContext();
}
/* static */ bool
KeyframeEffectReadOnly::IsGeometricProperty(
- const nsCSSProperty aProperty)
+ const nsCSSPropertyID aProperty)
{
switch (aProperty) {
case eCSSProperty_bottom:
case eCSSProperty_height:
case eCSSProperty_left:
case eCSSProperty_right:
case eCSSProperty_top:
case eCSSProperty_width:
@@ -1433,17 +1433,17 @@ KeyframeEffectReadOnly::ShouldBlockAsync
}
}
return false;
}
void
KeyframeEffectReadOnly::SetPerformanceWarning(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const AnimationPerformanceWarning& aWarning)
{
for (AnimationProperty& property : mProperties) {
if (property.mProperty == aProperty &&
(!property.mPerformanceWarning ||
*property.mPerformanceWarning != aWarning)) {
property.mPerformanceWarning = Some(aWarning);
@@ -1454,17 +1454,17 @@ KeyframeEffectReadOnly::SetPerformanceWa
AnimationUtils::LogAsyncAnimationFailure(logMessage, mTarget->mElement);
}
return;
}
}
}
static already_AddRefed<nsStyleContext>
-CreateStyleContextForAnimationValue(nsCSSProperty aProperty,
+CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
StyleAnimationValue aValue,
nsStyleContext* aBaseStyleContext)
{
MOZ_ASSERT(aBaseStyleContext,
"CreateStyleContextForAnimationValue needs to be called "
"with a valid nsStyleContext");
RefPtr<AnimValuesStyleRule> styleRule = new AnimValuesStyleRule();
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -3,17 +3,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_KeyframeEffect_h
#define mozilla_dom_KeyframeEffect_h
#include "nsChangeHint.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
#include "nsCycleCollectionParticipant.h"
#include "nsTArray.h"
#include "nsWrapperCache.h"
#include "mozilla/AnimationPerformanceWarning.h"
#include "mozilla/AnimationTarget.h"
#include "mozilla/Attributes.h"
#include "mozilla/ComputedTiming.h"
@@ -54,17 +54,17 @@ enum class CompositeOperation : uint32_t
struct AnimationPropertyDetails;
}
/**
* A property-value pair specified on a keyframe.
*/
struct PropertyValuePair
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
// The specified value for the property. For shorthand properties or invalid
// property values, we store the specified property value as a token stream
// (string).
nsCSSValue mValue;
bool operator==(const PropertyValuePair& aOther) const {
return mProperty == aOther.mProperty &&
mValue == aOther.mValue;
@@ -129,17 +129,17 @@ struct AnimationPropertySegment
}
bool operator!=(const AnimationPropertySegment& aOther) const {
return !(*this == aOther);
}
};
struct AnimationProperty
{
- nsCSSProperty mProperty = eCSSProperty_UNKNOWN;
+ nsCSSPropertyID mProperty = eCSSProperty_UNKNOWN;
// Does this property win in the CSS Cascade?
//
// For CSS transitions, this is true as long as a CSS animation on the
// same property and element is not running, in which case we set this
// to false so that the animation (lower in the cascade) can win. We
// then use this to decide whether to apply the style both in the CSS
// cascade and for OMTA.
@@ -285,18 +285,18 @@ public:
void SetAnimation(Animation* aAnimation);
Animation* GetAnimation() const { return mAnimation; }
void SetKeyframes(JSContext* aContext, JS::Handle<JSObject*> aKeyframes,
ErrorResult& aRv);
void SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
nsStyleContext* aStyleContext);
const AnimationProperty*
- GetAnimationOfProperty(nsCSSProperty aProperty) const;
- bool HasAnimationOfProperty(nsCSSProperty aProperty) const {
+ GetAnimationOfProperty(nsCSSPropertyID aProperty) const;
+ bool HasAnimationOfProperty(nsCSSPropertyID aProperty) const {
return GetAnimationOfProperty(aProperty) != nullptr;
}
const InfallibleTArray<AnimationProperty>& Properties() const {
return mProperties;
}
InfallibleTArray<AnimationProperty>& Properties() {
return mProperties;
}
@@ -308,17 +308,17 @@ public:
// Updates |aStyleRule| with the animation values produced by this
// AnimationEffect for the current time except any properties already
// contained in |aSetProperties|.
// Any updated properties are added to |aSetProperties|.
void ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
nsCSSPropertySet& aSetProperties);
// Returns true if at least one property is being animated on compositor.
bool IsRunningOnCompositor() const;
- void SetIsRunningOnCompositor(nsCSSProperty aProperty, bool aIsRunning);
+ void SetIsRunningOnCompositor(nsCSSPropertyID aProperty, bool aIsRunning);
void ResetIsRunningOnCompositor();
// Returns true if this effect, applied to |aFrame|, contains properties
// that mean we shouldn't run transform compositor animations on this element.
//
// For example, if we have an animation of geometric properties like 'left'
// and 'top' on an element, we force all 'transform' animations running at
// the same time on the same element to run on the main thread.
@@ -333,17 +333,17 @@ public:
nsPresContext* GetPresContext() const;
nsIPresShell* GetPresShell() const;
// Associates a warning with the animated property on the specified frame
// indicating why, for example, the property could not be animated on the
// compositor. |aParams| and |aParamsLength| are optional parameters which
// will be used to generate a localized message for devtools.
void SetPerformanceWarning(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const AnimationPerformanceWarning& aWarning);
// Cumulative change hint on each segment for each property.
// This is used for deciding the animation is paint-only.
void CalculateCumulativeChangeHint(nsStyleContext* aStyleContext);
// Returns true if all of animation properties' change hints
// can ignore painting if the animation is not visible.
@@ -429,17 +429,17 @@ private:
bool CanThrottleTransformChanges(nsIFrame& aFrame) const;
// Returns true unless Gecko limitations prevent performing transform
// animations for |aFrame|. When returning true, the reason for the
// limitation is stored in |aOutPerformanceWarning|.
static bool CanAnimateTransformOnCompositor(
const nsIFrame* aFrame,
AnimationPerformanceWarning::Type& aPerformanceWarning);
- static bool IsGeometricProperty(const nsCSSProperty aProperty);
+ static bool IsGeometricProperty(const nsCSSPropertyID aProperty);
static const TimeDuration OverflowRegionRefreshInterval();
};
class KeyframeEffect : public KeyframeEffectReadOnly
{
public:
KeyframeEffect(nsIDocument* aDocument,
--- a/dom/animation/KeyframeEffectParams.cpp
+++ b/dom/animation/KeyframeEffectParams.cpp
@@ -100,17 +100,17 @@ ConsumeIdentToken(RangedPtr<const char16
}
++aIter;
}
}
/* static */ void
KeyframeEffectParams::ParseSpacing(const nsAString& aSpacing,
SpacingMode& aSpacingMode,
- nsCSSProperty& aPacedProperty,
+ nsCSSPropertyID& aPacedProperty,
nsAString& aInvalidPacedProperty,
ErrorResult& aRv)
{
aInvalidPacedProperty.Truncate();
// Parse spacing.
// distribute | paced({ident})
// https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-spacing
--- a/dom/animation/KeyframeEffectParams.h
+++ b/dom/animation/KeyframeEffectParams.h
@@ -40,21 +40,21 @@ struct KeyframeEffectParams
* @param [out] aInvalidPacedProperty A string that, if we parsed a string of
* the form 'paced(<ident>)' where <ident>
* is not a recognized animatable property,
* will be set to <ident>.
* @param [out] aRv The error result.
*/
static void ParseSpacing(const nsAString& aSpacing,
SpacingMode& aSpacingMode,
- nsCSSProperty& aPacedProperty,
+ nsCSSPropertyID& aPacedProperty,
nsAString& aInvalidPacedProperty,
ErrorResult& aRv);
// FIXME: Bug 1216843: Add IterationCompositeOperations and
// Bug 1216844: Add CompositeOperation
SpacingMode mSpacingMode = SpacingMode::distribute;
- nsCSSProperty mPacedProperty = eCSSProperty_UNKNOWN;
+ nsCSSPropertyID mPacedProperty = eCSSProperty_UNKNOWN;
};
} // namespace mozilla
#endif // mozilla_KeyframeEffectParams_h
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -34,17 +34,17 @@ namespace mozilla {
// we set its cumulative distance to kNotPaceable, so we can use this to check.
const double kNotPaceable = -1.0;
// For the aAllowList parameter of AppendStringOrStringSequence and
// GetPropertyValuesPairs.
enum class ListAllowance { eDisallow, eAllow };
/**
- * A comparator to sort nsCSSProperty values such that longhands are sorted
+ * A comparator to sort nsCSSPropertyID values such that longhands are sorted
* before shorthands, and shorthands with fewer components are sorted before
* shorthands with more components.
*
* Using this allows us to prioritize values specified by longhands (or smaller
* shorthand subsets) when longhands and shorthands are both specified
* on the one keyframe.
*
* Example orderings that result from this:
@@ -56,23 +56,23 @@ enum class ListAllowance { eDisallow, eA
* border-top-color, border-color, border-top, border
*/
class PropertyPriorityComparator
{
public:
PropertyPriorityComparator()
: mSubpropertyCountInitialized(false) {}
- bool Equals(nsCSSProperty aLhs, nsCSSProperty aRhs) const
+ bool Equals(nsCSSPropertyID aLhs, nsCSSPropertyID aRhs) const
{
return aLhs == aRhs;
}
- bool LessThan(nsCSSProperty aLhs,
- nsCSSProperty aRhs) const
+ bool LessThan(nsCSSPropertyID aLhs,
+ nsCSSPropertyID aRhs) const
{
bool isShorthandLhs = nsCSSProps::IsShorthand(aLhs);
bool isShorthandRhs = nsCSSProps::IsShorthand(aRhs);
if (isShorthandLhs) {
if (isShorthandRhs) {
// First, sort shorthands by the number of longhands they have.
uint32_t subpropCountLhs = SubpropertyCount(aLhs);
@@ -92,17 +92,17 @@ public:
}
}
// For two longhand properties, or two shorthand with the same number
// of longhand components, sort by IDL name.
return nsCSSProps::PropertyIDLNameSortPosition(aLhs) <
nsCSSProps::PropertyIDLNameSortPosition(aRhs);
}
- uint32_t SubpropertyCount(nsCSSProperty aProperty) const
+ uint32_t SubpropertyCount(nsCSSPropertyID aProperty) const
{
if (!mSubpropertyCountInitialized) {
PodZero(&mSubpropertyCount);
mSubpropertyCountInitialized = true;
}
if (mSubpropertyCount[aProperty] == 0) {
uint32_t count = 0;
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
@@ -200,17 +200,17 @@ public:
};
Iter begin() { return Iter(*this); }
Iter end() { return Iter::EndIter(*this); }
private:
struct PropertyAndIndex
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
size_t mIndex; // Index of mProperty within mProperties
typedef TPropertyPriorityComparator<PropertyAndIndex> Comparator;
};
const nsTArray<PropertyValuePair>& mProperties;
nsTArray<PropertyAndIndex> mSortedPropertyIndices;
};
@@ -220,29 +220,29 @@ private:
* discovered on a regular keyframe or property-indexed keyframe object.
*
* Single values (as required by a regular keyframe, and as also supported
* on property-indexed keyframes) are stored as the only element in
* mValues.
*/
struct PropertyValuesPair
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
nsTArray<nsString> mValues;
typedef TPropertyPriorityComparator<PropertyValuesPair> Comparator;
};
/**
* An additional property (for a property-values pair) found on a
* BaseKeyframe or BasePropertyIndexedKeyframe object.
*/
struct AdditionalProperty
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
size_t mJsidIndex; // Index into |ids| in GetPropertyValuesPairs.
struct PropertyComparator
{
bool Equals(const AdditionalProperty& aLhs,
const AdditionalProperty& aRhs) const
{
return aLhs.mProperty == aRhs.mProperty;
@@ -260,17 +260,17 @@ struct AdditionalProperty
* Data for a segment in a keyframe animation of a given property
* whose value is a StyleAnimationValue.
*
* KeyframeValueEntry is used in GetAnimationPropertiesFromKeyframes
* to gather data for each individual segment.
*/
struct KeyframeValueEntry
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
StyleAnimationValue mValue;
float mOffset;
Maybe<ComputedTimingFunction> mTimingFunction;
struct PropertyOffsetComparator
{
static bool Equals(const KeyframeValueEntry& aLhs,
const KeyframeValueEntry& aRhs)
@@ -365,17 +365,17 @@ AppendStringOrStringSequenceToArray(JSCo
nsTArray<nsString>& aValues);
static bool
AppendValueAsString(JSContext* aCx,
nsTArray<nsString>& aValues,
JS::Handle<JS::Value> aValue);
static PropertyValuePair
-MakePropertyValuePair(nsCSSProperty aProperty, const nsAString& aStringValue,
+MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
nsCSSParser& aParser, nsIDocument* aDocument);
static bool
HasValidOffsets(const nsTArray<Keyframe>& aKeyframes);
static void
MarkAsComputeValuesFailureKey(PropertyValuePair& aPair);
@@ -406,17 +406,17 @@ static void
DistributeRange(const Range<Keyframe>& aSpacingRange);
static void
PaceRange(const Range<Keyframe>& aKeyframes,
const Range<double>& aCumulativeDistances);
static nsTArray<double>
GetCumulativeDistances(const nsTArray<ComputedKeyframeValues>& aValues,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
// ------------------------------------------------------------------
//
// Public API
//
// ------------------------------------------------------------------
/* static */ nsTArray<Keyframe>
@@ -469,17 +469,17 @@ KeyframeUtils::GetKeyframesFromObject(JS
}
return keyframes;
}
/* static */ void
KeyframeUtils::ApplySpacing(nsTArray<Keyframe>& aKeyframes,
SpacingMode aSpacingMode,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsTArray<ComputedKeyframeValues>& aComputedValues)
{
if (aKeyframes.IsEmpty()) {
return;
}
nsTArray<double> cumulativeDistances;
if (aSpacingMode == SpacingMode::paced) {
@@ -667,17 +667,17 @@ KeyframeUtils::GetAnimationPropertiesFro
}
nsTArray<AnimationProperty> result;
BuildSegmentsFromValueEntries(aStyleContext, entries, result);
return result;
}
/* static */ bool
-KeyframeUtils::IsAnimatableProperty(nsCSSProperty aProperty)
+KeyframeUtils::IsAnimatableProperty(nsCSSPropertyID aProperty)
{
if (aProperty == eCSSProperty_UNKNOWN) {
return false;
}
if (!nsCSSProps::IsShorthand(aProperty)) {
return nsCSSProps::kAnimTypeTable[aProperty] != eStyleAnimType_None;
}
@@ -858,17 +858,17 @@ GetPropertyValuesPairs(JSContext* aCx,
if (!JS_Enumerate(aCx, aObject, &ids)) {
return false;
}
for (size_t i = 0, n = ids.length(); i < n; i++) {
nsAutoJSString propName;
if (!propName.init(aCx, ids[i])) {
return false;
}
- nsCSSProperty property =
+ nsCSSPropertyID property =
nsCSSProps::LookupPropertyByIDLName(propName,
CSSEnabledState::eForAllContent);
if (KeyframeUtils::IsAnimatableProperty(property)) {
AdditionalProperty* p = properties.AppendElement();
p->mProperty = property;
p->mJsidIndex = i;
}
}
@@ -959,17 +959,17 @@ AppendValueAsString(JSContext* aCx,
*
* @param aProperty The CSS property.
* @param aStringValue The property value to parse.
* @param aParser The CSS parser object to use.
* @param aDocument The document to use when parsing.
* @return The constructed PropertyValuePair object.
*/
static PropertyValuePair
-MakePropertyValuePair(nsCSSProperty aProperty, const nsAString& aStringValue,
+MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
nsCSSParser& aParser, nsIDocument* aDocument)
{
MOZ_ASSERT(aDocument);
nsCSSValue value;
if (!nsCSSProps::IsShorthand(aProperty)) {
aParser.ParseLonghandProperty(aProperty,
aStringValue,
@@ -1111,17 +1111,17 @@ BuildSegmentsFromValueEntries(nsStyleCon
// one KeyframeValueEntry with offset 0.0, and at least one with offset 1.0.
// However, since it is possible that when building |aEntries|, the call to
// StyleAnimationValue::ComputeValues might fail, this can't be guaranteed.
// Furthermore, since we don't yet implement additive animation and hence
// don't have sensible fallback behavior when these values are missing, the
// following loop takes care to identify properties that lack a value at
// offset 0.0/1.0 and drops those properties from |aResult|.
- nsCSSProperty lastProperty = eCSSProperty_UNKNOWN;
+ nsCSSPropertyID lastProperty = eCSSProperty_UNKNOWN;
AnimationProperty* animationProperty = nullptr;
size_t i = 0, n = aEntries.Length();
while (i < n) {
// Check that the last property ends with an entry at offset 1.
if (i + 1 == n) {
if (aEntries[i].mOffset != 1.0f && animationProperty) {
@@ -1330,17 +1330,17 @@ RequiresAdditiveAnimation(const nsTArray
// This is only a temporary measure until we implement additive animation.
// So as long as this check catches most cases, and we don't do anything
// horrible in one of the cases we can't detect, it should be sufficient.
nsCSSPropertySet properties; // All properties encountered.
nsCSSPropertySet propertiesWithFromValue; // Those with a defined 0% value.
nsCSSPropertySet propertiesWithToValue; // Those with a defined 100% value.
- auto addToPropertySets = [&](nsCSSProperty aProperty, double aOffset) {
+ auto addToPropertySets = [&](nsCSSPropertyID aProperty, double aOffset) {
properties.AddProperty(aProperty);
if (aOffset == 0.0) {
propertiesWithFromValue.AddProperty(aProperty);
} else if (aOffset == 1.0) {
propertiesWithToValue.AddProperty(aProperty);
}
};
@@ -1495,17 +1495,17 @@ PaceRange(const Range<Keyframe>& aKeyfra
*
* @param aValues The computed values returned by GetComputedKeyframeValues.
* @param aPacedProperty The paced property.
* @return The cumulative distances for the paced property. The length will be
* the same as aValues.
*/
static nsTArray<double>
GetCumulativeDistances(const nsTArray<ComputedKeyframeValues>& aValues,
- nsCSSProperty aPacedProperty)
+ nsCSSPropertyID aPacedProperty)
{
// a) If aPacedProperty is a shorthand property, get its components.
// Otherwise, just add the longhand property into the set.
size_t pacedPropertyCount = 0;
nsCSSPropertySet pacedPropertySet;
bool isShorthand = nsCSSProps::IsShorthand(aPacedProperty);
if (isShorthand) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPacedProperty,
@@ -1547,17 +1547,17 @@ GetCumulativeDistances(const nsTArray<Co
// This is the first paceable keyframe so its cumulative distance is 0.0.
cumulativeDistances[i] = 0.0;
} else {
double dist = 0.0;
if (isShorthand) {
// Apply the distance by the square root of the sum of squares of
// longhand component distances.
for (size_t propIdx = 0; propIdx < pacedPropertyCount; ++propIdx) {
- nsCSSProperty prop = prevPacedValues[propIdx].mProperty;
+ nsCSSPropertyID prop = prevPacedValues[propIdx].mProperty;
MOZ_ASSERT(pacedValues[propIdx].mProperty == prop,
"Property mismatch");
double componentDistance = 0.0;
if (StyleAnimationValue::ComputeDistance(
prop,
prevPacedValues[propIdx].mValue,
pacedValues[propIdx].mValue,
--- a/dom/animation/KeyframeUtils.h
+++ b/dom/animation/KeyframeUtils.h
@@ -93,17 +93,17 @@ public:
* any value, e.g. eCSSProperty_UNKNOWN.
* @param aComputedValues The set of computed keyframe values as returned by
* GetComputedKeyframeValues. Only used when |aSpacingMode| is
* SpacingMode::paced. In all other cases this parameter is unused and may
* be any value including an empty array.
*/
static void ApplySpacing(nsTArray<Keyframe>& aKeyframes,
SpacingMode aSpacingMode,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsTArray<ComputedKeyframeValues>& aComputedValues);
/**
* Wrapper for ApplySpacing to simplify using distribute spacing.
*
* @param aKeyframes The set of keyframes to adjust.
*/
static void ApplyDistributeSpacing(nsTArray<Keyframe>& aKeyframes);
@@ -132,14 +132,14 @@ public:
/**
* Check if the property or, for shorthands, one or more of
* its subproperties, is animatable.
*
* @param aProperty The property to check.
* @return true if |aProperty| is animatable.
*/
- static bool IsAnimatableProperty(nsCSSProperty aProperty);
+ static bool IsAnimatableProperty(nsCSSPropertyID aProperty);
};
} // namespace mozilla
#endif // mozilla_KeyframeUtils_h
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2410,17 +2410,17 @@ nsDOMWindowUtils::BeginTabSwitch()
return NS_ERROR_FAILURE;
mgr->BeginTabSwitch();
return NS_OK;
}
static bool
-ComputeAnimationValue(nsCSSProperty aProperty,
+ComputeAnimationValue(nsCSSPropertyID aProperty,
Element* aElement,
const nsAString& aInput,
StyleAnimationValue& aOutput)
{
nsIDocument* doc = aElement->GetUncomposedDoc();
nsIPresShell* shell = doc->GetShell();
if (!shell) {
return false;
@@ -2670,17 +2670,17 @@ nsDOMWindowUtils::ComputeAnimationDistan
const nsAString& aValue1,
const nsAString& aValue2,
double* aResult)
{
nsresult rv;
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement, &rv);
NS_ENSURE_SUCCESS(rv, rv);
- nsCSSProperty property =
+ nsCSSPropertyID property =
nsCSSProps::LookupProperty(aProperty, CSSEnabledState::eIgnoreEnabledState);
if (property != eCSSProperty_UNKNOWN && nsCSSProps::IsShorthand(property)) {
property = eCSSProperty_UNKNOWN;
}
MOZ_ASSERT(property == eCSSProperty_UNKNOWN ||
!nsCSSProps::IsShorthand(property),
"should not have shorthand");
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -7,17 +7,17 @@
#include "nsTreeSanitizer.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/StyleRule.h"
#include "mozilla/css/Rule.h"
#include "nsCSSParser.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsUnicharInputStream.h"
#include "nsIDOMCSSRule.h"
#include "nsAttrName.h"
#include "nsIScriptSecurityManager.h"
#include "nsNetUtil.h"
#include "nsComponentManagerUtils.h"
#include "nsNullPrincipal.h"
#include "nsContentUtils.h"
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -2359,18 +2359,18 @@ CanvasRenderingContext2D::SetShadowColor
}
//
// filters
//
static already_AddRefed<Declaration>
CreateDeclaration(nsINode* aNode,
- const nsCSSProperty aProp1, const nsAString& aValue1, bool* aChanged1,
- const nsCSSProperty aProp2, const nsAString& aValue2, bool* aChanged2)
+ const nsCSSPropertyID aProp1, const nsAString& aValue1, bool* aChanged1,
+ const nsCSSPropertyID aProp2, const nsAString& aValue2, bool* aChanged2)
{
nsIPrincipal* principal = aNode->NodePrincipal();
nsIDocument* document = aNode->OwnerDoc();
nsIURI* docURL = document->GetDocumentURI();
nsIURI* baseURL = document->GetDocBaseURI();
// Pass the CSS Loader object to the parser, to allow parser error reports
@@ -2445,17 +2445,17 @@ GetFontParentStyleContext(Element* aElem
if (!result) {
aError.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return result.forget();
}
static bool
-PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSProperty aProperty)
+PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSPropertyID aProperty)
{
// We know the declaration is not !important, so we can use
// GetNormalBlock().
const nsCSSValue* filterVal =
aDeclaration->GetNormalBlock()->ValueFor(aProperty);
return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset ||
filterVal->GetUnit() == eCSSUnit_Inherit ||
filterVal->GetUnit() == eCSSUnit_Initial));
--- a/dom/html/HTMLHRElement.cpp
+++ b/dom/html/HTMLHRElement.cpp
@@ -201,17 +201,17 @@ HTMLHRElement::MapAttributesIntoRule(con
borderLeftStyle->SetIntValue(NS_STYLE_BORDER_STYLE_SOLID,
eCSSUnit_Enumerated);
}
// If it would be noticeable, set the border radius to
// 10000px on all corners; this triggers the clamping to make
// circular ends. This assumes the <hr> isn't larger than
// that in *both* dimensions.
- for (const nsCSSProperty* props =
+ for (const nsCSSPropertyID* props =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
*props != eCSSProperty_UNKNOWN; ++props) {
nsCSSValue* dimen = aData->ValueFor(*props);
if (dimen->GetUnit() == eCSSUnit_Null) {
dimen->SetFloatValue(10000.0f, eCSSUnit_Pixel);
}
}
}
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -688,17 +688,17 @@ nsSMILAnimationController::GetTargetIden
if (attributeType == eSMILTargetAttrType_auto) {
if (attributeNamespaceID == kNameSpaceID_None) {
// width/height are special as they may be attributes or for
// outer-<svg> elements, mapped into style.
if (attributeName == nsGkAtoms::width ||
attributeName == nsGkAtoms::height) {
isCSS = targetElem->GetNameSpaceID() != kNameSpaceID_SVG;
} else {
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(nsDependentAtomString(attributeName),
CSSEnabledState::eForAllContent);
isCSS = nsSMILCSSProperty::IsPropertyAnimatable(prop);
}
}
} else {
isCSS = (attributeType == eSMILTargetAttrType_CSS);
}
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/nsSMILCSSProperty.cpp
@@ -17,17 +17,17 @@
#include "nsIDOMElement.h"
#include "nsIDocument.h"
using namespace mozilla::dom;
// Helper function
static bool
GetCSSComputedValue(Element* aElem,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
nsAString& aResult)
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aPropID),
"Can't look up computed value of shorthand property");
MOZ_ASSERT(nsSMILCSSProperty::IsPropertyAnimatable(aPropID),
"Shouldn't get here for non-animatable properties");
nsIDocument* doc = aElem->GetUncomposedDoc();
@@ -47,17 +47,17 @@ GetCSSComputedValue(Element* aElem,
RefPtr<nsComputedDOMStyle> computedStyle =
NS_NewComputedDOMStyle(aElem, EmptyString(), shell);
computedStyle->GetPropertyValue(aPropID, aResult);
return true;
}
// Class Methods
-nsSMILCSSProperty::nsSMILCSSProperty(nsCSSProperty aPropID,
+nsSMILCSSProperty::nsSMILCSSProperty(nsCSSPropertyID aPropID,
Element* aElement)
: mPropID(aPropID), mElement(aElement)
{
MOZ_ASSERT(IsPropertyAnimatable(mPropID),
"Creating a nsSMILCSSProperty for a property "
"that's not supported for animation");
}
@@ -181,17 +181,17 @@ nsSMILCSSProperty::ClearAnimValue()
if (overrideDecl) {
overrideDecl->SetPropertyValue(mPropID, EmptyString());
}
}
// Based on http://www.w3.org/TR/SVG/propidx.html
// static
bool
-nsSMILCSSProperty::IsPropertyAnimatable(nsCSSProperty aPropID)
+nsSMILCSSProperty::IsPropertyAnimatable(nsCSSPropertyID aPropID)
{
// NOTE: Right now, Gecko doesn't recognize the following properties from
// the SVG Property Index:
// alignment-baseline
// baseline-shift
// color-profile
// color-rendering
// glyph-orientation-horizontal
--- a/dom/smil/nsSMILCSSProperty.h
+++ b/dom/smil/nsSMILCSSProperty.h
@@ -7,17 +7,17 @@
/* representation of a SMIL-animatable CSS property on an element */
#ifndef NS_SMILCSSPROPERTY_H_
#define NS_SMILCSSPROPERTY_H_
#include "mozilla/Attributes.h"
#include "nsISMILAttr.h"
#include "nsIAtom.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
namespace mozilla {
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla
@@ -29,17 +29,17 @@ class Element;
class nsSMILCSSProperty : public nsISMILAttr
{
public:
/**
* Constructs a new nsSMILCSSProperty.
* @param aPropID The CSS property we're interested in animating.
* @param aElement The element whose CSS property is being animated.
*/
- nsSMILCSSProperty(nsCSSProperty aPropID, mozilla::dom::Element* aElement);
+ nsSMILCSSProperty(nsCSSPropertyID aPropID, mozilla::dom::Element* aElement);
// nsISMILAttr methods
virtual nsresult ValueFromString(const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement,
nsSMILValue& aValue,
bool& aPreventCachingOfSandwich) const override;
virtual nsSMILValue GetBaseValue() const override;
virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
@@ -48,20 +48,20 @@ public:
/**
* Utility method - returns true if the given property is supported for
* SMIL animation.
*
* @param aProperty The property to check for animation support.
* @return true if the given property is supported for SMIL animation, or
* false otherwise
*/
- static bool IsPropertyAnimatable(nsCSSProperty aPropID);
+ static bool IsPropertyAnimatable(nsCSSPropertyID aPropID);
protected:
- nsCSSProperty mPropID;
+ nsCSSPropertyID mPropID;
// Using non-refcounted pointer for mElement -- we know mElement will stay
// alive for my lifetime because a nsISMILAttr (like me) only lives as long
// as the Compositing step, and DOM elements don't get a chance to die during
// that time.
mozilla::dom::Element* mElement;
};
#endif // NS_SMILCSSPROPERTY_H_
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -20,20 +20,20 @@
#include "nsIDocument.h"
using namespace mozilla::dom;
using mozilla::StyleAnimationValue;
/*static*/ nsSMILCSSValueType nsSMILCSSValueType::sSingleton;
struct ValueWrapper {
- ValueWrapper(nsCSSProperty aPropID, const StyleAnimationValue& aValue) :
+ ValueWrapper(nsCSSPropertyID aPropID, const StyleAnimationValue& aValue) :
mPropID(aPropID), mCSSValue(aValue) {}
- nsCSSProperty mPropID;
+ nsCSSPropertyID mPropID;
StyleAnimationValue mCSSValue;
};
// Helper Methods
// --------------
static const StyleAnimationValue*
GetZeroValueForUnit(StyleAnimationValue::Unit aUnit)
{
@@ -218,17 +218,17 @@ nsSMILCSSValueType::Add(nsSMILValue& aDe
"Trying to add invalid types");
MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
ValueWrapper* destWrapper = ExtractValueWrapper(aDest);
const ValueWrapper* valueToAddWrapper = ExtractValueWrapper(aValueToAdd);
MOZ_ASSERT(destWrapper || valueToAddWrapper,
"need at least one fully-initialized value");
- nsCSSProperty property = (valueToAddWrapper ? valueToAddWrapper->mPropID :
+ nsCSSPropertyID property = (valueToAddWrapper ? valueToAddWrapper->mPropID :
destWrapper->mPropID);
// Special case: font-size-adjust and stroke-dasharray are explicitly
// non-additive (even though StyleAnimationValue *could* support adding them)
if (property == eCSSProperty_font_size_adjust ||
property == eCSSProperty_stroke_dasharray) {
return NS_ERROR_FAILURE;
}
@@ -330,17 +330,17 @@ GetPresContextForElement(Element* aElem)
return nullptr;
}
nsIPresShell* shell = doc->GetShell();
return shell ? shell->GetPresContext() : nullptr;
}
// Helper function to parse a string into a StyleAnimationValue
static bool
-ValueFromStringHelper(nsCSSProperty aPropID,
+ValueFromStringHelper(nsCSSPropertyID aPropID,
Element* aTargetElement,
nsPresContext* aPresContext,
const nsAString& aString,
StyleAnimationValue& aStyleAnimValue,
bool* aIsContextSensitive)
{
// If value is negative, we'll strip off the "-" so the CSS parser won't
// barf, and then manually make the parsed value negative.
@@ -382,17 +382,17 @@ ValueFromStringHelper(nsCSSProperty aPro
aStyleAnimValue.SetCoordValue(aStyleAnimValue.GetCoordValue() /
aPresContext->TextZoom());
}
return true;
}
// static
void
-nsSMILCSSValueType::ValueFromString(nsCSSProperty aPropID,
+nsSMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID,
Element* aTargetElement,
const nsAString& aString,
nsSMILValue& aValue,
bool* aIsContextSensitive)
{
MOZ_ASSERT(aValue.IsNull(), "Outparam should be null-typed");
nsPresContext* presContext = GetPresContextForElement(aTargetElement);
if (!presContext) {
@@ -425,17 +425,17 @@ nsSMILCSSValueType::ValueToString(const
"Unexpected SMIL value type");
const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
return !wrapper ||
StyleAnimationValue::UncomputeValue(wrapper->mPropID,
wrapper->mCSSValue, aString);
}
// static
-nsCSSProperty
+nsCSSPropertyID
nsSMILCSSValueType::PropertyFromValue(const nsSMILValue& aValue)
{
if (aValue.mType != &nsSMILCSSValueType::sSingleton) {
return eCSSProperty_UNKNOWN;
}
const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
if (!wrapper) {
--- a/dom/smil/nsSMILCSSValueType.h
+++ b/dom/smil/nsSMILCSSValueType.h
@@ -5,17 +5,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* representation of a value for a SMIL-animated CSS property */
#ifndef NS_SMILCSSVALUETYPE_H_
#define NS_SMILCSSVALUETYPE_H_
#include "nsISMILType.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "mozilla/Attributes.h"
class nsAString;
namespace mozilla {
namespace dom {
class Element;
} // namespace dom
@@ -73,17 +73,17 @@ public:
* a different |aValue| depending on other
* CSS properties on |aTargetElement|
* or its ancestors (e.g. 'inherit).
* false otherwise. May be nullptr.
* Not set if the method fails.
* @pre aValue.IsNull()
* @post aValue.IsNull() || aValue.mType == nsSMILCSSValueType::sSingleton
*/
- static void ValueFromString(nsCSSProperty aPropID,
+ static void ValueFromString(nsCSSPropertyID aPropID,
Element* aTargetElement,
const nsAString& aString,
nsSMILValue& aValue,
bool* aIsContextSensitive);
/**
* Creates a string representation of the given nsSMILValue.
*
@@ -97,20 +97,20 @@ public:
* @return true on success, false on failure.
*/
static bool ValueToString(const nsSMILValue& aValue, nsAString& aString);
/**
* Return the CSS property animated by the specified value.
*
* @param aValue The nsSMILValue to examine.
- * @return The nsCSSProperty enum value of the property animated
+ * @return The nsCSSPropertyID enum value of the property animated
* by |aValue|, or eCSSProperty_UNKNOWN if the type of
* |aValue| is not nsSMILCSSValueType.
*/
- static nsCSSProperty PropertyFromValue(const nsSMILValue& aValue);
+ static nsCSSPropertyID PropertyFromValue(const nsSMILValue& aValue);
private:
// Private constructor: prevent instances beyond my singleton.
constexpr nsSMILCSSValueType() {}
};
#endif // NS_SMILCSSVALUETYPE_H_
--- a/dom/smil/nsSMILCompositor.cpp
+++ b/dom/smil/nsSMILCompositor.cpp
@@ -122,17 +122,17 @@ nsSMILCompositor::ClearAnimationEffects(
}
// Protected Helper Functions
// --------------------------
nsISMILAttr*
nsSMILCompositor::CreateSMILAttr()
{
if (mKey.mIsCSS) {
- nsCSSProperty propId =
+ nsCSSPropertyID propId =
nsCSSProps::LookupProperty(nsDependentAtomString(mKey.mAttributeName),
CSSEnabledState::eForAllContent);
if (nsSMILCSSProperty::IsPropertyAnimatable(propId)) {
return new nsSMILCSSProperty(propId, mKey.mElement.get());
}
} else {
return mKey.mElement->GetAnimatedAttr(mKey.mAttributeNamespaceID,
mKey.mAttributeName);
--- a/dom/smil/nsSMILMappedAttribute.h
+++ b/dom/smil/nsSMILMappedAttribute.h
@@ -31,17 +31,17 @@ class nsSMILMappedAttribute : public nsS
public:
/**
* Constructs a new nsSMILMappedAttribute.
*
* @param aPropID The CSS property for the mapped attribute we're
* interested in animating.
* @param aElement The element whose attribute is being animated.
*/
- nsSMILMappedAttribute(nsCSSProperty aPropID, mozilla::dom::Element* aElement) :
+ nsSMILMappedAttribute(nsCSSPropertyID aPropID, mozilla::dom::Element* aElement) :
nsSMILCSSProperty(aPropID, aElement) {}
// nsISMILAttr methods
virtual nsresult ValueFromString(const nsAString& aStr,
const mozilla::dom::SVGAnimationElement* aSrcElement,
nsSMILValue& aValue,
bool& aPreventCachingOfSandwich) const override;
virtual nsSMILValue GetBaseValue() const override;
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -1194,18 +1194,18 @@ void
MappedAttrParser::ParseMappedAttrValue(nsIAtom* aMappedAttrName,
const nsAString& aMappedAttrValue)
{
if (!mDecl) {
mDecl = new css::Declaration();
mDecl->InitializeEmpty();
}
- // Get the nsCSSProperty ID for our mapped attribute.
- nsCSSProperty propertyID =
+ // Get the nsCSSPropertyID ID for our mapped attribute.
+ nsCSSPropertyID propertyID =
nsCSSProps::LookupProperty(nsDependentAtomString(aMappedAttrName),
CSSEnabledState::eForAllContent);
if (propertyID != eCSSProperty_UNKNOWN) {
bool changed = false; // outparam for ParseProperty.
mParser.ParseProperty(propertyID, aMappedAttrValue, mDocURI, mBaseURI,
mElement->NodePrincipal(), mDecl, &changed, false, true);
if (changed) {
// The normal reporting of use counters by the nsCSSParser won't happen
@@ -2553,17 +2553,17 @@ nsSVGElement::GetAnimatedAttr(int32_t aN
if (aNamespaceID == kNameSpaceID_None) {
// We check mapped-into-style attributes first so that animations
// targeting width/height on outer-<svg> don't appear to be ignored
// because we returned a nsISMILAttr for the corresponding
// SVGAnimatedLength.
// Mapped attributes:
if (IsAttributeMapped(aName)) {
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(nsDependentAtomString(aName),
CSSEnabledState::eForAllContent);
// Check IsPropertyAnimatable to avoid attributes that...
// - map to explicitly unanimatable properties (e.g. 'direction')
// - map to unsupported attributes (e.g. 'glyph-orientation-horizontal')
if (nsSMILCSSProperty::IsPropertyAnimatable(prop)) {
return new nsSMILMappedAttribute(prop, this);
}
--- a/editor/libeditor/CSSEditUtils.cpp
+++ b/editor/libeditor/CSSEditUtils.cpp
@@ -543,17 +543,17 @@ CSSEditUtils::GetCSSInlinePropertyBase(n
return NS_OK;
}
MOZ_ASSERT(aStyleType == eSpecified);
RefPtr<css::Declaration> decl = element->GetInlineStyleDeclaration();
if (!decl) {
return NS_OK;
}
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(nsDependentAtomString(aProperty),
CSSEnabledState::eForAllContent);
MOZ_ASSERT(prop != eCSSProperty_UNKNOWN);
decl->GetValue(prop, aValue);
return NS_OK;
}
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -31,17 +31,17 @@
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/gfx/TiledRegion.h" // for TiledIntRegion
#include "mozilla/gfx/Types.h" // for SurfaceFormat
#include "mozilla/gfx/UserData.h" // for UserData, etc
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/mozalloc.h" // for operator delete, etc
#include "nsAutoPtr.h" // for nsAutoPtr, nsRefPtr, etc
#include "nsCOMPtr.h" // for already_AddRefed
-#include "nsCSSProperty.h" // for nsCSSProperty
+#include "nsCSSPropertyID.h" // for nsCSSPropertyID
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for Layer::Release, etc
#include "nsRect.h" // for mozilla::gfx::IntRect
#include "nsRegion.h" // for nsIntRegion
#include "nsString.h" // for nsCString
#include "nsTArray.h" // for nsTArray
#include "nsTArrayForwardDeclare.h" // for InfallibleTArray
#include "nscore.h" // for nsACString, nsAString
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -23,17 +23,17 @@ using struct mozilla::gfx::Point3D from
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
using class mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
using nscoord from "nsCoord.h";
using struct nsRect from "nsRect.h";
using struct nsPoint from "nsPoint.h";
using class mozilla::TimeDuration from "mozilla/TimeStamp.h";
using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
using mozilla::ScreenRotation from "mozilla/WidgetUtils.h";
-using nsCSSProperty from "nsCSSProperty.h";
+using nsCSSPropertyID from "nsCSSPropertyID.h";
using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::LayerMargin from "Units.h";
using mozilla::LayerPoint from "Units.h";
using mozilla::LayerRect from "Units.h";
using mozilla::LayerIntRegion from "Units.h";
using mozilla::ParentLayerIntRect from "Units.h";
using mozilla::LayoutDeviceIntRect from "Units.h";
@@ -194,17 +194,17 @@ struct Animation {
AnimationSegment[] segments;
// Number of times to repeat the animation, including positive infinity.
// Values <= 0 mean the animation will not play (although events are still
// dispatched on the main thread).
float iterations;
float iterationStart;
// This uses the NS_STYLE_ANIMATION_DIRECTION_* constants.
int32_t direction;
- nsCSSProperty property;
+ nsCSSPropertyID property;
AnimationData data;
float playbackRate;
// This is used in the transformed progress calculation.
TimingFunction easingFunction;
};
// Change a layer's attributes
struct CommonLayerAttributes {
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -29,17 +29,17 @@
#include "nsExceptionHandler.h"
#endif
#include "nsID.h"
#include "nsIWidget.h"
#include "nsMemory.h"
#include "nsString.h"
#include "nsTArray.h"
#include "js/StructuredClone.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#ifdef _MSC_VER
#pragma warning( disable : 4800 )
#endif
#if !defined(OS_POSIX)
// This condition must be kept in sync with the one in
// ipc_message_utils.h, but this dummy definition of
@@ -535,18 +535,18 @@ struct ParamTraits<float>
static void Log(const paramType& aParam, std::wstring* aLog)
{
aLog->append(StringPrintf(L"%g", aParam));
}
};
template <>
-struct ParamTraits<nsCSSProperty>
- : public ContiguousEnumSerializer<nsCSSProperty,
+struct ParamTraits<nsCSSPropertyID>
+ : public ContiguousEnumSerializer<nsCSSPropertyID,
eCSSProperty_UNKNOWN,
eCSSProperty_COUNT>
{};
template<>
struct ParamTraits<mozilla::void_t>
{
typedef mozilla::void_t paramType;
--- a/layout/base/ActiveLayerTracker.cpp
+++ b/layout/base/ActiveLayerTracker.cpp
@@ -61,22 +61,22 @@ public:
: mFrame(aFrame)
, mContent(nullptr)
, mContentActive(false)
{
PodArrayZero(mRestyleCounts);
}
~LayerActivity();
nsExpirationState* GetExpirationState() { return &mState; }
- uint8_t& RestyleCountForProperty(nsCSSProperty aProperty)
+ uint8_t& RestyleCountForProperty(nsCSSPropertyID aProperty)
{
return mRestyleCounts[GetActivityIndexForProperty(aProperty)];
}
- static ActivityIndex GetActivityIndexForProperty(nsCSSProperty aProperty)
+ static ActivityIndex GetActivityIndexForProperty(nsCSSPropertyID aProperty)
{
switch (aProperty) {
case eCSSProperty_opacity: return ACTIVITY_OPACITY;
case eCSSProperty_transform: return ACTIVITY_TRANSFORM;
case eCSSProperty_left: return ACTIVITY_LEFT;
case eCSSProperty_top: return ACTIVITY_TOP;
case eCSSProperty_right: return ACTIVITY_RIGHT;
case eCSSProperty_bottom: return ACTIVITY_BOTTOM;
@@ -287,17 +287,17 @@ IncrementScaleRestyleCountIfNeeded(nsIFr
return; // Nothing changed.
}
aActivity->mPreviousTransformScale = Some(scale);
IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
}
/* static */ void
-ActiveLayerTracker::NotifyRestyle(nsIFrame* aFrame, nsCSSProperty aProperty)
+ActiveLayerTracker::NotifyRestyle(nsIFrame* aFrame, nsCSSPropertyID aProperty)
{
LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
uint8_t& mutationCount = layerActivity->RestyleCountForProperty(aProperty);
IncrementMutationCount(&mutationCount);
if (aProperty == eCSSProperty_transform) {
IncrementScaleRestyleCountIfNeeded(aFrame, layerActivity);
}
@@ -310,34 +310,34 @@ ActiveLayerTracker::NotifyOffsetRestyle(
IncrementMutationCount(&layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_LEFT]);
IncrementMutationCount(&layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_TOP]);
IncrementMutationCount(&layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_RIGHT]);
IncrementMutationCount(&layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_BOTTOM]);
}
/* static */ void
ActiveLayerTracker::NotifyAnimated(nsIFrame* aFrame,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const nsAString& aNewValue,
nsDOMCSSDeclaration* aDOMCSSDecl)
{
LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
uint8_t& mutationCount = layerActivity->RestyleCountForProperty(aProperty);
if (mutationCount != 0xFF) {
nsAutoString oldValue;
aDOMCSSDecl->GetPropertyValue(aProperty, oldValue);
if (aNewValue != oldValue) {
// We know this is animated, so just hack the mutation count.
mutationCount = 0xFF;
}
}
}
/* static */ void
-ActiveLayerTracker::NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSProperty aProperty,
+ActiveLayerTracker::NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSPropertyID aProperty,
nsIFrame* aScrollFrame)
{
if (aFrame->PresContext() != aScrollFrame->PresContext()) {
// Don't allow cross-document dependencies.
return;
}
LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
LayerActivity::ActivityIndex activityIndex = LayerActivity::GetActivityIndexForProperty(aProperty);
@@ -361,32 +361,32 @@ IsPresContextInScriptAnimationCallback(n
// Treat timeouts/setintervals as scripted animation callbacks for our
// purposes.
nsPIDOMWindowInner* win = aPresContext->Document()->GetInnerWindow();
return win && win->IsRunningTimeout();
}
/* static */ void
ActiveLayerTracker::NotifyInlineStyleRuleModified(nsIFrame* aFrame,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const nsAString& aNewValue,
nsDOMCSSDeclaration* aDOMCSSDecl)
{
if (IsPresContextInScriptAnimationCallback(aFrame->PresContext())) {
NotifyAnimated(aFrame, aProperty, aNewValue, aDOMCSSDecl);
}
if (gLayerActivityTracker &&
gLayerActivityTracker->mCurrentScrollHandlerFrame.IsAlive()) {
NotifyAnimatedFromScrollHandler(aFrame, aProperty,
gLayerActivityTracker->mCurrentScrollHandlerFrame.GetFrame());
}
}
/* static */ bool
-ActiveLayerTracker::IsStyleMaybeAnimated(nsIFrame* aFrame, nsCSSProperty aProperty)
+ActiveLayerTracker::IsStyleMaybeAnimated(nsIFrame* aFrame, nsCSSPropertyID aProperty)
{
return IsStyleAnimated(nullptr, aFrame, aProperty);
}
/* static */ bool
ActiveLayerTracker::IsBackgroundPositionAnimated(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
@@ -414,17 +414,17 @@ CheckScrollInducedActivity(LayerActivity
// the layer activity so that it can expire.
aLayerActivity->mAnimatingScrollHandlerFrame = nullptr;
aLayerActivity->mScrollHandlerInducedActivity.clear();
return false;
}
/* static */ bool
ActiveLayerTracker::IsStyleAnimated(nsDisplayListBuilder* aBuilder,
- nsIFrame* aFrame, nsCSSProperty aProperty)
+ nsIFrame* aFrame, nsCSSPropertyID aProperty)
{
// TODO: Add some abuse restrictions
if ((aFrame->StyleDisplay()->mWillChangeBitField & NS_STYLE_WILL_CHANGE_TRANSFORM) &&
aProperty == eCSSProperty_transform &&
(!aBuilder || aBuilder->IsInWillChangeBudget(aFrame, aFrame->GetSize()))) {
return true;
}
if ((aFrame->StyleDisplay()->mWillChangeBitField & NS_STYLE_WILL_CHANGE_OPACITY) &&
--- a/layout/base/ActiveLayerTracker.h
+++ b/layout/base/ActiveLayerTracker.h
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ACTIVELAYERTRACKER_H_
#define ACTIVELAYERTRACKER_H_
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
class nsIFrame;
class nsIContent;
class nsDisplayListBuilder;
class nsDOMCSSDeclaration;
namespace mozilla {
@@ -33,60 +33,60 @@ public:
*/
/**
* Notify aFrame's style property as having changed due to a restyle,
* and therefore possibly wanting an active layer to render that style.
* Any such marking will time out after a short period.
* @param aProperty the property that has changed
*/
- static void NotifyRestyle(nsIFrame* aFrame, nsCSSProperty aProperty);
+ static void NotifyRestyle(nsIFrame* aFrame, nsCSSPropertyID aProperty);
/**
* Notify aFrame's left/top/right/bottom properties as having (maybe)
* changed due to a restyle, and therefore possibly wanting an active layer
* to render that style. Any such marking will time out after a short period.
*/
static void NotifyOffsetRestyle(nsIFrame* aFrame);
/**
* Mark aFrame as being known to have an animation of aProperty.
* Any such marking will time out after a short period.
* aNewValue and aDOMCSSDecl are used to determine whether the property's
* value has changed.
*/
- static void NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty,
+ static void NotifyAnimated(nsIFrame* aFrame, nsCSSPropertyID aProperty,
const nsAString& aNewValue,
nsDOMCSSDeclaration* aDOMCSSDecl);
/**
* Notify aFrame as being known to have an animation of aProperty through an
* inline style modification during aScrollFrame's scroll event handler.
*/
- static void NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSProperty aProperty,
+ static void NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSPropertyID aProperty,
nsIFrame* aScrollFrame);
/**
* Notify that a property in the inline style rule of aFrame's element
* has been modified.
* This notification is incomplete --- not all modifications to inline
* style will trigger this.
* aNewValue and aDOMCSSDecl are used to determine whether the property's
* value has changed.
*/
- static void NotifyInlineStyleRuleModified(nsIFrame* aFrame, nsCSSProperty aProperty,
+ static void NotifyInlineStyleRuleModified(nsIFrame* aFrame, nsCSSPropertyID aProperty,
const nsAString& aNewValue,
nsDOMCSSDeclaration* aDOMCSSDecl);
/**
* Return true if aFrame's aProperty style should be considered as being animated
* for pre-rendering.
*/
- static bool IsStyleMaybeAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
+ static bool IsStyleMaybeAnimated(nsIFrame* aFrame, nsCSSPropertyID aProperty);
/**
* Return true if aFrame's aProperty style should be considered as being animated
* for constructing active layers.
*/
static bool IsStyleAnimated(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
/**
* Return true if any of aFrame's offset property styles should be considered
* as being animated for constructing active layers.
*/
static bool IsOffsetOrMarginStyleAnimated(nsIFrame* aFrame);
/**
* Return true if aFrame's background-position-x or background-position-y
* property is animated.
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -278,17 +278,17 @@ void
FrameLayerBuilder::DisplayItemData::ClearAnimationCompositorState()
{
if (mDisplayItemKey != nsDisplayItem::TYPE_TRANSFORM &&
mDisplayItemKey != nsDisplayItem::TYPE_OPACITY) {
return;
}
for (nsIFrame* frame : mFrameList) {
- nsCSSProperty prop = mDisplayItemKey == nsDisplayItem::TYPE_TRANSFORM ?
+ nsCSSPropertyID prop = mDisplayItemKey == nsDisplayItem::TYPE_TRANSFORM ?
eCSSProperty_transform : eCSSProperty_opacity;
EffectCompositor::ClearIsRunningOnCompositor(frame, prop);
}
}
const nsTArray<nsIFrame*>&
FrameLayerBuilder::DisplayItemData::GetFrameListChanges()
{
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -453,17 +453,17 @@ AddAnimationForProperty(nsIFrame* aFrame
animSegment->startPortion() = segment.mFromKey;
animSegment->endPortion() = segment.mToKey;
animSegment->sampleFn() = ToTimingFunction(segment.mTimingFunction);
}
}
static void
-AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
+AddAnimationsForProperty(nsIFrame* aFrame, nsCSSPropertyID aProperty,
nsTArray<RefPtr<dom::Animation>>& aAnimations,
Layer* aLayer, AnimationData& aData,
bool aPending)
{
MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
"inconsistent property flags");
@@ -594,17 +594,17 @@ GenerateAndPushTextMask(nsIFrame* aFrame
return true;
}
/* static */ void
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(Layer* aLayer,
nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem,
nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
"inconsistent property flags");
// This function can be called in two ways: from
// nsDisplay*::BuildLayer while constructing a layer (with all
// pointers non-null), or from RestyleManager's handling of
@@ -4431,17 +4431,17 @@ IsItemTooSmallForActiveLayer(nsIFrame* a
aFrame->PresContext()->AppUnitsPerDevPixel());
static const int MIN_ACTIVE_LAYER_SIZE_DEV_PIXELS = 16;
return visibleDevPixels.Size() <
nsIntSize(MIN_ACTIVE_LAYER_SIZE_DEV_PIXELS, MIN_ACTIVE_LAYER_SIZE_DEV_PIXELS);
}
static void
SetAnimationPerformanceWarningForTooSmallItem(nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
// We use ToNearestPixels() here since ToOutsidePixels causes some sort of
// errors. See https://bugzilla.mozilla.org/show_bug.cgi?id=1258904#c19
nsIntRect visibleDevPixels = aFrame->GetVisualOverflowRectRelativeToSelf().ToNearestPixels(
aFrame->PresContext()->AppUnitsPerDevPixel());
// Set performance warning only if the visible dev pixels is not empty
// because dev pixels is empty if the frame has 'preserve-3d' style.
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -691,17 +691,17 @@ public:
* already checked that off main thread animations should be sent to
* the layer. When they are both null, the animations are added to
* the layer as pending animations.
*/
static void AddAnimationsAndTransitionsToLayer(Layer* aLayer,
nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem,
nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
/**
* A helper class to temporarily set the value of
* mIsAtRootOfPseudoStackingContext, and temporarily
* set mCurrentFrame and related state. Also temporarily sets mDirtyRect.
* aDirtyRect is relative to aForChild.
*/
class AutoBuildingDisplayList;
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -471,17 +471,17 @@ HasMatchingAnimations(const nsIFrame* aF
}
}
return false;
}
bool
nsLayoutUtils::HasCurrentAnimationOfProperty(const nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
return HasMatchingAnimations(aFrame,
[&aProperty](KeyframeEffectReadOnly& aEffect)
{
return aEffect.IsCurrent() && aEffect.HasAnimationOfProperty(aProperty);
}
);
}
@@ -496,17 +496,17 @@ nsLayoutUtils::HasCurrentTransitions(con
// so we don't need to null-check the result of GetAnimation().
return aEffect.IsCurrent() && aEffect.GetAnimation()->AsCSSTransition();
}
);
}
bool
nsLayoutUtils::HasRelevantAnimationOfProperty(const nsIFrame* aFrame,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
return HasMatchingAnimations(aFrame,
[&aProperty](KeyframeEffectReadOnly& aEffect)
{
return (aEffect.IsInEffect() || aEffect.IsCurrent()) &&
aEffect.HasAnimationOfProperty(aProperty);
}
);
@@ -5802,17 +5802,17 @@ DarkenColor(nscolor aColor)
static bool
ShouldDarkenColors(nsPresContext* aPresContext)
{
return !aPresContext->GetBackgroundColorDraw() &&
!aPresContext->GetBackgroundImageDraw();
}
nscolor
-nsLayoutUtils::GetColor(nsIFrame* aFrame, nsCSSProperty aProperty)
+nsLayoutUtils::GetColor(nsIFrame* aFrame, nsCSSPropertyID aProperty)
{
nscolor color = aFrame->GetVisitedDependentColor(aProperty);
if (ShouldDarkenColors(aFrame->PresContext())) {
color = DarkenColor(color);
}
return color;
}
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -13,17 +13,17 @@
#include "nsBoundingMetrics.h"
#include "nsChangeHint.h"
#include "nsFrameList.h"
#include "mozilla/layout/FrameChildList.h"
#include "nsThreadUtils.h"
#include "nsIPrincipal.h"
#include "FrameMetrics.h"
#include "nsIWidget.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsStyleCoord.h"
#include "nsStyleConsts.h"
#include "nsGkAtoms.h"
#include "nsRuleNode.h"
#include "imgIContainer.h"
#include "mozilla/gfx/2D.h"
#include "Units.h"
#include "mozilla/ToString.h"
@@ -1551,17 +1551,17 @@ public:
static nscoord PrefISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext);
// Implement nsIFrame::GetMinISize in terms of nsIFrame::AddInlineMinISize
static nscoord MinISizeFromInline(nsIFrame* aFrame,
nsRenderingContext* aRenderingContext);
// Get a suitable foreground color for painting aProperty for aFrame.
- static nscolor GetColor(nsIFrame* aFrame, nsCSSProperty aProperty);
+ static nscolor GetColor(nsIFrame* aFrame, nsCSSPropertyID aProperty);
// Get a baseline y position in app units that is snapped to device pixels.
static gfxFloat GetSnappedBaselineY(nsIFrame* aFrame, gfxContext* aContext,
nscoord aY, nscoord aAscent);
// Ditto for an x position (for vertical text). Note that for vertical-rl
// writing mode, the ascent value should be negated by the caller.
static gfxFloat GetSnappedBaselineX(nsIFrame* aFrame, gfxContext* aContext,
nscoord aX, nscoord aAscent);
@@ -2231,32 +2231,32 @@ public:
mozilla::MallocSizeOf aMallocSizeOf,
bool clear);
/**
* Returns true if the frame has current (i.e. running or scheduled-to-run)
* animations or transitions for the property.
*/
static bool HasCurrentAnimationOfProperty(const nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
/**
* Returns true if the frame has any current CSS transitions.
* A current transition is any transition that has not yet finished playing
* including paused transitions.
*/
static bool HasCurrentTransitions(const nsIFrame* aFrame);
/**
* Returns true if the frame has current or in-effect (i.e. in before phase,
* running or filling) animations or transitions for the
* property.
*/
static bool HasRelevantAnimationOfProperty(const nsIFrame* aFrame,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
/**
* Checks if off-main-thread animations are enabled.
*/
static bool AreAsyncAnimationsEnabled();
/**
* Checks if we should warn about animations that can't be async
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -209,17 +209,17 @@ PaintTextShadowCallback(nsRenderingConte
reinterpret_cast<nsDisplayTextOverflowMarker*>(aData)->
PaintTextToContext(aCtx, aShadowOffset);
}
void
nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
- nsCSSProperty colorProp = mFrame->StyleContext()->GetTextFillColorProp();
+ nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp();
nscolor foregroundColor = nsLayoutUtils::GetColor(mFrame, colorProp);
// Paint the text-shadows for the overflow marker
nsLayoutUtils::PaintTextShadow(mFrame, aCtx, mRect, mVisibleRect,
foregroundColor, PaintTextShadowCallback,
(void*)this);
aCtx->ThebesContext()->SetColor(gfx::Color::FromABGR(foregroundColor));
PaintTextToContext(aCtx, nsPoint(0, 0));
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -612,17 +612,17 @@ public:
const nsStyle##name_ * Style##name_ () const { \
NS_ASSERTION(mStyleContext, "No style context found!"); \
return mStyleContext->Style##name_ (); \
}
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
/** Also forward GetVisitedDependentColor to the style context */
- nscolor GetVisitedDependentColor(nsCSSProperty aProperty)
+ nscolor GetVisitedDependentColor(nsCSSPropertyID aProperty)
{ return mStyleContext->GetVisitedDependentColor(aProperty); }
/**
* These methods are to access any additional style contexts that
* the frame may be holding. These are contexts that are children
* of the frame's primary context and are NOT used as style contexts
* for any child frames. These contexts also MUST NOT have any child
* contexts whatsoever. If you need to insert style contexts into the
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -3935,23 +3935,23 @@ nsTextPaintStyle::InitSelectionColorsAnd
}
mSelectionTextColor =
LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForeground);
if (mResolveColors) {
// On MacOS X, we don't exchange text color and BG color.
if (mSelectionTextColor == NS_DONT_CHANGE_COLOR) {
- nsCSSProperty property = mFrame->IsSVGText()
+ nsCSSPropertyID property = mFrame->IsSVGText()
? eCSSProperty_fill
: mFrame->StyleContext()->GetTextFillColorProp();
nscoord frameColor = mFrame->GetVisitedDependentColor(property);
mSelectionTextColor = EnsureDifferentColors(frameColor, mSelectionBGColor);
} else if (mSelectionTextColor == NS_CHANGE_COLOR_IF_SAME_AS_BG) {
- nsCSSProperty property = mFrame->IsSVGText()
+ nsCSSPropertyID property = mFrame->IsSVGText()
? eCSSProperty_fill
: mFrame->StyleContext()->GetTextFillColorProp();
nscolor frameColor = mFrame->GetVisitedDependentColor(property);
if (frameColor == mSelectionBGColor) {
mSelectionTextColor =
LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForegroundCustom);
}
} else {
--- a/layout/inspector/inCSSValueSearch.cpp
+++ b/layout/inspector/inCSSValueSearch.cpp
@@ -31,17 +31,17 @@ inCSSValueSearch::inCSSValueSearch()
mResultCount(0),
mPropertyCount(0),
mIsActive(false),
mHoldResults(true),
mReturnRelativeURLs(true),
mNormalizeChromeURLs(false)
{
nsCSSProps::AddRefTable();
- mProperties = new nsCSSProperty[100];
+ mProperties = new nsCSSPropertyID[100];
}
inCSSValueSearch::~inCSSValueSearch()
{
delete[] mProperties;
delete mResults;
nsCSSProps::ReleaseTable();
}
@@ -217,17 +217,17 @@ inCSSValueSearch::SetNormalizeChromeURLs
{
mNormalizeChromeURLs = aNormalizeChromeURLs;
return NS_OK;
}
NS_IMETHODIMP
inCSSValueSearch::AddPropertyCriteria(const char16_t *aPropName)
{
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(nsDependentString(aPropName),
CSSEnabledState::eIgnoreEnabledState);
mProperties[mPropertyCount] = prop;
mPropertyCount++;
return NS_OK;
}
NS_IMETHODIMP
--- a/layout/inspector/inCSSValueSearch.h
+++ b/layout/inspector/inCSSValueSearch.h
@@ -28,17 +28,17 @@ public:
inCSSValueSearch();
protected:
virtual ~inCSSValueSearch();
nsCOMPtr<inISearchObserver> mObserver;
nsCOMPtr<nsIDOMDocument> mDocument;
nsTArray<nsAutoString *>* mResults;
- nsCSSProperty* mProperties;
+ nsCSSPropertyID* mProperties;
nsString mLastResult;
nsString mBaseURL;
nsString mTextCriteria;
int32_t mResultCount;
uint32_t mPropertyCount;
bool mIsActive;
bool mHoldResults;
bool mReturnRelativeURLs;
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -481,17 +481,17 @@ inDOMUtils::SelectorMatchesElement(nsIDO
*aMatches = nsCSSRuleProcessor::SelectorListMatches(element, matchingContext,
sel);
return NS_OK;
}
NS_IMETHODIMP
inDOMUtils::IsInheritedProperty(const nsAString &aPropertyName, bool *_retval)
{
- nsCSSProperty prop = nsCSSProps::
+ nsCSSPropertyID prop = nsCSSProps::
LookupProperty(aPropertyName, CSSEnabledState::eIgnoreEnabledState);
if (prop == eCSSProperty_UNKNOWN) {
*_retval = false;
return NS_OK;
}
if (prop == eCSSPropertyExtra_variable) {
*_retval = true;
@@ -526,39 +526,39 @@ inDOMUtils::GetCSSPropertyNames(uint32_t
maxCount += (eCSSProperty_COUNT_with_aliases - eCSSProperty_COUNT);
}
char16_t** props =
static_cast<char16_t**>(moz_xmalloc(maxCount * sizeof(char16_t*)));
#define DO_PROP(_prop) \
PR_BEGIN_MACRO \
- nsCSSProperty cssProp = nsCSSProperty(_prop); \
+ nsCSSPropertyID cssProp = nsCSSPropertyID(_prop); \
if (nsCSSProps::IsEnabled(cssProp, CSSEnabledState::eForAllContent)) { \
props[propCount] = \
ToNewUnicode(nsDependentCString(kCSSRawProperties[_prop])); \
++propCount; \
} \
PR_END_MACRO
// prop is the property id we're considering; propCount is how many properties
// we've put into props so far.
uint32_t prop = 0, propCount = 0;
for ( ; prop < eCSSProperty_COUNT_no_shorthands; ++prop) {
- if (nsCSSProps::PropertyParseType(nsCSSProperty(prop)) !=
+ if (nsCSSProps::PropertyParseType(nsCSSPropertyID(prop)) !=
CSS_PROPERTY_PARSE_INACCESSIBLE) {
DO_PROP(prop);
}
}
if (!(aFlags & EXCLUDE_SHORTHANDS)) {
for ( ; prop < eCSSProperty_COUNT; ++prop) {
// Some shorthands are also aliases
if ((aFlags & INCLUDE_ALIASES) ||
- !nsCSSProps::PropHasFlags(nsCSSProperty(prop),
+ !nsCSSProps::PropHasFlags(nsCSSPropertyID(prop),
CSS_PROPERTY_IS_ALIAS)) {
DO_PROP(prop);
}
}
}
if (aFlags & INCLUDE_ALIASES) {
for (prop = eCSSProperty_COUNT; prop < eCSSProperty_COUNT_with_aliases; ++prop) {
@@ -579,17 +579,17 @@ static void InsertNoDuplicates(nsTArray<
{
size_t i = aArray.IndexOfFirstElementGt(aString);
if (i > 0 && aArray[i-1].Equals(aString)) {
return;
}
aArray.InsertElementAt(i, aString);
}
-static void GetKeywordsForProperty(const nsCSSProperty aProperty,
+static void GetKeywordsForProperty(const nsCSSPropertyID aProperty,
nsTArray<nsString>& aArray)
{
if (nsCSSProps::IsShorthand(aProperty)) {
// Shorthand props have no keywords.
return;
}
const nsCSSProps::KTableEntry* keywordTable =
nsCSSProps::kKeywordTableTable[aProperty];
@@ -670,17 +670,17 @@ static void GetOtherValuesForProperty(co
}
}
NS_IMETHODIMP
inDOMUtils::GetSubpropertiesForCSSProperty(const nsAString& aProperty,
uint32_t* aLength,
char16_t*** aValues)
{
- nsCSSProperty propertyID =
+ nsCSSPropertyID propertyID =
nsCSSProps::LookupProperty(aProperty, CSSEnabledState::eForAllContent);
if (propertyID == eCSSProperty_UNKNOWN) {
return NS_ERROR_FAILURE;
}
if (propertyID == eCSSPropertyExtra_variable) {
*aValues = static_cast<char16_t**>(moz_xmalloc(sizeof(char16_t*)));
@@ -693,62 +693,62 @@ inDOMUtils::GetSubpropertiesForCSSProper
*aValues = static_cast<char16_t**>(moz_xmalloc(sizeof(char16_t*)));
(*aValues)[0] = ToNewUnicode(nsCSSProps::GetStringValue(propertyID));
*aLength = 1;
return NS_OK;
}
// Count up how many subproperties we have.
size_t subpropCount = 0;
- for (const nsCSSProperty *props = nsCSSProps::SubpropertyEntryFor(propertyID);
+ for (const nsCSSPropertyID *props = nsCSSProps::SubpropertyEntryFor(propertyID);
*props != eCSSProperty_UNKNOWN; ++props) {
++subpropCount;
}
*aValues =
static_cast<char16_t**>(moz_xmalloc(subpropCount * sizeof(char16_t*)));
*aLength = subpropCount;
- for (const nsCSSProperty *props = nsCSSProps::SubpropertyEntryFor(propertyID),
+ for (const nsCSSPropertyID *props = nsCSSProps::SubpropertyEntryFor(propertyID),
*props_start = props;
*props != eCSSProperty_UNKNOWN; ++props) {
(*aValues)[props-props_start] = ToNewUnicode(nsCSSProps::GetStringValue(*props));
}
return NS_OK;
}
NS_IMETHODIMP
inDOMUtils::CssPropertyIsShorthand(const nsAString& aProperty, bool *_retval)
{
- nsCSSProperty propertyID =
+ nsCSSPropertyID propertyID =
nsCSSProps::LookupProperty(aProperty, CSSEnabledState::eForAllContent);
if (propertyID == eCSSProperty_UNKNOWN) {
return NS_ERROR_FAILURE;
}
if (propertyID == eCSSPropertyExtra_variable) {
*_retval = false;
} else {
*_retval = nsCSSProps::IsShorthand(propertyID);
}
return NS_OK;
}
// A helper function that determines whether the given property
// supports the given type.
static bool
-PropertySupportsVariant(nsCSSProperty aPropertyID, uint32_t aVariant)
+PropertySupportsVariant(nsCSSPropertyID aPropertyID, uint32_t aVariant)
{
if (nsCSSProps::IsShorthand(aPropertyID)) {
// We need a special case for border here, because while it resets
// border-image, it can't actually parse an image.
if (aPropertyID == eCSSProperty_border) {
return (aVariant & (VARIANT_COLOR | VARIANT_LENGTH)) != 0;
}
- for (const nsCSSProperty* props = nsCSSProps::SubpropertyEntryFor(aPropertyID);
+ for (const nsCSSPropertyID* props = nsCSSProps::SubpropertyEntryFor(aPropertyID);
*props != eCSSProperty_UNKNOWN; ++props) {
if (PropertySupportsVariant(*props, aVariant)) {
return true;
}
}
return false;
}
@@ -859,17 +859,17 @@ PropertySupportsVariant(nsCSSProperty aP
return (nsCSSProps::ParserVariant(aPropertyID) & aVariant) != 0;
}
NS_IMETHODIMP
inDOMUtils::CssPropertySupportsType(const nsAString& aProperty, uint32_t aType,
bool *_retval)
{
- nsCSSProperty propertyID =
+ nsCSSPropertyID propertyID =
nsCSSProps::LookupProperty(aProperty, CSSEnabledState::eForAllContent);
if (propertyID == eCSSProperty_UNKNOWN) {
return NS_ERROR_FAILURE;
}
if (propertyID >= eCSSProperty_COUNT) {
*_retval = false;
return NS_OK;
@@ -920,17 +920,17 @@ inDOMUtils::CssPropertySupportsType(cons
return NS_OK;
}
NS_IMETHODIMP
inDOMUtils::GetCSSValuesForProperty(const nsAString& aProperty,
uint32_t* aLength,
char16_t*** aValues)
{
- nsCSSProperty propertyID = nsCSSProps::
+ nsCSSPropertyID propertyID = nsCSSProps::
LookupProperty(aProperty, CSSEnabledState::eForAllContent);
if (propertyID == eCSSProperty_UNKNOWN) {
return NS_ERROR_FAILURE;
}
nsTArray<nsString> array;
// We start collecting the values, BUT colors need to go in first, because array
// needs to stay sorted, and the colors are sorted, so we just append them.
@@ -1055,17 +1055,17 @@ inDOMUtils::IsValidCSSColor(const nsAStr
return NS_OK;
}
NS_IMETHODIMP
inDOMUtils::CssPropertyIsValid(const nsAString& aPropertyName,
const nsAString& aPropertyValue,
bool *_retval)
{
- nsCSSProperty propertyID = nsCSSProps::
+ nsCSSPropertyID propertyID = nsCSSProps::
LookupProperty(aPropertyName, CSSEnabledState::eIgnoreEnabledState);
if (propertyID == eCSSProperty_UNKNOWN) {
*_retval = false;
return NS_OK;
}
if (propertyID == eCSSPropertyExtra_variable) {
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -2119,17 +2119,17 @@ nsMathMLChar::PaintForeground(nsPresCont
// normal drawing if there is nothing special about this char
// Set default context to the parent context
styleContext = parentContext;
}
RefPtr<gfxContext> thebesContext = aRenderingContext.ThebesContext();
// Set color ...
- nsCSSProperty colorProp = styleContext->GetTextFillColorProp();
+ nsCSSPropertyID colorProp = styleContext->GetTextFillColorProp();
nscolor fgColor = styleContext->GetVisitedDependentColor(colorProp);
if (aIsSelected) {
// get color to use for selection from the look&feel object
fgColor = LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForeground,
fgColor);
}
thebesContext->SetColor(Color::FromABGR(fgColor));
thebesContext->Save();
--- a/layout/mathml/nsMathMLFrame.cpp
+++ b/layout/mathml/nsMathMLFrame.cpp
@@ -359,17 +359,17 @@ void nsDisplayMathMLBar::Paint(nsDisplay
nsRenderingContext* aCtx)
{
// paint the bar with the current text color
DrawTarget* drawTarget = aCtx->GetDrawTarget();
Rect rect =
NSRectToNonEmptySnappedRect(mRect + ToReferenceFrame(),
mFrame->PresContext()->AppUnitsPerDevPixel(),
*drawTarget);
- nsCSSProperty colorProp = mFrame->StyleContext()->GetTextFillColorProp();
+ nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp();
ColorPattern color(ToDeviceColor(
mFrame->GetVisitedDependentColor(colorProp)));
drawTarget->FillRect(rect, color);
}
void
nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect,
--- a/layout/mathml/nsMathMLmencloseFrame.cpp
+++ b/layout/mathml/nsMathMLmencloseFrame.cpp
@@ -774,17 +774,17 @@ void nsDisplayNotation::Paint(nsDisplayL
nsPresContext* presContext = mFrame->PresContext();
Float strokeWidth = presContext->AppUnitsToGfxUnits(mThickness);
Rect rect = NSRectToRect(mRect + ToReferenceFrame(),
presContext->AppUnitsPerDevPixel());
rect.Deflate(strokeWidth / 2.f);
- nsCSSProperty colorProp = mFrame->StyleContext()->GetTextFillColorProp();
+ nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp();
ColorPattern color(ToDeviceColor(
mFrame->GetVisitedDependentColor(colorProp)));
StrokeOptions strokeOptions(strokeWidth);
switch(mType)
{
case NOTATION_CIRCLE: {
--- a/layout/mathml/nsMathMLmfracFrame.cpp
+++ b/layout/mathml/nsMathMLmfracFrame.cpp
@@ -624,17 +624,17 @@ void nsDisplayMathMLSlash::Paint(nsDispl
{
DrawTarget& aDrawTarget = *aCtx->GetDrawTarget();
// get the gfxRect
nsPresContext* presContext = mFrame->PresContext();
Rect rect = NSRectToRect(mRect + ToReferenceFrame(),
presContext->AppUnitsPerDevPixel());
- nsCSSProperty colorProp = mFrame->StyleContext()->GetTextFillColorProp();
+ nsCSSPropertyID colorProp = mFrame->StyleContext()->GetTextFillColorProp();
ColorPattern color(ToDeviceColor(
mFrame->GetVisitedDependentColor(colorProp)));
// draw the slash as a parallelogram
Point delta = Point(presContext->AppUnitsToGfxUnits(mThickness), 0);
RefPtr<PathBuilder> builder = aDrawTarget.CreatePathBuilder();
if (mRTL) {
builder->MoveTo(rect.TopLeft());
--- a/layout/style/CSSVariableImageTable.h
+++ b/layout/style/CSSVariableImageTable.h
@@ -4,24 +4,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* A global table that tracks images referenced by CSS variables. */
#ifndef mozilla_CSSVariableImageTable_h
#define mozilla_CSSVariableImageTable_h
#include "nsClassHashtable.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
#include "nsStyleContext.h"
#include "nsTArray.h"
/**
* CSSVariableImageTable maintains a global mapping
- * (nsStyleContext, nsCSSProperty) -> nsTArray<ImageValue>
+ * (nsStyleContext, nsCSSPropertyID) -> nsTArray<ImageValue>
* which allows us to track the relationship between CSS property values
* involving variables and any images they may reference.
*
* When properties like background-image contain a normal url(), the
* Declaration's data block will hold a reference to the ImageValue. When a
* token stream is used, the Declaration only holds on to an
* nsCSSValueTokenStream object, and the ImageValue would only exist for the
* duration of nsRuleNode::WalkRuleTree, in the AutoCSSValueArray. So instead
@@ -39,17 +39,17 @@
*/
namespace mozilla {
namespace CSSVariableImageTable {
namespace detail {
typedef nsTArray<RefPtr<css::ImageValue>> ImageValueArray;
-typedef nsClassHashtable<nsGenericHashKey<nsCSSProperty>, ImageValueArray>
+typedef nsClassHashtable<nsGenericHashKey<nsCSSPropertyID>, ImageValueArray>
PerPropertyImageHashtable;
typedef nsClassHashtable<nsPtrHashKey<nsStyleContext>, PerPropertyImageHashtable>
CSSVariableImageHashtable;
inline CSSVariableImageHashtable& GetTable()
{
static CSSVariableImageHashtable imageTable;
return imageTable;
@@ -62,27 +62,27 @@ inline bool& IsReplacing()
return isReplacing;
}
#endif
} // namespace detail
/**
* ReplaceAll() allows callers to replace the ImageValues associated with a
- * (nsStyleContext, nsCSSProperty) pair. The memory used by the previous list of
+ * (nsStyleContext, nsCSSPropertyID) pair. The memory used by the previous list of
* ImageValues is automatically released.
*
* @param aContext The style context the ImageValues are associated with.
* @param aProp The CSS property the ImageValues are associated with.
* @param aFunc A lambda that calls CSSVariableImageTable::Add() to add new
* ImageValues which will replace the old ones.
*/
template <typename Lambda>
inline void ReplaceAll(nsStyleContext* aContext,
- nsCSSProperty aProp,
+ nsCSSPropertyID aProp,
Lambda aFunc)
{
MOZ_ASSERT(aContext);
auto& imageTable = detail::GetTable();
// Clear the existing image array, if any, for this property.
{
@@ -129,17 +129,17 @@ inline void ReplaceAll(nsStyleContext* a
/**
* Adds a new ImageValue @aValue to the CSSVariableImageTable, which will be
* associated with @aContext and @aProp.
*
* It's illegal to call this function outside of a lambda passed to
* CSSVariableImageTable::ReplaceAll().
*/
inline void
-Add(nsStyleContext* aContext, nsCSSProperty aProp, css::ImageValue* aValue)
+Add(nsStyleContext* aContext, nsCSSPropertyID aProp, css::ImageValue* aValue)
{
MOZ_ASSERT(aValue);
MOZ_ASSERT(aContext);
MOZ_ASSERT(detail::IsReplacing());
auto& imageTable = detail::GetTable();
// Ensure there's a per-property image table for this style context.
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -119,29 +119,29 @@ Declaration::MapsImportantInheritedStyle
"important data");
if (mImportantVariables && mImportantVariables->Count() != 0) {
return true;
}
return mImportantData ? mImportantData->HasInheritedStyleData() : false;
}
void
-Declaration::ValueAppended(nsCSSProperty aProperty)
+Declaration::ValueAppended(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(!mData && !mImportantData,
"should only be called while expanded");
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
"shorthands forbidden");
// order IS important for CSS, so remove and add to the end
mOrder.RemoveElement(static_cast<uint32_t>(aProperty));
mOrder.AppendElement(static_cast<uint32_t>(aProperty));
}
void
-Declaration::RemoveProperty(nsCSSProperty aProperty)
+Declaration::RemoveProperty(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT);
nsCSSExpandedDataBlock data;
ExpandTo(&data);
MOZ_ASSERT(!mData && !mImportantData, "Expand didn't null things out");
if (nsCSSProps::IsShorthand(aProperty)) {
@@ -154,29 +154,29 @@ Declaration::RemoveProperty(nsCSSPropert
data.ClearLonghandProperty(aProperty);
mOrder.RemoveElement(static_cast<uint32_t>(aProperty));
}
CompressFrom(&data);
}
bool
-Declaration::HasProperty(nsCSSProperty aProperty) const
+Declaration::HasProperty(nsCSSPropertyID aProperty) const
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"property ID out of range");
nsCSSCompressedDataBlock *data = GetValueIsImportant(aProperty)
? mImportantData : mData;
const nsCSSValue *val = data->ValueFor(aProperty);
return !!val;
}
bool
-Declaration::AppendValueToString(nsCSSProperty aProperty,
+Declaration::AppendValueToString(nsCSSPropertyID aProperty,
nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"property ID out of range");
nsCSSCompressedDataBlock *data = GetValueIsImportant(aProperty)
? mImportantData : mData;
@@ -185,31 +185,31 @@ Declaration::AppendValueToString(nsCSSPr
return false;
}
val->AppendToString(aProperty, aResult, aSerialization);
return true;
}
void
-Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
+Declaration::GetValue(nsCSSPropertyID aProperty, nsAString& aValue) const
{
GetValue(aProperty, aValue, nsCSSValue::eNormalized);
}
void
-Declaration::GetAuthoredValue(nsCSSProperty aProperty, nsAString& aValue) const
+Declaration::GetAuthoredValue(nsCSSPropertyID aProperty, nsAString& aValue) const
{
GetValue(aProperty, aValue, nsCSSValue::eAuthorSpecified);
}
static void
AppendSingleImageLayerPositionValue(const nsCSSValue& aPositionX,
const nsCSSValue& aPositionY,
- const nsCSSProperty aTable[],
+ const nsCSSPropertyID aTable[],
nsAString& aValue,
nsCSSValue::Serialization aSerialization)
{
// We need to make sure that we don't serialize to an invalid 3-value form.
// The 3-value form is only valid if both edges are present.
const nsCSSValue &xEdge = aPositionX.GetArrayValue()->Item(0);
const nsCSSValue &xOffset = aPositionX.GetArrayValue()->Item(1);
const nsCSSValue &yEdge = aPositionY.GetArrayValue()->Item(0);
@@ -236,17 +236,17 @@ AppendSingleImageLayerPositionValue(cons
aValue, aSerialization);
}
void
Declaration::GetImageLayerValue(
nsCSSCompressedDataBlock *data,
nsAString& aValue,
nsCSSValue::Serialization aSerialization,
- const nsCSSProperty aTable[]) const
+ const nsCSSPropertyID aTable[]) const
{
// We know from our caller that all subproperties were specified.
// However, we still can't represent that in the shorthand unless
// they're all lists of the same length. So if they're different
// lengths, we need to bail out.
// We also need to bail out if an item has background-clip and
// background-origin that are different and not the default
// values. (We omit them if they're both default.)
@@ -439,17 +439,17 @@ Declaration::GetImageLayerValue(
}
}
void
Declaration::GetImageLayerPositionValue(
nsCSSCompressedDataBlock *data,
nsAString& aValue,
nsCSSValue::Serialization aSerialization,
- const nsCSSProperty aTable[]) const
+ const nsCSSPropertyID aTable[]) const
{
// We know from above that all subproperties were specified.
// However, we still can't represent that in the shorthand unless
// they're all lists of the same length. So if they're different
// lengths, we need to bail out.
const nsCSSValueList *positionX =
data->ValueFor(aTable[nsStyleImageLayers::positionX])->GetListValue();
const nsCSSValueList *positionY =
@@ -468,17 +468,17 @@ Declaration::GetImageLayerPositionValue(
return;
}
aValue.Append(char16_t(','));
aValue.Append(char16_t(' '));
}
}
void
-Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue,
+Declaration::GetValue(nsCSSPropertyID aProperty, nsAString& aValue,
nsCSSValue::Serialization aSerialization) const
{
aValue.Truncate(0);
// simple properties are easy.
if (!nsCSSProps::IsShorthand(aProperty)) {
AppendValueToString(aProperty, aValue, aSerialization);
return;
@@ -587,17 +587,17 @@ Declaration::GetValue(nsCSSProperty aPro
nsCSSCompressedDataBlock *data = importantCount ? mImportantData : mData;
switch (aProperty) {
case eCSSProperty_margin:
case eCSSProperty_padding:
case eCSSProperty_border_color:
case eCSSProperty_border_style:
case eCSSProperty_border_width: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(nsCSSProps::GetStringValue(subprops[0]).Find("-top") !=
kNotFound, "first subprop must be top");
MOZ_ASSERT(nsCSSProps::GetStringValue(subprops[1]).Find("-right") !=
kNotFound, "second subprop must be right");
MOZ_ASSERT(nsCSSProps::GetStringValue(subprops[2]).Find("-bottom") !=
kNotFound, "third subprop must be bottom");
MOZ_ASSERT(nsCSSProps::GetStringValue(subprops[3]).Find("-left") !=
@@ -609,17 +609,17 @@ Declaration::GetValue(nsCSSProperty aPro
data->ValueFor(subprops[3])
};
nsCSSValue::AppendSidesShorthandToString(subprops, vals, aValue,
aSerialization);
break;
}
case eCSSProperty_border_radius:
case eCSSProperty__moz_outline_radius: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
const nsCSSValue* vals[4] = {
data->ValueFor(subprops[0]),
data->ValueFor(subprops[1]),
data->ValueFor(subprops[2]),
data->ValueFor(subprops[3])
};
nsCSSValue::AppendBasicShapeRadiusToString(subprops, vals, aValue,
@@ -681,23 +681,23 @@ Declaration::GetValue(nsCSSProperty aPro
eCSSUnit_None ||
data->ValueFor(eCSSProperty_border_bottom_colors)->GetUnit() !=
eCSSUnit_None ||
data->ValueFor(eCSSProperty_border_left_colors)->GetUnit() !=
eCSSUnit_None) {
break;
}
- const nsCSSProperty* subproptables[3] = {
+ const nsCSSPropertyID* subproptables[3] = {
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color),
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_style),
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_width)
};
bool match = true;
- for (const nsCSSProperty** subprops = subproptables,
+ for (const nsCSSPropertyID** subprops = subproptables,
**subprops_end = ArrayEnd(subproptables);
subprops < subprops_end; ++subprops) {
const nsCSSValue *firstSide = data->ValueFor((*subprops)[0]);
for (int32_t side = 1; side < 4; ++side) {
const nsCSSValue *otherSide =
data->ValueFor((*subprops)[side]);
if (*firstSide != *otherSide)
match = false;
@@ -716,17 +716,17 @@ Declaration::GetValue(nsCSSProperty aPro
case eCSSProperty_border_bottom:
case eCSSProperty_border_left:
case eCSSProperty_border_inline_start:
case eCSSProperty_border_inline_end:
case eCSSProperty_border_block_start:
case eCSSProperty_border_block_end:
case eCSSProperty__moz_column_rule:
case eCSSProperty_outline: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(StringEndsWith(nsCSSProps::GetStringValue(subprops[2]),
NS_LITERAL_CSTRING("-color")),
"third subprop must be the color property");
const nsCSSValue *colorValue = data->ValueFor(subprops[2]);
bool isMozUseTextColor =
colorValue->GetUnit() == eCSSUnit_Enumerated &&
colorValue->GetIntValue() == NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR;
@@ -885,25 +885,25 @@ Declaration::GetValue(nsCSSProperty aPro
}
aValue.Append(char16_t(' '));
family->AppendToString(eCSSProperty_font_family, aValue,
aSerialization);
}
break;
}
case eCSSProperty_font_variant: {
- const nsCSSProperty *subprops =
+ const nsCSSPropertyID *subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
const nsCSSValue *fontVariantLigatures =
data->ValueFor(eCSSProperty_font_variant_ligatures);
// all subproperty values normal? system font?
bool normalLigs = true, normalNonLigs = true, systemFont = true,
hasSystem = false;
- for (const nsCSSProperty *sp = subprops; *sp != eCSSProperty_UNKNOWN; sp++) {
+ for (const nsCSSPropertyID *sp = subprops; *sp != eCSSProperty_UNKNOWN; sp++) {
const nsCSSValue *spVal = data->ValueFor(*sp);
bool isNormal = (spVal->GetUnit() == eCSSUnit_Normal);
if (*sp == eCSSProperty_font_variant_ligatures) {
normalLigs = normalLigs && isNormal;
} else {
normalNonLigs = normalNonLigs && isNormal;
}
bool isSystem = (spVal->GetUnit() == eCSSUnit_System_Font);
@@ -923,17 +923,17 @@ Declaration::GetValue(nsCSSProperty aPro
aSerialization);
} else if (ligsNone || hasSystem) {
// ligatures none but other values are non-normal ==> empty
// at least one but not all values are system font ==> empty
return;
} else {
// iterate over and append non-normal values
bool appendSpace = false;
- for (const nsCSSProperty *sp = subprops;
+ for (const nsCSSPropertyID *sp = subprops;
*sp != eCSSProperty_UNKNOWN; sp++) {
const nsCSSValue *spVal = data->ValueFor(*sp);
if (spVal && spVal->GetUnit() != eCSSUnit_Normal) {
if (appendSpace) {
aValue.Append(char16_t(' '));
} else {
appendSpace = true;
}
@@ -1062,17 +1062,17 @@ Declaration::GetValue(nsCSSProperty aPro
if (pro || dur || tim || del) {
// Lists not all the same length, can't use shorthand.
aValue.Truncate();
}
}
break;
}
case eCSSProperty_animation: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_animation);
static const size_t numProps = 8;
MOZ_ASSERT(subprops[numProps] == eCSSProperty_UNKNOWN,
"unexpected number of subproperties");
const nsCSSValue* values[numProps];
const nsCSSValueList* lists[numProps];
for (uint32_t i = 0; i < numProps; ++i) {
@@ -1122,63 +1122,63 @@ Declaration::GetValue(nsCSSProperty aPro
const nsCSSValue &startValue =
*data->ValueFor(eCSSProperty_marker_start);
if (endValue == midValue && midValue == startValue)
AppendValueToString(eCSSProperty_marker_end, aValue, aSerialization);
break;
}
case eCSSProperty__moz_columns: {
// Two values, column-count and column-width, separated by a space.
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
AppendValueToString(subprops[0], aValue, aSerialization);
aValue.Append(char16_t(' '));
AppendValueToString(subprops[1], aValue, aSerialization);
break;
}
case eCSSProperty_flex: {
// flex-grow, flex-shrink, flex-basis, separated by single space
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
AppendValueToString(subprops[0], aValue, aSerialization);
aValue.Append(char16_t(' '));
AppendValueToString(subprops[1], aValue, aSerialization);
aValue.Append(char16_t(' '));
AppendValueToString(subprops[2], aValue, aSerialization);
break;
}
case eCSSProperty_flex_flow: {
// flex-direction, flex-wrap, separated by single space
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
"must have exactly two subproperties");
AppendValueToString(subprops[0], aValue, aSerialization);
aValue.Append(char16_t(' '));
AppendValueToString(subprops[1], aValue, aSerialization);
break;
}
case eCSSProperty_grid_row:
case eCSSProperty_grid_column: {
// grid-{row,column}-start, grid-{row,column}-end, separated by a slash
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
"must have exactly two subproperties");
// TODO: should we simplify when possible?
AppendValueToString(subprops[0], aValue, aSerialization);
aValue.AppendLiteral(" / ");
AppendValueToString(subprops[1], aValue, aSerialization);
break;
}
case eCSSProperty_grid_area: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(subprops[4] == eCSSProperty_UNKNOWN,
"must have exactly four subproperties");
// TODO: should we simplify when possible?
AppendValueToString(subprops[0], aValue, aSerialization);
aValue.AppendLiteral(" / ");
AppendValueToString(subprops[1], aValue, aSerialization);
@@ -1333,17 +1333,17 @@ Declaration::GetValue(nsCSSProperty aPro
if (columnsValue.GetUnit() != eCSSUnit_None) {
aValue.AppendLiteral(" / ");
AppendValueToString(eCSSProperty_grid_template_columns,
aValue, aSerialization);
}
break;
}
case eCSSProperty_grid_gap: {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
"must have exactly two subproperties");
nsAutoString val1, val2;
AppendValueToString(subprops[0], val1, aSerialization);
AppendValueToString(subprops[1], val2, aSerialization);
if (val1 == val2) {
@@ -1373,17 +1373,17 @@ Declaration::GetValue(nsCSSProperty aPro
if (!isDefaultColor) {
AppendValueToString(eCSSProperty_text_emphasis_color,
aValue, aSerialization);
}
break;
}
case eCSSProperty__moz_transform: {
// shorthands that are just aliases with different parsing rules
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aProperty);
MOZ_ASSERT(subprops[1] == eCSSProperty_UNKNOWN,
"must have exactly one subproperty");
AppendValueToString(subprops[0], aValue, aSerialization);
break;
}
case eCSSProperty_scroll_snap_type: {
const nsCSSValue& xValue =
@@ -1430,31 +1430,31 @@ Declaration::GetValue(nsCSSProperty aPro
MOZ_ASSERT(false, "no other shorthands");
break;
}
}
bool
Declaration::GetValueIsImportant(const nsAString& aProperty) const
{
- nsCSSProperty propID = nsCSSProps::
+ nsCSSPropertyID propID = nsCSSProps::
LookupProperty(aProperty, CSSEnabledState::eIgnoreEnabledState);
if (propID == eCSSProperty_UNKNOWN) {
return false;
}
if (propID == eCSSPropertyExtra_variable) {
const nsSubstring& variableName =
Substring(aProperty, CSS_CUSTOM_NAME_PREFIX_LENGTH);
return GetVariableValueIsImportant(variableName);
}
return GetValueIsImportant(propID);
}
bool
-Declaration::GetValueIsImportant(nsCSSProperty aProperty) const
+Declaration::GetValueIsImportant(nsCSSPropertyID aProperty) const
{
if (!mImportantData)
return false;
// Calling ValueFor is inefficient, but we can assume '!important' is rare.
if (!nsCSSProps::IsShorthand(aProperty)) {
return mImportantData->ValueFor(aProperty) != nullptr;
@@ -1469,17 +1469,17 @@ Declaration::GetValueIsImportant(nsCSSPr
if (!mImportantData->ValueFor(*p)) {
return false;
}
}
return true;
}
void
-Declaration::AppendPropertyAndValueToString(nsCSSProperty aProperty,
+Declaration::AppendPropertyAndValueToString(nsCSSPropertyID aProperty,
nsAutoString& aValue,
nsAString& aResult) const
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"property enum out of range");
MOZ_ASSERT((aProperty < eCSSProperty_COUNT_no_shorthands) == aValue.IsEmpty(),
"aValue should be given for shorthands but not longhands");
AppendASCIItoUTF16(nsCSSProps::GetStringValue(aProperty), aResult);
@@ -1560,54 +1560,54 @@ Declaration::ToString(nsAString& aString
systemFontData->ValueFor(eCSSProperty__x_system_font);
const bool haveSystemFont = systemFont &&
systemFont->GetUnit() != eCSSUnit_None &&
systemFont->GetUnit() != eCSSUnit_Null;
bool didSystemFont = false;
int32_t count = mOrder.Length();
int32_t index;
- AutoTArray<nsCSSProperty, 16> shorthandsUsed;
+ AutoTArray<nsCSSPropertyID, 16> shorthandsUsed;
for (index = 0; index < count; index++) {
- nsCSSProperty property = GetPropertyAt(index);
+ nsCSSPropertyID property = GetPropertyAt(index);
if (property == eCSSPropertyExtra_variable) {
uint32_t variableIndex = mOrder[index] - eCSSProperty_COUNT;
AppendVariableAndValueToString(mVariableOrder[variableIndex], aString);
continue;
}
if (!nsCSSProps::IsEnabled(property, CSSEnabledState::eForAllContent)) {
continue;
}
bool doneProperty = false;
// If we already used this property in a shorthand, skip it.
if (shorthandsUsed.Length() > 0) {
- for (const nsCSSProperty *shorthands =
+ for (const nsCSSPropertyID *shorthands =
nsCSSProps::ShorthandsContaining(property);
*shorthands != eCSSProperty_UNKNOWN; ++shorthands) {
if (shorthandsUsed.Contains(*shorthands)) {
doneProperty = true;
break;
}
}
if (doneProperty)
continue;
}
// Try to use this property in a shorthand.
nsAutoString value;
- for (const nsCSSProperty *shorthands =
+ for (const nsCSSPropertyID *shorthands =
nsCSSProps::ShorthandsContaining(property);
*shorthands != eCSSProperty_UNKNOWN; ++shorthands) {
// ShorthandsContaining returns the shorthands in order from those
// that contain the most subproperties to those that contain the
// least, which is exactly the order we want to test them.
- nsCSSProperty shorthand = *shorthands;
+ nsCSSPropertyID shorthand = *shorthands;
GetValue(shorthand, value);
// in the system font case, skip over font-variant shorthand, since all
// subproperties are already dealt with via the font shorthand
if (shorthand == eCSSProperty_font_variant &&
value.EqualsLiteral("-moz-use-system-font")) {
continue;
@@ -1686,17 +1686,17 @@ Declaration::List(FILE* out, int32_t aIn
}
#endif
bool
Declaration::GetNthProperty(uint32_t aIndex, nsAString& aReturn) const
{
aReturn.Truncate();
if (aIndex < mOrder.Length()) {
- nsCSSProperty property = GetPropertyAt(aIndex);
+ nsCSSPropertyID property = GetPropertyAt(aIndex);
if (property == eCSSPropertyExtra_variable) {
GetCustomPropertyNameAt(aIndex, aReturn);
return true;
}
if (0 <= property) {
AppendASCIItoUTF16(nsCSSProps::GetStringValue(property), aReturn);
return true;
}
--- a/layout/style/Declaration.h
+++ b/layout/style/Declaration.h
@@ -16,17 +16,17 @@
#ifndef MOZILLA_INTERNAL_API
#error "This file should only be included within libxul"
#endif
#include "mozilla/Attributes.h"
#include "mozilla/MemoryReporting.h"
#include "CSSVariableDeclarations.h"
#include "nsCSSDataBlock.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSProps.h"
#include "nsIStyleRule.h"
#include "nsStringFwd.h"
#include "nsTArray.h"
#include <stdio.h>
// feec07b8-3fe6-491e-90d5-cc93f853e048
#define NS_CSS_DECLARATION_IMPL_CID \
@@ -107,29 +107,29 @@ public:
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
#endif
/**
* |ValueAppended| must be called to maintain this declaration's
* |mOrder| whenever a property is parsed into an expanded data block
* for this declaration. aProperty must not be a shorthand.
*/
- void ValueAppended(nsCSSProperty aProperty);
+ void ValueAppended(nsCSSPropertyID aProperty);
- void RemoveProperty(nsCSSProperty aProperty);
+ void RemoveProperty(nsCSSPropertyID aProperty);
- bool HasProperty(nsCSSProperty aProperty) const;
+ bool HasProperty(nsCSSPropertyID aProperty) const;
- void GetValue(nsCSSProperty aProperty, nsAString& aValue) const;
- void GetAuthoredValue(nsCSSProperty aProperty, nsAString& aValue) const;
+ void GetValue(nsCSSPropertyID aProperty, nsAString& aValue) const;
+ void GetAuthoredValue(nsCSSPropertyID aProperty, nsAString& aValue) const;
bool HasImportantData() const {
return mImportantData || mImportantVariables;
}
- bool GetValueIsImportant(nsCSSProperty aProperty) const;
+ bool GetValueIsImportant(nsCSSPropertyID aProperty) const;
bool GetValueIsImportant(const nsAString& aProperty) const;
/**
* Adds a custom property declaration to this object.
*
* @param aName The variable name (i.e., without the "--" prefix).
* @param aType The type of value the variable has.
* @param aValue The value of the variable, if aType is
@@ -233,17 +233,17 @@ public:
* declaration with the matching value from |aFromBlock|.
* This method may only be called on a mutable declaration.
* It will fail (returning false) if |aProperty| is shorthand,
* is not already in this declaration, or does not have the indicated
* importance level. If it returns true, it erases the value in
* |aFromBlock|. |aChanged| is set to true if the declaration
* changed as a result of the call, and to false otherwise.
*/
- bool TryReplaceValue(nsCSSProperty aProperty, bool aIsImportant,
+ bool TryReplaceValue(nsCSSPropertyID aProperty, bool aIsImportant,
nsCSSExpandedDataBlock& aFromBlock,
bool* aChanged)
{
AssertMutable();
MOZ_ASSERT(mData, "called while expanded");
if (nsCSSProps::IsShorthand(aProperty)) {
*aChanged = false;
@@ -262,17 +262,17 @@ public:
MOZ_ASSERT(!other || !other->ValueFor(aProperty) ||
!block->ValueFor(aProperty),
"Property both important and not?");
}
#endif
return block->TryReplaceValue(aProperty, aFromBlock, aChanged);
}
- bool HasNonImportantValueFor(nsCSSProperty aProperty) const {
+ bool HasNonImportantValueFor(nsCSSPropertyID aProperty) const {
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty), "must be longhand");
return !!mData->ValueFor(aProperty);
}
/**
* Return whether |this| may be modified.
*/
bool IsMutable() const {
@@ -348,55 +348,55 @@ public:
}
return nullptr;
}
private:
Declaration& operator=(const Declaration& aCopy) = delete;
bool operator==(const Declaration& aCopy) const = delete;
- void GetValue(nsCSSProperty aProperty, nsAString& aValue,
+ void GetValue(nsCSSPropertyID aProperty, nsAString& aValue,
nsCSSValue::Serialization aValueSerialization) const;
static void AppendImportanceToString(bool aIsImportant, nsAString& aString);
// return whether there was a value in |aValue| (i.e., it had a non-null unit)
- bool AppendValueToString(nsCSSProperty aProperty, nsAString& aResult) const;
- bool AppendValueToString(nsCSSProperty aProperty, nsAString& aResult,
+ bool AppendValueToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
+ bool AppendValueToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
// Helper for ToString with strange semantics regarding aValue.
- void AppendPropertyAndValueToString(nsCSSProperty aProperty,
+ void AppendPropertyAndValueToString(nsCSSPropertyID aProperty,
nsAutoString& aValue,
nsAString& aResult) const;
// helper for ToString that serializes a custom property declaration for
// a variable with the specified name
void AppendVariableAndValueToString(const nsAString& aName,
nsAString& aResult) const;
void GetImageLayerValue(nsCSSCompressedDataBlock *data,
nsAString& aValue,
nsCSSValue::Serialization aSerialization,
- const nsCSSProperty aTable[]) const;
+ const nsCSSPropertyID aTable[]) const;
void GetImageLayerPositionValue(nsCSSCompressedDataBlock *data,
nsAString& aValue,
nsCSSValue::Serialization aSerialization,
- const nsCSSProperty aTable[]) const;
+ const nsCSSPropertyID aTable[]) const;
public:
/**
* Returns the property at the given index in the ordered list of
* declarations. For custom properties, eCSSPropertyExtra_variable
* is returned.
*/
- nsCSSProperty GetPropertyAt(uint32_t aIndex) const {
+ nsCSSPropertyID GetPropertyAt(uint32_t aIndex) const {
uint32_t value = mOrder[aIndex];
if (value >= eCSSProperty_COUNT) {
return eCSSPropertyExtra_variable;
}
- return nsCSSProperty(value);
+ return nsCSSPropertyID(value);
}
/**
* Gets the name of the custom property at the given index in the ordered
* list of declarations.
*/
void GetCustomPropertyNameAt(uint32_t aIndex, nsAString& aResult) const {
MOZ_ASSERT(mOrder[aIndex] >= eCSSProperty_COUNT);
@@ -405,17 +405,17 @@ public:
aResult.AppendLiteral("--");
aResult.Append(mVariableOrder[variableIndex]);
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
private:
// The order of properties in this declaration. Longhand properties are
- // represented by their nsCSSProperty value, and each custom property (--*)
+ // represented by their nsCSSPropertyID value, and each custom property (--*)
// is represented by a value that begins at eCSSProperty_COUNT.
//
// Subtracting eCSSProperty_COUNT from those values that represent custom
// properties results in an index into mVariableOrder, which identifies the
// specific variable the custom property declaration is for.
AutoTArray<uint32_t, 8> mOrder;
// variable names of custom properties found in mOrder
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -592,17 +592,17 @@ FontFace::GetDesc(nsCSSFontDesc aDescID,
mRule->GetDesc(aDescID, aResult);
} else {
aResult = mDescriptors->Get(aDescID);
}
}
void
FontFace::GetDesc(nsCSSFontDesc aDescID,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
nsString& aResult) const
{
MOZ_ASSERT(aDescID == eCSSFontDesc_UnicodeRange ||
aDescID == eCSSFontDesc_Display ||
aPropID != eCSSProperty_UNKNOWN,
"only pass eCSSProperty_UNKNOWN for eCSSFontDesc_UnicodeRange");
nsCSSValue value;
--- a/layout/style/FontFace.h
+++ b/layout/style/FontFace.h
@@ -4,17 +4,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_FontFace_h
#define mozilla_dom_FontFace_h
#include "mozilla/dom/FontFaceBinding.h"
#include "gfxUserFontSet.h"
#include "nsAutoPtr.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
#include "nsWrapperCache.h"
class gfxFontFaceBufferSource;
class nsCSSFontFaceRule;
namespace mozilla {
struct CSSFontFaceDescriptors;
@@ -186,17 +186,17 @@ private:
const FontFaceDescriptors& aDescriptors);
/**
* Sets the current loading status.
*/
void SetStatus(mozilla::dom::FontFaceLoadStatus aStatus);
void GetDesc(nsCSSFontDesc aDescID,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
nsString& aResult) const;
/**
* Returns and takes ownership of the buffer storing the font data.
*/
void TakeBuffer(uint8_t*& aBuffer, uint32_t& aLength);
nsCOMPtr<nsISupports> mParent;
--- a/layout/style/GenerateCSSPropsGenerated.py
+++ b/layout/style/GenerateCSSPropsGenerated.py
@@ -15,17 +15,17 @@ def get_properties(preprocessorHeader):
cpp.append(preprocessorHeader)
preprocessed = subprocess.check_output(cpp)
properties = [{"name":p[0], "prop":p[1], "id":p[2],
"flags":p[3], "pref":p[4], "proptype":p[5]}
for (i, p) in enumerate(eval(preprocessed))]
# Sort the list so that longhand and logical properties are intermingled
# first, shorthand properties follow, then aliases appear last. This matches
- # the order of the nsCSSProperty enum.
+ # the order of the nsCSSPropertyID enum.
def property_compare(x, y):
property_order = {"longhand": 0, "logical": 0, "shorthand": 1, "alias": 2}
return property_order[x["proptype"]] - property_order[y["proptype"]]
properties = sorted(properties, cmp=property_compare)
for i, p in enumerate(properties):
@@ -56,30 +56,30 @@ def generate_idl_names(properties):
def generate_assertions(properties):
def enum(p):
if p["proptype"] is "alias":
return "eCSSPropertyAlias_%s" % p["prop"]
else:
return "eCSSProperty_%s" % p["id"]
msg = ('static_assert(%s == %d, "GenerateCSSPropsGenerated.py did not list '
- 'properties in nsCSSProperty order");')
+ 'properties in nsCSSPropertyID order");')
return "\n".join(map(lambda p: msg % (enum(p), p["index"]), properties))
def generate_idl_name_positions(properties):
# Skip aliases.
ps = filter(lambda p: p["proptype"] is not "alias", properties)
# Sort alphabetically by IDL name.
ps = sorted(ps, key=lambda p: p["idlname"])
# Annotate entries with the sorted position.
ps = [(p, position) for position, p in enumerate(ps)]
- # Sort back to nsCSSProperty order.
+ # Sort back to nsCSSPropertyID order.
ps = sorted(ps, key=lambda (p, position): p["index"])
return ",\n".join(map(lambda (p, position): " %d" % position, ps))
def generate(output, cppTemplate, preprocessorHeader):
cppFile = open(cppTemplate, "r")
cppTemplate = cppFile.read()
cppFile.close()
--- a/layout/style/LayerAnimationInfo.cpp
+++ b/layout/style/LayerAnimationInfo.cpp
@@ -25,19 +25,19 @@ LayerAnimationInfo::Initialize()
MOZ_ASSERT(nsCSSProps::PropHasFlags(record.mProperty,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
"CSS property with entry in LayerAnimation::sRecords does not "
"have the CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR flag");
}
// Check that every property with the flag for animating on the
// compositor has an entry in LayerAnimationInfo::sRecords.
- for (nsCSSProperty prop = nsCSSProperty(0);
+ for (nsCSSPropertyID prop = nsCSSPropertyID(0);
prop < eCSSProperty_COUNT;
- prop = nsCSSProperty(prop + 1)) {
+ prop = nsCSSPropertyID(prop + 1)) {
if (nsCSSProps::PropHasFlags(prop,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR)) {
bool found = false;
for (const Record& record : sRecords) {
if (record.mProperty == prop) {
found = true;
break;
}
--- a/layout/style/LayerAnimationInfo.h
+++ b/layout/style/LayerAnimationInfo.h
@@ -2,29 +2,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_LayerAnimationInfo_h
#define mozilla_LayerAnimationInfo_h
#include "nsChangeHint.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsDisplayList.h" // For nsDisplayItem::Type
namespace mozilla {
struct LayerAnimationInfo {
#ifdef DEBUG
static void Initialize();
#endif
// For CSS properties that may be animated on a separate layer, represents
// a record of the corresponding layer type and change hint.
struct Record {
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
nsDisplayItem::Type mLayerType;
nsChangeHint mChangeHint;
};
static const size_t kRecords = 2;
static const Record sRecords[kRecords];
};
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -48,17 +48,17 @@ using namespace mozilla::gfx;
*
* @param aFirstUnit One unit to resolve.
* @param aFirstUnit The other unit to resolve.
* @return A "common" unit that both source units can be converted into, or
* eUnit_Null if that's not possible.
*/
static
StyleAnimationValue::Unit
-GetCommonUnit(nsCSSProperty aProperty,
+GetCommonUnit(nsCSSPropertyID aProperty,
StyleAnimationValue::Unit aFirstUnit,
StyleAnimationValue::Unit aSecondUnit)
{
if (aFirstUnit != aSecondUnit) {
if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_STORES_CALC) &&
(aFirstUnit == StyleAnimationValue::eUnit_Coord ||
aFirstUnit == StyleAnimationValue::eUnit_Percent ||
aFirstUnit == StyleAnimationValue::eUnit_Calc) &&
@@ -70,17 +70,17 @@ GetCommonUnit(nsCSSProperty aProperty,
}
return StyleAnimationValue::eUnit_Null;
}
return aFirstUnit;
}
static
nsCSSUnit
-GetCommonUnit(nsCSSProperty aProperty,
+GetCommonUnit(nsCSSPropertyID aProperty,
nsCSSUnit aFirstUnit,
nsCSSUnit aSecondUnit)
{
if (aFirstUnit != aSecondUnit) {
if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_STORES_CALC) &&
(aFirstUnit == eCSSUnit_Pixel ||
aFirstUnit == eCSSUnit_Percent ||
aFirstUnit == eCSSUnit_Calc) &&
@@ -478,17 +478,17 @@ CalcPositionCoordSquareDistance(const ns
float diffpct = calcVal2.mPercent - calcVal1.mPercent;
return difflen * difflen + diffpct * diffpct;
}
// CLASS METHODS
// -------------
bool
-StyleAnimationValue::ComputeDistance(nsCSSProperty aProperty,
+StyleAnimationValue::ComputeDistance(nsCSSPropertyID aProperty,
const StyleAnimationValue& aStartValue,
const StyleAnimationValue& aEndValue,
double& aDistance)
{
Unit commonUnit =
GetCommonUnit(aProperty, aStartValue.GetUnit(), aEndValue.GetUnit());
switch (commonUnit) {
@@ -1012,17 +1012,17 @@ RestrictValue(uint32_t aRestrictions, T
MOZ_ASSERT(false, "bad value restriction");
break;
}
return result;
}
template <typename T>
T
-RestrictValue(nsCSSProperty aProperty, T aValue)
+RestrictValue(nsCSSPropertyID aProperty, T aValue)
{
return RestrictValue(nsCSSProps::ValueRestrictions(aProperty), aValue);
}
static inline void
AddCSSValuePixel(double aCoeff1, const nsCSSValue &aValue1,
double aCoeff2, const nsCSSValue &aValue2,
nsCSSValue &aResult, uint32_t aValueRestrictions = 0)
@@ -1834,17 +1834,17 @@ AddPositions(double aCoeff1, const nsCSS
const nsCSSValue& v2 = posArray2->Item(i);
nsCSSValue& vr = resultPosArray->Item(i);
AddCSSValueCanonicalCalc(aCoeff1, v1,
aCoeff2, v2, vr);
}
}
static Maybe<nsCSSValuePair>
-AddCSSValuePair(nsCSSProperty aProperty, uint32_t aRestrictions,
+AddCSSValuePair(nsCSSPropertyID aProperty, uint32_t aRestrictions,
double aCoeff1, const nsCSSValuePair* aPair1,
double aCoeff2, const nsCSSValuePair* aPair2)
{
MOZ_ASSERT(aPair1, "expected pair");
MOZ_ASSERT(aPair2, "expected pair");
Maybe<nsCSSValuePair> result;
nsCSSUnit unit[2];
@@ -1873,17 +1873,17 @@ AddCSSValuePair(nsCSSProperty aProperty,
return result; // Nothing() (returning |result| for RVO)
}
}
return result;
}
static UniquePtr<nsCSSValuePairList>
-AddCSSValuePairList(nsCSSProperty aProperty,
+AddCSSValuePairList(nsCSSPropertyID aProperty,
double aCoeff1, const nsCSSValuePairList* aList1,
double aCoeff2, const nsCSSValuePairList* aList2)
{
MOZ_ASSERT(aList1, "Can't add a null list");
MOZ_ASSERT(aList2, "Can't add a null list");
auto result = MakeUnique<nsCSSValuePairList>();
nsCSSValuePairList* resultPtr = result.get();
@@ -1925,17 +1925,17 @@ AddCSSValuePairList(nsCSSProperty aPrope
if (aList1 || aList2) {
return nullptr; // We can't interpolate lists of different lengths
}
return result;
}
static already_AddRefed<nsCSSValue::Array>
-AddShapeFunction(nsCSSProperty aProperty,
+AddShapeFunction(nsCSSPropertyID aProperty,
double aCoeff1, const nsCSSValue::Array* aArray1,
double aCoeff2, const nsCSSValue::Array* aArray2)
{
MOZ_ASSERT(aArray1 && aArray1->Count() == 2, "expected shape function");
MOZ_ASSERT(aArray2 && aArray2->Count() == 2, "expected shape function");
MOZ_ASSERT(aArray1->Item(0).GetUnit() == eCSSUnit_Function,
"expected function");
MOZ_ASSERT(aArray2->Item(0).GetUnit() == eCSSUnit_Function,
@@ -2239,17 +2239,17 @@ AddPositionCoords(double aCoeff1, const
const nsCSSValue& v1 = posArray1->Item(1);
const nsCSSValue& v2 = posArray2->Item(1);
nsCSSValue& vr = resultPosArray->Item(1);
AddCSSValueCanonicalCalc(aCoeff1, v1,
aCoeff2, v2, vr);
}
bool
-StyleAnimationValue::AddWeighted(nsCSSProperty aProperty,
+StyleAnimationValue::AddWeighted(nsCSSPropertyID aProperty,
double aCoeff1,
const StyleAnimationValue& aValue1,
double aCoeff2,
const StyleAnimationValue& aValue2,
StyleAnimationValue& aResultValue)
{
Unit commonUnit =
GetCommonUnit(aProperty, aValue1.GetUnit(), aValue2.GetUnit());
@@ -2748,31 +2748,31 @@ StyleAnimationValue::AddWeighted(nsCSSPr
}
}
MOZ_ASSERT(false, "Can't interpolate using the given common unit");
return false;
}
already_AddRefed<css::StyleRule>
-BuildStyleRule(nsCSSProperty aProperty,
+BuildStyleRule(nsCSSPropertyID aProperty,
dom::Element* aTargetElement,
const nsAString& aSpecifiedValue,
bool aUseSVGMode)
{
// Set up an empty CSS Declaration
RefPtr<css::Declaration> declaration(new css::Declaration());
declaration->InitializeEmpty();
bool changed; // ignored, but needed as outparam for ParseProperty
nsIDocument* doc = aTargetElement->OwnerDoc();
nsCOMPtr<nsIURI> baseURI = aTargetElement->GetBaseURI();
nsCSSParser parser(doc->CSSLoader());
- nsCSSProperty propertyToCheck = nsCSSProps::IsShorthand(aProperty) ?
+ nsCSSPropertyID propertyToCheck = nsCSSProps::IsShorthand(aProperty) ?
nsCSSProps::SubpropertyEntryFor(aProperty)[0] : aProperty;
// Get a parser, parse the property, and check for CSS parsing errors.
// If this fails, we bail out and delete the declaration.
parser.ParseProperty(aProperty, aSpecifiedValue, doc->GetDocumentURI(),
baseURI, aTargetElement->NodePrincipal(), declaration,
&changed, false, aUseSVGMode);
@@ -2783,17 +2783,17 @@ BuildStyleRule(nsCSSProperty aProperty,
RefPtr<css::StyleRule> rule = new css::StyleRule(nullptr,
declaration,
0, 0);
return rule.forget();
}
already_AddRefed<css::StyleRule>
-BuildStyleRule(nsCSSProperty aProperty,
+BuildStyleRule(nsCSSPropertyID aProperty,
dom::Element* aTargetElement,
const nsCSSValue& aSpecifiedValue,
bool aUseSVGMode)
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
"Should be a longhand property");
// Check if longhand failed to parse correctly.
@@ -2812,17 +2812,17 @@ BuildStyleRule(nsCSSProperty aProperty,
declaration->ValueAppended(aProperty);
declaration->CompressFrom(&block);
RefPtr<css::StyleRule> rule = new css::StyleRule(nullptr, declaration, 0, 0);
return rule.forget();
}
static bool
-ComputeValuesFromStyleRule(nsCSSProperty aProperty,
+ComputeValuesFromStyleRule(nsCSSPropertyID aProperty,
CSSEnabledState aEnabledState,
dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
css::StyleRule* aStyleRule,
nsTArray<PropertyStyleAnimationValuePair>& aValues,
bool* aIsContextSensitive)
{
MOZ_ASSERT(aStyleContext);
@@ -2900,17 +2900,17 @@ ComputeValuesFromStyleRule(nsCSSProperty
PropertyStyleAnimationValuePair* pair = aValues.AppendElement();
pair->mProperty = aProperty;
return StyleAnimationValue::ExtractComputedValue(aProperty, tmpStyleContext,
pair->mValue);
}
}
/* static */ bool
-StyleAnimationValue::ComputeValue(nsCSSProperty aProperty,
+StyleAnimationValue::ComputeValue(nsCSSPropertyID aProperty,
dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsAString& aSpecifiedValue,
bool aUseSVGMode,
StyleAnimationValue& aComputedValue,
bool* aIsContextSensitive)
{
MOZ_ASSERT(aTargetElement, "null target element");
@@ -2951,17 +2951,17 @@ StyleAnimationValue::ComputeValue(nsCSSP
aComputedValue = values[0].mValue;
return true;
}
template <class T>
bool
ComputeValuesFromSpecifiedValue(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
CSSEnabledState aEnabledState,
dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
T& aSpecifiedValue,
bool aUseSVGMode,
nsTArray<PropertyStyleAnimationValuePair>& aResult)
{
MOZ_ASSERT(aTargetElement, "null target element");
@@ -2979,48 +2979,48 @@ ComputeValuesFromSpecifiedValue(
aResult.Clear();
return ComputeValuesFromStyleRule(aProperty, aEnabledState, aTargetElement,
aStyleContext, styleRule, aResult,
/* aIsContextSensitive */ nullptr);
}
/* static */ bool
StyleAnimationValue::ComputeValues(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
CSSEnabledState aEnabledState,
dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsAString& aSpecifiedValue,
bool aUseSVGMode,
nsTArray<PropertyStyleAnimationValuePair>& aResult)
{
return ComputeValuesFromSpecifiedValue(aProperty, aEnabledState,
aTargetElement, aStyleContext,
aSpecifiedValue, aUseSVGMode,
aResult);
}
/* static */ bool
StyleAnimationValue::ComputeValues(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
CSSEnabledState aEnabledState,
dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsCSSValue& aSpecifiedValue,
bool aUseSVGMode,
nsTArray<PropertyStyleAnimationValuePair>& aResult)
{
return ComputeValuesFromSpecifiedValue(aProperty, aEnabledState,
aTargetElement, aStyleContext,
aSpecifiedValue, aUseSVGMode,
aResult);
}
bool
-StyleAnimationValue::UncomputeValue(nsCSSProperty aProperty,
+StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty,
const StyleAnimationValue& aComputedValue,
nsCSSValue& aSpecifiedValue)
{
Unit unit = aComputedValue.GetUnit();
switch (unit) {
case eUnit_Normal:
aSpecifiedValue.SetNormalValue();
break;
@@ -3126,17 +3126,17 @@ StyleAnimationValue::UncomputeValue(nsCS
break;
default:
return false;
}
return true;
}
bool
-StyleAnimationValue::UncomputeValue(nsCSSProperty aProperty,
+StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty,
StyleAnimationValue&& aComputedValue,
nsCSSValue& aSpecifiedValue)
{
Unit unit = aComputedValue.GetUnit();
switch (unit) {
case eUnit_Dasharray:
case eUnit_Shadow:
case eUnit_Filter:
@@ -3161,17 +3161,17 @@ StyleAnimationValue::UncomputeValue(nsCS
break;
default:
return UncomputeValue(aProperty, aComputedValue, aSpecifiedValue);
}
return true;
}
bool
-StyleAnimationValue::UncomputeValue(nsCSSProperty aProperty,
+StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty,
const StyleAnimationValue& aComputedValue,
nsAString& aSpecifiedValue)
{
aSpecifiedValue.Truncate(); // Clear outparam, if it's not already empty
if (aComputedValue.GetUnit() == eUnit_UnparsedString) {
aComputedValue.GetStringValue(aSpecifiedValue);
return true;
@@ -3579,17 +3579,17 @@ StyleClipBasicShapeToCSSArray(const Styl
return false;
}
aResult->Item(1).SetIntValue(aClipPath.GetReferenceBox(),
eCSSUnit_Enumerated);
return true;
}
bool
-StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty,
+StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
nsStyleContext* aStyleContext,
StyleAnimationValue& aComputedValue)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"bad property");
const void* styleStruct =
aStyleContext->StyleData(nsCSSProps::kSIDTable[aProperty]);
ptrdiff_t ssOffset = nsCSSProps::kStyleStructOffsetTable[aProperty];
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -48,17 +48,17 @@ public:
* Note that if |aCount| is 0, then |aDest| will be unchanged. Also, if
* this method fails, then |aDest| will be unchanged.
*
* @param aDest The value to add to.
* @param aValueToAdd The value to add.
* @param aCount The number of times to add aValueToAdd.
* @return true on success, false on failure.
*/
- static bool Add(nsCSSProperty aProperty, StyleAnimationValue& aDest,
+ static bool Add(nsCSSPropertyID aProperty, StyleAnimationValue& aDest,
const StyleAnimationValue& aValueToAdd, uint32_t aCount) {
return AddWeighted(aProperty, 1.0, aDest, aCount, aValueToAdd, aDest);
}
/**
* Calculates a measure of 'distance' between two values.
*
* This measure of Distance is guaranteed to be proportional to
@@ -71,17 +71,17 @@ public:
*
* @param aStartValue The start of the interval for which the distance
* should be calculated.
* @param aEndValue The end of the interval for which the distance
* should be calculated.
* @param aDistance The result of the calculation.
* @return true on success, false on failure.
*/
- static bool ComputeDistance(nsCSSProperty aProperty,
+ static bool ComputeDistance(nsCSSPropertyID aProperty,
const StyleAnimationValue& aStartValue,
const StyleAnimationValue& aEndValue,
double& aDistance);
/**
* Calculates an interpolated value that is the specified |aPortion| between
* the two given values.
*
@@ -92,17 +92,17 @@ public:
* interpolation.
* @param aEndValue The value defining the end of the interval of
* interpolation.
* @param aPortion A number in the range [0.0, 1.0] defining the
* distance of the interpolated value in the interval.
* @param [out] aResultValue The resulting interpolated value.
* @return true on success, false on failure.
*/
- static bool Interpolate(nsCSSProperty aProperty,
+ static bool Interpolate(nsCSSPropertyID aProperty,
const StyleAnimationValue& aStartValue,
const StyleAnimationValue& aEndValue,
double aPortion,
StyleAnimationValue& aResultValue) {
return AddWeighted(aProperty, 1.0 - aPortion, aStartValue,
aPortion, aEndValue, aResultValue);
}
@@ -115,17 +115,17 @@ public:
* @return true on success, false on failure.
*
* NOTE: Current callers always pass aCoeff1 and aCoeff2 >= 0. They
* are currently permitted to be negative; however, if, as we add
* support more value types types, we find that this causes
* difficulty, we might change this to restrict them to being
* positive.
*/
- static bool AddWeighted(nsCSSProperty aProperty,
+ static bool AddWeighted(nsCSSPropertyID aProperty,
double aCoeff1, const StyleAnimationValue& aValue1,
double aCoeff2, const StyleAnimationValue& aValue2,
StyleAnimationValue& aResultValue);
// Type-conversion methods
// -----------------------
/**
* Creates a computed value for the given specified value
@@ -152,17 +152,17 @@ public:
* a different |aComputedValue| depending on other CSS
* properties on |aTargetElement| or its ancestors.
* false otherwise.
* Note that the operation of this method is
* significantly faster when |aIsContextSensitive| is
* nullptr.
* @return true on success, false on failure.
*/
- static bool ComputeValue(nsCSSProperty aProperty,
+ static bool ComputeValue(nsCSSPropertyID aProperty,
mozilla::dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsAString& aSpecifiedValue,
bool aUseSVGMode,
StyleAnimationValue& aComputedValue,
bool* aIsContextSensitive = nullptr);
/**
@@ -170,29 +170,29 @@ public:
*
* On success, when aProperty is a longhand, aResult will have a single
* value in it. When aProperty is a shorthand, aResult will be filled with
* values for all of aProperty's longhand components. aEnabledState
* is used to filter the longhand components that will be appended
* to aResult. On failure, aResult might still have partial results
* in it.
*/
- static bool ComputeValues(nsCSSProperty aProperty,
+ static bool ComputeValues(nsCSSPropertyID aProperty,
mozilla::CSSEnabledState aEnabledState,
mozilla::dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsAString& aSpecifiedValue,
bool aUseSVGMode,
nsTArray<PropertyStyleAnimationValuePair>& aResult);
/**
* A variant on ComputeValues that takes an nsCSSValue as the specified
* value. Only longhand properties are supported.
*/
- static bool ComputeValues(nsCSSProperty aProperty,
+ static bool ComputeValues(nsCSSPropertyID aProperty,
mozilla::CSSEnabledState aEnabledState,
mozilla::dom::Element* aTargetElement,
nsStyleContext* aStyleContext,
const nsCSSValue& aSpecifiedValue,
bool aUseSVGMode,
nsTArray<PropertyStyleAnimationValuePair>& aResult);
/**
@@ -207,23 +207,23 @@ public:
* transfers ownership for some resources such that the |aComputedValue|
* does not depend on the lifetime of |aSpecifiedValue|.
*
* @param aProperty The property whose value we're uncomputing.
* @param aComputedValue The computed value to be converted.
* @param [out] aSpecifiedValue The resulting specified value.
* @return true on success, false on failure.
*/
- static bool UncomputeValue(nsCSSProperty aProperty,
+ static bool UncomputeValue(nsCSSPropertyID aProperty,
const StyleAnimationValue& aComputedValue,
nsCSSValue& aSpecifiedValue);
- static bool UncomputeValue(nsCSSProperty aProperty,
+ static bool UncomputeValue(nsCSSPropertyID aProperty,
StyleAnimationValue&& aComputedValue,
nsCSSValue& aSpecifiedValue);
- static bool UncomputeValue(nsCSSProperty aProperty,
+ static bool UncomputeValue(nsCSSPropertyID aProperty,
const StyleAnimationValue& aComputedValue,
nsAString& aSpecifiedValue);
/**
* Gets the computed value for the given property from the given style
* context.
*
* Obtaining the computed value allows us to animate properties when the
@@ -231,17 +231,17 @@ public:
* other keyword that isn't directly interpolatable, but which *computes* to
* something interpolatable.
*
* @param aProperty The property whose value we're looking up.
* @param aStyleContext The style context to check for the computed value.
* @param [out] aComputedValue The resulting computed value.
* @return true on success, false on failure.
*/
- static bool ExtractComputedValue(nsCSSProperty aProperty,
+ static bool ExtractComputedValue(nsCSSPropertyID aProperty,
nsStyleContext* aStyleContext,
StyleAnimationValue& aComputedValue);
/**
* Interpolates between 2 matrices by decomposing them.
*
* @param aMatrix1 First matrix, using CSS pixel units.
* @param aMatrix2 Second matrix, using CSS pixel units.
@@ -504,15 +504,15 @@ private:
}
static bool IsStringUnit(Unit aUnit) {
return aUnit == eUnit_UnparsedString;
}
};
struct PropertyStyleAnimationValuePair
{
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
StyleAnimationValue mValue;
};
} // namespace mozilla
#endif
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -37,17 +37,17 @@ EXPORTS += [
'nsCSSAnonBoxes.h',
'nsCSSAnonBoxList.h',
'nsCSSCounterDescList.h',
'nsCSSFontDescList.h',
'nsCSSKeywordList.h',
'nsCSSKeywords.h',
'nsCSSParser.h',
'nsCSSPropAliasList.h',
- 'nsCSSProperty.h',
+ 'nsCSSPropertyID.h',
'nsCSSPropertySet.h',
'nsCSSPropList.h',
'nsCSSPropLogicalGroupList.h',
'nsCSSProps.h',
'nsCSSPseudoClasses.h',
'nsCSSPseudoClassList.h',
'nsCSSPseudoElementList.h',
'nsCSSPseudoElements.h',
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -553,20 +553,20 @@ private:
void FillInMissingKeyframeValues(
nsPresContext* aPresContext,
nsCSSPropertySet aAnimatedProperties,
nsCSSPropertySet aPropertiesSetAtStart,
nsCSSPropertySet aPropertiesSetAtEnd,
const Maybe<ComputedTimingFunction>& aInheritedTimingFunction,
nsTArray<Keyframe>& aKeyframes);
void AppendProperty(nsPresContext* aPresContext,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsTArray<PropertyValuePair>& aPropertyValues);
nsCSSValue GetComputedValue(nsPresContext* aPresContext,
- nsCSSProperty aProperty);
+ nsCSSPropertyID aProperty);
static TimingParams TimingParamsFrom(
const StyleAnimation& aStyleAnimation)
{
TimingParams timing;
timing.mDuration.emplace(StickyTimeDuration::FromMilliseconds(
aStyleAnimation.GetDuration()));
@@ -876,19 +876,19 @@ CSSAnimationBuilder::GetKeyframeProperty
nsCSSKeyframeRule* aKeyframeRule,
nsCSSPropertySet& aAnimatedProperties)
{
nsTArray<PropertyValuePair> result;
RefPtr<nsStyleContext> styleContext =
mResolvedStyles.Get(aPresContext, mStyleContext,
aKeyframeRule->Declaration());
- for (nsCSSProperty prop = nsCSSProperty(0);
+ for (nsCSSPropertyID prop = nsCSSPropertyID(0);
prop < eCSSProperty_COUNT_no_shorthands;
- prop = nsCSSProperty(prop + 1)) {
+ prop = nsCSSPropertyID(prop + 1)) {
if (nsCSSProps::kAnimTypeTable[prop] == eStyleAnimType_None ||
!aKeyframeRule->Declaration()->HasNonImportantValueFor(prop)) {
continue;
}
PropertyValuePair pair;
pair.mProperty = prop;
@@ -992,48 +992,48 @@ CSSAnimationBuilder::FillInMissingKeyfra
// Now that we have finished manipulating aKeyframes, it is safe to
// take pointers to its elements.
Keyframe* startKeyframe = startKeyframeIndex == kNotSet
? nullptr : &aKeyframes[startKeyframeIndex];
Keyframe* endKeyframe = endKeyframeIndex == kNotSet
? nullptr : &aKeyframes[endKeyframeIndex];
// Iterate through all properties and fill-in missing values
- for (nsCSSProperty prop = nsCSSProperty(0);
+ for (nsCSSPropertyID prop = nsCSSPropertyID(0);
prop < eCSSProperty_COUNT_no_shorthands;
- prop = nsCSSProperty(prop + 1)) {
+ prop = nsCSSPropertyID(prop + 1)) {
if (!aAnimatedProperties.HasProperty(prop)) {
continue;
}
if (startKeyframe && !aPropertiesSetAtStart.HasProperty(prop)) {
AppendProperty(aPresContext, prop, startKeyframe->mPropertyValues);
}
if (endKeyframe && !aPropertiesSetAtEnd.HasProperty(prop)) {
AppendProperty(aPresContext, prop, endKeyframe->mPropertyValues);
}
}
}
void
CSSAnimationBuilder::AppendProperty(
nsPresContext* aPresContext,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsTArray<PropertyValuePair>& aPropertyValues)
{
PropertyValuePair propertyValue;
propertyValue.mProperty = aProperty;
propertyValue.mValue = GetComputedValue(aPresContext, aProperty);
aPropertyValues.AppendElement(Move(propertyValue));
}
nsCSSValue
CSSAnimationBuilder::GetComputedValue(nsPresContext* aPresContext,
- nsCSSProperty aProperty)
+ nsCSSPropertyID aProperty)
{
nsCSSValue result;
StyleAnimationValue computedValue;
if (!mStyleWithoutAnimation) {
MOZ_ASSERT(aPresContext->StyleSet()->IsGecko(),
"ServoStyleSet should not use nsAnimationManager for "
"animations");
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -50,17 +50,17 @@ ShouldIgnoreColors(nsRuleData *aRuleData
}
/**
* Tries to call |nsCSSValue::StartImageLoad()| on an image source.
* Image sources are specified by |url()| or |-moz-image-rect()| function.
*/
static void
TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
- nsStyleContext* aContext, nsCSSProperty aProperty,
+ nsStyleContext* aContext, nsCSSPropertyID aProperty,
bool aForTokenStream)
{
MOZ_ASSERT(aDocument);
if (aValue.GetUnit() == eCSSUnit_URL) {
#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
// The 'mask-image' property accepts local reference URIs.
// For example,
@@ -120,17 +120,17 @@ TryToStartImageLoadOnValue(const nsCSSVa
const nsCSSValue& image = arguments->Item(1);
TryToStartImageLoadOnValue(image, aDocument, aContext, aProperty,
aForTokenStream);
}
}
static void
TryToStartImageLoad(const nsCSSValue& aValue, nsIDocument* aDocument,
- nsStyleContext* aContext, nsCSSProperty aProperty,
+ nsStyleContext* aContext, nsCSSPropertyID aProperty,
bool aForTokenStream)
{
if (aValue.GetUnit() == eCSSUnit_List) {
for (const nsCSSValueList* l = aValue.GetListValue(); l; l = l->mNext) {
TryToStartImageLoad(l->mValue, aDocument, aContext, aProperty,
aForTokenStream);
}
} else if (nsCSSProps::PropHasFlags(aProperty,
@@ -141,31 +141,31 @@ TryToStartImageLoad(const nsCSSValue& aV
}
} else {
TryToStartImageLoadOnValue(aValue, aDocument, aContext, aProperty,
aForTokenStream);
}
}
static inline bool
-ShouldStartImageLoads(nsRuleData *aRuleData, nsCSSProperty aProperty)
+ShouldStartImageLoads(nsRuleData *aRuleData, nsCSSPropertyID aProperty)
{
// Don't initiate image loads for if-visited styles. This is
// important because:
// (1) it's a waste of CPU and bandwidth
// (2) in some cases we'd start the image load on a style change
// 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 aTargetProp,
+MapSinglePropertyInto(nsCSSPropertyID aTargetProp,
const nsCSSValue* aSrcValue,
nsCSSValue* aTargetValue,
nsRuleData* aRuleData)
{
MOZ_ASSERT(!nsCSSProps::PropHasFlags(aTargetProp, CSS_PROPERTY_LOGICAL),
"Can't map into a logical property");
MOZ_ASSERT(aSrcValue->GetUnit() != eCSSUnit_Null, "oops");
@@ -207,17 +207,17 @@ MapSinglePropertyInto(nsCSSProperty aTar
}
/**
* If aProperty is a logical property, converts it to the equivalent physical
* property based on writing mode information obtained from aRuleData's
* style context.
*/
static inline void
-EnsurePhysicalProperty(nsCSSProperty& aProperty, nsRuleData* aRuleData)
+EnsurePhysicalProperty(nsCSSPropertyID& aProperty, nsRuleData* aRuleData)
{
bool isAxisProperty =
nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_AXIS);
bool isBlock =
nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_BLOCK_AXIS);
int index;
@@ -253,17 +253,17 @@ EnsurePhysicalProperty(nsCSSProperty& aP
// We rely on the physical side constant values matching the order of
// the physical properties in the logical group array.
static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
"unexpected side constant values");
index = side;
}
- const nsCSSProperty* props = nsCSSProps::LogicalGroup(aProperty);
+ const nsCSSPropertyID* props = nsCSSProps::LogicalGroup(aProperty);
size_t len = isAxisProperty ? 2 : 4;
#ifdef DEBUG
for (size_t i = 0; i < len; i++) {
MOZ_ASSERT(props[i] != eCSSProperty_UNKNOWN,
"unexpected logical group length");
}
MOZ_ASSERT(props[len] == eCSSProperty_UNKNOWN,
"unexpected logical group length");
@@ -307,17 +307,17 @@ nsCSSCompressedDataBlock::MapRuleInfoInt
// the rest of the function.
if (!(aRuleData->mSIDs & mStyleBits))
return;
// We process these in reverse order so that we end up mapping the
// right property when one can be expressed using both logical and
// physical property names.
for (uint32_t i = mNumProps; i-- > 0; ) {
- nsCSSProperty iProp = PropertyAtIndex(i);
+ nsCSSPropertyID iProp = PropertyAtIndex(i);
if (nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[iProp]) &
aRuleData->mSIDs) {
if (nsCSSProps::PropHasFlags(iProp, CSS_PROPERTY_LOGICAL)) {
EnsurePhysicalProperty(iProp, aRuleData);
}
nsCSSValue* target = aRuleData->ValueFor(iProp);
if (target->GetUnit() == eCSSUnit_Null) {
const nsCSSValue *val = ValueAtIndex(i);
@@ -332,17 +332,17 @@ nsCSSCompressedDataBlock::MapRuleInfoInt
}
MapSinglePropertyInto(iProp, val, target, aRuleData);
}
}
}
}
const nsCSSValue*
-nsCSSCompressedDataBlock::ValueFor(nsCSSProperty aProperty) const
+nsCSSCompressedDataBlock::ValueFor(nsCSSPropertyID aProperty) const
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
"Don't call for shorthands");
// If we have no data for this struct, then return immediately.
// This optimization should make us return most of the time, so we
// have to worry much less (although still some) about the speed of
// the rest of the function.
@@ -355,17 +355,17 @@ nsCSSCompressedDataBlock::ValueFor(nsCSS
return ValueAtIndex(i);
}
}
return nullptr;
}
bool
-nsCSSCompressedDataBlock::TryReplaceValue(nsCSSProperty aProperty,
+nsCSSCompressedDataBlock::TryReplaceValue(nsCSSPropertyID aProperty,
nsCSSExpandedDataBlock& aFromBlock,
bool *aChanged)
{
nsCSSValue* newValue = aFromBlock.PropertyAt(aProperty);
MOZ_ASSERT(newValue && newValue->GetUnit() != eCSSUnit_Null,
"cannot replace with empty value");
const nsCSSValue* oldValue = ValueFor(aProperty);
@@ -475,17 +475,17 @@ void
nsCSSExpandedDataBlock::DoExpand(nsCSSCompressedDataBlock *aBlock,
bool aImportant)
{
/*
* Save needless copying and allocation by copying the memory
* corresponding to the stored data in the compressed block.
*/
for (uint32_t i = 0; i < aBlock->mNumProps; i++) {
- nsCSSProperty iProp = aBlock->PropertyAtIndex(i);
+ nsCSSPropertyID iProp = aBlock->PropertyAtIndex(i);
MOZ_ASSERT(!nsCSSProps::IsShorthand(iProp), "out of range");
MOZ_ASSERT(!HasPropertyBit(iProp),
"compressed block has property multiple times");
SetPropertyBit(iProp);
if (aImportant)
SetImportantBit(iProp);
const nsCSSValue* val = aBlock->ValueAtIndex(i);
@@ -525,17 +525,17 @@ nsCSSExpandedDataBlock::ComputeNumProps(
*aNumPropsNormal = *aNumPropsImportant = 0;
for (size_t iHigh = 0; iHigh < nsCSSPropertySet::kChunkCount; ++iHigh) {
if (!mPropertiesSet.HasPropertyInChunk(iHigh))
continue;
for (size_t iLow = 0; iLow < nsCSSPropertySet::kBitsInChunk; ++iLow) {
if (!mPropertiesSet.HasPropertyAt(iHigh, iLow))
continue;
#ifdef DEBUG
- nsCSSProperty iProp = nsCSSPropertySet::CSSPropertyAt(iHigh, iLow);
+ nsCSSPropertyID iProp = nsCSSPropertySet::CSSPropertyAt(iHigh, iLow);
#endif
MOZ_ASSERT(!nsCSSProps::IsShorthand(iProp), "out of range");
MOZ_ASSERT(PropertyAt(iProp)->GetUnit() != eCSSUnit_Null,
"null value while computing size");
if (mPropertiesImportant.HasPropertyAt(iHigh, iLow))
(*aNumPropsImportant)++;
else
(*aNumPropsNormal)++;
@@ -565,17 +565,17 @@ nsCSSExpandedDataBlock::Compress(nsCSSCo
}
/*
* Save needless copying and allocation by copying the memory
* corresponding to the stored data in the expanded block, and then
* clearing the data in the expanded block.
*/
for (size_t i = 0; i < aOrder.Length(); i++) {
- nsCSSProperty iProp = static_cast<nsCSSProperty>(aOrder[i]);
+ nsCSSPropertyID iProp = static_cast<nsCSSPropertyID>(aOrder[i]);
if (iProp >= eCSSProperty_COUNT) {
// a custom property
continue;
}
MOZ_ASSERT(mPropertiesSet.HasProperty(iProp),
"aOrder identifies a property not in the expanded "
"data block");
MOZ_ASSERT(!nsCSSProps::IsShorthand(iProp), "out of range");
@@ -622,17 +622,17 @@ nsCSSExpandedDataBlock::Compress(nsCSSCo
ClearSets();
AssertInitialState();
*aNormalBlock = result_normal.forget();
*aImportantBlock = result_important.forget();
}
void
-nsCSSExpandedDataBlock::AddLonghandProperty(nsCSSProperty aProperty,
+nsCSSExpandedDataBlock::AddLonghandProperty(nsCSSPropertyID aProperty,
const nsCSSValue& aValue)
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
"property out of range");
nsCSSValue& storage = *static_cast<nsCSSValue*>(PropertyAt(aProperty));
storage = aValue;
SetPropertyBit(aProperty);
}
@@ -641,50 +641,50 @@ void
nsCSSExpandedDataBlock::Clear()
{
for (size_t iHigh = 0; iHigh < nsCSSPropertySet::kChunkCount; ++iHigh) {
if (!mPropertiesSet.HasPropertyInChunk(iHigh))
continue;
for (size_t iLow = 0; iLow < nsCSSPropertySet::kBitsInChunk; ++iLow) {
if (!mPropertiesSet.HasPropertyAt(iHigh, iLow))
continue;
- nsCSSProperty iProp = nsCSSPropertySet::CSSPropertyAt(iHigh, iLow);
+ nsCSSPropertyID iProp = nsCSSPropertySet::CSSPropertyAt(iHigh, iLow);
ClearLonghandProperty(iProp);
}
}
AssertInitialState();
}
void
-nsCSSExpandedDataBlock::ClearProperty(nsCSSProperty aPropID)
+nsCSSExpandedDataBlock::ClearProperty(nsCSSPropertyID aPropID)
{
if (nsCSSProps::IsShorthand(aPropID)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
p, aPropID, CSSEnabledState::eIgnoreEnabledState) {
ClearLonghandProperty(*p);
}
} else {
ClearLonghandProperty(aPropID);
}
}
void
-nsCSSExpandedDataBlock::ClearLonghandProperty(nsCSSProperty aPropID)
+nsCSSExpandedDataBlock::ClearLonghandProperty(nsCSSPropertyID aPropID)
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aPropID), "out of range");
ClearPropertyBit(aPropID);
ClearImportantBit(aPropID);
PropertyAt(aPropID)->Reset();
}
bool
nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
CSSEnabledState aEnabledState,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
css::Declaration* aDeclaration,
nsIDocument* aSheetDocument)
{
if (!nsCSSProps::IsShorthand(aPropID)) {
@@ -706,17 +706,17 @@ nsCSSExpandedDataBlock::TransferFromBloc
aMustCallValueAppended, aDeclaration,
aSheetDocument);
}
return changed;
}
bool
nsCSSExpandedDataBlock::DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
css::Declaration* aDeclaration,
nsIDocument* aSheetDocument)
{
bool changed = false;
MOZ_ASSERT(aFromBlock.HasPropertyBit(aPropID), "oops");
@@ -759,25 +759,25 @@ nsCSSExpandedDataBlock::DoTransferFromBl
* the destination, copying memory directly, and then using placement
* new.
*/
changed |= MoveValue(aFromBlock.PropertyAt(aPropID), PropertyAt(aPropID));
return changed;
}
void
-nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSProperty aPropID,
+nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSPropertyID aPropID,
nsRuleData* aRuleData) const
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aPropID));
const nsCSSValue* src = PropertyAt(aPropID);
MOZ_ASSERT(src->GetUnit() != eCSSUnit_Null);
- nsCSSProperty physicalProp = aPropID;
+ nsCSSPropertyID physicalProp = aPropID;
if (nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_LOGICAL)) {
EnsurePhysicalProperty(physicalProp, aRuleData);
}
nsCSSValue* dest = aRuleData->ValueFor(physicalProp);
MOZ_ASSERT(dest->GetUnit() == eCSSUnit_TokenStream &&
dest->GetTokenStreamValue()->mPropertyID == aPropID);
@@ -789,14 +789,14 @@ nsCSSExpandedDataBlock::MapRuleInfoInto(
#ifdef DEBUG
void
nsCSSExpandedDataBlock::DoAssertInitialState()
{
mPropertiesSet.AssertIsEmpty("not initial state");
mPropertiesImportant.AssertIsEmpty("not initial state");
for (uint32_t i = 0; i < eCSSProperty_COUNT_no_shorthands; ++i) {
- nsCSSProperty prop = nsCSSProperty(i);
+ nsCSSPropertyID prop = nsCSSPropertyID(i);
MOZ_ASSERT(PropertyAt(prop)->GetUnit() == eCSSUnit_Null,
"not initial state");
}
}
#endif
--- a/layout/style/nsCSSDataBlock.h
+++ b/layout/style/nsCSSDataBlock.h
@@ -59,27 +59,27 @@ public:
* Return the location at which the *value* for the property is
* stored, or null if the block does not contain a value for the
* property.
*
* Inefficient (by design).
*
* Must not be called for shorthands.
*/
- const nsCSSValue* ValueFor(nsCSSProperty aProperty) const;
+ const nsCSSValue* ValueFor(nsCSSPropertyID aProperty) const;
/**
* Attempt to replace the value for |aProperty| stored in this block
* with the matching value stored in |aFromBlock|.
* This method will fail (returning false) if |aProperty| is not
* already in this block. It will set |aChanged| to true if it
* actually made a change to the block, but regardless, if it
* returns true, the value in |aFromBlock| was erased.
*/
- bool TryReplaceValue(nsCSSProperty aProperty,
+ bool TryReplaceValue(nsCSSPropertyID aProperty,
nsCSSExpandedDataBlock& aFromBlock,
bool* aChanged);
/**
* Clone this block, or return null on out-of-memory.
*/
nsCSSCompressedDataBlock* Clone() const;
@@ -103,34 +103,34 @@ public:
private:
void* operator new(size_t aBaseSize, uint32_t aNumProps) {
MOZ_ASSERT(aBaseSize == sizeof(nsCSSCompressedDataBlock),
"unexpected size for nsCSSCompressedDataBlock");
return ::operator new(aBaseSize + DataSize(aNumProps));
}
public:
- // Ideally, |nsCSSProperty| would be |enum nsCSSProperty : int16_t|. But
+ // Ideally, |nsCSSPropertyID| would be |enum nsCSSPropertyID : int16_t|. But
// not all of the compilers we use are modern enough to support small
- // enums. So we manually squeeze nsCSSProperty into 16 bits ourselves.
+ // enums. So we manually squeeze nsCSSPropertyID into 16 bits ourselves.
// The static assertion below ensures it fits.
typedef int16_t CompressedCSSProperty;
static const size_t MaxCompressedCSSProperty = INT16_MAX;
private:
static size_t DataSize(uint32_t aNumProps) {
return size_t(aNumProps) *
(sizeof(nsCSSValue) + sizeof(CompressedCSSProperty));
}
int32_t mStyleBits; // the structs for which we have data, according to
// |nsCachedStyleData::GetBitForSID|.
uint32_t mNumProps;
// nsCSSValue elements are stored after these fields, and
- // nsCSSProperty elements are stored -- each one compressed as a
+ // nsCSSPropertyID elements are stored -- each one compressed as a
// CompressedCSSProperty -- after the nsCSSValue elements. Space for them
// is allocated in |operator new| above. The static assertions following
// this class make sure that the value and property elements are aligned
// appropriately.
nsCSSValue* Values() const {
return (nsCSSValue*)(this + 1);
}
@@ -139,32 +139,32 @@ private:
return (CompressedCSSProperty*)(Values() + mNumProps);
}
nsCSSValue* ValueAtIndex(uint32_t i) const {
MOZ_ASSERT(i < mNumProps, "value index out of range");
return Values() + i;
}
- nsCSSProperty PropertyAtIndex(uint32_t i) const {
+ nsCSSPropertyID PropertyAtIndex(uint32_t i) const {
MOZ_ASSERT(i < mNumProps, "property index out of range");
- nsCSSProperty prop = (nsCSSProperty)CompressedProperties()[i];
+ nsCSSPropertyID prop = (nsCSSPropertyID)CompressedProperties()[i];
MOZ_ASSERT(!nsCSSProps::IsShorthand(prop), "out of range");
return prop;
}
void CopyValueToIndex(uint32_t i, nsCSSValue* aValue) {
new (ValueAtIndex(i)) nsCSSValue(*aValue);
}
void RawCopyValueToIndex(uint32_t i, nsCSSValue* aValue) {
memcpy(ValueAtIndex(i), aValue, sizeof(nsCSSValue));
}
- void SetPropertyAtIndex(uint32_t i, nsCSSProperty aProperty) {
+ void SetPropertyAtIndex(uint32_t i, nsCSSPropertyID aProperty) {
MOZ_ASSERT(i < mNumProps, "set property index out of range");
CompressedProperties()[i] = (CompressedCSSProperty)aProperty;
}
void SetNumPropsToZero() {
mNumProps = 0;
}
};
@@ -176,17 +176,17 @@ static_assert(sizeof(nsCSSCompressedData
static_assert(NS_ALIGNMENT_OF(nsCSSValue) == 4 || NS_ALIGNMENT_OF(nsCSSValue) == 8,
"nsCSSValue doesn't align with nsCSSCompressedDataBlock");
static_assert(NS_ALIGNMENT_OF(nsCSSCompressedDataBlock::CompressedCSSProperty) == 2,
"CompressedCSSProperty doesn't align with nsCSSValue");
// Make sure that sizeof(CompressedCSSProperty) is big enough.
static_assert(eCSSProperty_COUNT_no_shorthands <=
nsCSSCompressedDataBlock::MaxCompressedCSSProperty,
- "nsCSSProperty doesn't fit in StoredSizeOfCSSProperty");
+ "nsCSSPropertyID doesn't fit in StoredSizeOfCSSProperty");
class nsCSSExpandedDataBlock
{
friend class nsCSSCompressedDataBlock;
public:
nsCSSExpandedDataBlock();
~nsCSSExpandedDataBlock();
@@ -213,44 +213,44 @@ public:
/**
* Allocate new compressed blocks and transfer all of the state
* from this expanded block to the new blocks, clearing this
* expanded block. A normal block will always be allocated, but
* an important block will only be allocated if there are
* !important properties in the expanded block; otherwise
* |*aImportantBlock| will be set to null.
*
- * aOrder is an array of nsCSSProperty values specifying the order
+ * aOrder is an array of nsCSSPropertyID values specifying the order
* to store values in the two data blocks.
*/
void Compress(nsCSSCompressedDataBlock **aNormalBlock,
nsCSSCompressedDataBlock **aImportantBlock,
const nsTArray<uint32_t>& aOrder);
/**
* Copy a value into this expanded block. This does NOT destroy
* the source value object. |aProperty| cannot be a shorthand.
*/
- void AddLonghandProperty(nsCSSProperty aProperty, const nsCSSValue& aValue);
+ void AddLonghandProperty(nsCSSPropertyID aProperty, const nsCSSValue& aValue);
/**
* Clear the state of this expanded block.
*/
void Clear();
/**
* Clear the data for the given property (including the set and
* important bits). Can be used with shorthand properties.
*/
- void ClearProperty(nsCSSProperty aPropID);
+ void ClearProperty(nsCSSPropertyID aPropID);
/**
* Same as ClearProperty, but faster and cannot be used with shorthands.
*/
- void ClearLonghandProperty(nsCSSProperty aPropID);
+ void ClearLonghandProperty(nsCSSPropertyID aPropID);
/**
* Transfer the state for |aPropID| (which may be a shorthand)
* from |aFromBlock| to this block. The property being transferred
* is !important if |aIsImportant| is true, and should replace an
* existing !important property regardless of its own importance
* if |aOverrideImportant| is true. |aEnabledState| is used to
* determine which longhand components of |aPropID| (if it is a
@@ -258,31 +258,31 @@ public:
*
* Returns true if something changed, false otherwise. Calls
* |ValueAppended| on |aDeclaration| if the property was not
* previously set, or in any case if |aMustCallValueAppended| is true.
* Calls |SetDocumentAndPageUseCounter| on |aSheetDocument| if it is
* non-null and |aPropID| has a use counter.
*/
bool TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
mozilla::CSSEnabledState aEnabledState,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
mozilla::css::Declaration* aDeclaration,
nsIDocument* aSheetDocument);
/**
* Copies the values for aPropID into the specified aRuleData object.
*
* This is used for copying parsed-at-computed-value-time properties
* that had variable references. aPropID must be a longhand property.
*/
- void MapRuleInfoInto(nsCSSProperty aPropID, nsRuleData* aRuleData) const;
+ void MapRuleInfoInto(nsCSSPropertyID aPropID, nsRuleData* aRuleData) const;
void AssertInitialState() {
#ifdef DEBUG
DoAssertInitialState();
#endif
}
private:
@@ -294,17 +294,17 @@ private:
uint32_t* aNumPropsImportant);
void DoExpand(nsCSSCompressedDataBlock *aBlock, bool aImportant);
/**
* Worker for TransferFromBlock; cannot be used with shorthands.
*/
bool DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
- nsCSSProperty aPropID,
+ nsCSSPropertyID aPropID,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
mozilla::css::Declaration* aDeclaration,
nsIDocument* aSheetDocument);
#ifdef DEBUG
void DoAssertInitialState();
@@ -321,50 +321,50 @@ private:
* mPropertiesImportant indicates which properties are '!important'.
*/
nsCSSPropertySet mPropertiesImportant;
/*
* Return the storage location within |this| of the value of the
* property |aProperty|.
*/
- nsCSSValue* PropertyAt(nsCSSProperty aProperty) {
+ nsCSSValue* PropertyAt(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty &&
aProperty < eCSSProperty_COUNT_no_shorthands,
"property out of range");
return &mValues[aProperty];
}
- const nsCSSValue* PropertyAt(nsCSSProperty aProperty) const {
+ const nsCSSValue* PropertyAt(nsCSSPropertyID aProperty) const {
MOZ_ASSERT(0 <= aProperty &&
aProperty < eCSSProperty_COUNT_no_shorthands,
"property out of range");
return &mValues[aProperty];
}
- void SetPropertyBit(nsCSSProperty aProperty) {
+ void SetPropertyBit(nsCSSPropertyID aProperty) {
mPropertiesSet.AddProperty(aProperty);
}
- void ClearPropertyBit(nsCSSProperty aProperty) {
+ void ClearPropertyBit(nsCSSPropertyID aProperty) {
mPropertiesSet.RemoveProperty(aProperty);
}
- bool HasPropertyBit(nsCSSProperty aProperty) {
+ bool HasPropertyBit(nsCSSPropertyID aProperty) {
return mPropertiesSet.HasProperty(aProperty);
}
- void SetImportantBit(nsCSSProperty aProperty) {
+ void SetImportantBit(nsCSSPropertyID aProperty) {
mPropertiesImportant.AddProperty(aProperty);
}
- void ClearImportantBit(nsCSSProperty aProperty) {
+ void ClearImportantBit(nsCSSPropertyID aProperty) {
mPropertiesImportant.RemoveProperty(aProperty);
}
- bool HasImportantBit(nsCSSProperty aProperty) {
+ bool HasImportantBit(nsCSSPropertyID aProperty) {
return mPropertiesImportant.HasProperty(aProperty);
}
void ClearSets() {
mPropertiesSet.Empty();
mPropertiesImportant.Empty();
}
};
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -168,26 +168,26 @@ public:
bool* aChanged);
nsresult ParseRule(const nsAString& aRule,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
css::Rule** aResult);
- void ParseProperty(const nsCSSProperty aPropID,
+ void ParseProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
css::Declaration* aDeclaration,
bool* aChanged,
bool aIsImportant,
bool aIsSVGMode);
- void ParseLonghandProperty(const nsCSSProperty aPropID,
+ void ParseLonghandProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aValue);
bool ParseTransformProperty(const nsAString& aPropValue,
bool aDisallowRelativeValues,
@@ -265,17 +265,17 @@ public:
bool ParseFontFaceDescriptor(nsCSSFontDesc aDescID,
const nsAString& aBuffer,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aValue);
- bool IsValueValidForProperty(const nsCSSProperty aPropID,
+ bool IsValueValidForProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue);
typedef nsCSSParser::VariableEnumFunc VariableEnumFunc;
/**
* Parses a CSS token stream value and invokes a callback function for each
* variable reference that is encountered.
*
@@ -329,18 +329,18 @@ public:
* If a longhand property is to be parsed, aPropertyID is that property,
* and aShorthandPropertyID must be eCSSProperty_UNKNOWN.
* @param aValue The CSS token stream value.
* @param aVariables The set of variable values to use when resolving variable
* references.
* @param aRuleData The rule data object into which parsed property value for
* aPropertyID will be stored.
*/
- void ParsePropertyWithVariableReferences(nsCSSProperty aPropertyID,
- nsCSSProperty aShorthandPropertyID,
+ void ParsePropertyWithVariableReferences(nsCSSPropertyID aPropertyID,
+ nsCSSPropertyID aShorthandPropertyID,
const nsAString& aValue,
const CSSVariableValues* aVariables,
nsRuleData* aRuleData,
nsIURI* aDocURL,
nsIURI* aBaseURL,
nsIPrincipal* aDocPrincipal,
CSSStyleSheet* aSheet,
uint32_t aLineNumber,
@@ -366,17 +366,17 @@ public:
enabledState |= CSSEnabledState::eInUASheets;
}
if (mIsChrome) {
enabledState |= CSSEnabledState::eInChrome;
}
return enabledState;
}
- nsCSSProperty LookupEnabledProperty(const nsAString& aProperty) {
+ nsCSSPropertyID LookupEnabledProperty(const nsAString& aProperty) {
return nsCSSProps::LookupProperty(aProperty, EnabledState());
}
protected:
class nsAutoParseCompoundProperty;
friend class nsAutoParseCompoundProperty;
class nsAutoFailingSupportsRule;
@@ -824,45 +824,45 @@ protected:
nsCSSContextType aContext);
// When we detect a webkit-prefixed gradient expression, this function can be
// used to parse its body into outparam |aValue|, with the help of the
// CSSUnprefixingService.
// Only call if ShouldUseUnprefixingService() returns true.
bool ParseWebkitPrefixedGradientWithService(nsAString& aPrefixedFuncName,
nsCSSValue& aValue);
- bool ParseProperty(nsCSSProperty aPropID);
- bool ParsePropertyByFunction(nsCSSProperty aPropID);
+ bool ParseProperty(nsCSSPropertyID aPropID);
+ bool ParsePropertyByFunction(nsCSSPropertyID aPropID);
CSSParseResult ParseSingleValueProperty(nsCSSValue& aValue,
- nsCSSProperty aPropID);
+ nsCSSPropertyID aPropID);
bool ParseSingleValuePropertyByFunction(nsCSSValue& aValue,
- nsCSSProperty aPropID);
+ nsCSSPropertyID aPropID);
// This is similar to ParseSingleValueProperty but only works for
// properties that are parsed with ParseBoxProperties or
// ParseGroupedBoxProperty.
//
// Only works with variants with the following flags:
// A, C, H, K, L, N, P, CALC.
CSSParseResult ParseBoxProperty(nsCSSValue& aValue,
- nsCSSProperty aPropID);
+ nsCSSPropertyID aPropID);
enum PriorityParsingStatus {
ePriority_None,
ePriority_Important,
ePriority_Error
};
PriorityParsingStatus ParsePriority();
#ifdef MOZ_XUL
bool ParseTreePseudoElement(nsAtomList **aPseudoElementArgs);
#endif
// Property specific parsing routines
- bool ParseImageLayers(const nsCSSProperty aTable[]);
+ bool ParseImageLayers(const nsCSSPropertyID aTable[]);
struct ImageLayersShorthandParseState {
nsCSSValue& mColor;
nsCSSValueList* mImage;
nsCSSValuePairList* mRepeat;
nsCSSValueList* mAttachment; // A property for background layer only
nsCSSValueList* mClip;
nsCSSValueList* mOrigin;
@@ -882,52 +882,52 @@ protected:
mAttachment(aAttachment), mClip(aClip), mOrigin(aOrigin),
mPositionX(aPositionX), mPositionY(aPositionY),
mSize(aSize), mComposite(aComposite),
mMode(aMode) {};
};
bool IsFunctionTokenValidForImageLayerImage(const nsCSSToken& aToken) const;
bool ParseImageLayersItem(ImageLayersShorthandParseState& aState,
- const nsCSSProperty aTable[]);
-
- bool ParseValueList(nsCSSProperty aPropID); // a single value prop-id
- bool ParseImageLayerRepeat(nsCSSProperty aPropID);
+ const nsCSSPropertyID aTable[]);
+
+ bool ParseValueList(nsCSSPropertyID aPropID); // a single value prop-id
+ bool ParseImageLayerRepeat(nsCSSPropertyID aPropID);
bool ParseImageLayerRepeatValues(nsCSSValuePair& aValue);
- bool ParseImageLayerPosition(const nsCSSProperty aTable[]);
- bool ParseImageLayerPositionCoord(nsCSSProperty aPropID, bool aIsHorizontal);
+ bool ParseImageLayerPosition(const nsCSSPropertyID aTable[]);
+ bool ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHorizontal);
// ParseBoxPositionValues parses the CSS 2.1 background-position syntax,
// which is still used by some properties. See ParsePositionValue
// for the css3-background syntax.
bool ParseBoxPositionValues(nsCSSValuePair& aOut, bool aAcceptsInherit,
bool aAllowExplicitCenter = true); // deprecated
// ParsePositionValue parses a CSS <position> value, which is used by
// the 'background-position' property.
bool ParsePositionValue(nsCSSValue& aOut);
bool ParsePositionValueSeparateCoords(nsCSSValue& aOutX, nsCSSValue& aOutY);
bool ParseImageLayerPositionCoordItem(nsCSSValue& aOut, bool aIsHorizontal);
- bool ParseImageLayerSize(nsCSSProperty aPropID);
+ bool ParseImageLayerSize(nsCSSPropertyID aPropID);
bool ParseImageLayerSizeValues(nsCSSValuePair& aOut);
bool ParseBorderColor();
- bool ParseBorderColors(nsCSSProperty aProperty);
+ bool ParseBorderColors(nsCSSPropertyID aProperty);
void SetBorderImageInitialValues();
bool ParseBorderImageRepeat(bool aAcceptsInherit);
// If ParseBorderImageSlice returns false, aConsumedTokens indicates
// whether or not any tokens were consumed (in other words, was the property
// in error or just not present). If ParseBorderImageSlice returns true
// aConsumedTokens is always true.
bool ParseBorderImageSlice(bool aAcceptsInherit, bool* aConsumedTokens);
bool ParseBorderImageWidth(bool aAcceptsInherit);
bool ParseBorderImageOutset(bool aAcceptsInherit);
bool ParseBorderImage();
bool ParseBorderSpacing();
- bool ParseBorderSide(const nsCSSProperty aPropIDs[],
+ bool ParseBorderSide(const nsCSSPropertyID aPropIDs[],
bool aSetAllSides);
bool ParseBorderStyle();
bool ParseBorderWidth();
bool ParseCalc(nsCSSValue &aValue, uint32_t aVariantMask);
bool ParseCalcAdditiveExpression(nsCSSValue& aValue,
uint32_t& aVariantMask);
bool ParseCalcMultiplicativeExpression(nsCSSValue& aValue,
@@ -958,17 +958,17 @@ protected:
bool ParseGridLineNameListRepeat(nsCSSValueList** aTailPtr);
bool ParseOptionalLineNameListAfterSubgrid(nsCSSValue& aValue);
CSSParseResult ParseGridTrackBreadth(nsCSSValue& aValue);
// eFixedTrackSize in aFlags makes it parse a <fixed-size>.
CSSParseResult ParseGridTrackSize(nsCSSValue& aValue,
GridTrackSizeFlags aFlags = GridTrackSizeFlags::eDefaultTrackSize);
- bool ParseGridAutoColumnsRows(nsCSSProperty aPropID);
+ bool ParseGridAutoColumnsRows(nsCSSPropertyID aPropID);
bool ParseGridTrackListRepeat(nsCSSValueList** aTailPtr);
bool ParseGridTrackRepeatIntro(bool aForSubgrid,
int32_t* aRepetitions,
Maybe<int32_t>* aRepeatAutoEnum);
// Assuming a [ <line-names>? ] has already been parsed,
// parse the rest of a <track-list>.
//
@@ -978,53 +978,53 @@ protected:
// grid-template-rows and grid-template-areas.
//
// On success, |aValue| will be a list of odd length >= 3,
// starting with a <line-names> (which is itself a list)
// and alternating between that and <track-size>.
bool ParseGridTrackListWithFirstLineNames(nsCSSValue& aValue,
const nsCSSValue& aFirstLineNames);
- bool ParseGridTrackList(nsCSSProperty aPropID);
- bool ParseGridTemplateColumnsRows(nsCSSProperty aPropID);
+ bool ParseGridTrackList(nsCSSPropertyID aPropID);
+ bool ParseGridTemplateColumnsRows(nsCSSPropertyID aPropID);
// |aAreaIndices| is a lookup table to help us parse faster,
// mapping area names to indices in |aResult.mNamedAreas|.
bool ParseGridTemplateAreasLine(const nsAutoString& aInput,
css::GridTemplateAreasValue* aResult,
nsDataHashtable<nsStringHashKey, uint32_t>& aAreaIndices);
bool ParseGridTemplateAreas();
bool ParseGridTemplate();
bool ParseGridTemplateAfterString(const nsCSSValue& aFirstLineNames);
bool ParseGrid();
bool ParseGridShorthandAutoProps();
bool ParseGridLine(nsCSSValue& aValue);
- bool ParseGridColumnRowStartEnd(nsCSSProperty aPropID);
- bool ParseGridColumnRow(nsCSSProperty aStartPropID,
- nsCSSProperty aEndPropID);
+ bool ParseGridColumnRowStartEnd(nsCSSPropertyID aPropID);
+ bool ParseGridColumnRow(nsCSSPropertyID aStartPropID,
+ nsCSSPropertyID aEndPropID);
bool ParseGridArea();
bool ParseGridGap();
bool ParseInitialLetter();
// parsing 'align/justify-items/self' from the css-align spec
bool ParseAlignJustifyPosition(nsCSSValue& aResult,
const KTableEntry aTable[]);
bool ParseJustifyItems();
bool ParseAlignItems();
- bool ParseAlignJustifySelf(nsCSSProperty aPropID);
+ bool ParseAlignJustifySelf(nsCSSPropertyID aPropID);
// parsing 'align/justify-content' from the css-align spec
- bool ParseAlignJustifyContent(nsCSSProperty aPropID);
+ bool ParseAlignJustifyContent(nsCSSPropertyID aPropID);
// for 'clip' and '-moz-image-region'
- bool ParseRect(nsCSSProperty aPropID);
+ bool ParseRect(nsCSSPropertyID aPropID);
bool ParseColumns();
bool ParseContain(nsCSSValue& aValue);
bool ParseContent();
- bool ParseCounterData(nsCSSProperty aPropID);
+ bool ParseCounterData(nsCSSPropertyID aPropID);
bool ParseCursor();
bool ParseFont();
bool ParseFontSynthesis(nsCSSValue& aValue);
bool ParseSingleAlternate(int32_t& aWhichFeature, nsCSSValue& aValue);
bool ParseFontVariantAlternates(nsCSSValue& aValue);
bool MergeBitmaskValue(int32_t aNewValue, const int32_t aMasks[],
int32_t& aMergedValue);
bool ParseBitmaskValues(nsCSSValue& aValue,
@@ -1060,45 +1060,45 @@ protected:
bool ParseTextEmphasis();
bool ParseTextEmphasisPosition(nsCSSValue& aValue);
bool ParseTextEmphasisStyle(nsCSSValue& aValue);
bool ParseTextCombineUpright(nsCSSValue& aValue);
bool ParseTextOverflow(nsCSSValue& aValue);
bool ParseTouchAction(nsCSSValue& aValue);
bool ParseShadowItem(nsCSSValue& aValue, bool aIsBoxShadow);
- bool ParseShadowList(nsCSSProperty aProperty);
+ bool ParseShadowList(nsCSSPropertyID aProperty);
bool ParseShapeOutside(nsCSSValue& aValue);
bool ParseTransitionProperty();
bool ParseTransitionTimingFunctionValues(nsCSSValue& aValue);
bool ParseTransitionTimingFunctionValueComponent(float& aComponent,
char aStop,
bool aIsXPoint);
bool ParseTransitionStepTimingFunctionValues(nsCSSValue& aValue);
enum ParseAnimationOrTransitionShorthandResult {
eParseAnimationOrTransitionShorthand_Values,
eParseAnimationOrTransitionShorthand_Inherit,
eParseAnimationOrTransitionShorthand_Error
};
ParseAnimationOrTransitionShorthandResult
- ParseAnimationOrTransitionShorthand(const nsCSSProperty* aProperties,
+ ParseAnimationOrTransitionShorthand(const nsCSSPropertyID* aProperties,
const nsCSSValue* aInitialValues,
nsCSSValue* aValues,
size_t aNumProperties);
bool ParseTransition();
bool ParseAnimation();
bool ParseWillChange();
- bool ParsePaint(nsCSSProperty aPropID);
+ bool ParsePaint(nsCSSPropertyID aPropID);
bool ParseDasharray();
bool ParseMarker();
bool ParsePaintOrder();
bool ParseAll();
bool ParseScrollSnapType();
- bool ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSProperty aPropID);
+ bool ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSPropertyID aPropID);
bool ParseScrollSnapDestination(nsCSSValue& aValue);
bool ParseScrollSnapCoordinate(nsCSSValue& aValue);
bool ParseWebkitTextStroke();
/**
* Parses a variable value from a custom property declaration.
*
* @param aType Out parameter into which will be stored the type of variable
@@ -1141,26 +1141,26 @@ protected:
bool BackslashDropped();
/**
* Calls AppendImpliedEOFCharacters on mScanner.
*/
void AppendImpliedEOFCharacters(nsAString& aResult);
// Reused utility parsing routines
- void AppendValue(nsCSSProperty aPropID, const nsCSSValue& aValue);
- bool ParseBoxProperties(const nsCSSProperty aPropIDs[]);
+ void AppendValue(nsCSSPropertyID aPropID, const nsCSSValue& aValue);
+ bool ParseBoxProperties(const nsCSSPropertyID aPropIDs[]);
bool ParseGroupedBoxProperty(int32_t aVariantMask,
nsCSSValue& aValue);
- bool ParseBoxCornerRadius(const nsCSSProperty aPropID);
+ bool ParseBoxCornerRadius(const nsCSSPropertyID aPropID);
bool ParseBoxCornerRadiiInternals(nsCSSValue array[]);
- bool ParseBoxCornerRadii(const nsCSSProperty aPropIDs[]);
+ bool ParseBoxCornerRadii(const nsCSSPropertyID aPropIDs[]);
int32_t ParseChoice(nsCSSValue aValues[],
- const nsCSSProperty aPropIDs[], int32_t aNumIDs);
+ const nsCSSPropertyID aPropIDs[], int32_t aNumIDs);
CSSParseResult ParseColor(nsCSSValue& aValue);
bool ParseNumberColorComponent(uint8_t& aComponent, char aStop);
bool ParsePercentageColorComponent(float& aComponent, char aStop);
// ParseHSLColor parses everything starting with the opening '('
// up through and including the aStop char.
bool ParseHSLColor(float& aHue, float& aSaturation, float& aLightness,
char aStop);
// ParseColorOpacity will enforce that the color ends with a ')'
@@ -1866,17 +1866,17 @@ CSSParserImpl::ParseRule(const nsAString
}
}
ReleaseScanner();
return rv;
}
void
-CSSParserImpl::ParseLonghandProperty(const nsCSSProperty aPropID,
+CSSParserImpl::ParseLonghandProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aValue)
{
MOZ_ASSERT(aPropID < eCSSProperty_COUNT_no_shorthands,
"ParseLonghandProperty must only take a longhand property");
@@ -1935,17 +1935,17 @@ CSSParserImpl::ParseTransformProperty(co
}
ReleaseScanner();
return parsedOK;
}
void
-CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
+CSSParserImpl::ParseProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURI,
nsIURI* aBaseURI,
nsIPrincipal* aSheetPrincipal,
css::Declaration* aDeclaration,
bool* aChanged,
bool aIsImportant,
bool aIsSVGMode)
@@ -2335,17 +2335,17 @@ CSSParserImpl::ParseKeyframeSelectorStri
bool
CSSParserImpl::EvaluateSupportsDeclaration(const nsAString& aProperty,
const nsAString& aValue,
nsIURI* aDocURL,
nsIURI* aBaseURL,
nsIPrincipal* aDocPrincipal)
{
- nsCSSProperty propID = LookupEnabledProperty(aProperty);
+ nsCSSPropertyID propID = LookupEnabledProperty(aProperty);
if (propID == eCSSProperty_UNKNOWN) {
return false;
}
nsCSSScanner scanner(aValue, 0);
css::ErrorReporter reporter(scanner, mSheet, mChildLoader, aDocURL);
InitScanner(scanner, reporter, aDocURL, aBaseURL, aDocPrincipal);
nsAutoSuppressErrors suppressErrors(this);
@@ -2914,18 +2914,18 @@ CSSParserImpl::ResolveVariableValue(cons
aFirstToken, aLastToken);
ReleaseScanner();
return valid;
}
void
CSSParserImpl::ParsePropertyWithVariableReferences(
- nsCSSProperty aPropertyID,
- nsCSSProperty aShorthandPropertyID,
+ nsCSSPropertyID aPropertyID,
+ nsCSSPropertyID aShorthandPropertyID,
const nsAString& aValue,
const CSSVariableValues* aVariables,
nsRuleData* aRuleData,
nsIURI* aDocURL,
nsIURI* aBaseURL,
nsIPrincipal* aDocPrincipal,
CSSStyleSheet* aSheet,
uint32_t aLineNumber,
@@ -2954,17 +2954,17 @@ CSSParserImpl::ParsePropertyWithVariable
} else {
REPORT_UNEXPECTED(PEValueWithVariablesFallbackInitial);
}
OUTPUT_ERROR_WITH_POSITION(aLineNumber, aLineOffset);
}
ReleaseScanner();
}
- nsCSSProperty propertyToParse =
+ nsCSSPropertyID propertyToParse =
aShorthandPropertyID != eCSSProperty_UNKNOWN ? aShorthandPropertyID :
aPropertyID;
// Parse the property with that resolved value.
if (valid) {
nsCSSScanner scanner(expandedValue, 0);
css::ErrorReporter reporter(scanner, aSheet, mChildLoader, aDocURL);
InitScanner(scanner, reporter, aDocURL, aBaseURL, aDocPrincipal);
@@ -4657,17 +4657,17 @@ CSSParserImpl::ParseSupportsConditionInP
if (mToken.mType == eCSSToken_Ident) {
if (!mToken.mIdent.LowerCaseEqualsLiteral("not")) {
nsAutoString propertyName = mToken.mIdent;
if (!ExpectSymbol(':', true)) {
return false;
}
- nsCSSProperty propID = LookupEnabledProperty(propertyName);
+ nsCSSPropertyID propID = LookupEnabledProperty(propertyName);
if (propID == eCSSProperty_UNKNOWN) {
if (ExpectSymbol(')', true)) {
UngetToken();
return false;
}
aConditionMet = false;
SkipUntil(')');
UngetToken();
@@ -7280,17 +7280,17 @@ CSSParserImpl::ParseDeclaration(css::Dec
return false;
}
// Don't report property parse errors if we're inside a failing @supports
// rule.
nsAutoSuppressErrors suppressErrors(this, mInFailingSupportsRule);
// Information about a parsed non-custom property.
- nsCSSProperty propID;
+ nsCSSPropertyID propID;
// Information about a parsed custom property.
CSSVariableDeclarations::Type variableType;
nsString variableValue;
// Check if the property name is a custom property.
bool customProperty = nsLayoutUtils::CSSVariablesEnabled() &&
nsCSSProps::IsCustomPropertyName(propertyName) &&
@@ -7397,57 +7397,57 @@ CSSParserImpl::ParseDeclaration(css::Dec
status == ePriority_Important,
false, aMustCallValueAppended,
aDeclaration, GetDocument());
}
return true;
}
-static const nsCSSProperty kBorderTopIDs[] = {
+static const nsCSSPropertyID kBorderTopIDs[] = {
eCSSProperty_border_top_width,
eCSSProperty_border_top_style,
eCSSProperty_border_top_color
};
-static const nsCSSProperty kBorderRightIDs[] = {
+static const nsCSSPropertyID kBorderRightIDs[] = {
eCSSProperty_border_right_width,
eCSSProperty_border_right_style,
eCSSProperty_border_right_color
};
-static const nsCSSProperty kBorderBottomIDs[] = {
+static const nsCSSPropertyID kBorderBottomIDs[] = {
eCSSProperty_border_bottom_width,
eCSSProperty_border_bottom_style,
eCSSProperty_border_bottom_color
};
-static const nsCSSProperty kBorderLeftIDs[] = {
+static const nsCSSPropertyID kBorderLeftIDs[] = {
eCSSProperty_border_left_width,
eCSSProperty_border_left_style,
eCSSProperty_border_left_color
};
-static const nsCSSProperty kBorderInlineStartIDs[] = {
+static const nsCSSPropertyID kBorderInlineStartIDs[] = {
eCSSProperty_border_inline_start_width,
eCSSProperty_border_inline_start_style,
eCSSProperty_border_inline_start_color
};
-static const nsCSSProperty kBorderInlineEndIDs[] = {
+static const nsCSSPropertyID kBorderInlineEndIDs[] = {
eCSSProperty_border_inline_end_width,
eCSSProperty_border_inline_end_style,
eCSSProperty_border_inline_end_color
};
-static const nsCSSProperty kBorderBlockStartIDs[] = {
+static const nsCSSPropertyID kBorderBlockStartIDs[] = {
eCSSProperty_border_block_start_width,
eCSSProperty_border_block_start_style,
eCSSProperty_border_block_start_color
};
-static const nsCSSProperty kBorderBlockEndIDs[] = {
+static const nsCSSPropertyID kBorderBlockEndIDs[] = {
eCSSProperty_border_block_end_width,
eCSSProperty_border_block_end_style,
eCSSProperty_border_block_end_color
};
-static const nsCSSProperty kColumnRuleIDs[] = {
+static const nsCSSPropertyID kColumnRuleIDs[] = {
eCSSProperty__moz_column_rule_width,
eCSSProperty__moz_column_rule_style,
eCSSProperty__moz_column_rule_color
};
bool
CSSParserImpl::ParseEnum(nsCSSValue& aValue,
const KTableEntry aKeywordTable[])
@@ -8484,17 +8484,17 @@ CSSParserImpl::ParseFlex()
return true;
}
// flex-flow: <flex-direction> || <flex-wrap>
bool
CSSParserImpl::ParseFlexFlow()
{
- static const nsCSSProperty kFlexFlowSubprops[] = {
+ static const nsCSSPropertyID kFlexFlowSubprops[] = {
eCSSProperty_flex_direction,
eCSSProperty_flex_wrap
};
const size_t numProps = MOZ_ARRAY_LENGTH(kFlexFlowSubprops);
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, kFlexFlowSubprops, numProps);
@@ -8776,17 +8776,17 @@ CSSParserImpl::ParseGridTrackSize(nsCSSV
}
return CSSParseResult::Ok;
}
SkipUntil(')');
return CSSParseResult::Error;
}
bool
-CSSParserImpl::ParseGridAutoColumnsRows(nsCSSProperty aPropID)
+CSSParserImpl::ParseGridAutoColumnsRows(nsCSSPropertyID aPropID)
{
nsCSSValue value;
if (ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr) ||
ParseGridTrackSize(value) == CSSParseResult::Ok) {
AppendValue(aPropID, value);
return true;
}
return false;
@@ -9152,30 +9152,30 @@ CSSParserImpl::ParseGridTrackListRepeat(
tail = tail->mNext;
tail->mValue = lastLineNames;
*aTailPtr = tail;
return true;
}
bool
-CSSParserImpl::ParseGridTrackList(nsCSSProperty aPropID)
+CSSParserImpl::ParseGridTrackList(nsCSSPropertyID aPropID)
{
nsCSSValue value;
nsCSSValue firstLineNames;
if (ParseGridLineNames(firstLineNames) == CSSParseResult::Error ||
!ParseGridTrackListWithFirstLineNames(value, firstLineNames)) {
return false;
}
AppendValue(aPropID, value);
return true;
}
bool
-CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSProperty aPropID)
+CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSPropertyID aPropID)
{
nsCSSValue value;
if (ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) {
AppendValue(aPropID, value);
return true;
}
nsSubstring* ident = NextIdent();
@@ -9484,17 +9484,17 @@ CSSParserImpl::ParseGridTemplateAfterStr
// <'grid-template'> |
// [ <'grid-auto-flow'> [ <'grid-auto-rows'> [ / <'grid-auto-columns'> ]? ]? ]
bool
CSSParserImpl::ParseGrid()
{
nsCSSValue value;
if (ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
- for (const nsCSSProperty* subprops =
+ for (const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_grid);
*subprops != eCSSProperty_UNKNOWN; ++subprops) {
AppendValue(*subprops, value);
}
return true;
}
// An empty value is always invalid.
@@ -9658,17 +9658,17 @@ CSSParserImpl::ParseGridLine(nsCSSValue&
}
if (hasIdent) {
item->mValue = ident;
}
return true;
}
bool
-CSSParserImpl::ParseGridColumnRowStartEnd(nsCSSProperty aPropID)
+CSSParserImpl::ParseGridColumnRowStartEnd(nsCSSPropertyID aPropID)
{
nsCSSValue value;
if (ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr) ||
ParseGridLine(value)) {
AppendValue(aPropID, value);
return true;
}
return false;
@@ -9685,18 +9685,18 @@ HandleGridLineFallback(const nsCSSValue&
!aFallback.GetListValue()->mNext) {
aValue = aFallback;
} else {
aValue.SetAutoValue();
}
}
bool
-CSSParserImpl::ParseGridColumnRow(nsCSSProperty aStartPropID,
- nsCSSProperty aEndPropID)
+CSSParserImpl::ParseGridColumnRow(nsCSSPropertyID aStartPropID,
+ nsCSSPropertyID aEndPropID)
{
nsCSSValue value;
nsCSSValue secondValue;
if (ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
AppendValue(aStartPropID, value);
AppendValue(aEndPropID, value);
return true;
}
@@ -9902,17 +9902,17 @@ CSSParserImpl::ParseAlignItems()
}
AppendValue(eCSSProperty_align_items, value);
return true;
}
// auto | normal | stretch | <baseline-position> |
// [ <overflow-position>? && <self-position> ]
bool
-CSSParserImpl::ParseAlignJustifySelf(nsCSSProperty aPropID)
+CSSParserImpl::ParseAlignJustifySelf(nsCSSPropertyID aPropID)
{
nsCSSValue value;
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
if (!ParseEnum(value, nsCSSProps::kAlignAutoNormalStretchBaseline)) {
if (!ParseAlignJustifyPosition(value, nsCSSProps::kAlignSelfPosition) ||
value.GetUnit() == eCSSUnit_Null) {
return false;
}
@@ -9921,17 +9921,17 @@ CSSParserImpl::ParseAlignJustifySelf(nsC
AppendValue(aPropID, value);
return true;
}
// normal | <baseline-position> | [ <content-distribution> ||
// [ <overflow-position>? && <content-position> ] ]
// (the part after the || is called <*-position> below)
bool
-CSSParserImpl::ParseAlignJustifyContent(nsCSSProperty aPropID)
+CSSParserImpl::ParseAlignJustifyContent(nsCSSPropertyID aPropID)
{
nsCSSValue value;
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
if (!ParseEnum(value, nsCSSProps::kAlignNormalBaseline)) {
nsCSSValue fallbackValue;
if (!ParseEnum(value, nsCSSProps::kAlignContentDistribution)) {
if (!ParseAlignJustifyPosition(fallbackValue,
nsCSSProps::kAlignContentPosition) ||
@@ -10864,17 +10864,17 @@ CSSParserImpl::ParseWebkitGradient(nsCSS
aValue.SetGradientValue(cssGradient);
return true;
}
bool
CSSParserImpl::ParseWebkitTextStroke()
{
- static const nsCSSProperty kWebkitTextStrokeIDs[] = {
+ static const nsCSSPropertyID kWebkitTextStrokeIDs[] = {
eCSSProperty__webkit_text_stroke_width,
eCSSProperty__webkit_text_stroke_color
};
const size_t numProps = MOZ_ARRAY_LENGTH(kWebkitTextStrokeIDs);
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, kWebkitTextStrokeIDs, numProps);
@@ -10894,17 +10894,17 @@ CSSParserImpl::ParseWebkitTextStroke()
AppendValue(kWebkitTextStrokeIDs[index], values[index]);
}
return true;
}
int32_t
CSSParserImpl::ParseChoice(nsCSSValue aValues[],
- const nsCSSProperty aPropIDs[], int32_t aNumIDs)
+ const nsCSSPropertyID aPropIDs[], int32_t aNumIDs)
{
int32_t found = 0;
nsAutoParseCompoundProperty compound(this);
int32_t loop;
for (loop = 0; loop < aNumIDs; loop++) {
// Try each property parser in order
int32_t hadFound = found;
@@ -10967,28 +10967,28 @@ CSSParserImpl::ParseChoice(nsCSSValue aV
}
}
}
}
return found;
}
void
-CSSParserImpl::AppendValue(nsCSSProperty aPropID, const nsCSSValue& aValue)
+CSSParserImpl::AppendValue(nsCSSPropertyID aPropID, const nsCSSValue& aValue)
{
mTempData.AddLonghandProperty(aPropID, aValue);
}
/**
* Parse a "box" property. Box properties have 1 to 4 values. When less
* than 4 values are provided a standard mapping is used to replicate
* existing values.
*/
bool
-CSSParserImpl::ParseBoxProperties(const nsCSSProperty aPropIDs[])
+CSSParserImpl::ParseBoxProperties(const nsCSSPropertyID aPropIDs[])
{
// Get up to four values for the property
int32_t count = 0;
nsCSSRect result;
NS_FOR_CSS_SIDES (index) {
CSSParseResult parseResult =
ParseBoxProperty(result.*(nsCSSRect::sides[index]), aPropIDs[index]);
if (parseResult == CSSParseResult::NotFound) {
@@ -11070,17 +11070,17 @@ CSSParserImpl::ParseGroupedBoxProperty(i
case 3: // Make left == right
result.mLeft = result.mRight;
}
return true;
}
bool
-CSSParserImpl::ParseBoxCornerRadius(nsCSSProperty aPropID)
+CSSParserImpl::ParseBoxCornerRadius(nsCSSPropertyID aPropID)
{
nsCSSValue dimenX, dimenY;
// required first value
if (ParseNonNegativeVariant(dimenX, VARIANT_HLP | VARIANT_CALC, nullptr) !=
CSSParseResult::Ok) {
return false;
}
@@ -11194,55 +11194,55 @@ CSSParserImpl::ParseBoxCornerRadiiIntern
pair.SetPairValue(x, y);
array[side] = pair;
}
}
return true;
}
bool
-CSSParserImpl::ParseBoxCornerRadii(const nsCSSProperty aPropIDs[])
+CSSParserImpl::ParseBoxCornerRadii(const nsCSSPropertyID aPropIDs[])
{
nsCSSValue value[4];
if (!ParseBoxCornerRadiiInternals(value)) {
return false;
}
NS_FOR_CSS_SIDES(side) {
AppendValue(aPropIDs[side], value[side]);
}
return true;
}
// These must be in CSS order (top,right,bottom,left) for indexing to work
-static const nsCSSProperty kBorderStyleIDs[] = {
+static const nsCSSPropertyID kBorderStyleIDs[] = {
eCSSProperty_border_top_style,
eCSSProperty_border_right_style,
eCSSProperty_border_bottom_style,
eCSSProperty_border_left_style
};
-static const nsCSSProperty kBorderWidthIDs[] = {
+static const nsCSSPropertyID kBorderWidthIDs[] = {
eCSSProperty_border_top_width,
eCSSProperty_border_right_width,
eCSSProperty_border_bottom_width,
eCSSProperty_border_left_width
};
-static const nsCSSProperty kBorderColorIDs[] = {
+static const nsCSSPropertyID kBorderColorIDs[] = {
eCSSProperty_border_top_color,
eCSSProperty_border_right_color,
eCSSProperty_border_bottom_color,
eCSSProperty_border_left_color
};
-static const nsCSSProperty kBorderRadiusIDs[] = {
+static const nsCSSPropertyID kBorderRadiusIDs[] = {
eCSSProperty_border_top_left_radius,
eCSSProperty_border_top_right_radius,
eCSSProperty_border_bottom_right_radius,
eCSSProperty_border_bottom_left_radius
};
-static const nsCSSProperty kOutlineRadiusIDs[] = {
+static const nsCSSPropertyID kOutlineRadiusIDs[] = {
eCSSProperty__moz_outline_radius_topLeft,
eCSSProperty__moz_outline_radius_topRight,
eCSSProperty__moz_outline_radius_bottomRight,
eCSSProperty__moz_outline_radius_bottomLeft
};
void
CSSParserImpl::SaveInputState(CSSParserInputState& aState)
@@ -11256,17 +11256,17 @@ void
CSSParserImpl::RestoreSavedInputState(const CSSParserInputState& aState)
{
mToken = aState.mToken;
mHavePushBack = aState.mHavePushBack;
mScanner->RestoreSavedPosition(aState.mPosition);
}
bool
-CSSParserImpl::ParseProperty(nsCSSProperty aPropID)
+CSSParserImpl::ParseProperty(nsCSSPropertyID aPropID)
{
// Can't use AutoRestore<bool> because it's a bitfield.
MOZ_ASSERT(!mHashlessColorQuirk,
"hashless color quirk should not be set");
MOZ_ASSERT(!mUnitlessLengthQuirk,
"unitless length quirk should not be set");
MOZ_ASSERT(aPropID != eCSSPropertyExtra_variable);
@@ -11470,17 +11470,17 @@ CSSParserImpl::ParseProperty(nsCSSProper
mHashlessColorQuirk = false;
mUnitlessLengthQuirk = false;
}
return result;
}
bool
-CSSParserImpl::ParsePropertyByFunction(nsCSSProperty aPropID)
+CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
{
switch (aPropID) { // handle shorthand or multiple properties
case eCSSProperty_background:
return ParseImageLayers(nsStyleImageLayers::kBackgroundLayerTable);
case eCSSProperty_background_repeat:
return ParseImageLayerRepeat(eCSSProperty_background_repeat);
case eCSSProperty_background_position:
return ParseImageLayerPosition(nsStyleImageLayers::kBackgroundLayerTable);
@@ -11695,17 +11695,17 @@ CSSParserImpl::ParsePropertyByFunction(n
#define BG_RIGHT NS_STYLE_IMAGELAYER_POSITION_RIGHT
#define BG_CTB (BG_CENTER | BG_TOP | BG_BOTTOM)
#define BG_TB (BG_TOP | BG_BOTTOM)
#define BG_CLR (BG_CENTER | BG_LEFT | BG_RIGHT)
#define BG_LR (BG_LEFT | BG_RIGHT)
CSSParseResult
CSSParserImpl::ParseBoxProperty(nsCSSValue& aValue,
- nsCSSProperty aPropID)
+ nsCSSPropertyID aPropID)
{
if (aPropID < 0 || aPropID >= eCSSProperty_COUNT_no_shorthands) {
MOZ_ASSERT(false, "must only be called for longhand properties");
return CSSParseResult::NotFound;
}
MOZ_ASSERT(!nsCSSProps::PropHasFlags(aPropID,
CSS_PROPERTY_VALUE_PARSER_FUNCTION),
@@ -11726,17 +11726,17 @@ CSSParserImpl::ParseBoxProperty(nsCSSVal
const KTableEntry* kwtable = nsCSSProps::kKeywordTableTable[aPropID];
uint32_t restrictions = nsCSSProps::ValueRestrictions(aPropID);
return ParseVariantWithRestrictions(aValue, variant, kwtable, restrictions);
}
bool
CSSParserImpl::ParseSingleValuePropertyByFunction(nsCSSValue& aValue,
- nsCSSProperty aPropID)
+ nsCSSPropertyID aPropID)
{
switch (aPropID) {
case eCSSProperty_font_family:
return ParseFamily(aValue);
case eCSSProperty_font_synthesis:
return ParseFontSynthesis(aValue);
case eCSSProperty_font_variant_alternates:
return ParseFontVariantAlternates(aValue);
@@ -11785,17 +11785,17 @@ CSSParserImpl::ParseSingleValuePropertyB
default:
MOZ_ASSERT(false, "should not reach here");
return false;
}
}
CSSParseResult
CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
- nsCSSProperty aPropID)
+ nsCSSPropertyID aPropID)
{
if (aPropID == eCSSPropertyExtra_x_none_value) {
return ParseVariant(aValue, VARIANT_NONE | VARIANT_INHERIT, nullptr);
}
if (aPropID == eCSSPropertyExtra_x_auto_value) {
return ParseVariant(aValue, VARIANT_AUTO | VARIANT_INHERIT, nullptr);
}
@@ -11933,27 +11933,27 @@ BoxPositionMaskToCSSValue(int32_t aMask,
val = NS_STYLE_IMAGELAYER_POSITION_BOTTOM;
}
}
return nsCSSValue(val, eCSSUnit_Enumerated);
}
bool
-CSSParserImpl::ParseImageLayers(const nsCSSProperty aTable[])
+CSSParserImpl::ParseImageLayers(const nsCSSPropertyID aTable[])
{
nsAutoParseCompoundProperty compound(this);
// background-color can only be set once, so it's not a list.
nsCSSValue color;
// Check first for inherit/initial/unset.
if (ParseSingleTokenVariant(color, VARIANT_INHERIT, nullptr)) {
// must be alone
- for (const nsCSSProperty* subprops =
+ for (const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(aTable[nsStyleImageLayers::shorthand]);
*subprops != eCSSProperty_UNKNOWN; ++subprops) {
AppendValue(*subprops, color);
}
return true;
}
nsCSSValue image, repeat, attachment, clip, origin, positionX, positionY, size,
@@ -12068,17 +12068,17 @@ CSSParserImpl::IsFunctionTokenValidForIm
funcName.LowerCaseEqualsLiteral("-webkit-repeating-linear-gradient") ||
funcName.LowerCaseEqualsLiteral("-webkit-repeating-radial-gradient")));
}
// Parse one item of the background shorthand property.
bool
CSSParserImpl::ParseImageLayersItem(
CSSParserImpl::ImageLayersShorthandParseState& aState,
- const nsCSSProperty aTable[])
+ const nsCSSPropertyID aTable[])
{
// Fill in the values that the shorthand will set if we don't find
// other values.
aState.mImage->mValue.SetNoneValue();
aState.mAttachment->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL,
eCSSUnit_Enumerated);
aState.mClip->mValue.SetIntValue(NS_STYLE_IMAGELAYER_CLIP_BORDER,
eCSSUnit_Enumerated);
@@ -12322,17 +12322,17 @@ CSSParserImpl::ParseImageLayersItem(
}
return haveSomething;
}
// This function is very similar to ParseScrollSnapCoordinate,
// ParseImageLayerPosition, and ParseImageLayersSize.
bool
-CSSParserImpl::ParseValueList(nsCSSProperty aPropID)
+CSSParserImpl::ParseValueList(nsCSSPropertyID aPropID)
{
// aPropID is a single value prop-id
nsCSSValue value;
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
nsCSSValueList* item = value.SetListValue();
for (;;) {
if (ParseSingleValueProperty(item->mValue, aPropID) !=
@@ -12346,17 +12346,17 @@ CSSParserImpl::ParseValueList(nsCSSPrope
item = item->mNext;
}
}
AppendValue(aPropID, value);
return true;
}
bool
-CSSParserImpl::ParseImageLayerRepeat(nsCSSProperty aPropID)
+CSSParserImpl::ParseImageLayerRepeat(nsCSSPropertyID aPropID)
{
nsCSSValue value;
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
nsCSSValuePair valuePair;
if (!ParseImageLayerRepeatValues(valuePair)) {
return false;
}
@@ -12397,17 +12397,17 @@ CSSParserImpl::ParseImageLayerRepeatValu
}
return true;
}
return false;
}
bool
-CSSParserImpl::ParseImageLayerPosition(const nsCSSProperty aTable[])
+CSSParserImpl::ParseImageLayerPosition(const nsCSSPropertyID aTable[])
{
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
nsCSSValue position;
if (ParseSingleTokenVariant(position, VARIANT_INHERIT, nullptr)) {
AppendValue(aTable[nsStyleImageLayers::positionX], position);
AppendValue(aTable[nsStyleImageLayers::positionY], position);
return true;
}
@@ -12437,17 +12437,17 @@ CSSParserImpl::ParseImageLayerPosition(c
itemY = itemY->mNext;
}
AppendValue(aTable[nsStyleImageLayers::positionX], valueX);
AppendValue(aTable[nsStyleImageLayers::positionY], valueY);
return true;
}
bool
-CSSParserImpl::ParseImageLayerPositionCoord(nsCSSProperty aPropID, bool aIsHorizontal)
+CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHorizontal)
{
nsCSSValue value;
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
nsCSSValue itemValue;
if (!ParseImageLayerPositionCoordItem(itemValue, aIsHorizontal)) {
return false;
}
@@ -12906,17 +12906,17 @@ CSSParserImpl::ParseImageLayerPositionCo
"Unexpected units");
return true;
}
// This function is very similar to ParseScrollSnapCoordinate,
// ParseImageLayers, and ParseImageLayerPosition.
bool
-CSSParserImpl::ParseImageLayerSize(nsCSSProperty aPropID)
+CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID)
{
nsCSSValue value;
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
nsCSSValuePair valuePair;
if (!ParseImageLayerSizeValues(valuePair)) {
return false;
}
@@ -13280,17 +13280,17 @@ CSSParserImpl::ParseBorderSpacing()
nsCSSValue pair;
pair.SetPairValue(xValue, yValue);
AppendValue(eCSSProperty_border_spacing, pair);
}
return true;
}
bool
-CSSParserImpl::ParseBorderSide(const nsCSSProperty aPropIDs[],
+CSSParserImpl::ParseBorderSide(const nsCSSPropertyID aPropIDs[],
bool aSetAllSides)
{
const int32_t numProps = 3;
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, aPropIDs, numProps);
if (found < 1) {
return false;
@@ -13310,17 +13310,17 @@ CSSParserImpl::ParseBorderSide(const nsC
// Parsing "border" shorthand; set all four sides to the same thing
for (int32_t index = 0; index < 4; index++) {
NS_ASSERTION(numProps == 3, "This code needs updating");
AppendValue(kBorderWidthIDs[index], values[0]);
AppendValue(kBorderStyleIDs[index], values[1]);
AppendValue(kBorderColorIDs[index], values[2]);
}
- static const nsCSSProperty kBorderColorsProps[] = {
+ static const nsCSSPropertyID kBorderColorsProps[] = {
eCSSProperty_border_top_colors,
eCSSProperty_border_right_colors,
eCSSProperty_border_bottom_colors,
eCSSProperty_border_left_colors
};
// Set the other properties that the border shorthand sets to their
// initial values.
@@ -13363,17 +13363,17 @@ CSSParserImpl::ParseBorderStyle()
bool
CSSParserImpl::ParseBorderWidth()
{
return ParseBoxProperties(kBorderWidthIDs);
}
bool
-CSSParserImpl::ParseBorderColors(nsCSSProperty aProperty)
+CSSParserImpl::ParseBorderColors(nsCSSPropertyID aProperty)
{
nsCSSValue value;
// 'inherit', 'initial', 'unset' and 'none' are only allowed on their own
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
nullptr)) {
nsCSSValueList *cur = value.SetListValue();
for (;;) {
if (ParseVariant(cur->mValue, VARIANT_COLOR | VARIANT_KEYWORD,
@@ -13651,17 +13651,17 @@ CSSParserImpl::RequireWhitespace()
// Skip any additional whitespace tokens.
if (GetToken(true)) {
UngetToken();
}
return true;
}
bool
-CSSParserImpl::ParseRect(nsCSSProperty aPropID)
+CSSParserImpl::ParseRect(nsCSSPropertyID aPropID)
{
nsCSSValue val;
if (ParseSingleTokenVariant(val, VARIANT_INHERIT | VARIANT_AUTO, nullptr)) {
AppendValue(aPropID, val);
return true;
}
if (! GetToken(true)) {
@@ -13702,17 +13702,17 @@ CSSParserImpl::ParseRect(nsCSSProperty a
bool
CSSParserImpl::ParseColumns()
{
// We use a similar "fake value" hack to ParseListStyle, because
// "auto" is acceptable for both column-count and column-width.
// If the fake "auto" value is found, and one of the real values isn't,
// that means the fake auto value is meant for the real value we didn't
// find.
- static const nsCSSProperty columnIDs[] = {
+ static const nsCSSPropertyID columnIDs[] = {
eCSSPropertyExtra_x_auto_value,
eCSSProperty__moz_column_count,
eCSSProperty__moz_column_width
};
const int32_t numProps = MOZ_ARRAY_LENGTH(columnIDs);
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, columnIDs, numProps);
@@ -13790,17 +13790,17 @@ CSSParserImpl::ParseContent()
cur = cur->mNext;
}
}
AppendValue(eCSSProperty_content, value);
return true;
}
bool
-CSSParserImpl::ParseCounterData(nsCSSProperty aPropID)
+CSSParserImpl::ParseCounterData(nsCSSPropertyID aPropID)
{
static const nsCSSKeyword kCounterDataKTable[] = {
eCSSKeyword_none,
eCSSKeyword_UNKNOWN
};
nsCSSValue value;
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
nullptr)) {
@@ -13938,17 +13938,17 @@ CSSParserImpl::ParseFont()
// Indexes into fontIDs[] and values[] arrays.
const int kFontStyleIndex = 0;
const int kFontVariantIndex = 1;
const int kFontWeightIndex = 2;
const int kFontStretchIndex = 3;
// The order of the initializers here must match the order of the indexes
// defined above!
- static const nsCSSProperty fontIDs[] = {
+ static const nsCSSPropertyID fontIDs[] = {
eCSSProperty_font_style,
eCSSProperty_font_variant_caps,
eCSSProperty_font_weight,
eCSSProperty_font_stretch
};
const int32_t numProps = MOZ_ARRAY_LENGTH(fontIDs);
nsCSSValue values[numProps];
@@ -14987,17 +14987,17 @@ CSSParserImpl::ParseListStyle()
{
// 'list-style' can accept 'none' for two different subproperties,
// 'list-style-type' and 'list-style-image'. In order to accept
// 'none' as the value of either but still allow another value for
// either, we need to ensure that the first 'none' we find gets
// allocated to a dummy property instead. Since parse function for
// 'list-style-type' could accept values for 'list-style-position',
// we put position in front of type.
- static const nsCSSProperty listStyleIDs[] = {
+ static const nsCSSPropertyID listStyleIDs[] = {
eCSSPropertyExtra_x_none_value,
eCSSProperty_list_style_position,
eCSSProperty_list_style_type,
eCSSProperty_list_style_image
};
nsCSSValue values[MOZ_ARRAY_LENGTH(listStyleIDs)];
int32_t found =
@@ -15053,17 +15053,17 @@ CSSParserImpl::ParseListStyleType(nsCSSV
}
return false;
}
bool
CSSParserImpl::ParseMargin()
{
- static const nsCSSProperty kMarginSideIDs[] = {
+ static const nsCSSPropertyID kMarginSideIDs[] = {
eCSSProperty_margin_top,
eCSSProperty_margin_right,
eCSSProperty_margin_bottom,
eCSSProperty_margin_left
};
return ParseBoxProperties(kMarginSideIDs);
}
@@ -15079,17 +15079,17 @@ CSSParserImpl::ParseObjectPosition()
AppendValue(eCSSProperty_object_position, value);
return true;
}
bool
CSSParserImpl::ParseOutline()
{
const int32_t numProps = 3;
- static const nsCSSProperty kOutlineIDs[] = {
+ static const nsCSSPropertyID kOutlineIDs[] = {
eCSSProperty_outline_color,
eCSSProperty_outline_style,
eCSSProperty_outline_width
};
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, kOutlineIDs, numProps);
if (found < 1) {
@@ -15139,17 +15139,17 @@ CSSParserImpl::ParseOverflow()
AppendValue(eCSSProperty_overflow_x, overflowX);
AppendValue(eCSSProperty_overflow_y, overflowY);
return true;
}
bool
CSSParserImpl::ParsePadding()
{
- static const nsCSSProperty kPaddingSideIDs[] = {
+ static const nsCSSPropertyID kPaddingSideIDs[] = {
eCSSProperty_padding_top,
eCSSProperty_padding_right,
eCSSProperty_padding_bottom,
eCSSProperty_padding_left
};
return ParseBoxProperties(kPaddingSideIDs);
}
@@ -15180,17 +15180,17 @@ CSSParserImpl::ParseQuotes()
}
AppendValue(eCSSProperty_quotes, value);
return true;
}
bool
CSSParserImpl::ParseTextDecoration()
{
- static const nsCSSProperty kTextDecorationIDs[] = {
+ static const nsCSSPropertyID kTextDecorationIDs[] = {
eCSSProperty_text_decoration_line,
eCSSProperty_text_decoration_style,
eCSSProperty_text_decoration_color
};
const int32_t numProps = MOZ_ARRAY_LENGTH(kTextDecorationIDs);
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, kTextDecorationIDs, numProps);
@@ -15216,17 +15216,17 @@ CSSParserImpl::ParseTextDecoration()
AppendValue(kTextDecorationIDs[index], values[index]);
}
return true;
}
bool
CSSParserImpl::ParseTextEmphasis()
{
- static constexpr nsCSSProperty kTextEmphasisIDs[] = {
+ static constexpr nsCSSPropertyID kTextEmphasisIDs[] = {
eCSSProperty_text_emphasis_style,
eCSSProperty_text_emphasis_color
};
constexpr int32_t numProps = MOZ_ARRAY_LENGTH(kTextEmphasisIDs);
nsCSSValue values[numProps];
int32_t found = ParseChoice(values, kTextEmphasisIDs, numProps);
if (found < 1) {
@@ -16252,17 +16252,17 @@ CSSParserImpl::ParseShapeOutside(nsCSSVa
}
bool CSSParserImpl::ParseTransformOrigin(bool aPerspective)
{
nsCSSValuePair position;
if (!ParseBoxPositionValues(position, true))
return false;
- nsCSSProperty prop = eCSSProperty_transform_origin;
+ nsCSSPropertyID prop = eCSSProperty_transform_origin;
if (aPerspective) {
prop = eCSSProperty_perspective_origin;
}
// Unlike many other uses of pairs, this position should always be stored
// as a pair, even if the values are the same, so it always serializes as
// a pair, and to keep the computation code simple.
if (position.mXValue.GetUnit() == eCSSUnit_Inherit ||
@@ -16627,17 +16627,17 @@ AppendValueToList(nsCSSValue& aContainer
aTail->mNext = entry;
}
entry->mValue = aValue;
return entry;
}
CSSParserImpl::ParseAnimationOrTransitionShorthandResult
CSSParserImpl::ParseAnimationOrTransitionShorthand(
- const nsCSSProperty* aProperties,
+ const nsCSSPropertyID* aProperties,
const nsCSSValue* aInitialValues,
nsCSSValue* aValues,
size_t aNumProperties)
{
nsCSSValue tempValue;
// first see if 'inherit', 'initial' or 'unset' is specified. If one is,
// it can be the only thing specified, so don't attempt to parse any
// additional properties
@@ -16723,17 +16723,17 @@ CSSParserImpl::ParseAnimationOrTransitio
}
return eParseAnimationOrTransitionShorthand_Values;
}
bool
CSSParserImpl::ParseTransition()
{
- static const nsCSSProperty kTransitionProperties[] = {
+ static const nsCSSPropertyID kTransitionProperties[] = {
eCSSProperty_transition_duration,
eCSSProperty_transition_timing_function,
// Must check 'transition-delay' after 'transition-duration', since
// that's our assumption about what the spec means for the shorthand
// syntax (the first time given is the duration, and the second
// given is the delay).
eCSSProperty_transition_delay,
// Must check 'transition-property' after
@@ -16800,17 +16800,17 @@ CSSParserImpl::ParseTransition()
AppendValue(kTransitionProperties[i], values[i]);
}
return true;
}
bool
CSSParserImpl::ParseAnimation()
{
- static const nsCSSProperty kAnimationProperties[] = {
+ static const nsCSSPropertyID kAnimationProperties[] = {
eCSSProperty_animation_duration,
eCSSProperty_animation_timing_function,
// Must check 'animation-delay' after 'animation-duration', since
// that's our assumption about what the spec means for the shorthand
// syntax (the first time given is the duration, and the second
// given is the delay).
eCSSProperty_animation_delay,
eCSSProperty_animation_direction,
@@ -16946,17 +16946,17 @@ CSSParserImpl::ParseShadowItem(nsCSSValu
nsCSSProps::kBoxShadowTypeKTable);
}
aValue.SetArrayValue(val, eCSSUnit_Array);
return true;
}
bool
-CSSParserImpl::ParseShadowList(nsCSSProperty aProperty)
+CSSParserImpl::ParseShadowList(nsCSSPropertyID aProperty)
{
nsAutoParseCompoundProperty compound(this);
bool isBoxShadow = aProperty == eCSSProperty_box_shadow;
nsCSSValue value;
// 'inherit', 'initial', 'unset' and 'none' must be alone
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
nullptr)) {
@@ -17002,17 +17002,17 @@ CSSParserImpl::SetDefaultNamespaceOnSele
if (mNameSpaceMap) {
aSelector.SetNameSpace(mNameSpaceMap->FindNameSpaceID(nullptr));
} else {
aSelector.SetNameSpace(kNameSpaceID_Unknown); // wildcard
}
}
bool
-CSSParserImpl::ParsePaint(nsCSSProperty aPropID)
+CSSParserImpl::ParsePaint(nsCSSPropertyID aPropID)
{
nsCSSValue x, y;
if (ParseVariant(x, VARIANT_HC | VARIANT_NONE | VARIANT_URL |
VARIANT_OPENTYPE_SVG_KEYWORD,
nsCSSProps::kContextPatternKTable) != CSSParseResult::Ok) {
return false;
}
@@ -17265,17 +17265,17 @@ CSSParserImpl::ParseScrollSnapType()
return false;
}
AppendValue(eCSSProperty_scroll_snap_type_x, value);
AppendValue(eCSSProperty_scroll_snap_type_y, value);
return true;
}
bool
-CSSParserImpl::ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSProperty aPropID)
+CSSParserImpl::ParseScrollSnapPoints(nsCSSValue& aValue, nsCSSPropertyID aPropID)
{
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT | VARIANT_NONE,
nullptr)) {
return true;
}
if (!GetToken(true)) {
return false;
}
@@ -17569,17 +17569,17 @@ CSSParserImpl::ParseValueWithVariables(C
aImpliedCharacters.Append(stack[i]);
}
*aType = type;
return true;
}
bool
-CSSParserImpl::IsValueValidForProperty(const nsCSSProperty aPropID,
+CSSParserImpl::IsValueValidForProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue)
{
mData.AssertInitialState();
mTempData.AssertInitialState();
nsCSSScanner scanner(aPropValue, 0);
css::ErrorReporter reporter(scanner, mSheet, mChildLoader, nullptr);
InitScanner(scanner, reporter, nullptr, nullptr, nullptr);
@@ -17739,34 +17739,34 @@ nsCSSParser::ParseRule(const nsAString&
nsIPrincipal* aSheetPrincipal,
css::Rule** aResult)
{
return static_cast<CSSParserImpl*>(mImpl)->
ParseRule(aRule, aSheetURI, aBaseURI, aSheetPrincipal, aResult);
}
void
-nsCSSParser::ParseProperty(const nsCSSProperty aPropID,
+nsCSSParser::ParseProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURI,
nsIURI* aBaseURI,
nsIPrincipal* aSheetPrincipal,
css::Declaration* aDeclaration,
bool* aChanged,
bool aIsImportant,
bool aIsSVGMode)
{
static_cast<CSSParserImpl*>(mImpl)->
ParseProperty(aPropID, aPropValue, aSheetURI, aBaseURI,
aSheetPrincipal, aDeclaration, aChanged,
aIsImportant, aIsSVGMode);
}
void
-nsCSSParser::ParseLonghandProperty(const nsCSSProperty aPropID,
+nsCSSParser::ParseLonghandProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURI,
nsIURI* aBaseURI,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aResult)
{
static_cast<CSSParserImpl*>(mImpl)->
ParseLonghandProperty(aPropID, aPropValue, aSheetURI, aBaseURI,
@@ -17912,18 +17912,18 @@ nsCSSParser::ResolveVariableValue(const
{
return static_cast<CSSParserImpl*>(mImpl)->
ResolveVariableValue(aPropertyValue, aVariables,
aResult, aFirstToken, aLastToken);
}
void
nsCSSParser::ParsePropertyWithVariableReferences(
- nsCSSProperty aPropertyID,
- nsCSSProperty aShorthandPropertyID,
+ nsCSSPropertyID aPropertyID,
+ nsCSSPropertyID aShorthandPropertyID,
const nsAString& aValue,
const CSSVariableValues* aVariables,
nsRuleData* aRuleData,
nsIURI* aDocURL,
nsIURI* aBaseURL,
nsIPrincipal* aDocPrincipal,
CSSStyleSheet* aSheet,
uint32_t aLineNumber,
@@ -17967,17 +17967,17 @@ nsCSSParser::ParseFontFaceDescriptor(nsC
nsCSSValue& aValue)
{
return static_cast<CSSParserImpl*>(mImpl)->
ParseFontFaceDescriptor(aDescID, aBuffer,
aSheetURL, aBaseURL, aSheetPrincipal, aValue);
}
bool
-nsCSSParser::IsValueValidForProperty(const nsCSSProperty aPropID,
+nsCSSParser::IsValueValidForProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue)
{
return static_cast<CSSParserImpl*>(mImpl)->
IsValueValidForProperty(aPropID, aPropValue);
}
/* static */
uint8_t
--- a/layout/style/nsCSSParser.h
+++ b/layout/style/nsCSSParser.h
@@ -6,17 +6,17 @@
/* parsing of CSS stylesheets, based on a token stream from the CSS scanner */
#ifndef nsCSSParser_h___
#define nsCSSParser_h___
#include "mozilla/Attributes.h"
#include "mozilla/css/Loader.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSScanner.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsStringFwd.h"
#include "nsTArrayForwardDeclare.h"
class nsIPrincipal;
class nsIURI;
@@ -108,30 +108,30 @@ public:
// Parse the value of a single CSS property, and add or replace that
// property in aDeclaration.
//
// SVG "mapped attributes" (which correspond directly to CSS
// properties) are parsed slightly differently from regular CSS; in
// particular, units may be omitted from <length>. The 'aIsSVGMode'
// argument controls this quirk. Note that this *only* applies to
// mapped attributes, not inline styles or full style sheets in SVG.
- void ParseProperty(const nsCSSProperty aPropID,
+ void ParseProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
mozilla::css::Declaration* aDeclaration,
bool* aChanged,
bool aIsImportant,
bool aIsSVGMode = false);
// Same as ParseProperty but returns an nsCSSValue in aResult
// rather than storing the property in a Declaration. aPropID
// must be a longhand property.
- void ParseLonghandProperty(const nsCSSProperty aPropID,
+ void ParseLonghandProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aResult);
// Parse the value of a CSS transform property. Returns
// whether the value was successfully parsed. If
@@ -280,18 +280,18 @@ public:
* otherwise, aPropertyID will be parsed. Either way, only aPropertyID,
* a longhand property, will be copied over to the rule data.
*
* If the property cannot be parsed, it will be treated as if 'initial' or
* 'inherit' were specified, for non-inherited and inherited properties
* respectively.
*/
void ParsePropertyWithVariableReferences(
- nsCSSProperty aPropertyID,
- nsCSSProperty aShorthandPropertyID,
+ nsCSSPropertyID aPropertyID,
+ nsCSSPropertyID aShorthandPropertyID,
const nsAString& aValue,
const mozilla::CSSVariableValues* aVariables,
nsRuleData* aRuleData,
nsIURI* aDocURL,
nsIURI* aBaseURL,
nsIPrincipal* aDocPrincipal,
mozilla::CSSStyleSheet* aSheet,
uint32_t aLineNumber,
@@ -311,17 +311,17 @@ public:
bool ParseFontFaceDescriptor(nsCSSFontDesc aDescID,
const nsAString& aBuffer,
nsIURI* aSheetURL,
nsIURI* aBaseURL,
nsIPrincipal* aSheetPrincipal,
nsCSSValue& aValue);
// Check whether a given value can be applied to a property.
- bool IsValueValidForProperty(const nsCSSProperty aPropID,
+ bool IsValueValidForProperty(const nsCSSPropertyID aPropID,
const nsAString& aPropValue);
// Return the default value to be used for -moz-control-character-visibility,
// from preferences (cached by our Startup(), so that both nsStyleText and
// nsRuleNode can have fast access to it).
static uint8_t ControlCharVisibilityDefault();
protected:
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -22,17 +22,17 @@
-. 'name' entries represent a CSS property name and *must* use only
lowercase characters.
-. 'id' should be the same as 'name' except that all hyphens ('-')
in 'name' are converted to underscores ('_') in 'id'. For properties
on a standards track, any '-moz-' prefix is removed in 'id'. This
lets us do nice things with the macros without having to copy/convert
strings at runtime. These are the names used for the enum values of
- the nsCSSProperty enumeration defined in nsCSSProps.h.
+ the nsCSSPropertyID enumeration defined in nsCSSProps.h.
-. 'method' is designed to be as input for CSS2Properties and similar
callers. It must always be the same as 'name' except it must use
InterCaps and all hyphens ('-') must be removed. Callers using this
parameter must also define the CSS_PROP_PUBLIC_OR_PRIVATE(publicname_,
privatename_) macro to yield either publicname_ or privatename_.
The names differ in that publicname_ has Moz prefixes where they are
used, and also in CssFloat vs. Float. The caller's choice depends on
rename from layout/style/nsCSSProperty.h
rename to layout/style/nsCSSPropertyID.h
--- a/layout/style/nsCSSProperty.h
+++ b/layout/style/nsCSSPropertyID.h
@@ -1,28 +1,28 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* enum types for CSS properties and their values */
-#ifndef nsCSSProperty_h___
-#define nsCSSProperty_h___
+#ifndef nsCSSPropertyID_h___
+#define nsCSSPropertyID_h___
#include <nsHashKeys.h>
/*
Declare the enum list using the magic of preprocessing
enum values are "eCSSProperty_foo" (where foo is the property)
To change the list of properties, see nsCSSPropList.h
*/
-enum nsCSSProperty {
+enum nsCSSPropertyID {
eCSSProperty_UNKNOWN = -1,
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, stylestruct_, stylestructoffset_, animtype_) \
eCSSProperty_##id_,
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
@@ -65,17 +65,17 @@ enum nsCSSProperty {
// Extra value to represent custom properties (--*).
eCSSPropertyExtra_variable
};
namespace mozilla {
template<>
inline PLDHashNumber
-Hash<nsCSSProperty>(const nsCSSProperty& aValue)
+Hash<nsCSSPropertyID>(const nsCSSPropertyID& aValue)
{
return uint32_t(aValue);
}
} // namespace mozilla
// The "descriptors" that can appear in a @font-face rule.
// They have the syntax of properties but different value rules.
@@ -107,9 +107,9 @@ enum nsCSSPropertyLogicalGroup {
eCSSPropertyLogicalGroup_##name_,
#include "nsCSSPropLogicalGroupList.h"
#undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
#undef CSS_PROP_LOGICAL_GROUP_BOX
#undef CSS_PROP_LOGICAL_GROUP_AXIS
eCSSPropertyLogicalGroup_COUNT
};
-#endif /* nsCSSProperty_h___ */
+#endif /* nsCSSPropertyID_h___ */
--- a/layout/style/nsCSSPropertySet.h
+++ b/layout/style/nsCSSPropertySet.h
@@ -5,53 +5,53 @@
/* bit vectors for sets of CSS properties */
#ifndef nsCSSPropertySet_h__
#define nsCSSPropertySet_h__
#include "mozilla/ArrayUtils.h"
#include "mozilla/PodOperations.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include <limits.h> // for CHAR_BIT
/**
* nsCSSPropertySet maintains a set of non-shorthand CSS properties. In
* other words, for each longhand CSS property we support, it has a bit
* for whether that property is in the set.
*/
class nsCSSPropertySet {
public:
nsCSSPropertySet() { Empty(); }
// auto-generated copy-constructor OK
- void AssertInSetRange(nsCSSProperty aProperty) const {
+ void AssertInSetRange(nsCSSPropertyID aProperty) const {
NS_ASSERTION(0 <= aProperty &&
aProperty < eCSSProperty_COUNT_no_shorthands,
"out of bounds");
}
// Conversion of aProperty to |size_t| after AssertInSetRange
// lets the compiler generate significantly tighter code.
- void AddProperty(nsCSSProperty aProperty) {
+ void AddProperty(nsCSSPropertyID aProperty) {
AssertInSetRange(aProperty);
size_t p = aProperty;
mProperties[p / kBitsInChunk] |=
property_set_type(1) << (p % kBitsInChunk);
}
- void RemoveProperty(nsCSSProperty aProperty) {
+ void RemoveProperty(nsCSSPropertyID aProperty) {
AssertInSetRange(aProperty);
size_t p = aProperty;
mProperties[p / kBitsInChunk] &=
~(property_set_type(1) << (p % kBitsInChunk));
}
- bool HasProperty(nsCSSProperty aProperty) const {
+ bool HasProperty(nsCSSPropertyID aProperty) const {
AssertInSetRange(aProperty);
size_t p = aProperty;
return (mProperties[p / kBitsInChunk] &
(property_set_type(1) << (p % kBitsInChunk))) != 0;
}
void Empty() {
memset(mProperties, 0, sizeof(mProperties));
@@ -82,17 +82,17 @@ public:
* likely to be set).
*/
bool HasPropertyInChunk(size_t aChunk) const {
return mProperties[aChunk] != 0;
}
bool HasPropertyAt(size_t aChunk, size_t aBit) const {
return (mProperties[aChunk] & (property_set_type(1) << aBit)) != 0;
}
- static nsCSSProperty CSSPropertyAt(size_t aChunk, size_t aBit) {
- return nsCSSProperty(aChunk * kBitsInChunk + aBit);
+ static nsCSSPropertyID CSSPropertyAt(size_t aChunk, size_t aBit) {
+ return nsCSSPropertyID(aChunk * kBitsInChunk + aBit);
}
private:
property_set_type mProperties[kChunkCount];
};
#endif /* !defined(nsCSSPropertySet_h__) */
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -76,21 +76,21 @@ const char* const kCSSRawProperties[eCSS
using namespace mozilla;
static int32_t gPropertyTableRefCount;
static nsStaticCaseInsensitiveNameTable* gPropertyTable;
static nsStaticCaseInsensitiveNameTable* gFontDescTable;
static nsStaticCaseInsensitiveNameTable* gCounterDescTable;
static nsStaticCaseInsensitiveNameTable* gPredefinedCounterStyleTable;
-static nsDataHashtable<nsCStringHashKey,nsCSSProperty>* gPropertyIDLNameTable;
-
-/* static */ nsCSSProperty *
+static nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>* gPropertyIDLNameTable;
+
+/* static */ nsCSSPropertyID *
nsCSSProps::gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
-/* static */ nsCSSProperty* nsCSSProps::gShorthandsContainingPool = nullptr;
+/* static */ nsCSSPropertyID* nsCSSProps::gShorthandsContainingPool = nullptr;
static const char* const kCSSRawFontDescs[] = {
#define CSS_FONT_DESC(name_, method_) #name_,
#include "nsCSSFontDescList.h"
#undef CSS_FONT_DESC
};
static const char* const kCSSRawCounterDescs[] = {
@@ -123,17 +123,17 @@ static const char* const kCSSRawPredefin
// 7.1.3 Chinese
"simp-chinese-informal", "simp-chinese-formal",
"trad-chinese-informal", "trad-chinese-formal", "cjk-ideographic",
// 7.2 Ethiopic Numeric Counter Style
"ethiopic-numeric"
};
struct PropertyAndCount {
- nsCSSProperty property;
+ nsCSSPropertyID property;
uint32_t count;
};
static int
SortPropertyAndCount(const void* s1, const void* s2, void *closure)
{
const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1);
const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2);
@@ -146,17 +146,17 @@ SortPropertyAndCount(const void* s1, con
// We need eCSSAliasCount so we can make gAliases nonzero size when there
// are no aliases.
enum {
eCSSAliasCount = eCSSProperty_COUNT_with_aliases - eCSSProperty_COUNT
};
// The names are in kCSSRawProperties.
-static nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = {
+static nsCSSPropertyID gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = {
#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \
eCSSProperty_##propid_ ,
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS
};
nsStaticCaseInsensitiveNameTable*
CreateStaticTable(const char* const aRawTable[], int32_t aLength)
@@ -187,20 +187,20 @@ nsCSSProps::AddRefTable(void)
kCSSRawProperties, eCSSProperty_COUNT_with_aliases);
gFontDescTable = CreateStaticTable(kCSSRawFontDescs, eCSSFontDesc_COUNT);
gCounterDescTable = CreateStaticTable(
kCSSRawCounterDescs, eCSSCounterDesc_COUNT);
gPredefinedCounterStyleTable = CreateStaticTable(
kCSSRawPredefinedCounterStyles,
ArrayLength(kCSSRawPredefinedCounterStyles));
- gPropertyIDLNameTable = new nsDataHashtable<nsCStringHashKey,nsCSSProperty>;
- for (nsCSSProperty p = nsCSSProperty(0);
+ gPropertyIDLNameTable = new nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>;
+ for (nsCSSPropertyID p = nsCSSPropertyID(0);
size_t(p) < ArrayLength(kIDLNameTable);
- p = nsCSSProperty(p + 1)) {
+ p = nsCSSPropertyID(p + 1)) {
if (kIDLNameTable[p]) {
gPropertyIDLNameTable->Put(nsDependentCString(kIDLNameTable[p]), p);
}
}
BuildShorthandsContainingTable();
static bool prefObserversInited = false;
@@ -238,65 +238,65 @@ nsCSSProps::AddRefTable(void)
{
// Assert that if CSS_PROPERTY_ENABLED_IN_UA_SHEETS or
// CSS_PROPERTY_ENABLED_IN_CHROME is used on a shorthand property
// that all of its component longhands also have the flag.
static uint32_t flagsToCheck[] = {
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
CSS_PROPERTY_ENABLED_IN_CHROME
};
- for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
+ for (nsCSSPropertyID shorthand = eCSSProperty_COUNT_no_shorthands;
shorthand < eCSSProperty_COUNT;
- shorthand = nsCSSProperty(shorthand + 1)) {
+ shorthand = nsCSSPropertyID(shorthand + 1)) {
for (size_t i = 0; i < ArrayLength(flagsToCheck); i++) {
uint32_t flag = flagsToCheck[i];
if (!nsCSSProps::PropHasFlags(shorthand, flag)) {
continue;
}
- for (const nsCSSProperty* p =
+ for (const nsCSSPropertyID* p =
nsCSSProps::SubpropertyEntryFor(shorthand);
*p != eCSSProperty_UNKNOWN;
++p) {
MOZ_ASSERT(nsCSSProps::PropHasFlags(*p, flag),
"all subproperties of a property with a "
"CSS_PROPERTY_ENABLED_* flag must also have "
"the flag");
}
}
}
// Assert that CSS_PROPERTY_INTERNAL is used on properties in
// #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL sections of nsCSSPropList.h
// and on no others.
- static nsCSSProperty nonInternalProperties[] = {
+ static nsCSSPropertyID nonInternalProperties[] = {
#define CSS_PROP(name_, id_, ...) eCSSProperty_##id_,
#define CSS_PROP_SHORTHAND(name_, id_, ...) eCSSProperty_##id_,
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP_SHORTHAND
#undef CSS_PROP
};
MOZ_ASSERT(ArrayLength(nonInternalProperties) <= eCSSProperty_COUNT);
bool found[eCSSProperty_COUNT];
PodArrayZero(found);
- for (nsCSSProperty p : nonInternalProperties) {
+ for (nsCSSPropertyID p : nonInternalProperties) {
MOZ_ASSERT(!nsCSSProps::PropHasFlags(p, CSS_PROPERTY_INTERNAL),
"properties defined outside of #ifndef "
"CSS_PROP_LIST_EXCLUDE_INTERNAL sections must not have "
"the CSS_PROPERTY_INTERNAL flag");
found[p] = true;
}
for (size_t i = 0; i < ArrayLength(found); ++i) {
if (!found[i]) {
- auto p = static_cast<nsCSSProperty>(i);
+ auto p = static_cast<nsCSSPropertyID>(i);
MOZ_ASSERT(nsCSSProps::PropHasFlags(p, CSS_PROPERTY_INTERNAL),
"properties defined in #ifndef "
"CSS_PROP_LIST_EXCLUDE_INTERNAL sections must have "
"the CSS_PROPERTY_INTERNAL flag");
}
}
}
#endif
@@ -307,64 +307,64 @@ nsCSSProps::AddRefTable(void)
bool
nsCSSProps::BuildShorthandsContainingTable()
{
uint32_t occurrenceCounts[eCSSProperty_COUNT_no_shorthands];
memset(occurrenceCounts, 0, sizeof(occurrenceCounts));
PropertyAndCount subpropCounts[eCSSProperty_COUNT -
eCSSProperty_COUNT_no_shorthands];
- for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
+ for (nsCSSPropertyID shorthand = eCSSProperty_COUNT_no_shorthands;
shorthand < eCSSProperty_COUNT;
- shorthand = nsCSSProperty(shorthand + 1)) {
+ shorthand = nsCSSPropertyID(shorthand + 1)) {
#ifdef DEBUG_SHORTHANDS_CONTAINING
printf("Considering shorthand property '%s'.\n",
nsCSSProps::GetStringValue(shorthand).get());
#endif
PropertyAndCount &subpropCountsEntry =
subpropCounts[shorthand - eCSSProperty_COUNT_no_shorthands];
subpropCountsEntry.property = shorthand;
subpropCountsEntry.count = 0;
if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) {
// Don't put shorthands that are acting as aliases in the
// shorthands-containing lists.
continue;
}
- for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
+ for (const nsCSSPropertyID* subprops = SubpropertyEntryFor(shorthand);
*subprops != eCSSProperty_UNKNOWN;
++subprops) {
MOZ_ASSERT(0 <= *subprops && *subprops < eCSSProperty_COUNT_no_shorthands,
"subproperty must be a longhand");
++occurrenceCounts[*subprops];
++subpropCountsEntry.count;
}
}
uint32_t poolEntries = 0;
- for (nsCSSProperty longhand = nsCSSProperty(0);
+ for (nsCSSPropertyID longhand = nsCSSPropertyID(0);
longhand < eCSSProperty_COUNT_no_shorthands;
- longhand = nsCSSProperty(longhand + 1)) {
+ longhand = nsCSSPropertyID(longhand + 1)) {
uint32_t count = occurrenceCounts[longhand];
if (count > 0)
// leave room for terminator
poolEntries += count + 1;
}
- gShorthandsContainingPool = new nsCSSProperty[poolEntries];
+ gShorthandsContainingPool = new nsCSSPropertyID[poolEntries];
if (!gShorthandsContainingPool)
return false;
// Initialize all entries to point to their null-terminator.
{
- nsCSSProperty *poolCursor = gShorthandsContainingPool - 1;
- nsCSSProperty *lastTerminator =
+ nsCSSPropertyID *poolCursor = gShorthandsContainingPool - 1;
+ nsCSSPropertyID *lastTerminator =
gShorthandsContainingPool + poolEntries - 1;
- for (nsCSSProperty longhand = nsCSSProperty(0);
+ for (nsCSSPropertyID longhand = nsCSSPropertyID(0);
longhand < eCSSProperty_COUNT_no_shorthands;
- longhand = nsCSSProperty(longhand + 1)) {
+ longhand = nsCSSPropertyID(longhand + 1)) {
uint32_t count = occurrenceCounts[longhand];
if (count > 0) {
poolCursor += count + 1;
gShorthandsContainingTable[longhand] = poolCursor;
*poolCursor = eCSSProperty_UNKNOWN;
} else {
gShorthandsContainingTable[longhand] = lastTerminator;
}
@@ -388,74 +388,74 @@ nsCSSProps::BuildShorthandsContainingTab
nsCSSProps::GetStringValue(shorthandAndCount->property).get());
#endif
if (nsCSSProps::PropHasFlags(shorthandAndCount->property,
CSS_PROPERTY_IS_ALIAS)) {
// Don't put shorthands that are acting as aliases in the
// shorthands-containing lists.
continue;
}
- for (const nsCSSProperty* subprops =
+ for (const nsCSSPropertyID* subprops =
SubpropertyEntryFor(shorthandAndCount->property);
*subprops != eCSSProperty_UNKNOWN;
++subprops) {
*(--gShorthandsContainingTable[*subprops]) = shorthandAndCount->property;
}
}
#ifdef DEBUG_SHORTHANDS_CONTAINING
- for (nsCSSProperty longhand = nsCSSProperty(0);
+ for (nsCSSPropertyID longhand = nsCSSPropertyID(0);
longhand < eCSSProperty_COUNT_no_shorthands;
- longhand = nsCSSProperty(longhand + 1)) {
+ longhand = nsCSSPropertyID(longhand + 1)) {
printf("Property %s is in %d shorthands.\n",
nsCSSProps::GetStringValue(longhand).get(),
occurrenceCounts[longhand]);
- for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand);
+ for (const nsCSSPropertyID *shorthands = ShorthandsContaining(longhand);
*shorthands != eCSSProperty_UNKNOWN;
++shorthands) {
printf(" %s\n", nsCSSProps::GetStringValue(*shorthands).get());
}
}
#endif
#ifdef DEBUG
// Verify that all values that should be are present.
- for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
+ for (nsCSSPropertyID shorthand = eCSSProperty_COUNT_no_shorthands;
shorthand < eCSSProperty_COUNT;
- shorthand = nsCSSProperty(shorthand + 1)) {
+ shorthand = nsCSSPropertyID(shorthand + 1)) {
if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) {
// Don't put shorthands that are acting as aliases in the
// shorthands-containing lists.
continue;
}
- for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
+ for (const nsCSSPropertyID* subprops = SubpropertyEntryFor(shorthand);
*subprops != eCSSProperty_UNKNOWN;
++subprops) {
uint32_t count = 0;
- for (const nsCSSProperty *shcont = ShorthandsContaining(*subprops);
+ for (const nsCSSPropertyID *shcont = ShorthandsContaining(*subprops);
*shcont != eCSSProperty_UNKNOWN;
++shcont) {
if (*shcont == shorthand)
++count;
}
MOZ_ASSERT(count == 1,
"subproperty of shorthand should have shorthand"
" in its ShorthandsContaining() table");
}
}
// Verify that there are no extra values
- for (nsCSSProperty longhand = nsCSSProperty(0);
+ for (nsCSSPropertyID longhand = nsCSSPropertyID(0);
longhand < eCSSProperty_COUNT_no_shorthands;
- longhand = nsCSSProperty(longhand + 1)) {
- for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand);
+ longhand = nsCSSPropertyID(longhand + 1)) {
+ for (const nsCSSPropertyID *shorthands = ShorthandsContaining(longhand);
*shorthands != eCSSProperty_UNKNOWN;
++shorthands) {
uint32_t count = 0;
- for (const nsCSSProperty* subprops = SubpropertyEntryFor(*shorthands);
+ for (const nsCSSPropertyID* subprops = SubpropertyEntryFor(*shorthands);
*subprops != eCSSProperty_UNKNOWN;
++subprops) {
if (*subprops == longhand)
++count;
}
MOZ_ASSERT(count == 1,
"longhand should be in subproperty table of "
"property in its ShorthandsContaining() table");
@@ -486,17 +486,17 @@ nsCSSProps::ReleaseTable(void)
gPropertyIDLNameTable = nullptr;
delete [] gShorthandsContainingPool;
gShorthandsContainingPool = nullptr;
}
}
/* static */ bool
-nsCSSProps::IsInherited(nsCSSProperty aProperty)
+nsCSSProps::IsInherited(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(!IsShorthand(aProperty));
nsStyleStructID sid = kSIDTable[aProperty];
return nsCachedStyleData::IsInherited(sid);
}
/* static */ bool
@@ -509,28 +509,28 @@ nsCSSProps::IsCustomPropertyName(const n
/* static */ bool
nsCSSProps::IsCustomPropertyName(const nsAString& aProperty)
{
return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH &&
StringBeginsWith(aProperty, NS_LITERAL_STRING("--"));
}
-nsCSSProperty
+nsCSSPropertyID
nsCSSProps::LookupProperty(const nsACString& aProperty,
EnabledState aEnabled)
{
MOZ_ASSERT(gPropertyTable, "no lookup table, needs addref");
if (nsLayoutUtils::CSSVariablesEnabled() &&
IsCustomPropertyName(aProperty)) {
return eCSSPropertyExtra_variable;
}
- nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
+ nsCSSPropertyID res = nsCSSPropertyID(gPropertyTable->Lookup(aProperty));
if (MOZ_LIKELY(res < eCSSProperty_COUNT)) {
if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) {
res = eCSSProperty_UNKNOWN;
}
return res;
}
MOZ_ASSERT(eCSSAliasCount != 0,
"'res' must be an alias at this point so we better have some!");
@@ -543,29 +543,29 @@ nsCSSProps::LookupProperty(const nsACStr
"aliases must not point to other aliases");
if (IsEnabled(res) || aEnabled == CSSEnabledState::eIgnoreEnabledState) {
return res;
}
}
return eCSSProperty_UNKNOWN;
}
-nsCSSProperty
+nsCSSPropertyID
nsCSSProps::LookupProperty(const nsAString& aProperty, EnabledState aEnabled)
{
if (nsLayoutUtils::CSSVariablesEnabled() &&
IsCustomPropertyName(aProperty)) {
return eCSSPropertyExtra_variable;
}
// This is faster than converting and calling
// LookupProperty(nsACString&). The table will do its own
// converting and avoid a PromiseFlatCString() call.
MOZ_ASSERT(gPropertyTable, "no lookup table, needs addref");
- nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
+ nsCSSPropertyID res = nsCSSPropertyID(gPropertyTable->Lookup(aProperty));
if (MOZ_LIKELY(res < eCSSProperty_COUNT)) {
if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) {
res = eCSSProperty_UNKNOWN;
}
return res;
}
MOZ_ASSERT(eCSSAliasCount != 0,
"'res' must be an alias at this point so we better have some!");
@@ -578,32 +578,32 @@ nsCSSProps::LookupProperty(const nsAStri
"aliases must not point to other aliases");
if (IsEnabled(res) || aEnabled == CSSEnabledState::eIgnoreEnabledState) {
return res;
}
}
return eCSSProperty_UNKNOWN;
}
-nsCSSProperty
+nsCSSPropertyID
nsCSSProps::LookupPropertyByIDLName(const nsACString& aPropertyIDLName,
EnabledState aEnabled)
{
- nsCSSProperty res;
+ nsCSSPropertyID res;
if (!gPropertyIDLNameTable->Get(aPropertyIDLName, &res)) {
return eCSSProperty_UNKNOWN;
}
MOZ_ASSERT(res < eCSSProperty_COUNT);
if (!IsEnabled(res, aEnabled)) {
return eCSSProperty_UNKNOWN;
}
return res;
}
-nsCSSProperty
+nsCSSPropertyID
nsCSSProps::LookupPropertyByIDLName(const nsAString& aPropertyIDLName,
EnabledState aEnabled)
{
MOZ_ASSERT(gPropertyIDLNameTable, "no lookup table, needs addref");
return LookupPropertyByIDLName(NS_ConvertUTF16toUTF8(aPropertyIDLName),
aEnabled);
}
@@ -673,17 +673,17 @@ nsCSSProps::IsPredefinedCounterStyle(con
{
MOZ_ASSERT(gPredefinedCounterStyleTable,
"no lookup table, needs addref");
return gPredefinedCounterStyleTable->Lookup(aStyle) !=
nsStaticCaseInsensitiveNameTable::NOT_FOUND;
}
const nsAFlatCString&
-nsCSSProps::GetStringValue(nsCSSProperty aProperty)
+nsCSSProps::GetStringValue(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(gPropertyTable, "no lookup table, needs addref");
if (gPropertyTable) {
return gPropertyTable->GetStringValue(int32_t(aProperty));
} else {
static nsDependentCString sNullStr("");
return sNullStr;
}
@@ -2499,17 +2499,17 @@ nsCSSProps::kKeywordTableTable[eCSSPrope
kwtable_,
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP
};
const nsAFlatCString&
-nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, int32_t aValue)
+nsCSSProps::LookupPropertyValue(nsCSSPropertyID aProp, int32_t aValue)
{
MOZ_ASSERT(aProp >= 0 && aProp < eCSSProperty_COUNT,
"property out of range");
#ifdef DEBUG
typedef decltype(KTableEntry::mValue) table_value_type;
NS_ASSERTION(table_value_type(aValue) == aValue, "Value out of range");
#endif
@@ -2583,84 +2583,84 @@ const uint32_t nsCSSProps::kFlagsTable[e
#include "nsCSSPropList.h"
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) flags_,
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
};
-static const nsCSSProperty gAllSubpropTable[] = {
+static const nsCSSPropertyID gAllSubpropTable[] = {
#define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
stylestruct_, stylestructoffset_, animtype_) \
eCSSProperty_##id_,
#include "nsCSSPropList.h"
#undef CSS_PROP
#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gAnimationSubpropTable[] = {
+static const nsCSSPropertyID gAnimationSubpropTable[] = {
eCSSProperty_animation_duration,
eCSSProperty_animation_timing_function,
eCSSProperty_animation_delay,
eCSSProperty_animation_direction,
eCSSProperty_animation_fill_mode,
eCSSProperty_animation_iteration_count,
eCSSProperty_animation_play_state,
// List animation-name last so we serialize it last, in case it has
// a value that conflicts with one of the other properties. (See
// how Declaration::GetValue serializes 'animation'.
eCSSProperty_animation_name,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderRadiusSubpropTable[] = {
+static const nsCSSPropertyID gBorderRadiusSubpropTable[] = {
// Code relies on these being in topleft-topright-bottomright-bottomleft
// order.
eCSSProperty_border_top_left_radius,
eCSSProperty_border_top_right_radius,
eCSSProperty_border_bottom_right_radius,
eCSSProperty_border_bottom_left_radius,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gOutlineRadiusSubpropTable[] = {
+static const nsCSSPropertyID gOutlineRadiusSubpropTable[] = {
// Code relies on these being in topleft-topright-bottomright-bottomleft
// order.
eCSSProperty__moz_outline_radius_topLeft,
eCSSProperty__moz_outline_radius_topRight,
eCSSProperty__moz_outline_radius_bottomRight,
eCSSProperty__moz_outline_radius_bottomLeft,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBackgroundSubpropTable[] = {
+static const nsCSSPropertyID gBackgroundSubpropTable[] = {
eCSSProperty_background_color,
eCSSProperty_background_image,
eCSSProperty_background_repeat,
eCSSProperty_background_attachment,
eCSSProperty_background_clip,
eCSSProperty_background_origin,
eCSSProperty_background_position_x,
eCSSProperty_background_position_y,
eCSSProperty_background_size,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBackgroundPositionSubpropTable[] = {
+static const nsCSSPropertyID gBackgroundPositionSubpropTable[] = {
eCSSProperty_background_position_x,
eCSSProperty_background_position_y,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderSubpropTable[] = {
+static const nsCSSPropertyID gBorderSubpropTable[] = {
eCSSProperty_border_top_width,
eCSSProperty_border_right_width,
eCSSProperty_border_bottom_width,
eCSSProperty_border_left_width,
eCSSProperty_border_top_style,
eCSSProperty_border_right_style,
eCSSProperty_border_bottom_style,
eCSSProperty_border_left_style,
@@ -2675,120 +2675,120 @@ static const nsCSSProperty gBorderSubpro
eCSSProperty_border_image_source,
eCSSProperty_border_image_slice,
eCSSProperty_border_image_width,
eCSSProperty_border_image_outset,
eCSSProperty_border_image_repeat,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderBlockEndSubpropTable[] = {
+static const nsCSSPropertyID gBorderBlockEndSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_block_end_width,
eCSSProperty_border_block_end_style,
eCSSProperty_border_block_end_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderBlockStartSubpropTable[] = {
+static const nsCSSPropertyID gBorderBlockStartSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_block_start_width,
eCSSProperty_border_block_start_style,
eCSSProperty_border_block_start_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderBottomSubpropTable[] = {
+static const nsCSSPropertyID gBorderBottomSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_bottom_width,
eCSSProperty_border_bottom_style,
eCSSProperty_border_bottom_color,
eCSSProperty_UNKNOWN
};
static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
"box side constants not top/right/bottom/left == 0/1/2/3");
-static const nsCSSProperty gBorderColorSubpropTable[] = {
+static const nsCSSPropertyID gBorderColorSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
// Code relies on these matching the NS_SIDE_* constants.
eCSSProperty_border_top_color,
eCSSProperty_border_right_color,
eCSSProperty_border_bottom_color,
eCSSProperty_border_left_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderInlineEndSubpropTable[] = {
+static const nsCSSPropertyID gBorderInlineEndSubpropTable[] = {
// Declaration.cpp output the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_inline_end_width,
eCSSProperty_border_inline_end_style,
eCSSProperty_border_inline_end_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderLeftSubpropTable[] = {
+static const nsCSSPropertyID gBorderLeftSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_left_width,
eCSSProperty_border_left_style,
eCSSProperty_border_left_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderRightSubpropTable[] = {
+static const nsCSSPropertyID gBorderRightSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_right_width,
eCSSProperty_border_right_style,
eCSSProperty_border_right_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderInlineStartSubpropTable[] = {
+static const nsCSSPropertyID gBorderInlineStartSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_inline_start_width,
eCSSProperty_border_inline_start_style,
eCSSProperty_border_inline_start_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderStyleSubpropTable[] = {
+static const nsCSSPropertyID gBorderStyleSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_border_top_style,
eCSSProperty_border_right_style,
eCSSProperty_border_bottom_style,
eCSSProperty_border_left_style,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderTopSubpropTable[] = {
+static const nsCSSPropertyID gBorderTopSubpropTable[] = {
// Declaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_border_top_width,
eCSSProperty_border_top_style,
eCSSProperty_border_top_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderWidthSubpropTable[] = {
+static const nsCSSPropertyID gBorderWidthSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_border_top_width,
eCSSProperty_border_right_width,
eCSSProperty_border_bottom_width,
eCSSProperty_border_left_width,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gFontSubpropTable[] = {
+static const nsCSSPropertyID gFontSubpropTable[] = {
eCSSProperty_font_family,
eCSSProperty_font_style,
eCSSProperty_font_weight,
eCSSProperty_font_size,
eCSSProperty_line_height,
eCSSProperty_font_size_adjust,
eCSSProperty_font_stretch,
eCSSProperty__x_system_font,
@@ -2800,286 +2800,286 @@ static const nsCSSProperty gFontSubpropT
eCSSProperty_font_variant_caps,
eCSSProperty_font_variant_east_asian,
eCSSProperty_font_variant_ligatures,
eCSSProperty_font_variant_numeric,
eCSSProperty_font_variant_position,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gFontVariantSubpropTable[] = {
+static const nsCSSPropertyID gFontVariantSubpropTable[] = {
eCSSProperty_font_variant_alternates,
eCSSProperty_font_variant_caps,
eCSSProperty_font_variant_east_asian,
eCSSProperty_font_variant_ligatures,
eCSSProperty_font_variant_numeric,
eCSSProperty_font_variant_position,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gListStyleSubpropTable[] = {
+static const nsCSSPropertyID gListStyleSubpropTable[] = {
eCSSProperty_list_style_type,
eCSSProperty_list_style_image,
eCSSProperty_list_style_position,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gMarginSubpropTable[] = {
+static const nsCSSPropertyID gMarginSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_margin_top,
eCSSProperty_margin_right,
eCSSProperty_margin_bottom,
eCSSProperty_margin_left,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gOutlineSubpropTable[] = {
+static const nsCSSPropertyID gOutlineSubpropTable[] = {
// nsCSSDeclaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty_outline_width,
eCSSProperty_outline_style,
eCSSProperty_outline_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gColumnsSubpropTable[] = {
+static const nsCSSPropertyID gColumnsSubpropTable[] = {
eCSSProperty__moz_column_count,
eCSSProperty__moz_column_width,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gColumnRuleSubpropTable[] = {
+static const nsCSSPropertyID gColumnRuleSubpropTable[] = {
// nsCSSDeclaration.cpp outputs the subproperties in this order.
// It also depends on the color being third.
eCSSProperty__moz_column_rule_width,
eCSSProperty__moz_column_rule_style,
eCSSProperty__moz_column_rule_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gFlexSubpropTable[] = {
+static const nsCSSPropertyID gFlexSubpropTable[] = {
eCSSProperty_flex_grow,
eCSSProperty_flex_shrink,
eCSSProperty_flex_basis,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gFlexFlowSubpropTable[] = {
+static const nsCSSPropertyID gFlexFlowSubpropTable[] = {
eCSSProperty_flex_direction,
eCSSProperty_flex_wrap,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridTemplateSubpropTable[] = {
+static const nsCSSPropertyID gGridTemplateSubpropTable[] = {
eCSSProperty_grid_template_areas,
eCSSProperty_grid_template_rows,
eCSSProperty_grid_template_columns,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridSubpropTable[] = {
+static const nsCSSPropertyID gGridSubpropTable[] = {
eCSSProperty_grid_template_areas,
eCSSProperty_grid_template_rows,
eCSSProperty_grid_template_columns,
eCSSProperty_grid_auto_flow,
eCSSProperty_grid_auto_rows,
eCSSProperty_grid_auto_columns,
eCSSProperty_grid_row_gap, // can only be reset, not get/set
eCSSProperty_grid_column_gap, // can only be reset, not get/set
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridColumnSubpropTable[] = {
+static const nsCSSPropertyID gGridColumnSubpropTable[] = {
eCSSProperty_grid_column_start,
eCSSProperty_grid_column_end,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridRowSubpropTable[] = {
+static const nsCSSPropertyID gGridRowSubpropTable[] = {
eCSSProperty_grid_row_start,
eCSSProperty_grid_row_end,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridAreaSubpropTable[] = {
+static const nsCSSPropertyID gGridAreaSubpropTable[] = {
eCSSProperty_grid_row_start,
eCSSProperty_grid_column_start,
eCSSProperty_grid_row_end,
eCSSProperty_grid_column_end,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gGridGapSubpropTable[] = {
+static const nsCSSPropertyID gGridGapSubpropTable[] = {
eCSSProperty_grid_row_gap,
eCSSProperty_grid_column_gap,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gOverflowSubpropTable[] = {
+static const nsCSSPropertyID gOverflowSubpropTable[] = {
eCSSProperty_overflow_x,
eCSSProperty_overflow_y,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gPaddingSubpropTable[] = {
+static const nsCSSPropertyID gPaddingSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_padding_top,
eCSSProperty_padding_right,
eCSSProperty_padding_bottom,
eCSSProperty_padding_left,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gTextDecorationSubpropTable[] = {
+static const nsCSSPropertyID gTextDecorationSubpropTable[] = {
eCSSProperty_text_decoration_color,
eCSSProperty_text_decoration_line,
eCSSProperty_text_decoration_style,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gTextEmphasisSubpropTable[] = {
+static const nsCSSPropertyID gTextEmphasisSubpropTable[] = {
eCSSProperty_text_emphasis_style,
eCSSProperty_text_emphasis_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gWebkitTextStrokeSubpropTable[] = {
+static const nsCSSPropertyID gWebkitTextStrokeSubpropTable[] = {
eCSSProperty__webkit_text_stroke_width,
eCSSProperty__webkit_text_stroke_color,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gTransitionSubpropTable[] = {
+static const nsCSSPropertyID gTransitionSubpropTable[] = {
eCSSProperty_transition_property,
eCSSProperty_transition_duration,
eCSSProperty_transition_timing_function,
eCSSProperty_transition_delay,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gBorderImageSubpropTable[] = {
+static const nsCSSPropertyID gBorderImageSubpropTable[] = {
eCSSProperty_border_image_source,
eCSSProperty_border_image_slice,
eCSSProperty_border_image_width,
eCSSProperty_border_image_outset,
eCSSProperty_border_image_repeat,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gMarkerSubpropTable[] = {
+static const nsCSSPropertyID gMarkerSubpropTable[] = {
eCSSProperty_marker_start,
eCSSProperty_marker_mid,
eCSSProperty_marker_end,
eCSSProperty_UNKNOWN
};
// Subproperty tables for shorthands that are just aliases with
// different parsing rules.
-static const nsCSSProperty gMozTransformSubpropTable[] = {
+static const nsCSSPropertyID gMozTransformSubpropTable[] = {
eCSSProperty_transform,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gScrollSnapTypeSubpropTable[] = {
+static const nsCSSPropertyID gScrollSnapTypeSubpropTable[] = {
eCSSProperty_scroll_snap_type_x,
eCSSProperty_scroll_snap_type_y,
eCSSProperty_UNKNOWN
};
#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
-static const nsCSSProperty gMaskSubpropTable[] = {
+static const nsCSSPropertyID gMaskSubpropTable[] = {
eCSSProperty_mask_image,
eCSSProperty_mask_repeat,
eCSSProperty_mask_position_x,
eCSSProperty_mask_position_y,
eCSSProperty_mask_clip,
eCSSProperty_mask_origin,
eCSSProperty_mask_size,
eCSSProperty_mask_composite,
eCSSProperty_mask_mode,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gMaskPositionSubpropTable[] = {
+static const nsCSSPropertyID gMaskPositionSubpropTable[] = {
eCSSProperty_mask_position_x,
eCSSProperty_mask_position_y,
eCSSProperty_UNKNOWN
};
#endif
// FIXME: mask-border tables should be added when we implement
// mask-border properties.
-const nsCSSProperty *const
+const nsCSSPropertyID *const
nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_
// Need an extra level of macro nesting to force expansion of method_
// params before they get pasted.
#define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable,
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
NSCSSPROPS_INNER_MACRO(method_)
#include "nsCSSPropList.h"
#undef CSS_PROP_SHORTHAND
#undef NSCSSPROPS_INNER_MACRO
#undef CSS_PROP_PUBLIC_OR_PRIVATE
};
-static const nsCSSProperty gOffsetLogicalGroupTable[] = {
+static const nsCSSPropertyID gOffsetLogicalGroupTable[] = {
eCSSProperty_top,
eCSSProperty_right,
eCSSProperty_bottom,
eCSSProperty_left,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gMaxSizeLogicalGroupTable[] = {
+static const nsCSSPropertyID gMaxSizeLogicalGroupTable[] = {
eCSSProperty_max_height,
eCSSProperty_max_width,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gMinSizeLogicalGroupTable[] = {
+static const nsCSSPropertyID gMinSizeLogicalGroupTable[] = {
eCSSProperty_min_height,
eCSSProperty_min_width,
eCSSProperty_UNKNOWN
};
-static const nsCSSProperty gSizeLogicalGroupTable[] = {
+static const nsCSSPropertyID gSizeLogicalGroupTable[] = {
eCSSProperty_height,
eCSSProperty_width,
eCSSProperty_UNKNOWN
};
-const nsCSSProperty* const
+const nsCSSPropertyID* const
nsCSSProps::kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT] = {
#define CSS_PROP_LOGICAL_GROUP_SHORTHAND(id_) g##id_##SubpropTable,
#define CSS_PROP_LOGICAL_GROUP_AXIS(name_) g##name_##LogicalGroupTable,
#define CSS_PROP_LOGICAL_GROUP_BOX(name_) g##name_##LogicalGroupTable,
#include "nsCSSPropLogicalGroupList.h"
#undef CSS_PROP_LOGICAL_GROUP_BOX
#undef CSS_PROP_LOGICAL_GROUP_AXIS
#undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
};
// Mapping of logical longhand properties to their logical group (which
// represents the physical longhands the logical properties an correspond
// to). The format is pairs of values, where the first is the logical
-// longhand property (an nsCSSProperty) and the second is the logical group
+// longhand property (an nsCSSPropertyID) and the second is the logical group
// (an nsCSSPropertyLogicalGroup), stored in a flat array (like KTableEntry
// arrays).
static const int gLogicalGroupMappingTable[] = {
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, \
kwtable_, group_, stylestruct_, \
stylestructoffset_, animtype_) \
eCSSProperty_##id_, eCSSPropertyLogicalGroup_##group_,
#include "nsCSSPropList.h"
#undef CSS_PROP_LOGICAL
};
-/* static */ const nsCSSProperty*
-nsCSSProps::LogicalGroup(nsCSSProperty aProperty)
+/* static */ const nsCSSPropertyID*
+nsCSSProps::LogicalGroup(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"out of range");
MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL),
"aProperty must be a logical longhand property");
for (size_t i = 0; i < ArrayLength(gLogicalGroupMappingTable); i += 2) {
if (gLogicalGroupMappingTable[i] == aProperty) {
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -9,17 +9,17 @@
*/
#ifndef nsCSSProps_h___
#define nsCSSProps_h___
#include <limits>
#include <type_traits>
#include "nsString.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsStyleStructFwd.h"
#include "nsCSSKeywords.h"
#include "mozilla/CSSEnabledState.h"
#include "mozilla/UseCounter.h"
// Length of the "--" prefix on custom names (such as custom property names,
// and, in the future, custom media query names).
#define CSS_CUSTOM_NAME_PREFIX_LENGTH 2
@@ -159,17 +159,17 @@
// This property allows calc() between lengths and percentages and
// stores such calc() expressions in its style structs (typically in an
// nsStyleCoord, although this is not the case for 'background-position'
// and 'background-size').
#define CSS_PROPERTY_STORES_CALC (1<<8)
// Define what mechanism the CSS parser uses for parsing the property.
-// See CSSParserImpl::ParseProperty(nsCSSProperty). Don't use 0 so that
+// See CSSParserImpl::ParseProperty(nsCSSPropertyID). Don't use 0 so that
// we can verify that every property sets one of the values.
//
// CSS_PROPERTY_PARSE_FUNCTION must be used for shorthand properties,
// since it's the only mechanism that allows appending values for
// separate properties. Longhand properties that require custom parsing
// functions should prefer using CSS_PROPERTY_PARSE_VALUE (or
// CSS_PROPERTY_PARSE_VALUE_LIST) and
// CSS_PROPERTY_VALUE_PARSER_FUNCTION, though a number of existing
@@ -377,66 +377,66 @@ public:
nsCSSKeyword mKeyword;
int16_t mValue;
};
static void AddRefTable(void);
static void ReleaseTable(void);
// Looks up the property with name aProperty and returns its corresponding
- // nsCSSProperty value. If aProperty is the name of a custom property,
+ // nsCSSPropertyID value. If aProperty is the name of a custom property,
// then eCSSPropertyExtra_variable will be returned.
- static nsCSSProperty LookupProperty(const nsAString& aProperty,
+ static nsCSSPropertyID LookupProperty(const nsAString& aProperty,
EnabledState aEnabled);
- static nsCSSProperty LookupProperty(const nsACString& aProperty,
+ static nsCSSPropertyID LookupProperty(const nsACString& aProperty,
EnabledState aEnabled);
// As above, but looked up using a property's IDL name.
// eCSSPropertyExtra_variable won't be returned from these methods.
- static nsCSSProperty LookupPropertyByIDLName(
+ static nsCSSPropertyID LookupPropertyByIDLName(
const nsAString& aPropertyIDLName,
EnabledState aEnabled);
- static nsCSSProperty LookupPropertyByIDLName(
+ static nsCSSPropertyID LookupPropertyByIDLName(
const nsACString& aPropertyIDLName,
EnabledState aEnabled);
// Returns whether aProperty is a custom property name, i.e. begins with
// "--". This assumes that the CSS Variables pref has been enabled.
static bool IsCustomPropertyName(const nsAString& aProperty);
static bool IsCustomPropertyName(const nsACString& aProperty);
- static inline bool IsShorthand(nsCSSProperty aProperty) {
+ static inline bool IsShorthand(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
return (aProperty >= eCSSProperty_COUNT_no_shorthands);
}
// Must be given a longhand property.
- static bool IsInherited(nsCSSProperty aProperty);
+ static bool IsInherited(nsCSSPropertyID aProperty);
// Same but for @font-face descriptors
static nsCSSFontDesc LookupFontDesc(const nsAString& aProperty);
static nsCSSFontDesc LookupFontDesc(const nsACString& aProperty);
// For @counter-style descriptors
static nsCSSCounterDesc LookupCounterDesc(const nsAString& aProperty);
static nsCSSCounterDesc LookupCounterDesc(const nsACString& aProperty);
// For predefined counter styles which need to be lower-cased during parse
static bool IsPredefinedCounterStyle(const nsAString& aStyle);
static bool IsPredefinedCounterStyle(const nsACString& aStyle);
// Given a property enum, get the string value
- static const nsAFlatCString& GetStringValue(nsCSSProperty aProperty);
+ static const nsAFlatCString& GetStringValue(nsCSSPropertyID aProperty);
static const nsAFlatCString& GetStringValue(nsCSSFontDesc aFontDesc);
static const nsAFlatCString& GetStringValue(nsCSSCounterDesc aCounterDesc);
// Given a CSS Property and a Property Enum Value
// Return back a const nsString& representation of the
// value. Return back nullstr if no value is found
- static const nsAFlatCString& LookupPropertyValue(nsCSSProperty aProperty, int32_t aValue);
+ static const nsAFlatCString& LookupPropertyValue(nsCSSPropertyID aProperty, int32_t aValue);
// Get a color name for a predefined color value like buttonhighlight or activeborder
// Sets the aStr param to the name of the propertyID
static bool GetColorName(int32_t aPropID, nsCString &aStr);
// Returns the index of |aKeyword| in |aTable|, if it exists there;
// otherwise, returns -1.
// NOTE: Generally, clients should call FindKeyword() instead of this method.
@@ -478,87 +478,87 @@ public:
static const nsStyleAnimType kAnimTypeTable[eCSSProperty_COUNT_no_shorthands];
static const ptrdiff_t
kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands];
private:
static const uint32_t kFlagsTable[eCSSProperty_COUNT];
public:
- static inline bool PropHasFlags(nsCSSProperty aProperty, uint32_t aFlags)
+ static inline bool PropHasFlags(nsCSSPropertyID aProperty, uint32_t aFlags)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
MOZ_ASSERT(!(aFlags & CSS_PROPERTY_PARSE_PROPERTY_MASK),
"The CSS_PROPERTY_PARSE_* values are not bitflags; don't pass "
"them to PropHasFlags. You probably want PropertyParseType "
"instead.");
return (nsCSSProps::kFlagsTable[aProperty] & aFlags) == aFlags;
}
- static inline uint32_t PropertyParseType(nsCSSProperty aProperty)
+ static inline uint32_t PropertyParseType(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
return nsCSSProps::kFlagsTable[aProperty] &
CSS_PROPERTY_PARSE_PROPERTY_MASK;
}
- static inline uint32_t ValueRestrictions(nsCSSProperty aProperty)
+ static inline uint32_t ValueRestrictions(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
return nsCSSProps::kFlagsTable[aProperty] &
CSS_PROPERTY_VALUE_RESTRICTION_MASK;
}
private:
// Lives in nsCSSParser.cpp for the macros it depends on.
static const uint32_t kParserVariantTable[eCSSProperty_COUNT_no_shorthands];
public:
- static inline uint32_t ParserVariant(nsCSSProperty aProperty) {
+ static inline uint32_t ParserVariant(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"out of range");
return nsCSSProps::kParserVariantTable[aProperty];
}
private:
// A table for shorthand properties. The appropriate index is the
// property ID minus eCSSProperty_COUNT_no_shorthands.
- static const nsCSSProperty *const
+ static const nsCSSPropertyID *const
kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands];
public:
static inline
- const nsCSSProperty * SubpropertyEntryFor(nsCSSProperty aProperty) {
+ const nsCSSPropertyID * SubpropertyEntryFor(nsCSSPropertyID aProperty) {
MOZ_ASSERT(eCSSProperty_COUNT_no_shorthands <= aProperty &&
aProperty < eCSSProperty_COUNT,
"out of range");
return nsCSSProps::kSubpropertyTable[aProperty -
eCSSProperty_COUNT_no_shorthands];
}
// Returns an eCSSProperty_UNKNOWN-terminated array of the shorthand
// properties containing |aProperty|, sorted from those that contain
// the most properties to those that contain the least.
- static const nsCSSProperty * ShorthandsContaining(nsCSSProperty aProperty) {
+ static const nsCSSPropertyID * ShorthandsContaining(nsCSSPropertyID aProperty) {
MOZ_ASSERT(gShorthandsContainingPool, "uninitialized");
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"out of range");
return gShorthandsContainingTable[aProperty];
}
private:
// gShorthandsContainingTable is an array of the return values for
- // ShorthandsContaining (arrays of nsCSSProperty terminated by
+ // ShorthandsContaining (arrays of nsCSSPropertyID terminated by
// eCSSProperty_UNKNOWN) pointing into memory in
// gShorthandsContainingPool (which contains all of those arrays in a
// single allocation, and is the one pointer that should be |free|d).
- static nsCSSProperty *gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
- static nsCSSProperty* gShorthandsContainingPool;
+ static nsCSSPropertyID *gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
+ static nsCSSPropertyID* gShorthandsContainingPool;
static bool BuildShorthandsContainingTable();
private:
static const size_t gPropertyCountInStruct[nsStyleStructID_Length];
static const size_t gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands];
public:
/**
* Return the number of properties that must be cascaded when
@@ -568,26 +568,26 @@ public:
MOZ_ASSERT(0 <= aSID && aSID < nsStyleStructID_Length,
"out of range");
return gPropertyCountInStruct[aSID];
}
/**
* Return an index for aProperty that is unique within its SID and in
* the range 0 <= index < PropertyCountInStruct(aSID).
*/
- static size_t PropertyIndexInStruct(nsCSSProperty aProperty) {
+ static size_t PropertyIndexInStruct(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"out of range");
return gPropertyIndexInStruct[aProperty];
}
private:
// A table for logical property groups. Indexes are
// nsCSSPropertyLogicalGroup values.
- static const nsCSSProperty* const
+ static const nsCSSPropertyID* const
kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT];
public:
/**
* Returns an array of longhand physical properties which can be set by
* the argument, which must be a logical longhand property. The returned
* array is terminated by an eCSSProperty_UNKNOWN value. For example,
* given eCSSProperty_margin_block_start, returns an array of the four
@@ -599,17 +599,17 @@ public:
* flag, the returned array will have two values preceding the sentinel;
* otherwise it will have four.
*
* (Note that the running time of this function is proportional to the
* number of logical longhand properties that exist. If we start
* getting too many of these properties, we should make kLogicalGroupTable
* be a simple array of eCSSProperty_COUNT length.)
*/
- static const nsCSSProperty* LogicalGroup(nsCSSProperty aProperty);
+ static const nsCSSPropertyID* LogicalGroup(nsCSSPropertyID aProperty);
private:
static bool gPropertyEnabled[eCSSProperty_COUNT_with_aliases];
private:
// Defined in the generated nsCSSPropsGenerated.inc.
static const char* const kIDLNameTable[eCSSProperty_COUNT];
@@ -619,58 +619,58 @@ public:
* longhand, logical or shorthand property. The IDL name is the property
* name with any hyphen-lowercase character pairs replaced by an
* uppercase character:
* https://drafts.csswg.org/cssom/#css-property-to-idl-attribute
*
* As a special case, the string "cssFloat" is returned for the float
* property. nullptr is returned for internal properties.
*/
- static const char* PropertyIDLName(nsCSSProperty aProperty)
+ static const char* PropertyIDLName(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
return kIDLNameTable[aProperty];
}
private:
static const int32_t kIDLNameSortPositionTable[eCSSProperty_COUNT];
public:
/**
* Returns the position of the specified property in a list of all
* properties sorted by their IDL name.
*/
- static int32_t PropertyIDLNameSortPosition(nsCSSProperty aProperty)
+ static int32_t PropertyIDLNameSortPosition(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
"out of range");
return kIDLNameSortPositionTable[aProperty];
}
- static bool IsEnabled(nsCSSProperty aProperty) {
+ static bool IsEnabled(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_with_aliases,
"out of range");
return gPropertyEnabled[aProperty];
}
// A table for the use counter associated with each CSS property. If a
// property does not have a use counter defined in UseCounters.conf, then
// its associated entry is |eUseCounter_UNKNOWN|.
static const mozilla::UseCounter gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands];
public:
- static mozilla::UseCounter UseCounterFor(nsCSSProperty aProperty) {
+ static mozilla::UseCounter UseCounterFor(nsCSSPropertyID aProperty) {
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
"out of range");
return gPropertyUseCounter[aProperty];
}
- static bool IsEnabled(nsCSSProperty aProperty, EnabledState aEnabled)
+ static bool IsEnabled(nsCSSPropertyID aProperty, EnabledState aEnabled)
{
if (IsEnabled(aProperty)) {
return true;
}
if (aEnabled == EnabledState::eIgnoreEnabledState) {
return true;
}
if ((aEnabled & EnabledState::eInUASheets) &&
@@ -683,23 +683,23 @@ public:
{
return true;
}
return false;
}
public:
-// Storing the enabledstate_ value in an nsCSSProperty variable is a small hack
+// Storing the enabledstate_ value in an nsCSSPropertyID variable is a small hack
// to avoid needing a separate variable declaration for its real type
// (CSSEnabledState), which would then require using a block and
// therefore a pair of macros by consumers for the start and end of the loop.
#define CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(it_, prop_, enabledstate_) \
- for (const nsCSSProperty *it_ = nsCSSProps::SubpropertyEntryFor(prop_), \
- es_ = (nsCSSProperty)((enabledstate_) | \
+ for (const nsCSSPropertyID *it_ = nsCSSProps::SubpropertyEntryFor(prop_), \
+ es_ = (nsCSSPropertyID)((enabledstate_) | \
CSSEnabledState(0)); \
*it_ != eCSSProperty_UNKNOWN; ++it_) \
if (nsCSSProps::IsEnabled(*it_, (mozilla::CSSEnabledState) es_))
// Keyword/Enum value tables
static const KTableEntry kAnimationDirectionKTable[];
static const KTableEntry kAnimationFillModeKTable[];
static const KTableEntry kAnimationIterationCountKTable[];
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -1459,26 +1459,26 @@ nsCSSFontFaceStyleDecl::IndexedGetter(ui
NS_IMETHODIMP
nsCSSFontFaceStyleDecl::GetParentRule(nsIDOMCSSRule** aParentRule)
{
NS_IF_ADDREF(*aParentRule = ContainingRule()->GetDOMRule());
return NS_OK;
}
NS_IMETHODIMP
-nsCSSFontFaceStyleDecl::GetPropertyValue(const nsCSSProperty aPropID,
+nsCSSFontFaceStyleDecl::GetPropertyValue(const nsCSSPropertyID aPropID,
nsAString& aValue)
{
return
GetPropertyValue(NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aPropID)),
aValue);
}
NS_IMETHODIMP
-nsCSSFontFaceStyleDecl::SetPropertyValue(const nsCSSProperty aPropID,
+nsCSSFontFaceStyleDecl::SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue)
{
return SetProperty(NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aPropID)),
aValue, EmptyString());
}
nsINode*
nsCSSFontFaceStyleDecl::GetParentObject()
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -14,17 +14,17 @@
#include "gfxFontFeatures.h"
#include "mozilla/Attributes.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Move.h"
#include "mozilla/SheetType.h"
#include "mozilla/css/GroupRule.h"
#include "mozilla/dom/FontFace.h"
#include "nsAutoPtr.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSValue.h"
#include "nsDOMCSSDeclaration.h"
#include "nsIDOMCSSConditionRule.h"
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMCSSFontFaceRule.h"
#include "nsIDOMCSSFontFeatureValuesRule.h"
#include "nsIDOMCSSGroupingRule.h"
#include "nsIDOMCSSMediaRule.h"
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -841,17 +841,17 @@ nsCSSValue::BufferFromString(const nsStr
// Null-terminate.
data[length] = 0;
return buffer.forget();
}
namespace {
struct CSSValueSerializeCalcOps {
- CSSValueSerializeCalcOps(nsCSSProperty aProperty, nsAString& aResult,
+ CSSValueSerializeCalcOps(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization)
: mProperty(aProperty),
mResult(aResult),
mValueSerialization(aSerialization)
{
}
typedef nsCSSValue input_type;
@@ -877,25 +877,25 @@ struct CSSValueSerializeCalcOps {
void AppendNumber(const input_type& aValue)
{
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Number, "unexpected unit");
aValue.AppendToString(mProperty, mResult, mValueSerialization);
}
private:
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
nsAString &mResult;
nsCSSValue::Serialization mValueSerialization;
};
} // namespace
void
-nsCSSValue::AppendPolygonToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSValue::AppendPolygonToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aSerialization) const
{
const nsCSSValue::Array* array = GetArrayValue();
MOZ_ASSERT(array->Count() > 1 && array->Count() <= 3,
"Polygons must have name and at least one more value.");
// When the array has 2 elements, the item on index 1 is the coordinate
// pair list.
// When the array has 3 elements, the item on index 1 is a fill-rule
@@ -912,31 +912,31 @@ nsCSSValue::AppendPolygonToString(nsCSSP
aResult.AppendLiteral(", ");
++index;
}
array->Item(index).AppendToString(aProperty, aResult, aSerialization);
}
inline void
nsCSSValue::AppendPositionCoordinateToString(
- const nsCSSValue& aValue, nsCSSProperty aProperty,
+ const nsCSSValue& aValue, nsCSSPropertyID aProperty,
nsAString& aResult, Serialization aSerialization) const
{
if (aValue.GetUnit() == eCSSUnit_Enumerated) {
int32_t intValue = aValue.GetIntValue();
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue,
nsCSSProps::kShapeRadiusKTable), aResult);
} else {
aValue.AppendToString(aProperty, aResult, aSerialization);
}
}
void
nsCSSValue::AppendCircleOrEllipseToString(nsCSSKeyword aFunctionId,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsAString& aResult,
Serialization aSerialization) const
{
const nsCSSValue::Array* array = GetArrayValue();
size_t count = aFunctionId == eCSSKeyword_circle ? 2 : 3;
MOZ_ASSERT(array->Count() == count + 1, "wrong number of arguments");
bool hasRadii = array->Item(1).GetUnit() != eCSSUnit_Null;
@@ -1022,17 +1022,17 @@ nsCSSValue::AppendBasicShapePositionToSt
aResult.Append(' ');
yOffset.AppendToString(eCSSProperty_UNKNOWN, aResult, aSerialization);
}
}
// Helper to append |aString| with the shorthand sides notation used in e.g.
// 'padding'. |aProperties| and |aValues| are expected to have 4 elements.
/*static*/ void
-nsCSSValue::AppendSidesShorthandToString(const nsCSSProperty aProperties[],
+nsCSSValue::AppendSidesShorthandToString(const nsCSSPropertyID aProperties[],
const nsCSSValue* aValues[],
nsAString& aString,
nsCSSValue::Serialization
aSerialization)
{
const nsCSSValue& value1 = *aValues[0];
const nsCSSValue& value2 = *aValues[1];
const nsCSSValue& value3 = *aValues[2];
@@ -1053,17 +1053,17 @@ nsCSSValue::AppendSidesShorthandToString
MOZ_ASSERT(value4.GetUnit() != eCSSUnit_Null, "null value 4");
value4.AppendToString(aProperties[3], aString, aSerialization);
}
}
}
}
/*static*/ void
-nsCSSValue::AppendBasicShapeRadiusToString(const nsCSSProperty aProperties[],
+nsCSSValue::AppendBasicShapeRadiusToString(const nsCSSPropertyID aProperties[],
const nsCSSValue* aValues[],
nsAString& aResult,
Serialization aSerialization)
{
bool needY = false;
const nsCSSValue* xVals[4];
const nsCSSValue* yVals[4];
for (int i = 0; i < 4; i++) {
@@ -1079,17 +1079,17 @@ nsCSSValue::AppendBasicShapeRadiusToStri
AppendSidesShorthandToString(aProperties, xVals, aResult, aSerialization);
if (needY) {
aResult.AppendLiteral(" / ");
AppendSidesShorthandToString(aProperties, yVals, aResult, aSerialization);
}
}
void
-nsCSSValue::AppendInsetToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSValue::AppendInsetToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aSerialization) const
{
const nsCSSValue::Array* array = GetArrayValue();
MOZ_ASSERT(array->Count() == 6,
"inset function has wrong number of arguments");
if (array->Item(1).GetUnit() != eCSSUnit_Null) {
array->Item(1).AppendToString(aProperty, aResult, aSerialization);
if (array->Item(2).GetUnit() != eCSSUnit_Null) {
@@ -1102,17 +1102,17 @@ nsCSSValue::AppendInsetToString(nsCSSPro
aResult.Append(' ');
array->Item(4).AppendToString(aProperty, aResult, aSerialization);
}
}
}
}
if (array->Item(5).GetUnit() == eCSSUnit_Array) {
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
const nsCSSValue::Array* radius = array->Item(5).GetArrayValue();
MOZ_ASSERT(radius->Count() == 4, "expected 4 radii values");
const nsCSSValue* vals[4] = {
&(radius->Item(0)),
&(radius->Item(1)),
&(radius->Item(2)),
&(radius->Item(3))
@@ -1152,17 +1152,17 @@ nsCSSValue::AppendAlignJustifyValueToStr
if (MOZ_UNLIKELY(overflowPos == NS_STYLE_ALIGN_SAFE)) {
aResult.Append(' ');
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(overflowPos, kwtable),
aResult);
}
}
void
-nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aSerialization) const
{
// eCSSProperty_UNKNOWN gets used for some recursive calls below.
MOZ_ASSERT((0 <= aProperty &&
aProperty <= eCSSProperty_COUNT_no_shorthands) ||
aProperty == eCSSProperty_UNKNOWN,
"property ID out of range");
@@ -1225,17 +1225,17 @@ nsCSSValue::AppendToString(nsCSSProperty
int32_t system = array->Item(i).GetIntValue();
if (system != NS_STYLE_COUNTER_SYSTEM_SYMBOLIC) {
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(
system, nsCSSProps::kCounterSystemKTable), aResult);
mark = true;
}
continue;
}
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
((eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) &&
i == array->Count() - 1)
? eCSSProperty_list_style_type : aProperty;
if (array->Item(i).GetUnit() != eCSSUnit_Null) {
array->Item(i).AppendToString(prop, aResult, aSerialization);
mark = true;
}
}
@@ -1738,17 +1738,17 @@ nsCSSValue::AppendToString(nsCSSProperty
if (++i == gradient->mStops.Length()) {
break;
}
aResult.AppendLiteral(", ");
}
aResult.Append(')');
} else if (eCSSUnit_TokenStream == unit) {
- nsCSSProperty shorthand = mValue.mTokenStream->mShorthandPropertyID;
+ nsCSSPropertyID shorthand = mValue.mTokenStream->mShorthandPropertyID;
if (shorthand == eCSSProperty_UNKNOWN ||
nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS) ||
aProperty == eCSSProperty__x_system_font) {
// We treat serialization of aliases like '-moz-transform' as a special
// case, since it really wants to be serialized as if it were a longhand
// even though it is implemented as a shorthand. We also need to
// serialize -x-system-font's token stream value, even though the
// value is set through the font shorthand. This serialization
@@ -2114,17 +2114,17 @@ nsCSSValueList::CloneInto(nsCSSValueList
{
NS_ASSERTION(!aList->mNext, "Must be an empty list!");
aList->mValue = mValue;
aList->mNext = mNext ? mNext->Clone() : nullptr;
}
static void
AppendValueListToString(const nsCSSValueList* val,
- nsCSSProperty aProperty, nsAString& aResult,
+ nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization)
{
for (;;) {
val->mValue.AppendToString(aProperty, aResult, aSerialization);
val = val->mNext;
if (!val)
break;
@@ -2132,17 +2132,17 @@ AppendValueListToString(const nsCSSValue
CSS_PROPERTY_VALUE_LIST_USES_COMMAS))
aResult.Append(char16_t(','));
aResult.Append(char16_t(' '));
}
}
static void
AppendGridTemplateToString(const nsCSSValueList* val,
- nsCSSProperty aProperty, nsAString& aResult,
+ nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization)
{
// This is called for the "list" that's the top-level value of the property.
bool isSubgrid = false;
for (;;) {
bool addSpaceSeparator = true;
nsCSSUnit unit = val->mValue.GetUnit();
@@ -2225,17 +2225,17 @@ AppendGridTemplateToString(const nsCSSVa
if (addSpaceSeparator) {
aResult.Append(char16_t(' '));
}
}
}
void
-nsCSSValueList::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSValueList::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
if (aProperty == eCSSProperty_grid_template_columns ||
aProperty == eCSSProperty_grid_template_rows) {
AppendGridTemplateToString(this, aProperty, aResult, aSerialization);
} else {
AppendValueListToString(this, aProperty, aResult, aSerialization);
}
@@ -2290,17 +2290,17 @@ nsCSSValueSharedList::~nsCSSValueSharedL
MOZ_COUNT_DTOR(nsCSSValueSharedList);
if (mHead) {
NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext);
delete mHead;
}
}
void
-nsCSSValueSharedList::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSValueSharedList::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
if (mHead) {
mHead->AppendToString(aProperty, aResult, aSerialization);
}
}
bool
@@ -2338,17 +2338,17 @@ nsCSSRect::nsCSSRect(const nsCSSRect& aC
}
nsCSSRect::~nsCSSRect()
{
MOZ_COUNT_DTOR(nsCSSRect);
}
void
-nsCSSRect::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+nsCSSRect::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
MOZ_ASSERT(mTop.GetUnit() != eCSSUnit_Null &&
mTop.GetUnit() != eCSSUnit_Inherit &&
mTop.GetUnit() != eCSSUnit_Initial &&
mTop.GetUnit() != eCSSUnit_Unset,
"parser should have used a bare value");
@@ -2411,17 +2411,17 @@ static_assert(NS_SIDE_TOP == 0 && NS_SID
&nsCSSRect::mRight,
&nsCSSRect::mBottom,
&nsCSSRect::mLeft,
};
// --- nsCSSValuePair -----------------
void
-nsCSSValuePair::AppendToString(nsCSSProperty aProperty,
+nsCSSValuePair::AppendToString(nsCSSPropertyID aProperty,
nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
mXValue.AppendToString(aProperty, aResult, aSerialization);
if (mYValue.GetUnit() != eCSSUnit_Null) {
aResult.Append(char16_t(' '));
mYValue.AppendToString(aProperty, aResult, aSerialization);
}
@@ -2447,17 +2447,17 @@ nsCSSValuePair_heap::SizeOfIncludingThis
n += mYValue.SizeOfExcludingThis(aMallocSizeOf);
}
return n;
}
// --- nsCSSValueTriplet -----------------
void
-nsCSSValueTriplet::AppendToString(nsCSSProperty aProperty,
+nsCSSValueTriplet::AppendToString(nsCSSPropertyID aProperty,
nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
mXValue.AppendToString(aProperty, aResult, aSerialization);
if (mYValue.GetUnit() != eCSSUnit_Null) {
aResult.Append(char16_t(' '));
mYValue.AppendToString(aProperty, aResult, aSerialization);
if (mZValue.GetUnit() != eCSSUnit_Null) {
@@ -2501,17 +2501,17 @@ nsCSSValuePairList::Clone() const
src = src->mNext;
}
MOZ_ASSERT(result, "shouldn't return null; supposed to be infallible");
return result;
}
void
-nsCSSValuePairList::AppendToString(nsCSSProperty aProperty,
+nsCSSValuePairList::AppendToString(nsCSSPropertyID aProperty,
nsAString& aResult,
nsCSSValue::Serialization aSerialization) const
{
const nsCSSValuePairList* item = this;
for (;;) {
MOZ_ASSERT(item->mXValue.GetUnit() != eCSSUnit_Null,
"unexpected null unit");
item->mXValue.AppendToString(aProperty, aResult, aSerialization);
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -14,17 +14,17 @@
#include "mozilla/MemoryReporting.h"
#include "mozilla/SheetType.h"
#include "mozilla/UniquePtr.h"
#include "nsIPrincipal.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#include "nsCSSKeywords.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsCSSProps.h"
#include "nsColor.h"
#include "nsCoord.h"
#include "nsProxyRelease.h"
#include "nsRefPtrHashtable.h"
#include "nsString.h"
#include "nsStringBuffer.h"
#include "nsTArray.h"
@@ -486,17 +486,17 @@ public:
// Enum for AppendToString's aValueSerialization argument.
enum Serialization { eNormalized, eAuthorSpecified };
/**
* Serialize |this| as a specified value for |aProperty| and append
* it to |aResult|.
*/
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aValueSerialization) const;
nsCSSUnit GetUnit() const { return mUnit; }
bool IsLengthUnit() const
{ return eCSSUnit_PhysicalMillimeter <= mUnit && mUnit <= eCSSUnit_Pixel; }
bool IsLengthPercentCalcUnit() const
{ return IsLengthUnit() || mUnit == eCSSUnit_Percent || IsCalcUnit(); }
/**
@@ -795,47 +795,47 @@ public:
// Returns an already addrefed buffer. Guaranteed to return non-null.
// (Will abort on allocation failure.)
static already_AddRefed<nsStringBuffer>
BufferFromString(const nsString& aValue);
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
static void
- AppendSidesShorthandToString(const nsCSSProperty aProperties[],
+ AppendSidesShorthandToString(const nsCSSPropertyID aProperties[],
const nsCSSValue* aValues[],
nsAString& aString,
Serialization aSerialization);
static void
- AppendBasicShapeRadiusToString(const nsCSSProperty aProperties[],
+ AppendBasicShapeRadiusToString(const nsCSSPropertyID aProperties[],
const nsCSSValue* aValues[],
nsAString& aResult,
Serialization aValueSerialization);
static void
AppendAlignJustifyValueToString(int32_t aValue, nsAString& aResult);
private:
static const char16_t* GetBufferValue(nsStringBuffer* aBuffer) {
return static_cast<char16_t*>(aBuffer->Data());
}
- void AppendPolygonToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendPolygonToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aValueSerialization) const;
void AppendPositionCoordinateToString(const nsCSSValue& aValue,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
nsAString& aResult,
Serialization aSerialization) const;
void AppendCircleOrEllipseToString(
nsCSSKeyword aFunctionId,
- nsCSSProperty aProperty, nsAString& aResult,
+ nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aValueSerialization) const;
void AppendBasicShapePositionToString(
nsAString& aResult,
Serialization aValueSerialization) const;
- void AppendInsetToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendInsetToString(nsCSSPropertyID aProperty, nsAString& aResult,
Serialization aValueSerialization) const;
protected:
nsCSSUnit mUnit;
union {
int32_t mInt;
float mFloat;
// Note: the capacity of the buffer may exceed the length of the string.
// If we're of a string type, mString is not null.
@@ -971,17 +971,17 @@ private:
// Prefer nsCSSValue::Array for lists of fixed size.
struct nsCSSValueList {
nsCSSValueList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValueList); }
~nsCSSValueList();
nsCSSValueList* Clone() const; // makes a deep copy. Infallible.
void CloneInto(nsCSSValueList* aList) const; // makes a deep copy into aList
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
static bool Equal(const nsCSSValueList* aList1,
const nsCSSValueList* aList2);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
nsCSSValue mValue;
@@ -1036,17 +1036,17 @@ struct nsCSSValueSharedList final {
private:
// Private destructor, to discourage deletion outside of Release():
~nsCSSValueSharedList();
public:
NS_INLINE_DECL_REFCOUNTING(nsCSSValueSharedList)
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
bool operator==(nsCSSValueSharedList const& aOther) const;
bool operator!=(const nsCSSValueSharedList& aOther) const
{ return !(*this == aOther); }
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
@@ -1077,17 +1077,17 @@ nsCSSValue::GetListValue() const
}
}
struct nsCSSRect {
nsCSSRect(void);
nsCSSRect(const nsCSSRect& aCopy);
~nsCSSRect();
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
bool operator==(const nsCSSRect& aOther) const {
return mTop == aOther.mTop &&
mRight == aOther.mRight &&
mBottom == aOther.mBottom &&
mLeft == aOther.mLeft;
}
@@ -1219,17 +1219,17 @@ struct nsCSSValuePair {
mYValue.Reset();
}
bool HasValue() const {
return mXValue.GetUnit() != eCSSUnit_Null ||
mYValue.GetUnit() != eCSSUnit_Null;
}
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
nsCSSValue mXValue;
nsCSSValue mYValue;
};
@@ -1311,17 +1311,17 @@ struct nsCSSValueTriplet {
}
bool HasValue() const {
return mXValue.GetUnit() != eCSSUnit_Null ||
mYValue.GetUnit() != eCSSUnit_Null ||
mZValue.GetUnit() != eCSSUnit_Null;
}
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
nsCSSValue mXValue;
nsCSSValue mYValue;
nsCSSValue mZValue;
};
// nsCSSValueTriplet_heap differs from nsCSSValueTriplet only in being
@@ -1375,17 +1375,17 @@ nsCSSValue::GetTripletValue() const
}
// Maybe should be replaced with nsCSSValueList and nsCSSValue::Array?
struct nsCSSValuePairList {
nsCSSValuePairList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValuePairList); }
~nsCSSValuePairList();
nsCSSValuePairList* Clone() const; // makes a deep copy. Infallible.
- void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
+ void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
nsCSSValue::Serialization aValueSerialization) const;
static bool Equal(const nsCSSValuePairList* aList1,
const nsCSSValuePairList* aList2);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
nsCSSValue mXValue;
@@ -1628,22 +1628,22 @@ public:
NS_INLINE_DECL_REFCOUNTING(nsCSSValueTokenStream)
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
// The property that has mTokenStream as its unparsed specified value.
// When a variable reference is used in a shorthand property, a
// TokenStream value is stored as the specified value for each of its
// component longhand properties.
- nsCSSProperty mPropertyID;
+ nsCSSPropertyID mPropertyID;
// The shorthand property that had a value with a variable reference,
// which caused the longhand property identified by mPropertyID to have
// a TokenStream value.
- nsCSSProperty mShorthandPropertyID;
+ nsCSSPropertyID mShorthandPropertyID;
// The unparsed CSS corresponding to the specified value of the property.
// When the value of a shorthand property has a variable reference, the
// same mTokenStream value is used on each of the nsCSSValueTokenStream
// objects that will be set by parsing the shorthand.
nsString mTokenStream;
nsCOMPtr<nsIURI> mBaseURI;
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -82,17 +82,17 @@ struct nsComputedStyleMap
{
friend class nsComputedDOMStyle;
struct Entry
{
// Create a pointer-to-member-function type.
typedef already_AddRefed<CSSValue> (nsComputedDOMStyle::*ComputeMethod)();
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
ComputeMethod mGetter;
bool IsLayoutFlushNeeded() const
{
return nsCSSProps::PropHasFlags(mProperty,
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH);
}
@@ -123,28 +123,28 @@ struct nsComputedStyleMap
return mExposedPropertyCount;
}
/**
* Returns the property at the given index in the list of properties
* that should be exposed on an nsComputedDOMStyle, excluding any
* disabled properties.
*/
- nsCSSProperty PropertyAt(uint32_t aIndex)
+ nsCSSPropertyID PropertyAt(uint32_t aIndex)
{
Update();
return kEntries[EntryIndex(aIndex)].mProperty;
}
/**
* Searches for and returns the computed style map entry for the given
* property, or nullptr if the property is not exposed on nsComputedDOMStyle
* or is currently disabled.
*/
- const Entry* FindEntryForProperty(nsCSSProperty aPropID)
+ const Entry* FindEntryForProperty(nsCSSPropertyID aPropID)
{
Update();
for (uint32_t i = 0; i < mExposedPropertyCount; i++) {
const Entry* entry = &kEntries[EntryIndex(i)];
if (entry->mProperty == aPropID) {
return entry;
}
}
@@ -303,29 +303,29 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_END_INHERITING(nsDOMCSSDeclaration)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsComputedDOMStyle)
NS_IMETHODIMP
-nsComputedDOMStyle::GetPropertyValue(const nsCSSProperty aPropID,
+nsComputedDOMStyle::GetPropertyValue(const nsCSSPropertyID aPropID,
nsAString& aValue)
{
// This is mostly to avoid code duplication with GetPropertyCSSValue(); if
// perf ever becomes an issue here (doubtful), we can look into changing
// this.
return GetPropertyValue(
NS_ConvertASCIItoUTF16(nsCSSProps::GetStringValue(aPropID)),
aValue);
}
NS_IMETHODIMP
-nsComputedDOMStyle::SetPropertyValue(const nsCSSProperty aPropID,
+nsComputedDOMStyle::SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue)
{
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
NS_IMETHODIMP
nsComputedDOMStyle::GetCssText(nsAString& aCssText)
{
@@ -748,34 +748,34 @@ nsComputedDOMStyle::ClearCurrentStyleSou
if (!mResolvedStyleContext) {
mStyleContext = nullptr;
}
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName, ErrorResult& aRv)
{
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(aPropertyName, CSSEnabledState::eForAllContent);
bool needsLayoutFlush;
nsComputedStyleMap::Entry::ComputeMethod getter;
if (prop == eCSSPropertyExtra_variable) {
needsLayoutFlush = false;
getter = nullptr;
} else {
// We don't (for now, anyway, though it may make sense to change it
// for all aliases, including those in nsCSSPropAliasList) want
// aliases to be enumerable (via GetLength and IndexedGetter), so
// handle them here rather than adding entries to
// GetQueryablePropertyMap.
if (prop != eCSSProperty_UNKNOWN &&
nsCSSProps::PropHasFlags(prop, CSS_PROPERTY_IS_ALIAS)) {
- const nsCSSProperty* subprops = nsCSSProps::SubpropertyEntryFor(prop);
+ const nsCSSPropertyID* subprops = nsCSSProps::SubpropertyEntryFor(prop);
MOZ_ASSERT(subprops[1] == eCSSProperty_UNKNOWN,
"must have list of length 1");
prop = subprops[0];
}
const nsComputedStyleMap::Entry* propEntry =
GetComputedStyleMap()->FindEntryForProperty(prop);
@@ -6317,17 +6317,17 @@ nsComputedDOMStyle::DoGetTransitionPrope
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
MOZ_ASSERT(display->mTransitionPropertyCount > 0,
"first item must be explicit");
uint32_t i = 0;
do {
const StyleTransition *transition = &display->mTransitions[i];
RefPtr<nsROCSSPrimitiveValue> property = new nsROCSSPrimitiveValue;
- nsCSSProperty cssprop = transition->GetProperty();
+ nsCSSPropertyID cssprop = transition->GetProperty();
if (cssprop == eCSSPropertyExtra_all_properties)
property->SetIdent(eCSSKeyword_all);
else if (cssprop == eCSSPropertyExtra_no_properties)
property->SetIdent(eCSSKeyword_none);
else if (cssprop == eCSSProperty_UNKNOWN ||
cssprop == eCSSPropertyExtra_variable)
{
nsAutoString escaped;
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -14,17 +14,17 @@
on nsComputedDOMStyle objects. It is designed to be included in
nsComputedDOMStyle.cpp to generate the "computed style map", a
table of property IDs and corresponding functions on nsComputedDOMStyle
that return the CSSValue representing that property's computed value.
The COMPUTED_STYLE_PROP macro is defined for each such property.
Its arguments are:
- -. 'id' the nsCSSProperty ID, without the leading "nsCSSProperty_".
+ -. 'id' the nsCSSPropertyID ID, without the leading "nsCSSProperty_".
-. 'method' the nsComputedDOMStyle method name that returns the
CSSValue representing that property's computed value, without the leading
"Do".
******/
/* ******************************************************************* *\
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -167,17 +167,17 @@ nsDOMCSSAttributeDeclaration::GetParentR
/* virtual */ nsINode*
nsDOMCSSAttributeDeclaration::GetParentObject()
{
return mElement;
}
NS_IMETHODIMP
-nsDOMCSSAttributeDeclaration::SetPropertyValue(const nsCSSProperty aPropID,
+nsDOMCSSAttributeDeclaration::SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue)
{
// Scripted modifications to style.opacity or style.transform
// could immediately force us into the animated state if heuristics suggest
// this is scripted animation.
// FIXME: This is missing the margin shorthand and the logical versions of
// the margin properties, see bug 1266287.
if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform ||
--- a/layout/style/nsDOMCSSAttrDeclaration.h
+++ b/layout/style/nsDOMCSSAttrDeclaration.h
@@ -31,17 +31,17 @@ public:
// If GetCSSDeclaration returns non-null, then the decl it returns
// is owned by our current style rule.
virtual mozilla::css::Declaration* GetCSSDeclaration(Operation aOperation) override;
virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) override;
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) override;
virtual nsINode* GetParentObject() override;
- NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,
+ NS_IMETHOD SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue) override;
protected:
~nsDOMCSSAttributeDeclaration();
virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl) override;
virtual nsIDocument* DocToUpdate() override;
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -36,17 +36,17 @@ nsDOMCSSDeclaration::WrapObject(JSContex
NS_INTERFACE_TABLE_HEAD(nsDOMCSSDeclaration)
NS_INTERFACE_TABLE(nsDOMCSSDeclaration,
nsICSSDeclaration,
nsIDOMCSSStyleDeclaration)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_END
NS_IMETHODIMP
-nsDOMCSSDeclaration::GetPropertyValue(const nsCSSProperty aPropID,
+nsDOMCSSDeclaration::GetPropertyValue(const nsCSSPropertyID aPropID,
nsAString& aValue)
{
NS_PRECONDITION(aPropID != eCSSProperty_UNKNOWN,
"Should never pass eCSSProperty_UNKNOWN around");
css::Declaration* decl = GetCSSDeclaration(eOperation_Read);
aValue.Truncate();
@@ -70,17 +70,17 @@ nsDOMCSSDeclaration::GetCustomPropertyVa
}
decl->GetVariableDeclaration(Substring(aPropertyName,
CSS_CUSTOM_NAME_PREFIX_LENGTH),
aValue);
}
NS_IMETHODIMP
-nsDOMCSSDeclaration::SetPropertyValue(const nsCSSProperty aPropID,
+nsDOMCSSDeclaration::SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue)
{
switch (aPropID) {
case eCSSProperty_background_position:
case eCSSProperty_background_position_x:
case eCSSProperty_background_position_y:
case eCSSProperty_transform:
case eCSSProperty_top:
@@ -190,17 +190,17 @@ nsDOMCSSDeclaration::IndexedGetter(uint3
css::Declaration* decl = GetCSSDeclaration(eOperation_Read);
aFound = decl && decl->GetNthProperty(aIndex, aPropName);
}
NS_IMETHODIMP
nsDOMCSSDeclaration::GetPropertyValue(const nsAString& aPropertyName,
nsAString& aReturn)
{
- const nsCSSProperty propID =
+ const nsCSSPropertyID propID =
nsCSSProps::LookupProperty(aPropertyName, CSSEnabledState::eForAllContent);
if (propID == eCSSProperty_UNKNOWN) {
aReturn.Truncate();
return NS_OK;
}
if (propID == eCSSPropertyExtra_variable) {
GetCustomPropertyValue(aPropertyName, aReturn);
@@ -209,17 +209,17 @@ nsDOMCSSDeclaration::GetPropertyValue(co
return GetPropertyValue(propID, aReturn);
}
NS_IMETHODIMP
nsDOMCSSDeclaration::GetAuthoredPropertyValue(const nsAString& aPropertyName,
nsAString& aReturn)
{
- const nsCSSProperty propID =
+ const nsCSSPropertyID propID =
nsCSSProps::LookupProperty(aPropertyName, CSSEnabledState::eForAllContent);
if (propID == eCSSProperty_UNKNOWN) {
aReturn.Truncate();
return NS_OK;
}
if (propID == eCSSPropertyExtra_variable) {
GetCustomPropertyValue(aPropertyName, aReturn);
@@ -250,17 +250,17 @@ nsDOMCSSDeclaration::GetPropertyPriority
}
NS_IMETHODIMP
nsDOMCSSDeclaration::SetProperty(const nsAString& aPropertyName,
const nsAString& aValue,
const nsAString& aPriority)
{
// In the common (and fast) cases we can use the property id
- nsCSSProperty propID =
+ nsCSSPropertyID propID =
nsCSSProps::LookupProperty(aPropertyName, CSSEnabledState::eForAllContent);
if (propID == eCSSProperty_UNKNOWN) {
return NS_OK;
}
if (aValue.IsEmpty()) {
// If the new value of the property is an empty string we remove the
// property.
@@ -286,17 +286,17 @@ nsDOMCSSDeclaration::SetProperty(const n
}
return ParsePropertyValue(propID, aValue, important);
}
NS_IMETHODIMP
nsDOMCSSDeclaration::RemoveProperty(const nsAString& aPropertyName,
nsAString& aReturn)
{
- const nsCSSProperty propID =
+ const nsCSSPropertyID propID =
nsCSSProps::LookupProperty(aPropertyName, CSSEnabledState::eForAllContent);
if (propID == eCSSProperty_UNKNOWN) {
aReturn.Truncate();
return NS_OK;
}
if (propID == eCSSPropertyExtra_variable) {
RemoveCustomProperty(aPropertyName);
@@ -322,17 +322,17 @@ nsDOMCSSDeclaration::GetCSSParsingEnviro
nsIDocument* document = sheet->GetOwningDocument();
aCSSParseEnv.mSheetURI = sheet->GetSheetURI();
aCSSParseEnv.mBaseURI = sheet->GetBaseURI();
aCSSParseEnv.mPrincipal = sheet->Principal();
aCSSParseEnv.mCSSLoader = document ? document->CSSLoader() : nullptr;
}
nsresult
-nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSProperty aPropID,
+nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
bool aIsImportant)
{
css::Declaration* olddecl = GetCSSDeclaration(eOperation_Modify);
if (!olddecl) {
return NS_ERROR_NOT_AVAILABLE;
}
@@ -399,17 +399,17 @@ nsDOMCSSDeclaration::ParseCustomProperty
// Parsing failed -- but we don't throw an exception for that.
return NS_OK;
}
return SetCSSDeclaration(decl);
}
nsresult
-nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
+nsDOMCSSDeclaration::RemoveProperty(const nsCSSPropertyID aPropID)
{
css::Declaration* olddecl = GetCSSDeclaration(eOperation_RemoveProperty);
if (!olddecl) {
return NS_OK; // no decl, so nothing to remove
}
// For nsDOMCSSAttributeDeclaration, SetCSSDeclaration will lead to
// Attribute setting code, which leads in turn to BeginUpdate. We
--- a/layout/style/nsDOMCSSDeclaration.h
+++ b/layout/style/nsDOMCSSDeclaration.h
@@ -151,23 +151,23 @@ protected:
// anything meaningful.
virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) = 0;
// An implementation for GetCSSParsingEnvironment for callers wrapping
// an css::Rule.
static void GetCSSParsingEnvironmentForRule(mozilla::css::Rule* aRule,
CSSParsingEnvironment& aCSSParseEnv);
- nsresult ParsePropertyValue(const nsCSSProperty aPropID,
+ nsresult ParsePropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aPropValue,
bool aIsImportant);
// Prop-id based version of RemoveProperty. Note that this does not
// return the old value; it just does a straight removal.
- nsresult RemoveProperty(const nsCSSProperty aPropID);
+ nsresult RemoveProperty(const nsCSSPropertyID aPropID);
void GetCustomPropertyValue(const nsAString& aPropertyName, nsAString& aValue);
nsresult RemoveCustomProperty(const nsAString& aPropertyName);
nsresult ParseCustomPropertyValue(const nsAString& aPropertyName,
const nsAString& aPropValue,
bool aIsImportant);
protected:
--- a/layout/style/nsICSSDeclaration.h
+++ b/layout/style/nsICSSDeclaration.h
@@ -9,24 +9,24 @@
*/
#ifndef nsICSSDeclaration_h__
#define nsICSSDeclaration_h__
/**
* This interface provides access to methods analogous to those of
* nsIDOMCSSStyleDeclaration; the difference is that these use
- * nsCSSProperty enums for the prop names instead of using strings.
+ * nsCSSPropertyID enums for the prop names instead of using strings.
* This is meant for use in performance-sensitive code only! Most
* consumers should continue to use nsIDOMCSSStyleDeclaration.
*/
#include "mozilla/Attributes.h"
#include "nsIDOMCSSStyleDeclaration.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "CSSValue.h"
#include "nsWrapperCache.h"
#include "nsString.h"
#include "nsIDOMCSSRule.h"
#include "nsIDOMCSSValue.h"
#include "mozilla/ErrorResult.h"
#include "nsCOMPtr.h"
@@ -42,28 +42,28 @@ class nsICSSDeclaration : public nsIDOMC
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSDECLARATION_IID)
/**
* Method analogous to nsIDOMCSSStyleDeclaration::GetPropertyValue,
* which obeys all the same restrictions.
*/
- NS_IMETHOD GetPropertyValue(const nsCSSProperty aPropID,
+ NS_IMETHOD GetPropertyValue(const nsCSSPropertyID aPropID,
nsAString& aValue) = 0;
NS_IMETHOD GetAuthoredPropertyValue(const nsAString& aPropName,
nsAString& aValue) = 0;
/**
* Method analogous to nsIDOMCSSStyleDeclaration::SetProperty. This
* method does NOT allow setting a priority (the priority will
* always be set to default priority).
*/
- NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,
+ NS_IMETHOD SetPropertyValue(const nsCSSPropertyID aPropID,
const nsAString& aValue) = 0;
virtual nsINode *GetParentObject() = 0;
// Also have to declare all the nsIDOMCSSStyleDeclaration methods,
// since we want to be able to call them from the WebIDL versions.
NS_IMETHOD GetCssText(nsAString& aCssText) override = 0;
NS_IMETHOD SetCssText(const nsAString& aCssText) override = 0;
@@ -148,21 +148,21 @@ public:
GetParentRule(getter_AddRefs(rule));
return rule.forget();
}
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID)
#define NS_DECL_NSICSSDECLARATION \
- NS_IMETHOD GetPropertyValue(const nsCSSProperty aPropID, \
+ NS_IMETHOD GetPropertyValue(const nsCSSPropertyID aPropID, \
nsAString& aValue) override; \
NS_IMETHOD GetAuthoredPropertyValue(const nsAString& aPropName, \
nsAString& aValue) override; \
- NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID, \
+ NS_IMETHOD SetPropertyValue(const nsCSSPropertyID aPropID, \
const nsAString& aValue) override;
#define NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER \
NS_IMETHOD GetCssText(nsAString & aCssText) override; \
NS_IMETHOD SetCssText(const nsAString & aCssText) override; \
NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval) override; \
NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval) override; \
NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval) override; \
--- a/layout/style/nsRuleData.h
+++ b/layout/style/nsRuleData.h
@@ -61,17 +61,17 @@ struct nsRuleData
/**
* Return a pointer to the value object within |this| corresponding
* to property |aProperty|.
*
* This function must only be called if the given property is in
* mSIDs.
*/
- nsCSSValue* ValueFor(nsCSSProperty aProperty)
+ nsCSSValue* ValueFor(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(aProperty < eCSSProperty_COUNT_no_shorthands,
"invalid or shorthand property");
nsStyleStructID sid = nsCSSProps::kSIDTable[aProperty];
size_t indexInStruct = nsCSSProps::PropertyIndexInStruct(aProperty);
// This should really be nsCachedStyleData::GetBitForSID, but we can't
@@ -79,17 +79,17 @@ struct nsRuleData
MOZ_ASSERT(mSIDs & (1 << sid),
"calling nsRuleData::ValueFor on property not in mSIDs");
MOZ_ASSERT(indexInStruct != size_t(-1),
"logical property");
return mValueStorage + mValueOffsets[sid] + indexInStruct;
}
- const nsCSSValue* ValueFor(nsCSSProperty aProperty) const {
+ const nsCSSValue* ValueFor(nsCSSPropertyID aProperty) const {
return const_cast<nsRuleData*>(this)->ValueFor(aProperty);
}
/**
* Getters like ValueFor(aProperty), but for each property by name
* (ValueForBackgroundColor, etc.), and more efficient than ValueFor.
* These use the names used for the property on DOM interfaces (the
* 'method' field in nsCSSPropList.h).
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -5173,17 +5173,17 @@ nsRuleNode::ComputeUIResetData(void* aSt
NS_STYLE_WINDOW_SHADOW_DEFAULT);
COMPUTE_END_RESET(UIReset, ui)
}
// Information about each transition or animation property that is
// constant.
struct TransitionPropInfo {
- nsCSSProperty property;
+ nsCSSPropertyID property;
// Location of the count of the property's computed value.
uint32_t nsStyleDisplay::* sdCount;
};
// Each property's index in this array must match its index in the
// mutable array |transitionPropData| below.
static const TransitionPropInfo transitionPropInfo[4] = {
{ eCSSProperty_transition_delay,
@@ -5346,17 +5346,17 @@ nsRuleNode::ComputeTimingFunction(const
}
break;
default:
NS_NOTREACHED("Invalid transition property unit");
}
}
static uint8_t
-GetWillChangeBitFieldFromPropFlags(const nsCSSProperty& aProp)
+GetWillChangeBitFieldFromPropFlags(const nsCSSPropertyID& aProp)
{
uint8_t willChangeBitField = 0;
if (nsCSSProps::PropHasFlags(aProp, CSS_PROPERTY_CREATES_STACKING_CONTEXT)) {
willChangeBitField |= NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
}
if (nsCSSProps::PropHasFlags(aProp, CSS_PROPERTY_FIXPOS_CB)) {
willChangeBitField |= NS_STYLE_WILL_CHANGE_FIXPOS_CB;
@@ -5489,17 +5489,17 @@ nsRuleNode::ComputeDisplayData(void* aSt
} else if (property.unit == eCSSUnit_None) {
transition->SetProperty(eCSSPropertyExtra_no_properties);
} else if (property.list) {
const nsCSSValue &val = property.list->mValue;
if (val.GetUnit() == eCSSUnit_Ident) {
nsDependentString
propertyStr(property.list->mValue.GetStringBufferValue());
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(propertyStr,
CSSEnabledState::eForAllContent);
if (prop == eCSSProperty_UNKNOWN ||
prop == eCSSPropertyExtra_variable) {
transition->SetUnknownProperty(prop, propertyStr);
} else {
transition->SetProperty(prop);
}
@@ -6289,24 +6289,24 @@ nsRuleNode::ComputeDisplayData(void* aSt
}
if (buffer.EqualsLiteral("opacity")) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_OPACITY;
}
if (buffer.EqualsLiteral("scroll-position")) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_SCROLL;
}
- nsCSSProperty prop =
+ nsCSSPropertyID prop =
nsCSSProps::LookupProperty(buffer, CSSEnabledState::eForAllContent);
if (prop != eCSSProperty_UNKNOWN &&
prop != eCSSPropertyExtra_variable) {
// If the property given is a shorthand, it indicates the expectation
// for all the longhands the shorthand expands to.
if (nsCSSProps::IsShorthand(prop)) {
- for (const nsCSSProperty* shorthands =
+ for (const nsCSSPropertyID* shorthands =
nsCSSProps::SubpropertyEntryFor(prop);
*shorthands != eCSSProperty_UNKNOWN; ++shorthands) {
display->mWillChangeBitField |= GetWillChangeBitFieldFromPropFlags(*shorthands);
}
} else {
display->mWillChangeBitField |= GetWillChangeBitFieldFromPropFlags(prop);
}
}
@@ -7330,17 +7330,17 @@ nsRuleNode::ComputeMarginData(void* aSta
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Margin, margin, parentMargin)
// margin: length, percent, calc, inherit
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_margin);
nsStyleCoord coord;
NS_FOR_CSS_SIDES(side) {
nsStyleCoord parentCoord = parentMargin->mMargin.Get(side);
if (SetCoord(*aRuleData->ValueFor(subprops[side]),
coord, parentCoord,
SETCOORD_LPAH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
SETCOORD_UNSET_INITIAL,
@@ -7444,17 +7444,17 @@ nsRuleNode::ComputeBorderData(void* aSta
border->mBoxDecorationBreak, conditions,
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
parentBorder->mBoxDecorationBreak,
NS_STYLE_BOX_DECORATION_BREAK_SLICE);
// border-width, border-*-width: length, enum, inherit
nsStyleCoord coord;
{
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_width);
NS_FOR_CSS_SIDES(side) {
const nsCSSValue& value = *aRuleData->ValueFor(subprops[side]);
NS_ASSERTION(eCSSUnit_Percent != value.GetUnit(),
"Percentage borders not implemented yet "
"If implementing, make sure to fix all consumers of "
"nsStyleBorder, the IsPercentageAwareChild method, "
"the nsAbsoluteContainingBlock::FrameDependsOnContainer "
@@ -7491,17 +7491,17 @@ nsRuleNode::ComputeBorderData(void* aSta
NS_ASSERTION(eCSSUnit_Null == value.GetUnit(),
"missing case handling border width");
}
}
}
// border-style, border-*-style: enum, inherit
{
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_style);
NS_FOR_CSS_SIDES(side) {
const nsCSSValue& value = *aRuleData->ValueFor(subprops[side]);
nsCSSUnit unit = value.GetUnit();
MOZ_ASSERT(eCSSUnit_None != unit,
"'none' should be handled as enumerated value");
if (eCSSUnit_Enumerated == unit) {
border->SetBorderStyle(side, value.GetIntValue());
@@ -7516,17 +7516,17 @@ nsRuleNode::ComputeBorderData(void* aSta
}
}
}
// -moz-border-*-colors: color, string, enum, none, inherit/initial
nscolor borderColor;
nscolor unused = NS_RGB(0,0,0);
- static const nsCSSProperty borderColorsProps[] = {
+ static const nsCSSPropertyID borderColorsProps[] = {
eCSSProperty_border_top_colors,
eCSSProperty_border_right_colors,
eCSSProperty_border_bottom_colors,
eCSSProperty_border_left_colors
};
NS_FOR_CSS_SIDES(side) {
const nsCSSValue& value = *aRuleData->ValueFor(borderColorsProps[side]);
@@ -7575,17 +7575,17 @@ nsRuleNode::ComputeBorderData(void* aSta
default:
MOZ_ASSERT(false, "unrecognized border color unit");
}
}
// border-color, border-*-color: color, string, enum, inherit
{
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color);
bool foreground;
NS_FOR_CSS_SIDES(side) {
const nsCSSValue& value = *aRuleData->ValueFor(subprops[side]);
if (eCSSUnit_Inherit == value.GetUnit()) {
conditions.SetUncacheable();
if (parentContext) {
parentBorder->GetBorderColor(side, borderColor, foreground);
@@ -7621,17 +7621,17 @@ nsRuleNode::ComputeBorderData(void* aSta
eCSSUnit_Unset == value.GetUnit()) {
border->SetBorderToForeground(side);
}
}
}
// border-radius: length, percent, inherit
{
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
NS_FOR_CSS_FULL_CORNERS(corner) {
int cx = NS_FULL_TO_HALF_CORNER(corner, false);
int cy = NS_FULL_TO_HALF_CORNER(corner, true);
const nsCSSValue& radius = *aRuleData->ValueFor(subprops[corner]);
nsStyleCoord parentX = parentBorder->mBorderRadius.Get(cx);
nsStyleCoord parentY = parentBorder->mBorderRadius.Get(cy);
nsStyleCoord coordX, coordY;
@@ -7751,17 +7751,17 @@ nsRuleNode::ComputePaddingData(void* aSt
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Padding, padding, parentPadding)
// padding: length, percent, calc, inherit
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_padding);
nsStyleCoord coord;
NS_FOR_CSS_SIDES(side) {
nsStyleCoord parentCoord = parentPadding->mPadding.Get(side);
if (SetCoord(*aRuleData->ValueFor(subprops[side]),
coord, parentCoord,
SETCOORD_LPH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
SETCOORD_UNSET_INITIAL,
@@ -7839,17 +7839,17 @@ nsRuleNode::ComputeOutlineData(void* aSt
else if (eCSSUnit_Enumerated == outlineColorValue->GetUnit() ||
eCSSUnit_Initial == outlineColorValue->GetUnit() ||
eCSSUnit_Unset == outlineColorValue->GetUnit()) {
outline->SetOutlineInitialColor();
}
// -moz-outline-radius: length, percent, inherit
{
- const nsCSSProperty* subprops =
+ const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty__moz_outline_radius);
NS_FOR_CSS_FULL_CORNERS(corner) {
int cx = NS_FULL_TO_HALF_CORNER(corner, false);
int cy = NS_FULL_TO_HALF_CORNER(corner, true);
const nsCSSValue& radius = *aRuleData->ValueFor(subprops[corner]);
nsStyleCoord parentX = parentOutline->mOutlineRadius.Get(cx);
nsStyleCoord parentY = parentOutline->mOutlineRadius.Get(cy);
nsStyleCoord coordX, coordY;
@@ -8381,17 +8381,17 @@ nsRuleNode::ComputePositionData(void* aS
nsStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Position, pos, parentPos)
// box offsets: length, percent, calc, auto, inherit
- static const nsCSSProperty offsetProps[] = {
+ static const nsCSSPropertyID offsetProps[] = {
eCSSProperty_top,
eCSSProperty_right,
eCSSProperty_bottom,
eCSSProperty_left
};
nsStyleCoord coord;
NS_FOR_CSS_SIDES(side) {
nsStyleCoord parentCoord = parentPos->mOffset.Get(side);
@@ -10426,22 +10426,22 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) {
ruleData.mValueOffsets[eStyleStruct_Padding] = paddingOffset;
}
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
ruleData.mValueOffsets[eStyleStruct_Text] = textShadowOffset;
}
- static const nsCSSProperty backgroundValues[] = {
+ static const nsCSSPropertyID backgroundValues[] = {
eCSSProperty_background_color,
eCSSProperty_background_image,
};
- static const nsCSSProperty borderValues[] = {
+ static const nsCSSPropertyID borderValues[] = {
eCSSProperty_border_top_color,
eCSSProperty_border_top_style,
eCSSProperty_border_top_width,
eCSSProperty_border_right_color,
eCSSProperty_border_right_style,
eCSSProperty_border_right_width,
eCSSProperty_border_bottom_color,
eCSSProperty_border_bottom_style,
@@ -10450,36 +10450,36 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
eCSSProperty_border_left_style,
eCSSProperty_border_left_width,
eCSSProperty_border_top_left_radius,
eCSSProperty_border_top_right_radius,
eCSSProperty_border_bottom_right_radius,
eCSSProperty_border_bottom_left_radius,
};
- static const nsCSSProperty paddingValues[] = {
+ static const nsCSSPropertyID paddingValues[] = {
eCSSProperty_padding_top,
eCSSProperty_padding_right,
eCSSProperty_padding_bottom,
eCSSProperty_padding_left,
};
- static const nsCSSProperty textShadowValues[] = {
+ static const nsCSSPropertyID textShadowValues[] = {
eCSSProperty_text_shadow
};
// Number of properties we care about
size_t nValues = 0;
nsCSSValue* values[MOZ_ARRAY_LENGTH(backgroundValues) +
MOZ_ARRAY_LENGTH(borderValues) +
MOZ_ARRAY_LENGTH(paddingValues) +
MOZ_ARRAY_LENGTH(textShadowValues)];
- nsCSSProperty properties[MOZ_ARRAY_LENGTH(backgroundValues) +
+ nsCSSPropertyID properties[MOZ_ARRAY_LENGTH(backgroundValues) +
MOZ_ARRAY_LENGTH(borderValues) +
MOZ_ARRAY_LENGTH(paddingValues) +
MOZ_ARRAY_LENGTH(textShadowValues)];
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
for (uint32_t i = 0, i_end = ArrayLength(backgroundValues);
i < i_end; ++i) {
properties[nValues] = backgroundValues[i];
@@ -10593,30 +10593,30 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
}
} while (haveExplicitUAInherit && styleContext);
return false;
}
/* static */ void
nsRuleNode::ComputePropertiesOverridingAnimation(
- const nsTArray<nsCSSProperty>& aProperties,
+ const nsTArray<nsCSSPropertyID>& aProperties,
nsStyleContext* aStyleContext,
nsCSSPropertySet& aPropertiesOverridden)
{
/*
* Set up an nsRuleData with all the structs needed for all of the
* properties in aProperties.
*/
uint32_t structBits = 0;
size_t nprops = 0;
size_t offsets[nsStyleStructID_Length];
for (size_t propIdx = 0, propEnd = aProperties.Length();
propIdx < propEnd; ++propIdx) {
- nsCSSProperty prop = aProperties[propIdx];
+ nsCSSPropertyID prop = aProperties[propIdx];
nsStyleStructID sid = nsCSSProps::kSIDTable[prop];
uint32_t bit = nsCachedStyleData::GetBitForSID(sid);
if (!(structBits & bit)) {
structBits |= bit;
offsets[sid] = nprops;
nprops += nsCSSProps::PropertyCountInStruct(sid);
}
}
@@ -10667,17 +10667,17 @@ nsRuleNode::ComputePropertiesOverridingA
}
}
/*
* Fill in which properties were overridden.
*/
for (size_t propIdx = 0, propEnd = aProperties.Length();
propIdx < propEnd; ++propIdx) {
- nsCSSProperty prop = aProperties[propIdx];
+ nsCSSPropertyID prop = aProperties[propIdx];
if (ruleData.ValueFor(prop)->GetUnit() != eCSSUnit_Null) {
aPropertiesOverridden.AddProperty(prop);
}
}
}
/* static */
bool
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -956,17 +956,17 @@ public:
/**
* Fill in to aPropertiesOverridden all of the properties in aProperties
* that, for this rule node, have a declaration that is higher than the
* animation level in the CSS Cascade.
*/
static void
ComputePropertiesOverridingAnimation(
- const nsTArray<nsCSSProperty>& aProperties,
+ const nsTArray<nsCSSPropertyID>& aProperties,
nsStyleContext* aStyleContext,
nsCSSPropertySet& aPropertiesOverridden);
// Expose this so media queries can use it
static nscoord CalcLengthWithInitialFont(nsPresContext* aPresContext,
const nsCSSValue& aValue);
// Expose this so nsTransformFunctions can use it.
static nscoord CalcLength(const nsCSSValue& aValue,
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -1389,39 +1389,39 @@ NS_NewStyleContext(nsStyleContext* aPare
nsIPresShell*
nsStyleContext::Arena()
{
return PresContext()->PresShell();
}
static inline void
-ExtractAnimationValue(nsCSSProperty aProperty,
+ExtractAnimationValue(nsCSSPropertyID aProperty,
nsStyleContext* aStyleContext,
StyleAnimationValue& aResult)
{
DebugOnly<bool> success =
StyleAnimationValue::ExtractComputedValue(aProperty, aStyleContext,
aResult);
MOZ_ASSERT(success,
"aProperty must be extractable by StyleAnimationValue");
}
static nscolor
-ExtractColor(nsCSSProperty aProperty,
+ExtractColor(nsCSSPropertyID aProperty,
nsStyleContext *aStyleContext)
{
StyleAnimationValue val;
ExtractAnimationValue(aProperty, aStyleContext, val);
return val.GetUnit() == StyleAnimationValue::eUnit_CurrentColor
? aStyleContext->StyleColor()->mColor : val.GetColorValue();
}
static nscolor
-ExtractColorLenient(nsCSSProperty aProperty,
+ExtractColorLenient(nsCSSPropertyID aProperty,
nsStyleContext *aStyleContext)
{
StyleAnimationValue val;
ExtractAnimationValue(aProperty, aStyleContext, val);
if (val.GetUnit() == StyleAnimationValue::eUnit_Color) {
return val.GetColorValue();
} else if (val.GetUnit() == StyleAnimationValue::eUnit_CurrentColor) {
return aStyleContext->StyleColor()->mColor;
@@ -1431,17 +1431,17 @@ ExtractColorLenient(nsCSSProperty aPrope
struct ColorIndexSet {
uint8_t colorIndex, alphaIndex;
};
static const ColorIndexSet gVisitedIndices[2] = { { 0, 0 }, { 1, 0 } };
nscolor
-nsStyleContext::GetVisitedDependentColor(nsCSSProperty aProperty)
+nsStyleContext::GetVisitedDependentColor(nsCSSPropertyID aProperty)
{
NS_ASSERTION(aProperty == eCSSProperty_color ||
aProperty == eCSSProperty_background_color ||
aProperty == eCSSProperty_border_top_color ||
aProperty == eCSSProperty_border_right_color ||
aProperty == eCSSProperty_border_bottom_color ||
aProperty == eCSSProperty_border_left_color ||
aProperty == eCSSProperty_outline_color ||
--- a/layout/style/nsStyleContext.h
+++ b/layout/style/nsStyleContext.h
@@ -169,17 +169,17 @@ public:
already_AddRefed<nsStyleContext>
FindChildWithRules(const nsIAtom* aPseudoTag,
mozilla::NonOwningStyleContextSource aSource,
mozilla::NonOwningStyleContextSource aSourceIfVisited,
bool aRelevantLinkVisited);
/**
* Get the color property that should be used to fill text.
*/
- nsCSSProperty GetTextFillColorProp() {
+ nsCSSPropertyID GetTextFillColorProp() {
return StyleText()->mWebkitTextFillColorForeground
? eCSSProperty_color : eCSSProperty__webkit_text_fill_color;
}
/**
* Get the color that should be used to fill text: either
* the current foreground color, or a separately-specified text fill color.
*/
@@ -421,17 +421,17 @@ public:
*
* aProperty must be a color-valued property that StyleAnimationValue
* knows how to extract. It must also be a property that we know to
* do change handling for in nsStyleContext::CalcDifference.
*
* Note that if aProperty is eCSSProperty_border_*_color, this
* function handles -moz-use-text-color.
*/
- nscolor GetVisitedDependentColor(nsCSSProperty aProperty);
+ nscolor GetVisitedDependentColor(nsCSSPropertyID aProperty);
/**
* aColors should be a two element array of nscolor in which the first
* color is the unvisited color and the second is the visited color.
*
* Combine the R, G, and B components of whichever of aColors should
* be used based on aLinkIsVisited with the A component of aColors[0].
*/
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2328,33 +2328,33 @@ nsStyleImage::PurgeCacheForViewportChang
mCachedBIData->SetCachedSVGViewportSize(aSVGViewportSize);
}
}
// --------------------
// nsStyleImageLayers
//
-const nsCSSProperty nsStyleImageLayers::kBackgroundLayerTable[] = {
+const nsCSSPropertyID nsStyleImageLayers::kBackgroundLayerTable[] = {
eCSSProperty_background, // shorthand
eCSSProperty_background_color, // color
eCSSProperty_background_image, // image
eCSSProperty_background_repeat, // repeat
eCSSProperty_background_position_x, // positionX
eCSSProperty_background_position_y, // positionY
eCSSProperty_background_clip, // clip
eCSSProperty_background_origin, // origin
eCSSProperty_background_size, // size
eCSSProperty_background_attachment, // attachment
eCSSProperty_UNKNOWN, // maskMode
eCSSProperty_UNKNOWN // composite
};
#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
-const nsCSSProperty nsStyleImageLayers::kMaskLayerTable[] = {
+const nsCSSPropertyID nsStyleImageLayers::kMaskLayerTable[] = {
eCSSProperty_mask, // shorthand
eCSSProperty_UNKNOWN, // color
eCSSProperty_mask_image, // image
eCSSProperty_mask_repeat, // repeat
eCSSProperty_mask_position_x, // positionX
eCSSProperty_mask_position_y, // positionY
eCSSProperty_mask_clip, // clip
eCSSProperty_mask_origin, // origin
@@ -2900,17 +2900,17 @@ StyleTransition::SetInitialValues()
{
mTimingFunction = nsTimingFunction(NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE);
mDuration = 0.0;
mDelay = 0.0;
mProperty = eCSSPropertyExtra_all_properties;
}
void
-StyleTransition::SetUnknownProperty(nsCSSProperty aProperty,
+StyleTransition::SetUnknownProperty(nsCSSPropertyID aProperty,
const nsAString& aPropertyString)
{
MOZ_ASSERT(nsCSSProps::LookupProperty(aPropertyString,
CSSEnabledState::eForAllContent) ==
aProperty,
"property and property string should match");
MOZ_ASSERT(aProperty == eCSSProperty_UNKNOWN ||
aProperty == eCSSPropertyExtra_variable,
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -802,18 +802,18 @@ struct nsStyleImageLayers {
mLayers[i].UntrackImages(aContext);
}
nsChangeHint CalcDifference(const nsStyleImageLayers& aNewLayers,
nsChangeHint aPositionChangeHint) const;
bool HasLayerWithImage() const;
- static const nsCSSProperty kBackgroundLayerTable[];
- static const nsCSSProperty kMaskLayerTable[];
+ static const nsCSSPropertyID kBackgroundLayerTable[];
+ static const nsCSSPropertyID kMaskLayerTable[];
#define NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(var_, layers_) \
for (uint32_t var_ = (layers_).mImageCount; var_-- != 0; )
#define NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT_WITH_RANGE(var_, layers_, start_, count_) \
NS_ASSERTION((int32_t)(start_) >= 0 && (uint32_t)(start_) < (layers_).mImageCount, "Invalid layer start!"); \
NS_ASSERTION((count_) > 0 && (count_) <= (start_) + 1, "Invalid layer range!"); \
for (uint32_t var_ = (start_) + 1; var_-- != (uint32_t)((start_) + 1 - (count_)); )
};
@@ -2429,36 +2429,36 @@ struct StyleTransition
void SetInitialValues();
// Delay and Duration are in milliseconds
const nsTimingFunction& GetTimingFunction() const { return mTimingFunction; }
float GetDelay() const { return mDelay; }
float GetDuration() const { return mDuration; }
- nsCSSProperty GetProperty() const { return mProperty; }
+ nsCSSPropertyID GetProperty() const { return mProperty; }
nsIAtom* GetUnknownProperty() const { return mUnknownProperty; }
float GetCombinedDuration() const {
// http://dev.w3.org/csswg/css-transitions/#combined-duration
return std::max(mDuration, 0.0f) + mDelay;
}
void SetTimingFunction(const nsTimingFunction& aTimingFunction)
{ mTimingFunction = aTimingFunction; }
void SetDelay(float aDelay) { mDelay = aDelay; }
void SetDuration(float aDuration) { mDuration = aDuration; }
- void SetProperty(nsCSSProperty aProperty)
+ void SetProperty(nsCSSPropertyID aProperty)
{
NS_ASSERTION(aProperty != eCSSProperty_UNKNOWN &&
aProperty != eCSSPropertyExtra_variable,
"invalid property");
mProperty = aProperty;
}
- void SetUnknownProperty(nsCSSProperty aProperty,
+ void SetUnknownProperty(nsCSSPropertyID aProperty,
const nsAString& aPropertyString);
void CopyPropertyFrom(const StyleTransition& aOther)
{
mProperty = aOther.mProperty;
mUnknownProperty = aOther.mUnknownProperty;
}
nsTimingFunction& TimingFunctionSlot() { return mTimingFunction; }
@@ -2466,17 +2466,17 @@ struct StyleTransition
bool operator==(const StyleTransition& aOther) const;
bool operator!=(const StyleTransition& aOther) const
{ return !(*this == aOther); }
private:
nsTimingFunction mTimingFunction;
float mDuration;
float mDelay;
- nsCSSProperty mProperty;
+ nsCSSPropertyID mProperty;
nsCOMPtr<nsIAtom> mUnknownProperty; // used when mProperty is
// eCSSProperty_UNKNOWN or
// eCSSPropertyExtra_variable
};
struct StyleAnimation
{
StyleAnimation() { /* leaves uninitialized; see also SetInitialValues */ }
--- a/layout/style/nsStyleUtil.cpp
+++ b/layout/style/nsStyleUtil.cpp
@@ -223,17 +223,17 @@ nsStyleUtil::AppendEscapedCSSFontFamilyL
default:
name.AppendToString(aResult);
}
}
}
/* static */ void
-nsStyleUtil::AppendBitmaskCSSValue(nsCSSProperty aProperty,
+nsStyleUtil::AppendBitmaskCSSValue(nsCSSPropertyID aProperty,
int32_t aMaskedValue,
int32_t aFirstMask,
int32_t aLastMask,
nsAString& aResult)
{
for (int32_t mask = aFirstMask; mask <= aLastMask; mask <<= 1) {
if (mask & aMaskedValue) {
AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, mask),
--- a/layout/style/nsStyleUtil.h
+++ b/layout/style/nsStyleUtil.h
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsStyleUtil_h___
#define nsStyleUtil_h___
#include "nsCoord.h"
-#include "nsCSSProperty.h"
+#include "nsCSSPropertyID.h"
#include "nsString.h"
#include "nsTArrayForwardDeclare.h"
#include "gfxFontFamilyList.h"
#include "nsStyleStruct.h"
#include "nsCRT.h"
class nsCSSValue;
class nsStringComparator;
@@ -48,17 +48,17 @@ public:
static void AppendEscapedCSSIdent(const nsAString& aIdent,
nsAString& aResult);
static void
AppendEscapedCSSFontFamilyList(const mozilla::FontFamilyList& aFamilyList,
nsAString& aResult);
// Append a bitmask-valued property's value(s) (space-separated) to aResult.
- static void AppendBitmaskCSSValue(nsCSSProperty aProperty,
+ static void AppendBitmaskCSSValue(nsCSSPropertyID aProperty,
int32_t aMaskedValue,
int32_t aFirstMask,
int32_t aLastMask,
nsAString& aResult);
static void AppendAngleValue(const nsStyleCoord& aValue, nsAString& aResult);
static void AppendPaintOrderValue(uint8_t aValue, nsAString& aResult);
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -136,17 +136,17 @@ CSSTransition::WrapObject(JSContext* aCx
void
CSSTransition::GetTransitionProperty(nsString& aRetVal) const
{
// Once we make the effect property settable (bug 1049975) we will need
// to store the transition property on the CSSTransition itself but for
// now we can just query the effect.
MOZ_ASSERT(mEffect && mEffect->AsTransition(),
"Transitions should have a transition effect");
- nsCSSProperty prop = mEffect->AsTransition()->TransitionProperty();
+ nsCSSPropertyID prop = mEffect->AsTransition()->TransitionProperty();
aRetVal = NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(prop));
}
AnimationPlayState
CSSTransition::PlayStateFromJS() const
{
FlushStyle();
return Animation::PlayStateFromJS();
@@ -204,17 +204,17 @@ CSSTransition::QueueEvents()
void
CSSTransition::Tick()
{
Animation::Tick();
QueueEvents();
}
-nsCSSProperty
+nsCSSPropertyID
CSSTransition::TransitionProperty() const
{
// FIXME: Once we support replacing/removing the effect (bug 1049975)
// we'll need to store the original transition property so we keep
// returning the same value in that case.
dom::KeyframeEffectReadOnly* effect = GetEffect();
MOZ_ASSERT(effect && effect->AsTransition(),
"Transition should have a transition effect");
@@ -463,25 +463,25 @@ nsTransitionManager::UpdateTransitions(
// Check the combined duration (combination of delay and duration)
// first, since it defaults to zero, which means we can ignore the
// transition.
if (t.GetCombinedDuration() > 0.0f) {
// We might have something to transition. See if any of the
// properties in question changed and are animatable.
// FIXME: Would be good to find a way to share code between this
// interpretation of transition-property and the one below.
- nsCSSProperty property = t.GetProperty();
+ nsCSSPropertyID property = t.GetProperty();
if (property == eCSSPropertyExtra_no_properties ||
property == eCSSPropertyExtra_variable ||
property == eCSSProperty_UNKNOWN) {
// Nothing to do, but need to exclude this from cases below.
} else if (property == eCSSPropertyExtra_all_properties) {
- for (nsCSSProperty p = nsCSSProperty(0);
+ for (nsCSSPropertyID p = nsCSSPropertyID(0);
p < eCSSProperty_COUNT_no_shorthands;
- p = nsCSSProperty(p + 1)) {
+ p = nsCSSPropertyID(p + 1)) {
ConsiderStartingTransition(p, t, aElement, aElementTransitions,
aOldStyleContext, aNewStyleContext,
&startedAny, &whichStarted);
}
} else if (nsCSSProps::IsShorthand(property)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property,
CSSEnabledState::eForAllContent)
{
@@ -510,25 +510,25 @@ nsTransitionManager::UpdateTransitions(
bool checkProperties =
aDisp->mTransitions[0].GetProperty() != eCSSPropertyExtra_all_properties;
nsCSSPropertySet allTransitionProperties;
if (checkProperties) {
for (uint32_t i = aDisp->mTransitionPropertyCount; i-- != 0; ) {
const StyleTransition& t = aDisp->mTransitions[i];
// FIXME: Would be good to find a way to share code between this
// interpretation of transition-property and the one above.
- nsCSSProperty property = t.GetProperty();
+ nsCSSPropertyID property = t.GetProperty();
if (property == eCSSPropertyExtra_no_properties ||
property == eCSSPropertyExtra_variable ||
property == eCSSProperty_UNKNOWN) {
// Nothing to do, but need to exclude this from cases below.
} else if (property == eCSSPropertyExtra_all_properties) {
- for (nsCSSProperty p = nsCSSProperty(0);
+ for (nsCSSPropertyID p = nsCSSPropertyID(0);
p < eCSSProperty_COUNT_no_shorthands;
- p = nsCSSProperty(p + 1)) {
+ p = nsCSSPropertyID(p + 1)) {
allTransitionProperties.AddProperty(p);
}
} else if (nsCSSProps::IsShorthand(property)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
subprop, property, CSSEnabledState::eForAllContent) {
allTransitionProperties.AddProperty(*subprop);
}
} else {
@@ -576,17 +576,17 @@ nsTransitionManager::UpdateTransitions(
}
}
return startedAny;
}
void
nsTransitionManager::ConsiderStartingTransition(
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
const StyleTransition& aTransition,
dom::Element* aElement,
CSSTransitionCollection*& aElementTransitions,
nsStyleContext* aOldStyleContext,
nsStyleContext* aNewStyleContext,
bool* aStartedAny,
nsCSSPropertySet* aWhichStarted)
{
@@ -857,34 +857,34 @@ nsTransitionManager::ConsiderStartingTra
effectSet->UpdateAnimationGeneration(mPresContext);
}
*aStartedAny = true;
aWhichStarted->AddProperty(aProperty);
}
static Keyframe&
-AppendKeyframe(double aOffset, nsCSSProperty aProperty,
+AppendKeyframe(double aOffset, nsCSSPropertyID aProperty,
StyleAnimationValue&& aValue, nsTArray<Keyframe>& aKeyframes)
{
Keyframe& frame = *aKeyframes.AppendElement();
frame.mOffset.emplace(aOffset);
PropertyValuePair& pv = *frame.mPropertyValues.AppendElement();
pv.mProperty = aProperty;
DebugOnly<bool> uncomputeResult =
StyleAnimationValue::UncomputeValue(aProperty, Move(aValue), pv.mValue);
MOZ_ASSERT(uncomputeResult,
"Unable to get specified value from computed value");
return frame;
}
nsTArray<Keyframe>
nsTransitionManager::GetTransitionKeyframes(
nsStyleContext* aStyleContext,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
StyleAnimationValue&& aStartValue,
StyleAnimationValue&& aEndValue,
const nsTimingFunction& aTimingFunction)
{
nsTArray<Keyframe> keyframes(2);
Keyframe& fromFrame = AppendKeyframe(0.0, aProperty, Move(aStartValue),
keyframes);
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -47,17 +47,17 @@ struct ElementPropertyTransition : publi
{ }
ElementPropertyTransition* AsTransition() override { return this; }
const ElementPropertyTransition* AsTransition() const override
{
return this;
}
- nsCSSProperty TransitionProperty() const {
+ nsCSSPropertyID TransitionProperty() const {
MOZ_ASSERT(mKeyframes.Length() == 2,
"Transitions should have exactly two animation keyframes. "
"Perhaps we are using an un-initialized transition?");
MOZ_ASSERT(mKeyframes[0].mPropertyValues.Length() == 1,
"Transitions should have exactly one property in their first "
"frame");
return mKeyframes[0].mPropertyValues[0].mProperty;
}
@@ -165,17 +165,17 @@ public:
// that restyle should target the *transitions* level of the cascade.
// However, once we clear the owning element, CascadeLevel() will begin
// returning CascadeLevel::Animations.
mOwningElement = OwningElementRef();
}
void Tick() override;
- nsCSSProperty TransitionProperty() const;
+ nsCSSPropertyID TransitionProperty() const;
StyleAnimationValue ToValue() const;
bool HasLowerCompositeOrderThan(const CSSTransition& aOther) const;
EffectCompositor::CascadeLevel CascadeLevel() const override
{
return IsTiedToMarkup() ?
EffectCompositor::CascadeLevel::Transitions :
EffectCompositor::CascadeLevel::Animations;
@@ -271,17 +271,17 @@ struct AnimationTypeTraits<dom::CSSTrans
struct TransitionEventInfo {
RefPtr<dom::Element> mElement;
RefPtr<dom::Animation> mAnimation;
InternalTransitionEvent mEvent;
TimeStamp mTimeStamp;
TransitionEventInfo(dom::Element* aElement,
CSSPseudoElementType aPseudoType,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
StickyTimeDuration aDuration,
const TimeStamp& aTimeStamp,
dom::Animation* aAnimation)
: mElement(aElement)
, mAnimation(aAnimation)
, mEvent(true, eTransitionEnd)
, mTimeStamp(aTimeStamp)
{
@@ -394,28 +394,28 @@ protected:
bool
UpdateTransitions(const nsStyleDisplay* aDisp,
mozilla::dom::Element* aElement,
CSSTransitionCollection*& aElementTransitions,
nsStyleContext* aOldStyleContext,
nsStyleContext* aNewStyleContext);
void
- ConsiderStartingTransition(nsCSSProperty aProperty,
+ ConsiderStartingTransition(nsCSSPropertyID aProperty,
const mozilla::StyleTransition& aTransition,
mozilla::dom::Element* aElement,
CSSTransitionCollection*& aElementTransitions,
nsStyleContext* aOldStyleContext,
nsStyleContext* aNewStyleContext,
bool* aStartedAny,
nsCSSPropertySet* aWhichStarted);
nsTArray<mozilla::Keyframe> GetTransitionKeyframes(
nsStyleContext* aStyleContext,
- nsCSSProperty aProperty,
+ nsCSSPropertyID aProperty,
mozilla::StyleAnimationValue&& aStartValue,
mozilla::StyleAnimationValue&& aEndValue,
const nsTimingFunction& aTimingFunction);
bool mInAnimationOnlyStyleUpdate;
mozilla::DelayedEventDispatcher<mozilla::TransitionEventInfo>
mEventDispatcher;
--- a/layout/style/test/TestCSSPropertyLookup.cpp
+++ b/layout/style/test/TestCSSPropertyLookup.cpp
@@ -19,33 +19,33 @@ static const char* const kJunkNames[] =
"zzzzzz",
"#@$&@#*@*$@$#"
};
static bool
TestProps()
{
bool success = true;
- nsCSSProperty id;
- nsCSSProperty index;
+ nsCSSPropertyID id;
+ nsCSSPropertyID index;
// Everything appears to assert if we don't do this first...
nsCSSProps::AddRefTable();
// First make sure we can find all of the tags that are supposed to
// be in the table. Futz with the case to make sure any case will
// work
extern const char* const kCSSRawProperties[];
const char*const* et = &kCSSRawProperties[0];
const char*const* end = &kCSSRawProperties[eCSSProperty_COUNT];
index = eCSSProperty_UNKNOWN;
while (et < end) {
char tagName[100];
PL_strcpy(tagName, *et);
- index = nsCSSProperty(int32_t(index) + 1);
+ index = nsCSSPropertyID(int32_t(index) + 1);
id = nsCSSProps::LookupProperty(nsCString(tagName),
CSSEnabledState::eIgnoreEnabledState);
if (id == eCSSProperty_UNKNOWN) {
printf("bug: can't find '%s'\n", tagName);
success = false;
}
if (id != index) {