CSSVariableReferenceValue.cpp (2299B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:set ts=2 sw=2 sts=2 et cindent: */ 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/CSSVariableReferenceValue.h" 8 9 #include "mozilla/AlreadyAddRefed.h" 10 #include "mozilla/Assertions.h" 11 #include "mozilla/ErrorResult.h" 12 #include "mozilla/RefPtr.h" 13 #include "mozilla/dom/CSSVariableReferenceValueBinding.h" 14 #include "nsCycleCollectionParticipant.h" 15 16 namespace mozilla::dom { 17 18 CSSVariableReferenceValue::CSSVariableReferenceValue( 19 nsCOMPtr<nsISupports> aParent) 20 : mParent(std::move(aParent)) { 21 MOZ_ASSERT(mParent); 22 } 23 24 NS_IMPL_CYCLE_COLLECTING_ADDREF(CSSVariableReferenceValue) 25 NS_IMPL_CYCLE_COLLECTING_RELEASE(CSSVariableReferenceValue) 26 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSVariableReferenceValue) 27 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY 28 NS_INTERFACE_MAP_ENTRY(nsISupports) 29 NS_INTERFACE_MAP_END 30 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CSSVariableReferenceValue, mParent) 31 32 nsISupports* CSSVariableReferenceValue::GetParentObject() const { 33 return mParent; 34 } 35 36 JSObject* CSSVariableReferenceValue::WrapObject( 37 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { 38 return CSSVariableReferenceValue_Binding::Wrap(aCx, this, aGivenProto); 39 } 40 41 // start of CSSVariableReferenceValue Web IDL implementation 42 43 // static 44 already_AddRefed<CSSVariableReferenceValue> 45 CSSVariableReferenceValue::Constructor(const GlobalObject& aGlobal, 46 const nsACString& aVariable, 47 CSSUnparsedValue* aFallback, 48 ErrorResult& aRv) { 49 return MakeAndAddRef<CSSVariableReferenceValue>(aGlobal.GetAsSupports()); 50 } 51 52 void CSSVariableReferenceValue::GetVariable(nsCString& aRetVal) const {} 53 54 void CSSVariableReferenceValue::SetVariable(const nsACString& aArg, 55 ErrorResult& aRv) { 56 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 57 } 58 59 CSSUnparsedValue* CSSVariableReferenceValue::GetFallback() const { 60 return nullptr; 61 } 62 63 // end of CSSVariableReferenceValue Web IDL implementation 64 65 } // namespace mozilla::dom