OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 * | 19 * |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 #include "core/rendering/style/StyleRareInheritedData.h" | 23 #include "core/rendering/style/StyleRareInheritedData.h" |
24 | 24 |
| 25 #include "core/rendering/style/AppliedTextDecorationList.h" |
25 #include "core/rendering/style/CursorList.h" | 26 #include "core/rendering/style/CursorList.h" |
26 #include "core/rendering/style/QuotesData.h" | 27 #include "core/rendering/style/QuotesData.h" |
27 #include "core/rendering/style/RenderStyle.h" | 28 #include "core/rendering/style/RenderStyle.h" |
28 #include "core/rendering/style/RenderStyleConstants.h" | 29 #include "core/rendering/style/RenderStyleConstants.h" |
29 #include "core/rendering/style/ShadowList.h" | 30 #include "core/rendering/style/ShadowList.h" |
30 #include "core/rendering/style/StyleImage.h" | 31 #include "core/rendering/style/StyleImage.h" |
31 | 32 |
32 namespace WebCore { | 33 namespace WebCore { |
33 | 34 |
34 struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI
nheritedData> { | 35 struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI
nheritedData> { |
35 void* styleImage; | 36 void* styleImage; |
36 Color firstColor; | 37 Color firstColor; |
37 float firstFloat; | 38 float firstFloat; |
38 Color colors[5]; | 39 Color colors[5]; |
39 void* ownPtrs[1]; | 40 void* ownPtrs[1]; |
40 AtomicString atomicStrings[4]; | 41 AtomicString atomicStrings[4]; |
41 void* refPtrs[2]; | 42 void* refPtrs[3]; |
42 Length lengths[1]; | 43 Length lengths[1]; |
43 float secondFloat; | 44 float secondFloat; |
44 unsigned m_bitfields[2]; | 45 unsigned m_bitfields[2]; |
45 short pagedMediaShorts[2]; | 46 short pagedMediaShorts[2]; |
46 unsigned unsigneds[1]; | 47 unsigned unsigneds[1]; |
47 short hyphenationShorts[3]; | 48 short hyphenationShorts[3]; |
48 | 49 |
49 Color touchColors; | 50 Color touchColors; |
50 }; | 51 }; |
51 | 52 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 , m_rubyPosition(o.m_rubyPosition) | 143 , m_rubyPosition(o.m_rubyPosition) |
143 , m_touchActionDelay(o.m_touchActionDelay) | 144 , m_touchActionDelay(o.m_touchActionDelay) |
144 , hyphenationString(o.hyphenationString) | 145 , hyphenationString(o.hyphenationString) |
145 , hyphenationLimitBefore(o.hyphenationLimitBefore) | 146 , hyphenationLimitBefore(o.hyphenationLimitBefore) |
146 , hyphenationLimitAfter(o.hyphenationLimitAfter) | 147 , hyphenationLimitAfter(o.hyphenationLimitAfter) |
147 , hyphenationLimitLines(o.hyphenationLimitLines) | 148 , hyphenationLimitLines(o.hyphenationLimitLines) |
148 , locale(o.locale) | 149 , locale(o.locale) |
149 , textEmphasisCustomMark(o.textEmphasisCustomMark) | 150 , textEmphasisCustomMark(o.textEmphasisCustomMark) |
150 , m_tabSize(o.m_tabSize) | 151 , m_tabSize(o.m_tabSize) |
151 , tapHighlightColor(o.tapHighlightColor) | 152 , tapHighlightColor(o.tapHighlightColor) |
| 153 , appliedTextDecorations(o.appliedTextDecorations) |
152 { | 154 { |
153 } | 155 } |
154 | 156 |
155 StyleRareInheritedData::~StyleRareInheritedData() | 157 StyleRareInheritedData::~StyleRareInheritedData() |
156 { | 158 { |
157 } | 159 } |
158 | 160 |
159 static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) | 161 static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) |
160 { | 162 { |
161 if (c1 == c2) | 163 if (c1 == c2) |
162 return true; | 164 return true; |
163 if ((!c1 && c2) || (c1 && !c2)) | 165 if ((!c1 && c2) || (c1 && !c2)) |
164 return false; | 166 return false; |
165 return (*c1 == *c2); | 167 return (*c1 == *c2); |
166 } | 168 } |
167 | 169 |
| 170 static bool appliedTextDecorationsEquivalent(const AppliedTextDecorationList* d1
, const AppliedTextDecorationList* d2) |
| 171 { |
| 172 return (d1 == d2) || (d1 && d2 && *d1 == *d2); |
| 173 } |
| 174 |
168 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const | 175 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const |
169 { | 176 { |
170 return m_textStrokeColor == o.m_textStrokeColor | 177 return m_textStrokeColor == o.m_textStrokeColor |
171 && textStrokeWidth == o.textStrokeWidth | 178 && textStrokeWidth == o.textStrokeWidth |
172 && m_textFillColor == o.m_textFillColor | 179 && m_textFillColor == o.m_textFillColor |
173 && m_textEmphasisColor == o.m_textEmphasisColor | 180 && m_textEmphasisColor == o.m_textEmphasisColor |
174 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor | 181 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor |
175 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor | 182 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor |
176 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor | 183 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor |
177 && tapHighlightColor == o.tapHighlightColor | 184 && tapHighlightColor == o.tapHighlightColor |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 && m_textIndentLine == o.m_textIndentLine | 219 && m_textIndentLine == o.m_textIndentLine |
213 && m_lineBoxContain == o.m_lineBoxContain | 220 && m_lineBoxContain == o.m_lineBoxContain |
214 && hyphenationString == o.hyphenationString | 221 && hyphenationString == o.hyphenationString |
215 && locale == o.locale | 222 && locale == o.locale |
216 && textEmphasisCustomMark == o.textEmphasisCustomMark | 223 && textEmphasisCustomMark == o.textEmphasisCustomMark |
217 && QuotesData::equals(quotes.get(), o.quotes.get()) | 224 && QuotesData::equals(quotes.get(), o.quotes.get()) |
218 && m_tabSize == o.m_tabSize | 225 && m_tabSize == o.m_tabSize |
219 && m_imageRendering == o.m_imageRendering | 226 && m_imageRendering == o.m_imageRendering |
220 && m_textUnderlinePosition == o.m_textUnderlinePosition | 227 && m_textUnderlinePosition == o.m_textUnderlinePosition |
221 && m_rubyPosition == o.m_rubyPosition | 228 && m_rubyPosition == o.m_rubyPosition |
222 && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.g
et()); | 229 && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.g
et()) |
| 230 && appliedTextDecorationsEquivalent(appliedTextDecorations.get(), o.appl
iedTextDecorations.get()); |
223 } | 231 } |
224 | 232 |
225 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData&
o) const | 233 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData&
o) const |
226 { | 234 { |
227 if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) | 235 if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) |
228 return false; | 236 return false; |
229 if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) | 237 if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) |
230 return false; | 238 return false; |
231 return true; | 239 return true; |
232 } | 240 } |
233 | 241 |
234 } // namespace WebCore | 242 } // namespace WebCore |
OLD | NEW |