CSSStartingStyleRule.cpp (1576B)
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 #include "mozilla/dom/CSSStartingStyleRule.h" 8 9 #include "mozilla/ServoBindings.h" 10 #include "mozilla/dom/CSSStartingStyleRuleBinding.h" 11 12 namespace mozilla::dom { 13 14 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(CSSStartingStyleRule, 15 css::GroupRule) 16 17 // QueryInterface implementation for SupportsRule 18 19 #ifdef DEBUG 20 void CSSStartingStyleRule::List(FILE* out, int32_t aIndent) const { 21 nsAutoCString str; 22 for (int32_t i = 0; i < aIndent; i++) { 23 str.AppendLiteral(" "); 24 } 25 Servo_StartingStyleRule_Debug(mRawRule, &str); 26 fprintf_stderr(out, "%s\n", str.get()); 27 } 28 #endif 29 30 StyleCssRuleType CSSStartingStyleRule::Type() const { 31 return StyleCssRuleType::StartingStyle; 32 } 33 34 already_AddRefed<StyleLockedCssRules> 35 CSSStartingStyleRule::GetOrCreateRawRules() { 36 return Servo_StartingStyleRule_GetRules(mRawRule).Consume(); 37 } 38 39 void CSSStartingStyleRule::GetCssText(nsACString& aCssText) const { 40 Servo_StartingStyleRule_GetCssText(mRawRule.get(), &aCssText); 41 } 42 43 JSObject* CSSStartingStyleRule::WrapObject(JSContext* aCx, 44 JS::Handle<JSObject*> aGivenProto) { 45 return CSSStartingStyleRule_Binding::Wrap(aCx, this, aGivenProto); 46 } 47 48 } // namespace mozilla::dom