Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / style / StyleRareNonInheritedData.h
blobafd5c17c082d4746874fba621181eea73c767435
1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
25 #ifndef StyleRareNonInheritedData_h
26 #define StyleRareNonInheritedData_h
28 #include "core/CoreExport.h"
29 #include "core/css/StyleColor.h"
30 #include "core/layout/ClipPathOperation.h"
31 #include "core/style/BasicShapes.h"
32 #include "core/style/CounterDirectives.h"
33 #include "core/style/CursorData.h"
34 #include "core/style/DataRef.h"
35 #include "core/style/FillLayer.h"
36 #include "core/style/ComputedStyleConstants.h"
37 #include "core/style/LineClampValue.h"
38 #include "core/style/NinePieceImage.h"
39 #include "core/style/ShapeValue.h"
40 #include "core/style/StyleContentAlignmentData.h"
41 #include "core/style/StyleScrollSnapData.h"
42 #include "core/style/StyleSelfAlignmentData.h"
43 #include "platform/LengthPoint.h"
44 #include "wtf/OwnPtr.h"
45 #include "wtf/PassRefPtr.h"
46 #include "wtf/Vector.h"
48 namespace blink {
50 class ContentData;
51 class CSSAnimationData;
52 class CSSTransitionData;
53 class LengthSize;
54 class ShadowList;
55 class StyleDeprecatedFlexibleBoxData;
56 class StyleFilterData;
57 class StyleFlexibleBoxData;
58 class StyleGridData;
59 class StyleGridItemData;
60 class StyleMultiColData;
61 class StyleReflection;
62 class StyleTransformData;
63 class StyleWillChangeData;
65 // Page size type.
66 // StyleRareNonInheritedData::m_pageSize is meaningful only when
67 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
68 enum PageSizeType {
69 PAGE_SIZE_AUTO, // size: auto
70 PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
71 PAGE_SIZE_AUTO_PORTRAIT, // size: portrait
72 PAGE_SIZE_RESOLVED // Size is fully resolved.
75 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties.
76 // By grouping them together, we save space, and only allocate this object when someone
77 // actually uses one of these properties.
78 class CORE_EXPORT StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
79 public:
80 static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
81 PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
82 ~StyleRareNonInheritedData();
84 bool operator==(const StyleRareNonInheritedData&) const;
85 bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
87 bool contentDataEquivalent(const StyleRareNonInheritedData&) const;
88 bool counterDataEquivalent(const StyleRareNonInheritedData&) const;
89 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const;
90 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const;
91 bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
92 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
93 bool shapeOutsideDataEquivalent(const StyleRareNonInheritedData&) const;
94 bool clipPathDataEquivalent(const StyleRareNonInheritedData&) const;
95 bool hasFilters() const;
96 bool hasBackdropFilters() const;
97 bool hasOpacity() const { return opacity < 1; }
99 float opacity; // Whether or not we're transparent.
101 float m_perspective;
102 float m_shapeImageThreshold;
104 int m_order;
106 LengthPoint m_perspectiveOrigin;
107 LengthPoint m_objectPosition;
109 LineClampValue lineClamp; // An Apple extension.
110 DraggableRegionMode m_draggableRegionMode;
112 DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
113 DataRef<StyleFlexibleBoxData> m_flexibleBox;
114 DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties
115 DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
116 DataRef<StyleWillChangeData> m_willChange; // CSS Will Change
118 DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
119 DataRef<StyleFilterData> m_backdropFilter; // Backdrop filter operations (url, sepia, blur, etc.)
121 DataRef<StyleGridData> m_grid;
122 DataRef<StyleGridItemData> m_gridItem;
123 DataRef<StyleScrollSnapData> m_scrollSnap;
125 OwnPtrWillBePersistent<ContentData> m_content;
126 OwnPtr<CounterDirectiveMap> m_counterDirectives;
127 OwnPtr<CSSAnimationData> m_animations;
128 OwnPtr<CSSTransitionData> m_transitions;
130 RefPtr<ShadowList> m_boxShadow;
132 RefPtr<StyleReflection> m_boxReflect;
134 RefPtrWillBePersistent<ShapeValue> m_shapeOutside;
135 RefPtr<ClipPathOperation> m_clipPath;
137 FillLayer m_mask;
138 NinePieceImage m_maskBoxImage;
140 FloatSize m_pageSize;
141 Length m_shapeMargin;
143 StyleColor m_textDecorationColor;
144 StyleColor m_visitedLinkTextDecorationColor;
145 StyleColor m_visitedLinkBackgroundColor;
146 StyleColor m_visitedLinkOutlineColor;
147 StyleColor m_visitedLinkBorderLeftColor;
148 StyleColor m_visitedLinkBorderRightColor;
149 StyleColor m_visitedLinkBorderTopColor;
150 StyleColor m_visitedLinkBorderBottomColor;
152 Vector<String> m_callbackSelectors;
154 StyleContentAlignmentData m_alignContent;
155 StyleSelfAlignmentData m_alignItems;
156 StyleSelfAlignmentData m_alignSelf;
157 StyleContentAlignmentData m_justifyContent;
158 StyleSelfAlignmentData m_justifyItems;
159 StyleSelfAlignmentData m_justifySelf;
161 unsigned m_pageSizeType : 2; // PageSizeType
162 unsigned m_transformStyle3D : 1; // ETransformStyle3D
163 unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
165 unsigned userDrag : 2; // EUserDrag
166 unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
167 unsigned marginBeforeCollapse : 2; // EMarginCollapse
168 unsigned marginAfterCollapse : 2; // EMarginCollapse
169 unsigned m_appearance : 6; // EAppearance
171 unsigned m_textDecorationStyle : 3; // TextDecorationStyle
172 unsigned m_wrapFlow: 3; // WrapFlow
173 unsigned m_wrapThrough: 1; // WrapThrough
175 unsigned m_hasCurrentOpacityAnimation : 1;
176 unsigned m_hasCurrentTransformAnimation : 1;
177 unsigned m_hasCurrentFilterAnimation : 1;
178 unsigned m_hasCurrentBackdropFilterAnimation : 1;
179 unsigned m_runningOpacityAnimationOnCompositor : 1;
180 unsigned m_runningTransformAnimationOnCompositor : 1;
181 unsigned m_runningFilterAnimationOnCompositor : 1;
182 unsigned m_runningBackdropFilterAnimationOnCompositor : 1;
184 unsigned m_effectiveBlendMode: 5; // EBlendMode
186 unsigned m_touchAction : TouchActionBits; // TouchAction
188 unsigned m_objectFit : 3; // ObjectFit
190 unsigned m_isolation : 1; // Isolation
192 // ScrollBehavior. 'scroll-behavior' has 2 accepted values, but ScrollBehavior has a third
193 // value (that can only be specified using CSSOM scroll APIs) so 2 bits are needed.
194 unsigned m_scrollBehavior: 2;
196 unsigned m_scrollSnapType: 2; // ScrollSnapType
198 // Plugins require accelerated compositing for reasons external to blink.
199 // In which case, we need to update the ComputedStyle on the LayoutEmbeddedObject,
200 // so store this bit so that the style actually changes when the plugin
201 // becomes composited.
202 unsigned m_requiresAcceleratedCompositingForExternalReasons: 1;
204 // Whether the transform (if it exists) is stored in the element's inline style.
205 unsigned m_hasInlineTransform : 1;
206 unsigned m_resize : 2; // EResize
207 unsigned m_hasCompositorProxy : 1;
209 // Style adjustment for appearance is disabled when certain properties are set.
210 unsigned m_hasAuthorBackground : 1; // Whether there is a author-defined background.
211 unsigned m_hasAuthorBorder : 1; // Whether there is a author-defined border.
213 private:
214 StyleRareNonInheritedData();
215 StyleRareNonInheritedData(const StyleRareNonInheritedData&);
218 } // namespace blink
220 #endif // StyleRareNonInheritedData_h