Fix issue with galleries in Microsoft Edge.#13326
Merged
jorgefilipecosta merged 1 commit intomasterfrom Jan 25, 2019
Merged
Conversation
Fixes #13270. Props @designsimply for proposed fix, extensive debugging, and finding the right solution. Turns out, as Sheri correctly identified, there is a bug with Microsoft Edge where the browser is basically rewriting whatever is inside the `calc` rule. As she noted: > Edge calculates an ever-so-slightly different width as calc(-10.6667px + 33.3333%) served via style.min.css and when Gutenberg is deactivated then Edge calculates the width as calc(-10.66px + 33.33%) served via style.css. I noticed that changing margin-right to be even one pixel smaller, from 16px to 15px The difference between `-10.6667px + 33.3333%` and `-10.66px + 33.33%` is enough to cause three columns to become two. This PR adopts Sheri's proposed fix, and wraps it in an Edge-Only rule. Don't worry, normal browsers ignore that rule, and also do not rewrite `calc` rules. Here's what Chrome shows in the inspector: `width: calc((100% - 16px * 2) / 3);` (as it should).
Contributor
Author
|
Thank you @designsimply for your thorough testing and debugging. It was instrumental in fixing this, and ultimately this is your pull request. |
jorgefilipecosta
approved these changes
Jan 25, 2019
Member
jorgefilipecosta
left a comment
There was a problem hiding this comment.
Fixes the problem in my tests 👍
This was referenced Feb 4, 2019
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
Fixes #13270. Props @designsimply for proposed fix, extensive debugging, and finding the right solution. Turns out, as Sheri correctly identified, there is a bug with Microsoft Edge where the browser is basically rewriting whatever is inside the `calc` rule. As she noted: > Edge calculates an ever-so-slightly different width as calc(-10.6667px + 33.3333%) served via style.min.css and when Gutenberg is deactivated then Edge calculates the width as calc(-10.66px + 33.33%) served via style.css. I noticed that changing margin-right to be even one pixel smaller, from 16px to 15px The difference between `-10.6667px + 33.3333%` and `-10.66px + 33.33%` is enough to cause three columns to become two. This PR adopts Sheri's proposed fix, and wraps it in an Edge-Only rule. Don't worry, normal browsers ignore that rule, and also do not rewrite `calc` rules. Here's what Chrome shows in the inspector: `width: calc((100% - 16px * 2) / 3);` (as it should). Before: <img width="765" alt="before" src="https://user-images.githubusercontent.com/1204802/51174867-20cf8c80-18b9-11e9-9fd9-537c78809c5d.png"> After: <img width="809" alt="after" src="https://user-images.githubusercontent.com/1204802/51174833-0b5a6280-18b9-11e9-8b3d-3a8a766db713.png">
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
Fixes #13270. Props @designsimply for proposed fix, extensive debugging, and finding the right solution. Turns out, as Sheri correctly identified, there is a bug with Microsoft Edge where the browser is basically rewriting whatever is inside the `calc` rule. As she noted: > Edge calculates an ever-so-slightly different width as calc(-10.6667px + 33.3333%) served via style.min.css and when Gutenberg is deactivated then Edge calculates the width as calc(-10.66px + 33.33%) served via style.css. I noticed that changing margin-right to be even one pixel smaller, from 16px to 15px The difference between `-10.6667px + 33.3333%` and `-10.66px + 33.33%` is enough to cause three columns to become two. This PR adopts Sheri's proposed fix, and wraps it in an Edge-Only rule. Don't worry, normal browsers ignore that rule, and also do not rewrite `calc` rules. Here's what Chrome shows in the inspector: `width: calc((100% - 16px * 2) / 3);` (as it should). Before: <img width="765" alt="before" src="https://user-images.githubusercontent.com/1204802/51174867-20cf8c80-18b9-11e9-9fd9-537c78809c5d.png"> After: <img width="809" alt="after" src="https://user-images.githubusercontent.com/1204802/51174833-0b5a6280-18b9-11e9-8b3d-3a8a766db713.png">
This was referenced Mar 5, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13270. Props @designsimply for proposed fix, extensive debugging, and finding the right solution.
Turns out, as Sheri correctly identified, there is a bug with Microsoft Edge where the browser is basically rewriting whatever is inside the
calcrule. As she noted:The difference between
-10.6667px + 33.3333%and-10.66px + 33.33%is enough to cause three columns to become two.This PR adopts Sheri's proposed fix, and wraps it in an Edge-Only rule.
Don't worry, normal browsers ignore that rule, and also do not rewrite
calcrules. Here's what Chrome shows in the inspector:width: calc((100% - 16px * 2) / 3);(as it should).Before:
After: