Commit graph

62765 commits

Author SHA1 Message Date
Tim Ledbetter
bd72ff5669 LibWeb: Expose ChildNode methods on the DocumentType IDL interface 2024-07-19 09:22:08 +02:00
Tim Ledbetter
7e8d71f7fc Tests/LibWeb: Add some tests for Node.isEqualNode 2024-07-19 09:22:08 +02:00
Tim Ledbetter
5a578e8f15 LibWeb: Compare node names case insensitively in Node::is_equal_node() 2024-07-19 09:22:08 +02:00
Tim Ledbetter
7ab7be694d LibWeb: Don't consider nodes in different namespaces to be equal
Previously, `Node::is_equal_node()` would return true for nodes in
different namespaces that were otherwise equal.
2024-07-19 09:22:08 +02:00
Holger Hans Peter Freyther
319bb6353e LibWeb: Fix assertion failure on telekom.de
The EntryType has three possible values: Fetching, Failed or
ModuleScript. It is possible that we transition from Fetching to Failed
as in #13.1. Change the assertion to include the failed scenario.

Fixes: https://github.com/LadybirdBrowser/ladybird/issues/661
2024-07-19 09:20:09 +02:00
Daniel Bertalan
31eb0ed938 LibWeb/DOM: Work around GCC 14 warning on always true is<T>()
GCC 14 emits a warning when an always succeeding `dynamic_cast`'s return
value is compared to NULL inside the `AK::is<T>(U)` template when `T` ==
`U`.

While warning on tautological `is` calls seems useful, it's a bit
awkward when it comes from a function template where the cast may fail
in some instantiation. There is a GCC bug open for it:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115664

Work around the warning by performing the algorithm on the base type
(`EventTarget`), with a wrapper that casts it to the more specialized
input type.
2024-07-19 09:18:27 +02:00
Diego Frias
ea67bc989f LibWasm: Remove some unnecessary memory checks
Also make `store_to_memory` take a `MemoryArgument` so that we no longer
have to make "synthetic instructions" in some scenarios.
2024-07-19 03:19:04 +02:00
Diego Frias
56ae6b3968 LibWasm: Remove some dead code 2024-07-19 03:19:04 +02:00
Timothy Flynn
368dad54ef LibTextCodec: Use AK facilities to validate and convert UTF-16 to UTF-8
This allows LibTextCodec to make use of simdutf, and also reduces the
number of places with manual UTF-16 implementations.
2024-07-18 19:43:57 +02:00
Timothy Flynn
71c29504af AK: Support non-native endianness in Utf16View
Utf16View currently assumes host endianness. Add support for specifying
either big or little endianness (which we mostly just pipe through to
simdutf). This will allow using simdutf facilities with LibTextCodec.
2024-07-18 19:43:57 +02:00
circl
e59048e90f LibWebView: Add keyboard navigation to the Inspector 2024-07-18 07:09:50 -06:00
circl
8357f18e9b LibWeb: Set document.activeElement using the spec algorithm 2024-07-18 07:09:50 -06:00
circl
1aa9282103 LibWeb: Move retarget function to its own file 2024-07-18 07:09:50 -06:00
Ali Mohammad Pur
8cf0f36f7d LibWasm: Replace a hashtable with an RBTree to make instantiation faster
...by about 40%.
2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
f1abc36689 LibWasm/WASI: Make the premapped stdio files configurable 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
16dd8d4d3b LibWasm/WASI+wasm: Make WASI exit() "noreturn" instead of making it exit
This makes it so exit() traps with a known error; an embedder (wasm.cpp)
can simply match this format and handle the request accordingly.
2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
e08a7cb94d LibWasm/WASI: Add support for fd_seek() 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
708abf6bb1 LibWasm/WASI: Add support for fd_fdstat_get() 2024-07-18 14:54:50 +02:00
Ali Mohammad Pur
e22408b8b4 LibWasm: Make import errors a bit more descriptive and helpful
Instead of "yeah something went wrong", show what went wrong.
2024-07-18 14:54:50 +02:00
Timothy Flynn
fb228a3d85 LibJS: Implement Iterator.prototype.constructor according to spec
The spec allows setting a constructor on non built-in Iterator objects.

This is a normative change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/30b3501
2024-07-18 14:49:25 +02:00
Timothy Flynn
734e37442d LibJS: Implement Iterator.prototype [ @@toStringTag ] according to spec
The spec allows setting the prototype on non built-in Iterator objects.

This is a normative change in the Iterator Helpers proposal. See:
https://github.com/tc39/proposal-iterator-helpers/commit/30b3501
2024-07-18 14:49:25 +02:00
Andrew Kaster
2225b837f8 Documentation: Remove now-unnecessary environment settings for VsCode 2024-07-18 14:48:20 +02:00
Andrew Kaster
8e5d28de3c CMake: Force vcpkg to use CMAKE_CXX_COMPILER as specified to CMake
Override the vcpkg/scripts/detect_compiler behavior of always pulling
$CC and $CXX at the time that vcpkg install is determined to need called
by forcing $ENV{CXX} and $ENV{CC} to our CMake-determined compiler.

This prevents strange behavior such as running the following:

./Meta/ladybird.sh run
    make changes...
ninja -C Build/ladybird

Where the second build step would be run without CC or CXX set in the
environment, causing a total cache miss from vcpkg and a full rebuild.

It also helps prevent full rebuilds when an IDE passes a slightly
different compiler to the build step than ladybird.sh.
2024-07-18 14:48:20 +02:00
Aliaksandr Kalenik
1e4720700c LibWeb: Use premultiplied alpha for gradient interpolation in Skia
This change fixes the rest of regressions in
Tests/LibWeb/Ref/css-gradients.html
2024-07-18 14:47:32 +02:00
Timothy Flynn
0c14a9417a AK: Replace converting to and from UTF-16 with simdutf
The one behavior difference is that we will now actually fail on invalid
code units with Utf16View::to_utf8(AllowInvalidCodeUnits::No). It was
arguably a bug that this wasn't already the case.
2024-07-18 14:46:25 +02:00
Timothy Flynn
32ffe9bbfc AK: Replace UTF-16 validation and length computation with simdutf 2024-07-18 14:46:25 +02:00
Timothy Flynn
a2bcb2ab8d AK: Replace UTF-8 validation and length computation with simdutf 2024-07-18 14:46:25 +02:00
Timothy Flynn
3b96ef1a4d AK: Remove Lagom tools workaround for simdutf 2024-07-18 14:46:25 +02:00
Timothy Flynn
7c813d3992 Meta+CI: Hook up the Lagom tools build with vcpkg
AK will depend on some vcpkg dependencies, so the Lagom tools build will
need to know how to use vcpkg. We can do this by sym-linking vcpkg.json
to Meta/Lagom (as vcpkg.json has to be in the CMake source directory).
We also need a CMakePresets.json in the source directory, which can just
include the root file. The root CMakePresets then needs to define paths
relative to ${fileDir} rather than ${sourceDir}.
2024-07-18 14:46:25 +02:00
Tim Ledbetter
055c902a37 LibWeb: Implement Node.isDefaultNamespace()
This method accepts a namespace URI as an argument and returns true if
the given URI is the default namespace on the given node, false
otherwise.
2024-07-18 12:41:01 +03:00
Tim Ledbetter
27d429a85f LibWeb: Implement Node.lookupNamespaceURI()
This method takes a prefix and returns the namespace URI associated
with it on the given node, or null if no namespace is found.
2024-07-18 12:41:01 +03:00
Andrew Kaster
d106b6eae2 LibCore: Remove workarounds for system header global name conflicts 2024-07-18 09:43:38 +01:00
Andrew Kaster
8082daaa3f LibAudio+LibCore: Remove workarounds for system header conflicts
This commit could possibly be cherry-picked to serenity
2024-07-18 09:43:38 +01:00
Andrew Kaster
349a3ceec5 Ladybird/AppKit: Remove system header workarounds for global names 2024-07-18 09:43:38 +01:00
Andrew Kaster
88044f59c6 AK: Stop exporting AK::FixedPoint into the global namespace
This declaration has conflicts with the macOS SDK, which becomes a
problem when trying to interact with system clang modules.
2024-07-18 09:43:38 +01:00
Andrew Kaster
1529f5469c LibGfx+icc: Prefix AK::FixedPoint with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
bf600c8e1d AK: Stop exporting AK::Duration into the global namespace
This has conflicts with MacTypes.h from the Apple macOS SDKs, which
becomes a huge problem when trying to interact with system clang modules
2024-07-18 09:43:38 +01:00
Andrew Kaster
5ace53c96f Ladybird/Qt: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
39a41d59c8 RequestServer: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
28093fecae LibWebView+WebContent: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
b20a1d0fcd LibWeb: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
2fa9ec20bd LibUnicode: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
f8d1a25254 LibJS: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
c1681931ba LibMedia: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
28ab1941b9 LibIPC: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
383c15b22e LibCore: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Andrew Kaster
6772d442e5 LibAudio: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Aliaksandr Kalenik
7a1f3f7ae3 LibWeb: Change grid item placement to look for area by boundary lines
Areas are disassembled into boundary lines on `build_grid_areas()` step,
so we can always use them to find grid item's position during placement.
This way we support both ways to define area: `grid-template-areas` and
implicitly using `-start` and `-end` boundary line names.
2024-07-18 09:05:37 +02:00
Andreas Kling
166e603c5e ImageDecoder: Pass decoded images as Gfx::Bitmap over IPC
Before this change, we were passing them as Gfx::ShareableBitmap. The
problem is that shareable bitmaps keep their underlying file descriptor
open, so that they can be shared again with someone else.

When a Gfx::Bitmap is decoded from an IPC message, the file descriptor
is closed and recovered immediately.

This fixes an issue where we'd accumulate one file descriptor for every
image decoded. This eventually led to descriptor starvation after enough
images were loaded and still referenced at the same time.
2024-07-18 09:05:10 +02:00
Andreas Kling
9f1a853cc8 LibGfx: Add ability to pass NonnullRefPtr<Gfx::Bitmap> over IPC 2024-07-18 09:05:10 +02:00