OLD | NEW |
| (Empty) |
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/layout/style/DataRef.h" | |
30 #include "platform/Length.h" | |
31 #include "platform/graphics/Color.h" | |
32 #include "platform/text/TabSize.h" | |
33 #include "wtf/PassRefPtr.h" | |
34 #include "wtf/RefCounted.h" | |
35 #include "wtf/RefVector.h" | |
36 #include "wtf/text/AtomicString.h" | |
37 | |
38 namespace blink { | |
39 | |
40 class AppliedTextDecoration; | |
41 class CursorData; | |
42 class QuotesData; | |
43 class ShadowList; | |
44 class StyleImage; | |
45 | |
46 typedef RefVector<AppliedTextDecoration> AppliedTextDecorationList; | |
47 typedef RefVector<CursorData> CursorList; | |
48 | |
49 // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific prop
erties. | |
50 // By grouping them together, we save space, and only allocate this object when
someone | |
51 // actually uses one of these properties. | |
52 class StyleRareInheritedData : public RefCounted<StyleRareInheritedData> { | |
53 public: | |
54 static PassRefPtr<StyleRareInheritedData> create() { return adoptRef(new Sty
leRareInheritedData); } | |
55 PassRefPtr<StyleRareInheritedData> copy() const { return adoptRef(new StyleR
areInheritedData(*this)); } | |
56 ~StyleRareInheritedData(); | |
57 | |
58 bool operator==(const StyleRareInheritedData&) const; | |
59 bool operator!=(const StyleRareInheritedData& o) const | |
60 { | |
61 return !(*this == o); | |
62 } | |
63 bool shadowDataEquivalent(const StyleRareInheritedData&) const; | |
64 bool quotesDataEquivalent(const StyleRareInheritedData&) const; | |
65 | |
66 RefPtr<StyleImage> listStyleImage; | |
67 | |
68 StyleColor textStrokeColor() const { return m_textStrokeColorIsCurrentColor
? StyleColor::currentColor() : StyleColor(m_textStrokeColor); } | |
69 StyleColor textFillColor() const { return m_textFillColorIsCurrentColor ? St
yleColor::currentColor() : StyleColor(m_textFillColor); } | |
70 StyleColor textEmphasisColor() const { return m_textEmphasisColorIsCurrentCo
lor ? StyleColor::currentColor() : StyleColor(m_textEmphasisColor); } | |
71 StyleColor visitedLinkTextStrokeColor() const { return m_visitedLinkTextStro
keColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTex
tStrokeColor); } | |
72 StyleColor visitedLinkTextFillColor() const { return m_visitedLinkTextFillCo
lorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextFil
lColor); } | |
73 StyleColor visitedLinkTextEmphasisColor() const { return m_visitedLinkTextEm
phasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLin
kTextEmphasisColor); } | |
74 | |
75 void setTextStrokeColor(const StyleColor& color) { m_textStrokeColor = color
.resolve(Color()); m_textStrokeColorIsCurrentColor = color.isCurrentColor(); } | |
76 void setTextFillColor(const StyleColor& color) { m_textFillColor = color.res
olve(Color()); m_textFillColorIsCurrentColor = color.isCurrentColor(); } | |
77 void setTextEmphasisColor(const StyleColor& color) { m_textEmphasisColor = c
olor.resolve(Color()); m_textEmphasisColorIsCurrentColor = color.isCurrentColor(
); } | |
78 void setVisitedLinkTextStrokeColor(const StyleColor& color) { m_visitedLinkT
extStrokeColor = color.resolve(Color()); m_visitedLinkTextStrokeColorIsCurrentCo
lor = color.isCurrentColor(); } | |
79 void setVisitedLinkTextFillColor(const StyleColor& color) { m_visitedLinkTex
tFillColor = color.resolve(Color()); m_visitedLinkTextFillColorIsCurrentColor =
color.isCurrentColor(); } | |
80 void setVisitedLinkTextEmphasisColor(const StyleColor& color) { m_visitedLin
kTextEmphasisColor = color.resolve(Color()); m_visitedLinkTextEmphasisColorIsCur
rentColor = color.isCurrentColor(); } | |
81 | |
82 Color m_textStrokeColor; | |
83 float textStrokeWidth; | |
84 Color m_textFillColor; | |
85 Color m_textEmphasisColor; | |
86 | |
87 Color m_visitedLinkTextStrokeColor; | |
88 Color m_visitedLinkTextFillColor; | |
89 Color m_visitedLinkTextEmphasisColor; | |
90 | |
91 RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed t
ext drawing. | |
92 AtomicString highlight; // Apple-specific extension for custom highlight ren
dering. | |
93 | |
94 RefPtr<CursorList> cursorData; | |
95 Length indent; | |
96 float m_effectiveZoom; | |
97 | |
98 // Paged media properties. | |
99 short widows; | |
100 short orphans; | |
101 unsigned m_hasAutoOrphans : 1; | |
102 | |
103 unsigned m_textStrokeColorIsCurrentColor : 1; | |
104 unsigned m_textFillColorIsCurrentColor : 1; | |
105 unsigned m_textEmphasisColorIsCurrentColor : 1; | |
106 unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1; | |
107 unsigned m_visitedLinkTextFillColorIsCurrentColor : 1; | |
108 unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1; | |
109 | |
110 unsigned textSecurity : 2; // ETextSecurity | |
111 unsigned userModify : 2; // EUserModify (editing) | |
112 unsigned wordBreak : 2; // EWordBreak | |
113 unsigned overflowWrap : 1; // EOverflowWrap | |
114 unsigned lineBreak : 3; // LineBreak | |
115 unsigned userSelect : 2; // EUserSelect | |
116 unsigned speak : 3; // ESpeak | |
117 unsigned hyphens : 2; // Hyphens | |
118 unsigned textEmphasisFill : 1; // TextEmphasisFill | |
119 unsigned textEmphasisMark : 3; // TextEmphasisMark | |
120 unsigned textEmphasisPosition : 1; // TextEmphasisPosition | |
121 unsigned m_textAlignLast : 3; // TextAlignLast | |
122 unsigned m_textJustify : 2; // TextJustify | |
123 unsigned m_textOrientation : 2; // TextOrientation | |
124 unsigned m_textIndentLine : 1; // TextIndentEachLine | |
125 unsigned m_textIndentType : 1; // TextIndentHanging | |
126 unsigned m_lineBoxContain: 7; // LineBoxContain | |
127 // CSS Image Values Level 3 | |
128 unsigned m_imageRendering : 3; // EImageRendering | |
129 unsigned m_textUnderlinePosition : 1; // TextUnderlinePosition | |
130 unsigned m_rubyPosition : 1; // RubyPosition | |
131 | |
132 // Though will-change is not itself an inherited property, the intent | |
133 // expressed by 'will-change: contents' includes descendants. | |
134 unsigned m_subtreeWillChangeContents : 1; | |
135 | |
136 unsigned m_selfOrAncestorHasDirAutoAttribute : 1; | |
137 | |
138 AtomicString hyphenationString; | |
139 short hyphenationLimitBefore; | |
140 short hyphenationLimitAfter; | |
141 short hyphenationLimitLines; | |
142 | |
143 AtomicString locale; | |
144 | |
145 AtomicString textEmphasisCustomMark; | |
146 RefPtr<QuotesData> quotes; | |
147 | |
148 Color tapHighlightColor; | |
149 | |
150 RefPtr<AppliedTextDecorationList> appliedTextDecorations; | |
151 TabSize m_tabSize; | |
152 | |
153 private: | |
154 StyleRareInheritedData(); | |
155 StyleRareInheritedData(const StyleRareInheritedData&); | |
156 }; | |
157 | |
158 } // namespace blink | |
159 | |
160 #endif // StyleRareInheritedData_h | |
OLD | NEW |