Skip to content

[Shadow]: rename <content> to <slot> (bugzilla: 28561) #92

Closed

Description

@hayatoito

Title: [Shadow]: rename to (bugzilla: 28561)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561


comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c0
Anne wrote on 2015-04-27 05:30:45 +0000.

Since we successfully managed to avoid bikeshedding at the meeting... I think makes more sense, especially with an API. "Distributing nodes into slots".


comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c1
Justin Fagnani wrote on 2015-04-27 07:04:07 +0000.

I'm honestly not sure that makes more sense than . It's not just any nodes that can be redistributed - it must be children of the host, so makes sense here to me. is where all or some of the hosts content goes.


comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c2
Travis Leithead [MSFT] wrote on 2015-04-27 20:00:34 +0000.

Slot does seem pretty generic... like . Can't say I'm behind the new name idea either.


comment: 3
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c3
Hayato Ito wrote on 2015-04-30 10:42:34 +0000.

This might be bikeshed. :)

Can we defer the decision until the upcoming Imperative APIs proposal?
I hope the situation will be more clear after that.


comment: 4
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c4
Anne wrote on 2015-04-30 11:31:03 +0000.

Sure, I don't feel strongly about this. Dimitri came up with this and I liked it since it was a somewhat shorter and clearer name.

To reply to Justin, it's the host element's content that is distributed. But it's not distributed into content... Rather, it's content distributed into slots based on (most likely) a Turing complete set of rules.


comment: 5
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c5
Hayato Ito wrote on 2015-04-30 12:47:59 +0000.

If I were allowed to write the spec from the scratch, I prefer "slot" to "content" because the name of "slot" is more intuitive than insertion points to me.

However, I am not sure this kind of renaming is really worth doing only because we find a better name.

I'd like to defer this, given we have more high priority tasks.


comment: 6
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28561#c6
Anne wrote on 2015-04-30 12:53:15 +0000.

Okay, let's wait for the imperative API. Because if we change that, we can change this too.

Activity

  1. wilsonpage commented on May 28, 2015

    @wilsonpage
    Contributor

    Does this mean ::content will change to ::slot?

  2. hayatoito commented on May 29, 2015

    @hayatoito
    ContributorAuthor

    I guess there is no intention for that. We can file a new bug if we prefer ::slot to ::content.

  3. wilsonpage commented on May 29, 2015

    @wilsonpage
    Contributor

    Without a <content> tag ::content pseudo selector no longer makes as much sense.

  4. hayatoito commented on May 29, 2015

    @hayatoito
    ContributorAuthor

    ::content can be used for insertion points in general. It makes sense, doesn't it?
    In fact, ::content could be used for both <content> and <shadow> at the era of 'multiple shadow roots'.

  5. rniwa commented on May 29, 2015

    @rniwa
    Collaborator

    Note I don't have a strong preference on the name of the element into which nodes are distributed.

    However, given the current consensus is not to have multiple shadow roots at least in v1, I don't think it makes sense to keep the name ::content if we're renaming <content> to <slot> just in case we all happen to agree on adding back <content> and <shadow> since some vendors, such as us (Apple), vocally opposed to that.

  6. annevk commented on May 30, 2015

    @annevk
    Collaborator

    Yeah, we should rename ::content too if we rename <content>. And I think we should rename both.

  7. hayatoito commented on May 30, 2015

    @hayatoito
    ContributorAuthor

    The point is ::slot is not a good name here. That's a confusing name for the purpose of ::content.
    ::slot is likely to make developers have a wrong impression that ::slot is used for selecting slot elements which are assigned to this slot, rather than selecting distributed nodes which are distributed to this slot.
    Do you want ::slot to select distributed nodes? I don't think so.

    One idea, we might have both:

    • A. ::slot - used for selecting slots which are assigned to this slot. I am not sure there is a use case for that.
    • B. ::distributed - which has the same behavior of the current ::content. Actually, ::distributed was the former name for ::content.

    IMO, renaming to ::distributed is much better than renaming to ::slot because it is less confusing for the purpose of B. We might want to reserve ::slot for the purpose of A.

  8. rniwa commented on May 31, 2015

    @rniwa
    Collaborator

    I don't think we should use a completely different name like ::distributed. You might be well versed with all the terms in web components but a typical Web developer already has to deal with terms like shadow DOM and slots. Introducing yet another arbitrary term like distribution is only doing disservice to the developer ergonomics. In general, our industry is completely insane for making up all these words. We need to stop doing that.

    Having said that, the only name I can think of will be ::slot-content if ::slot is confusing.

  9. dglazkov commented on May 31, 2015

    @dglazkov
    Contributor

    Agreed on terrible naming history, would love to do better. How about ::slotted?

  10. hayatoito commented on Jun 1, 2015

    @hayatoito
    ContributorAuthor

    I am not saying that we have to rename ::content to ::distributed.
    I am saying ::distributed is better than ::slot, relatively. ::content is still better than ::distributed and ::slot-content.
    I think ::slot-content is just redundant. I want to write slot::content rather than slot::slot-content.

    What problems are you trying to solve by renaming ::content to ::slot-content?

    Anyway, now I think everyone can understand why ::slot is not a good name here, as I pointed out in the previous comment, this kind of renaming is a low priority task for me. I hope the discussion would settle down with a reasonable result, including the possibility of 'no renaming'.

    I think everyone doesn't like a renaming again and again. :(

  11. rniwa commented on Jun 1, 2015

    @rniwa
    Collaborator

    I disagree. ::content is a horribly vague. Everything in a HTML/XML document is content. ::slotted sounds best among what's been proposed so far although ::inserted and ::placed may also work.

  12. hayatoito commented on Jun 1, 2015

    @hayatoito
    ContributorAuthor

    If you are still interested in renaming, could you file a bug for CSS Scoping, http://dev.w3.org/csswg/css-scoping/ ?
    The Shadow DOM spec doesn't define it.

  13. rniwa commented on Jun 1, 2015

    @rniwa
    Collaborator

    If that's your final response, why didn't you just say that at the beginning instead of making comments about how ::content would be just fine? I find it extremely frustrating for the whole discussion to be debunked like that.

    Now, the said spec, in fact, has issue 6 which states "::content is a confusingly general name for something that is specific to the projected content of a shadow tree" so we should be renaming this pseudo element even if we kept content as the element name, which we aren't doing anymore.

  14. 8 remaining items

  15. hayatoito commented on Jun 11, 2015

    @hayatoito
    ContributorAuthor

    BTW, can we defer the discussion, say one month later?
    I think it's a bit early to discuss this kind of topic. I'd like to prioritize other tasks than this and wait for the final version of the slots proposal.

  16. tabatkins commented on Jun 11, 2015

    @tabatkins

    Yes, I'd greatly prefer to wait until the slots proposal is fully statted out before trying to mold some CSS around it.

  17. added a commit that references this issue on Sep 7, 2015
    c3c26e3
  18. humanarity commented on Dec 3, 2015

    @humanarity

    Since slots inverts control from content ( content decides which nodes to distribute, nodes named to a slot can decide where they distribute ), can't we have both? Seems there are cases where the balance of control on component authors or component users could work to go either way.

  19. hayatoito commented on Dec 3, 2015

    @hayatoito
    ContributorAuthor

    @humanarity
    I have the similar concern about slots.
    You might want to take a look at: #343

  20. wejrowski commented on Jun 21, 2016

    @wejrowski

    I'm not sure the best place to ask this question, but... I'm curious, did the <content> tag which chrome currently supports simply get renamed to <slot>? Or is there something more going on here? I know I can use in chrome, but FF was showing the content tag deprecated.

    Any replies would be awesome, also is there a better location for QA?

  21. hayatoito commented on Jun 22, 2016

    @hayatoito
    ContributorAuthor

    I guess the subject of this issue would confuse you. Rename is not a good word here. They, <content> and <slot>, have different purposes.

    <content> continues to work in chrome for Shadow DOM v0 (I mean it works inside of a shadow tree created by Element.createShadowRoot()) until it is deprecated someday. The deprecation should not happen soon. I will support it until it is deprecated.

    Any replies would be awesome, also is there a better location for QA?

    Yeah, we should discuss this in other places because your concern might be specific to chrome, but I think it's okay to answer here because you might not be the only person who got confused.

  22. wejrowski commented on Jun 24, 2016

    @wejrowski

    Yeah I'm curious what what difference is apart from just a rename.

    Currently I'm trying to look into what's supported on browsers and where the standards are... what is firmly established and what is open for discussion (as far as web component related features are concerned). My assumption has been that the basic component API has been agreed on and it's just a matter of naming, though perhaps everything's still up in the air. I also discovered createShadowRoot() has also been renamed which was a surprise to me too.

  23. annevk commented on Jun 24, 2016

    @annevk
    Collaborator
  24. retrocausal commented on Sep 2, 2016

    @retrocausal

    As a developer , It is getting a tad inconclusive. I know, that a <content> tag would render whatever is marked down within the custom element tags.

    Now, I see that we have a concept called the <slot> tags within the shadowDoM for a custom element, and any markdown within the tags , gets appended to the slot tag in the shadowDoM.
    Now, where does that leave <content>?

  25. annevk commented on Sep 2, 2016

    @annevk
    Collaborator

    <content> is obsolete.

  26. retrocausal commented on Sep 2, 2016

    @retrocausal

    Huh! Nooooo! all my old code is gonna break?

    Rememeber we used to

    <template id="some-id">
        <div class="some-class">
            <content></content>
        </div>
    </template>
    

    and if the custom element we defined was "custom-element" ,
    and if that element was built using the template above ,
    anything within

    <custom-element>
     < markup>
    </custom-element>
    

    the markup would be injected into the template.

    What are our options now, considering content being obsolete?

  27. domenic commented on Sep 2, 2016

    @domenic
    Collaborator

    Your old code was already broken in all browsers except Chrome :)

    As @annevk said a few posts ago, reading through http://hayato.io/2016/shadowdomv1/ or other tutorials will be your best way to understand your options.

  28. added a commit that references this issue on Jul 30, 2025
    a4ec41e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions