Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / base / ScreenLuminance.h
blob5595fd734beaddea4d31a45f391f044ac550cd98
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 et tw=78: */
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/. */
7 #ifndef mozilla_dom_ScreenLuminance_h
8 #define mozilla_dom_ScreenLuminance_h
10 #include "nsCycleCollectionParticipant.h"
11 #include "nsISupportsImpl.h"
12 #include "nsWrapperCache.h"
14 class nsScreen;
16 namespace mozilla::dom {
18 class ScreenLuminance final : public nsWrapperCache {
19 public:
20 // Ref counting and cycle collection
21 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ScreenLuminance)
22 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ScreenLuminance)
24 // WebIDL methods
25 double Min() const { return mMin; }
26 double Max() const { return mMax; }
27 double MaxAverage() const { return mMaxAverage; }
28 // End WebIDL methods
30 ScreenLuminance(nsScreen* aScreen, double aMin, double aMax,
31 double aMaxAverage)
32 : mScreen(aScreen), mMin(aMin), mMax(aMax), mMaxAverage(aMaxAverage) {}
34 nsScreen* GetParentObject() const { return mScreen; }
35 JSObject* WrapObject(JSContext* aCx,
36 JS::Handle<JSObject*> aGivenProto) override;
38 private:
39 virtual ~ScreenLuminance() = default;
41 RefPtr<nsScreen> mScreen;
42 double mMin;
43 double mMax;
44 double mMaxAverage;
47 } // namespace mozilla::dom
49 #endif // mozilla_dom_ScreenLuminance_h