/*
* Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderStyle e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case BNONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CompositeOperator e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CompositeClear:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case NoControlPart:
case MediaVolumeSliderPart:
m_value.ident = CSSValueMediaVolumeSlider;
break;
+ case MediaVolumeSliderMuteButtonPart:
+ m_value.ident = CSSValueMediaVolumeSliderMuteButton;
+ break;
case MediaVolumeSliderThumbPart:
m_value.ident = CSSValueMediaVolumeSliderthumb;
break;
case MenulistTextFieldPart:
m_value.ident = CSSValueMenulistTextfield;
break;
+ case MeterPart:
+ m_value.ident = CSSValueMeter;
+ break;
+ case RelevancyLevelIndicatorPart:
+ m_value.ident = CSSValueRelevancyLevelIndicator;
+ break;
+ case ContinuousCapacityLevelIndicatorPart:
+ m_value.ident = CSSValueContinuousCapacityLevelIndicator;
+ break;
+ case DiscreteCapacityLevelIndicatorPart:
+ m_value.ident = CSSValueDiscreteCapacityLevelIndicator;
+ break;
+ case RatingLevelIndicatorPart:
+ m_value.ident = CSSValueRatingLevelIndicator;
+ break;
case OuterSpinButtonPart:
m_value.ident = CSSValueOuterSpinButton;
break;
+ case ProgressBarPart:
+#if ENABLE(PROGRESS_TAG)
+ m_value.ident = CSSValueProgressBar;
+#endif
+ break;
+ case ProgressBarValuePart:
+#if ENABLE(PROGRESS_TAG)
+ m_value.ident = CSSValueProgressBarValue;
+#endif
+ break;
case SliderHorizontalPart:
m_value.ident = CSSValueSliderHorizontal;
break;
case CapsLockIndicatorPart:
m_value.ident = CSSValueCapsLockIndicator;
break;
+ case InputSpeechButtonPart:
+#if ENABLE(INPUT_SPEECH)
+ m_value.ident = CSSValueInputSpeechButton;
+#endif
+ break;
}
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillAttachment e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case ScrollBackgroundAttachment:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case BorderFillBox:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillRepeat e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case RepeatFill:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxAlignment e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case BSTRETCH:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDirection e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case BNORMAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxLines e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case SINGLE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxOrient e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case HORIZONTAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CAPLEFT:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CNONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CURSOR_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case INLINE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EEmptyCell e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case SHOW:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case FNONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EKHTMLLineBreak e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case LBNORMAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStylePosition e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case OUTSIDE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case Afar:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarginCollapse e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case MCOLLAPSE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeBehavior e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case MNONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeDirection e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case MFORWARD:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMatchNearestMailBlockquoteColor e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case BCNORMAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ENBSPMode e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case NBNORMAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case OVISIBLE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case PBAUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case StaticPosition:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case RESIZE_BOTH:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case TAUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case TAAUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case TSNONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CAPITALIZE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case UBNormal:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case DRAG_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case READ_ONLY:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case SELECT_NONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case VISIBLE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case NORMAL:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case NormalWordBreak:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordWrap e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case NormalWordWrap:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case LTR:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case PE_NONE:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (smoothing) {
case AutoSmoothing:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case AutoTextRendering:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (space) {
case DeviceColorSpace:
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
+ : m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
+{
+ switch (hyphens) {
+ case HyphensNone:
+ m_value.ident = CSSValueNone;
+ break;
+ case HyphensManual:
+ m_value.ident = CSSValueManual;
+ break;
+ case HyphensAuto:
+ m_value.ident = CSSValueAuto;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator Hyphens() const
+{
+ switch (m_value.ident) {
+ case CSSValueNone:
+ return HyphensNone;
+ case CSSValueManual:
+ return HyphensManual;
+ case CSSValueAuto:
+ return HyphensAuto;
+ default:
+ ASSERT_NOT_REACHED();
+ return HyphensAuto;
+ }
+}
+
#if ENABLE(SVG)
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case ButtCap:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case MiterJoin:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case RULE_NONZERO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case AB_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CI_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case CR_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case DB_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case IR_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case IR_AUTO:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case TA_START:
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWritingMode e)
: m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
{
switch (e) {
case WM_LRTB:
return static_cast<EWritingMode>(m_value.ident - CSSValueLrTb);
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
+ : m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
+{
+ switch (e) {
+ case VE_NONE:
+ m_value.ident = CSSValueNone;
+ break;
+ case VE_NON_SCALING_STROKE:
+ m_value.ident = CSSValueNonScalingStroke;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator EVectorEffect() const
+{
+ switch (m_value.ident) {
+ case CSSValueNone:
+ return VE_NONE;
+ case CSSValueNonScalingStroke:
+ return VE_NON_SCALING_STROKE;
+ default:
+ ASSERT_NOT_REACHED();
+ return VE_NONE;
+ }
+}
+
#endif
}