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 "CSSWrapShapes.h"
29 #include "CounterDirectives.h"
30 #include "CursorData.h"
32 #include "FillLayer.h"
33 #include "LineClampValue.h"
34 #include "NinePieceImage.h"
35 #include <wtf/OwnPtr.h>
36 #include <wtf/PassRefPtr.h>
37 #include <wtf/Vector.h>
42 class CSSStyleSelector;
44 class StyleDeprecatedFlexibleBoxData;
45 #if ENABLE(CSS_FILTERS)
46 class StyleFilterData;
48 class StyleFlexibleBoxData;
49 #if ENABLE(CSS_GRID_LAYOUT)
52 class StyleMarqueeData;
53 class StyleMultiColData;
54 class StyleReflection;
55 class StyleTransformData;
60 #if ENABLE(DASHBOARD_SUPPORT)
61 struct StyleDashboardRegion;
65 // StyleRareNonInheritedData::m_pageSize is meaningful only when
66 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
68 PAGE_SIZE_AUTO, // size: auto
69 PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
70 PAGE_SIZE_AUTO_PORTRAIT, // size: portrait
71 PAGE_SIZE_RESOLVED // Size is fully resolved.
74 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties.
75 // By grouping them together, we save space, and only allocate this object when someone
76 // actually uses one of these properties.
77 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
79 static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
80 PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
81 ~StyleRareNonInheritedData();
83 bool operator==(const StyleRareNonInheritedData&) const;
84 bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
86 bool contentDataEquivalent(const StyleRareNonInheritedData&) const;
87 bool counterDataEquivalent(const StyleRareNonInheritedData&) const;
88 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const;
89 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const;
90 bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
91 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
93 float opacity; // Whether or not we're transparent.
95 float m_aspectRatioDenominator;
96 float m_aspectRatioNumerator;
98 short m_counterIncrement;
102 Length m_perspectiveOriginX;
103 Length m_perspectiveOriginY;
105 LineClampValue lineClamp; // An Apple extension.
106 #if ENABLE(DASHBOARD_SUPPORT)
107 Vector<StyleDashboardRegion> m_dashboardRegions;
110 DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
111 DataRef<StyleFlexibleBoxData> m_flexibleBox;
112 DataRef<StyleMarqueeData> m_marquee; // Marquee properties
113 DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties
114 DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
116 #if ENABLE(CSS_FILTERS)
117 DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
120 #if ENABLE(CSS_GRID_LAYOUT)
121 DataRef<StyleGridData> m_grid;
124 OwnPtr<ContentData> m_content;
125 OwnPtr<CounterDirectiveMap> m_counterDirectives;
127 OwnPtr<ShadowData> m_boxShadow; // For box-shadow decorations.
129 RefPtr<StyleReflection> m_boxReflect;
131 OwnPtr<AnimationList> m_animations;
132 OwnPtr<AnimationList> m_transitions;
135 NinePieceImage m_maskBoxImage;
137 LengthSize m_pageSize;
139 RefPtr<CSSWrapShape> m_wrapShapeInside;
140 RefPtr<CSSWrapShape> m_wrapShapeOutside;
142 Length m_wrapPadding;
144 Color m_visitedLinkBackgroundColor;
145 Color m_visitedLinkOutlineColor;
146 Color m_visitedLinkBorderLeftColor;
147 Color m_visitedLinkBorderRightColor;
148 Color m_visitedLinkBorderTopColor;
149 Color m_visitedLinkBorderBottomColor;
151 AtomicString m_flowThread;
152 AtomicString m_regionThread;
153 unsigned m_regionOverflow : 1; // RegionOverflow
155 unsigned m_regionBreakAfter : 2; // EPageBreak
156 unsigned m_regionBreakBefore : 2; // EPageBreak
157 unsigned m_regionBreakInside : 2; // EPageBreak
159 unsigned m_pageSizeType : 2; // PageSizeType
160 unsigned m_transformStyle3D : 1; // ETransformStyle3D
161 unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
163 unsigned userDrag : 2; // EUserDrag
164 unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
165 unsigned marginBeforeCollapse : 2; // EMarginCollapse
166 unsigned marginAfterCollapse : 2; // EMarginCollapse
167 unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
168 unsigned m_appearance : 6; // EAppearance
169 unsigned m_borderFit : 1; // EBorderFit
170 unsigned m_textCombine : 1; // CSS3 text-combine properties
172 unsigned m_wrapFlow: 3; // WrapFlow
173 unsigned m_wrapThrough: 1; // WrapThrough
175 bool m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
176 #if USE(ACCELERATED_COMPOSITING)
177 bool m_runningAcceleratedAnimation : 1;
181 StyleRareNonInheritedData();
182 StyleRareNonInheritedData(const StyleRareNonInheritedData&);
185 } // namespace WebCore
187 #endif // StyleRareNonInheritedData_h