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

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: 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 832ecfb63e36606175e5ee0e403dc324cae2608a..3f75a197e221c4f46cf434946f23ea49666815de 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1600,9 +1600,14 @@ 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();
esprehn 2015/03/18 11:41:01 This seems okay as a short term hack, but long ter
rune 2015/03/18 14:53:03 Acknowledged.
+ if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force) {
documentElementStyle = ensureStyleResolver().styleForElement(documentElement());
+ didRecalcDocumentElement = true;
+ }
WritingMode rootWritingMode = documentElementStyle->writingMode();
TextDirection rootDirection = documentElementStyle->direction();
@@ -1610,8 +1615,12 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
HTMLElement* body = this->body();
RefPtr<LayoutStyle> bodyStyle;
if (body) {
- bodyStyle = body->layoutStyle();
- if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsStyleRecalc() || change == Force)
+ if (didRecalcDocumentElement)
+ body->clearAnimationStyleChange();
+ else
+ bodyStyle = body->layoutStyle();
dstockwell 2015/03/18 11:05:54 It's confusing to place this in the else branch, i
esprehn 2015/03/18 11:41:01 +1
rune 2015/03/18 14:53:03 Done.
+
+ if (!bodyStyle || body->needsStyleRecalc() || didRecalcDocumentElement)
esprehn 2015/03/18 11:41:01 Why do you need to recalc the body if we recalced
esprehn 2015/03/18 11:41:37 document element*
rune 2015/03/18 14:53:03 If documentElement style is changed, it may affect
bodyStyle = ensureStyleResolver().styleForElement(body, documentElementStyle.get());
rootWritingMode = bodyStyle->writingMode();
rootDirection = bodyStyle->direction();

Powered by Google App Engine
This is Rietveld 408576698