aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Implement `DataTransfer` and related interfaces (#34205)Gae242024-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add datatransfer interfaces Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * implement DataTransfer interface implemented Constructor, setter and getter for drop_effect and effect_allowed, Items and SetDragImage Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * implement DataTransferItem interface Implemented Kind, Type, GetAsString, GetAsFile. Marked DataTransfer as weakReferenceable to access its field inside DataTransferItemList and DataTransferItem. Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * implement DataTransferItemList interface implemented Lenght, Getter, Add, Remove, Clear Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * added DataTransfer's old interface Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * DataTransfer: implemented GetData, SetData, SetData Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * set Weakref to DataTransfer in DataTransferItemList and DataTransferItem Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * DataTransfer: implemented Types and Files Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * cleanup get_data, set_data, clear_data Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix clippy warning Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add drag data store Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix DataTransfer's Types() behaviour Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * DataTransferItem: use the underlying drag data store Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix DataTransferItemList's getter and remove Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix clippy warnings Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * update test expectations Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-0/+2
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Support persisting unminified external stylesheets (#33919)Taym Haddadi2024-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * Support local tweaking of external stylesheets Signed-off-by: Taym <haddadi.taym@gmail.com> * Remove duplicated code between unminify_css and unminify_js Signed-off-by: Taym <haddadi.taym@gmail.com> * Add License Signed-off-by: Taym <haddadi.taym@gmail.com> * Use js-beautify instead of npx Signed-off-by: Taym <haddadi.taym@gmail.com> * Fix clippy warning Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* Properly track `rel` keywords for `<a>`/`<area>`/`<form>` elements (#33462)Simon Wülker2024-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Use linkrelations for all linkable elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Document LinkRelations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Rename linkrelations.rs -> links.rs This module is supposed to include general-purpose link related stuff. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Parse all "rel" keywords Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Initial support for `<link rel="prefetch">` (#33345)Simon Wülker2024-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Properly store link relations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Send fetch request for prefetch links We don't actually *do* anything with the response yet (handle errors etc) but its a first step. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fire load/error events for prefetch loads Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set prefetch destination/cors setting correctly Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix ./mach test-tidy errors Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set correct "Accept" value for prefetch requests Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec text to individual steps Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Use global exports from derives (#33169)Samson2024-08-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* enhance: Add support for `unsafe-eval` and `wasm-unsafe-eval` (#32893)Chocolate Pie2024-08-011-0/+2
| | | Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
* Fix more clippy (#32740)石蕊 (Pi-Cla)2024-07-091-1/+1
|
* Address issues uncovered by rust-1.78 beta (#32130)Martin Robinson2024-04-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes changes to allow Servo to compile with the 1.78 version of Rust: - Dead code is removd (Rust seems to have gotten better at detecting it). - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice [^1]. - The `imports.rs` now explicitly silences warnings about unused imports. [^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* crown: Do not warn about crown for rustdoc or clippy (#31805)Martin Robinson2024-03-211-2/+4
| | | Fixes #31804.
* Compile Servo with the latest version of rust stable (#30831)Martin Robinson2023-12-061-2/+0
| | | | | | | | | | | | | | | | This completes the transition to compiling Servo with rust stable. Some nightly-only features are still used when compiling the `script` and `crown` crates, as well as for some style unit tests. These will likely break with newer compiler versions, but `crown` can be disabled for them conditionally. This is just the first step. This has some caveats: 1. We need to disable setting up the special linker on Linux. The -Z option isn't supported with stable rust so using this is out -- meanwhile we can't be sure that lld is installed on most systems. 2. `cargo fmt` still uses some unstable options, so we need to rely on the unstable toolchain just for running `fmt`. The idea is to fix this gradually.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 usage of `drain_filter` (#30742)Martin Robinson2023-11-171-1/+0
| | | This is a step on the way toward supporting stable rust.
* Remove Servo `window.trap()` extension (#30743)Martin Robinson2023-11-171-1/+0
| | | | | This Servo-specific extension is unused by any code in the repository and removing it allows us to remove use of nightly only reliance on rust intrinsics. This is a step toward supporting stable rust.
* remove `extern crate` (#30311)Samson2023-09-081-22/+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>
* Use std::cell::OnceCell and remove mitochondria dependency (#30207)Martin Robinson2023-08-251-0/+1
| | | | | `OnceCell` is now part of the standard library and we'll be able to use it once we upgrade rust. For now we can use the version that's shipped behind a feature flag in rust. This removes a dependency on one crate.
* No tracing of nop traceable fields (#29926)Samson2023-08-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add `no_trace` option to JSTraceable derive * NoTrace wrapper * Port some types to no_trace schematics * Fixing my unsafe mistakes (not tracing traceables) * Add docs & safety guards for no_trace Safety guards (trait shenanigans) guarantees safety usage of `no_trace` * Port canvas_traits to no_trace * Port servo_media to no_trace * Port net_traits to no_trace * Port style to no_trace * Port webgpu to no_trace * Port script_traits to no_trace * Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace * unrooted_must_root lint in seperate file * Add trace_in_no_trace_lint as script_plugin * Composable types in must_not_have_traceable * Introduced HashMapTracedValues wrapper * `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>` * Port rest of servo's types to no_trace * Port html5ever, euclid, mime and http to no_trace * Port remaining externals to no_trace * Port webxr and Arc<Mutex<_>> * Fix spelling in notrace doc
* Eliminate duplicate Layout DOM wrappersMartin Robinson2023-05-051-20/+2
| | | | | | | | | | There are duplicate sets of Layout DOM wrappers: one for Layout 2013 and one for Layout 2020. As part of cleaning up and simplifying the wrappers, this change parameterizes them on the specific layout data they contain. This allows them to be shared again. In addition, various small cleanups are included. Fixes #29691.
* apply pylbrecht/servo/named.window.getter (closes #27952)Delan Azabani2023-03-231-0/+2
|
* Fix warnings.Josh Matthews2022-04-011-2/+0
|
* Fix three trivial warnings.Dominic Cooney2021-05-231-1/+0
| | | | Signed-off-by: Dominic Cooney <dominic.cooney@gmail.com>
* Update toolchain to nightly-2021-05-18Dominic Cooney2021-05-221-1/+1
| | | | | | | | | | | The nightly-2021-03-12 toolchain doesn't have RLS on Windows. This breaks code completion in Visual Studio Code because the rust plugin picks up the project toolchain. RLS is available in all tier one platforms in nightly-2021-05-18 per: https://rust-lang.github.io/rustup-components-history/ Signed-off-by: Dominic Cooney <dominic.cooney@gmail.com>
* Upgrade to rustc 1.52.0-nightly (a8486b64b 2021-02-24)Simon Sapin2021-02-251-0/+1
|
* Update mozjs.Josh Matthews2021-02-181-0/+1
|
* serviceworker: make job queue unique per originGregory Terzian2020-05-211-2/+0
|
* Move most animation processing to scriptMartin Robinson2020-05-121-0/+1
| | | | | | | This is preparation for sharing this code with layout_2020 and implementing selective off-the-main-thread animations. We still look for nodes not in the flow tree in the layout thread.
* Start having animations conform to the HTML specMartin Robinson2020-05-051-0/+1
| | | | | | | | | | | | | | This is a small step toward fixing #19242. The main idea is that the clock for animations should advance as the event loop ticks. We accomplish this by moving the clock from layout and naming it the "animation timeline" which is the spec language. This should fix flakiness with animations and transitions tests where a reflow could move animations forward while script was running. This change also starts to break out transition and animation events into their own data structure, because it's quite likely that the next step in fixing #19242 is to no longer send these events through a channel.
* Replace a `transmute` with `.to_ne_bytes()` + constructorSimon Sapin2020-04-151-1/+0
|
* Remove use of soon-to-be-deprecated unstable featureSimon Sapin2020-04-151-1/+0
| | | | https://github.com/rust-lang/rust/issues/47336#issuecomment-586589016
* Remove unused `#![feature(…)]` attributesSimon Sapin2020-04-151-1/+0
|
* allow for a service worker manager per originGregory Terzian2020-04-051-2/+2
|
* Merge RawLayoutElementHelpers into LayoutElementHelpersAnthony Ramine2020-03-311-1/+1
|
* Move PendingRestyle to the style_layout_interface crateAnthony Ramine2020-03-281-1/+1
|
* Update SpiderMonkeyAnthony Ramine2020-03-061-0/+1
|
* Introduce a new type MaybeUnreflectedDom<T> (fixes #25701)Anthony Ramine2020-02-171-0/+1
|
* rename compartment to realmKunal Mohan2020-01-241-2/+2
|
* Modify `script` to prevent further violations of snake_caseKunal Mohan2020-01-181-1/+0
|
* Scaffold module scriptCYBAI2020-01-031-0/+2
|
* script: Ensure JS engine is initialized and deinitialized on the same thread.Josh Matthews2019-11-261-0/+1
|
* Use `#![register_tool]` instead of `#![register_attr]`Simon Sapin2019-11-151-4/+2
| | | | CC https://github.com/rust-lang/rust/issues/66079
* Use `#![register_attr(…)]` instead of `Registry::register_attribute`Simon Sapin2019-11-151-0/+4
| | | | CC https://github.com/rust-lang/rust/pull/66344, https://github.com/rust-lang/rust/issues/66080
* Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensionsBailey Blankenship2019-11-101-0/+1
| | | | Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
* Remove use of on_unimplementedSimon Sapin2019-11-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | It errors in today’s Nightly: ```rust error[E0557]: feature has been removed --> components/script/lib.rs:9:12 | 9 | #![feature(on_unimplemented)] | ^^^^^^^^^^^^^^^^ feature has been removed error[E0658]: this is an internal attribute that will never be stable --> components/script/dom/bindings/conversions.rs:77:1 | 77 | #[rustc_on_unimplemented(message = "The IDL interface `{Self}` is not derived from `{T}`.")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/29642 = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable error: aborting due to 2 previous errors ```
* Upgrade to rustc 1.40.0-nightly (246be7e1a 2019-10-25)Simon Sapin2019-10-261-1/+31
|
* Move items at the root of the script crate to a moduleSimon Sapin2019-10-261-66/+3
|
* Moved CanvasState out of canvasrenderingcontextHanif Bin Ariffin2019-10-251-0/+1
| | | | | | | | | | | | | | | | | Cleaned up imports... Applied clang-tidy Moved CanvasState and some other files Next commit should remove pub modifier from members of CanvasState and use getters/setters instead. Members of CanvasState are now private and applied test-tidy Now have getters that return an immutable reference. Also, I have no idea what to name some_func.rs Removed need for some_func and made pub(crate)
* Remove uses of mem::uninitializedSimon Sapin2019-07-171-2/+4
|
* Upgrade to rustc 1.37.0-nightly (088b98730 2019-07-03)Josh Matthews2019-07-051-1/+0
|
* Remove `default-except-unstable`Simon Sapin2019-07-011-2/+2
| | | | | … and use remaining unstable features unconditionally. This doesn’t actually change the set of crates that can build on the Stable channel.
* Fix some new warningsSimon Sapin2019-06-221-1/+0
|