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 | #pragma once |
27 | |
28 | #include <initializer_list> |
29 | |
30 | namespace WTF { |
31 | class TextStream; |
32 | } |
33 | |
34 | namespace WebCore { |
35 | |
36 | static const size_t PrintColorAdjustBits = 1; |
37 | enum class PrintColorAdjust : uint8_t { |
38 | Economy, |
39 | Exact |
40 | }; |
41 | |
42 | // The difference between two styles. The following values are used: |
43 | // - StyleDifference::Equal - The two styles are identical |
44 | // - StyleDifference::RecompositeLayer - The layer needs its position and transform updated, but no repaint |
45 | // - StyleDifference::Repaint - The object just needs to be repainted. |
46 | // - StyleDifference::RepaintIfTextOrBorderOrOutline - The object needs to be repainted if it contains text or a border or outline. |
47 | // - StyleDifference::RepaintLayer - The layer and its descendant layers needs to be repainted. |
48 | // - StyleDifference::LayoutPositionedMovementOnly - Only the position of this positioned object has been updated |
49 | // - StyleDifference::SimplifiedLayout - Only overflow needs to be recomputed |
50 | // - StyleDifference::SimplifiedLayoutAndPositionedMovement - Both positioned movement and simplified layout updates are required. |
51 | // - StyleDifference::Layout - A full layout is required. |
52 | enum class StyleDifference { |
53 | Equal, |
54 | RecompositeLayer, |
55 | Repaint, |
56 | RepaintIfTextOrBorderOrOutline, |
57 | RepaintLayer, |
58 | LayoutPositionedMovementOnly, |
59 | SimplifiedLayout, |
60 | SimplifiedLayoutAndPositionedMovement, |
61 | Layout, |
62 | NewStyle |
63 | }; |
64 | |
65 | // When some style properties change, different amounts of work have to be done depending on |
66 | // context (e.g. whether the property is changing on an element which has a compositing layer). |
67 | // A simple StyleDifference does not provide enough information so we return a bit mask of |
68 | // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too. |
69 | enum class StyleDifferenceContextSensitiveProperty { |
70 | None = 0, |
71 | Transform = 1 << 0, |
72 | Opacity = 1 << 1, |
73 | Filter = 1 << 2, |
74 | ClipRect = 1 << 3, |
75 | ClipPath = 1 << 4, |
76 | WillChange = 1 << 5, |
77 | }; |
78 | |
79 | // Static pseudo styles. Dynamic ones are produced on the fly. |
80 | enum class PseudoId : uint8_t { |
81 | // The order must be None, public IDs, and then internal IDs. |
82 | None, |
83 | |
84 | // Public: |
85 | FirstLine, |
86 | FirstLetter, |
87 | Marker, |
88 | Before, |
89 | After, |
90 | Selection, |
91 | Scrollbar, |
92 | |
93 | // Internal: |
94 | ScrollbarThumb, |
95 | ScrollbarButton, |
96 | ScrollbarTrack, |
97 | ScrollbarTrackPiece, |
98 | ScrollbarCorner, |
99 | Resizer, |
100 | |
101 | AfterLastInternalPseudoId, |
102 | |
103 | FirstPublicPseudoId = FirstLine, |
104 | FirstInternalPseudoId = ScrollbarThumb, |
105 | PublicPseudoIdMask = ((1 << FirstInternalPseudoId) - 1) & ~((1 << FirstPublicPseudoId) - 1) |
106 | }; |
107 | |
108 | class PseudoIdSet { |
109 | public: |
110 | PseudoIdSet() |
111 | : m_data(0) |
112 | { |
113 | } |
114 | |
115 | PseudoIdSet(std::initializer_list<PseudoId> initializerList) |
116 | : m_data(0) |
117 | { |
118 | for (PseudoId pseudoId : initializerList) |
119 | add(pseudoId); |
120 | } |
121 | |
122 | static PseudoIdSet fromMask(unsigned rawPseudoIdSet) |
123 | { |
124 | return PseudoIdSet(rawPseudoIdSet); |
125 | } |
126 | |
127 | bool has(PseudoId pseudoId) const |
128 | { |
129 | ASSERT((sizeof(m_data) * 8) > static_cast<unsigned>(pseudoId)); |
130 | return m_data & (1U << static_cast<unsigned>(pseudoId)); |
131 | } |
132 | |
133 | void add(PseudoId pseudoId) |
134 | { |
135 | ASSERT((sizeof(m_data) * 8) > static_cast<unsigned>(pseudoId)); |
136 | m_data |= (1U << static_cast<unsigned>(pseudoId)); |
137 | } |
138 | |
139 | void merge(PseudoIdSet source) |
140 | { |
141 | m_data |= source.m_data; |
142 | } |
143 | |
144 | PseudoIdSet operator &(const PseudoIdSet& pseudoIdSet) const |
145 | { |
146 | return PseudoIdSet(m_data & pseudoIdSet.m_data); |
147 | } |
148 | |
149 | PseudoIdSet operator |(const PseudoIdSet& pseudoIdSet) const |
150 | { |
151 | return PseudoIdSet(m_data | pseudoIdSet.m_data); |
152 | } |
153 | |
154 | explicit operator bool() const |
155 | { |
156 | return m_data; |
157 | } |
158 | |
159 | unsigned data() const { return m_data; } |
160 | |
161 | static ptrdiff_t dataMemoryOffset() { return OBJECT_OFFSETOF(PseudoIdSet, m_data); } |
162 | |
163 | private: |
164 | explicit PseudoIdSet(unsigned rawPseudoIdSet) |
165 | : m_data(rawPseudoIdSet) |
166 | { |
167 | } |
168 | |
169 | unsigned m_data; |
170 | }; |
171 | |
172 | enum class ColumnFill : uint8_t { |
173 | Balance, |
174 | Auto |
175 | }; |
176 | |
177 | enum class ColumnSpan : uint8_t { |
178 | None = 0, |
179 | All |
180 | }; |
181 | |
182 | enum class BorderCollapse : uint8_t { |
183 | Separate = 0, |
184 | Collapse |
185 | }; |
186 | |
187 | // These have been defined in the order of their precedence for border-collapsing. Do |
188 | // not change this order! This order also must match the order in CSSValueKeywords.in. |
189 | enum class BorderStyle : uint8_t { |
190 | None, |
191 | Hidden, |
192 | Inset, |
193 | Groove, |
194 | Outset, |
195 | Ridge, |
196 | Dotted, |
197 | Dashed, |
198 | Solid, |
199 | Double |
200 | }; |
201 | |
202 | enum class BorderPrecedence : uint8_t { |
203 | Off, |
204 | Table, |
205 | ColumnGroup, |
206 | Column, |
207 | RowGroup, |
208 | Row, |
209 | Cell |
210 | }; |
211 | |
212 | enum class OutlineIsAuto : uint8_t { |
213 | Off = 0, |
214 | On |
215 | }; |
216 | |
217 | enum class PositionType : uint8_t { |
218 | Static = 0, |
219 | Relative = 1, |
220 | Absolute = 2, |
221 | Sticky = 3, |
222 | // This value is required to pack our bits efficiently in RenderObject. |
223 | Fixed = 6 |
224 | }; |
225 | |
226 | enum class Float : uint8_t { |
227 | No, |
228 | Left, |
229 | Right |
230 | }; |
231 | |
232 | enum class MarginCollapse : uint8_t { |
233 | Collapse, |
234 | Separate, |
235 | Discard |
236 | }; |
237 | |
238 | // Box decoration attributes. Not inherited. |
239 | |
240 | enum class BoxDecorationBreak : uint8_t { |
241 | Slice, |
242 | Clone |
243 | }; |
244 | |
245 | // Box attributes. Not inherited. |
246 | |
247 | enum class BoxSizing : uint8_t { |
248 | ContentBox, |
249 | BorderBox |
250 | }; |
251 | |
252 | // Random visual rendering model attributes. Not inherited. |
253 | |
254 | enum class Overflow : uint8_t { |
255 | Visible, |
256 | Hidden, |
257 | Scroll, |
258 | Auto, |
259 | PagedX, |
260 | PagedY |
261 | }; |
262 | |
263 | enum class VerticalAlign : uint8_t { |
264 | Baseline, |
265 | Middle, |
266 | Sub, |
267 | Super, |
268 | TextTop, |
269 | TextBottom, |
270 | Top, |
271 | Bottom, |
272 | BaselineMiddle, |
273 | Length |
274 | }; |
275 | |
276 | enum class Clear : uint8_t { |
277 | None = 0, |
278 | Left = 1, |
279 | Right = 2, |
280 | Both = 3 |
281 | }; |
282 | |
283 | enum class TableLayoutType : uint8_t { |
284 | Auto, |
285 | Fixed |
286 | }; |
287 | |
288 | enum class TextCombine : uint8_t { |
289 | None, |
290 | Horizontal |
291 | }; |
292 | |
293 | enum class FillAttachment : uint8_t { |
294 | ScrollBackground, |
295 | LocalBackground, |
296 | FixedBackground |
297 | }; |
298 | |
299 | enum class FillBox : uint8_t { |
300 | Border, |
301 | Padding, |
302 | Content, |
303 | Text |
304 | }; |
305 | |
306 | enum class FillRepeat : uint8_t { |
307 | Repeat, |
308 | NoRepeat, |
309 | Round, |
310 | Space |
311 | }; |
312 | |
313 | enum class FillLayerType : uint8_t { |
314 | Background, |
315 | Mask |
316 | }; |
317 | |
318 | // CSS3 Background Values |
319 | enum class FillSizeType : uint8_t { |
320 | Contain, |
321 | Cover, |
322 | Size, |
323 | None |
324 | }; |
325 | |
326 | // CSS3 <position> |
327 | enum class Edge : uint8_t { |
328 | Top, |
329 | Right, |
330 | Bottom, |
331 | Left |
332 | }; |
333 | |
334 | // CSS3 Mask Source Types |
335 | |
336 | enum class MaskSourceType : uint8_t { |
337 | Alpha, |
338 | Luminance |
339 | }; |
340 | |
341 | // CSS3 Marquee Properties |
342 | |
343 | enum class MarqueeBehavior : uint8_t { |
344 | None, |
345 | Scroll, |
346 | Slide, |
347 | Alternate |
348 | }; |
349 | |
350 | enum class MarqueeDirection : uint8_t { |
351 | Auto, |
352 | Left, |
353 | Right, |
354 | Up, |
355 | Down, |
356 | Forward, |
357 | Backward |
358 | }; |
359 | |
360 | // Deprecated Flexible Box Properties |
361 | |
362 | enum class BoxPack : uint8_t { |
363 | Start, |
364 | Center, |
365 | End, |
366 | Justify |
367 | }; |
368 | |
369 | enum class BoxAlignment : uint8_t { |
370 | Stretch, |
371 | Start, |
372 | Center, |
373 | End, |
374 | Baseline |
375 | }; |
376 | |
377 | enum class BoxOrient : uint8_t { |
378 | Horizontal, |
379 | Vertical |
380 | }; |
381 | |
382 | enum class BoxLines : uint8_t { |
383 | Single, |
384 | Multiple |
385 | }; |
386 | |
387 | enum class BoxDirection : uint8_t { |
388 | Normal, |
389 | Reverse |
390 | }; |
391 | |
392 | // CSS3 Flexbox Properties |
393 | |
394 | enum class AlignContent : uint8_t { |
395 | FlexStart, |
396 | FlexEnd, |
397 | Center, |
398 | SpaceBetween, |
399 | SpaceAround, |
400 | Stretch |
401 | }; |
402 | |
403 | enum class FlexDirection : uint8_t { |
404 | Row, |
405 | RowReverse, |
406 | Column, |
407 | ColumnReverse |
408 | }; |
409 | |
410 | enum class FlexWrap : uint8_t { |
411 | NoWrap, |
412 | Wrap, |
413 | Reverse |
414 | }; |
415 | |
416 | enum class ItemPosition : uint8_t { |
417 | Legacy, |
418 | Auto, |
419 | Normal, |
420 | Stretch, |
421 | Baseline, |
422 | LastBaseline, |
423 | Center, |
424 | Start, |
425 | End, |
426 | SelfStart, |
427 | SelfEnd, |
428 | FlexStart, |
429 | FlexEnd, |
430 | Left, |
431 | Right |
432 | }; |
433 | |
434 | enum class OverflowAlignment : uint8_t { |
435 | Default, |
436 | Unsafe, |
437 | Safe |
438 | }; |
439 | |
440 | enum class ItemPositionType : uint8_t { |
441 | NonLegacy, |
442 | Legacy |
443 | }; |
444 | |
445 | enum class ContentPosition : uint8_t { |
446 | Normal, |
447 | Baseline, |
448 | LastBaseline, |
449 | Center, |
450 | Start, |
451 | End, |
452 | FlexStart, |
453 | FlexEnd, |
454 | Left, |
455 | Right |
456 | }; |
457 | |
458 | enum class ContentDistribution : uint8_t { |
459 | Default, |
460 | SpaceBetween, |
461 | SpaceAround, |
462 | SpaceEvenly, |
463 | Stretch |
464 | }; |
465 | |
466 | |
467 | enum class TextSecurity : uint8_t { |
468 | None, |
469 | Disc, |
470 | Circle, |
471 | Square |
472 | }; |
473 | |
474 | // CSS3 User Modify Properties |
475 | |
476 | enum class UserModify : uint8_t { |
477 | ReadOnly, |
478 | ReadWrite, |
479 | ReadWritePlaintextOnly |
480 | }; |
481 | |
482 | // CSS3 User Drag Values |
483 | |
484 | enum class UserDrag : uint8_t { |
485 | Auto, |
486 | None, |
487 | Element |
488 | }; |
489 | |
490 | // CSS3 User Select Values |
491 | |
492 | enum class UserSelect : uint8_t { |
493 | None, |
494 | Text, |
495 | All |
496 | }; |
497 | |
498 | // CSS3 Image Values |
499 | enum class ObjectFit : uint8_t { |
500 | Fill, |
501 | Contain, |
502 | Cover, |
503 | None, |
504 | ScaleDown |
505 | }; |
506 | |
507 | enum class AspectRatioType : uint8_t { |
508 | Auto, |
509 | FromIntrinsic, |
510 | FromDimensions, |
511 | Specified |
512 | }; |
513 | |
514 | enum class WordBreak : uint8_t { |
515 | Normal, |
516 | BreakAll, |
517 | KeepAll, |
518 | BreakWord |
519 | }; |
520 | |
521 | enum class OverflowWrap : uint8_t { |
522 | Normal, |
523 | Break |
524 | }; |
525 | |
526 | enum class NBSPMode : uint8_t { |
527 | Normal, |
528 | Space |
529 | }; |
530 | |
531 | enum class LineBreak : uint8_t { |
532 | Auto, |
533 | Loose, |
534 | Normal, |
535 | Strict, |
536 | AfterWhiteSpace, |
537 | Anywhere |
538 | }; |
539 | |
540 | enum class Resize : uint8_t { |
541 | None, |
542 | Both, |
543 | Horizontal, |
544 | Vertical |
545 | }; |
546 | |
547 | // The order of this enum must match the order of the list style types in CSSValueKeywords.in. |
548 | enum class ListStyleType : uint8_t { |
549 | Disc, |
550 | Circle, |
551 | Square, |
552 | Decimal, |
553 | DecimalLeadingZero, |
554 | ArabicIndic, |
555 | Binary, |
556 | Bengali, |
557 | Cambodian, |
558 | Khmer, |
559 | Devanagari, |
560 | Gujarati, |
561 | Gurmukhi, |
562 | Kannada, |
563 | LowerHexadecimal, |
564 | Lao, |
565 | Malayalam, |
566 | Mongolian, |
567 | Myanmar, |
568 | Octal, |
569 | Oriya, |
570 | Persian, |
571 | Urdu, |
572 | Telugu, |
573 | Tibetan, |
574 | Thai, |
575 | UpperHexadecimal, |
576 | LowerRoman, |
577 | UpperRoman, |
578 | LowerGreek, |
579 | LowerAlpha, |
580 | LowerLatin, |
581 | UpperAlpha, |
582 | UpperLatin, |
583 | Afar, |
584 | EthiopicHalehameAaEt, |
585 | EthiopicHalehameAaEr, |
586 | Amharic, |
587 | EthiopicHalehameAmEt, |
588 | AmharicAbegede, |
589 | EthiopicAbegedeAmEt, |
590 | CjkEarthlyBranch, |
591 | CjkHeavenlyStem, |
592 | Ethiopic, |
593 | EthiopicHalehameGez, |
594 | EthiopicAbegede, |
595 | EthiopicAbegedeGez, |
596 | HangulConsonant, |
597 | Hangul, |
598 | LowerNorwegian, |
599 | Oromo, |
600 | EthiopicHalehameOmEt, |
601 | Sidama, |
602 | EthiopicHalehameSidEt, |
603 | Somali, |
604 | EthiopicHalehameSoEt, |
605 | Tigre, |
606 | EthiopicHalehameTig, |
607 | TigrinyaEr, |
608 | EthiopicHalehameTiEr, |
609 | TigrinyaErAbegede, |
610 | EthiopicAbegedeTiEr, |
611 | TigrinyaEt, |
612 | EthiopicHalehameTiEt, |
613 | TigrinyaEtAbegede, |
614 | EthiopicAbegedeTiEt, |
615 | UpperGreek, |
616 | UpperNorwegian, |
617 | Asterisks, |
618 | , |
619 | Hebrew, |
620 | Armenian, |
621 | LowerArmenian, |
622 | UpperArmenian, |
623 | Georgian, |
624 | CJKIdeographic, |
625 | Hiragana, |
626 | Katakana, |
627 | HiraganaIroha, |
628 | KatakanaIroha, |
629 | None |
630 | }; |
631 | |
632 | enum class QuoteType : uint8_t { |
633 | OpenQuote, |
634 | CloseQuote, |
635 | NoOpenQuote, |
636 | NoCloseQuote |
637 | }; |
638 | |
639 | enum class BorderFit : uint8_t { |
640 | Border, |
641 | Lines |
642 | }; |
643 | |
644 | enum class AnimationFillMode : uint8_t { |
645 | None, |
646 | Forwards, |
647 | Backwards, |
648 | Both |
649 | }; |
650 | |
651 | enum class AnimationPlayState : uint8_t { |
652 | Playing = 0x0, |
653 | Paused = 0x1 |
654 | }; |
655 | |
656 | enum class WhiteSpace : uint8_t { |
657 | Normal, |
658 | Pre, |
659 | PreWrap, |
660 | PreLine, |
661 | NoWrap, |
662 | KHTMLNoWrap, |
663 | BreakSpaces |
664 | }; |
665 | |
666 | // The order of this enum must match the order of the text align values in CSSValueKeywords.in. |
667 | enum class TextAlignMode : uint8_t { |
668 | Left, |
669 | Right, |
670 | Center, |
671 | Justify, |
672 | WebKitLeft, |
673 | WebKitRight, |
674 | WebKitCenter, |
675 | Start, |
676 | End, |
677 | }; |
678 | |
679 | enum class TextTransform : uint8_t { |
680 | Capitalize, |
681 | Uppercase, |
682 | Lowercase, |
683 | None |
684 | }; |
685 | |
686 | #if ENABLE(LETTERPRESS) |
687 | static const size_t TextDecorationBits = 5; |
688 | #else |
689 | static const size_t TextDecorationBits = 4; |
690 | #endif |
691 | enum class TextDecoration : uint8_t { |
692 | None = 0, |
693 | Underline = 1 << 0, |
694 | Overline = 1 << 1, |
695 | LineThrough = 1 << 2, |
696 | Blink = 1 << 3, |
697 | #if ENABLE(LETTERPRESS) |
698 | Letterpress = 1 << 4, |
699 | #endif |
700 | }; |
701 | |
702 | enum class TextDecorationStyle : uint8_t { |
703 | Solid, |
704 | Double, |
705 | Dotted, |
706 | Dashed, |
707 | Wavy |
708 | }; |
709 | |
710 | #if ENABLE(CSS3_TEXT) |
711 | enum class TextAlignLast : uint8_t { |
712 | Auto, |
713 | Start, |
714 | End, |
715 | Left, |
716 | Right, |
717 | Center, |
718 | Justify |
719 | }; |
720 | |
721 | enum class TextJustify : uint8_t { |
722 | Auto, |
723 | None, |
724 | InterWord, |
725 | Distribute |
726 | }; |
727 | #endif // CSS3_TEXT |
728 | |
729 | enum class TextDecorationSkip : uint8_t { |
730 | None = 0, |
731 | Ink = 1 << 0, |
732 | Objects = 1 << 1, |
733 | Auto = 1 << 2 |
734 | }; |
735 | |
736 | enum class TextUnderlinePosition : uint8_t { |
737 | // FIXME: Implement support for 'under left' and 'under right' values. |
738 | Auto, |
739 | Under, |
740 | FromFont |
741 | }; |
742 | |
743 | enum class TextZoom : uint8_t { |
744 | Normal, |
745 | Reset |
746 | }; |
747 | |
748 | enum class BreakBetween : uint8_t { |
749 | Auto, |
750 | Avoid, |
751 | AvoidColumn, |
752 | AvoidPage, |
753 | Column, |
754 | Page, |
755 | LeftPage, |
756 | RightPage, |
757 | RectoPage, |
758 | VersoPage |
759 | }; |
760 | bool alwaysPageBreak(BreakBetween); |
761 | |
762 | enum class BreakInside : uint8_t { |
763 | Auto, |
764 | Avoid, |
765 | AvoidColumn, |
766 | AvoidPage |
767 | }; |
768 | |
769 | enum class HangingPunctuation : uint8_t { |
770 | None = 0, |
771 | First = 1 << 0, |
772 | Last = 1 << 1, |
773 | AllowEnd = 1 << 2, |
774 | ForceEnd = 1 << 3 |
775 | }; |
776 | |
777 | enum class EmptyCell : uint8_t { |
778 | Show, |
779 | Hide |
780 | }; |
781 | |
782 | enum class CaptionSide : uint8_t { |
783 | Top, |
784 | Bottom, |
785 | Left, |
786 | Right |
787 | }; |
788 | |
789 | enum class ListStylePosition : uint8_t { |
790 | Outside, |
791 | Inside |
792 | }; |
793 | |
794 | enum class Visibility : uint8_t { |
795 | Visible, |
796 | Hidden, |
797 | Collapse |
798 | }; |
799 | |
800 | WTF::TextStream& operator<<(WTF::TextStream&, Visibility); |
801 | |
802 | enum class CursorType : uint8_t { |
803 | // The following must match the order in CSSValueKeywords.in. |
804 | Auto, |
805 | Default, |
806 | // None |
807 | , |
808 | Help, |
809 | Pointer, |
810 | Progress, |
811 | Wait, |
812 | Cell, |
813 | Crosshair, |
814 | Text, |
815 | VerticalText, |
816 | Alias, |
817 | // Copy |
818 | Move, |
819 | NoDrop, |
820 | NotAllowed, |
821 | Grab, |
822 | Grabbing, |
823 | EResize, |
824 | NResize, |
825 | NEResize, |
826 | NWResize, |
827 | SResize, |
828 | SEResize, |
829 | SWResize, |
830 | WResize, |
831 | EWResize, |
832 | NSResize, |
833 | NESWResize, |
834 | NWSEResize, |
835 | ColumnResize, |
836 | RowResize, |
837 | AllScroll, |
838 | ZoomIn, |
839 | ZoomOut, |
840 | |
841 | // The following are handled as exceptions so don't need to match. |
842 | Copy, |
843 | None |
844 | }; |
845 | |
846 | #if ENABLE(CURSOR_VISIBILITY) |
847 | enum class CursorVisibility : uint8_t { |
848 | Auto, |
849 | AutoHide, |
850 | }; |
851 | #endif |
852 | |
853 | // The order of this enum must match the order of the display values in CSSValueKeywords.in. |
854 | enum class DisplayType : uint8_t { |
855 | Inline, |
856 | Block, |
857 | ListItem, |
858 | Compact, |
859 | InlineBlock, |
860 | Table, |
861 | InlineTable, |
862 | TableRowGroup, |
863 | , |
864 | , |
865 | TableRow, |
866 | TableColumnGroup, |
867 | TableColumn, |
868 | TableCell, |
869 | TableCaption, |
870 | Box, |
871 | InlineBox, |
872 | Flex, |
873 | WebKitFlex, |
874 | InlineFlex, |
875 | WebKitInlineFlex, |
876 | Contents, |
877 | Grid, |
878 | InlineGrid, |
879 | FlowRoot, |
880 | None |
881 | }; |
882 | |
883 | enum class InsideLink : uint8_t { |
884 | NotInside, |
885 | InsideUnvisited, |
886 | InsideVisited |
887 | }; |
888 | |
889 | enum class PointerEvents : uint8_t { |
890 | None, |
891 | Auto, |
892 | Stroke, |
893 | Fill, |
894 | Painted, |
895 | Visible, |
896 | VisibleStroke, |
897 | VisibleFill, |
898 | VisiblePainted, |
899 | All |
900 | }; |
901 | |
902 | enum class TransformStyle3D : uint8_t { |
903 | Flat, |
904 | Preserve3D |
905 | }; |
906 | |
907 | enum class BackfaceVisibility : uint8_t { |
908 | Visible, |
909 | Hidden |
910 | }; |
911 | |
912 | enum class TransformBox : uint8_t { |
913 | BorderBox, |
914 | FillBox, |
915 | ViewBox |
916 | }; |
917 | |
918 | enum class LineClamp : uint8_t { |
919 | LineCount, |
920 | Percentage |
921 | }; |
922 | |
923 | enum class Hyphens : uint8_t { |
924 | None, |
925 | Manual, |
926 | Auto |
927 | }; |
928 | |
929 | enum class SpeakAs : uint8_t { |
930 | Normal = 0, |
931 | SpellOut = 1 << 0, |
932 | Digits = 1 << 1, |
933 | LiteralPunctuation = 1 << 2, |
934 | NoPunctuation = 1 << 3 |
935 | }; |
936 | |
937 | enum class TextEmphasisFill : uint8_t { |
938 | Filled, |
939 | Open |
940 | }; |
941 | |
942 | enum class TextEmphasisMark : uint8_t { |
943 | None, |
944 | Auto, |
945 | Dot, |
946 | Circle, |
947 | DoubleCircle, |
948 | Triangle, |
949 | Sesame, |
950 | Custom |
951 | }; |
952 | |
953 | enum class TextEmphasisPosition : uint8_t { |
954 | Over = 1 << 0, |
955 | Under = 1 << 1, |
956 | Left = 1 << 2, |
957 | Right = 1 << 3 |
958 | }; |
959 | |
960 | enum class TextOrientation : uint8_t { |
961 | Mixed, |
962 | Upright, |
963 | Sideways |
964 | }; |
965 | |
966 | enum class TextOverflow : uint8_t { |
967 | Clip = 0, |
968 | Ellipsis |
969 | }; |
970 | |
971 | enum class ImageRendering : uint8_t { |
972 | Auto = 0, |
973 | OptimizeSpeed, |
974 | OptimizeQuality, |
975 | CrispEdges, |
976 | Pixelated |
977 | }; |
978 | |
979 | WTF::TextStream& operator<<(WTF::TextStream&, ImageRendering); |
980 | |
981 | enum class ImageResolutionSource : uint8_t { |
982 | Specified = 0, |
983 | FromImage |
984 | }; |
985 | |
986 | enum class ImageResolutionSnap : uint8_t { |
987 | None = 0, |
988 | Pixels |
989 | }; |
990 | |
991 | enum class Order : uint8_t { |
992 | Logical = 0, |
993 | Visual |
994 | }; |
995 | |
996 | enum class ColumnAxis : uint8_t { |
997 | Horizontal, |
998 | Vertical, |
999 | Auto |
1000 | }; |
1001 | |
1002 | enum class ColumnProgression : uint8_t { |
1003 | Normal, |
1004 | Reverse |
1005 | }; |
1006 | |
1007 | enum class LineSnap : uint8_t { |
1008 | None, |
1009 | Baseline, |
1010 | Contain |
1011 | }; |
1012 | |
1013 | enum class LineAlign : uint8_t { |
1014 | None, |
1015 | Edges |
1016 | }; |
1017 | |
1018 | enum class RubyPosition : uint8_t { |
1019 | Before, |
1020 | After, |
1021 | InterCharacter |
1022 | }; |
1023 | |
1024 | #if ENABLE(DARK_MODE_CSS) |
1025 | enum class ColorScheme : uint8_t { |
1026 | Light = 1 << 0, |
1027 | Dark = 1 << 1 |
1028 | }; |
1029 | |
1030 | static const size_t ColorSchemeBits = 2; |
1031 | #endif |
1032 | |
1033 | static const size_t GridAutoFlowBits = 4; |
1034 | enum InternalGridAutoFlowAlgorithm { |
1035 | InternalAutoFlowAlgorithmSparse = 1 << 0, |
1036 | InternalAutoFlowAlgorithmDense = 1 << 1, |
1037 | }; |
1038 | |
1039 | enum InternalGridAutoFlowDirection { |
1040 | InternalAutoFlowDirectionRow = 1 << 2, |
1041 | InternalAutoFlowDirectionColumn = 1 << 3 |
1042 | }; |
1043 | |
1044 | enum GridAutoFlow { |
1045 | AutoFlowRow = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionRow, |
1046 | AutoFlowColumn = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionColumn, |
1047 | AutoFlowRowDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionRow, |
1048 | AutoFlowColumnDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionColumn |
1049 | }; |
1050 | |
1051 | enum class AutoRepeatType : uint8_t { |
1052 | None, |
1053 | Fill, |
1054 | Fit |
1055 | }; |
1056 | |
1057 | // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows). |
1058 | static const float maximumAllowedFontSize = 1000000.0f; |
1059 | |
1060 | #if ENABLE(CSS3_TEXT) |
1061 | |
1062 | enum class TextIndentLine : uint8_t { |
1063 | FirstLine, |
1064 | EachLine |
1065 | }; |
1066 | |
1067 | enum class TextIndentType : uint8_t { |
1068 | Normal, |
1069 | Hanging |
1070 | }; |
1071 | |
1072 | #endif |
1073 | |
1074 | enum class Isolation : uint8_t { |
1075 | Auto, |
1076 | Isolate |
1077 | }; |
1078 | |
1079 | // Fill, Stroke, ViewBox are just used for SVG. |
1080 | enum class CSSBoxType : uint8_t { |
1081 | BoxMissing = 0, |
1082 | MarginBox, |
1083 | BorderBox, |
1084 | PaddingBox, |
1085 | ContentBox, |
1086 | FillBox, |
1087 | StrokeBox, |
1088 | ViewBox |
1089 | }; |
1090 | |
1091 | #if ENABLE(CSS_SCROLL_SNAP) |
1092 | enum class ScrollSnapStrictness : uint8_t { |
1093 | None, |
1094 | Proximity, |
1095 | Mandatory |
1096 | }; |
1097 | |
1098 | enum class ScrollSnapAxis : uint8_t { |
1099 | XAxis, |
1100 | YAxis, |
1101 | Block, |
1102 | Inline, |
1103 | Both |
1104 | }; |
1105 | |
1106 | enum class ScrollSnapAxisAlignType : uint8_t { |
1107 | None, |
1108 | Start, |
1109 | Center, |
1110 | End |
1111 | }; |
1112 | #endif |
1113 | |
1114 | #if ENABLE(CSS_TRAILING_WORD) |
1115 | enum class TrailingWord : uint8_t { |
1116 | Auto, |
1117 | PartiallyBalanced |
1118 | }; |
1119 | #endif |
1120 | |
1121 | #if ENABLE(APPLE_PAY) |
1122 | enum class ApplePayButtonStyle : uint8_t { |
1123 | White, |
1124 | WhiteOutline, |
1125 | Black, |
1126 | }; |
1127 | |
1128 | enum class ApplePayButtonType : uint8_t { |
1129 | Plain, |
1130 | Buy, |
1131 | SetUp, |
1132 | Donate, |
1133 | #if ENABLE(APPLE_PAY_SESSION_V4) |
1134 | CheckOut, |
1135 | Book, |
1136 | Subscribe, |
1137 | #endif |
1138 | }; |
1139 | #endif |
1140 | |
1141 | WTF::TextStream& operator<<(WTF::TextStream&, FillSizeType); |
1142 | WTF::TextStream& operator<<(WTF::TextStream&, FillAttachment); |
1143 | WTF::TextStream& operator<<(WTF::TextStream&, FillBox); |
1144 | WTF::TextStream& operator<<(WTF::TextStream&, FillRepeat); |
1145 | WTF::TextStream& operator<<(WTF::TextStream&, MaskSourceType); |
1146 | WTF::TextStream& operator<<(WTF::TextStream&, Edge); |
1147 | |
1148 | // These are all minimized combinations of paint-order. |
1149 | enum class PaintOrder : uint8_t { |
1150 | Normal, |
1151 | Fill, |
1152 | FillMarkers, |
1153 | Stroke, |
1154 | StrokeMarkers, |
1155 | Markers, |
1156 | |
1157 | }; |
1158 | |
1159 | enum class PaintType : uint8_t { |
1160 | Fill, |
1161 | Stroke, |
1162 | Markers |
1163 | }; |
1164 | |
1165 | enum class FontLoadingBehavior : uint8_t { |
1166 | Auto, |
1167 | Block, |
1168 | Swap, |
1169 | Fallback, |
1170 | Optional |
1171 | }; |
1172 | |
1173 | extern const float defaultMiterLimit; |
1174 | |
1175 | } // namespace WebCore |
1176 | |