Commit graph

374 commits

Author SHA1 Message Date
Oriol Brufau
27c40fcd29
layout: Don't let table grid boxes inherit display: inline-table (#35264)
The outer display type of a table element applies to the table wrapper
box. The table grid box needs to be block-level as defined in
https://drafts.csswg.org/css-tables/#table-grid-box

Therefore this sets `display: table` on table grid boxes, and then when
painting collapsed table borders we can use the usual logic to compute
the StackingContextSection.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-02-03 17:11:49 +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
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
Martin Robinson
7256590599
Remove resources/prefs.json (#34999)
This file is not used any longer.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-16 07:38:58 +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
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
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
Daniel Adams
79a2f070ed
Enable SubtleCrypto by default (#34294)
* Enable SubtleCrypto by default

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

* Update interfaces/manifest

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-11-19 21:01:51 +00:00
Martin Robinson
0eda2de19f
style: Add support for is() and where() selectors (#34066)
Additionally, changes now need to be made to `servo.css` in order to
ensure that `<button>` text is centered the same way that it is for
`<input type=button>`. In the past the rule for centering text for the
latter was ignored because it used `:is()`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-11-19 14:05:46 +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
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
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
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
Daniel Adams
4c3b3529a8
servoshell: Update gilrs version, enable gamepad pref by default (#33466)
* Update gilrs version, enable pref by default

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

* Add core-foundation to servo-tidy ignore

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

* Update manifest

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-17 05:52:19 +00:00
Martin Robinson
db0aee6b58
layout: <th> should have text-align: center when the child of an element with text-align: initial (#33427)
This behavir is enabled via a special CSS value that we can share with
Gecko.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-12 19:28:31 +00:00
Daniel Adams
5ffdce9aee
servoshell: Enable OpenXR by default and remove old WebVR prefs, adjust XrDiscovery initialization (#33245)
* Remove WebVR prefs, enable OpenXR by default

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

* Prefer OpenXR if available, otherwise use GLWindow

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-29 05:06:57 +00:00
webbeef
1b48bd18aa
Basic tab strip for the minibrowser (#33100)
This implements a simple tab system for servoshell:
- The egui part uses the built-in SelectableLabels components and
  display the full tab title on hover.
- WebView structs now hold all the state for each WebView. When we
  need "global" state, we return the focused WebView state, eg.
  for the load status since it's still global in the UI.
- New keyboard shortcut: [Cmd-or-Ctrl]+[W] to close the current tab.
- New keyboard shortcut: [Cmd-or-Ctrl]+[T] to create a new tab.
- The new tab content is loaded from the 'servo:newtab' url using a
  couple of custom protocol handlers.

Signed-off-by: webbeef <me@webbeef.org>
2024-08-27 20:17:33 +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
Daniel Adams
e85491b5fc
Allow prefs to be overridden from a file and set WPT-specific prefs from file (#33163)
* Allow prefs to be passed in from a separate file

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

* Add wpt-prefs.json for setting WPT-specific prefs

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

* fix argument to read_prefs_file

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

* Update test_parse_pref test

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

* Add line in executorservo.py to read from wpt-prefs.json

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

* Update MANIFEST.json

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

* Update expectations

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

* Disable dom.webxr.test for interfaces test

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-24 06:47:57 +00:00
Martin Robinson
56280c6242
layout: Add initial support for bidirectional text (BiDi) (#33148)
This adds supports for right-to-left text assigning bidi levels to all
line items when necessary. This includes support for the `dir` attribute
as well as corresponding CSS properties like `unicode-bidi`. It only
implements right-to-left rendering for inline layout at the moment and
doesn't include support for `dir=auto`. Because of missing features,
this causes quite a few tests to start failing, as references become
incorrect due to right-to-left rendering being active in some cases,
but not others (before it didn't exist at all).

Analysis of most of the new failures:

```
- /css/css-flexbox/gap-001-rtl.html
  /css/css-flexbox/gap-004-rtl.html
 - Require implementing BiDi in Flexbox, because the start and
   end inline margins are opposite the order of items.

- /css/CSS2/bidi-text/direction-applies-to-*.xht
  /css/CSS2/bidi-text/direction-applies-to-002.xht
  /css/CSS2/bidi-text/direction-applies-to-003.xht
  /css/CSS2/bidi-text/direction-applies-to-004.xht
  - Broken due to a bug in tables, not allocating the
    right amount of width for a column.

- /css/css-lists/inline-list.html
  - This fails because we wrongly insert a soft wrap opportunity between the
    start of an inline box and its first content.

- /css/css-text/bidi/bidi-lines-001.html
  /css/css-text/bidi/bidi-lines-002.html
  /css/CSS2/text/bidi-flag-emoji.html
  - We do not fully support unicode-bidi: plaintext

- /css/css-text/text-align/text-align-end-010.html
  /css/css-text/text-align/text-align-justify-006.html
  /css/css-text/text-align/text-align-start-010.html
  /html/dom/elements/global-attributes/*
  - We do not support dir=auto yet.

- /css/css-text/white-space/tab-bidi-001.html
  - Servo doesn't support tab stops

- /css/CSS2/positioning/abspos-block-level-001.html
  /css/css-text/word-break/word-break-normal-ar-000.html
  - Do not yet support RTL layout in block

- /css/css-text/white-space/pre-wrap-018.html
  - Even in RTL contexts, spaces at the end of the line must hang and
    not be reordered

- /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html
  - We are letting spaces hang with white-space: pre, but they shouldn't
    hang.
```

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-21 14:28:54 +00:00
Daniel Adams
825d6f10e9
webxr: Update hand input to match latest spec (#32958)
* Update IDLs

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

* Update XRHand and XRJointSpace methods/bindings

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

* Implement fillJointRadii

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

* Implement fillPoses

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

* Formatting

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

* Update test expectations

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

* Tidy, missing spec link

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

* Remove idlharness expectation files, update hands pref

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

* Update interfaces

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

* XRJointPose interface

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

* XRHand interface

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

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-14 22:45:45 +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
Martin Robinson
569fd5d8b5
Upgrade stylo to 2024-07-16 (#32812)
* Upgrade stylo to 2024-07-16

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

* Use the new `dom` crate from stylo

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

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-07-24 14:37:08 +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
959ffad99a
layout: Add support for table captions (#32657)
This adds initial support for table captions. To do this, the idea of
the table wrapper becomes a bit more concrete. Even so, the wrapper is
still reponsible for allocating space for the grid's border and padding,
as those properties are specified on the wrapper and not grid in CSS.

In order to account for this weirdness of HTML/CSS captions and grid are
now laid out and placed with a negative offset in the table wrapper
content rect.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-07-03 18:24:19 +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
Martin Robinson
44064b1439
layout: Add very basic support for showing text in input boxes (#32365)
This only paints text in input fields. Selection and cursor are still
not painted.

In addition to adding this feature, the change also updates the
user-agent.css with the latest from the HTML specification. Extra
padding and extraneous settings (such as a bogus line-height and
min-height) are also removed from servo.css. This leads to some new
passes.

There are some new passes, this introduces failures as inserting text
reveals issues that were hidden before. Notably:

- failures in `/html/editing/editing-0/spelling-and-grammar-checking/`:
  We do not support spell-checking.
- Most of the rest of the new failures are missing features of input
  boxes that are also missing in legacy layout.
2024-06-20 10:13:50 +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
Oriol Brufau
b30b79a93a
Cleanup UA styles for anonymous table rows and cells (#31661)
These properties were being set to their initial value, this wasn't
needed because they are non-inherited properties and there isn't
anything else setting them.
2024-03-14 11:53:27 +00:00
Martin Robinson
49ae9bb442
layout: Fix the pseudo for anonymous tables (#31578)
Anonymous tables should not use legacy pseudos, as the legacy layout
engine had them inherit lots of random properites that lead to bad
layout in the new layout engine.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-08 10:32:51 +00:00
Oriol Brufau
007a31c1b5
Enable CSS Tables by default (#31470)
And remove the pref `layout.tables.enabled`.
2024-03-07 10:09:10 +00:00
Sebastian C
0342d6beb0
<hr> elements are expected to have a default overflow:hidden (#31297)
* <hr> elements are expected to have a default overflow:hidden
See https://github.com/whatwg/html/pull/2724

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Use full defined hr style

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* update legacy test expectation

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2024-02-10 21:27:50 +00:00
Mukilan Thiyagarajan
d8958f9693
android: disable JIT in SM to workaround #31134 (#31270)
The crash when loading servo.org happens in the JIT code
emitted by SM's CacheIRCompiler to invoke the VM function
`ProxyGetPropertyByValue`.

To disable this code path, it is not sufficient to disable
just the baseline JIT (which exposed in servo under the
pref `js.baseline.enabled`) but also the baseline
interpreter which is controlled by a different flag in SM.

This PR disables renames the `js.baseline.enabled` pref in
Servo to `js.baseline_jit.enabled` and introduces a new
pref `js.baseline_interpreter.enabled` that controls the
baseline interpreter.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-02-07 03:59:28 +00:00
Martin Robinson
81f5157522
Add support for table fixups (#30868)
This adds support for fixing up tables so that internal table elements
that are not properly parented in the DOM have the correct box tree
structure according to the CSS Table specification [1]. Note that this
only comes into play when building the DOM via script, as HTML 5 has its
own table fixups that mean that the box tree construction fixups here
are not necessary.

There are no tests for this change. In general, it's hard to write tests
against the shape of the box tree, because it depends on the DOM. We
plan to test this via WPT tests once layout is complete.

1. https://drafts.csswg.org/css-tables/#table-internal-element

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-12-22 12:11:58 +00:00
Martin Robinson
f0b4162328
Add initial support for table box tree construction (#30799)
This is the first part of constructing the box tree for table layout. No
layout is actually done and the construction of tables is now hidden
behind a flag (in order to not regress WPT).  Notably, this does not
handle anonymous table part construction, when the DOM does not reflect
a fully-formed table. That's part two.

Progress toward #27459.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Manish Goregaokar <manishsmail@gmail.com>
2023-12-05 11:10:45 +00:00
Oriol Brufau
733222fffe Further changes required by Servo 2023-11-24 08:57:14 +01:00
Martin Robinson
fd31da9102
Anonymous boxes that wrap inlines should not inherit overflow (#30579)
In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.

This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.

Fixes #30562.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-10-19 13:43:55 +00:00
Ngo Iok Ui (Wu Yu Wei)
38a325cc1c
Add shell.background-color.rgba to prefs (#30488)
* Add shell.transparent-background.enabled to prefs

* Rename config to background_color

* Rename to background-color and.rgba add PrefValue::Array variant
2023-10-04 13:16:16 +00:00
Ennui Langeweile
80d9a2bb4f
Treat the keygen element as obsolete (#30429)
* Eradicate the `keygen` element

* Run `./mach fmt`

* Fix relevant Servo test

* Fix outdated manifest
2023-09-26 21:37:46 +00:00
Delan Azabani
c3c6c95a9b
constellation: crash to a new “sad tab” error page (#30290)
* constellation: crash to a new “sad tab” page

* check in resources/crash.html

* use a separate enum variant instead of keying on reason

* fmt + tidy

* rename Resource::Crash to Resource::CrashHTML

* clean up crash page and add details (reason + backtrace)

* avoid repeating crash errors in script::script_thread warn log

* make new LoadData init more idiomatic

* clarify comments and new fields

* fix doc comment style
2023-09-06 09:52:37 +00:00
Atbrakhi
37923d7fa3
remove minibrowser from prefs (#30127) 2023-08-19 08:29:44 +00:00
Martin Robinson
bce7622cde
Switch to rustls and webpki-roots (#30025)
This change replaces OpenSSL with rustls and also the manually curated
CA certs file with webpki-roots (effectively the same thing, but as a
crate).

Generally speaking the design of the network stack is the same. Changes:

- Code around certificate overrides needed to be refactored to work with
  rustls so the various thread-safe list of certificates is refactored
  into `CertificateErrorOverrideManager`
- hyper-rustls takes care of setting ALPN protocols for HTTP requests,
  so for WebSockets this is moved to the WebSocket code.
- The safe set of cypher suites is chosen, which seem to correspond to
  the "Modern" configuration from [1]. This can be adjusted later.
- Instead of passing a string of PEM CA certificates around, an enum is
  used that includes parsed Certificates (or the default which reads
  them from webpki-roots).
- Code for starting up an SSL server for testing is cleaned up a little,
  due to the fact that the certificates need to be overriden explicitly
  now. This is due to the fact that the `webpki` crate is more stringent
  with self-signed certificates than SSL (CA certificates cannot used as
  end-entity certificates). [2]

1. https://wiki.mozilla.org/Security/Server_Side_TLS
2. https://github.com/briansmith/webpki/issues/114

Fixes #7888.
Fixes #13749.
Fixes #26835.
Fixes #29291.
2023-08-08 14:00:10 +00:00
Atbrakhi
4bf2bca167
Minibrowser: Introduce minibrowser.enabled prefs (#29995)
* Introduce minibrowser.enabled prefs

* commit signoff
2023-07-13 14:24:33 +00:00
Martin Robinson
d31cdb682f
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2023-07-06 14:49:24 +02:00