Closed Bug 1804583 Opened 1 year ago Closed 1 year ago

Image orientation is not respected when img source tag uses data url

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

Firefox 107
defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox107 --- wontfix
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- fixed

People

(Reporter: hshahid, Assigned: dlrobertson)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image hummingbird.jpg

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

  1. attach an image with an orientation exif data.
  2. read the image and generate a Data URL
  3. set the image-orientation to none.

Codesandbox to show bug: https://codesandbox.io/s/cool-bohr-cfsnfl?file=/src/App.js

Actual results:

The image orientation is still using the exif data and is not displayed as none.

Expected results:

The image orientation is still using the exif data and is not displayed as none.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core
Component: Graphics: WebRender → Graphics: ImageLib
Severity: -- → S3
Component: Graphics: ImageLib → Layout: Images, Video, and HTML Frames

I think this is because we consider the data uri to be cross origin and hence the image-orientation: none is ignored. Not sure if that is correct or not, maybe Emilio knows off the top of his head?

Flags: needinfo?(emilio)

Yes, so data: is per spec an opaque origin, so we're applying bug 1655598. Presumably Safari behaves like Blink here?

Code is here. Maybe we should special-case data: URIs, since they're quite similar to blobs. The spec doesn't mention origins at all, seems we still need edits. We should definitely file a spec issue to get this properly defined..

Flags: needinfo?(emilio) → needinfo?(drobertson)
Regressed by: 1655598

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Yes, so data: is per spec an opaque origin, so we're applying bug 1655598. Presumably Safari behaves like Blink here?

Code is here. Maybe we should special-case data: URIs, since they're quite similar to blobs. The spec doesn't mention origins at all, seems we still need edits. We should definitely file a spec issue to get this properly defined..

Thanks for the ping! Good catch! I tested blob:, but not data:... I'll update this and add a test. It is a bit interesting that a data url gets a triggering principal, but a blob doesn't.

  • Images with a data url source should be treated as same-origin requests,
    meaning that the image-orientation should be respected.
  • Add web platform test for a image with a data url source and
    image-orientation: none.
  • Fix the blob url test for image-orientation: none.
Assignee: nobody → drobertson
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Set release status flags based on info from the regressing bug 1655598

Flags: needinfo?(drobertson)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

The spec doesn't mention origins at all, seems we still need edits. We should definitely file a spec issue to get this properly defined.

Wouldn't this just be w3c/csswg-drafts#5165? Or am I missing what you're getting at here?

Set release status flags based on info from the regressing bug 1655598

Pushed by drobertson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f35974ef034b
image orientation should be used for data url requests. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37813 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: