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

Is <slot> a replaced element or not? #564

Closed
haoqunjiang opened this issue Sep 12, 2016 · 6 comments
Closed

Is <slot> a replaced element or not? #564

haoqunjiang opened this issue Sep 12, 2016 · 6 comments

Comments

@haoqunjiang
Copy link

Per the WHATWG HTML Spec, the <slot> element is listed in the section "Non-replaced elements". However, given its presentation hint (display: contents), it seems that <slot> might better be treated as a replaced element. Also Chrome 53+ seems have implemented it as such (::before and ::after selectors no longer work on <slot>)

@annevk
Copy link
Collaborator

annevk commented Sep 12, 2016

There's disagreement between WebKit and Blink as to what is correct here. @rniwa et al feel quite strongly ::before and such should work.

@rniwa
Copy link
Collaborator

rniwa commented Sep 12, 2016

I think whether we treat slot as a replaced element is a slightly orthogonal issue to whether it has display: contents as the style or not. Having said that, slot is kind of special since its content is the slotted nodes so I could see it being treated as a replaced element. Really though, slot is a special element different from replaced or non-replaced element.

@hayatoito
Copy link
Contributor

hayatoito commented Sep 13, 2016

When users specify an author rule, slot { display: block }, I would like <slot> to behave like a <div>, in terms of layout.
Though other nodes are assigned to children of a slot in the layout tree, there should be no difference between <slot> and <div>, other than that, in this case.

Does it mean <slot> is NOT a replaced element?

I do not fully understand the impact of letting it being a replaced element. What is a user visible impact?
::before (or ::after) can not be applied for a replaced element, per the spec?

@haoqunjiang
Copy link
Author

@hayatoito It's stated in CSS Generated Content Module Level 3:

Replaced elements do not have '::before' and '::after' pseudo-elements

@hayatoito
Copy link
Contributor

hayatoito commented Sep 14, 2016

Thanks! Then, I propose the status quo; <slot> should be a Non-replaced element.

Regarding the current behavior in Blink, please do not take it seriously. No explicit intention there.
The current support of <slot> in Blink is incomplete because Blink does not support "slot" in a flat tree.
See #308 for details. Blink does not create any layout box for a slot, as of now.

@hayatoito
Copy link
Contributor

hayatoito commented Dec 6, 2016

Let me close this with status quo since this issue did not get the attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants