Commit graph

19 commits

Author SHA1 Message Date
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use cfg(crown) instead of a cargo feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-10 08:19:19 +00:00
Samson
6c2b840e37
Support associated types in must_root lint (#34163)
* Support associated types in must_root lint

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fix

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix crown violations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fix eng

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* make new test use RUSTC_BOOTSTRAP=1

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-06 18:48:57 +00:00
chickenleaf
bc84dfbae5
Fix: Add missing transmute annotations in Castable trait (#33729)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-08 16:37:05 +00:00
tanishka
38c5ebbf8e
clippy: Fix warning in components/script/dom (#33685)
* clippy: Fix warnings in components/script/dom

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Remove unused default() method

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-10-08 10:38:07 +00:00
Samson
88d8770214
Use global exports from derives (#33169)
* pub reexport *Traceable

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport `HasParent` for derives

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport DomObject, Reflector, MutDomObject

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fmt

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-25 13:58:09 +00:00
Josh Matthews
b182bdfa52
Fix crash when closing window containing video element (#31413)
* Forbid casting DOM objects when JS runtime is shutting down.

* Remove media controls from document when element is removed from the tree.
2024-02-23 12:18:49 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
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
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Ms2ger
0c61be7a57 Rustfmt some of script. 2015-11-18 11:14:05 +01:00
rohan.prinja
34b71e55f5 remove unneeded import + reexport InheritTypes from inheritance 2015-10-30 20:26:30 +09:00
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
rohan.prinja
bb2536cd01 move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00