CSSHSL.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/CSSHSL.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/CSSHSLBinding.h" 15 16 namespace mozilla::dom { 17 18 CSSHSL::CSSHSL(nsCOMPtr<nsISupports> aParent) 19 : CSSColorValue(std::move(aParent)) {} 20 21 JSObject* CSSHSL::WrapObject(JSContext* aCx, 22 JS::Handle<JSObject*> aGivenProto) { 23 return CSSHSL_Binding::Wrap(aCx, this, aGivenProto); 24 } 25 26 // start of CSSHSL Web IDL implementation 27 28 // static 29 already_AddRefed<CSSHSL> CSSHSL::Constructor(const GlobalObject& aGlobal, 30 const CSSColorAngle& aH, 31 const CSSColorPercent& aS, 32 const CSSColorPercent& aL, 33 const CSSColorPercent& aAlpha, 34 ErrorResult& aRv) { 35 return MakeAndAddRef<CSSHSL>(aGlobal.GetAsSupports()); 36 } 37 38 void CSSHSL::GetH(OwningCSSColorAngle& aRetVal) const { 39 aRetVal.SetAsDouble() = 0; 40 } 41 42 void CSSHSL::SetH(const CSSColorAngle& aArg, ErrorResult& aRv) { 43 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 44 } 45 46 void CSSHSL::GetS(OwningCSSColorPercent& aRetVal) const { 47 aRetVal.SetAsDouble() = 0; 48 } 49 50 void CSSHSL::SetS(const CSSColorPercent& aArg, ErrorResult& aRv) { 51 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 52 } 53 54 void CSSHSL::GetL(OwningCSSColorPercent& aRetVal) const { 55 aRetVal.SetAsDouble() = 0; 56 } 57 58 void CSSHSL::SetL(const CSSColorPercent& aArg, ErrorResult& aRv) { 59 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 60 } 61 62 void CSSHSL::GetAlpha(OwningCSSColorPercent& aRetVal) const { 63 aRetVal.SetAsDouble() = 0; 64 } 65 66 void CSSHSL::SetAlpha(const CSSColorPercent& aArg, ErrorResult& aRv) { 67 aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); 68 } 69 70 // end of CSSHSL Web IDL implementation 71 72 } // namespace mozilla::dom