Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / style / RenderStyleConstants.h
1 /*
2  * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3  *           (C) 2000 Antti Koivisto (koivisto@kde.org)
4  *           (C) 2000 Dirk Mueller (mueller@kde.org)
5  * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
6  * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public License
20  * along with this library; see the file COPYING.LIB.  If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  *
24  */
25
26 #ifndef RenderStyleConstants_h
27 #define RenderStyleConstants_h
28
29 namespace blink {
30
31 // Sides used when drawing borders and outlines. The values should run clockwise from top.
32 enum BoxSide {
33     BSTop,
34     BSRight,
35     BSBottom,
36     BSLeft
37 };
38
39 enum StyleRecalcChange {
40     NoChange,
41     NoInherit,
42     UpdatePseudoElements,
43     Inherit,
44     Force,
45     Reattach,
46     ReattachNoRenderer
47 };
48
49 static const size_t PrintColorAdjustBits = 1;
50 enum PrintColorAdjust {
51     PrintColorAdjustEconomy,
52     PrintColorAdjustExact
53 };
54
55 // Static pseudo styles. Dynamic ones are produced on the fly.
56 enum PseudoId {
57     // The order must be NOP ID, public IDs, and then internal IDs.
58     // If you add or remove a public ID, you must update _pseudoBits in RenderStyle.
59     NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, BACKDROP, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR,
60     // Internal IDs follow:
61     SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, INPUT_LIST_BUTTON,
62     // Special values follow:
63     AFTER_LAST_INTERNAL_PSEUDOID,
64     FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
65     FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB,
66     PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1),
67     PSEUDO_ELEMENT_MASK = (1 << (BEFORE - 1)) | (1 << (AFTER - 1)) | (1 << (BACKDROP - 1))
68 };
69
70 enum ColumnFill { ColumnFillBalance, ColumnFillAuto };
71
72 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll };
73
74 enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };
75
76 // These have been defined in the order of their precedence for border-collapsing. Do
77 // not change this order! This order also must match the order in CSSValueKeywords.in.
78 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, OUTSET, RIDGE, DOTTED, DASHED, SOLID, DOUBLE };
79
80 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
81
82 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
83
84 enum EPosition {
85     StaticPosition = 0,
86     RelativePosition = 1,
87     AbsolutePosition = 2,
88     // This value is required to pack our bits efficiently in RenderObject.
89     // FIXME: Is this still true now that we've remove position: sticky.
90     FixedPosition = 6
91 };
92
93 enum EFloat {
94     NoFloat, LeftFloat, RightFloat
95 };
96
97 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
98
99 // Box decoration attributes. Not inherited.
100
101 enum EBoxDecorationBreak { DSLICE, DCLONE };
102
103 // Box attributes. Not inherited.
104
105 enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
106
107 // Random visual rendering model attributes. Not inherited.
108
109 enum EOverflow {
110     OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OPAGEDX, OPAGEDY
111 };
112
113 enum EVerticalAlign {
114     BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP,
115     TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
116 };
117
118 enum EClear {
119     CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
120 };
121
122 enum ETableLayout {
123     TAUTO, TFIXED
124 };
125
126 enum TextCombine {
127     TextCombineNone, TextCombineHorizontal
128 };
129
130 enum EFillAttachment {
131     ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
132 };
133
134 enum EFillBox {
135     BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox
136 };
137
138 enum EFillRepeat {
139     RepeatFill, NoRepeatFill, RoundFill, SpaceFill
140 };
141
142 enum EFillLayerType {
143     BackgroundFillLayer, MaskFillLayer
144 };
145
146 // CSS3 Background Values
147 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
148
149 // CSS3 Background Position
150 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
151
152 // CSS Mask Source Types
153 enum EMaskSourceType { MaskAlpha, MaskLuminance };
154
155 // Deprecated Flexible Box Properties
156
157 enum EBoxPack { Start, Center, End, Justify };
158 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BBASELINE };
159 enum EBoxOrient { HORIZONTAL, VERTICAL };
160 enum EBoxLines { SINGLE, MULTIPLE };
161 enum EBoxDirection { BNORMAL, BREVERSE };
162
163 // CSS3 Flexbox Properties
164
165 enum EAlignContent { AlignContentFlexStart, AlignContentFlexEnd, AlignContentCenter, AlignContentSpaceBetween, AlignContentSpaceAround, AlignContentStretch };
166 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
167 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
168
169 enum ETextSecurity {
170     TSNONE, TSDISC, TSCIRCLE, TSSQUARE
171 };
172
173 // CSS3 User Modify Properties
174
175 enum EUserModify {
176     READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY
177 };
178
179 // CSS3 User Drag Values
180
181 enum EUserDrag {
182     DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
183 };
184
185 // CSS3 User Select Values
186
187 enum EUserSelect {
188     SELECT_NONE, SELECT_TEXT, SELECT_ALL
189 };
190
191 // CSS3 Image Values
192 enum ObjectFit { ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown };
193
194 // Word Break Values. Matches WinIE, rather than CSS3
195
196 enum EWordBreak {
197     NormalWordBreak, BreakAllWordBreak, BreakWordBreak
198 };
199
200 enum EOverflowWrap {
201     NormalOverflowWrap, BreakOverflowWrap
202 };
203
204 enum LineBreak {
205     LineBreakAuto, LineBreakLoose, LineBreakNormal, LineBreakStrict, LineBreakAfterWhiteSpace
206 };
207
208 enum EResize {
209     RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
210 };
211
212 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
213 enum EListStyleType {
214     Disc,
215     Circle,
216     Square,
217     DecimalListStyle,
218     DecimalLeadingZero,
219     ArabicIndic,
220     BinaryListStyle,
221     Bengali,
222     Cambodian,
223     Khmer,
224     Devanagari,
225     Gujarati,
226     Gurmukhi,
227     Kannada,
228     LowerHexadecimal,
229     Lao,
230     Malayalam,
231     Mongolian,
232     Myanmar,
233     Octal,
234     Oriya,
235     Persian,
236     Urdu,
237     Telugu,
238     Tibetan,
239     Thai,
240     UpperHexadecimal,
241     LowerRoman,
242     UpperRoman,
243     LowerGreek,
244     LowerAlpha,
245     LowerLatin,
246     UpperAlpha,
247     UpperLatin,
248     Afar,
249     EthiopicHalehameAaEt,
250     EthiopicHalehameAaEr,
251     Amharic,
252     EthiopicHalehameAmEt,
253     AmharicAbegede,
254     EthiopicAbegedeAmEt,
255     CjkEarthlyBranch,
256     CjkHeavenlyStem,
257     Ethiopic,
258     EthiopicHalehameGez,
259     EthiopicAbegede,
260     EthiopicAbegedeGez,
261     HangulConsonant,
262     Hangul,
263     LowerNorwegian,
264     Oromo,
265     EthiopicHalehameOmEt,
266     Sidama,
267     EthiopicHalehameSidEt,
268     Somali,
269     EthiopicHalehameSoEt,
270     Tigre,
271     EthiopicHalehameTig,
272     TigrinyaEr,
273     EthiopicHalehameTiEr,
274     TigrinyaErAbegede,
275     EthiopicAbegedeTiEr,
276     TigrinyaEt,
277     EthiopicHalehameTiEt,
278     TigrinyaEtAbegede,
279     EthiopicAbegedeTiEt,
280     UpperGreek,
281     UpperNorwegian,
282     Asterisks,
283     Footnotes,
284     Hebrew,
285     Armenian,
286     LowerArmenian,
287     UpperArmenian,
288     Georgian,
289     CJKIdeographic,
290     Hiragana,
291     Katakana,
292     HiraganaIroha,
293     KatakanaIroha,
294     NoneListStyle
295 };
296
297 enum QuoteType {
298     OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
299 };
300
301 enum EAnimPlayState {
302     AnimPlayStatePlaying,
303     AnimPlayStatePaused
304 };
305
306 enum EWhiteSpace {
307     NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP
308 };
309
310 // The order of this enum must match the order of the text align values in CSSValueKeywords.in.
311 enum ETextAlign {
312     LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND,
313 };
314
315 enum ETextTransform {
316     CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
317 };
318
319 static const size_t TextDecorationBits = 4;
320 enum TextDecoration {
321     TextDecorationNone = 0x0,
322     TextDecorationUnderline = 0x1,
323     TextDecorationOverline = 0x2,
324     TextDecorationLineThrough = 0x4,
325     TextDecorationBlink = 0x8
326 };
327 inline TextDecoration operator| (TextDecoration a, TextDecoration b) { return TextDecoration(int(a) | int(b)); }
328 inline TextDecoration& operator|= (TextDecoration& a, TextDecoration b) { return a = a | b; }
329
330 enum TextDecorationStyle {
331     TextDecorationStyleSolid,
332     TextDecorationStyleDouble,
333     TextDecorationStyleDotted,
334     TextDecorationStyleDashed,
335     TextDecorationStyleWavy
336 };
337
338 enum TextAlignLast {
339     TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
340 };
341
342 enum TextJustify {
343     TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyDistribute
344 };
345
346 enum TextUnderlinePosition {
347     // FIXME: Implement support for 'under left' and 'under right' values.
348     TextUnderlinePositionAuto,
349     TextUnderlinePositionUnder
350 };
351
352 enum EPageBreak {
353     PBAUTO, PBALWAYS, PBAVOID
354 };
355
356 enum EEmptyCell {
357     SHOW, HIDE
358 };
359
360 enum ECaptionSide {
361     CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
362 };
363
364 enum EListStylePosition { OUTSIDE, INSIDE };
365
366 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
367
368 enum ECursor {
369     // The following must match the order in CSSValueKeywords.in.
370     CURSOR_AUTO,
371     CURSOR_CROSS,
372     CURSOR_DEFAULT,
373     CURSOR_POINTER,
374     CURSOR_MOVE,
375     CURSOR_VERTICAL_TEXT,
376     CURSOR_CELL,
377     CURSOR_CONTEXT_MENU,
378     CURSOR_ALIAS,
379     CURSOR_PROGRESS,
380     CURSOR_NO_DROP,
381     CURSOR_NOT_ALLOWED,
382     CURSOR_ZOOM_IN,
383     CURSOR_ZOOM_OUT,
384     CURSOR_E_RESIZE,
385     CURSOR_NE_RESIZE,
386     CURSOR_NW_RESIZE,
387     CURSOR_N_RESIZE,
388     CURSOR_SE_RESIZE,
389     CURSOR_SW_RESIZE,
390     CURSOR_S_RESIZE,
391     CURSOR_W_RESIZE,
392     CURSOR_EW_RESIZE,
393     CURSOR_NS_RESIZE,
394     CURSOR_NESW_RESIZE,
395     CURSOR_NWSE_RESIZE,
396     CURSOR_COL_RESIZE,
397     CURSOR_ROW_RESIZE,
398     CURSOR_TEXT,
399     CURSOR_WAIT,
400     CURSOR_HELP,
401     CURSOR_ALL_SCROLL,
402     CURSOR_WEBKIT_GRAB,
403     CURSOR_WEBKIT_GRABBING,
404
405     // The following are handled as exceptions so don't need to match.
406     CURSOR_COPY,
407     CURSOR_NONE
408 };
409
410 // The order of this enum must match the order of the display values in CSSValueKeywords.in.
411 enum EDisplay {
412     INLINE, BLOCK, LIST_ITEM, INLINE_BLOCK,
413     TABLE, INLINE_TABLE, TABLE_ROW_GROUP,
414     TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW,
415     TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL,
416     TABLE_CAPTION, BOX, INLINE_BOX,
417     FLEX, INLINE_FLEX,
418     GRID, INLINE_GRID,
419     NONE,
420     FIRST_TABLE_DISPLAY = TABLE,
421     LAST_TABLE_DISPLAY = TABLE_CAPTION
422 };
423
424 enum EInsideLink {
425     NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
426 };
427
428 enum EPointerEvents {
429     PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
430     PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_BOUNDINGBOX,
431     PE_ALL
432 };
433
434 enum ETransformStyle3D {
435     TransformStyle3DFlat, TransformStyle3DPreserve3D
436 };
437
438 enum EBackfaceVisibility {
439     BackfaceVisibilityVisible, BackfaceVisibilityHidden
440 };
441
442 enum ELineClampType { LineClampLineCount, LineClampPercentage };
443
444 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
445
446 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
447
448 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
449
450 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
451
452 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
453
454 enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight };
455
456 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
457
458 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast, ImageRenderingPixelated };
459
460 enum ImageResolutionSource { ImageResolutionSpecified = 0, ImageResolutionFromImage };
461
462 enum ImageResolutionSnap { ImageResolutionNoSnap = 0, ImageResolutionSnapPixels };
463
464 enum Order { LogicalOrder = 0, VisualOrder };
465
466 enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlowMaximum, WrapFlowClear };
467
468 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
469
470 enum RubyPosition { RubyPositionBefore, RubyPositionAfter };
471
472 static const size_t GridAutoFlowBits = 5;
473 enum InternalGridAutoFlowAlgorithm {
474     InternalAutoFlowAlgorithmSparse = 0x1,
475     InternalAutoFlowAlgorithmDense = 0x2,
476     InternalAutoFlowAlgorithmStack = 0x4
477 };
478
479 enum InternalGridAutoFlowDirection {
480     InternalAutoFlowDirectionRow = 0x8,
481     InternalAutoFlowDirectionColumn = 0x10
482 };
483
484 enum GridAutoFlow {
485     AutoFlowRow = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionRow,
486     AutoFlowColumn = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionColumn,
487     AutoFlowRowDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionRow,
488     AutoFlowColumnDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionColumn,
489     AutoFlowStackRow = InternalAutoFlowAlgorithmStack | InternalAutoFlowDirectionRow,
490     AutoFlowStackColumn = InternalAutoFlowAlgorithmStack | InternalAutoFlowDirectionColumn
491 };
492
493 enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
494
495 static const size_t TouchActionBits = 4;
496 enum TouchAction {
497     TouchActionAuto = 0x0,
498     TouchActionNone = 0x1,
499     TouchActionPanX = 0x2,
500     TouchActionPanY = 0x4,
501     TouchActionPinchZoom = 0x8,
502 };
503 inline TouchAction operator| (TouchAction a, TouchAction b) { return TouchAction(int(a) | int(b)); }
504 inline TouchAction& operator|= (TouchAction& a, TouchAction b) { return a = a | b; }
505 inline TouchAction operator& (TouchAction a, TouchAction b) { return TouchAction(int(a) & int(b)); }
506 inline TouchAction& operator&= (TouchAction& a, TouchAction b) { return a = a & b; }
507
508 enum EIsolation { IsolationAuto, IsolationIsolate };
509
510 enum TouchActionDelay { TouchActionDelayNone, TouchActionDelayScript };
511
512 enum ItemPosition {
513     ItemPositionAuto,
514     ItemPositionStretch,
515     ItemPositionBaseline,
516     ItemPositionLastBaseline,
517     ItemPositionCenter,
518     ItemPositionStart,
519     ItemPositionEnd,
520     ItemPositionSelfStart,
521     ItemPositionSelfEnd,
522     ItemPositionFlexStart,
523     ItemPositionFlexEnd,
524     ItemPositionLeft,
525     ItemPositionRight
526 };
527
528 enum OverflowAlignment {
529     OverflowAlignmentDefault,
530     OverflowAlignmentTrue,
531     OverflowAlignmentSafe
532 };
533
534 enum ItemPositionType {
535     NonLegacyPosition,
536     LegacyPosition
537 };
538
539 enum ContentPosition {
540     ContentPositionAuto,
541     ContentPositionBaseline,
542     ContentPositionLastBaseline,
543     ContentPositionCenter,
544     ContentPositionStart,
545     ContentPositionEnd,
546     ContentPositionFlexStart,
547     ContentPositionFlexEnd,
548     ContentPositionLeft,
549     ContentPositionRight
550 };
551
552 enum ContentDistributionType {
553     ContentDistributionDefault,
554     ContentDistributionSpaceBetween,
555     ContentDistributionSpaceAround,
556     ContentDistributionSpaceEvenly,
557     ContentDistributionStretch
558 };
559
560 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
561 static const float maximumAllowedFontSize = 1000000.0f;
562
563 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine };
564 enum TextIndentType { TextIndentNormal, TextIndentHanging };
565
566 enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox };
567
568 } // namespace blink
569
570 #endif // RenderStyleConstants_h