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

Side by Side Diff: sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp

Issue 709213002: Remove ContentData. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/rendering/style/StyleRareNonInheritedData.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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/StyleRareNonInheritedData.h" 23 #include "core/rendering/style/StyleRareNonInheritedData.h"
24 24
25 #include "core/rendering/style/ContentData.h"
26 #include "core/rendering/style/DataEquivalency.h" 25 #include "core/rendering/style/DataEquivalency.h"
27 #include "core/rendering/style/RenderStyle.h" 26 #include "core/rendering/style/RenderStyle.h"
28 #include "core/rendering/style/ShadowList.h" 27 #include "core/rendering/style/ShadowList.h"
29 #include "core/rendering/style/StyleFilterData.h" 28 #include "core/rendering/style/StyleFilterData.h"
30 #include "core/rendering/style/StyleTransformData.h" 29 #include "core/rendering/style/StyleTransformData.h"
31 30
32 namespace blink { 31 namespace blink {
33 32
34 StyleRareNonInheritedData::StyleRareNonInheritedData() 33 StyleRareNonInheritedData::StyleRareNonInheritedData()
35 : opacity(RenderStyle::initialOpacity()) 34 : opacity(RenderStyle::initialOpacity())
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 , m_aspectRatioDenominator(o.m_aspectRatioDenominator) 89 , m_aspectRatioDenominator(o.m_aspectRatioDenominator)
91 , m_aspectRatioNumerator(o.m_aspectRatioNumerator) 90 , m_aspectRatioNumerator(o.m_aspectRatioNumerator)
92 , m_perspective(o.m_perspective) 91 , m_perspective(o.m_perspective)
93 , m_perspectiveOriginX(o.m_perspectiveOriginX) 92 , m_perspectiveOriginX(o.m_perspectiveOriginX)
94 , m_perspectiveOriginY(o.m_perspectiveOriginY) 93 , m_perspectiveOriginY(o.m_perspectiveOriginY)
95 , lineClamp(o.lineClamp) 94 , lineClamp(o.lineClamp)
96 , m_flexibleBox(o.m_flexibleBox) 95 , m_flexibleBox(o.m_flexibleBox)
97 , m_transform(o.m_transform) 96 , m_transform(o.m_transform)
98 , m_willChange(o.m_willChange) 97 , m_willChange(o.m_willChange)
99 , m_filter(o.m_filter) 98 , m_filter(o.m_filter)
100 , m_content(o.m_content ? o.m_content->clone() : nullptr)
101 , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr) 99 , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
102 , m_boxShadow(o.m_boxShadow) 100 , m_boxShadow(o.m_boxShadow)
103 , m_animations(o.m_animations ? CSSAnimationData::create(*o.m_animations) : nullptr) 101 , m_animations(o.m_animations ? CSSAnimationData::create(*o.m_animations) : nullptr)
104 , m_transitions(o.m_transitions ? CSSTransitionData::create(*o.m_transitions ) : nullptr) 102 , m_transitions(o.m_transitions ? CSSTransitionData::create(*o.m_transitions ) : nullptr)
105 , m_mask(o.m_mask) 103 , m_mask(o.m_mask)
106 , m_maskBoxImage(o.m_maskBoxImage) 104 , m_maskBoxImage(o.m_maskBoxImage)
107 , m_pageSize(o.m_pageSize) 105 , m_pageSize(o.m_pageSize)
108 , m_clipPath(o.m_clipPath) 106 , m_clipPath(o.m_clipPath)
109 , m_textDecorationColor(o.m_textDecorationColor) 107 , m_textDecorationColor(o.m_textDecorationColor)
110 , m_order(o.m_order) 108 , m_order(o.m_order)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 && m_aspectRatioDenominator == o.m_aspectRatioDenominator 155 && m_aspectRatioDenominator == o.m_aspectRatioDenominator
158 && m_aspectRatioNumerator == o.m_aspectRatioNumerator 156 && m_aspectRatioNumerator == o.m_aspectRatioNumerator
159 && m_perspective == o.m_perspective 157 && m_perspective == o.m_perspective
160 && m_perspectiveOriginX == o.m_perspectiveOriginX 158 && m_perspectiveOriginX == o.m_perspectiveOriginX
161 && m_perspectiveOriginY == o.m_perspectiveOriginY 159 && m_perspectiveOriginY == o.m_perspectiveOriginY
162 && lineClamp == o.lineClamp 160 && lineClamp == o.lineClamp
163 && m_flexibleBox == o.m_flexibleBox 161 && m_flexibleBox == o.m_flexibleBox
164 && m_transform == o.m_transform 162 && m_transform == o.m_transform
165 && m_willChange == o.m_willChange 163 && m_willChange == o.m_willChange
166 && m_filter == o.m_filter 164 && m_filter == o.m_filter
167 && contentDataEquivalent(o)
168 && counterDataEquivalent(o) 165 && counterDataEquivalent(o)
169 && shadowDataEquivalent(o) 166 && shadowDataEquivalent(o)
170 && animationDataEquivalent(o) 167 && animationDataEquivalent(o)
171 && transitionDataEquivalent(o) 168 && transitionDataEquivalent(o)
172 && m_mask == o.m_mask 169 && m_mask == o.m_mask
173 && m_maskBoxImage == o.m_maskBoxImage 170 && m_maskBoxImage == o.m_maskBoxImage
174 && m_pageSize == o.m_pageSize 171 && m_pageSize == o.m_pageSize
175 && m_clipPath == o.m_clipPath 172 && m_clipPath == o.m_clipPath
176 && m_textDecorationColor == o.m_textDecorationColor 173 && m_textDecorationColor == o.m_textDecorationColor
177 && m_order == o.m_order 174 && m_order == o.m_order
(...skipping 25 matching lines...) Expand all
203 && m_justifyItems == o.m_justifyItems 200 && m_justifyItems == o.m_justifyItems
204 && m_justifyItemsOverflowAlignment == o.m_justifyItemsOverflowAlignment 201 && m_justifyItemsOverflowAlignment == o.m_justifyItemsOverflowAlignment
205 && m_justifyItemsPositionType == o.m_justifyItemsPositionType 202 && m_justifyItemsPositionType == o.m_justifyItemsPositionType
206 && m_justifySelf == o.m_justifySelf 203 && m_justifySelf == o.m_justifySelf
207 && m_justifySelfOverflowAlignment == o.m_justifySelfOverflowAlignment 204 && m_justifySelfOverflowAlignment == o.m_justifySelfOverflowAlignment
208 && m_scrollBehavior == o.m_scrollBehavior 205 && m_scrollBehavior == o.m_scrollBehavior
209 && m_requiresAcceleratedCompositingForExternalReasons == o.m_requiresAcc eleratedCompositingForExternalReasons 206 && m_requiresAcceleratedCompositingForExternalReasons == o.m_requiresAcc eleratedCompositingForExternalReasons
210 && m_hasInlineTransform == o.m_hasInlineTransform; 207 && m_hasInlineTransform == o.m_hasInlineTransform;
211 } 208 }
212 209
213 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInherite dData& o) const
214 {
215 ContentData* a = m_content.get();
216 ContentData* b = o.m_content.get();
217
218 while (a && b && *a == *b) {
219 a = a->next();
220 b = b->next();
221 }
222
223 return !a && !b;
224 }
225
226 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInherite dData& o) const 210 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInherite dData& o) const
227 { 211 {
228 return dataEquivalent(m_counterDirectives, o.m_counterDirectives); 212 return dataEquivalent(m_counterDirectives, o.m_counterDirectives);
229 } 213 }
230 214
231 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInherited Data& o) const 215 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInherited Data& o) const
232 { 216 {
233 return dataEquivalent(m_boxShadow, o.m_boxShadow); 217 return dataEquivalent(m_boxShadow, o.m_boxShadow);
234 } 218 }
235 219
(...skipping 14 matching lines...) Expand all
250 return false; 234 return false;
251 return m_transitions->transitionsMatchForStyleRecalc(*o.m_transitions); 235 return m_transitions->transitionsMatchForStyleRecalc(*o.m_transitions);
252 } 236 }
253 237
254 bool StyleRareNonInheritedData::hasFilters() const 238 bool StyleRareNonInheritedData::hasFilters() const
255 { 239 {
256 return m_filter.get() && !m_filter->m_operations.isEmpty(); 240 return m_filter.get() && !m_filter->m_operations.isEmpty();
257 } 241 }
258 242
259 } // namespace blink 243 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/style/StyleRareNonInheritedData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698