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

Unified Diff: Source/core/dom/Element.cpp

Issue 558333002: Don't clear StyleAffectedByEmpty before recalc. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1f2fed69eefcbaeb8f6dd79a86194da9d66c3598..b0623cd8ef5d19427e63b56463fa616af5abee85 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1327,9 +1327,6 @@ void Element::attach(const AttachContext& context)
if (hasRareData() && styleChangeType() == NeedsReattachStyleChange) {
ElementRareData* data = elementRareData();
data->clearComputedStyle();
- // Only clear the style state if we're not going to reuse the style from recalcStyle.
- if (!context.resolvedStyle)
- data->resetStyleState();
}
RenderTreeBuilder(this, context.resolvedStyle).createRendererForElementIfNeeded();
@@ -1368,11 +1365,9 @@ void Element::detach(const AttachContext& context)
ElementRareData* data = elementRareData();
data->clearPseudoElements();
- // attach() will perform the below steps for us when inside recalcStyle.
- if (!document().inStyleRecalc()) {
- data->resetStyleState();
+ // attach() will clear the computed style for us when inside recalcStyle.
+ if (!document().inStyleRecalc())
data->clearComputedStyle();
- }
if (ActiveAnimations* activeAnimations = data->activeAnimations()) {
if (context.performingReattach) {
@@ -1481,7 +1476,6 @@ void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
if (change >= Inherit || needsStyleRecalc()) {
if (hasRareData()) {
ElementRareData* data = elementRareData();
- data->resetStyleState();
data->clearComputedStyle();
if (change >= Inherit) {
« no previous file with comments | « LayoutTests/fast/css/pseudo-not-empty-adjacent-dynamic-expected.txt ('k') | Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698