TestReflectedHTMLAttribute.h (1675B)
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 file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_TestReflectedHTMLAttribute_h 8 #define mozilla_dom_TestReflectedHTMLAttribute_h 9 10 #include "mozilla/dom/BindingDeclarations.h" 11 #include "mozilla/dom/Element.h" 12 #include "mozilla/dom/Nullable.h" 13 #include "nsWrapperCache.h" 14 15 namespace mozilla::dom { 16 17 class TestReflectedHTMLAttribute final : public nsWrapperCache { 18 public: 19 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TestReflectedHTMLAttribute) 20 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(TestReflectedHTMLAttribute) 21 22 static already_AddRefed<TestReflectedHTMLAttribute> Constructor( 23 GlobalObject& aGlobal); 24 25 void GetReflectedHTMLAttribute(bool* aUseCachedValue, 26 Nullable<nsTArray<RefPtr<Element>>>& aResult); 27 void SetReflectedHTMLAttribute( 28 const Nullable<Sequence<OwningNonNull<Element>>>& aValue); 29 void SetReflectedHTMLAttributeValue( 30 const Sequence<OwningNonNull<Element>>& aElements); 31 32 nsISupports* GetParentObject() const { return nullptr; } 33 JSObject* WrapObject(JSContext* aCx, 34 JS::Handle<JSObject*> aGivenProto) override; 35 36 private: 37 ~TestReflectedHTMLAttribute() = default; 38 39 Nullable<nsTArray<RefPtr<Element>>> mCachedElements; 40 Nullable<nsTArray<RefPtr<Element>>> mNewElements; 41 }; 42 43 } // namespace mozilla::dom 44 45 #endif // mozilla_dom_TestReflectedHTMLAttribute_h