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 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 , m_rareInheritedData(o.m_rareInheritedData) | 161 , m_rareInheritedData(o.m_rareInheritedData) |
162 , m_styleInheritedData(o.m_styleInheritedData) | 162 , m_styleInheritedData(o.m_styleInheritedData) |
163 , m_svgStyle(o.m_svgStyle) | 163 , m_svgStyle(o.m_svgStyle) |
164 , m_inheritedData(o.m_inheritedData) | 164 , m_inheritedData(o.m_inheritedData) |
165 , m_nonInheritedData(o.m_nonInheritedData) | 165 , m_nonInheritedData(o.m_nonInheritedData) |
166 { | 166 { |
167 } | 167 } |
168 | 168 |
169 static StyleRecalcChange diffPseudoStyles(const ComputedStyle& oldStyle, const C omputedStyle& newStyle) | 169 static StyleRecalcChange diffPseudoStyles(const ComputedStyle& oldStyle, const C omputedStyle& newStyle) |
170 { | 170 { |
171 // If the pseudoStyles have changed, we want any StyleRecalcChange that is n ot NoChange | 171 if (!oldStyle.hasAnyPublicPseudoStyles()) { |
172 // because setStyle will do the right thing with anything else. | 172 // If newStyle has PseudoStyle UpdatePseudoElements will ensure layoutOb ject to setStyle. |
173 if (!oldStyle.hasAnyPublicPseudoStyles()) | 173 for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPs eudoId; pseudoId = static_cast<PseudoId>(pseudoId + 1)) { |
skobes
2016/09/24 00:11:39
We should avoid looping in the common case that ne
|
skobes
2016/09/24 00:11:39
Instead of adding another loop let's update the ma
|
174 return NoChange; | 174 if (oldStyle.hasPseudoStyle(pseudoId) != newStyle.hasPseudoStyle(pse udoId)) |
175 return UpdatePseudoElements; | |
176 } | |
177 } | |
178 | |
175 for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudo Id; pseudoId = static_cast<PseudoId>(pseudoId + 1)) { | 179 for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudo Id; pseudoId = static_cast<PseudoId>(pseudoId + 1)) { |
176 if (!oldStyle.hasPseudoStyle(pseudoId)) | 180 if (!oldStyle.hasPseudoStyle(pseudoId)) |
177 continue; | 181 continue; |
178 const ComputedStyle* newPseudoStyle = newStyle.getCachedPseudoStyle(pseu doId); | 182 const ComputedStyle* newPseudoStyle = newStyle.getCachedPseudoStyle(pseu doId); |
179 if (!newPseudoStyle) | 183 if (!newPseudoStyle) |
180 return NoInherit; | 184 return NoInherit; |
181 const ComputedStyle* oldPseudoStyle = oldStyle.getCachedPseudoStyle(pseu doId); | 185 const ComputedStyle* oldPseudoStyle = oldStyle.getCachedPseudoStyle(pseu doId); |
182 if (oldPseudoStyle && *oldPseudoStyle != *newPseudoStyle) | 186 if (oldPseudoStyle && *oldPseudoStyle != *newPseudoStyle) |
183 return NoInherit; | 187 return NoInherit; |
184 } | 188 } |
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2042 if (value < 0) | 2046 if (value < 0) |
2043 fvalue -= 0.5f; | 2047 fvalue -= 0.5f; |
2044 else | 2048 else |
2045 fvalue += 0.5f; | 2049 fvalue += 0.5f; |
2046 } | 2050 } |
2047 | 2051 |
2048 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2052 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2049 } | 2053 } |
2050 | 2054 |
2051 } // namespace blink | 2055 } // namespace blink |
OLD | NEW |