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] fix 'src' attribute judge logic (#6575) #6580

Merged
merged 1 commit into from
Aug 27, 2021
Merged

[fix] fix 'src' attribute judge logic (#6575) #6580

merged 1 commit into from
Aug 27, 2021

Conversation

baseballyama
Copy link
Member

@baseballyama baseballyama commented Jul 27, 2021

This PR is under confirmation at #6575.


fix #6575

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@benmccann

This comment has been minimized.

@Conduitry

This comment has been minimized.

@baseballyama
Copy link
Member Author

Could somebody please review this PR?
Updating of Svelte Native is blocked by Issue #6575.
Therefore I think we should solve this issue.

@@ -148,7 +148,7 @@ export function get_root_for_style(node: Node): ShadowRoot | Document {
if (!node) return document;

const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
if ((root as ShadowRoot).host) {
if (root && (root as ShadowRoot).host) {
Copy link
Member

@Conduitry Conduitry Aug 20, 2021

Choose a reason for hiding this comment

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

What is this change intended to address? This seems unrelated to the src attribute handling mentioned in #6575.

Copy link
Member Author

@baseballyama baseballyama Aug 25, 2021

Choose a reason for hiding this comment

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

The return of node.ownerDocument is possibly null.
And in the case of Svelte Native returns null at least in this issue #6575.
Therefore it needs to check nullability.

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.

[svelte-native] broken custom components with 'src' attribute
3 participants