Commit graph

64906 commits

Author SHA1 Message Date
Timothy Flynn
1417314aa9 WebContent: Do not coerce element properties to strings for WebDriver
We want the "raw" value here. The spec sort of assumes we are sending JS
values over the wire, whereas we are actually sending AK::JsonValue. So
using the JSON clone AO here is our best bet.
2024-11-06 20:44:19 -05:00
Timothy Flynn
33a00f45fd WebContent: Ensure the document's style is up to date for WebDriver
Otherwise, we have a timing issue retrieving computed styles.
2024-11-06 20:44:19 -05:00
Timothy Flynn
ecaacd2adf LibWeb+WebContent: Update our list of boolean attributes for WebDriver
Chromium has a larger list of boolean attributes, and WPT depends on it.
We must also compare attribute names case-insensitively.

Note this method is only used by WebDriver.
2024-11-06 20:44:19 -05:00
Andreas Kling
81e75530d9 LibWeb: Make :nth-* selectors match children of non-elements
Some checks failed
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
Build Dev Container Image / build (push) Has been cancelled
This was covered by WPT, which caught us not allowing :nth-child(1)
to match the root HTML element, and other similar issues.
2024-11-06 21:42:53 +01:00
Andreas Kling
eeba30f988 LibWeb: Allow :link and :any-link to match SVG <a> elements 2024-11-06 21:42:53 +01:00
Andreas Kling
92d9907f8f LibWeb: Add style invalidation for :target, :focus, :active and :link 2024-11-06 21:42:53 +01:00
Andreas Kling
1045000c28 LibWeb: Style invalidation for DOM node removal needs to happen earlier
We can't invalidate after the removal has taken effect, since that means
invalidation won't be able to find potentially affected siblings and
ancestors by traversing from the invalidation target.
2024-11-06 21:42:53 +01:00
Andreas Kling
adfc69bc67 LibWeb: Add style invalidation for :defined selector 2024-11-06 21:42:53 +01:00
Andreas Kling
6c945fc353 Tests: Import more CSS selector tests from WPT 2024-11-06 21:42:53 +01:00
Andreas Kling
9dff6bca1f Tests: Import more style invalidation tests from WPT
These will help us work on style invalidation with more confidence.
2024-11-06 21:42:53 +01:00
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