Home | History | Annotate | Download | only in style
      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/rendering/ClipPathOperation.h"
     29 #include "core/rendering/style/BasicShapes.h"
     30 #include "core/rendering/style/CounterDirectives.h"
     31 #include "core/rendering/style/CursorData.h"
     32 #include "core/rendering/style/DataRef.h"
     33 #include "core/rendering/style/FillLayer.h"
     34 #include "core/rendering/style/LineClampValue.h"
     35 #include "core/rendering/style/NinePieceImage.h"
     36 #include "core/rendering/style/RenderStyleConstants.h"
     37 #include "core/rendering/style/ShapeValue.h"
     38 #include "platform/LengthPoint.h"
     39 #include "wtf/OwnPtr.h"
     40 #include "wtf/PassRefPtr.h"
     41 #include "wtf/Vector.h"
     42 
     43 namespace WebCore {
     44 
     45 class ContentData;
     46 class CSSAnimationDataList;
     47 class ShadowList;
     48 class StyleDeprecatedFlexibleBoxData;
     49 class StyleFilterData;
     50 class StyleFlexibleBoxData;
     51 class StyleGridData;
     52 class StyleGridItemData;
     53 class StyleMarqueeData;
     54 class StyleMultiColData;
     55 class StyleReflection;
     56 class StyleResolver;
     57 class StyleTransformData;
     58 
     59 struct LengthSize;
     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 hasFilters() const;
     90     bool hasOpacity() const { return opacity < 1; }
     91 
     92     float opacity; // Whether or not we're transparent.
     93 
     94     float m_aspectRatioDenominator;
     95     float m_aspectRatioNumerator;
     96 
     97     float m_perspective;
     98     Length m_perspectiveOriginX;
     99     Length m_perspectiveOriginY;
    100 
    101     LineClampValue lineClamp; // An Apple extension.
    102     DraggableRegionMode m_draggableRegionMode;
    103 
    104     DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
    105     DataRef<StyleFlexibleBoxData> m_flexibleBox;
    106     DataRef<StyleMarqueeData> m_marquee; // Marquee properties
    107     DataRef<StyleMultiColData> m_multiCol; //  CSS3 multicol properties
    108     DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
    109 
    110     DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
    111 
    112     DataRef<StyleGridData> m_grid;
    113     DataRef<StyleGridItemData> m_gridItem;
    114 
    115     OwnPtr<ContentData> m_content;
    116     OwnPtr<CounterDirectiveMap> m_counterDirectives;
    117 
    118     RefPtr<ShadowList> m_boxShadow;
    119 
    120     RefPtr<StyleReflection> m_boxReflect;
    121 
    122     OwnPtr<CSSAnimationDataList> m_animations;
    123     OwnPtr<CSSAnimationDataList> m_transitions;
    124 
    125     FillLayer m_mask;
    126     NinePieceImage m_maskBoxImage;
    127 
    128     LengthSize m_pageSize;
    129 
    130     RefPtr<ShapeValue> m_shapeInside;
    131     RefPtr<ShapeValue> m_shapeOutside;
    132     Length m_shapeMargin;
    133     Length m_shapePadding;
    134     float m_shapeImageThreshold;
    135 
    136     RefPtr<ClipPathOperation> m_clipPath;
    137 
    138     Color m_textDecorationColor;
    139     Color m_visitedLinkTextDecorationColor;
    140     Color m_visitedLinkBackgroundColor;
    141     Color m_visitedLinkOutlineColor;
    142     Color m_visitedLinkBorderLeftColor;
    143     Color m_visitedLinkBorderRightColor;
    144     Color m_visitedLinkBorderTopColor;
    145     Color m_visitedLinkBorderBottomColor;
    146 
    147     int m_order;
    148 
    149     LengthPoint m_objectPosition;
    150 
    151     Vector<String> m_callbackSelectors;
    152 
    153     AtomicString m_flowThread;
    154     AtomicString m_regionThread;
    155     unsigned m_regionFragment : 1; // RegionFragment
    156 
    157     unsigned m_regionBreakAfter : 2; // EPageBreak
    158     unsigned m_regionBreakBefore : 2; // EPageBreak
    159     unsigned m_regionBreakInside : 2; // EPageBreak
    160 
    161     unsigned m_pageSizeType : 2; // PageSizeType
    162     unsigned m_transformStyle3D : 1; // ETransformStyle3D
    163     unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
    164 
    165     unsigned m_alignContent : 3; // EAlignContent
    166     unsigned m_alignItems : 3; // EAlignItems
    167     unsigned m_alignSelf : 3; // EAlignItems
    168     unsigned m_justifyContent : 3; // EJustifyContent
    169 
    170     unsigned userDrag : 2; // EUserDrag
    171     unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
    172     unsigned marginBeforeCollapse : 2; // EMarginCollapse
    173     unsigned marginAfterCollapse : 2; // EMarginCollapse
    174     unsigned m_appearance : 6; // EAppearance
    175     unsigned m_borderFit : 1; // EBorderFit
    176     unsigned m_textCombine : 1; // CSS3 text-combine properties
    177 
    178     unsigned m_textDecorationStyle : 3; // TextDecorationStyle
    179     unsigned m_wrapFlow: 3; // WrapFlow
    180     unsigned m_wrapThrough: 1; // WrapThrough
    181 
    182     unsigned m_runningAcceleratedAnimation : 1;
    183 
    184     unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
    185 
    186     unsigned m_effectiveBlendMode: 5; // EBlendMode
    187 
    188     unsigned m_touchAction : TouchActionBits; // TouchAction
    189 
    190     unsigned m_objectFit : 3; // ObjectFit
    191 
    192     unsigned m_isolation : 1; // Isolation
    193 
    194 private:
    195     StyleRareNonInheritedData();
    196     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
    197 };
    198 
    199 } // namespace WebCore
    200 
    201 #endif // StyleRareNonInheritedData_h
    202