WaterWhisperer
241bff962d
Change some #[allow]s to #[expect]s ( #40458 )
...
Removes some unneeded lints.
Testing: Refactor
Part of: #40383
Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com >
2025-11-06 12:31:48 +00:00
Simon Wülker
de6feb469a
script: Move operations in window_named_properties::get_own_property_descriptor & webdriver_handlers::clone_an_object into unsafe blocks ( #38951 )
...
Testing: Covered by existing tests
Part of https://github.com/servo/servo/issues/35955
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
2025-08-26 21:48:25 +00:00
Jonathan Schwender
ff4971012f
bump mozjs to 137.0-1 ( #38561 )
...
This bump downgrades icu_capi to 1.5.0, to match the version vendored in
spidermonkey.
Previous mozjs PRs:
- https://github.com/servo/mozjs/pull/606
- https://github.com/servo/mozjs/pull/605
Testing: Covered by existing tests
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com >
2025-08-08 20:19:45 +00:00
Simon Wülker
bb0d08432e
Migrate to the 2024 edition ( #35755 )
...
* Migrate to 2024 edition
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
* Allow unsafe_op_in_unsafe_fn lint
This lint warns by default in the 2024
edition, but is *way* too noisy for servo.
We might enable it in the future, but not now.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
* Compile using the 2024 edition
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
2025-03-13 10:28:11 +00:00
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition ( #35764 )
...
* Use 2024 style edition
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
* Reformat all code
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de >
2025-03-03 11:26:53 +00:00
Gae24
56199fd153
window: avoid NonNull<JSObject> in NamedGetter ( #35508 )
...
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com >
2025-02-17 12:48:21 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. ( #34915 )
...
* script: Restrict reexport visibility of DOM types.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* script: Mass pub->pub(crate) conversion.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* script: Hide existing dead code warnings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* Fix clippy warnings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* Fix unit tests.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* Fix clippy.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
* More formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net >
2025-01-10 08:19:19 +00:00
Hayashi Mikihiro
a797969efe
Replace the lazy_static crate whth std::sync::LazyLock in components/script ( #33004 )
...
* replace in str.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace navigator.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace htmlmetaelement.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace document.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace cssstyledeclaration.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace script_runtime.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* replace window_named_properties.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* reduce dependency lazy_static
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
* reduce lazy in script_runtime.rs
`Mutex::new()` is const contexts. I think that `JS_ENGINE` is need not lazy initialize.
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
---------
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com >
2024-08-12 07:30:35 +00:00
Bumsoo Kim
141a594e23
Replace null-byte terminated string literals with C-string literals ( #32716 )
...
* simple conversion from byte string to c-string
Signed-off-by: Bum Kim <bumcrystlbum@gmail.com >
* convert byte strings to c-strings to c_char ptr
Signed-off-by: Bum Kim <bumcrystlbum@gmail.com >
---------
Signed-off-by: Bum Kim <bumcrystlbum@gmail.com >
2024-07-06 20:14:15 +00:00
RustAndMetal
f6a975fc58
clippy: Fix several warnings ( #31710 )
...
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com >
2024-03-18 08:33:43 +00:00
Richard Dushime
8a6481c341
clippy: Fix warnings in components/script ( #31700 )
...
* Fix warnings: immediate dereferencing of references and unneeded statement
* Fix warnings in Components/script
2024-03-15 17:27:50 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) ( #30325 )
...
* strict imports formatting
* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af
remove extern crate ( #30311 )
...
* 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 >
2023-09-08 12:11:31 +00:00
Delan Azabani
557ce73f5f
add spec issue as todo in [[OwnPropertyKeys]] trap
2023-03-23 19:15:20 +08:00
Delan Azabani
c831a136b2
clarify and test interactions with indexed access
2023-03-23 18:07:50 +08:00
Delan Azabani
b1f78d8a3d
fix attrs in descriptor for @@toStringTag property
2023-03-23 18:07:44 +08:00
Delan Azabani
dd905d8434
clean up spurious changes and todos with no action needed
2023-03-23 18:07:39 +08:00
Delan Azabani
65da7b668b
clean up lints and tidy errors
2023-03-23 18:07:36 +08:00
Delan Azabani
9a8a5bdbf7
make ownPropertyKeys trap return @@toStringTag key
...
This fixes the failures in the “[[OwnPropertyKeys]]” subtest.
2023-03-23 18:07:11 +08:00
Delan Azabani
bbaacb7b2d
make getOwnPropertyDescriptor trap accept @@toStringTag key
...
This fixes the failures in the “[[Get]]” and “[[Delete]]” subtests.
2023-03-23 18:07:08 +08:00
Delan Azabani
33387eb75a
make getOwnPropertyDescriptor trap accept integer indices
...
Several /webidl/ecmascript-binding/window-named-properties-object.html
subtests, including the “[[GetOwnProperty]]” and “[[HasProperty]]”
subtests, expect iframe.contentWindow.Window.prototype[0] to return an
element with id “0”.
This commit makes the getOwnPropertyDescriptor trap accept property
keys that are integer indices, by converting them to a DOMString just
like we would for a property key that is a JSString.
2023-03-23 18:07:05 +08:00
Delan Azabani
9a3d6969c9
migrate use of deprecated RUST_JS_{IS,TO}_STRING
2023-03-23 18:07:02 +08:00
Delan Azabani
8814e4bb4f
fix failures in [[DefineOwnProperty]] subtest
...
Calling throw_type_error in the [[DefineOwnProperty]] trap (and
returning false) makes the internal method throw a TypeError, which
means both Object#defineProperty and Reflect#defineProperty will throw
a TypeError, but we actually want the latter to return false.
This commit makes the trap set ObjectOpResult to a TypeError (and
return true), making the internal method return false per the spec [1]
and in turn allowing Reflect#defineProperty to return false.
[1] https://webidl.spec.whatwg.org/#named-properties-object-defineownproperty
2023-03-23 18:06:58 +08:00
Delan Azabani
4c7f198ee2
apply yvt/servo/fix-named-window-getter
2023-03-23 18:02:35 +08:00
Delan Azabani
fd1de05592
apply pylbrecht/servo/named.window.getter ( closes #27952 )
2023-03-23 18:01:26 +08:00