Commit graph

3691 commits

Author SHA1 Message Date
Timothy Flynn
0447d05d52 Meta: Support fully static distribution release builds
This adds the vcpkg triplets and CMake preset to perform release
builds for distribution. These builds are fully static, and currently
intended to be used for the `js` ESVU release.

In the future, linking everything statically into the final binary is
probably not what we will do for released Ladybird builds. Instead, we
may have a "libladybird.so", which is then linked into the binary. But
this should be fine for `js` for now.
2024-11-08 11:29:18 -07:00
Andrew Kaster
3226aee666 CMake: Force-load fontconfig into dependencies of skia
The dynamic shared lib build of skia doesn't seem to actually express
any dependencies in its DT_NEEDED section, so we need to force-load
fontconfig into the dependencies of the skia target to avoid runtime
linker errors.
2024-11-08 11:10:31 -07:00
Andrew Kaster
e65eff22e8 CMake: Add include_guard() statements to fontconfig and vulkan
This should prevent extra calls to find_package() from causing
issues.
2024-11-08 11:10:31 -07:00
Sam Atkins
de1552342b Documentation: Stop telling people to get gn from homebrew
Homebrew doesn't have an entry for gn, so this was confusing.
2024-11-08 10:22:09 -07: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
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
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
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
Sam Atkins
7a5b38d577 Meta: Support importing WPT reference tests 2024-11-05 17:58:16 +00:00
Aliaksandr Kalenik
3833049fc8 Meta+Tests: Substitute Ahem font path in import-wpt-test.py 2024-11-05 17:44:08 +01: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
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
sideshowbarker
7d3ad89603 Tests: Allow full relative or absolute pathnames for test files to run
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 change allows the test list given to “WPT.sh run” to include full
filesystem relative or absolute pathnames. That facilitates using tab
completion in the shell to browse for pathnames, and also facilitates
copy-paste of full filesystem pathnames. For example:

./Meta/WPT.sh run Tests/LibWeb/WPT/wpt/dom/historical.html
./Meta/WPT.sh run /opt/ladybird/Tests/LibWeb/WPT/wpt/dom/historical.html

Otherwise, without this change, the test list can’t include full
filesystem pathnames, but is instead limited to only path fragments that
specify WPT subdirectory pathnames — which doesn’t allow for tab
completion on pathnames in the shell, nor copy-paste of full pathnames.
2024-11-04 06:35:26 +00:00
Timothy Flynn
13b7355ec1 LibWeb: Move some classes from the DOM namespace to the HTML namespace
The following classes are in the HTML spec and thus belong in the HTML
namespace:

* BeforeUnloadEvent
* HTMLFormControlsCollection
* RadioNodeList
2024-11-02 11:16:45 -04:00
Jonne Ransijn
69f96122b6 LibJS+LibWeb: Prevent double invocation of [[GetOwnProperty]]
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
The `[[GetOwnProperty]]` internal method invocation in
`OrdinarySetWithOwnDescriptor` was being invocated again with the same
parameters in the `[[DefineOwnProperty]]` internal method that is also
later called in `OrdinarySetWithOwnDescriptor`.

The `PlatformObject.[[DefineOwnProperty]]` has similair logic.

This change adds an optional parameter to the `[[DefineOwnProperty]]`
internal method so the results of the previous `[[GetOwnProperty]]`
internal method invocation can be re-used.
2024-11-02 12:27:02 +01:00
Shannon Booth
84dc83e0e0 LibWeb: Rename current_global_object to current_principal_global_object
Again, following a rename as part of the introduction of shadow realms
inducing a bunch of mechanical changes.
2024-11-01 12:15:17 -07:00
Andrew Kaster
36feebb1e7 LibWeb: Add Wasm Web-API streaming compilation and instantiation
This requires fixing up the "parameter is a promise" handling in
the IDL generator.
2024-11-01 10:42:24 -07:00
Jelle Raaijmakers
3504370281 LibWeb: Add stubbed Media Source Extensions API
Just the boilerplate :^)
2024-11-01 13:23:45 -04:00
Sam Atkins
d0d5600f47 LibWeb/CSS: Move rule-conversion code into its own file
This is an attempt to bring the size of Parser.cpp down. No code
changes, just moves and some explicit template instantiations now that
we're using them from a different file.
2024-11-01 16:16:40 +00:00
sideshowbarker
286511c4cf Meta: Make import-wpt-test.py use html.parser, not BeautifulSoup
This change switches the Meta/import-wpt-test.py script to using the
standard html.parser module rather than BeautifulSoup.

Otherwise, without this change, when a contributor first tries to run
the script, if they don’t have BeautifulSoup installed, it will fail.

Note that this patch also includes an unrelated small change that
switches to using os.path.normpath — rather than Path.absolute() — to
“normalize” the destination names of the downloaded test files.
2024-11-01 12:27:24 +01:00
Jelle Raaijmakers
5f84c2c3af LibWeb: Factor out HTMLOrSVGElement
This is a mixin in the IDL, so let's treat it as a mixin in our code and
let both SVGElement and MathMLElement reuse the implementations that we
wrote for HTMLElement.
2024-10-31 10:46:21 +01:00
sideshowbarker
cf7a1f6a52 Meta: Make import-wpt-test.py resolve “..” parent refs in URLs/pathnames
This change makes the Meta/import-wpt-test.py script handle URLs such as
https://wpt.live//WebCryptoAPI/generateKey/../util/helpers.js and paths
containing, e.g., wpt-import/WebCryptoAPI/generateKey/../util/helpers.js
(that is, URLs and paths with “..” parent-directory references in them).

Otherwise, without this change, when the import-wpt-test.py script tries
a URL like https://wpt.live//WebCryptoAPI/generateKey/../util/helpers.js
which contains a “..” parent-directory reference, the script fails with
a “urllib.error.HTTPError: HTTP Error 404: Not Found” error message.
2024-10-31 07:04:18 +00:00
Shannon Booth
797b0d0f43 LibJS+LibWeb: Remove remaining use and reference to SafeFunction 2024-10-30 20:55:45 +01:00
Aliaksandr Kalenik
a8077f79cc LibWeb: Separate text control input events handling from contenteditable
This input event handling change is intended to address the following
design issues:
- Having `DOM::Position` is unnecessary complexity when `Selection`
  exists because caret position could be described by the selection
  object with a collapsed state. Before this change, we had to
  synchronize those whenever one of them was modified, and there were
  already bugs caused by that, i.e., caret position was not changed when
  selection offset was modified from the JS side.
- Selection API exposes selection offset within `<textarea>` and
  `<input>`, which is not supposed to happen. These objects should
  manage their selection state by themselves and have selection offset
  even when they are not displayed.
- `EventHandler` looks only at `DOM::Text` owned by `DOM::Position`
  while doing text manipulations. It works fine for `<input>` and
  `<textarea>`, but `contenteditable` needs to consider all text
  descendant text nodes; i.e., if the cursor is moved outside of
  `DOM::Text`, we need to look for an adjacent text node to move the
  cursor there.

With this change, `EventHandler` no longer does direct manipulations on
caret position or text content, but instead delegates them to the active
`InputEventsTarget`, which could be either
`FormAssociatedTextControlElement` (for `<input>` and `<textarea>`) or
`EditingHostManager` (for `contenteditable`). The `Selection` object is
used to manage both selection and caret position for `contenteditable`,
and text control elements manage their own selection state that is not
exposed by Selection API.

This change improves text editing on Discord, as now we don't have to
refocus the `contenteditable` element after character input. The problem
was that selection manipulations from the JS side were not propagated
to `DOM::Position`.

I expect this change to make future correctness improvements for
`contenteditable` (and `designMode`) easier, as now it's decoupled from
`<input>` and `<textarea>` and separated from `EventHandler`, which is
quite a busy file.
2024-10-30 19:29:56 +01:00
stelar7
5630a0d6b4 Meta: Add a script to import WPT tests 2024-10-30 17:29:03 +01:00
stelar7
488436fb54 LibWeb: Parse the rotate css property 2024-10-29 14:40:40 +00:00
Tim Ledbetter
ed658154d2 Meta: Set LADYBIRD_GIT_VERSION environment variable in WPT.sh
This ensures the `browser_version` field of any wptreport format log
files include the current git commit hash.
2024-10-29 13:30:12 +00:00
Tim Ledbetter
d79fcceb8a Meta: Replace realpath usage with cross-platform function in WPT.sh
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
2024-10-29 07:30:32 -04:00
Tim Ledbetter
cd0b9c4ec0 Meta: Add cross-platform function for absolutizing paths 2024-10-29 07:30:32 -04:00
Timothy Flynn
42984a10e9 IPCCompiler: Transfer DevicePixelRect by value 2024-10-29 11:03:20 +00:00
Lucas CHOLLET
e8fc731b8c LibWeb/CSS: Introduce a base class for LCH-based color values
This will be used by both CSSLCH and CSSOKLCH.
2024-10-28 23:26:19 +01:00
Shannon Booth
70599d3f8d LibWeb: Add support for dictionaries in overload resolution
By making use of the known set of supported dictionary names in that
overload set. Note that this list is typically very small (the max that
we have currently is 1).
2024-10-28 22:56:39 +01:00
Shannon Booth
013c2a1c7c LibWeb: Verify that all overloads contain Unscopable if present
It would be strange for the IDL to be defined as such, so instead of
leaving a FIXME comment, let's just verify that this doesn't happen in
practise incase it does end up happening in reality.
2024-10-28 22:56:39 +01:00
Lucas CHOLLET
48bbebc636 LibWeb/CSS: Start parsing the color() function
This is really bare bone as we only support the `xyz-d50` color space
for the moment.

It makes us pass the following WPT tests:
 - css/css-color/predefined-016.html
 - css/css-color/xyz-d50-001.html
 - css/css-color/xyz-d50-002.html
2024-10-28 22:55:57 +01:00
Tim Ledbetter
0a3a75cf35 Meta: Use correct WPT log file path when an absolute path is given 2024-10-28 10:22:48 -04:00
Tim Ledbetter
c544d1fa1f Meta: Use correct certificate path when invoking WPT
We now ensure that the directory for the currently selected build
preset is used as the base certificate path.
2024-10-28 10:22:48 -04:00
Andreas Kling
85bf1d6033 Meta: Ignore LibWeb text tests for newline-at-eof check 2024-10-27 13:33:46 +01:00
Lucas CHOLLET
8efa046e0c LibWeb/CSS: Make CSSOKLab inherit from a new CSSLabLike class
This class provides the common base for both CSSOKLab and the future
CSSLab classes.
2024-10-27 10:20:03 +01:00
Timothy Flynn
6cd224bb88 Meta: Use release builds as the basis for Sanitizer builds
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
LLVM recommends compiling with at least -O1 to have decent performance
with sanitizers enabled. Indeed, this improves CI performance of LibWeb
tests as follows:

    GCC on Linux:   160.61s to 119.68s (40.93s faster)
    Clang on Linux:  65.56s to  55.64s ( 9.92s faster)
2024-10-26 22:58:40 +02:00
sideshowbarker
6b82ab06fd Meta: Make WPT.sh echo the “wpt run” invocation
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
To help people in troubleshooting problems when running the WPT.sh
script, this change makes the script echo to stdout the complete
“wpt run” invocation (including all the flags and path args).
2024-10-26 11:27:33 +02:00
Andrew Kaster
2c3531ab78 LibWeb: Move JS::Promise <-> WebIDL conversion into IDL
This change also removes as much direct use of JS::Promise in LibWeb
as possible. When specs refer to `Promise<T>` they should be assumed
to be referring to the WebIDL Promise type, not the JS::Promise type.

The one exception is the HostPromiseRejectionTracker hook on the JS
VM. This facility and its associated sets and events are intended to
expose the exact opaque object handles that were rejected to author
code. This is not possible with the WebIDL Promise type, so we have
to use JS::Promise or JS::Object to hold onto the promises.

It also exposes which specs need some updates in the area of
promises. WebDriver stands out in this regard. WebAudio could use
some more cross-references to WebIDL as well to clarify things.
2024-10-25 14:04:21 -06:00
Ben Wiederhake
352acd7771 Tests: Prevent executable images or html files during lint 2024-10-25 09:00:52 +02:00
sideshowbarker
ede6924db8 LibWeb: Complete support for all ARIA properties in current spec
This change completes handling for all ARIA properties defined in the
current ARIA spec — by adding handling for the following properties:

- aria-braillelabel
- aria-brailleroledescription
- aria-colindextext
- aria-description
- aria-rowindextext
2024-10-24 22:21:46 +02:00
Sam Atkins
c036e87d46 Documentation: Combine testing documentation together
Bring together the docs on running tests, with the ones on writing them
which were hidden in Browser/Patterns.md

I've made a few adjustments while I was at it, because RunningTests.md
was a bit outdated and didn't mention `Meta/ladybird.sh test`. It's
possible they're still outdated and wrong, but I'm not familiar enough
with that area to know.
2024-10-23 09:02:46 +02:00
Alex Ungurianu
50d64b0fb7 LibWeb: Add and implement CSSPropertyRule IDL and bindings 2024-10-23 06:55:37 +01:00
Timothy Flynn
14c3bff5da Meta: Add a flag to WPT.sh to run Ladybird headlessly
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
We have more work to do before we can run WPT headlessly by default
(i.e. handling alerts). But for now, we can run it headlessly locally
with the --headless flag.
2024-10-22 04:24:31 +01:00
stelar7
d81f31c699 LibWeb/Meta: Adjust how missing/invalid default values are generated 2024-10-21 10:34:26 +02:00
Cameron Youell
c5219b0193 CMake: Fix linker issues on Windows
Co-authored-by: Andrew Kaster <akaster@serenityos.org>
2024-10-19 18:14:48 -06:00
Jelle Raaijmakers
2a98f2a12d LibWeb: Implement AudioListener
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.
2024-10-18 09:39:04 +02:00
Aliaksandr Kalenik
c097f53875 LibWeb: Remove InlinePaintable
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
It was replaced with PaintableWithLines.
2024-10-16 20:25:42 +02:00
Jelle Raaijmakers
0b9d55b676 Meta: Reuse built-in JS types list for IDL to C++ generation
This opens up the code path for the `ArrayBuffer` type, which can now be
used as a method argument.
2024-10-15 10:02:15 +02:00
John Diamond
8f45f59df3 Meta: Warn before attempting to use clang-format 19
The clang-format version released with llvm 19 will format many files
differently than clang-format-18.

This change presents the existing warning shown for incorrect
clang-format versions to those with versions greater than 18.

Fixes issue #1750
2024-10-14 15:54:53 -06:00
Andreas Kling
dd419b5a8d AK: Make String::number() infallible
This API will always succeed in creating a String representing the
provided number in base-10.
2024-10-14 20:47:35 +02:00
Timothy Flynn
6ce473af72 LibIPC: Pass AK::Duration by value over IPC
AK::Duration is simply an integer, and does not need to be passed by
reference.
2024-10-14 08:25:41 +02:00
Sam Atkins
e0be17e4fb LibWeb/CSS: Rewrite CSS Parser core methods according to new spec
CSS Syntax 3 (https://drafts.csswg.org/css-syntax) has changed
significantly since we implemented it a couple of years ago. Just about
every parsing algorithm has been rewritten in terms of the new token
stream concept, and to support nested styles. As all of those
algorithms call into each other, this is an unfortunately chonky diff.

As part of this, the transitory types (Declaration, Function, AtRule...)
have been rewritten. That's both because we have new requirements of
what they should be and contain, and also because the spec asks us to
create and then gradually modify them in place, which is easier if they
are plain structs.
2024-10-14 08:08:37 +02:00
justus2510
55f0dc823f LibWeb: Handle unpaired surrogates in USVStrings
Some checks are pending
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, 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 should fix (at least) the last two remaining WPT test failures in
FileAPI/unicode.html.
2024-10-13 22:24:28 +01:00
Cory Virok
9336b14d15 Meta: Clean up generated CMake uservars
Prior to this change, running ./Meta/ladybird.sh rebuild would not
remove the user-variables.cmake file that was generated by the build
script. This caused errors when testing out the .devcontainer on my
Mac because the pkg-config binary lived in different dirs in the
container vs host.debug
2024-10-12 15:37:26 -06:00
Andreas Kling
175f3febb8 LibWeb: Make DOMException take error message as a String
There was no need to use FlyString for error messages, and it just
caused a bunch of churn since these strings typically only existed
during the lifetime of the error.
2024-10-12 21:14:18 +02:00
sin-ack
d5948709cd BindingsGenerator: Handle global interfaces without named properties
DedicatedWorkerGlobalScope is an object with a Global extended
attribute, but does not define any named property getters. This needs to
be handled by setting the prototype chain to:

    DedicatedWorkerGlobalScope
    ^ DedicatedWorkerGlobalScopePrototype
    ^ WorkerGlobalScopePrototype

(This is different from something like Window, where there is an
intermediate WindowProperties object for named properties.)

Previously, we treated the GlobalMixin object as if it was a simple
prototype object, accidentally setting DedicatedWorkerGlobalScope's
prototype to WorkerGlobalScopePrototype. This caused the expression

    self instanceof DedicatedWorkerGlobalScope

to return false inside workers.

This makes us pass many more of the "/xhr/idlharness.any.worker" WPT
tests than before, rather than failing early.
2024-10-12 19:21:59 +02:00
Timothy Flynn
bd8ab33593 Meta: Add a command to WPT.sh to execute wpt serve
Just a handy command for local testing.
2024-10-12 15:02:41 +02:00
pheonixfirewingz
60283ed392 CMake: Reorganize flags for ClangCL usage
Disable some non-supported flags on windows platforms, and
pull in some flags from the other windows support branches.

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2024-10-10 21:48:41 -06:00
pheonixfirewingz
c92d9cce42 Toolchain: Rewrite BuildVcpkg.sh in python
Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2024-10-10 21:48:41 -06:00
Andrew Kaster
7faebb2702 LibWeb: Implement most of Service Worker registration
Some checks are pending
Lint Code / lint (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (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
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
Push notes / build (push) Waiting to run
This approach will need some rework to be properly handled at the user
agent level instead of per renderer process, but it's a start.
2024-10-09 15:58:36 -06:00
Sam Atkins
b645e26e9b LibWeb/CSS: Bring TokenStream in line with spec
When the TokenStream code was originally written, there was no such
concept in the CSS Syntax spec. But since then, it's been officially
added, (https://drafts.csswg.org/css-syntax/#css-token-stream) and the
parsing algorithms are described in terms of it. This patch brings our
implementation in line with the spec. A few deprecated TokenStream
methods are left around until their users are also updated to match the
newer spec.

There are a few differences:

- They name things differently. The main confusing one is we had
  `next_token()` which consumed a token and returned it, but the spec
  has a `next_token()` which peeks the next token. The spec names are
  honestly better than what I'd come up with. (`discard_a_token()` is a
  nice addition too!)

- We used to store the index of the token that was just consumed, and
  they instead store the index of the token that will be consumed next.
  This is a perfect breeding ground for off-by-one errors, so I've
  finally added a test suite for TokenStream itself.

- We use a transaction system for rewinding, and the spec uses a stack
  of "marks", which can be manually rewound to. These should be able to
  coexist as long as we stick with marks in the parser spec algorithms,
  and stick with transactions elsewhere.
2024-10-09 17:29:29 +01:00
Andrew Kaster
be13a0ec3f Meta: Port changes to gn build
8b3a5d0b96
99ef078c97
dc401f49ea
d30ae92b82
c22a2d8f2b
6cf7d07a98
0c98c7637e
00487a7b25
1db243c006
2024-10-09 06:43:31 -04:00
Shannon Booth
7ea17d2fea Meta: Use a common function for getting build directory
Between WPT.sh and ladybird.sh.

This is useful to me as I set my default build configuration to Debug,
and have been hacking around with the WPT script to align with this
configuration.
2024-10-09 11:31:51 +01:00
Shannon Booth
16f68ab1bd Meta: Make LADYBIRD_SOURCE_DIR consistent between WPT.sh and ladybird.sh
ladybird.sh allows the source directory to be overriden to point to
another source directory. I am not sure if anyone is actually using this
behaviour in practise, but let's make the behaviour at least common
between the two scripts with a helper function.
2024-10-09 11:31:51 +01:00
Jelle Raaijmakers
f88acedc8f AK: Remove unused floating point conversion code
Currently I don't expect this code to be ever used in Ladybird.
2024-10-08 19:02:51 +02:00
Jamie Mansfield
f610a12671 LibWeb/UIEvents: Implement TextEvent 2024-10-08 11:45:39 +02:00
Jamie Mansfield
86e20ea246 LibWeb/UIEvents: Implement CompositionEvent 2024-10-08 11:45:39 +02:00
Jamie Mansfield
9fce70069d LibWeb/UIEvents: Implement InputEvent 2024-10-08 11:45:39 +02:00
Timothy Flynn
00487a7b25 LibWebView+LibWeb: Remove ResourceLoader and WebSocket adapters
These were used to provide a layer of abstraction between ResourceLoader
and the networking backend. Now that we only have RequestServer, we can
remove these adapters to make the code a bit easier to follow.
2024-10-08 06:52:51 +02:00
Timothy Flynn
1b324f3ae1 LibWebView+UI: Remove Qt networking infrastructure
Now that we use libcurl, there's no reason to keep Qt networking around.
Further, it doesn't support all features we need anyways, such as non-
buffered request handling for SSE.
2024-10-08 06:52:51 +02:00
Noah Bright
d30ae92b82 LibWeb: Define PerformanceEventTiming
https://www.w3.org/TR/event-timing/#sec-performance-event-timing

Add idl, header and stubs for PerformanceEventTiming interface.

Two missing `PerformanceEntry` types that have come up in issues
are the `first-input` and the `event` entryTypes. Those are both
this.

Also, because both of those are this same interface, the static
methods from the parent class are difficult to implement because
of instance-specific details. Might either need subclasses or to
edit the parent and also everything that inherits from it :/
2024-10-08 03:44:55 +02:00
Shannon Booth
dc401f49ea LibWeb+LibURL: Move HTML::Origin to URL::Origin
While Origin is defined in the HTML spec - this leaves us with quite an
awkward relationship as the URL spec makes use of AO's from what is
defined in the HTML spec.

To simplify this factoring, relocate Origin into LibURL.
2024-10-05 10:46:30 +02:00
Shannon Booth
e9dd05b2b5 LibWeb: Correct attributes on IDL interface 'operations'
This fixes four tests for the IDL harness for URL under:

https://wpt.live/url/idlharness.any.html
and https://wpt.live/url/idlharness.any.worker.html

But probably some tests in other places too :^)
2024-10-05 10:46:30 +02:00
Shannon Booth
fb2b78620d LibWeb: Factor out function to define the 'operations' on an interface 2024-10-05 10:46:30 +02:00
rmg-x
d8c36ed458 LibCore: Remove unused classes and headers 2024-10-05 09:18:54 +02:00
Andreas Kling
cc4b3cbacc Meta: Update my e-mail address everywhere
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
2024-10-04 13:19:50 +02:00
Andrew Kaster
29416befe6 LibWeb: Add ServiceWorker job registration and execution
Now we can register jobs and they will be executed on the event loop
"later". This doesn't feel like the right place to execute them, but
the spec needs some updates in this regard anyway.
2024-10-04 07:08:08 +02:00
Andrew Kaster
3ecf6de652 LibMedia+Ladybird: Use pkg_check_modules to find pulseaudio
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
2024-10-02 20:23:03 -04:00
Zachary Huang
e0bd42be95 ImageDecoder+LibGfx: Collate decoded bitmaps before sending over IPC
There is an issue where gifs with many frames cannot be loaded, as each
bitmap is sent over IPC using a separate file descriptor, and there is
limit on the maximum number of descriptors per IPC message. Thus, trying
to load gifs with more than 64 frames (the current limit) causes the
image decoder process to die.

This commit introduces the BitmapSequence class, which is a thin wrapper
around the type Vector<Optional<NonnullRefPtr<Gfx::Bitmap>>> and
provides an IPC encode/decode routine that collates all bitmap data into
a single buffer so that only a single file descriptor is required per
IPC transfer, even if multiple frames are being sent.
2024-10-02 15:57:41 -06:00
Andrew Kaster
ebaba7fb7b LibMedia: Mark ffmpeg as required, and reorganize CMakeLists
Now it should be clearer looking at the build scripts what options
are available for building LibMedia, and what packages are required.
2024-10-02 16:03:33 -04:00
Sam Atkins
cd13b30fb8 LibWeb/CSS: Add parsing for <opentype-tag>
This is a special form of `<string>` so doesn't need its own style value
type. It's used in a couple of font-related properties. For completeness
it's included in ValueType.
2024-10-02 16:28:55 +01:00
Andrew Kaster
91de0438fe Meta: Add swift-format linter script
Some checks are pending
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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
swift-format is available in the Xcode 16 Beta and homebrew.
We will need some extra docs to tell Linux developers how to get it on
their distribution.

This also makes use of the fact that you can pass git diff a colon
delimited pattern to include ':*pattern' or exclude ':!*pattern'
matching files, which is pretty neat.
2024-10-01 13:33:05 -06:00
Saleem Abdulrasool
cf702d21d1 Meta: Remove unused code generate tools
These are no longer in the tree, remove their definitions.
2024-10-01 10:14:16 -06:00
Jelle Raaijmakers
233b4f2ca8 LibMedia+everywhere: Remove superfluous and unused audio code
We had numerous NiH-based implementations of audio formats and metadata
that we now no longer need because we either don't make use of the code,
or we replaced its implementation by FFmpeg.
2024-09-30 18:48:12 +02:00
Jelle Raaijmakers
57783eff24 LibMedia: Convert OggLoader into generic FFmpegLoader
This loader supports whatever format libavformat and libavcodec can
handle. Currently only seekable streams are supported, and we still have
some limitations as to the number of channels and sample format.

Plays all non-streaming audio files at:

  https://tools.woolyss.com/html5-audio-video-tester/
2024-09-30 18:48:12 +02:00
Sam Atkins
fdcece2e88 LibWeb/CSS: Implement legacy name aliases for properties
When a property is a "legacy name alias", any time it is used in CSS or
via the CSSOM its aliased name is used instead.
(See https://drafts.csswg.org/css-cascade-5/#legacy-name-alias)

This means we only care about the alias when parsing a string as a
PropertyID - and we can just return the PropertyID it is an alias for.
No need for a distinct PropertyID for it, and no need for LibWeb to
care about it at all.

Previously, we had a bunch of these properties, which misused our code
for "logical aliases", some of which I've discovered were not even
fully implemented. But with this change, all that code can go away, and
making a legacy alias is just a case of putting it in the JSON. This
also shrinks `StyleProperties` as it doesn't need to contain data for
these aliases, and removes a whole load of `-webkit-*` spam from the
style inspector.
2024-09-27 17:16:23 +01:00
Andrew Kaster
2b13079b35 Meta: Update Ladybird and services to build again with gn 2024-09-27 10:15:08 -06:00
Andrew Kaster
7880b2fba9 Meta: Update LibWeb to build again with gn 2024-09-27 10:15:08 -06:00
Andrew Kaster
9bcdf8eafe Meta: Update non-LibWeb libraries in gn build 2024-09-27 10:15:08 -06:00
Andrew Kaster
e53ad772f3 Meta: Update LibUnicode gn build to depend on icu 2024-09-27 10:15:08 -06:00
Andrew Kaster
4348efd078 Meta: Update LibMedia gn build to depend on ffmpeg 2024-09-27 10:15:08 -06:00
Andrew Kaster
b395e6a6a6 Meta: Update LibGfx gn build for removed files and added Libraries
LibGfx depends on a lot of third-party libs now.
2024-09-27 10:15:08 -06:00
Andrew Kaster
a1e2437b21 Meta: Add missing files and libraries to LibCore in gn build 2024-09-27 10:15:08 -06:00