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

Update src/href attributes to be a USVString #22456

Merged
merged 1 commit into from Dec 23, 2018
Merged

Conversation

@dlrobertson
Copy link
Contributor

dlrobertson commented Dec 14, 2018

The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

Fixes: #22454


This change is Reviewable

@highfive
Copy link

highfive commented Dec 14, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/htmliframeelement.rs, components/script/dom/htmllinkelement.rs, components/script/dom/webidls/HTMLScriptElement.webidl, components/script/dom/macros.rs, components/script/dom/webidls/HTMLInputElement.webidl and 10 more
  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/dom/htmllinkelement.rs, components/script/dom/webidls/HTMLScriptElement.webidl, components/script/dom/macros.rs, components/script/dom/webidls/HTMLInputElement.webidl and 10 more
@highfive
Copy link

highfive commented Dec 14, 2018

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
Copy link
Member

ferjm left a comment

LGTM. There are a couple of DOMStrings that should be USVStrings left though. Thanks!

@@ -13,7 +13,7 @@ interface HTMLMediaElement : HTMLElement {
readonly attribute MediaError? error;

// network state
[CEReactions] attribute DOMString src;
[CEReactions] attribute USVString src;
attribute MediaProvider? srcObject;
readonly attribute DOMString currentSrc;

This comment has been minimized.

Copy link
@ferjm

ferjm Dec 14, 2018

Member

According to the spec, currentSrc should also be an USVString

@@ -8,7 +8,7 @@ interface HTMLImageElement : HTMLElement {
[CEReactions]
attribute DOMString alt;
[CEReactions]
attribute DOMString src;
attribute USVString src;
[CEReactions]
attribute DOMString srcset;

This comment has been minimized.

Copy link
@ferjm

ferjm Dec 14, 2018

Member

srcset and currentSrc should also be USVStrings

@SimonSapin
Copy link
Member

SimonSapin commented Dec 14, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2018

Trying commit 86f715a with merge d443b2a...

bors-servo added a commit that referenced this pull request Dec 14, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2018

💔 Test failed - status-taskcluster

@SimonSapin
Copy link
Member

SimonSapin commented Dec 14, 2018

@bors-servo try=linux retry

@SimonSapin
Copy link
Member

SimonSapin commented Dec 14, 2018

@SimonSapin
Copy link
Member

SimonSapin commented Dec 14, 2018

@bors-servo try=linux

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2018

Trying commit 86f715a with merge 8ca7be9...

bors-servo added a commit that referenced this pull request Dec 14, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@dlrobertson dlrobertson force-pushed the dlrobertson:fix_src branch from 86f715a to aa8bcab Dec 14, 2018
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Dec 14, 2018

@ferjm updated

@ferjm
ferjm approved these changes Dec 17, 2018
Copy link
Member

ferjm left a comment

Looks good. Thanks!

}
}

impl<'a> From<&'a str> for USVString {

This comment has been minimized.

Copy link
@ferjm

ferjm Dec 17, 2018

Member

What do we need this for? I can't see us using it at the moment.

}
}

impl<'a> From<Cow<'a, str>> for USVString {

This comment has been minimized.

Copy link
@ferjm

ferjm Dec 17, 2018

Member

We do not seem to need this either.

The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

 - HTMLIFrameElement
 - HTMLImageElement
 - HTMLInputElement
 - HTMLLinkElement
 - HTMLMediaElement
 - HTMLScriptElement
@dlrobertson dlrobertson force-pushed the dlrobertson:fix_src branch from aa8bcab to c46508e Dec 17, 2018
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Dec 17, 2018

👍 Removed them. They were implemented for DOMString, so I thought they might be useful down the road, but we can add them later if we need them.

@ferjm
Copy link
Member

ferjm commented Dec 17, 2018

Thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Dec 17, 2018

📌 Commit c46508e has been approved by ferjm

bors-servo added a commit that referenced this pull request Dec 22, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2018

💔 Test failed - mac-rel-css1

@jdm
Copy link
Member

jdm commented Dec 22, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2018

Testing commit c46508e with merge 1751958...

bors-servo added a commit that referenced this pull request Dec 22, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 22, 2018

💔 Test failed - mac-rel-wpt3

@jdm
Copy link
Member

jdm commented Dec 22, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Dec 23, 2018

Testing commit c46508e with merge 13fd9b0...

bors-servo added a commit that referenced this pull request Dec 23, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 23, 2018

💔 Test failed - mac-rel-wpt4

@jdm
Copy link
Member

jdm commented Dec 23, 2018

bors-servo added a commit that referenced this pull request Dec 23, 2018
Update src/href attributes to be a USVString

The following IDLs have the src/href attributes typed as a `DOMString`
while in the spec the attribute has been updated to be a `USVString`:

 - [HTMLIFrameElement]
 - [HTMLImageElement]
 - [HTMLInputElement]
 - [HTMLLinkElement]
 - [HTMLMediaElement]
 - [HTMLScriptElement]

Fixes: #22454

[HTMLIFrameElement]: https://html.spec.whatwg.org/multipage/#htmliframeelement
[HTMLImageElement]: https://html.spec.whatwg.org/multipage/#htmlimageelement
[HTMLInputElement]: https://html.spec.whatwg.org/multipage/#htmlinputelement
[HTMLLinkElement]: https://html.spec.whatwg.org/multipage/#htmllinkelement
[HTMLMediaElement]: https://html.spec.whatwg.org/multipage/#htmlmediaelement
[HTMLScriptElement]: https://html.spec.whatwg.org/multipage/#htmlscriptelement

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 23, 2018

Testing commit c46508e with merge 2757795...

@bors-servo
Copy link
Contributor

bors-servo commented Dec 23, 2018

@bors-servo bors-servo merged commit c46508e into servo:master Dec 23, 2018
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.