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 [Unforgeable] #7988

Merged
merged 1 commit into from Dec 3, 2015
Merged

Implement [Unforgeable] #7988

merged 1 commit into from Dec 3, 2015

Conversation

nox
Copy link
Contributor

@nox nox commented Oct 13, 2015

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.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 13, 2015
@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@nox nox added A-content/dom Interacting with the DOM from web content A-content/bindings The DOM bindings labels Oct 13, 2015
@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #7727) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 14, 2015
@nox nox removed the S-needs-rebase There are merge conflict errors. label Oct 15, 2015
@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #8089) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 20, 2015
@nox nox removed the S-needs-rebase There are merge conflict errors. label Oct 20, 2015
@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #8196) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 25, 2015
@metajack
Copy link
Contributor

metajack commented Nov 3, 2015

r? @Ms2ger

@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 11, 2015
@jdm jdm assigned jdm and unassigned Ms2ger Nov 11, 2015
@jdm
Copy link
Member

jdm commented Nov 11, 2015

This matches up well with Gecko's implementation. I'm happy with it!
-S-awaiting-review +@jdm


Reviewed 9 of 9 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


components/script/dom/bindings/codegen/CodegenRust.py, line 2214 [r1] (raw file):
These functions return Result, so we need to check them. Gecko passes in a failureCode argument; we might be able to just assert that it's Ok.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Nov 11, 2015

That being said, I'd like to have a test for overwriting an unforgeable property as well as unforgeable properties on proxies.

@jdm
Copy link
Member

jdm commented Nov 11, 2015

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 12, 2015
@nox
Copy link
Contributor Author

nox commented Nov 12, 2015

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):
Done.


Comments from the review on Reviewable.io

@nox nox removed the S-needs-rebase There are merge conflict errors. label Nov 12, 2015
@highfive highfive removed the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label Dec 1, 2015
@nox
Copy link
Contributor Author

nox commented Dec 1, 2015

I amended the patch with the test expectations.

@jdm
Copy link
Member

jdm commented Dec 2, 2015

This can merge with the requested comment addition.
-S-awaiting-review +S-needs-code-changes


Reviewed 8 of 8 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/bindings/codegen/CodegenRust.py, line 4706 [r3] (raw file):
Let's add a comment explaining why this is necessary.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 2, 2015
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.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Dec 2, 2015
@nox
Copy link
Contributor Author

nox commented Dec 2, 2015

Comment added.

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

📌 Commit 6097640 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 2, 2015
@bors-servo
Copy link
Contributor

⌛ Testing commit 6097640 with merge b371f23...

bors-servo pushed a commit that referenced this pull request Dec 3, 2015
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 -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 3, 2015
@KiChjang
Copy link
Contributor

KiChjang commented Dec 3, 2015

Ran 3717 tests finished in 870.0 seconds.
  • 3716 ran as expected. 710 tests skipped.
  • 1 tests timed out unexpectedly

Tests with unexpected results:
  ▶ TIMEOUT [expected PASS] /_mozilla/css/iframe/hide_layers2.html
  │ 
  │ thread 'Constellation' panicked at 'unable to find pipeline - this is a bug', ../src/libcore/option.rs:335
  │ stack backtrace:
  │    1:        0x107c70d08 - sys::backtrace::tracing::imp::write::h3ed615ef3cda9b6b7It
  │    2:        0x107c72e4f - panicking::log_panic::_<closure>::closure.40650
  │    3:        0x107c728f2 - panicking::log_panic::hdfd4a4ec7b55d6a5MAx
  │    4:        0x107c5dde6 - sys_common::unwind::begin_unwind_inner::h2f70decd24e7a2917Ls
  │    5:        0x107c5e1ce - sys_common::unwind::begin_unwind_fmt::h29da0d611b24747ddLs
  │    6:        0x107c70327 - rust_begin_unwind
  │    7:        0x107c95430 - panicking::panic_fmt::h2f3428e3725b99d6VFK
  │    8:        0x10669962d - constellation::_<impl>::handle_request::handle_request::h14084396330141331367
  │    9:        0x10667eaa7 - sys_common::unwind::try::try_fn::try_fn::h5790274250769403721
  │   10:        0x107c70148 - __rust_try
  │   11:        0x107c6d24e - sys_common::unwind::try::inner_try::hd7e4f8fc422767d2FIs
  │   12:        0x106680b6a - boxed::_<impl>::call_box::call_box::h8113799359328547308
  │   13:        0x107c720dd - sys::thread::_<impl>::new::thread_start::ha2c46efb1706c462jVw
  │   14:     0x7fff91449059 - _pthread_body

@KiChjang
Copy link
Contributor

KiChjang commented Dec 3, 2015

@bors-servo
Copy link
Contributor

⌛ Testing commit 6097640 with merge 20df7fb...

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Dec 3, 2015
bors-servo pushed a commit that referenced this pull request Dec 3, 2015
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 -->
@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 3, 2015
@bors-servo
Copy link
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo bors-servo merged commit 6097640 into servo:master Dec 3, 2015
@nox nox deleted the unforgeable branch December 15, 2015 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/bindings The DOM bindings A-content/dom Interacting with the DOM from web content S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants