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 StyleRareInheritedData_h
     26 #define StyleRareInheritedData_h
     27 
     28 #include "core/rendering/style/DataRef.h"
     29 #include "core/rendering/style/StyleVariableData.h"
     30 #include "platform/Length.h"
     31 #include "platform/graphics/Color.h"
     32 #include "wtf/PassRefPtr.h"
     33 #include "wtf/RefCounted.h"
     34 #include "wtf/text/AtomicString.h"
     35 
     36 namespace WebCore {
     37 
     38 class CursorList;
     39 class QuotesData;
     40 class ShadowList;
     41 class StyleImage;
     42 
     43 // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties.
     44 // By grouping them together, we save space, and only allocate this object when someone
     45 // actually uses one of these properties.
     46 class StyleRareInheritedData : public RefCounted<StyleRareInheritedData> {
     47 public:
     48     static PassRefPtr<StyleRareInheritedData> create() { return adoptRef(new StyleRareInheritedData); }
     49     PassRefPtr<StyleRareInheritedData> copy() const { return adoptRef(new StyleRareInheritedData(*this)); }
     50     ~StyleRareInheritedData();
     51 
     52     bool operator==(const StyleRareInheritedData& o) const;
     53     bool operator!=(const StyleRareInheritedData& o) const
     54     {
     55         return !(*this == o);
     56     }
     57     bool shadowDataEquivalent(const StyleRareInheritedData&) const;
     58 
     59     RefPtr<StyleImage> listStyleImage;
     60 
     61     Color textStrokeColor;
     62     float textStrokeWidth;
     63     Color textFillColor;
     64     Color textEmphasisColor;
     65 
     66     Color visitedLinkTextStrokeColor;
     67     Color visitedLinkTextFillColor;
     68     Color visitedLinkTextEmphasisColor;
     69 
     70     RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed text drawing.
     71     AtomicString highlight; // Apple-specific extension for custom highlight rendering.
     72 
     73     RefPtr<CursorList> cursorData;
     74     Length indent;
     75     float m_effectiveZoom;
     76 
     77     // Paged media properties.
     78     short widows;
     79     short orphans;
     80     unsigned m_hasAutoWidows : 1;
     81     unsigned m_hasAutoOrphans : 1;
     82 
     83     unsigned textSecurity : 2; // ETextSecurity
     84     unsigned userModify : 2; // EUserModify (editing)
     85     unsigned wordBreak : 2; // EWordBreak
     86     unsigned overflowWrap : 1; // EOverflowWrap
     87     unsigned lineBreak : 3; // LineBreak
     88     unsigned resize : 2; // EResize
     89     unsigned userSelect : 2; // EUserSelect
     90     unsigned speak : 3; // ESpeak
     91     unsigned hyphens : 2; // Hyphens
     92     unsigned textEmphasisFill : 1; // TextEmphasisFill
     93     unsigned textEmphasisMark : 3; // TextEmphasisMark
     94     unsigned textEmphasisPosition : 1; // TextEmphasisPosition
     95     unsigned m_textAlignLast : 3; // TextAlignLast
     96     unsigned m_textJustify : 2; // TextJustify
     97     unsigned m_textOrientation : 2; // TextOrientation
     98     unsigned m_textIndentLine : 1; // TextIndentEachLine
     99     unsigned m_lineBoxContain: 7; // LineBoxContain
    100     // CSS Image Values Level 3
    101     unsigned m_imageRendering : 2; // EImageRendering
    102     unsigned m_lineSnap : 2; // LineSnap
    103     unsigned m_lineAlign : 1; // LineAlign
    104     unsigned m_textUnderlinePosition : 2; // TextUnderlinePosition
    105     unsigned m_rubyPosition : 1; // RubyPosition
    106     unsigned m_touchActionDelay : 1; // TouchActionDelay
    107 
    108     AtomicString hyphenationString;
    109     short hyphenationLimitBefore;
    110     short hyphenationLimitAfter;
    111     short hyphenationLimitLines;
    112 
    113     AtomicString locale;
    114 
    115     AtomicString textEmphasisCustomMark;
    116     RefPtr<QuotesData> quotes;
    117 
    118     AtomicString m_lineGrid;
    119     unsigned m_tabSize;
    120 
    121     Color tapHighlightColor;
    122 
    123     DataRef<StyleVariableData> m_variables;
    124 
    125 private:
    126     StyleRareInheritedData();
    127     StyleRareInheritedData(const StyleRareInheritedData&);
    128 };
    129 
    130 } // namespace WebCore
    131 
    132 #endif // StyleRareInheritedData_h
    133