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 StyleSheet.ownerNode #23082

Open
CYBAI opened this issue Mar 23, 2019 · 5 comments
Open

Implement StyleSheet.ownerNode #23082

CYBAI opened this issue Mar 23, 2019 · 5 comments
Labels

Comments

@CYBAI
Copy link
Collaborator

@CYBAI CYBAI commented Mar 23, 2019

As @emilio mentioned in #23073 (review) , we don't support ownerNode yet.

Spec: https://drafts.csswg.org/cssom/#dom-stylesheet-ownernode

// readonly attribute (Element or ProcessingInstruction)? ownerNode;

We need to uncomment it and implement it in components/script/dom/stylesheet.rs (basically just need to reuse the method added in #23073 ).

(But somehow I'm confused that the spec said it's an Element or ProcessingInstruction but we only have Element in CSSStyleSheet. Maybe we can only always return an Element for now? 🤔)

@CYBAI CYBAI added the A-content/css label Mar 23, 2019
@CYBAI
Copy link
Collaborator Author

@CYBAI CYBAI commented Mar 23, 2019

@sbansal3096 maybe you'd be interested in this one?

@sbansal3096
Copy link
Contributor

@sbansal3096 sbansal3096 commented Mar 23, 2019

Yeah, sure. I am.willing to give it a shot.

@CYBAI CYBAI added the C-assigned label Mar 23, 2019
@sbansal3096
Copy link
Contributor

@sbansal3096 sbansal3096 commented Mar 23, 2019

@CYBAI Do I have to implement the new ownerNode function in the same fashion that is been used for other properties like title? If so, then where should I use the new function that I created in my last pull request?

fn GetTitle(&self) -> Option<DOMString> {

@CYBAI
Copy link
Collaborator Author

@CYBAI CYBAI commented Mar 24, 2019

@sbansal3096 Yes. When you uncomment the property in WebIDL, compiler will give you the hint ;) In this case, you'll need to implement GetOwnerNode for StyleSheetMethods. Then, you can reuse the method you created in last PR in the GetOwnerNode.

If my explanation is not clear, feel free to let me know :)

@sbansal3096 sbansal3096 mentioned this issue Mar 25, 2019
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Mar 25, 2019
implement stylesheet.ownerNode

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

Implemented GetOwnerNode for StyleSheetMethods by using get_owner method

---
<!-- 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
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #23082

<!-- 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/23096)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 7, 2019
implement stylesheet.ownerNode

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

Implemented GetOwnerNode for StyleSheetMethods by using get_owner method

---
<!-- 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
- [ ] These changes fix #23082

<!-- 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/23096)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 9, 2019
implement stylesheet.ownerNode

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

Implemented GetOwnerNode for StyleSheetMethods by using get_owner method

---
<!-- 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 #23082
- [x] There are tests for these changes that will be a new test for nullable owner.

<!-- 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/23096)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 9, 2019
implement stylesheet.ownerNode

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

Implemented GetOwnerNode for StyleSheetMethods by using get_owner method

---
<!-- 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 #23082
- [x] There are tests for these changes that will be a new test for nullable owner.

<!-- 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/23096)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 11, 2019
implement stylesheet.ownerNode

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

Implemented GetOwnerNode for StyleSheetMethods by using get_owner method

---
<!-- 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 #23082
- [x] There are tests for these changes that will be a new test for nullable owner.

<!-- 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/23096)
<!-- Reviewable:end -->
@CYBAI
Copy link
Collaborator Author

@CYBAI CYBAI commented Jul 16, 2019

The work in #23096 is almost there and only need to address @emilio 's suggestions in #23096 (comment) and #23096 (comment).

@sbansal3096 Feel free to reopen and finish that PR if this is not fixed when you have time!

@CYBAI CYBAI removed the C-assigned label Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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