Bug 948265 - Remove deprecated filterRes attribute from SVG filters. r=roc

This commit is contained in:
Max Vujovic 2014-02-28 16:40:14 -05:00
Родитель 4ea33adaa9
Коммит 5292d9035a
30 изменённых файлов: 36 добавлений и 338 удалений

Просмотреть файл

@ -1275,7 +1275,6 @@ GK_ATOM(fill, "fill")
GK_ATOM(fill_opacity, "fill-opacity")
GK_ATOM(fill_rule, "fill-rule")
GK_ATOM(filter, "filter")
GK_ATOM(filterRes, "filterRes")
GK_ATOM(filterUnits, "filterUnits")
GK_ATOM(flood_color, "flood-color")
GK_ATOM(flood_opacity, "flood-opacity")

Просмотреть файл

@ -416,7 +416,6 @@ nsIAtom** const kAttributesSVG[] = {
&nsGkAtoms::fill_opacity, // fill-opacity
&nsGkAtoms::fill_rule, // fill-rule
&nsGkAtoms::filter, // filter
&nsGkAtoms::filterRes, // filterRes
&nsGkAtoms::filterUnits, // filterUnits
&nsGkAtoms::flood_color, // flood-color
&nsGkAtoms::flood_opacity, // flood-opacity

Просмотреть файл

@ -30,11 +30,6 @@ nsSVGElement::LengthInfo SVGFilterElement::sLengthInfo[4] =
{ &nsGkAtoms::height, 120, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::Y },
};
nsSVGElement::IntegerPairInfo SVGFilterElement::sIntegerPairInfo[1] =
{
{ &nsGkAtoms::filterRes, 0 }
};
nsSVGElement::EnumInfo SVGFilterElement::sEnumInfo[2] =
{
{ &nsGkAtoms::filterUnits,
@ -105,26 +100,6 @@ SVGFilterElement::PrimitiveUnits()
return mEnumAttributes[PRIMITIVEUNITS].ToDOMAnimatedEnum(this);
}
already_AddRefed<SVGAnimatedInteger>
SVGFilterElement::FilterResX()
{
return mIntegerPairAttributes[FILTERRES].ToDOMAnimatedInteger(nsSVGIntegerPair::eFirst,
this);
}
already_AddRefed<SVGAnimatedInteger>
SVGFilterElement::FilterResY()
{
return mIntegerPairAttributes[FILTERRES].ToDOMAnimatedInteger(nsSVGIntegerPair::eSecond,
this);
}
void
SVGFilterElement::SetFilterRes(uint32_t filterResX, uint32_t filterResY)
{
mIntegerPairAttributes[FILTERRES].SetBaseValues(filterResX, filterResY, this);
}
already_AddRefed<SVGAnimatedString>
SVGFilterElement::Href()
{
@ -186,13 +161,6 @@ SVGFilterElement::GetLengthInfo()
ArrayLength(sLengthInfo));
}
nsSVGElement::IntegerPairAttributesInfo
SVGFilterElement::GetIntegerPairInfo()
{
return IntegerPairAttributesInfo(mIntegerPairAttributes, sIntegerPairInfo,
ArrayLength(sIntegerPairInfo));
}
nsSVGElement::EnumAttributesInfo
SVGFilterElement::GetEnumInfo()
{

Просмотреть файл

@ -54,15 +54,11 @@ public:
already_AddRefed<SVGAnimatedLength> Height();
already_AddRefed<SVGAnimatedEnumeration> FilterUnits();
already_AddRefed<SVGAnimatedEnumeration> PrimitiveUnits();
already_AddRefed<SVGAnimatedInteger> FilterResX();
already_AddRefed<SVGAnimatedInteger> FilterResY();
void SetFilterRes(uint32_t filterResX, uint32_t filterResY);
already_AddRefed<SVGAnimatedString> Href();
protected:
virtual LengthAttributesInfo GetLengthInfo() MOZ_OVERRIDE;
virtual IntegerPairAttributesInfo GetIntegerPairInfo() MOZ_OVERRIDE;
virtual EnumAttributesInfo GetEnumInfo() MOZ_OVERRIDE;
virtual StringAttributesInfo GetStringInfo() MOZ_OVERRIDE;
@ -70,10 +66,6 @@ protected:
nsSVGLength2 mLengthAttributes[4];
static LengthInfo sLengthInfo[4];
enum { FILTERRES };
nsSVGIntegerPair mIntegerPairAttributes[1];
static IntegerPairInfo sIntegerPairInfo[1];
enum { FILTERUNITS, PRIMITIVEUNITS };
nsSVGEnum mEnumAttributes[2];
static EnumInfo sEnumInfo[2];

Просмотреть файл

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" width="750">
<defs>
<!-- <integer-optional-integer> (filterRes) -->
<filter id="filter">
<!-- <boolean> (preserveAlpha) -->
<!-- <enum> (edgeMode) -->

До

Ширина:  |  Высота:  |  Размер: 646 B

После

Ширина:  |  Высота:  |  Размер: 594 B

Просмотреть файл

@ -122,56 +122,6 @@ function runTests()
convolve.removeAttribute("targetX");
ok(convolve.getAttribute("targetX") === null, "removed integer attribute");
// integer-optional-integer attribute
filter.setAttribute("filterRes", "100");
is(filter.filterResX.baseVal, 100, "integer-optional-integer first baseVal");
is(filter.filterResX.animVal, 100, "integer-optional-integer first animVal");
is(filter.filterResY.baseVal, 100, "integer-optional-integer second baseVal");
is(filter.filterResY.animVal, 100, "integer-optional-integer second animVal");
filter.filterResX.baseVal = 50;
is(filter.filterResX.animVal, 50, "integer-optional-integer first animVal");
is(filter.filterResY.animVal, 100, "integer-optional-integer second animVal");
is(filter.getAttribute("filterRes"), "50, 100", "integer-optional-integer attribute");
filter.filterResY.baseVal = 50;
is(filter.getAttribute("filterRes"), "50", "integer-optional-integer attribute");
filter.setFilterRes(80, 90);
is(filter.filterResX.baseVal, 80, "integer-optional-integer first baseVal");
is(filter.filterResX.animVal, 80, "integer-optional-integer first animVal");
is(filter.filterResY.baseVal, 90, "integer-optional-integer second baseVal");
is(filter.filterResY.animVal, 90, "integer-optional-integer second animVal");
// 32 bit integer range
filter.setFilterRes(-2147483648, 2147483647);
is(filter.filterResX.baseVal, -2147483648, "integer-optional-integer first baseVal");
is(filter.filterResX.animVal, -2147483648, "integer-optional-integer first animVal");
is(filter.filterResY.baseVal, 2147483647, "integer-optional-integer second baseVal");
is(filter.filterResY.animVal, 2147483647, "integer-optional-integer second animVal");
// too big, clamp
filter.setAttribute("filterRes", "-2147483649, 2147483648");
is(filter.filterResX.baseVal, -2147483648, "integer-optional-integer first baseVal");
is(filter.filterResX.animVal, -2147483648, "integer-optional-integer first animVal");
is(filter.filterResY.baseVal, 2147483647, "integer-optional-integer second baseVal");
is(filter.filterResY.animVal, 2147483647, "integer-optional-integer second animVal");
// invalid
filter.setAttribute("filterRes", "-00000000000invalid, 214748364720invalid");
is(filter.filterResX.baseVal, 0, "integer-optional-integer first baseVal");
is(filter.filterResX.animVal, 0, "integer-optional-integer first animVal");
is(filter.filterResY.baseVal, 0, "integer-optional-integer second baseVal");
is(filter.filterResY.animVal, 0, "integer-optional-integer second animVal");
filter.setAttribute("filterRes", "");
ok(filter.getAttribute("filterRes") === "",
"empty integer-optional-integer attribute");
filter.removeAttribute("filterRes");
ok(filter.getAttribute("filterRes") === null,
"removed integer-optional-integer attribute");
// angle attribute
marker.setAttribute("orient", "90deg");

Просмотреть файл

@ -127,21 +127,6 @@ function runTests()
convolve.setAttribute("targetX", "8");
convolve.targetX.baseVal = 8;
// integer-optional-integer attribute
eventChecker.watchAttr(filter, "filterRes");
eventChecker.expect("add modify remove add");
filter.setAttribute("filterRes", "60, 70");
filter.filterResX.baseVal = 50;
filter.removeAttribute("filterRes");
filter.removeAttributeNS(null, "filterRes");
filter.setAttribute("filterRes", "50, 60");
eventChecker.expect("");
filter.filterResX.baseVal = 50;
filter.setAttribute("filterRes", "50, 60");
filter.filterResY.baseVal = 60;
// angle attribute
eventChecker.watchAttr(marker, "orient");

Просмотреть файл

@ -17,10 +17,7 @@ interface SVGFilterElement : SVGElement {
readonly attribute SVGAnimatedLength y;
readonly attribute SVGAnimatedLength width;
readonly attribute SVGAnimatedLength height;
readonly attribute SVGAnimatedInteger filterResX;
readonly attribute SVGAnimatedInteger filterResY;
void setFilterRes(unsigned long filterResX, unsigned long filterResY);
// ImageData apply(ImageData source);
};

Просмотреть файл

@ -5,10 +5,10 @@
<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'>
<!--
A basic test for the <feDiffuseLighting> filter primitive.
Setting filterRes on the <filter> and kernelUnitLength on the
<feDiffuseLighting> should allow us to assume pixel perfection.
Setting kernelUnitLength on the <feDiffuseLighting> should allow us to
assume pixel perfection.
-->
<filter id='f' x='0' y='0' width='1' height='1' filterRes='100 100'>
<filter id='f' x='0' y='0' width='1' height='1'>
<feDiffuseLighting kernelUnitLength='1'>
<feDistantLight/>
</feDiffuseLighting>

До

Ширина:  |  Высота:  |  Размер: 660 B

После

Ширина:  |  Высота:  |  Размер: 610 B

Просмотреть файл

@ -5,7 +5,7 @@
<svg xmlns="http://www.w3.org/2000/svg">
<title>Test that directionless filter primitive attributes are resolved to user units correctly</title>
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=619967 -->
<filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="400" height="200" filterRes="400 100" color-interpolation-filters="sRGB">
<filter id="f" filterUnits="userSpaceOnUse" x="0" y="0" width="400" height="200" color-interpolation-filters="sRGB">
<feFlood flood-color="#800" result="map"/>
<feDisplacementMap in="SourceGraphic" in2="map" xChannelSelector="R" yChannelSelector="G" scale="100"/>
</filter>

До

Ширина:  |  Высота:  |  Размер: 805 B

После

Ширина:  |  Высота:  |  Размер: 785 B

Просмотреть файл

@ -1,19 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Reference for feDistantLight with filterRes larger than filter region</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=610466 -->
<defs>
<filter id="f" x="0" y="0" width="0.5" height="0.5" filterRes="50 50">
<feDiffuseLighting kernelUnitLength="1" lighting-color="lime">
<feDistantLight elevation="100"/>
</feDiffuseLighting>
</filter>
</defs>
<svg clip="rect(1px 48px 48px 1px)">
<path d="M0,0 h100 v100 h-100 z" filter="url(#f)"/>
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 672 B

Просмотреть файл

@ -1,19 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Testcase for feDistantLight with filterRes larger than filter region</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=610466 -->
<defs>
<filter id="f" x="0" y="0" width="0.5" height="0.5" filterRes="60 60">
<feDiffuseLighting kernelUnitLength="1" lighting-color="lime">
<feDistantLight elevation="100"/>
</feDiffuseLighting>
</filter>
</defs>
<svg clip="rect(1px 48px 48px 1px)">
<path d="M0,0 h100 v100 h-100 z" filter="url(#f)"/>
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 671 B

Просмотреть файл

@ -5,10 +5,10 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<!--
A basic test for the <feSpecularLighting> filter primitive.
Setting filterRes on the <filter> and kernelUnitLength on the
<feSpecularLighting> should allow us to assume pixel perfection.
Setting kernelUnitLength on the <feSpecularLighting> should allow us to
assume pixel perfection.
-->
<filter id='f' x='0' y='0' width='1' height='1' filterRes='100 100' color-interpolation-filters='sRGB'>
<filter id='f' x='0' y='0' width='1' height='1' color-interpolation-filters='sRGB'>
<feSpecularLighting kernelUnitLength='1' result='a'>
<feDistantLight azimuth='45'/>
</feSpecularLighting>

До

Ширина:  |  Высота:  |  Размер: 1.1 KiB

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -1,20 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.0">
<desc>
This test checks that the implicit offscreen surface scaling implied by
a high 'filterRes' interacts correctly with other transforms. Specifically
you should see no red if the red filtered circle paints only on the pixels
that it should paint on.
</desc>
<filter id="filter" x="0" y="0" width="1" height="1" filterRes="1000 1000">
<feGaussianBlur stdDeviation="0.001"/>
</filter>
<rect width="100%" height="100%" fill="lime"/>
<g transform="translate(50, 0)">
<circle fill="red" cx="100" cy="100" r="98" transform="translate(50, 0)" filter="url(#filter)"/>
</g>
<circle fill="lime" cx="200" cy="100" r="100"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 837 B

Просмотреть файл

@ -1,20 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.0">
<desc>
This test checks that the implicit offscreen surface scaling implied by
a high 'filterRes' interacts correctly with other transforms. Specifically
you should see no red if the lime filtered circle paints on all the pixels
that it should paint on.
</desc>
<filter id="filter" x="0" y="0" width="1" height="1" filterRes="1000 1000">
<feGaussianBlur stdDeviation="0.001"/>
</filter>
<rect width="100%" height="100%" fill="lime"/>
<circle fill="red" cx="200" cy="100" r="98"/>
<g transform="translate(50, 0)">
<circle fill="lime" cx="100" cy="100" r="100" transform="translate(50, 0)" filter="url(#filter)"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 837 B

Просмотреть файл

@ -1,22 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.0">
<desc>
This test checks that the implicit offscreen surface scaling implied by
a high 'filterRes' interacts correctly with other transforms. Specifically
you should see only green if the red filtered circle paints only on
the pixels that it should paint on.
</desc>
<filter id="filter" x="0" y="0" width="1" height="1" filterRes="50 50">
<feGaussianBlur stdDeviation="0.001"/>
</filter>
<rect width="100%" height="100%" fill="lime"/>
<g transform="translate(50, 0)">
<!-- The filterRes is quartered, so we need r to be 5 pixels less, plus
one less for antialiasing, otherwise the circle will get fringe effects. -->
<circle fill="red" cx="100" cy="100" r="94" transform="translate(50, 0)" filter="url(#filter)"/>
</g>
<circle fill="lime" cx="200" cy="100" r="100"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 999 B

Просмотреть файл

@ -51,9 +51,6 @@ fuzzy(1,6400) == feGaussianBlur-1.svg feGaussianBlur-1-ref.svg
# no tests for feTurbulence
== filter-clipped-rect-01.svg pass.svg
== filter-filterRes-high-01.svg pass.svg
== filter-filterRes-high-02.svg pass.svg
random-if(d2d) == filter-filterRes-low-01.svg pass.svg
== filter-inner-svg-01.svg pass.svg
== filter-inner-svg-02.svg pass.svg
== filter-inner-svg-03.svg pass.svg
@ -85,8 +82,6 @@ fuzzy(1,10000) == feConvolveMatrix-bias-01.svg feConvolveMatrix-bias-01-ref.svg
fuzzy(2,500) == feDisplacementMap-colour-01.svg feDisplacementMap-colour-01-ref.svg
skip-if(B2G) == feDisplacementMap-scale-01.svg pass.svg
skip-if(B2G) fuzzy-if(cocoaWidget,4,184) == feDistantLight-filterRes-01.svg feDistantLight-filterRes-01-ref.svg
== feDropShadow-01.svg feDropShadow-01-ref.svg
== feGaussianBlur-alpha-01.svg feGaussianBlur-alpha-01-ref.svg

Просмотреть файл

@ -8,7 +8,7 @@
onload="setTimeAndSnapshot(1.9999, true)">
<title>Test animation of the "stdDeviation" &lt;number-optional-number&gt; attribute on "feGaussianBlur" elements</title>
<script xlink:href="smil-util.js" type="text/javascript"/>
<filter id="filter" x="0" y="0" width="1" height="1" filterRes="1000">
<filter id="filter" x="0" y="0" width="1" height="1">
<feGaussianBlur stdDeviation="50">
<animate attributeName="stdDeviation"
calcMode="linear"

До

Ширина:  |  Высота:  |  Размер: 1.0 KiB

После

Ширина:  |  Высота:  |  Размер: 1023 B

Просмотреть файл

@ -1,24 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait"
onload="setTimeAndSnapshot(101, true)">
<title>Test animation of the "filterRes" &lt;integer-optional-integer&gt; attribute on "filter" elements</title>
<script xlink:href="smil-util.js" type="text/javascript"/>
<filter id="filter" x="0" y="0" width="1" height="1" filterRes="10 10">
<animate attributeName="filterRes"
calcMode="linear"
begin="100s" dur="2s"
from="0" to="2000 2000"
fill="freeze"/>
<feGaussianBlur stdDeviation="0.001"/>
</filter>
<rect width="100%" height="100%" fill="lime"/>
<g transform="translate(50, 0)">
<circle fill="red" cx="100" cy="100" r="98" transform="translate(50, 0)" filter="url(#filter)"/>
</g>
<circle fill="lime" cx="200" cy="100" r="100"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1002 B

Просмотреть файл

@ -115,9 +115,6 @@ skip-if(B2G) == anim-offset-01.svg lime.svg # bug 773482
# animate some <integer> attributes:
skip-if(B2G) == anim-feTurbulence-numOctaves-01.svg anim-feTurbulence-numOctaves-01-ref.svg # bug 773482
# animate some <integer-optional-integer> attributes:
skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == anim-filter-filterRes-01.svg lime.svg # bug 818177
# animate some <angle> attributes:
skip-if(B2G) == anim-marker-orient-01.svg lime.svg # bug 773482
skip-if(B2G) == anim-marker-orient-02.svg lime.svg # bug 773482

Просмотреть файл

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg">
<filter id="f" height="-1" filterRes="1"/>
<filter id="f" height="-1"/>
<rect filter="url(#f)" />

До

Ширина:  |  Высота:  |  Размер: 124 B

После

Ширина:  |  Высота:  |  Размер: 110 B

Просмотреть файл

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg"><filter id="f1" filterRes="10 20" height="-2"/><rect width="50" height="100" filter="url(#f1)"/></svg>
<svg xmlns="http://www.w3.org/2000/svg"><filter id="f1" height="-2"/><rect width="50" height="100" filter="url(#f1)"/></svg>

До

Ширина:  |  Высота:  |  Размер: 143 B

После

Ширина:  |  Высота:  |  Размер: 125 B

Просмотреть файл

@ -67,22 +67,6 @@ nsSVGFilterFrame::GetEnumValue(uint32_t aIndex, nsIContent *aDefault)
mEnumAttributes[aIndex].GetAnimValue();
}
const nsSVGIntegerPair *
nsSVGFilterFrame::GetIntegerPairValue(uint32_t aIndex, nsIContent *aDefault)
{
const nsSVGIntegerPair *thisIntegerPair =
&static_cast<SVGFilterElement *>(mContent)->mIntegerPairAttributes[aIndex];
if (thisIntegerPair->IsExplicitlySet())
return thisIntegerPair;
AutoFilterReferencer filterRef(this);
nsSVGFilterFrame *next = GetReferencedFilterIfNotInUse();
return next ? next->GetIntegerPairValue(aIndex, aDefault) :
&static_cast<SVGFilterElement *>(aDefault)->mIntegerPairAttributes[aIndex];
}
const nsSVGLength2 *
nsSVGFilterFrame::GetLengthValue(uint32_t aIndex, nsIContent *aDefault)
{
@ -187,7 +171,6 @@ nsSVGFilterFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::y ||
aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height ||
aAttribute == nsGkAtoms::filterRes ||
aAttribute == nsGkAtoms::filterUnits ||
aAttribute == nsGkAtoms::primitiveUnits)) {
nsSVGEffects::InvalidateDirectRenderingObservers(this);

Просмотреть файл

@ -85,11 +85,6 @@ private:
{
return GetEnumValue(aIndex, mContent);
}
const nsSVGIntegerPair *GetIntegerPairValue(uint32_t aIndex, nsIContent *aDefault);
const nsSVGIntegerPair *GetIntegerPairValue(uint32_t aIndex)
{
return GetIntegerPairValue(aIndex, mContent);
}
const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
{

Просмотреть файл

@ -52,9 +52,9 @@ nsSVGFilterInstance::nsSVGFilterInstance(const nsStyleFilter& aFilter,
// XXX if filterUnits is set (or has defaulted) to objectBoundingBox, we
// should send a warning to the error console if the author has used lengths
// with units. This is a common mistake and can result in filterRes being
// *massive* below (because we ignore the units and interpret the number as
// a factor of the bbox width/height). We should also send a warning if the
// with units. This is a common mistake and can result in the filter region
// being *massive* below (because we ignore the units and interpret the number
// as a factor of the bbox width/height). We should also send a warning if the
// user uses a number without units (a future SVG spec should really
// deprecate that, since it's too confusing for a bare number to be sometimes
// interpreted as a fraction of the bounding box and sometimes as user-space
@ -81,56 +81,31 @@ nsSVGFilterInstance::nsSVGFilterInstance(const nsStyleFilter& aFilter,
return;
}
// Calculate filterRes (the width and height of the pixel buffer of the
// Calculate the width and height of the pixel buffer of the
// temporary offscreen surface that we would/will create to paint into when
// painting the entire filtered element) and, if necessary, adjust
// painting the entire filtered element and, if necessary, adjust
// mFilterRegion out slightly so that it aligns with pixel boundaries of this
// buffer:
gfxIntSize filterRes;
const nsSVGIntegerPair* filterResAttrs =
mFilterFrame->GetIntegerPairValue(SVGFilterElement::FILTERRES);
if (filterResAttrs->IsExplicitlySet()) {
int32_t filterResX = filterResAttrs->GetAnimValue(nsSVGIntegerPair::eFirst);
int32_t filterResY = filterResAttrs->GetAnimValue(nsSVGIntegerPair::eSecond);
if (filterResX <= 0 || filterResY <= 0) {
// 0 disables rendering, < 0 is error. dispatch error console warning?
return;
}
mFilterRegion.Scale(filterResX, filterResY);
mFilterRegion.RoundOut();
mFilterRegion.Scale(1.0 / filterResX, 1.0 / filterResY);
// We don't care if this overflows, because we can handle upscaling/
// downscaling to filterRes
bool overflow;
filterRes =
nsSVGUtils::ConvertToSurfaceSize(gfxSize(filterResX, filterResY),
&overflow);
// XXX we could send a warning to the error console if the author specified
// filterRes doesn't align well with our outer 'svg' device space.
} else {
// Match filterRes as closely as possible to the pixel density of the nearest
// outer 'svg' device space:
gfxMatrix canvasTM =
nsSVGUtils::GetCanvasTM(mTargetFrame, nsISVGChildFrame::FOR_OUTERSVG_TM);
if (canvasTM.IsSingular()) {
// nothing to draw
return;
}
gfxSize scale = canvasTM.ScaleFactors(true);
mFilterRegion.Scale(scale.width, scale.height);
mFilterRegion.RoundOut();
// We don't care if this overflows, because we can handle upscaling/
// downscaling to filterRes
bool overflow;
filterRes = nsSVGUtils::ConvertToSurfaceSize(mFilterRegion.Size(),
&overflow);
mFilterRegion.Scale(1.0 / scale.width, 1.0 / scale.height);
// Match filter space as closely as possible to the pixel density of the
// nearest outer 'svg' device space:
gfxMatrix canvasTM =
nsSVGUtils::GetCanvasTM(mTargetFrame, nsISVGChildFrame::FOR_OUTERSVG_TM);
if (canvasTM.IsSingular()) {
// nothing to draw
return;
}
mFilterSpaceBounds.SetRect(nsIntPoint(0, 0), filterRes);
gfxSize scale = canvasTM.ScaleFactors(true);
mFilterRegion.Scale(scale.width, scale.height);
mFilterRegion.RoundOut();
// We don't care if this overflows, because we can handle upscaling/
// downscaling to filter space.
bool overflow;
mFilterSpaceBounds.SetRect(nsIntPoint(0, 0),
nsSVGUtils::ConvertToSurfaceSize(mFilterRegion.Size(), &overflow));
mFilterRegion.Scale(1.0 / scale.width, 1.0 / scale.height);
mInitialized = true;
}

Просмотреть файл

@ -74,9 +74,6 @@ public:
/**
* Returns the size of the user specified "filter region", in filter space.
* The size will be {filterRes.x by filterRes.y}, whether the user specified
* the filter's filterRes attribute explicitly, or the implementation chose
* the filterRes values.
*/
nsIntRect GetFilterSpaceBounds() const { return mFilterSpaceBounds; }

Просмотреть файл

@ -1008,7 +1008,6 @@ public final class AttributeName
public static final AttributeName ELEVATION = new AttributeName(ALL_NO_NS, SAME_LOCAL("elevation"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName DIRECTION = new AttributeName(ALL_NO_NS, SAME_LOCAL("direction"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName DRAGGABLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("draggable"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName FILTERRES = new AttributeName(ALL_NO_NS, SVG_DIFFERENT("filterres", "filterRes"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName FILL_RULE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fill-rule"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName FONTSTYLE = new AttributeName(ALL_NO_NS, SAME_LOCAL("fontstyle"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
public static final AttributeName FONT_SIZE = new AttributeName(ALL_NO_NS, SAME_LOCAL("font-size"), ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
@ -1590,7 +1589,6 @@ public final class AttributeName
ELEVATION,
DIRECTION,
DRAGGABLE,
FILTERRES,
FILL_RULE,
FONTSTYLE,
FONT_SIZE,

Просмотреть файл

@ -358,8 +358,6 @@ HTML5_ATOM(equalrows, "equalrows")
HTML5_ATOM(elevation, "elevation")
HTML5_ATOM(direction, "direction")
HTML5_ATOM(draggable, "draggable")
HTML5_ATOM(filterres, "filterres")
HTML5_ATOM(filterRes, "filterRes")
HTML5_ATOM(fill_rule, "fill-rule")
HTML5_ATOM(fontstyle, "fontstyle")
HTML5_ATOM(font_size, "font-size")

Просмотреть файл

@ -1104,7 +1104,6 @@ nsHtml5AttributeName::initializeStatics()
ATTR_ELEVATION = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::elevation), ALL_NO_PREFIX);
ATTR_DIRECTION = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::direction), ALL_NO_PREFIX);
ATTR_DRAGGABLE = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::draggable), ALL_NO_PREFIX);
ATTR_FILTERRES = new nsHtml5AttributeName(ALL_NO_NS, SVG_DIFFERENT(nsHtml5Atoms::filterres, nsHtml5Atoms::filterRes), ALL_NO_PREFIX);
ATTR_FILL_RULE = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::fill_rule), ALL_NO_PREFIX);
ATTR_FONTSTYLE = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::fontstyle), ALL_NO_PREFIX);
ATTR_FONT_SIZE = new nsHtml5AttributeName(ALL_NO_NS, SAME_LOCAL(nsHtml5Atoms::font_size), ALL_NO_PREFIX);

Просмотреть файл

@ -1,5 +1,5 @@
#data
<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>
<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>
#errors
#document
| <!DOCTYPE html>
@ -18,7 +18,6 @@
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
@ -71,7 +70,7 @@
| zoomAndPan=""
#data
<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' DIFFUSECONSTANT='' EDGEMODE='' EXTERNALRESOURCESREQUIRED='' FILTERRES='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>
<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' DIFFUSECONSTANT='' EDGEMODE='' EXTERNALRESOURCESREQUIRED='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>
#errors
#document
| <!DOCTYPE html>
@ -90,7 +89,6 @@
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
@ -143,7 +141,7 @@
| zoomAndPan=""
#data
<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' contentscripttype='' contentstyletype='' diffuseconstant='' edgemode='' externalresourcesrequired='' filterres='' filterunits='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>
<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' contentscripttype='' contentstyletype='' diffuseconstant='' edgemode='' externalresourcesrequired='' filterunits='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>
#errors
#document
| <!DOCTYPE html>
@ -162,7 +160,6 @@
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
@ -215,7 +212,7 @@
| zoomAndPan=""
#data
<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>
<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>
#errors
#document
| <!DOCTYPE html>
@ -234,7 +231,6 @@
| diffuseconstant=""
| edgemode=""
| externalresourcesrequired=""
| filterres=""
| filterunits=""
| glyphref=""
| gradienttransform=""