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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2346213002: Update PseudoElements during recalcStyle. (Closed)
Patch Set: Update UpdatePseudoElements on recalcStyle Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-reconstruction-on-inserting-newstyle-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index a81a1ae815f051b09bf12b604df7baa9aadce200..e15af85a1583bea07cc7de10175cd1b967ce215f 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -168,10 +168,14 @@ ALWAYS_INLINE ComputedStyle::ComputedStyle(const ComputedStyle& o)
static StyleRecalcChange diffPseudoStyles(const ComputedStyle& oldStyle, const ComputedStyle& newStyle)
{
- // If the pseudoStyles have changed, we want any StyleRecalcChange that is not NoChange
- // because setStyle will do the right thing with anything else.
- if (!oldStyle.hasAnyPublicPseudoStyles())
skobes 2016/09/24 00:11:39 We should avoid looping in the common case that ne
- return NoChange;
+ if (!oldStyle.hasAnyPublicPseudoStyles()) {
+ // If newStyle has PseudoStyle UpdatePseudoElements will ensure layoutObject to setStyle.
+ for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudoId; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
skobes 2016/09/24 00:11:39 Instead of adding another loop let's update the ma
+ if (oldStyle.hasPseudoStyle(pseudoId) != newStyle.hasPseudoStyle(pseudoId))
+ return UpdatePseudoElements;
+ }
+ }
+
for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudoId; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
if (!oldStyle.hasPseudoStyle(pseudoId))
continue;
« no previous file with comments | « third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-reconstruction-on-inserting-newstyle-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698