1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 /* constants used in the style struct data provided by ComputedStyle */
8 
9 #ifndef nsStyleConsts_h___
10 #define nsStyleConsts_h___
11 
12 #include <inttypes.h>
13 
14 #include "X11UndefineNone.h"
15 
16 #include "gfxFontConstants.h"
17 #include "mozilla/ServoStyleConsts.h"
18 
19 // XXX fold this into ComputedStyle and group by nsStyleXXX struct
20 
21 namespace mozilla {
22 
23 static constexpr uint16_t STYLE_DISPLAY_LIST_ITEM_BIT = 0x8000;
24 static constexpr uint8_t STYLE_DISPLAY_OUTSIDE_BITS = 7;
25 static constexpr uint8_t STYLE_DISPLAY_INSIDE_BITS = 8;
26 
27 // The `display` longhand.
StyleDisplayFrom(StyleDisplayOutside aOuter,StyleDisplayInside aInner)28 uint16_t constexpr StyleDisplayFrom(StyleDisplayOutside aOuter,
29                                     StyleDisplayInside aInner) {
30   return uint16_t(uint16_t(aOuter) << STYLE_DISPLAY_INSIDE_BITS) |
31          uint16_t(aInner);
32 }
33 
34 enum class StyleDisplay : uint16_t {
35   // These MUST be in sync with the Rust enum values in
36   // servo/components/style/values/specified/box.rs
37   /// https://drafts.csswg.org/css-display/#the-display-properties
38   None = StyleDisplayFrom(StyleDisplayOutside::None, StyleDisplayInside::None),
39   Contents =
40       StyleDisplayFrom(StyleDisplayOutside::None, StyleDisplayInside::Contents),
41   Inline =
42       StyleDisplayFrom(StyleDisplayOutside::Inline, StyleDisplayInside::Flow),
43   Block =
44       StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::Flow),
45   FlowRoot = StyleDisplayFrom(StyleDisplayOutside::Block,
46                               StyleDisplayInside::FlowRoot),
47   Flex = StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::Flex),
48   Grid = StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::Grid),
49   Table =
50       StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::Table),
51   InlineTable =
52       StyleDisplayFrom(StyleDisplayOutside::Inline, StyleDisplayInside::Table),
53   TableCaption = StyleDisplayFrom(StyleDisplayOutside::TableCaption,
54                                   StyleDisplayInside::Flow),
55   Ruby =
56       StyleDisplayFrom(StyleDisplayOutside::Inline, StyleDisplayInside::Ruby),
57   WebkitBox = StyleDisplayFrom(StyleDisplayOutside::Block,
58                                StyleDisplayInside::WebkitBox),
59   WebkitInlineBox = StyleDisplayFrom(StyleDisplayOutside::Inline,
60                                      StyleDisplayInside::WebkitBox),
61   ListItem = Block | STYLE_DISPLAY_LIST_ITEM_BIT,
62 
63   /// Internal table boxes.
64   TableRowGroup = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
65                                    StyleDisplayInside::TableRowGroup),
66   TableHeaderGroup = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
67                                       StyleDisplayInside::TableHeaderGroup),
68   TableFooterGroup = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
69                                       StyleDisplayInside::TableFooterGroup),
70   TableColumn = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
71                                  StyleDisplayInside::TableColumn),
72   TableColumnGroup = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
73                                       StyleDisplayInside::TableColumnGroup),
74   TableRow = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
75                               StyleDisplayInside::TableRow),
76   TableCell = StyleDisplayFrom(StyleDisplayOutside::InternalTable,
77                                StyleDisplayInside::TableCell),
78 
79   /// Internal ruby boxes.
80   RubyBase = StyleDisplayFrom(StyleDisplayOutside::InternalRuby,
81                               StyleDisplayInside::RubyBase),
82   RubyBaseContainer = StyleDisplayFrom(StyleDisplayOutside::InternalRuby,
83                                        StyleDisplayInside::RubyBaseContainer),
84   RubyText = StyleDisplayFrom(StyleDisplayOutside::InternalRuby,
85                               StyleDisplayInside::RubyText),
86   RubyTextContainer = StyleDisplayFrom(StyleDisplayOutside::InternalRuby,
87                                        StyleDisplayInside::RubyTextContainer),
88 
89   /// XUL boxes.
90   MozBox =
91       StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::MozBox),
92   MozInlineBox =
93       StyleDisplayFrom(StyleDisplayOutside::Inline, StyleDisplayInside::MozBox),
94   MozDeck =
95       StyleDisplayFrom(StyleDisplayOutside::XUL, StyleDisplayInside::MozDeck),
96   MozPopup =
97       StyleDisplayFrom(StyleDisplayOutside::XUL, StyleDisplayInside::MozPopup),
98 };
99 // The order of the StyleDisplay values isn't meaningful.
100 bool operator<(const StyleDisplay&, const StyleDisplay&) = delete;
101 bool operator<=(const StyleDisplay&, const StyleDisplay&) = delete;
102 bool operator>(const StyleDisplay&, const StyleDisplay&) = delete;
103 bool operator>=(const StyleDisplay&, const StyleDisplay&) = delete;
104 
105 // Basic shapes
106 enum class StyleBasicShapeType : uint8_t {
107   Polygon,
108   Circle,
109   Ellipse,
110   Inset,
111 };
112 
113 // box-align
114 enum class StyleBoxAlign : uint8_t {
115   Stretch,
116   Start,
117   Center,
118   Baseline,
119   End,
120 };
121 
122 // box-decoration-break
123 enum class StyleBoxDecorationBreak : uint8_t {
124   Slice,
125   Clone,
126 };
127 
128 // box-direction
129 enum class StyleBoxDirection : uint8_t {
130   Normal,
131   Reverse,
132 };
133 
134 // box-orient
135 enum class StyleBoxOrient : uint8_t {
136   Horizontal,
137   Vertical,
138 };
139 
140 // box-pack
141 enum class StyleBoxPack : uint8_t {
142   Start,
143   Center,
144   End,
145   Justify,
146 };
147 
148 // box-sizing
149 enum class StyleBoxSizing : uint8_t { Content, Border };
150 
151 // box-shadow
152 enum class StyleBoxShadowType : uint8_t {
153   Inset,
154 };
155 
156 // clear
157 enum class StyleClear : uint8_t {
158   None = 0,
159   Left,
160   Right,
161   Both,
162   // StyleClear::Line can be added to one of the other values in layout
163   // so it needs to use a bit value that none of the other values can have.
164   //
165   // FIXME(emilio): Doesn't look like we do that anymore, so probably can be
166   // made a single value instead, and Max removed.
167   Line = 8,
168   Max = 13  // Max = (Both | Line)
169 };
170 
171 enum class StyleColumnFill : uint8_t {
172   Balance,
173   Auto,
174 };
175 
176 enum class StyleColumnSpan : uint8_t {
177   None,
178   All,
179 };
180 
181 // Define geometry box for clip-path's reference-box, background-clip,
182 // background-origin, mask-clip, mask-origin, shape-box and transform-box.
183 enum class StyleGeometryBox : uint8_t {
184   ContentBox,  // Used by everything, except transform-box.
185   PaddingBox,  // Used by everything, except transform-box.
186   BorderBox,
187   MarginBox,  // XXX Bug 1260094 comment 9.
188               // Although margin-box is required by mask-origin and mask-clip,
189               // we do not implement that due to lack of support in other
190               // browsers. clip-path reference-box only.
191   FillBox,    // Used by everything, except shape-box.
192   StrokeBox,  // mask-clip, mask-origin and clip-path reference-box only.
193   ViewBox,    // Used by everything, except shape-box.
194   NoClip,     // mask-clip only.
195   Text,       // background-clip only.
196   NoBox,      // Depending on which kind of element this style value applied on,
197               // the default value of a reference-box can be different.
198               // For an HTML element, the default value of reference-box is
199               // border-box; for an SVG element, the default value is fill-box.
200               // Since we can not determine the default value at parsing time,
201               // set it as NoBox so that we make a decision later.
202               // clip-path reference-box only.
203   MozAlmostPadding = 127  // A magic value that we use for our "pretend that
204                           // background-clip is 'padding' when we have a solid
205                           // border" optimization.  This isn't actually equal
206                           // to StyleGeometryBox::Padding because using that
207                           // causes antialiasing seams between the background
208                           // and border.
209                           // background-clip only.
210 };
211 
212 // float-edge
213 enum class StyleFloatEdge : uint8_t {
214   ContentBox,
215   MarginBox,
216 };
217 
218 // Hyphens
219 enum class StyleHyphens : uint8_t {
220   None,
221   Manual,
222   Auto,
223 };
224 
225 // image-orientation
226 enum class StyleImageOrientation : uint8_t {
227   None,
228   FromImage,
229 };
230 
231 // scrollbar-width
232 enum class StyleScrollbarWidth : uint8_t {
233   Auto,
234   Thin,
235   None,
236 };
237 
238 // Shape source type
239 enum class StyleShapeSourceType : uint8_t {
240   None,
241   Image,  // shape-outside / clip-path only, and clip-path only uses it for
242           // <url>s
243   Shape,
244   Box,
245   Path,  // SVG path function
246 };
247 
248 // user-focus
249 enum class StyleUserFocus : uint8_t {
250   None,
251   Ignore,
252   Normal,
253   SelectAll,
254   SelectBefore,
255   SelectAfter,
256   SelectSame,
257   SelectMenu,
258 };
259 
260 // user-input
261 enum class StyleUserInput : uint8_t {
262   None,
263   Auto,
264 };
265 
266 // user-modify
267 enum class StyleUserModify : uint8_t {
268   ReadOnly,
269   ReadWrite,
270   WriteOnly,
271 };
272 
273 // -moz-inert
274 enum class StyleInert : uint8_t {
275   None,
276   Inert,
277 };
278 
279 // -moz-window-dragging
280 enum class StyleWindowDragging : uint8_t {
281   Default,
282   Drag,
283   NoDrag,
284 };
285 
286 // orient
287 enum class StyleOrient : uint8_t {
288   Inline,
289   Block,
290   Horizontal,
291   Vertical,
292 };
293 
294 // See AnimationEffect.webidl
295 // and mozilla/dom/AnimationEffectBinding.h
296 namespace dom {
297 enum class PlaybackDirection : uint8_t;
298 enum class FillMode : uint8_t;
299 }  // namespace dom
300 
301 // Animation play state
302 enum class StyleAnimationPlayState : uint8_t { Running, Paused };
303 
304 // See nsStyleImageLayers
305 enum class StyleImageLayerAttachment : uint8_t { Scroll, Fixed, Local };
306 
307 // See nsStyleImageLayers
308 enum class StyleImageLayerRepeat : uint8_t {
309   NoRepeat = 0x00,
310   RepeatX,
311   RepeatY,
312   Repeat,
313   Space,
314   Round
315 };
316 
317 // Mask mode
318 enum class StyleMaskMode : uint8_t { Alpha = 0, Luminance, MatchSource };
319 
320 // See nsStyleTable
321 enum class StyleBorderCollapse : uint8_t { Collapse, Separate };
322 
323 // border-image-repeat
324 enum class StyleBorderImageRepeat : uint8_t { Stretch, Repeat, Round, Space };
325 
326 // See nsStyleVisibility
327 enum class StyleDirection : uint8_t { Ltr, Rtl };
328 
329 // See nsStyleVisibility
330 // NOTE: WritingModes.h depends on the particular values used here.
331 
332 // Single-bit flag, used in combination with VerticalLR and RL to specify
333 // the corresponding Sideways* modes.
334 // (To avoid ambiguity, this bit must be high enough such that no other
335 // values here accidentally use it in their binary representation.)
336 static constexpr uint8_t kWritingModeSidewaysMask = 4;
337 
338 enum class StyleWritingModeProperty : uint8_t {
339   HorizontalTb = 0,
340   VerticalRl = 1,
341   // HorizontalBT = 2,    // hypothetical
342   VerticalLr = 3,
343   SidewaysRl = VerticalRl | kWritingModeSidewaysMask,
344   SidewaysLr = VerticalLr | kWritingModeSidewaysMask,
345 };
346 
347 // See nsStylePosition
348 enum class StyleFlexDirection : uint8_t {
349   Row,
350   RowReverse,
351   Column,
352   ColumnReverse,
353 };
354 
355 // See nsStylePosition
356 enum class StyleFlexWrap : uint8_t {
357   Nowrap,
358   Wrap,
359   WrapReverse,
360 };
361 
362 // See nsStylePosition
363 // NOTE: This is the initial value of the integer-valued 'order' property
364 // (rather than an internal numerical representation of some keyword).
365 #define NS_STYLE_ORDER_INITIAL 0
366 
367 #define NS_STYLE_MASONRY_PLACEMENT_PACK (1 << 0)
368 #define NS_STYLE_MASONRY_ORDER_DEFINITE_FIRST (1 << 1)
369 #define NS_STYLE_MASONRY_AUTO_FLOW_INITIAL_VALUE \
370   (NS_STYLE_MASONRY_PLACEMENT_PACK | NS_STYLE_MASONRY_ORDER_DEFINITE_FIRST)
371 
372 // 'subgrid' keyword in grid-template-{columns,rows}
373 #define NS_STYLE_GRID_TEMPLATE_SUBGRID 0
374 
375 // CSS Grid <track-breadth> keywords
376 // Should not overlap with NS_STYLE_GRID_TEMPLATE_SUBGRID
377 enum class StyleGridTrackBreadth : uint8_t {
378   MaxContent = 1,
379   MinContent = 2,
380 };
381 
382 // defaults per MathML spec
383 #define NS_MATHML_DEFAULT_SCRIPT_SIZE_MULTIPLIER 0.71f
384 #define NS_MATHML_DEFAULT_SCRIPT_MIN_SIZE_PT 8
385 
386 // See nsStyleFont
387 enum class StyleMathVariant : uint8_t {
388   None = 0,
389   Normal = 1,
390   Bold = 2,
391   Italic = 3,
392   BoldItalic = 4,
393   Script = 5,
394   BoldScript = 6,
395   Fraktur = 7,
396   DoubleStruck = 8,
397   BoldFraktur = 9,
398   SansSerif = 10,
399   BoldSansSerif = 11,
400   SansSerifItalic = 12,
401   SansSerifBoldItalic = 13,
402   Monospace = 14,
403   Initial = 15,
404   Tailed = 16,
405   Looped = 17,
406   Stretched = 18,
407 };
408 
409 // See nsStyleFont::mMathStyle
410 #define NS_STYLE_MATH_STYLE_COMPACT 0
411 #define NS_STYLE_MATH_STYLE_NORMAL 1
412 
413 // See nsStyleDisplay.mPosition
414 enum class StylePositionProperty : uint8_t {
415   Static,
416   Relative,
417   Absolute,
418   Fixed,
419   Sticky,
420 };
421 
422 // See nsStyleEffects.mClip, mClipFlags
423 #define NS_STYLE_CLIP_AUTO 0x00
424 #define NS_STYLE_CLIP_RECT 0x01
425 #define NS_STYLE_CLIP_TYPE_MASK 0x0F
426 #define NS_STYLE_CLIP_LEFT_AUTO 0x10
427 #define NS_STYLE_CLIP_TOP_AUTO 0x20
428 #define NS_STYLE_CLIP_RIGHT_AUTO 0x40
429 #define NS_STYLE_CLIP_BOTTOM_AUTO 0x80
430 
431 // FRAME/FRAMESET/IFRAME specific values including backward compatibility.
432 // Boolean values with the same meaning (e.g. 1 & yes) may need to be
433 // distinguished for correct mode processing
434 #define NS_STYLE_FRAME_YES 0
435 #define NS_STYLE_FRAME_NO 1
436 #define NS_STYLE_FRAME_0 2
437 #define NS_STYLE_FRAME_1 3
438 #define NS_STYLE_FRAME_ON 4
439 #define NS_STYLE_FRAME_OFF 5
440 #define NS_STYLE_FRAME_AUTO 6
441 #define NS_STYLE_FRAME_SCROLL 7
442 #define NS_STYLE_FRAME_NOSCROLL 8
443 
444 // See nsStyleList
445 #define NS_STYLE_LIST_STYLE_CUSTOM -1  // for @counter-style
446 #define NS_STYLE_LIST_STYLE_NONE 0
447 #define NS_STYLE_LIST_STYLE_DECIMAL 1
448 #define NS_STYLE_LIST_STYLE_DISC 2
449 #define NS_STYLE_LIST_STYLE_CIRCLE 3
450 #define NS_STYLE_LIST_STYLE_SQUARE 4
451 #define NS_STYLE_LIST_STYLE_DISCLOSURE_CLOSED 5
452 #define NS_STYLE_LIST_STYLE_DISCLOSURE_OPEN 6
453 #define NS_STYLE_LIST_STYLE_HEBREW 7
454 #define NS_STYLE_LIST_STYLE_JAPANESE_INFORMAL 8
455 #define NS_STYLE_LIST_STYLE_JAPANESE_FORMAL 9
456 #define NS_STYLE_LIST_STYLE_KOREAN_HANGUL_FORMAL 10
457 #define NS_STYLE_LIST_STYLE_KOREAN_HANJA_INFORMAL 11
458 #define NS_STYLE_LIST_STYLE_KOREAN_HANJA_FORMAL 12
459 #define NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL 13
460 #define NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL 14
461 #define NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL 15
462 #define NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL 16
463 #define NS_STYLE_LIST_STYLE_ETHIOPIC_NUMERIC 17
464 // These styles are handled as custom styles defined in counterstyles.css.
465 // They are preserved here only for html attribute map.
466 #define NS_STYLE_LIST_STYLE_LOWER_ROMAN 100
467 #define NS_STYLE_LIST_STYLE_UPPER_ROMAN 101
468 #define NS_STYLE_LIST_STYLE_LOWER_ALPHA 102
469 #define NS_STYLE_LIST_STYLE_UPPER_ALPHA 103
470 
471 // See nsStyleList
472 #define NS_STYLE_LIST_STYLE_POSITION_INSIDE 0
473 #define NS_STYLE_LIST_STYLE_POSITION_OUTSIDE 1
474 
475 // See nsStyleVisibility
476 enum class StylePointerEvents : uint8_t {
477   None,
478   Visiblepainted,
479   Visiblefill,
480   Visiblestroke,
481   Visible,
482   Painted,
483   Fill,
484   Stroke,
485   All,
486   Auto,
487 };
488 
489 enum class StyleIsolation : uint8_t {
490   Auto,
491   Isolate,
492 };
493 
494 // See nsStylePosition.mObjectFit
495 enum class StyleObjectFit : uint8_t {
496   Fill,
497   Contain,
498   Cover,
499   None,
500   ScaleDown,
501 };
502 
503 // See nsStyleText
504 #define NS_STYLE_TEXT_DECORATION_STYLE_NONE \
505   0  // not in CSS spec, mapped to -moz-none
506 #define NS_STYLE_TEXT_DECORATION_STYLE_DOTTED 1
507 #define NS_STYLE_TEXT_DECORATION_STYLE_DASHED 2
508 #define NS_STYLE_TEXT_DECORATION_STYLE_SOLID 3
509 #define NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE 4
510 #define NS_STYLE_TEXT_DECORATION_STYLE_WAVY 5
511 #define NS_STYLE_TEXT_DECORATION_STYLE_MAX NS_STYLE_TEXT_DECORATION_STYLE_WAVY
512 
513 // See nsStyleText
514 #define NS_STYLE_TEXT_TRANSFORM_NONE 0
515 #define NS_STYLE_TEXT_TRANSFORM_CAPITALIZE 1
516 #define NS_STYLE_TEXT_TRANSFORM_LOWERCASE 2
517 #define NS_STYLE_TEXT_TRANSFORM_UPPERCASE 3
518 #define NS_STYLE_TEXT_TRANSFORM_FULL_WIDTH 4
519 #define NS_STYLE_TEXT_TRANSFORM_FULL_SIZE_KANA 5
520 
521 // See nsStyleDisplay
522 enum class StyleTopLayer : uint8_t {
523   None,
524   Top,
525 };
526 
527 // See nsStyleVisibility
528 enum class StyleVisibility : uint8_t {
529   Hidden,
530   Visible,
531   Collapse,
532 };
533 
534 // See nsStyleText
535 #define NS_STYLE_TABSIZE_INITIAL 8
536 
537 // See nsStyleText
538 enum class StyleWhiteSpace : uint8_t {
539   Normal = 0,
540   Pre,
541   Nowrap,
542   PreWrap,
543   PreLine,
544   PreSpace,
545   BreakSpaces,
546 };
547 
548 // ruby-align, see nsStyleText
549 enum class StyleRubyAlign : uint8_t {
550   Start,
551   Center,
552   SpaceBetween,
553   SpaceAround,
554 };
555 
556 // See nsStyleText
557 enum class StyleTextSizeAdjust : uint8_t {
558   None,
559   Auto,
560 };
561 
562 // See nsStyleText
563 enum class StyleTextOrientation : uint8_t {
564   Mixed,
565   Upright,
566   Sideways,
567 };
568 
569 // See nsStyleText
570 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE 0
571 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL 1
572 
573 // See nsStyleText
574 #define NS_STYLE_UNICODE_BIDI_NORMAL 0x0
575 #define NS_STYLE_UNICODE_BIDI_EMBED 0x1
576 #define NS_STYLE_UNICODE_BIDI_ISOLATE 0x2
577 #define NS_STYLE_UNICODE_BIDI_BIDI_OVERRIDE 0x4
578 #define NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE 0x6
579 #define NS_STYLE_UNICODE_BIDI_PLAINTEXT 0x8
580 
581 enum class StyleTableLayout : uint8_t {
582   Auto,
583   Fixed,
584 };
585 
586 enum class StyleEmptyCells : uint8_t {
587   Hide,
588   Show,
589 };
590 
591 // constants for cell "scope" attribute
592 #define NS_STYLE_CELL_SCOPE_ROW 0
593 #define NS_STYLE_CELL_SCOPE_COL 1
594 #define NS_STYLE_CELL_SCOPE_ROWGROUP 2
595 #define NS_STYLE_CELL_SCOPE_COLGROUP 3
596 
597 // See nsStylePage
598 #define NS_STYLE_PAGE_MARKS_NONE 0x00
599 #define NS_STYLE_PAGE_MARKS_CROP 0x01
600 #define NS_STYLE_PAGE_MARKS_REGISTER 0x02
601 
602 // See nsStylePage
603 #define NS_STYLE_PAGE_SIZE_AUTO 0
604 #define NS_STYLE_PAGE_SIZE_PORTRAIT 1
605 #define NS_STYLE_PAGE_SIZE_LANDSCAPE 2
606 
607 // See nsStyleBreaks
608 #define NS_STYLE_PAGE_BREAK_AUTO 0
609 #define NS_STYLE_PAGE_BREAK_ALWAYS 1
610 #define NS_STYLE_PAGE_BREAK_AVOID 2
611 #define NS_STYLE_PAGE_BREAK_LEFT 3
612 #define NS_STYLE_PAGE_BREAK_RIGHT 4
613 
614 // See nsStyleUIReset
615 enum class StyleImeMode : uint8_t {
616   Auto,
617   Normal,
618   Active,
619   Disabled,
620   Inactive,
621 };
622 
623 // See nsStyleSVG
624 
625 /*
626  * -moz-window-shadow
627  * Also used in widget code
628  */
629 enum class StyleWindowShadow : uint8_t {
630   None,
631   Default,
632   Menu,
633   Tooltip,
634   Sheet,
635   Cliprounded,  // clip border to popup border-radius
636 };
637 
638 // dominant-baseline
639 enum class StyleDominantBaseline : uint8_t {
640   Auto,
641   Ideographic,
642   Alphabetic,
643   Hanging,
644   Mathematical,
645   Central,
646   Middle,
647   TextAfterEdge,
648   TextBeforeEdge,
649 };
650 
651 // mask-type
652 enum class StyleMaskType : uint8_t {
653   Luminance,
654   Alpha,
655 };
656 
657 // shape-rendering
658 enum class StyleShapeRendering : uint8_t {
659   Auto,
660   Optimizespeed,
661   Crispedges,
662   Geometricprecision,
663 };
664 
665 // stroke-linecap
666 enum class StyleStrokeLinecap : uint8_t {
667   Butt,
668   Round,
669   Square,
670 };
671 
672 // stroke-linejoin
673 enum class StyleStrokeLinejoin : uint8_t {
674   Miter,
675   Round,
676   Bevel,
677 };
678 
679 // text-anchor
680 enum class StyleTextAnchor : uint8_t {
681   Start,
682   Middle,
683   End,
684 };
685 
686 // text-emphasis-position
687 #define NS_STYLE_TEXT_EMPHASIS_POSITION_OVER (1 << 0)
688 #define NS_STYLE_TEXT_EMPHASIS_POSITION_UNDER (1 << 1)
689 #define NS_STYLE_TEXT_EMPHASIS_POSITION_LEFT (1 << 2)
690 #define NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT (1 << 3)
691 #define NS_STYLE_TEXT_EMPHASIS_POSITION_DEFAULT \
692   (NS_STYLE_TEXT_EMPHASIS_POSITION_OVER | NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT)
693 #define NS_STYLE_TEXT_EMPHASIS_POSITION_DEFAULT_ZH \
694   (NS_STYLE_TEXT_EMPHASIS_POSITION_UNDER |         \
695    NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT)
696 
697 // text-rendering
698 enum class StyleTextRendering : uint8_t {
699   Auto,
700   Optimizespeed,
701   Optimizelegibility,
702   Geometricprecision,
703 };
704 
705 // color-interpolation and color-interpolation-filters
706 enum class StyleColorInterpolation : uint8_t {
707   Auto = 0,
708   Srgb = 1,
709   Linearrgb = 2,
710 };
711 
712 // vector-effect
713 enum class StyleVectorEffect : uint8_t { None = 0, NonScalingStroke = 1 };
714 
715 // 3d Transforms - Backface visibility
716 enum class StyleBackfaceVisibility : uint8_t { Hidden = 0, Visible = 1 };
717 
718 // blending
719 enum class StyleBlend : uint8_t {
720   Normal = 0,
721   Multiply,
722   Screen,
723   Overlay,
724   Darken,
725   Lighten,
726   ColorDodge,
727   ColorBurn,
728   HardLight,
729   SoftLight,
730   Difference,
731   Exclusion,
732   Hue,
733   Saturation,
734   Color,
735   Luminosity,
736   PlusLighter,
737 };
738 
739 // composite
740 enum class StyleMaskComposite : uint8_t {
741   Add = 0,
742   Subtract,
743   Intersect,
744   Exclude
745 };
746 
747 // scroll-behavior
748 enum class StyleScrollBehavior : uint8_t {
749   Auto,
750   Smooth,
751 };
752 
753 }  // namespace mozilla
754 
755 #endif /* nsStyleConsts_h___ */
756