Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / style / ComputedStyleConstants.h
blob189aecbfcbe4cc5c1bd966cb331082d6b2e6cf9a
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/)
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 ComputedStyleConstants_h
27 #define ComputedStyleConstants_h
29 namespace blink {
31 // Sides used when drawing borders and outlines. The values should run clockwise from top.
32 enum BoxSide {
33 BSTop,
34 BSRight,
35 BSBottom,
36 BSLeft
39 enum StyleRecalcChange {
40 NoChange,
41 NoInherit,
42 UpdatePseudoElements,
43 Inherit,
44 Force,
45 Reattach,
46 ReattachNoLayoutObject
49 static const size_t PrintColorAdjustBits = 1;
50 enum PrintColorAdjust {
51 PrintColorAdjustEconomy,
52 PrintColorAdjustExact
55 // Static pseudo styles. Dynamic ones are produced on the fly.
56 enum PseudoId {
57 // The order must be NOP ID, public IDs, and then internal IDs.
58 // If you add or remove a public ID, you must update _pseudoBits in ComputedStyle.
59 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, BACKDROP, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR,
60 // Internal IDs follow:
61 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, INPUT_LIST_BUTTON,
62 // Special values follow:
63 AFTER_LAST_INTERNAL_PSEUDOID,
64 FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
65 FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB,
66 PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1),
67 PSEUDO_ELEMENT_MASK = (1 << (BEFORE - 1)) | (1 << (AFTER - 1)) | (1 << (BACKDROP - 1))
70 enum ColumnFill { ColumnFillBalance, ColumnFillAuto };
72 enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll };
74 enum EBorderCollapse { BSEPARATE = 0, BCOLLAPSE = 1 };
76 // These have been defined in the order of their precedence for border-collapsing. Do
77 // not change this order! This order also must match the order in CSSValueKeywords.in.
78 enum EBorderStyle { BNONE, BHIDDEN, INSET, GROOVE, OUTSET, RIDGE, DOTTED, DASHED, SOLID, DOUBLE };
80 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
82 enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
84 enum EPosition {
85 StaticPosition = 0,
86 RelativePosition = 1,
87 AbsolutePosition = 2,
88 StickyPosition = 3,
89 // This value is required to pack our bits efficiently in LayoutObject.
90 FixedPosition = 6
93 enum EFloat {
94 NoFloat, LeftFloat, RightFloat
97 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
99 // Box decoration attributes. Not inherited.
101 enum EBoxDecorationBreak { DSLICE, DCLONE };
103 // Box attributes. Not inherited.
105 enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
107 // Random visual rendering model attributes. Not inherited.
109 enum EOverflow {
110 OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OPAGEDX, OPAGEDY
113 enum EVerticalAlign {
114 BASELINE, MIDDLE, SUB, SUPER, TEXT_TOP,
115 TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
118 enum EClear {
119 CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
122 enum ETableLayout {
123 TAUTO, TFIXED
126 enum TextCombine {
127 TextCombineNone, TextCombineHorizontal
130 enum EFillAttachment {
131 ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
134 enum EFillBox {
135 BorderFillBox, PaddingFillBox, ContentFillBox, TextFillBox
138 enum EFillRepeat {
139 RepeatFill, NoRepeatFill, RoundFill, SpaceFill
142 enum EFillLayerType {
143 BackgroundFillLayer, MaskFillLayer
146 // CSS3 Background Values
147 enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
149 // CSS3 Background Position
150 enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
152 // CSS Mask Source Types
153 enum EMaskSourceType { MaskAlpha, MaskLuminance };
155 // Deprecated Flexible Box Properties
157 enum EBoxPack { Start, Center, End, Justify };
158 enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BBASELINE };
159 enum EBoxOrient { HORIZONTAL, VERTICAL };
160 enum EBoxLines { SINGLE, MULTIPLE };
161 enum EBoxDirection { BNORMAL, BREVERSE };
163 // CSS3 Flexbox Properties
165 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
166 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
168 enum ETextSecurity {
169 TSNONE, TSDISC, TSCIRCLE, TSSQUARE
172 // CSS3 User Modify Properties
174 enum EUserModify {
175 READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY
178 // CSS3 User Drag Values
180 enum EUserDrag {
181 DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT
184 // CSS3 User Select Values
186 enum EUserSelect {
187 SELECT_NONE, SELECT_TEXT, SELECT_ALL
190 // CSS3 Image Values
191 enum ObjectFit { ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown };
193 // Word Break Values. Matches WinIE and CSS3
195 enum EWordBreak {
196 NormalWordBreak, BreakAllWordBreak, KeepAllWordBreak, BreakWordBreak
199 enum EOverflowWrap {
200 NormalOverflowWrap, BreakOverflowWrap
203 enum LineBreak {
204 LineBreakAuto, LineBreakLoose, LineBreakNormal, LineBreakStrict, LineBreakAfterWhiteSpace
207 enum EResize {
208 RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
211 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
212 enum EListStyleType {
213 Disc,
214 Circle,
215 Square,
216 DecimalListStyle,
217 DecimalLeadingZero,
218 ArabicIndic,
219 Bengali,
220 Cambodian,
221 Khmer,
222 Devanagari,
223 Gujarati,
224 Gurmukhi,
225 Kannada,
226 Lao,
227 Malayalam,
228 Mongolian,
229 Myanmar,
230 Oriya,
231 Persian,
232 Urdu,
233 Telugu,
234 Tibetan,
235 Thai,
236 LowerRoman,
237 UpperRoman,
238 LowerGreek,
239 LowerAlpha,
240 LowerLatin,
241 UpperAlpha,
242 UpperLatin,
243 CjkEarthlyBranch,
244 CjkHeavenlyStem,
245 EthiopicHalehame,
246 EthiopicHalehameAm,
247 EthiopicHalehameTiEr,
248 EthiopicHalehameTiEt,
249 Hangul,
250 HangulConsonant,
251 KoreanHangulFormal,
252 KoreanHanjaFormal,
253 KoreanHanjaInformal,
254 Hebrew,
255 Armenian,
256 LowerArmenian,
257 UpperArmenian,
258 Georgian,
259 CJKIdeographic,
260 SimpChineseFormal,
261 SimpChineseInformal,
262 TradChineseFormal,
263 TradChineseInformal,
264 Hiragana,
265 Katakana,
266 HiraganaIroha,
267 KatakanaIroha,
268 NoneListStyle
271 enum QuoteType {
272 OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
275 enum EAnimPlayState {
276 AnimPlayStatePlaying,
277 AnimPlayStatePaused
280 enum EWhiteSpace {
281 NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP
284 // The order of this enum must match the order of the text align values in CSSValueKeywords.in.
285 enum ETextAlign {
286 LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER, TASTART, TAEND,
289 enum ETextTransform {
290 CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
293 static const size_t TextDecorationBits = 4;
294 enum TextDecoration {
295 TextDecorationNone = 0x0,
296 TextDecorationUnderline = 0x1,
297 TextDecorationOverline = 0x2,
298 TextDecorationLineThrough = 0x4,
299 TextDecorationBlink = 0x8
301 inline TextDecoration operator| (TextDecoration a, TextDecoration b) { return TextDecoration(int(a) | int(b)); }
302 inline TextDecoration& operator|= (TextDecoration& a, TextDecoration b) { return a = a | b; }
304 enum TextDecorationStyle {
305 TextDecorationStyleSolid,
306 TextDecorationStyleDouble,
307 TextDecorationStyleDotted,
308 TextDecorationStyleDashed,
309 TextDecorationStyleWavy
312 enum TextAlignLast {
313 TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
316 enum TextUnderlinePosition {
317 // FIXME: Implement support for 'under left' and 'under right' values.
318 TextUnderlinePositionAuto,
319 TextUnderlinePositionUnder
322 enum EPageBreak {
323 PBAUTO, PBALWAYS, PBAVOID
326 enum EEmptyCell {
327 SHOW, HIDE
330 enum ECaptionSide {
331 CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
334 enum EListStylePosition { OUTSIDE, INSIDE };
336 enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
338 enum ECursor {
339 // The following must match the order in CSSValueKeywords.in.
340 CURSOR_AUTO,
341 CURSOR_CROSS,
342 CURSOR_DEFAULT,
343 CURSOR_POINTER,
344 CURSOR_MOVE,
345 CURSOR_VERTICAL_TEXT,
346 CURSOR_CELL,
347 CURSOR_CONTEXT_MENU,
348 CURSOR_ALIAS,
349 CURSOR_PROGRESS,
350 CURSOR_NO_DROP,
351 CURSOR_NOT_ALLOWED,
352 CURSOR_ZOOM_IN,
353 CURSOR_ZOOM_OUT,
354 CURSOR_E_RESIZE,
355 CURSOR_NE_RESIZE,
356 CURSOR_NW_RESIZE,
357 CURSOR_N_RESIZE,
358 CURSOR_SE_RESIZE,
359 CURSOR_SW_RESIZE,
360 CURSOR_S_RESIZE,
361 CURSOR_W_RESIZE,
362 CURSOR_EW_RESIZE,
363 CURSOR_NS_RESIZE,
364 CURSOR_NESW_RESIZE,
365 CURSOR_NWSE_RESIZE,
366 CURSOR_COL_RESIZE,
367 CURSOR_ROW_RESIZE,
368 CURSOR_TEXT,
369 CURSOR_WAIT,
370 CURSOR_HELP,
371 CURSOR_ALL_SCROLL,
372 CURSOR_WEBKIT_GRAB,
373 CURSOR_WEBKIT_GRABBING,
375 // The following are handled as exceptions so don't need to match.
376 CURSOR_COPY,
377 CURSOR_NONE
380 // The order of this enum must match the order of the display values in CSSValueKeywords.in.
381 enum EDisplay {
382 INLINE, BLOCK, LIST_ITEM, INLINE_BLOCK,
383 TABLE, INLINE_TABLE, TABLE_ROW_GROUP,
384 TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW,
385 TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL,
386 TABLE_CAPTION, BOX, INLINE_BOX,
387 FLEX, INLINE_FLEX,
388 GRID, INLINE_GRID,
389 NONE,
390 FIRST_TABLE_DISPLAY = TABLE,
391 LAST_TABLE_DISPLAY = TABLE_CAPTION
394 enum EInsideLink {
395 NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
398 enum EPointerEvents {
399 PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
400 PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_BOUNDINGBOX,
401 PE_ALL
404 enum ETransformStyle3D {
405 TransformStyle3DFlat, TransformStyle3DPreserve3D
408 enum MotionRotationType { MotionRotationAuto, MotionRotationFixed };
410 enum EBackfaceVisibility {
411 BackfaceVisibilityVisible, BackfaceVisibilityHidden
414 enum ELineClampType { LineClampLineCount, LineClampPercentage };
416 enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
418 enum ESpeak { SpeakNone, SpeakNormal, SpeakSpellOut, SpeakDigits, SpeakLiteralPunctuation, SpeakNoPunctuation };
420 enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
422 enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasisMarkDot, TextEmphasisMarkCircle, TextEmphasisMarkDoubleCircle, TextEmphasisMarkTriangle, TextEmphasisMarkSesame, TextEmphasisMarkCustom };
424 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
426 enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight };
428 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
430 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast, ImageRenderingPixelated };
432 enum ImageResolutionSource { ImageResolutionSpecified = 0, ImageResolutionFromImage };
434 enum ImageResolutionSnap { ImageResolutionNoSnap = 0, ImageResolutionSnapPixels };
436 enum Order { LogicalOrder = 0, VisualOrder };
438 enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlowMaximum, WrapFlowClear };
440 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
442 enum RubyPosition { RubyPositionBefore, RubyPositionAfter };
444 static const size_t GridAutoFlowBits = 4;
445 enum InternalGridAutoFlowAlgorithm {
446 InternalAutoFlowAlgorithmSparse = 0x1,
447 InternalAutoFlowAlgorithmDense = 0x2
450 enum InternalGridAutoFlowDirection {
451 InternalAutoFlowDirectionRow = 0x4,
452 InternalAutoFlowDirectionColumn = 0x8
455 enum GridAutoFlow {
456 AutoFlowRow = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionRow,
457 AutoFlowColumn = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionColumn,
458 AutoFlowRowDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionRow,
459 AutoFlowColumnDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionColumn
462 enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
464 static const size_t TouchActionBits = 6;
465 enum TouchAction {
466 TouchActionAuto = 0x0,
467 TouchActionNone = 0x1,
468 TouchActionPanLeft = 0x2,
469 TouchActionPanRight = 0x4,
470 TouchActionPanX = TouchActionPanLeft | TouchActionPanRight,
471 TouchActionPanUp = 0x8,
472 TouchActionPanDown = 0x10,
473 TouchActionPanY = TouchActionPanUp | TouchActionPanDown,
474 TouchActionPinchZoom = 0x20,
476 inline TouchAction operator| (TouchAction a, TouchAction b) { return TouchAction(int(a) | int(b)); }
477 inline TouchAction& operator|= (TouchAction& a, TouchAction b) { return a = a | b; }
478 inline TouchAction operator& (TouchAction a, TouchAction b) { return TouchAction(int(a) & int(b)); }
479 inline TouchAction& operator&= (TouchAction& a, TouchAction b) { return a = a & b; }
481 enum EIsolation { IsolationAuto, IsolationIsolate };
483 enum ItemPosition {
484 ItemPositionAuto,
485 ItemPositionStretch,
486 ItemPositionBaseline,
487 ItemPositionLastBaseline,
488 ItemPositionCenter,
489 ItemPositionStart,
490 ItemPositionEnd,
491 ItemPositionSelfStart,
492 ItemPositionSelfEnd,
493 ItemPositionFlexStart,
494 ItemPositionFlexEnd,
495 ItemPositionLeft,
496 ItemPositionRight
499 enum OverflowAlignment {
500 OverflowAlignmentDefault,
501 OverflowAlignmentTrue,
502 OverflowAlignmentSafe
505 enum ItemPositionType {
506 NonLegacyPosition,
507 LegacyPosition
510 enum ContentPosition {
511 ContentPositionAuto,
512 ContentPositionBaseline,
513 ContentPositionLastBaseline,
514 ContentPositionCenter,
515 ContentPositionStart,
516 ContentPositionEnd,
517 ContentPositionFlexStart,
518 ContentPositionFlexEnd,
519 ContentPositionLeft,
520 ContentPositionRight
523 enum ContentDistributionType {
524 ContentDistributionDefault,
525 ContentDistributionSpaceBetween,
526 ContentDistributionSpaceAround,
527 ContentDistributionSpaceEvenly,
528 ContentDistributionStretch
531 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
532 static const float maximumAllowedFontSize = 1000000.0f;
534 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine };
535 enum TextIndentType { TextIndentNormal, TextIndentHanging };
537 enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox };
539 enum ScrollSnapType {
540 ScrollSnapTypeNone,
541 ScrollSnapTypeMandatory,
542 ScrollSnapTypeProximity
545 } // namespace blink
547 #endif // ComputedStyleConstants_h