Upstream version 5.34.104.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 WebCore {
30
31 enum StyleRecalcChange {
32     NoChange,
33     NoInherit,
34     UpdatePseudoElements,
35     Inherit,
36     Force,
37     Reattach,
38 };
39
40 static const size_t PrintColorAdjustBits = 1;
41 enum PrintColorAdjust {
42     PrintColorAdjustEconomy,
43     PrintColorAdjustExact
44 };
45
46 // The difference between two styles.  The following values are used:
47 // (1) StyleDifferenceEqual - The two styles are identical.
48 // (2) StyleDifferenceRecompositeLayer - The layer needs its position and transform updated, but no repaint.
49 // (3) StyleDifferenceRepaint - The object just needs to be repainted.
50 // (4) StyleDifferenceRepaintIfTextOrColorChange - The object needs to be repainted if it contains text or properties dependent on color (e.g., border or outline).
51 // (5) StyleDifferenceRepaintLayer - The layer and its descendant layers needs to be repainted.
52 // (6) StyleDifferenceLayoutPositionedMovementOnly - Only the position of this positioned object has been updated.
53 // (7) StyleDifferenceSimplifiedLayout - Only overflow needs to be recomputed.
54 // (8) StyleDifferenceSimplifiedLayoutAndPositionedMovement - Both positioned movement and simplified layout updates are required.
55 // (9) StyleDifferenceLayout - A full layout is required.
56 enum StyleDifference {
57     StyleDifferenceEqual,
58     StyleDifferenceRecompositeLayer,
59     StyleDifferenceRepaint,
60     StyleDifferenceRepaintIfTextOrColorChange,
61     StyleDifferenceRepaintLayer,
62     StyleDifferenceLayoutPositionedMovementOnly,
63     StyleDifferenceSimplifiedLayout,
64     StyleDifferenceSimplifiedLayoutAndPositionedMovement,
65     StyleDifferenceLayout
66 };
67
68 // When some style properties change, different amounts of work have to be done depending on
69 // context (e.g. whether the property is changing on an element which has a compositing layer).
70 // A simple StyleDifference does not provide enough information so we return a bit mask of
71 // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too.
72 enum StyleDifferenceContextSensitiveProperty {
73     ContextSensitivePropertyNone = 0,
74     ContextSensitivePropertyTransform = (1 << 0),
75     ContextSensitivePropertyOpacity = (1 << 1),
76     ContextSensitivePropertyFilter = (1 << 2)
77 };
78
79 // Static pseudo styles. Dynamic ones are produced on the fly.
80 enum PseudoId {
81     // The order must be NOP ID, public IDs, and then internal IDs.
82     // If you add or remove a public ID, you must update _pseudoBits in RenderStyle.
83     NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, BACKDROP, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR,
84     // Internal IDs follow:
85     SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, INPUT_LIST_BUTTON,
86     // Special values follow:
87     AFTER_LAST_INTERNAL_PSEUDOID,
88     FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
89     FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB,
90     PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1),
91     PSEUDO_ELEMENT_MASK = (1 << (BEFORE - 1)) | (1 << (AFTER - 1)) | (1 << (BACKDROP - 1))
92 };
93
94 enum ColumnFill { ColumnFillBalance, ColumnFillAuto };
95
96 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll };
97
98 enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };
99
100 // These have been defined in the order of their precedence for border-collapsing. Do
101 // not change this order! This order also must match the order in CSSValueKeywords.in.
102 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, OUTSET, RIDGE, DOTTED, DASHED, SOLID, DOUBLE };
103
104 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
105
106 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
107
108 enum EPosition {
109     StaticPosition = 0,
110     RelativePosition = 1,
111     AbsolutePosition = 2,
112     StickyPosition = 3,
113     // This value is required to pack our bits efficiently in RenderObject.
114     FixedPosition = 6
115 };
116
117 enum EFloat {
118     NoFloat, LeftFloat, RightFloat
119 };
120
121 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
122
123 // Box decoration attributes. Not inherited.
124
125 enum EBoxDecorationBreak { DSLICE, DCLONE };
126
127 // Box attributes. Not inherited.
128
129 enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
130
131 // Random visual rendering model attributes. Not inherited.
132
133 enum EOverflow {
134     OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OPAGEDX, OPAGEDY
135 };
136
137 enum EVerticalAlign {
138     BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP,
139     TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
140 };
141
142 enum EClear {
143     CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
144 };
145
146 enum ETableLayout {
147     TAUTO, TFIXED
148 };
149
150 enum TextCombine {
151     TextCombineNone, TextCombineHorizontal
152 };
153
154 enum EFillAttachment {
155     ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
156 };
157
158 enum EFillBox {
159     BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox
160 };
161
162 enum EFillRepeat {
163     RepeatFill, NoRepeatFill, RoundFill, SpaceFill
164 };
165
166 enum EFillLayerType {
167     BackgroundFillLayer, MaskFillLayer
168 };
169
170 // CSS3 Background Values
171 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
172
173 // CSS3 Background Position
174 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
175
176 // CSS Mask Source Types
177 enum EMaskSourceType { MaskAlpha, MaskLuminance };
178
179 // CSS3 Marquee Properties
180
181 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE };
182 enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 };
183
184 // Deprecated Flexible Box Properties
185
186 enum EBoxPack { Start, Center, End, Justify };
187 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BBASELINE };
188 enum EBoxOrient { HORIZONTAL, VERTICAL };
189 enum EBoxLines { SINGLE, MULTIPLE };
190 enum EBoxDirection { BNORMAL, BREVERSE };
191
192 // CSS3 Flexbox Properties
193
194 enum EAlignContent { AlignContentFlexStart, AlignContentFlexEnd, AlignContentCenter, AlignContentSpaceBetween, AlignContentSpaceAround, AlignContentStretch };
195 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
196 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
197 enum EJustifyContent { JustifyFlexStart, JustifyFlexEnd, JustifyCenter, JustifySpaceBetween, JustifySpaceAround };
198
199 enum ETextSecurity {
200     TSNONE, TSDISC, TSCIRCLE, TSSQUARE
201 };
202
203 // CSS3 User Modify Properties
204
205 enum EUserModify {
206     READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY
207 };
208
209 // CSS3 User Drag Values
210
211 enum EUserDrag {
212     DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
213 };
214
215 // CSS3 User Select Values
216
217 enum EUserSelect {
218     SELECT_NONE, SELECT_TEXT, SELECT_ALL
219 };
220
221 // CSS3 Image Values
222 enum ObjectFit { ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown };
223
224 // Word Break Values. Matches WinIE, rather than CSS3
225
226 enum EWordBreak {
227     NormalWordBreak, BreakAllWordBreak, BreakWordBreak
228 };
229
230 enum EOverflowWrap {
231     NormalOverflowWrap, BreakOverflowWrap
232 };
233
234 enum LineBreak {
235     LineBreakAuto, LineBreakLoose, LineBreakNormal, LineBreakStrict, LineBreakAfterWhiteSpace
236 };
237
238 enum EResize {
239     RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
240 };
241
242 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
243 enum EListStyleType {
244     Disc,
245     Circle,
246     Square,
247     DecimalListStyle,
248     DecimalLeadingZero,
249     ArabicIndic,
250     BinaryListStyle,
251     Bengali,
252     Cambodian,
253     Khmer,
254     Devanagari,
255     Gujarati,
256     Gurmukhi,
257     Kannada,
258     LowerHexadecimal,
259     Lao,
260     Malayalam,
261     Mongolian,
262     Myanmar,
263     Octal,
264     Oriya,
265     Persian,
266     Urdu,
267     Telugu,
268     Tibetan,
269     Thai,
270     UpperHexadecimal,
271     LowerRoman,
272     UpperRoman,
273     LowerGreek,
274     LowerAlpha,
275     LowerLatin,
276     UpperAlpha,
277     UpperLatin,
278     Afar,
279     EthiopicHalehameAaEt,
280     EthiopicHalehameAaEr,
281     Amharic,
282     EthiopicHalehameAmEt,
283     AmharicAbegede,
284     EthiopicAbegedeAmEt,
285     CjkEarthlyBranch,
286     CjkHeavenlyStem,
287     Ethiopic,
288     EthiopicHalehameGez,
289     EthiopicAbegede,
290     EthiopicAbegedeGez,
291     HangulConsonant,
292     Hangul,
293     LowerNorwegian,
294     Oromo,
295     EthiopicHalehameOmEt,
296     Sidama,
297     EthiopicHalehameSidEt,
298     Somali,
299     EthiopicHalehameSoEt,
300     Tigre,
301     EthiopicHalehameTig,
302     TigrinyaEr,
303     EthiopicHalehameTiEr,
304     TigrinyaErAbegede,
305     EthiopicAbegedeTiEr,
306     TigrinyaEt,
307     EthiopicHalehameTiEt,
308     TigrinyaEtAbegede,
309     EthiopicAbegedeTiEt,
310     UpperGreek,
311     UpperNorwegian,
312     Asterisks,
313     Footnotes,
314     Hebrew,
315     Armenian,
316     LowerArmenian,
317     UpperArmenian,
318     Georgian,
319     CJKIdeographic,
320     Hiragana,
321     Katakana,
322     HiraganaIroha,
323     KatakanaIroha,
324     NoneListStyle
325 };
326
327 enum QuoteType {
328     OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
329 };
330
331 enum EBorderFit { BorderFitBorder, BorderFitLines };
332
333 enum EAnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth };
334
335 enum EAnimPlayState {
336     AnimPlayStatePlaying = 0x0,
337     AnimPlayStatePaused = 0x1
338 };
339
340 enum EWhiteSpace {
341     NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP
342 };
343
344 // The order of this enum must match the order of the text align values in CSSValueKeywords.in.
345 enum ETextAlign {
346     LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND,
347 };
348
349 enum ETextTransform {
350     CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
351 };
352
353 static const size_t TextDecorationBits = 4;
354 enum TextDecoration {
355     TextDecorationNone = 0x0,
356     TextDecorationUnderline = 0x1,
357     TextDecorationOverline = 0x2,
358     TextDecorationLineThrough = 0x4,
359     TextDecorationBlink = 0x8
360 };
361 inline TextDecoration operator| (TextDecoration a, TextDecoration b) { return TextDecoration(int(a) | int(b)); }
362 inline TextDecoration& operator|= (TextDecoration& a, TextDecoration b) { return a = a | b; }
363
364 enum TextDecorationStyle {
365     TextDecorationStyleSolid,
366     TextDecorationStyleDouble,
367     TextDecorationStyleDotted,
368     TextDecorationStyleDashed,
369     TextDecorationStyleWavy
370 };
371
372 enum TextAlignLast {
373     TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
374 };
375
376 enum TextJustify {
377     TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyDistribute
378 };
379
380 enum TextUnderlinePosition {
381     // FIXME: Implement support for 'under left' and 'under right' values.
382     TextUnderlinePositionAuto = 0x1,
383     TextUnderlinePositionUnder = 0x2
384 };
385
386 enum EPageBreak {
387     PBAUTO, PBALWAYS, PBAVOID
388 };
389
390 enum EEmptyCell {
391     SHOW, HIDE
392 };
393
394 enum ECaptionSide {
395     CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
396 };
397
398 enum EListStylePosition { OUTSIDE, INSIDE };
399
400 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
401
402 enum ECursor {
403     // The following must match the order in CSSValueKeywords.in.
404     CURSOR_AUTO,
405     CURSOR_CROSS,
406     CURSOR_DEFAULT,
407     CURSOR_POINTER,
408     CURSOR_MOVE,
409     CURSOR_VERTICAL_TEXT,
410     CURSOR_CELL,
411     CURSOR_CONTEXT_MENU,
412     CURSOR_ALIAS,
413     CURSOR_PROGRESS,
414     CURSOR_NO_DROP,
415     CURSOR_NOT_ALLOWED,
416     CURSOR_WEBKIT_ZOOM_IN,
417     CURSOR_WEBKIT_ZOOM_OUT,
418     CURSOR_E_RESIZE,
419     CURSOR_NE_RESIZE,
420     CURSOR_NW_RESIZE,
421     CURSOR_N_RESIZE,
422     CURSOR_SE_RESIZE,
423     CURSOR_SW_RESIZE,
424     CURSOR_S_RESIZE,
425     CURSOR_W_RESIZE,
426     CURSOR_EW_RESIZE,
427     CURSOR_NS_RESIZE,
428     CURSOR_NESW_RESIZE,
429     CURSOR_NWSE_RESIZE,
430     CURSOR_COL_RESIZE,
431     CURSOR_ROW_RESIZE,
432     CURSOR_TEXT,
433     CURSOR_WAIT,
434     CURSOR_HELP,
435     CURSOR_ALL_SCROLL,
436     CURSOR_WEBKIT_GRAB,
437     CURSOR_WEBKIT_GRABBING,
438
439     // The following are handled as exceptions so don't need to match.
440     CURSOR_COPY,
441     CURSOR_NONE
442 };
443
444 // The order of this enum must match the order of the display values in CSSValueKeywords.in.
445 enum EDisplay {
446     INLINE, BLOCK, LIST_ITEM, INLINE_BLOCK,
447     TABLE, INLINE_TABLE, TABLE_ROW_GROUP,
448     TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW,
449     TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL,
450     TABLE_CAPTION, BOX, INLINE_BOX,
451     FLEX, INLINE_FLEX,
452     GRID, INLINE_GRID,
453     NONE,
454     FIRST_TABLE_DISPLAY = TABLE,
455     LAST_TABLE_DISPLAY = TABLE_CAPTION
456 };
457
458 enum EInsideLink {
459     NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
460 };
461
462 enum EPointerEvents {
463     PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
464     PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_BOUNDINGBOX,
465     PE_ALL
466 };
467
468 enum ETransformStyle3D {
469     TransformStyle3DFlat, TransformStyle3DPreserve3D
470 };
471
472 enum EBackfaceVisibility {
473     BackfaceVisibilityVisible, BackfaceVisibilityHidden
474 };
475
476 enum ELineClampType { LineClampLineCount, LineClampPercentage };
477
478 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
479
480 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
481
482 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
483
484 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
485
486 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
487
488 enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight };
489
490 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
491
492 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast };
493
494 enum ImageResolutionSource { ImageResolutionSpecified = 0, ImageResolutionFromImage };
495
496 enum ImageResolutionSnap { ImageResolutionNoSnap = 0, ImageResolutionSnapPixels };
497
498 enum Order { LogicalOrder = 0, VisualOrder };
499
500 enum ColumnAxis { HorizontalColumnAxis, VerticalColumnAxis, AutoColumnAxis };
501
502 enum ColumnProgression { NormalColumnProgression, ReverseColumnProgression };
503
504 enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlowMaximum, WrapFlowClear };
505
506 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
507
508 enum RubyPosition { RubyPositionBefore, RubyPositionAfter };
509
510 enum GridAutoFlow { AutoFlowNone, AutoFlowColumn, AutoFlowRow };
511
512 enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
513
514 static const size_t TouchActionBits = 3;
515 enum TouchAction {
516     TouchActionAuto = 0x0,
517     TouchActionNone = 0x1,
518     TouchActionPanX = 0x2,
519     TouchActionPanY = 0x4
520 };
521 inline TouchAction operator| (TouchAction a, TouchAction b) { return TouchAction(int(a) | int(b)); }
522 inline TouchAction& operator|= (TouchAction& a, TouchAction b) { return a = a | b; }
523 inline TouchAction operator& (TouchAction a, TouchAction b) { return TouchAction(int(a) & int(b)); }
524 inline TouchAction& operator&= (TouchAction& a, TouchAction b) { return a = a & b; }
525
526 enum EIsolation { IsolationAuto, IsolationIsolate };
527
528 enum TouchActionDelay { TouchActionDelayNone, TouchActionDelayScript };
529
530 enum ItemPosition {
531     ItemPositionAuto,
532     ItemPositionStretch,
533     ItemPositionBaseline,
534     ItemPositionCenter,
535     ItemPositionStart,
536     ItemPositionEnd,
537     ItemPositionSelfStart,
538     ItemPositionSelfEnd,
539     ItemPositionFlexStart,
540     ItemPositionFlexEnd,
541     ItemPositionLeft,
542     ItemPositionRight
543 };
544
545 enum OverflowAlignment {
546     OverflowAlignmentDefault,
547     OverflowAlignmentTrue,
548     OverflowAlignmentSafe
549 };
550
551 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
552 static const float maximumAllowedFontSize = 1000000.0f;
553
554 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine };
555
556 enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox };
557
558 } // namespace WebCore
559
560 #endif // RenderStyleConstants_h