Commit graph

34374 commits

Author SHA1 Message Date
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
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
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
1529f5469c LibGfx+icc: Prefix AK::FixedPoint 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
Daniel Bertalan
c62240aa80 Everywhere: Warn on function definitions without prototypes
If no header includes the prototype of a function, then it cannot be
used from outside the translation unit it was defined in. In that case,
it should be marked as `static`, in order to avoid possible ODR
problems, unnecessary exported symbols, and allow the compiler to better
optimize those.

If this warning triggers in a function defined in a header, `inline`
needs to be added, otherwise if the header is included in more than one
TU, it will fail to link with a duplicate definition error.

The reason this diff got so big is that Lagom-only code wasn't built
with this flag even in Serenity times.
2024-07-17 21:51:29 +02:00
Daniel Bertalan
7fe82a1cda CMake: Add back stricter warnings used in Serenity builds
These used to be enabled in `serenity_compile_options.cmake` for
Serenity builds and were removed in 9b05fb98. This is a slightly more
conservative subset of those, with ones that are enabled by default
omitted.

This should prevent our code quality regressing in the long run.
2024-07-17 21:51:29 +02:00
Jamie Mansfield
0961d68ebc LibWeb: Stub Text.wholeText 2024-07-17 18:19:09 +01:00
Jamie Mansfield
807e63faaf LibWeb: Implement MouseEvent.initMouseEvent 2024-07-17 18:19:09 +01:00
Jamie Mansfield
3845d174e3 LibWeb: Implement KeyboardEvent.initKeyboardEvent 2024-07-17 18:19:09 +01:00
Jamie Mansfield
aefab1de38 LibWeb: Short-circuit UIEvent.initMouseEvent if dispatched
This fixes some bugs on wpt.dom/events/Event-init-while-dispatching.html,
although the test still fails due to [GH-23722].

[GH-23722]: https://github.com/SerenityOS/serenity/issues/23722
2024-07-17 18:19:09 +01:00
Jamie Mansfield
87880e9b81 LibWeb/HTML: Remove FIXMEs from HTMLTrackElement constants 2024-07-17 18:19:09 +01:00
Jamie Mansfield
66c3388b16 LibWeb: Implement Performance.toJSON 2024-07-17 18:19:09 +01:00
Jamie Mansfield
116c1f835d LibWeb/DOM: Add FIXMEs for missing functions in Node 2024-07-17 18:19:09 +01:00
Jamie Mansfield
62f74f3b77 LibWeb/DOM: Match order of Node.idl with the spec
This makes it easier to compare with the spec :^)
2024-07-17 18:19:09 +01:00
doctortheemh
0140e5e9cc LibGfx: Decode WebP images with libwebp 2024-07-17 10:04:25 -06:00
Aliaksandr Kalenik
be644e5d5d LibWeb: Use blur_radius / 2 as sigma to blur text shadow using Skia
This change is needed to match behavior of default Gfx::Painter.

Fixes Tests/LibWeb/Ref/text-shadow.html
2024-07-17 18:02:11 +02:00
Aliaksandr Kalenik
3270df476d LibWeb: Fix flexible track sizing in GFC
- Change min track sizing function to be "auto" when flex size is
  specified.
- Never check if min track sizing funciton is flexible, because only
  max is allowed to be flexible.
- Address FIXME in automatic_minimum_size to avoid regressions after
  making two fixes mentioned above.
2024-07-17 18:00:18 +02:00
Timothy Flynn
c3f8202d0c LibJS: Create exception messages as Strings
The JS::Error types all store their exception messages as a String. So
by using ByteString, we hit the StringView constructor, and end up
allocating the same string twice.
2024-07-17 11:57:06 -04:00
Hendiadyoin1
144e822de2 LibWasm: Use shuffle_or_0 in for vector swizzles and shuffles
Otherwise we'd hit a VERIFY in AK::SIMD::shuffle() when that operand
contains an out-of-range value, the spec tests indicate that a swizzle
with an out-of-range index should return 0.

(cherry picked from commit cd454a1e3d0bc8b3342ed39891c9b27409ecc829)
2024-07-17 09:56:13 -06:00
Aliaksandr Kalenik
3ddacaa705 Ladybird+LibWeb+WebContent: Always use Skia CPU backend in tests mode
Enforce the use of the CPU backend in test mode to ensure that ref-tests
produce consistent results across different computers, as this
consistency cannot be achieved with the GPU backend.
2024-07-17 17:58:53 +03:00
Sam Atkins
9fb44cb057 LibWeb/CSS: Make StringStyleValue hold a FlyString
We already have a FlyString of its value from parsing, and most users
also want a FlyString from it, so let's use that instead of converting
backwards and forwards.

The two users that did want a String are:
- Quotes, which make sense as FlyString instead, so I've converted that.
- Animation names, which should probably be FlyString too, but the code
  currently also allows for other kinds of StyleValue, and I don't want
  to dive into this right now to figure out if that's needed or not.
2024-07-17 15:08:44 +01:00
Sam Atkins
d2f04b9f04 LibWeb/CSS: Remove unused StyleProperties::grid_area()
This does not appear to be correct; the `grid-area` property's value is
quite complicated, and not just a string.
2024-07-17 15:08:44 +01:00
simonkrauter
b1d7a27468 LibWeb: Rename HTMLInputElement members related to range shadow tree
Choose a better name for private members which were added in
https://github.com/LadybirdBrowser/ladybird/pull/513
2024-07-17 13:11:55 +02:00
Aliaksandr Kalenik
66c88b432f LibWeb: Join text clip paths before application in Skia painter
Each item in clip_paths represents a glyph run, and applying them as a
clip in intersection mode one by one results in an empty clip. Instead,
now all clip paths are joined and applied as a clip together.

This change fixes rendering of "background-clip: text" when an element
has more than one glyph run.

Fixed ref-test: Tests/LibWeb/Ref/css-background-clip-text.html
2024-07-17 14:09:52 +03:00
Braydn
dbc2f7ed48 LibJS: Implement CreatePerIterationEnvironment for 'for' statements
Implement for CreatePerIterationEnvironment for 'for' loops per the Ecma
Standard. This ensures each iteration of a 'for' loop has its own
lexical environment so that variables declared in the loop are scoped to
the current iteration.
2024-07-17 11:20:11 +02:00
Jamie Mansfield
c8e6a95988 LibWeb/SVG: SVGGradientElement includes SVGURIReference 2024-07-16 21:43:53 +02:00