CSSLab.cpp (2287B)
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/CSSLab.h" 8 9 #include "mozilla/AlreadyAddRefed.h" 10 #include "mozilla/ErrorResult.h" 11 #include "mozilla/RefPtr.h" 12 #include "mozilla/dom/BindingDeclarations.h" 13 #include "mozilla/dom/CSSColorValueBinding.h" 14 #include "mozilla/dom/CSSLabBinding.h" 15 16 namespace mozilla::dom { 17 18 CSSLab::CSSLab(nsCOMPtr<nsISupports> aParent) 19 : CSSColorValue(std::move(aParent)) {} 20 21 JSObject* CSSLab::WrapObject(JSContext* aCx, 22 JS::Handle<JSObject*> aGivenProto) { 23 return CSSLab_Binding::Wrap(aCx, this, aGivenProto); 24 } 25 26 // start of CSSLab Web IDL implementation 27 28 // static 29 already_AddRefed<CSSLab> CSSLab::Constructor(const GlobalObject& aGlobal, 30 const CSSColorPercent& aL, 31 const CSSColorNumber& aA, 32 const CSSColorNumber& aB, 33 const CSSColorPercent& aAlpha, 34 ErrorResult& aRv) { 35 return MakeAndAddRef<CSSLab>(aGlobal.GetAsSupports()); 36 } 37 38 void CSSLab::GetL(OwningCSSColorPercent& aRetVal) const { 39 aRetVal.SetAsDouble() = 0; 40 } 41 42 void CSSLab::SetL(const CSSColorPercent& aArg, ErrorResult& aRv) { 43 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 44 } 45 46 void CSSLab::GetA(OwningCSSColorNumber& aRetVal) const { 47 aRetVal.SetAsDouble() = 0; 48 } 49 50 void CSSLab::SetA(const CSSColorNumber& aArg, ErrorResult& aRv) { 51 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 52 } 53 54 void CSSLab::GetB(OwningCSSColorNumber& aRetVal) const { 55 aRetVal.SetAsDouble() = 0; 56 } 57 58 void CSSLab::SetB(const CSSColorNumber& aArg, ErrorResult& aRv) { 59 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 60 } 61 62 void CSSLab::GetAlpha(OwningCSSColorPercent& aRetVal) const { 63 aRetVal.SetAsDouble() = 0; 64 } 65 66 void CSSLab::SetAlpha(const CSSColorPercent& aArg, ErrorResult& aRv) { 67 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 68 } 69 70 // end of CSSLab Web IDL implementation 71 72 } // namespace mozilla::dom