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/css/StyleColor.h"
29 #include "core/rendering/ClipPathOperation.h"
30 #include "core/rendering/style/BasicShapes.h"
31 #include "core/rendering/style/CounterDirectives.h"
32 #include "core/rendering/style/CursorData.h"
33 #include "core/rendering/style/DataRef.h"
34 #include "core/rendering/style/FillLayer.h"
35 #include "core/rendering/style/LineClampValue.h"
36 #include "core/rendering/style/NinePieceImage.h"
37 #include "core/rendering/style/RenderStyleConstants.h"
38 #include "core/rendering/style/ShapeValue.h"
39 #include "platform/LengthPoint.h"
40 #include "wtf/OwnPtr.h"
41 #include "wtf/PassRefPtr.h"
42 #include "wtf/Vector.h"
47 class CSSAnimationData;
48 class CSSTransitionData;
51 class StyleDeprecatedFlexibleBoxData;
52 class StyleFilterData;
53 class StyleFlexibleBoxData;
55 class StyleGridItemData;
56 class StyleMultiColData;
57 class StyleReflection;
58 class StyleTransformData;
59 class StyleWillChangeData;
62 // StyleRareNonInheritedData::m_pageSize is meaningful only when
63 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
65 PAGE_SIZE_AUTO, // size: auto
66 PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
67 PAGE_SIZE_AUTO_PORTRAIT, // size: portrait
68 PAGE_SIZE_RESOLVED // Size is fully resolved.
71 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties.
72 // By grouping them together, we save space, and only allocate this object when someone
73 // actually uses one of these properties.
74 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
76 static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
77 PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
78 ~StyleRareNonInheritedData();
80 bool operator==(const StyleRareNonInheritedData&) const;
81 bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
83 bool contentDataEquivalent(const StyleRareNonInheritedData&) const;
84 bool counterDataEquivalent(const StyleRareNonInheritedData&) const;
85 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const;
86 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const;
87 bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
88 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
89 bool shapeOutsideDataEquivalent(const StyleRareNonInheritedData&) const;
90 bool clipPathDataEquivalent(const StyleRareNonInheritedData&) const;
91 bool hasFilters() const;
92 bool hasOpacity() const { return opacity < 1; }
94 float opacity; // Whether or not we're transparent.
97 LengthPoint m_perspectiveOrigin;
99 LineClampValue lineClamp; // An Apple extension.
100 DraggableRegionMode m_draggableRegionMode;
102 DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
103 DataRef<StyleFlexibleBoxData> m_flexibleBox;
104 DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties
105 DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
106 DataRef<StyleWillChangeData> m_willChange; // CSS Will Change
108 DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
110 DataRef<StyleGridData> m_grid;
111 DataRef<StyleGridItemData> m_gridItem;
113 OwnPtr<ContentData> m_content;
114 OwnPtr<CounterDirectiveMap> m_counterDirectives;
116 RefPtr<ShadowList> m_boxShadow;
118 RefPtr<StyleReflection> m_boxReflect;
120 OwnPtr<CSSAnimationData> m_animations;
121 OwnPtr<CSSTransitionData> m_transitions;
124 NinePieceImage m_maskBoxImage;
126 LengthSize m_pageSize;
128 RefPtr<ShapeValue> m_shapeOutside;
129 Length m_shapeMargin;
130 float m_shapeImageThreshold;
132 RefPtr<ClipPathOperation> m_clipPath;
134 StyleColor m_textDecorationColor;
135 StyleColor m_visitedLinkTextDecorationColor;
136 StyleColor m_visitedLinkBackgroundColor;
137 StyleColor m_visitedLinkOutlineColor;
138 StyleColor m_visitedLinkBorderLeftColor;
139 StyleColor m_visitedLinkBorderRightColor;
140 StyleColor m_visitedLinkBorderTopColor;
141 StyleColor m_visitedLinkBorderBottomColor;
145 LengthPoint m_objectPosition;
147 Vector<String> m_callbackSelectors;
149 unsigned m_pageSizeType : 2; // PageSizeType
150 unsigned m_transformStyle3D : 1; // ETransformStyle3D
151 unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
153 unsigned m_alignContent : 3; // EAlignContent
154 unsigned m_alignItems : 4; // ItemPosition
155 unsigned m_alignItemsOverflowAlignment : 2; // OverflowAlignment
156 unsigned m_alignSelf : 4; // ItemPosition
157 unsigned m_alignSelfOverflowAlignment : 2; // OverflowAlignment
158 unsigned m_justifyContent : 4; // ContentPosition
159 unsigned m_justifyContentDistribution : 3; // ContentDistributionType
160 unsigned m_justifyContentOverflowAlignment : 2; // OverflowAlignment
162 unsigned userDrag : 2; // EUserDrag
163 unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
164 unsigned marginBeforeCollapse : 2; // EMarginCollapse
165 unsigned marginAfterCollapse : 2; // EMarginCollapse
166 unsigned m_appearance : 6; // EAppearance
167 unsigned m_textCombine : 1; // CSS3 text-combine properties
169 unsigned m_textDecorationStyle : 3; // TextDecorationStyle
170 unsigned m_wrapFlow: 3; // WrapFlow
171 unsigned m_wrapThrough: 1; // WrapThrough
173 unsigned m_hasCurrentOpacityAnimation : 1;
174 unsigned m_hasCurrentTransformAnimation : 1;
175 unsigned m_hasCurrentFilterAnimation : 1;
176 unsigned m_runningOpacityAnimationOnCompositor : 1;
177 unsigned m_runningTransformAnimationOnCompositor : 1;
178 unsigned m_runningFilterAnimationOnCompositor : 1;
180 unsigned m_effectiveBlendMode: 5; // EBlendMode
182 unsigned m_touchAction : TouchActionBits; // TouchAction
184 unsigned m_objectFit : 3; // ObjectFit
186 unsigned m_isolation : 1; // Isolation
188 unsigned m_justifyItems : 4; // ItemPosition
189 unsigned m_justifyItemsOverflowAlignment : 2; // OverflowAlignment
190 unsigned m_justifyItemsPositionType: 1; // Whether or not alignment uses the 'legacy' keyword.
192 unsigned m_justifySelf : 4; // ItemPosition
193 unsigned m_justifySelfOverflowAlignment : 2; // OverflowAlignment
195 // ScrollBehavior. 'scroll-behavior' has 2 accepted values, but ScrollBehavior has a third
196 // value (that can only be specified using CSSOM scroll APIs) so 2 bits are needed.
197 unsigned m_scrollBehavior: 2;
199 // Plugins require accelerated compositing for reasons external to blink.
200 // In which case, we need to update the RenderStyle on the RenderEmbeddedObject,
201 // so store this bit so that the style actually changes when the plugin
202 // becomes composited.
203 unsigned m_requiresAcceleratedCompositingForExternalReasons: 1;
205 // Whether the transform (if it exists) is stored in the element's inline style.
206 unsigned m_hasInlineTransform : 1;
207 unsigned m_resize : 2; // EResize
210 StyleRareNonInheritedData();
211 StyleRareNonInheritedData(const StyleRareNonInheritedData&);
216 #endif // StyleRareNonInheritedData_h