diff --git a/browser/base/content/test/general/browser_bug329212.js b/browser/base/content/test/general/browser_bug1230267.js copy from browser/base/content/test/general/browser_bug329212.js copy to browser/base/content/test/general/browser_bug1230267.js diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -1410,16 +1410,17 @@ GK_ATOM(font_face_uri, "font-face-uri") GK_ATOM(font_family, "font-family") GK_ATOM(font_size, "font-size") GK_ATOM(font_size_adjust, "font-size-adjust") GK_ATOM(font_stretch, "font-stretch") GK_ATOM(font_style, "font-style") GK_ATOM(font_variant, "font-variant") GK_ATOM(foreignObject, "foreignObject") GK_ATOM(fractalNoise, "fractalNoise") +GK_ATOM(fr, "fr") GK_ATOM(fx, "fx") GK_ATOM(fy, "fy") GK_ATOM(G, "G") GK_ATOM(g, "g") GK_ATOM(gamma, "gamma") // 'generic' conflicts with msvc11 winrt compiler extensions GK_ATOM(generic_, "generic") GK_ATOM(glyph, "glyph") diff --git a/dom/svg/SVGGradientElement.cpp b/dom/svg/SVGGradientElement.cpp --- a/dom/svg/SVGGradientElement.cpp +++ b/dom/svg/SVGGradientElement.cpp @@ -190,23 +190,24 @@ SVGLinearGradientElement::GetLengthInfo( //-------------------------- Radial Gradients ---------------------------- JSObject* SVGRadialGradientElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { return SVGRadialGradientElementBinding::Wrap(aCx, this, aGivenProto); } -nsSVGElement::LengthInfo SVGRadialGradientElement::sLengthInfo[5] = +nsSVGElement::LengthInfo SVGRadialGradientElement::sLengthInfo[6] = { { &nsGkAtoms::cx, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X }, { &nsGkAtoms::cy, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::Y }, { &nsGkAtoms::r, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::XY }, { &nsGkAtoms::fx, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X }, { &nsGkAtoms::fy, 50, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::Y }, + { &nsGkAtoms::fr, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::XY }, }; //---------------------------------------------------------------------- // Implementation SVGRadialGradientElement::SVGRadialGradientElement(already_AddRefed& aNodeInfo) : SVGRadialGradientElementBase(aNodeInfo) { @@ -244,16 +245,22 @@ SVGRadialGradientElement::Fx() } already_AddRefed SVGRadialGradientElement::Fy() { return mLengthAttributes[ATTR_FY].ToDOMAnimatedLength(this); } +already_AddRefed +SVGRadialGradientElement::Fr() +{ + return mLengthAttributes[ATTR_FR].ToDOMAnimatedLength(this); +} + //---------------------------------------------------------------------- // nsSVGElement methods nsSVGElement::LengthAttributesInfo SVGRadialGradientElement::GetLengthInfo() { return LengthAttributesInfo(mLengthAttributes, sLengthInfo, ArrayLength(sLengthInfo)); diff --git a/dom/svg/SVGGradientElement.h b/dom/svg/SVGGradientElement.h --- a/dom/svg/SVGGradientElement.h +++ b/dom/svg/SVGGradientElement.h @@ -133,21 +133,22 @@ public: virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; // WebIDL already_AddRefed Cx(); already_AddRefed Cy(); already_AddRefed R(); already_AddRefed Fx(); already_AddRefed Fy(); + already_AddRefed Fr(); protected: virtual LengthAttributesInfo GetLengthInfo() override; - enum { ATTR_CX, ATTR_CY, ATTR_R, ATTR_FX, ATTR_FY }; - nsSVGLength2 mLengthAttributes[5]; - static LengthInfo sLengthInfo[5]; + enum { ATTR_CX, ATTR_CY, ATTR_R, ATTR_FX, ATTR_FY, ATTR_FR }; + nsSVGLength2 mLengthAttributes[6]; + static LengthInfo sLengthInfo[6]; }; } // namespace dom } // namespace mozilla #endif diff --git a/dom/webidl/SVGRadialGradientElement.webidl b/dom/webidl/SVGRadialGradientElement.webidl --- a/dom/webidl/SVGRadialGradientElement.webidl +++ b/dom/webidl/SVGRadialGradientElement.webidl @@ -16,10 +16,11 @@ interface SVGRadialGradientElement : SVG [Constant] readonly attribute SVGAnimatedLength cy; [Constant] readonly attribute SVGAnimatedLength r; [Constant] readonly attribute SVGAnimatedLength fx; [Constant] readonly attribute SVGAnimatedLength fy; - // readonly attribute SVGAnimatedLength fr; + [Constant] + readonly attribute SVGAnimatedLength fr; }; diff --git a/layout/reftests/svg/gradient-fr-01.svg b/layout/reftests/svg/gradient-fr-01.svg new file mode 100644 --- /dev/null +++ b/layout/reftests/svg/gradient-fr-01.svg @@ -0,0 +1,17 @@ + + + Test gradient fr attribute + + + + + + + + + + + diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -179,16 +179,17 @@ fails-if(Android||B2G) pref(security.fil == foreignObject-style-change-01.svg pass.svg == foreignObject-dynamic-abspos-01.html foreignObject-dynamic-abspos-01-ref.html fuzzy-if(Android,18,600) == foreignObject-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html == foreignObject-fixedpos-02.html foreignObject-fixedpos-ref.html == foreignObject-dynamic-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html == foreignObject-vertical-01.svg foreignObject-vertical-01-ref.svg == g-transform-01.svg pass.svg == getElementById-a-element-01.svg pass.svg +== gradient-fr-01.svg pass.svg fuzzy-if(Android||B2G,9,980||Mulet,9,980) skip-if(Mulet) == gradient-live-01a.svg gradient-live-01-ref.svg # Initial mulet triage: parity with B2G/B2G Desktop # MULET: Bug 1144079: Re-enable Mulet mochitests and reftests taskcluster-specific disables fuzzy-if(Android||B2G,9,980||Mulet,9,980) skip-if(Mulet) == gradient-live-01b.svg gradient-live-01-ref.svg # Initial mulet triage: parity with B2G/B2G Desktop # MULET: Bug 1144079: Re-enable Mulet mochitests and reftests taskcluster-specific disables fuzzy-if(Android||B2G,9,980||Mulet,9,980) skip-if(Mulet) == gradient-live-01c.svg gradient-live-01-ref.svg # Initial mulet triage: parity with B2G/B2G Desktop # MULET: Bug 1144079: Re-enable Mulet mochitests and reftests taskcluster-specific disables fuzzy-if(Android||B2G,9,980||Mulet,9,980) skip-if(Mulet) == gradient-live-01d.svg gradient-live-01-ref.svg # Initial mulet triage: parity with B2G/B2G Desktop # MULET: Bug 1144079: Re-enable Mulet mochitests and reftests taskcluster-specific disables == gradient-transform-01.svg pass.svg == import-svg-01.html pass.svg == invalid-text-01.svg pass.svg == lang-attribute-01.svg pass.svg diff --git a/layout/svg/nsSVGGradientFrame.cpp b/layout/svg/nsSVGGradientFrame.cpp --- a/layout/svg/nsSVGGradientFrame.cpp +++ b/layout/svg/nsSVGGradientFrame.cpp @@ -609,24 +609,25 @@ bool nsSVGRadialGradientFrame::GradientVectorLengthIsZero() { return GetLengthValue(dom::SVGRadialGradientElement::ATTR_R) == 0; } already_AddRefed nsSVGRadialGradientFrame::CreateGradient() { - float cx, cy, r, fx, fy; + float cx, cy, r, fx, fy, fr; cx = GetLengthValue(dom::SVGRadialGradientElement::ATTR_CX); cy = GetLengthValue(dom::SVGRadialGradientElement::ATTR_CY); r = GetLengthValue(dom::SVGRadialGradientElement::ATTR_R); // If fx or fy are not set, use cx/cy instead fx = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FX, cx); fy = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FY, cy); + fr = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FR); if (fx != cx || fy != cy) { // The focal point (fFx and fFy) must be clamped to be *inside* - not on - // the circumference of the gradient or we'll get rendering anomalies. We // calculate the distance from the focal point to the gradient center and // make sure it is *less* than the gradient radius. // 1/128 is the limit of the fractional part of cairo's 24.8 fixed point // representation divided by 2 to ensure that we get different cairo @@ -637,17 +638,17 @@ nsSVGRadialGradientFrame::CreateGradient double d = sqrt((dx * dx) + (dy * dy)); if (d > dMax) { double angle = atan2(dy, dx); fx = (float)(dMax * cos(angle)) + cx; fy = (float)(dMax * sin(angle)) + cy; } } - RefPtr pattern = new gfxPattern(fx, fy, 0, cx, cy, r); + RefPtr pattern = new gfxPattern(fx, fy, fr, cx, cy, r); return pattern.forget(); } // ------------------------------------------------------------------------- // Public functions // ------------------------------------------------------------------------- nsIFrame* diff --git a/testing/web-platform/meta/svg/interfaces.html.ini b/testing/web-platform/meta/svg/interfaces.html.ini --- a/testing/web-platform/meta/svg/interfaces.html.ini +++ b/testing/web-platform/meta/svg/interfaces.html.ini @@ -1201,22 +1201,16 @@ expected: FAIL [SVGElement interface: linearGradient must inherit property "onsort" with the proper type (61)] expected: FAIL [SVGElement interface: linearGradient must inherit property "ontoggle" with the proper type (66)] expected: FAIL - [SVGRadialGradientElement interface: attribute fr] - expected: FAIL - - [SVGRadialGradientElement interface: radialGradient must inherit property "fr" with the proper type (5)] - expected: FAIL - [SVGElement interface: radialGradient must inherit property "tabIndex" with the proper type (3)] expected: FAIL [SVGElement interface: radialGradient must inherit property "focus" with the proper type (4)] expected: FAIL [SVGElement interface: radialGradient must inherit property "blur" with the proper type (5)] expected: FAIL