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