mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1045532 - Part 1 - Drop <picture> sources with unsupported types. r=bz
This commit is contained in:
parent
491a0b280e
commit
c6ac48160b
@ -28,6 +28,7 @@
|
||||
#include "nsFocusManager.h"
|
||||
#include "mozilla/dom/HTMLFormElement.h"
|
||||
#include "nsAttrValueOrString.h"
|
||||
#include "imgLoader.h"
|
||||
|
||||
// Responsive images!
|
||||
#include "mozilla/dom/HTMLSourceElement.h"
|
||||
@ -1095,10 +1096,17 @@ HTMLImageElement::TryCreateResponsiveSelector(nsIContent *aSourceNode,
|
||||
MOZ_ASSERT(IsPreviousSibling(aSourceNode, this));
|
||||
MOZ_ASSERT(pictureEnabled);
|
||||
|
||||
// Check media and type
|
||||
HTMLSourceElement *src = static_cast<HTMLSourceElement*>(aSourceNode);
|
||||
if (!src->MatchesCurrentMedia()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoString type;
|
||||
if (aSourceNode->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type) &&
|
||||
!imgLoader::SupportImageWithMimeType(NS_ConvertUTF16toUTF8(type).get())) {
|
||||
return false;
|
||||
}
|
||||
} else if (aSourceNode->Tag() == nsGkAtoms::img) {
|
||||
// Otherwise this is the <img> tag itself
|
||||
MOZ_ASSERT(aSourceNode == this);
|
||||
|
Loading…
Reference in New Issue
Block a user