Commit graph

11365 commits

Author SHA1 Message Date
Timothy Flynn
c2365653a5 LibURL: Add a few missing internal page factories 2025-09-18 07:27:24 -04:00
Rocco Corsi
3d1d055e27 LibRegex: Export OpCode/OpCode_Compare for REGEX_DEBUG builds
When building with REGEX_DEBUG or ENABLE_ALL_THE_DEBUG_MACROS there are
two issues with linking of bin/TestRegex

 - Libraries/LibRegex/RegexDebug.h:76 with undefined reference
       regex::OpCode_Compare::variable_arguments_to_byte_string(
           AK::Optional<regex::MatchInput const&>) const

 - Libraries/LibRegex/RegexByteCode.h:672 with undefined reference
       regex::OpCode::name(regex::OpCodeId)

Add REGEX_API on regex::OpCode and regex::OptCode_Compare to allow
access to the classes in bin/TestRegex
2025-09-18 11:02:13 +02:00
Rocco Corsi
73658c9785 LibDNS: Export DNS::Messages::Records::SIG for DNS_DEBUG builds
When building with DNS_DEBUG or ENABLE_ALL_THE_DEBUG_MACROS there is a
linking issue with Libraries/LibDNS/Resolver.h:1003 with
undefined reference DNS::Messages::Records::SIG::to_string() const

Add DNS_API on DNS:Messages::Records::SIG definition to allow access
to the class in bin/dns, bin/TestDNSResolver, libexec/RequestServer
2025-09-18 11:02:13 +02:00
luizgfc
bcbbecff9f LibWeb: Correctly handle properties on CSS declaration serialization 2025-09-18 09:25:23 +01:00
luizgfc
3b5df12b38 LibWeb: Handle custom properties on CSSStyleProperties list 2025-09-18 09:25:23 +01:00
Zaggy1024
261cd5846f LibWeb: Use Duration::to_seconds_f64 to set HTMLMediaElement duration 2025-09-17 16:45:45 -05:00
Jelle Raaijmakers
c31eff6a47 Everywhere: Use Optional<T>::ensure() where useful
No functional changes.
2025-09-17 12:01:18 -04:00
Aliaksandr Kalenik
d45f8a3081 LibJS: Add inline caching for adding new own properties to objects
We already had IC support in PutById for the following cases:
- Changing an existing own property
- Calling a setter located in the prototype chain

This was enough to speed up code where structurally identical objects
(same shape) are processed in a loop:
```js
const arr = [{ a: 1 }, { a: 2 }, { a: 3 }];
for (let obj of arr) {
    obj.a += 1;
}
```

However, creating structurally identical objects in a loop was still
slow:
```js
for (let i = 0; i < 10_000_000; i++) {
    const o = {};
    o.a = 1;
    o.b = 2;
    o.c = 3;
}
```

This change addresses that by adding a new IC type that caches both the
source and target shapes, allowing property additions to be fast-pathed
by directly jumping to the shape that already includes the new property.
2025-09-17 12:44:44 +02:00
Aliaksandr Kalenik
a54215c07d LibJS: Make internal_define_own_property() save added property offset
...in `PropertyDescriptor`. This is required for the upcoming change
that needs to know offset of newly added properties to set up inline
caching.
2025-09-17 12:44:44 +02:00
Timothy Flynn
ede6314cb6 LibWebView+UI/AppKit: Display icons in the macOS UI on Tahoe
On macOS Tahoe, it is now recommended to show menu item icons. We use
system symbols for this now. Symbols do not have constant variable names
and must be found via the SF Symbols app.

The symbols chosen here were to match Safari as close as possible.
2025-09-17 11:29:01 +01:00
Rocco Corsi
55d4adc614 LibWasm: Missing argument formatter (Wasm::Value) for WASI_DEBUG
Formatting code was removed in PR #960 for performance improvements.
Adding Wasi::Value back as u128 to allow WASI_DEBUG MACRO compilation
2025-09-16 22:13:23 +02:00
Callum Law
7a9b1a8033 LibWebView: Show a better error for invalid download dir in headless
Previously if the directory returned by `downloads_directory()` didn't
exist (or wasn't a directory) when taking a screnshot in headless mode
we try to ask the user for the download directory and fail with the
unhelpful error: QWidget: Must construct a QApplication before a QWidget
2025-09-16 10:39:20 -04:00
Jelle Raaijmakers
b9da7baac4 LibWeb: Extend logic for extraneous line breaks in block elements
While editing, we need to consider whether removing a <br> has any
effect on layout to determine whether its extraneous. This new condition
finds most cases for extraneous <br>s inside block elements.
2025-09-16 06:57:30 -04:00
Jelle Raaijmakers
f77f169824 LibWeb: Reformat code and comments in Editing::split_the_parents()
Mainly rewrapping the spec text to 120 characters. No functional
changes.
2025-09-16 06:57:30 -04:00
Jelle Raaijmakers
c557db8315 LibWeb: Pass existing DOM::BoundaryPoints in delete_the_selection() 2025-09-16 06:57:30 -04:00
Jelle Raaijmakers
9b614eebb3 LibWeb: Make TreeNode::child_at_index() accept a size_t
This gets rid of IDE warnings when the call site already uses a size_t.
2025-09-16 06:57:30 -04:00
Jelle Raaijmakers
b51cc00478 LibWeb: Resolve Unicode FIXME in forwardDelete 2025-09-16 06:57:30 -04:00
Tete17
82f56e30ed LibWeb: Adapt the parsing of script elements to accommodate TrustedTypes 2025-09-16 10:57:34 +02:00
Tete17
f7c05013c7 LibWeb: Add innerText attribute of HTMLScriptElement for TrustedTypes 2025-09-16 10:57:34 +02:00
Tete17
6b9c44390f LibWeb: Add textContent attribute of HTMLScriptElement for TrustedTypes 2025-09-16 10:57:34 +02:00
Tete17
f65dca1b53 LibWeb: Extend src attribute of HTMLScriptElement with TrustedTypes
The field does no longer have the Reflect and URL attributes so we
remove it from our internal unit test.
2025-09-16 10:57:34 +02:00
Tete17
664a3b536a LibWeb: Extend set_text of HTMLScriptElement to accommodate TrustedTypes 2025-09-16 10:57:34 +02:00
Timothy Flynn
b4df857a57 LibWeb+LibWebView+WebContent: Replace DNT with GPC
Global Privacy Control aims to be a replacement for Do Not Track. DNT
ended up not being a great solution, as it wasn't enforced by law. This
actually resulted in the DNT header serving as an extra fingerprinting
data point.

GPC is becoming enforced by law in USA states such as California and
Colorado. CA is further working on a bill which requires that browsers
implement such an opt-out preference signal (OOPS):

https://cppa.ca.gov/announcements/2025/20250911.html

This patch replaces DNT with GPC and hooks up the associated settings.
2025-09-16 10:38:20 +02:00
Zaggy1024
850aea7e17 LibWeb: Remove a FIXME and simplify the painting of video frames
The extra representations of a video element are unnecessary to specify
in VideoPaintable, as the playback system itself should take care of
all the details of the representation as specified.
2025-09-16 10:26:03 +02:00
Zaggy1024
861c10f37f LibWeb: Use an IIFE to determine a VideoPaintable's representation 2025-09-16 10:26:03 +02:00
Timothy Flynn
7b3465ab55 LibWeb: Do not require multipart form data to end with CRLF
According to RFC 2046, the BNF of the form data body is:

    multipart-body := [preamble CRLF]
                      dash-boundary transport-padding CRLF
                      body-part *encapsulation
                      close-delimiter transport-padding
                      [CRLF epilogue]

Where "epilogue" is any text that "may be ignored or discarded". So we
should stop parsing the body once we encounter the terminating delimiter
("--").

Note that our parsing function is from an attempt to standardize the
grammar in the spec: https://andreubotella.github.io/multipart-form-data
This proposal hasn't been updated in ~4 years, and the fetch spec still
does not have a formal definition of the body string.
2025-09-15 18:28:48 +02:00
Callum Law
34b8947ca0 LibWeb: Support text-underline-position: under 2025-09-15 15:24:20 +01:00
Callum Law
b0e3af7d10 LibWeb: Parse text-underline-position property
This introduces the `TextUnderlinePositionStyleValue` class, it is
possible to represent `text-underline-position` as a `StyleValueList`
but would have required ugly workarounds for either serialization or in
`ComputedProperties::text_underline_position`
2025-09-15 15:24:20 +01:00
Callum Law
a6812e1005 LibWeb: Store parsed shorthands in canonical order 2025-09-15 15:24:20 +01:00
Sam Atkins
d127eb5117 LibWeb/Geometry: Correct typos in DOMMatrix "not 0 or -0" checks
Assuming 0 and -0 are distinct values, `a != 0 || a != -0` is always
true.
2025-09-15 13:34:24 +02:00
Aliaksandr Kalenik
85e029b2e7 LibJS+LibWeb: Inline fast path for Value::to_object()
Adds inline implementation for the most common case when `Value` is
already an object.

1.47x improvement on the following benchmark:
```js
const o = {};
for (let i = 0; i < 10_000_000; i++) {
    o.a = 1;
    o.b = 2;
    o.c = 3;
}
```
2025-09-15 12:16:58 +02:00
Tim Ledbetter
f5fd6338d5 LibWeb: Handle interpolation of mixed-type LengthPercentages 2025-09-15 10:41:01 +01:00
Tim Ledbetter
7409c564d7 LibWeb: Extract mixed-type interpolation to a separate method 2025-09-15 10:41:01 +01:00
Tim Ledbetter
b19fee9962 LibWeb: Interpolate ellipse() function by computed value 2025-09-15 10:34:43 +01:00
Tim Ledbetter
f146207a04 LibWeb: Interpolate circle() function by computed value 2025-09-15 10:34:43 +01:00
Tim Ledbetter
4a0fe65923 LibWeb: Interpolate polygon() function by computed value 2025-09-15 10:34:43 +01:00
Tim Ledbetter
853bedeb31 LibWeb: Interpolate rect() function by computed value 2025-09-15 10:34:43 +01:00
Tim Ledbetter
0c89e86ff7 LibWeb: Interpolate xywh() function by computed value 2025-09-15 10:34:43 +01:00
Tim Ledbetter
be94c8d456 LibWeb: Interpolate inset() function by computed value 2025-09-15 10:34:43 +01:00
Lorenz A
47796e7967 LibWeb: Serialize HTML attribute names as per spec 2025-09-15 10:08:12 +02:00
Luke Wilde
4772e1b0c9 LibWeb/Fetch: Add missing spec step for checking for tuple origin
Fixes https://github.com/LadybirdBrowser/ladybird/issues/6188
2025-09-15 09:58:33 +02:00
Sam Atkins
5904694844 LibWeb/CSS: Implement CSSImageValue and reify images as it
This is specced to be opaque, so there's not much to it.
2025-09-15 08:47:10 +01:00
Callum Law
50239b58aa LibWeb: Reset border-image to initial value when using border
Also includes associated handling for serialization of the `border`
shorthand.
2025-09-15 08:42:22 +01:00
Callum Law
588c611e7e LibWeb: Use correct initial value for border-image
Omitting the `/`s meant that `1` and `0` were parsed as part of
border-slice instead of their intended values.

No functional changes but this will be relied on in a later commit.
2025-09-15 08:42:22 +01:00
ayeteadoe
69e92f69a7 LibCore: Implement SIGTERM-based kill() on Windows
There is no direct Win32 API equivalent, but calling WM_CLOSE on
the top-level windows allows for a graceful shutdown where resources
are able to clean themselves up properly
2025-09-15 09:19:52 +02:00
Pavel Shliak
bbb9159883 LibWeb: Fix Request() TypeError message typo for mode='navigate'
The Request constructor’s mode validation threw
  "Mode must not be 'navigate"
missing the closing quote. Add the trailing quote so the error reads:
  "Mode must not be 'navigate'".
2025-09-15 08:19:34 +01:00
Kemal Zebari
faf3c19026 LibWeb/MimeSniff: Match spec change by using correct font essence
Spec change was made to fix a typo; application/font-off ->
application/font-otf
2025-09-15 07:31:02 +01:00
MFMF-EGY
fff09ed330 LibWeb: Handle interpolation of BorderRadius style value type 2025-09-14 16:49:20 +01:00
Shivendra Kumar
b3e8784f92 LibCrypto: Fix typo in comment 2025-09-14 10:45:41 +01:00
Marcos Del Sol Vives
40792aa85d LibWeb/CSS: Fix compilation with CSS_TRANSITIONS_DEBUG
A new parameter was added to Web::CSS::StyleValue::to_string() in
PR #2820 but this debug message was never updated. If
CSS_TRANSITIONS_DEBUG was enabled, compilation would fail.
2025-09-13 23:33:57 +02:00