зеркало из https://github.com/mozilla/pjs.git
Bug 326143 - floodColor and floodOpacity should be non-inherited
properties. r=dbaron
This commit is contained in:
Родитель
15a6ad694c
Коммит
8f7f4c6526
|
@ -2603,8 +2603,8 @@ nsSVGFEFloodElement::Filter(nsSVGFilterInstance *instance)
|
||||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
|
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
|
||||||
nsStyleContext* style = frame->GetStyleContext();
|
nsStyleContext* style = frame->GetStyleContext();
|
||||||
|
|
||||||
nscolor floodColor = style->GetStyleSVG()->mFloodColor;
|
nscolor floodColor = style->GetStyleSVGReset()->mFloodColor;
|
||||||
float floodOpacity = style->GetStyleSVG()->mFloodOpacity;
|
float floodOpacity = style->GetStyleSVGReset()->mFloodOpacity;
|
||||||
PRUint8 r, g, b, a;
|
PRUint8 r, g, b, a;
|
||||||
a = PRUint8(floodOpacity * 255);
|
a = PRUint8(floodOpacity * 255);
|
||||||
r = (PRUint32(NS_GET_R(floodColor)) * a) / 255;
|
r = (PRUint32(NS_GET_R(floodColor)) * a) / 255;
|
||||||
|
|
|
@ -476,8 +476,8 @@ CSS_PROP_SVG(fill, fill, Fill, SVG, mFill, eCSSType_ValuePair, nsnull)
|
||||||
CSS_PROP_SVG(fill-opacity, fill_opacity, FillOpacity, SVG, mFillOpacity, eCSSType_Value, nsnull)
|
CSS_PROP_SVG(fill-opacity, fill_opacity, FillOpacity, SVG, mFillOpacity, eCSSType_Value, nsnull)
|
||||||
CSS_PROP_SVG(fill-rule, fill_rule, FillRule, SVG, mFillRule, eCSSType_Value, kFillRuleKTable)
|
CSS_PROP_SVG(fill-rule, fill_rule, FillRule, SVG, mFillRule, eCSSType_Value, kFillRuleKTable)
|
||||||
CSS_PROP_SVGRESET(filter, filter, Filter, SVG, mFilter, eCSSType_Value, nsnull)
|
CSS_PROP_SVGRESET(filter, filter, Filter, SVG, mFilter, eCSSType_Value, nsnull)
|
||||||
CSS_PROP_SVG(flood-color, flood_color, FloodColor, SVG, mFloodColor, eCSSType_Value, nsnull)
|
CSS_PROP_SVGRESET(flood-color, flood_color, FloodColor, SVG, mFloodColor, eCSSType_Value, nsnull)
|
||||||
CSS_PROP_SVG(flood-opacity, flood_opacity, FloodOpacity, SVG, mFloodOpacity, eCSSType_Value, nsnull)
|
CSS_PROP_SVGRESET(flood-opacity, flood_opacity, FloodOpacity, SVG, mFloodOpacity, eCSSType_Value, nsnull)
|
||||||
CSS_PROP_SHORTHAND(marker, marker, Marker)
|
CSS_PROP_SHORTHAND(marker, marker, Marker)
|
||||||
CSS_PROP_SVG(marker-end, marker_end, MarkerEnd, SVG, mMarkerEnd, eCSSType_Value, nsnull)
|
CSS_PROP_SVG(marker-end, marker_end, MarkerEnd, SVG, mMarkerEnd, eCSSType_Value, nsnull)
|
||||||
CSS_PROP_SVG(marker-mid, marker_mid, MarkerMid, SVG, mMarkerMid, eCSSType_Value, nsnull)
|
CSS_PROP_SVG(marker-mid, marker_mid, MarkerMid, SVG, mMarkerMid, eCSSType_Value, nsnull)
|
||||||
|
|
|
@ -4079,14 +4079,6 @@ nsRuleNode::ComputeSVGData(nsStyleStruct* aStartStruct,
|
||||||
svg->mFillRule = parentSVG->mFillRule;
|
svg->mFillRule = parentSVG->mFillRule;
|
||||||
}
|
}
|
||||||
|
|
||||||
// flood-color:
|
|
||||||
SetColor(SVGData.mFloodColor, parentSVG->mFloodColor,
|
|
||||||
mPresContext, aContext, svg->mFloodColor, inherited);
|
|
||||||
|
|
||||||
// flood-opacity:
|
|
||||||
SetSVGOpacity(SVGData.mFloodOpacity, parentSVG->mFloodOpacity,
|
|
||||||
svg->mFloodOpacity, inherited);
|
|
||||||
|
|
||||||
// marker-end: url, none, inherit
|
// marker-end: url, none, inherit
|
||||||
if (eCSSUnit_URL == SVGData.mMarkerEnd.GetUnit()) {
|
if (eCSSUnit_URL == SVGData.mMarkerEnd.GetUnit()) {
|
||||||
svg->mMarkerEnd = SVGData.mMarkerEnd.GetURLValue();
|
svg->mMarkerEnd = SVGData.mMarkerEnd.GetURLValue();
|
||||||
|
@ -4269,8 +4261,13 @@ nsRuleNode::ComputeSVGResetData(nsStyleStruct* aStartStruct,
|
||||||
{
|
{
|
||||||
COMPUTE_START_RESET(SVGReset, (), svgReset, parentSVGReset, SVG, SVGData)
|
COMPUTE_START_RESET(SVGReset, (), svgReset, parentSVGReset, SVG, SVGData)
|
||||||
|
|
||||||
// stop-color:
|
// stop-color:
|
||||||
SetColor(SVGData.mStopColor, parentSVGReset->mStopColor, mPresContext, aContext, svgReset->mStopColor, aInherited);
|
SetColor(SVGData.mStopColor, parentSVGReset->mStopColor,
|
||||||
|
mPresContext, aContext, svgReset->mStopColor, inherited);
|
||||||
|
|
||||||
|
// flood-color:
|
||||||
|
SetColor(SVGData.mFloodColor, parentSVGReset->mFloodColor,
|
||||||
|
mPresContext, aContext, svgReset->mFloodColor, inherited);
|
||||||
|
|
||||||
// clip-path: url, none, inherit
|
// clip-path: url, none, inherit
|
||||||
if (eCSSUnit_URL == SVGData.mClipPath.GetUnit()) {
|
if (eCSSUnit_URL == SVGData.mClipPath.GetUnit()) {
|
||||||
|
@ -4286,6 +4283,10 @@ nsRuleNode::ComputeSVGResetData(nsStyleStruct* aStartStruct,
|
||||||
SetSVGOpacity(SVGData.mStopOpacity, parentSVGReset->mStopOpacity,
|
SetSVGOpacity(SVGData.mStopOpacity, parentSVGReset->mStopOpacity,
|
||||||
svgReset->mStopOpacity, inherited);
|
svgReset->mStopOpacity, inherited);
|
||||||
|
|
||||||
|
// flood-opacity:
|
||||||
|
SetSVGOpacity(SVGData.mFloodOpacity, parentSVGReset->mFloodOpacity,
|
||||||
|
svgReset->mFloodOpacity, inherited);
|
||||||
|
|
||||||
// dominant-baseline: enum, auto, inherit
|
// dominant-baseline: enum, auto, inherit
|
||||||
if (eCSSUnit_Enumerated == SVGData.mDominantBaseline.GetUnit()) {
|
if (eCSSUnit_Enumerated == SVGData.mDominantBaseline.GetUnit()) {
|
||||||
svgReset->mDominantBaseline = SVGData.mDominantBaseline.GetIntValue();
|
svgReset->mDominantBaseline = SVGData.mDominantBaseline.GetIntValue();
|
||||||
|
|
|
@ -865,8 +865,6 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
|
||||||
else
|
else
|
||||||
fprintf(out, "%ld ", (long)svg->mStroke.mPaint.mColor);
|
fprintf(out, "%ld ", (long)svg->mStroke.mPaint.mColor);
|
||||||
|
|
||||||
fprintf(out, "%ld ", (long)svg->mFloodColor);
|
|
||||||
|
|
||||||
fprintf(out, "%s %s %s ",
|
fprintf(out, "%s %s %s ",
|
||||||
URICString(svg->mMarkerEnd).get(),
|
URICString(svg->mMarkerEnd).get(),
|
||||||
URICString(svg->mMarkerMid).get(),
|
URICString(svg->mMarkerMid).get(),
|
||||||
|
@ -881,12 +879,11 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
|
||||||
}
|
}
|
||||||
|
|
||||||
svg->mStrokeDashoffset.ToString(str);
|
svg->mStrokeDashoffset.ToString(str);
|
||||||
fprintf(out, "%f %s %f %f %f ",
|
fprintf(out, "%f %s %f %f ",
|
||||||
svg->mFillOpacity,
|
svg->mFillOpacity,
|
||||||
NS_ConvertUTF16toUTF8(str).get(),
|
NS_ConvertUTF16toUTF8(str).get(),
|
||||||
svg->mStrokeMiterlimit,
|
svg->mStrokeMiterlimit,
|
||||||
svg->mStrokeOpacity,
|
svg->mStrokeOpacity);
|
||||||
svg->mFloodOpacity);
|
|
||||||
svg->mStrokeWidth.ToString(str);
|
svg->mStrokeWidth.ToString(str);
|
||||||
fprintf(out, "%s %d %d %d %d %d %d %d %d %d\" />\n",
|
fprintf(out, "%s %d %d %d %d %d %d %d %d %d\" />\n",
|
||||||
NS_ConvertUTF16toUTF8(str).get(),
|
NS_ConvertUTF16toUTF8(str).get(),
|
||||||
|
@ -906,11 +903,14 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
|
||||||
|
|
||||||
fprintf(out, "<svgreset data=\"%ld ", (long)svgReset->mStopColor);
|
fprintf(out, "<svgreset data=\"%ld ", (long)svgReset->mStopColor);
|
||||||
|
|
||||||
fprintf(out, "%s %s %s %f %d\" />\n",
|
fprintf(out, "%ld ", (long)svgReset->mFloodColor);
|
||||||
|
|
||||||
|
fprintf(out, "%s %s %s %f %f %d\" />\n",
|
||||||
URICString(svgReset->mClipPath).get(),
|
URICString(svgReset->mClipPath).get(),
|
||||||
URICString(svgReset->mFilter).get(),
|
URICString(svgReset->mFilter).get(),
|
||||||
URICString(svgReset->mMask).get(),
|
URICString(svgReset->mMask).get(),
|
||||||
svgReset->mStopOpacity,
|
svgReset->mStopOpacity,
|
||||||
|
svgReset->mFloodOpacity,
|
||||||
(int)svgReset->mDominantBaseline);
|
(int)svgReset->mDominantBaseline);
|
||||||
#endif
|
#endif
|
||||||
//#insert new style structs here#
|
//#insert new style structs here#
|
||||||
|
|
|
@ -642,7 +642,6 @@ nsStyleSVG::nsStyleSVG()
|
||||||
mStroke.mType = eStyleSVGPaintType_None;
|
mStroke.mType = eStyleSVGPaintType_None;
|
||||||
mStroke.mPaint.mColor = NS_RGB(0,0,0);
|
mStroke.mPaint.mColor = NS_RGB(0,0,0);
|
||||||
mStroke.mFallbackColor = NS_RGB(0,0,0);
|
mStroke.mFallbackColor = NS_RGB(0,0,0);
|
||||||
mFloodColor = NS_RGB(0,0,0);
|
|
||||||
mStrokeDasharray = nsnull;
|
mStrokeDasharray = nsnull;
|
||||||
|
|
||||||
mStrokeDashoffset.SetFactorValue(0.0f);
|
mStrokeDashoffset.SetFactorValue(0.0f);
|
||||||
|
@ -651,7 +650,6 @@ nsStyleSVG::nsStyleSVG()
|
||||||
mFillOpacity = 1.0f;
|
mFillOpacity = 1.0f;
|
||||||
mStrokeMiterlimit = 4.0f;
|
mStrokeMiterlimit = 4.0f;
|
||||||
mStrokeOpacity = 1.0f;
|
mStrokeOpacity = 1.0f;
|
||||||
mFloodOpacity = 1.0f;
|
|
||||||
|
|
||||||
mStrokeDasharrayLength = 0;
|
mStrokeDasharrayLength = 0;
|
||||||
mClipRule = NS_STYLE_FILL_RULE_NONZERO;
|
mClipRule = NS_STYLE_FILL_RULE_NONZERO;
|
||||||
|
@ -675,7 +673,6 @@ nsStyleSVG::nsStyleSVG(const nsStyleSVG& aSource)
|
||||||
|
|
||||||
mFill = aSource.mFill;
|
mFill = aSource.mFill;
|
||||||
mStroke = aSource.mStroke;
|
mStroke = aSource.mStroke;
|
||||||
mFloodColor = aSource.mFloodColor;
|
|
||||||
|
|
||||||
mMarkerEnd = aSource.mMarkerEnd;
|
mMarkerEnd = aSource.mMarkerEnd;
|
||||||
mMarkerMid = aSource.mMarkerMid;
|
mMarkerMid = aSource.mMarkerMid;
|
||||||
|
@ -700,7 +697,6 @@ nsStyleSVG::nsStyleSVG(const nsStyleSVG& aSource)
|
||||||
mFillOpacity = aSource.mFillOpacity;
|
mFillOpacity = aSource.mFillOpacity;
|
||||||
mStrokeMiterlimit = aSource.mStrokeMiterlimit;
|
mStrokeMiterlimit = aSource.mStrokeMiterlimit;
|
||||||
mStrokeOpacity = aSource.mStrokeOpacity;
|
mStrokeOpacity = aSource.mStrokeOpacity;
|
||||||
mFloodOpacity = aSource.mFloodOpacity;
|
|
||||||
|
|
||||||
mClipRule = aSource.mClipRule;
|
mClipRule = aSource.mClipRule;
|
||||||
mFillRule = aSource.mFillRule;
|
mFillRule = aSource.mFillRule;
|
||||||
|
@ -716,7 +712,6 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const
|
||||||
{
|
{
|
||||||
if ( mFill != aOther.mFill ||
|
if ( mFill != aOther.mFill ||
|
||||||
mStroke != aOther.mStroke ||
|
mStroke != aOther.mStroke ||
|
||||||
mFloodColor != aOther.mFloodColor ||
|
|
||||||
|
|
||||||
!EqualURIs(mMarkerEnd, aOther.mMarkerEnd) ||
|
!EqualURIs(mMarkerEnd, aOther.mMarkerEnd) ||
|
||||||
!EqualURIs(mMarkerMid, aOther.mMarkerMid) ||
|
!EqualURIs(mMarkerMid, aOther.mMarkerMid) ||
|
||||||
|
@ -728,7 +723,6 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const
|
||||||
mFillOpacity != aOther.mFillOpacity ||
|
mFillOpacity != aOther.mFillOpacity ||
|
||||||
mStrokeMiterlimit != aOther.mStrokeMiterlimit ||
|
mStrokeMiterlimit != aOther.mStrokeMiterlimit ||
|
||||||
mStrokeOpacity != aOther.mStrokeOpacity ||
|
mStrokeOpacity != aOther.mStrokeOpacity ||
|
||||||
mFloodOpacity != aOther.mFloodOpacity ||
|
|
||||||
|
|
||||||
mClipRule != aOther.mClipRule ||
|
mClipRule != aOther.mClipRule ||
|
||||||
mFillRule != aOther.mFillRule ||
|
mFillRule != aOther.mFillRule ||
|
||||||
|
@ -763,10 +757,12 @@ nsChangeHint nsStyleSVG::MaxDifference()
|
||||||
nsStyleSVGReset::nsStyleSVGReset()
|
nsStyleSVGReset::nsStyleSVGReset()
|
||||||
{
|
{
|
||||||
mStopColor = NS_RGB(0,0,0);
|
mStopColor = NS_RGB(0,0,0);
|
||||||
|
mFloodColor = NS_RGB(0,0,0);
|
||||||
mClipPath = nsnull;
|
mClipPath = nsnull;
|
||||||
mFilter = nsnull;
|
mFilter = nsnull;
|
||||||
mMask = nsnull;
|
mMask = nsnull;
|
||||||
mStopOpacity = 1.0f;
|
mStopOpacity = 1.0f;
|
||||||
|
mFloodOpacity = 1.0f;
|
||||||
mDominantBaseline = NS_STYLE_DOMINANT_BASELINE_AUTO;
|
mDominantBaseline = NS_STYLE_DOMINANT_BASELINE_AUTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,20 +773,24 @@ nsStyleSVGReset::~nsStyleSVGReset()
|
||||||
nsStyleSVGReset::nsStyleSVGReset(const nsStyleSVGReset& aSource)
|
nsStyleSVGReset::nsStyleSVGReset(const nsStyleSVGReset& aSource)
|
||||||
{
|
{
|
||||||
mStopColor = aSource.mStopColor;
|
mStopColor = aSource.mStopColor;
|
||||||
|
mFloodColor = aSource.mFloodColor;
|
||||||
mClipPath = aSource.mClipPath;
|
mClipPath = aSource.mClipPath;
|
||||||
mFilter = aSource.mFilter;
|
mFilter = aSource.mFilter;
|
||||||
mMask = aSource.mMask;
|
mMask = aSource.mMask;
|
||||||
mStopOpacity = aSource.mStopOpacity;
|
mStopOpacity = aSource.mStopOpacity;
|
||||||
|
mFloodOpacity = aSource.mFloodOpacity;
|
||||||
mDominantBaseline = aSource.mDominantBaseline;
|
mDominantBaseline = aSource.mDominantBaseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsChangeHint nsStyleSVGReset::CalcDifference(const nsStyleSVGReset& aOther) const
|
nsChangeHint nsStyleSVGReset::CalcDifference(const nsStyleSVGReset& aOther) const
|
||||||
{
|
{
|
||||||
if (mStopColor != aOther.mStopColor ||
|
if (mStopColor != aOther.mStopColor ||
|
||||||
!EqualURIs(mClipPath, aOther.mClipPath) ||
|
mFloodColor != aOther.mFloodColor ||
|
||||||
!EqualURIs(mFilter, aOther.mFilter) ||
|
!EqualURIs(mClipPath, aOther.mClipPath) ||
|
||||||
!EqualURIs(mMask, aOther.mMask) ||
|
!EqualURIs(mFilter, aOther.mFilter) ||
|
||||||
mStopOpacity != aOther.mStopOpacity ||
|
!EqualURIs(mMask, aOther.mMask) ||
|
||||||
|
mStopOpacity != aOther.mStopOpacity ||
|
||||||
|
mFloodOpacity != aOther.mFloodOpacity ||
|
||||||
mDominantBaseline != aOther.mDominantBaseline)
|
mDominantBaseline != aOther.mDominantBaseline)
|
||||||
return NS_STYLE_HINT_VISUAL;
|
return NS_STYLE_HINT_VISUAL;
|
||||||
|
|
||||||
|
|
|
@ -1242,7 +1242,6 @@ struct nsStyleSVG : public nsStyleStruct {
|
||||||
|
|
||||||
nsStyleSVGPaint mFill; // [inherited]
|
nsStyleSVGPaint mFill; // [inherited]
|
||||||
nsStyleSVGPaint mStroke; // [inherited]
|
nsStyleSVGPaint mStroke; // [inherited]
|
||||||
nscolor mFloodColor; // [inherited]
|
|
||||||
nsCOMPtr<nsIURI> mMarkerEnd; // [inherited]
|
nsCOMPtr<nsIURI> mMarkerEnd; // [inherited]
|
||||||
nsCOMPtr<nsIURI> mMarkerMid; // [inherited]
|
nsCOMPtr<nsIURI> mMarkerMid; // [inherited]
|
||||||
nsCOMPtr<nsIURI> mMarkerStart; // [inherited]
|
nsCOMPtr<nsIURI> mMarkerStart; // [inherited]
|
||||||
|
@ -1254,7 +1253,6 @@ struct nsStyleSVG : public nsStyleStruct {
|
||||||
float mFillOpacity; // [inherited]
|
float mFillOpacity; // [inherited]
|
||||||
float mStrokeMiterlimit; // [inherited]
|
float mStrokeMiterlimit; // [inherited]
|
||||||
float mStrokeOpacity; // [inherited]
|
float mStrokeOpacity; // [inherited]
|
||||||
float mFloodOpacity; // [inherited]
|
|
||||||
|
|
||||||
PRUint32 mStrokeDasharrayLength;
|
PRUint32 mStrokeDasharrayLength;
|
||||||
PRUint8 mClipRule; // [inherited]
|
PRUint8 mClipRule; // [inherited]
|
||||||
|
@ -1286,11 +1284,13 @@ struct nsStyleSVGReset : public nsStyleStruct {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nscolor mStopColor; // [reset]
|
nscolor mStopColor; // [reset]
|
||||||
|
nscolor mFloodColor; // [reset]
|
||||||
nsCOMPtr<nsIURI> mClipPath; // [reset]
|
nsCOMPtr<nsIURI> mClipPath; // [reset]
|
||||||
nsCOMPtr<nsIURI> mFilter; // [reset]
|
nsCOMPtr<nsIURI> mFilter; // [reset]
|
||||||
nsCOMPtr<nsIURI> mMask; // [reset]
|
nsCOMPtr<nsIURI> mMask; // [reset]
|
||||||
|
|
||||||
float mStopOpacity; // [reset]
|
float mStopOpacity; // [reset]
|
||||||
|
float mFloodOpacity; // [reset]
|
||||||
|
|
||||||
PRUint8 mDominantBaseline; // [reset] see nsStyleConsts.h
|
PRUint8 mDominantBaseline; // [reset] see nsStyleConsts.h
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче