Commit graph

64846 commits

Author SHA1 Message Date
Timothy Flynn
80c6268431 Meta+LibJS: Upgrade to prettier version 3.3.3
Prettier v3 was released over a year ago, and most users will have it by
default by now.
2024-11-06 15:10:27 -05:00
Timothy Flynn
deb5947fc0 Meta: Fix regex version check in the lint-prettier script
If your local version is 3.2.0, this check would errantly pass.
2024-11-06 15:10:27 -05:00
Sam Atkins
f61a41d7a6 Meta: Add imported WPT ref tests to .prettierignore 2024-11-06 20:03:38 +01:00
Sam Atkins
8f21513902 Tests: Re-import tests that used ahem.css
This causes 36 new subtests to pass locally. :^)

Unfortunately at least one of these is flaky when it's able to load the
font file, apparently because we don't wait for the font and its
stylesheet to actually load before the tests run.
2024-11-06 20:03:38 +01:00
Sam Atkins
f2407cd511 Meta: Support importing WPT ref tests that use an absolute path
For example, a few ref tests have a match like this:
```
<link rel="match"
      href="/css/reference/ref-filled-green-100px-square-only.html">
```

Previously we'd interpret this as `http://css/reference/...` which made
the test runner sad.
2024-11-06 20:03:38 +01:00
Sam Atkins
8673dd4e6e Meta: Include stylesheets and stylesheet-includes in WPT imports
Because of this we no longer have to handle ahem.css in a special way.

This should find:
- <link rel=stylesheet>
- CSS `@import`s
- Any resources linked from a stylesheet with `url()`

There's a good chance there are other resources we'll want to copy too,
but CSS was a big hole.
2024-11-06 20:03:38 +01:00
Sam Atkins
a8b3d363cc Tests: Annotate reasons for skipping LibWeb tests
Eventually we want to stop skipping these, so it's helpful to know why
they were skipped in the first place. :^)

I've grouped them together by reason, so the order has changed a little.

For some of these the reason isn't clear.
2024-11-06 20:03:38 +01:00
Gingeh
f88f41cf1e LibWeb: Reject invalid processing instructions 2024-11-06 18:48:50 +01:00
Andrew Kaster
80d9949264 CMake: Add a Fuzzers preset for building fuzzers locally 2024-11-06 10:38:57 -07:00
Andrew Kaster
a283a4fce5 Meta: Add overlay port for skia to patch generated skparagraph.gni
This works around an issue in upstream skia where a debug build with
dynamic libraries includes an extra file in the skparagraph module
that is not compilable on macOS.
2024-11-06 10:38:57 -07:00
Andrew Kaster
064e85a373 Meta: Bump simdutf to version 5.6.0
With luck, this will blast the old vcpkg cache for simdutf in
github actions and allow us to move forward with the new dynamic
linking support.
2024-11-06 10:38:57 -07:00
Timothy Flynn
d86693158a Meta: Use dynamic vcpkg linkage for release builds
By using static linkage, we are opening ourselves up to ODR violations
that result in runtime crashes (rather than build-time link errors). For
example, we've seen this happen while trying to use Skia context in both
LibGfx and LibWeb.
2024-11-06 10:38:57 -07:00
Timothy Flynn
5681dbee64 Meta: Move the vcpkg installation/cache directories under Build
In addition to changing the build-type dependent build directories, we
can take this opportunity to move the vcpkg cache directory to the Build
folder itself. This probably isn't 100% needed, but it ensures that no
leftover artifacts are used from non-dynamic vcpkg builds, and it's also
generally nice to have all build artifacts under Build.
2024-11-06 10:38:57 -07:00
Timothy Flynn
4ffca2089e Meta: Change the default build directories to exclude "ladybird" prefix
The reason for this change is that CMake/vcpkg are unable to detect a
change to VCPKG_LIBRARY_LINKAGE. So when we switch to dynamic builds,
the switch would be non-functional, and every developer would have to
remove their Build and vcpkg cache directories manually. By changing
these directories, vcpkg is able to detect it must rebuild.
2024-11-06 10:38:57 -07:00
Andrew Kaster
dfd928a8f8 CMake: Install simdutf runtime components as required
Using install(IMPORTED_RUNTIME_ARTIFACTS), we can re-export the
shared library and frameworks we imported from outside the build
tree into our install treer. This is required for simdutf as it
is a dependency of the AK library, and we need liblagom-ak.so to
be loadable when doing fuzzer and cross-compile builds for the
Lagom tools.
2024-11-06 10:38:57 -07:00
Timothy Flynn
35639ebc77 Meta: Update libpng to version 1.6.43#3
This is a fix to the vcpkg package itself to fix some exported symbols.
2024-11-06 10:38:57 -07:00
Timothy Flynn
3d200296e3 Meta: Update vcpkg to the October 2024 release 2024-11-06 10:38:57 -07:00
Aliaksandr Kalenik
2a29e348c9 LibWeb: Delete EditableTextNodeOwner
It's no longer needed after FormAssociatedTextControlElement became
responsible for managing input events for text controls.
2024-11-06 18:05:11 +01:00
Timothy Flynn
34c0303ae1 Revert "LibWeb: Make WebDriver's script executor public"
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This reverts commit e41c668435.
2024-11-06 08:42:17 -05:00
Timothy Flynn
94a0f36b3e Revert "WebContent: Restore ability to use Inspector accessors like $0"
This reverts commit ae1c58fad1.
2024-11-06 08:42:17 -05:00
Timothy Flynn
d40b7d67b1 Revert "LibJS+LibWeb: Remove now-unused lexical environment override"
This reverts commit d39f6975f9.
2024-11-06 08:42:17 -05:00
Sam Atkins
b09b23a162 LibWeb/CSS: Avoid double promotion in CSSColorValue code
Co-authored-by: Nico Weber <thakis@chromium.org>
2024-11-06 11:48:48 +00:00
Piotr
06154b87dd LibWeb: Support for "content-language" http-equiv state
Implemented support for setting the pragma-set default language in the
`<meta/>` tag with an `http-equiv` attribute `content-language`.
2024-11-06 10:56:57 +01:00
Timothy Flynn
413cf6b329 LibWeb+LibWebView+WebContent: Remove unused back/forward navigation IPCs 2024-11-06 10:54:17 +01:00
Timothy Flynn
1a8a3979f9 WebContent: Implement the WebDriver Forward endpoint according spec 2024-11-06 10:54:17 +01:00
Timothy Flynn
d867cd26c4 WebContent: Implement the WebDriver Back endpoint according spec 2024-11-06 10:54:17 +01:00
Timothy Flynn
d4966bc2d8 LibWeb: Add a document observer for pageHide/pageShow events
WebDriver will need to "block" until a pageShow event occurs in some
cases.
2024-11-06 10:54:17 +01:00
Timothy Flynn
3afd88330b WebContent: Handle user prompts in the Take Screenshot endpoint
This is a spec issue, and WPT relies on this behavior.
2024-11-06 10:50:33 +01:00
Timothy Flynn
f4111ef1e1 LibWeb: Implement pausing the event loop a bit closer to the spec
Namely, this is to update the rendering before pausing the event loop.
2024-11-06 10:50:33 +01:00
Andreas Kling
5431db8c1c LibWeb: Avoid unnecessary style recomputation during traversal
While traversing the DOM tree, looking for nodes that need a style
update, we were recomputing style for every node visited along the way,
even nodes that didn't themselves need a style update (but one of their
descendants did).

This avoids a bunch of completely unnecessary style recomputation on
basically every website.
2024-11-06 10:49:32 +01:00
Jonne Ransijn
0de9818470 LibWeb: Remove most of the copying of CSS::Parser::ComponentValue
This class was being copied all over the place, however, most of these
cases can be easily prevented with `auto const&` or `NonnullRawPtr<>`.

It also didn't have a move constructor, causing `Vector` to copy on
every resize as well.

Removing all these copies results in an almost 15% increase in
performance for CSS parsing, as measured with callgrind.
2024-11-06 09:43:15 +00:00
Jonne Ransijn
e50b9f5478 AK: Add NonnullRawPtr<T> abstraction
It is a non-null `T*` with reference semantics.
Or a `T&` whose address can be copied and re-assigned.
Or a `NonnullRefPtr` whose memory is not managed.

It can be useful when you want to store a reference in a
data structure that needs to be copyable or assignable.
2024-11-06 09:43:15 +00:00
Jonne Ransijn
90b2142658 LibWeb: Make CSS::Parser::ComponentValue immutable
`ComponentValue` instances are never mutated, so let's make them
immutable to indicate that they could potentially be cached in the
future.
2024-11-06 09:43:15 +00:00
Jonne Ransijn
138135e0e6 LibWeb: Fix accidental copy in ComponentValue constructors
These values were being copied, despite being passed in as r-value
references.
2024-11-06 09:43:15 +00:00
Hermes Junior
5dabd468ed LibWeb: Fix out-of-bound crash when there's more table cells than cols
Added a getter to ensure we are within a valid range.
This behavior is accepted by other browsers,
and crashed on some pages.
2024-11-06 09:36:33 +00:00
Gingeh
cd5d8f4d95 LibWeb: Handle steps(x, start) like steps(x, jump-start) 2024-11-06 09:27:53 +00:00
Pavel Shliak
672590c360 Tests: Remove duplicated test for FloatingPointParsing 2024-11-06 09:22:44 +00:00
Pavel Shliak
5fe1d38955 Tests: Remove duplicated test for UnicodeCharacterTypes 2024-11-06 09:22:44 +00:00
Pavel Shliak
cf5521ec68 Tests: Remove duplicated test for StringView 2024-11-06 09:22:44 +00:00
Gingeh
453e034801 LibXML: Read code points when parsing names 2024-11-06 10:07:52 +01:00
Aliaksandr Kalenik
42b31820a6 LibWeb: Use UTF-16 code units length in CharacterData::replace_data()
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Range API uses UTF-16 code units to represent offsets, so replace_data()
needs to use it instead of bytes count while calculating new offsets.

Fixes incorrectly thrown exception when non-latin string is passed into
replace_data().
2024-11-06 05:46:30 +00:00
Tim Schumacher
f7dfe03cf6 Meta: Step down myself from maintainers
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Build Dev Container Image / build (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-05 20:04:13 +01:00
Timothy Flynn
185255efc3 WebContent: Close top-level traversables asynchronously
The spec is a bit out-of-date here, so this works around an issue with
closing top-level traversables while a dialog is open in another window
within the same agent.
2024-11-05 10:58:34 -07:00
Timothy Flynn
4c61ce5b10 WebDriver: Don't remove windows if attempting to close the window failed
For example, if a dialog is open and the session is configured to ignore
dialogs (instead of automatically closing them), then the Close Window
endpoint will have failed. We can't remove the client-side window handle
in that case.
2024-11-05 10:58:34 -07:00
Timothy Flynn
7f4d2ef0d6 WebDriver: Pass capability-related options along to new windows 2024-11-05 10:58:34 -07:00
Timothy Flynn
d66b54fec5 WebContent+WebDriver: Transfer WebDriver capability init to Session
Capabilities are configured on a per-session basis, but we were only
applying these options to the first WebContent process created. We will
need to pass these options to new windows created from that process.
This patch re-organizes capability processing so that our session can
remember them for new windows.
2024-11-05 10:58:34 -07:00
Sam Atkins
f5d67cefc1 Tests: Import a couple of CSS nesting tests from WPT
This is partly to check that importing ref tests works, and that I
didn't break the text-test import.
2024-11-05 17:58:16 +00:00
Sam Atkins
7a5b38d577 Meta: Support importing WPT reference tests 2024-11-05 17:58:16 +00:00
Shannon Booth
9598ed1d17 LibWeb: Hook up the HostInitializeShadowRealm callback
This is enough for a basic shadow realm to work :^)

There is more that we still need to implement here such as module
loading and fixing up the global object, but this is enough to get some
basic usage working.
2024-11-05 10:43:08 -07:00
Shannon Booth
b24cd3ecf6 LibWeb: Wire up synthetic realm to settings object and execution context 2024-11-05 10:43:08 -07:00