Line data Source code
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
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : /* representation of media lists for servo backend */
8 :
9 : #ifndef mozilla_ServoMediaList_h
10 : #define mozilla_ServoMediaList_h
11 :
12 : #include "mozilla/dom/MediaList.h"
13 : #include "mozilla/ServoBindingTypes.h"
14 :
15 : namespace mozilla {
16 :
17 : class ServoMediaList final : public dom::MediaList
18 : {
19 : public:
20 0 : explicit ServoMediaList(already_AddRefed<RawServoMediaList> aRawList)
21 0 : : mRawList(aRawList) {}
22 : explicit ServoMediaList(const nsAString& aMedia);
23 : ServoMediaList();
24 :
25 : already_AddRefed<dom::MediaList> Clone() final;
26 :
27 : void GetText(nsAString& aMediaText) final;
28 : void SetText(const nsAString& aMediaText) final;
29 :
30 : uint32_t Length() final;
31 : void IndexedGetter(uint32_t aIndex, bool& aFound,
32 : nsAString& aReturn) final;
33 :
34 : bool Matches(nsPresContext*) const final;
35 :
36 : #ifdef DEBUG
37 0 : bool IsServo() const final { return true; }
38 : #endif
39 :
40 : RawServoMediaList& RawList() { return *mRawList; }
41 :
42 : protected:
43 : nsresult Delete(const nsAString& aOldMedium) final;
44 : nsresult Append(const nsAString& aNewMedium) final;
45 :
46 0 : ~ServoMediaList() {}
47 :
48 : private:
49 : RefPtr<RawServoMediaList> mRawList;
50 : };
51 :
52 : } // namespace mozilla
53 :
54 : #endif // mozilla_ServoMediaList_h
|