Commit graph

68626 commits

Author SHA1 Message Date
Andreas Kling
be70f8d345 LibGC: Avoid excessive bitfield use in GC::Cell
We didn't actually save any space by making the Cell flags bitfields.
In fact, it just forced us to do bit twiddling when accessing them.
2025-04-08 12:09:42 +02:00
Sam Atkins
a80408fea6 LibWeb/CSS: Store @property initial value as a style value
For now, it's the "raw" UnresolvedStyleValue. Later, we'll need to try
to parse it into a "real" style value using the property's syntax.
2025-04-08 09:59:41 +01:00
Sam Atkins
9292b769ef LibWeb/CSS: Use descriptor parsing for @property 2025-04-08 09:59:41 +01:00
rmg-x
514233008b Meta+LibCore: Stop linking against LibCrypt
This was only be used by "Account.cpp" which was removed in:
d8c36ed458
2025-04-08 09:13:33 +02:00
rmg-x
92f5183ced AK+Meta: Remove unused class RecursionDecision 2025-04-08 09:13:33 +02:00
rmg-x
fcf3abd19c AK: Remove unused class DOSPackedTime 2025-04-08 09:13:33 +02:00
rmg-x
f39d14fa8a RequestServer: Remove check for square brackets in websocket_connect
This is no longer necessary since commit:
6480e1a3fe
2025-04-08 09:13:33 +02:00
Luke Wilde
948349974c LibWeb/WebGL: Implement EXT_blend_minmax extension
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
2025-04-07 23:21:11 +02:00
Aliaksandr Kalenik
ac643aa392 LibIPC: Break from message parsing if whole message payload is not ready
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
Fixes the bug when we try to read message payload without checking if we
received enough bytes or file descriptors.
2025-04-07 20:26:01 +02:00
Timothy Flynn
1d9e226206 AK: Remove unused UTF-8 / other factory methods from ByteString 2025-04-07 17:44:38 +02:00
Timothy Flynn
3f439efe21 AK: Rename StringImpl to ByteStringImpl
StringImpl is very specific to ByteString. Let's rename it to match, to
avoid confusion with the StringBase and StringData classes.
2025-04-07 17:44:38 +02:00
Timothy Flynn
0a256b0a9a AK+Everywhere: Change StringView case conversions to return String
There's a bit of a UTF-8 assumption with this change. But nearly every
caller of these methods were immediately creating a String from the
resulting ByteString anyways.
2025-04-07 17:44:38 +02:00
Timothy Flynn
05627b6f45 AK: Remove unused ByteString titlecase/invert case conversions 2025-04-07 17:44:38 +02:00
Timothy Flynn
c8bb3030fd AK: Return NonnullRefPtr from StringImpl::create methods
None of these return a nullptr.
2025-04-07 17:44:38 +02:00
Timothy Flynn
f029ba6a29 AK: Improve performance of ASCII case conversions
Don't use a Vector to form the transformed string. We can construct the
string immediately and store the result in its buffer, and thus avoid a
double allocation.

In a synthetic benchmark, lowercasing a 500 character ASCII string
1 million times reduced from 550ms to 65ms on my machine.
2025-04-07 17:44:38 +02:00
Timothy Flynn
13d7d3a60d AK: Simplify ASCII case conversion implementations a bit
* Use `any_of` instead of manual loops

* Don't check if a code point is upper/lowercase twice. The check we
  are using is already present inside the case converter.

* Move StringImpl's implementation into ByteString. ByteString is its
  only user, so let's avoid some jumping around. The other ASCII case
  methods on StringImpl will soon also be removed.
2025-04-07 17:44:38 +02:00
Aliaksandr Kalenik
a371f849e3 LibIPC: Make TransportSocket responsible for reading entire messages
With this change, the responsibility for prepending messages with their
size and ensuring the entire message is received before returning it to
the caller is moved to TransportSocket. This removes the need to
duplicate this logic in both LibIPC and MessagePort.

Another advantage of reducing message granularity at IPC::Transport
layer is that it will make it easier to support alternative transport
implementations (like Mach ports, which unlike Unix domain sockets are
not stream oriented).
2025-04-07 16:59:49 +02:00
Shannon Booth
0a58497ab9 LibURL/Pattern: Fix PatternParser logic for prefix codepoint comparison
We were not properly handling the case that prefix code point was the
empty string (which we represent as an OptionalNone). While this
still resulted in the correct pattern string being generated, an
incorrect regular expression was being generated causing matching
to fail.
2025-04-07 10:29:09 -04:00
Shannon Booth
4b6f0ee24a LibURL: Do not trim whitespace parsing port in URL parser
This has no functional difference as far as I can tell, but for
clarity explicitly do not attempt to do this, which has the nice
side effect of not checking for whitespace known to not exist.
2025-04-07 10:29:09 -04:00
Shannon Booth
565ccc04a9 LibURL/Pattern: Do not trim whitespace interpreting port
It turns out that the problem here was simply that we were trimming
trailing whitespace when we did not need to, which was meaning that
the port number of '80 ' was being converted to the empty string
per URLPattern elision as the port matches the http scheme.
2025-04-07 10:29:09 -04:00
Luke Wilde
25e343464d LibJS: Cache length identifier for GetLengthWithThis
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
We cached the length identifier for GetLength, but not
GetLengthWithThis. This caused an `has_value()` verification failure
when accessing super.length. Found by Fuzzilli.
2025-04-07 14:40:48 +02:00
Tim Ledbetter
408f9f3dde LibWeb: Disallow "default" as a <family-name> identifier
This commit disallows "default" as a font-family name, when the name is
not quoted because unquoted names are treated as custom-idents, for
which the name "default" is not allowed.
2025-04-07 12:14:29 +01:00
Tim Ledbetter
263cb3f8ca LibWeb/CSS: Remove unnecessary shorthand serialization special cases
The serialization of these properties is improved by using the new
default behavior.
2025-04-07 11:38:56 +01:00
Tim Ledbetter
63228477a4 LibWeb/CSS: Specify list-style subproperties in canonical order 2025-04-07 11:38:56 +01:00
Tim Ledbetter
3186adeaa1 LibWeb/CSS: Don't serialize longhands which match their initial values
Shorthand subproperties that match their initial values are now
excluded from serialization, by default.

Properties where this behavior is not desired, like `gap`, are
special-cased.
2025-04-07 11:38:56 +01:00
Viktor Szépe
b4b8d85251 LibWeb+LibJS+Tests: Fix typos - act I 2025-04-07 11:22:13 +01:00
Sam Atkins
e8213bb86b LibWeb/CSS: Remove unnecessary note about unicode-range parsing
I wrote this before implementing the parsing, and it ended-up not being
true.
2025-04-07 10:00:21 +01:00
Sam Atkins
5609649098 Documentation: Document Descriptors.json 2025-04-07 10:00:21 +01:00
Sam Atkins
5aeaeb3097 LibWeb/CSS: Remove redundant font-face src parsing code
We now always parse this as a descriptor.
2025-04-07 10:00:21 +01:00
Sam Atkins
5f6972fc31 LibWeb/CSS: Parse FontFace parameters as descriptors
This also rearranges the code to follow the spec better: We create an
empty FontFace first and then fill it in, instead of creating it
fully-formed at the end.
2025-04-07 10:00:21 +01:00
Sam Atkins
0121e7028f LibWeb/CSS: Make "CSSStyleValue -> list of font sources" code accessible
We'll want this in FontFace.
2025-04-07 10:00:21 +01:00
Sam Atkins
3288c71953 LibGfx: Serialize unicode-ranges in uppercase
This matches the behavior of other browsers.
2025-04-07 10:00:21 +01:00
Sam Atkins
1e132d9f87 LibWeb/CSS: Use descriptor parsing in FontFace setters 2025-04-07 10:00:21 +01:00
Sam Atkins
ce56ac9159 LibWeb/CSS: Correct include style in CSSFontFaceDescriptors.cpp 2025-04-07 10:00:21 +01:00
Sam Atkins
775efd01e2 LibWeb/CSS: Use initial values for @font-face descriptors 2025-04-07 10:00:21 +01:00
Sam Atkins
d2c58e9376 LibWeb/CSS: Generate descriptor initial values
We parse these lazily, and then cache them for future use.
2025-04-07 10:00:21 +01:00
Sam Atkins
ee647616b2 LibWeb/CSS: Serialize @font-face closer to spec
Read the descriptor style values instead of producing a ParsedFontFace
first, as this means we know if a descriptor is actually present, or
has been defaulted to an initial value. This lets us correctly skip the
unicode-range if it was not explicitly set.

Firefox and Chromium both serialize using the "font-stretch" name,
(which is an alias for font-width) which follows the outdated cssom
spec, so I've done so too to match them.

The one thing that we still do differently in this test is that those
browsers check explicitly if `font-stretch` was set, and ignore when
`font-width` is.

I've also inlined the `serialize_a_local()` function to the one place
it's used. The style value to_string() method was already wrapping the
string in quotes, so calling serialize_a_string() on it was producing
`local("\this mess\"")`. It's clearer what's happening when the code
isn't split up.
2025-04-07 10:00:21 +01:00
Sam Atkins
a7f7c2a821 LibWeb/CSS: Teach OpenTypeTaggedStyleValue to serialize without "1" 2025-04-07 10:00:21 +01:00
Ali Mohammad Pur
69050da929 LibRegex: Merge inverse string table mappings separately
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
2025-04-06 20:21:16 +02:00
Ali Mohammad Pur
299b9ca572 LibRegex: Check backreference index before looking it up
If a backref happens after it's cleared, the slot may be cleared
already.
2025-04-06 20:21:16 +02:00
Andreas Kling
e695dc1405 LibJS: Don't make Bytecode::Operand::Type an u8 outside of aarch64
This is a slightly mystified attempt to recover the performance
regression seen on our JS benchmark runner after 3c2a2bb39f
and c7bba505ea.

With this change, c7bba505ea is effectively reverted from the
perspective of x86_64.
2025-04-06 20:12:58 +02:00
Timothy Flynn
ee6b2db009 AK+LibURL+LibWeb: Use simdutf to validate ASCII strings
simdutf provides a vectorized ASCII validator, so let's use that instead
of looping over strings manually.
2025-04-06 11:05:58 -04:00
Shannon Booth
212095e1c2 LibURL/Pattern: Ensure string passed through in process a URLPatternInit
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
Corresponds to: https://github.com/whatwg/urlpattern/commit/696b402
2025-04-06 08:24:54 -04:00
Shannon Booth
bee3720b6f LibURL/Pattern: Make dummyURL from the URL parser with a special scheme
Corresponds to: https://github.com/whatwg/urlpattern/commit/46c30fda8f

Along with a follow up bug fix that I made of:

https://github.com/whatwg/urlpattern/commit/5e1c93e2

This for example, fixes canonicalization of URL hosts containing
special characters that should have the unicode ToAscii algorithm
performed on them as the URLs were not being treated as special.
2025-04-06 08:24:54 -04:00
Shannon Booth
83a82a027f LibURL/Pattern: Do not return errors in some canonicalization steps
Corresponds to: https://github.com/whatwg/urlpattern/commit/5c979a31
2025-04-06 08:24:54 -04:00
Shannon Booth
a9777a3300 LibURL: Make port state override return failure more for URLPattern
Corresponds to URL spec change:

https://github.com/whatwg/url/commit/cc8b776b

Note that the new test failure being introduced here is an unrelated
WPT test change bundled in the resources test file update that I am
not convinced is correct.
2025-04-06 08:24:54 -04:00
Shannon Booth
4e8f2e48c4 LibURL: Report all hostname state failures for URLPattern
Corresponds to URL spec change:

https://github.com/whatwg/url/commit/c23aec1
2025-04-06 08:24:54 -04:00
Shannon Booth
f64d5451df LibWeb/Bindings: Do put OptionalNone as member in returned dictionaries
Our handling of 'optional' return values was previously not correct
in that we would always call 'create_data_property' for every
single member of the returned dictionary, even if that property did
not have a value (by falling back to JS::js_null).

This was resulting in a massive number of test failures for URL
pattern which was expecting 'undefined' as the member value, instead
of 'null'.
2025-04-06 08:24:54 -04:00
Shannon Booth
b1b73f32a7 LibWeb/Bindings: Invert logic for nullability check in wrap statements
This is less code, and also makes a future bugfix much simpler to
implement :^)
2025-04-06 08:24:54 -04:00
Shannon Booth
dcb7842f59 LibURL/Pattern: Use opaque pathname serialization in canonicalization
The URL spec represents its path as a:

Variant<String, Vector<String>>

A URL is defined has having an opaque path if it has a single String,
the URL path otherwise containing a list of path components.

We (like in an older version of the spec) track this through a boolean
and only use a Vector with a single component for opaque paths.

This means it was incorrect to simple assign the path to a list with
a single empty string without setting that URL as opaque, which
meant that the path serialization was producing incorrect results.

It may make sense changing the API so this situation is a little more
clear. But for now, we simply need to set the opaque path boolean
to true here.
2025-04-06 08:24:54 -04:00