From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- layout/style/StyleSheet.h | 210 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 layout/style/StyleSheet.h (limited to 'layout/style/StyleSheet.h') diff --git a/layout/style/StyleSheet.h b/layout/style/StyleSheet.h new file mode 100644 index 000000000..f21a6d648 --- /dev/null +++ b/layout/style/StyleSheet.h @@ -0,0 +1,210 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#ifndef mozilla_StyleSheet_h +#define mozilla_StyleSheet_h + +#include "mozilla/css/SheetParsingMode.h" +#include "mozilla/dom/CSSStyleSheetBinding.h" +#include "mozilla/net/ReferrerPolicy.h" +#include "mozilla/StyleBackendType.h" +#include "mozilla/CORSMode.h" +#include "mozilla/ServoUtils.h" + +#include "nsIDOMCSSStyleSheet.h" +#include "nsWrapperCache.h" + +class nsIDocument; +class nsINode; +class nsIPrincipal; +class nsMediaList; + +namespace mozilla { + +class CSSStyleSheet; +class ServoStyleSheet; +struct StyleSheetInfo; + +namespace dom { +class CSSRuleList; +class SRIMetadata; +} // namespace dom + +/** + * Superclass for data common to CSSStyleSheet and ServoStyleSheet. + */ +class StyleSheet : public nsIDOMCSSStyleSheet + , public nsWrapperCache +{ +protected: + StyleSheet(StyleBackendType aType, css::SheetParsingMode aParsingMode); + StyleSheet(const StyleSheet& aCopy, + nsIDocument* aDocumentToUse, + nsINode* aOwningNodeToUse); + virtual ~StyleSheet() {} + +public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheet) + + void SetOwningNode(nsINode* aOwningNode) + { + mOwningNode = aOwningNode; + } + + css::SheetParsingMode ParsingMode() { return mParsingMode; } + mozilla::dom::CSSStyleSheetParsingMode ParsingModeDOM(); + + // The document this style sheet is associated with. May be null + nsIDocument* GetDocument() const { return mDocument; } + + /** + * Whether the sheet is complete. + */ + bool IsComplete() const; + void SetComplete(); + + MOZ_DECL_STYLO_METHODS(CSSStyleSheet, ServoStyleSheet) + + // Whether the sheet is for an inline