/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * */ /* loading of CSS style sheets using the network APIs */ #include "mozilla/ArrayUtils.h" #include "mozilla/LoadInfo.h" #include "mozilla/MemoryReporting.h" #include "mozilla/css/Loader.h" #include "mozilla/StyleSheetInlines.h" #include "nsIRunnable.h" #include "nsIUnicharStreamLoader.h" #include "nsSyncLoadService.h" #include "nsCOMPtr.h" #include "nsString.h" #include "nsIContent.h" #include "nsIDocument.h" #include "nsIDOMNode.h" #include "nsIDOMDocument.h" #include "nsIURI.h" #include "nsNetUtil.h" #include "nsIProtocolHandler.h" #include "nsContentUtils.h" #include "nsIScriptSecurityManager.h" #include "nsContentPolicyUtils.h" #include "nsIHttpChannel.h" #include "nsIHttpChannelInternal.h" #include "nsIClassOfService.h" #include "nsIScriptError.h" #include "nsMimeTypes.h" #include "nsIStyleSheetLinkingElement.h" #include "nsICSSLoaderObserver.h" #include "nsCSSParser.h" #include "mozilla/css/ImportRule.h" #include "nsThreadUtils.h" #include "nsGkAtoms.h" #include "nsIThreadInternal.h" #include "nsINetworkPredictor.h" #include "nsITimedChannel.h" #include "mozilla/dom/ShadowRoot.h" #include "mozilla/dom/URL.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" #include "mozilla/ConsoleReportCollector.h" #include "nsXULPrototypeCache.h" #include "nsIMediaList.h" #include "nsIDOMStyleSheet.h" #include "nsError.h" #include "nsIContentSecurityPolicy.h" #include "mozilla/dom/SRICheck.h" #include "mozilla/dom/EncodingUtils.h" using mozilla::dom::EncodingUtils; using namespace mozilla::dom; /** * OVERALL ARCHITECTURE * * The CSS Loader gets requests to load various sorts of style sheets: * inline style from