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

test: test slots not at top level #4689

Merged
merged 8 commits into from
Oct 24, 2024
Merged

test: test slots not at top level #4689

merged 8 commits into from
Oct 24, 2024

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Oct 24, 2024

Details

When working on the SSR compiler, the question came up of how slot attributes work when not at the top level, e.g.:

<x-foo>
  <div>
    <span slot="does-this-work"></span>
  </div>
</x-foo>

The answer seems to be that our behavior for light DOM slots is correct insofar as it matches native shadow DOM behavior (which is that only slot attributes at the true top level – just elements, not including our framework directives like <template lwc:if>). Synthetic shadow also seems to behave correctly.

This PR is just asserting the existing behavior.

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

@nolanlawson nolanlawson requested a review from a team as a code owner October 24, 2024 00:23
Copy link
Contributor

@wjhsf wjhsf left a comment

Choose a reason for hiding this comment

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

This PR is just asserting the existing behavior.

Files changed 97

🙉

@@ -21,7 +21,7 @@ exports.STANDARD_SAUCE_BROWSERS = [
label: 'sl_safari_latest',
browserName: 'safari',
browserVersion: 'latest',
platformName: 'macOS 12', // Note: this must be updated when macOS releases new updates
platformName: 'macOS 13', // Note: this must be updated when macOS releases new updates
Copy link
Collaborator Author

@nolanlawson nolanlawson Oct 24, 2024

Choose a reason for hiding this comment

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

Safari 16 doesn't implement Document.parseHTMLUnsafe

@nolanlawson nolanlawson merged commit 41d223c into master Oct 24, 2024
11 checks passed
@nolanlawson nolanlawson deleted the nolan/slot-not-top branch October 24, 2024 21:54
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.

3 participants