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

68695 commits

Author SHA1 Message Date
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
Shannon Booth
e124ef52ee LibJS+LibWeb: Set [[CanBlock]] false to Agent for window agent
similar-origin window agents have the [[CanBlock]] flag set to false.
Achieve this by hooking up JS's concept with an agent to HTML::Agent.
For now, this is only hooked up to the similar-origin window agent
case but should be extended to the other agent types in the future.
2025-04-22 11:50:35 -04:00
Timothy Flynn
4cd186f3f5 LibWeb: Adjust the scroll offset when the scrollbar gutter is clicked
This allows clicking on the scrollbar gutter to scroll to the offset
indicated by the mouse position.
2025-04-22 11:29:06 -04:00
Timothy Flynn
a135ce528e LibWeb: Move adjustmust of scrollbar offset into compute_scrollbar_data
Currently, compute_scrollbar_data does not adjust the position of the
scrollbar thumb based on the actual scroll offset. This is because we
perform this offset in most cases inside the display list executor, in
order to allow us to avoid recomputing the display list.

However, there are cases where we do want the thumb rect with an offset
inside PaintableBox. We currently use scroll_thumb_rect to perform that
computation.

In an upcoming patch, we will need both this offset thumb rect and the
scrollbar gutter rect. So this patch moves the computation of the offset
to compute_scrollbar_data, performed behind an optional parameter.
2025-04-22 11:29:06 -04:00
Timothy Flynn
66e422b4f1 LibWeb: Draw a scrollbar gutter when the scrollbar is enlarged 2025-04-22 11:29:06 -04:00
Timothy Flynn
126be42cfa LibWeb: Paint scrollbar outlines with anti-aliasing
This gives the scrollbar a much less jagged appearance.
2025-04-22 11:29:06 -04:00
Timothy Flynn
843468dbf8 LibWeb: Enlarge scrollbars that are interacting with the mouse
When a scrollbar is not interacting with the mouse, we now draw the
scrollbar slightly slimmer. When the mouse enters the space occupied
by the scrollbar, we enlarge it for easier mouse interactivity.
2025-04-22 11:29:06 -04:00
Timothy Flynn
9ef3fd0922 headless-browser: Disable viewport scrollbar painting for tests
This allows us to update how the viewport scrollbar is painted without
breaking every screenshot test.
2025-04-22 11:29:06 -04:00
Shannon Booth
96f38dc180 LibWeb/HTML: Make environments top level creation URL nullable
This is explicitly set to null for Workers.
2025-04-22 08:44:50 -06:00
Ali Mohammad Pur
a786269687 LibWeb/WebAssembly: Implement Module::customSections(module) 2025-04-22 08:43:46 -06:00
Ali Mohammad Pur
f341bb0522 IDLGenerators: Cast wrapped references to a known reference type
They may be GC::Ref<T> objects, which should be converted to T const&
before being so nicely const-cast to T&.
2025-04-22 08:43:46 -06:00
Ali Mohammad Pur
95cc2bd810 LibWeb/WebAssembly: Implement Module::exports(module) 2025-04-22 08:43:46 -06:00
Ali Mohammad Pur
f984c1cc51 LibWeb/WebAssembly: Implement Module::imports(module) 2025-04-22 08:43:46 -06:00
Ali Mohammad Pur
3a6b6a732e IDLGenerators: Unbreak sequence<dictionary> codegen
This was completely busted (where it would generate a variable inside a
block, and try to access it outside the block); this commit fixes this
in the least annoying way possible.
2025-04-22 08:43:46 -06:00
Ali Mohammad Pur
51bab5b186 LibWasm: Make traps hold on to externally-managed data
...instead of specially handling JS::Completion.
This makes it possible for LibWeb/LibJS to have full control over how
these things are made, stored, and visited (whenever).

Fixes an issue where we couldn't roundtrip a JS exception through Wasm.
2025-04-22 08:43:46 -06:00
Andreas Kling
7b2a427430 LibWeb: Avoid computing automatic minimum size for some flex items
There's a specific (and thankfully very common!) scenario where we can
actually skip calculating the automatic minimum size for flex items.

In single-line (no wrapping) flex containers, if the sum of all item
flex base sizes is <= the flex container's main size, we know that
none of the items will be shrunk by the layout algorithm.

And so for any flex item with definite main size AND automatic minimum
main size, we can treat the automatic minimum size as 0.
2025-04-22 15:46:10 +02:00
Tim Ledbetter
6f5b107fcc LibWeb: Resolve absolute calc() values in color functions
Currently, `calc()` values with relative units are not handled
correctly and will output an error to the console.
2025-04-22 12:20:26 +02:00
Tim Ledbetter
9cf04f40f6 LibWeb: Implement the color-mix() function
This takes 2 color values and returns the result of mixing them by a
given amount.
2025-04-22 12:19:51 +02:00
Shannon Booth
a14711a9d7 LibWeb/Bindings: Use realm's globalObject as thisValue if nullish
We were missing the step to use realm's global object if thisValue
was nullish. This is very trivial to fix, as `impl_this` already
handles everything as it should, allowing us to also remove the
special casing for WindowProxy.
2025-04-22 12:17:14 +02:00
Shannon Booth
dcc7fe3663 LibWeb/Tests: Import WPT test global-object-implicit-this-value 2025-04-22 12:17:14 +02:00
Andreas Kling
0c6ad0a740 LibWeb: Remove redundant call to fit-content sizing in flex layout
We were calculating the fit-content cross size and then throwing it
away and doing it again. You might think this wasn't so bad since
fit-content relies on cacheable intrinsic sizes *buuuuut* since we're
actually modifying the constraints for the second call, we were indeed
doing completely wasted work here.
2025-04-22 12:09:42 +02:00
Andreas Kling
9840a8c750 LibWeb: Turn Window.scroll(0, 0) into a no-op when possible
For unscrolled viewports (already at 0, 0), we can short-circuit here
and avoid doing a synchronous relayout of the page.

This avoids a bunch of synchronous layouts on Speedometer3's NewsSite
(Nuxt version) subtests.
2025-04-22 12:09:42 +02:00
Andreas Kling
1242b9152e LibWeb: Turn Element.scroll(0, 0) into a no-op when possible
For unscrolled elements (already at 0, 0) that aren't eligible to be the
Document.scrollingElement, we can short-circuit here and avoid doing a
synchronous relayout of the page.

This avoids a bunch of synchronous layouts on Speedometer3's NewsSite
subtests.
2025-04-22 12:09:42 +02:00
Andreas Kling
c394344e7d LibWeb: Put PaintableWithLines in dedicated GC allocator 2025-04-22 12:09:42 +02:00
Aliaksandr Kalenik
20c6c4e359 LibJS: Delete unused member in FunctionParameter AST node 2025-04-22 10:53:59 +02:00
Shannon Booth
ad62af3d82 LibWeb/ServiceWorker: Add some FIXME comments for updatedResources logic 2025-04-21 15:26:38 -06:00
Shannon Booth
73b981e339 LibWeb/ServiceWorker: Adjust comments for ServiceWorkerRecord 2025-04-21 15:26:38 -06:00
Shannon Booth
9bc022c229 LibWeb/ServiceWorker: Immediately finish job if resources didn't change 2025-04-21 15:26:38 -06:00
Aliaksandr Kalenik
63f17a4f12 LibWeb: Support per-glyph font fallbacks in canvas text measuring 2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
f6b0851c38 LibGfx+LibWeb: Support per-glyph font fallbacks in canvas text painting
Instead of using the first font from the FontCascadeList for all glyphs
in a text, we perform a text shaping process that finds a suitable font
for each glyph and returns a list of glyph runs, where each glyph run
represents consecutive glyphs using the same font.
2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
1e7922fac8 LibGfx+LibWeb: Add Path::glyph_run() and use in canvas
Canvas text painting needs to support per-glyph font fallbacks, which
means we can't hand over responsibility for text shaping to Skia and
instead need to extract glyph paths from our own shaped GlyphRun.
2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
2c64c6d773 LibWeb: Store FontCascadeList instead of Font in CanvasState
This is required to implement per-glyph font fallbacks in the upcoming
changes.
2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
455700d379 LibGfx: Join SkiaFont.cpp into Font
No need to keep this function in a separate file.
2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
8e2d1559ec LibGfx: Join ScaledFont into Font
Since ScaledFont is the only class inherited from Font we could simply
merge them.
2025-04-21 09:51:16 +02:00
Aliaksandr Kalenik
16e883a9a3 LibGfx+LibWeb: Don't include start.x in GlyphRun width
For some reason we were including x offset of start position into glyph
run width. This is not correct and would be revealed by the upcoming
changes.
2025-04-21 09:51:16 +02:00