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

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: Fix review issues. 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/DataEquivalency.h" 27 #include "core/rendering/style/DataEquivalency.h"
27 #include "core/rendering/style/QuotesData.h" 28 #include "core/rendering/style/QuotesData.h"
28 #include "core/rendering/style/RenderStyle.h" 29 #include "core/rendering/style/RenderStyle.h"
29 #include "core/rendering/style/RenderStyleConstants.h" 30 #include "core/rendering/style/RenderStyleConstants.h"
30 #include "core/rendering/style/ShadowList.h" 31 #include "core/rendering/style/ShadowList.h"
31 #include "core/rendering/style/StyleImage.h" 32 #include "core/rendering/style/StyleImage.h"
32 33
33 namespace WebCore { 34 namespace WebCore {
34 35
35 struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI nheritedData> { 36 struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI nheritedData> {
36 void* styleImage; 37 void* styleImage;
37 Color firstColor; 38 Color firstColor;
38 float firstFloat; 39 float firstFloat;
39 Color colors[5]; 40 Color colors[5];
40 void* ownPtrs[1]; 41 void* ownPtrs[1];
41 AtomicString atomicStrings[4]; 42 AtomicString atomicStrings[4];
42 void* refPtrs[2]; 43 void* refPtrs[3];
43 Length lengths[1]; 44 Length lengths[1];
44 float secondFloat; 45 float secondFloat;
45 unsigned m_bitfields[2]; 46 unsigned m_bitfields[2];
46 short pagedMediaShorts[2]; 47 short pagedMediaShorts[2];
47 unsigned unsigneds[1]; 48 unsigned unsigneds[1];
48 short hyphenationShorts[3]; 49 short hyphenationShorts[3];
49 50
50 Color touchColors; 51 Color touchColors;
51 }; 52 };
52 53
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 , m_rubyPosition(o.m_rubyPosition) 146 , m_rubyPosition(o.m_rubyPosition)
146 , m_touchActionDelay(o.m_touchActionDelay) 147 , m_touchActionDelay(o.m_touchActionDelay)
147 , hyphenationString(o.hyphenationString) 148 , hyphenationString(o.hyphenationString)
148 , hyphenationLimitBefore(o.hyphenationLimitBefore) 149 , hyphenationLimitBefore(o.hyphenationLimitBefore)
149 , hyphenationLimitAfter(o.hyphenationLimitAfter) 150 , hyphenationLimitAfter(o.hyphenationLimitAfter)
150 , hyphenationLimitLines(o.hyphenationLimitLines) 151 , hyphenationLimitLines(o.hyphenationLimitLines)
151 , locale(o.locale) 152 , locale(o.locale)
152 , textEmphasisCustomMark(o.textEmphasisCustomMark) 153 , textEmphasisCustomMark(o.textEmphasisCustomMark)
153 , m_tabSize(o.m_tabSize) 154 , m_tabSize(o.m_tabSize)
154 , tapHighlightColor(o.tapHighlightColor) 155 , tapHighlightColor(o.tapHighlightColor)
156 , appliedTextDecorations(o.appliedTextDecorations)
155 { 157 {
156 } 158 }
157 159
158 StyleRareInheritedData::~StyleRareInheritedData() 160 StyleRareInheritedData::~StyleRareInheritedData()
159 { 161 {
160 } 162 }
161 163
164 static bool appliedTextDecorationsEquivalent(const AppliedTextDecorationList* d1 , const AppliedTextDecorationList* d2)
165 {
166 return (d1 == d2) || (d1 && d2 && *d1 == *d2);
167 }
168
162 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const 169 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
163 { 170 {
164 return m_textStrokeColor == o.m_textStrokeColor 171 return m_textStrokeColor == o.m_textStrokeColor
165 && textStrokeWidth == o.textStrokeWidth 172 && textStrokeWidth == o.textStrokeWidth
166 && m_textFillColor == o.m_textFillColor 173 && m_textFillColor == o.m_textFillColor
167 && m_textEmphasisColor == o.m_textEmphasisColor 174 && m_textEmphasisColor == o.m_textEmphasisColor
168 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor 175 && m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor
169 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor 176 && m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor
170 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor 177 && m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor
171 && tapHighlightColor == o.tapHighlightColor 178 && tapHighlightColor == o.tapHighlightColor
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 && m_textIndentType == o.m_textIndentType 214 && m_textIndentType == o.m_textIndentType
208 && m_lineBoxContain == o.m_lineBoxContain 215 && m_lineBoxContain == o.m_lineBoxContain
209 && hyphenationString == o.hyphenationString 216 && hyphenationString == o.hyphenationString
210 && locale == o.locale 217 && locale == o.locale
211 && textEmphasisCustomMark == o.textEmphasisCustomMark 218 && textEmphasisCustomMark == o.textEmphasisCustomMark
212 && quotesDataEquivalent(o) 219 && quotesDataEquivalent(o)
213 && m_tabSize == o.m_tabSize 220 && m_tabSize == o.m_tabSize
214 && m_imageRendering == o.m_imageRendering 221 && m_imageRendering == o.m_imageRendering
215 && m_textUnderlinePosition == o.m_textUnderlinePosition 222 && m_textUnderlinePosition == o.m_textUnderlinePosition
216 && m_rubyPosition == o.m_rubyPosition 223 && m_rubyPosition == o.m_rubyPosition
217 && dataEquivalent(listStyleImage.get(), o.listStyleImage.get()); 224 && dataEquivalent(listStyleImage.get(), o.listStyleImage.get())
225 && appliedTextDecorationsEquivalent(appliedTextDecorations.get(), o.appl iedTextDecorations.get());
Julien - ping for review 2014/05/05 17:45:08 I think dataEquivalent(appliedTextDecorations, o.a
andersr 2014/05/06 13:15:29 Done.
218 } 226 }
219 227
220 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const 228 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
221 { 229 {
222 return dataEquivalent(textShadow.get(), o.textShadow.get()); 230 return dataEquivalent(textShadow.get(), o.textShadow.get());
223 } 231 }
224 232
225 bool StyleRareInheritedData::quotesDataEquivalent(const StyleRareInheritedData& o) const 233 bool StyleRareInheritedData::quotesDataEquivalent(const StyleRareInheritedData& o) const
226 { 234 {
227 return dataEquivalent(quotes, o.quotes); 235 return dataEquivalent(quotes, o.quotes);
228 } 236 }
229 237
230 } // namespace WebCore 238 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698