aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_module.rs
Commit message (Collapse)AuthorAgeFilesLines
* Mark promise creation methods with CanGc (#33928)Josh Matthews2024-10-221-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. 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>
* fix clippy warning in components/script (#33878)lwz232024-10-171-1/+1
| | | Signed-off-by: lwz23 <wenzhaoliao@ruc.edu.cn>
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-161-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FetchThread` (#33863) Instead of creating a `ROUTER` for each fetch, create a fetch thread which handles all incoming and outcoming fetch requests. Now messages involving fetches carry a "request id" which indicates which fetch is being addressed by the message. This greatly reduces the number of file descriptors used by fetch. In addition, the interface for kicking off fetches is simplified when using the `Listener` with `Document`s and the `GlobalScope`. This does not fix all leaked file descriptors / mach ports, but greatly eliminates the number used. Now tests can be run without limiting procesess on modern macOS systems. Followup work: 1. There are more instances where fetch is done using the old method. Some of these require more changes in order to be converted to the `FetchThread` approach. 2. Eliminate usage of IPC channels when doing redirects. 3. Also eliminate the IPC channel used for cancel handling. 4. This change opens up the possiblity of controlling the priority of fetch requests. Fixes #29834. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Rename various methods and members to conform to naming guidelines ↵Martin Robinson2024-10-101-3/+3
| | | | | | | | | (#33762) This ensure that methods named `new()` do not take `&self` or return `Box<Self>`. In addition, method are renamed (or removed when not necessary) to avoid being prefixed with `from_`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Various CanGc fixes in components/script/dom (#33706)webbeef2024-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * Propagate 'can_gc' in IFrame DOM code Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in HTML video and image elements Signed-off-by: webbeef <me@webbeef.org> * Propagate 'can_gc' in Blob and dependencies Signed-off-by: webbeef <me@webbeef.org> * Leftover can_gc fixes for HTMLMediaElement Signed-off-by: webbeef <me@webbeef.org> * Address comment Signed-off-by: webbeef <me@webbeef.org> --------- Signed-off-by: webbeef <me@webbeef.org>
* Create HttpStatus to safely deal with HTTP responses status. (#33581)webbeef2024-09-291-16/+18
| | | Signed-off-by: webbeef <me@webbeef.org>
* Propagate `CanGc` from `Document::new()` (#33386)Andriy Sultanov2024-09-091-2/+2
| | | | | | | | | | | | | * Add canGc as a parameter to autogenerated trait methods Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> * Propagate CanGc from Document::new() Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> --------- Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
* jsstring_to_str should accept a NonNull argument for the JS string (#33306)Andriy Sultanov2024-09-051-1/+1
| | | | | | Instead of asserting the raw pointer is not null, force callers to produce a NonNull pointer. Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
* script: Use the new C string literal in the DOM bindings (#32741)Bumsoo Kim2024-07-111-1/+1
| | | | | | | | | | | | | | | | | * simple conversion to cstrings using as_ptr() Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> * replaced byte strings with c strings using new helper functions Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> * changed &[u8] type parameters to &CStr Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> --------- Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
* Fix more clippy (#32740)石蕊 (Pi-Cla)2024-07-091-3/+3
|
* Avoid unnecessary clones for URLs (#32694)cybai (Haku)2024-07-081-25/+27
|
* Fixed some clippy warnings in components (#32025)komuhangi2024-04-101-1/+1
| | | | | * Fixed some clippy warnings in components * Updated the simplification of bolean expressions in componets/script/dom/range.rs
* clippy: Allow `too_many_arguments` for all functions (#31962)komuhangi2024-04-011-0/+1
| | | | | This is the start of preventing this in the future. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: fixed various clippy warnings in `components/scripts` (#31960)Rosemary Ajayi2024-04-011-1/+1
| | | | | | | | | * fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix a few problems in `components/scripts` (#31959)Rosemary Ajayi2024-04-011-1/+1
| | | | | * fixed various clippy warnings * fixed various clippy warnings
* clippy: Fix len_zero warnings (#31935)Oluwatobi Sofela2024-03-291-2/+2
|
* fix: omitted the `let` bindings (#31908)Azhar Ismagulova2024-03-271-1/+1
|
* fixes dereferencing on an immutable reference (#31864)Aarya Khandelwal2024-03-261-1/+1
|
* clippy: Fix `explicit_auto_deref` warnings in `components/script` (#31837)Oluwatobi Sofela2024-03-231-5/+5
| | | | | | | | | * clippy: Fix explicit auto-deref warnings * clippy: Fix explicit auto-deref warnings * refactor: Tidy up code * refactor: Fix method not found errors
* clippy: Fix `unnecessary_cast` warnings in `components/script` (#31823)Oluwatobi Sofela2024-03-221-1/+1
| | | | | | | * clippy: Fix unnecessary cast warnings * clippy: Replace redundant field names with their shorthand alternatives * clippy: Delete struct pattern dereferencings
* Fixed the .clone() warnings. (#31819)Aarya Khandelwal2024-03-221-12/+10
|
* clippy: Fix unneeded return statement warnings (#31776)Oluwatobi Sofela2024-03-201-1/+1
|
* clippy: Fix dereferenced warnings (#31770)Oluwatobi Sofela2024-03-201-2/+2
|
* clippy: Fix many warnings in `components/script` (#31717)Richard Dushime2024-03-191-18/+17
| | | | | | | | | | | | | | | | | * Fix Several clippy warnings * Fix Build errors * Fix Unused import * Fix requested changes * Fix rustfmt * Minor fixes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Remove deprecated remove function (#31213)Taym Haddadi2024-01-301-1/+3
|
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-13/+13
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Use Foo_Binding instead of FooBinding for namespace modules (#30447)Samson2023-09-301-1/+1
| | | | | * Update Codegen.py to emit Foo_Binding instead of FooBinding * s/FooBinding/Foo_Binding/g
* Update mozjs to a version that includes SpiderMonkey ESR 115 (#30379)Samson2023-09-201-34/+10
| | | | | | | | | | | | | | | * Update mozjs to sm115 * fix module stuff https://phabricator.services.mozilla.com/D163949 * fix always allow cloning https://bugzilla.mozilla.org/show_bug.cgi?id=1774866 * Update expectations toStringTag now works on wasm object due to SM bump
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-49/+46
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+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 mozjs tracing infrastructure (#29918)Samson2023-08-101-0/+1
| | | | | | | * Update mozjs https://github.com/servo/mozjs/commit/64711ec2e6dc4595df691bffc7f1e5052ab86c8d also fixes https://github.com/servo/servo/issues/30043 * Move to mozjs Traceable and introduce CustomTraceable
* No tracing of nop traceable fields (#29926)Samson2023-08-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix formatting.Josh Matthews2023-05-201-10/+3
|
* Remove global argument from Promise::new_in_current_realm.Josh Matthews2023-05-201-2/+2
|
* Make GlobalScope.get_cx a static method.Josh Matthews2023-05-201-30/+33
|
* Format.Josh Matthews2022-11-231-10/+13
|
* Trigger new module error reporting behaviour.Josh Matthews2022-11-231-27/+32
|
* Changes for spidermomkey upgrade.Josh Matthews2022-11-231-23/+31
|
* Don't hardcode string types.Josh Matthews2021-05-141-2/+2
|
* fmtsagudev2021-03-131-1/+1
|
* Fix ModuleEvaluatesagudev2021-03-131-2/+3
|
* Formatingsagudev2021-03-121-1/+1
|
* Fix errorssagudev2021-03-121-4/+4
|
* Update mozjs.Josh Matthews2021-02-181-11/+23
|
* ran mach tidySudarsan2020-08-281-1/+0
|
* Update mozjs to 0.14.1Sudarsan2020-08-281-3/+1
| | | | | | | This update pulls in improvements on mozjs that now removes the need to pass pointers to CompileOptionsWraper::new(), allows NewProxyObject to now accept a Singleton bool and JSClass and removes an unsafe Handle::new usage.
* Removed unnecessary conversion from UTF-8 to UTF-16Arjun Ramachandrula2020-07-271-6/+4
|
* Auto merge of #27026 - CYBAI:dynamic-module, r=jdmbors-servo2020-07-191-54/+458
|\ | | | | | | | | | | | | | | | | | | Introduce dynamic module --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25439 - [x] There are tests for these changes
| * Handle script private reference hooks properlyCYBAI2020-07-181-3/+21
| |