aboutsummaryrefslogtreecommitdiffstats
path: root/components/dom_struct/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* script: Feature-gate all crown support. (#35055)Josh Matthews2025-01-181-1/+1
| | | | | | | | | | | | | * 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>
* Use global exports from derives (#33169)Samson2024-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* clippy: fix warnings in various modules in components (#31568)eri2024-03-081-2/+2
| | | | | | | | | * clippy: fix warnings in various modules in components * fix: unit tests * fix: build on android * fix: all samplers use new_boxed
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* remove `extern crate` (#30311)Samson2023-09-081-1/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Upgrade remaining components to edition 2018sagudev2023-02-181-5/+1
|
* Use `#![register_tool]` instead of `#![register_attr]`Simon Sapin2019-11-151-1/+1
| | | | CC https://github.com/rust-lang/rust/issues/66079
* Remove redundant webidl_must_inherit compiler plugin lintSimon Sapin2019-09-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | At first I was considering moving it to a procedural macro (source-level information should be sufficient), and started by trying to reproduce the error case by changing `htmldivelement.rs` to use `Element` instead of `HTMLElement` as the first field. The output was: ```rust error[E0308]: mismatched types --> /home/simon/servo2/target/debug/build/script-4caa244faca7d10f/out/Bindings/HTMLDivElementBinding.rs:665:31 | 665 | let _: &HTMLElement = self.as_parent(); | ^^^^^^^^^^^^^^^^ expected struct `dom::htmlelement::HTMLElement`, found struct `dom::element::Element` | = note: expected type `&dom::htmlelement::HTMLElement` found type `&dom::element::Element` ``` This line number is inside a generated method called `__assert_parent_type`. As far as I can tell, any case where this lint would error is already caught by such methods. The lint is therefore redundant and can safely be removed.
* Bump all in-tree components to syn 1Anthony Ramine2019-09-271-5/+1
|
* Can collect webidl paths.krk2019-04-201-0/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-1/+0
|
* Format remaining filesPyfisch2018-11-061-1/+2
|
* Use 2018-style paths in code generated by proc-macro derivesSimon Sapin2018-11-061-1/+1
|
* Format components dom_struct, domobject_derive and embedder_traits #21373kingdido9992018-09-031-2/+5
|
* Upgrade to rustc 1.29.0-nightly (1ecf6929d 2018-07-16)Simon Sapin2018-07-181-3/+0
|
* Assert that DOM structs have the correct first fieldManish Goregaokar2018-07-031-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(); } } ````
* Upgrade to rustc 1.28.0-nightly (524ad9b9e 2018-05-29)Anthony Ramine2018-05-301-0/+1
| | | | Fixes https://github.com/servo/servo/issues/20844
* Revert "Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)"Josh Matthews2018-05-181-1/+1
| | | | This reverts commit 46ad8110172cfc9d8d420e8eb41863f3d394e24d.
* Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)Simon Sapin2018-05-041-1/+1
|
* Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07)Simon Sapin2018-04-091-3/+2
|
* Upgrade to rustc 1.24.0-nightly (5a2465e2b 2017-12-06)Simon Sapin2017-12-071-0/+4
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Use the better TokenStream API in dom_structAnthony Ramine2017-09-011-10/+5
| | | | | | | | | | | | | | | | | | | | | | Before: ``` error[E0412]: cannot find type `SourceBuffer` in this scope --> /Users/nox/src/servo/components/script/dom/mediasource.rs:25:1 | 25 | #[dom_struct] | ^^^^^^^^^^^^^ did you mean `SourceBufferList`? ``` After: ``` error[E0412]: cannot find type `SourceBuffer` in this scope --> /Users/nox/src/servo/components/script/dom/mediasource.rs:28:39 | 28 | source_buffers: DOMRefCell<Vec<JS<SourceBuffer>>>, | ^^^^^^^^^^^^ did you mean `SourceBufferList`? ```
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+28