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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2346213002: Update PseudoElements during recalcStyle. (Closed)
Patch Set: Rebase to latest Created 4 years, 2 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 * 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 , m_rareInheritedData(o.m_rareInheritedData) 167 , m_rareInheritedData(o.m_rareInheritedData)
168 , m_styleInheritedData(o.m_styleInheritedData) 168 , m_styleInheritedData(o.m_styleInheritedData)
169 , m_svgStyle(o.m_svgStyle) 169 , m_svgStyle(o.m_svgStyle)
170 , m_inheritedData(o.m_inheritedData) 170 , m_inheritedData(o.m_inheritedData)
171 , m_nonInheritedData(o.m_nonInheritedData) 171 , m_nonInheritedData(o.m_nonInheritedData)
172 { 172 {
173 } 173 }
174 174
175 static StyleRecalcChange diffPseudoStyles(const ComputedStyle& oldStyle, const C omputedStyle& newStyle) 175 static StyleRecalcChange diffPseudoStyles(const ComputedStyle& oldStyle, const C omputedStyle& newStyle)
176 { 176 {
177 // If the pseudoStyles have changed, we want any StyleRecalcChange that is n ot NoChange 177 // If the pseudoStyles have changed, ensure layoutObject triggers setStyle.
178 // because setStyle will do the right thing with anything else. 178 if (!oldStyle.hasAnyPublicPseudoStyles() && !newStyle.hasAnyPublicPseudoStyl es())
179 if (!oldStyle.hasAnyPublicPseudoStyles())
180 return NoChange; 179 return NoChange;
181 for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudo Id; pseudoId = static_cast<PseudoId>(pseudoId + 1)) { 180 for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudo Id; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
182 if (!oldStyle.hasPseudoStyle(pseudoId)) 181 if (!oldStyle.hasPseudoStyle(pseudoId) && !newStyle.hasPseudoStyle(pseud oId))
183 continue; 182 continue;
184 const ComputedStyle* newPseudoStyle = newStyle.getCachedPseudoStyle(pseu doId); 183 const ComputedStyle* newPseudoStyle = newStyle.getCachedPseudoStyle(pseu doId);
185 if (!newPseudoStyle) 184 if (!newPseudoStyle)
186 return NoInherit; 185 return NoInherit;
187 const ComputedStyle* oldPseudoStyle = oldStyle.getCachedPseudoStyle(pseu doId); 186 const ComputedStyle* oldPseudoStyle = oldStyle.getCachedPseudoStyle(pseu doId);
188 if (oldPseudoStyle && *oldPseudoStyle != *newPseudoStyle) 187 if (oldPseudoStyle && *oldPseudoStyle != *newPseudoStyle)
189 return NoInherit; 188 return NoInherit;
190 } 189 }
191 return NoChange; 190 return NoChange;
192 } 191 }
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 if (value < 0) 2052 if (value < 0)
2054 fvalue -= 0.5f; 2053 fvalue -= 0.5f;
2055 else 2054 else
2056 fvalue += 0.5f; 2055 fvalue += 0.5f;
2057 } 2056 }
2058 2057
2059 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2058 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2060 } 2059 }
2061 2060
2062 } // namespace blink 2061 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-reconstruction-on-setting-newstyle-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698