Bug 1583980 - Restrict mapping of width and height to aspect-ratio for <img> for now. r=bzbarsky

This is an easier thing to implement interoperably than what we implement now,
which is basically "whatever goes through this function".

Differential Revision: https://phabricator.services.mozilla.com/D47145
This commit is contained in:
Emilio Cobos Álvarez
2019-09-25 22:33:47 +00:00
parent 9a3329717f
commit 77ac98fc52
3 changed files with 15 additions and 16 deletions

View File

@@ -234,11 +234,11 @@ bool HTMLImageElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
void HTMLImageElement::MapAttributesIntoRule(
const nsMappedAttributes* aAttributes, MappedDeclarations& aDecls) {
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
MapImageAlignAttributeInto(aAttributes, aDecls);
MapImageBorderAttributeInto(aAttributes, aDecls);
MapImageMarginAttributeInto(aAttributes, aDecls);
MapImageSizeAttributesInto(aAttributes, aDecls, MapAspectRatio::Yes);
MapCommonAttributesInto(aAttributes, aDecls);
}
nsChangeHint HTMLImageElement::GetAttributeChangeHint(const nsAtom* aAttribute,