-
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
Block Library: Flatten width calculation of gallery columns #20690
Merged
Conversation
This file contains 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
aduth
added
[Type] Bug
An existing feature does not function as intended
Browser Issues
Issues or PRs that are related to browser specific problems
[Block] Gallery
Affects the Gallery Block - used to display groups of images
labels
Mar 6, 2020
Size Change: -101 B (0%) Total Size: 864 kB
ℹ️ View Unchanged
|
jasmussen
approved these changes
Mar 9, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Gallery
Affects the Gallery Block - used to display groups of images
Browser Issues
Issues or PRs that are related to browser specific problems
[Type] Bug
An existing feature does not function as intended
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 #20652
This pull request seeks to update the width calculation applied to the gallery block columns. These changes are intended both as a simplification/unification of the width calculation, and as a resolution to a crash which occurs in Microsoft Edge.
As observed at #20652 (comment), the crash appears to occur as a result of the Edge-specific
@supports (-ms-ime-align:auto) {
block implemented in the gallery block styles.As noted in #13326, the original issue #13270 is a result of how Edge interprets the
width
style. Compare how the stylewidth: calc((100% - 16px * 2) / 3);
is interpreted between Edge and Chrome:The proposed changes should apply effectively the same width, but simplify the calculation at compile time, resulting in the style
calc(33.33333% - 10.66667px)
. It appears that this is handled better in Edge, avoiding the early wrapping, rounding down to10.66px
per column.Aside: There is overflow which occurs in Edge for the gallery block, with or without these changes. This should probably be investigated separately.
Testing Instructions:
Repeat steps to reproduce from #20652, verifying that no crash occurs.
Repeat steps to reproduce from #13270 / testing instructions from #13326, verifying that gallery columns wrap as expected both in Edge and in your preferred browser.
Follow-up tasks:
There is another style which uses the problematic
@supports(-ms-ime-align:auto)
block:gutenberg/packages/components/src/modal/style.scss
Lines 80 to 86 in 3ab3727
However, there is no immediate crash which occurs as a result of this style. The problem may only manifest as a combination of
@supports
within a@media
media query. In any case, over time we should consider removing these Edge-specific styles, which are no longer valid in recent Chromium-based versions of Edge.