Bug 1280425 part 2: Remove code associated with now-unsupported "defer" in SVG. r=dholbert

MozReview-Commit-ID: 8Naxc84aAES

--HG--
extra : rebase_source : 78d34a35dde95c10923c2aaa4660e0ed58e402b4
This commit is contained in:
Fariskhi Vidyan 2016-06-30 17:28:56 -07:00
parent ccd59b67bf
commit 6a7ef6e422
5 changed files with 5 additions and 27 deletions

View File

@ -245,7 +245,6 @@ PackPreserveAspectRatio(const SVGPreserveAspectRatio& par)
// All preserveAspectRatio values are enum values (do not interpolate), so we
// can safely collate them and treat them as a single enum as for SMIL.
uint64_t packed = 0;
packed |= uint64_t(par.GetDefer() ? 1 : 0) << 16;
packed |= uint64_t(par.GetAlign()) << 8;
packed |= uint64_t(par.GetMeetOrSlice());
return packed;
@ -258,7 +257,6 @@ SVGAnimatedPreserveAspectRatio::SetAnimValue(uint64_t aPackedValue,
if (mIsAnimated && PackPreserveAspectRatio(mAnimVal) == aPackedValue) {
return;
}
mAnimVal.SetDefer(((aPackedValue & 0xff0000) >> 16) ? true : false);
mAnimVal.SetAlign(uint16_t((aPackedValue & 0xff00) >> 8));
mAnimVal.SetMeetOrSlice(uint16_t(aPackedValue & 0xff));
mIsAnimated = true;

View File

@ -28,7 +28,6 @@ public:
void Init() {
mBaseVal.mAlign = SVG_PRESERVEASPECTRATIO_XMIDYMID;
mBaseVal.mMeetOrSlice = SVG_MEETORSLICE_MEET;
mBaseVal.mDefer = false;
mAnimVal = mBaseVal;
mIsAnimated = false;
mIsBaseSet = false;
@ -46,8 +45,7 @@ public:
return NS_ERROR_FAILURE;
}
SetBaseValue(SVGPreserveAspectRatio(
static_cast<SVGAlign>(aAlign), mBaseVal.GetMeetOrSlice(),
mBaseVal.GetDefer()),
static_cast<SVGAlign>(aAlign), mBaseVal.GetMeetOrSlice()),
aSVGElement);
return NS_OK;
}
@ -57,8 +55,7 @@ public:
return NS_ERROR_FAILURE;
}
SetBaseValue(SVGPreserveAspectRatio(
mBaseVal.GetAlign(), static_cast<SVGMeetOrSlice>(aMeetOrSlice),
mBaseVal.GetDefer()),
mBaseVal.GetAlign(), static_cast<SVGMeetOrSlice>(aMeetOrSlice)),
aSVGElement);
return NS_OK;
}

View File

@ -25,8 +25,7 @@ bool
SVGPreserveAspectRatio::operator==(const SVGPreserveAspectRatio& aOther) const
{
return mAlign == aOther.mAlign &&
mMeetOrSlice == aOther.mMeetOrSlice &&
mDefer == aOther.mDefer;
mMeetOrSlice == aOther.mMeetOrSlice;
}
JSObject*

View File

@ -53,11 +53,9 @@ class SVGPreserveAspectRatio final
{
friend class SVGAnimatedPreserveAspectRatio;
public:
SVGPreserveAspectRatio(SVGAlign aAlign, SVGMeetOrSlice aMeetOrSlice,
bool aDefer = false)
SVGPreserveAspectRatio(SVGAlign aAlign, SVGMeetOrSlice aMeetOrSlice)
: mAlign(aAlign)
, mMeetOrSlice(aMeetOrSlice)
, mDefer(aDefer)
{}
bool operator==(const SVGPreserveAspectRatio& aOther) const;
@ -65,7 +63,6 @@ public:
explicit SVGPreserveAspectRatio()
: mAlign(SVG_PRESERVEASPECTRATIO_UNKNOWN)
, mMeetOrSlice(SVG_MEETORSLICE_UNKNOWN)
, mDefer(false)
{}
nsresult SetAlign(uint16_t aAlign) {
@ -91,23 +88,14 @@ public:
return static_cast<SVGMeetOrSlice>(mMeetOrSlice);
}
void SetDefer(bool aDefer) {
mDefer = aDefer;
}
bool GetDefer() const {
return mDefer;
}
uint32_t Hash() const {
return HashGeneric(mAlign, mMeetOrSlice, mDefer);
return HashGeneric(mAlign, mMeetOrSlice);
}
private:
// We can't use enum types here because some compilers fail to pack them.
uint8_t mAlign;
uint8_t mMeetOrSlice;
bool mDefer;
};
namespace dom {

View File

@ -1117,10 +1117,6 @@ SVGSVGElement::
return; // preserveAspectRatio irrelevant (only matters if we have viewBox)
}
if (aPAR.GetDefer() && HasPreserveAspectRatio()) {
return; // Referring element defers to my own preserveAspectRatio value.
}
if (SetPreserveAspectRatioProperty(aPAR)) {
mImageNeedsTransformInvalidation = true;
}