Discovered with IE11 using Virtualbox. It occurs in both the field widget and /admin/content/media

Note that whatever fix we come up with here must be tested in multiple themes. That means it needs to look decent in Seven, Bartik, and Umami (ideally screenshots will be added here as well).

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Most likely due to the use of object-postion/object-fit for the image, which is not supported by IE11 https://caniuse.com/#feat=object-fit

bnjmnm’s picture

Status: Active » Needs review
StatusFileSize
new2.55 KB
new895.55 KB
new1.03 MB

I feel like there must be a more elegant way to address this, but this patch solves the problem by adding a style attribute to the thumbnail container with a background image that is only visible in IE11. Also in IE11, the distorted image is given 0 opacity.
With Patch

Without Patch

wim leers’s picture

Issue tags: +CSS, +browser compatibility

🍿This is amazingly obscure. I love the throwback to a decade ago here! 🤩🤓🤦‍♂️

wim leers’s picture

  1. +++ b/core/modules/media_library/media_library.module
    @@ -65,6 +66,24 @@ function media_library_theme() {
    +  // background image that seen only in IE11.
    

    🤓 Übernit: that seen only in IE11. → that is seen only in IE11.

  2. WHY_SO_BLORY.png

    😂👏👏

    Thanks for this thoroughly entertaining issue, @bnjmnm 🙏

bnjmnm’s picture

StatusFileSize
new778 bytes
new2.56 KB

#5.1 nit addressed

webchick’s picture

I was asked to chime in here about MoSCoW.

From what I can see through perusing a few links, IE 11 is an older version sitting at ~3% of usage overall.

And the nature of this bug is that it doesn't prevent you from using the media library, though it does look like shit.

So I'd rate this a "should have," personally. It would be really nice to fix it if we can, since if you're stuck on that browser version because of your organization/company/whatever you would have a far more pleasant experience. But not worth holding up the entire feature as a whole, IMO.

phenaproxima’s picture

I would make one request: can we perhaps have a comment or todo or something to delete this extra code when IE11 support is dropped? Otherwise we'll forget for sure.

phenaproxima’s picture

So I'd rate this a "should have," personally. It would be really nice to fix it if we can, since if you're stuck on that browser version because of your organization/company/whatever you would have a far more pleasant experience. But not worth holding up the entire feature as a whole, IMO.

Yup, we'll definitely fix this. The question is mostly whether or not we need to fix this in Media Library's bundled CSS before it is moved into Seven (which will happen when we mark the module stable), or if we consider this a bug that can be fixed in Seven after the module is stable (i.e., potentially during the 8.8.x alpha or, at latest, beta phase).

Since it's a should-have and clearly a bug, it seems reasonable that we can land this after the module is stable. So...+1, I guess!

wim leers’s picture

Priority: Major » Minor

Given #7 + #9, demoting priority.

xjm’s picture

Priority: Minor » Normal

This is definitely still a bug that needs to be fixed -- we only use minor for typos in docblocks and whatnot.

I agree that it can be a should-have since IE does still work and there's no serious a11y regression or anything.

Module CSS (and internal theme CSS) can be changed in any minor and up to RC to fix bugs. However, is this a rule that would need to be copied into classy as part of the final steps of #2834729: [META] Roadmap to stabilize Media Library? If it would, then the restrictions about changing it after we mark Media stable go up a lot, so we'd potentially be stuck with the broken CSS in Classy until Classy exits core stage left. And that we'd probably want to have done before beta. Still a should-have, I guess, just sucky to be stuck with it. :P

xjm’s picture

@bnjmnm confirmed that this CSS only needs to go in Seven, not Classy, so we are good to fix it in any minor up to RC. Thanks!

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

dww’s picture

Issue tags: +Needs manual testing
StatusFileSize
new3.02 KB
new2.98 KB

Agreed re: #8. Created follow-up issue for that: #3089196: Remove IE11 work-arounds from Media when core drops IE11 support.
Re-rolled to apply cleanly to the 8.9.x and 8.8.x branches.
Added @todo / @see comments pointing to #3089196.

Not sure what else we're waiting for in here.

I don't have IE11 nor Virtualbox, so I'm not in a position to test this directly. Maybe one more round of manual testing to officially confirm we're cool? We obviously can't write automated tests for this.

RTBC?

Cheers,
-Derek

p.s. Interdiff was confused on this, so I'm attaching a raw diff of the two patch files.

nightlife2008’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new834.37 KB
new486.34 KB

Just applied the patch without problems on a 8.7.7 build.

Built and deployed it to two of our QA environments and the results are perfect!

before:

Without patch

after:

Without patch

Thanks a lot everyone!

dww’s picture

Issue tags: -Needs manual testing

Great, thanks! Manual testing complete. Removing tag.

  • webchick committed a053908 on 9.0.x
    Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed thumbnails...

  • webchick committed c929ae0 on 8.9.x
    Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed thumbnails...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome work, all!

Committed and pushed to 9.0.x, 8.9.x, and 8.8.x. Thanks!

  • webchick committed 9d1dc20 on 8.8.x
    Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed thumbnails...
alphawebgroup’s picture

Status: Fixed » Needs work

I'm sorry... but it fails when we use SVG images...
the element for SVG image has $element[0]['#image_style'] as NULL
so it fails with error message:
Error: Call to a member function buildUrl() on null in media_library_preprocess_field() (line 112 of core/modules/media_library/media_library.module).

what we really need is additional handling for the case when we don't have an #image_style.
the code in the nested conditions should look like

        $uri = File::load($fid)->getFileUri();
        if ($element[0]['#image_style']) {
          $image_url = ImageStyle::load($element[0]['#image_style'])->buildUrl($uri);
        }
        else {
          $image_url = file_create_url($uri);
        }
        $variables['attributes']['style'] = "background-image: url($image_url); background-repeat: no-repeat; background-position: center;";

or.. do we need to open a separate issue on that?

wim leers’s picture

or.. do we need to open a separate issue on that?

It'd be lovely if you could do that :)

99% of Drupal sites don't allow SVGs to be uploaded because of the inherent security concerns. So this issue mitigated it for 99% of Drupal sites. (Not to mention only a tiny percentage of people use IE11.)

  • webchick committed 414fb97 on 9.0.x
    Revert "Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed...

  • webchick committed 234bcf6 on 8.9.x
    Revert "Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed...

  • webchick committed 25ac1cc on 8.8.x
    Revert "Issue #3085908 by bnjmnm, dww, nightlife2008: Blurry/skewed...
webchick’s picture

Sorry, all, I had to roll this one back. The fix here was causing double thumbnails to appear in non-Seven themes, e.g.

Double thumbnails in media grid

phenaproxima’s picture

Title: Blurry/skewed thumbnails in IE11 » Media library thumbnails are blurry/skewed in IE11
phenaproxima’s picture

Title: Media library thumbnails are blurry/skewed in IE11 » [PP-1] Media library thumbnails are blurry/skewed in IE11
Issue summary: View changes
Status: Needs work » Postponed
Issue tags: +Amsterdam2019

Tagging this bug fix to be worked on at DrupalCon Amsterdam 2019, and adding some testing instructions.

Also postponing on #3082690: Mark Media Library as a stable core module, since changes made in that issue will make it possible to know if the proposed fix in this issue is adequate (we only discovered the flaw in #14 after applying that patch, which is why this took so long to get reverted).

phenaproxima’s picture

Title: [PP-1] Media library thumbnails are blurry/skewed in IE11 » Media library thumbnails are blurry/skewed in IE11
Status: Postponed » Needs work

Media Library is stable, and this is therefore unblocked.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)

With the EOL of IE11 wonder if this is still relevant?

bnjmnm’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Technically this is relevant until 9.5, the final IE11 supporting version, is EOL. So for those ~11 months a fix for this could be added to a patch release.

However, there doesn't seem to be much interest given that it has been over 3 years since anything has happened here. There would also be very little benefit since IE market share is plummeting, and IE11 itself became EOL earlier this year. Additionally, he thumbnails still work, they're just a little ugly in a browser where ugliness is not uncommon.

Given that finding a solution for this would take time, and it's for a not-needed feature for a dead browser and a Drupal version EOL-ing in less than a year, it's unlikely this issue would yield anything beyond potentially hosting a few test-failing rerolls.

And that was a long way of saying I'm ignoring the letter of the law and closing this issue I created because working on it further would be time poorly spent.