-
Notifications
You must be signed in to change notification settings - Fork 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
Fix the broken style tag HTML in iframe that renders a pattern #86621
Conversation
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~35 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~63 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
// Use fake assets to eliminate the compatStyles without the id. | ||
// See https://github.com/WordPress/gutenberg/blob/f77958cfc13c02b0c0e6b9b697b43bbcad4ba40b/packages/block-editor/src/components/iframe/index.js#L127 | ||
const settings = { | ||
__unstableResolvedAssets: { | ||
styles: '<style id="" />', | ||
}, | ||
}; | ||
|
||
const settings = {}; |
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.
The Iframe
component has been updated, so adding an empty style here is no longer necessary.
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.
Relevant PR: WordPress/gutenberg#51136.
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.
LGTM 👍
// Use fake assets to eliminate the compatStyles without the id. | ||
// See https://github.com/WordPress/gutenberg/blob/f77958cfc13c02b0c0e6b9b697b43bbcad4ba40b/packages/block-editor/src/components/iframe/index.js#L127 | ||
const settings = { | ||
__unstableResolvedAssets: { | ||
styles: '<style id="" />', | ||
}, | ||
}; | ||
|
||
const settings = {}; |
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.
Relevant PR: WordPress/gutenberg#51136.
Related to #85489
Proposed Changes
This PR fixes the broken style tag HTML in iframe that renders a pattern.
Details
The font styles are safely injected.
old version (
__unstableResolvedAssets.styles[n].id
was needed, as it's being used)https://github.com/WordPress/gutenberg/blob/f77958cfc13c02b0c0e6b9b697b43bbcad4ba40b/packages/block-editor/src/components/iframe/index.js#L118
new version
https://github.com/WordPress/gutenberg/blob/33b6e64/packages/block-editor/src/components/iframe/index.js#L117
Testing Instructions
Pre-merge Checklist