Skip to content
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: custom style rules don't get inserted into some iframe elements #823

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

YunFeng0817
Copy link
Member

bug

If an iframe element is added to the dom first and its document nodes are added later, the custom style rules won't get inserted.

reason

The custom style rules were designed to add through code . But when we apply the iframe's document content mutation later, the inserted style element would be wiped here.

idea of the fix

We can insert our custom rules whenever a new HTML element is appended to an iframe's content document. Because attachDocumentToIframe's afterAppend callback seems to be the common execution path of all situations.

Copy link
Member

@Yuyz0112 Yuyz0112 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yuyz0112 Yuyz0112 merged commit 5ec7d9e into master Feb 3, 2022
@YunFeng0817 YunFeng0817 deleted the iframe-fix branch February 4, 2022 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants