mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Restore nsIDOMMediaQueryList XPCOM interface.
Except for AddListener and RemoveListener as they would add unnecessary complications not needed by wine. Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
parent
1004e5f9fd
commit
0018fc6db4
@ -19,6 +19,7 @@ XPIDL_SOURCES += [
|
||||
'nsIDOMGlobalPropertyInitializer.idl',
|
||||
'nsIDOMHistory.idl',
|
||||
'nsIDOMLocation.idl',
|
||||
'nsIDOMMediaQueryList.idl',
|
||||
'nsIDOMModalContentWindow.idl',
|
||||
'nsIDOMNavigator.idl',
|
||||
'nsIDOMScreen.idl',
|
||||
|
13
dom/interfaces/base/nsIDOMMediaQueryList.idl
Normal file
13
dom/interfaces/base/nsIDOMMediaQueryList.idl
Normal file
@ -0,0 +1,13 @@
|
||||
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
|
||||
/* 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/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[builtinclass, uuid(e0e49c52-915b-40f9-9cba-6026305cdf3e)]
|
||||
interface nsIDOMMediaQueryList : nsISupports
|
||||
{
|
||||
readonly attribute DOMString media;
|
||||
readonly attribute boolean matches;
|
||||
};
|
@ -55,6 +55,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(MediaQueryList)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(MediaQueryList)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMediaQueryList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(MediaQueryList)
|
||||
NS_INTERFACE_MAP_END
|
||||
@ -62,10 +63,18 @@ NS_INTERFACE_MAP_END
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(MediaQueryList)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaQueryList)
|
||||
|
||||
void
|
||||
NS_IMETHODIMP
|
||||
MediaQueryList::GetMedia(nsAString &aMedia)
|
||||
{
|
||||
mMediaList->GetText(aMedia);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MediaQueryList::GetMatches(bool *aMatches)
|
||||
{
|
||||
*aMatches = Matches();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef mozilla_dom_MediaQueryList_h
|
||||
#define mozilla_dom_MediaQueryList_h
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIDOMMediaQueryList.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
@ -25,7 +25,7 @@ class nsMediaList;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class MediaQueryList final : public nsISupports,
|
||||
class MediaQueryList final : public nsIDOMMediaQueryList,
|
||||
public nsWrapperCache,
|
||||
public PRCList
|
||||
{
|
||||
@ -41,6 +41,8 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaQueryList)
|
||||
|
||||
NS_DECL_NSIDOMMEDIAQUERYLIST
|
||||
|
||||
nsISupports* GetParentObject() const;
|
||||
|
||||
struct HandleChangeData {
|
||||
@ -58,7 +60,7 @@ public:
|
||||
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
// WebIDL methods
|
||||
void GetMedia(nsAString& aMedia);
|
||||
// The XPCOM GetMedia method is good
|
||||
bool Matches();
|
||||
void AddListener(mozilla::dom::MediaQueryListListener& aListener);
|
||||
void RemoveListener(mozilla::dom::MediaQueryListListener& aListener);
|
||||
|
Loading…
Reference in New Issue
Block a user