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

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

Issue 1000413003: Clear need for animation style for forced styleForElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review issue: removed constness Created 5 years, 9 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 | « LayoutTests/animations/base-render-style-body-crash-expected.txt ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 832ecfb63e36606175e5ee0e403dc324cae2608a..dfea11b9ec9cd519a3a934e2cabed905271c846f 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1600,18 +1600,26 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
ASSERT(inStyleRecalc());
ASSERT(documentElement());
+ bool didRecalcDocumentElement = false;
RefPtr<LayoutStyle> documentElementStyle = documentElement()->layoutStyle();
- if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force)
+ if (change == Force)
+ documentElement()->clearAnimationStyleChange();
+ if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force) {
documentElementStyle = ensureStyleResolver().styleForElement(documentElement());
+ didRecalcDocumentElement = true;
+ }
WritingMode rootWritingMode = documentElementStyle->writingMode();
TextDirection rootDirection = documentElementStyle->direction();
HTMLElement* body = this->body();
RefPtr<LayoutStyle> bodyStyle;
+
if (body) {
bodyStyle = body->layoutStyle();
- if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsStyleRecalc() || change == Force)
+ if (didRecalcDocumentElement)
+ body->clearAnimationStyleChange();
+ if (!bodyStyle || body->needsStyleRecalc() || didRecalcDocumentElement)
bodyStyle = ensureStyleResolver().styleForElement(body, documentElementStyle.get());
rootWritingMode = bodyStyle->writingMode();
rootDirection = bodyStyle->direction();
« no previous file with comments | « LayoutTests/animations/base-render-style-body-crash-expected.txt ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698