mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:57:45 +00:00
LibWeb: Use the generated enums instead of defining them in StyleValue.h
The remaining enums here are special cases that don't directly correspond to a list of identifiers. But the majority can go. :^)
This commit is contained in:
parent
a97944e483
commit
823d67bfc1
1 changed files with 1 additions and 240 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <LibGfx/Painter.h>
|
#include <LibGfx/Painter.h>
|
||||||
#include <LibWeb/CSS/Angle.h>
|
#include <LibWeb/CSS/Angle.h>
|
||||||
#include <LibWeb/CSS/Display.h>
|
#include <LibWeb/CSS/Display.h>
|
||||||
|
#include <LibWeb/CSS/Enums.h>
|
||||||
#include <LibWeb/CSS/Frequency.h>
|
#include <LibWeb/CSS/Frequency.h>
|
||||||
#include <LibWeb/CSS/Length.h>
|
#include <LibWeb/CSS/Length.h>
|
||||||
#include <LibWeb/CSS/Number.h>
|
#include <LibWeb/CSS/Number.h>
|
||||||
|
@ -39,126 +40,23 @@
|
||||||
|
|
||||||
namespace Web::CSS {
|
namespace Web::CSS {
|
||||||
|
|
||||||
enum class AlignItems {
|
|
||||||
FlexStart,
|
|
||||||
FlexEnd,
|
|
||||||
Center,
|
|
||||||
Baseline,
|
|
||||||
Stretch,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class BackgroundAttachment {
|
|
||||||
Fixed,
|
|
||||||
Local,
|
|
||||||
Scroll,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class BackgroundBox {
|
|
||||||
BorderBox,
|
|
||||||
ContentBox,
|
|
||||||
PaddingBox,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class BackgroundSize {
|
enum class BackgroundSize {
|
||||||
Contain,
|
Contain,
|
||||||
Cover,
|
Cover,
|
||||||
LengthPercentage,
|
LengthPercentage,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class BoxSizing {
|
|
||||||
BorderBox,
|
|
||||||
ContentBox,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class ShadowPlacement {
|
enum class ShadowPlacement {
|
||||||
Outer,
|
Outer,
|
||||||
Inner,
|
Inner,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Clear {
|
|
||||||
None,
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
Both,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Cursor {
|
|
||||||
Auto,
|
|
||||||
Default,
|
|
||||||
None,
|
|
||||||
ContextMenu,
|
|
||||||
Help,
|
|
||||||
Pointer,
|
|
||||||
Progress,
|
|
||||||
Wait,
|
|
||||||
Cell,
|
|
||||||
Crosshair,
|
|
||||||
Text,
|
|
||||||
VerticalText,
|
|
||||||
Alias,
|
|
||||||
Copy,
|
|
||||||
Move,
|
|
||||||
NoDrop,
|
|
||||||
NotAllowed,
|
|
||||||
Grab,
|
|
||||||
Grabbing,
|
|
||||||
EResize,
|
|
||||||
NResize,
|
|
||||||
NeResize,
|
|
||||||
NwResize,
|
|
||||||
SResize,
|
|
||||||
SeResize,
|
|
||||||
SwResize,
|
|
||||||
WResize,
|
|
||||||
EwResize,
|
|
||||||
NsResize,
|
|
||||||
NeswResize,
|
|
||||||
NwseResize,
|
|
||||||
ColResize,
|
|
||||||
RowResize,
|
|
||||||
AllScroll,
|
|
||||||
ZoomIn,
|
|
||||||
ZoomOut,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class FlexBasis {
|
enum class FlexBasis {
|
||||||
Content,
|
Content,
|
||||||
LengthPercentage,
|
LengthPercentage,
|
||||||
Auto,
|
Auto,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class FlexDirection {
|
|
||||||
Row,
|
|
||||||
RowReverse,
|
|
||||||
Column,
|
|
||||||
ColumnReverse,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class FlexWrap {
|
|
||||||
Nowrap,
|
|
||||||
Wrap,
|
|
||||||
WrapReverse
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Float {
|
|
||||||
None,
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class FontVariant {
|
|
||||||
Normal,
|
|
||||||
SmallCaps,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class ImageRendering {
|
|
||||||
Auto,
|
|
||||||
CrispEdges,
|
|
||||||
HighQuality,
|
|
||||||
Pixelated,
|
|
||||||
Smooth,
|
|
||||||
};
|
|
||||||
|
|
||||||
// FIXME: Find a better place for this helper.
|
// FIXME: Find a better place for this helper.
|
||||||
inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_value)
|
inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_value)
|
||||||
{
|
{
|
||||||
|
@ -174,72 +72,6 @@ inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_val
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class JustifyContent {
|
|
||||||
FlexStart,
|
|
||||||
FlexEnd,
|
|
||||||
Center,
|
|
||||||
SpaceBetween,
|
|
||||||
SpaceAround,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class LineStyle {
|
|
||||||
None,
|
|
||||||
Hidden,
|
|
||||||
Dotted,
|
|
||||||
Dashed,
|
|
||||||
Solid,
|
|
||||||
Double,
|
|
||||||
Groove,
|
|
||||||
Ridge,
|
|
||||||
Inset,
|
|
||||||
Outset,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class ListStyleType {
|
|
||||||
None,
|
|
||||||
Disc,
|
|
||||||
Circle,
|
|
||||||
Square,
|
|
||||||
Decimal,
|
|
||||||
DecimalLeadingZero,
|
|
||||||
LowerAlpha,
|
|
||||||
LowerLatin,
|
|
||||||
LowerRoman,
|
|
||||||
UpperAlpha,
|
|
||||||
UpperLatin,
|
|
||||||
UpperRoman,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Overflow : u8 {
|
|
||||||
Auto,
|
|
||||||
Clip,
|
|
||||||
Hidden,
|
|
||||||
Scroll,
|
|
||||||
Visible,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Position {
|
|
||||||
Static,
|
|
||||||
Relative,
|
|
||||||
Absolute,
|
|
||||||
Fixed,
|
|
||||||
Sticky,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class PositionEdge {
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
Top,
|
|
||||||
Bottom,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Repeat : u8 {
|
|
||||||
NoRepeat,
|
|
||||||
Repeat,
|
|
||||||
Round,
|
|
||||||
Space,
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr StringView to_string(Repeat value)
|
constexpr StringView to_string(Repeat value)
|
||||||
{
|
{
|
||||||
switch (value) {
|
switch (value) {
|
||||||
|
@ -256,46 +88,6 @@ constexpr StringView to_string(Repeat value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class TextAlign {
|
|
||||||
Left,
|
|
||||||
Center,
|
|
||||||
Right,
|
|
||||||
Justify,
|
|
||||||
LibwebCenter,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class TextDecorationLine {
|
|
||||||
None,
|
|
||||||
Underline,
|
|
||||||
Overline,
|
|
||||||
LineThrough,
|
|
||||||
Blink,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class TextDecorationStyle {
|
|
||||||
Solid,
|
|
||||||
Double,
|
|
||||||
Dotted,
|
|
||||||
Dashed,
|
|
||||||
Wavy,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class TextJustify {
|
|
||||||
Auto,
|
|
||||||
None,
|
|
||||||
InterWord,
|
|
||||||
InterCharacter,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class TextTransform {
|
|
||||||
None,
|
|
||||||
Capitalize,
|
|
||||||
Uppercase,
|
|
||||||
Lowercase,
|
|
||||||
FullWidth,
|
|
||||||
FullSizeKana,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class TransformFunction {
|
enum class TransformFunction {
|
||||||
Matrix,
|
Matrix,
|
||||||
Translate,
|
Translate,
|
||||||
|
@ -310,37 +102,6 @@ enum class TransformFunction {
|
||||||
SkewY,
|
SkewY,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class VerticalAlign {
|
|
||||||
Baseline,
|
|
||||||
Bottom,
|
|
||||||
Middle,
|
|
||||||
Sub,
|
|
||||||
Super,
|
|
||||||
TextBottom,
|
|
||||||
TextTop,
|
|
||||||
Top,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class Visibility {
|
|
||||||
Visible,
|
|
||||||
Hidden,
|
|
||||||
Collapse,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class WhiteSpace {
|
|
||||||
Normal,
|
|
||||||
Pre,
|
|
||||||
Nowrap,
|
|
||||||
PreLine,
|
|
||||||
PreWrap,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class PointerEvents {
|
|
||||||
Auto,
|
|
||||||
All,
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
class StyleValue : public RefCounted<StyleValue> {
|
class StyleValue : public RefCounted<StyleValue> {
|
||||||
public:
|
public:
|
||||||
virtual ~StyleValue() = default;
|
virtual ~StyleValue() = default;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue