Skip to content

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

Closed
wants to merge 3 commits into from
Closed

Clarify CSSURLImageValue.url #639

wants to merge 3 commits into from

Conversation

darrnshn
Copy link
Collaborator

@darrnshn darrnshn commented Feb 5, 2018

Fixes #630 .

Hi @tabatkins PTAL, not sure what the correct wording should be.

@darrnshn darrnshn requested a review from tabatkins February 5, 2018 02:37
@@ -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,
Copy link
Collaborator Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2. Else, return a new {{CSSURLImageValue}}
with its {{CSSURLImageValue/url}} internal slot
set to |url|.
set to |url| with CSS character escapes processed.
Copy link
Collaborator Author

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...

Copy link
Member

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.

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2. Else, return a new {{CSSURLImageValue}}
with its {{CSSURLImageValue/url}} internal slot
set to |url|.
set to |url| with CSS character escapes processed.
Copy link
Member

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]],
Copy link
Collaborator Author

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 :/

Copy link
Member

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.

@tabatkins
Copy link
Member

Closing due to substantial redesign, see #716 (comment)

@tabatkins tabatkins closed this Feb 26, 2018
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

Successfully merging this pull request may close these issues.

3 participants