Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove the `wrap_fn` argument from `reflect_dom_object`. #8576
Comments
|
This obviously exclude global interfaces, which don't have the same wrap signature. Maybe we should also have a reflect_dom_global function with that other wrap? |
|
Orthogonal to this issue, but that sounds like something we could do, yes. |
|
@jdm hi can i try this issue? |
|
@kjhyung Of course! Ask questions about anything that's unclear! |
|
@kjhyung Have you made any progress on this task? |
|
@jdm May I have a try on this if no one is working on it now? |
|
@lyuyuan Sure! I think the easiest way to proceed is to:
Does that make sense? |
|
@jdm Sounds good! Thanks for the tip! |
|
@jdm It seems that |
|
I think we can get away with a different solution: trait DomObjectWrap {
const WRAP: ...
}And edit https://github.com/servo/servo/blob/master/components/dom_struct/lib.rs#L42-L53 to implement the DomObjectWrap trait, and make reflect_dom_object take |
Add trait DomObjectWrap to provide WRAP function <!-- Please describe your changes on the following line: --> --- <!-- 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 #8576 (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. -->
Add trait DomObjectWrap to provide WRAP function <!-- Please describe your changes on the following line: --> --- <!-- 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 #8576 (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. -->
Add trait DomObjectWrap to provide WRAP function <!-- Please describe your changes on the following line: --> --- <!-- 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 #8576 (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. -->
Add trait DomObjectWrap to provide WRAP function <!-- Please describe your changes on the following line: --> --- <!-- 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 #8576 (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. -->
It should be possible to derive it from the type. Maybe
FooBinding::Wrapshould be<Foo as ConcreteDOMObject>::wrap? (Name of the trait up for bikeshedding.)