1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00
Commit graph

68729 commits

Author SHA1 Message Date
Ali Mohammad Pur
eea81738cd AK+Everywhere: Recognise that surrogates in utf16 aren't all that common
For the slight cost of counting code points when converting between
encodings and a teeny bit of memory, this commit adds a fast path for
all-happy utf-16 substrings and code point operations.

This seems to be a significant chunk of time spent in many regex
benchmarks.
2025-04-23 07:56:02 -06:00
Andrew Kaster
86c756a589 LibWeb: Import WebAssembly jsapi cross-realm torture tests from WPT
The failures here are due to us not actually implementing the
error types yet.
2025-04-23 14:09:09 +02:00
Andrew Kaster
7b0c2da14f LibWeb: Account for LegacyNamespace attribute in constructor generator
When playing games with cross-realm construction, we need to make sure
that any calls to ensure_web_prototype for LegacyNamespace objects use
the correctly namespaced prototype name.
2025-04-23 14:09:09 +02:00
Jelle Raaijmakers
79352ad725 LibWeb: Remove application of vertical float clearance to BFC Y offset
In 15103d172c we applied any remaining vertical float clearance to the
BFC's current Y offset for the next block to layout, because a `<br
style="clear: left">` could introduce clearance that would otherwise be
ignored. However, a `<div>` that floats _and_ clears `right` also
introduces this clearance and it is obvious that this should not push
down any subsequent blocks to layout in the current BFC.

Turns out, we don't need this change anymore. Some other later change
also fixed the underlying issue, and by getting rid of the original fix
we can now render https://en.wikipedia.org/wiki/SerenityOS correctly
again.

Fixes #4418.
2025-04-23 13:24:58 +02:00
Jelle Raaijmakers
1731389bfe LibWeb: Return early in clear_floating_boxes()
Get rid of an indentation level. No functional changes.
2025-04-23 13:24:58 +02:00
Jelle Raaijmakers
47ed39a790 LibWeb: Reuse floating box' margin box rect for clear: ...
We already store the resulting margin box rect for floating boxes
relative to their root coordinate space, so don't calculate them again.
No functional changes.
2025-04-23 13:24:58 +02:00
Timothy Flynn
8417ade552 LibWeb: Update the media display when the hovered component changes
This allows the media paintable to be redrawn when the media element is
paused. We change the color of some components on hover, but if the
media was paused, that would not be rendered. This wasn't an issue while
the media is playing because the update to the timeline would take care
of redrawing the paintable.
2025-04-23 13:22:56 +02:00
Timothy Flynn
7b0e62cae7 LibWeb: Use branded colors for the painted media controls 2025-04-23 13:22:56 +02:00
Timothy Flynn
094e00caef LibGfx: Add a helper to create Ladybird-branded colors 2025-04-23 13:22:56 +02:00
Sam Atkins
658569b533 LibWeb/CSS: Use CSSRule's context to parse new child rules
Keep track of which CSSRule owns a CSSRuleList, and then use that to
produce a stack of RuleContexts for the CSS Parser to use.

There are certainly other places we should do this!
2025-04-23 10:55:45 +01:00
Sam Atkins
763b1b0ee2 LibWeb/CSS: Move RuleContext type out of Parser.h
This was previously internal to the Parser, but we'd like to pass it in
from outside.
2025-04-23 10:55:45 +01:00
Sam Atkins
9465492edf LibWeb/CSS: Combine the CSSRuleList constructors 2025-04-23 10:55:45 +01:00
Sam Atkins
3d1665cc80 LibWeb/CSS: Parse nested declarations in insert_a_css_rule()
The spec algorithm changed at some point to support nested declarations,
but I only just noticed. The subtest regression is one we were passing
incorrectly.
2025-04-23 10:55:45 +01:00
Sam Atkins
fa8bbfa6a5 LibWeb/CSS: Align declaration block parsing with the spec
We have two different code paths that implement the "parse a CSS
declaration block" algorithm, for properties and descriptors. COmbining
them isn't straightforward, and doesn't seem especially useful.
2025-04-23 10:55:45 +01:00
Tim Ledbetter
8a20899382 LibWeb: Canonicalize color space when parsing color-mix() function
This amounts to replacing the "xyz" color space with "xyz-d65".
2025-04-23 11:26:27 +02:00
Gingeh
7b8af4d84c LibWeb: Remove a popover AD-HOC comment after spec update
See https://github.com/whatwg/html/pull/11197
2025-04-23 10:13:29 +01:00
Tim Ledbetter
04d7228c51 LibWeb: Implement interpolation of repeatable lists 2025-04-23 09:13:45 +01:00
Tim Ledbetter
0beb22f19e LibWeb: Implement interpolation of edge values 2025-04-23 09:13:45 +01:00
Tim Ledbetter
31dea89fe0 AK: Add lowest common multiple and greatest common divisor functions 2025-04-23 09:13:45 +01:00
Tim Ledbetter
16e83f0b35 Tests: Remove some animation tests from the ignore list
These tests are relevant to the fixes being made in later commits
2025-04-23 09:13:45 +01:00
InvalidUsernameException
84ff18b6ac LibGfx: Assert on out-of-bounds y-value
The reduced amount of indirections from the previous commit made it
obvious that a range check on the y-value was missing.
2025-04-23 09:26:45 +02:00
InvalidUsernameException
7568ea3160 LibGfx: Simplify get_pixel()
There appears to be no reason for Bitmap::get_pixel() to be split into
three layers of methods. Make the code simpler by inlining everything
into a single method.
2025-04-23 09:26:45 +02:00
InvalidUsernameException
578a3af87d LibGfx: Support missing pixel formats in get_pixel()
Bitmap::get_pixel() was only handling two out of the four possible pixel
formats, asserting when called with the other two. The asserting code
path was triggered when loading JPEG XL images, causing crashes on pages
like https://jpegxl.info/resources/jpeg-xl-test-page or
https://html5test.co/.
2025-04-23 09:26:45 +02:00
Shannon Booth
f1d79483b7 LibWeb/HTML: Only trim single '#' on Location.hash setter 2025-04-23 08:24:29 +01:00
Shannon Booth
d01ee20b67 LibWeb/HTML: Update spec comments for location hash setter
Corresponds to open merge request in HTML spec of whatwg/html#11245
and a WPT test change of web-platform-tests/wpt#52085.
2025-04-23 08:24:29 +01:00
Shannon Booth
03c487eb56 LibWeb/HTML: Implement remaining Location setters 2025-04-23 08:24:29 +01:00
Shannon Booth
8ba6c7330d LibWeb/HTML: Adjust some comments in Location implementation
To closer resemble the style of other places in the code base.
2025-04-23 08:24:29 +01:00
Glenn Skrzypczak
d4076ec9fa LibWeb/HTML: Signal a type change
Type changes are now signaled to radio buttons. This causes other radio
buttons in the group to be unchecked if the input element is a checked
radio button after the type change.
2025-04-23 07:20:02 +01:00
Glenn Skrzypczak
5f75558646 LibWeb/HTML: Correctly reset selection on type change
The selection now gets reset to the beginning of the control if the
type changes from an unselectable type to a selectable type.
2025-04-23 07:20:02 +01:00
Pavel Shliak
84e29f791c Revert "AK: Work around Apple Clang __builtin_subc codegen issue"
This reverts commit 9d4dfc1061.
2025-04-22 22:31:28 -06:00
Jonne Ransijn
bb20a0d8f8 AK: Allow the Optional<T> move assignment operator to be trivial
This will change behaviour for moved-from `Optional<T>`s, since they
will now no longer clear their value if `T` is trivial. However, a
moved-from value should be considered to be in an unspecified state.
Use `Optional<T>::clear` or `Optional<T>::release_value` instead.
2025-04-22 21:19:31 -06:00
Jonne Ransijn
50bc6fb9d9 AK: Loosen the restrictions on non-copyable/non-movable containers
If a type is non-move constructible but move assignable,
its container type may still be move assignable.

Similairly, if a type is non-copy constructible but copy assignable,
its container type may still be copy assignable.
2025-04-22 21:19:31 -06:00
Jonne Ransijn
eff9d4881c AK: Add IsScalar to StdLibExtraDetails.h
This matches the behaviour of `std::is_scalar_v`
2025-04-22 21:19:31 -06:00
Jonne Ransijn
0d1ba5c37d AK: Add IsMemberPointer to StdLibExtraDetails.h
Does exactly what it says on the tin.
2025-04-22 21:19:31 -06:00
Jonne Ransijn
7fcedae610 Tests: Fix missing argument removed by -cc1
This argument is removed (or rather, never added) by `-cc1`, which
breaks any builds using GNU libc++, including CI.
2025-04-22 21:19:31 -06:00
Jonne Ransijn
ca33899370 LibJS: Allow Optional<Completion> to be used in constant expressions 2025-04-22 21:19:31 -06:00
Jonne Ransijn
c63a8c0334 LibJS: Allow Optional<Value> to be used in constant expressions 2025-04-22 21:19:31 -06:00
Jonne Ransijn
e37377600d AK: Allow Optional<{,Fly}String> to be used in constant expressions 2025-04-22 21:19:31 -06:00
Jonne Ransijn
a059ab4677 AK: Allow Optional<T> to be used in constant expressions 2025-04-22 21:19:31 -06:00
Jonne Ransijn
063be28e90 AK: Add IsOneOfIgnoringCVReference to StdLibExtraDetails.h
Much like `IsOneOfIgnoringCV`, some functions want to ignore both
cv-qualifiers _and_ references. Add a template and concept for it.
2025-04-22 21:19:31 -06:00
Jonne Ransijn
e5d89c72a6 LibWeb: Remove unuses variable in PaintableBox.cpp 2025-04-22 21:19:31 -06:00
Timothy Flynn
16c535a6d2 Meta: Read vcpkg baseline revision from vcpkg.json
Just so we only have to update one location when we update the baseline.
2025-04-22 19:30:07 -04:00
Ali Mohammad Pur
2c13504bfc LibWebView+RequestServer: Add some UI for DNS settings 2025-04-22 18:05:07 -04:00
Andrew Kaster
e1369aa7d6 CMake: Explicitly set CMAKE_OSX_SYSROOT to macosx for macOS host builds
The implicit default CMAKE_OSX_SYSROOT was a workaround in CMake for
macOS ~10.8. As of CMake 4.x, CMake expects macOS host compilers to have
their own default sysroot detection logic. However, upstream llvm does
not actually do this, only Apple Clang does. To keep supporting homebrew
clang and manually compiled clang from llvm/llvm-project, we need to
set the sysroot explicitly.

The behavior difference and lack of default detection logic in the clang
driver is tracked at https://gitlab.kitware.com/cmake/cmake/-/issues/26863
2025-04-22 17:31:12 -04:00
Aliaksandr Kalenik
981e465a04 LibJS: Delete create_variable param in BindingPattern::generate_bytecode
It's no longer used, because we assume that caller of this function has
already taken care of variable creation and initialization.
2025-04-22 21:57:25 +02:00
Aliaksandr Kalenik
7932091e02 LibJS: Allow using local variable for catch parameters
Local variables are faster to access and if all catch parameters are
locals we can skip lexical environment allocation.
2025-04-22 21:57:25 +02:00
Aliaksandr Kalenik
0f14c70252 LibJS: Use Identifier to represent CatchClause parameter names
By doing that we consistently use Identifier node for identifiers and
also enable mechanism that registers identifiers in a corresponding
ScopePusher for catch parameters, which is necessary for work in the
upcoming changes.
2025-04-22 21:57:25 +02:00
Andreas Kling
42f72bbdce Revert "LibWeb: Turn Window.scroll(0, 0) into a no-op when possible"
This reverts commit 9840a8c750.

Regressed a number of CSS transitions tests in WPT.
2025-04-22 19:28:06 +02:00
Sam Atkins
7bedc1c556 Meta: Update woff2 to version 1.0.2#5
This includes a patch which lets it build on GCC 15.
See https://github.com/microsoft/vcpkg/pull/45132
2025-04-22 11:51:02 -04:00
Sam Atkins
da5a9e548d Meta: Update vcpkg to latest master 2025-04-22 11:51:02 -04:00