CSSNumericArray.h (1729B)
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 #ifndef LAYOUT_STYLE_TYPEDOM_CSSNUMERICARRAY_H_ 8 #define LAYOUT_STYLE_TYPEDOM_CSSNUMERICARRAY_H_ 9 10 #include <stdint.h> 11 12 #include "js/TypeDecls.h" 13 #include "mozilla/dom/CSSNumericValueBindingFwd.h" 14 #include "nsCOMPtr.h" 15 #include "nsISupports.h" 16 #include "nsISupportsImpl.h" 17 #include "nsTArray.h" 18 #include "nsWrapperCache.h" 19 20 namespace mozilla { 21 22 namespace dom { 23 24 class CSSNumericArray final : public nsISupports, public nsWrapperCache { 25 public: 26 CSSNumericArray(nsCOMPtr<nsISupports> aParent, 27 nsTArray<RefPtr<CSSNumericValue>> aValues); 28 29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 30 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CSSNumericArray) 31 32 nsISupports* GetParentObject() const; 33 34 JSObject* WrapObject(JSContext* aCx, 35 JS::Handle<JSObject*> aGivenProto) override; 36 37 // start of CSSNumericArray Web IDL declarations 38 39 // https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericarray-length 40 uint32_t Length() const; 41 42 // https://drafts.css-houdini.org/css-typed-om-1/#cssnumericarray-indexed-property-getter 43 CSSNumericValue* IndexedGetter(uint32_t aIndex, bool& aFound); 44 45 // end of CSSNumericArray Web IDL declarations 46 47 private: 48 virtual ~CSSNumericArray() = default; 49 50 nsCOMPtr<nsISupports> mParent; 51 nsTArray<RefPtr<CSSNumericValue>> mValues; 52 }; 53 54 } // namespace dom 55 } // namespace mozilla 56 57 #endif // LAYOUT_STYLE_TYPEDOM_CSSNUMERICARRAY_H_