Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / style / StyleRareInheritedData.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 StyleRareInheritedData_h
26 #define StyleRareInheritedData_h
27
28 #include "core/css/StyleColor.h"
29 #include "core/rendering/style/DataRef.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     StyleColor textStrokeColor;
62     float textStrokeWidth;
63     StyleColor textFillColor;
64     StyleColor textEmphasisColor;
65
66     StyleColor visitedLinkTextStrokeColor;
67     StyleColor visitedLinkTextFillColor;
68     StyleColor 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_textUnderlinePosition : 2; // TextUnderlinePosition
103     unsigned m_rubyPosition : 1; // RubyPosition
104     unsigned m_touchActionDelay : 1; // TouchActionDelay
105
106     AtomicString hyphenationString;
107     short hyphenationLimitBefore;
108     short hyphenationLimitAfter;
109     short hyphenationLimitLines;
110
111     AtomicString locale;
112
113     AtomicString textEmphasisCustomMark;
114     RefPtr<QuotesData> quotes;
115
116     unsigned m_tabSize;
117
118     Color tapHighlightColor;
119
120 private:
121     StyleRareInheritedData();
122     StyleRareInheritedData(const StyleRareInheritedData&);
123 };
124
125 } // namespace WebCore
126
127 #endif // StyleRareInheritedData_h