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

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

Issue 2105743002: Optimize style recalc when adding @keyframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test review issues Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10 matching lines...) Expand all
21 * 21 *
22 * You should have received a copy of the GNU Library General Public License 22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to 23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA. 25 * Boston, MA 02110-1301, USA.
26 */ 26 */
27 27
28 #include "core/dom/StyleEngine.h" 28 #include "core/dom/StyleEngine.h"
29 29
30 #include "core/HTMLNames.h" 30 #include "core/HTMLNames.h"
31 #include "core/animation/AnimationTimeline.h"
31 #include "core/css/CSSDefaultStyleSheets.h" 32 #include "core/css/CSSDefaultStyleSheets.h"
32 #include "core/css/CSSFontSelector.h" 33 #include "core/css/CSSFontSelector.h"
33 #include "core/css/CSSStyleSheet.h" 34 #include "core/css/CSSStyleSheet.h"
34 #include "core/css/FontFaceCache.h" 35 #include "core/css/FontFaceCache.h"
35 #include "core/css/StyleSheetContents.h" 36 #include "core/css/StyleSheetContents.h"
36 #include "core/css/invalidation/InvalidationSet.h" 37 #include "core/css/invalidation/InvalidationSet.h"
37 #include "core/css/resolver/ScopedStyleResolver.h" 38 #include "core/css/resolver/ScopedStyleResolver.h"
38 #include "core/dom/DocumentStyleSheetCollector.h" 39 #include "core/dom/DocumentStyleSheetCollector.h"
39 #include "core/dom/Element.h" 40 #include "core/dom/Element.h"
40 #include "core/dom/ProcessingInstruction.h" 41 #include "core/dom/ProcessingInstruction.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 737
737 void StyleEngine::ensureFullscreenUAStyle() 738 void StyleEngine::ensureFullscreenUAStyle()
738 { 739 {
739 CSSDefaultStyleSheets::instance().ensureDefaultStyleSheetForFullscreen(); 740 CSSDefaultStyleSheets::instance().ensureDefaultStyleSheetForFullscreen();
740 if (!m_resolver) 741 if (!m_resolver)
741 return; 742 return;
742 if (!m_resolver->hasFullscreenUAStyle()) 743 if (!m_resolver->hasFullscreenUAStyle())
743 m_resolver->resetRuleFeatures(); 744 m_resolver->resetRuleFeatures();
744 } 745 }
745 746
747 void StyleEngine::keyframesRulesAdded()
748 {
749 if (m_hasUnresolvedKeyframesRule) {
750 m_hasUnresolvedKeyframesRule = false;
751 document().setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::StyleSheetChange));
752 return;
753 }
754
755 document().timeline().invalidateKeyframeEffects();
756 }
757
746 DEFINE_TRACE(StyleEngine) 758 DEFINE_TRACE(StyleEngine)
747 { 759 {
748 visitor->trace(m_document); 760 visitor->trace(m_document);
749 visitor->trace(m_injectedAuthorStyleSheets); 761 visitor->trace(m_injectedAuthorStyleSheets);
750 visitor->trace(m_documentStyleSheetCollection); 762 visitor->trace(m_documentStyleSheetCollection);
751 visitor->trace(m_styleSheetCollectionMap); 763 visitor->trace(m_styleSheetCollectionMap);
752 visitor->trace(m_resolver); 764 visitor->trace(m_resolver);
753 visitor->trace(m_styleInvalidator); 765 visitor->trace(m_styleInvalidator);
754 visitor->trace(m_dirtyTreeScopes); 766 visitor->trace(m_dirtyTreeScopes);
755 visitor->trace(m_activeTreeScopes); 767 visitor->trace(m_activeTreeScopes);
756 visitor->trace(m_fontSelector); 768 visitor->trace(m_fontSelector);
757 visitor->trace(m_textToSheetCache); 769 visitor->trace(m_textToSheetCache);
758 visitor->trace(m_sheetToTextCache); 770 visitor->trace(m_sheetToTextCache);
759 CSSFontSelectorClient::trace(visitor); 771 CSSFontSelectorClient::trace(visitor);
760 } 772 }
761 773
762 DEFINE_TRACE_WRAPPERS(StyleEngine) 774 DEFINE_TRACE_WRAPPERS(StyleEngine)
763 { 775 {
764 for (auto sheet : m_injectedAuthorStyleSheets) { 776 for (auto sheet : m_injectedAuthorStyleSheets) {
765 visitor->traceWrappers(sheet); 777 visitor->traceWrappers(sheet);
766 } 778 }
767 visitor->traceWrappers(m_documentStyleSheetCollection); 779 visitor->traceWrappers(m_documentStyleSheetCollection);
768 } 780 }
769 781
770 } // namespace blink 782 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698