Bug 798843 - Rename -moz-objectFill, -moz-objectStroke, -moz-objectValue to context-fill, context-stroke, context-value r=dbaron

This commit is contained in:
Edwin Flores 2013-05-16 14:35:15 +12:00
parent 9e3a28f874
commit 8a4ca2262b
19 changed files with 136 additions and 116 deletions

View File

@ -208,8 +208,8 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -5 #define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -5
#define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -6 #define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -6
// Only valid as paints in SVG glyphs // Only valid as paints in SVG glyphs
#define NS_COLOR_OBJECTFILL -7 #define NS_COLOR_CONTEXT_FILL -7
#define NS_COLOR_OBJECTSTROKE -8 #define NS_COLOR_CONTEXT_STROKE -8
// See nsStyleDisplay // See nsStyleDisplay
#define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0 #define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0
@ -885,7 +885,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_STROKE_LINEJOIN_BEVEL 2 #define NS_STYLE_STROKE_LINEJOIN_BEVEL 2
// stroke-dasharray, stroke-dashoffset, stroke-width // stroke-dasharray, stroke-dashoffset, stroke-width
#define NS_STYLE_STROKE_PROP_OBJECTVALUE 0 #define NS_STYLE_STROKE_PROP_CONTEXT_VALUE 0
// text-anchor // text-anchor
#define NS_STYLE_TEXT_ANCHOR_START 0 #define NS_STYLE_TEXT_ANCHOR_START 0
@ -915,8 +915,8 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D 1 #define NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D 1
// object {fill,stroke}-opacity for SVG glyphs // object {fill,stroke}-opacity for SVG glyphs
#define NS_STYLE_OBJECT_FILL_OPACITY 0 #define NS_STYLE_CONTEXT_FILL_OPACITY 0
#define NS_STYLE_OBJECT_STROKE_OPACITY 1 #define NS_STYLE_CONTEXT_STROKE_OPACITY 1
/***************************************************************************** /*****************************************************************************
* Constants for media features. * * Constants for media features. *

View File

@ -1,5 +1,5 @@
pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-basic.svg svg-glyph-basic-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-basic.svg svg-glyph-basic-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-basic.svg svg-glyph-basic-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-basic.svg svg-glyph-basic-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-positioning.svg svg-glyph-positioning-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-positioning.svg svg-glyph-positioning-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-html.html svg-glyph-html-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-html.html svg-glyph-html-ref.svg

View File

@ -6,19 +6,19 @@
<!-- -moz-objectfill, no stroke --> <!-- -moz-objectfill, no stroke -->
<!-- N --> <!-- N -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
stroke="none" fill="-moz-objectFill" glyphchar="N"/> stroke="none" fill="context-fill" glyphchar="N"/>
<!-- O --> <!-- O -->
<rect x="50" y="-950" width="900" height="900" stroke-width="100" <rect x="50" y="-950" width="900" height="900" stroke-width="100"
fill="-moz-objectFill" stroke="none" glyphchar="O"/> fill="context-fill" stroke="none" glyphchar="O"/>
<!-- -moz-objectstroke --> <!-- -moz-objectstroke -->
<!-- P --> <!-- P -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
stroke="-moz-objectStroke" fill="burlywood" glyphchar="P"/> stroke="context-stroke" fill="burlywood" glyphchar="P"/>
<!-- both -moz-objectstroke and -moz-objectfill --> <!-- both -moz-objectstroke and -moz-objectfill -->
<!-- Q --> <!-- Q -->
<rect x="50" y="-950" width="900" height="900" stroke-width="100" <rect x="50" y="-950" width="900" height="900" stroke-width="100"
fill="-moz-objectStroke" stroke="-moz-objectFill" glyphchar="Q"/> fill="context-stroke" stroke="context-fill" glyphchar="Q"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 831 B

View File

@ -5,47 +5,47 @@
--> -->
<!-- R --> <!-- R -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="-moz-objectFill" stroke="-moz-objectStroke" fill="context-fill" stroke="context-stroke"
fill-opacity="-moz-objectFillOpacity" fill-opacity="context-fill-opacity"
stroke-opacity="-moz-objectStrokeOpacity" glyphchar="R"/> stroke-opacity="context-stroke-opacity" glyphchar="R"/>
<!-- S --> <!-- S -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="-moz-objectFill" stroke="-moz-objectStroke" fill="context-fill" stroke="context-stroke"
fill-opacity="-moz-objectStrokeOpacity" fill-opacity="context-stroke-opacity"
stroke-opacity="-moz-objectFillOpacity" glyphchar="S"/> stroke-opacity="context-fill-opacity" glyphchar="S"/>
<!-- T --> <!-- T -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="-moz-objectStroke" stroke="-moz-objectFill" fill="context-stroke" stroke="context-fill"
fill-opacity="-moz-objectFillOpacity" fill-opacity="context-fill-opacity"
stroke-opacity="-moz-objectStrokeOpacity" glyphchar="T"/> stroke-opacity="context-stroke-opacity" glyphchar="T"/>
<!-- U --> <!-- U -->
<!-- Test for bug where explicit `inherit' would fail for <!-- Test for bug where explicit `inherit' would fail for
*-opacity="objectStrokeOpacity" or "objectFillOpacity" --> *-opacity="objectStrokeOpacity" or "objectFillOpacity" -->
<g style="fill-opacity : -moz-objectStrokeOpacity; stroke-opacity : -moz-objectFillOpacity"> <g style="fill-opacity : context-stroke-opacity; stroke-opacity : context-fill-opacity">
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="-moz-objectStroke" stroke="-moz-objectFill" fill="context-stroke" stroke="context-fill"
fill-opacity="inherit" stroke-opacity="inherit" glyphchar="U"/> fill-opacity="inherit" stroke-opacity="inherit" glyphchar="U"/>
</g> </g>
<!-- W --> <!-- W -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="darkorchid" stroke="goldenrod" fill="darkorchid" stroke="goldenrod"
fill-opacity="-moz-objectFillOpacity" fill-opacity="context-fill-opacity"
stroke-opacity="-moz-objectStrokeOpacity" glyphchar="W"/> stroke-opacity="context-stroke-opacity" glyphchar="W"/>
<!-- X --> <!-- X -->
<rect x="100" y="-900" width="800" height="800" stroke-width="50" <rect x="100" y="-900" width="800" height="800" stroke-width="50"
fill="darkorchid" stroke="goldenrod" fill="darkorchid" stroke="goldenrod"
fill-opacity="-moz-objectStrokeOpacity" fill-opacity="context-stroke-opacity"
stroke-opacity="-moz-objectFillOpacity" glyphchar="X"/> stroke-opacity="context-fill-opacity" glyphchar="X"/>
<style type="text/css"><![CDATA[ <style type="text/css"><![CDATA[
#yparent { #yparent {
fill-opacity : -moz-objectFillOpacity; fill-opacity : context-fill-opacity;
stroke-opacity : -moz-objectStrokeOpacity; stroke-opacity : context-stroke-opacity;
} }
#ychild { #ychild {
color-interpolation : sRGB; color-interpolation : sRGB;

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -11,15 +11,15 @@
<!-- b --> <!-- b -->
<rect x="100" y="-900" width="800" height="800" stroke="chartreuse" <rect x="100" y="-900" width="800" height="800" stroke="chartreuse"
stroke-width="50" stroke-dashoffset="35" stroke-width="50" stroke-dashoffset="35"
stroke-dasharray="-moz-objectValue" glyphchar="b" /> stroke-dasharray="context-value" glyphchar="b" />
<!-- c --> <!-- c -->
<rect x="100" y="-900" width="800" height="800" stroke="sienna" <rect x="100" y="-900" width="800" height="800" stroke="sienna"
stroke-width="50" stroke-dasharray="50 50" stroke-width="50" stroke-dasharray="50 50"
stroke-dashoffset="-moz-objectValue" glyphchar="c" /> stroke-dashoffset="context-value" glyphchar="c" />
<!-- d --> <!-- d -->
<rect x="100" y="-900" width="800" height="800" stroke="olivedrab" <rect x="100" y="-900" width="800" height="800" stroke="olivedrab"
stroke-width="-moz-objectValue" stroke-dasharray="-moz-objectValue" stroke-width="context-value" stroke-dasharray="context-value"
stroke-dashoffset="-moz-objectValue" glyphchar="d" /> stroke-dashoffset="context-value" glyphchar="d" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 919 B

After

Width:  |  Height:  |  Size: 904 B

View File

@ -124,11 +124,6 @@ CSS_KEY(-moz-min-content, _moz_min_content)
CSS_KEY(-moz-myanmar, _moz_myanmar) CSS_KEY(-moz-myanmar, _moz_myanmar)
CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext) CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext)
CSS_KEY(-moz-none, _moz_none) CSS_KEY(-moz-none, _moz_none)
CSS_KEY(-moz-objectfill, _moz_objectfill)
CSS_KEY(-moz-objectfillopacity, _moz_objectfillopacity)
CSS_KEY(-moz-objectstroke, _moz_objectstroke)
CSS_KEY(-moz-objectstrokeopacity, _moz_objectstrokeopacity)
CSS_KEY(-moz-objectvalue, _moz_objectvalue)
CSS_KEY(-moz-oddtreerow, _moz_oddtreerow) CSS_KEY(-moz-oddtreerow, _moz_oddtreerow)
CSS_KEY(-moz-oriya, _moz_oriya) CSS_KEY(-moz-oriya, _moz_oriya)
CSS_KEY(-moz-persian, _moz_persian) CSS_KEY(-moz-persian, _moz_persian)
@ -219,7 +214,12 @@ CSS_KEY(column-reverse, column_reverse)
CSS_KEY(condensed, condensed) CSS_KEY(condensed, condensed)
CSS_KEY(contain, contain) CSS_KEY(contain, contain)
CSS_KEY(content-box, content_box) CSS_KEY(content-box, content_box)
CSS_KEY(context-fill, context_fill)
CSS_KEY(context-fill-opacity, context_fill_opacity)
CSS_KEY(context-menu, context_menu) CSS_KEY(context-menu, context_menu)
CSS_KEY(context-stroke, context_stroke)
CSS_KEY(context-stroke-opacity, context_stroke_opacity)
CSS_KEY(context-value, context_value)
CSS_KEY(continuous, continuous) CSS_KEY(continuous, continuous)
CSS_KEY(copy, copy) CSS_KEY(copy, copy)
CSS_KEY(contextual, contextual) CSS_KEY(contextual, contextual)

View File

@ -77,6 +77,8 @@ using namespace mozilla;
#define VARIANT_ELEMENT 0x08000000 // eCSSUnit_Element #define VARIANT_ELEMENT 0x08000000 // eCSSUnit_Element
#define VARIANT_POSITIVE_DIMENSION 0x10000000 // Only lengths greater than 0.0 #define VARIANT_POSITIVE_DIMENSION 0x10000000 // Only lengths greater than 0.0
#define VARIANT_NONNEGATIVE_DIMENSION 0x20000000 // Only lengths greater than or equal to 0.0 #define VARIANT_NONNEGATIVE_DIMENSION 0x20000000 // Only lengths greater than or equal to 0.0
// Keyword used iff gfx.font_rendering.opentype_svg.enabled is true:
#define VARIANT_OPENTYPE_SVG_KEYWORD 0x40000000
// Common combinations of variants // Common combinations of variants
#define VARIANT_AL (VARIANT_AUTO | VARIANT_LENGTH) #define VARIANT_AL (VARIANT_AUTO | VARIANT_LENGTH)
@ -5003,7 +5005,8 @@ CSSParserImpl::TranslateDimension(nsCSSValue& aValue,
VARIANT_GRADIENT | \ VARIANT_GRADIENT | \
VARIANT_TIMING_FUNCTION | \ VARIANT_TIMING_FUNCTION | \
VARIANT_ALL | \ VARIANT_ALL | \
VARIANT_CALC VARIANT_CALC | \
VARIANT_OPENTYPE_SVG_KEYWORD
// Note that callers passing VARIANT_CALC in aVariantMask will get // Note that callers passing VARIANT_CALC in aVariantMask will get
// full-range parsing inside the calc() expression, and the code that // full-range parsing inside the calc() expression, and the code that
@ -5153,6 +5156,18 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
return true; return true;
} }
} }
if ((aVariantMask & VARIANT_OPENTYPE_SVG_KEYWORD) != 0) {
static bool sOpentypeSVGEnabled;
static bool sOpentypeSVGEnabledCached = false;
if (!sOpentypeSVGEnabledCached) {
sOpentypeSVGEnabledCached = true;
Preferences::AddBoolVarCache(&sOpentypeSVGEnabled,
"gfx.font_rendering.opentype_svg.enabled");
}
if (sOpentypeSVGEnabled) {
aVariantMask |= VARIANT_KEYWORD;
}
}
if ((aVariantMask & VARIANT_KEYWORD) != 0) { if ((aVariantMask & VARIANT_KEYWORD) != 0) {
int32_t value; int32_t value;
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) { if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
@ -10651,8 +10666,10 @@ bool
CSSParserImpl::ParsePaint(nsCSSProperty aPropID) CSSParserImpl::ParsePaint(nsCSSProperty aPropID)
{ {
nsCSSValue x, y; nsCSSValue x, y;
if (!ParseVariant(x, VARIANT_HCK | VARIANT_NONE | VARIANT_URL,
nsCSSProps::kObjectPatternKTable)) { if (!ParseVariant(x, VARIANT_HC | VARIANT_NONE | VARIANT_URL |
VARIANT_OPENTYPE_SVG_KEYWORD,
nsCSSProps::kContextPatternKTable)) {
return false; return false;
} }
@ -10679,8 +10696,10 @@ bool
CSSParserImpl::ParseDasharray() CSSParserImpl::ParseDasharray()
{ {
nsCSSValue value; nsCSSValue value;
if (ParseVariant(value, VARIANT_HK | VARIANT_NONE,
nsCSSProps::kStrokeObjectValueKTable)) { if (ParseVariant(value, VARIANT_INHERIT | VARIANT_NONE |
VARIANT_OPENTYPE_SVG_KEYWORD,
nsCSSProps::kStrokeContextValueKTable)) {
// 'inherit', 'initial', and 'none' are only allowed on their own // 'inherit', 'initial', and 'none' are only allowed on their own
if (!ExpectEndProperty()) { if (!ExpectEndProperty()) {
return false; return false;

View File

@ -3292,7 +3292,7 @@ CSS_PROP_SVG(
CSS_PROPERTY_PARSE_FUNCTION, CSS_PROPERTY_PARSE_FUNCTION,
"", "",
0, 0,
kObjectPatternKTable, kContextPatternKTable,
offsetof(nsStyleSVG, mFill), offsetof(nsStyleSVG, mFill),
eStyleAnimType_PaintServer) eStyleAnimType_PaintServer)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3301,8 +3301,8 @@ CSS_PROP_SVG(
FillOpacity, FillOpacity,
CSS_PROPERTY_PARSE_VALUE, CSS_PROPERTY_PARSE_VALUE,
"", "",
VARIANT_HN | VARIANT_KEYWORD, VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
kObjectOpacityKTable, kContextOpacityKTable,
offsetof(nsStyleSVG, mFillOpacity), offsetof(nsStyleSVG, mFillOpacity),
eStyleAnimType_float) eStyleAnimType_float)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3458,7 +3458,7 @@ CSS_PROP_SVG(
CSS_PROPERTY_PARSE_FUNCTION, CSS_PROPERTY_PARSE_FUNCTION,
"", "",
0, 0,
kObjectPatternKTable, kContextPatternKTable,
offsetof(nsStyleSVG, mStroke), offsetof(nsStyleSVG, mStroke),
eStyleAnimType_PaintServer) eStyleAnimType_PaintServer)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3470,7 +3470,7 @@ CSS_PROP_SVG(
// NOTE: Internal values have range restrictions. // NOTE: Internal values have range restrictions.
"", "",
0, 0,
kStrokeObjectValueKTable, kStrokeContextValueKTable,
CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */ CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */
eStyleAnimType_Custom) eStyleAnimType_Custom)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3479,8 +3479,8 @@ CSS_PROP_SVG(
StrokeDashoffset, StrokeDashoffset,
CSS_PROPERTY_PARSE_VALUE, CSS_PROPERTY_PARSE_VALUE,
"", "",
VARIANT_HLPN | VARIANT_KEYWORD, VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
kStrokeObjectValueKTable, kStrokeContextValueKTable,
offsetof(nsStyleSVG, mStrokeDashoffset), offsetof(nsStyleSVG, mStrokeDashoffset),
eStyleAnimType_Coord) eStyleAnimType_Coord)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3520,8 +3520,8 @@ CSS_PROP_SVG(
StrokeOpacity, StrokeOpacity,
CSS_PROPERTY_PARSE_VALUE, CSS_PROPERTY_PARSE_VALUE,
"", "",
VARIANT_HN | VARIANT_KEYWORD, VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
kObjectOpacityKTable, kContextOpacityKTable,
offsetof(nsStyleSVG, mStrokeOpacity), offsetof(nsStyleSVG, mStrokeOpacity),
eStyleAnimType_float) eStyleAnimType_float)
CSS_PROP_SVG( CSS_PROP_SVG(
@ -3531,8 +3531,8 @@ CSS_PROP_SVG(
CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE, CSS_PROPERTY_VALUE_NONNEGATIVE,
"", "",
VARIANT_HLPN | VARIANT_KEYWORD, VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
kStrokeObjectValueKTable, kStrokeContextValueKTable,
offsetof(nsStyleSVG, mStrokeWidth), offsetof(nsStyleSVG, mStrokeWidth),
eStyleAnimType_Coord) eStyleAnimType_Coord)
CSS_PROP_SVG( CSS_PROP_SVG(

View File

@ -769,7 +769,7 @@ const int32_t nsCSSProps::kClearKTable[] = {
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };
// See also kObjectPatternKTable for SVG paint-specific values // See also kContextPatternKTable for SVG paint-specific values
const int32_t nsCSSProps::kColorKTable[] = { const int32_t nsCSSProps::kColorKTable[] = {
eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder, eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder,
eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption, eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption,
@ -1229,15 +1229,15 @@ const int32_t nsCSSProps::kListStyleKTable[] = {
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };
const int32_t nsCSSProps::kObjectOpacityKTable[] = { const int32_t nsCSSProps::kContextOpacityKTable[] = {
eCSSKeyword__moz_objectfillopacity, NS_STYLE_OBJECT_FILL_OPACITY, eCSSKeyword_context_fill_opacity, NS_STYLE_CONTEXT_FILL_OPACITY,
eCSSKeyword__moz_objectstrokeopacity, NS_STYLE_OBJECT_STROKE_OPACITY, eCSSKeyword_context_stroke_opacity, NS_STYLE_CONTEXT_STROKE_OPACITY,
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };
const int32_t nsCSSProps::kObjectPatternKTable[] = { const int32_t nsCSSProps::kContextPatternKTable[] = {
eCSSKeyword__moz_objectfill, NS_COLOR_OBJECTFILL, eCSSKeyword_context_fill, NS_COLOR_CONTEXT_FILL,
eCSSKeyword__moz_objectstroke, NS_COLOR_OBJECTSTROKE, eCSSKeyword_context_stroke, NS_COLOR_CONTEXT_STROKE,
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };
@ -1673,8 +1673,8 @@ const int32_t nsCSSProps::kStrokeLinejoinKTable[] = {
// Lookup table to store the sole objectValue keyword to let SVG glyphs inherit // Lookup table to store the sole objectValue keyword to let SVG glyphs inherit
// certain stroke-* properties from the outer text object // certain stroke-* properties from the outer text object
const int32_t nsCSSProps::kStrokeObjectValueKTable[] = { const int32_t nsCSSProps::kStrokeContextValueKTable[] = {
eCSSKeyword__moz_objectvalue, NS_STYLE_STROKE_PROP_OBJECTVALUE, eCSSKeyword_context_value, NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
eCSSKeyword_UNKNOWN, -1 eCSSKeyword_UNKNOWN, -1
}; };

View File

@ -374,7 +374,7 @@ public:
static const int32_t kShapeRenderingKTable[]; static const int32_t kShapeRenderingKTable[];
static const int32_t kStrokeLinecapKTable[]; static const int32_t kStrokeLinecapKTable[];
static const int32_t kStrokeLinejoinKTable[]; static const int32_t kStrokeLinejoinKTable[];
static const int32_t kStrokeObjectValueKTable[]; static const int32_t kStrokeContextValueKTable[];
static const int32_t kVectorEffectKTable[]; static const int32_t kVectorEffectKTable[];
static const int32_t kTextAnchorKTable[]; static const int32_t kTextAnchorKTable[];
static const int32_t kTextRenderingKTable[]; static const int32_t kTextRenderingKTable[];
@ -421,8 +421,8 @@ public:
static const int32_t kListStylePositionKTable[]; static const int32_t kListStylePositionKTable[];
static const int32_t kListStyleKTable[]; static const int32_t kListStyleKTable[];
static const int32_t kMaskTypeKTable[]; static const int32_t kMaskTypeKTable[];
static const int32_t kObjectOpacityKTable[]; static const int32_t kContextOpacityKTable[];
static const int32_t kObjectPatternKTable[]; static const int32_t kContextPatternKTable[];
static const int32_t kOrientKTable[]; static const int32_t kOrientKTable[];
static const int32_t kOutlineStyleKTable[]; static const int32_t kOutlineStyleKTable[];
static const int32_t kOutlineColorKTable[]; static const int32_t kOutlineColorKTable[];

View File

@ -4155,14 +4155,14 @@ nsComputedDOMStyle::GetSVGPaintFor(bool aFill)
SetToRGBAColor(fallback, paint->mFallbackColor); SetToRGBAColor(fallback, paint->mFallbackColor);
return valueList; return valueList;
} }
case eStyleSVGPaintType_ObjectFill: case eStyleSVGPaintType_ContextFill:
{ {
val->SetIdent(eCSSKeyword__moz_objectfill); val->SetIdent(eCSSKeyword_context_fill);
break; break;
} }
case eStyleSVGPaintType_ObjectStroke: case eStyleSVGPaintType_ContextStroke:
{ {
val->SetIdent(eCSSKeyword__moz_objectstroke); val->SetIdent(eCSSKeyword_context_stroke);
break; break;
} }
} }

View File

@ -7327,11 +7327,11 @@ SetSVGPaint(const nsCSSValue& aValue, const nsStyleSVGPaint& parentPaint,
} else if (pair.mXValue.GetUnit() == eCSSUnit_Enumerated) { } else if (pair.mXValue.GetUnit() == eCSSUnit_Enumerated) {
switch (pair.mXValue.GetIntValue()) { switch (pair.mXValue.GetIntValue()) {
case NS_COLOR_OBJECTFILL: case NS_COLOR_CONTEXT_FILL:
aResult.SetType(eStyleSVGPaintType_ObjectFill); aResult.SetType(eStyleSVGPaintType_ContextFill);
break; break;
case NS_COLOR_OBJECTSTROKE: case NS_COLOR_CONTEXT_STROKE:
aResult.SetType(eStyleSVGPaintType_ObjectStroke); aResult.SetType(eStyleSVGPaintType_ContextStroke);
break; break;
default: default:
NS_NOTREACHED("unknown keyword as paint server value"); NS_NOTREACHED("unknown keyword as paint server value");
@ -7363,11 +7363,11 @@ SetSVGOpacity(const nsCSSValue& aValue,
{ {
if (eCSSUnit_Enumerated == aValue.GetUnit()) { if (eCSSUnit_Enumerated == aValue.GetUnit()) {
switch (aValue.GetIntValue()) { switch (aValue.GetIntValue()) {
case NS_STYLE_OBJECT_FILL_OPACITY: case NS_STYLE_CONTEXT_FILL_OPACITY:
aOpacityTypeField = eStyleSVGOpacitySource_ObjectFillOpacity; aOpacityTypeField = eStyleSVGOpacitySource_ContextFillOpacity;
break; break;
case NS_STYLE_OBJECT_STROKE_OPACITY: case NS_STYLE_CONTEXT_STROKE_OPACITY:
aOpacityTypeField = eStyleSVGOpacitySource_ObjectStrokeOpacity; aOpacityTypeField = eStyleSVGOpacitySource_ContextStrokeOpacity;
break; break;
default: default:
NS_NOTREACHED("SetSVGOpacity: Unknown keyword"); NS_NOTREACHED("SetSVGOpacity: Unknown keyword");
@ -7387,10 +7387,10 @@ SetSVGOpacity(const nsCSSValue& aValue,
template <typename FieldT, typename T> template <typename FieldT, typename T>
static bool static bool
SetTextObjectValue(const nsCSSValue& aValue, FieldT& aField, T aFallbackValue) SetTextContextValue(const nsCSSValue& aValue, FieldT& aField, T aFallbackValue)
{ {
if (aValue.GetUnit() != eCSSUnit_Enumerated || if (aValue.GetUnit() != eCSSUnit_Enumerated ||
aValue.GetIntValue() != NS_STYLE_STROKE_PROP_OBJECTVALUE) { aValue.GetIntValue() != NS_STYLE_STROKE_PROP_CONTEXT_VALUE) {
return false; return false;
} }
aField = aFallbackValue; aField = aFallbackValue;
@ -7430,12 +7430,13 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
parentSVG->mFill, mPresContext, aContext, parentSVG->mFill, mPresContext, aContext,
svg->mFill, eStyleSVGPaintType_Color, canStoreInRuleTree); svg->mFill, eStyleSVGPaintType_Color, canStoreInRuleTree);
// fill-opacity: factor, inherit, initial, objectFillOpacity, objectStrokeOpacity // fill-opacity: factor, inherit, initial,
nsStyleSVGOpacitySource objectFillOpacity = svg->mFillOpacitySource; // context-fill-opacity, context-stroke-opacity
nsStyleSVGOpacitySource contextFillOpacity = svg->mFillOpacitySource;
SetSVGOpacity(*aRuleData->ValueForFillOpacity(), SetSVGOpacity(*aRuleData->ValueForFillOpacity(),
svg->mFillOpacity, objectFillOpacity, canStoreInRuleTree, svg->mFillOpacity, contextFillOpacity, canStoreInRuleTree,
parentSVG->mFillOpacity, parentSVG->mFillOpacitySource); parentSVG->mFillOpacity, parentSVG->mFillOpacitySource);
svg->mFillOpacitySource = objectFillOpacity; svg->mFillOpacitySource = contextFillOpacity;
// fill-rule: enum, inherit, initial // fill-rule: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForFillRule(), SetDiscrete(*aRuleData->ValueForFillRule(),
@ -7522,7 +7523,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
parentSVG->mStroke, mPresContext, aContext, parentSVG->mStroke, mPresContext, aContext,
svg->mStroke, eStyleSVGPaintType_None, canStoreInRuleTree); svg->mStroke, eStyleSVGPaintType_None, canStoreInRuleTree);
// stroke-dasharray: <dasharray>, none, inherit, -moz-objectValue // stroke-dasharray: <dasharray>, none, inherit, context-value
const nsCSSValue* strokeDasharrayValue = aRuleData->ValueForStrokeDasharray(); const nsCSSValue* strokeDasharrayValue = aRuleData->ValueForStrokeDasharray();
switch (strokeDasharrayValue->GetUnit()) { switch (strokeDasharrayValue->GetUnit()) {
case eCSSUnit_Null: case eCSSUnit_Null:
@ -7549,7 +7550,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
case eCSSUnit_Enumerated: case eCSSUnit_Enumerated:
NS_ABORT_IF_FALSE(strokeDasharrayValue->GetIntValue() == NS_ABORT_IF_FALSE(strokeDasharrayValue->GetIntValue() ==
NS_STYLE_STROKE_PROP_OBJECTVALUE, NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
"Unknown keyword for stroke-dasharray"); "Unknown keyword for stroke-dasharray");
svg->mStrokeDasharrayFromObject = true; svg->mStrokeDasharrayFromObject = true;
delete [] svg->mStrokeDasharray; delete [] svg->mStrokeDasharray;
@ -7604,7 +7605,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
aRuleData->ValueForStrokeDashoffset(); aRuleData->ValueForStrokeDashoffset();
svg->mStrokeDashoffsetFromObject = svg->mStrokeDashoffsetFromObject =
strokeDashoffsetValue->GetUnit() == eCSSUnit_Enumerated && strokeDashoffsetValue->GetUnit() == eCSSUnit_Enumerated &&
strokeDashoffsetValue->GetIntValue() == NS_STYLE_STROKE_PROP_OBJECTVALUE; strokeDashoffsetValue->GetIntValue() == NS_STYLE_STROKE_PROP_CONTEXT_VALUE;
if (svg->mStrokeDashoffsetFromObject) { if (svg->mStrokeDashoffsetFromObject) {
svg->mStrokeDashoffset.SetIntValue(0, eStyleUnit_Integer); svg->mStrokeDashoffset.SetIntValue(0, eStyleUnit_Integer);
} else { } else {
@ -7633,18 +7634,18 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
parentSVG->mStrokeMiterlimit, 4.0f); parentSVG->mStrokeMiterlimit, 4.0f);
// stroke-opacity: // stroke-opacity:
nsStyleSVGOpacitySource objectStrokeOpacity = svg->mStrokeOpacitySource; nsStyleSVGOpacitySource contextStrokeOpacity = svg->mStrokeOpacitySource;
SetSVGOpacity(*aRuleData->ValueForStrokeOpacity(), SetSVGOpacity(*aRuleData->ValueForStrokeOpacity(),
svg->mStrokeOpacity, objectStrokeOpacity, canStoreInRuleTree, svg->mStrokeOpacity, contextStrokeOpacity, canStoreInRuleTree,
parentSVG->mStrokeOpacity, parentSVG->mStrokeOpacitySource); parentSVG->mStrokeOpacity, parentSVG->mStrokeOpacitySource);
svg->mStrokeOpacitySource = objectStrokeOpacity; svg->mStrokeOpacitySource = contextStrokeOpacity;
// stroke-width: // stroke-width:
const nsCSSValue* strokeWidthValue = aRuleData->ValueForStrokeWidth(); const nsCSSValue* strokeWidthValue = aRuleData->ValueForStrokeWidth();
switch (strokeWidthValue->GetUnit()) { switch (strokeWidthValue->GetUnit()) {
case eCSSUnit_Enumerated: case eCSSUnit_Enumerated:
NS_ABORT_IF_FALSE(strokeWidthValue->GetIntValue() == NS_ABORT_IF_FALSE(strokeWidthValue->GetIntValue() ==
NS_STYLE_STROKE_PROP_OBJECTVALUE, NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
"Unrecognized keyword for stroke-width"); "Unrecognized keyword for stroke-width");
svg->mStrokeWidthFromObject = true; svg->mStrokeWidthFromObject = true;
svg->mStrokeWidth.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(1)); svg->mStrokeWidth.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(1));

View File

@ -3139,11 +3139,11 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
eUnit_CSSValuePair); eUnit_CSSValuePair);
return true; return true;
} }
if (paint.mType == eStyleSVGPaintType_ObjectFill || if (paint.mType == eStyleSVGPaintType_ContextFill ||
paint.mType == eStyleSVGPaintType_ObjectStroke) { paint.mType == eStyleSVGPaintType_ContextStroke) {
nsAutoPtr<nsCSSValuePair> pair(new nsCSSValuePair); nsAutoPtr<nsCSSValuePair> pair(new nsCSSValuePair);
pair->mXValue.SetIntValue(paint.mType == eStyleSVGPaintType_ObjectFill ? pair->mXValue.SetIntValue(paint.mType == eStyleSVGPaintType_ContextFill ?
NS_COLOR_OBJECTFILL : NS_COLOR_OBJECTSTROKE, NS_COLOR_CONTEXT_FILL : NS_COLOR_CONTEXT_STROKE,
eCSSUnit_Enumerated); eCSSUnit_Enumerated);
pair->mYValue.SetColorValue(paint.mFallbackColor); pair->mYValue.SetColorValue(paint.mFallbackColor);
aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(), aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(),

View File

@ -2157,14 +2157,14 @@ enum nsStyleSVGPaintType {
eStyleSVGPaintType_None = 1, eStyleSVGPaintType_None = 1,
eStyleSVGPaintType_Color, eStyleSVGPaintType_Color,
eStyleSVGPaintType_Server, eStyleSVGPaintType_Server,
eStyleSVGPaintType_ObjectFill, eStyleSVGPaintType_ContextFill,
eStyleSVGPaintType_ObjectStroke eStyleSVGPaintType_ContextStroke
}; };
enum nsStyleSVGOpacitySource { enum nsStyleSVGOpacitySource {
eStyleSVGOpacitySource_Normal, eStyleSVGOpacitySource_Normal,
eStyleSVGOpacitySource_ObjectFillOpacity, eStyleSVGOpacitySource_ContextFillOpacity,
eStyleSVGOpacitySource_ObjectStrokeOpacity eStyleSVGOpacitySource_ContextStrokeOpacity
}; };
struct nsStyleSVGPaint struct nsStyleSVGPaint

View File

@ -1059,14 +1059,14 @@ nsSVGGlyphFrame::SetupContextPaint(gfxContext *aContext,
const nsStyleSVG *style = StyleSVG(); const nsStyleSVG *style = StyleSVG();
const nsStyleSVGPaint &paint = style->*aFillOrStroke; const nsStyleSVGPaint &paint = style->*aFillOrStroke;
if (paint.mType != eStyleSVGPaintType_ObjectFill && if (paint.mType != eStyleSVGPaintType_ContextFill &&
paint.mType != eStyleSVGPaintType_ObjectStroke) { paint.mType != eStyleSVGPaintType_ContextStroke) {
return false; return false;
} }
gfxMatrix current = aContext->CurrentMatrix(); gfxMatrix current = aContext->CurrentMatrix();
nsRefPtr<gfxPattern> pattern = nsRefPtr<gfxPattern> pattern =
paint.mType == eStyleSVGPaintType_ObjectFill ? paint.mType == eStyleSVGPaintType_ContextFill ?
aOuterContextPaint->GetFillPattern(aOpacity, current) : aOuterContextPaint->GetFillPattern(aOpacity, current) :
aOuterContextPaint->GetStrokePattern(aOpacity, current); aOuterContextPaint->GetStrokePattern(aOpacity, current);
if (!pattern) { if (!pattern) {
@ -1135,12 +1135,12 @@ mozilla::SVGTextContextPaint::Paint::GetPattern(float aOpacity,
} }
pattern->SetMatrix(aCTM * mPatternMatrix); pattern->SetMatrix(aCTM * mPatternMatrix);
break; break;
case eStyleSVGPaintType_ObjectFill: case eStyleSVGPaintType_ContextFill:
pattern = mPaintDefinition.mContextPaint->GetFillPattern(aOpacity, aCTM); pattern = mPaintDefinition.mContextPaint->GetFillPattern(aOpacity, aCTM);
// Don't cache this. mContextPaint will have cached it anyway. If we // Don't cache this. mContextPaint will have cached it anyway. If we
// cache it, we'll have to compute mPatternMatrix, which is annoying. // cache it, we'll have to compute mPatternMatrix, which is annoying.
return pattern.forget(); return pattern.forget();
case eStyleSVGPaintType_ObjectStroke: case eStyleSVGPaintType_ContextStroke:
pattern = mPaintDefinition.mContextPaint->GetStrokePattern(aOpacity, aCTM); pattern = mPaintDefinition.mContextPaint->GetStrokePattern(aOpacity, aCTM);
// Don't cache this. mContextPaint will have cached it anyway. If we // Don't cache this. mContextPaint will have cached it anyway. If we
// cache it, we'll have to compute mPatternMatrix, which is annoying. // cache it, we'll have to compute mPatternMatrix, which is annoying.

View File

@ -65,8 +65,8 @@ struct SVGTextContextPaint : public gfxTextContextPaint {
void SetContextPaint(gfxTextContextPaint *aContextPaint, void SetContextPaint(gfxTextContextPaint *aContextPaint,
nsStyleSVGPaintType aPaintType) { nsStyleSVGPaintType aPaintType) {
NS_ASSERTION(aPaintType == eStyleSVGPaintType_ObjectFill || NS_ASSERTION(aPaintType == eStyleSVGPaintType_ContextFill ||
aPaintType == eStyleSVGPaintType_ObjectStroke, aPaintType == eStyleSVGPaintType_ContextStroke,
"Invalid context paint type"); "Invalid context paint type");
mPaintType = aPaintType; mPaintType = aPaintType;
mPaintDefinition.mContextPaint = aContextPaint; mPaintDefinition.mContextPaint = aContextPaint;

View File

@ -3349,7 +3349,7 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
SVGCharClipDisplayItem item(run); SVGCharClipDisplayItem item(run);
// Set up the fill and stroke so that SVG glyphs can get painted correctly // Set up the fill and stroke so that SVG glyphs can get painted correctly
// when they use -moz-objectFill values etc. // when they use context-fill etc.
gfx->SetMatrix(initialMatrix); gfx->SetMatrix(initialMatrix);
gfxTextContextPaint *outerContextPaint = gfxTextContextPaint *outerContextPaint =
(gfxTextContextPaint*)aContext->GetUserData(&gfxTextContextPaint::sUserDataKey); (gfxTextContextPaint*)aContext->GetUserData(&gfxTextContextPaint::sUserDataKey);
@ -5276,14 +5276,14 @@ nsSVGTextFrame2::SetupContextPaint(gfxContext* aContext,
const nsStyleSVG *style = aFrame->StyleSVG(); const nsStyleSVG *style = aFrame->StyleSVG();
const nsStyleSVGPaint &paint = style->*aFillOrStroke; const nsStyleSVGPaint &paint = style->*aFillOrStroke;
if (paint.mType != eStyleSVGPaintType_ObjectFill && if (paint.mType != eStyleSVGPaintType_ContextFill &&
paint.mType != eStyleSVGPaintType_ObjectStroke) { paint.mType != eStyleSVGPaintType_ContextStroke) {
return false; return false;
} }
gfxMatrix current = aContext->CurrentMatrix(); gfxMatrix current = aContext->CurrentMatrix();
nsRefPtr<gfxPattern> pattern = nsRefPtr<gfxPattern> pattern =
paint.mType == eStyleSVGPaintType_ObjectFill ? paint.mType == eStyleSVGPaintType_ContextFill ?
aOuterContextPaint->GetFillPattern(aOpacity, current) : aOuterContextPaint->GetFillPattern(aOpacity, current) :
aOuterContextPaint->GetStrokePattern(aOpacity, current); aOuterContextPaint->GetStrokePattern(aOpacity, current);
if (!pattern) { if (!pattern) {

View File

@ -1532,8 +1532,8 @@ nsSVGUtils::GetFallbackOrPaintColor(gfxContext *aContext, nsStyleContext *aStyle
const nsStyleSVGPaint &paint = aStyleContext->StyleSVG()->*aFillOrStroke; const nsStyleSVGPaint &paint = aStyleContext->StyleSVG()->*aFillOrStroke;
nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited(); nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited();
bool isServer = paint.mType == eStyleSVGPaintType_Server || bool isServer = paint.mType == eStyleSVGPaintType_Server ||
paint.mType == eStyleSVGPaintType_ObjectFill || paint.mType == eStyleSVGPaintType_ContextFill ||
paint.mType == eStyleSVGPaintType_ObjectStroke; paint.mType == eStyleSVGPaintType_ContextStroke;
nscolor color = isServer ? paint.mFallbackColor : paint.mPaint.mColor; nscolor color = isServer ? paint.mFallbackColor : paint.mPaint.mColor;
if (styleIfVisited) { if (styleIfVisited) {
const nsStyleSVGPaint &paintIfVisited = const nsStyleSVGPaint &paintIfVisited =
@ -1592,10 +1592,10 @@ nsSVGUtils::SetupContextPaint(gfxContext *aContext,
} }
switch (aPaint.mType) { switch (aPaint.mType) {
case eStyleSVGPaintType_ObjectFill: case eStyleSVGPaintType_ContextFill:
pattern = aContextPaint->GetFillPattern(aOpacity, aContext->CurrentMatrix()); pattern = aContextPaint->GetFillPattern(aOpacity, aContext->CurrentMatrix());
break; break;
case eStyleSVGPaintType_ObjectStroke: case eStyleSVGPaintType_ContextStroke:
pattern = aContextPaint->GetStrokePattern(aOpacity, aContext->CurrentMatrix()); pattern = aContextPaint->GetStrokePattern(aOpacity, aContext->CurrentMatrix());
break; break;
default: default:
@ -1687,18 +1687,18 @@ nsSVGUtils::GetOpacity(nsStyleSVGOpacitySource aOpacityType,
case eStyleSVGOpacitySource_Normal: case eStyleSVGOpacitySource_Normal:
opacity = aOpacity; opacity = aOpacity;
break; break;
case eStyleSVGOpacitySource_ObjectFillOpacity: case eStyleSVGOpacitySource_ContextFillOpacity:
if (aOuterContextPaint) { if (aOuterContextPaint) {
opacity = aOuterContextPaint->GetFillOpacity(); opacity = aOuterContextPaint->GetFillOpacity();
} else { } else {
NS_WARNING("objectFillOpacity used outside of an SVG glyph"); NS_WARNING("context-fill-opacity used outside of an SVG glyph");
} }
break; break;
case eStyleSVGOpacitySource_ObjectStrokeOpacity: case eStyleSVGOpacitySource_ContextStrokeOpacity:
if (aOuterContextPaint) { if (aOuterContextPaint) {
opacity = aOuterContextPaint->GetStrokeOpacity(); opacity = aOuterContextPaint->GetStrokeOpacity();
} else { } else {
NS_WARNING("objectStrokeOpacity used outside of an SVG glyph"); NS_WARNING("context-stroke-opacity used outside of an SVG glyph");
} }
break; break;
default: default: