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

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

Issue 2346213002: Update PseudoElements during recalcStyle. (Closed)
Patch Set: Rebase to latest 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-setting-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 fca60578af7bb40c36feca861b0921ec36f826e8..f4ffabfa51a68d951ab70eb8538d4265b9fa051f 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -174,12 +174,11 @@ 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())
+ // If the pseudoStyles have changed, ensure layoutObject triggers setStyle.
+ if (!oldStyle.hasAnyPublicPseudoStyles() && !newStyle.hasAnyPublicPseudoStyles())
return NoChange;
for (PseudoId pseudoId = FirstPublicPseudoId; pseudoId < FirstInternalPseudoId; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
- if (!oldStyle.hasPseudoStyle(pseudoId))
+ if (!oldStyle.hasPseudoStyle(pseudoId) && !newStyle.hasPseudoStyle(pseudoId))
continue;
const ComputedStyle* newPseudoStyle = newStyle.getCachedPseudoStyle(pseudoId);
if (!newPseudoStyle)
« 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