| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Expose a `ServoBuilder` for easily creating Servo instances using
default values. This change enables removing `EmbedderTraits`.
Testing: This is covered by `Servo` unit tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
| |
This PR allows setting the log-filter according to the env_filter spec
via CLI arguments.
Testing is currently in progress, will be done on machines running OHOS.
---------
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libservo: Make zooming and HiDPI scaling work per-`WebView`
This change moves all zooming and HiDPI scaling to work per-`WebView` in
both libservo and Compositor. This means that you can pinch zoom one
`WebView` and it should now work independently of other `WebView`s.
This is accomplished by making each `WebView` in the WebRender scene
have its own scaling reference frame.
All WebViews are now expected to manage their HiDPI scaling factor and
this can be set independently of other WebViews. Perhaps in the future
this will become a Servo-wide setting.
This allows full removal of the `WindowMethods` trait from Servo.
Testing: There are not yet any tests for the WebView API, but I hope
to add those soon.
Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes a new method of creating `WebView`s using the Rust builder
pattern. This will be more important as we add more kinds of
configuration options for `WebView` such as size and HiDPI scaling.
Testing: The API currently doesn't have tests, but functionality is
ensured by the fact that servoshell is the test harness.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[OHOS]Bugfix: unimplemented WebviewDelegate.sceen_geometry causes failed
page loading
this [PR 36223](https://github.com/servo/servo/pull/36223) causes that
some page can not be loaded on ohos platform. The newly added
WebviewDelegate.screen_geometry is unimplemented at ohos platform
Besides, this commit also fix the bug that failed to copy the prefs.json
to cache dir when the servo is started at the first time after an ohos
application is installed, due to the cache dir is not existed.
@mrobinson @jschwe
Testing: the ohos platform test demo hap
Fixes: No issue exists i can find
Signed-off-by: coding-joedow <ibluegalaxy_taoj@163.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes removes animation tracking from the `WindowMethods` trait
and moves it to `ServoDelegate` and `WebViewDelegate`.
- Animation changes per-`WebView` are now triggered in the compositor
only when the value is updated there, rather than right after ticking
animations.
- Both `WebView` and `Servo` now expose an `animation()` method, so
tracking animation state actually becomes unecessary in many cases,
such as that of desktop servoshell, which can just read the value
when the event loop spins.
Testing: No tests necessary as the API layer is still untested. Later,
tests will be added for the `WebView` API and this can be tested then.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`WindowMethods` is used by the embedding layer to get information from
the embedder. This change moves the functionality for getting screen
size and `WebView` offsets to `WebViewDelegate`.
This is important because `WebView`s might be on different screens or
have different offsets on the screen itself, so it makes sense for this
to be per-`WebView` and not global to the embedder. HiDPI and animation
state functionality will move to the embedder in subsequent changes.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
<!-- 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
- [x] These changes do not require tests because they just modify the
`WebView` API surface a bit.
<!-- 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. -->
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove `EmbedderMethods::get_user_agent_string`. This is now part of
the `Preferences` data structure, which should allow it to be
per-`WebView` in the future.
- Remove `EmbedderMethods::get_version_string`. This was used to include
some data along with WebRender captures about the Servo version. This
isn't really necessary and it was done to replace code in the past
that output the WebRender version, so also isn't what the original
code did. I think we can just remove this entirely.
The idea with these changes is that `EmbedderMethods` can be removed
in a followup and the rest of the methods can be added to
`ServoDelegate`. These two methods are ones that cannot be added to a
delegate as they are used during `Servo` initialization.
Testing: There is currently no testing for libservo. These changes are
meant
as preparation for adding a suite of `WebView` unit tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Create config_dir if none exist for caching
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* remove specialized behaviour for ohos; copy prefs.json if necessary
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* downgrade the log to trace verbosity
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* update wpt-test
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
| |
The underlying issue was solved in napi-ohos 1.0.2,
and we have already updated to 1.0.4
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch exposes a servo internal DOM API that is only made available to about:
pages on the navigator object to request memory reports. The about:memory page itself is
loaded like other html resources (eg. bad cert, net error) and makes use of this new API.
On the implementation side, notable changes:
- components/script/routed_promise.rs abstracts the setup used to fulfill a promise when the
work needs to be routed through the constellation. The goal is to migrate other similar
promise APIs in followup (eg. dom/webgpu/gpu.rs, bluetooth.rs).
- a new message is added to request a report from the memory reporter, and the memory reporter
creates a json representation of the set of memory reports.
- the post-processing of memory reports is done in Javascript in the about-memory.html page,
providing the same results as the current Rust code that outputs to stdout. We can decide
later if we want to remove the current output.
Signed-off-by: webbeef <me@webbeef.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allows to read the prefs.json from the hap bundle on OHOS.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
* incorporate suggestions
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
* incoroporate requested changes
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
|
|
|
| |
Signed-off-by: Delan Azabani <dazabani@igalia.com>
|
|
|
|
|
|
|
|
|
| |
When creating a `WebView`, let the Compositor know synchronously that
it exists. This allows the embedder to immediately call methods like
`WebView::focus()`. In addition remove messages associated with the
`WebViewDelegate::notify_ready_to_show()` method (and the method
itself), as now `WebView`s can be shown immediately.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first step toward removing `WindowMethods`, which will
gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing
of the `WebView` is now handled by the a size associated with a
`RenderingContext`. `WebView`s will eventually just paint the entire
size of their `RenderingContext`. Notes:
- This is transitionary step so now there is a `WebView::resize` and a
`WebView::move_resize`. The first is the future which will resize the
`WebView` and its associated `RenderingContext`. The second is a
function that the virtual `WebView`s that will soon be replaced by a
the one-`WebView` per `WebView` model.
- We do not need to call `WebView::move_resize` at as much any longer
because the default size of the `WebView` is to take up the whole
`RenderingContext`.
- `SurfmanRenderingContext` is no longer exposed in the API, as a
surfman context doesn't naturally have a size unless a surface is
bound to it.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* TouchSequenceInfo is added to store information about a touch sequence.
For details about TouchSequenceInfo, see the code comments.
The handling_touch_move attribute is added to the TouchHandler, indicating that the script is processing the touch move event.
When handling_touch_move is set to true, the touch move event does not need to be sent to the script thread.
Signed-off-by: kongbai1996 <1782765876@qq.com>
* move touch state, active_touch_point and handling_touch_move to TouchSequenceInfo form TouchHandler.
remove TouchSequenceInfo end_sequence property, add Finished state mark sequence end.
if preventDefault on touchup, do not prevent Fling.
Signed-off-by: kongbai1996 <1782765876@qq.com>
* Refactor Touchhandler
- Add a newtype wrapper for the TouchSequenceId
- Move more state back into the TouchSequenceState
- Rename TouchAction to TouchMoveAction,
since it only covers immediate actions now.
Everything else is handled via state, since
it needs to wait on the handler.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix test-tidy
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix clippy missing-default lint
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix remaining clippy lints
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Remove accidental committed test file
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Remove wrong todo comment
(move events that are sent to script are just raw touchpoints,
no merging needed)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix preventdefault after long touch_down handler
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
---------
Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#35538)
This is a step toward the renderer-per-WebView goal. It moves various
details out of `IOCompositor`.
- Image output: This is moved to servoshell as now applications can
access the image contents of a `WebView` via
`RenderingContext::read_to_image`. Most options for this are moved to
`ServoShellPreferences` apart from `wait_for_stable_image` as this
requires a specific kind of coordination in the `ScriptThread` that is
also very expensive. Instead, paint is now simply delayed until a
stable image is reached and `WebView::paint()` returns a boolean.
Maybe this can be revisited in the future.
- Shutdown: Shutdown is now managed by libservo itself. Shutdown state
is shared between the compositor and `Servo` instance. In the future,
this sharing might be unecessary.
- `CompositeTarget` has been removed entirely. This no longer needs to
be passed when creating a Servo instance.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the rendering model of the `WebView` clearer:
1. `WebViewDelegate::notify_new_frame_ready()` indicates that the
WebView has become dirty and needs to be repainted.
2. `WebView::paint()` asks Servo to paint the contents of the `WebView`
into the `RenderingContext`.
3. `RenderingContext::present()` does a buffer swap if the
`RenderingContext` is actually double-buffered.
This is documented and all in-tree embedders are updated to work with
this new model.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#35501)
Expose two easy-to-use wrappers around `SurfmanRenderingContext` that
make the API simpler to use:
- `WindowRenderingContext`: This `RenderingContext` is a newtype around
`SurfmanRenderingContext` takes a `raw-window-handle` display and window
and creates a full window rendering context.
- `SoftwareRenderingContext`: is wraps `SurfmanRenderingContext` and
adds a swap chain in order to expose a software GL rendering context.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* implement Touchevent prevent default behavior
* The status change logic of the `TouchHandler` is changed.
> The `WaitingForScript` state is canceled. TouchAction can be identified
based on the current touch type and numbers if touch points.
* Sends current event to script thread along with recognized `TouchAction`.
> After dispatch event, script thread sends a `TouchEventProcess(EventResult)`
message to main thread. If the event is set to `DefaultAllowed`, the
corresponding `TouchAction` information is added.
* After receiving `DefaultAllowed(TouchAction)` message, main thread executes corresponding action.
> `DefaultPrevented(TouchEventType)` is received. Use `prevent_click` to mark
that the default `Click` is blocked, and `prevent_move` to mark that the
default `Scroll` and `Zoom` are blocked. In this way, all TouchActions
implement preventDefault.
Signed-off-by: Bi Fuguo <1782765876@qq.com>
* fix some suggestions
* support preventDefault fling
* move `TouchAction` to share touch directory
* check preventDefault everytime when touch
* fix zoom ineffective
Signed-off-by: Bi Fuguo <1782765876@qq.com>
* fix some suggestions
rename on_event_processed to on_touch_event_processed
clear unused features
Signed-off-by: Bi Fuguo <1782765876@qq.com>
* Optimizes pan performance by continuously sliding without waiting for the eventhandler.
Signed-off-by: kongbai1996 <1782765876@qq.com>
* resolve conflict
Signed-off-by: kongbai1996 <1782765876@qq.com>
---------
Signed-off-by: Bi Fuguo <1782765876@qq.com>
Signed-off-by: kongbai1996 <1782765876@qq.com>
|
|
|
|
|
|
| |
This was implemented, but unset.
Fixes #35481.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change exposes a single `InputEvent` type and now there is only a
single delegate method for this `WebViewDelegate::notify_input_event`.
- Clipboard events are now handled as `EditingAction` inpute events. In
the future this can include things like "Select All", etc.
In addition, many parts of the dance to pass these events can now be
simplified due to this abstraction.
- All forwarded events are handled the same way in the `Constellation`,
though they may carry an optional hit test (for events that have a
`point`) which affects which `Pipeline` they are sent to.
- In the `ScriptThread` we now accept these `InputEvents` and use them
everywhere. Now all "compositor events" are "input events".
- This allows removing several data structures which are no longer
necessary.
- We no longer inform the embedder when an event was handled by a
WebView as that was only important for a MDI feature that will
no longer be so important the full-featured `WebView` API.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Constellation (#35369)
Instead of telling the Constellation to tell the embedder that new
frames are ready, have the compositor tell the embedder directly. This
should reduce frame latency. Now, after processing compositor
updates, run any pending `WebView::new_frame_ready` delegate methods.
This change also removes the `refresh` call from the Java interface as
that was the only other place that the compositor was rendering the
WebRender scene outside of event looping spinning. This `refresh` call
was completely unused.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a delegate method for HTTP authentication and a related
`AuthenticationRequest` object that carries with it the URL as well as
whether or not the authentication request is for a proxy or not.
This is now separate from the prompt API because requesting
authentication doesn't necessarily involve prompting -- this is an
implementation detail of the embedder. In addition, the internal bits
are cleaned up slightly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Update the script crate to better reflect the modern Permission
specifcation -- removing the necessity for an `Insecure` variant of
the permissions prompt.
- Have all allow/deny type requests in the internal API use an
`AllowOrDeny` enum for clarity.
- Expose `PermissionsRequest` and `PermissionFeature` data types to the
API and use them in the delegate method.
- Update both servoshell implementations to use the API.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
| |
Using environment variables is not really an option on ohos/android,
so add a CLI option to configure tracing.
Making it a `pref`, so that we can persist the filter
might also be desirable.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a `ClipboardDelegate` to the `WebView` API and a default
implementation in libservo for this delegate that works on Mac, Windows,
and Linux. Support for Android will be added in the future. This means
that embedders do not need to do anything special to get clipboard
support, but can choose to override it or implement it for other
platforms.
In addition, this adds support for handling fetches of clipboard contents
and renames things to reflect that eventually other types of clipboard
content will be supported. Part of this is removing the string
argument from the `ClipboardEventType::Paste` enum because script will
need to get other types of content from the clipboard than just a
string. It now talks to the embedder to get this information directly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
| |
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a few methods are still difficult to implement without
the help of surfman. To simplify the trait methods, all methods that
return surfman types are removed. They are either handled by
embedders themselves or abstract to simpler types that servo
components need. The most noticeable changes are:
- Methods related to native surface are moved to servo_glue. The
embedder should decide when to remove/replace the surface and it's
outside of servo's scope.
- Methods required by servo media now return exact media types for it.
The other major change is sevevral difficult trait methods that are
reuiqred by WebGL and Servo media have default implementation. So they
can be optional for users to implement.
Signed-off-by: Wu Wayne <yuweiwu@pm.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#35196)
This change adds the second major part of the new API: delegates which
have methods called by the Servo loop. When a delegate is set on a
`WebView` or on `Servo` itself, the event loop will call into
appropriate delegate methods. Applications can implement the delegate on
their own structs to add special behavior per-`WebView` or for all
`WebView`s.
In addition, each delegate has a default implementation, which
automatically exposes "reasonable" behavior such as by-default allowing
navigation.
There's a lot more work to do here, such as refining the delegate
methods so that they all have nice interfaces, particulary with regard
to delegate methods that need an asynchronous response. This will be
handed gradually as we keep working on the API.
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* chore: Rename CompositeTarget enum
Signed-off-by: DK Liao <dklassic@gmail.com>
sync name in other documents
Signed-off-by: DK Liao <dklassic@gmail.com>
sync more name in other documents
Signed-off-by: DK Liao <dklassic@gmail.com>
* Fix Android/ohos
Signed-off-by: DK Liao <dklassic@gmail.com>
---------
Signed-off-by: DK Liao <dklassic@gmail.com>
|
|
|
|
|
|
|
|
|
| |
These will be a single method in the upcoming `WebView` delegate, so it
makes sense to also combine the internal message to match this. In
addition, since `LoadStatus` is now exposed to the API if there is ever
the need to add more statuses or to move to an event-based version, the
API is already set up for this.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
| |
- Run `cargo fmt` on `webxr` and `webxr-api`
- Fix clippy warnings in the existing `webxr` code
- Integrate the new crates into the workspace
- Expose `webxr` via the libservo API rather than requiring embedders to
depend on it explicitly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
| |
The conversion of an integer into a `MediaSessionAction` is
Android-specific and thus shouldn't be used throughout the source code.
This change moves the conversion to the Android port of servoshell.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`EmbedderMsg` was previously paired with an implicit
`Option<WebViewId>`, even though almost all variants were either always
`Some` or always `None`, depending on whether there was a `WebView
involved.
This patch adds the `WebViewId` to as many `EmbedderMsg` variants as
possible, so we can call their associated `WebView` delegate methods
without needing to check and unwrap the `Option`. In many cases, this
required more changes to plumb through the `WebViewId`.
Notably, all `Request`s now explicitly need a `WebView` or not, in order
to ensure that it is passed when appropriate.
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
| |
A window resize requires to also resize the webview,
otherwise it will stay at the original size.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|
|
|
| |
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many types used directly in the `libservo` API are in the
`script_traits` crate, which was created to break circular dependencies.
Move all API exposed types to `embedder_traits` which now contains types
exposed via the `libservo` embedding API. Also expose these at the root
of the `libservo` `servo` crate so that the API won't break when they
move around in the future.
The idea with `embedder_traits` in the future is that it contains types
that are available throughout servo because they are used in the
embedding API and thus should have minimal dependencies on other Servo
crates (a bit like `base`).
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a new handle-based webview API to libservo, with
two main design goals:
1. The lifetime of the handles controls the lifetime of the webview,
giving the embedder full control over exactly when webviews are
created and destroyed. This is consistent with how WebKitGTK’s
WebView works; the engine can only create webviews via a create
request, and can only destroy them via a close request.
2. All methods are infallible; if the constellation dies, the embedder
finds out when calling Servo::handle_events.
For the moment, the embedder is only responsible for creating the
WebView id, and not the internal TopLevelBrowsingContext data
structures. This is so that the ScriptThread is able to get a handle on
the new WebView's WindowProxy in the case that it's an auxiliary
browsing context. In the future, the embedder should also be responsible
for creating the TopLevelBrowsingContext and the ScriptThread should
have mechanism to associate the two views so that WebView creation is
always executed through the same code path in the embedding layer. For
now, it's enough that the embedder can get a handle to the new WebView
when it's creation is requested.
Once we replace EmbedderMsg with a webview delegate trait, we will pass
WebView handles to the embedder, rather than webview ids. We’ll also add
detailed docs, once the design settles.
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove type parameter from Servo and IOCompositor (#35121)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix compile error in libservo example
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Fix compile error in servoshell
Signed-off-by: Delan Azabani <dazabani@igalia.com>
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat: turn RenderingContext into a trait
Signed-off-by: DK Liao <dklassic@gmail.com>
Add comment and handle drop error
Signed-off-by: DK Liao <dklassic@gmail.com>
Add doc comment
Signed-off-by: DK Liao <dklassic@gmail.com>
Allow make_current to propagate Error
Signed-off-by: DK Liao <dklassic@gmail.com>
Fix all make_current occurances
Signed-off-by: DK Liao <dklassic@gmail.com>
Move back to Rc<dyn RenderingContext>
Signed-off-by: DK Liao <dklassic@gmail.com>
fix android/ohos
Signed-off-by: DK Liao <dklassic@gmail.com>
Fix build
Signed-off-by: DK Liao <dklassic@gmail.com>
fix android/ohos again
Signed-off-by: DK Liao <dklassic@gmail.com>
* Fix macOS smoke test
Signed-off-by: DK Liao <dklassic@gmail.com>
* Add comment for create_texture and destroy_texture
Signed-off-by: DK Liao <dklassic@gmail.com>
* Improve comments written
Signed-off-by: DK Liao <dklassic@gmail.com>
---------
Signed-off-by: DK Liao <dklassic@gmail.com>
|
|
|
|
|
| |
This fixes a variety of clippy issues that show up on the Android build.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ohos: Add event for page loaded
We can use this to check if we succeeded.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* CI: Test OpenHarmony on self-hosted runner
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* fix typo
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement WebResourceRequested Event on the Embedder Layer
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* fix and add test
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* resolve comments
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* remove sample code in webview
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* remove typo
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* ./mach format
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* fix test fail caused by interception message
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
* update impl for is_for_main_frame
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
---------
Signed-off-by: zhuhaichao518 <zhuhaichao518@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* implement ClipboardEvent interface
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* draft implementation of clipboard events
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* handle received clipboard events inside html elemtents
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* use rustdoc style
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* fix compilation errors due to rebase
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* update arboard crate
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* improve paste events
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* code cleanup
revert arboard crate's update, handle text only
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* restrict visibility of some methods to script crate
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* propagate CanGc argument
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* simplify handle_clipboard_msg
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* remove code duplication
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* fix potential borrow hazard
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* add clipboard_event pref, restore unit test code
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* retrict visibility of some document's methods
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* check if clipboardevent is trusted
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* enable clipboardevent
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* fix compilation for egl ports
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
---------
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Use xcomponent exclusively via `xcomponent_sys` instead of
using some of the APIs from ohos-sys.
ohos-sys simply re-exports xcomponent-sys,
so using both makes updating either difficult.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
|