Files
servo/components
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
..
2018-06-20 09:15:31 +10:00
2018-04-25 10:25:21 +02:00
2018-04-25 10:25:21 +02:00
2017-12-05 12:03:20 +01:00
2018-03-16 14:34:29 +08:00
2018-06-20 09:15:31 +10:00
2018-02-06 15:10:35 +01:00
2018-03-21 13:05:47 +01:00
2018-04-25 10:25:21 +02:00
2018-06-23 20:34:10 +02:00
2018-04-25 10:25:21 +02:00
2018-04-11 21:29:03 +01:00
2018-06-12 12:15:16 -07:00
2018-06-23 20:34:10 +02:00
2018-04-19 17:01:14 +02:00
2018-03-21 13:05:47 +01:00