| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Add CanGc as arguments in methods in Document
Testing: These changes do not require tests because they are a refactor.
Addressed part of https://github.com/servo/servo/issues/34573.
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the final step of #1799, where the majority of the generated
code for the JS bindings is now compiled as part of the script_bindings
build step. The remaining pieces in script must live there because they
refer to concrete DOM types; all code in script_bindings is generic over
the
[DomTypes](https://doc.servo.org/script/dom/bindings/codegen/DomTypes/trait.DomTypes.html)
trait.
My testing with incremental builds shows me a 12 second reduction in
build times on my 2024 M4 Macbook Pro when modifying code in the script
crate after these changes. Before this PR those changes took 20 seconds
to rebuild Servo, and now they take 8 seconds.
Testing: Existing WPT tests ensure no regressions.
Fixes: #1799
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
| |
1. Implement `WebDriverCommand::DeleteCookie`
2. Remove unnecessary clone for `WebDriverCommand::GetNamedCookie`
Fixes: #36287
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
|
|
|
| |
Signed-off-by: dericko681 <abonghoderick@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#36111)
* new_js_regex and matches_js_regex need a CanGc argument
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* new_js_regex and matches_js_regex need a CanGc argument
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* edit Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
* Propagate CanGc arguments through new_js_regex and matches_js_regex
Signed-off-by: dericko681 <abonghoderick@gmail.com>
---------
Signed-off-by: dericko681 <abonghoderick@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* script: Move num module to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Make JS reflector creation generic over DOM trait.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move bindings-specific lock to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move DOM proto array code to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move finalizer implementations to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move some error routines to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move some DOM interface conversion routines to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Make is_array_like generic over DOM trait.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Use generic interfaces for conditional exposure functions.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move a bunch of routines used by codegen to script_bindings.
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>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Serialize html fragments without going through html5ever
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement ShadowRoot::GetHtml / Element::GetHtml
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Propagate CanGc annotations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* servodriver: Ensure capabilities is always a non-empty value.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Serialize arguments object like an array.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Ensure script body is always valid JS.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Use current browsing context when getting element center point.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Propagate errors received from getting element center point.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Ensure opening a new window records a unique window handle.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Don't panic if script execution fails.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Do not update the current browsing context after closing a window.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* webdriver: Use more precise check for arguments exotic object.
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>
|
|
|
|
|
|
| |
The `WebViewId` name is a lot more descriptive these days to the casual
reader, so I think we can go ahead and finish the rename.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first step toward moving the WebDriver implementation to
servoshell. This move will make it possible to start testing the
embedding API with WebDriver. See [this zulip thread][a] for more details.
While WebDriver will be able to use a lot of API commands to do what it
is doing now, there will still need to be some "cheat codes" for more
gnarly access to `ScriptThread` details. That's why we likely won't be
able to remove all WebDriver-specific messages from the API -- but maybe
they will be useful for embedders somehow.
A couple messages have to change as they depended on `script_traits`
types, particularly those that used `WindowSizeData` and `LoadData`. I
think this helps to encapsulate the WebDriver commands a bit more
though.
[a]: https://servo.zulipchat.com/#narrow/channel/437943-embedding/topic/webdriver.20as.20embedding.20api.20playgound
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
| |
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
|
|
|
|
|
| |
(#35457)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* script: Move Reflector to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
| |
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
| |
Expose two new helpers and start using them as much as possible.
- `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty
owns a `Node`. This may be different than `.global()` in the case that
the `Node` was adopted by a different `Document`.
- `Window::as_global_scope`: A helper to avoid having to cast so much
when treating a `Window` like a `GlobalScope`.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#34832)
This puts a few commonly used `Node` helpers into a trait (`NodeTraits`)
and gives them more descriptive names and documentation. The renames:
- `document_from_node` -> `NodeTraits::owner_document`
- `window_from_node` -> `NodeTraits::owner_window`
- `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner`
- `containing_shadow_root` -> `NodeTraits::containing_shadow_root`
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Replace unsafe uses of HandleValueArray.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix clippy lint.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make servodriver a thin wrapper over the base webdriver browser/executor classes.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Make ServoWebDriverRefTestExecutor a thin shell over the webdriver reftest executor.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Wait for the initial load to complete when opening a new tab via webdriver.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove assumption of a single tab from the webdriver server.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Serialize all keys of JS objects when converting to webdriver values.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Cleanup, docs, etc.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Use webview terminology more consistently.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix flake8 errors.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reflowing (#34486)
This changes fixes two issues:
1. A reflow of all `Document`s currently done unconditionally after
receving IPC messages in the `ScriptThread`. Reflowing without first
updating the animation timeline can lead to transitions finshing as
soon as they start (because it looks like time advancement is
measaured between calls to `update-the-rendering`).
2. Fix an issue where not all `Pipeline`s were updated during *update
the rendering*. The previous code only took into account top level
frames and their children. It's not guaranteed that a particular
`ScriptThread` is managing any top level frames, depending on the
origens of those frames. We should update the rendering of those
non-top-level iframes regardless.
The new code attempts to order the frames according to the
specification as much as possible without knowing the entire frame
tree, without skipping any documents managed by the `ScriptThread` in
question.
In addition, `Documents` is pulled out the `script_thread.rs` and
renamed to `DocumentCollection`.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
| |
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
|
|
|
| |
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* CanGc fixes in errorevent.rs
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Allow too_many_arguments to avoid lint error
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* CanGc changes from fontfaceset.rs
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Update components/script/dom/bindings/codegen/Bindings.conf
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
| |
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* CanGc fixes and checks in multiple files
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CanGc fixes in storageevent.rs
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Replace CanGc::note() calls with arguments in components/script/dom
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Add methods to Bindings.conf
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Modify existing interface sections
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Resolve conflicts
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
---------
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Mark JS reflector wrappers as CanGc.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Propagate CanGc from reflect_dom_object_with_proto.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Mark DOM constructors as GC operations.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:
1. Move non `gfx` crate things out of `gfx_traits`. This is important in
order to prevent dependency cycles with a different integration between
layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
to do with messages and instead mostly holds ids, which are used
across many different crates in Servo. This new crate will hold the
*rare* data types that are widely used.
Details:
- All BackgroundHangMonitor-related things from base to a new
`background_hang_monitor_api` crate.
- Moved `TraversalDirection` to `script_traits`
- Moved `Epoch`-related things from `gfx_traits` to `base`.
- Moved `PrintTree` to base. This should be widely useful in Servo.
- Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
to `WebRenderFontApi`.
|
|
|
|
|
|
|
|
|
| |
* Fixed some clippy warnings in components/script/webdriver_handlers.rs
* Updated fixes for clippy warnings in components/script/webdriver_handlers.rs
* Updated the formatting of components/script/webdriver_handlers.rs
* Updated components/script/webdriver_handler.rs to fix some clippy warnings.
|
| |
|
|
|
|
|
| |
* Fix warnings: immediate dereferencing of references and unneeded statement
* Fix warnings in Components/script
|
|
|
|
|
| |
* strict imports formatting
* Reformat all imports
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
command
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
georgeroman:implement_get_element_property_wd_command, r=jdm
Implement GetElementProperty wd command
<!-- 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
<!-- Either: -->
- [X] There are tests for these changes
<!-- 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. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23745)
<!-- Reviewable:end -->
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.
Given the size of this patch, I think it's useful to get this landed as-is.
|