2626#include " mozilla/CycleCollectedJSContext.h"
2727#include " mozilla/LoadInfo.h"
2828#include " mozilla/Maybe.h"
29+ #include " mozilla/StyleSheet.h"
30+ #include " mozilla/StyleSheetInlines.h"
2931#include " mozilla/dom/AutoEntryScript.h"
3032#include " mozilla/dom/Document.h"
3133#include " mozilla/dom/Element.h"
3234#include " mozilla/dom/RequestBinding.h"
33- #include " mozilla/StyleSheet.h"
34- #include " mozilla/StyleSheetInlines.h"
3535#include " nsContentSecurityManager.h"
3636#include " nsError.h"
3737#include " nsIContent.h"
@@ -373,10 +373,11 @@ nsresult ModuleLoader::CompileCssModule(
373373 ErrorResult error;
374374 auto compile = [&](auto & source) {
375375 using T = decltype (source);
376- static_assert (std::is_same_v<T, JS::SourceText<char16_t >&> || std::is_same_v<T, JS::SourceText<Utf8Unit>&>);
376+ static_assert (std::is_same_v<T, JS::SourceText<char16_t >&> ||
377+ std::is_same_v<T, JS::SourceText<Utf8Unit>&>);
377378
378379 nsCOMPtr<nsPIDOMWindowInner> window =
379- do_QueryInterface (aRequest->GetGlobalObject ());
380+ do_QueryInterface (aRequest->GetGlobalObject ());
380381 if (!window) {
381382 error.ThrowNotSupportedError (" Not supported when there is no document" );
382383 return ;
@@ -388,19 +389,22 @@ nsresult ModuleLoader::CompileCssModule(
388389 return ;
389390 }
390391
391- // 5. Let sheet be the result of running the steps to create a constructed CSSStyleSheet
392+ // 5. Let sheet be the result of running the steps to create a constructed
393+ // CSSStyleSheet
392394 // with an empty dictionary as the argument.
393- // Note that according to the specification, the baseURL should be the baseURL of the document,
394- // but that doesn't seem correct (see https://github.com/whatwg/html/issues/11629).
395+ // Note that according to the specification, the baseURL should be the
396+ // baseURL of the document, but that doesn't seem correct (see
397+ // https://github.com/whatwg/html/issues/11629).
395398 dom::CSSStyleSheetInit options;
396- RefPtr<StyleSheet> sheet = StyleSheet::CreateConstructedSheet (*constructorDocument, aRequest->mBaseURL , options, error);
399+ RefPtr<StyleSheet> sheet = StyleSheet::CreateConstructedSheet (
400+ *constructorDocument, aRequest->mBaseURL , options, error);
397401 if (error.Failed ()) {
398402 return ;
399403 }
400404
401- // 6. Run the steps to synchronously replace the rules of a CSSStyleSheet on sheet given source.
402- // Ideally we wouldn't run this on the main thread for large scripts,
403- // see https://bugzilla.mozilla.org/show_bug.cgi?id=1987143.
405+ // 6. Run the steps to synchronously replace the rules of a CSSStyleSheet on
406+ // sheet given source. Ideally we wouldn't run this on the main thread for
407+ // large scripts, see https://bugzilla.mozilla.org/show_bug.cgi?id=1987143.
404408 if constexpr (std::is_same_v<T, JS::SourceText<mozilla::Utf8Unit>&>) {
405409 nsDependentCSubstring text (source.get (), source.length ());
406410 sheet->ReplaceSync (text, error);
0 commit comments