зеркало из https://github.com/mozilla/gecko-dev.git
Bug 798843 - Rename -moz-objectFill, -moz-objectStroke, -moz-objectValue to context-fill, context-stroke, context-value r=dbaron
* * * bug 798843 - recompile svg.woff font to pick up the updated glyph definitions * * * bug 798843 - update property_database.js to match the new property names
This commit is contained in:
Родитель
43e0322c30
Коммит
90fcad5f64
|
@ -3,22 +3,22 @@
|
|||
Test SVG glyphs for text object pattern inheritance
|
||||
Covers glyph ID range 48 (N) to 51 (Q)
|
||||
-->
|
||||
<!-- -moz-objectfill, no stroke -->
|
||||
<!-- context-fill, no stroke -->
|
||||
<!-- N -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
stroke="none" fill="-moz-objectFill" id="glyph48"/>
|
||||
stroke="none" fill="context-fill" id="glyph48"/>
|
||||
|
||||
<!-- O -->
|
||||
<rect x="50" y="-950" width="900" height="900" stroke-width="100"
|
||||
fill="-moz-objectFill" stroke="none" id="glyph49"/>
|
||||
fill="context-fill" stroke="none" id="glyph49"/>
|
||||
|
||||
<!-- -moz-objectstroke -->
|
||||
<!-- context-stroke -->
|
||||
<!-- P -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
stroke="-moz-objectStroke" fill="burlywood" id="glyph50"/>
|
||||
stroke="context-stroke" fill="burlywood" id="glyph50"/>
|
||||
|
||||
<!-- both -moz-objectstroke and -moz-objectfill -->
|
||||
<!-- both context-stroke and context-fill (but note swapped usage!) -->
|
||||
<!-- Q -->
|
||||
<rect x="50" y="-950" width="900" height="900" stroke-width="100"
|
||||
fill="-moz-objectStroke" stroke="-moz-objectFill" id="glyph51"/>
|
||||
fill="context-stroke" stroke="context-fill" id="glyph51"/>
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 842 B После Ширина: | Высота: | Размер: 841 B |
|
@ -5,47 +5,47 @@
|
|||
-->
|
||||
<!-- R -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
fill="-moz-objectFill" stroke="-moz-objectStroke"
|
||||
fill-opacity="-moz-objectFillOpacity"
|
||||
stroke-opacity="-moz-objectStrokeOpacity" id="glyph52"/>
|
||||
fill="context-fill" stroke="context-stroke"
|
||||
fill-opacity="context-fill-opacity"
|
||||
stroke-opacity="context-stroke-opacity" id="glyph52"/>
|
||||
|
||||
<!-- S -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
fill="-moz-objectFill" stroke="-moz-objectStroke"
|
||||
fill-opacity="-moz-objectStrokeOpacity"
|
||||
stroke-opacity="-moz-objectFillOpacity" id="glyph53"/>
|
||||
fill="context-fill" stroke="context-stroke"
|
||||
fill-opacity="context-stroke-opacity"
|
||||
stroke-opacity="context-fill-opacity" id="glyph53"/>
|
||||
|
||||
<!-- T -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
fill="-moz-objectStroke" stroke="-moz-objectFill"
|
||||
fill-opacity="-moz-objectFillOpacity"
|
||||
stroke-opacity="-moz-objectStrokeOpacity" id="glyph54"/>
|
||||
fill="context-stroke" stroke="context-fill"
|
||||
fill-opacity="context-fill-opacity"
|
||||
stroke-opacity="context-stroke-opacity" id="glyph54"/>
|
||||
|
||||
<!-- U -->
|
||||
<!-- Test for bug where explicit `inherit' would fail for
|
||||
*-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"
|
||||
fill="-moz-objectStroke" stroke="-moz-objectFill"
|
||||
fill="context-stroke" stroke="context-fill"
|
||||
fill-opacity="inherit" stroke-opacity="inherit" id="glyph55"/>
|
||||
</g>
|
||||
|
||||
<!-- W -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
fill="darkorchid" stroke="goldenrod"
|
||||
fill-opacity="-moz-objectFillOpacity"
|
||||
stroke-opacity="-moz-objectStrokeOpacity" id="glyph57"/>
|
||||
fill-opacity="context-fill-opacity"
|
||||
stroke-opacity="context-stroke-opacity" id="glyph57"/>
|
||||
|
||||
<!-- X -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke-width="50"
|
||||
fill="darkorchid" stroke="goldenrod"
|
||||
fill-opacity="-moz-objectStrokeOpacity"
|
||||
stroke-opacity="-moz-objectFillOpacity" id="glyph58"/>
|
||||
fill-opacity="context-stroke-opacity"
|
||||
stroke-opacity="context-fill-opacity" id="glyph58"/>
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
#glyph59 {
|
||||
fill-opacity : -moz-objectFillOpacity;
|
||||
stroke-opacity : -moz-objectStrokeOpacity;
|
||||
fill-opacity : context-fill-opacity;
|
||||
stroke-opacity : context-stroke-opacity;
|
||||
}
|
||||
#ychild {
|
||||
color-interpolation : sRGB;
|
||||
|
|
До Ширина: | Высота: | Размер: 2.1 KiB После Ширина: | Высота: | Размер: 2.1 KiB |
|
@ -11,15 +11,15 @@
|
|||
<!-- b -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke="chartreuse"
|
||||
stroke-width="50" stroke-dashoffset="35"
|
||||
stroke-dasharray="-moz-objectValue" id="glyph68" />
|
||||
stroke-dasharray="context-value" id="glyph68" />
|
||||
|
||||
<!-- c -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke="sienna"
|
||||
stroke-width="50" stroke-dasharray="50 50"
|
||||
stroke-dashoffset="-moz-objectValue" id="glyph69" />
|
||||
stroke-dashoffset="context-value" id="glyph69" />
|
||||
|
||||
<!-- d -->
|
||||
<rect x="100" y="-900" width="800" height="800" stroke="olivedrab"
|
||||
stroke-width="-moz-objectValue" stroke-dasharray="-moz-objectValue"
|
||||
stroke-dashoffset="-moz-objectValue" id="glyph70" />
|
||||
stroke-width="context-value" stroke-dasharray="context-value"
|
||||
stroke-dashoffset="context-value" id="glyph70" />
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 915 B После Ширина: | Высота: | Размер: 900 B |
Двоичные данные
layout/reftests/text-svgglyphs/resources/svg.woff
Двоичные данные
layout/reftests/text-svgglyphs/resources/svg.woff
Двоичный файл не отображается.
|
@ -123,11 +123,6 @@ CSS_KEY(-moz-min-content, _moz_min_content)
|
|||
CSS_KEY(-moz-myanmar, _moz_myanmar)
|
||||
CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext)
|
||||
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-oriya, _moz_oriya)
|
||||
CSS_KEY(-moz-persian, _moz_persian)
|
||||
|
@ -223,7 +218,12 @@ CSS_KEY(column-reverse, column_reverse)
|
|||
CSS_KEY(condensed, condensed)
|
||||
CSS_KEY(contain, contain)
|
||||
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-stroke, context_stroke)
|
||||
CSS_KEY(context-stroke-opacity, context_stroke_opacity)
|
||||
CSS_KEY(context-value, context_value)
|
||||
CSS_KEY(continuous, continuous)
|
||||
CSS_KEY(contrast, contrast)
|
||||
CSS_KEY(copy, copy)
|
||||
|
|
|
@ -4984,7 +4984,8 @@ CSSParserImpl::TranslateDimension(nsCSSValue& aValue,
|
|||
VARIANT_GRADIENT | \
|
||||
VARIANT_TIMING_FUNCTION | \
|
||||
VARIANT_ALL | \
|
||||
VARIANT_CALC
|
||||
VARIANT_CALC | \
|
||||
VARIANT_OPENTYPE_SVG_KEYWORD
|
||||
|
||||
// Note that callers passing VARIANT_CALC in aVariantMask will get
|
||||
// full-range parsing inside the calc() expression, and the code that
|
||||
|
@ -5133,6 +5134,18 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
|
|||
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) {
|
||||
int32_t value;
|
||||
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
|
||||
|
@ -10839,8 +10852,10 @@ bool
|
|||
CSSParserImpl::ParsePaint(nsCSSProperty aPropID)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -10867,8 +10882,10 @@ bool
|
|||
CSSParserImpl::ParseDasharray()
|
||||
{
|
||||
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
|
||||
if (!ExpectEndProperty()) {
|
||||
return false;
|
||||
|
|
|
@ -3342,7 +3342,7 @@ CSS_PROP_SVG(
|
|||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
kObjectPatternKTable,
|
||||
kContextPatternKTable,
|
||||
offsetof(nsStyleSVG, mFill),
|
||||
eStyleAnimType_PaintServer)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3351,8 +3351,8 @@ CSS_PROP_SVG(
|
|||
FillOpacity,
|
||||
CSS_PROPERTY_PARSE_VALUE,
|
||||
"",
|
||||
VARIANT_HN | VARIANT_KEYWORD,
|
||||
kObjectOpacityKTable,
|
||||
VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
|
||||
kContextOpacityKTable,
|
||||
offsetof(nsStyleSVG, mFillOpacity),
|
||||
eStyleAnimType_float)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3508,7 +3508,7 @@ CSS_PROP_SVG(
|
|||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
kObjectPatternKTable,
|
||||
kContextPatternKTable,
|
||||
offsetof(nsStyleSVG, mStroke),
|
||||
eStyleAnimType_PaintServer)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3520,7 +3520,7 @@ CSS_PROP_SVG(
|
|||
// NOTE: Internal values have range restrictions.
|
||||
"",
|
||||
0,
|
||||
kStrokeObjectValueKTable,
|
||||
kStrokeContextValueKTable,
|
||||
CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */
|
||||
eStyleAnimType_Custom)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3529,8 +3529,8 @@ CSS_PROP_SVG(
|
|||
StrokeDashoffset,
|
||||
CSS_PROPERTY_PARSE_VALUE,
|
||||
"",
|
||||
VARIANT_HLPN | VARIANT_KEYWORD,
|
||||
kStrokeObjectValueKTable,
|
||||
VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
|
||||
kStrokeContextValueKTable,
|
||||
offsetof(nsStyleSVG, mStrokeDashoffset),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3570,8 +3570,8 @@ CSS_PROP_SVG(
|
|||
StrokeOpacity,
|
||||
CSS_PROPERTY_PARSE_VALUE,
|
||||
"",
|
||||
VARIANT_HN | VARIANT_KEYWORD,
|
||||
kObjectOpacityKTable,
|
||||
VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
|
||||
kContextOpacityKTable,
|
||||
offsetof(nsStyleSVG, mStrokeOpacity),
|
||||
eStyleAnimType_float)
|
||||
CSS_PROP_SVG(
|
||||
|
@ -3581,8 +3581,8 @@ CSS_PROP_SVG(
|
|||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE,
|
||||
"",
|
||||
VARIANT_HLPN | VARIANT_KEYWORD,
|
||||
kStrokeObjectValueKTable,
|
||||
VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
|
||||
kStrokeContextValueKTable,
|
||||
offsetof(nsStyleSVG, mStrokeWidth),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_SVG(
|
||||
|
|
|
@ -793,7 +793,7 @@ const int32_t nsCSSProps::kClearKTable[] = {
|
|||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
|
||||
// See also kObjectPatternKTable for SVG paint-specific values
|
||||
// See also kContextPatternKTable for SVG paint-specific values
|
||||
const int32_t nsCSSProps::kColorKTable[] = {
|
||||
eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder,
|
||||
eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption,
|
||||
|
@ -1268,15 +1268,15 @@ const int32_t nsCSSProps::kListStyleKTable[] = {
|
|||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
|
||||
const int32_t nsCSSProps::kObjectOpacityKTable[] = {
|
||||
eCSSKeyword__moz_objectfillopacity, NS_STYLE_OBJECT_FILL_OPACITY,
|
||||
eCSSKeyword__moz_objectstrokeopacity, NS_STYLE_OBJECT_STROKE_OPACITY,
|
||||
const int32_t nsCSSProps::kContextOpacityKTable[] = {
|
||||
eCSSKeyword_context_fill_opacity, NS_STYLE_CONTEXT_FILL_OPACITY,
|
||||
eCSSKeyword_context_stroke_opacity, NS_STYLE_CONTEXT_STROKE_OPACITY,
|
||||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
|
||||
const int32_t nsCSSProps::kObjectPatternKTable[] = {
|
||||
eCSSKeyword__moz_objectfill, NS_COLOR_OBJECTFILL,
|
||||
eCSSKeyword__moz_objectstroke, NS_COLOR_OBJECTSTROKE,
|
||||
const int32_t nsCSSProps::kContextPatternKTable[] = {
|
||||
eCSSKeyword_context_fill, NS_COLOR_CONTEXT_FILL,
|
||||
eCSSKeyword_context_stroke, NS_COLOR_CONTEXT_STROKE,
|
||||
eCSSKeyword_UNKNOWN,-1
|
||||
};
|
||||
|
||||
|
@ -1746,8 +1746,8 @@ const int32_t nsCSSProps::kStrokeLinejoinKTable[] = {
|
|||
|
||||
// Lookup table to store the sole objectValue keyword to let SVG glyphs inherit
|
||||
// certain stroke-* properties from the outer text object
|
||||
const int32_t nsCSSProps::kStrokeObjectValueKTable[] = {
|
||||
eCSSKeyword__moz_objectvalue, NS_STYLE_STROKE_PROP_OBJECTVALUE,
|
||||
const int32_t nsCSSProps::kStrokeContextValueKTable[] = {
|
||||
eCSSKeyword_context_value, NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
|
||||
eCSSKeyword_UNKNOWN, -1
|
||||
};
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#define VARIANT_ELEMENT 0x08000000 // eCSSUnit_Element
|
||||
#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
|
||||
// Keyword used iff gfx.font_rendering.opentype_svg.enabled is true:
|
||||
#define VARIANT_OPENTYPE_SVG_KEYWORD 0x40000000
|
||||
|
||||
// Common combinations of variants
|
||||
#define VARIANT_AL (VARIANT_AUTO | VARIANT_LENGTH)
|
||||
|
@ -456,7 +458,7 @@ public:
|
|||
static const int32_t kShapeRenderingKTable[];
|
||||
static const int32_t kStrokeLinecapKTable[];
|
||||
static const int32_t kStrokeLinejoinKTable[];
|
||||
static const int32_t kStrokeObjectValueKTable[];
|
||||
static const int32_t kStrokeContextValueKTable[];
|
||||
static const int32_t kVectorEffectKTable[];
|
||||
static const int32_t kTextAnchorKTable[];
|
||||
static const int32_t kTextRenderingKTable[];
|
||||
|
@ -505,8 +507,8 @@ public:
|
|||
static const int32_t kListStylePositionKTable[];
|
||||
static const int32_t kListStyleKTable[];
|
||||
static const int32_t kMaskTypeKTable[];
|
||||
static const int32_t kObjectOpacityKTable[];
|
||||
static const int32_t kObjectPatternKTable[];
|
||||
static const int32_t kContextOpacityKTable[];
|
||||
static const int32_t kContextPatternKTable[];
|
||||
static const int32_t kOrientKTable[];
|
||||
static const int32_t kOutlineStyleKTable[];
|
||||
static const int32_t kOutlineColorKTable[];
|
||||
|
|
|
@ -4294,14 +4294,14 @@ nsComputedDOMStyle::GetSVGPaintFor(bool aFill)
|
|||
SetToRGBAColor(fallback, paint->mFallbackColor);
|
||||
return valueList;
|
||||
}
|
||||
case eStyleSVGPaintType_ObjectFill:
|
||||
case eStyleSVGPaintType_ContextFill:
|
||||
{
|
||||
val->SetIdent(eCSSKeyword__moz_objectfill);
|
||||
val->SetIdent(eCSSKeyword_context_fill);
|
||||
break;
|
||||
}
|
||||
case eStyleSVGPaintType_ObjectStroke:
|
||||
case eStyleSVGPaintType_ContextStroke:
|
||||
{
|
||||
val->SetIdent(eCSSKeyword__moz_objectstroke);
|
||||
val->SetIdent(eCSSKeyword_context_stroke);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7420,11 +7420,11 @@ SetSVGPaint(const nsCSSValue& aValue, const nsStyleSVGPaint& parentPaint,
|
|||
} else if (pair.mXValue.GetUnit() == eCSSUnit_Enumerated) {
|
||||
|
||||
switch (pair.mXValue.GetIntValue()) {
|
||||
case NS_COLOR_OBJECTFILL:
|
||||
aResult.SetType(eStyleSVGPaintType_ObjectFill);
|
||||
case NS_COLOR_CONTEXT_FILL:
|
||||
aResult.SetType(eStyleSVGPaintType_ContextFill);
|
||||
break;
|
||||
case NS_COLOR_OBJECTSTROKE:
|
||||
aResult.SetType(eStyleSVGPaintType_ObjectStroke);
|
||||
case NS_COLOR_CONTEXT_STROKE:
|
||||
aResult.SetType(eStyleSVGPaintType_ContextStroke);
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("unknown keyword as paint server value");
|
||||
|
@ -7456,11 +7456,11 @@ SetSVGOpacity(const nsCSSValue& aValue,
|
|||
{
|
||||
if (eCSSUnit_Enumerated == aValue.GetUnit()) {
|
||||
switch (aValue.GetIntValue()) {
|
||||
case NS_STYLE_OBJECT_FILL_OPACITY:
|
||||
aOpacityTypeField = eStyleSVGOpacitySource_ObjectFillOpacity;
|
||||
case NS_STYLE_CONTEXT_FILL_OPACITY:
|
||||
aOpacityTypeField = eStyleSVGOpacitySource_ContextFillOpacity;
|
||||
break;
|
||||
case NS_STYLE_OBJECT_STROKE_OPACITY:
|
||||
aOpacityTypeField = eStyleSVGOpacitySource_ObjectStrokeOpacity;
|
||||
case NS_STYLE_CONTEXT_STROKE_OPACITY:
|
||||
aOpacityTypeField = eStyleSVGOpacitySource_ContextStrokeOpacity;
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("SetSVGOpacity: Unknown keyword");
|
||||
|
@ -7480,10 +7480,10 @@ SetSVGOpacity(const nsCSSValue& aValue,
|
|||
|
||||
template <typename FieldT, typename T>
|
||||
static bool
|
||||
SetTextObjectValue(const nsCSSValue& aValue, FieldT& aField, T aFallbackValue)
|
||||
SetTextContextValue(const nsCSSValue& aValue, FieldT& aField, T aFallbackValue)
|
||||
{
|
||||
if (aValue.GetUnit() != eCSSUnit_Enumerated ||
|
||||
aValue.GetIntValue() != NS_STYLE_STROKE_PROP_OBJECTVALUE) {
|
||||
aValue.GetIntValue() != NS_STYLE_STROKE_PROP_CONTEXT_VALUE) {
|
||||
return false;
|
||||
}
|
||||
aField = aFallbackValue;
|
||||
|
@ -7523,12 +7523,13 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
|||
parentSVG->mFill, mPresContext, aContext,
|
||||
svg->mFill, eStyleSVGPaintType_Color, canStoreInRuleTree);
|
||||
|
||||
// fill-opacity: factor, inherit, initial, objectFillOpacity, objectStrokeOpacity
|
||||
nsStyleSVGOpacitySource objectFillOpacity = svg->mFillOpacitySource;
|
||||
// fill-opacity: factor, inherit, initial,
|
||||
// context-fill-opacity, context-stroke-opacity
|
||||
nsStyleSVGOpacitySource contextFillOpacity = svg->mFillOpacitySource;
|
||||
SetSVGOpacity(*aRuleData->ValueForFillOpacity(),
|
||||
svg->mFillOpacity, objectFillOpacity, canStoreInRuleTree,
|
||||
svg->mFillOpacity, contextFillOpacity, canStoreInRuleTree,
|
||||
parentSVG->mFillOpacity, parentSVG->mFillOpacitySource);
|
||||
svg->mFillOpacitySource = objectFillOpacity;
|
||||
svg->mFillOpacitySource = contextFillOpacity;
|
||||
|
||||
// fill-rule: enum, inherit, initial
|
||||
SetDiscrete(*aRuleData->ValueForFillRule(),
|
||||
|
@ -7615,7 +7616,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
|||
parentSVG->mStroke, mPresContext, aContext,
|
||||
svg->mStroke, eStyleSVGPaintType_None, canStoreInRuleTree);
|
||||
|
||||
// stroke-dasharray: <dasharray>, none, inherit, -moz-objectValue
|
||||
// stroke-dasharray: <dasharray>, none, inherit, context-value
|
||||
const nsCSSValue* strokeDasharrayValue = aRuleData->ValueForStrokeDasharray();
|
||||
switch (strokeDasharrayValue->GetUnit()) {
|
||||
case eCSSUnit_Null:
|
||||
|
@ -7642,7 +7643,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
|||
|
||||
case eCSSUnit_Enumerated:
|
||||
NS_ABORT_IF_FALSE(strokeDasharrayValue->GetIntValue() ==
|
||||
NS_STYLE_STROKE_PROP_OBJECTVALUE,
|
||||
NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
|
||||
"Unknown keyword for stroke-dasharray");
|
||||
svg->mStrokeDasharrayFromObject = true;
|
||||
delete [] svg->mStrokeDasharray;
|
||||
|
@ -7697,9 +7698,9 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
|||
aRuleData->ValueForStrokeDashoffset();
|
||||
svg->mStrokeDashoffsetFromObject =
|
||||
strokeDashoffsetValue->GetUnit() == eCSSUnit_Enumerated &&
|
||||
strokeDashoffsetValue->GetIntValue() == NS_STYLE_STROKE_PROP_OBJECTVALUE;
|
||||
strokeDashoffsetValue->GetIntValue() == NS_STYLE_STROKE_PROP_CONTEXT_VALUE;
|
||||
if (svg->mStrokeDashoffsetFromObject) {
|
||||
svg->mStrokeDashoffset.SetIntValue(0, eStyleUnit_Integer);
|
||||
svg->mStrokeDashoffset.SetCoordValue(0);
|
||||
} else {
|
||||
SetCoord(*aRuleData->ValueForStrokeDashoffset(),
|
||||
svg->mStrokeDashoffset, parentSVG->mStrokeDashoffset,
|
||||
|
@ -7726,18 +7727,18 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
|||
parentSVG->mStrokeMiterlimit, 4.0f);
|
||||
|
||||
// stroke-opacity:
|
||||
nsStyleSVGOpacitySource objectStrokeOpacity = svg->mStrokeOpacitySource;
|
||||
nsStyleSVGOpacitySource contextStrokeOpacity = svg->mStrokeOpacitySource;
|
||||
SetSVGOpacity(*aRuleData->ValueForStrokeOpacity(),
|
||||
svg->mStrokeOpacity, objectStrokeOpacity, canStoreInRuleTree,
|
||||
svg->mStrokeOpacity, contextStrokeOpacity, canStoreInRuleTree,
|
||||
parentSVG->mStrokeOpacity, parentSVG->mStrokeOpacitySource);
|
||||
svg->mStrokeOpacitySource = objectStrokeOpacity;
|
||||
svg->mStrokeOpacitySource = contextStrokeOpacity;
|
||||
|
||||
// stroke-width:
|
||||
const nsCSSValue* strokeWidthValue = aRuleData->ValueForStrokeWidth();
|
||||
switch (strokeWidthValue->GetUnit()) {
|
||||
case eCSSUnit_Enumerated:
|
||||
NS_ABORT_IF_FALSE(strokeWidthValue->GetIntValue() ==
|
||||
NS_STYLE_STROKE_PROP_OBJECTVALUE,
|
||||
NS_STYLE_STROKE_PROP_CONTEXT_VALUE,
|
||||
"Unrecognized keyword for stroke-width");
|
||||
svg->mStrokeWidthFromObject = true;
|
||||
svg->mStrokeWidth.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(1));
|
||||
|
|
|
@ -3433,11 +3433,11 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
|
|||
eUnit_CSSValuePair);
|
||||
return true;
|
||||
}
|
||||
if (paint.mType == eStyleSVGPaintType_ObjectFill ||
|
||||
paint.mType == eStyleSVGPaintType_ObjectStroke) {
|
||||
if (paint.mType == eStyleSVGPaintType_ContextFill ||
|
||||
paint.mType == eStyleSVGPaintType_ContextStroke) {
|
||||
nsAutoPtr<nsCSSValuePair> pair(new nsCSSValuePair);
|
||||
pair->mXValue.SetIntValue(paint.mType == eStyleSVGPaintType_ObjectFill ?
|
||||
NS_COLOR_OBJECTFILL : NS_COLOR_OBJECTSTROKE,
|
||||
pair->mXValue.SetIntValue(paint.mType == eStyleSVGPaintType_ContextFill ?
|
||||
NS_COLOR_CONTEXT_FILL : NS_COLOR_CONTEXT_STROKE,
|
||||
eCSSUnit_Enumerated);
|
||||
pair->mYValue.SetColorValue(paint.mFallbackColor);
|
||||
aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(),
|
||||
|
|
|
@ -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_ACTIVEHYPERLINKTEXT -6
|
||||
// Only valid as paints in SVG glyphs
|
||||
#define NS_COLOR_OBJECTFILL -7
|
||||
#define NS_COLOR_OBJECTSTROKE -8
|
||||
#define NS_COLOR_CONTEXT_FILL -7
|
||||
#define NS_COLOR_CONTEXT_STROKE -8
|
||||
|
||||
// See nsStyleDisplay
|
||||
#define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0
|
||||
|
@ -914,7 +914,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
|||
#define NS_STYLE_STROKE_LINEJOIN_BEVEL 2
|
||||
|
||||
// stroke-dasharray, stroke-dashoffset, stroke-width
|
||||
#define NS_STYLE_STROKE_PROP_OBJECTVALUE 0
|
||||
#define NS_STYLE_STROKE_PROP_CONTEXT_VALUE 0
|
||||
|
||||
// text-anchor
|
||||
#define NS_STYLE_TEXT_ANCHOR_START 0
|
||||
|
@ -943,9 +943,9 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
|||
#define NS_STYLE_TRANSFORM_STYLE_FLAT 0
|
||||
#define NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D 1
|
||||
|
||||
// object {fill,stroke}-opacity for SVG glyphs
|
||||
#define NS_STYLE_OBJECT_FILL_OPACITY 0
|
||||
#define NS_STYLE_OBJECT_STROKE_OPACITY 1
|
||||
// object {fill,stroke}-opacity inherited from context for SVG glyphs
|
||||
#define NS_STYLE_CONTEXT_FILL_OPACITY 0
|
||||
#define NS_STYLE_CONTEXT_STROKE_OPACITY 1
|
||||
|
||||
// blending
|
||||
#define NS_STYLE_BLEND_NORMAL 0
|
||||
|
|
|
@ -2280,14 +2280,14 @@ enum nsStyleSVGPaintType {
|
|||
eStyleSVGPaintType_None = 1,
|
||||
eStyleSVGPaintType_Color,
|
||||
eStyleSVGPaintType_Server,
|
||||
eStyleSVGPaintType_ObjectFill,
|
||||
eStyleSVGPaintType_ObjectStroke
|
||||
eStyleSVGPaintType_ContextFill,
|
||||
eStyleSVGPaintType_ContextStroke
|
||||
};
|
||||
|
||||
enum nsStyleSVGOpacitySource {
|
||||
eStyleSVGOpacitySource_Normal,
|
||||
eStyleSVGOpacitySource_ObjectFillOpacity,
|
||||
eStyleSVGOpacitySource_ObjectStrokeOpacity
|
||||
eStyleSVGOpacitySource_ContextFillOpacity,
|
||||
eStyleSVGOpacitySource_ContextStrokeOpacity
|
||||
};
|
||||
|
||||
struct nsStyleSVGPaint
|
||||
|
|
|
@ -3479,14 +3479,14 @@ var gCSSProperties = {
|
|||
type: CSS_TYPE_LONGHAND,
|
||||
prerequisites: { "color": "blue" },
|
||||
initial_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)" ],
|
||||
other_values: [ "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "none", "currentColor", "-moz-objectFill", "-moz-objectStroke" ],
|
||||
other_values: [ "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "none", "currentColor", "context-fill", "context-stroke" ],
|
||||
invalid_values: [ "000000", "ff00ff" ]
|
||||
},
|
||||
"fill-opacity": {
|
||||
domProp: "fillOpacity",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "1", "2.8", "1.000", "-moz-objectFillOpacity", "-moz-objectStrokeOpacity" ],
|
||||
initial_values: [ "1", "2.8", "1.000", "context-fill-opacity", "context-stroke-opacity" ],
|
||||
other_values: [ "0", "0.3", "-7.3" ],
|
||||
invalid_values: []
|
||||
},
|
||||
|
@ -3611,14 +3611,14 @@ var gCSSProperties = {
|
|||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)", "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "currentColor", "-moz-objectFill", "-moz-objectStroke" ],
|
||||
other_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)", "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "currentColor", "context-fill", "context-stroke" ],
|
||||
invalid_values: [ "000000", "ff00ff" ]
|
||||
},
|
||||
"stroke-dasharray": {
|
||||
domProp: "strokeDasharray",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none", "-moz-objectValue" ],
|
||||
initial_values: [ "none", "context-value" ],
|
||||
other_values: [ "5px,3px,2px", "5px 3px 2px", " 5px ,3px , 2px ", "1px", "5%", "3em" ],
|
||||
invalid_values: [ "-5px,3px,2px", "5px,3px,-2px" ]
|
||||
},
|
||||
|
@ -3626,7 +3626,7 @@ var gCSSProperties = {
|
|||
domProp: "strokeDashoffset",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "0", "-0px", "0em", "-moz-objectValue" ],
|
||||
initial_values: [ "0", "-0px", "0em", "context-value" ],
|
||||
other_values: [ "3px", "3%", "1em" ],
|
||||
invalid_values: []
|
||||
},
|
||||
|
@ -3658,7 +3658,7 @@ var gCSSProperties = {
|
|||
domProp: "strokeOpacity",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "1", "2.8", "1.000", "-moz-objectFillOpacity", "-moz-objectStrokeOpacity" ],
|
||||
initial_values: [ "1", "2.8", "1.000", "context-fill-opacity", "context-stroke-opacity" ],
|
||||
other_values: [ "0", "0.3", "-7.3" ],
|
||||
invalid_values: []
|
||||
},
|
||||
|
@ -3666,7 +3666,7 @@ var gCSSProperties = {
|
|||
domProp: "strokeWidth",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "1px", "-moz-objectValue" ],
|
||||
initial_values: [ "1px", "context-value" ],
|
||||
other_values: [ "0", "0px", "-0em", "17px", "0.2em" ],
|
||||
invalid_values: [ "-0.1px", "-3px" ]
|
||||
},
|
||||
|
|
|
@ -1056,14 +1056,14 @@ nsSVGGlyphFrame::SetupContextPaint(gfxContext *aContext,
|
|||
const nsStyleSVG *style = StyleSVG();
|
||||
const nsStyleSVGPaint &paint = style->*aFillOrStroke;
|
||||
|
||||
if (paint.mType != eStyleSVGPaintType_ObjectFill &&
|
||||
paint.mType != eStyleSVGPaintType_ObjectStroke) {
|
||||
if (paint.mType != eStyleSVGPaintType_ContextFill &&
|
||||
paint.mType != eStyleSVGPaintType_ContextStroke) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gfxMatrix current = aContext->CurrentMatrix();
|
||||
nsRefPtr<gfxPattern> pattern =
|
||||
paint.mType == eStyleSVGPaintType_ObjectFill ?
|
||||
paint.mType == eStyleSVGPaintType_ContextFill ?
|
||||
aOuterContextPaint->GetFillPattern(aOpacity, current) :
|
||||
aOuterContextPaint->GetStrokePattern(aOpacity, current);
|
||||
if (!pattern) {
|
||||
|
@ -1132,12 +1132,12 @@ mozilla::SVGTextContextPaint::Paint::GetPattern(float aOpacity,
|
|||
}
|
||||
pattern->SetMatrix(aCTM * mPatternMatrix);
|
||||
break;
|
||||
case eStyleSVGPaintType_ObjectFill:
|
||||
case eStyleSVGPaintType_ContextFill:
|
||||
pattern = mPaintDefinition.mContextPaint->GetFillPattern(aOpacity, aCTM);
|
||||
// Don't cache this. mContextPaint will have cached it anyway. If we
|
||||
// cache it, we'll have to compute mPatternMatrix, which is annoying.
|
||||
return pattern.forget();
|
||||
case eStyleSVGPaintType_ObjectStroke:
|
||||
case eStyleSVGPaintType_ContextStroke:
|
||||
pattern = mPaintDefinition.mContextPaint->GetStrokePattern(aOpacity, aCTM);
|
||||
// Don't cache this. mContextPaint will have cached it anyway. If we
|
||||
// cache it, we'll have to compute mPatternMatrix, which is annoying.
|
||||
|
|
|
@ -63,8 +63,8 @@ struct SVGTextContextPaint : public gfxTextContextPaint {
|
|||
|
||||
void SetContextPaint(gfxTextContextPaint *aContextPaint,
|
||||
nsStyleSVGPaintType aPaintType) {
|
||||
NS_ASSERTION(aPaintType == eStyleSVGPaintType_ObjectFill ||
|
||||
aPaintType == eStyleSVGPaintType_ObjectStroke,
|
||||
NS_ASSERTION(aPaintType == eStyleSVGPaintType_ContextFill ||
|
||||
aPaintType == eStyleSVGPaintType_ContextStroke,
|
||||
"Invalid context paint type");
|
||||
mPaintType = aPaintType;
|
||||
mPaintDefinition.mContextPaint = aContextPaint;
|
||||
|
|
|
@ -3525,7 +3525,7 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
|||
SVGCharClipDisplayItem item(run);
|
||||
|
||||
// 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);
|
||||
gfxTextContextPaint *outerContextPaint =
|
||||
(gfxTextContextPaint*)aContext->GetUserData(&gfxTextContextPaint::sUserDataKey);
|
||||
|
@ -5505,14 +5505,14 @@ nsSVGTextFrame2::SetupContextPaint(gfxContext* aContext,
|
|||
const nsStyleSVG *style = aFrame->StyleSVG();
|
||||
const nsStyleSVGPaint &paint = style->*aFillOrStroke;
|
||||
|
||||
if (paint.mType != eStyleSVGPaintType_ObjectFill &&
|
||||
paint.mType != eStyleSVGPaintType_ObjectStroke) {
|
||||
if (paint.mType != eStyleSVGPaintType_ContextFill &&
|
||||
paint.mType != eStyleSVGPaintType_ContextStroke) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gfxMatrix current = aContext->CurrentMatrix();
|
||||
nsRefPtr<gfxPattern> pattern =
|
||||
paint.mType == eStyleSVGPaintType_ObjectFill ?
|
||||
paint.mType == eStyleSVGPaintType_ContextFill ?
|
||||
aOuterContextPaint->GetFillPattern(aOpacity, current) :
|
||||
aOuterContextPaint->GetStrokePattern(aOpacity, current);
|
||||
if (!pattern) {
|
||||
|
|
|
@ -1436,8 +1436,8 @@ nsSVGUtils::GetFallbackOrPaintColor(gfxContext *aContext, nsStyleContext *aStyle
|
|||
const nsStyleSVGPaint &paint = aStyleContext->StyleSVG()->*aFillOrStroke;
|
||||
nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited();
|
||||
bool isServer = paint.mType == eStyleSVGPaintType_Server ||
|
||||
paint.mType == eStyleSVGPaintType_ObjectFill ||
|
||||
paint.mType == eStyleSVGPaintType_ObjectStroke;
|
||||
paint.mType == eStyleSVGPaintType_ContextFill ||
|
||||
paint.mType == eStyleSVGPaintType_ContextStroke;
|
||||
nscolor color = isServer ? paint.mFallbackColor : paint.mPaint.mColor;
|
||||
if (styleIfVisited) {
|
||||
const nsStyleSVGPaint &paintIfVisited =
|
||||
|
@ -1496,10 +1496,10 @@ nsSVGUtils::SetupContextPaint(gfxContext *aContext,
|
|||
}
|
||||
|
||||
switch (aPaint.mType) {
|
||||
case eStyleSVGPaintType_ObjectFill:
|
||||
case eStyleSVGPaintType_ContextFill:
|
||||
pattern = aContextPaint->GetFillPattern(aOpacity, aContext->CurrentMatrix());
|
||||
break;
|
||||
case eStyleSVGPaintType_ObjectStroke:
|
||||
case eStyleSVGPaintType_ContextStroke:
|
||||
pattern = aContextPaint->GetStrokePattern(aOpacity, aContext->CurrentMatrix());
|
||||
break;
|
||||
default:
|
||||
|
@ -1591,18 +1591,18 @@ nsSVGUtils::GetOpacity(nsStyleSVGOpacitySource aOpacityType,
|
|||
case eStyleSVGOpacitySource_Normal:
|
||||
opacity = aOpacity;
|
||||
break;
|
||||
case eStyleSVGOpacitySource_ObjectFillOpacity:
|
||||
case eStyleSVGOpacitySource_ContextFillOpacity:
|
||||
if (aOuterContextPaint) {
|
||||
opacity = aOuterContextPaint->GetFillOpacity();
|
||||
} else {
|
||||
NS_WARNING("objectFillOpacity used outside of an SVG glyph");
|
||||
NS_WARNING("context-fill-opacity used outside of an SVG glyph");
|
||||
}
|
||||
break;
|
||||
case eStyleSVGOpacitySource_ObjectStrokeOpacity:
|
||||
case eStyleSVGOpacitySource_ContextStrokeOpacity:
|
||||
if (aOuterContextPaint) {
|
||||
opacity = aOuterContextPaint->GetStrokeOpacity();
|
||||
} else {
|
||||
NS_WARNING("objectStrokeOpacity used outside of an SVG glyph");
|
||||
NS_WARNING("context-stroke-opacity used outside of an SVG glyph");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Загрузка…
Ссылка в новой задаче