Bug 1634180 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Daniel Holbert [:dholbert] from comment #2)
> We should probably do some webcompat outreach to Slack folks and see if they can address this on their end by **removing the (dynamically added) explicit CSS transform & instead explicitly styling the user-uploaded images with `image-orientation:from-image`** (to make this work the same way regardless of the default value).

Sorry, actually this ^^ suggested solution won't work for them if they want to support existing Chromium/Blink versions, because Chromium/Blink apparently didn't support `image-orientation`  **at all** until now - they implemented it with this new default behavior, and didn't previously support it at all (if I'm reading https://bugs.chromium.org/p/chromium/issues/detail?id=158753#c101 and https://caniuse.com/#search=image-orientation correctly).

So really, the simplest band-aid for now would be for slack to:
(1) add something like `.p-pending_image_file__img { image-orientation: none; }` to restore the old default orientation behavior for the file-upload preview img element (this matches the orientation that currently-shipping Chrome uses)

(2) adjust their transform `scale(...)` calculation to account for this change somehow.  If I just use `.p-pending_image_file__img { image-orientation: none; }`, their dynamically-computed `transform:...scale(...)` value (shown alongside the rotation in the devtools screenshot above) ends up being wrong, because the code that computes it seems to disregard the `image-orientation:none` setting. (Perhaps that calculation is done via a measurement in a different element which also needs `{image-orientation: none; }`?)
(In reply to Daniel Holbert [:dholbert] from comment #2)
> We should probably do some webcompat outreach to Slack folks and see if they can address this on their end by **removing the (dynamically added) explicit CSS transform & instead explicitly styling the user-uploaded images with `image-orientation:from-image`** (to make this work the same way regardless of the default value).

Sorry, actually this ^^ suggested solution won't work for them if they want to support existing Chromium/Blink versions, because Chromium/Blink apparently didn't support `image-orientation`  **at all** until now - they implemented it with this new default behavior, and didn't previously support it at all (if I'm reading https://bugs.chromium.org/p/chromium/issues/detail?id=158753#c101 and https://caniuse.com/#search=image-orientation correctly).  So `image-orientation:from-image` won't have any effect in currently-shipping Chrome, so we can't rely on that to do the right thing.

So: I think the simplest band-aid for now would be for Slack to:
(1) add something like `.p-pending_image_file__img { image-orientation: none; }` to restore the old default orientation behavior for the file-upload preview img element (this matches the orientation that currently-shipping Chrome uses)

(2) adjust their transform `scale(...)` calculation to account for this change somehow.  If I just use `.p-pending_image_file__img { image-orientation: none; }`, their dynamically-computed `transform:...scale(...)` value (shown alongside the rotation in the devtools screenshot above) ends up being wrong, because the code that computes it seems to disregard the `image-orientation:none` setting. (Perhaps that calculation is done via a measurement in a different element which also needs `{image-orientation: none; }`?)
(In reply to Daniel Holbert [:dholbert] from comment #2)
> We should probably do some webcompat outreach to Slack folks and see if they can address this on their end by **removing the (dynamically added) explicit CSS transform & instead explicitly styling the user-uploaded images with `image-orientation:from-image`** (to make this work the same way regardless of the default value).

Sorry, actually this ^^ suggested solution won't work for them if they want to support existing Chromium/Blink versions, because Chromium/Blink apparently didn't support `image-orientation`  **at all** until now - they implemented it with this new default behavior, and didn't previously support it at all (if I'm reading https://bugs.chromium.org/p/chromium/issues/detail?id=158753#c101 and https://caniuse.com/#search=image-orientation correctly).  So `image-orientation:from-image` won't have any effect in recently-shipping Chrome versions (< 81), so we can't rely on that to do the right thing.

So: I think the simplest band-aid for now would be for Slack to:
(1) add something like `.p-pending_image_file__img { image-orientation: none; }` to restore the old default orientation behavior for the file-upload preview img element (this matches the orientation that recently-shipping Chrome uses)

(2) adjust their transform `scale(...)` calculation to account for this change somehow.  If I just use `.p-pending_image_file__img { image-orientation: none; }`, their dynamically-computed `transform:...scale(...)` value (shown alongside the rotation in the devtools screenshot above) ends up being wrong, because the code that computes it seems to disregard the `image-orientation:none` setting. (Perhaps that calculation is done via a measurement in a different element which also needs `{image-orientation: none; }`?)

Back to Bug 1634180 Comment 4