CSSScopeRule.h (1415B)
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/. */ 6 7 #ifndef CSSScopeRule_h___ 8 #define CSSScopeRule_h___ 9 10 #include "mozilla/ServoBindingTypes.h" 11 #include "mozilla/css/GroupRule.h" 12 13 namespace mozilla::dom { 14 15 class CSSScopeRule final : public css::GroupRule { 16 public: 17 CSSScopeRule(RefPtr<StyleScopeRule> aRawRule, StyleSheet* aSheet, 18 css::Rule* aParentRule, uint32_t aLine, uint32_t aColumn); 19 20 NS_DECL_ISUPPORTS_INHERITED 21 22 #ifdef DEBUG 23 void List(FILE* out = stdout, int32_t aIndent = 0) const final; 24 #endif 25 26 StyleScopeRule* Raw() const { return mRawRule; } 27 void SetRawAfterClone(RefPtr<StyleScopeRule>); 28 29 already_AddRefed<StyleLockedCssRules> GetOrCreateRawRules() final; 30 31 // WebIDL interface 32 StyleCssRuleType Type() const final; 33 void GetCssText(nsACString& aCssText) const final; 34 35 void GetStart(nsACString& aStart) const; 36 void GetEnd(nsACString& aEnd) const; 37 38 size_t SizeOfIncludingThis(MallocSizeOf) const override; 39 JSObject* WrapObject(JSContext*, JS::Handle<JSObject*>) override; 40 41 private: 42 ~CSSScopeRule() = default; 43 44 RefPtr<StyleScopeRule> mRawRule; 45 }; 46 47 } // namespace mozilla::dom 48 49 #endif