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

Implement HTMLMediaElement.crossorigin #22824

Closed
wants to merge 5 commits into from

Conversation

@andrealexandre
Copy link

andrealexandre commented Feb 5, 2019

  1. uncommented HTMLMediaElement webidl
  2. added getter and setter to HTMLMedieElementMethods trait implementation
  3. added logic to modify RequestInit values based on value of CorsSettings property. added cross origin property to html media elment struct.

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #22287 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because "the test expectations seem to already cover the new property, and there was no impact on the test results"

This change is Reviewable

@highfive
Copy link

highfive commented Feb 5, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @asajeffrey (or someone else) soon.

@highfive
Copy link

highfive commented Feb 5, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/HTMLMediaElement.webidl, components/script/dom/htmlmediaelement.rs
  • @KiChjang: components/script/dom/webidls/HTMLMediaElement.webidl, components/script/dom/htmlmediaelement.rs
@highfive
Copy link

highfive commented Feb 5, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@Manishearth Manishearth changed the title Feature/#22287 Implement HTMLMediaElement.crossorigin Feb 5, 2019
@ferjm
Copy link
Member

ferjm commented Feb 6, 2019

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request Feb 6, 2019
Implement HTMLMediaElement.crossorigin

<!-- Please describe your changes on the following line: -->
1. uncommented HTMLMediaElement webidl
2. added getter and setter to HTMLMedieElementMethods trait implementation
3. added logic to modify RequestInit values based on value of CorsSettings property.  added cross origin property to html media elment struct.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22287  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because "the test expectations seem to already cover the new property, and there was no impact on the test results"

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/22824)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 6, 2019

Trying commit 92e825c with merge 9171c6c...

Copy link
Member

ferjm left a comment

LGTM, but I suspect that we need to update the tests expectations at least for the couple of WPTs mentioned here. Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Feb 6, 2019

💔 Test failed - linux-rel-css

@ferjm
Copy link
Member

ferjm commented Feb 11, 2019

Yes, that seems to be the case. We need to update the tests expectations for /html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html

{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "HTMLMediaElement.crossOrigin", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110684, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "HTMLMediaElement.crossOrigin, setting to empty string", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110771, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "FAIL", 
    "group": "default", 
    "message": "assert_false: expected false got true", 
    "stack": "@http://web-platform.test:8000/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html:43:5\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1587:20\ntest@http://web-platform.test:8000/resources/testharness.js:544:21\n@http://web-platform.test:8000/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html:40:1\n", 
    "subtest": "HTMLMediaElement.crossOrigin, setting to null", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110774, 
    "action": "test_result", 
    "expected": "PASS"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "HTMLMediaElement.crossOrigin, setting to invalid value", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110775, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "HTMLMediaElement.crossOrigin, setting to uppercase ANONYMOUS", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110776, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "HTMLMediaElement.crossOrigin, setting to use-credentials", 
    "test": "/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/crossOrigin.html", 
    "line": 110777, 
    "action": "test_result", 
    "expected": "FAIL"
DOMString::from_string(self.cross_origin.borrow().clone())
}
// https://html.spec.whatwg.org/multipage/#attr-media-crossorigin
make_setter!(SetCrossOrigin, "crossorigin");

This comment has been minimized.

Copy link
@jdm

jdm Feb 11, 2019

Member

This won't work as written, since the cross_origin member is never updated with the new value. We should do what HTMLImageElement does instead:

    // https://html.spec.whatwg.org/multipage/#attr-media-crossOrigin
    fn GetCrossOrigin(&self) -> Option<DOMString> {
        reflect_cross_origin_attribute(self.upcast::<Element>())
    }

    // https://html.spec.whatwg.org/multipage/#attr-media-crossOrigin
    fn SetCrossOrigin(&self, value: Option<DOMString>) {
        set_cross_origin_attribute(self.upcast::<Element>(), value);
    }
@@ -16,7 +16,7 @@ interface HTMLMediaElement : HTMLElement {
[CEReactions] attribute USVString src;
attribute MediaProvider? srcObject;
readonly attribute USVString currentSrc;
// [CEReactions] attribute DOMString crossOrigin;
[CEReactions] attribute DOMString crossOrigin;

This comment has been minimized.

Copy link
@jdm
@jdm jdm assigned ferjm and unassigned asajeffrey Feb 11, 2019
@jdm
Copy link
Member

jdm commented Feb 27, 2019

@andrealexandre Are you planning to keep working on this?

@ferjm
Copy link
Member

ferjm commented Mar 13, 2019

I am closing this one due to the lack of activity. @andrealexandre feel free to reopen if you find the time to work on this again. Thanks!

@ferjm ferjm closed this Mar 13, 2019
@andrealexandre
Copy link
Author

andrealexandre commented Mar 20, 2019

Sorry, been busy these last couple weeks. I'll reopen a new PR after going through the comments and changes mentioned here.

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.

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