michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: ft=cpp tw=78 sw=2 et ts=2 michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * This Original Code has been modified by IBM Corporation. michael@0: * Modifications made by IBM described herein are Copyright (c) michael@0: * International Business Machines Corporation, 2000. Modifications michael@0: * to Mozilla code or documentation identified per MPL Section 3.3 michael@0: * michael@0: * Date Modified by Description of modification michael@0: * 04/20/2000 IBM Corp. OS/2 VisualAge build. michael@0: */ michael@0: michael@0: /* loading of CSS style sheets using the network APIs */ michael@0: michael@0: #include "mozilla/ArrayUtils.h" michael@0: #include "mozilla/MemoryReporting.h" michael@0: michael@0: #include "mozilla/css/Loader.h" michael@0: #include "nsIRunnable.h" michael@0: #include "nsIUnicharStreamLoader.h" michael@0: #include "nsSyncLoadService.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "nsIContent.h" michael@0: #include "nsIDocument.h" michael@0: #include "nsIDOMNode.h" michael@0: #include "nsIDOMDocument.h" michael@0: #include "nsIURI.h" michael@0: #include "nsNetUtil.h" michael@0: #include "nsContentUtils.h" michael@0: #include "nsIScriptSecurityManager.h" michael@0: #include "nsContentPolicyUtils.h" michael@0: #include "nsIHttpChannel.h" michael@0: #include "nsIHttpChannelInternal.h" michael@0: #include "nsIScriptError.h" michael@0: #include "nsMimeTypes.h" michael@0: #include "nsCSSStyleSheet.h" michael@0: #include "nsIStyleSheetLinkingElement.h" michael@0: #include "nsICSSLoaderObserver.h" michael@0: #include "nsCSSParser.h" michael@0: #include "mozilla/css/ImportRule.h" michael@0: #include "nsThreadUtils.h" michael@0: #include "nsGkAtoms.h" michael@0: #include "nsIThreadInternal.h" michael@0: #include "nsCrossSiteListenerProxy.h" michael@0: #include "nsINetworkSeer.h" michael@0: #include "mozilla/dom/ShadowRoot.h" michael@0: #include "mozilla/dom/URL.h" michael@0: michael@0: #ifdef MOZ_XUL michael@0: #include "nsXULPrototypeCache.h" michael@0: #endif michael@0: michael@0: #include "nsIMediaList.h" michael@0: #include "nsIDOMStyleSheet.h" michael@0: #include "nsError.h" michael@0: michael@0: #include "nsIChannelPolicy.h" michael@0: #include "nsIContentSecurityPolicy.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: michael@0: #include "mozilla/dom/EncodingUtils.h" michael@0: using mozilla::dom::EncodingUtils; michael@0: michael@0: using namespace mozilla::dom; michael@0: michael@0: /** michael@0: * OVERALL ARCHITECTURE michael@0: * michael@0: * The CSS Loader gets requests to load various sorts of style sheets: michael@0: * inline style from