-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gallery Block: Gallery not being properly displayed/rendered in Edge #13270
Comments
Nice find! I tested and confirmed with WordPress 5.0.3 and no active plugins using Twenty Nineteen 1.2 that a 3 column gallery doesn't line up correctly in Edge 18 on Windows 10. Interestingly, I found that it works properly if the Gutenberg 4.8.0 plugin is activated: @jasmussen the main difference I spotted between the two screenshots above is that when the plugin is NOT installed Edge calculates an ever-so-slightly different width as Related PR: #10027 btw, this all seems incredibly sub-pixel rendering edge-case-y to me! I did find that different browsers round fractional pixels differently (https://cruft.io/posts/percentage-calculations-in-ie/) but the part about Edge rounding differently for minified CSS (more decimal places) vs unminified CSS is interesting and I am curious whether the difference in rounding happens because of the minification or if it's something coming from the plugin vs core. It's got to be because of the minifcation, right? |
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).
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">
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">
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 also happens in Firefox when fractional scaling is used ( |
Bug Description
When opening a page with a galler of three columns in Edge it won't be properly displayed as in other browsers.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To get the gallery displayed as in other browsers
Screenshots
https://bright-natterjack.jurassic.ninja/gallery-test/
Gallery in Edge:
Gallery in Chrome:
Desktop:
Additional context
The text was updated successfully, but these errors were encountered: