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

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

Issue 2751193004: Skip ruleset invalidations for SubtreeStyleChange roots. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 treeScope.document().hasNodesWithPlaceholderStyle()) { 1077 treeScope.document().hasNodesWithPlaceholderStyle()) {
1078 treeScope.document().setNeedsStyleRecalc( 1078 treeScope.document().setNeedsStyleRecalc(
1079 SubtreeStyleChange, StyleChangeReasonForTracing::create( 1079 SubtreeStyleChange, StyleChangeReasonForTracing::create(
1080 StyleChangeReason::CleanupPlaceholderStyles)); 1080 StyleChangeReason::CleanupPlaceholderStyles));
1081 return; 1081 return;
1082 } 1082 }
1083 1083
1084 if (changedRuleFlags & KeyframesRules) 1084 if (changedRuleFlags & KeyframesRules)
1085 ScopedStyleResolver::keyframesRulesAdded(treeScope); 1085 ScopedStyleResolver::keyframesRulesAdded(treeScope);
1086 1086
1087 Node& invalidationRoot =
1088 ScopedStyleResolver::invalidationRootForTreeScope(treeScope);
1089 if (invalidationRoot.getStyleChangeType() >= SubtreeStyleChange)
1090 return;
1091
1087 if (fontsChanged || (changedRuleFlags & FullRecalcRules)) { 1092 if (fontsChanged || (changedRuleFlags & FullRecalcRules)) {
1088 ScopedStyleResolver::invalidationRootForTreeScope(treeScope) 1093 invalidationRoot.setNeedsStyleRecalc(
1089 .setNeedsStyleRecalc(SubtreeStyleChange, 1094 SubtreeStyleChange, StyleChangeReasonForTracing::create(
1090 StyleChangeReasonForTracing::create( 1095 StyleChangeReason::ActiveStylesheetsUpdate));
1091 StyleChangeReason::ActiveStylesheetsUpdate));
1092 return; 1096 return;
1093 } 1097 }
1094 1098
1095 scheduleInvalidationsForRuleSets(treeScope, changedRuleSets); 1099 scheduleInvalidationsForRuleSets(treeScope, changedRuleSets);
1096 } 1100 }
1097 1101
1098 const MediaQueryEvaluator& StyleEngine::ensureMediaQueryEvaluator() { 1102 const MediaQueryEvaluator& StyleEngine::ensureMediaQueryEvaluator() {
1099 if (!m_mediaQueryEvaluator) { 1103 if (!m_mediaQueryEvaluator) {
1100 if (document().frame()) 1104 if (document().frame())
1101 m_mediaQueryEvaluator = new MediaQueryEvaluator(document().frame()); 1105 m_mediaQueryEvaluator = new MediaQueryEvaluator(document().frame());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 } 1153 }
1150 1154
1151 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1155 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1152 for (auto sheet : m_injectedAuthorStyleSheets) { 1156 for (auto sheet : m_injectedAuthorStyleSheets) {
1153 visitor->traceWrappers(sheet); 1157 visitor->traceWrappers(sheet);
1154 } 1158 }
1155 visitor->traceWrappers(m_documentStyleSheetCollection); 1159 visitor->traceWrappers(m_documentStyleSheetCollection);
1156 } 1160 }
1157 1161
1158 } // namespace blink 1162 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698