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 /* 32 * WARNING: 33 * -------- 34 * 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. 38 */ 39 40 // The difference between two styles. The following values are used: 41 // (1) StyleDifferenceEqual - The two styles are identical 42 // (2) StyleDifferenceRecompositeLayer - The layer needs its position and transform updated, but no repaint 43 // (3) StyleDifferenceRepaint - The object just needs to be repainted. 44 // (4) StyleDifferenceRepaintLayer - The layer and its descendant layers needs to be repainted. 45 // (5) StyleDifferenceLayout - A layout is required. 46 enum StyleDifference { 47 StyleDifferenceEqual, 48 #if USE(ACCELERATED_COMPOSITING) 49 StyleDifferenceRecompositeLayer, 50 #endif 51 StyleDifferenceRepaint, 52 StyleDifferenceRepaintLayer, 53 StyleDifferenceLayoutPositionedMovementOnly, 54 StyleDifferenceSimplifiedLayout, 55 StyleDifferenceLayout 56 }; 57 58 // When some style properties change, different amounts of work have to be done depending on 59 // context (e.g. whether the property is changing on an element which has a compositing layer). 60 // A simple StyleDifference does not provide enough information so we return a bit mask of 61 // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too. 62 enum StyleDifferenceContextSensitiveProperty { 63 ContextSensitivePropertyNone = 0, 64 ContextSensitivePropertyTransform = (1 << 0), 65 ContextSensitivePropertyOpacity = (1 << 1) 66 }; 67 68 // Static pseudo styles. Dynamic ones are produced on the fly. 69 enum PseudoId { 70 // The order must be NOP ID, public IDs, and then internal IDs. 71 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER, 72 SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, 73 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, 74 INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, 75 METER_BAR, METER_OPTIMUM, METER_SUBOPTIMAL, METER_EVEN_LESS_GOOD, 76 AFTER_LAST_INTERNAL_PSEUDOID, 77 FULL_SCREEN, FULL_SCREEN_DOCUMENT, 78 FIRST_PUBLIC_PSEUDOID = FIRST_LINE, 79 FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON, 80 PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1) 81 }; 82 83 // These have been defined in the order of their precedence for border-collapsing. Do 84 // not change this order! 85 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, RIDGE, OUTSET, DOTTED, DASHED, SOLID, DOUBLE }; 86 87 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL }; 88 89 enum EPosition { 90 StaticPosition, RelativePosition, AbsolutePosition, FixedPosition 91 }; 92 93 enum EFloat { 94 FNONE = 0, FLEFT, FRIGHT 95 }; 96 97 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD }; 98 99 // Box attributes. Not inherited. 100 101 enum EBoxSizing { CONTENT_BOX, BORDER_BOX }; 102 103 // Random visual rendering model attributes. Not inherited. 104 105 enum EOverflow { 106 OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE 107 }; 108 109 enum EVerticalAlign { 110 BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP, 111 TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH 112 }; 113 114 enum EClear { 115 CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3 116 }; 117 118 enum ETableLayout { 119 TAUTO, TFIXED 120 }; 121 122 // CSS Text Layout Module Level 3: Vertical writing support 123 enum WritingMode { 124 TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode 125 }; 126 127 enum TextCombine { 128 TextCombineNone, TextCombineHorizontal 129 }; 130 131 enum EFillAttachment { 132 ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment 133 }; 134 135 enum EFillBox { 136 BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox 137 }; 138 139 enum EFillRepeat { 140 RepeatFill, NoRepeatFill, RoundFill, SpaceFill 141 }; 142 143 enum EFillLayerType { 144 BackgroundFillLayer, MaskFillLayer 145 }; 146 147 // CSS3 Background Values 148 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone }; 149 150 // CSS3 Marquee Properties 151 152 enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE }; 153 enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 }; 154 155 // CSS3 Flexible Box Properties 156 157 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BJUSTIFY, BBASELINE }; 158 enum EBoxOrient { HORIZONTAL, VERTICAL }; 159 enum EBoxLines { SINGLE, MULTIPLE }; 160 enum EBoxDirection { BNORMAL, BREVERSE }; 161 162 enum ETextSecurity { 163 TSNONE, TSDISC, TSCIRCLE, TSSQUARE 164 }; 165 166 // CSS3 User Modify Properties 167 168 enum EUserModify { 169 READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY 170 }; 171 172 // CSS3 User Drag Values 173 174 enum EUserDrag { 175 DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT 176 }; 177 178 // CSS3 User Select Values 179 180 enum EUserSelect { 181 SELECT_NONE, SELECT_TEXT 182 }; 183 184 // Word Break Values. Matches WinIE, rather than CSS3 185 186 enum EWordBreak { 187 NormalWordBreak, BreakAllWordBreak, BreakWordBreak 188 }; 189 190 enum EWordWrap { 191 NormalWordWrap, BreakWordWrap 192 }; 193 194 enum ENBSPMode { 195 NBNORMAL, SPACE 196 }; 197 198 enum EKHTMLLineBreak { 199 LBNORMAL, AFTER_WHITE_SPACE 200 }; 201 202 enum EMatchNearestMailBlockquoteColor { 203 BCNORMAL, MATCH 204 }; 205 206 enum EResize { 207 RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL 208 }; 209 210 // The order of this enum must match the order of the list style types in CSSValueKeywords.in. 211 enum EListStyleType { 212 Disc, 213 Circle, 214 Square, 215 DecimalListStyle, 216 DecimalLeadingZero, 217 ArabicIndic, 218 BinaryListStyle, 219 Bengali, 220 Cambodian, 221 Khmer, 222 Devanagari, 223 Gujarati, 224 Gurmukhi, 225 Kannada, 226 LowerHexadecimal, 227 Lao, 228 Malayalam, 229 Mongolian, 230 Myanmar, 231 Octal, 232 Oriya, 233 Persian, 234 Urdu, 235 Telugu, 236 Tibetan, 237 Thai, 238 UpperHexadecimal, 239 LowerRoman, 240 UpperRoman, 241 LowerGreek, 242 LowerAlpha, 243 LowerLatin, 244 UpperAlpha, 245 UpperLatin, 246 Afar, 247 EthiopicHalehameAaEt, 248 EthiopicHalehameAaEr, 249 Amharic, 250 EthiopicHalehameAmEt, 251 AmharicAbegede, 252 EthiopicAbegedeAmEt, 253 CjkEarthlyBranch, 254 CjkHeavenlyStem, 255 Ethiopic, 256 EthiopicHalehameGez, 257 EthiopicAbegede, 258 EthiopicAbegedeGez, 259 HangulConsonant, 260 Hangul, 261 LowerNorwegian, 262 Oromo, 263 EthiopicHalehameOmEt, 264 Sidama, 265 EthiopicHalehameSidEt, 266 Somali, 267 EthiopicHalehameSoEt, 268 Tigre, 269 EthiopicHalehameTig, 270 TigrinyaEr, 271 EthiopicHalehameTiEr, 272 TigrinyaErAbegede, 273 EthiopicAbegedeTiEr, 274 TigrinyaEt, 275 EthiopicHalehameTiEt, 276 TigrinyaEtAbegede, 277 EthiopicAbegedeTiEt, 278 UpperGreek, 279 UpperNorwegian, 280 Asterisks, 281 Footnotes, 282 Hebrew, 283 Armenian, 284 LowerArmenian, 285 UpperArmenian, 286 Georgian, 287 CJKIdeographic, 288 Hiragana, 289 Katakana, 290 HiraganaIroha, 291 KatakanaIroha, 292 NoneListStyle 293 }; 294 295 enum StyleContentType { 296 CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER, CONTENT_QUOTE 297 }; 298 299 enum QuoteType { 300 OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE 301 }; 302 303 enum EBorderFit { BorderFitBorder, BorderFitLines }; 304 305 enum EAnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth }; 306 307 enum EAnimPlayState { 308 AnimPlayStatePlaying = 0x0, 309 AnimPlayStatePaused = 0x1 310 }; 311 312 enum EWhiteSpace { 313 NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP 314 }; 315 316 enum ETextAlign { 317 TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND, 318 }; 319 320 enum ETextTransform { 321 CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE 322 }; 323 324 enum ETextDecoration { 325 TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8 326 }; 327 328 enum EPageBreak { 329 PBAUTO, PBALWAYS, PBAVOID 330 }; 331 332 enum EEmptyCell { 333 SHOW, HIDE 334 }; 335 336 enum ECaptionSide { 337 CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT 338 }; 339 340 enum EListStylePosition { OUTSIDE, INSIDE }; 341 342 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE }; 343 344 enum ECursor { 345 // The following must match the order in CSSValueKeywords.in. 346 CURSOR_AUTO, 347 CURSOR_CROSS, 348 CURSOR_DEFAULT, 349 CURSOR_POINTER, 350 CURSOR_MOVE, 351 CURSOR_VERTICAL_TEXT, 352 CURSOR_CELL, 353 CURSOR_CONTEXT_MENU, 354 CURSOR_ALIAS, 355 CURSOR_PROGRESS, 356 CURSOR_NO_DROP, 357 CURSOR_NOT_ALLOWED, 358 CURSOR_WEBKIT_ZOOM_IN, 359 CURSOR_WEBKIT_ZOOM_OUT, 360 CURSOR_E_RESIZE, 361 CURSOR_NE_RESIZE, 362 CURSOR_NW_RESIZE, 363 CURSOR_N_RESIZE, 364 CURSOR_SE_RESIZE, 365 CURSOR_SW_RESIZE, 366 CURSOR_S_RESIZE, 367 CURSOR_W_RESIZE, 368 CURSOR_EW_RESIZE, 369 CURSOR_NS_RESIZE, 370 CURSOR_NESW_RESIZE, 371 CURSOR_NWSE_RESIZE, 372 CURSOR_COL_RESIZE, 373 CURSOR_ROW_RESIZE, 374 CURSOR_TEXT, 375 CURSOR_WAIT, 376 CURSOR_HELP, 377 CURSOR_ALL_SCROLL, 378 CURSOR_WEBKIT_GRAB, 379 CURSOR_WEBKIT_GRABBING, 380 381 // The following are handled as exceptions so don't need to match. 382 CURSOR_COPY, 383 CURSOR_NONE 384 }; 385 386 enum EDisplay { 387 INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, INLINE_BLOCK, 388 TABLE, INLINE_TABLE, TABLE_ROW_GROUP, 389 TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW, 390 TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL, 391 TABLE_CAPTION, BOX, INLINE_BOX, 392 #if ENABLE(WCSS) 393 WAP_MARQUEE, 394 #endif 395 NONE 396 }; 397 398 enum EInsideLink { 399 NotInsideLink, InsideUnvisitedLink, InsideVisitedLink 400 }; 401 402 enum EPointerEvents { 403 PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE, 404 PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL 405 }; 406 407 enum ETransformStyle3D { 408 TransformStyle3DFlat, TransformStyle3DPreserve3D 409 }; 410 411 enum EBackfaceVisibility { 412 BackfaceVisibilityVisible, BackfaceVisibilityHidden 413 }; 414 415 enum ELineClampType { LineClampLineCount, LineClampPercentage }; 416 417 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto }; 418 419 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation }; 420 421 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen }; 422 423 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom }; 424 425 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder }; 426 427 } // namespace WebCore 428 429 #endif // RenderStyleConstants_h 430