-
Notifications
You must be signed in to change notification settings - Fork 142
Clarify CSSURLImageValue.url #639
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
Conversation
css-typed-om/Overview.bs
Outdated
@@ -2650,11 +2650,11 @@ objects, the {{CSSURLImageValue/url}} attribute contains the URL that references | |||
when called, | |||
perform the following steps: | |||
|
|||
1. If the |url| passed into the constructor doesn't correctly | |||
parse as a <<url>>, throw a {{TypeError}} and exit this algorithm. | |||
1. If the |url| passed into the constructor is not a valid url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I link to some definition of valid url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
css-typed-om/Overview.bs
Outdated
2. Else, return a new {{CSSURLImageValue}} | ||
with its {{CSSURLImageValue/url}} internal slot | ||
set to |url|. | ||
set to |url| with CSS character escapes processed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh not sure what to do here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be doing anything with character escapes here. The url is just a string, we should be using that directly. Escaping only comes into play when we serialize the value back out as a CSS string.
css-typed-om/Overview.bs
Outdated
@@ -2650,11 +2650,11 @@ objects, the {{CSSURLImageValue/url}} attribute contains the URL that references | |||
when called, | |||
perform the following steps: | |||
|
|||
1. If the |url| passed into the constructor doesn't correctly | |||
parse as a <<url>>, throw a {{TypeError}} and exit this algorithm. | |||
1. If the |url| passed into the constructor is not a valid url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
css-typed-om/Overview.bs
Outdated
2. Else, return a new {{CSSURLImageValue}} | ||
with its {{CSSURLImageValue/url}} internal slot | ||
set to |url|. | ||
set to |url| with CSS character escapes processed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be doing anything with character escapes here. The url is just a string, we should be using that directly. Escaping only comes into play when we serialize the value back out as a CSS string.
@@ -2743,7 +2743,9 @@ objects, the {{CSSURLImageValue/url}} attribute contains the URL that references | |||
when called, | |||
perform the following steps: | |||
|
|||
1. Return a new {{CSSURLImageValue}} | |||
1. If the |url| passed into the constructor is not a [[url#valid-url-string]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out how to link the URL spec correctly sorry :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't really work. You need to use the URL parser (<a>URL parser</a>
) and make sure the return value is not failure. However, you'll also need to pass a base URL for that. And it seems you want to treat fragments as a special value per issue discussion so this probably needs some more thought.
Closing due to substantial redesign, see #716 (comment) |
Fixes #630 .
Hi @tabatkins PTAL, not sure what the correct wording should be.