Bug 1730256 [wpt PR 30555] - Move getWindowSegments to visualViewport.segments, a...
[gecko.git] / layout / style / nsHTMLCSSStyleSheet.h
blob7c087cef5d14e6a996830555650058fac8273a67
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * style sheet and style rule processor representing style attributes
9 */
11 #ifndef nsHTMLCSSStyleSheet_h_
12 #define nsHTMLCSSStyleSheet_h_
14 #include "mozilla/Attributes.h"
15 #include "mozilla/MemoryReporting.h"
17 #include "nsTHashMap.h"
19 class nsRuleWalker;
20 struct MiscContainer;
22 namespace mozilla {
23 enum class PseudoStyleType : uint8_t;
24 namespace dom {
25 class Element;
26 } // namespace dom
27 } // namespace mozilla
29 class nsHTMLCSSStyleSheet final {
30 public:
31 nsHTMLCSSStyleSheet();
33 NS_INLINE_DECL_REFCOUNTING(nsHTMLCSSStyleSheet)
35 void CacheStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
36 void EvictStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
37 MiscContainer* LookupStyleAttr(const nsAString& aSerialized);
39 private:
40 ~nsHTMLCSSStyleSheet();
42 nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) = delete;
43 nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) = delete;
45 protected:
46 nsTHashMap<nsStringHashKey, MiscContainer*> mCachedStyleAttrs;
49 #endif /* !defined(nsHTMLCSSStyleSheet_h_) */