Commit graph

246 commits

Author SHA1 Message Date
Martin Robinson
54b5c7b632
compositing: Move image output and shutdown management out of the compositor (#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>
2025-02-20 18:27:49 +00:00
Mukilan Thiyagarajan
56840e0a35
script: add skeleton implementation of FontFace API (#35262)
This patch implements the `FontFace` interface, but with some caveats

1. The interface is only exposed on `Window`. Support for Workers will
   be handled in the future.
2. The concept of `css-connected` `FontFace` is not implemented, so
   `@font-face` rules in stylesheets will not be represented in the DOM.
3. The constructor only supports using `url()` strings as source
   and `ArrayBuffer` and `ArrayBufferView` are not supported yet.

A skeleton implementation of the `load` method of `FontFaceSet` is also
implemented in this patch. The intention is to support some web pages
that don't load without this method.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-19 05:50:01 +00:00
Jason Tsai
22c3a63737
feat: add Notification Web API binding (#34842)
* feat: add Notification Web API binding

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: update spec link

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: fix clippy

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: index overflow

Signed-off-by: Jason Tsai <git@pews.dev>

* test(tidy): add notification WebIDL standard URL

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: allow crown::unrooted_must_root

Signed-off-by: Jason Tsai <git@pews.dev>

* implement GetPermission

Signed-off-by: Jason Tsai <git@pews.dev>

* fix silent type

Signed-off-by: Jason Tsai <git@pews.dev>

* add all properties

Signed-off-by: Jason Tsai <git@pews.dev>

* test: add Notification to global

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: update wpt manifest and fix clippy

Signed-off-by: Jason Tsai <git@pews.dev>

* test: temp skip notifications

Signed-off-by: Jason Tsai <git@pews.dev>

* add vibration and apply suggestions

Signed-off-by: Jason Tsai <git@pews.dev>

* partially implement RequestPermission

Signed-off-by: Jason Tsai <git@pews.dev>

* call Permission request permission algorithm

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: pub crate Notification

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: fix clippy

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: crown attribute

Signed-off-by: Jason Tsai <git@pews.dev>

* fix part of suggestions

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: store private `Action` structure

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: fix typo

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: serialize images URL

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: use globalscope as environment settings object

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: add pref `dom_notification_enabled` and default to disabled

Signed-off-by: Jason Tsai <git@pews.dev>

* fix: use `descriptor_permission_state`

Signed-off-by: Jason Tsai <git@pews.dev>

* apply suggestions

Signed-off-by: Jason Tsai <git@pews.dev>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>

* test: remove passed meta

Signed-off-by: Jason Tsai <git@pews.dev>

* test: enable notification prefs in mozilla tests

Signed-off-by: Jason Tsai <git@pews.dev>

---------

Signed-off-by: Jason Tsai <git@pews.dev>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-02-18 16:56:57 +00:00
Martin Robinson
ebd471bb55
deps: Remove some unused Cargo.toml (#35466)
These were discovered with cargo-machete.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-14 15:33:14 +00:00
Martin Robinson
ed597d8137
prefs: Stop precaching WebRender shaders by default (#35431)
In #34998, I inadvertantly enabled shader precaching by default during a
cleanup. This change reverts that particular mistake.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-12 08:28:41 +00:00
Martin Robinson
118a813dba
servoshell: Move initial_window_size and screen_size_override into ServoShellPreferences from Opts (#35407)
These settings just configure `servoshell` so should be in
`ServoShellPreferences` instead.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-10 20:48:48 +00:00
Martin Robinson
75cf3d7265
dom: Always replace unpaired surrogates when handling page text (#35381)
Background:

> JavaScript strings are potentially ill-formed UTF-16 (arbitrary
> Vec<u16>) and can contain unpaired surrogates. Rust’s String type is
> well-formed UTF-8 and can not contain any surrogate. Surrogates are
> never emitted when decoding bytes from the network, but they can sneak
> in through document.write, the Element.innerHtml setter, or other DOM
> APIs.

In 2015, Servo launched an experiment to see if unpaired surrogates
cropped up in page content. That experiment caused Servo to panic if
unpaired surrogates were encountered with a request to report the page
to bug #6564. During that time several pages were reported with unpaired
surrogates, causing Servo to panic. In addition, when running the WPT
tests Servo will never panic due to the `-Z replace-surrogates` option
being passed by the test driver.

Motivation:

After this 10 year experiment, it's clear that unpaired surrogates are a
real concern in page content. Several reports were filed of Servo
panicking after encountering them in real world pages. A complete fix for
this issue would be to somehow maintain unpaired surrogates in the DOM,
but that is a much larger task than simply emitting U+FFD instead of an
unpaired surrogate.

Since it is clear that this kind of content exists, it is better for
Servo to try its best to handle the content rather than crash as
production browsers should not crash due to user content when possible.
In this change, I modify Servo to always replace unpaired surrogates.

It would have been ideal to only crash when debug assertions are
enabled, but debug assertions are enabled by default in release mode --
so this wouldn't be effective for WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-09 08:56:05 +00:00
Martin Robinson
e227e0913b
servoshell: Move headless setting to ServoShellPreferences (#35377)
This is only used in servoshell, even though it was plumbed through
script previously. It's just about how the `RenderingContext` is set up,
which is something managed entirely outside of servo itself.

In addition, make the name of `servo_shell_preferences` in `app.rs` more
consistent with the rest of the codebase.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-07 20:04:31 +00:00
Martin Robinson
e7a6691628
libservo: Enable file directory listing by default (#35317)
This is a useful feature to have in a browser engine, so I think it
should be enabled by default. I believe that the original concern was
that there was a security issue, but this certainly has the same
security concerns as normal file loading.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-06 10:05:04 +00:00
Shalvin
ec6c4bc8fd
Consolidated opts into a manual Default trait implementation (#35257)
Signed-off-by: Shalvin Deo <shalvin.deo@live.com>
2025-02-01 20:18:09 +00:00
Martin Robinson
2965b2fda7
Remove Preferences::network_tls_ignore_unexpected_eof (#35080)
This workaround was introduced to handle an issue with the WPT server,
but it seems that it is no longer needed. This change removes the
prefernce and the workarond code.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-20 13:07:54 +00:00
Josh Matthews
90cbb8abdb
config: Derive defaults for Opts. (#35057)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 09:23:36 +00:00
Martin Robinson
2d09552234
prefs: Move some DebugOptions to Preferences and clean up (#34998)
- Move options configuring antialiasing and WebRender shader precache to
  the `Preferences` to group them with other related WebRender and DOM
  settings.
- Remove the option to disable antialiasing for canvases. This was
  unused.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-17 11:47:47 +00:00
Gae24
d470f219b1
Implement Clipboard Event Api (#33576)
* 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>
2025-01-15 19:45:29 +00:00
Martin Robinson
28c9ceedf6
fonts: Remove synchronous web font loading functionality (#35000)
Synchronous web font loading is not specification compliant and was
added in #8341 to work around issues that do not exist any longer. This
change removes the functionality and ensures that WPT tests are run with
the spec compliant loader.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-15 11:16:43 +00:00
Martin Robinson
f5ef8aaed3
config: Remove legacy-layout and unused Preferences and Opts (#34994)
There are some preferences and options that are only used by legacy
layout or not used at all. This PR removes them.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 20:12:14 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
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>
2025-01-14 13:54:06 +00:00
Ngo Iok Ui (Wu Yu Wei)
da2074e5d6
webxr: create glwindow with Rc window and without rendering context (#34813)
* Create webxr glwindow with Rc window

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Remove obselte gurad type

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Update GlWindow trait method

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>

* Update how webxr discorvery is created

Now glwindow will create a hidden window. It's better to not use it
unless we really want to use this port.

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Link back to upstream webxr repo

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yuwei <yuweiwu@pm.me>
2025-01-03 03:01:30 +00:00
Josh Matthews
bc2def0582
script: Add stub interface for AbortController. (#34519)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: syvb <me@iter.ca>
2024-12-10 07:31:04 +00:00
Ville Lindholm
bc7fe41a02
Add XPath parser/evaluator (#34463)
* Add XPath parser/evaluator

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* Correctly annotate XPathEvaluator IDL

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: have bindings pass in `can_gc`

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: implement PartialEq for Value for readability

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add docstrings for CoreFunctions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: simplify node test code

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: add unit tests for string handling xpath functions

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* put xpath features behind dom.xpath.enabled pref

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review] remove rstest and insta dev-deps

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* [PR review]: tweak metadata files

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

* update wpt test expectations AGAIN

Signed-off-by: Ville Lindholm <ville@lindholm.dev>

---------

Signed-off-by: Ville Lindholm <ville@lindholm.dev>
2024-12-08 02:01:50 +00:00
Jonathan Schwender
68a27946bf
Add prefs to limit threadpool sizes (#34478)
* Add prefs to limit threadpool sizes

Add preferences to control the size of threadpools,
so that we can easily reduce the amount of runtime
threads and test which pools benefit from more
threads.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Add pref for Webrender threadpool

Add a preference to limit the size of the webrender threadpool.
Note: WebRender by default calls hooks which register the threads with
a profiler instance that the embedder can register with webrender.
Servo currently doesn't register such a profiler with webrender,
but in the future we might also want to profile the
webrender threadpool.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-07 05:25:17 +00:00
Nico Burns
6cbd89dbb0
Layout: Implement CSS Grid using taffy (#32619)
* Add layout.grid.enabled pref

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add taffy dependency

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Import taffy <-> stylo conversion code from taffy_stylo crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Add `Grid` variant to DisplayInside

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Implement CSS Grid using Taffy

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import full stylo_taffy crate

Signed-off-by: Nico Burns <nico@nicoburns.com>

Squashed PR feedback changes

Deduplicate is_document_only_whitespace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Import taffy::AvailableSpace

Signed-off-by: Nico Burns <nico@nicoburns.com>

Rename FlexContext to TaffyContainerContext

Signed-off-by: Nico Burns <nico@nicoburns.com>

Eliminate references to flexbox in taffy/layout module

Signed-off-by: Nico Burns <nico@nicoburns.com>

Use constructors for geom types

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove comment about abspos elements splitting contiguous text runs

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove reference to flexbox in taffy/construct

Signed-off-by: Nico Burns <nico@nicoburns.com>

Deduplicate construction of flexbox/grid containers

Signed-off-by: Nico Burns <nico@nicoburns.com>

Make anonymous text runs InFlow

Signed-off-by: Nico Burns <nico@nicoburns.com>

Remove commented code

Signed-off-by: Nico Burns <nico@nicoburns.com>

Update comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

Inline/vendor the stylo/taffy interop code

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Update test expectations

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix nits from PR review

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2024-11-21 20:21:01 +00:00
Samson
873e82a532
Add js.disable_jit pref (#34231)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-13 06:50:30 +00:00
Jonathan Schwender
07aa561295
ohos: Remove unneeded dirs dependency in servo_config (#34166)
`dirs` does not support OpenHarmony, and it also seems that
there currently is no native API that `dirs` could use on
OpenHarmony and the directory needs to be read from ArkTS.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-11-06 15:58:46 +00:00
Martin Robinson
850e59f98e
servoshell: Allow overriding screen resolution with a command-line argument (#34038)
There is a command-line argument to override the default window size,
but not one for overriding the default screen resolution. This is
important for testing pages that use screen size to have different
behavior.

In addition to adding the new option this change:

 - Renames the `--resolution` command-line argument to `--window-size`
   to remove ambiguity with the `--screen-size` argument.
 - Passes the screen size as device independent (device pixels scaled by
   HiDPI factor) to Servo internals. Not only it make it simpler to pass
   the `--window-size` override, it makes more sense. Different screens
   can have different HiDPI factors and these can be different from the
   scale of the window. This makes the screen HiDPI factor totally
   independent of the one that Servo uses for the window.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-30 11:54:13 +00:00
Taym Haddadi
ee68dc2589
Support persisting unminified external stylesheets (#33919)
* Support local tweaking of external stylesheets

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Remove duplicated code between unminify_css and unminify_js

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Add License

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Use js-beautify instead of npx

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Fix clippy warning

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-10-30 11:12:20 +00:00
Martin Robinson
3b5dc069ae
dom: Stub out the IntersectionObserver interface (#33989)
This is the first step toward implementing the IntersectionObserver
interface. It adds stubs which are exposed when a preference is turned
on. This is enough to get some sites with `IntersectionObserver` to
start working.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-25 09:26:47 +00:00
Oriol Brufau
f05f1b3690
Implement transition-behavior (#33991)
Bump Stylo to https://github.com/servo/stylo/pull/84

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-10-24 20:34:10 +00:00
tanishka
66695d2f7e
clippy: Fix warnings in subtlecrypto.rs (#33943)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-21 10:43:47 +00:00
DK Liao
fee927475b
Remove some unused preferences (#33939)
Signed-off-by: DK Liao <dklassic@gmail.com>
2024-10-21 08:24:27 +00:00
Ngo Iok Ui (Wu Yu Wei)
b58cee48ce
doc(resources): Preferences, HstsPreloadList, RippyPNG (#33775)
* Set to default if Preferences and HstsPreloadList are empty

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Add documentation of Preferences, HstsPreloadList, RippyPNG

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Add warn log when setting prefs to default

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Add error log instead

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Add error log to HSTS preload list

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Apply suggestions from code review

Address a couple wording nits

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-10-10 18:19:41 +00:00
Daniel Adams
fc0d4d8157
crypto: Begin SubtleCrypto implementation (#33628)
* Update IDLs and Bindings conf

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add AES crate

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement DOM interfaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* IDL tidy

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove deriveKey from inRealms for now until implemented

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix CryptoKey rustdoc comments

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move string constants to top of file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Use properly rooted CryptoKey

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Code clarity

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Rework NormalizedAlgorithm to not hold a DOMString

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add Rustdoc for CryptoKey interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move ignore mallocsizeof to rand crate, remove from crypto

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update cargo lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix key handling, implement exportKey with JWK TODO

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Use create_buffer_source, remove aes dep from libservo

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix crash when running in worker

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Move CryptoKey and SubtleCrypto behind pref for now

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Readd timeout expectation

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-10-08 03:51:08 +00:00
Taym Haddadi
6aaca118a9
Drop support for '--no-minibrowser' mode (#33677)
* Drop support for '--no-minibrowser' mode

Signed-off-by: Taym <haddadi.taym@gmail.com>

* remove unused import

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-10-07 08:00:32 +00:00
Cristian Brinza
c7a4e4f627
net: Refactor Decoder (#33611)
* Refactor Decoder to be fully async

Signed-off-by: crbrz <cristianb@gmail.com>

* Update WPT results

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix deflate unit test

Signed-off-by: crbrz <cristianb@gmail.com>

* Add compressed response update count test

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix typo

Signed-off-by: crbrz <cristianb@gmail.com>

* Source error check without conversion to String

Signed-off-by: crbrz <cristianb@gmail.com>

* Simplify error check

Signed-off-by: crbrz <cristianb@gmail.com>

* Fix variable name

Signed-off-by: crbrz <cristianb@gmail.com>

* Added TODO note for network.tls.ignore_unexpected_eof

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-10-02 16:59:31 +00:00
Martin Robinson
aa0029c11c
Add rust-version to all Cargo.toml files (#33483)
This is another step preparing for building Servo without `mach`.

Fixes #33430.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-17 16:39:07 +00:00
Martin Robinson
7b7020a8d4
layout: Enable flexbox by default on non-legacy layout (#33186)
Flexbox is still very much in progress, but things are working well
enough that we can enable it by default. It improves most pages that use
flexbox now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-26 13:50:52 +00:00
Samson
4397d8a021
Add dom.allow_scripts_to_close_windows pref. (#33187)
It's also present in firefox: https://searchfox.org/mozilla-central/search?q=allow_scripts_to_close_windows

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-26 11:44:47 +00:00
Martin Robinson
f45c98496e
Upgrade font-kit, raqote, and stop using dirs-next (#33120)
`dirs-next` is still used by the version of the `term` crate we are
using, but this also remoes a version of `cstr` so our dependency count
does not change.

A new version of `raqote` hasn't been released, so this depends on the
upstream repository directly. It's been almost 4 months since the
release has been ready -- so it's unclear when it will happen.

Fixes #32801.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-19 12:16:28 +00:00
Hayashi Mikihiro
016ff5dfa6
Replace lazy_static crate with std::sync::LazyLock in layout and config (#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>
2024-08-15 16:28:04 +00:00
Samson
d132a0273d
Update mozjs (SpiderMonkey) to 128.0 (#32769)
* Update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix changed readTransfer callback

https://bugzilla.mozilla.org/show_bug.cgi?id=1842713
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use NewExternalArrayBuffer from glue

d33454be74
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix columnorigin and filename being in latin1

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup newexternalarray

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Float16 (this might require more work for codegen support)

https://bugzilla.mozilla.org/show_bug.cgi?id=1833647
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* js.strict is removed

https://bugzilla.mozilla.org/show_bug.cgi?id=1621603
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* asm options are now somewhere else

https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Comment out offthread compilation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set NDK to 26

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix 1-origin handling

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expect `FinalizationRegistry` interface

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `WeakRef` to interfaces expectation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* mozjs upgrade: fixes for Android

Android NDK's layout has changed in r26 and 'lib64' no longer exists
under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to
be it are now present in `lib` folder itself.

This patch updates the build configuration to use the `lib` folder
instead when configuring the LIBCLANG_PATH environment variable.

This patch also updates to a newer mozjs version that includes fixes for
linker errors faced on Android (see #32769).

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Patch libz-sys & update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update NDK version in README

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Use servo/mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update mozjs again

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-29 07:20:15 +00:00
Daniel Adams
9212ed203a
Enable OpenXR backend from the WebXR crate (#32817)
* Enable OpenXR backend from the WebXR crate

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Ensure openxr feature is only included on windows

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add cfgs for OpenXR usages

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-20 06:24:40 +00:00
Martin Robinson
77e9e3deba
fonts: Add support for generic font families and font size configuration (#32673)
This adds support for generic font families in Servo and allows for
configuration of them as well as their default font sizes. One
interesting fix here is that now monospace default to 13px, like it does
in other browsers.

In addition to that, this exposes a new interface in Stylo which allows
setting a default style. This is quite useful for fonts, but also for
other kinds of default style settings -- like text zoom.

Fixes #8371.
Fixes #14773.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 17:17:48 +00:00
Martin Robinson
4b63043c6a
clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
Martin Robinson
7ea894774f
Add a directory listing feature for file URLs (#32580)
Signed-off-by: Bobulous <Bobulous@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Bobulous <Bobulous@users.noreply.github.com>
2024-06-26 08:02:50 +00:00
Mukilan Thiyagarajan
ee2acaeacf
config: fix panic in PrefValue to [f64; 4] conversion (#32571)
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>
2024-06-20 08:47:13 +00:00
Martin Robinson
4a7f3bac7c
Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
Gregory Terzian
3d78d60619
implement basic infra for ResizeObserver (#31108) 2024-06-17 16:44:07 +00:00
Hieu Do
3d70243438
webgpu: Parse and forward backend prefs to wgpu (#32410)
Signed-off-by: Hieu Do <hieudn.uh@gmail.com>
2024-05-31 17:51:36 +00:00
Martin Robinson
55f908653f
compositor: Remove the is_running_problem_test setting (#31589)
These tests don't seem to time out any longer and this mechanism is
probably better served by some sort of adjustment to `RUST_LOG` in the
WPT harness.
2024-03-09 02:29:43 +00:00
eri
ef3dad3a61
clippy: fix warnings in components/config* (#31562) 2024-03-08 07:15:56 +00:00