зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1857820 - Simplify checking for percent units on offset attribute r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190403
This commit is contained in:
Родитель
d3464f1dc0
Коммит
120a330b0f
|
@ -175,7 +175,8 @@ class SVGElement : public SVGElementBase // nsIContent
|
|||
return GetStringInfo().mInfos[aAttrEnum].mIsAnimatable;
|
||||
}
|
||||
bool NumberAttrAllowsPercentage(uint8_t aAttrEnum) {
|
||||
return GetNumberInfo().mInfos[aAttrEnum].mPercentagesAllowed;
|
||||
return IsSVGElement(nsGkAtoms::stop) &&
|
||||
GetNumberInfo().mInfos[aAttrEnum].mName == nsGkAtoms::offset;
|
||||
}
|
||||
virtual bool HasValidDimensions() const { return true; }
|
||||
void SetLength(nsAtom* aName, const SVGAnimatedLength& aLength);
|
||||
|
@ -431,7 +432,6 @@ class SVGElement : public SVGElementBase // nsIContent
|
|||
struct NumberInfo {
|
||||
nsStaticAtom* const mName;
|
||||
const float mDefaultValue;
|
||||
const bool mPercentagesAllowed;
|
||||
};
|
||||
|
||||
using NumberAttributesInfo = AttributesInfo<SVGAnimatedNumber, NumberInfo>;
|
||||
|
|
|
@ -21,10 +21,10 @@ JSObject* SVGFECompositeElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFECompositeElement::sNumberInfo[4] = {
|
||||
{nsGkAtoms::k1, 0, false},
|
||||
{nsGkAtoms::k2, 0, false},
|
||||
{nsGkAtoms::k3, 0, false},
|
||||
{nsGkAtoms::k4, 0, false}};
|
||||
{nsGkAtoms::k1, 0},
|
||||
{nsGkAtoms::k2, 0},
|
||||
{nsGkAtoms::k3, 0},
|
||||
{nsGkAtoms::k4, 0}};
|
||||
|
||||
SVGEnumMapping SVGFECompositeElement::sOperatorMap[] = {
|
||||
{nsGkAtoms::over, SVG_FECOMPOSITE_OPERATOR_OVER},
|
||||
|
|
|
@ -26,7 +26,7 @@ JSObject* SVGFEConvolveMatrixElement::WrapNode(
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEConvolveMatrixElement::sNumberInfo[2] = {
|
||||
{nsGkAtoms::divisor, 1, false}, {nsGkAtoms::bias, 0, false}};
|
||||
{nsGkAtoms::divisor, 1}, {nsGkAtoms::bias, 0}};
|
||||
|
||||
SVGElement::NumberPairInfo SVGFEConvolveMatrixElement::sNumberPairInfo[1] = {
|
||||
{nsGkAtoms::kernelUnitLength, 0, 0}};
|
||||
|
|
|
@ -22,7 +22,7 @@ JSObject* SVGFEDisplacementMapElement::WrapNode(
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEDisplacementMapElement::sNumberInfo[1] = {
|
||||
{nsGkAtoms::scale, 0, false},
|
||||
{nsGkAtoms::scale, 0},
|
||||
};
|
||||
|
||||
SVGEnumMapping SVGFEDisplacementMapElement::sChannelMap[] = {
|
||||
|
|
|
@ -20,7 +20,7 @@ JSObject* SVGFEDistantLightElement::WrapNode(
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] = {
|
||||
{nsGkAtoms::azimuth, 0, false}, {nsGkAtoms::elevation, 0, false}};
|
||||
{nsGkAtoms::azimuth, 0}, {nsGkAtoms::elevation, 0}};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -21,7 +21,7 @@ JSObject* SVGFEDropShadowElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEDropShadowElement::sNumberInfo[2] = {
|
||||
{nsGkAtoms::dx, 2, false}, {nsGkAtoms::dy, 2, false}};
|
||||
{nsGkAtoms::dx, 2}, {nsGkAtoms::dy, 2}};
|
||||
|
||||
SVGElement::NumberPairInfo SVGFEDropShadowElement::sNumberPairInfo[1] = {
|
||||
{nsGkAtoms::stdDeviation, 2, 2}};
|
||||
|
|
|
@ -22,7 +22,7 @@ JSObject* SVGFEOffsetElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEOffsetElement::sNumberInfo[2] = {
|
||||
{nsGkAtoms::dx, 0, false}, {nsGkAtoms::dy, 0, false}};
|
||||
{nsGkAtoms::dx, 0}, {nsGkAtoms::dy, 0}};
|
||||
|
||||
SVGElement::StringInfo SVGFEOffsetElement::sStringInfo[2] = {
|
||||
{nsGkAtoms::result, kNameSpaceID_None, true},
|
||||
|
|
|
@ -20,9 +20,7 @@ JSObject* SVGFEPointLightElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] = {
|
||||
{nsGkAtoms::x, 0, false},
|
||||
{nsGkAtoms::y, 0, false},
|
||||
{nsGkAtoms::z, 0, false}};
|
||||
{nsGkAtoms::x, 0}, {nsGkAtoms::y, 0}, {nsGkAtoms::z, 0}};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsINode methods
|
||||
|
|
|
@ -20,14 +20,14 @@ JSObject* SVGFESpotLightElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] = {
|
||||
{nsGkAtoms::x, 0, false},
|
||||
{nsGkAtoms::y, 0, false},
|
||||
{nsGkAtoms::z, 0, false},
|
||||
{nsGkAtoms::pointsAtX, 0, false},
|
||||
{nsGkAtoms::pointsAtY, 0, false},
|
||||
{nsGkAtoms::pointsAtZ, 0, false},
|
||||
{nsGkAtoms::specularExponent, 1, false},
|
||||
{nsGkAtoms::limitingConeAngle, 0, false}};
|
||||
{nsGkAtoms::x, 0},
|
||||
{nsGkAtoms::y, 0},
|
||||
{nsGkAtoms::z, 0},
|
||||
{nsGkAtoms::pointsAtX, 0},
|
||||
{nsGkAtoms::pointsAtY, 0},
|
||||
{nsGkAtoms::pointsAtZ, 0},
|
||||
{nsGkAtoms::specularExponent, 1},
|
||||
{nsGkAtoms::limitingConeAngle, 0}};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsINode methods
|
||||
|
|
|
@ -28,7 +28,7 @@ JSObject* SVGFETurbulenceElement::WrapNode(JSContext* aCx,
|
|||
}
|
||||
|
||||
SVGElement::NumberInfo SVGFETurbulenceElement::sNumberInfo[1] = {
|
||||
{nsGkAtoms::seed, 0, false}};
|
||||
{nsGkAtoms::seed, 0}};
|
||||
|
||||
SVGElement::NumberPairInfo SVGFETurbulenceElement::sNumberPairInfo[1] = {
|
||||
{nsGkAtoms::baseFrequency, 0, 0}};
|
||||
|
|
|
@ -144,11 +144,11 @@ SVGElement::NumberListInfo
|
|||
{nsGkAtoms::tableValues}};
|
||||
|
||||
SVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] = {
|
||||
{nsGkAtoms::slope, 1, false},
|
||||
{nsGkAtoms::intercept, 0, false},
|
||||
{nsGkAtoms::amplitude, 1, false},
|
||||
{nsGkAtoms::exponent, 1, false},
|
||||
{nsGkAtoms::offset, 0, false}};
|
||||
{nsGkAtoms::slope, 1},
|
||||
{nsGkAtoms::intercept, 0},
|
||||
{nsGkAtoms::amplitude, 1},
|
||||
{nsGkAtoms::exponent, 1},
|
||||
{nsGkAtoms::offset, 0}};
|
||||
|
||||
SVGEnumMapping SVGComponentTransferFunctionElement::sTypeMap[] = {
|
||||
{nsGkAtoms::identity, SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY},
|
||||
|
@ -331,10 +331,10 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncAElement)
|
|||
//--------------------------------------------------------------------
|
||||
//
|
||||
SVGElement::NumberInfo SVGFELightingElement::sNumberInfo[4] = {
|
||||
{nsGkAtoms::surfaceScale, 1, false},
|
||||
{nsGkAtoms::diffuseConstant, 1, false},
|
||||
{nsGkAtoms::specularConstant, 1, false},
|
||||
{nsGkAtoms::specularExponent, 1, false}};
|
||||
{nsGkAtoms::surfaceScale, 1},
|
||||
{nsGkAtoms::diffuseConstant, 1},
|
||||
{nsGkAtoms::specularConstant, 1},
|
||||
{nsGkAtoms::specularExponent, 1}};
|
||||
|
||||
SVGElement::NumberPairInfo SVGFELightingElement::sNumberPairInfo[1] = {
|
||||
{nsGkAtoms::kernelUnitLength, 0, 0}};
|
||||
|
|
|
@ -27,7 +27,7 @@ using namespace mozilla::gfx;
|
|||
namespace mozilla::dom {
|
||||
|
||||
SVGElement::NumberInfo SVGGeometryElement::sNumberInfo = {nsGkAtoms::pathLength,
|
||||
0, false};
|
||||
0};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
|
|
@ -16,8 +16,7 @@ JSObject* SVGStopElement::WrapNode(JSContext* aCx,
|
|||
return SVGStopElement_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
SVGElement::NumberInfo SVGStopElement::sNumberInfo = {nsGkAtoms::offset, 0,
|
||||
true};
|
||||
SVGElement::NumberInfo SVGStopElement::sNumberInfo = {nsGkAtoms::offset, 0};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
|
Загрузка…
Ссылка в новой задаче