Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

[css-conditional-3] define whether/how it matters if namespace prefixes are declared #3220

Closed

Description

@dbaron

One issue that came up in #3207 (noticed by @heycam while reviewing code from @emilio) is that the spec should define to what extent namespace prefixes are required to be declared. In particular, how do:

@supports (content: attr(n|href)) {
}
CSS.supports("content", "attr(n|href)");
CSS.supports("(content: attr(n|href))");

depend on whether the namespace prefix n has been declared? Do they:

  • treat all namespace prefixes as already declared?
  • treat all namespace prefixes as undeclared (invalid)?
  • depend on a set of namespace declarations (which set, exactly)?

Activity

  1. dbaron commented on Oct 17, 2018

    @dbaron
    MemberAuthor

    And I'd note that one of the relevant pieces here is that the CSS Qualified Names section of namespaces says:

    CSS qualified names can be used in (for example) selectors and property values as described in other modules. Those modules must define handling of namespace prefixes that have not been properly declared. Such handling should treat undeclared namespace prefixes as a parsing error that will cause the selector or declaration (etc.) to be considered invalid and, in CSS, ignored.

  2. emilio commented on Oct 17, 2018

    @emilio
    Collaborator

    Thanks for filing, was on my list of things to do :)

    As I said in the linked issue, I'd argue for keeping the consistency with existing APIs in regards of treating undeclared namespaces as invalid.

    For example, right now document.querySelector("a|b") throws instead of returning null, for example. I think CSS.supports should do the same, and same @supports unless namespaces are registered in the style sheet.

    This is both more consistent (IMO) and easier to implement / less special-casey.

  3. emilio commented on Oct 17, 2018

    @emilio
    Collaborator

    (Do the same as in "treat it as invalid", not as in throwing :))

  4. dbaron commented on Oct 23, 2018

    @dbaron
    MemberAuthor

    In the discussion just minuted in #3207, we resolved not to take the option of "namespaces are all invalid", but didn't yet choose between "all valid" and "use the namespace map".

  5. fantasai commented on Sep 18, 2020

    @fantasai
    Collaborator
  6. svgeesus commented on Oct 1, 2020

    @svgeesus
    Collaborator

    RESOLVED: Namespaces are either always valid or valid when they're declared. (Issue #3220)

    Well, we need to pick one of those :)

  7. svgeesus commented on Oct 1, 2020

    @svgeesus
    Collaborator

    @emilio, any opinions?

  8. emilio commented on Oct 22, 2020

    @emilio
    Collaborator

    I'd prefer the "valid when declared" option. Still less special-casey.

  9. css-meeting-bot commented on Oct 22, 2020

    @css-meeting-bot
    Member

    The CSS Working Group just discussed define whether/how it matters if namespace prefixes are declared, and agreed to the following:

    • RESOLVED: the CSS.supports() function considers all namespaces invalid (like .querySelector() does), the @supports rule consults the stylesheet's namespace map
    The full IRC log of that discussion <gregwhitworth> Topic: define whether/how it matters if namespace prefixes are declared
    <astearns> github: https://github.com//issues/3220
    <TabAtkins> @supports (content: attr(n|href)) {
    <TabAtkins> }
    <gregwhitworth> TabAtkins: things that take a namespace value, such as the attr function
    <gregwhitworth> TabAtkins: in this case if the n namespace is not declared should this supports declaration valid or not
    <gregwhitworth> TabAtkins: emilio_ had an opinion 14 mins ago
    <gregwhitworth> TabAtkins: only consider it valid when the namespace has been declared
    <gregwhitworth> TabAtkins: I don't like namespaces so I don't care
    <chris> ok someone else take this, I will rejoin
    <TabAtkins> document.querySelector("a|b")
    <gregwhitworth> TabAtkins: emilio_ also pointed out ^ (example) does check the namespace map
    <fantasai> chris points out it's a corner case
    <gregwhitworth> TabAtkins: thus we should probably stay consistent with APIs that care about namepaces
    <gregwhitworth> TabAtkins: it shouldn't matter, as chris said it's a corner case
    <gregwhitworth> fremy: one thing - you have to re-verify the at-supports
    <gregwhitworth> fantasai: no - that's not true, namespaces are per file
    <gregwhitworth> fremy: how does that work in queryselector?
    <fantasai> https://www.w3.org/TR/css-namespaces/#scope
    <gregwhitworth> rune: yeah I don't get how query selector will work
    <emilio_> It does _not_ check the ns map, there's no ns map to check
    <gregwhitworth> TabAtkins: at-supports should query the stylesheets namespace value
    <emilio_> But yeah @supports could
    <gregwhitworth> TabAtkins: so, I'm fine with emilio_ opinion
    <gregwhitworth> fantasai: I'm in favor of what's easy to implement as well
    <TabAtkins> proposed resolution: the CSS.supports() function considers all namespaces invalid (like .querySelector() does), the @supports rule consults the stylesheet's namespace map
    <gregwhitworth> chris: I just want it defined
    <gregwhitworth> astearns: any objections
    <gregwhitworth> the CSS.supports() function considers all namespaces invalid (like .querySelector() does), the @supports rule consults the stylesheet's namespace map
    <gregwhitworth> RESOLVED: the CSS.supports() function considers all namespaces invalid (like .querySelector() does), the @supports rule consults the stylesheet's namespace map
  10. added a commit that references this issue on Nov 15, 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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions