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 Apple Inc. All rights reserved. 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Library General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU Library General Public License 19 * along with this library; see the file COPYING.LIB. If not, write to 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 22 * 23 */ 24 25 #ifndef RenderStyleConstants_h 26 #define RenderStyleConstants_h 27 28 namespace WebCore { 29 30 /* 31 * WARNING: 32 * -------- 33 * 34 * The order of the values in the enums have to agree with the order specified 35 * in CSSValueKeywords.in, otherwise some optimizations in the parser will fail, 36 * and produce invalid results. 37 */ 38 39 // The difference between two styles. The following values are used: 40 // (1) StyleDifferenceEqual - The two styles are identical 41 // (2) StyleDifferenceRecompositeLayer - The layer needs its position and transform updated, but no repaint 42 // (3) StyleDifferenceRepaint - The object just needs to be repainted. 43 // (4) StyleDifferenceRepaintLayer - The layer and its descendant layers needs to be repainted. 44 // (5) StyleDifferenceLayout - A layout is required. 45 enum StyleDifference { 46 StyleDifferenceEqual, 47 #if USE(ACCELERATED_COMPOSITING) 48 StyleDifferenceRecompositeLayer, 49 #endif 50 StyleDifferenceRepaint, 51 StyleDifferenceRepaintLayer, 52 StyleDifferenceLayoutPositionedMovementOnly, 53 StyleDifferenceLayout 54 }; 55 56 // When some style properties change, different amounts of work have to be done depending on 57 // context (e.g. whether the property is changing on an element which has a compositing layer). 58 // A simple StyleDifference does not provide enough information so we return a bit mask of 59 // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too. 60 enum StyleDifferenceContextSensitiveProperty { 61 ContextSensitivePropertyNone = 0, 62 ContextSensitivePropertyTransform = (1 << 0), 63 ContextSensitivePropertyOpacity = (1 << 1) 64 }; 65 66 // Static pseudo styles. Dynamic ones are produced on the fly. 67 enum PseudoId { 68 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER, 69 SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL, 70 MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER, 71 MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON, 72 MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, 73 MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_STATUS_DISPLAY, 74 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, 75 76 FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON 77 }; 78 79 // These have been defined in the order of their precedence for border-collapsing. Do 80 // not change this order! 81 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, RIDGE, OUTSET, DOTTED, DASHED, SOLID, DOUBLE }; 82 83 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL }; 84 85 enum PseudoState { PseudoUnknown, PseudoNone, PseudoAnyLink, PseudoLink, PseudoVisited}; 86 87 enum EPosition { 88 StaticPosition, RelativePosition, AbsolutePosition, FixedPosition 89 }; 90 91 enum EFloat { 92 FNONE = 0, FLEFT, FRIGHT 93 }; 94 95 96 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD }; 97 98 // Box attributes. Not inherited. 99 100 enum EBoxSizing { CONTENT_BOX, BORDER_BOX }; 101 102 // Random visual rendering model attributes. Not inherited. 103 104 enum EOverflow { 105 OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE 106 }; 107 108 enum EVerticalAlign { 109 BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP, 110 TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH 111 }; 112 113 enum EClear { 114 CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3 115 }; 116 117 enum ETableLayout { 118 TAUTO, TFIXED 119 }; 120 121 enum EUnicodeBidi { 122 UBNormal, Embed, Override 123 }; 124 125 enum EFillAttachment { 126 ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment 127 }; 128 129 enum EFillBox { 130 BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox 131 }; 132 133 enum EFillRepeat { 134 RepeatFill, RepeatXFill, RepeatYFill, NoRepeatFill 135 }; 136 137 enum EFillLayerType { 138 BackgroundFillLayer, MaskFillLayer 139 }; 140 141 // CSS3 Marquee Properties 142 143 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE }; 144 enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 }; 145 146 // CSS3 Flexible Box Properties 147 148 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BJUSTIFY, BBASELINE }; 149 enum EBoxOrient { HORIZONTAL, VERTICAL }; 150 enum EBoxLines { SINGLE, MULTIPLE }; 151 enum EBoxDirection { BNORMAL, BREVERSE }; 152 153 enum ETextSecurity { 154 TSNONE, TSDISC, TSCIRCLE, TSSQUARE 155 }; 156 157 // CSS3 User Modify Properties 158 159 enum EUserModify { 160 READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY 161 }; 162 163 // CSS3 User Drag Values 164 165 enum EUserDrag { 166 DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT 167 }; 168 169 // CSS3 User Select Values 170 171 enum EUserSelect { 172 SELECT_NONE, SELECT_TEXT 173 }; 174 175 // Word Break Values. Matches WinIE, rather than CSS3 176 177 enum EWordBreak { 178 NormalWordBreak, BreakAllWordBreak, BreakWordBreak 179 }; 180 181 enum EWordWrap { 182 NormalWordWrap, BreakWordWrap 183 }; 184 185 enum ENBSPMode { 186 NBNORMAL, SPACE 187 }; 188 189 enum EKHTMLLineBreak { 190 LBNORMAL, AFTER_WHITE_SPACE 191 }; 192 193 enum EMatchNearestMailBlockquoteColor { 194 BCNORMAL, MATCH 195 }; 196 197 enum EResize { 198 RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL 199 }; 200 201 enum EListStyleType { 202 DISC, CIRCLE, SQUARE, LDECIMAL, DECIMAL_LEADING_ZERO, 203 LOWER_ROMAN, UPPER_ROMAN, LOWER_GREEK, 204 LOWER_ALPHA, LOWER_LATIN, UPPER_ALPHA, UPPER_LATIN, 205 HEBREW, ARMENIAN, GEORGIAN, CJK_IDEOGRAPHIC, 206 HIRAGANA, KATAKANA, HIRAGANA_IROHA, KATAKANA_IROHA, LNONE 207 }; 208 209 enum StyleContentType { 210 CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER 211 }; 212 213 enum EBorderFit { BorderFitBorder, BorderFitLines }; 214 215 enum EAnimPlayState { 216 AnimPlayStatePlaying = 0x0, 217 AnimPlayStatePaused = 0x1 218 }; 219 220 enum ETimingFunctionType { LinearTimingFunction, CubicBezierTimingFunction }; 221 222 enum EWhiteSpace { 223 NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP 224 }; 225 226 enum ETextAlign { 227 TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER 228 }; 229 230 enum ETextTransform { 231 CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE 232 }; 233 234 enum ETextDecoration { 235 TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8 236 }; 237 238 enum EPageBreak { 239 PBAUTO, PBALWAYS, PBAVOID 240 }; 241 242 enum EEmptyCell { 243 SHOW, HIDE 244 }; 245 246 enum ECaptionSide { 247 CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT 248 }; 249 250 enum EListStylePosition { OUTSIDE, INSIDE }; 251 252 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE }; 253 254 enum ECursor { 255 // The following must match the order in CSSValueKeywords.in. 256 CURSOR_AUTO, 257 CURSOR_CROSS, 258 CURSOR_DEFAULT, 259 CURSOR_POINTER, 260 CURSOR_MOVE, 261 CURSOR_VERTICAL_TEXT, 262 CURSOR_CELL, 263 CURSOR_CONTEXT_MENU, 264 CURSOR_ALIAS, 265 CURSOR_PROGRESS, 266 CURSOR_NO_DROP, 267 CURSOR_NOT_ALLOWED, 268 CURSOR_WEBKIT_ZOOM_IN, 269 CURSOR_WEBKIT_ZOOM_OUT, 270 CURSOR_E_RESIZE, 271 CURSOR_NE_RESIZE, 272 CURSOR_NW_RESIZE, 273 CURSOR_N_RESIZE, 274 CURSOR_SE_RESIZE, 275 CURSOR_SW_RESIZE, 276 CURSOR_S_RESIZE, 277 CURSOR_W_RESIZE, 278 CURSOR_EW_RESIZE, 279 CURSOR_NS_RESIZE, 280 CURSOR_NESW_RESIZE, 281 CURSOR_NWSE_RESIZE, 282 CURSOR_COL_RESIZE, 283 CURSOR_ROW_RESIZE, 284 CURSOR_TEXT, 285 CURSOR_WAIT, 286 CURSOR_HELP, 287 CURSOR_ALL_SCROLL, 288 CURSOR_WEBKIT_GRAB, 289 CURSOR_WEBKIT_GRABBING, 290 291 // The following are handled as exceptions so don't need to match. 292 CURSOR_COPY, 293 CURSOR_NONE 294 }; 295 296 enum EDisplay { 297 INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, INLINE_BLOCK, 298 TABLE, INLINE_TABLE, TABLE_ROW_GROUP, 299 TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW, 300 TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL, 301 TABLE_CAPTION, BOX, INLINE_BOX, NONE 302 }; 303 304 enum EPointerEvents { 305 PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE, 306 PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL 307 }; 308 309 enum ETransformStyle3D { 310 TransformStyle3DFlat, TransformStyle3DPreserve3D 311 }; 312 313 enum EBackfaceVisibility { 314 BackfaceVisibilityVisible, BackfaceVisibilityHidden 315 }; 316 317 } // namespace WebCore 318 319 #endif // RenderStyleConstants_h 320