Commit graph

64804 commits

Author SHA1 Message Date
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
Shannon Booth
c69a9812c8 LibWeb: Introduce the 'ShadowRealmGlobalScope' interface
This object represents the global object for a shadow realm. The IDL
generator will need to be adjusted to the '[Global]' extended attribute
and no '[Exposed]' field (the change in the test is not correct, as I
understand it), but this should be enough to get us started on
shadow realms.
2024-11-05 10:43:08 -07:00
Shannon Booth
b105c06824 LibWeb: Introduce a SyntheticHostDefined class
This class is the host defined field of a synthetic realm created as
part of a shadow realm.
2024-11-05 10:43:08 -07:00
Shannon Booth
5154df020b LibWeb: Rename Bindings::HostDefined to Bindings::PrincipalHostDefined
With the introduction of shadow realms, there will be two different
possible host defined objects. For clarity, rename the existing host
defined object to PrincipalHostDefined.
2024-11-05 10:43:08 -07:00
stasoid
16ab3c5f9d LibCore: Port DirIterator to Windows using vcpkg dirent.h 2024-11-05 10:42:44 -07:00
stasoid
cf198d0d60 Partially revert "LibCore: Add Windows version of DirIterator"
This reverts commit d92a96c40a, but
keeps changes to AK/Error{.h,.cpp} (function Error::from_windows_error)
2024-11-05 10:42:44 -07:00
Aliaksandr Kalenik
75e26af117 Tests/LibWeb: Import css grid alignment tests from WPT 2024-11-05 17:44:08 +01:00
Aliaksandr Kalenik
3833049fc8 Meta+Tests: Substitute Ahem font path in import-wpt-test.py 2024-11-05 17:44:08 +01:00
Sam Atkins
b7efb61fbe Tests/LibWeb: Restructure Ref and Screenshot test dirs to match others
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
Now each test type has the same directories:
- input
- expected
- data

Also, tests can be in subdirectories within ./input.
2024-11-05 14:02:07 +00:00
Sam Atkins
08253d6aee Tests/LibWeb: Move assets used by multiple test types into Assets/
Having to go through multiple levels of .. is not ideal, but less odd
than reaching into another test type's data files.
2024-11-05 14:02:07 +00:00
Gingeh
57ba720fb1 AK: Avoid returning null StringViews instead of empty views
This was error-prone and most users were just checking the length anyway
2024-11-05 14:01:45 +00:00
Gingeh
a4b38dda56 LibWeb: Use substrings instead of pointers when parsing unicode ranges
Fixes a segfault when parsing a wildcard-only unicode range
2024-11-05 14:01:45 +00:00
Andreas Kling
ceedfb34d2 LibWeb: Look at both namespace & tag name in HTML parser stack checks
We were neglecting to check the namespace when looking for a specific
type of element on the stack of open elements in many cases.

This caused us to confuse HTML and SVG elements.
2024-11-05 12:29:27 +01:00
Andreas Kling
7d7f8f1b48 LibWeb: Remove outdated FIXME in "in body" insertion mode
We are actually setting `onlyAddToElementStack` here. :^)
2024-11-05 12:29:27 +01:00
Andreas Kling
49b88fc095 LibWeb: Don't compare against HTML-uppercased tag names in HTML parser
Element::tag_name() returns an uppercased string for HTML elements,
which is usually not what's expected by the parser algorithms that look
at tag names.
2024-11-05 12:29:27 +01:00
Andreas Kling
79613eae7f LibWeb: Add spec comments to the "in template" insertion mode 2024-11-05 12:29:27 +01:00
Gingeh
d1b967bca5 LibWeb: Consider every row when calculating table width 2024-11-05 10:58:11 +00:00
Gingeh
c67ecf37f7 LibWeb: Implement linear easing according to latest spec 2024-11-05 10:41:29 +00:00
Gingeh
3f79d93bd3 LibWeb: Break Easing Function definitions into separate functions 2024-11-05 10:41:29 +00:00
Kostya Farber
373c80db68 LibWeb: Start implementing letter spacing
Letter spacing is applied during text shaping and `shape_text` is used
in places other `InlineLevelIterator` so way may have more work to do,
however this is a good start :^).
2024-11-05 10:40:22 +00:00
Simek
09420406b8 LibWeb: Do not allow focusing "Actually Disabled" elements 2024-11-05 10:39:29 +01:00
sideshowbarker
21b705ee32 Documentation: Explain how to import tests using the WPT.sh script 2024-11-05 10:38:52 +01:00
justus2510
6d9dab5a29 LibGfx: Support APNG more completely
This fixes 3/4 of the remaining test failures in wpt/png/apng. Also,
about half of the APNG files on
https://commons.wikimedia.org/wiki/Category:Animated_PNG_files
used to be broken, and they all seem to work properly now :^)

I also refactored the code to be (at least to me) simpler and more
similar to what the spec describes. As a nice side effect, there are now
fewer lines of code than before.

Lastly, I replaced DeprecatedPainter with Painter.
2024-11-05 10:38:01 +01:00
Tim Ledbetter
c31d44ee18 LibWeb: Ensure inputs are repainted when their checkedness is toggled
Previously, input elements weren't always repainted when their
checkedness was set programmatically.
2024-11-05 10:36:32 +01:00
Shannon Booth
424a0cda93 LibJS: Align ShadowRealmConstructor closer with latest spec
Some checks are pending
Push notes / build (push) Waiting to run
Lint Code / lint (push) Waiting to run
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
The current shadow realm constructor implementation was based off a
merge request to the shadow realm proposal for integration into the
web platform. However, this merge request had a bug which we had
applied a workaround for by popping off the execution stack.

Since then, the spec has had an update of:

https://github.com/tc39/proposal-shadowrealm/commit/28b0cc

Which closer aligned the mainline spec to the proposed merge request.

Now, the original shadow realm proposal merge request has been closed
and a new one has been reopened with a much more minimal set of changes
that merely adds extra arguments to HostInitializeShadowRealm, which
this commit aligns with.
2024-11-04 17:15:15 -07:00
Shannon Booth
b927d7f658 LibJS: Update ShadowRealm to not hold an ExecutionContext
Noone needs to use this any more :^)

This is somewhat AD-HOC in the constructor as it is based on an open
shadow realm merge request, but applies the intent of the change without
any change in behaviour.
2024-11-04 17:15:15 -07:00
Shannon Booth
3cb62265ab LibJS: Use GetShadowRealmContext for PerformShadowRealmEval 2024-11-04 17:15:15 -07:00
Shannon Booth
6a55865bf6 LibJS: Use GetShadowRealmContext for ShadowRealmImportValue
Removing one user of the ExecutionContext slot of ShadowRealm.
2024-11-04 17:15:15 -07:00
Shannon Booth
3f24008b31 LibJS: Implement ShadowRealm AO GetShadowRealmContext
This is a new AO introduced in the spec which allows the
[[ExecutionContext]] slot of the ShadowRealm object to be removed.
2024-11-04 17:15:15 -07:00
Shannon Booth
c1998f96c2 LibJS: Update HostEnsureCanCompileStrings arguments to latest spec 2024-11-04 17:15:15 -07:00
Shannon Booth
6da0ac3aa7 LibJS: Update CreateDynamicFunction to latest spec
The use of extract_parameter_arguments_and_body() here is to make things
a little less awkward. If we were to exactly follow spec there would be
an awkward handling of the case that no arguments were provided and we
needed to provide an empty string.

To do this, we would need to either:
  - Provide an Optional<Value> for bodyString to CreateDynamicFunction
  - Create a new empty PrimitiveString wrapped in a JS Value.

Either case is somewhat awkward. Instead, just refactor this logic
outside of CreateDynamicFunction and make the caller do it.

Otherwise, this commit prepares for the new definition of
HostEnsureCanCompileStrings.
2024-11-04 17:15:15 -07:00
Andrew Kaster
8eefe7b152 CMake: Add warning for missing field initializers globally
This warning is already enabled by our existing flags with gcc-13,
so make sure that clang checks these as well.
2024-11-04 16:10:16 -07:00
Timothy Flynn
6bc339b737 WebContent: Ensure we mark a driver endpoint as complete in early return
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
Fixes a mistake from 3da20aca65.
2024-11-04 16:16:44 -05:00
Timothy Flynn
c0a45394a9 LibWeb: Make the completion callbacks for dismissing dialogs required
All callers have been made async, i.e. they now all provide a completion
callback. Let's make the callback required to discourage any future sync
usage.
2024-11-04 16:16:44 -05:00
stasoid
38aa051f12 LibCore: Port DateTime to Windows 2024-11-04 12:20:53 -07:00
stasoid
3ca2790a43 LibCore: Port most of StandardPaths to Windows
Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
Co-authored-by: Andrew Kaster <akaster@serenityos.org>
Co-authored-by: Konrad <25054764+konradekk@users.noreply.github.com>
2024-11-04 12:20:11 -07:00
stasoid
95bae0c321 LibCore: Port Environment to Windows 2024-11-04 12:20:11 -07:00
Pavel Shliak
38bb8ce0de LibWeb: Modify table formatting according to spec
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
Makes Sub, Super, TextBottom, TextTop vertical aligns equal to Baseline
2024-11-04 14:54:32 +00:00
Jelle Raaijmakers
1388b6866e LibGfx: Return descriptive errors when decoding PNGs
We had an interesting tri-state `ErrorOr<bool>` going on when decoding
PNGs; replace it with `ErrorOr<void>` and add some descriptive errors.
2024-11-04 14:47:37 +01:00
Jelle Raaijmakers
2ce7ec8251 LibGfx: Use libpng's built-in signature verification 2024-11-04 14:47:37 +01:00
Sam Atkins
0a569a9034 LibWeb/CSS: Use writing-mode enum for writing-mode property 2024-11-04 14:47:07 +01:00
Tim Ledbetter
3e57f472f5 Meta: Add an option to WPT.sh to import WPT tests
This invokes the existing `import-wpt-test.py` script, then uses
`headless-browser` to create an expectation file.
2024-11-04 14:02:44 +01:00
Sam Atkins
ebbef87243 Tests: Skip flakey css/cubic-bezier-infinite-slope-crash.html test
This has been consistently timing-out on CI.
2024-11-04 12:50:44 +00:00