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
31 enum StyleRecalcChange {
40 static const size_t PrintColorAdjustBits = 1;
41 enum PrintColorAdjust {
42 PrintColorAdjustEconomy,
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 {
58 StyleDifferenceRecompositeLayer,
59 StyleDifferenceRepaint,
60 StyleDifferenceRepaintIfTextOrColorChange,
61 StyleDifferenceRepaintLayer,
62 StyleDifferenceLayoutPositionedMovementOnly,
63 StyleDifferenceSimplifiedLayout,
64 StyleDifferenceSimplifiedLayoutAndPositionedMovement,
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)
79 // Static pseudo styles. Dynamic ones are produced on the fly.
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))
94 enum ColumnFill { ColumnFillBalance, ColumnFillAuto };
96 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll };
98 enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };
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 };
104 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
106 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
110 RelativePosition = 1,
111 AbsolutePosition = 2,
113 // This value is required to pack our bits efficiently in RenderObject.
118 NoFloat, LeftFloat, RightFloat
121 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
123 // Box decoration attributes. Not inherited.
125 enum EBoxDecorationBreak { DSLICE, DCLONE };
127 // Box attributes. Not inherited.
129 enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
131 // Random visual rendering model attributes. Not inherited.
134 OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OPAGEDX, OPAGEDY
137 enum EVerticalAlign {
138 BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP,
139 TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
143 CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
151 TextCombineNone, TextCombineHorizontal
154 enum EFillAttachment {
155 ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
159 BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox
163 RepeatFill, NoRepeatFill, RoundFill, SpaceFill
166 enum EFillLayerType {
167 BackgroundFillLayer, MaskFillLayer
170 // CSS3 Background Values
171 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
173 // CSS3 Background Position
174 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
176 // CSS Mask Source Types
177 enum EMaskSourceType { MaskAlpha, MaskLuminance };
179 // CSS3 Marquee Properties
181 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE };
182 enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 };
184 // Deprecated Flexible Box Properties
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 };
192 // CSS3 Flexbox Properties
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 };
200 TSNONE, TSDISC, TSCIRCLE, TSSQUARE
203 // CSS3 User Modify Properties
206 READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY
209 // CSS3 User Drag Values
212 DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
215 // CSS3 User Select Values
218 SELECT_NONE, SELECT_TEXT, SELECT_ALL
222 enum ObjectFit { ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown };
224 // Word Break Values. Matches WinIE, rather than CSS3
227 NormalWordBreak, BreakAllWordBreak, BreakWordBreak
231 NormalOverflowWrap, BreakOverflowWrap
235 LineBreakAuto, LineBreakLoose, LineBreakNormal, LineBreakStrict, LineBreakAfterWhiteSpace
239 RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
242 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
243 enum EListStyleType {
279 EthiopicHalehameAaEt,
280 EthiopicHalehameAaEr,
282 EthiopicHalehameAmEt,
295 EthiopicHalehameOmEt,
297 EthiopicHalehameSidEt,
299 EthiopicHalehameSoEt,
303 EthiopicHalehameTiEr,
307 EthiopicHalehameTiEt,
328 OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
331 enum EBorderFit { BorderFitBorder, BorderFitLines };
333 enum EAnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth };
335 enum EAnimPlayState {
336 AnimPlayStatePlaying = 0x0,
337 AnimPlayStatePaused = 0x1
341 NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP
344 // The order of this enum must match the order of the text align values in CSSValueKeywords.in.
346 LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND,
349 enum ETextTransform {
350 CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
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
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; }
364 enum TextDecorationStyle {
365 TextDecorationStyleSolid,
366 TextDecorationStyleDouble,
367 TextDecorationStyleDotted,
368 TextDecorationStyleDashed,
369 TextDecorationStyleWavy
373 TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
377 TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyDistribute
380 enum TextUnderlinePosition {
381 // FIXME: Implement support for 'under left' and 'under right' values.
382 TextUnderlinePositionAuto = 0x1,
383 TextUnderlinePositionUnder = 0x2
387 PBAUTO, PBALWAYS, PBAVOID
395 CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
398 enum EListStylePosition { OUTSIDE, INSIDE };
400 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
403 // The following must match the order in CSSValueKeywords.in.
409 CURSOR_VERTICAL_TEXT,
416 CURSOR_WEBKIT_ZOOM_IN,
417 CURSOR_WEBKIT_ZOOM_OUT,
437 CURSOR_WEBKIT_GRABBING,
439 // The following are handled as exceptions so don't need to match.
444 // The order of this enum must match the order of the display values in CSSValueKeywords.in.
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,
454 FIRST_TABLE_DISPLAY = TABLE,
455 LAST_TABLE_DISPLAY = TABLE_CAPTION
459 NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
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,
468 enum ETransformStyle3D {
469 TransformStyle3DFlat, TransformStyle3DPreserve3D
472 enum EBackfaceVisibility {
473 BackfaceVisibilityVisible, BackfaceVisibilityHidden
476 enum ELineClampType { LineClampLineCount, LineClampPercentage };
478 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
480 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
482 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
484 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
486 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
488 enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight };
490 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
492 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast };
494 enum ImageResolutionSource { ImageResolutionSpecified = 0, ImageResolutionFromImage };
496 enum ImageResolutionSnap { ImageResolutionNoSnap = 0, ImageResolutionSnapPixels };
498 enum Order { LogicalOrder = 0, VisualOrder };
500 enum ColumnAxis { HorizontalColumnAxis, VerticalColumnAxis, AutoColumnAxis };
502 enum ColumnProgression { NormalColumnProgression, ReverseColumnProgression };
504 enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlowMaximum, WrapFlowClear };
506 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
508 enum RubyPosition { RubyPositionBefore, RubyPositionAfter };
510 enum GridAutoFlow { AutoFlowNone, AutoFlowColumn, AutoFlowRow };
512 enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
514 static const size_t TouchActionBits = 3;
516 TouchActionAuto = 0x0,
517 TouchActionNone = 0x1,
518 TouchActionPanX = 0x2,
519 TouchActionPanY = 0x4
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; }
526 enum EIsolation { IsolationAuto, IsolationIsolate };
528 enum TouchActionDelay { TouchActionDelayNone, TouchActionDelayScript };
533 ItemPositionBaseline,
537 ItemPositionSelfStart,
539 ItemPositionFlexStart,
545 enum OverflowAlignment {
546 OverflowAlignmentDefault,
547 OverflowAlignmentTrue,
548 OverflowAlignmentSafe
551 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
552 static const float maximumAllowedFontSize = 1000000.0f;
554 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine };
556 enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox };
558 } // namespace WebCore
560 #endif // RenderStyleConstants_h