Commit graph

73167 commits

Author SHA1 Message Date
Tim Ledbetter
e9519b132f Base: Use the correct memory unit suffixes in about::processes
Previously the GB suffix was displayed as BB.
2025-12-01 07:30:23 -05:00
Lorenz A
b579608d41 Meta: Remove unused function check_program_version_at_least
The function `check_program_version_at_least` was only used in
`ladybird.sh`, which was removed in PR #4904.
2025-12-01 13:02:53 +01:00
Timothy Flynn
90525f7e97 LibCore: Define SocketAddress out-of-line to remove SocketAddressWindows
SocketAddressWindows.h contains a bunch of copy-pasted Windows
definitions. This started causing ad-nauseam redefinition errors when
implementing the HTTP disk cache for Windows.

Instead, let's forward-declare the types we can in SocketAddress.h and
only define the couple of constants that we need. We can then assert at
compile-time that we defined them correctly.
2025-12-01 06:34:32 -05:00
Timothy Flynn
5c88c3718b LibCore: Do not include SocketAddressWindows.h in System.h
SocketAddressWindows.h contains (re)definitions of a bunch of system-
level types. This leads to a bunch of conflicts when trying to include
proper Windows headers in SystemWindows.cpp. This patch removes this
inclusion and just forward-declares the couple of types we need.
2025-12-01 06:34:32 -05:00
Timothy Flynn
2d22ef0db5 LibCore: Move AddressInfoVector to its own file
By defining this class entirely in the System.h header, we are relying
on ::freeaddrinfo being available. This has led to us polluting the
System.h header with system-level definitions on Windows by way of
SocketAddressWindows.h.
2025-12-01 06:34:32 -05:00
Sam Atkins
cdc81e8921 LibWeb/CSS: Add -moz-appearance property alias 2025-12-01 11:10:13 +00:00
Sam Atkins
d5d1b5351e LibWeb: Hide stepper buttons on appearance: textfield number inputs
The spec says:

> For the purpose of this specification, they all have the same effect
  as auto. However, the host language may also take these values into
  account when defining the native appearance of the element.

https://drafts.csswg.org/css-ui/#typedef-appearance-compat-special

Firefox at least hides the stepper buttons when this is set.
2025-12-01 11:10:13 +00:00
Sam Atkins
c3d23a2487 LibWeb/HTML: Clone integrity policy when cloning policy container
Corresponds to:
3c6cb6c0c5
2025-12-01 11:07:16 +00:00
Sam Atkins
b3d9ffdfce LibWeb/HTML: Update ImageRequest::prepare_for_presentation spec steps
Corresponds to:
ad281924e2

We don't implement this at all yet, it's still just FIXMEs.
2025-12-01 11:07:16 +00:00
Sam Atkins
573d5362f4 LibWeb/HTML: Add FIXMEs to honor WebDriver BiDi emulated language
Corresponds to:
547f8044b0

We currently don't follow the spec for these language getters, and the
BiDi changes are still ongoing, so it seems better to leave a FIXME for
them rather than try to make any changes right now.
2025-12-01 11:07:16 +00:00
Sam Atkins
c8990697d1 LibWeb: Add FIXME for moving "stop parsing" step for error documents
Corresponds to:
48cd393d1e

Actually doing so was causing crashes and other issues, so I'll leave it
as a FIXME for later.
2025-12-01 11:07:16 +00:00
Sam Atkins
2feff2b519 LibWeb/HTML: Capitalize autocorrection and autocapitalization states
Only comment changes.

Corresponds to:
ea29ce1963
2025-12-01 11:07:16 +00:00
Sam Atkins
c0b8f47a76 LibWeb/HTML: Move connectedness check for script post_connection()
Corresponds to:
905384d140

Also import the test added along with that change.
2025-12-01 11:07:16 +00:00
Sam Atkins
5179c57ca0 LibWeb/DOM: Use Document::make_unsalvageable()
Noticed because of this spec change:
e2974bd884

I then went and updated the other places it should be used.
2025-12-01 11:07:16 +00:00
Sam Atkins
04f1dbce2e LibWeb/HTML: Update BroadcastChannel::is_eligible_for_messaging() spec
Corresponds to part of:
e9ccb97eb1

The majority of that spec change is in algorithms that we don't yet
implement. So this is just a small text change and an update to use
as_if() instead of static_cast().
2025-12-01 11:07:16 +00:00
Sam Atkins
ed5169af8d LibWeb/HTML: Make command events not composed
Also re-import the affected button-event-dispatch test.

Corresponds to:
787316d519
2025-12-01 11:07:16 +00:00
Sam Atkins
d2b261d28e LibWeb/DOM: Update references to ancestor revealing algorithms
No behaviour changes, because we don't yet implement the actual
algorithm.

Corresponds to:
55baf054d2
2025-12-01 11:07:16 +00:00
Sam Atkins
15583040df LibWeb/DOM: Add FIXMEs for new spec steps in respond_to_base_url_changes
Corresponds to part of
49f5cd381e

(Apparently I missed this when previously looking at that spec PR.)
2025-12-01 11:07:16 +00:00
Sam Atkins
f81bb1bd8c LibWeb/CSS: Absolutize GradientStyleValues
This lets us not care about non-absolute Length units when resolving
gradient data, as they'll already have been converted to px.

We can also use Angle::from_style_value() safely on absolutized angles,
which reduces some boilerplate code.
2025-12-01 11:01:06 +00:00
Sam Atkins
fbe0567f90 LibWeb/CSS: Store RadialGradientStyleValue sizes as StyleValues
No significant consequences of this, but it'll make it easier to
absolutize these values.
2025-12-01 11:01:06 +00:00
Sam Atkins
d327f677c5 LibWeb/CSS: Store linear-gradient() angle as a StyleValue
This means we now support calc() there too.
2025-12-01 11:01:06 +00:00
Sam Atkins
73fbaaba77 LibWeb: Store GradientStyleValue color-stop positions as StyleValues
A few things fall out of this:
- We no longer need to templatize our color-stop list types.
- A bit more code is required to resolve gradient data.

This results in a slightly different rendering for a couple of the test
gradients, with a larger difference between macOS and Linux. I've
expanded the fuzziness factor to cover for it.
2025-12-01 11:01:06 +00:00
Sam Atkins
71397c876c Tests: Import gradient interpolation test
Importing separately to make progress easier to see.
2025-12-01 11:01:06 +00:00
Callum Law
12e8f503aa LibWeb: Support non-fixed <random-value-sharing>
This works by generating random values using XorShift128PlusRNG at
compute time and then caching them on the document using the relevant
random-caching-key
2025-12-01 11:00:33 +00:00
Callum Law
86e6aa0291 LibWeb: Keep track of random function index within property value
Caching keys for 'auto' <random-value-sharing> rely on this value to
distinguish between two random functions in a single property
2025-12-01 11:00:33 +00:00
Callum Law
bad9efac22 LibWeb: Support CSS random() function step argument 2025-12-01 11:00:33 +00:00
Callum Law
2a5e389f63 LibWeb: Implement basic CSS random() function
At the moment this is limited to only fixed value sharing and does not
support step values
2025-12-01 11:00:33 +00:00
Callum Law
8944130fde LibWeb: Serialize CSS::Number to spec
We were previously serializing with 5 instead of 6 digits of precision
2025-12-01 11:00:33 +00:00
Callum Law
76108b1979 LibWeb: Update math function argument parsing to use TokenStream
This brings us in line with the rest of the parsing methods
2025-12-01 11:00:33 +00:00
Callum Law
1f7fe97ac3 LibJS/AK: Move XorShift128PlusRNG to AK
This will be useful for CSS random functions so it should be in a
reusable place.

This does require us to use `AK::get_random` instead of
`Crypto::get_secure_random`, but this is fine since the latter is in the
process of being removed (see #6564).
2025-12-01 11:00:33 +00:00
Callum Law
6d9f10ba36 LibWeb: Support nullable arguments to CSS math functions
All existing arguments have defaults but this isn't always the case
(e.g. the step argument for `random()`)
2025-12-01 11:00:33 +00:00
Callum Law
65512f5403 LibWeb: Import CSS random function tests 2025-12-01 11:00:33 +00:00
Callum Law
cd0976395a LibWeb: Remove unused class in CSS parser 2025-12-01 11:00:33 +00:00
Callum Law
2477a8eb0d LibWeb: Use property_initial_value rather than hardcoded default value 2025-12-01 10:16:41 +00:00
Callum Law
d6371fe896 LibWeb: Simplify parse_coordinating_value_list_shorthand 2025-12-01 10:16:41 +00:00
Callum Law
51f694c6af LibWeb: Simplify compute_style_value_list 2025-12-01 10:16:41 +00:00
Callum Law
3ab0bdf4fd LibWeb: Simplify handling of unicode-range descriptor
We know that this is always a `StyleValueList`
2025-12-01 10:16:41 +00:00
Callum Law
47bed173b4 LibWeb: Simplify ComputedProperties::will_change()
We know that `will-change` parses as either `Keyword::Auto` or
`StyleValueList`
2025-12-01 10:16:41 +00:00
Callum Law
b52beb5105 LibWeb: Simplify assemble_coordinated_value_list
We know that all coordinated value list longhands are parsed as
`StyleValueList`s
2025-12-01 10:16:41 +00:00
Callum Law
e8ba1b4fdf LibWeb: Simplify serialization of coordinating value list shorthands
We know that longhand values are always `StyleValueList`s

Introduces a new fail in the `view-timeline-shorthand.html` WPT test
but this is because the test is incorrect and we now correctly don't
contract when `view-timeline-inset` has dissimilar cardinality. See
web-platform-tests/wpt#56181
2025-12-01 10:16:41 +00:00
Callum Law
11a9b5a67b LibWeb: Simplify handling of font-family
We know `parse_comma_separated_value_list` always returns a
`StyleValueList`
2025-12-01 10:16:41 +00:00
Callum Law
0595d52be2 LibWeb: Simplify handling of {text,box}-shadow
We know that shadow values are always parsed as a `KeywordStyleValue`
with `Keyword::None` or a `StyleValueList`
2025-12-01 10:16:41 +00:00
Callum Law
4c4fa5c9cd LibWeb: Simplify expansion of background-position shorthand
We know that this is always a `StyleValueList`
2025-12-01 10:16:41 +00:00
Callum Law
40596d5b99 LibWeb: Simplify getting resolved value for animation-duration
We now know that `animation_duration_computed_value` is always a
StyleValueList
2025-12-01 10:16:41 +00:00
Callum Law
e937f5db57 LibWeb: Always parse comma separated value lists as StyleValueList
Previously we would either parse these as `StyleValueList<T>` or `T`
depending on whether or not there was more than one value, this meant we
always had to handle both cases anywhere we used these values.
2025-12-01 10:16:41 +00:00
Callum Law
1a5933cb04 LibWeb: Fail less when multiple mask images are defined
We don't yet support multiple images but we at least continue to use the
first rather than having none
2025-12-01 10:16:41 +00:00
Callum Law
5371862d11 LibWeb: Use correct play state for handling animations on display change
Previously we were doing a couple things wrong:
 - Using the cascaded rather than computed value (so we didn't support
   CSS-wide keywords)
 - Only supporting the case where we had one animation-play-state
2025-12-01 10:16:41 +00:00
Callum Law
1af0364cfc LibWeb: Store last_css_animation_play_state on anim instead of effect
Since it is the animation rather than the effect which has a play state
it makes more sense to store it here
2025-12-01 10:16:41 +00:00
Tete17
6a95506bb1 LibWeb: Update Dom spec now that TrustedTypes integration is merged 2025-12-01 09:54:04 +01:00
Tete17
42284f8006 LibWeb: Modify DomParser parseFromString to accept TrustedHTML
We made the internal changes to accept this new type, but we forgot to
expose it.
2025-12-01 09:54:04 +01:00