@@ -86,8 +86,14 @@ class StylesheetGraph {
86
86
/// Returns the set of nodes that need to be recompiled because their imports
87
87
/// changed as a result of this stylesheet being added. This does not include
88
88
/// the new stylesheet, which can be accessed via `nodes[canonicalUrl]` .
89
+ ///
90
+ /// If [recanonicalize] is `false` , this instead avoids checking downstream
91
+ /// nodes' imports and always returns an empty set. It should only be set to
92
+ /// `false` when initially adding stylesheets, not when handling future
93
+ /// updates.
89
94
Set <StylesheetNode > addCanonical (
90
- Importer importer, Uri canonicalUrl, Uri originalUrl) {
95
+ Importer importer, Uri canonicalUrl, Uri originalUrl,
96
+ {bool recanonicalize = true }) {
91
97
var node = _nodes[canonicalUrl];
92
98
if (node != null ) return const {};
93
99
@@ -99,7 +105,9 @@ class StylesheetGraph {
99
105
_upstreamNodes (stylesheet, importer, canonicalUrl));
100
106
_nodes[canonicalUrl] = node;
101
107
102
- return _recanonicalizeImports (importer, canonicalUrl);
108
+ return recanonicalize
109
+ ? _recanonicalizeImports (importer, canonicalUrl)
110
+ : const {};
103
111
}
104
112
105
113
/// Returns two maps from non-canonicalized imported URLs in [stylesheet] to
0 commit comments