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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 FontBuilder fontBuilder(*this); 1593 FontBuilder fontBuilder(*this);
1594 RefPtrWillBeRawPtr<CSSFontSelector> selector = styleEngine().fontSelector(); 1594 RefPtrWillBeRawPtr<CSSFontSelector> selector = styleEngine().fontSelector();
1595 fontBuilder.createFontForDocument(selector, documentStyle); 1595 fontBuilder.createFontForDocument(selector, documentStyle);
1596 } 1596 }
1597 1597
1598 void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) 1598 void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
1599 { 1599 {
1600 ASSERT(inStyleRecalc()); 1600 ASSERT(inStyleRecalc());
1601 ASSERT(documentElement()); 1601 ASSERT(documentElement());
1602 1602
1603 bool didRecalcDocumentElement = false;
1603 RefPtr<LayoutStyle> documentElementStyle = documentElement()->layoutStyle(); 1604 RefPtr<LayoutStyle> documentElementStyle = documentElement()->layoutStyle();
1604 if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force) 1605 if (change == Force)
1606 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.
1607 if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force) {
1605 documentElementStyle = ensureStyleResolver().styleForElement(documentEle ment()); 1608 documentElementStyle = ensureStyleResolver().styleForElement(documentEle ment());
1609 didRecalcDocumentElement = true;
1610 }
1606 1611
1607 WritingMode rootWritingMode = documentElementStyle->writingMode(); 1612 WritingMode rootWritingMode = documentElementStyle->writingMode();
1608 TextDirection rootDirection = documentElementStyle->direction(); 1613 TextDirection rootDirection = documentElementStyle->direction();
1609 1614
1610 HTMLElement* body = this->body(); 1615 HTMLElement* body = this->body();
1611 RefPtr<LayoutStyle> bodyStyle; 1616 RefPtr<LayoutStyle> bodyStyle;
1612 if (body) { 1617 if (body) {
1613 bodyStyle = body->layoutStyle(); 1618 if (didRecalcDocumentElement)
1614 if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsSt yleRecalc() || change == Force) 1619 body->clearAnimationStyleChange();
1620 else
1621 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.
1622
1623 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
1615 bodyStyle = ensureStyleResolver().styleForElement(body, documentElem entStyle.get()); 1624 bodyStyle = ensureStyleResolver().styleForElement(body, documentElem entStyle.get());
1616 rootWritingMode = bodyStyle->writingMode(); 1625 rootWritingMode = bodyStyle->writingMode();
1617 rootDirection = bodyStyle->direction(); 1626 rootDirection = bodyStyle->direction();
1618 } 1627 }
1619 1628
1620 RefPtr<LayoutStyle> overflowStyle; 1629 RefPtr<LayoutStyle> overflowStyle;
1621 if (Element* element = viewportDefiningElement(documentElementStyle.get())) { 1630 if (Element* element = viewportDefiningElement(documentElementStyle.get())) {
1622 if (element == body) { 1631 if (element == body) {
1623 overflowStyle = bodyStyle; 1632 overflowStyle = bodyStyle;
1624 } else { 1633 } else {
(...skipping 4094 matching lines...) Expand 10 before | Expand all | Expand 10 after
5719 #ifndef NDEBUG 5728 #ifndef NDEBUG
5720 using namespace blink; 5729 using namespace blink;
5721 void showLiveDocumentInstances() 5730 void showLiveDocumentInstances()
5722 { 5731 {
5723 WeakDocumentSet& set = liveDocumentSet(); 5732 WeakDocumentSet& set = liveDocumentSet();
5724 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5733 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5725 for (Document* document : set) 5734 for (Document* document : set)
5726 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5735 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5727 } 5736 }
5728 #endif 5737 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698