gecko-dev/layout/style/ServoMediaList.h
Xidorn Quan 7941bea334 Bug 1315601 part 5 - Implement MediaList for Stylo. r=heycam,manishearth
MozReview-Commit-ID: 1NSyoqguoJr

--HG--
extra : rebase_source : 63e482fa74ef1f88777d9fbe7cdc4c4cb7832666
2017-03-09 17:56:31 +11:00

45 lines
1.2 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* representation of media lists for servo backend */
#ifndef mozilla_ServoMediaList_h
#define mozilla_ServoMediaList_h
#include "mozilla/dom/MediaList.h"
#include "mozilla/ServoBindingTypes.h"
namespace mozilla {
class ServoMediaList final : public dom::MediaList
{
public:
explicit ServoMediaList(already_AddRefed<RawServoMediaList> aRawList)
: mRawList(aRawList) {}
already_AddRefed<dom::MediaList> Clone() final;
void GetText(nsAString& aMediaText) final;
void SetText(const nsAString& aMediaText) final;
uint32_t Length() final;
void IndexedGetter(uint32_t aIndex, bool& aFound,
nsAString& aReturn) final;
protected:
nsresult Delete(const nsAString& aOldMedium) final;
nsresult Append(const nsAString& aNewMedium) final;
~ServoMediaList() {}
private:
RefPtr<RawServoMediaList> mRawList;
};
} // namespace mozilla
#endif // mozilla_ServoMediaList_h