|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* |
|
7 * style sheet and style rule processor representing style attributes |
|
8 */ |
|
9 |
|
10 #ifndef nsHTMLCSSStyleSheet_h_ |
|
11 #define nsHTMLCSSStyleSheet_h_ |
|
12 |
|
13 #include "mozilla/Attributes.h" |
|
14 #include "mozilla/MemoryReporting.h" |
|
15 |
|
16 #include "nsDataHashtable.h" |
|
17 #include "nsIStyleRuleProcessor.h" |
|
18 |
|
19 struct MiscContainer; |
|
20 |
|
21 class nsHTMLCSSStyleSheet MOZ_FINAL : public nsIStyleRuleProcessor |
|
22 { |
|
23 public: |
|
24 nsHTMLCSSStyleSheet(); |
|
25 ~nsHTMLCSSStyleSheet(); |
|
26 |
|
27 NS_DECL_ISUPPORTS |
|
28 |
|
29 // nsIStyleRuleProcessor |
|
30 virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE; |
|
31 virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE; |
|
32 virtual void RulesMatching(AnonBoxRuleProcessorData* aData) MOZ_OVERRIDE; |
|
33 #ifdef MOZ_XUL |
|
34 virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE; |
|
35 #endif |
|
36 virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; |
|
37 virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) MOZ_OVERRIDE; |
|
38 virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE; |
|
39 virtual nsRestyleHint |
|
40 HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE; |
|
41 virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE; |
|
42 virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) |
|
43 const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; |
|
44 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) |
|
45 const MOZ_MUST_OVERRIDE MOZ_OVERRIDE; |
|
46 |
|
47 void CacheStyleAttr(const nsAString& aSerialized, MiscContainer* aValue); |
|
48 void EvictStyleAttr(const nsAString& aSerialized, MiscContainer* aValue); |
|
49 MiscContainer* LookupStyleAttr(const nsAString& aSerialized); |
|
50 |
|
51 private: |
|
52 nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE; |
|
53 nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE; |
|
54 |
|
55 protected: |
|
56 nsDataHashtable<nsStringHashKey, MiscContainer*> mCachedStyleAttrs; |
|
57 }; |
|
58 |
|
59 #endif /* !defined(nsHTMLCSSStyleSheet_h_) */ |