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