Bug 1325878: Don't hardode nsMediaList in dom::StyleSheet. r=xidorn

MozReview-Commit-ID: IynF1NFUSLf
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-04-11 09:31:21 +08:00
Родитель 75a86d5f3c
Коммит 6ec12dc4f5
2 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -41,11 +41,18 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaList)
/**
* Creates a MediaList backed by the StyleBackendType of the document.
* Creates a MediaList backed by the given StyleBackendType.
*/
static already_AddRefed<MediaList> Create(StyleBackendType,
const nsAString& aMedia);
/**
* Creates a MediaList backed by the given StyleBackendType.
*/
static already_AddRefed<MediaList> Create(StyleBackendType aBackendType) {
return Create(aBackendType, nsString());
}
/**
* Creates a MediaList backed by the StyleBackendType of the document.
*/

Просмотреть файл

@ -14,7 +14,6 @@
#include "mozilla/CSSStyleSheet.h"
#include "mozAutoDocUpdate.h"
#include "nsMediaList.h"
#include "NullPrincipal.h"
namespace mozilla {
@ -692,7 +691,7 @@ dom::MediaList*
StyleSheet::Media()
{
if (!mMedia) {
mMedia = new nsMediaList();
mMedia = dom::MediaList::Create(mType);
mMedia->SetStyleSheet(this);
}