2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef CSSPrimitiveValueMappings_h
31 #define CSSPrimitiveValueMappings_h
33 #include "ColorSpace.h"
34 #include "CSSPrimitiveValue.h"
35 #include "CSSValueKeywords.h"
36 #include "FontDescription.h"
37 #include "FontSmoothingMode.h"
38 #include "GraphicsTypes.h"
40 #include "RenderStyleConstants.h"
41 #include "SVGRenderStyleDefs.h"
42 #include "TextDirection.h"
43 #include "TextOrientation.h"
44 #include "TextRenderingMode.h"
45 #include "ThemeTypes.h"
46 #include "UnicodeBidi.h"
48 #if ENABLE(CSS_SHADERS)
49 #include "CustomFilterOperation.h"
52 #include <wtf/MathExtras.h>
56 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(short i)
57 : CSSValue(PrimitiveClass)
59 m_primitiveUnitType = CSS_NUMBER;
60 m_value.num = static_cast<double>(i);
63 template<> inline CSSPrimitiveValue::operator short() const
65 if (m_primitiveUnitType == CSS_NUMBER)
66 return clampTo<short>(m_value.num);
72 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(unsigned short i)
73 : CSSValue(PrimitiveClass)
75 m_primitiveUnitType = CSS_NUMBER;
76 m_value.num = static_cast<double>(i);
79 template<> inline CSSPrimitiveValue::operator unsigned short() const
81 if (m_primitiveUnitType == CSS_NUMBER)
82 return clampTo<unsigned short>(m_value.num);
88 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(int i)
89 : CSSValue(PrimitiveClass)
91 m_primitiveUnitType = CSS_NUMBER;
92 m_value.num = static_cast<double>(i);
95 template<> inline CSSPrimitiveValue::operator int() const
97 if (m_primitiveUnitType == CSS_NUMBER)
98 return clampTo<int>(m_value.num);
100 ASSERT_NOT_REACHED();
104 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(unsigned i)
105 : CSSValue(PrimitiveClass)
107 m_primitiveUnitType = CSS_NUMBER;
108 m_value.num = static_cast<double>(i);
111 template<> inline CSSPrimitiveValue::operator unsigned() const
113 if (m_primitiveUnitType == CSS_NUMBER)
114 return clampTo<unsigned>(m_value.num);
116 ASSERT_NOT_REACHED();
121 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(float i)
122 : CSSValue(PrimitiveClass)
124 m_primitiveUnitType = CSS_NUMBER;
125 m_value.num = static_cast<double>(i);
128 template<> inline CSSPrimitiveValue::operator float() const
130 if (m_primitiveUnitType == CSS_NUMBER)
131 return clampTo<float>(m_value.num);
133 ASSERT_NOT_REACHED();
137 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnSpan columnSpan)
138 : CSSValue(PrimitiveClass)
140 switch (columnSpan) {
142 m_primitiveUnitType = CSS_IDENT;
143 m_value.ident = CSSValueAll;
146 m_primitiveUnitType = CSS_NUMBER;
152 template<> inline CSSPrimitiveValue::operator ColumnSpan() const
154 if (m_primitiveUnitType == CSS_IDENT && m_value.ident == CSSValueAll)
155 return ColumnSpanAll;
156 if (m_primitiveUnitType == CSS_NUMBER && m_value.num == 1)
157 return ColumnSpanOne;
158 ASSERT_NOT_REACHED();
159 return ColumnSpanOne;
163 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(PrintColorAdjust value)
164 : CSSValue(PrimitiveClass)
166 m_primitiveUnitType = CSS_IDENT;
168 case PrintColorAdjustExact:
169 m_value.ident = CSSValueExact;
171 case PrintColorAdjustEconomy:
172 m_value.ident = CSSValueEconomy;
177 template<> inline CSSPrimitiveValue::operator PrintColorAdjust() const
179 switch (m_value.ident) {
180 case CSSValueEconomy:
181 return PrintColorAdjustEconomy;
183 return PrintColorAdjustExact;
185 ASSERT_NOT_REACHED();
186 return PrintColorAdjustEconomy;
191 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderStyle e)
192 : CSSValue(PrimitiveClass)
194 m_primitiveUnitType = CSS_IDENT;
197 m_value.ident = CSSValueNone;
200 m_value.ident = CSSValueHidden;
203 m_value.ident = CSSValueInset;
206 m_value.ident = CSSValueGroove;
209 m_value.ident = CSSValueRidge;
212 m_value.ident = CSSValueOutset;
215 m_value.ident = CSSValueDotted;
218 m_value.ident = CSSValueDashed;
221 m_value.ident = CSSValueSolid;
224 m_value.ident = CSSValueDouble;
229 template<> inline CSSPrimitiveValue::operator EBorderStyle() const
231 if (m_value.ident == CSSValueAuto) // Valid for CSS outline-style
233 return (EBorderStyle)(m_value.ident - CSSValueNone);
236 template<> inline CSSPrimitiveValue::operator OutlineIsAuto() const
238 if (m_value.ident == CSSValueAuto)
243 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CompositeOperator e)
244 : CSSValue(PrimitiveClass)
246 m_primitiveUnitType = CSS_IDENT;
249 m_value.ident = CSSValueClear;
252 m_value.ident = CSSValueCopy;
254 case CompositeSourceOver:
255 m_value.ident = CSSValueSourceOver;
257 case CompositeSourceIn:
258 m_value.ident = CSSValueSourceIn;
260 case CompositeSourceOut:
261 m_value.ident = CSSValueSourceOut;
263 case CompositeSourceAtop:
264 m_value.ident = CSSValueSourceAtop;
266 case CompositeDestinationOver:
267 m_value.ident = CSSValueDestinationOver;
269 case CompositeDestinationIn:
270 m_value.ident = CSSValueDestinationIn;
272 case CompositeDestinationOut:
273 m_value.ident = CSSValueDestinationOut;
275 case CompositeDestinationAtop:
276 m_value.ident = CSSValueDestinationAtop;
279 m_value.ident = CSSValueXor;
281 case CompositePlusDarker:
282 m_value.ident = CSSValuePlusDarker;
284 case CompositePlusLighter:
285 m_value.ident = CSSValuePlusLighter;
290 template<> inline CSSPrimitiveValue::operator CompositeOperator() const
292 switch (m_value.ident) {
294 return CompositeClear;
296 return CompositeCopy;
297 case CSSValueSourceOver:
298 return CompositeSourceOver;
299 case CSSValueSourceIn:
300 return CompositeSourceIn;
301 case CSSValueSourceOut:
302 return CompositeSourceOut;
303 case CSSValueSourceAtop:
304 return CompositeSourceAtop;
305 case CSSValueDestinationOver:
306 return CompositeDestinationOver;
307 case CSSValueDestinationIn:
308 return CompositeDestinationIn;
309 case CSSValueDestinationOut:
310 return CompositeDestinationOut;
311 case CSSValueDestinationAtop:
312 return CompositeDestinationAtop;
315 case CSSValuePlusDarker:
316 return CompositePlusDarker;
317 case CSSValuePlusLighter:
318 return CompositePlusLighter;
320 ASSERT_NOT_REACHED();
321 return CompositeClear;
325 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
326 : CSSValue(PrimitiveClass)
328 m_primitiveUnitType = CSS_IDENT;
331 m_value.ident = CSSValueNone;
334 m_value.ident = CSSValueCheckbox;
337 m_value.ident = CSSValueRadio;
340 m_value.ident = CSSValuePushButton;
342 case SquareButtonPart:
343 m_value.ident = CSSValueSquareButton;
346 m_value.ident = CSSValueButton;
348 case ButtonBevelPart:
349 m_value.ident = CSSValueButtonBevel;
351 case DefaultButtonPart:
352 m_value.ident = CSSValueDefaultButton;
354 case InnerSpinButtonPart:
355 m_value.ident = CSSValueInnerSpinButton;
358 m_value.ident = CSSValueListbox;
362 m_value.ident = CSSValueListButton;
366 m_value.ident = CSSValueListitem;
368 case MediaFullscreenButtonPart:
369 m_value.ident = CSSValueMediaFullscreenButton;
371 case MediaPlayButtonPart:
372 m_value.ident = CSSValueMediaPlayButton;
374 case MediaMuteButtonPart:
375 m_value.ident = CSSValueMediaMuteButton;
377 case MediaSeekBackButtonPart:
378 m_value.ident = CSSValueMediaSeekBackButton;
380 case MediaSeekForwardButtonPart:
381 m_value.ident = CSSValueMediaSeekForwardButton;
383 case MediaRewindButtonPart:
384 m_value.ident = CSSValueMediaRewindButton;
386 case MediaReturnToRealtimeButtonPart:
387 m_value.ident = CSSValueMediaReturnToRealtimeButton;
389 case MediaToggleClosedCaptionsButtonPart:
390 m_value.ident = CSSValueMediaToggleClosedCaptionsButton;
392 case MediaSliderPart:
393 m_value.ident = CSSValueMediaSlider;
395 case MediaSliderThumbPart:
396 m_value.ident = CSSValueMediaSliderthumb;
398 case MediaVolumeSliderContainerPart:
399 m_value.ident = CSSValueMediaVolumeSliderContainer;
401 case MediaVolumeSliderPart:
402 m_value.ident = CSSValueMediaVolumeSlider;
404 case MediaVolumeSliderMuteButtonPart:
405 m_value.ident = CSSValueMediaVolumeSliderMuteButton;
407 case MediaVolumeSliderThumbPart:
408 m_value.ident = CSSValueMediaVolumeSliderthumb;
410 case MediaControlsBackgroundPart:
411 m_value.ident = CSSValueMediaControlsBackground;
413 case MediaControlsFullscreenBackgroundPart:
414 m_value.ident = CSSValueMediaControlsFullscreenBackground;
416 case MediaCurrentTimePart:
417 m_value.ident = CSSValueMediaCurrentTimeDisplay;
419 case MediaTimeRemainingPart:
420 m_value.ident = CSSValueMediaTimeRemainingDisplay;
423 m_value.ident = CSSValueMenulist;
425 case MenulistButtonPart:
426 m_value.ident = CSSValueMenulistButton;
428 case MenulistTextPart:
429 m_value.ident = CSSValueMenulistText;
431 case MenulistTextFieldPart:
432 m_value.ident = CSSValueMenulistTextfield;
435 m_value.ident = CSSValueMeter;
437 case RelevancyLevelIndicatorPart:
438 m_value.ident = CSSValueRelevancyLevelIndicator;
440 case ContinuousCapacityLevelIndicatorPart:
441 m_value.ident = CSSValueContinuousCapacityLevelIndicator;
443 case DiscreteCapacityLevelIndicatorPart:
444 m_value.ident = CSSValueDiscreteCapacityLevelIndicator;
446 case RatingLevelIndicatorPart:
447 m_value.ident = CSSValueRatingLevelIndicator;
449 case ProgressBarPart:
450 #if ENABLE(PROGRESS_TAG)
451 m_value.ident = CSSValueProgressBar;
454 case ProgressBarValuePart:
455 #if ENABLE(PROGRESS_TAG)
456 m_value.ident = CSSValueProgressBarValue;
459 case SliderHorizontalPart:
460 m_value.ident = CSSValueSliderHorizontal;
462 case SliderVerticalPart:
463 m_value.ident = CSSValueSliderVertical;
465 case SliderThumbHorizontalPart:
466 m_value.ident = CSSValueSliderthumbHorizontal;
468 case SliderThumbVerticalPart:
469 m_value.ident = CSSValueSliderthumbVertical;
472 m_value.ident = CSSValueCaret;
474 case SearchFieldPart:
475 m_value.ident = CSSValueSearchfield;
477 case SearchFieldDecorationPart:
478 m_value.ident = CSSValueSearchfieldDecoration;
480 case SearchFieldResultsDecorationPart:
481 m_value.ident = CSSValueSearchfieldResultsDecoration;
483 case SearchFieldResultsButtonPart:
484 m_value.ident = CSSValueSearchfieldResultsButton;
486 case SearchFieldCancelButtonPart:
487 m_value.ident = CSSValueSearchfieldCancelButton;
490 m_value.ident = CSSValueTextfield;
492 #if ENABLE(TIZEN_INPUT_TAG_DATE)
494 m_value.ident = CSSValueDatefield;
498 m_value.ident = CSSValueTextarea;
500 case CapsLockIndicatorPart:
501 m_value.ident = CSSValueCapsLockIndicator;
503 case InputSpeechButtonPart:
504 #if ENABLE(INPUT_SPEECH)
505 m_value.ident = CSSValueWebkitInputSpeechButton;
511 template<> inline CSSPrimitiveValue::operator ControlPart() const
513 if (m_value.ident == CSSValueNone)
514 return NoControlPart;
516 return ControlPart(m_value.ident - CSSValueCheckbox + 1);
519 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBackfaceVisibility e)
520 : CSSValue(PrimitiveClass)
522 m_primitiveUnitType = CSS_IDENT;
524 case BackfaceVisibilityVisible:
525 m_value.ident = CSSValueVisible;
527 case BackfaceVisibilityHidden:
528 m_value.ident = CSSValueHidden;
533 template<> inline CSSPrimitiveValue::operator EBackfaceVisibility() const
535 switch (m_value.ident) {
536 case CSSValueVisible:
537 return BackfaceVisibilityVisible;
539 return BackfaceVisibilityHidden;
541 ASSERT_NOT_REACHED();
542 return BackfaceVisibilityHidden;
547 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillAttachment e)
548 : CSSValue(PrimitiveClass)
550 m_primitiveUnitType = CSS_IDENT;
552 case ScrollBackgroundAttachment:
553 m_value.ident = CSSValueScroll;
555 case LocalBackgroundAttachment:
556 m_value.ident = CSSValueLocal;
558 case FixedBackgroundAttachment:
559 m_value.ident = CSSValueFixed;
564 template<> inline CSSPrimitiveValue::operator EFillAttachment() const
566 switch (m_value.ident) {
568 return ScrollBackgroundAttachment;
570 return LocalBackgroundAttachment;
572 return FixedBackgroundAttachment;
574 ASSERT_NOT_REACHED();
575 return ScrollBackgroundAttachment;
579 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
580 : CSSValue(PrimitiveClass)
582 m_primitiveUnitType = CSS_IDENT;
585 m_value.ident = CSSValueBorderBox;
588 m_value.ident = CSSValuePaddingBox;
591 m_value.ident = CSSValueContentBox;
594 m_value.ident = CSSValueText;
599 template<> inline CSSPrimitiveValue::operator EFillBox() const
601 switch (m_value.ident) {
603 case CSSValueBorderBox:
604 return BorderFillBox;
605 case CSSValuePadding:
606 case CSSValuePaddingBox:
607 return PaddingFillBox;
608 case CSSValueContent:
609 case CSSValueContentBox:
610 return ContentFillBox;
612 case CSSValueWebkitText:
615 ASSERT_NOT_REACHED();
616 return BorderFillBox;
620 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillRepeat e)
621 : CSSValue(PrimitiveClass)
623 m_primitiveUnitType = CSS_IDENT;
626 m_value.ident = CSSValueRepeat;
629 m_value.ident = CSSValueNoRepeat;
632 m_value.ident = CSSValueRound;
635 m_value.ident = CSSValueSpace;
640 template<> inline CSSPrimitiveValue::operator EFillRepeat() const
642 switch (m_value.ident) {
645 case CSSValueNoRepeat:
652 ASSERT_NOT_REACHED();
657 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxAlignment e)
658 : CSSValue(PrimitiveClass)
660 m_primitiveUnitType = CSS_IDENT;
663 m_value.ident = CSSValueStretch;
666 m_value.ident = CSSValueStart;
669 m_value.ident = CSSValueCenter;
672 m_value.ident = CSSValueEnd;
675 m_value.ident = CSSValueBaseline;
678 m_value.ident = CSSValueJustify;
683 template<> inline CSSPrimitiveValue::operator EBoxAlignment() const
685 switch (m_value.ident) {
686 case CSSValueStretch:
694 case CSSValueBaseline:
696 case CSSValueJustify:
699 ASSERT_NOT_REACHED();
704 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxSizing e)
705 : CSSValue(PrimitiveClass)
707 m_primitiveUnitType = CSS_IDENT;
710 m_value.ident = CSSValueBorderBox;
713 m_value.ident = CSSValueContentBox;
718 template<> inline CSSPrimitiveValue::operator EBoxSizing() const
720 switch (m_value.ident) {
721 case CSSValueBorderBox:
723 case CSSValueContentBox:
726 ASSERT_NOT_REACHED();
731 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDirection e)
732 : CSSValue(PrimitiveClass)
734 m_primitiveUnitType = CSS_IDENT;
737 m_value.ident = CSSValueNormal;
740 m_value.ident = CSSValueReverse;
745 template<> inline CSSPrimitiveValue::operator EBoxDirection() const
747 switch (m_value.ident) {
750 case CSSValueReverse:
753 ASSERT_NOT_REACHED();
758 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxLines e)
759 : CSSValue(PrimitiveClass)
761 m_primitiveUnitType = CSS_IDENT;
764 m_value.ident = CSSValueSingle;
767 m_value.ident = CSSValueMultiple;
772 template<> inline CSSPrimitiveValue::operator EBoxLines() const
774 switch (m_value.ident) {
777 case CSSValueMultiple:
780 ASSERT_NOT_REACHED();
785 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxOrient e)
786 : CSSValue(PrimitiveClass)
788 m_primitiveUnitType = CSS_IDENT;
791 m_value.ident = CSSValueHorizontal;
794 m_value.ident = CSSValueVertical;
799 template<> inline CSSPrimitiveValue::operator EBoxOrient() const
801 switch (m_value.ident) {
802 case CSSValueHorizontal:
803 case CSSValueInlineAxis:
805 case CSSValueVertical:
806 case CSSValueBlockAxis:
809 ASSERT_NOT_REACHED();
814 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
815 : CSSValue(PrimitiveClass)
817 m_primitiveUnitType = CSS_IDENT;
820 m_value.ident = CSSValueLeft;
823 m_value.ident = CSSValueRight;
826 m_value.ident = CSSValueTop;
829 m_value.ident = CSSValueBottom;
834 template<> inline CSSPrimitiveValue::operator ECaptionSide() const
836 switch (m_value.ident) {
846 ASSERT_NOT_REACHED();
851 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
852 : CSSValue(PrimitiveClass)
854 m_primitiveUnitType = CSS_IDENT;
857 m_value.ident = CSSValueNone;
860 m_value.ident = CSSValueLeft;
863 m_value.ident = CSSValueRight;
866 m_value.ident = CSSValueBoth;
871 template<> inline CSSPrimitiveValue::operator EClear() const
873 switch (m_value.ident) {
883 ASSERT_NOT_REACHED();
888 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
889 : CSSValue(PrimitiveClass)
891 m_primitiveUnitType = CSS_IDENT;
894 m_value.ident = CSSValueAuto;
897 m_value.ident = CSSValueCrosshair;
900 m_value.ident = CSSValueDefault;
903 m_value.ident = CSSValuePointer;
906 m_value.ident = CSSValueMove;
909 m_value.ident = CSSValueCell;
911 case CURSOR_VERTICAL_TEXT:
912 m_value.ident = CSSValueVerticalText;
914 case CURSOR_CONTEXT_MENU:
915 m_value.ident = CSSValueContextMenu;
918 m_value.ident = CSSValueAlias;
921 m_value.ident = CSSValueCopy;
924 m_value.ident = CSSValueNone;
926 case CURSOR_PROGRESS:
927 m_value.ident = CSSValueProgress;
930 m_value.ident = CSSValueNoDrop;
932 case CURSOR_NOT_ALLOWED:
933 m_value.ident = CSSValueNotAllowed;
935 case CURSOR_WEBKIT_ZOOM_IN:
936 m_value.ident = CSSValueWebkitZoomIn;
938 case CURSOR_WEBKIT_ZOOM_OUT:
939 m_value.ident = CSSValueWebkitZoomOut;
941 case CURSOR_E_RESIZE:
942 m_value.ident = CSSValueEResize;
944 case CURSOR_NE_RESIZE:
945 m_value.ident = CSSValueNeResize;
947 case CURSOR_NW_RESIZE:
948 m_value.ident = CSSValueNwResize;
950 case CURSOR_N_RESIZE:
951 m_value.ident = CSSValueNResize;
953 case CURSOR_SE_RESIZE:
954 m_value.ident = CSSValueSeResize;
956 case CURSOR_SW_RESIZE:
957 m_value.ident = CSSValueSwResize;
959 case CURSOR_S_RESIZE:
960 m_value.ident = CSSValueSResize;
962 case CURSOR_W_RESIZE:
963 m_value.ident = CSSValueWResize;
965 case CURSOR_EW_RESIZE:
966 m_value.ident = CSSValueEwResize;
968 case CURSOR_NS_RESIZE:
969 m_value.ident = CSSValueNsResize;
971 case CURSOR_NESW_RESIZE:
972 m_value.ident = CSSValueNeswResize;
974 case CURSOR_NWSE_RESIZE:
975 m_value.ident = CSSValueNwseResize;
977 case CURSOR_COL_RESIZE:
978 m_value.ident = CSSValueColResize;
980 case CURSOR_ROW_RESIZE:
981 m_value.ident = CSSValueRowResize;
984 m_value.ident = CSSValueText;
987 m_value.ident = CSSValueWait;
990 m_value.ident = CSSValueHelp;
992 case CURSOR_ALL_SCROLL:
993 m_value.ident = CSSValueAllScroll;
995 case CURSOR_WEBKIT_GRAB:
996 m_value.ident = CSSValueWebkitGrab;
998 case CURSOR_WEBKIT_GRABBING:
999 m_value.ident = CSSValueWebkitGrabbing;
1004 template<> inline CSSPrimitiveValue::operator ECursor() const
1006 if (m_value.ident == CSSValueCopy)
1008 if (m_value.ident == CSSValueNone)
1010 return static_cast<ECursor>(m_value.ident - CSSValueAuto);
1013 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
1014 : CSSValue(PrimitiveClass)
1016 m_primitiveUnitType = CSS_IDENT;
1019 m_value.ident = CSSValueInline;
1022 m_value.ident = CSSValueBlock;
1025 m_value.ident = CSSValueListItem;
1028 m_value.ident = CSSValueRunIn;
1031 m_value.ident = CSSValueCompact;
1034 m_value.ident = CSSValueInlineBlock;
1037 m_value.ident = CSSValueTable;
1040 m_value.ident = CSSValueInlineTable;
1042 case TABLE_ROW_GROUP:
1043 m_value.ident = CSSValueTableRowGroup;
1045 case TABLE_HEADER_GROUP:
1046 m_value.ident = CSSValueTableHeaderGroup;
1048 case TABLE_FOOTER_GROUP:
1049 m_value.ident = CSSValueTableFooterGroup;
1052 m_value.ident = CSSValueTableRow;
1054 case TABLE_COLUMN_GROUP:
1055 m_value.ident = CSSValueTableColumnGroup;
1058 m_value.ident = CSSValueTableColumn;
1061 m_value.ident = CSSValueTableCell;
1064 m_value.ident = CSSValueTableCaption;
1067 m_value.ident = CSSValueWebkitBox;
1070 m_value.ident = CSSValueWebkitInlineBox;
1073 m_value.ident = CSSValueWebkitFlexbox;
1075 case INLINE_FLEXBOX:
1076 m_value.ident = CSSValueWebkitInlineFlexbox;
1078 #if ENABLE(CSS_GRID_LAYOUT)
1080 m_value.ident = CSSValueWebkitGrid;
1083 m_value.ident = CSSValueWebkitInlineGrid;
1087 m_value.ident = CSSValueNone;
1092 template<> inline CSSPrimitiveValue::operator EDisplay() const
1094 if (m_value.ident == CSSValueNone)
1097 EDisplay display = static_cast<EDisplay>(m_value.ident - CSSValueInline);
1098 ASSERT(display >= INLINE && display <= NONE);
1102 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EEmptyCell e)
1103 : CSSValue(PrimitiveClass)
1105 m_primitiveUnitType = CSS_IDENT;
1108 m_value.ident = CSSValueShow;
1111 m_value.ident = CSSValueHide;
1116 template<> inline CSSPrimitiveValue::operator EEmptyCell() const
1118 switch (m_value.ident) {
1124 ASSERT_NOT_REACHED();
1129 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
1130 : CSSValue(PrimitiveClass)
1132 m_primitiveUnitType = CSS_IDENT;
1135 m_value.ident = CSSValueStart;
1138 m_value.ident = CSSValueEnd;
1141 m_value.ident = CSSValueCenter;
1144 m_value.ident = CSSValueStretch;
1147 m_value.ident = CSSValueBaseline;
1152 template<> inline CSSPrimitiveValue::operator EFlexAlign() const
1154 switch (m_value.ident) {
1159 case CSSValueCenter:
1161 case CSSValueStretch:
1162 return AlignStretch;
1163 case CSSValueBaseline:
1164 return AlignBaseline;
1166 ASSERT_NOT_REACHED();
1171 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexPack e)
1172 : CSSValue(PrimitiveClass)
1174 m_primitiveUnitType = CSS_IDENT;
1177 m_value.ident = CSSValueStart;
1180 m_value.ident = CSSValueEnd;
1183 m_value.ident = CSSValueCenter;
1186 m_value.ident = CSSValueJustify;
1191 template<> inline CSSPrimitiveValue::operator EFlexPack() const
1193 switch (m_value.ident) {
1198 case CSSValueCenter:
1200 case CSSValueJustify:
1203 ASSERT_NOT_REACHED();
1208 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexFlow e)
1209 : CSSValue(PrimitiveClass)
1211 m_primitiveUnitType = CSS_IDENT;
1214 m_value.ident = CSSValueRow;
1216 case FlowRowReverse:
1217 m_value.ident = CSSValueRowReverse;
1220 m_value.ident = CSSValueColumn;
1222 case FlowColumnReverse:
1223 m_value.ident = CSSValueColumnReverse;
1228 template<> inline CSSPrimitiveValue::operator EFlexFlow() const
1230 switch (m_value.ident) {
1233 case CSSValueRowReverse:
1234 return FlowRowReverse;
1235 case CSSValueColumn:
1237 case CSSValueColumnReverse:
1238 return FlowColumnReverse;
1240 ASSERT_NOT_REACHED();
1245 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
1246 : CSSValue(PrimitiveClass)
1248 m_primitiveUnitType = CSS_IDENT;
1251 m_value.ident = CSSValueNone;
1254 m_value.ident = CSSValueLeft;
1257 m_value.ident = CSSValueRight;
1259 case PositionedFloat:
1260 m_value.ident = CSSValueWebkitPositioned;
1265 template<> inline CSSPrimitiveValue::operator EFloat() const
1267 switch (m_value.ident) {
1273 case CSSValueCenter: // Non-standard CSS value
1275 case CSSValueWebkitPositioned:
1276 return PositionedFloat;
1278 ASSERT_NOT_REACHED();
1283 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EKHTMLLineBreak e)
1284 : CSSValue(PrimitiveClass)
1286 m_primitiveUnitType = CSS_IDENT;
1289 m_value.ident = CSSValueNormal;
1291 case AFTER_WHITE_SPACE:
1292 m_value.ident = CSSValueAfterWhiteSpace;
1297 template<> inline CSSPrimitiveValue::operator EKHTMLLineBreak() const
1299 switch (m_value.ident) {
1300 case CSSValueAfterWhiteSpace:
1301 return AFTER_WHITE_SPACE;
1302 case CSSValueNormal:
1305 ASSERT_NOT_REACHED();
1310 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStylePosition e)
1311 : CSSValue(PrimitiveClass)
1313 m_primitiveUnitType = CSS_IDENT;
1316 m_value.ident = CSSValueOutside;
1319 m_value.ident = CSSValueInside;
1324 template<> inline CSSPrimitiveValue::operator EListStylePosition() const
1326 return (EListStylePosition)(m_value.ident - CSSValueOutside);
1329 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
1330 : CSSValue(PrimitiveClass)
1332 m_primitiveUnitType = CSS_IDENT;
1335 m_value.ident = CSSValueAfar;
1338 m_value.ident = CSSValueAmharic;
1340 case AmharicAbegede:
1341 m_value.ident = CSSValueAmharicAbegede;
1344 m_value.ident = CSSValueArabicIndic;
1347 m_value.ident = CSSValueArmenian;
1350 m_value.ident = CSSValueAsterisks;
1352 case BinaryListStyle:
1353 m_value.ident = CSSValueBinary;
1356 m_value.ident = CSSValueBengali;
1359 m_value.ident = CSSValueCambodian;
1362 m_value.ident = CSSValueCircle;
1364 case CjkEarthlyBranch:
1365 m_value.ident = CSSValueCjkEarthlyBranch;
1367 case CjkHeavenlyStem:
1368 m_value.ident = CSSValueCjkHeavenlyStem;
1370 case CJKIdeographic:
1371 m_value.ident = CSSValueCjkIdeographic;
1373 case DecimalLeadingZero:
1374 m_value.ident = CSSValueDecimalLeadingZero;
1376 case DecimalListStyle:
1377 m_value.ident = CSSValueDecimal;
1380 m_value.ident = CSSValueDevanagari;
1383 m_value.ident = CSSValueDisc;
1386 m_value.ident = CSSValueEthiopic;
1388 case EthiopicAbegede:
1389 m_value.ident = CSSValueEthiopicAbegede;
1391 case EthiopicAbegedeAmEt:
1392 m_value.ident = CSSValueEthiopicAbegedeAmEt;
1394 case EthiopicAbegedeGez:
1395 m_value.ident = CSSValueEthiopicAbegedeGez;
1397 case EthiopicAbegedeTiEr:
1398 m_value.ident = CSSValueEthiopicAbegedeTiEr;
1400 case EthiopicAbegedeTiEt:
1401 m_value.ident = CSSValueEthiopicAbegedeTiEt;
1403 case EthiopicHalehameAaEr:
1404 m_value.ident = CSSValueEthiopicHalehameAaEr;
1406 case EthiopicHalehameAaEt:
1407 m_value.ident = CSSValueEthiopicHalehameAaEt;
1409 case EthiopicHalehameAmEt:
1410 m_value.ident = CSSValueEthiopicHalehameAmEt;
1412 case EthiopicHalehameGez:
1413 m_value.ident = CSSValueEthiopicHalehameGez;
1415 case EthiopicHalehameOmEt:
1416 m_value.ident = CSSValueEthiopicHalehameOmEt;
1418 case EthiopicHalehameSidEt:
1419 m_value.ident = CSSValueEthiopicHalehameSidEt;
1421 case EthiopicHalehameSoEt:
1422 m_value.ident = CSSValueEthiopicHalehameSoEt;
1424 case EthiopicHalehameTiEr:
1425 m_value.ident = CSSValueEthiopicHalehameTiEr;
1427 case EthiopicHalehameTiEt:
1428 m_value.ident = CSSValueEthiopicHalehameTiEt;
1430 case EthiopicHalehameTig:
1431 m_value.ident = CSSValueEthiopicHalehameTig;
1434 m_value.ident = CSSValueFootnotes;
1437 m_value.ident = CSSValueGeorgian;
1440 m_value.ident = CSSValueGujarati;
1443 m_value.ident = CSSValueGurmukhi;
1446 m_value.ident = CSSValueHangul;
1448 case HangulConsonant:
1449 m_value.ident = CSSValueHangulConsonant;
1452 m_value.ident = CSSValueHebrew;
1455 m_value.ident = CSSValueHiragana;
1458 m_value.ident = CSSValueHiraganaIroha;
1461 m_value.ident = CSSValueKannada;
1464 m_value.ident = CSSValueKatakana;
1467 m_value.ident = CSSValueKatakanaIroha;
1470 m_value.ident = CSSValueKhmer;
1473 m_value.ident = CSSValueLao;
1476 m_value.ident = CSSValueLowerAlpha;
1479 m_value.ident = CSSValueLowerArmenian;
1482 m_value.ident = CSSValueLowerGreek;
1484 case LowerHexadecimal:
1485 m_value.ident = CSSValueLowerHexadecimal;
1488 m_value.ident = CSSValueLowerLatin;
1490 case LowerNorwegian:
1491 m_value.ident = CSSValueLowerNorwegian;
1494 m_value.ident = CSSValueLowerRoman;
1497 m_value.ident = CSSValueMalayalam;
1500 m_value.ident = CSSValueMongolian;
1503 m_value.ident = CSSValueMyanmar;
1506 m_value.ident = CSSValueNone;
1509 m_value.ident = CSSValueOctal;
1512 m_value.ident = CSSValueOriya;
1515 m_value.ident = CSSValueOromo;
1518 m_value.ident = CSSValuePersian;
1521 m_value.ident = CSSValueSidama;
1524 m_value.ident = CSSValueSomali;
1527 m_value.ident = CSSValueSquare;
1530 m_value.ident = CSSValueTelugu;
1533 m_value.ident = CSSValueThai;
1536 m_value.ident = CSSValueTibetan;
1539 m_value.ident = CSSValueTigre;
1542 m_value.ident = CSSValueTigrinyaEr;
1544 case TigrinyaErAbegede:
1545 m_value.ident = CSSValueTigrinyaErAbegede;
1548 m_value.ident = CSSValueTigrinyaEt;
1550 case TigrinyaEtAbegede:
1551 m_value.ident = CSSValueTigrinyaEtAbegede;
1554 m_value.ident = CSSValueUpperAlpha;
1557 m_value.ident = CSSValueUpperArmenian;
1560 m_value.ident = CSSValueUpperGreek;
1562 case UpperHexadecimal:
1563 m_value.ident = CSSValueUpperHexadecimal;
1566 m_value.ident = CSSValueUpperLatin;
1568 case UpperNorwegian:
1569 m_value.ident = CSSValueUpperNorwegian;
1572 m_value.ident = CSSValueUpperRoman;
1575 m_value.ident = CSSValueUrdu;
1580 template<> inline CSSPrimitiveValue::operator EListStyleType() const
1582 switch (m_value.ident) {
1584 return NoneListStyle;
1586 return static_cast<EListStyleType>(m_value.ident - CSSValueDisc);
1590 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarginCollapse e)
1591 : CSSValue(PrimitiveClass)
1593 m_primitiveUnitType = CSS_IDENT;
1596 m_value.ident = CSSValueCollapse;
1599 m_value.ident = CSSValueSeparate;
1602 m_value.ident = CSSValueDiscard;
1607 template<> inline CSSPrimitiveValue::operator EMarginCollapse() const
1609 switch (m_value.ident) {
1610 case CSSValueCollapse:
1612 case CSSValueSeparate:
1614 case CSSValueDiscard:
1617 ASSERT_NOT_REACHED();
1622 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeBehavior e)
1623 : CSSValue(PrimitiveClass)
1625 m_primitiveUnitType = CSS_IDENT;
1628 m_value.ident = CSSValueNone;
1631 m_value.ident = CSSValueScroll;
1634 m_value.ident = CSSValueSlide;
1637 m_value.ident = CSSValueAlternate;
1642 template<> inline CSSPrimitiveValue::operator EMarqueeBehavior() const
1644 switch (m_value.ident) {
1647 case CSSValueScroll:
1651 case CSSValueAlternate:
1654 ASSERT_NOT_REACHED();
1659 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RegionOverflow e)
1660 : CSSValue(PrimitiveClass)
1662 m_primitiveUnitType = CSS_IDENT;
1664 case AutoRegionOverflow:
1665 m_value.ident = CSSValueAuto;
1667 case BreakRegionOverflow:
1668 m_value.ident = CSSValueBreak;
1673 template<> inline CSSPrimitiveValue::operator RegionOverflow() const
1675 switch (m_value.ident) {
1677 return AutoRegionOverflow;
1679 return BreakRegionOverflow;
1681 ASSERT_NOT_REACHED();
1682 return AutoRegionOverflow;
1686 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeDirection e)
1687 : CSSValue(PrimitiveClass)
1689 m_primitiveUnitType = CSS_IDENT;
1692 m_value.ident = CSSValueForwards;
1695 m_value.ident = CSSValueBackwards;
1698 m_value.ident = CSSValueAuto;
1701 m_value.ident = CSSValueUp;
1704 m_value.ident = CSSValueDown;
1707 m_value.ident = CSSValueLeft;
1710 m_value.ident = CSSValueRight;
1715 template<> inline CSSPrimitiveValue::operator EMarqueeDirection() const
1717 switch (m_value.ident) {
1718 case CSSValueForwards:
1720 case CSSValueBackwards:
1725 case CSSValueUp: // We don't support vertical languages, so AHEAD just maps to UP.
1727 case CSSValueReverse:
1728 case CSSValueDown: // REVERSE just maps to DOWN, since we don't do vertical text.
1735 ASSERT_NOT_REACHED();
1740 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMatchNearestMailBlockquoteColor e)
1741 : CSSValue(PrimitiveClass)
1743 m_primitiveUnitType = CSS_IDENT;
1746 m_value.ident = CSSValueNormal;
1749 m_value.ident = CSSValueMatch;
1754 template<> inline CSSPrimitiveValue::operator EMatchNearestMailBlockquoteColor() const
1756 switch (m_value.ident) {
1757 case CSSValueNormal:
1762 ASSERT_NOT_REACHED();
1767 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ENBSPMode e)
1768 : CSSValue(PrimitiveClass)
1770 m_primitiveUnitType = CSS_IDENT;
1773 m_value.ident = CSSValueNormal;
1776 m_value.ident = CSSValueSpace;
1781 template<> inline CSSPrimitiveValue::operator ENBSPMode() const
1783 switch (m_value.ident) {
1786 case CSSValueNormal:
1789 ASSERT_NOT_REACHED();
1794 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)
1795 : CSSValue(PrimitiveClass)
1797 m_primitiveUnitType = CSS_IDENT;
1800 m_value.ident = CSSValueVisible;
1803 m_value.ident = CSSValueHidden;
1806 m_value.ident = CSSValueScroll;
1809 m_value.ident = CSSValueAuto;
1812 m_value.ident = CSSValueWebkitMarquee;
1815 m_value.ident = CSSValueOverlay;
1820 template<> inline CSSPrimitiveValue::operator EOverflow() const
1822 switch (m_value.ident) {
1823 case CSSValueVisible:
1825 case CSSValueHidden:
1827 case CSSValueScroll:
1831 case CSSValueWebkitMarquee:
1833 case CSSValueOverlay:
1836 ASSERT_NOT_REACHED();
1841 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
1842 : CSSValue(PrimitiveClass)
1844 m_primitiveUnitType = CSS_IDENT;
1847 m_value.ident = CSSValueAuto;
1850 m_value.ident = CSSValueAlways;
1853 m_value.ident = CSSValueAvoid;
1858 template<> inline CSSPrimitiveValue::operator EPageBreak() const
1860 switch (m_value.ident) {
1865 case CSSValueAlways:
1866 return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
1870 ASSERT_NOT_REACHED();
1875 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
1876 : CSSValue(PrimitiveClass)
1878 m_primitiveUnitType = CSS_IDENT;
1880 case StaticPosition:
1881 m_value.ident = CSSValueStatic;
1883 case RelativePosition:
1884 m_value.ident = CSSValueRelative;
1886 case AbsolutePosition:
1887 m_value.ident = CSSValueAbsolute;
1890 m_value.ident = CSSValueFixed;
1895 template<> inline CSSPrimitiveValue::operator EPosition() const
1897 switch (m_value.ident) {
1898 case CSSValueStatic:
1899 return StaticPosition;
1900 case CSSValueRelative:
1901 return RelativePosition;
1902 case CSSValueAbsolute:
1903 return AbsolutePosition;
1905 return FixedPosition;
1907 ASSERT_NOT_REACHED();
1908 return StaticPosition;
1912 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)
1913 : CSSValue(PrimitiveClass)
1915 m_primitiveUnitType = CSS_IDENT;
1918 m_value.ident = CSSValueBoth;
1920 case RESIZE_HORIZONTAL:
1921 m_value.ident = CSSValueHorizontal;
1923 case RESIZE_VERTICAL:
1924 m_value.ident = CSSValueVertical;
1927 m_value.ident = CSSValueNone;
1932 template<> inline CSSPrimitiveValue::operator EResize() const
1934 switch (m_value.ident) {
1937 case CSSValueHorizontal:
1938 return RESIZE_HORIZONTAL;
1939 case CSSValueVertical:
1940 return RESIZE_VERTICAL;
1942 ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.
1947 ASSERT_NOT_REACHED();
1952 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)
1953 : CSSValue(PrimitiveClass)
1955 m_primitiveUnitType = CSS_IDENT;
1958 m_value.ident = CSSValueAuto;
1961 m_value.ident = CSSValueFixed;
1966 template<> inline CSSPrimitiveValue::operator ETableLayout() const
1968 switch (m_value.ident) {
1974 ASSERT_NOT_REACHED();
1979 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)
1980 : CSSValue(PrimitiveClass)
1982 m_primitiveUnitType = CSS_IDENT;
1985 m_value.ident = CSSValueWebkitAuto;
1988 m_value.ident = CSSValueStart;
1991 m_value.ident = CSSValueEnd;
1994 m_value.ident = CSSValueLeft;
1997 m_value.ident = CSSValueRight;
2000 m_value.ident = CSSValueCenter;
2003 m_value.ident = CSSValueJustify;
2006 m_value.ident = CSSValueWebkitLeft;
2009 m_value.ident = CSSValueWebkitRight;
2012 m_value.ident = CSSValueWebkitCenter;
2017 template<> inline CSSPrimitiveValue::operator ETextAlign() const
2019 switch (m_value.ident) {
2025 return static_cast<ETextAlign>(m_value.ident - CSSValueWebkitAuto);
2029 template<> inline CSSPrimitiveValue::operator ETextDecoration() const
2031 switch (m_value.ident) {
2034 case CSSValueUnderline:
2036 case CSSValueOverline:
2038 case CSSValueLineThrough:
2039 return LINE_THROUGH;
2043 ASSERT_NOT_REACHED();
2048 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
2049 : CSSValue(PrimitiveClass)
2051 m_primitiveUnitType = CSS_IDENT;
2054 m_value.ident = CSSValueNone;
2057 m_value.ident = CSSValueDisc;
2060 m_value.ident = CSSValueCircle;
2063 m_value.ident = CSSValueSquare;
2068 template<> inline CSSPrimitiveValue::operator ETextSecurity() const
2070 switch (m_value.ident) {
2075 case CSSValueCircle:
2077 case CSSValueSquare:
2080 ASSERT_NOT_REACHED();
2085 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)
2086 : CSSValue(PrimitiveClass)
2088 m_primitiveUnitType = CSS_IDENT;
2091 m_value.ident = CSSValueCapitalize;
2094 m_value.ident = CSSValueUppercase;
2097 m_value.ident = CSSValueLowercase;
2100 m_value.ident = CSSValueNone;
2105 template<> inline CSSPrimitiveValue::operator ETextTransform() const
2107 switch (m_value.ident) {
2108 case CSSValueCapitalize:
2110 case CSSValueUppercase:
2112 case CSSValueLowercase:
2117 ASSERT_NOT_REACHED();
2122 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
2123 : CSSValue(PrimitiveClass)
2125 m_primitiveUnitType = CSS_IDENT;
2128 m_value.ident = CSSValueNormal;
2131 m_value.ident = CSSValueEmbed;
2134 m_value.ident = CSSValueBidiOverride;
2137 m_value.ident = CSSValueWebkitIsolate;
2140 m_value.ident = CSSValueWebkitPlaintext;
2145 template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const
2147 switch (m_value.ident) {
2148 case CSSValueNormal:
2152 case CSSValueBidiOverride:
2154 case CSSValueWebkitIsolate:
2156 case CSSValueWebkitPlaintext:
2159 ASSERT_NOT_REACHED();
2164 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)
2165 : CSSValue(PrimitiveClass)
2167 m_primitiveUnitType = CSS_IDENT;
2170 m_value.ident = CSSValueAuto;
2173 m_value.ident = CSSValueNone;
2176 m_value.ident = CSSValueElement;
2181 template<> inline CSSPrimitiveValue::operator EUserDrag() const
2183 switch (m_value.ident) {
2188 case CSSValueElement:
2189 return DRAG_ELEMENT;
2191 ASSERT_NOT_REACHED();
2196 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)
2197 : CSSValue(PrimitiveClass)
2199 m_primitiveUnitType = CSS_IDENT;
2202 m_value.ident = CSSValueReadOnly;
2205 m_value.ident = CSSValueReadWrite;
2207 case READ_WRITE_PLAINTEXT_ONLY:
2208 m_value.ident = CSSValueReadWritePlaintextOnly;
2213 template<> inline CSSPrimitiveValue::operator EUserModify() const
2215 return static_cast<EUserModify>(m_value.ident - CSSValueReadOnly);
2218 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
2219 : CSSValue(PrimitiveClass)
2221 m_primitiveUnitType = CSS_IDENT;
2224 m_value.ident = CSSValueNone;
2227 m_value.ident = CSSValueText;
2232 template<> inline CSSPrimitiveValue::operator EUserSelect() const
2234 switch (m_value.ident) {
2242 ASSERT_NOT_REACHED();
2247 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVerticalAlign a)
2248 : CSSValue(PrimitiveClass)
2250 m_primitiveUnitType = CSS_IDENT;
2253 m_value.ident = CSSValueTop;
2256 m_value.ident = CSSValueBottom;
2259 m_value.ident = CSSValueMiddle;
2262 m_value.ident = CSSValueBaseline;
2265 m_value.ident = CSSValueTextBottom;
2268 m_value.ident = CSSValueTextTop;
2271 m_value.ident = CSSValueSub;
2274 m_value.ident = CSSValueSuper;
2276 case BASELINE_MIDDLE:
2277 m_value.ident = CSSValueWebkitBaselineMiddle;
2280 m_value.ident = CSSValueInvalid;
2284 template<> inline CSSPrimitiveValue::operator EVerticalAlign() const
2286 switch (m_value.ident) {
2289 case CSSValueBottom:
2291 case CSSValueMiddle:
2293 case CSSValueBaseline:
2295 case CSSValueTextBottom:
2297 case CSSValueTextTop:
2303 case CSSValueWebkitBaselineMiddle:
2304 return BASELINE_MIDDLE;
2306 ASSERT_NOT_REACHED();
2311 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)
2312 : CSSValue(PrimitiveClass)
2314 m_primitiveUnitType = CSS_IDENT;
2317 m_value.ident = CSSValueVisible;
2320 m_value.ident = CSSValueHidden;
2323 m_value.ident = CSSValueCollapse;
2328 template<> inline CSSPrimitiveValue::operator EVisibility() const
2330 switch (m_value.ident) {
2331 case CSSValueHidden:
2333 case CSSValueVisible:
2335 case CSSValueCollapse:
2338 ASSERT_NOT_REACHED();
2343 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)
2344 : CSSValue(PrimitiveClass)
2346 m_primitiveUnitType = CSS_IDENT;
2349 m_value.ident = CSSValueNormal;
2352 m_value.ident = CSSValuePre;
2355 m_value.ident = CSSValuePreWrap;
2358 m_value.ident = CSSValuePreLine;
2361 m_value.ident = CSSValueNowrap;
2364 m_value.ident = CSSValueWebkitNowrap;
2369 template<> inline CSSPrimitiveValue::operator EWhiteSpace() const
2371 switch (m_value.ident) {
2372 case CSSValueWebkitNowrap:
2373 return KHTML_NOWRAP;
2374 case CSSValueNowrap:
2378 case CSSValuePreWrap:
2380 case CSSValuePreLine:
2382 case CSSValueNormal:
2385 ASSERT_NOT_REACHED();
2390 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)
2391 : CSSValue(PrimitiveClass)
2393 m_primitiveUnitType = CSS_IDENT;
2395 case NormalWordBreak:
2396 m_value.ident = CSSValueNormal;
2398 case BreakAllWordBreak:
2399 m_value.ident = CSSValueBreakAll;
2401 case BreakWordBreak:
2402 m_value.ident = CSSValueBreakWord;
2407 template<> inline CSSPrimitiveValue::operator EWordBreak() const
2409 switch (m_value.ident) {
2410 case CSSValueBreakAll:
2411 return BreakAllWordBreak;
2412 case CSSValueBreakWord:
2413 return BreakWordBreak;
2414 case CSSValueNormal:
2415 return NormalWordBreak;
2417 ASSERT_NOT_REACHED();
2418 return NormalWordBreak;
2422 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordWrap e)
2423 : CSSValue(PrimitiveClass)
2425 m_primitiveUnitType = CSS_IDENT;
2427 case NormalWordWrap:
2428 m_value.ident = CSSValueNormal;
2431 m_value.ident = CSSValueBreakWord;
2436 template<> inline CSSPrimitiveValue::operator EWordWrap() const
2438 switch (m_value.ident) {
2439 case CSSValueBreakWord:
2440 return BreakWordWrap;
2441 case CSSValueNormal:
2442 return NormalWordWrap;
2444 ASSERT_NOT_REACHED();
2445 return NormalWordWrap;
2449 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)
2450 : CSSValue(PrimitiveClass)
2452 m_primitiveUnitType = CSS_IDENT;
2455 m_value.ident = CSSValueLtr;
2458 m_value.ident = CSSValueRtl;
2463 template<> inline CSSPrimitiveValue::operator TextDirection() const
2465 switch (m_value.ident) {
2471 ASSERT_NOT_REACHED();
2476 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WritingMode e)
2477 : CSSValue(PrimitiveClass)
2479 m_primitiveUnitType = CSS_IDENT;
2481 case TopToBottomWritingMode:
2482 m_value.ident = CSSValueHorizontalTb;
2484 case RightToLeftWritingMode:
2485 m_value.ident = CSSValueVerticalRl;
2487 case LeftToRightWritingMode:
2488 m_value.ident = CSSValueVerticalLr;
2490 case BottomToTopWritingMode:
2491 m_value.ident = CSSValueHorizontalBt;
2496 template<> inline CSSPrimitiveValue::operator WritingMode() const
2498 switch (m_value.ident) {
2499 case CSSValueHorizontalTb:
2500 return TopToBottomWritingMode;
2501 case CSSValueVerticalRl:
2502 return RightToLeftWritingMode;
2503 case CSSValueVerticalLr:
2504 return LeftToRightWritingMode;
2505 case CSSValueHorizontalBt:
2506 return BottomToTopWritingMode;
2508 ASSERT_NOT_REACHED();
2509 return TopToBottomWritingMode;
2513 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextCombine e)
2514 : CSSValue(PrimitiveClass)
2516 m_primitiveUnitType = CSS_IDENT;
2518 case TextCombineNone:
2519 m_value.ident = CSSValueNone;
2521 case TextCombineHorizontal:
2522 m_value.ident = CSSValueHorizontal;
2527 template<> inline CSSPrimitiveValue::operator TextCombine() const
2529 switch (m_value.ident) {
2531 return TextCombineNone;
2532 case CSSValueHorizontal:
2533 return TextCombineHorizontal;
2535 ASSERT_NOT_REACHED();
2536 return TextCombineNone;
2540 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
2541 : CSSValue(PrimitiveClass)
2543 m_primitiveUnitType = CSS_IDENT;
2545 case TextEmphasisPositionOver:
2546 m_value.ident = CSSValueOver;
2548 case TextEmphasisPositionUnder:
2549 m_value.ident = CSSValueUnder;
2554 template<> inline CSSPrimitiveValue::operator TextEmphasisPosition() const
2556 switch (m_value.ident) {
2558 return TextEmphasisPositionOver;
2560 return TextEmphasisPositionUnder;
2562 ASSERT_NOT_REACHED();
2563 return TextEmphasisPositionOver;
2567 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOverflow overflow)
2568 : CSSValue(PrimitiveClass)
2570 m_primitiveUnitType = CSS_IDENT;
2572 case TextOverflowClip:
2573 m_value.ident = CSSValueClip;
2575 case TextOverflowEllipsis:
2576 m_value.ident = CSSValueEllipsis;
2581 template<> inline CSSPrimitiveValue::operator TextOverflow() const
2583 switch (m_value.ident) {
2585 return TextOverflowClip;
2586 case CSSValueEllipsis:
2587 return TextOverflowEllipsis;
2589 ASSERT_NOT_REACHED();
2590 return TextOverflowClip;
2594 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisFill fill)
2595 : CSSValue(PrimitiveClass)
2597 m_primitiveUnitType = CSS_IDENT;
2599 case TextEmphasisFillFilled:
2600 m_value.ident = CSSValueFilled;
2602 case TextEmphasisFillOpen:
2603 m_value.ident = CSSValueOpen;
2608 template<> inline CSSPrimitiveValue::operator TextEmphasisFill() const
2610 switch (m_value.ident) {
2611 case CSSValueFilled:
2612 return TextEmphasisFillFilled;
2614 return TextEmphasisFillOpen;
2616 ASSERT_NOT_REACHED();
2617 return TextEmphasisFillFilled;
2621 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisMark mark)
2622 : CSSValue(PrimitiveClass)
2624 m_primitiveUnitType = CSS_IDENT;
2626 case TextEmphasisMarkDot:
2627 m_value.ident = CSSValueDot;
2629 case TextEmphasisMarkCircle:
2630 m_value.ident = CSSValueCircle;
2632 case TextEmphasisMarkDoubleCircle:
2633 m_value.ident = CSSValueDoubleCircle;
2635 case TextEmphasisMarkTriangle:
2636 m_value.ident = CSSValueTriangle;
2638 case TextEmphasisMarkSesame:
2639 m_value.ident = CSSValueSesame;
2641 case TextEmphasisMarkNone:
2642 case TextEmphasisMarkAuto:
2643 case TextEmphasisMarkCustom:
2644 ASSERT_NOT_REACHED();
2645 m_value.ident = CSSValueNone;
2650 template<> inline CSSPrimitiveValue::operator TextEmphasisMark() const
2652 switch (m_value.ident) {
2654 return TextEmphasisMarkNone;
2656 return TextEmphasisMarkDot;
2657 case CSSValueCircle:
2658 return TextEmphasisMarkCircle;
2659 case CSSValueDoubleCircle:
2660 return TextEmphasisMarkDoubleCircle;
2661 case CSSValueTriangle:
2662 return TextEmphasisMarkTriangle;
2663 case CSSValueSesame:
2664 return TextEmphasisMarkSesame;
2666 ASSERT_NOT_REACHED();
2667 return TextEmphasisMarkNone;
2671 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
2672 : CSSValue(PrimitiveClass)
2674 m_primitiveUnitType = CSS_IDENT;
2676 case TextOrientationVerticalRight:
2677 m_value.ident = CSSValueVerticalRight;
2679 case TextOrientationUpright:
2680 m_value.ident = CSSValueUpright;
2685 template<> inline CSSPrimitiveValue::operator TextOrientation() const
2687 switch (m_value.ident) {
2688 case CSSValueVerticalRight:
2689 return TextOrientationVerticalRight;
2690 case CSSValueUpright:
2691 return TextOrientationUpright;
2693 ASSERT_NOT_REACHED();
2694 return TextOrientationVerticalRight;
2698 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
2699 : CSSValue(PrimitiveClass)
2701 m_primitiveUnitType = CSS_IDENT;
2704 m_value.ident = CSSValueNone;
2707 m_value.ident = CSSValueStroke;
2710 m_value.ident = CSSValueFill;
2713 m_value.ident = CSSValuePainted;
2716 m_value.ident = CSSValueVisible;
2718 case PE_VISIBLE_STROKE:
2719 m_value.ident = CSSValueVisiblestroke;
2721 case PE_VISIBLE_FILL:
2722 m_value.ident = CSSValueVisiblefill;
2724 case PE_VISIBLE_PAINTED:
2725 m_value.ident = CSSValueVisiblepainted;
2728 m_value.ident = CSSValueAuto;
2731 m_value.ident = CSSValueAll;
2736 template<> inline CSSPrimitiveValue::operator EPointerEvents() const
2738 switch (m_value.ident) {
2745 case CSSValueVisiblepainted:
2746 return PE_VISIBLE_PAINTED;
2747 case CSSValueVisiblefill:
2748 return PE_VISIBLE_FILL;
2749 case CSSValueVisiblestroke:
2750 return PE_VISIBLE_STROKE;
2751 case CSSValueVisible:
2753 case CSSValuePainted:
2757 case CSSValueStroke:
2760 ASSERT_NOT_REACHED();
2765 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
2766 : CSSValue(PrimitiveClass)
2768 m_primitiveUnitType = CSS_IDENT;
2769 switch (smoothing) {
2771 m_value.ident = CSSValueAuto;
2774 m_value.ident = CSSValueNone;
2777 m_value.ident = CSSValueAntialiased;
2779 case SubpixelAntialiased:
2780 m_value.ident = CSSValueSubpixelAntialiased;
2784 ASSERT_NOT_REACHED();
2785 m_value.ident = CSSValueAuto;
2788 template<> inline CSSPrimitiveValue::operator FontSmoothingMode() const
2790 switch (m_value.ident) {
2792 return AutoSmoothing;
2795 case CSSValueAntialiased:
2797 case CSSValueSubpixelAntialiased:
2798 return SubpixelAntialiased;
2801 ASSERT_NOT_REACHED();
2802 return AutoSmoothing;
2805 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontWeight weight)
2806 : CSSValue(PrimitiveClass)
2808 m_primitiveUnitType = CSS_IDENT;
2811 m_value.ident = CSSValue900;
2814 m_value.ident = CSSValue800;
2817 m_value.ident = CSSValue700;
2820 m_value.ident = CSSValue600;
2823 m_value.ident = CSSValue500;
2826 m_value.ident = CSSValue400;
2829 m_value.ident = CSSValue300;
2832 m_value.ident = CSSValue200;
2835 m_value.ident = CSSValue100;
2839 ASSERT_NOT_REACHED();
2840 m_value.ident = CSSValueNormal;
2843 template<> inline CSSPrimitiveValue::operator FontWeight() const
2845 switch (m_value.ident) {
2847 return FontWeightBold;
2848 case CSSValueNormal:
2849 return FontWeightNormal;
2851 return FontWeight900;
2853 return FontWeight800;
2855 return FontWeight700;
2857 return FontWeight600;
2859 return FontWeight500;
2861 return FontWeight400;
2863 return FontWeight300;
2865 return FontWeight200;
2867 return FontWeight100;
2870 ASSERT_NOT_REACHED();
2871 return FontWeightNormal;
2874 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontItalic italic)
2875 : CSSValue(PrimitiveClass)
2877 m_primitiveUnitType = CSS_IDENT;
2880 m_value.ident = CSSValueNormal;
2883 m_value.ident = CSSValueItalic;
2887 ASSERT_NOT_REACHED();
2888 m_value.ident = CSSValueNormal;
2891 template<> inline CSSPrimitiveValue::operator FontItalic() const
2893 switch (m_value.ident) {
2894 case CSSValueOblique:
2895 // FIXME: oblique is the same as italic for the moment...
2896 case CSSValueItalic:
2897 return FontItalicOn;
2898 case CSSValueNormal:
2899 return FontItalicOff;
2901 ASSERT_NOT_REACHED();
2902 return FontItalicOff;
2905 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmallCaps smallCaps)
2906 : CSSValue(PrimitiveClass)
2908 m_primitiveUnitType = CSS_IDENT;
2909 switch (smallCaps) {
2910 case FontSmallCapsOff:
2911 m_value.ident = CSSValueNormal;
2913 case FontSmallCapsOn:
2914 m_value.ident = CSSValueSmallCaps;
2918 ASSERT_NOT_REACHED();
2919 m_value.ident = CSSValueNormal;
2922 template<> inline CSSPrimitiveValue::operator FontSmallCaps() const
2924 switch (m_value.ident) {
2925 case CSSValueSmallCaps:
2926 return FontSmallCapsOn;
2927 case CSSValueNormal:
2928 return FontSmallCapsOff;
2930 ASSERT_NOT_REACHED();
2931 return FontSmallCapsOff;
2934 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
2935 : CSSValue(PrimitiveClass)
2937 m_primitiveUnitType = CSS_IDENT;
2939 case AutoTextRendering:
2940 m_value.ident = CSSValueAuto;
2943 m_value.ident = CSSValueOptimizespeed;
2945 case OptimizeLegibility:
2946 m_value.ident = CSSValueOptimizelegibility;
2948 case GeometricPrecision:
2949 m_value.ident = CSSValueGeometricprecision;
2954 template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
2956 switch (m_value.ident) {
2958 return AutoTextRendering;
2959 case CSSValueOptimizespeed:
2960 return OptimizeSpeed;
2961 case CSSValueOptimizelegibility:
2962 return OptimizeLegibility;
2963 case CSSValueGeometricprecision:
2964 return GeometricPrecision;
2966 ASSERT_NOT_REACHED();
2967 return AutoTextRendering;
2971 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
2972 : CSSValue(PrimitiveClass)
2974 m_primitiveUnitType = CSS_IDENT;
2976 case ColorSpaceDeviceRGB:
2977 m_value.ident = CSSValueDefault;
2979 case ColorSpaceSRGB:
2980 m_value.ident = CSSValueSrgb;
2982 case ColorSpaceLinearRGB:
2983 // CSS color correction does not support linearRGB yet.
2984 ASSERT_NOT_REACHED();
2985 m_value.ident = CSSValueDefault;
2990 template<> inline CSSPrimitiveValue::operator ColorSpace() const
2992 switch (m_value.ident) {
2993 case CSSValueDefault:
2994 return ColorSpaceDeviceRGB;
2996 return ColorSpaceSRGB;
2998 ASSERT_NOT_REACHED();
2999 return ColorSpaceDeviceRGB;
3003 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
3004 : CSSValue(PrimitiveClass)
3006 m_primitiveUnitType = CSS_IDENT;
3009 m_value.ident = CSSValueNone;
3012 m_value.ident = CSSValueManual;
3015 m_value.ident = CSSValueAuto;
3020 template<> inline CSSPrimitiveValue::operator Hyphens() const
3022 switch (m_value.ident) {
3025 case CSSValueManual:
3026 return HyphensManual;
3030 ASSERT_NOT_REACHED();
3035 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineGridSnap gridSnap)
3036 : CSSValue(PrimitiveClass)
3038 m_primitiveUnitType = CSS_IDENT;
3040 case LineGridSnapNone:
3041 m_value.ident = CSSValueNone;
3043 case LineGridSnapBaseline:
3044 m_value.ident = CSSValueBaseline;
3046 case LineGridSnapBounds:
3047 m_value.ident = CSSValueBounds;
3052 template<> inline CSSPrimitiveValue::operator LineGridSnap() const
3054 switch (m_value.ident) {
3056 return LineGridSnapNone;
3057 case CSSValueBaseline:
3058 return LineGridSnapBaseline;
3059 case CSSValueBounds:
3060 return LineGridSnapBounds;
3062 ASSERT_NOT_REACHED();
3063 return LineGridSnapNone;
3067 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ESpeak e)
3068 : CSSValue(PrimitiveClass)
3070 m_primitiveUnitType = CSS_IDENT;
3073 m_value.ident = CSSValueNone;
3076 m_value.ident = CSSValueNormal;
3079 m_value.ident = CSSValueSpellOut;
3082 m_value.ident = CSSValueDigits;
3084 case SpeakLiteralPunctuation:
3085 m_value.ident = CSSValueLiteralPunctuation;
3087 case SpeakNoPunctuation:
3088 m_value.ident = CSSValueNoPunctuation;
3093 template<> inline CSSPrimitiveValue::operator Order() const
3095 switch (m_value.ident) {
3096 case CSSValueLogical:
3097 return LogicalOrder;
3098 case CSSValueVisual:
3101 ASSERT_NOT_REACHED();
3102 return LogicalOrder;
3106 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Order e)
3107 : CSSValue(PrimitiveClass)
3109 m_primitiveUnitType = CSS_IDENT;
3112 m_value.ident = CSSValueLogical;
3115 m_value.ident = CSSValueVisual;
3120 template<> inline CSSPrimitiveValue::operator ESpeak() const
3122 switch (m_value.ident) {
3125 case CSSValueNormal:
3127 case CSSValueSpellOut:
3128 return SpeakSpellOut;
3129 case CSSValueDigits:
3131 case CSSValueLiteralPunctuation:
3132 return SpeakLiteralPunctuation;
3133 case CSSValueNoPunctuation:
3134 return SpeakNoPunctuation;
3136 ASSERT_NOT_REACHED();
3141 #if ENABLE(CSS_SHADERS)
3142 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CustomFilterOperation::MeshBoxType meshBoxType)
3143 : CSSValue(PrimitiveClass)
3145 m_primitiveUnitType = CSS_IDENT;
3146 switch (meshBoxType) {
3147 case CustomFilterOperation::FILTER_BOX:
3148 m_value.ident = CSSValueFilterBox;
3150 case CustomFilterOperation::BORDER_BOX:
3151 m_value.ident = CSSValueBorderBox;
3153 case CustomFilterOperation::PADDING_BOX:
3154 m_value.ident = CSSValuePaddingBox;
3156 case CustomFilterOperation::CONTENT_BOX:
3157 m_value.ident = CSSValueContentBox;
3162 template<> inline CSSPrimitiveValue::operator CustomFilterOperation::MeshBoxType() const
3164 switch (m_value.ident) {
3165 case CSSValueFilterBox:
3166 return CustomFilterOperation::FILTER_BOX;
3167 case CSSValueBorderBox:
3168 return CustomFilterOperation::BORDER_BOX;
3169 case CSSValuePaddingBox:
3170 return CustomFilterOperation::PADDING_BOX;
3171 case CSSValueContentBox:
3172 return CustomFilterOperation::CONTENT_BOX;
3174 ASSERT_NOT_REACHED();
3175 return CustomFilterOperation::FILTER_BOX;
3178 #endif // ENABLE(CSS_SHADERS)
3182 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
3183 : CSSValue(PrimitiveClass)
3185 m_primitiveUnitType = CSS_IDENT;
3188 m_value.ident = CSSValueButt;
3191 m_value.ident = CSSValueRound;
3194 m_value.ident = CSSValueSquare;
3199 template<> inline CSSPrimitiveValue::operator LineCap() const
3201 switch (m_value.ident) {
3206 case CSSValueSquare:
3209 ASSERT_NOT_REACHED();
3214 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)
3215 : CSSValue(PrimitiveClass)
3217 m_primitiveUnitType = CSS_IDENT;
3220 m_value.ident = CSSValueMiter;
3223 m_value.ident = CSSValueRound;
3226 m_value.ident = CSSValueBevel;
3231 template<> inline CSSPrimitiveValue::operator LineJoin() const
3233 switch (m_value.ident) {
3241 ASSERT_NOT_REACHED();
3246 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
3247 : CSSValue(PrimitiveClass)
3249 m_primitiveUnitType = CSS_IDENT;
3252 m_value.ident = CSSValueNonzero;
3255 m_value.ident = CSSValueEvenodd;
3260 template<> inline CSSPrimitiveValue::operator WindRule() const
3262 switch (m_value.ident) {
3263 case CSSValueNonzero:
3264 return RULE_NONZERO;
3265 case CSSValueEvenodd:
3266 return RULE_EVENODD;
3268 ASSERT_NOT_REACHED();
3269 return RULE_NONZERO;
3274 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)
3275 : CSSValue(PrimitiveClass)
3277 m_primitiveUnitType = CSS_IDENT;
3280 m_value.ident = CSSValueAuto;
3283 m_value.ident = CSSValueBaseline;
3285 case AB_BEFORE_EDGE:
3286 m_value.ident = CSSValueBeforeEdge;
3288 case AB_TEXT_BEFORE_EDGE:
3289 m_value.ident = CSSValueTextBeforeEdge;
3292 m_value.ident = CSSValueMiddle;
3295 m_value.ident = CSSValueCentral;
3298 m_value.ident = CSSValueAfterEdge;
3300 case AB_TEXT_AFTER_EDGE:
3301 m_value.ident = CSSValueTextAfterEdge;
3303 case AB_IDEOGRAPHIC:
3304 m_value.ident = CSSValueIdeographic;
3307 m_value.ident = CSSValueAlphabetic;
3310 m_value.ident = CSSValueHanging;
3312 case AB_MATHEMATICAL:
3313 m_value.ident = CSSValueMathematical;
3318 template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const
3320 switch (m_value.ident) {
3323 case CSSValueBaseline:
3325 case CSSValueBeforeEdge:
3326 return AB_BEFORE_EDGE;
3327 case CSSValueTextBeforeEdge:
3328 return AB_TEXT_BEFORE_EDGE;
3329 case CSSValueMiddle:
3331 case CSSValueCentral:
3333 case CSSValueAfterEdge:
3334 return AB_AFTER_EDGE;
3335 case CSSValueTextAfterEdge:
3336 return AB_TEXT_AFTER_EDGE;
3337 case CSSValueIdeographic:
3338 return AB_IDEOGRAPHIC;
3339 case CSSValueAlphabetic:
3340 return AB_ALPHABETIC;
3341 case CSSValueHanging:
3343 case CSSValueMathematical:
3344 return AB_MATHEMATICAL;
3346 ASSERT_NOT_REACHED();
3353 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderCollapse e)
3354 : CSSValue(PrimitiveClass)
3356 m_primitiveUnitType = CSS_IDENT;
3359 m_value.ident = CSSValueSeparate;
3362 m_value.ident = CSSValueCollapse;
3367 template<> inline CSSPrimitiveValue::operator EBorderCollapse() const
3369 switch (m_value.ident) {
3370 case CSSValueSeparate:
3372 case CSSValueCollapse:
3375 ASSERT_NOT_REACHED();
3380 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderFit e)
3381 : CSSValue(PrimitiveClass)
3383 m_primitiveUnitType = CSS_IDENT;
3385 case BorderFitBorder:
3386 m_value.ident = CSSValueBorder;
3388 case BorderFitLines:
3389 m_value.ident = CSSValueLines;
3394 template<> inline CSSPrimitiveValue::operator EBorderFit() const
3396 switch (m_value.ident) {
3397 case CSSValueBorder:
3398 return BorderFitBorder;
3400 return BorderFitLines;
3402 ASSERT_NOT_REACHED();
3403 return BorderFitLines;
3407 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)
3408 : CSSValue(PrimitiveClass)
3410 m_primitiveUnitType = CSS_IDENT;
3412 case ImageRenderingAuto:
3413 m_value.ident = CSSValueAuto;
3415 case ImageRenderingOptimizeSpeed:
3416 m_value.ident = CSSValueOptimizespeed;
3418 case ImageRenderingOptimizeQuality:
3419 m_value.ident = CSSValueOptimizequality;
3421 case ImageRenderingOptimizeContrast:
3422 m_value.ident = CSSValueWebkitOptimizeContrast;
3427 template<> inline CSSPrimitiveValue::operator EImageRendering() const
3429 switch (m_value.ident) {
3431 return ImageRenderingAuto;
3432 case CSSValueOptimizespeed:
3433 return ImageRenderingOptimizeSpeed;
3434 case CSSValueOptimizequality:
3435 return ImageRenderingOptimizeQuality;
3436 case CSSValueWebkitOptimizeContrast:
3437 return ImageRenderingOptimizeContrast;
3439 ASSERT_NOT_REACHED();
3440 return ImageRenderingAuto;
3444 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETransformStyle3D e)
3445 : CSSValue(PrimitiveClass)
3447 m_primitiveUnitType = CSS_IDENT;
3449 case TransformStyle3DFlat:
3450 m_value.ident = CSSValueFlat;
3452 case TransformStyle3DPreserve3D:
3453 m_value.ident = CSSValuePreserve3d;
3458 template<> inline CSSPrimitiveValue::operator ETransformStyle3D() const
3460 switch (m_value.ident) {
3462 return TransformStyle3DFlat;
3463 case CSSValuePreserve3d:
3464 return TransformStyle3DPreserve3D;
3466 ASSERT_NOT_REACHED();
3467 return TransformStyle3DFlat;
3471 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnAxis e)
3472 : CSSValue(PrimitiveClass)
3474 m_primitiveUnitType = CSS_IDENT;
3476 case HorizontalColumnAxis:
3477 m_value.ident = CSSValueHorizontal;
3479 case VerticalColumnAxis:
3480 m_value.ident = CSSValueVertical;
3482 case AutoColumnAxis:
3483 m_value.ident = CSSValueAuto;
3488 template<> inline CSSPrimitiveValue::operator ColumnAxis() const
3490 switch (m_value.ident) {
3491 case CSSValueHorizontal:
3492 return HorizontalColumnAxis;
3493 case CSSValueVertical:
3494 return VerticalColumnAxis;
3496 return AutoColumnAxis;
3498 ASSERT_NOT_REACHED();
3499 return AutoColumnAxis;
3503 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapFlow wrapFlow)
3504 : CSSValue(PrimitiveClass)
3506 m_primitiveUnitType = CSS_IDENT;
3509 m_value.ident = CSSValueAuto;
3512 m_value.ident = CSSValueBoth;
3515 m_value.ident = CSSValueLeft;
3518 m_value.ident = CSSValueRight;
3520 case WrapFlowMaximum:
3521 m_value.ident = CSSValueMaximum;
3524 m_value.ident = CSSValueClear;
3529 template<> inline CSSPrimitiveValue::operator WrapFlow() const
3531 switch (m_value.ident) {
3533 return WrapFlowAuto;
3535 return WrapFlowBoth;
3537 return WrapFlowLeft;
3539 return WrapFlowRight;
3540 case CSSValueMaximum:
3541 return WrapFlowMaximum;
3543 return WrapFlowClear;
3545 ASSERT_NOT_REACHED();
3546 return WrapFlowAuto;
3550 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WrapThrough wrapThrough)
3551 : CSSValue(PrimitiveClass)
3553 m_primitiveUnitType = CSS_IDENT;
3554 switch (wrapThrough) {
3555 case WrapThroughWrap:
3556 m_value.ident = CSSValueWrap;
3558 case WrapThroughNone:
3559 m_value.ident = CSSValueNone;
3564 template<> inline CSSPrimitiveValue::operator WrapThrough() const
3566 switch (m_value.ident) {
3568 return WrapThroughWrap;
3570 return WrapThroughNone;
3572 ASSERT_NOT_REACHED();
3573 return WrapThroughWrap;
3579 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)
3580 : CSSValue(PrimitiveClass)
3582 m_primitiveUnitType = CSS_IDENT;
3585 m_value.ident = CSSValueAuto;
3588 m_value.ident = CSSValueSrgb;
3591 m_value.ident = CSSValueLinearrgb;
3596 template<> inline CSSPrimitiveValue::operator EColorInterpolation() const
3598 switch (m_value.ident) {
3601 case CSSValueLinearrgb:
3602 return CI_LINEARRGB;
3606 ASSERT_NOT_REACHED();
3611 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
3612 : CSSValue(PrimitiveClass)
3614 m_primitiveUnitType = CSS_IDENT;
3617 m_value.ident = CSSValueAuto;
3619 case CR_OPTIMIZESPEED:
3620 m_value.ident = CSSValueOptimizespeed;
3622 case CR_OPTIMIZEQUALITY:
3623 m_value.ident = CSSValueOptimizequality;
3628 template<> inline CSSPrimitiveValue::operator EColorRendering() const
3630 switch (m_value.ident) {
3631 case CSSValueOptimizespeed:
3632 return CR_OPTIMIZESPEED;
3633 case CSSValueOptimizequality:
3634 return CR_OPTIMIZEQUALITY;
3638 ASSERT_NOT_REACHED();
3643 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)
3644 : CSSValue(PrimitiveClass)
3646 m_primitiveUnitType = CSS_IDENT;
3649 m_value.ident = CSSValueAuto;
3652 m_value.ident = CSSValueUseScript;
3655 m_value.ident = CSSValueNoChange;
3658 m_value.ident = CSSValueResetSize;
3661 m_value.ident = CSSValueCentral;
3664 m_value.ident = CSSValueMiddle;
3666 case DB_TEXT_BEFORE_EDGE:
3667 m_value.ident = CSSValueTextBeforeEdge;
3669 case DB_TEXT_AFTER_EDGE:
3670 m_value.ident = CSSValueTextAfterEdge;
3672 case DB_IDEOGRAPHIC:
3673 m_value.ident = CSSValueIdeographic;
3676 m_value.ident = CSSValueAlphabetic;
3679 m_value.ident = CSSValueHanging;
3681 case DB_MATHEMATICAL:
3682 m_value.ident = CSSValueMathematical;
3687 template<> inline CSSPrimitiveValue::operator EDominantBaseline() const
3689 switch (m_value.ident) {
3692 case CSSValueUseScript:
3693 return DB_USE_SCRIPT;
3694 case CSSValueNoChange:
3695 return DB_NO_CHANGE;
3696 case CSSValueResetSize:
3697 return DB_RESET_SIZE;
3698 case CSSValueIdeographic:
3699 return DB_IDEOGRAPHIC;
3700 case CSSValueAlphabetic:
3701 return DB_ALPHABETIC;
3702 case CSSValueHanging:
3704 case CSSValueMathematical:
3705 return DB_MATHEMATICAL;
3706 case CSSValueCentral:
3708 case CSSValueMiddle:
3710 case CSSValueTextAfterEdge:
3711 return DB_TEXT_AFTER_EDGE;
3712 case CSSValueTextBeforeEdge:
3713 return DB_TEXT_BEFORE_EDGE;
3715 ASSERT_NOT_REACHED();
3720 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
3721 : CSSValue(PrimitiveClass)
3723 m_primitiveUnitType = CSS_IDENT;
3726 m_value.ident = CSSValueAuto;
3728 case SR_OPTIMIZESPEED:
3729 m_value.ident = CSSValueOptimizespeed;
3732 m_value.ident = CSSValueCrispedges;
3734 case SR_GEOMETRICPRECISION:
3735 m_value.ident = CSSValueGeometricprecision;
3740 template<> inline CSSPrimitiveValue::operator EShapeRendering() const
3742 switch (m_value.ident) {
3745 case CSSValueOptimizespeed:
3746 return SR_OPTIMIZESPEED;
3747 case CSSValueCrispedges:
3748 return SR_CRISPEDGES;
3749 case CSSValueGeometricprecision:
3750 return SR_GEOMETRICPRECISION;
3752 ASSERT_NOT_REACHED();
3757 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)
3758 : CSSValue(PrimitiveClass)
3760 m_primitiveUnitType = CSS_IDENT;
3763 m_value.ident = CSSValueStart;
3766 m_value.ident = CSSValueMiddle;
3769 m_value.ident = CSSValueEnd;
3774 template<> inline CSSPrimitiveValue::operator ETextAnchor() const
3776 switch (m_value.ident) {
3779 case CSSValueMiddle:
3784 ASSERT_NOT_REACHED();
3789 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(SVGWritingMode e)
3790 : CSSValue(PrimitiveClass)
3792 m_primitiveUnitType = CSS_IDENT;
3795 m_value.ident = CSSValueLrTb;
3798 m_value.ident = CSSValueLr;
3801 m_value.ident = CSSValueRlTb;
3804 m_value.ident = CSSValueRl;
3807 m_value.ident = CSSValueTbRl;
3810 m_value.ident = CSSValueTb;
3815 template<> inline CSSPrimitiveValue::operator SVGWritingMode() const
3817 switch (m_value.ident) {
3831 ASSERT_NOT_REACHED();
3836 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
3837 : CSSValue(PrimitiveClass)
3839 m_primitiveUnitType = CSS_IDENT;
3842 m_value.ident = CSSValueNone;
3844 case VE_NON_SCALING_STROKE:
3845 m_value.ident = CSSValueNonScalingStroke;
3850 template<> inline CSSPrimitiveValue::operator EVectorEffect() const
3852 switch (m_value.ident) {
3855 case CSSValueNonScalingStroke:
3856 return VE_NON_SCALING_STROKE;
3858 ASSERT_NOT_REACHED();
3863 #endif // ENABLE(SVG)