Sam Atkins
79093291b5
LibWeb/CSS: Un-template parse_comma_separated_value_list()
...
This doesn't need to be a template. Changing it means we can use it from
any FooParsing.cpp file, and also move it ValueParsing.cpp where it
belongs.
2025-04-04 10:40:32 +01:00
Sam Atkins
fd4f4f425d
LibWeb: Generate DescriptorID enum
...
Add a new JSON file describing at-rule descriptors, and then use it to
generate a DescriptorID enum, and code to check if it's accepted in a
given at-rule.
2025-04-04 10:40:32 +01:00
Timothy Flynn
a3ea4881e7
LibWeb+LibWebView+UI: Migrate to LibWebView's language settings
2025-04-04 10:16:32 +02:00
Tim Ledbetter
c941170e5a
LibWeb: Invalidate document style when media rules are changed
...
This ensures that new media rules are always produce the correct result
when evaluated.
2025-04-04 10:10:43 +02:00
Andrew Kaster
9ee2473aa4
LibWeb+LibGC: Import GC swift module into LibWeb and an initial user
...
Start work on a speculative HTML Parser in Swift. This component will
walk ahead of the normal HTML parser looking for fetch() requests to
make while the normal parser is blocked. This work exposed many holes in
the Swift C++ interop component, which have been reported upstream.
2025-04-03 16:47:48 -06:00
Andrew Kaster
e4c88915ab
LibGC+LibJS+LibWeb: Add workaround for Swift boolean bitfield issue
...
This patch adds a workaround for a Swift issue where boolean bitfields
with getters and setters in SWIFT_UNSAFE_REFERENCE types are improperly
imported, causing an ICE.
2025-04-03 16:47:48 -06:00
Aliaksandr Kalenik
12a2aebeb6
LibWeb: Move painting surface allocation into rendering thread
...
Skia has a check in debug mode to verify that surface is only used
within one thread. Before this change we were violating this by
allocating surfaces on the main thread while using and destructing them
on the rendering thread.
2025-04-03 22:01:43 +02:00
Aliaksandr Kalenik
4b04e97feb
LibWeb: Send IPC messages exceeding socket buffer through shared memory
...
It turned out that some web applications want to send fairly large
messages to WebWorker through IPC (for example, MapLibre GL sends
~1200KiB), which led to failures (at least on macOS) because buffer size
of TransportSocket is limited to 128KiB. This change solves the problem
by wrapping messages that exceed socket buffer size into another message
that holds wrapped message content in shared memory.
Co-Authored-By: Luke Wilde <luke@ladybird.org>
2025-04-03 13:55:41 +02:00
Aliaksandr Kalenik
bc0ec84100
LibWeb: Don't queue rendering task for empty display lists
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-02 23:22:38 +02:00
Aliaksandr Kalenik
cf143cf118
LibWeb: Don't call flush() when no surface is passed in execute_impl()
...
`DisplayListPlayer::execute_impl()` can receive null surface if it was
invoked to rasterize nested display lists (we use them for iframes). In
this case we should not call `flush()` by the end of execution and wait
until outer display list execution will do that.
2025-04-02 23:22:38 +02:00
Sam Atkins
3af25b9d2f
LibWeb/SVG: Mark SVG factory functions as [NewObject]
...
Corresponds to 9991813a66
2025-04-02 17:28:45 +01:00
Sam Atkins
b74ec1ab7e
LibWeb/SVG: Remove fixme about SVGSVGElement::getElementById()
...
Resolved in e02e2c6465
2025-04-02 17:28:45 +01:00
Sam Atkins
07adbddbcd
LibWeb/SVG: Remove SVGAElement.text attribute
...
Corresponds to 7210af6604
2025-04-02 17:28:45 +01:00
Sam Atkins
02e8c0e1d1
LibWeb/HTML: Allow throwing SecurityError for push/replaceState() abuse
...
Corresponds to 73e51b414b
2025-04-02 17:28:06 +01:00
Sam Atkins
7367150536
LibWeb/HTML: Update FIXME to not reset form-associated custom elements
...
Corresponds to e6bdd0557a
2025-04-02 17:28:06 +01:00
Sam Atkins
86b57a5205
LibWeb/CSS: Use font_format_is_supported() when parsing font sources
2025-04-02 15:53:50 +01:00
Tim Ledbetter
cbb169820a
LibWeb/CSS: Implement the CSSImportRule.media
attribute
2025-04-02 13:53:03 +01:00
Tim Ledbetter
ac19b0cda8
LibWeb/CSS: Support media queries in import at-rules
2025-04-02 13:53:03 +01:00
Timothy Flynn
0de017df9b
LibRequests: Move NetworkError stringification to LibRequests
...
Let's also rename the file to NetworkError.h while we're here. No need
to have "Enum" in the name.
2025-04-02 08:52:45 -04:00
Shannon Booth
a5df972055
LibWeb: Do not store network errors as a StringView
...
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
This is very clearly a very dangerous API to have, and was causing
a crash on Linux as a result of a stack use-after-free when visiting
https://www.index.hr/ .
Fixes #3901
2025-04-02 11:43:53 +02:00
Kenneth Myhra
82a2ae99c8
Everywhere: Remove DeprecatedFlyString + any remaining references to it
...
This reverts commit 7c32d1e8a5
.
2025-04-02 11:43:13 +02:00
Aliaksandr Kalenik
fd147e6be0
LibWeb: Protect SkiaBackendContext with a mutex
...
The Skia Ganesh backend we currently use doesn't support painting from
multiple threads, which could happen before this change when the main
thread used Skia to paint on the HTML canvas while the rendering thread
was working on display list rasterization.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/4172
2025-04-01 23:39:05 +02:00
Aliaksandr Kalenik
24527b6ae3
LibWeb: Pass PaintingSurface into DisplayListPlayer::execute()
...
Deleteing set_surface() makes DisplayListPlayer API a bit more intuitive
because now caller doesn't have to think whether it's necessary to
restore previous surface after execution, instead DisplayListPlayer
takes care of it by maintaining a stack of surfaces.
2025-04-01 23:39:05 +02:00
Jelle Raaijmakers
23f0fddeab
LibWeb: Let LineBuilder decide on Y-coordinate for float insertion
...
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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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
Instead of reaching into the IFC of the LineBuilder from the BFC, we
should let LineBuilder determine how to deal with the running vertical
float clearance. No functional changes.
2025-04-01 16:02:53 +02:00
Jelle Raaijmakers
6d911a6baa
LibWeb: Resolve block height correctly after line break with clear: ..
...
If a block with inline children ends with a line break clearing any
floats, we not only need to take the introduced clearance into account
for the next line box, but the containing block needs to set the correct
height as well.
Since the spec calls for using the last line box' bottom as the resolved
height (if treated as auto), we now correctly apply the clearance to the
previous line box' bottom coordinate.
Fixes #4058 .
2025-04-01 16:02:53 +02:00
Andreas Kling
7c32d1e8a5
Revert "Everywhere: Remove DeprecatedFlyString + any remaining references to it"
...
This reverts commit 3131e6369f
.
Greatly regressed JavaScript benchmark performance.
2025-04-01 15:40:27 +02:00
Jelle Raaijmakers
45905d6f7b
LibWeb: Use relative coordinates for available_space_for_line()
...
We were accidentally providing it with absolute Y-coordinates, messing
up stacked floating boxes that would otherwise intrude on each other.
Fixes #4160 .
2025-04-01 15:26:12 +02:00
Jelle Raaijmakers
a728d67ac2
LibWeb: Only calculate float intrusions for definite available width
...
No functional changes.
2025-04-01 15:26:12 +02:00
Glenn Skrzypczak
da09608156
LibWeb/Painting: Fix blending with viewport background
...
The viewport is now drawn onto transparent black instead of the
background color of the viewport.
2025-04-01 13:38:00 +02:00
Glenn Skrzypczak
9973b01848
LibWeb/CSS: Improved implementation of background-blend-mode
...
This is a improved version of a73cd88f0c
The old commit was reverted in 552dd18696
The new version only paints an element into a new layer if background
blend modes other than normal are used. The rasterization performance
of most websites should therefore not suffer.
Co-Authored-By: Alexander Kalenik <kalenik.aliaksandr@gmail.com>
2025-04-01 13:38:00 +02:00
Glenn Skrzypczak
6906f1722a
LibWeb/Painting: Add back SaveLayer
command
...
This reverts commit 552dd18696
.
2025-04-01 13:38:00 +02:00
Kenneth Myhra
3131e6369f
Everywhere: Remove DeprecatedFlyString + any remaining references to it
2025-04-01 12:50:00 +02:00
Luke Wilde
278666edcd
LibWeb: Enforce Content Security Policy on navigation request/response
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, 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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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-01 04:01:28 +02:00
Timothy Flynn
004173f88b
LibWeb: Allow parsing of "file" prompt types in WebDriver
...
See: 3055808
This isn't actually used outside of BiDi.
2025-04-01 03:52:02 +02:00
Timothy Flynn
952ad4e68b
LibWeb: Allow fractional numbers for WebDriver mouse-move coordinates
...
See: a67669c
2025-04-01 03:52:02 +02:00
Luke Wilde
ee6dbcc96e
LibWeb: Apply HTMLFontElement's face attribute's presentational hint
...
Fixes font selection on https://stagsnet.net/
2025-04-01 03:50:30 +02:00
Aliaksandr Kalenik
e33174fca1
LibWeb: Make BackingStore atomic ref-counted
...
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
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
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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
This is required to make sure rendering thread will keep backing stores
alive in case backing stores reallocation happens during rasterization.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/4164
2025-04-01 03:05:21 +02:00
Glenn Skrzypczak
1022566bff
LibWeb/Layout: Properly remove layout nodes
...
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, 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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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
This properly remove the old layout node subtree when no new layout
node is created during layout update.
2025-03-31 18:19:58 +01:00
Aliaksandr Kalenik
24e2c402f5
LibWeb+WebContent: Move display list rasterization off the main thread
...
The display list is an immutable data structure, so once it's created,
rasterization can be moved to a separate thread. This allows more room
for performing other tasks between processing HTML rendering tasks.
This change makes PaintingSurface, ImmutableBitmap, and GlyphRun atomic
ref-counted, as they are shared between the main and rendering threads
by being included in the display list.
2025-03-31 15:58:15 +01:00
Jelle Raaijmakers
86b831750d
LibWeb: Layout children a bit earlier in BlockFormattingContext
...
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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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 don't need to duplicate this piece of code. No functional changes.
2025-03-31 08:11:10 +01:00
Jelle Raaijmakers
04ba375cc7
LibWeb: Only set line builder's block offset if clearance increases it
...
This prevents text from overlapping with each other if a `<br>` with
`clear: ..` is used in between.
2025-03-31 08:11:10 +01:00
Timothy Flynn
6f1710121d
LibWeb: Remove OOM handling from the AutoplayAllowlist
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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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-03-30 16:18:57 +01:00
Timothy Flynn
c7979a8bd6
LibWeb: Add missing forward-include to AutoplayAllowlist
...
This just lets clangd index this file.
2025-03-30 16:18:57 +01:00
Tim Ledbetter
568531f06a
Everywhere: Mark GC::Cell
derived classes as Weakable explicitly
...
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 (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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
Previously, all `GC::Cell` derived classes were Weakable. Marking only
those classes that require this functionality as Weakable allows us to
reduce the memory footprint of some frequently used classes.
2025-03-29 17:36:33 -05:00
Totto16
b66e7ac1ba
LibWeb: Implement BarProp properties for Window
2025-03-29 02:35:27 +00:00
Andreas Kling
ba8aabdeb0
Revert "LibWeb: Skip "overlay" paint phase when there's no inspected node"
...
This reverts commit dc56435ecd
.
It broke overlay scrollbars.
2025-03-28 20:08:48 +00:00
Aliaksandr Kalenik
1229328adc
Revert "LibWeb/Painting: Add SaveLayer
command"
...
This reverts commit 1898643ba4
.
2025-03-28 16:48:03 +00:00
Aliaksandr Kalenik
552dd18696
Revert "LibWeb/CSS: Implement 'background-blend-mode'"
...
This reverts commit a73cd88f0c
.
Emitting SaveLayer for each paintable made rasterization a lot slower
on every website because now Skia has to allocate enormous amounts of
temporary surfaces. Let's revert it for now and figure how to implement
it with less aggressive SaveLayer usage.
2025-03-28 16:48:03 +00:00
Andreas Kling
c71772126f
LibJS: Remove ByteString internals from PrimitiveString
...
PrimitiveString is now internally either UTF-8, UTF-16, or both.
We no longer convert them to/from ByteString anywhere, nor does VM have
a ByteString cache.
2025-03-28 12:31:40 -04:00
Timothy Flynn
f05b0bfd5f
LibWeb+LibWebView+WebContent: Convert about:settings to a WebUI
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
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (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-03-28 07:31:10 -04:00