Commit graph

69186 commits

Author SHA1 Message Date
Tim Ledbetter
1c5881c44a LibCore: Remove LADYBIRD_GIT_VERSION environment variable usage
This was previously used by the WPT runner to determine the git hash
of a particular WPT run. This mechanism is no longer used, since it
doesn't work with chunked WPT runs.
2025-05-15 14:02:48 +02:00
Tim Ledbetter
7f4916b806 Meta: Ensure wptreport browser_version field is always populated
This was previously done by passing the `LADYBIRD_GIT_VERSION`
environment variable to `wpt`, but this doesn't work in chunked mode.
2025-05-15 14:02:48 +02:00
Jelle Raaijmakers
cac1d49d21 LibWeb: Ensure we're not creating invalid ranges
Our Ranges should maintain the invariant that their offsets are always
within range of 0..length (inclusive) of their respective containers.

Note that we cannot maintain this in AbstractRange, which is the base
for StaticRange and can still have invalid offsets.
2025-05-15 11:44:32 +01:00
Jelle Raaijmakers
c3a5e8e266 LibWeb: Invalidate viewport's text blocks cache on layout update
156c1083e9 introduced a text blocks cache
for better performance when searching through text on a page, but when
we partially recreate the layout tree, this cache does not get
invalidated. We now rebuild the entire text blocks cache after a layout
update.
2025-05-15 11:44:32 +01:00
Jelle Raaijmakers
0d83426a49 LibWeb: Modify range start & end directly where applicable
We were calling into `Range::set_start_or_end()` indirectly through
`::set_start()` and `::set_end()`, but that algorithm only calls for an
invocation whenever the start or end of a range needs to be set to a
boundary point. If an algorithm step calls for setting the node or
offset, we should directly modify the range.

The problem with calling into `::set_start_or_end()` is that this
algorithm potentially modifies _both_ the start and end of the range,
but algorithms trying to update a range's start or end often have
explicit steps to take both the start and end into account and end up
overcompensating for the start or end offset resulting in an invalid
range (e.g. with an end offset beyond a node's length).

This makes updating a range's start/end a bit more efficient and removes
a piece of ad-hoc code in CharacterData needed to make it work before.
2025-05-15 11:44:32 +01:00
Tim Ledbetter
e2db9790b0 Meta: Use human readable timestamp in WPT run folder name
This makes it easier to figure out when a given run started.
2025-05-15 12:11:20 +02:00
Sam Atkins
3a235e9050 LibWeb/CSS: Parse @page bleed, marks, page-orientation descriptors
These don't have WPT tests so I've added some myself.
2025-05-15 09:53:29 +01:00
Sam Atkins
9415bffd9b LibWeb/CSS: Parse @page size descriptor 2025-05-15 09:53:29 +01:00
Sam Atkins
d8c6b872a3 LibWeb/CSS: Allow descriptors to be shorthands
I was wrong when I added those notes before about this being impossible,
it's *very* possible, for example with the `@page margin` descriptor.
However, until we have a large number of these shorthands and not just a
single example, we can get away with hard-coding support for it.
2025-05-15 09:53:29 +01:00
Sam Atkins
1aa5631610 LibWeb/CSS: Parse @page selectors
Ideally we'd be able to share the code between page selectors and style
ones, but given how simple page selectors are, some code duplication is
the simpler option.
2025-05-15 09:53:29 +01:00
Sam Atkins
aaf07ae30d LibWeb: Add basic implementation of @page
This doesn't support selectors, and the only descriptors for now are for
margins.
2025-05-15 09:53:29 +01:00
Sam Atkins
1002464322 Tests: Import WPT CSSOM and parsing tests for @page 2025-05-15 09:53:29 +01:00
Andrew Kaster
09ed4bd265 CI: Manually add apt repo for llvm 20 to all relevant jobs
Some checks failed
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled
2025-05-14 19:43:52 -04:00
Andrew Kaster
30d01f7920 Devcontainer: Update to llvm 20 2025-05-14 19:43:52 -04:00
Andrew Kaster
096bd2369a Documentation: Remove instructions for OpenIndiana
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
No one has tried to build Ladybird on this Solaris fork since the
fork, and it doesn't have any vcpkg support.
2025-05-14 22:15:40 +01:00
Andrew Kaster
cd06939325 Documentation: Remove instructions for Haiku
No one has tried to build Ladybird on Haiku since the
fork, and it doesn't have any vcpkg support.
2025-05-14 22:15:40 +01:00
stelar7
22a7e0795a LibWeb/IDB: Use helper method for checking transaction mode 2025-05-14 17:17:29 +02:00
stelar7
c8e1b24864 LibWeb/IDB: Use helper method for checking transaction state 2025-05-14 17:17:29 +02:00
stelar7
4c7c7845d3 LibWeb/IDB: Remove outdated FIXME 2025-05-14 17:17:29 +02:00
stelar7
13674c1b32 LibWeb/IDB: Resolve FIXME regarding removing from indecies 2025-05-14 17:17:29 +02:00
stelar7
46ecf239c4 LibWeb/IDB: Implement storing of index records 2025-05-14 17:17:29 +02:00
stelar7
c73b8d1fa0 LibWeb/IDB: Implement IDBIndex::openKeyCursor 2025-05-14 17:17:29 +02:00
stelar7
852323009f LibWeb/IDB: Implement IDBIndex::count 2025-05-14 17:17:29 +02:00
stelar7
b8bb8345a9 LibWeb/IDB: Implement IDBIndex::getAllKeys 2025-05-14 17:17:29 +02:00
stelar7
3fa1d1299c LibWeb/IDB: Implement IDBIndex::getAll 2025-05-14 17:17:29 +02:00
stelar7
47450bc15c LibWeb/IDB: Implement IDBIndex::getKey 2025-05-14 17:17:29 +02:00
stelar7
e74e571b56 LibWeb/IDB: Implement IDBIndex::get 2025-05-14 17:17:29 +02:00
Sam Atkins
73fa567e7a LibWeb/CSS: Remove now-unused AllowUnresolved enum
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This mechanism has been replaced with PendingSubstitutionValues.
2025-05-14 11:46:47 +01:00
Sam Atkins
4edafb35cd LibWeb/CSS: Use PendingSubstitutionValue for unresolved shorthands
Previously, we would just assign the UnresolvedStyleValue to each
longhand, which was completely wrong but happened to work if it was a
ShorthandStyleValue (because that's basically a list of "set property X
to Y", and doesn't care which property it's the value of).

For example, the included `var-in-margin-shorthand.html` test would:
1. Set `margin-top` to `var(--a) 10px`
2. Resolve it to `margin-top: 5px 10px`
3. Reject that as invalid

What now happens is:
1. Set `margin-top` to a PendingSubstitutionValue
2. Resolve `margin` to `5px 10px`
3. Expand that out into its longhands
4. `margin-top` is `5px` 🎉

In order to support this, `for_each_property_expanding_shorthands()` now
runs the callback for the shorthand too if it's an unresolved or
pending-substitution value. This is so that we can store those in the
CascadedProperties until they can be resolved - otherwise, by the time
we want to resolve them, we don't have them any more.

`cascade_declarations()` has an unfortunate hack: it tracks, for each
declaration, which properties have already been given values, so that
it can avoid overwriting an actual value with a pending one. This is
necessary because of the unfortunate way that CSSStyleProperties holds
expanded longhands, and not just the original declarations. The spec
disagrees with itself about this, but we do need to do that expansion
for `element.style` to work correctly. This HashTable is unfortunate
but it does solve the problem until a better solution can be found.
2025-05-14 11:46:47 +01:00
Sam Atkins
398d2f9981 LibWeb/CSS: Implement pending-substitution value
This is a special value temporarily assigned to longhands when their
shorthand is unresolved, and then later replaced once that is resolved.
2025-05-14 11:46:47 +01:00
Sam Atkins
59e8a669de LibWeb/CSS: Unify code in StyleComputer::cascade_declarations() 2025-05-14 11:46:47 +01:00
Sam Atkins
d1dadd43a1 LibWeb/CSS: Implement guaranteed-invalid value
This is a special value produced when var/attr substitution fails, and
is also the initial value for custom properties.
2025-05-14 11:46:47 +01:00
Sam Atkins
804c1eeeed LibWeb/CSS: Remove double set_property_expanding_shorthands() call
If `value` was UnresolvedStyleValue, we'd attempt to `set_property...()`
with its resolved value, then call that again with the original
UnresolvedStyleValue. For any other kind of `value`, we'd simply call
call `set_property...()` twice with the same parameters.
2025-05-14 11:46:47 +01:00
Sam Atkins
ded3c95da5 LibWeb/CSS: Remove unused FontVariant style value type 2025-05-14 11:46:47 +01:00
Sam Atkins
475788732f LibWeb/CSS: Remove outdated FIXME
This method no longer sets anything to `initial`.
2025-05-14 11:46:47 +01:00
R-Goc
34c14d4e6d LibJS: Add fast path for float to int put
This commit adds a fast path for putting values into a TypedArray of an
integer type, when the value being put in is a double. This leads to a
6% speedup on JetStream/gcc-loops.js.
2025-05-14 12:33:35 +02:00
ayeteadoe
0061c64ee6 CMake: Remove duplicate sanitizer configuration
Root had identical copy of what was being done in Meta/Lagom
so now we ensure this is still included globally but is
isolated to its own cmake module to make sanitizer
config easier to discover
2025-05-14 02:05:12 -06:00
ayeteadoe
c4f08bc268 CMake: Add LibDiff to TEST_DIRECTORIES
Not sure if it has always been this way, but Tests/LibDiff has
not actually been running in CI at all.
2025-05-14 02:05:12 -06:00
ayeteadoe
11bca38f91 CMake: Build LibRegex tests in Tests/LibRegex not Meta/Lagom
As LibRegex was not specified in TEST_DIRECTORIES, the existing
Tests/LibRegex subdirectory was not actually included during
configuration. Also the RegexLibC test has not been needed
since migration away from Serenitys LibC was done, so
that test has been fully removed. I also renamed the
Regex.cpp test to TestRegex.cpp to match the naming
convention of most test targets.
2025-05-14 02:05:12 -06:00
ayeteadoe
8864b3e9d1 CMake: Build LibCore tests in Tests/LibCore not Meta/Lagom
As LibCore was not specified in TEST_DIRECTORIES, the existing
Tests/LibCore subdirectory was not actually included during
configuration.
2025-05-14 02:05:12 -06:00
ayeteadoe
d44ac0874f CMake: Build LibTest[Main] in Libraries/LibTest not Meta/Lagom
As LibTest was not specified in TEST_DIRECTORIES, the existing
Libraries/LibTest subdirectory was not actually included during
configuration.
2025-05-14 02:05:12 -06:00
Timothy Flynn
7280ed6312 Meta: Enforce newlines around namespaces
This has come up several times during code review, so let's just enforce
it using a new clang-format 20 option.
2025-05-14 02:01:59 -06:00
Timothy Flynn
ca9f3673c5 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-20 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
2025-05-14 02:01:59 -06:00
Timothy Flynn
d30f6f1b11 Meta: Switch to clang-format-20 as the standard formatter 2025-05-14 02:01:59 -06:00
Timothy Flynn
313e490fb6 Meta: Extract the required clang-format version to a variable
Rather than writing the version N times in this script, let's extract it
to a variable for easier use.
2025-05-14 02:01:59 -06:00
Timothy Flynn
70d2b0b6f3 CI: Update the Clang pipeline to Clang 20 2025-05-14 02:01:59 -06:00
Timothy Flynn
a65bbae4c9 CI: Update the GCC pipeline to GCC 14
Although GCC 15 is released, it is not available on Ubuntu 22.04 LTS via
the ubuntu-toolchain-r/test PPA.
2025-05-14 02:01:59 -06:00
Timothy Flynn
6fc7483757 Documentation: Bump OpenIndiana's clang version
Clang 19 seems to be the newest available:
https://pkg.openindiana.org/hipster/en/search.shtml?token=clang&action=Search

It also looks like they have newer versions of GCC now, but let's just
advise clang on this system that no contributer is using.
2025-05-14 02:01:59 -06:00
Timothy Flynn
0e4a2f760f Documentation: Refer to specific compiler versions in fewer places
The required and recommended compiler versions are sort of scattered
across several documents. Let's list them in a single document, and
have other documents refer to that location.

The language here intentionally recommends the same compiler versions
used in CI. The find_compiler.sh script can be updated with the
minimum known good version.
2025-05-14 02:01:59 -06:00
Timothy Flynn
85ee56a702 CI: Use clang for the test262 build
We currently have optimizations that apply only to clang, so we might as
well make use of them.
2025-05-14 02:01:59 -06:00