Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: Source/core/rendering/style/StyleRareInheritedData.cpp

Issue 219633002: Proper support for multiple text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Resolve decoration colors dynamically. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/AppliedTextDecoration.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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 , m_rubyPosition(o.m_rubyPosition) 145 , m_rubyPosition(o.m_rubyPosition)
145 , m_touchActionDelay(o.m_touchActionDelay) 146 , m_touchActionDelay(o.m_touchActionDelay)
146 , hyphenationString(o.hyphenationString) 147 , hyphenationString(o.hyphenationString)
147 , hyphenationLimitBefore(o.hyphenationLimitBefore) 148 , hyphenationLimitBefore(o.hyphenationLimitBefore)
148 , hyphenationLimitAfter(o.hyphenationLimitAfter) 149 , hyphenationLimitAfter(o.hyphenationLimitAfter)
149 , hyphenationLimitLines(o.hyphenationLimitLines) 150 , hyphenationLimitLines(o.hyphenationLimitLines)
150 , locale(o.locale) 151 , locale(o.locale)
151 , textEmphasisCustomMark(o.textEmphasisCustomMark) 152 , textEmphasisCustomMark(o.textEmphasisCustomMark)
152 , m_tabSize(o.m_tabSize) 153 , m_tabSize(o.m_tabSize)
153 , tapHighlightColor(o.tapHighlightColor) 154 , tapHighlightColor(o.tapHighlightColor)
155 , appliedTextDecorations(o.appliedTextDecorations)
154 { 156 {
155 } 157 }
156 158
157 StyleRareInheritedData::~StyleRareInheritedData() 159 StyleRareInheritedData::~StyleRareInheritedData()
158 { 160 {
159 } 161 }
160 162
161 static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) 163 static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2)
162 { 164 {
163 if (c1 == c2) 165 if (c1 == c2)
164 return true; 166 return true;
165 if ((!c1 && c2) || (c1 && !c2)) 167 if ((!c1 && c2) || (c1 && !c2))
166 return false; 168 return false;
167 return (*c1 == *c2); 169 return (*c1 == *c2);
168 } 170 }
169 171
172 static bool appliedTextDecorationsEquivalent(const AppliedTextDecorationList* d1 , const AppliedTextDecorationList* d2)
173 {
174 return (d1 == d2) || (d1 && d2 && *d1 == *d2);
175 }
176
170 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const 177 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
171 { 178 {
172 return m_textStrokeColor == o.m_textStrokeColor 179 return m_textStrokeColor == o.m_textStrokeColor
173 && textStrokeWidth == o.textStrokeWidth 180 && textStrokeWidth == o.textStrokeWidth
174 && m_textFillColor == o.m_textFillColor 181 && m_textFillColor == o.m_textFillColor
175 && m_textEmphasisColor == o.m_textEmphasisColor 182 && m_textEmphasisColor == o.m_textEmphasisColor
176 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor 183 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor
177 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor 184 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor
178 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor 185 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor
179 && tapHighlightColor == o.tapHighlightColor 186 && tapHighlightColor == o.tapHighlightColor
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 && m_textIndentType == o.m_textIndentType 222 && m_textIndentType == o.m_textIndentType
216 && m_lineBoxContain == o.m_lineBoxContain 223 && m_lineBoxContain == o.m_lineBoxContain
217 && hyphenationString == o.hyphenationString 224 && hyphenationString == o.hyphenationString
218 && locale == o.locale 225 && locale == o.locale
219 && textEmphasisCustomMark == o.textEmphasisCustomMark 226 && textEmphasisCustomMark == o.textEmphasisCustomMark
220 && quotes.get() == o.quotes.get() 227 && quotes.get() == o.quotes.get()
221 && m_tabSize == o.m_tabSize 228 && m_tabSize == o.m_tabSize
222 && m_imageRendering == o.m_imageRendering 229 && m_imageRendering == o.m_imageRendering
223 && m_textUnderlinePosition == o.m_textUnderlinePosition 230 && m_textUnderlinePosition == o.m_textUnderlinePosition
224 && m_rubyPosition == o.m_rubyPosition 231 && m_rubyPosition == o.m_rubyPosition
225 && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.g et()); 232 && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.g et())
233 && appliedTextDecorationsEquivalent(appliedTextDecorations.get(), o.appl iedTextDecorations.get());
226 } 234 }
227 235
228 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const 236 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
229 { 237 {
230 if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) 238 if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow))
231 return false; 239 return false;
232 if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) 240 if (textShadow && o.textShadow && (*textShadow != *o.textShadow))
233 return false; 241 return false;
234 return true; 242 return true;
235 } 243 }
236 244
237 } // namespace WebCore 245 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698