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; |