Closed Bug 426029 Opened 16 years ago Closed 15 years ago

Media preview displays broken images for images with data url

Categories

(Firefox :: Page Info Window, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.6a1

People

(Reporter: stream, Assigned: florian)

References

()

Details

(Keywords: regression, verified1.9.1)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008032904 Minefield/3.0pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008032904 Minefield/3.0pre

There is no way to preview image or background when its displayed with data url.

Reproducible: Always
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
As image in img tags are seen in fx2 which is mentioned in bug 386333
They are not in fx3
Status: RESOLVED → UNCONFIRMED
Depends on: 386333
Keywords: regression
Resolution: DUPLICATE → ---
Version: unspecified → Trunk
Attached patch patch v1Splinter Review
I guess this is a regression from bug 377364.
Assignee: nobody → florian
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #312606 - Flags: review?(mano)
Blocks: 377364
Severity: major → normal
OS: Windows XP → All
Hardware: PC → All
I tested only one build for now
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070101 Minefield/3.0a2pre
object tag containing encoded image is displayed in media preview on the acid2 test.
If we want to fix the case of background images in data urls (bug 386333) at the same time, we can add:

  // if we have a data url, get the MIME type from the url
  if (!mimeType && /^data:/.test(url)) {
    var dataMimeType = /^data:(image\/.*);/.exec(url);
    if (dataMimeType)
      mimeType = dataMimeType[1];
  }

I'm not sure if there is any security implication though. Currently, we do this test (/^data:/.test(url) && /^image\//.test(mimeType)) before allowing the display of an image from a data URL. If we take into account the MIME type included in the URL, the test won't be as reliable as before, because the MIME type included in the URL can be different from the actual type of the image.

I don't remember why we added the /^image\//.test(mimeType) test so I don't know if this is a real issue.
Flags: blocking-firefox3.1?
Flags: wanted-firefox3.1+
Flags: blocking-firefox3.1?
Flags: blocking-firefox3.1-
Comment on attachment 312606 [details] [diff] [review]
patch v1

r=mano
Attachment #312606 - Flags: review?(mano) → review+
landed v1:

http://hg.mozilla.org/mozilla-central/rev/818c6feeb5e9
Status: ASSIGNED → RESOLVED
Closed: 16 years ago15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.6a1
If someone wants to see this in 3.5, you need to request "approval1.9.1" on the patch.
(In reply to comment #9)
> If someone wants to see this in 3.5, you need to request "approval1.9.1" on the
> patch.

And what about v2?
(In reply to comment #10)
> (In reply to comment #9)
> > If someone wants to see this in 3.5, you need to request "approval1.9.1" on the
> > patch.
> 
> And what about v2?

Can be covered in bug 386333. This (the difference between v1 and 2) may help: https://bugzilla.mozilla.org/attachment.cgi?oldid=312606&newid=312608&action=interdiff&format=raw
Florian, will you move the patch to bug 386333 and ask for review there?
No, or at least, not in the near future.  If you understand the patch and are interested, feel free to do it.
Attachment #312608 - Attachment is obsolete: true
(In reply to comment #13)
> No, or at least, not in the near future.  If you understand the patch and are
> interested, feel free to do it.

Thanks Forian. I've attached the updated patch.
Verified fixed with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090407 Minefield/3.6a1pre (.NET CLR 3.5.30729) ID:20090407095250 and build on OS X.
Status: RESOLVED → VERIFIED
Attachment #312606 - Flags: approval1.9.1?
Comment on attachment 312606 [details] [diff] [review]
patch v1

a191=beltzner
Attachment #312606 - Flags: approval1.9.1? → approval1.9.1+
Keywords: checkin-needed
Whiteboard: [needs 1.9.1 landing]
While verifying this patch on 1.9.1 I noticed that Shiretoko displays some more media references as Minefield. Most of them are still broken. Does it mean we fail even with this patch on 1.9.1 or are those bogus entries?
(In reply to comment #18)
> While verifying this patch on 1.9.1 I noticed that Shiretoko displays some more
> media references as Minefield. Most of them are still broken. Does it mean we
> fail even with this patch on 1.9.1 or are those bogus entries?

This should be another issue. No time right now to dig into this issue.

Verified fixed on 1.9.1 with builds on OS X and Windows:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b4pre) Gecko/20090423 Shiretoko/3.5b4pre ID:20090423040926
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: