diff options
Diffstat (limited to 'Source/WebCore/rendering/style/RenderStyleConstants.h')
| -rw-r--r-- | Source/WebCore/rendering/style/RenderStyleConstants.h | 278 |
1 files changed, 213 insertions, 65 deletions
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h index 11b428559..492f78c4d 100644 --- a/Source/WebCore/rendering/style/RenderStyleConstants.h +++ b/Source/WebCore/rendering/style/RenderStyleConstants.h @@ -26,8 +26,12 @@ #ifndef RenderStyleConstants_h #define RenderStyleConstants_h +#include <initializer_list> + namespace WebCore { +class TextStream; + static const size_t PrintColorAdjustBits = 1; enum PrintColorAdjust { PrintColorAdjustEconomy, @@ -46,16 +50,15 @@ enum PrintColorAdjust { // - StyleDifferenceLayout - A full layout is required. enum StyleDifference { StyleDifferenceEqual, -#if USE(ACCELERATED_COMPOSITING) StyleDifferenceRecompositeLayer, -#endif StyleDifferenceRepaint, StyleDifferenceRepaintIfTextOrBorderOrOutline, StyleDifferenceRepaintLayer, StyleDifferenceLayoutPositionedMovementOnly, StyleDifferenceSimplifiedLayout, StyleDifferenceSimplifiedLayoutAndPositionedMovement, - StyleDifferenceLayout + StyleDifferenceLayout, + StyleDifferenceNewStyle }; // When some style properties change, different amounts of work have to be done depending on @@ -63,26 +66,91 @@ enum StyleDifference { // A simple StyleDifference does not provide enough information so we return a bit mask of // StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too. enum StyleDifferenceContextSensitiveProperty { - ContextSensitivePropertyNone = 0, - ContextSensitivePropertyTransform = (1 << 0), - ContextSensitivePropertyOpacity = (1 << 1), - ContextSensitivePropertyFilter = (1 << 2) + ContextSensitivePropertyNone = 0, + ContextSensitivePropertyTransform = 1 << 0, + ContextSensitivePropertyOpacity = 1 << 1, + ContextSensitivePropertyFilter = 1 << 2, + ContextSensitivePropertyClipRect = 1 << 3, + ContextSensitivePropertyClipPath = 1 << 4, + ContextSensitivePropertyWillChange = 1 << 5, }; // Static pseudo styles. Dynamic ones are produced on the fly. -enum PseudoId { +enum PseudoId : unsigned char { // The order must be NOP ID, public IDs, and then internal IDs. NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, // Internal IDs follow: SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, - INPUT_LIST_BUTTON, AFTER_LAST_INTERNAL_PSEUDOID, - FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_ANCESTOR, ANIMATING_FULL_SCREEN_TRANSITION, FIRST_PUBLIC_PSEUDOID = FIRST_LINE, FIRST_INTERNAL_PSEUDOID = SCROLLBAR_THUMB, PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1) }; +class PseudoIdSet { +public: + PseudoIdSet() + : m_data(0) + { + } + + PseudoIdSet(std::initializer_list<PseudoId> initializerList) + : m_data(0) + { + for (PseudoId pseudoId : initializerList) + add(pseudoId); + } + + static PseudoIdSet fromMask(unsigned rawPseudoIdSet) + { + return PseudoIdSet(rawPseudoIdSet); + } + + bool has(PseudoId pseudoId) const + { + ASSERT((sizeof(m_data) * 8) > pseudoId); + return m_data & (1U << pseudoId); + } + + void add(PseudoId pseudoId) + { + ASSERT((sizeof(m_data) * 8) > pseudoId); + m_data |= (1U << pseudoId); + } + + void merge(PseudoIdSet source) + { + m_data |= source.m_data; + } + + PseudoIdSet operator &(const PseudoIdSet& pseudoIdSet) const + { + return PseudoIdSet(m_data & pseudoIdSet.m_data); + } + + PseudoIdSet operator |(const PseudoIdSet& pseudoIdSet) const + { + return PseudoIdSet(m_data | pseudoIdSet.m_data); + } + + explicit operator bool() const + { + return m_data; + } + + unsigned data() const { return m_data; } + + static ptrdiff_t dataMemoryOffset() { return OBJECT_OFFSETOF(PseudoIdSet, m_data); } + +private: + explicit PseudoIdSet(unsigned rawPseudoIdSet) + : m_data(rawPseudoIdSet) + { + } + + unsigned m_data; +}; + enum ColumnFill { ColumnFillBalance, ColumnFillAuto }; enum ColumnSpan { ColumnSpanNone = 0, ColumnSpanAll }; @@ -162,8 +230,8 @@ enum EFillLayerType { // CSS3 Background Values enum EFillSizeType { Contain, Cover, SizeLength, SizeNone }; -// CSS3 Background Position -enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge }; +// CSS3 <position> +enum class Edge { Top, Right, Bottom, Left }; // CSS3 Mask Source Types enum EMaskSourceType { MaskAlpha, MaskLuminance }; @@ -184,10 +252,13 @@ enum EBoxDirection { BNORMAL, BREVERSE }; // CSS3 Flexbox Properties enum EAlignContent { AlignContentFlexStart, AlignContentFlexEnd, AlignContentCenter, AlignContentSpaceBetween, AlignContentSpaceAround, AlignContentStretch }; -enum EAlignItems { AlignAuto, AlignFlexStart, AlignFlexEnd, AlignCenter, AlignStretch, AlignBaseline }; enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse }; enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse }; -enum EJustifyContent { JustifyFlexStart, JustifyFlexEnd, JustifyCenter, JustifySpaceBetween, JustifySpaceAround }; +enum ItemPosition {ItemPositionAuto, ItemPositionStretch, ItemPositionBaseline, ItemPositionLastBaseline, ItemPositionCenter, ItemPositionStart, ItemPositionEnd, ItemPositionSelfStart, ItemPositionSelfEnd, ItemPositionFlexStart, ItemPositionFlexEnd, ItemPositionLeft, ItemPositionRight}; +enum OverflowAlignment {OverflowAlignmentDefault, OverflowAlignmentUnsafe, OverflowAlignmentSafe}; +enum ItemPositionType {NonLegacyPosition, LegacyPosition}; +enum ContentPosition {ContentPositionAuto, ContentPositionBaseline, ContentPositionLastBaseline, ContentPositionCenter, ContentPositionStart, ContentPositionEnd, ContentPositionFlexStart, ContentPositionFlexEnd, ContentPositionLeft, ContentPositionRight}; +enum ContentDistributionType {ContentDistributionDefault, ContentDistributionSpaceBetween, ContentDistributionSpaceAround, ContentDistributionSpaceEvenly, ContentDistributionStretch}; enum ETextSecurity { TSNONE, TSDISC, TSCIRCLE, TSSQUARE @@ -216,10 +287,12 @@ enum ObjectFit { ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown }; -// Word Break Values. Matches WinIE, rather than CSS3 +enum AspectRatioType { + AspectRatioAuto, AspectRatioFromIntrinsic, AspectRatioFromDimensions, AspectRatioSpecified +}; enum EWordBreak { - NormalWordBreak, BreakAllWordBreak, BreakWordBreak + NormalWordBreak, BreakAllWordBreak, KeepAllWordBreak, BreakWordBreak }; enum EOverflowWrap { @@ -381,13 +454,15 @@ enum TextAlignLast { }; enum TextJustify { - TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyInterIdeograph, TextJustifyInterCluster, TextJustifyDistribute, TextJustifyKashida + TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyDistribute }; #endif // CSS3_TEXT enum TextDecorationSkipItems { TextDecorationSkipNone = 0, - TextDecorationSkipInk = 1 << 0 + TextDecorationSkipInk = 1 << 0, + TextDecorationSkipObjects = 1 << 1, + TextDecorationSkipAuto = 1 << 2 }; typedef unsigned TextDecorationSkip; @@ -396,10 +471,29 @@ enum TextUnderlinePosition { TextUnderlinePositionAuto = 0x1, TextUnderlinePositionAlphabetic = 0x2, TextUnderlinePositionUnder = 0x4 }; -enum EPageBreak { - PBAUTO, PBALWAYS, PBAVOID +enum TextZoom { + TextZoomNormal, TextZoomReset }; +enum BreakBetween { + AutoBreakBetween, AvoidBreakBetween, AvoidColumnBreakBetween, AvoidPageBreakBetween, AvoidRegionBreakBetween, ColumnBreakBetween, RegionBreakBetween, PageBreakBetween, LeftPageBreakBetween, RightPageBreakBetween, RectoPageBreakBetween, VersoPageBreakBetween +}; +bool alwaysPageBreak(BreakBetween); + +enum BreakInside { + AutoBreakInside, AvoidBreakInside, AvoidColumnBreakInside, AvoidPageBreakInside, AvoidRegionBreakInside +}; + +enum HangingPunctuation { + NoHangingPunctuation = 0, + FirstHangingPunctuation = 1 << 0, + LastHangingPunctuation = 1 << 1, + AllowEndHangingPunctuation = 1 << 2, + ForceEndHangingPunctuation = 1 << 3 +}; +inline HangingPunctuation operator| (HangingPunctuation a, HangingPunctuation b) { return HangingPunctuation(int(a) | int(b)); } +inline HangingPunctuation& operator|= (HangingPunctuation& a, HangingPunctuation b) { return a = a | b; } + enum EEmptyCell { SHOW, HIDE }; @@ -414,44 +508,44 @@ enum EVisibility { VISIBLE, HIDDEN, COLLAPSE }; enum ECursor { // The following must match the order in CSSValueKeywords.in. - CURSOR_AUTO, - CURSOR_CROSS, - CURSOR_DEFAULT, - CURSOR_POINTER, - CURSOR_MOVE, - CURSOR_VERTICAL_TEXT, - CURSOR_CELL, - CURSOR_CONTEXT_MENU, - CURSOR_ALIAS, - CURSOR_PROGRESS, - CURSOR_NO_DROP, - CURSOR_NOT_ALLOWED, - CURSOR_WEBKIT_ZOOM_IN, - CURSOR_WEBKIT_ZOOM_OUT, - CURSOR_E_RESIZE, - CURSOR_NE_RESIZE, - CURSOR_NW_RESIZE, - CURSOR_N_RESIZE, - CURSOR_SE_RESIZE, - CURSOR_SW_RESIZE, - CURSOR_S_RESIZE, - CURSOR_W_RESIZE, - CURSOR_EW_RESIZE, - CURSOR_NS_RESIZE, - CURSOR_NESW_RESIZE, - CURSOR_NWSE_RESIZE, - CURSOR_COL_RESIZE, - CURSOR_ROW_RESIZE, - CURSOR_TEXT, - CURSOR_WAIT, - CURSOR_HELP, - CURSOR_ALL_SCROLL, - CURSOR_WEBKIT_GRAB, - CURSOR_WEBKIT_GRABBING, + CursorAuto, + CursorCross, + CursorDefault, + CursorPointer, + CursorMove, + CursorVerticalText, + CursorCell, + CursorContextMenu, + CursorAlias, + CursorProgress, + CursorNoDrop, + CursorNotAllowed, + CursorZoomIn, + CursorZoomOut, + CursorEResize, + CursorNeResize, + CursorNwResize, + CursorNResize, + CursorSeResize, + CursorSwResize, + CursorSResize, + CursorWResize, + CursorEwResize, + CursorNsResize, + CursorNeswResize, + CursorNwseResize, + CursorColResize, + CursorRowResize, + CursorText, + CursorWait, + CursorHelp, + CursorAllScroll, + CursorWebkitGrab, + CursorWebkitGrabbing, // The following are handled as exceptions so don't need to match. - CURSOR_COPY, - CURSOR_NONE + CursorCopy, + CursorNone }; #if ENABLE(CURSOR_VISIBILITY) @@ -463,13 +557,15 @@ enum CursorVisibility { // The order of this enum must match the order of the display values in CSSValueKeywords.in. enum EDisplay { - INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, INLINE_BLOCK, + INLINE, BLOCK, LIST_ITEM, COMPACT, INLINE_BLOCK, TABLE, INLINE_TABLE, TABLE_ROW_GROUP, TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW, TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL, TABLE_CAPTION, BOX, INLINE_BOX, - FLEX, INLINE_FLEX, + FLEX, WEBKIT_FLEX, INLINE_FLEX, WEBKIT_INLINE_FLEX, +#if ENABLE(CSS_GRID_LAYOUT) GRID, INLINE_GRID, +#endif NONE }; @@ -508,11 +604,17 @@ enum TextEmphasisPositions { }; typedef unsigned TextEmphasisPosition; -enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight }; +enum class TextOrientation { Mixed, Upright, Sideways }; enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis }; -enum EImageRendering { ImageRenderingAuto = 0, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingCrispEdges }; +enum EImageRendering { + ImageRenderingAuto = 0, + ImageRenderingOptimizeSpeed, + ImageRenderingOptimizeQuality, + ImageRenderingCrispEdges, + ImageRenderingPixelated +}; enum ImageResolutionSource { ImageResolutionSpecified = 0, ImageResolutionFromImage }; @@ -530,13 +632,27 @@ enum LineSnap { LineSnapNone, LineSnapBaseline, LineSnapContain }; enum LineAlign { LineAlignNone, LineAlignEdges }; -enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlowMaximum, WrapFlowClear }; +enum RubyPosition { RubyPositionBefore, RubyPositionAfter, RubyPositionInterCharacter }; -enum WrapThrough { WrapThroughWrap, WrapThroughNone }; +#if ENABLE(CSS_GRID_LAYOUT) +static const size_t GridAutoFlowBits = 4; +enum InternalGridAutoFlowAlgorithm { + InternalAutoFlowAlgorithmSparse = 0x1, + InternalAutoFlowAlgorithmDense = 0x2, +}; -enum RubyPosition { RubyPositionBefore, RubyPositionAfter }; +enum InternalGridAutoFlowDirection { + InternalAutoFlowDirectionRow = 0x4, + InternalAutoFlowDirectionColumn = 0x8 +}; -enum GridAutoFlow { AutoFlowNone, AutoFlowColumn, AutoFlowRow }; +enum GridAutoFlow { + AutoFlowRow = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionRow, + AutoFlowColumn = InternalAutoFlowAlgorithmSparse | InternalAutoFlowDirectionColumn, + AutoFlowRowDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionRow, + AutoFlowColumnDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionColumn +}; +#endif // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows). static const float maximumAllowedFontSize = 1000000.0f; @@ -546,7 +662,39 @@ enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine }; enum TextIndentType { TextIndentNormal, TextIndentHanging }; #endif -enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, BoundingBox }; +enum Isolation { IsolationAuto, IsolationIsolate }; + +// Fill, Stroke, ViewBox are just used for SVG. +enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox }; + +#if ENABLE(TOUCH_EVENTS) +enum class TouchAction { + Auto, + Manipulation +}; +#endif + +#if ENABLE(CSS_SCROLL_SNAP) +enum class ScrollSnapType { + None, + Proximity, + Mandatory +}; +#endif + +#if ENABLE(CSS_TRAILING_WORD) +enum class TrailingWord { + Auto, + PartiallyBalanced +}; +#endif + +TextStream& operator<<(TextStream&, EFillSizeType); +TextStream& operator<<(TextStream&, EFillAttachment); +TextStream& operator<<(TextStream&, EFillBox); +TextStream& operator<<(TextStream&, EFillRepeat); +TextStream& operator<<(TextStream&, EMaskSourceType); +TextStream& operator<<(TextStream&, Edge); } // namespace WebCore |
