servo/components/script/dom/bindings
Manish Goregaokar ad198993b1 Assert that DOM structs have the correct first field
DOM structs embed their parent type as their first field. This
introduces a `.parent()` method to the DOM struct that returns its first
field, and codegens a type assert that ensures that `.parent()` returns
the parent struct.

This generates:

On `#[dom_struct]`:

```rust
impl HasParent for Type {
    type Parent = ParentType;
    fn as_parent(&self) -> ParentType {
        &self.first_field
    }
}
```

In the codegen files:

```rust
impl Type {
    fn __assert_parent_type(&self) {
        let _: &ParentType = self.as_parent();
    }
}
````
2018-07-03 09:39:29 -07:00
..
codegen Assert that DOM structs have the correct first field 2018-07-03 09:39:29 -07:00
callback.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
cell.rs Make JSTraceable for DomRefCell<T> panic if cell is mutably borrowed (see #19871) 2018-01-26 10:12:40 +01:00
constant.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
conversions.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
error.rs Implement read methods on FileReaderSync 2018-06-04 15:53:08 -04:00
guard.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
htmlconstructor.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
inheritance.rs Assert that DOM structs have the correct first field 2018-07-03 09:39:29 -07:00
interface.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
iterable.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
mod.rs Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject> 2018-01-22 17:41:25 +01:00
mozmap.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
namespace.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
num.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
proxyhandler.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
refcounted.rs Use specific assertion for DOM binding refcounted 2018-01-26 01:18:55 +08:00
reflector.rs Updated to mozjs v0.7.1. 2018-05-30 14:44:47 -05:00
root.rs Replace NonZero<*{const,mut} _> with std::ptr::NonNull 2018-01-22 17:41:25 +01:00
settings_stack.rs Add a check for when the js execution stack is empty 2018-01-11 11:14:10 -05:00
str.rs Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
structuredclone.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
trace.rs Updated to mozjs v0.7.1. 2018-05-30 14:44:47 -05:00
utils.rs Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
weakref.rs Replace NonZero<*{const,mut} _> with std::ptr::NonNull 2018-01-22 17:41:25 +01:00
xmlname.rs Untry script 2017-06-18 13:21:49 +02:00