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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1644543002: Moved element style recalc count and stats to StyleEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 if (ElementAnimations* elementAnimations = this->elementAnimations()) { 1702 if (ElementAnimations* elementAnimations = this->elementAnimations()) {
1703 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this); 1703 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this);
1704 elementAnimations->updateAnimationFlags(*style); 1704 elementAnimations->updateAnimationFlags(*style);
1705 } 1705 }
1706 1706
1707 if (style->hasTransform()) { 1707 if (style->hasTransform()) {
1708 if (const StylePropertySet* inlineStyle = this->inlineStyle()) 1708 if (const StylePropertySet* inlineStyle = this->inlineStyle())
1709 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform)); 1709 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform));
1710 } 1710 }
1711 1711
1712 document().didRecalculateStyleForElement();
1713 return style.release(); 1712 return style.release();
1714 } 1713 }
1715 1714
1716 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject() 1715 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject()
1717 { 1716 {
1718 ASSERT(document().inStyleRecalc()); 1717 ASSERT(document().inStyleRecalc());
1719 return document().ensureStyleResolver().styleForElement(this); 1718 return document().ensureStyleResolver().styleForElement(this);
1720 } 1719 }
1721 1720
1722 void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling) 1721 void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 ASSERT(!parentOrShadowHostNode()->needsStyleRecalc()); 1782 ASSERT(!parentOrShadowHostNode()->needsStyleRecalc());
1784 ASSERT(change >= Inherit || needsStyleRecalc()); 1783 ASSERT(change >= Inherit || needsStyleRecalc());
1785 ASSERT(parentComputedStyle()); 1784 ASSERT(parentComputedStyle());
1786 1785
1787 RefPtr<ComputedStyle> oldStyle = mutableComputedStyle(); 1786 RefPtr<ComputedStyle> oldStyle = mutableComputedStyle();
1788 RefPtr<ComputedStyle> newStyle = styleForLayoutObject(); 1787 RefPtr<ComputedStyle> newStyle = styleForLayoutObject();
1789 ASSERT(newStyle); 1788 ASSERT(newStyle);
1790 1789
1791 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(oldStyle .get(), newStyle.get()); 1790 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(oldStyle .get(), newStyle.get());
1792 if (localChange == NoChange) { 1791 if (localChange == NoChange) {
1793 INCREMENT_STYLE_STATS_COUNTER(*document().styleResolver(), stylesUnchang ed, 1); 1792 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesUnchanged, 1);
1794 } else { 1793 } else {
1795 INCREMENT_STYLE_STATS_COUNTER(*document().styleResolver(), stylesChanged , 1); 1794 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), stylesChanged, 1 );
1796 } 1795 }
1797 1796
1798 if (localChange == Reattach) { 1797 if (localChange == Reattach) {
1799 AttachContext reattachContext; 1798 AttachContext reattachContext;
1800 reattachContext.resolvedStyle = newStyle.get(); 1799 reattachContext.resolvedStyle = newStyle.get();
1801 bool layoutObjectWillChange = needsAttach() || layoutObject(); 1800 bool layoutObjectWillChange = needsAttach() || layoutObject();
1802 reattach(reattachContext); 1801 reattach(reattachContext);
1803 if (layoutObjectWillChange || layoutObject()) 1802 if (layoutObjectWillChange || layoutObject())
1804 return Reattach; 1803 return Reattach;
1805 return ReattachNoLayoutObject; 1804 return ReattachNoLayoutObject;
(...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after
3652 { 3651 {
3653 #if ENABLE(OILPAN) 3652 #if ENABLE(OILPAN)
3654 if (hasRareData()) 3653 if (hasRareData())
3655 visitor->trace(elementRareData()); 3654 visitor->trace(elementRareData());
3656 visitor->trace(m_elementData); 3655 visitor->trace(m_elementData);
3657 #endif 3656 #endif
3658 ContainerNode::trace(visitor); 3657 ContainerNode::trace(visitor);
3659 } 3658 }
3660 3659
3661 } // namespace blink 3660 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698