-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Revert "Make sure the CSS class id-dark-theme is added to the editor iframe body. (#60300) #60616
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -38 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
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.
Can confirm that I'm seeing the follow type error on trunk in Safari
null is not an object (evaluating 'contentDocument.body.classList')
With the branch checked out, that error is gone.
Thanks for the quick fix @glendaviesnz
@afercia apologies for the lack of time to consult on this, but there as a tight timeframe to get a fix into 18.1 |
…iframe body. (#60300)" (#60616) This reverts commit a4ae813. Co-authored-by: glendaviesnz <[email protected]> Co-authored-by: ramonjd <[email protected]>
I just cherry-picked this PR to the release/18.1 branch to get it included in the next release: dfec163 |
// `is-dark-theme` class added by useDarkThemeBodyClassName. | ||
const initialIframeBodyClasses = Array.from( | ||
contentDocument.body.classList | ||
); |
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.
Why not just revert this part?
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.
because .concat( initialIframeBodyClasses )
is not relevant without the above, and is-dark-theme
check at this point may also not be relevant, but it can be added back if needed in a follow up PR that gets is-dark-theme
working in the post editor, otherwise it seemed like there was potential for it to be left there as dead code.
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.
If I took your suggestion to "remove all this logic introduced last week" too literally 😄 I can put up a PR to add back in the `|| name === 'is-dark-theme' tomorrow if you think it is worth it.
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.
18.1 has already been released with the revert. 18.2 will be cut in 2 weeks if it can wait. Thanks!
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.
yep, I don't believe it will be an urgent change if we do add it back, 18.2 will be fine I think.
@glendaviesnz no worries and thanks for fixing it. Sorry for the inconvenience, it's interesting that this problem only occurred in Safari. I will reopen the original issue as that class is necessary to work properly but it evidently needs a different solution. Thanks. |
What?
This reverts commit a4ae813.
Why?
This commit broke the setting of editor styles in Safari - see #60550 (comment)
How?
Just reverts the commit for 18.1, and an alternative approach for keeping the
is-dark-theme
can be researched as a follow upTesting Instructions