Bug 1501794 - Implement img decode API. r=bzbarsky,tnikkel

The img decode API allows a web author to request that an image be
decoded at its intrinsic size and be notified when it has been
completed. This is useful to ensure an image is ready to display before
adding it to the DOM tree -- this will help reduce flickering.

Differential Revision: https://phabricator.services.mozilla.com/D11362
This commit is contained in:
Andrew Osmond
2018-11-08 12:45:50 -05:00
parent 6b9dbdb87f
commit 86dbb846e0
29 changed files with 410 additions and 252 deletions

View File

@@ -191,6 +191,10 @@ void HTMLImageElement::GetDecoding(nsAString& aValue) {
GetEnumAttr(nsGkAtoms::decoding, kDecodingTableDefault->tag, aValue);
}
already_AddRefed<Promise> HTMLImageElement::Decode(ErrorResult& aRv) {
return nsImageLoadingContent::QueueDecodeAsync(aRv);
}
bool HTMLImageElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
const nsAString& aValue,
nsIPrincipal* aMaybeScriptedPrincipal,