Skip to content

[css-typed-om] Semantics of CSSURLImageValue constructor? #424

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

Closed
asajeffrey opened this issue Jul 5, 2017 · 2 comments · Fixed by #440
Closed

[css-typed-om] Semantics of CSSURLImageValue constructor? #424

asajeffrey opened this issue Jul 5, 2017 · 2 comments · Fixed by #440

Comments

@asajeffrey
Copy link

https://drafts.css-houdini.org/css-typed-om-1/#cssurlimagevalue says that CSSURLImageValue has a constructor, but not what its semantics should be. In particular, should it throw an exception if called with a string which does not parse as a URL?

@nainar
Copy link
Contributor

nainar commented Jul 25, 2017

Given a string that does not parse as a URL the CSSURLImageValue constructor should throw a TypeError.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed https://github.com/w3c/css-houdini-drafts/issues/424, and agreed to the following resolutions:

  • RESOLVED: CSSURLImageValue that fails to parse as a URL should throw an error
The full IRC log of that discussion <nainar> Topic: https://github.com//issues/424
<dbaron> Github: https://github.com//issues/424
<fantasai> topic is Semantics of CSSURLImageValue constructor
<fantasai> TabAtkins: Things that construct values based on URLs
<fantasai> TabAtkins: Should we do some early parsing of URL and throw an exception if it fails URL parsing?
<fantasai> TabAtkins: Our opinion is yes
<fantasai> iank_: If you construct a CSSURLImageValue in a PaintWorklet, and invalid, can't use it. what should semantics be?
<fantasai> TabAtkins: Constructed parsers are used in worklets
<fantasai> TabAtkins: Impls doe somehting about this in ServiceWorkers
<fantasai> TabAtkins: Shouldn't be difficult to throw if URL is bad
<fantasai> plinss: This is never synchronouse?
<fantasai> TabAtkins: No resolution
<fantasai> s/synch/async/
<fantasai> Rossen: Any opinions?
<dbaron> I don't really know the current rules for Gecko's URL parser, fwiw.
<fantasai> RESOLVED: CSSURLImageValue that fails to parse as a URL should throw an error
<fantasai> undecided which error?
<fantasai> plinss: Should have a platform-wide error for URL parsing error
<fantasai> iank_: Platform is very inconsistent, some throw TypeError, others throw SyntaxError
<fantasai> dbaron: Sure ServiceWorker relies on this?
<fantasai> iank_ cites stuff

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

Successfully merging a pull request may close this issue.

4 participants