[webkit-reviews] review granted: [Bug 176016] Implement HTMLImageElement.decode() method : [Attachment 319232] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 8 16:27:36 PDT 2017


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Said Abou-Hallawa
<sabouhallawa at apple.com>'s request for review:
Bug 176016: Implement HTMLImageElement.decode() method
https://bugs.webkit.org/show_bug.cgi?id=176016

Attachment 319232: Patch

https://bugs.webkit.org/attachment.cgi?id=319232&action=review




--- Comment #9 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 319232
  --> https://bugs.webkit.org/attachment.cgi?id=319232
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=319232&action=review

> Source/WebCore/ChangeLog:14
> +	   -- If the image frame is already decoded, the promise will be
resolved
> +	   before return.

Is this correct, or should we resolve the promise on the next event loop?

> Source/WebCore/platform/graphics/BitmapImage.cpp:510
> +    if (m_decodeCallback)
> +	   return;
> +
> +    m_decodeCallback = WTFMove(callback);

I'm not sure why you early return if there's already a callback?

> Source/WebCore/platform/graphics/BitmapImage.cpp:522
> +	   }

Maybe return here, or do if (canAnimate()) { ... return; }

> Source/WebCore/platform/graphics/BitmapImage.cpp:571
> +    // Call the m_decodeCallback only if the image frame was decoded with
the native size.

If not, will we do another decode to satisfy the promise?


More information about the webkit-reviews mailing list