Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / style / StyleRareNonInheritedData.h
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)
7  *
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.
12  *
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.
17  *
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.
22  *
23  */
24
25 #ifndef StyleRareNonInheritedData_h
26 #define StyleRareNonInheritedData_h
27
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"
43
44 namespace blink {
45
46 class ContentData;
47 class CSSAnimationData;
48 class CSSTransitionData;
49 class LengthSize;
50 class ShadowList;
51 class StyleDeprecatedFlexibleBoxData;
52 class StyleFilterData;
53 class StyleFlexibleBoxData;
54 class StyleGridData;
55 class StyleGridItemData;
56 class StyleMultiColData;
57 class StyleReflection;
58 class StyleTransformData;
59 class StyleWillChangeData;
60
61 // Page size type.
62 // StyleRareNonInheritedData::m_pageSize is meaningful only when
63 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
64 enum PageSizeType {
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.
69 };
70
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> {
75 public:
76     static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
77     PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
78     ~StyleRareNonInheritedData();
79
80     bool operator==(const StyleRareNonInheritedData&) const;
81     bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
82
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; }
93
94     float opacity; // Whether or not we're transparent.
95
96     float m_perspective;
97     LengthPoint m_perspectiveOrigin;
98
99     LineClampValue lineClamp; // An Apple extension.
100     DraggableRegionMode m_draggableRegionMode;
101
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
107
108     DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
109
110     DataRef<StyleGridData> m_grid;
111     DataRef<StyleGridItemData> m_gridItem;
112
113     OwnPtr<ContentData> m_content;
114     OwnPtr<CounterDirectiveMap> m_counterDirectives;
115
116     RefPtr<ShadowList> m_boxShadow;
117
118     RefPtr<StyleReflection> m_boxReflect;
119
120     OwnPtr<CSSAnimationData> m_animations;
121     OwnPtr<CSSTransitionData> m_transitions;
122
123     FillLayer m_mask;
124     NinePieceImage m_maskBoxImage;
125
126     LengthSize m_pageSize;
127
128     RefPtr<ShapeValue> m_shapeOutside;
129     Length m_shapeMargin;
130     float m_shapeImageThreshold;
131
132     RefPtr<ClipPathOperation> m_clipPath;
133
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;
142
143     int m_order;
144
145     LengthPoint m_objectPosition;
146
147     Vector<String> m_callbackSelectors;
148
149     unsigned m_pageSizeType : 2; // PageSizeType
150     unsigned m_transformStyle3D : 1; // ETransformStyle3D
151     unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
152
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
161
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
168
169     unsigned m_textDecorationStyle : 3; // TextDecorationStyle
170     unsigned m_wrapFlow: 3; // WrapFlow
171     unsigned m_wrapThrough: 1; // WrapThrough
172
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;
179
180     unsigned m_effectiveBlendMode: 5; // EBlendMode
181
182     unsigned m_touchAction : TouchActionBits; // TouchAction
183
184     unsigned m_objectFit : 3; // ObjectFit
185
186     unsigned m_isolation : 1; // Isolation
187
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.
191
192     unsigned m_justifySelf : 4; // ItemPosition
193     unsigned m_justifySelfOverflowAlignment : 2; // OverflowAlignment
194
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;
198
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;
204
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
208
209 private:
210     StyleRareNonInheritedData();
211     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
212 };
213
214 } // namespace blink
215
216 #endif // StyleRareNonInheritedData_h