1 /* 2 * Copyright (C) 2000 Lars Knoll (knoll (at) kde.org) 3 * (C) 2000 Antti Koivisto (koivisto (at) kde.org) 4 * (C) 2000 Dirk Mueller (mueller (at) kde.org) 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2006 Graham Dennis (graham.dennis (at) 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/ShapeValue.h" 38 #include "wtf/OwnPtr.h" 39 #include "wtf/PassRefPtr.h" 40 #include "wtf/Vector.h" 41 42 namespace WebCore { 43 44 class CSSAnimationDataList; 45 class ShadowData; 46 class StyleDeprecatedFlexibleBoxData; 47 class StyleFilterData; 48 class StyleFlexibleBoxData; 49 class StyleGridData; 50 class StyleGridItemData; 51 class StyleMarqueeData; 52 class StyleMultiColData; 53 class StyleReflection; 54 class StyleResolver; 55 class StyleTransformData; 56 57 class ContentData; 58 struct LengthSize; 59 60 // Page size type. 61 // StyleRareNonInheritedData::m_pageSize is meaningful only when 62 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED. 63 enum PageSizeType { 64 PAGE_SIZE_AUTO, // size: auto 65 PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape 66 PAGE_SIZE_AUTO_PORTRAIT, // size: portrait 67 PAGE_SIZE_RESOLVED // Size is fully resolved. 68 }; 69 70 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties. 71 // By grouping them together, we save space, and only allocate this object when someone 72 // actually uses one of these properties. 73 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> { 74 public: 75 static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); } 76 PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); } 77 ~StyleRareNonInheritedData(); 78 79 bool operator==(const StyleRareNonInheritedData&) const; 80 bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); } 81 82 bool contentDataEquivalent(const StyleRareNonInheritedData&) const; 83 bool counterDataEquivalent(const StyleRareNonInheritedData&) const; 84 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const; 85 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const; 86 bool animationDataEquivalent(const StyleRareNonInheritedData&) const; 87 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; 88 89 float opacity; // Whether or not we're transparent. 90 91 float m_aspectRatioDenominator; 92 float m_aspectRatioNumerator; 93 94 float m_perspective; 95 Length m_perspectiveOriginX; 96 Length m_perspectiveOriginY; 97 98 LineClampValue lineClamp; // An Apple extension. 99 DraggableRegionMode m_draggableRegionMode; 100 101 DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties 102 DataRef<StyleFlexibleBoxData> m_flexibleBox; 103 DataRef<StyleMarqueeData> m_marquee; // Marquee properties 104 DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties 105 DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.) 106 107 DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.) 108 109 DataRef<StyleGridData> m_grid; 110 DataRef<StyleGridItemData> m_gridItem; 111 112 OwnPtr<ContentData> m_content; 113 OwnPtr<CounterDirectiveMap> m_counterDirectives; 114 115 OwnPtr<ShadowData> m_boxShadow; // For box-shadow decorations. 116 117 RefPtr<StyleReflection> m_boxReflect; 118 119 OwnPtr<CSSAnimationDataList> m_animations; 120 OwnPtr<CSSAnimationDataList> m_transitions; 121 122 FillLayer m_mask; 123 NinePieceImage m_maskBoxImage; 124 125 LengthSize m_pageSize; 126 127 RefPtr<ShapeValue> m_shapeInside; 128 RefPtr<ShapeValue> m_shapeOutside; 129 Length m_shapeMargin; 130 Length m_shapePadding; 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 AtomicString m_flowThread; 146 AtomicString m_regionThread; 147 unsigned m_regionFragment : 1; // RegionFragment 148 149 unsigned m_regionBreakAfter : 2; // EPageBreak 150 unsigned m_regionBreakBefore : 2; // EPageBreak 151 unsigned m_regionBreakInside : 2; // EPageBreak 152 153 unsigned m_pageSizeType : 2; // PageSizeType 154 unsigned m_transformStyle3D : 1; // ETransformStyle3D 155 unsigned m_backfaceVisibility : 1; // EBackfaceVisibility 156 157 unsigned m_alignContent : 3; // EAlignContent 158 unsigned m_alignItems : 3; // EAlignItems 159 unsigned m_alignSelf : 3; // EAlignItems 160 unsigned m_justifyContent : 3; // EJustifyContent 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_borderFit : 1; // EBorderFit 168 unsigned m_textCombine : 1; // CSS3 text-combine properties 169 170 unsigned m_textDecorationStyle : 3; // TextDecorationStyle 171 unsigned m_wrapFlow: 3; // WrapFlow 172 unsigned m_wrapThrough: 1; // WrapThrough 173 174 unsigned m_runningAcceleratedAnimation : 1; 175 176 unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified. 177 178 unsigned m_effectiveBlendMode: 5; // EBlendMode 179 180 unsigned m_touchAction : 1; // TouchAction 181 182 private: 183 StyleRareNonInheritedData(); 184 StyleRareNonInheritedData(const StyleRareNonInheritedData&); 185 }; 186 187 } // namespace WebCore 188 189 #endif // StyleRareNonInheritedData_h 190