Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5
// See the comment in ServoBindings.h about the same.
6
#pragma GCC diagnostic push
7
#ifdef __clang__
8
# pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
9
#endif
10
11
#ifndef mozilla_ServoStyleConsts_h
12
#define mozilla_ServoStyleConsts_h
13
14
/* Generated with cbindgen:0.9.1 */
15
16
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
17
* To generate this file:
18
* 1. Get the latest cbindgen using `cargo install --force cbindgen`
19
* a. Alternatively, you can clone `https://github.com/eqrion/cbindgen` and use a tagged release
20
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --lockfile Cargo.lock --crate style -o layout/style/ServoStyleConsts.h`
21
*/
22
23
24
#include <cstdarg>
25
#include <cstdint>
26
#include <cstdlib>
27
#include <new>
28
#include "mozilla/ServoStyleConstsForwards.h"
29
30
namespace mozilla {
31
32
static const float StyleDEFAULT_FONT_STYLE_OBLIQUE_ANGLE_DEGREES = 14.;
33
34
#if defined(CBINDGEN_IS_SERVO)
35
static const uintptr_t StyleEAGER_PSEUDO_COUNT = 3;
36
#endif
37
38
static const int32_t StyleFONT_MEDIUM_PX = 16;
39
40
static const float StyleFONT_STYLE_OBLIQUE_MAX_ANGLE_DEGREES = 90.;
41
42
static const float StyleFONT_STYLE_OBLIQUE_MIN_ANGLE_DEGREES = -90.;
43
44
static const float StyleMAX_FONT_WEIGHT = 1000.;
45
46
static const int32_t StyleMAX_GRID_LINE = 10000;
47
48
static const float StyleMIN_FONT_WEIGHT = 1.;
49
50
static const int32_t StyleMIN_GRID_LINE = -10000;
51
52
static const uint8_t StylePAINT_ORDER_COUNT = 3;
53
54
static const uint8_t StylePAINT_ORDER_MASK = 3;
55
56
static const uint8_t StylePAINT_ORDER_SHIFT = 2;
57
58
static const uintptr_t StyleSHARING_CACHE_SIZE = 31;
59
60
static const uintptr_t StyleSTACK_SAFETY_MARGIN_KB = 168;
61
62
static const uintptr_t StyleSTYLE_THREAD_STACK_SIZE_KB = 256;
63
64
static const uintptr_t StyleWORK_UNIT_MAX = 16;
65
66
/// Whether to allow negative lengths or not.
67
enum class StyleAllowedNumericType : uint8_t {
68
/// Allow all kind of numeric values.
69
All,
70
/// Allow only non-negative numeric values.
71
NonNegative,
72
/// Allow only numeric values greater or equal to 1.0.
73
AtLeastOne,
74
};
75
76
/// The value for the `appearance` property.
77
///
79
enum class StyleAppearance : uint8_t {
80
/// No appearance at all.
81
None,
82
/// A typical dialog button.
83
Button,
84
/// Various arrows that go in buttons
85
ButtonArrowDown,
86
ButtonArrowNext,
87
ButtonArrowPrevious,
88
ButtonArrowUp,
89
/// A rectangular button that contains complex content
90
/// like images (e.g. HTML <button> elements)
91
ButtonBevel,
92
/// The focus outline box inside of a button.
93
ButtonFocus,
94
/// The caret of a text area
95
Caret,
96
/// A dual toolbar button (e.g., a Back button with a dropdown)
97
Dualbutton,
98
/// A groupbox.
99
Groupbox,
100
/// A inner-spin button.
101
InnerSpinButton,
102
/// List boxes.
103
Listbox,
104
/// A listbox item.
105
Listitem,
106
/// Menu Bar background
107
Menubar,
108
/// <menu> and <menuitem> appearances
109
Menuitem,
110
Checkmenuitem,
111
Radiomenuitem,
112
/// For text on non-iconic menuitems only
113
Menuitemtext,
114
/// A dropdown list.
115
Menulist,
116
/// The dropdown button(s) that open up a dropdown list.
117
MenulistButton,
118
/// The text part of a dropdown list, to left of button.
119
MenulistText,
120
/// An editable textfield with a dropdown list (a combobox).
121
MenulistTextfield,
122
/// Menu Popup background.
123
Menupopup,
124
/// menu checkbox/radio appearances
125
Menucheckbox,
126
Menuradio,
127
Menuseparator,
128
Menuarrow,
129
/// An image in the menu gutter, like in bookmarks or history.
130
Menuimage,
131
/// A horizontal meter bar.
132
Meter,
133
/// The meter bar's meter indicator.
134
Meterchunk,
135
/// The "arrowed" part of the dropdown button that open up a dropdown list.
136
MozMenulistButton,
137
/// For HTML's <input type=number>
138
NumberInput,
139
/// A horizontal progress bar.
140
ProgressBar,
141
/// The progress bar's progress indicator
142
Progresschunk,
143
/// A vertical progress bar.
144
ProgressbarVertical,
145
/// A checkbox element.
146
Checkbox,
147
/// A radio element within a radio group.
148
Radio,
149
/// A generic container that always repaints on state changes. This is a
150
/// hack to make XUL checkboxes and radio buttons work.
151
CheckboxContainer,
152
RadioContainer,
153
/// The label part of a checkbox or radio button, used for painting a focus
154
/// outline.
155
CheckboxLabel,
156
RadioLabel,
157
/// nsRangeFrame and its subparts
158
Range,
159
RangeThumb,
160
/// The resizer background area in a status bar for the resizer widget in
161
/// the corner of a window.
162
Resizerpanel,
163
/// The resizer itself.
164
Resizer,
165
/// A slider.
166
ScaleHorizontal,
167
ScaleVertical,
168
/// A slider's thumb.
169
ScalethumbHorizontal,
170
ScalethumbVertical,
171
/// If the platform supports it, the left/right chunks of the slider thumb.
172
Scalethumbstart,
173
Scalethumbend,
174
/// The ticks for a slider.
175
Scalethumbtick,
176
/// A scrollbar.
177
Scrollbar,
178
/// A small scrollbar.
179
ScrollbarSmall,
180
/// The scrollbar slider
181
ScrollbarHorizontal,
182
ScrollbarVertical,
183
/// A scrollbar button (up/down/left/right).
184
/// Keep these in order (some code casts these values to `int` in order to
185
/// compare them against each other).
186
ScrollbarbuttonUp,
187
ScrollbarbuttonDown,
188
ScrollbarbuttonLeft,
189
ScrollbarbuttonRight,
190
/// The scrollbar thumb.
191
ScrollbarthumbHorizontal,
192
ScrollbarthumbVertical,
193
/// The scrollbar track.
194
ScrollbartrackHorizontal,
195
ScrollbartrackVertical,
196
/// The scroll corner
197
Scrollcorner,
198
/// A searchfield.
199
Searchfield,
200
/// A separator. Can be horizontal or vertical.
201
Separator,
202
/// A spin control (up/down control for time/date pickers).
203
Spinner,
204
/// The up button of a spin control.
205
SpinnerUpbutton,
206
/// The down button of a spin control.
207
SpinnerDownbutton,
208
/// The textfield of a spin control
209
SpinnerTextfield,
210
/// A splitter. Can be horizontal or vertical.
211
Splitter,
212
/// A status bar in a main application window.
213
Statusbar,
214
/// A single pane of a status bar.
215
Statusbarpanel,
216
/// A single tab in a tab widget.
217
Tab,
218
/// A single pane (inside the tabpanels container).
219
Tabpanel,
220
/// The tab panels container.
221
Tabpanels,
222
/// The tabs scroll arrows (left/right).
223
TabScrollArrowBack,
224
TabScrollArrowForward,
225
/// A multi-line text field, e.g. HTML <textarea>.
226
Textarea,
227
/// A single-line text field, e.g. HTML <input type=text>.
228
Textfield,
229
/// A toolbar in an application window.
230
Toolbar,
231
/// A single toolbar button (with no associated dropdown).
232
Toolbarbutton,
233
/// The dropdown portion of a toolbar button
234
ToolbarbuttonDropdown,
235
/// The gripper for a toolbar.
236
Toolbargripper,
237
/// The toolbox that contains the toolbars.
238
Toolbox,
239
/// A tooltip.
240
Tooltip,
241
/// A listbox or tree widget header
242
Treeheader,
243
/// An individual header cell
244
Treeheadercell,
245
/// The sort arrow for a header.
246
Treeheadersortarrow,
247
/// A tree item.
248
Treeitem,
249
/// A tree widget branch line
250
Treeline,
251
/// A tree widget twisty.
252
Treetwisty,
253
/// Open tree widget twisty.
254
Treetwistyopen,
255
/// A tree widget.
256
Treeview,
257
/// Window and dialog backgrounds.
258
Window,
259
Dialog,
260
/// Vista Rebars.
261
MozWinCommunicationsToolbox,
262
MozWinMediaToolbox,
263
MozWinBrowsertabbarToolbox,
264
/// Vista glass.
265
MozWinGlass,
266
MozWinBorderlessGlass,
267
/// -moz-apperance style used in setting proper glass margins.
268
MozWinExcludeGlass,
269
/// Titlebar elements on the Mac.
270
MozMacFullscreenButton,
271
/// Mac help button.
272
MozMacHelpButton,
273
/// Windows themed window frame elements.
274
MozWindowButtonBox,
275
MozWindowButtonBoxMaximized,
276
MozWindowButtonClose,
277
MozWindowButtonMaximize,
278
MozWindowButtonMinimize,
279
MozWindowButtonRestore,
280
MozWindowFrameBottom,
281
MozWindowFrameLeft,
282
MozWindowFrameRight,
283
MozWindowTitlebar,
284
MozWindowTitlebarMaximized,
285
MozGtkInfoBar,
286
MozMacActiveSourceListSelection,
287
MozMacDisclosureButtonClosed,
288
MozMacDisclosureButtonOpen,
289
MozMacSourceList,
290
MozMacSourceListSelection,
291
MozMacVibrancyDark,
292
MozMacVibrancyLight,
293
MozMacVibrantTitlebarDark,
294
MozMacVibrantTitlebarLight,
295
/// A non-disappearing scrollbar.
296
ScrollbarNonDisappearing,
297
/// A themed focus outline (for outline:auto).
298
///
299
/// This isn't exposed to CSS at all, just here for convenience.
300
FocusOutline,
301
/// A dummy variant that should be last to let the GTK widget do hackery.
302
Count,
303
};
304
305
/// A specified value for a single side of a `border-style` property.
306
///
307
/// The order here corresponds to the integer values from the border conflict
308
/// resolution rules in CSS 2.1 § 17.6.2.1. Higher values override lower values.
309
enum class StyleBorderStyle : uint8_t {
310
Hidden,
311
None,
312
Inset,
313
Groove,
314
Outset,
315
Ridge,
316
Dotted,
317
Dashed,
318
Solid,
319
Double,
320
};
321
322
/// A kind of break between two boxes.
323
///
325
enum class StyleBreakBetween : uint8_t {
326
Always,
327
Auto,
328
Page,
329
Avoid,
330
Left,
331
Right,
332
};
333
334
/// A kind of break within a box.
335
///
337
enum class StyleBreakWithin : uint8_t {
338
Auto,
339
Avoid,
340
};
341
342
/// The CORS mode used for a CSS load.
343
enum class StyleCorsMode : uint8_t {
344
/// No CORS mode, so cross-origin loads can be done.
345
None,
346
/// Anonymous CORS request.
347
Anonymous,
348
};
349
350
/// The keywords allowed in the Cursor property.
351
///
353
enum class StyleCursorKind : uint8_t {
354
None,
355
Default,
356
Pointer,
357
ContextMenu,
358
Help,
359
Progress,
360
Wait,
361
Cell,
362
Crosshair,
363
Text,
364
VerticalText,
365
Alias,
366
Copy,
367
Move,
368
NoDrop,
369
NotAllowed,
370
Grab,
371
Grabbing,
372
EResize,
373
NResize,
374
NeResize,
375
NwResize,
376
SResize,
377
SeResize,
378
SwResize,
379
WResize,
380
EwResize,
381
NsResize,
382
NeswResize,
383
NwseResize,
384
ColResize,
385
RowResize,
386
AllScroll,
387
ZoomIn,
388
ZoomOut,
389
Auto,
390
};
391
392
enum class StyleDisplayInside : uint8_t {
393
None = 0,
394
Contents,
395
Block,
396
FlowRoot,
397
Inline,
398
Flex,
399
Grid,
400
Table,
401
TableRowGroup,
402
TableColumn,
403
TableColumnGroup,
404
TableHeaderGroup,
405
TableFooterGroup,
406
TableRow,
407
TableCell,
408
Ruby,
409
RubyBase,
410
RubyBaseContainer,
411
RubyText,
412
RubyTextContainer,
413
WebkitBox,
414
MozBox,
415
MozInlineBox,
416
MozGrid,
417
MozGridGroup,
418
MozGridLine,
419
MozStack,
420
MozDeck,
421
MozGroupbox,
422
MozPopup,
423
Flow,
424
};
425
426
/// Values for the display-mode media feature.
427
enum class StyleDisplayMode : uint8_t {
428
Browser = 0,
429
MinimalUi,
430
Standalone,
431
Fullscreen,
432
};
433
434
/// Defines an element’s display type, which consists of
435
/// the two basic qualities of how an element generates boxes
437
enum class StyleDisplayOutside : uint8_t {
438
None = 0,
439
Inline,
440
Block,
441
TableCaption,
442
InternalTable,
443
InternalRuby,
444
XUL,
445
};
446
447
/// A type for possible values for min- and max- flavors of width, height,
448
/// block-size, and inline-size.
449
enum class StyleExtremumLength : uint8_t {
450
MaxContent,
451
MinContent,
452
MozFitContent,
453
MozAvailable,
454
};
455
456
enum class StyleFillRule : uint8_t {
457
Nonzero,
458
Evenodd,
459
};
460
461
/// A computed value for the `float` property.
462
enum class StyleFloat : uint8_t {
463
Left,
464
Right,
465
None,
466
};
467
468
/// A font-display value for a @font-face rule.
469
/// The font-display descriptor determines how a font face is displayed based
470
/// on whether and when it is downloaded and ready to use.
471
enum class StyleFontDisplay : uint8_t {
472
Auto,
473
Block,
474
Swap,
475
Fallback,
476
Optional,
477
};
478
479
/// Font family names must either be given quoted as strings,
480
/// or unquoted as a sequence of one or more identifiers.
481
enum class StyleFontFamilyNameSyntax : uint8_t {
482
/// The family name was specified in a quoted form, e.g. "Font Name"
483
/// or 'Font Name'.
484
Quoted,
485
/// The family name was specified in an unquoted form as a sequence of
486
/// identifiers.
487
Identifiers,
488
};
489
490
/// A generic font-family name.
491
///
492
/// The order here is important, if you change it make sure that
493
/// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s
494
/// sSingleGenerics are updated as well.
495
enum class StyleGenericFontFamily : uint8_t {
496
/// No generic family specified, only for internal usage.
497
None,
498
Serif,
499
SansSerif,
500
Monospace,
501
Cursive,
502
Fantasy,
503
/// An internal value for emoji font selection.
504
MozEmoji,
505
};
506
507
/// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes.
508
enum class StyleGradientCompatMode : uint8_t {
509
/// Modern syntax.
510
Modern,
511
/// `-webkit` prefix.
512
WebKit,
513
/// `-moz` prefix
514
Moz,
515
};
516
517
/// A keyword for the X direction.
518
enum class StyleHorizontalPositionKeyword : uint8_t {
519
Left,
520
Right,
521
};
522
523
/// The path command absolute type.
524
enum class StyleIsAbsolute : uint8_t {
525
Yes,
526
No,
527
};
528
529
enum class StyleIsOrdinalInRange : uint8_t {
530
Auto,
531
InRange,
532
NotInRange,
533
NoOrdinalSpecified,
534
};
535
536
/// Values for the `line-break` property.
537
enum class StyleLineBreak : uint8_t {
538
Auto,
539
Loose,
540
Normal,
541
Strict,
542
Anywhere,
543
};
544
545
/// Specified and computed `-moz-list-reversed` property (for UA sheets only).
546
enum class StyleMozListReversed : uint8_t {
547
/// the initial value
548
False,
549
/// exclusively used for <ol reversed> in our html.css UA sheet
550
True,
551
};
552
553
/// Each style rule has an origin, which determines where it enters the cascade.
554
///
556
enum class StyleOrigin : uint8_t {
558
UserAgent = 1,
560
User = 2,
562
Author = 4,
563
};
564
565
/// The value for the `overflow-x` / `overflow-y` properties.
566
enum class StyleOverflow : uint8_t {
567
Visible,
568
Hidden,
569
Scroll,
570
Auto,
571
MozHiddenUnscrollable,
572
};
573
574
enum class StyleOverflowAnchor : uint8_t {
575
Auto,
576
None,
577
};
578
579
enum class StyleOverflowClipBox : uint8_t {
580
PaddingBox,
581
ContentBox,
582
};
583
584
/// Values for the `overflow-wrap` property.
585
enum class StyleOverflowWrap : uint8_t {
586
Normal,
587
BreakWord,
588
Anywhere,
589
};
590
591
enum class StyleOverscrollBehavior : uint8_t {
592
Auto,
593
Contain,
594
None,
595
};
596
597
/// The specified value for a single CSS paint-order property.
598
enum class StylePaintOrder : uint8_t {
599
/// `normal` variant
600
Normal = 0,
601
/// `fill` variant
602
Fill = 1,
603
/// `stroke` variant
604
Stroke = 2,
605
/// `markers` variant
606
Markers = 3,
607
};
608
609
/// Values for the prefers-color-scheme media feature.
610
enum class StylePrefersColorScheme : uint8_t {
611
Light,
612
Dark,
613
NoPreference,
614
};
615
616
/// The <size> in ray() function.
617
///
619
enum class StyleRaySize : uint8_t {
620
ClosestSide,
621
ClosestCorner,
622
FarthestSide,
623
FarthestCorner,
624
Sides,
625
};
626
627
/// A computed value for the `resize` property.
628
enum class StyleResize : uint8_t {
629
None,
630
Both,
631
Horizontal,
632
Vertical,
633
};
634
635
/// Specified value of scroll-snap-align keyword value.
636
enum class StyleScrollSnapAlignKeyword : uint8_t {
637
None,
638
Start,
639
End,
640
Center,
641
};
642
644
enum class StyleScrollSnapAxis : uint8_t {
645
X,
646
Y,
647
Block,
648
Inline,
649
Both,
650
};
651
653
enum class StyleScrollSnapStrictness : uint8_t {
654
None,
655
Mandatory,
656
Proximity,
657
};
658
660
enum class StyleShapeExtent : uint8_t {
661
ClosestSide,
662
FarthestSide,
663
ClosestCorner,
664
FarthestCorner,
665
Contain,
666
Cover,
667
};
668
669
enum class StyleStepPosition : uint8_t {
670
JumpStart,
671
JumpEnd,
672
JumpNone,
673
JumpBoth,
674
Start,
675
End,
676
};
677
678
/// System colors.
679
enum class StyleSystemColor : uint8_t {
680
WindowBackground,
681
WindowForeground,
682
WidgetBackground,
683
WidgetForeground,
684
WidgetSelectBackground,
685
WidgetSelectForeground,
686
Widget3DHighlight,
687
Widget3DShadow,
688
TextBackground,
689
TextForeground,
690
TextSelectBackground,
691
TextSelectForeground,
692
TextSelectForegroundCustom,
693
TextSelectBackgroundDisabled,
694
TextSelectBackgroundAttention,
695
TextHighlightBackground,
696
TextHighlightForeground,
697
IMERawInputBackground,
698
IMERawInputForeground,
699
IMERawInputUnderline,
700
IMESelectedRawTextBackground,
701
IMESelectedRawTextForeground,
702
IMESelectedRawTextUnderline,
703
IMEConvertedTextBackground,
704
IMEConvertedTextForeground,
705
IMEConvertedTextUnderline,
706
IMESelectedConvertedTextBackground,
707
IMESelectedConvertedTextForeground,
708
IMESelectedConvertedTextUnderline,
709
SpellCheckerUnderline,
710
Activeborder,
711
Activecaption,
712
Appworkspace,
713
Background,
714
Buttonface,
715
Buttonhighlight,
716
Buttonshadow,
717
Buttontext,
718
Captiontext,
719
Graytext,
720
Highlight,
721
Highlighttext,
722
Inactiveborder,
723
Inactivecaption,
724
Inactivecaptiontext,
725
Infobackground,
726
Infotext,
727
Menu,
728
Menutext,
729
Scrollbar,
730
Threeddarkshadow,
731
Threedface,
732
Threedhighlight,
733
Threedlightshadow,
734
Threedshadow,
735
Window,
736
Windowframe,
737
Windowtext,
738
MozButtondefault,
739
MozField,
740
MozFieldtext,
741
MozDialog,
742
MozDialogtext,
743
/// Used to highlight valid regions to drop something onto.
744
MozDragtargetzone,
745
/// Used for selected but not focused cell backgrounds.
746
MozCellhighlight,
747
/// Used for selected but not focused cell text.
748
MozCellhighlighttext,
749
/// Used for selected but not focused html cell backgrounds.
750
MozHtmlCellhighlight,
751
/// Used for selected but not focused html cell text.
752
MozHtmlCellhighlighttext,
753
/// Used to button text background when hovered.
754
MozButtonhoverface,
755
/// Used to button text color when hovered.
756
MozButtonhovertext,
757
/// Used for menu item backgrounds when hovered.
758
MozMenuhover,
759
/// Used for menu item text when hovered.
760
MozMenuhovertext,
761
/// Used for menubar item text.
762
MozMenubartext,
763
/// Used for menubar item text when hovered.
764
MozMenubarhovertext,
765
/// On platforms where these colors are the same as -moz-field, use
766
/// -moz-fieldtext as foreground color
767
MozEventreerow,
768
MozOddtreerow,
769
/// Used for button text when pressed.
770
MozGtkButtonactivetext,
771
/// Used for button text when pressed.
772
MozMacButtonactivetext,
773
/// Background color of chrome toolbars in active windows.
774
MozMacChromeActive,
775
/// Background color of chrome toolbars in inactive windows.
776
MozMacChromeInactive,
777
/// Foreground color of default buttons.
778
MozMacDefaultbuttontext,
779
/// Ring color around text fields and lists.
780
MozMacFocusring,
781
/// Color used when mouse is over a menu item.
782
MozMacMenuselect,
783
/// Color used to do shadows on menu items.
784
MozMacMenushadow,
785
/// Color used to display text for disabled menu items.
786
MozMacMenutextdisable,
787
/// Color used to display text while mouse is over a menu item.
788
MozMacMenutextselect,
789
/// Text color of disabled text on toolbars.
790
MozMacDisabledtoolbartext,
791
/// Inactive light hightlight
792
MozMacSecondaryhighlight,
793
/// Font smoothing background colors needed by the Mac OS X theme, based on
794
/// -moz-appearance names.
795
MozMacVibrancyLight,
796
MozMacVibrancyDark,
797
MozMacVibrantTitlebarLight,
798
MozMacVibrantTitlebarDark,
799
MozMacMenupopup,
800
MozMacMenuitem,
801
MozMacActiveMenuitem,
802
MozMacSourceList,
803
MozMacSourceListSelection,
804
MozMacActiveSourceListSelection,
805
MozMacTooltip,
806
/// Accent color for title bar.
807
MozWinAccentcolor,
808
/// Color from drawing text over the accent color.
809
MozWinAccentcolortext,
810
/// Media rebar text.
811
MozWinMediatext,
812
/// Communications rebar text.
813
MozWinCommunicationstext,
814
/// Hyperlink color extracted from the system, not affected by the
815
/// browser.anchor_color user pref.
816
///
817
/// There is no OS-specified safe background color for this text, but it is
818
/// used regularly within Windows and the Gnome DE on Dialog and Window
819
/// colors.
820
MozNativehyperlinktext,
821
/// Combobox widgets
822
MozComboboxtext,
823
MozCombobox,
824
MozGtkInfoBarText,
825
End,
826
};
827
828
/// Implements text-decoration-skip-ink which takes the keywords auto | none
829
///
831
enum class StyleTextDecorationSkipInk : uint8_t {
832
Auto,
833
None,
834
};
835
836
/// Fill mode for the text-emphasis-style property
837
enum class StyleTextEmphasisFillMode : uint8_t {
838
/// `filled`
839
Filled,
840
/// `open`
841
Open,
842
};
843
844
/// Shape keyword for the text-emphasis-style property
845
enum class StyleTextEmphasisShapeKeyword : uint8_t {
846
/// `dot`
847
Dot,
848
/// `circle`
849
Circle,
850
/// `double-circle`
851
DoubleCircle,
852
/// `triangle`
853
Triangle,
854
/// `sesame`
855
Sesame,
856
};
857
858
/// Specified keyword values for case transforms in the text-transform property. (These are exclusive.)
859
enum class StyleTextTransformCase {
860
/// No case transform.
861
None,
862
/// All uppercase.
863
Uppercase,
864
/// All lowercase.
865
Lowercase,
866
/// Capitalize each word.
867
Capitalize,
868
};
869
870
enum class StyleTimingKeyword : uint8_t {
871
Linear,
872
Ease,
873
EaseIn,
874
EaseOut,
875
EaseInOut,
876
};
877
878
/// The specified value for the `user-select` property.
879
///
881
enum class StyleUserSelect : uint8_t {
882
Auto,
883
Text,
884
None,
885
/// Force selection of all children.
886
All,
887
};
888
889
enum class StyleVerticalAlignKeyword : uint8_t {
890
Baseline,
891
Sub,
892
Super,
893
Top,
894
TextTop,
895
Middle,
896
Bottom,
897
TextBottom,
898
MozMiddleWithBaseline,
899
};
900
901
/// A keyword for the Y direction.
902
enum class StyleVerticalPositionKeyword : uint8_t {
903
Top,
904
Bottom,
905
};
906
907
/// Values for the `word-break` property.
908
enum class StyleWordBreak : uint8_t {
909
Normal,
910
BreakAll,
911
KeepAll,
912
/// The break-word value, needed for compat.
913
///
914
/// Specifying `word-break: break-word` makes `overflow-wrap` behave as
915
/// `anywhere`, and `word-break` behave like `normal`.
916
BreakWord,
917
};
918
919
/// Gecko-FFI-safe owned pointer.
920
///
921
/// Cannot be null, and leaks on drop, so needs to be converted into a rust-side
922
/// `Box` before.
923
template<typename GeckoType>
924
struct StyleOwned {
925
GeckoType *ptr;
926
927
bool operator==(const StyleOwned& other) const {
928
return ptr == other.ptr;
929
}
930
bool operator!=(const StyleOwned& other) const {
931
return ptr != other.ptr;
932
}
933
UniquePtr<GeckoType> Consume() {
934
UniquePtr<GeckoType> ret(ptr);
935
ptr = nullptr;
936
return ret;
937
}
938
};
939
940
/// Gecko-FFI-safe Arc (T is an ArcInner).
941
///
942
/// This can be null.
943
///
944
/// Leaks on drop. Please don't drop this.
945
template<typename GeckoType>
946
struct StyleStrong {
947
const GeckoType *ptr;
948
949
bool operator==(const StyleStrong& other) const {
950
return ptr == other.ptr;
951
}
952
bool operator!=(const StyleStrong& other) const {
953
return ptr != other.ptr;
954
}
955
already_AddRefed<GeckoType> Consume() {
956
already_AddRefed<GeckoType> ret(const_cast<GeckoType*>(ptr));
957
ptr = nullptr;
958
return ret;
959
}
960
};
961
962
/// A CSS float value.
963
using StyleCSSFloat = float;
964
965
/// A `<number>` value.
966
using StyleNumber = StyleCSSFloat;
967
968
/// A computed angle in degrees.
969
struct StyleAngle {
970
StyleCSSFloat _0;
971
972
bool operator==(const StyleAngle& other) const {
973
return _0 == other._0;
974
}
975
bool operator!=(const StyleAngle& other) const {
976
return _0 != other._0;
977
}
978
inline static StyleAngle Zero();
979
inline float ToDegrees() const;
980
inline double ToRadians() const;
981
StyleAngle operator+(const StyleAngle& aAngle) const {
982
return StyleAngle{_0 + aAngle._0};
983
}
984
StyleAngle operator-(const StyleAngle& aAngle) const {
985
return StyleAngle{_0 - aAngle._0};
986
}
987
};
988
989
/// A value of the `Rotate` property
990
///
992
template<typename Number, typename Angle>
993
struct StyleGenericRotate {
994
enum class Tag : uint8_t {
995
/// 'none'
996
None,
997
/// '<angle>'
998
Rotate,
999
/// '<number>{3} <angle>'
1000
Rotate3D,
1001
};
1002
1003
struct StyleRotate_Body {
1004
Angle _0;
1005
1006
bool operator==(const StyleRotate_Body& other) const {
1007
return _0 == other._0;
1008
}
1009
bool operator!=(const StyleRotate_Body& other) const {
1010
return _0 != other._0;
1011
}
1012
};
1013
1014
struct StyleRotate3D_Body {
1015
Number _0;
1016
Number _1;
1017
Number _2;
1018
Angle _3;
1019
1020
bool operator==(const StyleRotate3D_Body& other) const {
1021
return _0 == other._0 &&
1022
_1 == other._1 &&
1023
_2 == other._2 &&
1024
_3 == other._3;
1025
}
1026
bool operator!=(const StyleRotate3D_Body& other) const {
1027
return _0 != other._0 ||
1028
_1 != other._1 ||
1029
_2 != other._2 ||
1030
_3 != other._3;
1031
}
1032
};
1033
1034
Tag tag;
1035
union {
1036
StyleRotate_Body rotate;
1037
StyleRotate3D_Body rotate3_d;
1038
};
1039
1040
static StyleGenericRotate None() {
1041
StyleGenericRotate result;
1042
result.tag = Tag::None;
1043
return result;
1044
}
1045
1046
static StyleGenericRotate Rotate(const Angle &a0) {
1047
StyleGenericRotate result;
1048
::new (&result.rotate._0) (Angle)(a0);
1049
result.tag = Tag::Rotate;
1050
return result;
1051
}
1052
1053
static StyleGenericRotate Rotate3D(const Number &a0,
1054
const Number &a1,
1055
const Number &a2,
1056
const Angle &a3) {
1057
StyleGenericRotate result;
1058
::new (&result.rotate3_d._0) (Number)(a0);
1059
::new (&result.rotate3_d._1) (Number)(a1);
1060
::new (&result.rotate3_d._2) (Number)(a2);
1061
::new (&result.rotate3_d._3) (Angle)(a3);
1062
result.tag = Tag::Rotate3D;
1063
return result;
1064
}
1065
1066
bool IsNone() const {
1067
return tag == Tag::None;
1068
}
1069
1070
bool IsRotate() const {
1071
return tag == Tag::Rotate;
1072
}
1073
1074
bool IsRotate3D() const {
1075
return tag == Tag::Rotate3D;
1076
}
1077
1078
const Angle& AsRotate() const {
1079
MOZ_ASSERT(IsRotate());
1080
return rotate._0;
1081
}
1082
1083
const StyleRotate3D_Body& AsRotate3D() const {
1084
MOZ_ASSERT(IsRotate3D());
1085
return rotate3_d;
1086
}
1087
1088
bool operator==(const StyleGenericRotate& other) const {
1089
if (tag != other.tag) {
1090
return false;
1091
}
1092
switch (tag) {
1093
case Tag::Rotate: return rotate == other.rotate;
1094
case Tag::Rotate3D: return rotate3_d == other.rotate3_d;
1095
default: return true;
1096
}
1097
}
1098
1099
bool operator!=(const StyleGenericRotate& other) const {
1100
return !(*this == other);
1101
}
1102
1103
private:
1104
StyleGenericRotate() {
1105
1106
}
1107
public:
1108
1109
1110
~StyleGenericRotate() {
1111
switch (tag) {
1112
case Tag::Rotate: rotate.~StyleRotate_Body(); break;
1113
case Tag::Rotate3D: rotate3_d.~StyleRotate3D_Body(); break;
1114
default: break;
1115
}
1116
}
1117
1118
StyleGenericRotate(const StyleGenericRotate& other)
1119
: tag(other.tag) {
1120
switch (tag) {
1121
case Tag::Rotate: ::new (&rotate) (StyleRotate_Body)(other.rotate); break;
1122
case Tag::Rotate3D: ::new (&rotate3_d) (StyleRotate3D_Body)(other.rotate3_d); break;
1123
default: break;
1124
}
1125
}
1126
};
1127
1128
/// A computed CSS `rotate`
1129
using StyleRotate = StyleGenericRotate<StyleNumber, StyleAngle>;
1130
1131
/// A value of the `Scale` property
1132
///
1134
template<typename Number>
1135
struct StyleGenericScale {
1136
enum class Tag : uint8_t {
1137
/// 'none'
1138
None,
1139
/// '<number>{1,2}'
1140
Scale,
1141
/// '<number>{3}'
1142
Scale3D,
1143
};
1144
1145
struct StyleScale_Body {
1146
Number _0;
1147
Number _1;
1148
1149
bool operator==(const StyleScale_Body& other) const {
1150
return _0 == other._0 &&
1151
_1 == other._1;
1152
}
1153
bool operator!=(const StyleScale_Body& other) const {
1154
return _0 != other._0 ||
1155
_1 != other._1;
1156
}
1157
};
1158
1159
struct StyleScale3D_Body {
1160
Number _0;
1161
Number _1;
1162
Number _2;
1163
1164
bool operator==(const StyleScale3D_Body& other) const {
1165
return _0 == other._0 &&
1166
_1 == other._1 &&
1167
_2 == other._2;
1168
}
1169
bool operator!=(const StyleScale3D_Body& other) const {
1170
return _0 != other._0 ||
1171
_1 != other._1 ||
1172
_2 != other._2;
1173
}
1174
};
1175
1176
Tag tag;
1177
union {
1178
StyleScale_Body scale;
1179
StyleScale3D_Body scale3_d;
1180
};
1181
1182
static StyleGenericScale None() {
1183
StyleGenericScale result;
1184
result.tag = Tag::None;
1185
return result;
1186
}
1187
1188
static StyleGenericScale Scale(const Number &a0,
1189
const Number &a1) {
1190
StyleGenericScale result;
1191
::new (&result.scale._0) (Number)(a0);
1192
::new (&result.scale._1) (Number)(a1);
1193
result.tag = Tag::Scale;
1194
return result;
1195
}
1196
1197
static StyleGenericScale Scale3D(const Number &a0,
1198
const Number &a1,
1199
const Number &a2) {
1200
StyleGenericScale result;
1201
::new (&result.scale3_d._0) (Number)(a0);
1202
::new (&result.scale3_d._1) (Number)(a1);
1203
::new (&result.scale3_d._2) (Number)(a2);
1204
result.tag = Tag::Scale3D;
1205
return result;
1206
}
1207
1208
bool IsNone() const {
1209
return tag == Tag::None;
1210
}
1211
1212
bool IsScale() const {
1213
return tag == Tag::Scale;
1214
}
1215
1216
bool IsScale3D() const {
1217
return tag == Tag::Scale3D;
1218
}
1219
1220
const StyleScale_Body& AsScale() const {
1221
MOZ_ASSERT(IsScale());
1222
return scale;
1223
}
1224
1225
const StyleScale3D_Body& AsScale3D() const {
1226
MOZ_ASSERT(IsScale3D());
1227
return scale3_d;
1228
}
1229
1230
bool operator==(const StyleGenericScale& other) const {
1231
if (tag != other.tag) {
1232
return false;
1233
}
1234
switch (tag) {
1235
case Tag::Scale: return scale == other.scale;
1236
case Tag::Scale3D: return scale3_d == other.scale3_d;
1237
default: return true;
1238
}
1239
}
1240
1241
bool operator!=(const StyleGenericScale& other) const {
1242
return !(*this == other);
1243
}
1244
1245
private:
1246
StyleGenericScale() {
1247
1248
}
1249
public:
1250
1251
1252
~StyleGenericScale() {
1253
switch (tag) {
1254
case Tag::Scale: scale.~StyleScale_Body(); break;
1255
case Tag::Scale3D: scale3_d.~StyleScale3D_Body(); break;
1256
default: break;
1257
}
1258
}
1259
1260
StyleGenericScale(const StyleGenericScale& other)
1261
: tag(other.tag) {
1262
switch (tag) {
1263
case Tag::Scale: ::new (&scale) (StyleScale_Body)(other.scale); break;
1264
case Tag::Scale3D: ::new (&scale3_d) (StyleScale3D_Body)(other.scale3_d); break;
1265
default: break;
1266
}
1267
}
1268
};
1269
1270
/// A computed CSS `scale`
1271
using StyleScale = StyleGenericScale<StyleNumber>;
1272
1273
/// The computed `<length>` value.
1274
struct StyleCSSPixelLength {
1275
StyleCSSFloat _0;
1276
1277
bool operator==(const StyleCSSPixelLength& other) const {
1278
return _0 == other._0;
1279
}
1280
bool operator!=(const StyleCSSPixelLength& other) const {
1281
return _0 != other._0;
1282
}
1283
inline nscoord ToAppUnits() const;
1284
inline bool IsZero() const;
1285
float ToCSSPixels() const { return _0; }
1286
};
1287
1288
/// An alias of computed `<length>` value.
1289
using StyleLength = StyleCSSPixelLength;
1290
1291
/// A CSS integer value.
1292
using StyleCSSInteger = int32_t;
1293
1294
/// A `<integer>` value.
1295
using StyleInteger = StyleCSSInteger;
1296
1297
/// A computed percentage.
1298
struct StylePercentage {
1299
StyleCSSFloat _0;
1300
1301
bool operator==(const StylePercentage& other) const {
1302
return _0 == other._0;
1303
}
1304
bool operator!=(const StylePercentage& other) const {
1305
return _0 != other._0;
1306
}
1307
};
1308
1309
/// A `<length-percentage>` value. This can be either a `<length>`, a
1310
/// `<percentage>`, or a combination of both via `calc()`.
1311
///
1313
struct StyleLengthPercentage {
1314
StyleLength length;
1315
StylePercentage percentage;
1316
StyleAllowedNumericType clamping_mode;
1317
/// Whether we specified a percentage or not.
1318
bool has_percentage;
1319
1320
bool operator==(const StyleLengthPercentage& other) const {
1321
return length == other.length &&
1322
percentage == other.percentage &&
1323
clamping_mode == other.clamping_mode &&
1324
has_percentage == other.has_percentage;
1325
}
1326
bool operator!=(const StyleLengthPercentage& other) const {
1327
return length != other.length ||
1328
percentage != other.percentage ||
1329
clamping_mode != other.clamping_mode ||
1330
has_percentage != other.has_percentage;
1331
}
1332
static constexpr inline StyleLengthPercentage Zero();
1333
static inline StyleLengthPercentage FromAppUnits(nscoord);
1334
static inline StyleLengthPercentage FromPixels(CSSCoord);
1335
static inline StyleLengthPercentage FromPercentage(float);
1336
inline CSSCoord LengthInCSSPixels() const;
1337
inline float Percentage() const;
1338
inline bool HasPercent() const;
1339
inline bool ConvertsToLength() const;
1340
inline nscoord ToLength() const;
1341
inline bool ConvertsToPercentage() const;
1342
inline bool HasLengthAndPercentage() const;
1343
inline float ToPercentage() const;
1344
inline bool IsDefinitelyZero() const;
1345
inline CSSCoord ResolveToCSSPixels(CSSCoord aPercentageBasisInCSSPixels) const;
1346
template<typename T> inline CSSCoord ResolveToCSSPixelsWith(T aPercentageGetter) const;
1347
template<typename T, typename U>
1348
inline nscoord Resolve(T aPercentageGetter, U aPercentRoundingFunction) const;
1349
template<typename T>
1350
inline nscoord Resolve(nscoord aPercentageBasis, T aPercentRoundingFunction) const;
1351
template<typename T> inline nscoord Resolve(T aPercentageGetter) const;
1352
inline nscoord Resolve(nscoord aPercentageBasis) const;
1353
};
1354
1355
/// A generic 2D transformation matrix.
1356
template<typename T>
1357
struct StyleGenericMatrix {
1358
T a;
1359
T b;
1360
T c;
1361
T d;
1362
T e;
1363
T f;
1364
1365
bool operator==(const StyleGenericMatrix& other) const {
1366
return a == other.a &&
1367
b == other.b &&
1368
c == other.c &&
1369
d == other.d &&
1370
e == other.e &&
1371
f == other.f;
1372
}
1373
bool operator!=(const StyleGenericMatrix& other) const {
1374
return a != other.a ||
1375
b != other.b ||
1376
c != other.c ||
1377
d != other.d ||
1378
e != other.e ||
1379
f != other.f;
1380
}
1381
};
1382
1383
template<typename T>
1384
struct StyleGenericMatrix3D {
1385
T m11;
1386
T m12;
1387
T m13;
1388
T m14;
1389
T m21;
1390
T m22;
1391
T m23;
1392
T m24;
1393
T m31;
1394
T m32;
1395
T m33;
1396
T m34;
1397
T m41;
1398
T m42;
1399
T m43;
1400
T m44;
1401
1402
bool operator==(const StyleGenericMatrix3D& other) const {
1403
return m11 == other.m11 &&
1404
m12 == other.m12 &&
1405
m13 == other.m13 &&
1406
m14 == other.m14 &&
1407
m21 == other.m21 &&
1408
m22 == other.m22 &&
1409
m23 == other.m23 &&
1410
m24 == other.m24 &&
1411
m31 == other.m31 &&
1412
m32 == other.m32 &&
1413
m33 == other.m33 &&
1414
m34 == other.m34 &&
1415
m41 == other.m41 &&
1416
m42 == other.m42 &&
1417
m43 == other.m43 &&
1418
m44 == other.m44;
1419
}
1420
bool operator!=(const StyleGenericMatrix3D& other) const {
1421
return m11 != other.m11 ||
1422
m12 != other.m12 ||
1423
m13 != other.m13 ||
1424
m14 != other.m14 ||
1425
m21 != other.m21 ||
1426
m22 != other.m22 ||
1427
m23 != other.m23 ||
1428
m24 != other.m24 ||
1429
m31 != other.m31 ||
1430
m32 != other.m32 ||
1431
m33 != other.m33 ||
1432
m34 != other.m34 ||
1433
m41 != other.m41 ||
1434
m42 != other.m42 ||
1435
m43 != other.m43 ||
1436
m44 != other.m44;
1437
}
1438
};
1439
1440
/// A struct that basically replaces a `Box<[T]>`, but which cbindgen can
1441
/// understand.
1442
///
1443
/// We could rely on the struct layout of `Box<[T]>` per:
1444
///
1446
///
1447
/// But handling fat pointers with cbindgen both in structs and argument
1448
/// positions more generally is a bit tricky.
1449
///
1450
template<typename T>
1451
struct StyleOwnedSlice {
1452
T *ptr;
1453
uintptr_t len;
1454
StyleOwnedSlice() :
1455
ptr((T*)alignof(T)),
1456
len(0) {}
1457
1458
inline void Clear();
1459
inline void CopyFrom(const StyleOwnedSlice&);
1460
inline void SwapElements(StyleOwnedSlice&);
1461
1462
StyleOwnedSlice& operator=(const StyleOwnedSlice&);
1463
StyleOwnedSlice& operator=(StyleOwnedSlice&&);
1464
1465
inline StyleOwnedSlice(const StyleOwnedSlice&);
1466
inline StyleOwnedSlice(StyleOwnedSlice&&);
1467
1468
inline ~StyleOwnedSlice();
1469
1470
Span<const T> AsSpan() const {
1471
return MakeSpan(ptr, len);
1472
}
1473
1474
size_t Length() const {
1475
return AsSpan().Length();
1476
}
1477
1478
bool IsEmpty() const { return Length() == 0; }
1479
1480
bool operator==(const StyleOwnedSlice& other) const {
1481
return AsSpan() == other.AsSpan();
1482
}
1483
1484
bool operator!=(const StyleOwnedSlice& other) const {
1485
return !(*this == other);
1486
}
1487
};
1488
1489
/// A value of the `transform` property
1490
template<typename T>
1491
struct StyleGenericTransform {
1492
StyleOwnedSlice<T> _0;
1493
1494
bool operator==(const StyleGenericTransform& other) const {
1495
return _0 == other._0;
1496
}
1497
bool operator!=(const StyleGenericTransform& other) const {
1498
return _0 != other._0;
1499
}
1500
inline Span<const T> Operations() const;
1501
inline bool IsNone() const;
1502
bool HasPercent() const;
1503
};
1504
1505
/// A single operation in the list of a `transform` value
1506
template<typename Angle, typename Number, typename Length, typename Integer, typename LengthPercentage>
1507
struct StyleGenericTransformOperation {
1508
enum class Tag : uint8_t {
1509
/// Represents a 2D 2x3 matrix.
1510
Matrix,
1511
/// Represents a 3D 4x4 matrix.
1512
Matrix3D,
1513
/// A 2D skew.
1514
///
1515
/// If the second angle is not provided it is assumed zero.
1516
///
1517
/// Syntax can be skew(angle) or skew(angle, angle)
1518
Skew,
1519
/// skewX(angle)
1520
SkewX,
1521
/// skewY(angle)
1522
SkewY,
1523
/// translate(x, y) or translate(x)
1524
Translate,
1525
/// translateX(x)
1526
TranslateX,
1527
/// translateY(y)
1528
TranslateY,
1529
/// translateZ(z)
1530
TranslateZ,
1531
/// translate3d(x, y, z)
1532
Translate3D,
1533
/// A 2D scaling factor.
1534
///
1535
/// Syntax can be scale(factor) or scale(factor, factor)
1536
Scale,
1537
/// scaleX(factor)
1538
ScaleX,
1539
/// scaleY(factor)
1540
ScaleY,
1541
/// scaleZ(factor)
1542
ScaleZ,
1543
/// scale3D(factorX, factorY, factorZ)
1544
Scale3D,
1545
/// Describes a 2D Rotation.
1546
///
1547
/// In a 3D scene `rotate(angle)` is equivalent to `rotateZ(angle)`.
1548
Rotate,
1549
/// Rotation in 3D space around the x-axis.
1550
RotateX,
1551
/// Rotation in 3D space around the y-axis.
1552
RotateY,
1553
/// Rotation in 3D space around the z-axis.
1554
RotateZ,
1555
/// Rotation in 3D space.
1556
///
1557
/// Generalization of rotateX, rotateY and rotateZ.
1558
Rotate3D,
1559
/// Specifies a perspective projection matrix.
1560
///
1561
/// Part of CSS Transform Module Level 2 and defined at
1562
/// [§ 13.1. 3D Transform Function](https://drafts.csswg.org/css-transforms-2/#funcdef-perspective).
1563
///
1564
/// The value must be greater than or equal to zero.
1565
Perspective,
1566
/// A intermediate type for interpolation of mismatched transform lists.
1567
InterpolateMatrix,
1568
/// A intermediate type for accumulation of mismatched transform lists.
1569
AccumulateMatrix,
1570
};
1571
1572
struct StyleMatrix_Body {
1573
StyleGenericMatrix<Number> _0;
1574
1575
bool operator==(const StyleMatrix_Body& other) const {
1576
return _0 == other._0;
1577
}
1578
bool operator!=(const StyleMatrix_Body& other) const {
1579
return _0 != other._0;
1580
}
1581
};
1582
1583
struct StyleMatrix3D_Body {
1584
StyleGenericMatrix3D<Number> _0;
1585
1586
bool operator==(const StyleMatrix3D_Body& other) const {
1587
return _0 == other._0;
1588
}
1589
bool operator!=(const StyleMatrix3D_Body& other) const {
1590
return _0 != other._0;
1591
}
1592
};
1593
1594
struct StyleSkew_Body {
1595
Angle _0;
1596
Angle _1;
1597
1598
bool operator==(const StyleSkew_Body& other) const {
1599
return _0 == other._0 &&
1600
_1 == other._1;
1601
}
1602
bool operator!=(const StyleSkew_Body& other) const {
1603
return _0 != other._0 ||
1604
_1 != other._1;
1605
}
1606
};
1607
1608
struct StyleSkewX_Body {
1609
Angle _0;
1610
1611
bool operator==(const StyleSkewX_Body& other) const {
1612
return _0 == other._0;
1613
}
1614
bool operator!=(const StyleSkewX_Body& other) const {
1615
return _0 != other._0;
1616
}
1617
};
1618
1619
struct StyleSkewY_Body {
1620
Angle _0;
1621
1622
bool operator==(const StyleSkewY_Body& other) const {
1623
return _0 == other._0;
1624
}
1625
bool operator!=(const StyleSkewY_Body& other) const {
1626
return _0 != other._0;
1627
}
1628
};
1629
1630
struct StyleTranslate_Body {
1631
LengthPercentage _0;
1632
LengthPercentage _1;
1633
1634
bool operator==(const StyleTranslate_Body& other) const {
1635
return _0 == other._0 &&
1636
_1 == other._1;
1637
}
1638
bool operator!=(const StyleTranslate_Body& other) const {
1639
return _0 != other._0 ||
1640
_1 != other._1;
1641
}
1642
};
1643
1644
struct StyleTranslateX_Body {
1645
LengthPercentage _0;
1646
1647
bool operator==(const StyleTranslateX_Body& other) const {
1648
return _0 == other._0;
1649
}
1650
bool operator!=(const StyleTranslateX_Body& other) const {
1651
return _0 != other._0;
1652
}
1653
};
1654
1655
struct StyleTranslateY_Body {
1656
LengthPercentage _0;
1657
1658
bool operator==(const StyleTranslateY_Body& other) const {
1659
return _0 == other._0;
1660
}
1661
bool operator!=(const StyleTranslateY_Body& other) const {
1662
return _0 != other._0;
1663
}
1664
};
1665
1666
struct StyleTranslateZ_Body {
1667
Length _0;
1668
1669
bool operator==(const StyleTranslateZ_Body& other) const {
1670
return _0 == other._0;
1671
}
1672
bool operator!=(const StyleTranslateZ_Body& other) const {
1673
return _0 != other._0;
1674
}
1675
};
1676
1677
struct StyleTranslate3D_Body {
1678
LengthPercentage _0;
1679
LengthPercentage _1;
1680
Length _2;
1681
1682
bool operator==(const StyleTranslate3D_Body& other) const {
1683
return _0 == other._0 &&
1684
_1 == other._1 &&
1685
_2 == other._2;
1686
}
1687
bool operator!=(const StyleTranslate3D_Body& other) const {
1688
return _0 != other._0 ||
1689
_1 != other._1 ||
1690
_2 != other._2;
1691
}
1692
};
1693
1694
struct StyleScale_Body {
1695
Number _0;
1696
Number _1;
1697
1698
bool operator==(const StyleScale_Body& other) const {
1699
return _0 == other._0 &&
1700
_1 == other._1;
1701
}
1702
bool operator!=(const StyleScale_Body& other) const {
1703
return _0 != other._0 ||
1704
_1 != other._1;
1705
}
1706
};
1707
1708
struct StyleScaleX_Body {
1709
Number _0;
1710
1711
bool operator==(const StyleScaleX_Body& other) const {
1712
return _0 == other._0;
1713
}
1714
bool operator!=(const StyleScaleX_Body& other) const {
1715
return _0 != other._0;
1716
}
1717
};
1718
1719
struct StyleScaleY_Body {
1720
Number _0;
1721
1722
bool operator==(const StyleScaleY_Body& other) const {
1723
return _0 == other._0;
1724
}
1725
bool operator!=(const StyleScaleY_Body& other) const {
1726
return _0 != other._0;
1727
}
1728
};
1729
1730
struct StyleScaleZ_Body {
1731
Number _0;
1732
1733
bool operator==(const StyleScaleZ_Body& other) const {
1734
return _0 == other._0;
1735
}
1736
bool operator!=(const StyleScaleZ_Body& other) const {
1737
return _0 != other._0;
1738
}
1739
};
1740
1741
struct StyleScale3D_Body {
1742
Number _0;
1743
Number _1;
1744
Number _2;
1745
1746
bool operator==(const StyleScale3D_Body& other) const {
1747
return _0 == other._0 &&
1748
_1 == other._1 &&
1749
_2 == other._2;
1750
}
1751
bool operator!=(const StyleScale3D_Body& other) const {
1752
return _0 != other._0 ||
1753
_1 != other._1 ||
1754
_2 != other._2;
1755
}
1756
};
1757
1758
struct StyleRotate_Body {
1759
Angle _0;
1760
1761
bool operator==(const StyleRotate_Body& other) const {
1762
return _0 == other._0;
1763
}
1764
bool operator!=(const StyleRotate_Body& other) const {
1765
return _0 != other._0;
1766
}
1767
};
1768
1769
struct StyleRotateX_Body {
1770
Angle _0;
1771
1772
bool operator==(const StyleRotateX_Body& other) const {
1773
return _0 == other._0;
1774
}
1775
bool operator!=(const StyleRotateX_Body& other) const {
1776
return _0 != other._0;
1777
}
1778
};
1779
1780
struct StyleRotateY_Body {
1781
Angle _0;
1782
1783
bool operator==(const StyleRotateY_Body& other) const {
1784
return _0 == other._0;
1785
}
1786
bool operator!=(const StyleRotateY_Body& other) const {
1787
return _0 != other._0;
1788
}
1789
};
1790
1791
struct StyleRotateZ_Body {
1792
Angle _0;
1793
1794
bool operator==(const StyleRotateZ_Body& other) const {
1795
return _0 == other._0;
1796
}
1797
bool operator!=(const StyleRotateZ_Body& other) const {
1798
return _0 != other._0;
1799
}
1800
};
1801
1802
struct StyleRotate3D_Body {
1803
Number _0;
1804
Number _1;
1805
Number _2;
1806
Angle _3;
1807
1808
bool operator==(const StyleRotate3D_Body& other) const {
1809
return _0 == other._0 &&
1810
_1 == other._1 &&
1811
_2 == other._2 &&
1812
_3 == other._3;
1813
}
1814
bool operator!=(const StyleRotate3D_Body& other) const {
1815
return _0 != other._0 ||
1816
_1 != other._1 ||
1817
_2 != other._2 ||
1818
_3 != other._3;
1819
}
1820
};
1821
1822
struct StylePerspective_Body {
1823
Length _0;
1824
1825
bool operator==(const StylePerspective_Body& other) const {
1826
return _0 == other._0;
1827
}
1828
bool operator!=(const StylePerspective_Body& other) const {
1829
return _0 != other._0;
1830
}
1831
};
1832
1833
struct StyleInterpolateMatrix_Body {
1834
StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> from_list;
1835
StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> to_list;
1836
StylePercentage progress;
1837
1838
bool operator==(const StyleInterpolateMatrix_Body& other) const {
1839
return from_list == other.from_list &&
1840
to_list == other.to_list &&
1841
progress == other.progress;
1842
}
1843
bool operator!=(const StyleInterpolateMatrix_Body& other) const {
1844
return from_list != other.from_list ||
1845
to_list != other.to_list ||
1846
progress != other.progress;
1847
}
1848
};
1849
1850
struct StyleAccumulateMatrix_Body {
1851
StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> from_list;
1852
StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> to_list;
1853
Integer count;
1854
1855
bool operator==(const StyleAccumulateMatrix_Body& other) const {
1856
return from_list == other.from_list &&
1857
to_list == other.to_list &&
1858
count == other.count;
1859
}
1860
bool operator!=(const StyleAccumulateMatrix_Body& other) const {
1861
return from_list != other.from_list ||
1862
to_list != other.to_list ||
1863
count != other.count;
1864
}
1865
};
1866
1867
Tag tag;
1868
union {
1869
StyleMatrix_Body matrix;
1870
StyleMatrix3D_Body matrix3_d;
1871
StyleSkew_Body skew;
1872
StyleSkewX_Body skew_x;
1873
StyleSkewY_Body skew_y;
1874
StyleTranslate_Body translate;
1875
StyleTranslateX_Body translate_x;
1876
StyleTranslateY_Body translate_y;
1877
StyleTranslateZ_Body translate_z;
1878
StyleTranslate3D_Body translate3_d;
1879
StyleScale_Body scale;
1880
StyleScaleX_Body scale_x;
1881
StyleScaleY_Body scale_y;
1882
StyleScaleZ_Body scale_z;
1883
StyleScale3D_Body scale3_d;
1884
StyleRotate_Body rotate;
1885
StyleRotateX_Body rotate_x;
1886
StyleRotateY_Body rotate_y;
1887
StyleRotateZ_Body rotate_z;
1888
StyleRotate3D_Body rotate3_d;
1889
StylePerspective_Body perspective;
1890
StyleInterpolateMatrix_Body interpolate_matrix;
1891
StyleAccumulateMatrix_Body accumulate_matrix;
1892
};
1893
1894
static StyleGenericTransformOperation Matrix(const StyleGenericMatrix<Number> &a0) {
1895
StyleGenericTransformOperation result;
1896
::new (&result.matrix._0) (StyleGenericMatrix<Number>)(a0);
1897
result.tag = Tag::Matrix;
1898
return result;
1899
}
1900
1901
static StyleGenericTransformOperation Matrix3D(const StyleGenericMatrix3D<Number> &a0) {
1902
StyleGenericTransformOperation result;
1903
::new (&result.matrix3_d._0) (StyleGenericMatrix3D<Number>)(a0);
1904
result.tag = Tag::Matrix3D;
1905
return result;
1906
}
1907
1908
static StyleGenericTransformOperation Skew(const Angle &a0,
1909
const Angle &a1) {
1910
StyleGenericTransformOperation result;
1911
::new (&result.skew._0) (Angle)(a0);
1912
::new (&result.skew._1) (Angle)(a1);
1913
result.tag = Tag::Skew;
1914
return result;
1915
}
1916
1917
static StyleGenericTransformOperation SkewX(const Angle &a0) {
1918
StyleGenericTransformOperation result;
1919
::new (&result.skew_x._0) (Angle)(a0);
1920
result.tag = Tag::SkewX;
1921
return result;
1922
}
1923
1924
static StyleGenericTransformOperation SkewY(const Angle &a0) {
1925
StyleGenericTransformOperation result;
1926
::new (&result.skew_y._0) (Angle)(a0);
1927
result.tag = Tag::SkewY;
1928
return result;
1929
}
1930
1931
static StyleGenericTransformOperation Translate(const LengthPercentage &a0,
1932
const LengthPercentage &a1) {
1933
StyleGenericTransformOperation result;
1934
::new (&result.translate._0) (LengthPercentage)(a0);
1935
::new (&result.translate._1) (LengthPercentage)(a1);
1936
result.tag = Tag::Translate;
1937
return result;
1938
}
1939
1940
static StyleGenericTransformOperation TranslateX(const LengthPercentage &a0) {
1941
StyleGenericTransformOperation result;
1942
::new (&result.translate_x._0) (LengthPercentage)(a0);
1943
result.tag = Tag::TranslateX;
1944
return result;
1945
}
1946
1947
static StyleGenericTransformOperation TranslateY(const LengthPercentage &a0) {
1948
StyleGenericTransformOperation result;
1949
::new (&result.translate_y._0) (LengthPercentage)(a0);
1950
result.tag = Tag::TranslateY;
1951
return result;
1952
}
1953
1954
static StyleGenericTransformOperation TranslateZ(const Length &a0) {
1955
StyleGenericTransformOperation result;
1956
::new (&result.translate_z._0) (Length)(a0);
1957
result.tag = Tag::TranslateZ;
1958
return result;
1959
}
1960
1961
static StyleGenericTransformOperation Translate3D(const LengthPercentage &a0,
1962
const LengthPercentage &a1,
1963
const Length &a2) {
1964
StyleGenericTransformOperation result;
1965
::new (&result.translate3_d._0) (LengthPercentage)(a0);
1966
::new (&result.translate3_d._1) (LengthPercentage)(a1);
1967
::new (&result.translate3_d._2) (Length)(a2);
1968
result.tag = Tag::Translate3D;
1969
return result;
1970
}
1971
1972
static StyleGenericTransformOperation Scale(const Number &a0,
1973
const Number &a1) {
1974
StyleGenericTransformOperation result;
1975
::new (&result.scale._0) (Number)(a0);
1976
::new (&result.scale._1) (Number)(a1);
1977
result.tag = Tag::Scale;
1978
return result;
1979
}
1980
1981
static StyleGenericTransformOperation ScaleX(const Number &a0) {
1982
StyleGenericTransformOperation result;
1983
::new (&result.scale_x._0) (Number)(a0);
1984
result.tag = Tag::ScaleX;
1985
return result;
1986
}
1987
1988
static StyleGenericTransformOperation ScaleY(const Number &a0) {
1989
StyleGenericTransformOperation result;
1990
::new (&result.scale_y._0) (Number)(a0);
1991
result.tag = Tag::ScaleY;
1992
return result;
1993
}
1994
1995
static StyleGenericTransformOperation ScaleZ(const Number &a0) {
1996
StyleGenericTransformOperation result;
1997
::new (&result.scale_z._0) (Number)(a0);
1998
result.tag = Tag::ScaleZ;
1999
return result;
2000
}
2001
2002
static StyleGenericTransformOperation Scale3D(const Number &a0,
2003
const Number &a1,
2004
const Number &a2) {
2005
StyleGenericTransformOperation result;
2006
::new (&result.scale3_d._0) (Number)(a0);
2007
::new (&result.scale3_d._1) (Number)(a1);
2008
::new (&result.scale3_d._2) (Number)(a2);
2009
result.tag = Tag::Scale3D;
2010
return result;
2011
}
2012
2013
static StyleGenericTransformOperation Rotate(const Angle &a0) {
2014
StyleGenericTransformOperation result;
2015
::new (&result.rotate._0) (Angle)(a0);
2016
result.tag = Tag::Rotate;
2017
return result;
2018
}
2019
2020
static StyleGenericTransformOperation RotateX(const Angle &a0) {
2021
StyleGenericTransformOperation result;
2022
::new (&result.rotate_x._0) (Angle)(a0);
2023
result.tag = Tag::RotateX;
2024
return result;
2025
}
2026
2027
static StyleGenericTransformOperation RotateY(const Angle &a0) {
2028
StyleGenericTransformOperation result;
2029
::new (&result.rotate_y._0) (Angle)(a0);
2030
result.tag = Tag::RotateY;
2031
return result;
2032
}
2033
2034
static StyleGenericTransformOperation RotateZ(const Angle &a0) {
2035
StyleGenericTransformOperation result;
2036
::new (&result.rotate_z._0) (Angle)(a0);
2037
result.tag = Tag::RotateZ;
2038
return result;
2039
}
2040
2041
static StyleGenericTransformOperation Rotate3D(const Number &a0,
2042
const Number &a1,
2043
const Number &a2,
2044
const Angle &a3) {
2045
StyleGenericTransformOperation result;
2046
::new (&result.rotate3_d._0) (Number)(a0);
2047
::new (&result.rotate3_d._1) (Number)(a1);
2048
::new (&result.rotate3_d._2) (Number)(a2);
2049
::new (&result.rotate3_d._3) (Angle)(a3);
2050
result.tag = Tag::Rotate3D;
2051
return result;
2052
}
2053
2054
static StyleGenericTransformOperation Perspective(const Length &a0) {
2055
StyleGenericTransformOperation result;
2056
::new (&result.perspective._0) (Length)(a0);
2057
result.tag = Tag::Perspective;
2058
return result;
2059
}
2060
2061
static StyleGenericTransformOperation InterpolateMatrix(const StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> &aFromList,
2062
const StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> &aToList,
2063
const StylePercentage &aProgress) {
2064
StyleGenericTransformOperation result;
2065
::new (&result.interpolate_matrix.from_list) (StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>)(aFromList);
2066
::new (&result.interpolate_matrix.to_list) (StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>)(aToList);
2067
::new (&result.interpolate_matrix.progress) (StylePercentage)(aProgress);
2068
result.tag = Tag::InterpolateMatrix;
2069
return result;
2070
}
2071
2072
static StyleGenericTransformOperation AccumulateMatrix(const StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> &aFromList,
2073
const StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>> &aToList,
2074
const Integer &aCount) {
2075
StyleGenericTransformOperation result;
2076
::new (&result.accumulate_matrix.from_list) (StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>)(aFromList);
2077
::new (&result.accumulate_matrix.to_list) (StyleGenericTransform<StyleGenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>)(aToList);
2078
::new (&result.accumulate_matrix.count) (Integer)(aCount);
2079
result.tag = Tag::AccumulateMatrix;
2080
return result;
2081
}
2082
2083
bool IsMatrix() const {
2084
return tag == Tag::Matrix;
2085
}
2086
2087
bool IsMatrix3D() const {
2088
return tag == Tag::Matrix3D;
2089
}
2090
2091
bool IsSkew() const {
2092
return tag == Tag::Skew;
2093
}
2094
2095
bool IsSkewX() const {
2096
return tag == Tag::SkewX;
2097
}
2098
2099
bool IsSkewY() const {
2100
return tag == Tag::SkewY;
2101
}
2102
2103
bool IsTranslate() const {
2104
return tag == Tag::Translate;
2105
}
2106
2107
bool IsTranslateX() const {
2108
return tag == Tag::TranslateX;
2109
}
2110
2111
bool IsTranslateY() const {
2112
return tag == Tag::TranslateY;
2113
}
2114
2115
bool IsTranslateZ() const {
2116
return tag == Tag::TranslateZ;
2117
}
2118
2119
bool IsTranslate3D() const {
2120
return tag == Tag::Translate3D;
2121
}
2122
2123
bool IsScale() const {
2124
return tag == Tag::Scale;
2125
}
2126
2127
bool IsScaleX() const {
2128
return tag == Tag::ScaleX;
2129
}
2130
2131
bool IsScaleY() const {
2132
return tag == Tag::ScaleY;
2133
}
2134
2135
bool IsScaleZ() const {
2136
return tag == Tag::ScaleZ;
2137
}
2138
2139
bool IsScale3D() const {
2140
return tag == Tag::Scale3D;
2141
}
2142
2143
bool IsRotate() const {
2144
return tag == Tag::Rotate;
2145
}
2146
2147
bool IsRotateX() const {
2148
return tag == Tag::RotateX;
2149
}
2150
2151
bool IsRotateY() const {
2152
return tag == Tag::RotateY;
2153
}
2154
2155
bool IsRotateZ() const {
2156
return tag == Tag::RotateZ;
2157
}
2158
2159
bool IsRotate3D() const {
2160
return tag == Tag::Rotate3D;
2161
}
2162
2163
bool IsPerspective() const {
2164
return tag == Tag::Perspective;
2165
}
2166
2167
bool IsInterpolateMatrix() const {
2168
return tag == Tag::InterpolateMatrix;
2169
}
2170
2171
bool IsAccumulateMatrix() const {
2172
return tag == Tag::AccumulateMatrix;
2173
}
2174
2175
const StyleGenericMatrix<Number>& AsMatrix() const {
2176
MOZ_ASSERT(IsMatrix());
2177
return matrix._0;
2178
}
2179
2180
const StyleGenericMatrix3D<Number>& AsMatrix3D() const {
2181
MOZ_ASSERT(IsMatrix3D());
2182
return matrix3_d._0;
2183
}
2184
2185
const StyleSkew_Body& AsSkew() const {
2186
MOZ_ASSERT(IsSkew());
2187
return skew;
2188
}
2189
2190
const Angle& AsSkewX() const {
2191
MOZ_ASSERT(IsSkewX());
2192
return skew_x._0;
2193
}
2194
2195
const Angle& AsSkewY() const {
2196
MOZ_ASSERT(IsSkewY());
2197
return skew_y._0;
2198
}
2199
2200
const StyleTranslate_Body& AsTranslate() const {
2201
MOZ_ASSERT(IsTranslate());
2202
return translate;
2203
}
2204
2205
const LengthPercentage& AsTranslateX() const {
2206
MOZ_ASSERT(IsTranslateX());
2207
return translate_x._0;
2208
}
2209
2210
const LengthPercentage& AsTranslateY() const {
2211
MOZ_ASSERT(IsTranslateY());
2212
return translate_y._0;
2213
}
2214
2215
const Length& AsTranslateZ() const {
2216
MOZ_ASSERT(IsTranslateZ());
2217
return translate_z._0;
2218
}
2219
2220
const StyleTranslate3D_Body& AsTranslate3D() const {
2221
MOZ_ASSERT(IsTranslate3D());
2222
return translate3_d;
2223
}
2224
2225
const StyleScale_Body& AsScale() const {
2226
MOZ_ASSERT(IsScale());
2227
return scale;
2228
}
2229
2230
const Number& AsScaleX() const {
2231
MOZ_ASSERT(IsScaleX());
2232
return scale_x._0;
2233
}
2234
2235
const Number& AsScaleY() const {
2236
MOZ_ASSERT(IsScaleY());
2237
return scale_y._0;
2238
}
2239
2240
const Number& AsScaleZ() const {
2241
MOZ_ASSERT(IsScaleZ());
2242
return scale_z._0;
2243
}
2244
2245
const StyleScale3D_Body& AsScale3D() const {
2246
MOZ_ASSERT(IsScale3D());
2247
return scale3_d;
2248
}
2249
2250
const Angle& AsRotate() const {
2251
MOZ_ASSERT(IsRotate());
2252
return rotate._0;
2253
}
2254
2255
const Angle& AsRotateX() const {
2256
MOZ_ASSERT(IsRotateX());
2257
return rotate_x._0;
2258
}
2259
2260
const Angle& AsRotateY() const {
2261
MOZ_ASSERT(IsRotateY());
2262
return rotate_y._0;
2263
}
2264
2265
const Angle& AsRotateZ() const {
2266
MOZ_ASSERT(IsRotateZ());
2267
return rotate_z._0;
2268
}
2269
2270
const StyleRotate3D_Body& AsRotate3D() const {
2271
MOZ_ASSERT(IsRotate3D());
2272
return rotate3_d;
2273
}
2274
2275
const Length& AsPerspective() const {
2276
MOZ_ASSERT(IsPerspective());
2277
return perspective._0;
2278
}
2279
2280
const StyleInterpolateMatrix_Body& AsInterpolateMatrix() const {
2281
MOZ_ASSERT(IsInterpolateMatrix());
2282
return interpolate_matrix;
2283
}
2284
2285
const StyleAccumulateMatrix_Body& AsAccumulateMatrix() const {
2286
MOZ_ASSERT(IsAccumulateMatrix());
2287
return accumulate_matrix;
2288
}
2289
2290
bool operator==(const StyleGenericTransformOperation& other) const {
2291
if (tag != other.tag) {
2292
return false;
2293
}
2294
switch (tag) {
2295
case Tag::Matrix: return matrix == other.matrix;
2296
case Tag::Matrix3D: return matrix3_d == other.matrix3_d;
2297
case Tag::Skew: return skew == other.skew;
2298
case Tag::SkewX: return skew_x == other.skew_x;
2299
case Tag::SkewY: return skew_y == other.skew_y;
2300
case Tag::Translate: return translate == other.translate;
2301
case Tag::TranslateX: return translate_x == other.translate_x;
2302
case Tag::TranslateY: return translate_y == other.translate_y;
2303
case Tag::TranslateZ: return translate_z == other.translate_z;
2304
case Tag::Translate3D: return translate3_d == other.translate3_d;
2305
case Tag::Scale: return scale == other.scale;
2306
case Tag::ScaleX: return scale_x == other.scale_x;
2307
case Tag::ScaleY: return scale_y == other.scale_y;
2308
case Tag::ScaleZ: return scale_z == other.scale_z;
2309
case Tag::Scale3D: return scale3_d == other.scale3_d;
2310
case Tag::Rotate: return rotate == other.rotate;
2311
case Tag::RotateX: return rotate_x == other.rotate_x;
2312
case Tag::RotateY: return rotate_y == other.rotate_y;
2313
case Tag::RotateZ: return rotate_z == other.rotate_z;
2314
case Tag::Rotate3D: return rotate3_d == other.rotate3_d;
2315
case Tag::Perspective: return perspective == other.perspective;
2316
case Tag::InterpolateMatrix: return interpolate_matrix == other.interpolate_matrix;
2317
case Tag::AccumulateMatrix: return accumulate_matrix == other.accumulate_matrix;
2318
default: return true;
2319
}
2320
}
2321
2322
bool operator!=(const StyleGenericTransformOperation& other) const {
2323
return !(*this == other);
2324
}
2325
2326
private:
2327
StyleGenericTransformOperation() {
2328
2329
}
2330
public:
2331
<