Commit 920b8e07 authored by mitz@apple.com's avatar mitz@apple.com

2008-03-19 Dan Bernstein <mitz@apple.com>

        Rubber-stamped by John Sullivan.

        - change CSS property and value keyword constants from all-caps with
          underscores to intra-caps.

        * css/makeprop.pl:
        * css/makevalues.pl:
        * All files using the constants



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 14abdfbf
2008-03-19 Dan Bernstein <mitz@apple.com>
Rubber-stamped by John Sullivan.
- change CSS property and value keyword constants from all-caps with
underscores to intra-caps.
* css/makeprop.pl:
* css/makevalues.pl:
* All files using the constants
2008-03-19 Adam Roben <aroben@apple.com>
Make clicking anywhere in a row in the DOM tree select that row's node
This diff is collapsed.
......@@ -90,9 +90,9 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
{
// Obtain the font-family property and the src property. Both must be defined.
const CSSMutableStyleDeclaration* style = fontFaceRule->style();
RefPtr<CSSValue> fontFamily = style->getPropertyCSSValue(CSS_PROP_FONT_FAMILY);
RefPtr<CSSValue> src = style->getPropertyCSSValue(CSS_PROP_SRC);
RefPtr<CSSValue> unicodeRange = style->getPropertyCSSValue(CSS_PROP_UNICODE_RANGE);
RefPtr<CSSValue> fontFamily = style->getPropertyCSSValue(CSSPropertyFontFamily);
RefPtr<CSSValue> src = style->getPropertyCSSValue(CSSPropertySrc);
RefPtr<CSSValue> unicodeRange = style->getPropertyCSSValue(CSSPropertyUnicodeRange);
if (!fontFamily || !src || !fontFamily->isValueList() || !src->isValueList() || unicodeRange && !unicodeRange->isValueList())
return;
......@@ -109,27 +109,27 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
// Create a FontDescription for this font and set up bold/italic info properly.
FontDescription fontDescription;
if (RefPtr<CSSValue> fontStyle = style->getPropertyCSSValue(CSS_PROP_FONT_STYLE))
fontDescription.setItalic(static_cast<CSSPrimitiveValue*>(fontStyle.get())->getIdent() != CSS_VAL_NORMAL);
if (RefPtr<CSSValue> fontStyle = style->getPropertyCSSValue(CSSPropertyFontStyle))
fontDescription.setItalic(static_cast<CSSPrimitiveValue*>(fontStyle.get())->getIdent() != CSSValueNormal);
if (RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSS_PROP_FONT_WEIGHT)) {
if (RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight)) {
// FIXME: Need to support weights for real, since we're effectively limiting the number of supported weights to two.
// This behavior could also result in the "last kinda bold variant" described winning even if it isn't the best match for bold.
switch (static_cast<CSSPrimitiveValue*>(fontWeight.get())->getIdent()) {
case CSS_VAL_BOLD:
case CSS_VAL_BOLDER:
case CSS_VAL_600:
case CSS_VAL_700:
case CSS_VAL_800:
case CSS_VAL_900:
case CSSValueBold:
case CSSValueBolder:
case CSSValue600:
case CSSValue700:
case CSSValue800:
case CSSValue900:
fontDescription.setWeight(cBoldWeight);
default:
break;
}
}
if (RefPtr<CSSValue> fontVariant = style->getPropertyCSSValue(CSS_PROP_FONT_VARIANT))
fontDescription.setSmallCaps(static_cast<CSSPrimitiveValue*>(fontVariant.get())->getIdent() == CSS_VAL_SMALL_CAPS);
if (RefPtr<CSSValue> fontVariant = style->getPropertyCSSValue(CSSPropertyFontVariant))
fontDescription.setSmallCaps(static_cast<CSSPrimitiveValue*>(fontVariant.get())->getIdent() == CSSValueSmallCaps);
// Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
CSSFontFace* fontFace = 0;
......@@ -212,19 +212,19 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
// defining what font to use for those types.
String familyName;
switch (item->getIdent()) {
case CSS_VAL_SERIF:
case CSSValueSerif:
familyName = "-webkit-serif";
break;
case CSS_VAL_SANS_SERIF:
case CSSValueSansSerif:
familyName = "-webkit-sans-serif";
break;
case CSS_VAL_CURSIVE:
case CSSValueCursive:
familyName = "-webkit-cursive";
break;
case CSS_VAL_FANTASY:
case CSSValueFantasy:
familyName = "-webkit-fantasy";
break;
case CSS_VAL_MONOSPACE:
case CSSValueMonospace:
familyName = "-webkit-monospace";
break;
default:
......
......@@ -36,7 +36,7 @@ CSSImageValue::CSSImageValue(const String& url, StyleBase* style)
}
CSSImageValue::CSSImageValue()
: CSSPrimitiveValue(CSS_VAL_NONE)
: CSSPrimitiveValue(CSSValueNone)
, m_image(0)
, m_accessedImage(true)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -142,7 +142,7 @@ CSSPrimitiveValue::CSSPrimitiveValue(const Length& length)
switch (length.type()) {
case Auto:
m_type = CSS_IDENT;
m_value.ident = CSS_VAL_AUTO;
m_value.ident = CSSValueAuto;
break;
case WebCore::Fixed:
m_type = CSS_PX;
......@@ -150,11 +150,11 @@ CSSPrimitiveValue::CSSPrimitiveValue(const Length& length)
break;
case Intrinsic:
m_type = CSS_IDENT;
m_value.ident = CSS_VAL_INTRINSIC;
m_value.ident = CSSValueIntrinsic;
break;
case MinIntrinsic:
m_type = CSS_IDENT;
m_value.ident = CSS_VAL_MIN_INTRINSIC;
m_value.ident = CSSValueMinIntrinsic;
break;
case Percent:
m_type = CSS_PERCENTAGE;
......@@ -692,13 +692,13 @@ String CSSPrimitiveValue::cssText() const
text += " rectangle";
else
break;
if (region->top()->m_type == CSS_IDENT && region->top()->getIdent() == CSS_VAL_INVALID) {
if (region->top()->m_type == CSS_IDENT && region->top()->getIdent() == CSSValueInvalid) {
ASSERT(region->right()->m_type == CSS_IDENT);
ASSERT(region->bottom()->m_type == CSS_IDENT);
ASSERT(region->left()->m_type == CSS_IDENT);
ASSERT(region->right()->getIdent() == CSS_VAL_INVALID);
ASSERT(region->bottom()->getIdent() == CSS_VAL_INVALID);
ASSERT(region->left()->getIdent() == CSS_VAL_INVALID);
ASSERT(region->right()->getIdent() == CSSValueInvalid);
ASSERT(region->bottom()->getIdent() == CSSValueInvalid);
ASSERT(region->left()->getIdent() == CSSValueInvalid);
} else {
text.append(' ');
text += region->top()->cssText() + " ";
......
This diff is collapsed.
This diff is collapsed.
......@@ -64,114 +64,114 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro
return 0;
switch (static_cast<CSSPropertyID>(propertyID)) {
case CSS_PROP_CLIP_RULE:
case CSSPropertyClipRule:
return new CSSPrimitiveValue(svgStyle->clipRule());
case CSS_PROP_FLOOD_OPACITY:
case CSSPropertyFloodOpacity:
return new CSSPrimitiveValue(svgStyle->floodOpacity(), CSSPrimitiveValue::CSS_NUMBER);
case CSS_PROP_STOP_OPACITY:
case CSSPropertyStopOpacity:
return new CSSPrimitiveValue(svgStyle->stopOpacity(), CSSPrimitiveValue::CSS_NUMBER);
case CSS_PROP_POINTER_EVENTS:
case CSSPropertyPointerEvents:
return new CSSPrimitiveValue(svgStyle->pointerEvents());
case CSS_PROP_COLOR_INTERPOLATION:
case CSSPropertyColorInterpolation:
return new CSSPrimitiveValue(svgStyle->colorInterpolation());
case CSS_PROP_COLOR_INTERPOLATION_FILTERS:
case CSSPropertyColorInterpolationFilters:
return new CSSPrimitiveValue(svgStyle->colorInterpolationFilters());
case CSS_PROP_FILL_OPACITY:
case CSSPropertyFillOpacity:
return new CSSPrimitiveValue(svgStyle->fillOpacity(), CSSPrimitiveValue::CSS_NUMBER);
case CSS_PROP_FILL_RULE:
case CSSPropertyFillRule:
return new CSSPrimitiveValue(svgStyle->fillRule());
case CSS_PROP_COLOR_RENDERING:
case CSSPropertyColorRendering:
return new CSSPrimitiveValue(svgStyle->colorRendering());
case CSS_PROP_IMAGE_RENDERING:
case CSSPropertyImageRendering:
return new CSSPrimitiveValue(svgStyle->imageRendering());
case CSS_PROP_SHAPE_RENDERING:
case CSSPropertyShapeRendering:
return new CSSPrimitiveValue(svgStyle->shapeRendering());
case CSS_PROP_STROKE_LINECAP:
case CSSPropertyStrokeLinecap:
return new CSSPrimitiveValue(svgStyle->capStyle());
case CSS_PROP_STROKE_LINEJOIN:
case CSSPropertyStrokeLinejoin:
return new CSSPrimitiveValue(svgStyle->joinStyle());
case CSS_PROP_STROKE_MITERLIMIT:
case CSSPropertyStrokeMiterlimit:
return new CSSPrimitiveValue(svgStyle->strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
case CSS_PROP_STROKE_OPACITY:
case CSSPropertyStrokeOpacity:
return new CSSPrimitiveValue(svgStyle->strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
case CSS_PROP_TEXT_RENDERING:
case CSSPropertyTextRendering:
return new CSSPrimitiveValue(svgStyle->textRendering());
case CSS_PROP_ALIGNMENT_BASELINE:
case CSSPropertyAlignmentBaseline:
return new CSSPrimitiveValue(svgStyle->alignmentBaseline());
case CSS_PROP_DOMINANT_BASELINE:
case CSSPropertyDominantBaseline:
return new CSSPrimitiveValue(svgStyle->dominantBaseline());
case CSS_PROP_TEXT_ANCHOR:
case CSSPropertyTextAnchor:
return new CSSPrimitiveValue(svgStyle->textAnchor());
case CSS_PROP_WRITING_MODE:
case CSSPropertyWritingMode:
return new CSSPrimitiveValue(svgStyle->writingMode());
case CSS_PROP_CLIP_PATH:
case CSSPropertyClipPath:
if (!svgStyle->clipPath().isEmpty())
return new CSSPrimitiveValue(svgStyle->clipPath(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_MASK:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyMask:
if (!svgStyle->maskElement().isEmpty())
return new CSSPrimitiveValue(svgStyle->maskElement(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_FILTER:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyFilter:
if (!svgStyle->filter().isEmpty())
return new CSSPrimitiveValue(svgStyle->filter(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_FLOOD_COLOR:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyFloodColor:
return new CSSPrimitiveValue(svgStyle->floodColor().rgb());
case CSS_PROP_LIGHTING_COLOR:
case CSSPropertyLightingColor:
return new CSSPrimitiveValue(svgStyle->lightingColor().rgb());
case CSS_PROP_STOP_COLOR:
case CSSPropertyStopColor:
return new CSSPrimitiveValue(svgStyle->stopColor().rgb());
case CSS_PROP_FILL:
case CSSPropertyFill:
return svgStyle->fillPaint();
case CSS_PROP_KERNING:
case CSSPropertyKerning:
return svgStyle->kerning();
case CSS_PROP_MARKER_END:
case CSSPropertyMarkerEnd:
if (!svgStyle->endMarker().isEmpty())
return new CSSPrimitiveValue(svgStyle->endMarker(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_MARKER_MID:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyMarkerMid:
if (!svgStyle->midMarker().isEmpty())
return new CSSPrimitiveValue(svgStyle->midMarker(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_MARKER_START:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyMarkerStart:
if (!svgStyle->startMarker().isEmpty())
return new CSSPrimitiveValue(svgStyle->startMarker(), CSSPrimitiveValue::CSS_URI);
return new CSSPrimitiveValue(CSS_VAL_NONE);
case CSS_PROP_STROKE:
return new CSSPrimitiveValue(CSSValueNone);
case CSSPropertyStroke:
return svgStyle->strokePaint();
case CSS_PROP_STROKE_DASHARRAY:
case CSSPropertyStrokeDasharray:
return svgStyle->strokeDashArray();
case CSS_PROP_STROKE_DASHOFFSET:
case CSSPropertyStrokeDashoffset:
return svgStyle->strokeDashOffset();
case CSS_PROP_STROKE_WIDTH:
case CSSPropertyStrokeWidth:
return svgStyle->strokeWidth();
case CSS_PROP_BASELINE_SHIFT: {
case CSSPropertyBaselineShift: {
switch (svgStyle->baselineShift()) {
case BS_BASELINE:
return new CSSPrimitiveValue(CSS_VAL_BASELINE);
return new CSSPrimitiveValue(CSSValueBaseline);
case BS_SUPER:
return new CSSPrimitiveValue(CSS_VAL_SUPER);
return new CSSPrimitiveValue(CSSValueSuper);
case BS_SUB:
return new CSSPrimitiveValue(CSS_VAL_SUB);
return new CSSPrimitiveValue(CSSValueSub);
case BS_LENGTH:
return svgStyle->baselineShiftValue();
}
}
case CSS_PROP_GLYPH_ORIENTATION_HORIZONTAL:
case CSSPropertyGlyphOrientationHorizontal:
return glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientationHorizontal());
case CSS_PROP_GLYPH_ORIENTATION_VERTICAL: {
case CSSPropertyGlyphOrientationVertical: {
if (CSSPrimitiveValue* value = glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientationVertical()))
return value;
if (svgStyle->glyphOrientationVertical() == GO_AUTO)
return new CSSPrimitiveValue(CSS_VAL_AUTO);
return new CSSPrimitiveValue(CSSValueAuto);
return 0;
}
case CSS_PROP_MARKER:
case CSS_PROP_ENABLE_BACKGROUND:
case CSS_PROP_COLOR_PROFILE:
case CSSPropertyMarker:
case CSSPropertyEnableBackground:
case CSSPropertyColorProfile:
// the above properties are not yet implemented in the engine
break;
default:
......
......@@ -52,45 +52,45 @@ bool CSSParser::parseSVGValue(int propId, bool important)
switch (propId) {
/* The comment to the right defines all valid value of these
* properties as defined in SVG 1.1, Appendix N. Property index */
case CSS_PROP_ALIGNMENT_BASELINE:
case CSSPropertyAlignmentBaseline:
// auto | baseline | before-edge | text-before-edge | middle |
// central | after-edge | text-after-edge | ideographic | alphabetic |
// hanging | mathematical | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_BASELINE || id == CSS_VAL_MIDDLE ||
(id >= CSS_VAL_BEFORE_EDGE && id <= CSS_VAL_MATHEMATICAL))
if (id == CSSValueAuto || id == CSSValueBaseline || id == CSSValueMiddle ||
(id >= CSSValueBeforeEdge && id <= CSSValueMathematical))
valid_primitive = true;
break;
case CSS_PROP_BASELINE_SHIFT:
case CSSPropertyBaselineShift:
// baseline | super | sub | <percentage> | <length> | inherit
if (id == CSS_VAL_BASELINE || id == CSS_VAL_SUB ||
id >= CSS_VAL_SUPER)
if (id == CSSValueBaseline || id == CSSValueSub ||
id >= CSSValueSuper)
valid_primitive = true;
else
valid_primitive = validUnit(value, FLength|FPercent, false);
break;
case CSS_PROP_DOMINANT_BASELINE:
case CSSPropertyDominantBaseline:
// auto | use-script | no-change | reset-size | ideographic |
// alphabetic | hanging | mathematical | central | middle |
// text-after-edge | text-before-edge | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_MIDDLE ||
(id >= CSS_VAL_USE_SCRIPT && id <= CSS_VAL_RESET_SIZE) ||
(id >= CSS_VAL_CENTRAL && id <= CSS_VAL_MATHEMATICAL))
if (id == CSSValueAuto || id == CSSValueMiddle ||
(id >= CSSValueUseScript && id <= CSSValueResetSize) ||
(id >= CSSValueCentral && id <= CSSValueMathematical))
valid_primitive = true;
break;
case CSS_PROP_ENABLE_BACKGROUND:
case CSSPropertyEnableBackground:
// accumulate | new [x] [y] [width] [height] | inherit
if (id == CSS_VAL_ACCUMULATE) // TODO : new
if (id == CSSValueAccumulate) // TODO : new
valid_primitive = true;
break;
case CSS_PROP_MARKER_START:
case CSS_PROP_MARKER_MID:
case CSS_PROP_MARKER_END:
case CSS_PROP_MASK:
if (id == CSS_VAL_NONE)
case CSSPropertyMarkerStart:
case CSSPropertyMarkerMid:
case CSSPropertyMarkerEnd:
case CSSPropertyMask:
if (id == CSSValueNone)
valid_primitive = true;
else if (value->unit == CSSPrimitiveValue::CSS_URI) {
parsedValue = new CSSPrimitiveValue(value->string, CSSPrimitiveValue::CSS_URI);
......@@ -99,61 +99,61 @@ bool CSSParser::parseSVGValue(int propId, bool important)
}
break;
case CSS_PROP_CLIP_RULE: // nonzero | evenodd | inherit
case CSS_PROP_FILL_RULE:
if (id == CSS_VAL_NONZERO || id == CSS_VAL_EVENODD)
case CSSPropertyClipRule: // nonzero | evenodd | inherit
case CSSPropertyFillRule:
if (id == CSSValueNonzero || id == CSSValueEvenodd)
valid_primitive = true;
break;
case CSS_PROP_STROKE_MITERLIMIT: // <miterlimit> | inherit
case CSSPropertyStrokeMiterlimit: // <miterlimit> | inherit
valid_primitive = validUnit(value, FNumber|FNonNeg, false);
break;
case CSS_PROP_STROKE_LINEJOIN: // miter | round | bevel | inherit
if (id == CSS_VAL_MITER || id == CSS_VAL_ROUND || id == CSS_VAL_BEVEL)
case CSSPropertyStrokeLinejoin: // miter | round | bevel | inherit
if (id == CSSValueMiter || id == CSSValueRound || id == CSSValueBevel)
valid_primitive = true;
break;
case CSS_PROP_STROKE_LINECAP: // butt | round | square | inherit
if (id == CSS_VAL_BUTT || id == CSS_VAL_ROUND || id == CSS_VAL_SQUARE)
case CSSPropertyStrokeLinecap: // butt | round | square | inherit
if (id == CSSValueButt || id == CSSValueRound || id == CSSValueSquare)
valid_primitive = true;
break;
case CSS_PROP_STROKE_OPACITY: // <opacity-value> | inherit
case CSS_PROP_FILL_OPACITY:
case CSS_PROP_STOP_OPACITY:
case CSS_PROP_FLOOD_OPACITY:
case CSSPropertyStrokeOpacity: // <opacity-value> | inherit
case CSSPropertyFillOpacity:
case CSSPropertyStopOpacity:
case CSSPropertyFloodOpacity:
valid_primitive = (!id && validUnit(value, FNumber|FPercent, false));
break;
case CSS_PROP_SHAPE_RENDERING:
case CSSPropertyShapeRendering:
// auto | optimizeSpeed | crispEdges | geometricPrecision | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_OPTIMIZESPEED ||
id == CSS_VAL_CRISPEDGES || id == CSS_VAL_GEOMETRICPRECISION)
if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
id == CSSValueCrispedges || id == CSSValueGeometricprecision)
valid_primitive = true;
break;
case CSS_PROP_TEXT_RENDERING: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_OPTIMIZESPEED || id == CSS_VAL_OPTIMIZELEGIBILITY ||
id == CSS_VAL_GEOMETRICPRECISION)
case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit
if (id == CSSValueAuto || id == CSSValueOptimizespeed || id == CSSValueOptimizelegibility ||
id == CSSValueGeometricprecision)
valid_primitive = true;
break;
case CSS_PROP_IMAGE_RENDERING: // auto | optimizeSpeed |
case CSS_PROP_COLOR_RENDERING: // optimizeQuality | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_OPTIMIZESPEED ||
id == CSS_VAL_OPTIMIZEQUALITY)
case CSSPropertyImageRendering: // auto | optimizeSpeed |
case CSSPropertyColorRendering: // optimizeQuality | inherit
if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
id == CSSValueOptimizequality)
valid_primitive = true;
break;
case CSS_PROP_COLOR_PROFILE: // auto | sRGB | <name> | <uri> inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_SRGB)
case CSSPropertyColorProfile: // auto | sRGB | <name> | <uri> inherit
if (id == CSSValueAuto || id == CSSValueSrgb)
valid_primitive = true;
break;
case CSS_PROP_COLOR_INTERPOLATION: // auto | sRGB | linearRGB | inherit
case CSS_PROP_COLOR_INTERPOLATION_FILTERS:
if (id == CSS_VAL_AUTO || id == CSS_VAL_SRGB || id == CSS_VAL_LINEARRGB)
case CSSPropertyColorInterpolation: // auto | sRGB | linearRGB | inherit
case CSSPropertyColorInterpolationFilters:
if (id == CSSValueAuto || id == CSSValueSrgb || id == CSSValueLinearrgb)
valid_primitive = true;
break;
......@@ -161,26 +161,26 @@ bool CSSParser::parseSVGValue(int propId, bool important)
* correctly and allows optimization in applyRule(..)
*/
case CSS_PROP_POINTER_EVENTS:
case CSSPropertyPointerEvents:
// none | visiblePainted | visibleFill | visibleStroke | visible |
// painted | fill | stroke | none | all | inherit
if (id == CSS_VAL_VISIBLE || id == CSS_VAL_NONE ||
(id >= CSS_VAL_VISIBLEPAINTED && id <= CSS_VAL_ALL))
if (id == CSSValueVisible || id == CSSValueNone ||
(id >= CSSValueVisiblepainted && id <= CSSValueAll))
valid_primitive = true;
break;
case CSS_PROP_TEXT_ANCHOR: // start | middle | end | inherit
if (id == CSS_VAL_START || id == CSS_VAL_MIDDLE || id == CSS_VAL_END)
case CSSPropertyTextAnchor: // start | middle | end | inherit
if (id == CSSValueStart || id == CSSValueMiddle || id == CSSValueEnd)
valid_primitive = true;
break;
case CSS_PROP_GLYPH_ORIENTATION_VERTICAL: // auto | <angle> | inherit
if (id == CSS_VAL_AUTO) {
case CSSPropertyGlyphOrientationVertical: // auto | <angle> | inherit
if (id == CSSValueAuto) {
valid_primitive = true;
break;
}
/* fallthrough intentional */
case CSS_PROP_GLYPH_ORIENTATION_HORIZONTAL: // <angle> (restricted to _deg_ per SVG 1.1 spec) | inherit
case CSSPropertyGlyphOrientationHorizontal: // <angle> (restricted to _deg_ per SVG 1.1 spec) | inherit
if (value->unit == CSSPrimitiveValue::CSS_DEG || value->unit == CSSPrimitiveValue::CSS_NUMBER) {
parsedValue = new CSSPrimitiveValue(value->fValue, CSSPrimitiveValue::CSS_DEG);
......@@ -189,12 +189,12 @@ bool CSSParser::parseSVGValue(int propId, bool important)
}
break;
case CSS_PROP_FILL: // <paint> | inherit
case CSS_PROP_STROKE: // <paint> | inherit
case CSSPropertyFill: // <paint> | inherit
case CSSPropertyStroke: // <paint> | inherit
{
if (id == CSS_VAL_NONE)
if (id == CSSValueNone)
parsedValue = new SVGPaint(SVGPaint::SVG_PAINTTYPE_NONE);
else if (id == CSS_VAL_CURRENTCOLOR)
else if (id == CSSValueCurrentcolor)
parsedValue = new SVGPaint(SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR);
else if (value->unit == CSSPrimitiveValue::CSS_URI) {
RGBA32 c = Color::transparent;
......@@ -210,9 +210,9 @@ bool CSSParser::parseSVGValue(int propId, bool important)
}
break;
case CSS_PROP_COLOR: // <color> | inherit
if ((id >= CSS_VAL_AQUA && id <= CSS_VAL_WINDOWTEXT) ||
(id >= CSS_VAL_ALICEBLUE && id <= CSS_VAL_YELLOWGREEN))
case CSSPropertyColor: // <color> | inherit
if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
(id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
parsedValue = new SVGColor(value->string);
else
parsedValue = parseSVGColor();
......@@ -221,13 +221,13 @@ bool CSSParser::parseSVGValue(int propId, bool important)
valueList->next();
break;
case CSS_PROP_STOP_COLOR: // TODO : icccolor
case CSS_PROP_FLOOD_COLOR:
case CSS_PROP_LIGHTING_COLOR:
if ((id >= CSS_VAL_AQUA && id <= CSS_VAL_WINDOWTEXT) ||
(id >= CSS_VAL_ALICEBLUE && id <= CSS_VAL_YELLOWGREEN))
case CSSPropertyStopColor: // TODO : icccolor
case CSSPropertyFloodColor:
case CSSPropertyLightingColor:
if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
(id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
parsedValue = new SVGColor(value->string);
else if (id == CSS_VAL_CURRENTCOLOR)
else if (id == CSSValueCurrentcolor)
parsedValue = new SVGColor(SVGColor::SVG_COLORTYPE_CURRENTCOLOR);
else // TODO : svgcolor (iccColor)
parsedValue = parseSVGColor();
......@@ -237,34 +237,34 @@ bool CSSParser::parseSVGValue(int propId, bool important)
break;
case CSS_PROP_WRITING_MODE:
case CSSPropertyWritingMode:
// lr-tb | rl_tb | tb-rl | lr | rl | tb | inherit
if (id >= CSS_VAL_LR_TB && id <= CSS_VAL_TB)
if (id >= CSSValueLrTb && id <= CSSValueTb)
valid_primitive = true;
break;
case CSS_PROP_STROKE_WIDTH: // <length> | inherit
case CSS_PROP_STROKE_DASHOFFSET:
case CSSPropertyStrokeWidth: // <length> | inherit
case CSSPropertyStrokeDashoffset:
valid_primitive = validUnit(value, FLength | FPercent, false);
break;
case CSS_PROP_STROKE_DASHARRAY: // none | <dasharray> | inherit
if (id == CSS_VAL_NONE)
case CSSPropertyStrokeDasharray: // none | <dasharray> | inherit
if (id == CSSValueNone)
valid_primitive = true;
else
parsedValue = parseSVGStrokeDasharray();
break;
case CSS_PROP_KERNING: // auto | normal | <length> | inherit
if (id == CSS_VAL_AUTO || id == CSS_VAL_NORMAL)
case CSSPropertyKerning: // auto | normal | <length> | inherit
if (id == CSSValueAuto || id == CSSValueNormal)
valid_primitive = true;
else
valid_primitive = validUnit(value, FLength, false);
break;
case CSS_PROP_CLIP_PATH: // <uri> | none | inherit