mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1673199 - Make MediaList objects return a style sheet parent so that we associate reflectors to the right global. r=smaug
Otherwise if devtools or other privileged JS access them then content can choke. Differential Revision: https://phabricator.services.mozilla.com/D95121
This commit is contained in:
parent
cfaedde161
commit
73560dc1dd
@ -39,6 +39,8 @@ void MediaList::SetStyleSheet(StyleSheet* aSheet) {
|
||||
mStyleSheet = aSheet;
|
||||
}
|
||||
|
||||
nsISupports* MediaList::GetParentObject() const { return mStyleSheet; }
|
||||
|
||||
template <typename Func>
|
||||
void MediaList::DoMediaChange(Func aCallback, ErrorResult& aRv) {
|
||||
if (IsReadOnly()) {
|
||||
|
@ -40,7 +40,7 @@ class MediaList final : public nsISupports, public nsWrapperCache {
|
||||
already_AddRefed<MediaList> Clone();
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
|
||||
nsISupports* GetParentObject() const { return nullptr; }
|
||||
nsISupports* GetParentObject() const;
|
||||
|
||||
void GetText(nsAString& aMediaText);
|
||||
void SetText(const nsAString& aMediaText);
|
||||
|
Loading…
Reference in New Issue
Block a user