mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1134131 r=jst
This commit is contained in:
parent
d1b848dffb
commit
b4748e488c
@ -585,7 +585,7 @@ HTMLImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
UpdateFormOwner();
|
||||
}
|
||||
|
||||
bool addedToPicture = aParent && aParent->Tag() == nsGkAtoms::picture &&
|
||||
bool addedToPicture = aParent && aParent->IsHTML(nsGkAtoms::picture) &&
|
||||
HTMLPictureElement::IsPictureEnabled();
|
||||
if (addedToPicture) {
|
||||
QueueImageLoadTask();
|
||||
@ -887,8 +887,8 @@ HTMLImageElement::HaveSrcsetOrInPicture()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsINode *parent = nsINode::GetParentNode();
|
||||
return (parent && parent->Tag() == nsGkAtoms::picture);
|
||||
Element *parent = nsINode::GetParentElement();
|
||||
return (parent && parent->IsHTML(nsGkAtoms::picture));
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1043,10 +1043,10 @@ HTMLImageElement::UpdateResponsiveSource()
|
||||
nsIContent *currentSource =
|
||||
mResponsiveSelector ? mResponsiveSelector->Content() : nullptr;
|
||||
bool pictureEnabled = HTMLPictureElement::IsPictureEnabled();
|
||||
nsINode *parent = pictureEnabled ? this->nsINode::GetParentNode() : nullptr;
|
||||
Element *parent = pictureEnabled ? nsINode::GetParentElement() : nullptr;
|
||||
|
||||
nsINode *candidateSource = nullptr;
|
||||
if (parent && parent->Tag() == nsGkAtoms::picture) {
|
||||
if (parent && parent->IsHTML(nsGkAtoms::picture)) {
|
||||
// Walk source nodes previous to ourselves
|
||||
candidateSource = parent->GetFirstChild();
|
||||
} else {
|
||||
@ -1075,7 +1075,8 @@ HTMLImageElement::UpdateResponsiveSource()
|
||||
mResponsiveSelector = nullptr;
|
||||
}
|
||||
break;
|
||||
} else if (candidateSource->Tag() == nsGkAtoms::source &&
|
||||
} else if (candidateSource->IsElement() &&
|
||||
candidateSource->AsElement()->IsHTML(nsGkAtoms::source) &&
|
||||
TryCreateResponsiveSelector(candidateSource->AsContent())) {
|
||||
// This led to a valid source, stop
|
||||
break;
|
||||
@ -1108,10 +1109,10 @@ HTMLImageElement::TryCreateResponsiveSelector(nsIContent *aSourceNode,
|
||||
|
||||
bool pictureEnabled = HTMLPictureElement::IsPictureEnabled();
|
||||
// Skip if this is not a <source> with matching media query
|
||||
bool isSourceTag = aSourceNode->Tag() == nsGkAtoms::source;
|
||||
bool isSourceTag = aSourceNode->IsHTML(nsGkAtoms::source);
|
||||
if (isSourceTag) {
|
||||
DebugOnly<nsINode *> parent(nsINode::GetParentNode());
|
||||
MOZ_ASSERT(parent && parent->Tag() == nsGkAtoms::picture);
|
||||
DebugOnly<Element *> parent(nsINode::GetParentElement());
|
||||
MOZ_ASSERT(parent && parent->IsHTML(nsGkAtoms::picture));
|
||||
MOZ_ASSERT(IsPreviousSibling(aSourceNode, this));
|
||||
MOZ_ASSERT(pictureEnabled);
|
||||
|
||||
@ -1126,7 +1127,7 @@ HTMLImageElement::TryCreateResponsiveSelector(nsIContent *aSourceNode,
|
||||
!SupportedPictureSourceType(type)) {
|
||||
return false;
|
||||
}
|
||||
} else if (aSourceNode->Tag() == nsGkAtoms::img) {
|
||||
} else if (aSourceNode->IsHTML(nsGkAtoms::img)) {
|
||||
// Otherwise this is the <img> tag itself
|
||||
MOZ_ASSERT(aSourceNode == this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user