aboutsummaryrefslogtreecommitdiffstats
path: root/components/config/pref_util.rs
Commit message (Collapse)AuthorAgeFilesLines
* Allow setting userscripts directly without the need of files (#35388)Tony2025-03-271-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow settings userscripts through preferences Signed-off-by: Tony <legendmastertony@gmail.com> * mach fmt instead of cargo fmt Signed-off-by: Tony <legendmastertony@gmail.com> * Fix pref loading not working for array values Signed-off-by: Tony <legendmastertony@gmail.com> * Use pref! in userscripts instead Signed-off-by: Tony <legendmastertony@gmail.com> * Implement the model jdm suggested - Remove userscripts from all places and move it to servoshell - Add in `UserContentManager` struct and passing it through `Servo::new` all the way down to script thread Signed-off-by: Tony <legendmastertony@gmail.com> * Apply suggestions from code review and format Signed-off-by: Tony <legendmastertony@gmail.com> * Revert unrelated change Signed-off-by: Tony <legendmastertony@gmail.com> --------- Signed-off-by: Tony <legendmastertony@gmail.com> Signed-off-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* Fix the parsing error of PrefValue::Array, which is used for the parsing of ↵boluochoufeng2025-03-101-2/+2
| | | | | Preferences shell_background_color_rgba field (#35865) Signed-off-by: blycf <1355990831@qq.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-225/+57
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Replace lazy_static crate with `std::sync::LazyLock` in layout and config ↵Hayashi Mikihiro2024-08-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#33065) * replace in layout_thread_2020 Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in layout_thread Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in layout Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in config Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace in config_plugins The macro of config_plugins require Send trait bounds Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* clippy: Fix warnings in `shared` and `config`, `fonts`, `layout`, and ↵Martin Robinson2024-07-041-5/+1
| | | | `layout_2020` components (#32674)
* config: fix panic in PrefValue to [f64; 4] conversion (#32571)Mukilan Thiyagarajan2024-06-201-3/+5
| | | | | | | | | | | The `Iterator::all` method consumes the input iterator `f` so when we reuse `f` in `f.flatten().collect()` it yields an empty Vector in the case where all the elements are successfully converted using try_into(). This causes out of bounds access when indexing into the resulting Vector to extract the individual components. Fixes #32570. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* clippy: fix warnings in components/config* (#31562)eri2024-03-081-10/+9
|
* Add shell.background-color.rgba to prefs (#30488)Ngo Iok Ui (Wu Yu Wei)2023-10-041-0/+32
| | | | | | | * Add shell.transparent-background.enabled to prefs * Rename config to background_color * Rename to background-color and.rgba add PrefValue::Array variant
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-2/+3
| | | | | * 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>
* Remove an unneeded arc reference count bump on each pref access.Emilio Cobos Álvarez2023-06-081-5/+5
|
* Fix warnings introduced in newer Rust NightlySimon Sapin2021-02-251-6/+1
| | | | | | | | | | | | This does not (yet) upgrade ./rust-toolchain The warnings: * dead_code "field is never read" * redundant_semicolons "unnecessary trailing semicolon" * non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021" * unstable_name_collisions "a method with this name may be added to the standard library in the future" * legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
* Embedding API: prefs r/wPaul Rouget2020-06-101-0/+11
|
* Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30)Simon Sapin2019-07-311-1/+1
|
* Fix some new warningsSimon Sapin2019-06-221-2/+2
|
* #8539 Config preferences backend restructurePeter Hall2019-03-201-0/+282