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

Implemented type attribute for OscillatorNode interface #23282

Merged
merged 2 commits into from May 22, 2019

Conversation

@PurpleHairEngineer
Copy link
Contributor

PurpleHairEngineer commented Apr 27, 2019

Please see servo/media#242 for implementation of the new oscillator node message.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

This change is Reviewable

@highfive
Copy link

highfive commented Apr 27, 2019

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

@highfive
Copy link

highfive commented Apr 27, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/OscillatorNode.webidl
  • @KiChjang: components/script/dom/webidls/OscillatorNode.webidl
@highfive
Copy link

highfive commented Apr 27, 2019

warning Warning warning

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

jdm left a comment

The implementation changes appear to be missing.

@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 27, 2019

@jdm The implementation changes are in servo/media#242. What do you mean when you say they appear to be missing? I didn't know how to submit a pull request for both servo/servo and servo/media at the same time, which is why I split it up into two different pull requests.

@jdm
Copy link
Member

jdm commented Apr 27, 2019

This change does not compile right now, since there are missing SetType and GetType methods for OscillatorNode.

@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 27, 2019

@jdm My bad. I think I added the correct methods, although GetType was called Type in biquadfilternode.rs, so I kept the same style and just called it Type.

Copy link
Member

ferjm left a comment

Thanks for the PR :)

There are still a few build errors that need to be fixed.

components/script/dom/webidls/OscillatorNode.webidl Outdated Show resolved Hide resolved
@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 29, 2019

@ferjm I fixed a few of the build errors, but I can't figure out why it can't find the get and set methods: error[E0599]: no method named get found for type dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorType in the current scope. This is on line 120 of oscillatornode.rs now (and line 125 for the set method).

@ferjm
Copy link
Member

ferjm commented Apr 29, 2019

dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorType is an enum and it has no get or set methods.

You likely got these method calls from the BiquadFilterNode.filter related code that you were taking as example. If you look closer into that code, you could see that the we are using a Cell to provide interior mutability because the setters and getters of DOM struct members are getting a reference (&self) and not a mutable reference (&mut self). Cells expose the get and set methods you were calling.

We need exactly the same thing for OscillatorNode.oscillator_type. This is, to wrap it in a Cell to get interior mutability.

@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 29, 2019

@ferjm There are build errors for this, but a main reason seems to be that the OscillatorNodeMessage hasn't been implemented yet (see servo/media#242). Is there anything else I can do for this pull request before that one is merged?

Copy link
Member

ferjm left a comment

servo/media#242 was just merged. You should be able to update servo-media here to get the latest changes by running ./mach cargo-update -p servo-media.

components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 30, 2019

@ferjm Could you please take a look at this? I made the changes you suggested. I am getting build errors, but they all seem to be for files that are not modified by this pull request.

components/script/dom/oscillatornode.rs Show resolved Hide resolved
components/script/dom/oscillatornode.rs Show resolved Hide resolved
components/script/dom/oscillatornode.rs Outdated Show resolved Hide resolved
components/script/dom/oscillatornode.rs Show resolved Hide resolved
@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 30, 2019

@ferjm Now that I've committed and pushed the changes to Cargo.lock, it says this branch has merge conflicts that need to be resolved. I'm not sure how to resolve them because I'm not sure what the correct version of Cargo.lock is?

@jdm
Copy link
Member

jdm commented Apr 30, 2019

@PurpleHairEngineer I recommend performing a rebase, and when it encounters the merge conflict with Cargo.lock then run git rebase --skip, and once the rebase is complete then run the cargo update command that @ferjm mentioned. This will mean that the Cargo.lock will be in a pristine state, and then the update will be applied on top of it.

@PurpleHairEngineer
Copy link
Contributor Author

PurpleHairEngineer commented Apr 30, 2019

@jdm I ran git rebase -i origin/master and closed the text editor without changing anything. I got the message Successfully rebased and updated refs/heads/OscillatorNodeType. It did not encounter the merge conflict. Did I enter the wrong command?

@ferjm
Copy link
Member

ferjm commented Apr 30, 2019

@PurpleHairEngineer did you fetch upstream before rebasing?

git fetch upstream
git rebase upstream/master
(once the Cargo.lock conflict appears) git rebase --skip

These commands assume that you have a remote named upstream. To check if you have an upstream remote, run git remote -v, you should see something like upstream git@github.com:servo/servo.git (fetch). If you don't have it, you can run git remote add upstream git@github.com:servo/servo.git. And then run the fetch and rebase commands above.

In any case, I recommend waiting for #23294 to be merged, as updating servo-media before that one will throw additional build errors.

@ferjm
Copy link
Member

ferjm commented May 15, 2019

@PurpleHairEngineer #23294 was already merged, so this PR should be ready for merge after rebasing. Let me know if you need any help with the rebase or if you want me to do it? Thanks.

@ferjm
Copy link
Member

ferjm commented May 21, 2019

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request May 21, 2019
Implemented type attribute for OscillatorNode interface

<!-- Please describe your changes on the following line: -->

Please see servo/media#242 for implementation of the new oscillator node message.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

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

bors-servo commented May 21, 2019

Trying commit 969d61a with merge 9c4e301...

@ferjm
Copy link
Member

ferjm commented May 21, 2019

I went ahead and rebased and squashed the commits

@bors-servo
Copy link
Contributor

bors-servo commented May 21, 2019

💔 Test failed - linux-rel-wpt

@CYBAI
Copy link
Collaborator

CYBAI commented May 22, 2019

{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "OscillatorNode interface: attribute type", 
    "test": "/webaudio/idlharness.https.window.html", 
    "line": 160167, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "OscillatorNode interface: new OscillatorNode(context) must inherit property \"type\" with the proper type", 
    "test": "/webaudio/idlharness.https.window.html", 
    "line": 160173, 
    "action": "test_result", 
    "expected": "FAIL"
}
@ferjm
Copy link
Member

ferjm commented May 22, 2019

@bors-servo
Copy link
Contributor

bors-servo commented May 22, 2019

📌 Commit f8bcdde has been approved by ferjm

@bors-servo
Copy link
Contributor

bors-servo commented May 22, 2019

Testing commit f8bcdde with merge 1cbb04c...

bors-servo added a commit that referenced this pull request May 22, 2019
Implemented type attribute for OscillatorNode interface

<!-- Please describe your changes on the following line: -->

Please see servo/media#242 for implementation of the new oscillator node message.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

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

bors-servo commented May 22, 2019

☀️ Test successful - arm64, linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: ferjm
Pushing 1cbb04c to master...

@bors-servo bors-servo merged commit f8bcdde into servo:master May 22, 2019
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
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

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