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