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/)
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.
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.
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.
26 #ifndef RenderStyleConstants_h
27 #define RenderStyleConstants_h
35 * The order of the values in the enums have to agree with the order specified
36 * in CSSValueKeywords.in, otherwise some optimizations in the parser will fail,
37 * and produce invalid results.
39 static const size_t PrintColorAdjustBits = 1;
40 enum PrintColorAdjust {
41 PrintColorAdjustEconomy,
45 // The difference between two styles. The following values are used:
46 // (1) StyleDifferenceEqual - The two styles are identical
47 // (2) StyleDifferenceRecompositeLayer - The layer needs its position and transform updated, but no repaint
48 // (3) StyleDifferenceRepaint - The object just needs to be repainted.
49 // (4) StyleDifferenceRepaintLayer - The layer and its descendant layers needs to be repainted.
50 // (5) StyleDifferenceLayoutPositionedMovementOnly - Only the position of this positioned object has been updated
51 // (6) StyleDifferenceSimplifiedLayout - Only overflow needs to be recomputed
52 // (7) StyleDifferenceSimplifiedLayoutAndPositionedMovement - Both positioned movement and simplified layout updates are required.
53 // (8) StyleDifferenceLayout - A full layout is required.
54 enum StyleDifference {
56 #if USE(ACCELERATED_COMPOSITING)
57 StyleDifferenceRecompositeLayer,
59 StyleDifferenceRepaint,
60 StyleDifferenceRepaintLayer,
61 StyleDifferenceLayoutPositionedMovementOnly,
62 StyleDifferenceSimplifiedLayout,
63 StyleDifferenceSimplifiedLayoutAndPositionedMovement,
67 // When some style properties change, different amounts of work have to be done depending on
68 // context (e.g. whether the property is changing on an element which has a compositing layer).
69 // A simple StyleDifference does not provide enough information so we return a bit mask of
70 // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too.
71 enum StyleDifferenceContextSensitiveProperty {
72 ContextSensitivePropertyNone = 0,
73 ContextSensitivePropertyTransform = (1 << 0),
74 ContextSensitivePropertyOpacity = (1 << 1)
77 // Static pseudo styles. Dynamic ones are produced on the fly.
79 // The order must be NOP ID, public IDs, and then internal IDs.
80 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR,
81 // Internal IDs follow:
82 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
84 AFTER_LAST_INTERNAL_PSEUDOID,
85 FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_ANCESTOR, ANIMATING_FULL_SCREEN_TRANSITION,
86 FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
87 FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB,
88 PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1)
91 enum ColumnSpan { ColumnSpanOne = 0, ColumnSpanAll};
93 enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };
95 // These have been defined in the order of their precedence for border-collapsing. Do
96 // not change this order!
97 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, OUTSET, RIDGE, DOTTED, DASHED, SOLID, DOUBLE };
99 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
101 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
104 StaticPosition, RelativePosition, AbsolutePosition, FixedPosition
108 NoFloat, LeftFloat, RightFloat, PositionedFloat
111 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
113 // Box attributes. Not inherited.
115 enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
117 // Random visual rendering model attributes. Not inherited.
120 OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE
123 enum EVerticalAlign {
124 BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP,
125 TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
129 CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
136 // CSS Text Layout Module Level 3: Vertical writing support
138 TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode
142 TextCombineNone, TextCombineHorizontal
145 enum EFillAttachment {
146 ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
150 BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox
154 RepeatFill, NoRepeatFill, RoundFill, SpaceFill
157 enum EFillLayerType {
158 BackgroundFillLayer, MaskFillLayer
161 // CSS3 Background Values
162 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
164 // CSS3 Marquee Properties
166 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE };
167 enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 };
169 // Deprecated Flexible Box Properties
171 enum EBoxPack { Start, Center, End, Justify };
172 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BBASELINE };
173 enum EBoxOrient { HORIZONTAL, VERTICAL };
174 enum EBoxLines { SINGLE, MULTIPLE };
175 enum EBoxDirection { BNORMAL, BREVERSE };
177 // CSS3 Flexbox Properties
179 enum EFlexPack { PackStart, PackEnd, PackCenter, PackJustify, PackDistribute };
180 enum EFlexAlign { AlignAuto, AlignStart, AlignEnd, AlignCenter, AlignStretch, AlignBaseline };
181 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
182 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
185 TSNONE, TSDISC, TSCIRCLE, TSSQUARE
188 // CSS3 User Modify Properties
191 READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY
194 // CSS3 User Drag Values
197 DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
200 // CSS3 User Select Values
203 SELECT_NONE, SELECT_TEXT
206 // Word Break Values. Matches WinIE, rather than CSS3
209 NormalWordBreak, BreakAllWordBreak, BreakWordBreak
213 NormalWordWrap, BreakWordWrap
220 enum EKHTMLLineBreak {
221 LBNORMAL, AFTER_WHITE_SPACE
224 enum EMatchNearestMailBlockquoteColor {
229 RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
232 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
233 enum EListStyleType {
269 EthiopicHalehameAaEt,
270 EthiopicHalehameAaEr,
272 EthiopicHalehameAmEt,
285 EthiopicHalehameOmEt,
287 EthiopicHalehameSidEt,
289 EthiopicHalehameSoEt,
293 EthiopicHalehameTiEr,
297 EthiopicHalehameTiEt,
317 enum StyleContentType {
318 CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER, CONTENT_QUOTE
322 OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
325 enum EBorderFit { BorderFitBorder, BorderFitLines };
327 enum EAnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth };
329 enum EAnimPlayState {
330 AnimPlayStatePlaying = 0x0,
331 AnimPlayStatePaused = 0x1
335 NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP
339 TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND,
342 enum ETextTransform {
343 CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
346 static const size_t ETextDecorationBits = 4;
347 enum ETextDecoration {
348 TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8
350 inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); }
351 inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; }
354 PBAUTO, PBALWAYS, PBAVOID
362 CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
365 enum EListStylePosition { OUTSIDE, INSIDE };
367 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
370 // The following must match the order in CSSValueKeywords.in.
376 CURSOR_VERTICAL_TEXT,
383 CURSOR_WEBKIT_ZOOM_IN,
384 CURSOR_WEBKIT_ZOOM_OUT,
404 CURSOR_WEBKIT_GRABBING,
406 // The following are handled as exceptions so don't need to match.
412 INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, 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 FLEXBOX, INLINE_FLEXBOX,
418 #if ENABLE(CSS_GRID_LAYOUT)
425 NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
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_ALL
433 enum ETransformStyle3D {
434 TransformStyle3DFlat, TransformStyle3DPreserve3D
437 enum EBackfaceVisibility {
438 BackfaceVisibilityVisible, BackfaceVisibilityHidden
441 enum ELineClampType { LineClampLineCount, LineClampPercentage };
443 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
445 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
447 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
449 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
451 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
453 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
455 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast };
457 enum Order { LogicalOrder = 0, VisualOrder };
459 enum RegionOverflow { AutoRegionOverflow, BreakRegionOverflow };
461 enum ColumnAxis { HorizontalColumnAxis, VerticalColumnAxis, AutoColumnAxis };
463 enum LineGridSnap { LineGridSnapNone, LineGridSnapBaseline, LineGridSnapContain };
465 enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowLeft, WrapFlowRight, WrapFlowMaximum, WrapFlowClear };
467 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
469 } // namespace WebCore
471 #endif // RenderStyleConstants_h