All users were logged out of Bugzilla on October 13th, 2018

image.complete is inconsistent after setting base64 string

RESOLVED INVALID

Status

()

RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: capajj, Unassigned)

Tracking

41 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20151016093648

Steps to reproduce:

Pasted into console:

var img = new Image();img.src = 'data:image/gif;base64,R0lGODlhDwAPAKECAAAAzMzM/////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQSAOw==';console.log(img.complete)


Actual results:

first time this runs for that base64 string it logs false, any time after that it returns true


Expected results:

I would expect it to return true every time for base64 images with src set

Updated

3 years ago
Component: Untriaged → DOM
Product: Firefox → Core
The image will be complete when either the sync image cache is hit (which is what you see on the second and later times you do this) or when the async data: fetc completes (which is what you see the first time).  Since the fetc is async, img.complete does not become true immediately.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.