GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [css-cascade] [css-scoping] [cssom] What should getComputedStyle return for an element which isn't in the flat tree? · Issue #1964 · w3c/csswg-drafts

[css-cascade] [css-scoping] [cssom] What should getComputedStyle return for an element which isn't in the flat tree? #1964

New issue
Copy link
New issue
Copy link
Closed
Closed
[css-cascade] [css-scoping] [cssom] What should getComputedStyle return for an element which isn't in the flat tree?#1964
Copy link
Labels
Closed Accepted by CSSWG ResolutionChanges backed by a CSSWG resolution.Changes backed by a CSSWG resolution.css-cascade-4Current WorkCurrent Workcss-scoping-1Current WorkCurrent Workcssom-1Current WorkCurrent Worktopic: shadow

Description

@emilio
emilio
opened on Nov 9, 2017
Issue body actions

I believe implementations now just make it inherit from the default style, but that's not intuitive either, and in any case it's not specced, but should be.

Activity

  1. emilio commented on Nov 9, 2017

    @emilio
    emilio
    on Nov 9, 2017
    CollaboratorAuthor
    More actions

    I guess this affects a few more specs.

    CSS Cascade says in https://drafts.csswg.org/css-cascade/#inheriting:

    Inheritance propagates property values from parent elements to their children. The inherited value of a property on an element is the computed value of the property on the element’s parent element. For the root element, which has no parent element, the inherited value is the initial value of the property.

    But there's no mention to the flattened tree anywhere in that spec.

    CSS Scoping says in https://drafts.csswg.org/css-scoping/#shadow-gloss:

    However, the shadow tree, when it exists, is used in the construction of the flattened element tree, which CSS uses for all purposes after Selectors (including inheritance and box construction).

  2. emilio
    changed the title [-][cssom] What should getComputedStyle return for an element which isn't in the flat tree?[/-] [+][css-cascade] [css-scoping] [cssom] What should getComputedStyle return for an element which isn't in the flat tree?[/+] on Nov 9, 2017
  3. fantasai
    added
    cssom-1Current WorkCurrent Work
    css-cascade-3
    css-scoping-1Current WorkCurrent Work
    on Dec 4, 2017
  4. FremyCompany commented on Feb 6, 2018

    @FremyCompany
    FremyCompany
    on Feb 6, 2018
    Contributor
    More actions

    Merging with #1548

  5. FremyCompany
    closed this as completedon Feb 6, 2018
  6. emilio commented on Feb 6, 2018

    @emilio
    emilio
    on Feb 6, 2018
    CollaboratorAuthor
    More actions

    @FremyCompany I think this is not a dupe of that. A detached subree is not the same as an element which is not on the flat tree.

    An element which is part of a document tree but not of the flat tree would be an unassigned child of a shadow host.

    Could you reopen, o clarify in #1548 that this is also going to be addressed in there? (I don't have the permission).

    Thanks!

  7. FremyCompany
    reopened this on Feb 7, 2018
  8. FremyCompany commented on Feb 8, 2018

    @FremyCompany
    FremyCompany
    on Feb 8, 2018
    Contributor
    More actions

    Cross-posting from 1548:

    An element assigned to a slot doesn't inherit from the shadow host, but from the assigned slot. There's no spec that defines that in case it's not assigned to any slot it should inherit from the host, afaict.

    Ah, that should probably be added then; more than likely it's just an oversight. Using their parent's style is the closest approximation of the behavior that would happen whenever it gets slotted, so that looks reasonable to me.

  9. AmeliaBR commented on Feb 8, 2018

    @AmeliaBR
    AmeliaBR
    on Feb 8, 2018
    Contributor
    More actions

    A comparison could be made to SVG <symbol> and <defs> children, which are never rendered directly. When the element is cloned into a use-element shadow tree, the clone inherits from that context. But the original DOM elements can still have matched & inherited styles (based on its DOM tree parents), even if they are never used because the element isn't rendered. I think all browsers now calculate styles in that case -- although Firefox used to be (maybe still is) buggy, treating them as detached elements.

  10. annevk
    added
    topic: shadow
    on Feb 22, 2018
  11. FremyCompany
    added
    Agenda+ F2F
    on Mar 28, 2018
  12. tabatkins
    added
    css-cascade-4Current WorkCurrent Work
    and removed
    css-cascade-3
    on Jun 21, 2018
  13. astearns
    removed
    Agenda+ F2F
    on Jul 4, 2018
  14. css-meeting-bot commented on Jul 4, 2018

    @css-meeting-bot
    css-meeting-bot
    on Jul 4, 2018
    Member
    More actions

    The Working Group just discussed What should getComputedStyle return for an element which isn't in the flat tree?.

    The full IRC log of that discussion <florian> topic: What should getComputedStyle return for an element which isn't in the flat tree?
    <florian> github: https://github.com//issues/1964
    <florian> emilio: frremy added that, but we already resolved
    <florian> frremy: it's a bot bug, nothing to talk about
    <emilio> Was resolved on https://github.com//issues/1548#issuecomment-380383455
  15. tabatkins
    added a commit that references this issue on Jan 13, 2021

    [css-cascade-4] Define that elements that are disconnected or not in …

    8804865
  16. tabatkins commented on Jan 13, 2021

    @tabatkins
    tabatkins
    on Jan 13, 2021
    Member
    More actions

    Okay, we've added a paragraph to section 4 that should cover this, per the resolution in #1548:

    Elements that are not connected or are not part of the document’s flattened element tree do not participate in CSS value processing, and do not have declared, cascaded, specified, computed, used, or actual values, even if they potentially have style declarations assigned to them (for example, by a style attribute).

    CSSOM still needs to define what should be output by gCS() when an element has no styles; it might already do so but I haven't checked.

    @emilio Can you confirm that this looks correct?

  17. tabatkins
    added
    Closed Accepted by CSSWG ResolutionChanges backed by a CSSWG resolution.Changes backed by a CSSWG resolution.
    Commenter Response Pending
    on Jan 13, 2021
  18. fantasai commented on Jan 13, 2021

    @fantasai
    fantasai
    on Jan 13, 2021
    Collaborator
    More actions

    Also pls edit cssom since you are the editor. :P

  19. emilio commented on Mar 12, 2021

    @emilio
    emilio
    on Mar 12, 2021
    CollaboratorAuthor
    More actions

    Yeah that sounds good, thanks. https://drafts.csswg.org/cssom-1/#extensions-to-the-window-interface should already be doing the right thing.

  20. fantasai
    removed
    Commenter Response Pending
    on Mar 12, 2021
  21. fantasai
    closed this as completedon Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted by CSSWG ResolutionChanges backed by a CSSWG resolution.Changes backed by a CSSWG resolution.css-cascade-4Current WorkCurrent Workcss-scoping-1Current WorkCurrent Workcssom-1Current WorkCurrent Worktopic: shadow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.