[go: nahoru, domu]

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

TAG review of whether element.pseudo(":unknown") should return null or throw #348

Closed
fantasai opened this issue Feb 25, 2019 · 7 comments
Closed
Assignees

Comments

@fantasai
Copy link

こんにちはTAG!

I'm requesting a TAG review of:

We'd prefer the TAG provide feedback by commenting in this issue (for comments relevant to that issue) w3c/csswg-drafts#3603 or by opening new issues if more issues are found.

@alice alice self-assigned this Feb 26, 2019
@dbaron dbaron self-assigned this Feb 26, 2019
@hober hober self-assigned this Mar 4, 2019
@dbaron
Copy link
Member
dbaron commented Mar 29, 2019

So I think one question here is to what extent we should be looking for analogous cases that are functions, and to what extent we should be looking at analogous cases that are attributes. I ask this because .pseudo() is rather like attributes, except that it's large space of attributes and you're saying which one you want by giving the argument to the function.

It seems like there are three possible options for what to do when there isn't an object to return: null, undefined, or an exception. There are also multiple cases of not having an object, which could deserve different treatment:

  1. the implementation supports a pseudo-element with this name/syntax, but not on this element
  2. the implementation doesn't support a pseudo-element with this name/syntax
  3. the string argument given doesn't appear to be the syntax of a pseudo-element

I think distinguishing between (2) and (3) is a bad idea because it could make future syntax expansion difficult. But there might be a bit more reason for (1) to be different.

If you think of these like attributes, then it might make sense for (1) to be null and (2) and (3) to be undefined... but at the same time, I think it's highly unusual for web APIs to return undefined.

I'm having trouble thinking of closer analogies currently within the platform, though.

@dbaron dbaron changed the title TAG review of whether element.pseudo(":unkown") should return null or throw TAG review of whether element.pseudo(":unknown") should return null or throw Mar 30, 2019
@annevk
Copy link
Member
annevk commented Mar 31, 2019

When would 1 apply?

@dbaron
Copy link
Member
dbaron commented Mar 31, 2019

One example might be ::marker, which only exists on elements that are display: list-item.

@annevk
Copy link
Member
annevk commented Apr 1, 2019

Does that mean that this might become another "forces layout" API without that being documented in detail?

@dbaron
Copy link
Member
dbaron commented Apr 1, 2019

That's a good argument for not doing anything based on (1).

@torgo torgo added this to the 2019-04-24-telcon milestone Apr 17, 2019
@torgo
Copy link
Member
torgo commented Apr 17, 2019

We discussed briefly today in TAG call - and agreed to review pending the CSS wg discussion.

@hober
Copy link
Contributor
hober commented May 8, 2019

We discussed this on our telcon tonight. We think returning null is reasonable. We'll update our design guidelines to cover cases like this; that work is tracked in w3ctag/design-principles#55

@hober hober closed this as completed May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants