-
Notifications
You must be signed in to change notification settings - Fork 166
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
[ShadyDOM] A slot shouldn't report its default content as assignedNodes #70
Comments
This just looks like a shortcut/oversight that we should be able to easily resolve. |
I'm still seeing this in v1.0.20, so I'm assuming this hasn't been fixed yet. |
In that case, the default content should not be returned in the assignedNodes for the slot, if the {flatten: true} parameter was not specified. tested on 1.0.22/webcomponents-sd-ce.js tests: |
I tried to tackle this issue, however other tests started failing and I have no clue why. The tests that fail concern the dynamic removal/addition of slots. They rely on Therefore my suspicion is that these tests unintentionally rely on the broken behavior. However, I am not certain about this and am unable to make the proper modifications. @sorvell could you please let me know what the following tests are meant to test and why they rely on
|
On this branch you can run the test for this issue: https://github.com/webcomponents/shadydom/tree/assignednodes-fallback |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
See http://jsbin.com/cusozof/edit?html,console.
A slot can have direct children that the slot can render as default content if no nodes are assigned to the slot:
Here, the
div
is default content. If a component uses the above template as a shadow tree, and if an instance of that component has no children, this default content should render.In that case, the default content should not be returned in the
assignedNodes
for the slot. This is per the spec, at least as I read https://dom.spec.whatwg.org/#assigning-slotables-and-slots, which makes no mention of light DOM children. This is how native Shadow DOM behaves in both Chrome and Safari. The polyfill appears to incorrectly report default content as assigned nodes.This issue is breaking one of the Elix components.
The text was updated successfully, but these errors were encountered: