-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Use USVString for all URLs #1282
Conversation
This finds all instances where URLs are part of an IDL interface, including where they are reflecting content attributes, and changes the type from DOMString to USVString. This has already been done in some places in a haphazard way, but this commit finishes the process. This allows us to clarify the rules for reflecting USVString attributes, and remove the clause that allows DOMString attributes to reflect URLs. Fixes #1254. Fixes #1266.
Changes LGTM. Will merge later today in case anyone else wants to have a look. |
@@ -24497,7 +24500,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</pre> | |||
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt> | |||
<dd> | |||
<pre class="idl">interface <dfn>HTMLSourceElement</dfn> : <span>HTMLElement</span> { | |||
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-source-src">src</span>; | |||
[<span>CEReactions</span>] attribute USVString <span data-x="dom-source-src">src</span>; | |||
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-source-type">type</span>; | |||
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-source-srcset">srcset</span>; |
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.
Missed this one?
Edit: Sorry, there's already a catch-all for USVString. Ignore the above. |
Missing the constructors for Worker and SharedWorker |
Pushed a fixup. |
I also pushed a fixup with a bunch more. |
@@ -87017,15 +87017,15 @@ interface <dfn>NavigatorOnLine</dfn> { | |||
<pre class="idl">[Constructor(DOMString type, optional <span>ErrorEventInit</span> eventInitDict), Exposed=(Window,Worker)] | |||
interface <dfn>ErrorEvent</dfn> : <span>Event</span> { | |||
readonly attribute DOMString <span data-x="dom-ErrorEvent-message">message</span>; | |||
readonly attribute DOMString <span data-x="dom-ErrorEvent-filename">filename</span>; | |||
readonly attribute USVString <span data-x="dom-ErrorEvent-filename">filename</span>; |
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.
Are we sure about this one?
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.
https://html.spec.whatwg.org/multipage/webappapis.html#runtime-script-errors
Let location be an absolute URL that corresponds to the resource from which script was obtained.
...
Initialise event's filename attribute to location.
OK I think I'm done here. |
Looks good, will let @domenic land. |
Great catches, thanks; can't believe I missed them. |
As resolved by CSS WG on 2017-04-19, because they are URLs. This is consistent with HTML: whatwg/html#1282
As resolved by CSS WG on 2017-04-19, because they are URLs. This is consistent with HTML: whatwg/html#1282
This finds all instances where URLs are part of an IDL interface,
including where they are reflecting content attributes, and changes the
type from DOMString to USVString. This has already been done in some
places in a haphazard way, but this commit finishes the process.
This allows us to clarify the rules for reflecting USVString attributes,
and remove the clause that allows DOMString attributes to reflect URLs.
Fixes #1254. Fixes #1266.
/cc @Ms2ger