Commit graph

72753 commits

Author SHA1 Message Date
Jelle Raaijmakers
7e869c7816 LibWeb: Add SVGNumber 2025-11-09 01:22:48 +01:00
Timothy Flynn
0dd8e1e6f2 LibWebView: Add a bit of explicit handling for "localhost:port" URLs
LibURL parses "localhost:8000" as a URL with a scheme of "localhost" and
basename of "8000". Similar to "mailto:" URLs.  We then drop the URL as
having an invalid scheme.

Let's explicitly check for such localhost URLs here and prepend a valid
scheme, as it is a bit of a special case.
2025-11-08 11:14:44 -05:00
Ali Mohammad Pur
a290034a81 LibRegex: Start alternation opt nodes with an empty vector
...instead of checking every time whether there's a vector there.
Fixes #6755.
2025-11-08 11:51:27 +01:00
Andreas Kling
b28480f62d LibWeb: Propagate layout tree update in display: contents to parent
When an element has `display: contents` and it gets marked for a layout
tree rebuild, we actually have to mark its parent for rebuild as well.

The structure of the parent (and siblings) may change depending on how
the `display: contents` element changes (e.g position, display, etc.)
2025-11-08 11:20:32 +01:00
Tim Ledbetter
93889c5cd7 CodeGenerators: Use a HashMap for string to PropertyID lookups 2025-11-08 09:29:27 +01:00
R-Goc
d25f0571a9 Meta: Ladybird.py debug on Windows
This adds the .exe suffix when passing the target process to the
debugger.
2025-11-07 23:17:35 +01:00
Jelle Raaijmakers
b6f5c91a35 LibWeb: Shave 168 bytes off of ARIAMixin
Instead of keeping the vectors inside ARIAMixin, point to the heap using
OwnPtrs.
2025-11-07 16:59:26 +01:00
Jelle Raaijmakers
9d26626200 LibWeb: Shave 24 bytes off of each DOM::Element 2025-11-07 16:59:26 +01:00
Jelle Raaijmakers
02611c9c12 LibWeb: Shave 16 bytes off of each HTMLElement 2025-11-07 16:59:26 +01:00
Andreas Kling
6894034774 LibWeb: Mark flex item main size definite if resolved from aspect-ratio
This matches the behavior of other engines and makes the cards on the
Apple App Store appear in the narrower layouts.
2025-11-07 16:42:32 +01:00
Undefine
cde3941d9f AK: Remove a clang-15 consteval workaround
This is a really really old workaround and it doesn't seem to be needed
anymore as clang-15 is supported for a really long time.
2025-11-07 11:27:51 +01:00
Undefine
80003ecc09 AK: Remove unused __ptrdiff_t declaration
The project compiles just fine without and this seems a remnant from
SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
6fa705c730 LibCore: Mark Process::wait_for_termination as const
After removal of the of the disown mechanism this can be marked as
const, which in my opinion makes sense for this API.
2025-11-07 11:27:51 +01:00
Undefine
769bbe6021 LibCore: Remove unused KeepAsChild and disown mechanisms
Those went unused and did nothing on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
7a9dd46a39 LibCore: Remove unused Process::set_name
It went unused and was a no-op on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
3c0d787c53 LibCore: Remove unused working_directory parameter
This was unused and a no-op on systems other than SerenityOS.
2025-11-07 11:27:51 +01:00
Undefine
41d04de1f2 LibCore: Remove unused System::uname
This went unused.
2025-11-07 11:27:51 +01:00
Undefine
0582c01c89 AK+Tests: Remove NoAllocationGuard
On systems other than SerenityOS this was a no-op anyways.
2025-11-07 11:27:51 +01:00
Undefine
4f8a4c196f AK: Get rid of an unused NAKED macro
This went unused.
2025-11-07 11:27:51 +01:00
Undefine
6b7a8cb8c3 AK: Get rid of unused VALIDATE_ARCH macros
Those were used primarily in the SerenityOS kernel and are a relict
of the past.
2025-11-07 11:27:51 +01:00
Undefine
c6046dfe0f AK: Remove unused architecture specific TODO macros
As far as I can tell those remained unused from the SerenityOS days
2025-11-07 11:27:51 +01:00
Undefine
17d3b881d3 AK+Everywhere: Remove ifdefs for WASM and Emscripten
Building the Ladybird code for Emscripten doesn't really make sense
and I doubt it is even possible with all the dependencies now.
2025-11-07 11:27:51 +01:00
Sam Atkins
3166dabcd6 LibWeb/CSS: Implement StylePropertyMap::append() 2025-11-07 10:26:56 +00:00
Luke Wilde
d0ef1aad2d LibJS/Bytecode: Merge adjacent exception handlers
For example, this:
```
Exception handlers:
    from  678 to  698 handler  658 finalizer    0
    from  698 to  6f8 handler  658 finalizer    0
    from  6f8 to  708 handler  658 finalizer    0
    from  708 to  750 handler  658 finalizer    0
    from  750 to  788 handler  658 finalizer    0
    from  788 to  7a0 handler  658 finalizer    0
    from  7a0 to  7a8 handler  658 finalizer    0
```

Becomes:
```
Exception handlers:
    from  678 to  7a8 handler  658 finalizer    0
```
2025-11-07 09:57:06 +01:00
R-Goc
86b95b1d7a LibCore: Use IOCP for the event loop on Windows
This commit changes the event loop to use IOCPs instead of
WaitForMultipleObjects to wait on events. This is done through the Nt
kernel api NtAssociateWaitCompletionPacket which associates an event
with a completion packet. Each completion packet notifies only once, as
they are normally used to signal completion of an operation so to use
them for notifiers they are associated again after each time they are
triggered.
There are more optimizations that can be done, such as reusing the
EventLoopNotifier and EventLoopTimer structures to reduce the number of
allocations and context switches for timer and notifier registration.
2025-11-07 08:42:43 +01:00
R-Goc
af1bf342f9 AK: Make windows error formatter use stack buffer
This change makes the error formatter on windows use a stack array
instead of a heap allocated array. This is because the heap allocation
fails when being ran during process teardown.
2025-11-07 08:42:43 +01:00
Luke Wilde
7f7babe735 LibWeb: Remove spin_until from create_navigation_params_by_fetching
This is in similar fashion and reason to e095bf3
2025-11-07 04:08:30 +01:00
Aliaksandr Kalenik
ed9c0c1e09 LibWeb: Don't visit registered NavigationObserver from Navigable
NavigationObserver register itself in Navigable from constructor and
unregister itself from `finalize()`. The problem is that `finalize()`
won't be invoked for as long as NavigationObserver is visited by
Navigable, leading to GC leaks.
2025-11-07 04:08:30 +01:00
Luke Wilde
167de08c81 LibWeb: Remove exception throwing from Fetch
These were only here to manage OOMs, but there's not really any way to
recover from small OOMs in Fetch especially with its async nature.
2025-11-07 04:08:30 +01:00
Andreas Kling
baa9b6cc34 LibWeb: Prefer non-emoji font when deciding width of space between words
This fixes an issue where having an emoji font first in the font-family
cascade list would cause us to get the space width from the emoji font
as well.

We now look at adjacent text chunks when deciding which font to use for
space widths, instead of just blindly obeying the font-family value.
2025-11-06 23:42:01 +01:00
Andreas Kling
0fc0c84856 LibGfx: Add Font API to determine if it's (probably) an emoji font
This uses some heuristics since I don't think there's a simple way to
determine if something is "an emoji font".
2025-11-06 23:42:01 +01:00
Daniel Price
3a70a4735a LibWeb: Create an execution context before registering import map
Fixes #6297
2025-11-06 17:07:22 -05:00
Timothy Flynn
aff642053a LibJS: Set day field in CalendarYearMonthFromFields before resolution
This is an editorial change in the Temporal proposal. See:
a8d38c6
2025-11-06 13:47:11 -05:00
Undefine
2a73f779c3 LibWeb: Small WebGL spec fix for vertexAttribPointer 2025-11-06 19:02:36 +01:00
Undefine
5caead88fc LibWeb: Allow WebGL getParameter when WEBGL_draw_buffers is enabled
When that extensions is enabled we should allow getting the parameter
value of MAX_COLOR_ATTACHMENTS_WEBGL.
2025-11-06 19:02:36 +01:00
Undefine
d4ac9fc5c6 LibWeb: Implement WebGL extension OES_standard_derivatives 2025-11-06 19:02:36 +01:00
Undefine
2bf35881f9 LibWeb: Ensure compressed* WebGL functions don't allow disabled formats 2025-11-06 19:02:36 +01:00
Undefine
044ac2dd28 LibWeb: Fix WebGL getError
getError was just calling out to glGetError and never checking our
error value that we were maintaining ourselves.
2025-11-06 19:02:36 +01:00
Undefine
e7aeb71d29 LibWeb: Move WebGL error variable to WebGLRenderingContextBase
Implementations in both WebGL1 and WebGL2 were the same and most
probably will stay the same.
2025-11-06 19:02:36 +01:00
Tim Ledbetter
f6f238d15c ImageDecoder+LibWeb: Perform initial alpha conversion in ImageDecoder
This change moves the initial alpha premultiplication step for all
decoded images from WebContent to the ImageDecoder process. This
doesn't reduce the overall amount of work, but it can make sites with a
lot of images more responsive.
2025-11-06 17:56:29 +01:00
Tim Ledbetter
30d9584746 LibJS: Use TypedTransfer<T>::copy() when possible in CopyDataBlockBytes
If neither block is a Shared Data Block we can use memcpy rather than
copying one byte at a time. Currently, we are using `memcpy`
unconditionally, as Shared Data Blocks are not yet supported in this
method.
2025-11-06 11:44:43 -05:00
Luke Wilde
82bd3d3891 LibWeb: Avoid invoking Trusted Types where avoidable
Prevents observably calling Trusted Types, which can run arbitrary JS,
cause crashes due to use of MUST and allow arbitrary JS to modify
internal elements.
2025-11-06 11:43:06 -05:00
Luke Wilde
fb9406ddcd LibWeb: Make Trusted Types injection sink names more readable
No functional change.
2025-11-06 11:43:06 -05:00
Luke Wilde
60e1a136aa LibWeb: Use qualified names for SVG attribute reflectors 2025-11-06 11:43:06 -05:00
Luke Wilde
d211df8118 LibWeb: Implement Trusted Types for HTMLIFrameElement#srcdoc 2025-11-06 11:43:06 -05:00
stelar7
0f3a9a6958 LibWeb/CSS: Use correct property when looking up container-type 2025-11-06 13:28:17 +01:00
ayeteadoe
eb4ff07d83 LibWeb: Define SVGImageElement destructor for Core::Timer forward decl
This fixes a "error: member access into incomplete type 'Core::Timer'"
build error on clang-cl Windows.
2025-11-06 07:10:23 -05:00
Sam Atkins
1bcc489310 LibWeb/CSS: Subdivide into iterations when reading from StylePropertyMap 2025-11-06 10:34:48 +00:00
Sam Atkins
7292714592 LibWeb/CSS: Mark cursor as not a list-valued property
This is apparently supposed to always be treated as a single composite
value, for Typed OM at least.
2025-11-06 10:34:48 +00:00
Tim Ledbetter
478cf4f42c LibWeb: Explicitly disallow skipping 0 characters in HTML tokenizer
Previously, this caused the source position of an ambiguous ampersand
to be incorrect.
2025-11-06 10:59:54 +01:00