Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with gallery in IE11. #7465

Merged
merged 1 commit into from
Jun 22, 2018
Merged

Fix issues with gallery in IE11. #7465

merged 1 commit into from
Jun 22, 2018

Conversation

jasmussen
Copy link
Contributor

IE 11 is a horrendous browser, and its support for flexbox is equally horrendous.

Galleries, as a result, had crazy stretched images. This PR fixes that.

Screenshot after this PR is applied:

screen shot 2018-06-22 at 11 41 07

IE 11 is a horrendous browser, and its support for flexbox is equally horrendous.

Galleries, as a result, had crazy stretched images. This PR fixes that.
@jasmussen jasmussen added this to the 3.2 milestone Jun 22, 2018
@jasmussen jasmussen self-assigned this Jun 22, 2018
@jasmussen jasmussen requested a review from a team June 22, 2018 09:42
@jasmussen jasmussen merged commit 58c96ee into master Jun 22, 2018
@jasmussen jasmussen deleted the fix/ie11-galleries branch June 22, 2018 10:32
oxyc added a commit to generoi/gutenberg that referenced this pull request Jun 26, 2018
* 'master' of https://github.com/WordPress/gutenberg: (69 commits)
  fix: Show permalink editor in editor (WordPress#7494)
  Fix text wrapping in Firefox. (WordPress#7472)
  Try another approach to fixing the sibling inserter in Firefox (WordPress#7530)
  fix: Improve "add block" text in NUX onboarding (WordPress#7511)
  Implement core style of including revisions data on Post response (WordPress#7495)
  Testing: Add e2e test for PluginPostStatusInfo (WordPress#7284)
  Add end 2 end test for sidebar behaviours on mobile and desktop. (WordPress#6877)
  Only save metaboxes when it's not an autosave (WordPress#7502)
  Fix broken links in documentation (WordPress#7532)
  Remove post type 'viewable' compatibility shim (WordPress#7496)
  Fix typo. (WordPress#7528)
  Blocks: Remove wrapping div from paragraph block (WordPress#7477)
  fix: change import for InnerBlocks (WordPress#7484)
  Polish library just a teeeeensy bit (WordPress#7522)
  feat: Add snapshot update script (WordPress#7514)
  Display server error message when one exists (WordPress#7434)
  Fix issues with gallery in IE11. (WordPress#7465)
  Polish region focus style (WordPress#7459)
  Fix IE11 formatting toolbar visibility (WordPress#7413)
  Update plugin version to 3.1. (WordPress#7402)
  ...
@tullsta
Copy link

tullsta commented Aug 25, 2018

Is anyone facing this problem after fix? I can still see stretched images, not all of them, just randomly in Internet Explorer 11. In other browsers it looks OK. I use fresh Gutenberg build form official wordpress plugins repo.

@jasmussen
Copy link
Contributor Author

Hi @tullsta, I just took galleries for a spin again in IE11. I can't reproduce any issues with image scaling.

If you can provide steps to reproduce, perhaps send me the images you added to the gallery to produce the error, then I can take another look.

I'm assuming this is an issue in the editor, not the front-end, correct?

@tullsta
Copy link

tullsta commented Aug 29, 2018

Hello @jasmussen thank you for quick reply. It looks the same both in front-end, and in editor.
Here steps to reproduce:

Wordpress v.4.9.8
Theme Zerif Lite v.1.8.5.44
Gutenberg v.3.6.2
Create gallery images at new page. Page set to use full width template.

Things to adjust:

  • added to theme functions
    add_theme_support( 'align-wide' );
  • Gallery set to full width
  • I took random images form unsplash.com - there is only one condition - they must be differently oriented (horizontal and vertical).

Final result looks like in attached picture.

Maybe it's problem in Zerif theme, I asked them, but with no reply so far.

gutenberg

@jasmussen
Copy link
Contributor Author

Thank you for the detailed steps. I will take a look.

jasmussen pushed a commit that referenced this pull request Sep 5, 2018
This PR is a followup to feedback in #7465 (comment).

Notably there is an issue with image cropping in IE11 galleries. Simply, it doesn't really work because IE11 doesn't support object-fit. This means in some situations — for example a 2 column gallery with landscape, portrait, portrait images — the landscape image is skewed.

This PR takes a somewhat radical consequence and simply disables cropping altoghether on IE11. But it works fine in Edge.

This PR does a few other improvements too — it changes the IE11 hack to be a more solid one, using @supports(position:sticky) to augment the CSS for capable browsers, rather than relying on a contrast hack that fails if a user actually uses high contrast mode. In addition, it moves this hack from the editor style to the stylesheet file, so benefits affect both editor and theme.
@jasmussen
Copy link
Contributor Author

Thanks for your steps. I made a PR in #9622. Good news and bad news — it now no longer skews images, but it also means cropping is disabled in IE11.

jasmussen added a commit that referenced this pull request Sep 10, 2018
This PR is a followup to feedback in #7465 (comment).

Notably there is an issue with image cropping in IE11 galleries. Simply, it doesn't really work because IE11 doesn't support object-fit. This means in some situations — for example a 2 column gallery with landscape, portrait, portrait images — the landscape image is skewed.

This PR takes a somewhat radical consequence and simply disables cropping altoghether on IE11. But it works fine in Edge.

This PR does a few other improvements too — it changes the IE11 hack to be a more solid one, using @supports(position:sticky) to augment the CSS for capable browsers, rather than relying on a contrast hack that fails if a user actually uses high contrast mode. In addition, it moves this hack from the editor style to the stylesheet file, so benefits affect both editor and theme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants