OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef StyleRareInheritedData_h | 25 #ifndef StyleRareInheritedData_h |
26 #define StyleRareInheritedData_h | 26 #define StyleRareInheritedData_h |
27 | 27 |
28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
| 29 #include "core/css/StyleAutoColor.h" |
29 #include "core/css/StyleColor.h" | 30 #include "core/css/StyleColor.h" |
30 #include "core/style/TextSizeAdjust.h" | 31 #include "core/style/TextSizeAdjust.h" |
31 #include "platform/Length.h" | 32 #include "platform/Length.h" |
32 #include "platform/graphics/Color.h" | 33 #include "platform/graphics/Color.h" |
33 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
34 #include "platform/text/TabSize.h" | 35 #include "platform/text/TabSize.h" |
35 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
37 #include "wtf/RefVector.h" | 38 #include "wtf/RefVector.h" |
38 #include "wtf/text/AtomicString.h" | 39 #include "wtf/text/AtomicString.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 : StyleColor(m_textStrokeColor); | 81 : StyleColor(m_textStrokeColor); |
81 } | 82 } |
82 StyleColor textFillColor() const { | 83 StyleColor textFillColor() const { |
83 return m_textFillColorIsCurrentColor ? StyleColor::currentColor() | 84 return m_textFillColorIsCurrentColor ? StyleColor::currentColor() |
84 : StyleColor(m_textFillColor); | 85 : StyleColor(m_textFillColor); |
85 } | 86 } |
86 StyleColor textEmphasisColor() const { | 87 StyleColor textEmphasisColor() const { |
87 return m_textEmphasisColorIsCurrentColor ? StyleColor::currentColor() | 88 return m_textEmphasisColorIsCurrentColor ? StyleColor::currentColor() |
88 : StyleColor(m_textEmphasisColor); | 89 : StyleColor(m_textEmphasisColor); |
89 } | 90 } |
| 91 StyleAutoColor caretColor() const { |
| 92 if (m_caretColorIsCurrentColor) |
| 93 return StyleAutoColor::currentColor(); |
| 94 if (m_caretColorIsAuto) |
| 95 return StyleAutoColor::autoColor(); |
| 96 return StyleAutoColor(m_caretColor); |
| 97 } |
90 StyleColor visitedLinkTextStrokeColor() const { | 98 StyleColor visitedLinkTextStrokeColor() const { |
91 return m_visitedLinkTextStrokeColorIsCurrentColor | 99 return m_visitedLinkTextStrokeColorIsCurrentColor |
92 ? StyleColor::currentColor() | 100 ? StyleColor::currentColor() |
93 : StyleColor(m_visitedLinkTextStrokeColor); | 101 : StyleColor(m_visitedLinkTextStrokeColor); |
94 } | 102 } |
95 StyleColor visitedLinkTextFillColor() const { | 103 StyleColor visitedLinkTextFillColor() const { |
96 return m_visitedLinkTextFillColorIsCurrentColor | 104 return m_visitedLinkTextFillColorIsCurrentColor |
97 ? StyleColor::currentColor() | 105 ? StyleColor::currentColor() |
98 : StyleColor(m_visitedLinkTextFillColor); | 106 : StyleColor(m_visitedLinkTextFillColor); |
99 } | 107 } |
100 StyleColor visitedLinkTextEmphasisColor() const { | 108 StyleColor visitedLinkTextEmphasisColor() const { |
101 return m_visitedLinkTextEmphasisColorIsCurrentColor | 109 return m_visitedLinkTextEmphasisColorIsCurrentColor |
102 ? StyleColor::currentColor() | 110 ? StyleColor::currentColor() |
103 : StyleColor(m_visitedLinkTextEmphasisColor); | 111 : StyleColor(m_visitedLinkTextEmphasisColor); |
104 } | 112 } |
| 113 StyleAutoColor visitedLinkCaretColor() const { |
| 114 if (m_visitedLinkCaretColorIsCurrentColor) |
| 115 return StyleAutoColor::currentColor(); |
| 116 if (m_visitedLinkCaretColorIsAuto) |
| 117 return StyleAutoColor::autoColor(); |
| 118 return StyleAutoColor(m_visitedLinkCaretColor); |
| 119 } |
105 | 120 |
106 void setTextStrokeColor(const StyleColor& color) { | 121 void setTextStrokeColor(const StyleColor& color) { |
107 m_textStrokeColor = color.resolve(Color()); | 122 m_textStrokeColor = color.resolve(Color()); |
108 m_textStrokeColorIsCurrentColor = color.isCurrentColor(); | 123 m_textStrokeColorIsCurrentColor = color.isCurrentColor(); |
109 } | 124 } |
110 void setTextFillColor(const StyleColor& color) { | 125 void setTextFillColor(const StyleColor& color) { |
111 m_textFillColor = color.resolve(Color()); | 126 m_textFillColor = color.resolve(Color()); |
112 m_textFillColorIsCurrentColor = color.isCurrentColor(); | 127 m_textFillColorIsCurrentColor = color.isCurrentColor(); |
113 } | 128 } |
114 void setTextEmphasisColor(const StyleColor& color) { | 129 void setTextEmphasisColor(const StyleColor& color) { |
115 m_textEmphasisColor = color.resolve(Color()); | 130 m_textEmphasisColor = color.resolve(Color()); |
116 m_textEmphasisColorIsCurrentColor = color.isCurrentColor(); | 131 m_textEmphasisColorIsCurrentColor = color.isCurrentColor(); |
117 } | 132 } |
| 133 void setCaretColor(const StyleAutoColor& color) { |
| 134 m_caretColor = color.resolve(Color()); |
| 135 m_caretColorIsCurrentColor = color.isCurrentColor(); |
| 136 m_caretColorIsAuto = color.isAutoColor(); |
| 137 } |
118 void setVisitedLinkTextStrokeColor(const StyleColor& color) { | 138 void setVisitedLinkTextStrokeColor(const StyleColor& color) { |
119 m_visitedLinkTextStrokeColor = color.resolve(Color()); | 139 m_visitedLinkTextStrokeColor = color.resolve(Color()); |
120 m_visitedLinkTextStrokeColorIsCurrentColor = color.isCurrentColor(); | 140 m_visitedLinkTextStrokeColorIsCurrentColor = color.isCurrentColor(); |
121 } | 141 } |
122 void setVisitedLinkTextFillColor(const StyleColor& color) { | 142 void setVisitedLinkTextFillColor(const StyleColor& color) { |
123 m_visitedLinkTextFillColor = color.resolve(Color()); | 143 m_visitedLinkTextFillColor = color.resolve(Color()); |
124 m_visitedLinkTextFillColorIsCurrentColor = color.isCurrentColor(); | 144 m_visitedLinkTextFillColorIsCurrentColor = color.isCurrentColor(); |
125 } | 145 } |
126 void setVisitedLinkTextEmphasisColor(const StyleColor& color) { | 146 void setVisitedLinkTextEmphasisColor(const StyleColor& color) { |
127 m_visitedLinkTextEmphasisColor = color.resolve(Color()); | 147 m_visitedLinkTextEmphasisColor = color.resolve(Color()); |
128 m_visitedLinkTextEmphasisColorIsCurrentColor = color.isCurrentColor(); | 148 m_visitedLinkTextEmphasisColorIsCurrentColor = color.isCurrentColor(); |
129 } | 149 } |
| 150 void setVisitedLinkCaretColor(const StyleAutoColor& color) { |
| 151 m_visitedLinkCaretColor = color.resolve(Color()); |
| 152 m_visitedLinkCaretColorIsCurrentColor = color.isCurrentColor(); |
| 153 m_visitedLinkCaretColorIsAuto = color.isAutoColor(); |
| 154 } |
130 | 155 |
131 Color m_textStrokeColor; | 156 Color m_textStrokeColor; |
132 float textStrokeWidth; | 157 float textStrokeWidth; |
133 Color m_textFillColor; | 158 Color m_textFillColor; |
134 Color m_textEmphasisColor; | 159 Color m_textEmphasisColor; |
| 160 Color m_caretColor; |
135 | 161 |
136 Color m_visitedLinkTextStrokeColor; | 162 Color m_visitedLinkTextStrokeColor; |
137 Color m_visitedLinkTextFillColor; | 163 Color m_visitedLinkTextFillColor; |
138 Color m_visitedLinkTextEmphasisColor; | 164 Color m_visitedLinkTextEmphasisColor; |
| 165 Color m_visitedLinkCaretColor; |
139 | 166 |
140 RefPtr<ShadowList> | 167 RefPtr<ShadowList> |
141 textShadow; // Our text shadow information for shadowed text drawing. | 168 textShadow; // Our text shadow information for shadowed text drawing. |
142 AtomicString | 169 AtomicString |
143 highlight; // Apple-specific extension for custom highlight rendering. | 170 highlight; // Apple-specific extension for custom highlight rendering. |
144 | 171 |
145 Persistent<CursorList> cursorData; | 172 Persistent<CursorList> cursorData; |
146 | 173 |
147 Length indent; | 174 Length indent; |
148 float m_effectiveZoom; | 175 float m_effectiveZoom; |
149 | 176 |
150 // Paged media properties. | 177 // Paged media properties. |
151 short widows; | 178 short widows; |
152 short orphans; | 179 short orphans; |
153 | 180 |
154 unsigned m_textStrokeColorIsCurrentColor : 1; | 181 unsigned m_textStrokeColorIsCurrentColor : 1; |
155 unsigned m_textFillColorIsCurrentColor : 1; | 182 unsigned m_textFillColorIsCurrentColor : 1; |
156 unsigned m_textEmphasisColorIsCurrentColor : 1; | 183 unsigned m_textEmphasisColorIsCurrentColor : 1; |
| 184 unsigned m_caretColorIsCurrentColor : 1; |
| 185 unsigned m_caretColorIsAuto : 1; |
157 unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1; | 186 unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1; |
158 unsigned m_visitedLinkTextFillColorIsCurrentColor : 1; | 187 unsigned m_visitedLinkTextFillColorIsCurrentColor : 1; |
159 unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1; | 188 unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1; |
| 189 unsigned m_visitedLinkCaretColorIsCurrentColor : 1; |
| 190 unsigned m_visitedLinkCaretColorIsAuto : 1; |
160 | 191 |
161 unsigned textSecurity : 2; // ETextSecurity | 192 unsigned textSecurity : 2; // ETextSecurity |
162 unsigned userModify : 2; // EUserModify (editing) | 193 unsigned userModify : 2; // EUserModify (editing) |
163 unsigned wordBreak : 2; // EWordBreak | 194 unsigned wordBreak : 2; // EWordBreak |
164 unsigned overflowWrap : 1; // EOverflowWrap | 195 unsigned overflowWrap : 1; // EOverflowWrap |
165 unsigned lineBreak : 3; // LineBreak | 196 unsigned lineBreak : 3; // LineBreak |
166 unsigned userSelect : 2; // EUserSelect | 197 unsigned userSelect : 2; // EUserSelect |
167 unsigned speak : 3; // ESpeak | 198 unsigned speak : 3; // ESpeak |
168 unsigned hyphens : 2; // Hyphens | 199 unsigned hyphens : 2; // Hyphens |
169 unsigned textEmphasisFill : 1; // TextEmphasisFill | 200 unsigned textEmphasisFill : 1; // TextEmphasisFill |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 TextSizeAdjust m_textSizeAdjust; | 241 TextSizeAdjust m_textSizeAdjust; |
211 | 242 |
212 private: | 243 private: |
213 StyleRareInheritedData(); | 244 StyleRareInheritedData(); |
214 StyleRareInheritedData(const StyleRareInheritedData&); | 245 StyleRareInheritedData(const StyleRareInheritedData&); |
215 }; | 246 }; |
216 | 247 |
217 } // namespace blink | 248 } // namespace blink |
218 | 249 |
219 #endif // StyleRareInheritedData_h | 250 #endif // StyleRareInheritedData_h |
OLD | NEW |