aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
Commit message (Collapse)AuthorAgeFilesLines
* clippy: Fix some warnings in `components/script/timers.rs` (#31878)komuhangi2024-03-271-5/+7
| | | | | | | | | | | * Fixed some clippy warnings in components/script/timers.rs * Formatted changes in components/script/timers.rs * Updated changes in components/script/timers.rs * Updated Default implementation of JsTimers in components/script/timers.rs * UPDATED DEFAULT METHOD IMPLEMENTATION OF JsTimers in components/script/timers.rs
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-7/+7
|
* clippy: Fix several warnings (#31710)RustAndMetal2024-03-181-3/+3
| | | Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
* script: Implement `<meta http-equiv="refresh">` (#31468)Smitty2024-03-011-0/+3
| | | | | * script: Implement <meta http-equiv="refresh"> * Address review comments
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-1/+1
| | | | 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.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-15/+18
| | | | | * 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>
* No tracing of nop traceable fields (#29926)Samson2023-08-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Make GlobalScope.get_cx a static method.Josh Matthews2023-05-201-1/+1
|
* Set private reference for classic scriptCYBAI2020-07-181-1/+8
| | | | | | | | | | | | Web developers can use `Dynamic Import` in a classic script; thus, we need to save the script's private reference so that we can reuse it when we're going to fetch a dynamic import module for a classic script. Besides, because it's possible to use different executing context for a dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test), we can't initialize a module owner at the timing of `SetScriptPrivate`; thus, if the private module script doesn't hold an owner, we'll use a DynamicImport owner for it.
* ensure clean shutdown of all threads running JSGregory Terzian2020-06-301-0/+7
|
* Propagate user interacting flag to timers and promisesPaul Rouget2020-03-261-1/+6
|
* impl timer-task-source, dedicated time-out mechanism for service-workerGregory Terzian2019-11-191-7/+18
|
* update timer scheduler to use crossbeamGregory Terzian2019-10-201-1/+1
|
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-1/+1
|
* #8539 Config preferences backend restructurePeter Hall2019-03-201-5/+2
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-10/+10
|
* Format script componentchansuke2018-09-191-62/+89
|
* Updated to mozjs v0.7.1.Alan Jeffrey2018-05-301-1/+1
|
* beforeunload and unload infrastructureGregory Terzian2018-05-051-1/+1
|
* Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393Marcin Mielniczuk2018-03-281-2/+3
|
* Use unsafe Heap::handle wherever neededIgor Matuszewski2018-03-231-1/+8
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Rename DOMRefCell<T> to DomRefCell<T>Anthony Ramine2017-09-261-5/+5
| | | | | | | | I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
* order derivable traits listsClément DAVID2017-08-231-7/+7
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Use boxed slice instead of vec for FuntionTimerCallbackSadman Kazi2017-07-111-2/+2
|
* Bump euclid to 0.14.Nicolas Silva2017-06-141-1/+1
|
* Terminate timer scheduler thread during shutdownFernando Jiménez Moreno2017-03-301-4/+5
|
* script: Use a timer when rAF is used for non-animation purposesPatrick Walton2017-03-031-0/+3
| | | | | | | | | | | | After this patch, when the page calls `requestAnimationFrame()` too many times in the row without actually mutating the DOM, further calls to `rAF` will actually perform the moral equivalent of `setTimeout(16)`. This saves a lot of CPU time compared to actually waiting for the vertical blanking interval, because waiting for that requires us to draw the page. Reduces CPU usage drastically on nytimes.com, which has a perpetual `requestAnimationFrame()` loop that checks whether ads are in view.
* Change #[privatize] into #[derive(DenyPublicFields)]Anthony Ramine2017-02-151-6/+3
|
* The constellation notifies the script thread about documents becoming ↵Alan Jeffrey2017-01-271-1/+3
| | | | inactive, active and fully active.
* Remove some unsound JSVal handling in JsTimerTask::invoke.Ms2ger2017-01-051-7/+2
| | | | | We were using Handles to *copies* of the traced values, rather than the originals.
* Added warnings for idempotent freeze/thaw.Alan Jeffrey2017-01-041-2/+4
|
* Implement discarding Document objects to reclaim space.Alan Jeffrey2017-01-041-4/+4
|
* Removed util.Alan Jeffrey2016-12-141-1/+1
|
* Rename `Reflectable` to `DomObject`.Corey Farwell2016-12-081-4/+4
| | | | Fixes https://github.com/servo/servo/issues/8473.
* Use a timer callback when re-establishing a connectionKeith Yeung2016-11-111-0/+3
|
* Rename Reflectable::global_scope to globalAnthony Ramine2016-10-061-2/+2
|
* Move timers to GlobalScopeAnthony Ramine2016-10-061-9/+9
|
* Move JS evaluation functions to GlobalScopeAnthony Ramine2016-10-061-3/+3
|
* Replace ScriptHelpers by GlobalRef methodsAnthony Ramine2016-10-031-3/+4
|
* Support an equivalent of Trusted<T> for Rc<Promise> objects named ↵Josh Matthews2016-09-221-0/+3
| | | | TrustedPromise.
* Auto merge of #11872 - eddyb:back-to-roots, r=Ms2gerbors-servo2016-07-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace return_address usage for rooting with stack guards and convenience macros. The existing `Rooted` and `RootedVec` users were migrated the the following two macros: ```rust let x = Rooted::new(cx, value); // Was changed to: rooted!(in(cx) let x = value); // Which expands to: let mut __root = Rooted::new_unrooted(value); let x = RootedGuard::new(cx, &mut __root); ``` ```rust let mut v = RootedVec::new(); v.extend(iterator); // Was changed to: rooted_vec!(let v <- iterator); // Which expands to: let mut __root = RootableVec::new(); let v = RootedVec::new(&mut __root, iterator); ``` The `rooted!` macro depends on servo/rust-mozjs#272. These APIs based on two types, a container to be rooted and a rooting guard, allow implementing both `Rooted`-style rooting and `Traceable`-based rooting in stable Rust, without abusing `return_address`. Such macros may have been tried before, but in 1.9 their hygiene is broken, they work only since 1.10. Sadly, `Rooted` is a FFI type and completely exposed, so I cannot prevent anyone from creating their own, although all fields but the value get overwritten by `RootedGuard::new` anyway. `RootableVec` OTOH is *guaranteed* to be empty when not rooted, which makes it harmless AFAICT. By fixing rust-lang/rust#34227, this PR enables Servo to build with `-Zorbit`. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix rust-lang/rust#34227 - [x] These changes do not require tests because they are not functional changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11872) <!-- Reviewable:end -->
| * Switch to using the new rooted!/RootedGuard API for rooting.Eduard Burtescu2016-07-041-2/+2
| |
* | Refactor `util::prefs` operations to be methods on static struct.Corey Farwell2016-07-021-2/+2
|/
* Auto merge of #10225 - jmr0:visibility_api, r=jdmbors-servo2016-06-161-4/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement non-visible pipeline and iframe visibility methods This addresses #9566 and a good part of #9751, specifically: * Pipeline has a notion of visibility * IFrame setVisible/getVisible interface with IFrame's pipeline visibility * IFrame mozbrowservisibilitychange responds to changes in visibility * Pipeline visibility is used to limit animations (requestAnimationFrame does not tick animations when hidden) and to increase timer intervals (currently set to a minimum of 1 second while hidden) Absent for now are any changes to the Document API and general implementation of the Page Visibility API, since the more interesting parts require knowledge of whether the user agent is minimized, OS screen locked, etc. cc @paulrouget @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10225) <!-- Reviewable:end -->
| * Implement non-visible pipeline and iframe visibility methodsjmr02016-06-151-4/+34
| |
* | Remove an invalid assertion in fire_timer.Ms2ger2016-06-101-1/+4
|/ | | | | | | It's not clear to me if this is something we should expect to happen, but it does indeed happen, so we should disable the assertion while we investigate. Fixes #9984.