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 [Unforgeable] #7988
Implement [Unforgeable] #7988
Conversation
☔ The latest upstream changes (presumably #7727) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #8089) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #8196) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @Ms2ger |
This matches up well with Gecko's implementation. I'm happy with it! Reviewed 9 of 9 files at r1. components/script/dom/bindings/codegen/CodegenRust.py, line 2214 [r1] (raw file): Comments from the review on Reviewable.io |
That being said, I'd like to have a test for overwriting an unforgeable property as well as unforgeable properties on proxies. |
Here's one from gecko we can steal: http://mxr.mozilla.org/mozilla-central/source/dom/bindings/test/test_unforgeablesonexpando.html?force=1 |
I added a test. The failing one is unrelated to unforgeable attributes but I included it nonetheless. -S-needs-rebase Review status: 2 of 9 files reviewed at latest revision, 1 unresolved discussion. components/script/dom/bindings/codegen/CodegenRust.py, line 2214 [r1] (raw file): Comments from the review on Reviewable.io |
I amended the patch with the test expectations. |
This can merge with the requested comment addition. Reviewed 8 of 8 files at r3. components/script/dom/bindings/codegen/CodegenRust.py, line 4706 [r3] (raw file): Comments from the review on Reviewable.io |
This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in servo#5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. Given the unforgeable holder object has the same prototype as actual instances of the interface, the finalize hook needs to check its slot pointer for nullity before dropping it. The new failing test isn't related to Unforgeable attributes, but to the fact that all Document instances currently have a Location, even if their window isn't in a browsing context.
Comment added. @bors-servo r=jdm |
📌 Commit 6097640 has been approved by |
Implement [Unforgeable] This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7988) <!-- Reviewable:end -->
💔 Test failed - mac-rel-wpt |
|
Implement [Unforgeable] This is mostly stolen from Gecko. As there, we define the unforgeable members on an object stored in the slots of the prototype object. They are then copied onto instance objects when they are instantiated. It should be noted that proxy objects see their unforgeable memebers defined on their expando object. Unforgeable attributes aren't properly inherited in codegen (in a similar fashion as getters and setters as filed in #5875) and require to be redefined in derived interfaces. Fortunately, there are currently no such interfaces. No unforgeable members can be included into the TestBinding interfaces for good measure because they are not compatible with setters. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7988) <!-- Reviewable:end -->
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
This is mostly stolen from Gecko. As there, we define the unforgeable members
on an object stored in the slots of the prototype object. They are then copied
onto instance objects when they are instantiated. It should be noted that
proxy objects see their unforgeable memebers defined on their expando object.
Unforgeable attributes aren't properly inherited in codegen (in a similar
fashion as getters and setters as filed in #5875) and require to be redefined
in derived interfaces. Fortunately, there are currently no such interfaces.
No unforgeable members can be included into the TestBinding interfaces for good
measure because they are not compatible with setters.