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;
493 m_value.ident = CSSValueTextarea;
495 case CapsLockIndicatorPart:
496 m_value.ident = CSSValueCapsLockIndicator;
498 case InputSpeechButtonPart:
499 #if ENABLE(INPUT_SPEECH)
500 m_value.ident = CSSValueWebkitInputSpeechButton;
506 template<> inline CSSPrimitiveValue::operator ControlPart() const
508 if (m_value.ident == CSSValueNone)
509 return NoControlPart;
511 return ControlPart(m_value.ident - CSSValueCheckbox + 1);
514 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBackfaceVisibility e)
515 : CSSValue(PrimitiveClass)
517 m_primitiveUnitType = CSS_IDENT;
519 case BackfaceVisibilityVisible:
520 m_value.ident = CSSValueVisible;
522 case BackfaceVisibilityHidden:
523 m_value.ident = CSSValueHidden;
528 template<> inline CSSPrimitiveValue::operator EBackfaceVisibility() const
530 switch (m_value.ident) {
531 case CSSValueVisible:
532 return BackfaceVisibilityVisible;
534 return BackfaceVisibilityHidden;
536 ASSERT_NOT_REACHED();
537 return BackfaceVisibilityHidden;
542 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillAttachment e)
543 : CSSValue(PrimitiveClass)
545 m_primitiveUnitType = CSS_IDENT;
547 case ScrollBackgroundAttachment:
548 m_value.ident = CSSValueScroll;
550 case LocalBackgroundAttachment:
551 m_value.ident = CSSValueLocal;
553 case FixedBackgroundAttachment:
554 m_value.ident = CSSValueFixed;
559 template<> inline CSSPrimitiveValue::operator EFillAttachment() const
561 switch (m_value.ident) {
563 return ScrollBackgroundAttachment;
565 return LocalBackgroundAttachment;
567 return FixedBackgroundAttachment;
569 ASSERT_NOT_REACHED();
570 return ScrollBackgroundAttachment;
574 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
575 : CSSValue(PrimitiveClass)
577 m_primitiveUnitType = CSS_IDENT;
580 m_value.ident = CSSValueBorderBox;
583 m_value.ident = CSSValuePaddingBox;
586 m_value.ident = CSSValueContentBox;
589 m_value.ident = CSSValueText;
594 template<> inline CSSPrimitiveValue::operator EFillBox() const
596 switch (m_value.ident) {
598 case CSSValueBorderBox:
599 return BorderFillBox;
600 case CSSValuePadding:
601 case CSSValuePaddingBox:
602 return PaddingFillBox;
603 case CSSValueContent:
604 case CSSValueContentBox:
605 return ContentFillBox;
607 case CSSValueWebkitText:
610 ASSERT_NOT_REACHED();
611 return BorderFillBox;
615 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillRepeat e)
616 : CSSValue(PrimitiveClass)
618 m_primitiveUnitType = CSS_IDENT;
621 m_value.ident = CSSValueRepeat;
624 m_value.ident = CSSValueNoRepeat;
627 m_value.ident = CSSValueRound;
630 m_value.ident = CSSValueSpace;
635 template<> inline CSSPrimitiveValue::operator EFillRepeat() const
637 switch (m_value.ident) {
640 case CSSValueNoRepeat:
647 ASSERT_NOT_REACHED();
652 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxPack e)
653 : CSSValue(PrimitiveClass)
655 m_primitiveUnitType = CSS_IDENT;
658 m_value.ident = CSSValueStart;
661 m_value.ident = CSSValueCenter;
664 m_value.ident = CSSValueEnd;
667 m_value.ident = CSSValueJustify;
672 template<> inline CSSPrimitiveValue::operator EBoxPack() const
674 switch (m_value.ident) {
681 case CSSValueJustify:
684 ASSERT_NOT_REACHED();
689 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxAlignment e)
690 : CSSValue(PrimitiveClass)
692 m_primitiveUnitType = CSS_IDENT;
695 m_value.ident = CSSValueStretch;
698 m_value.ident = CSSValueStart;
701 m_value.ident = CSSValueCenter;
704 m_value.ident = CSSValueEnd;
707 m_value.ident = CSSValueBaseline;
712 template<> inline CSSPrimitiveValue::operator EBoxAlignment() const
714 switch (m_value.ident) {
715 case CSSValueStretch:
723 case CSSValueBaseline:
726 ASSERT_NOT_REACHED();
731 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxSizing e)
732 : CSSValue(PrimitiveClass)
734 m_primitiveUnitType = CSS_IDENT;
737 m_value.ident = CSSValueBorderBox;
740 m_value.ident = CSSValueContentBox;
745 template<> inline CSSPrimitiveValue::operator EBoxSizing() const
747 switch (m_value.ident) {
748 case CSSValueBorderBox:
750 case CSSValueContentBox:
753 ASSERT_NOT_REACHED();
758 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxDirection e)
759 : CSSValue(PrimitiveClass)
761 m_primitiveUnitType = CSS_IDENT;
764 m_value.ident = CSSValueNormal;
767 m_value.ident = CSSValueReverse;
772 template<> inline CSSPrimitiveValue::operator EBoxDirection() const
774 switch (m_value.ident) {
777 case CSSValueReverse:
780 ASSERT_NOT_REACHED();
785 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxLines e)
786 : CSSValue(PrimitiveClass)
788 m_primitiveUnitType = CSS_IDENT;
791 m_value.ident = CSSValueSingle;
794 m_value.ident = CSSValueMultiple;
799 template<> inline CSSPrimitiveValue::operator EBoxLines() const
801 switch (m_value.ident) {
804 case CSSValueMultiple:
807 ASSERT_NOT_REACHED();
812 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxOrient e)
813 : CSSValue(PrimitiveClass)
815 m_primitiveUnitType = CSS_IDENT;
818 m_value.ident = CSSValueHorizontal;
821 m_value.ident = CSSValueVertical;
826 template<> inline CSSPrimitiveValue::operator EBoxOrient() const
828 switch (m_value.ident) {
829 case CSSValueHorizontal:
830 case CSSValueInlineAxis:
832 case CSSValueVertical:
833 case CSSValueBlockAxis:
836 ASSERT_NOT_REACHED();
841 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
842 : CSSValue(PrimitiveClass)
844 m_primitiveUnitType = CSS_IDENT;
847 m_value.ident = CSSValueLeft;
850 m_value.ident = CSSValueRight;
853 m_value.ident = CSSValueTop;
856 m_value.ident = CSSValueBottom;
861 template<> inline CSSPrimitiveValue::operator ECaptionSide() const
863 switch (m_value.ident) {
873 ASSERT_NOT_REACHED();
878 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
879 : CSSValue(PrimitiveClass)
881 m_primitiveUnitType = CSS_IDENT;
884 m_value.ident = CSSValueNone;
887 m_value.ident = CSSValueLeft;
890 m_value.ident = CSSValueRight;
893 m_value.ident = CSSValueBoth;
898 template<> inline CSSPrimitiveValue::operator EClear() const
900 switch (m_value.ident) {
910 ASSERT_NOT_REACHED();
915 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
916 : CSSValue(PrimitiveClass)
918 m_primitiveUnitType = CSS_IDENT;
921 m_value.ident = CSSValueAuto;
924 m_value.ident = CSSValueCrosshair;
927 m_value.ident = CSSValueDefault;
930 m_value.ident = CSSValuePointer;
933 m_value.ident = CSSValueMove;
936 m_value.ident = CSSValueCell;
938 case CURSOR_VERTICAL_TEXT:
939 m_value.ident = CSSValueVerticalText;
941 case CURSOR_CONTEXT_MENU:
942 m_value.ident = CSSValueContextMenu;
945 m_value.ident = CSSValueAlias;
948 m_value.ident = CSSValueCopy;
951 m_value.ident = CSSValueNone;
953 case CURSOR_PROGRESS:
954 m_value.ident = CSSValueProgress;
957 m_value.ident = CSSValueNoDrop;
959 case CURSOR_NOT_ALLOWED:
960 m_value.ident = CSSValueNotAllowed;
962 case CURSOR_WEBKIT_ZOOM_IN:
963 m_value.ident = CSSValueWebkitZoomIn;
965 case CURSOR_WEBKIT_ZOOM_OUT:
966 m_value.ident = CSSValueWebkitZoomOut;
968 case CURSOR_E_RESIZE:
969 m_value.ident = CSSValueEResize;
971 case CURSOR_NE_RESIZE:
972 m_value.ident = CSSValueNeResize;
974 case CURSOR_NW_RESIZE:
975 m_value.ident = CSSValueNwResize;
977 case CURSOR_N_RESIZE:
978 m_value.ident = CSSValueNResize;
980 case CURSOR_SE_RESIZE:
981 m_value.ident = CSSValueSeResize;
983 case CURSOR_SW_RESIZE:
984 m_value.ident = CSSValueSwResize;
986 case CURSOR_S_RESIZE:
987 m_value.ident = CSSValueSResize;
989 case CURSOR_W_RESIZE:
990 m_value.ident = CSSValueWResize;
992 case CURSOR_EW_RESIZE:
993 m_value.ident = CSSValueEwResize;
995 case CURSOR_NS_RESIZE:
996 m_value.ident = CSSValueNsResize;
998 case CURSOR_NESW_RESIZE:
999 m_value.ident = CSSValueNeswResize;
1001 case CURSOR_NWSE_RESIZE:
1002 m_value.ident = CSSValueNwseResize;
1004 case CURSOR_COL_RESIZE:
1005 m_value.ident = CSSValueColResize;
1007 case CURSOR_ROW_RESIZE:
1008 m_value.ident = CSSValueRowResize;
1011 m_value.ident = CSSValueText;
1014 m_value.ident = CSSValueWait;
1017 m_value.ident = CSSValueHelp;
1019 case CURSOR_ALL_SCROLL:
1020 m_value.ident = CSSValueAllScroll;
1022 case CURSOR_WEBKIT_GRAB:
1023 m_value.ident = CSSValueWebkitGrab;
1025 case CURSOR_WEBKIT_GRABBING:
1026 m_value.ident = CSSValueWebkitGrabbing;
1031 template<> inline CSSPrimitiveValue::operator ECursor() const
1033 if (m_value.ident == CSSValueCopy)
1035 if (m_value.ident == CSSValueNone)
1037 return static_cast<ECursor>(m_value.ident - CSSValueAuto);
1040 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
1041 : CSSValue(PrimitiveClass)
1043 m_primitiveUnitType = CSS_IDENT;
1046 m_value.ident = CSSValueInline;
1049 m_value.ident = CSSValueBlock;
1052 m_value.ident = CSSValueListItem;
1055 m_value.ident = CSSValueRunIn;
1058 m_value.ident = CSSValueCompact;
1061 m_value.ident = CSSValueInlineBlock;
1064 m_value.ident = CSSValueTable;
1067 m_value.ident = CSSValueInlineTable;
1069 case TABLE_ROW_GROUP:
1070 m_value.ident = CSSValueTableRowGroup;
1072 case TABLE_HEADER_GROUP:
1073 m_value.ident = CSSValueTableHeaderGroup;
1075 case TABLE_FOOTER_GROUP:
1076 m_value.ident = CSSValueTableFooterGroup;
1079 m_value.ident = CSSValueTableRow;
1081 case TABLE_COLUMN_GROUP:
1082 m_value.ident = CSSValueTableColumnGroup;
1085 m_value.ident = CSSValueTableColumn;
1088 m_value.ident = CSSValueTableCell;
1091 m_value.ident = CSSValueTableCaption;
1094 m_value.ident = CSSValueWebkitBox;
1097 m_value.ident = CSSValueWebkitInlineBox;
1100 m_value.ident = CSSValueWebkitFlexbox;
1102 case INLINE_FLEXBOX:
1103 m_value.ident = CSSValueWebkitInlineFlexbox;
1105 #if ENABLE(CSS_GRID_LAYOUT)
1107 m_value.ident = CSSValueWebkitGrid;
1110 m_value.ident = CSSValueWebkitInlineGrid;
1114 m_value.ident = CSSValueNone;
1119 template<> inline CSSPrimitiveValue::operator EDisplay() const
1121 if (m_value.ident == CSSValueNone)
1124 EDisplay display = static_cast<EDisplay>(m_value.ident - CSSValueInline);
1125 ASSERT(display >= INLINE && display <= NONE);
1129 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EEmptyCell e)
1130 : CSSValue(PrimitiveClass)
1132 m_primitiveUnitType = CSS_IDENT;
1135 m_value.ident = CSSValueShow;
1138 m_value.ident = CSSValueHide;
1143 template<> inline CSSPrimitiveValue::operator EEmptyCell() const
1145 switch (m_value.ident) {
1151 ASSERT_NOT_REACHED();
1156 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
1157 : CSSValue(PrimitiveClass)
1159 m_primitiveUnitType = CSS_IDENT;
1162 m_value.ident = CSSValueAuto;
1165 m_value.ident = CSSValueStart;
1168 m_value.ident = CSSValueEnd;
1171 m_value.ident = CSSValueCenter;
1174 m_value.ident = CSSValueStretch;
1177 m_value.ident = CSSValueBaseline;
1182 template<> inline CSSPrimitiveValue::operator EFlexAlign() const
1184 switch (m_value.ident) {
1191 case CSSValueCenter:
1193 case CSSValueStretch:
1194 return AlignStretch;
1195 case CSSValueBaseline:
1196 return AlignBaseline;
1198 ASSERT_NOT_REACHED();
1203 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexPack e)
1204 : CSSValue(PrimitiveClass)
1206 m_primitiveUnitType = CSS_IDENT;
1209 m_value.ident = CSSValueStart;
1212 m_value.ident = CSSValueEnd;
1215 m_value.ident = CSSValueCenter;
1218 m_value.ident = CSSValueJustify;
1223 template<> inline CSSPrimitiveValue::operator EFlexPack() const
1225 switch (m_value.ident) {
1230 case CSSValueCenter:
1232 case CSSValueJustify:
1235 ASSERT_NOT_REACHED();
1240 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexDirection e)
1241 : CSSValue(PrimitiveClass)
1243 m_primitiveUnitType = CSS_IDENT;
1246 m_value.ident = CSSValueRow;
1248 case FlowRowReverse:
1249 m_value.ident = CSSValueRowReverse;
1252 m_value.ident = CSSValueColumn;
1254 case FlowColumnReverse:
1255 m_value.ident = CSSValueColumnReverse;
1260 template<> inline CSSPrimitiveValue::operator EFlexDirection() const
1262 switch (m_value.ident) {
1265 case CSSValueRowReverse:
1266 return FlowRowReverse;
1267 case CSSValueColumn:
1269 case CSSValueColumnReverse:
1270 return FlowColumnReverse;
1272 ASSERT_NOT_REACHED();
1277 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexWrap e)
1278 : CSSValue(PrimitiveClass)
1280 m_primitiveUnitType = CSS_IDENT;
1283 m_value.ident = CSSValueNowrap;
1286 m_value.ident = CSSValueWrap;
1288 case FlexWrapReverse:
1289 m_value.ident = CSSValueWrapReverse;
1294 template<> inline CSSPrimitiveValue::operator EFlexWrap() const
1296 switch (m_value.ident) {
1297 case CSSValueNowrap:
1301 case CSSValueWrapReverse:
1302 return FlexWrapReverse;
1304 ASSERT_NOT_REACHED();
1309 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
1310 : CSSValue(PrimitiveClass)
1312 m_primitiveUnitType = CSS_IDENT;
1315 m_value.ident = CSSValueNone;
1318 m_value.ident = CSSValueLeft;
1321 m_value.ident = CSSValueRight;
1323 case PositionedFloat:
1324 m_value.ident = CSSValueWebkitPositioned;
1329 template<> inline CSSPrimitiveValue::operator EFloat() const
1331 switch (m_value.ident) {
1337 case CSSValueCenter: // Non-standard CSS value
1339 case CSSValueWebkitPositioned:
1340 return PositionedFloat;
1342 ASSERT_NOT_REACHED();
1347 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EKHTMLLineBreak e)
1348 : CSSValue(PrimitiveClass)
1350 m_primitiveUnitType = CSS_IDENT;
1353 m_value.ident = CSSValueNormal;
1355 case AFTER_WHITE_SPACE:
1356 m_value.ident = CSSValueAfterWhiteSpace;
1361 template<> inline CSSPrimitiveValue::operator EKHTMLLineBreak() const
1363 switch (m_value.ident) {
1364 case CSSValueAfterWhiteSpace:
1365 return AFTER_WHITE_SPACE;
1366 case CSSValueNormal:
1369 ASSERT_NOT_REACHED();
1374 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStylePosition e)
1375 : CSSValue(PrimitiveClass)
1377 m_primitiveUnitType = CSS_IDENT;
1380 m_value.ident = CSSValueOutside;
1383 m_value.ident = CSSValueInside;
1388 template<> inline CSSPrimitiveValue::operator EListStylePosition() const
1390 return (EListStylePosition)(m_value.ident - CSSValueOutside);
1393 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e)
1394 : CSSValue(PrimitiveClass)
1396 m_primitiveUnitType = CSS_IDENT;
1399 m_value.ident = CSSValueAfar;
1402 m_value.ident = CSSValueAmharic;
1404 case AmharicAbegede:
1405 m_value.ident = CSSValueAmharicAbegede;
1408 m_value.ident = CSSValueArabicIndic;
1411 m_value.ident = CSSValueArmenian;
1414 m_value.ident = CSSValueAsterisks;
1416 case BinaryListStyle:
1417 m_value.ident = CSSValueBinary;
1420 m_value.ident = CSSValueBengali;
1423 m_value.ident = CSSValueCambodian;
1426 m_value.ident = CSSValueCircle;
1428 case CjkEarthlyBranch:
1429 m_value.ident = CSSValueCjkEarthlyBranch;
1431 case CjkHeavenlyStem:
1432 m_value.ident = CSSValueCjkHeavenlyStem;
1434 case CJKIdeographic:
1435 m_value.ident = CSSValueCjkIdeographic;
1437 case DecimalLeadingZero:
1438 m_value.ident = CSSValueDecimalLeadingZero;
1440 case DecimalListStyle:
1441 m_value.ident = CSSValueDecimal;
1444 m_value.ident = CSSValueDevanagari;
1447 m_value.ident = CSSValueDisc;
1450 m_value.ident = CSSValueEthiopic;
1452 case EthiopicAbegede:
1453 m_value.ident = CSSValueEthiopicAbegede;
1455 case EthiopicAbegedeAmEt:
1456 m_value.ident = CSSValueEthiopicAbegedeAmEt;
1458 case EthiopicAbegedeGez:
1459 m_value.ident = CSSValueEthiopicAbegedeGez;
1461 case EthiopicAbegedeTiEr:
1462 m_value.ident = CSSValueEthiopicAbegedeTiEr;
1464 case EthiopicAbegedeTiEt:
1465 m_value.ident = CSSValueEthiopicAbegedeTiEt;
1467 case EthiopicHalehameAaEr:
1468 m_value.ident = CSSValueEthiopicHalehameAaEr;
1470 case EthiopicHalehameAaEt:
1471 m_value.ident = CSSValueEthiopicHalehameAaEt;
1473 case EthiopicHalehameAmEt:
1474 m_value.ident = CSSValueEthiopicHalehameAmEt;
1476 case EthiopicHalehameGez:
1477 m_value.ident = CSSValueEthiopicHalehameGez;
1479 case EthiopicHalehameOmEt:
1480 m_value.ident = CSSValueEthiopicHalehameOmEt;
1482 case EthiopicHalehameSidEt:
1483 m_value.ident = CSSValueEthiopicHalehameSidEt;
1485 case EthiopicHalehameSoEt:
1486 m_value.ident = CSSValueEthiopicHalehameSoEt;
1488 case EthiopicHalehameTiEr:
1489 m_value.ident = CSSValueEthiopicHalehameTiEr;
1491 case EthiopicHalehameTiEt:
1492 m_value.ident = CSSValueEthiopicHalehameTiEt;
1494 case EthiopicHalehameTig:
1495 m_value.ident = CSSValueEthiopicHalehameTig;
1498 m_value.ident = CSSValueFootnotes;
1501 m_value.ident = CSSValueGeorgian;
1504 m_value.ident = CSSValueGujarati;
1507 m_value.ident = CSSValueGurmukhi;
1510 m_value.ident = CSSValueHangul;
1512 case HangulConsonant:
1513 m_value.ident = CSSValueHangulConsonant;
1516 m_value.ident = CSSValueHebrew;
1519 m_value.ident = CSSValueHiragana;
1522 m_value.ident = CSSValueHiraganaIroha;
1525 m_value.ident = CSSValueKannada;
1528 m_value.ident = CSSValueKatakana;
1531 m_value.ident = CSSValueKatakanaIroha;
1534 m_value.ident = CSSValueKhmer;
1537 m_value.ident = CSSValueLao;
1540 m_value.ident = CSSValueLowerAlpha;
1543 m_value.ident = CSSValueLowerArmenian;
1546 m_value.ident = CSSValueLowerGreek;
1548 case LowerHexadecimal:
1549 m_value.ident = CSSValueLowerHexadecimal;
1552 m_value.ident = CSSValueLowerLatin;
1554 case LowerNorwegian:
1555 m_value.ident = CSSValueLowerNorwegian;
1558 m_value.ident = CSSValueLowerRoman;
1561 m_value.ident = CSSValueMalayalam;
1564 m_value.ident = CSSValueMongolian;
1567 m_value.ident = CSSValueMyanmar;
1570 m_value.ident = CSSValueNone;
1573 m_value.ident = CSSValueOctal;
1576 m_value.ident = CSSValueOriya;
1579 m_value.ident = CSSValueOromo;
1582 m_value.ident = CSSValuePersian;
1585 m_value.ident = CSSValueSidama;
1588 m_value.ident = CSSValueSomali;
1591 m_value.ident = CSSValueSquare;
1594 m_value.ident = CSSValueTelugu;
1597 m_value.ident = CSSValueThai;
1600 m_value.ident = CSSValueTibetan;
1603 m_value.ident = CSSValueTigre;
1606 m_value.ident = CSSValueTigrinyaEr;
1608 case TigrinyaErAbegede:
1609 m_value.ident = CSSValueTigrinyaErAbegede;
1612 m_value.ident = CSSValueTigrinyaEt;
1614 case TigrinyaEtAbegede:
1615 m_value.ident = CSSValueTigrinyaEtAbegede;
1618 m_value.ident = CSSValueUpperAlpha;
1621 m_value.ident = CSSValueUpperArmenian;
1624 m_value.ident = CSSValueUpperGreek;
1626 case UpperHexadecimal:
1627 m_value.ident = CSSValueUpperHexadecimal;
1630 m_value.ident = CSSValueUpperLatin;
1632 case UpperNorwegian:
1633 m_value.ident = CSSValueUpperNorwegian;
1636 m_value.ident = CSSValueUpperRoman;
1639 m_value.ident = CSSValueUrdu;
1644 template<> inline CSSPrimitiveValue::operator EListStyleType() const
1646 switch (m_value.ident) {
1648 return NoneListStyle;
1650 return static_cast<EListStyleType>(m_value.ident - CSSValueDisc);
1654 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarginCollapse e)
1655 : CSSValue(PrimitiveClass)
1657 m_primitiveUnitType = CSS_IDENT;
1660 m_value.ident = CSSValueCollapse;
1663 m_value.ident = CSSValueSeparate;
1666 m_value.ident = CSSValueDiscard;
1671 template<> inline CSSPrimitiveValue::operator EMarginCollapse() const
1673 switch (m_value.ident) {
1674 case CSSValueCollapse:
1676 case CSSValueSeparate:
1678 case CSSValueDiscard:
1681 ASSERT_NOT_REACHED();
1686 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeBehavior e)
1687 : CSSValue(PrimitiveClass)
1689 m_primitiveUnitType = CSS_IDENT;
1692 m_value.ident = CSSValueNone;
1695 m_value.ident = CSSValueScroll;
1698 m_value.ident = CSSValueSlide;
1701 m_value.ident = CSSValueAlternate;
1706 template<> inline CSSPrimitiveValue::operator EMarqueeBehavior() const
1708 switch (m_value.ident) {
1711 case CSSValueScroll:
1715 case CSSValueAlternate:
1718 ASSERT_NOT_REACHED();
1723 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RegionOverflow e)
1724 : CSSValue(PrimitiveClass)
1726 m_primitiveUnitType = CSS_IDENT;
1728 case AutoRegionOverflow:
1729 m_value.ident = CSSValueAuto;
1731 case BreakRegionOverflow:
1732 m_value.ident = CSSValueBreak;
1737 template<> inline CSSPrimitiveValue::operator RegionOverflow() const
1739 switch (m_value.ident) {
1741 return AutoRegionOverflow;
1743 return BreakRegionOverflow;
1745 ASSERT_NOT_REACHED();
1746 return AutoRegionOverflow;
1750 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMarqueeDirection e)
1751 : CSSValue(PrimitiveClass)
1753 m_primitiveUnitType = CSS_IDENT;
1756 m_value.ident = CSSValueForwards;
1759 m_value.ident = CSSValueBackwards;
1762 m_value.ident = CSSValueAuto;
1765 m_value.ident = CSSValueUp;
1768 m_value.ident = CSSValueDown;
1771 m_value.ident = CSSValueLeft;
1774 m_value.ident = CSSValueRight;
1779 template<> inline CSSPrimitiveValue::operator EMarqueeDirection() const
1781 switch (m_value.ident) {
1782 case CSSValueForwards:
1784 case CSSValueBackwards:
1789 case CSSValueUp: // We don't support vertical languages, so AHEAD just maps to UP.
1791 case CSSValueReverse:
1792 case CSSValueDown: // REVERSE just maps to DOWN, since we don't do vertical text.
1799 ASSERT_NOT_REACHED();
1804 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EMatchNearestMailBlockquoteColor e)
1805 : CSSValue(PrimitiveClass)
1807 m_primitiveUnitType = CSS_IDENT;
1810 m_value.ident = CSSValueNormal;
1813 m_value.ident = CSSValueMatch;
1818 template<> inline CSSPrimitiveValue::operator EMatchNearestMailBlockquoteColor() const
1820 switch (m_value.ident) {
1821 case CSSValueNormal:
1826 ASSERT_NOT_REACHED();
1831 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ENBSPMode e)
1832 : CSSValue(PrimitiveClass)
1834 m_primitiveUnitType = CSS_IDENT;
1837 m_value.ident = CSSValueNormal;
1840 m_value.ident = CSSValueSpace;
1845 template<> inline CSSPrimitiveValue::operator ENBSPMode() const
1847 switch (m_value.ident) {
1850 case CSSValueNormal:
1853 ASSERT_NOT_REACHED();
1858 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)
1859 : CSSValue(PrimitiveClass)
1861 m_primitiveUnitType = CSS_IDENT;
1864 m_value.ident = CSSValueVisible;
1867 m_value.ident = CSSValueHidden;
1870 m_value.ident = CSSValueScroll;
1873 m_value.ident = CSSValueAuto;
1876 m_value.ident = CSSValueWebkitMarquee;
1879 m_value.ident = CSSValueOverlay;
1884 template<> inline CSSPrimitiveValue::operator EOverflow() const
1886 switch (m_value.ident) {
1887 case CSSValueVisible:
1889 case CSSValueHidden:
1891 case CSSValueScroll:
1895 case CSSValueWebkitMarquee:
1897 case CSSValueOverlay:
1900 ASSERT_NOT_REACHED();
1905 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
1906 : CSSValue(PrimitiveClass)
1908 m_primitiveUnitType = CSS_IDENT;
1911 m_value.ident = CSSValueAuto;
1914 m_value.ident = CSSValueAlways;
1917 m_value.ident = CSSValueAvoid;
1922 template<> inline CSSPrimitiveValue::operator EPageBreak() const
1924 switch (m_value.ident) {
1929 case CSSValueAlways:
1930 return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
1934 ASSERT_NOT_REACHED();
1939 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
1940 : CSSValue(PrimitiveClass)
1942 m_primitiveUnitType = CSS_IDENT;
1944 case StaticPosition:
1945 m_value.ident = CSSValueStatic;
1947 case RelativePosition:
1948 m_value.ident = CSSValueRelative;
1950 case AbsolutePosition:
1951 m_value.ident = CSSValueAbsolute;
1954 m_value.ident = CSSValueFixed;
1959 template<> inline CSSPrimitiveValue::operator EPosition() const
1961 switch (m_value.ident) {
1962 case CSSValueStatic:
1963 return StaticPosition;
1964 case CSSValueRelative:
1965 return RelativePosition;
1966 case CSSValueAbsolute:
1967 return AbsolutePosition;
1969 return FixedPosition;
1971 ASSERT_NOT_REACHED();
1972 return StaticPosition;
1976 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)
1977 : CSSValue(PrimitiveClass)
1979 m_primitiveUnitType = CSS_IDENT;
1982 m_value.ident = CSSValueBoth;
1984 case RESIZE_HORIZONTAL:
1985 m_value.ident = CSSValueHorizontal;
1987 case RESIZE_VERTICAL:
1988 m_value.ident = CSSValueVertical;
1991 m_value.ident = CSSValueNone;
1996 template<> inline CSSPrimitiveValue::operator EResize() const
1998 switch (m_value.ident) {
2001 case CSSValueHorizontal:
2002 return RESIZE_HORIZONTAL;
2003 case CSSValueVertical:
2004 return RESIZE_VERTICAL;
2006 ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.
2011 ASSERT_NOT_REACHED();
2016 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)
2017 : CSSValue(PrimitiveClass)
2019 m_primitiveUnitType = CSS_IDENT;
2022 m_value.ident = CSSValueAuto;
2025 m_value.ident = CSSValueFixed;
2030 template<> inline CSSPrimitiveValue::operator ETableLayout() const
2032 switch (m_value.ident) {
2038 ASSERT_NOT_REACHED();
2043 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)
2044 : CSSValue(PrimitiveClass)
2046 m_primitiveUnitType = CSS_IDENT;
2049 m_value.ident = CSSValueWebkitAuto;
2052 m_value.ident = CSSValueStart;
2055 m_value.ident = CSSValueEnd;
2058 m_value.ident = CSSValueLeft;
2061 m_value.ident = CSSValueRight;
2064 m_value.ident = CSSValueCenter;
2067 m_value.ident = CSSValueJustify;
2070 m_value.ident = CSSValueWebkitLeft;
2073 m_value.ident = CSSValueWebkitRight;
2076 m_value.ident = CSSValueWebkitCenter;
2081 template<> inline CSSPrimitiveValue::operator ETextAlign() const
2083 switch (m_value.ident) {
2089 return static_cast<ETextAlign>(m_value.ident - CSSValueWebkitAuto);
2093 template<> inline CSSPrimitiveValue::operator ETextDecoration() const
2095 switch (m_value.ident) {
2098 case CSSValueUnderline:
2100 case CSSValueOverline:
2102 case CSSValueLineThrough:
2103 return LINE_THROUGH;
2107 ASSERT_NOT_REACHED();
2112 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
2113 : CSSValue(PrimitiveClass)
2115 m_primitiveUnitType = CSS_IDENT;
2118 m_value.ident = CSSValueNone;
2121 m_value.ident = CSSValueDisc;
2124 m_value.ident = CSSValueCircle;
2127 m_value.ident = CSSValueSquare;
2132 template<> inline CSSPrimitiveValue::operator ETextSecurity() const
2134 switch (m_value.ident) {
2139 case CSSValueCircle:
2141 case CSSValueSquare:
2144 ASSERT_NOT_REACHED();
2149 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)
2150 : CSSValue(PrimitiveClass)
2152 m_primitiveUnitType = CSS_IDENT;
2155 m_value.ident = CSSValueCapitalize;
2158 m_value.ident = CSSValueUppercase;
2161 m_value.ident = CSSValueLowercase;
2164 m_value.ident = CSSValueNone;
2169 template<> inline CSSPrimitiveValue::operator ETextTransform() const
2171 switch (m_value.ident) {
2172 case CSSValueCapitalize:
2174 case CSSValueUppercase:
2176 case CSSValueLowercase:
2181 ASSERT_NOT_REACHED();
2186 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
2187 : CSSValue(PrimitiveClass)
2189 m_primitiveUnitType = CSS_IDENT;
2192 m_value.ident = CSSValueNormal;
2195 m_value.ident = CSSValueEmbed;
2198 m_value.ident = CSSValueBidiOverride;
2201 m_value.ident = CSSValueWebkitIsolate;
2204 m_value.ident = CSSValueWebkitPlaintext;
2209 template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const
2211 switch (m_value.ident) {
2212 case CSSValueNormal:
2216 case CSSValueBidiOverride:
2218 case CSSValueWebkitIsolate:
2220 case CSSValueWebkitPlaintext:
2223 ASSERT_NOT_REACHED();
2228 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)
2229 : CSSValue(PrimitiveClass)
2231 m_primitiveUnitType = CSS_IDENT;
2234 m_value.ident = CSSValueAuto;
2237 m_value.ident = CSSValueNone;
2240 m_value.ident = CSSValueElement;
2245 template<> inline CSSPrimitiveValue::operator EUserDrag() const
2247 switch (m_value.ident) {
2252 case CSSValueElement:
2253 return DRAG_ELEMENT;
2255 ASSERT_NOT_REACHED();
2260 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)
2261 : CSSValue(PrimitiveClass)
2263 m_primitiveUnitType = CSS_IDENT;
2266 m_value.ident = CSSValueReadOnly;
2269 m_value.ident = CSSValueReadWrite;
2271 case READ_WRITE_PLAINTEXT_ONLY:
2272 m_value.ident = CSSValueReadWritePlaintextOnly;
2277 template<> inline CSSPrimitiveValue::operator EUserModify() const
2279 return static_cast<EUserModify>(m_value.ident - CSSValueReadOnly);
2282 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)
2283 : CSSValue(PrimitiveClass)
2285 m_primitiveUnitType = CSS_IDENT;
2288 m_value.ident = CSSValueNone;
2291 m_value.ident = CSSValueText;
2296 template<> inline CSSPrimitiveValue::operator EUserSelect() const
2298 switch (m_value.ident) {
2306 ASSERT_NOT_REACHED();
2311 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVerticalAlign a)
2312 : CSSValue(PrimitiveClass)
2314 m_primitiveUnitType = CSS_IDENT;
2317 m_value.ident = CSSValueTop;
2320 m_value.ident = CSSValueBottom;
2323 m_value.ident = CSSValueMiddle;
2326 m_value.ident = CSSValueBaseline;
2329 m_value.ident = CSSValueTextBottom;
2332 m_value.ident = CSSValueTextTop;
2335 m_value.ident = CSSValueSub;
2338 m_value.ident = CSSValueSuper;
2340 case BASELINE_MIDDLE:
2341 m_value.ident = CSSValueWebkitBaselineMiddle;
2344 m_value.ident = CSSValueInvalid;
2348 template<> inline CSSPrimitiveValue::operator EVerticalAlign() const
2350 switch (m_value.ident) {
2353 case CSSValueBottom:
2355 case CSSValueMiddle:
2357 case CSSValueBaseline:
2359 case CSSValueTextBottom:
2361 case CSSValueTextTop:
2367 case CSSValueWebkitBaselineMiddle:
2368 return BASELINE_MIDDLE;
2370 ASSERT_NOT_REACHED();
2375 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)
2376 : CSSValue(PrimitiveClass)
2378 m_primitiveUnitType = CSS_IDENT;
2381 m_value.ident = CSSValueVisible;
2384 m_value.ident = CSSValueHidden;
2387 m_value.ident = CSSValueCollapse;
2392 template<> inline CSSPrimitiveValue::operator EVisibility() const
2394 switch (m_value.ident) {
2395 case CSSValueHidden:
2397 case CSSValueVisible:
2399 case CSSValueCollapse:
2402 ASSERT_NOT_REACHED();
2407 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)
2408 : CSSValue(PrimitiveClass)
2410 m_primitiveUnitType = CSS_IDENT;
2413 m_value.ident = CSSValueNormal;
2416 m_value.ident = CSSValuePre;
2419 m_value.ident = CSSValuePreWrap;
2422 m_value.ident = CSSValuePreLine;
2425 m_value.ident = CSSValueNowrap;
2428 m_value.ident = CSSValueWebkitNowrap;
2433 template<> inline CSSPrimitiveValue::operator EWhiteSpace() const
2435 switch (m_value.ident) {
2436 case CSSValueWebkitNowrap:
2437 return KHTML_NOWRAP;
2438 case CSSValueNowrap:
2442 case CSSValuePreWrap:
2444 case CSSValuePreLine:
2446 case CSSValueNormal:
2449 ASSERT_NOT_REACHED();
2454 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)
2455 : CSSValue(PrimitiveClass)
2457 m_primitiveUnitType = CSS_IDENT;
2459 case NormalWordBreak:
2460 m_value.ident = CSSValueNormal;
2462 case BreakAllWordBreak:
2463 m_value.ident = CSSValueBreakAll;
2465 case BreakWordBreak:
2466 m_value.ident = CSSValueBreakWord;
2471 template<> inline CSSPrimitiveValue::operator EWordBreak() const
2473 switch (m_value.ident) {
2474 case CSSValueBreakAll:
2475 return BreakAllWordBreak;
2476 case CSSValueBreakWord:
2477 return BreakWordBreak;
2478 case CSSValueNormal:
2479 return NormalWordBreak;
2481 ASSERT_NOT_REACHED();
2482 return NormalWordBreak;
2486 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordWrap e)
2487 : CSSValue(PrimitiveClass)
2489 m_primitiveUnitType = CSS_IDENT;
2491 case NormalWordWrap:
2492 m_value.ident = CSSValueNormal;
2495 m_value.ident = CSSValueBreakWord;
2500 template<> inline CSSPrimitiveValue::operator EWordWrap() const
2502 switch (m_value.ident) {
2503 case CSSValueBreakWord:
2504 return BreakWordWrap;
2505 case CSSValueNormal:
2506 return NormalWordWrap;
2508 ASSERT_NOT_REACHED();
2509 return NormalWordWrap;
2513 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)
2514 : CSSValue(PrimitiveClass)
2516 m_primitiveUnitType = CSS_IDENT;
2519 m_value.ident = CSSValueLtr;
2522 m_value.ident = CSSValueRtl;
2527 template<> inline CSSPrimitiveValue::operator TextDirection() const
2529 switch (m_value.ident) {
2535 ASSERT_NOT_REACHED();
2540 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WritingMode e)
2541 : CSSValue(PrimitiveClass)
2543 m_primitiveUnitType = CSS_IDENT;
2545 case TopToBottomWritingMode:
2546 m_value.ident = CSSValueHorizontalTb;
2548 case RightToLeftWritingMode:
2549 m_value.ident = CSSValueVerticalRl;
2551 case LeftToRightWritingMode:
2552 m_value.ident = CSSValueVerticalLr;
2554 case BottomToTopWritingMode:
2555 m_value.ident = CSSValueHorizontalBt;
2560 template<> inline CSSPrimitiveValue::operator WritingMode() const
2562 switch (m_value.ident) {
2563 case CSSValueHorizontalTb:
2564 return TopToBottomWritingMode;
2565 case CSSValueVerticalRl:
2566 return RightToLeftWritingMode;
2567 case CSSValueVerticalLr:
2568 return LeftToRightWritingMode;
2569 case CSSValueHorizontalBt:
2570 return BottomToTopWritingMode;
2572 ASSERT_NOT_REACHED();
2573 return TopToBottomWritingMode;
2577 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextCombine e)
2578 : CSSValue(PrimitiveClass)
2580 m_primitiveUnitType = CSS_IDENT;
2582 case TextCombineNone:
2583 m_value.ident = CSSValueNone;
2585 case TextCombineHorizontal:
2586 m_value.ident = CSSValueHorizontal;
2591 template<> inline CSSPrimitiveValue::operator TextCombine() const
2593 switch (m_value.ident) {
2595 return TextCombineNone;
2596 case CSSValueHorizontal:
2597 return TextCombineHorizontal;
2599 ASSERT_NOT_REACHED();
2600 return TextCombineNone;
2604 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
2605 : CSSValue(PrimitiveClass)
2607 m_primitiveUnitType = CSS_IDENT;
2609 case TextEmphasisPositionOver:
2610 m_value.ident = CSSValueOver;
2612 case TextEmphasisPositionUnder:
2613 m_value.ident = CSSValueUnder;
2618 template<> inline CSSPrimitiveValue::operator TextEmphasisPosition() const
2620 switch (m_value.ident) {
2622 return TextEmphasisPositionOver;
2624 return TextEmphasisPositionUnder;
2626 ASSERT_NOT_REACHED();
2627 return TextEmphasisPositionOver;
2631 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOverflow overflow)
2632 : CSSValue(PrimitiveClass)
2634 m_primitiveUnitType = CSS_IDENT;
2636 case TextOverflowClip:
2637 m_value.ident = CSSValueClip;
2639 case TextOverflowEllipsis:
2640 m_value.ident = CSSValueEllipsis;
2645 template<> inline CSSPrimitiveValue::operator TextOverflow() const
2647 switch (m_value.ident) {
2649 return TextOverflowClip;
2650 case CSSValueEllipsis:
2651 return TextOverflowEllipsis;
2653 ASSERT_NOT_REACHED();
2654 return TextOverflowClip;
2658 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisFill fill)
2659 : CSSValue(PrimitiveClass)
2661 m_primitiveUnitType = CSS_IDENT;
2663 case TextEmphasisFillFilled:
2664 m_value.ident = CSSValueFilled;
2666 case TextEmphasisFillOpen:
2667 m_value.ident = CSSValueOpen;
2672 template<> inline CSSPrimitiveValue::operator TextEmphasisFill() const
2674 switch (m_value.ident) {
2675 case CSSValueFilled:
2676 return TextEmphasisFillFilled;
2678 return TextEmphasisFillOpen;
2680 ASSERT_NOT_REACHED();
2681 return TextEmphasisFillFilled;
2685 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisMark mark)
2686 : CSSValue(PrimitiveClass)
2688 m_primitiveUnitType = CSS_IDENT;
2690 case TextEmphasisMarkDot:
2691 m_value.ident = CSSValueDot;
2693 case TextEmphasisMarkCircle:
2694 m_value.ident = CSSValueCircle;
2696 case TextEmphasisMarkDoubleCircle:
2697 m_value.ident = CSSValueDoubleCircle;
2699 case TextEmphasisMarkTriangle:
2700 m_value.ident = CSSValueTriangle;
2702 case TextEmphasisMarkSesame:
2703 m_value.ident = CSSValueSesame;
2705 case TextEmphasisMarkNone:
2706 case TextEmphasisMarkAuto:
2707 case TextEmphasisMarkCustom:
2708 ASSERT_NOT_REACHED();
2709 m_value.ident = CSSValueNone;
2714 template<> inline CSSPrimitiveValue::operator TextEmphasisMark() const
2716 switch (m_value.ident) {
2718 return TextEmphasisMarkNone;
2720 return TextEmphasisMarkDot;
2721 case CSSValueCircle:
2722 return TextEmphasisMarkCircle;
2723 case CSSValueDoubleCircle:
2724 return TextEmphasisMarkDoubleCircle;
2725 case CSSValueTriangle:
2726 return TextEmphasisMarkTriangle;
2727 case CSSValueSesame:
2728 return TextEmphasisMarkSesame;
2730 ASSERT_NOT_REACHED();
2731 return TextEmphasisMarkNone;
2735 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
2736 : CSSValue(PrimitiveClass)
2738 m_primitiveUnitType = CSS_IDENT;
2740 case TextOrientationVerticalRight:
2741 m_value.ident = CSSValueVerticalRight;
2743 case TextOrientationUpright:
2744 m_value.ident = CSSValueUpright;
2749 template<> inline CSSPrimitiveValue::operator TextOrientation() const
2751 switch (m_value.ident) {
2752 case CSSValueVerticalRight:
2753 return TextOrientationVerticalRight;
2754 case CSSValueUpright:
2755 return TextOrientationUpright;
2757 ASSERT_NOT_REACHED();
2758 return TextOrientationVerticalRight;
2762 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
2763 : CSSValue(PrimitiveClass)
2765 m_primitiveUnitType = CSS_IDENT;
2768 m_value.ident = CSSValueNone;
2771 m_value.ident = CSSValueStroke;
2774 m_value.ident = CSSValueFill;
2777 m_value.ident = CSSValuePainted;
2780 m_value.ident = CSSValueVisible;
2782 case PE_VISIBLE_STROKE:
2783 m_value.ident = CSSValueVisiblestroke;
2785 case PE_VISIBLE_FILL:
2786 m_value.ident = CSSValueVisiblefill;
2788 case PE_VISIBLE_PAINTED:
2789 m_value.ident = CSSValueVisiblepainted;
2792 m_value.ident = CSSValueAuto;
2795 m_value.ident = CSSValueAll;
2800 template<> inline CSSPrimitiveValue::operator EPointerEvents() const
2802 switch (m_value.ident) {
2809 case CSSValueVisiblepainted:
2810 return PE_VISIBLE_PAINTED;
2811 case CSSValueVisiblefill:
2812 return PE_VISIBLE_FILL;
2813 case CSSValueVisiblestroke:
2814 return PE_VISIBLE_STROKE;
2815 case CSSValueVisible:
2817 case CSSValuePainted:
2821 case CSSValueStroke:
2824 ASSERT_NOT_REACHED();
2829 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
2830 : CSSValue(PrimitiveClass)
2832 m_primitiveUnitType = CSS_IDENT;
2833 switch (smoothing) {
2835 m_value.ident = CSSValueAuto;
2838 m_value.ident = CSSValueNone;
2841 m_value.ident = CSSValueAntialiased;
2843 case SubpixelAntialiased:
2844 m_value.ident = CSSValueSubpixelAntialiased;
2848 ASSERT_NOT_REACHED();
2849 m_value.ident = CSSValueAuto;
2852 template<> inline CSSPrimitiveValue::operator FontSmoothingMode() const
2854 switch (m_value.ident) {
2856 return AutoSmoothing;
2859 case CSSValueAntialiased:
2861 case CSSValueSubpixelAntialiased:
2862 return SubpixelAntialiased;
2865 ASSERT_NOT_REACHED();
2866 return AutoSmoothing;
2869 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontWeight weight)
2870 : CSSValue(PrimitiveClass)
2872 m_primitiveUnitType = CSS_IDENT;
2875 m_value.ident = CSSValue900;
2878 m_value.ident = CSSValue800;
2881 m_value.ident = CSSValue700;
2884 m_value.ident = CSSValue600;
2887 m_value.ident = CSSValue500;
2890 m_value.ident = CSSValue400;
2893 m_value.ident = CSSValue300;
2896 m_value.ident = CSSValue200;
2899 m_value.ident = CSSValue100;
2903 ASSERT_NOT_REACHED();
2904 m_value.ident = CSSValueNormal;
2907 template<> inline CSSPrimitiveValue::operator FontWeight() const
2909 switch (m_value.ident) {
2911 return FontWeightBold;
2912 case CSSValueNormal:
2913 return FontWeightNormal;
2915 return FontWeight900;
2917 return FontWeight800;
2919 return FontWeight700;
2921 return FontWeight600;
2923 return FontWeight500;
2925 return FontWeight400;
2927 return FontWeight300;
2929 return FontWeight200;
2931 return FontWeight100;
2934 ASSERT_NOT_REACHED();
2935 return FontWeightNormal;
2938 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontItalic italic)
2939 : CSSValue(PrimitiveClass)
2941 m_primitiveUnitType = CSS_IDENT;
2944 m_value.ident = CSSValueNormal;
2947 m_value.ident = CSSValueItalic;
2951 ASSERT_NOT_REACHED();
2952 m_value.ident = CSSValueNormal;
2955 template<> inline CSSPrimitiveValue::operator FontItalic() const
2957 switch (m_value.ident) {
2958 case CSSValueOblique:
2959 // FIXME: oblique is the same as italic for the moment...
2960 case CSSValueItalic:
2961 return FontItalicOn;
2962 case CSSValueNormal:
2963 return FontItalicOff;
2965 ASSERT_NOT_REACHED();
2966 return FontItalicOff;
2969 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmallCaps smallCaps)
2970 : CSSValue(PrimitiveClass)
2972 m_primitiveUnitType = CSS_IDENT;
2973 switch (smallCaps) {
2974 case FontSmallCapsOff:
2975 m_value.ident = CSSValueNormal;
2977 case FontSmallCapsOn:
2978 m_value.ident = CSSValueSmallCaps;
2982 ASSERT_NOT_REACHED();
2983 m_value.ident = CSSValueNormal;
2986 template<> inline CSSPrimitiveValue::operator FontSmallCaps() const
2988 switch (m_value.ident) {
2989 case CSSValueSmallCaps:
2990 return FontSmallCapsOn;
2991 case CSSValueNormal:
2992 return FontSmallCapsOff;
2994 ASSERT_NOT_REACHED();
2995 return FontSmallCapsOff;
2998 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
2999 : CSSValue(PrimitiveClass)
3001 m_primitiveUnitType = CSS_IDENT;
3003 case AutoTextRendering:
3004 m_value.ident = CSSValueAuto;
3007 m_value.ident = CSSValueOptimizespeed;
3009 case OptimizeLegibility:
3010 m_value.ident = CSSValueOptimizelegibility;
3012 case GeometricPrecision:
3013 m_value.ident = CSSValueGeometricprecision;
3018 template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
3020 switch (m_value.ident) {
3022 return AutoTextRendering;
3023 case CSSValueOptimizespeed:
3024 return OptimizeSpeed;
3025 case CSSValueOptimizelegibility:
3026 return OptimizeLegibility;
3027 case CSSValueGeometricprecision:
3028 return GeometricPrecision;
3030 ASSERT_NOT_REACHED();
3031 return AutoTextRendering;
3035 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
3036 : CSSValue(PrimitiveClass)
3038 m_primitiveUnitType = CSS_IDENT;
3040 case ColorSpaceDeviceRGB:
3041 m_value.ident = CSSValueDefault;
3043 case ColorSpaceSRGB:
3044 m_value.ident = CSSValueSrgb;
3046 case ColorSpaceLinearRGB:
3047 // CSS color correction does not support linearRGB yet.
3048 ASSERT_NOT_REACHED();
3049 m_value.ident = CSSValueDefault;
3054 template<> inline CSSPrimitiveValue::operator ColorSpace() const
3056 switch (m_value.ident) {
3057 case CSSValueDefault:
3058 return ColorSpaceDeviceRGB;
3060 return ColorSpaceSRGB;
3062 ASSERT_NOT_REACHED();
3063 return ColorSpaceDeviceRGB;
3067 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
3068 : CSSValue(PrimitiveClass)
3070 m_primitiveUnitType = CSS_IDENT;
3073 m_value.ident = CSSValueNone;
3076 m_value.ident = CSSValueManual;
3079 m_value.ident = CSSValueAuto;
3084 template<> inline CSSPrimitiveValue::operator Hyphens() const
3086 switch (m_value.ident) {
3089 case CSSValueManual:
3090 return HyphensManual;
3094 ASSERT_NOT_REACHED();
3099 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineGridSnap gridSnap)
3100 : CSSValue(PrimitiveClass)
3102 m_primitiveUnitType = CSS_IDENT;
3104 case LineGridSnapNone:
3105 m_value.ident = CSSValueNone;
3107 case LineGridSnapBaseline:
3108 m_value.ident = CSSValueBaseline;
3110 case LineGridSnapBounds:
3111 m_value.ident = CSSValueBounds;
3116 template<> inline CSSPrimitiveValue::operator LineGridSnap() const
3118 switch (m_value.ident) {
3120 return LineGridSnapNone;
3121 case CSSValueBaseline:
3122 return LineGridSnapBaseline;
3123 case CSSValueBounds:
3124 return LineGridSnapBounds;
3126 ASSERT_NOT_REACHED();
3127 return LineGridSnapNone;
3131 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ESpeak e)
3132 : CSSValue(PrimitiveClass)
3134 m_primitiveUnitType = CSS_IDENT;
3137 m_value.ident = CSSValueNone;
3140 m_value.ident = CSSValueNormal;
3143 m_value.ident = CSSValueSpellOut;
3146 m_value.ident = CSSValueDigits;
3148 case SpeakLiteralPunctuation:
3149 m_value.ident = CSSValueLiteralPunctuation;
3151 case SpeakNoPunctuation:
3152 m_value.ident = CSSValueNoPunctuation;
3157 template<> inline CSSPrimitiveValue::operator Order() const
3159 switch (m_value.ident) {
3160 case CSSValueLogical:
3161 return LogicalOrder;
3162 case CSSValueVisual:
3165 ASSERT_NOT_REACHED();
3166 return LogicalOrder;
3170 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Order e)
3171 : CSSValue(PrimitiveClass)
3173 m_primitiveUnitType = CSS_IDENT;
3176 m_value.ident = CSSValueLogical;
3179 m_value.ident = CSSValueVisual;
3184 template<> inline CSSPrimitiveValue::operator ESpeak() const
3186 switch (m_value.ident) {
3189 case CSSValueNormal:
3191 case CSSValueSpellOut:
3192 return SpeakSpellOut;
3193 case CSSValueDigits:
3195 case CSSValueLiteralPunctuation:
3196 return SpeakLiteralPunctuation;
3197 case CSSValueNoPunctuation:
3198 return SpeakNoPunctuation;
3200 ASSERT_NOT_REACHED();
3205 #if ENABLE(CSS_SHADERS)
3206 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CustomFilterOperation::MeshBoxType meshBoxType)
3207 : CSSValue(PrimitiveClass)
3209 m_primitiveUnitType = CSS_IDENT;
3210 switch (meshBoxType) {
3211 case CustomFilterOperation::FILTER_BOX:
3212 m_value.ident = CSSValueFilterBox;
3214 case CustomFilterOperation::BORDER_BOX:
3215 m_value.ident = CSSValueBorderBox;
3217 case CustomFilterOperation::PADDING_BOX:
3218 m_value.ident = CSSValuePaddingBox;
3220 case CustomFilterOperation::CONTENT_BOX:
3221 m_value.ident = CSSValueContentBox;
3226 template<> inline CSSPrimitiveValue::operator CustomFilterOperation::MeshBoxType() const
3228 switch (m_value.ident) {
3229 case CSSValueFilterBox:
3230 return CustomFilterOperation::FILTER_BOX;
3231 case CSSValueBorderBox:
3232 return CustomFilterOperation::BORDER_BOX;
3233 case CSSValuePaddingBox:
3234 return CustomFilterOperation::PADDING_BOX;
3235 case CSSValueContentBox:
3236 return CustomFilterOperation::CONTENT_BOX;
3238 ASSERT_NOT_REACHED();
3239 return CustomFilterOperation::FILTER_BOX;
3242 #endif // ENABLE(CSS_SHADERS)
3246 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
3247 : CSSValue(PrimitiveClass)
3249 m_primitiveUnitType = CSS_IDENT;
3252 m_value.ident = CSSValueButt;
3255 m_value.ident = CSSValueRound;
3258 m_value.ident = CSSValueSquare;
3263 template<> inline CSSPrimitiveValue::operator LineCap() const
3265 switch (m_value.ident) {
3270 case CSSValueSquare:
3273 ASSERT_NOT_REACHED();
3278 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)
3279 : CSSValue(PrimitiveClass)
3281 m_primitiveUnitType = CSS_IDENT;
3284 m_value.ident = CSSValueMiter;
3287 m_value.ident = CSSValueRound;
3290 m_value.ident = CSSValueBevel;
3295 template<> inline CSSPrimitiveValue::operator LineJoin() const
3297 switch (m_value.ident) {
3305 ASSERT_NOT_REACHED();
3310 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)
3311 : CSSValue(PrimitiveClass)
3313 m_primitiveUnitType = CSS_IDENT;
3316 m_value.ident = CSSValueNonzero;
3319 m_value.ident = CSSValueEvenodd;
3324 template<> inline CSSPrimitiveValue::operator WindRule() const
3326 switch (m_value.ident) {
3327 case CSSValueNonzero:
3328 return RULE_NONZERO;
3329 case CSSValueEvenodd:
3330 return RULE_EVENODD;
3332 ASSERT_NOT_REACHED();
3333 return RULE_NONZERO;
3338 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)
3339 : CSSValue(PrimitiveClass)
3341 m_primitiveUnitType = CSS_IDENT;
3344 m_value.ident = CSSValueAuto;
3347 m_value.ident = CSSValueBaseline;
3349 case AB_BEFORE_EDGE:
3350 m_value.ident = CSSValueBeforeEdge;
3352 case AB_TEXT_BEFORE_EDGE:
3353 m_value.ident = CSSValueTextBeforeEdge;
3356 m_value.ident = CSSValueMiddle;
3359 m_value.ident = CSSValueCentral;
3362 m_value.ident = CSSValueAfterEdge;
3364 case AB_TEXT_AFTER_EDGE:
3365 m_value.ident = CSSValueTextAfterEdge;
3367 case AB_IDEOGRAPHIC:
3368 m_value.ident = CSSValueIdeographic;
3371 m_value.ident = CSSValueAlphabetic;
3374 m_value.ident = CSSValueHanging;
3376 case AB_MATHEMATICAL:
3377 m_value.ident = CSSValueMathematical;
3382 template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const
3384 switch (m_value.ident) {
3387 case CSSValueBaseline:
3389 case CSSValueBeforeEdge:
3390 return AB_BEFORE_EDGE;
3391 case CSSValueTextBeforeEdge:
3392 return AB_TEXT_BEFORE_EDGE;
3393 case CSSValueMiddle:
3395 case CSSValueCentral:
3397 case CSSValueAfterEdge:
3398 return AB_AFTER_EDGE;
3399 case CSSValueTextAfterEdge:
3400 return AB_TEXT_AFTER_EDGE;
3401 case CSSValueIdeographic:
3402 return AB_IDEOGRAPHIC;
3403 case CSSValueAlphabetic:
3404 return AB_ALPHABETIC;
3405 case CSSValueHanging:
3407 case CSSValueMathematical:
3408 return AB_MATHEMATICAL;
3410 ASSERT_NOT_REACHED();
3417 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderCollapse e)
3418 : CSSValue(PrimitiveClass)
3420 m_primitiveUnitType = CSS_IDENT;
3423 m_value.ident = CSSValueSeparate;
3426 m_value.ident = CSSValueCollapse;
3431 template<> inline CSSPrimitiveValue::operator EBorderCollapse() const
3433 switch (m_value.ident) {
3434 case CSSValueSeparate:
3436 case CSSValueCollapse:
3439 ASSERT_NOT_REACHED();
3444 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBorderFit e)
3445 : CSSValue(PrimitiveClass)
3447 m_primitiveUnitType = CSS_IDENT;
3449 case BorderFitBorder:
3450 m_value.ident = CSSValueBorder;
3452 case BorderFitLines:
3453 m_value.ident = CSSValueLines;
3458 template<> inline CSSPrimitiveValue::operator EBorderFit() const
3460 switch (m_value.ident) {
3461 case CSSValueBorder:
3462 return BorderFitBorder;
3464 return BorderFitLines;
3466 ASSERT_NOT_REACHED();
3467 return BorderFitLines;
3471 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)
3472 : CSSValue(PrimitiveClass)