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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 // This is also the case when we import the same document twice where the 976 // This is also the case when we import the same document twice where the
977 // last inserted document is inserted before the first one in dom order where 977 // last inserted document is inserted before the first one in dom order where
978 // the last would take precedence. 978 // the last would take precedence.
979 // 979 //
980 // Fall back to re-add all sheets to the scoped resolver and recalculate style 980 // Fall back to re-add all sheets to the scoped resolver and recalculate style
981 // for the whole document when we remove or insert an import document. 981 // for the whole document when we remove or insert an import document.
982 if (ScopedStyleResolver* resolver = document().scopedStyleResolver()) { 982 if (ScopedStyleResolver* resolver = document().scopedStyleResolver()) {
983 markDocumentDirty(); 983 markDocumentDirty();
984 resolver->setNeedsAppendAllSheets(); 984 resolver->setNeedsAppendAllSheets();
985 document().setNeedsStyleRecalc( 985 document().setNeedsStyleRecalc(
986 SubtreeStyleChange, StyleChangeReasonForTracing::create( 986 SubtreeStyleChange,
987 StyleChangeReason::ActiveStylesheetsUpdate)); 987 StyleChangeReasonForTracing::create(
988 StyleChangeReason::ActiveStylesheetsUpdate));
988 } 989 }
989 } 990 }
990 991
991 PassRefPtr<ComputedStyle> StyleEngine::findSharedStyle( 992 PassRefPtr<ComputedStyle> StyleEngine::findSharedStyle(
992 const ElementResolveContext& elementResolveContext) { 993 const ElementResolveContext& elementResolveContext) {
993 DCHECK(m_resolver); 994 DCHECK(m_resolver);
994 return SharedStyleFinder( 995 return SharedStyleFinder(
995 elementResolveContext, m_globalRuleSet.ruleFeatureSet(), 996 elementResolveContext, m_globalRuleSet.ruleFeatureSet(),
996 m_globalRuleSet.siblingRuleSet(), 997 m_globalRuleSet.siblingRuleSet(),
997 m_globalRuleSet.uncommonAttributeRuleSet(), *m_resolver) 998 m_globalRuleSet.uncommonAttributeRuleSet(), *m_resolver)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 treeScope.ensureScopedStyleResolver().appendActiveStyleSheets( 1067 treeScope.ensureScopedStyleResolver().appendActiveStyleSheets(
1067 appendStartIndex, newStyleSheets); 1068 appendStartIndex, newStyleSheets);
1068 } 1069 }
1069 1070
1070 if (treeScope.document().hasPendingForcedStyleRecalc()) 1071 if (treeScope.document().hasPendingForcedStyleRecalc())
1071 return; 1072 return;
1072 1073
1073 if (!treeScope.document().body() || 1074 if (!treeScope.document().body() ||
1074 treeScope.document().hasNodesWithPlaceholderStyle()) { 1075 treeScope.document().hasNodesWithPlaceholderStyle()) {
1075 treeScope.document().setNeedsStyleRecalc( 1076 treeScope.document().setNeedsStyleRecalc(
1076 SubtreeStyleChange, StyleChangeReasonForTracing::create( 1077 SubtreeStyleChange,
1077 StyleChangeReason::CleanupPlaceholderStyles)); 1078 StyleChangeReasonForTracing::create(
1079 StyleChangeReason::CleanupPlaceholderStyles));
1078 return; 1080 return;
1079 } 1081 }
1080 1082
1081 if (changedRuleFlags & KeyframesRules) 1083 if (changedRuleFlags & KeyframesRules)
1082 ScopedStyleResolver::keyframesRulesAdded(treeScope); 1084 ScopedStyleResolver::keyframesRulesAdded(treeScope);
1083 1085
1084 if (fontsChanged || (changedRuleFlags & FullRecalcRules)) { 1086 if (fontsChanged || (changedRuleFlags & FullRecalcRules)) {
1085 ScopedStyleResolver::invalidationRootForTreeScope(treeScope) 1087 ScopedStyleResolver::invalidationRootForTreeScope(treeScope)
1086 .setNeedsStyleRecalc(SubtreeStyleChange, 1088 .setNeedsStyleRecalc(SubtreeStyleChange,
1087 StyleChangeReasonForTracing::create( 1089 StyleChangeReasonForTracing::create(
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1148 }
1147 1149
1148 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1150 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1149 for (auto sheet : m_injectedAuthorStyleSheets) { 1151 for (auto sheet : m_injectedAuthorStyleSheets) {
1150 visitor->traceWrappers(sheet); 1152 visitor->traceWrappers(sheet);
1151 } 1153 }
1152 visitor->traceWrappers(m_documentStyleSheetCollection); 1154 visitor->traceWrappers(m_documentStyleSheetCollection);
1153 } 1155 }
1154 1156
1155 } // namespace blink 1157 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptRunner.cpp ('k') | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698