Commit Graph

31986 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
2764966ccc LibWeb: Reduce paintable tree traversals during hit-testing
By storing a list of positioned and floating descendants within the
stacking context tree node, we can eliminate the need for costly
paintable tree traversals during hit-testing.

This optimization results in hit-testing being 2 to 2.5 times faster
on https://ziglang.org/documentation/master/
2024-03-01 13:03:53 +01:00
Luke Wilde
48e11a1f12 LibWeb: Empty CE reaction queue instead of destroying it on exception
If an exception occurs in a custom element constructor, we clear the
reaction queue by destroying it, instead of emptying the Vector.
3da6916383/Userland/Libraries/LibWeb/DOM/Element.cpp (L2033)

This causes a UAF here, as async upgrades (i.e. custom elements not
created by document.createElement) are performed in this loop:
3da6916383/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp (L657)

Fixes crash when loading https://github.com/SerenityOS/serenity
2024-02-29 21:58:01 -05:00
Tim Ledbetter
5b4533cab8 LibWeb: Don't crash in offset_parent() if no ancestor element found
The specification says the final step of this algorithm is to return
null. Previously, the browser would crash if the content of an iframe
was appended to the document before its offsetParent property was
queried.
2024-02-29 21:54:53 -05:00
Aliaksandr Kalenik
90879a07ba LibWeb: Skip page scrolling for wheel events consumed by scrollable box
Fixes the bug when we scroll both scrollable box and page.
2024-02-29 13:18:57 +01:00
Gabriel Tassinari
30d8c5f301 LibLine: Ensure suggestions are reset after ^C 2024-02-29 09:09:47 +01:00
Timothy Flynn
d878975f95 AK+LibJS: Remove OFFSET_OF and its users
With the LibJS JIT removed, let's not expose pointers to internal
members.
2024-02-29 09:00:00 +01:00
Tim Ledbetter
4646a87eba LibWeb: Make CSSConditionRule.conditionText read-only
Previously @media rule conditions could be updated by assigning to
`conditionText`. This change aligns our implementation with the CSSOM
specification, which says `CSSConditionRule.conditionText` should be
read-only.
2024-02-28 22:14:58 +01:00
implicitfield
b08fd1b9ae LibWeb: Improve support for 'vertical-align: middle'
This rebaselines a few table-related layout tests since our default
stylesheet applies 'vertical-align: middle' to a few table-related
elements.
2024-02-28 16:11:05 -05:00
Nico Weber
41e0a0f0aa LibGfx/OpenType: Add named constants for header tags
...together with spec comments.

No behavior change.
2024-02-28 16:00:07 -05:00
Nico Weber
36bbf12b73 LibGfx: Add FourCC::from_u32() 2024-02-28 16:00:07 -05:00
Nico Weber
53c6dfacd7 LibGfx: IWYU for FourCC.h
Makes clangd-induced red squigglies disappear when editing this file.

No behavior change.
2024-02-28 16:00:07 -05:00
Nico Weber
86203974f5 LibGfx/OpenType: Extract read_tag() function 2024-02-28 16:00:07 -05:00
Nico Weber
93038f6f24 LibGfx/OpenType: Extract for_each_table_record() helper
Separates table record iteration from doing something with the table
records, which is arguably easier to read.

No behavior change.
2024-02-28 16:00:07 -05:00
Andreas Kling
953573565c LibJS/Bytecode: Cache realm, global object, and more in interpreter
Instead of looking these up in the VM execution context stack whenever
we need them, we now just cache them in the interpreter when entering
a new call frame.
2024-02-28 21:09:09 +01:00
Andreas Kling
01e9eee7dd LibJS/Bytecode: Avoid Value==Value in Call built-in fast path
Comparing two Values has to call the generic same_value() helper,
and we can avoid this by simply using a stronger type for built-in
native function handlers.
2024-02-28 21:09:09 +01:00
Andreas Kling
1060c63bd8 LibJS: Mark ThrowCompletionOr member functions as ALWAYS_INLINE
Some of them stood out in a profile, and they have no business doing so.
2024-02-28 21:09:09 +01:00
Timothy Flynn
3d2794d062 LibJS: Add a fast path for setting valid u32 values in Uint32TypedArray
The exisiting fast path only permits for valid i32 values.

On https://cyxx.github.io/another_js, this eliminates the runtime of
typed_array_set_element, and reduces the runtime of put_by_value from
11.1% to 7.7%.
2024-02-28 19:41:11 +01:00
Timothy Flynn
d0d22304e4 Revert "LibJS: Add fast path for getting the TA length of valid TAs"
This reverts commit 9c943f36ed.

This optimization is superseded by optimizing IsValidIntegerIndex for
TypedArrays with non-resizable ArrayBuffers. Reverting this commit has
no impact on test-js, test262, or live website performance.
2024-02-28 19:41:11 +01:00
Timothy Flynn
98552bf4c9 Revert "LibJS: Add fast path for checking if attached TAs are OOB"
This reverts commit 5fd53652b7.

This optimization is superseded by optimizing IsValidIntegerIndex for
TypedArrays with non-resizable ArrayBuffers. Reverting this commit has
no impact on test-js, test262, or live website performance.
2024-02-28 19:41:11 +01:00
Timothy Flynn
d8eb297b95 Revert "LibJS: Add fast path for creating a TA record for attached TAs"
This reverts commit 72cee4c88b.

This optimization is superseded by optimizing IsValidIntegerIndex for
TypedArrays with non-resizable ArrayBuffers. Reverting this commit has
no impact on test-js, test262, or live website performance.
2024-02-28 19:41:11 +01:00
Timothy Flynn
08ad2d774e LibJS: Optimize IsValidIntegerIndex for TAs with non-resizable buffers
If we know the TA does not have a resizable ArrayBuffer, we can avoid
most of the heavy lifting that IsValidIntegerIndex performs.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 7.1% to 3.7%.
2024-02-28 19:41:11 +01:00
Aliaksandr Kalenik
b821f7b283 LibWeb: Implement scrollbar painting
Introduces the rendering of scroll thumbs in vertical and horizontal
directions. Currently, the thumbs are purely graphical elements that
do not respond to mouse events. Nevertheless, this is beneficial as it
makes it easier to identify elements that should respond to scrolling
events.

Painting of scrollbars uncovers numerous bugs in the calculation of
scrollable overflow rectangles highlighting all the places where
elements are made scrollable whey they shouldn't be. Positively, this
issue might motivate us to pay more attention to this problem to
eliminate unnecessary scrollbars.

Currently, the scrollbar style is uniform across all platforms: a
semi-transparent gray rectangle with rounded corners.

Also here we add `scrollbar-width: none` to all existing scrolling
ref-tests, so they keep working with this change.
2024-02-28 07:51:13 -05:00
Aliaksandr Kalenik
8d9e20cb03 LibWeb: Parse the CSS scrollbar-width property 2024-02-28 07:51:13 -05:00
Aliaksandr Kalenik
c74fc4c171 LibWeb: Clean previous border radii clips in refresh_clip_state()
The list of border radii clips needs to be reset before being populated
with new clips that have refreshed positions. Besides fixing painting,
this also improves performance because the number of sample/blit
commands does not increase as we scroll.
2024-02-28 07:44:12 -05:00
Aliaksandr Kalenik
91378ded96 LibWeb: Apply scroll offset after clip in PaintableBox::before_paint()
The order is important because clip rectangles are calculated with the
scroll offset taken into account. Therefore, they need to be applied
before the scroll offset is changed, to avoid accounting for the scroll
offset twice.
2024-02-28 07:44:12 -05:00
Tim Ledbetter
ae42c6ed80 LibWeb: Implement AbortSignal.timeout()
This method returns a signal that will automatically abort after a
given number of milliseconds.
2024-02-28 07:42:43 -05:00
Tim Ledbetter
3c288c96e6 LibWeb: Extract run_steps_after_a_timeout() into a separate function 2024-02-28 07:42:43 -05:00
Matthew Olsson
aca32e298d LibWeb: Expand shorthand properties in CSS @keyframes 2024-02-28 08:05:41 +00:00
Bastiaan van der Plaat
05e78dabdb LibWeb: Add textarea readonly support 2024-02-27 18:03:20 -05:00
Nico Weber
9aa31157d5 LibPDF: Use right encoding for standard fonts Symbol and ZapfDingbats
We use Liberation Sans for the actual glyph for these, and that's
missing some (Symbol) / all (ZapfDingbats) of the glyphs we need
for these two standard fonts (...or at least the mapping from
name to glyph, not sure). But still, better rendering squares than
completely incorrect glpyhs.

Our code deciding what to do when a value isn't found in an encoding,
or when the name doesn't map to a glpyh, also needs work, but that's
mostly independent of this change. I think this is a nice small
standalone progression.
2024-02-27 17:42:08 -05:00
Nico Weber
76105d5d7f LibPDF: Resize images to the larger of image and mask dimensions
Makes text show up on 0000646.pdf pages 87-92, which for some reason
renders all text using 2x2 images with huge masks that contain
rendered text outlines.
2024-02-27 17:39:13 -05:00
Nico Weber
472bc367d3 LibPDF: Do not have redundant variables for image size
This way, the size of the bitmap cannot become out of sync with these
variables.

No behavior change.
2024-02-27 17:39:13 -05:00
Timothy Flynn
c7c4987967 LibJS: Store a TypeArray's element size upon construction
This avoids a virtual dispatch upon invoking the element size getter.
The size is static, so we could make TypedArrayBase templated with a
NTTP for the size, but let's not undergo such a wide-spread refactor.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 8.9% to 7.1%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
17e2f751c5 LibJS: Add an explicit DataBlock::size method
This avoids visiting the underlying buffer twice from ArrayBuffer's
byte_length.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 9.9% to 8.9%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
72cee4c88b LibJS: Add a fast path for creating a TA witness record for attached TAs
In IsValidIntegerIndex, we check if the TA is detached before invoking
MakeTypedArrayWithBufferWitnessRecord. There's no need to check it
again.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 10.7% to 9.9%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
5fd53652b7 LibJS: Add a fast path for checking if attached TAs are out of bounds
In IsValidIntegerIndex, we check if the TA is detached before invoking
IsTypedArrayOutOfBounds. There's no need to check it again.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 11.5% to 10.7%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
84936c9ab6 LibJS: Inline the ArrayBufferByteLength implementation
Note: When we better support SharedArrayBuffer, that part of this AO
might not be inlined, as it looks a bit expensive.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 12.5% to 11.5%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
9c943f36ed LibJS: Add a fast path for getting the TA length of known valid TAs
In IsValidIntegerIndex, we check IsTypedArrayOutOfBounds before invoking
TypedArrayLength. There's no need to check it again.

On https://cyxx.github.io/another_js, this reduces the runtime of
IsValidIntegerIndex from 16% to 12.5%.
2024-02-27 20:02:07 +01:00
Timothy Flynn
6656f70387 LibWeb: Use TypedArray as a forward-declaration where appropriate
This reduces the number of files needed to be recompiled when TypedArray
changes from ~1000 to ~600. The remaining ~600 are almost all generated
constructors and prototypes.
2024-02-27 20:02:07 +01:00
Aliaksandr Kalenik
a0dc9584de LibWeb: Add "object-position" CSS property into ComputedValues 2024-02-27 16:53:13 +01:00
Aliaksandr Kalenik
677a00ed92 LibWeb: Add "object-fit" CSS property into ComputedValues 2024-02-27 16:53:13 +01:00
Aliaksandr Kalenik
22da83c295 LibWeb: Resolve "object-position" without unwrapping raw percentage
Use `to_px()` that accepts reference value instead.

No behaviour change intended.
2024-02-27 16:53:13 +01:00
Aliaksandr Kalenik
6f5a0bd5de LibWeb: Save image provider in ImagePaintable
Refactoring towards making paintable be independant from layout nodes.

No behaviour change intended.
2024-02-27 16:53:13 +01:00
Aliaksandr Kalenik
ef01c735cd LibWeb: Visit ImageProvider from Layout::ImageBox
Adds missing visit of HTMLElement that serves as image provider of
image layout node.
2024-02-27 16:53:13 +01:00
Aliaksandr Kalenik
9fa22b60cf LibWeb: Save alt text in ImagePaintable
By saving string with alt text, image paintable no longer need to reach
into layout and DOM nodes while painting commands recording.

No behaviour change intended.
2024-02-27 16:53:13 +01:00
Sam Atkins
c2bc07ef7c LibCore: Use Core::Environment::raw_environ() instead of environment() 2024-02-27 08:33:48 +00:00
Sam Atkins
40b04d4da5 Shell: Use Core::Environment instead of manually iterating environ 2024-02-27 08:33:48 +00:00
Sam Atkins
97cb9cf469 LibCore: Use Core::Environment instead of manually iterating environ 2024-02-27 08:33:48 +00:00
Sam Atkins
56b8e248a5 LibCore: Remove now-unused Core::System::*env() functions
These have been moved to Core::Environment.
2024-02-27 08:33:48 +00:00
Sam Atkins
c6b9ce22ef LibSQL: Use Core::Environment instead of Core::System::*env() 2024-02-27 08:33:48 +00:00
Sam Atkins
f4e6f5c1cc SystemServer: Use Core::Environment instead of Core::System::*env() 2024-02-27 08:33:48 +00:00
Sam Atkins
7109f3706e Utilities: Use Core::Environment instead of Core::System::*env() 2024-02-27 08:33:48 +00:00
Sam Atkins
b9dc2d7ebf LibCore: Introduce Core::Environment wrapper
Core::System already had some wrappers for *env() functions, which I've
copied over. But 1) the set of functions there was incomplete, and 2)
the environment feels like an object in its own right, so let's treat it
as one. :^)

Also add `Core::Environment::has(StringView)` for situations where we
just care if a variable is defined.
2024-02-27 08:33:48 +00:00
Andreas Kling
55dc69625a LibJS/Bytecode: Fix formatting of operand lists in bytecode dumps
There was an unterminated color escape sequence which caused "args"
to look like "rgs" when dumping Call instructions.
2024-02-27 07:44:18 +01:00
Nico Weber
83d29b3e45 LibPDF: Hack around a FIXME in TrueTypePainter::get_glyph_width()
This will need further thought once we implement support for the
truetype 'post' table, but for now it's correct most of the time,
and better than not doing it.
2024-02-27 07:02:27 +01:00
Nico Weber
448eaa2966 LibPDF: Let Type1Font use TrueTypePainter for standard fonts
...and for fallback fonts too.

We use Liberation Sans (a truetype font) for standard and fallback
fonts. So we should use the standard PDF algorithm for mapping bytes
to truetype glyphs. TrueTypePainter knows how to do this.

Makes the "fi" ligature in the title on page 1 of 5014.CIDFont_Spec.pdf
or the dotless-i in the title of page 2 of ThinkingInPostScript.pdf
show up. They use Helvetica and TImes, and Helvetica and Symbol
respecitively (with -Bold variants).
2024-02-27 07:02:27 +01:00
Nico Weber
86a7753d65 LibPDF: Move TrueType painting into a new class
No behavior change.
2024-02-27 07:02:27 +01:00
Nico Weber
84d1e3956f LibPDF: Make truetype ascent adjustment more local
It's only used in this function.

No behavior change.
2024-02-27 07:02:27 +01:00
Nico Weber
b11aaca609 pdf: Honor page rotation 2024-02-27 07:02:02 +01:00
Nico Weber
03fab7089a LibPDF+PDFViewer: Extract Renderer::apply_page_rotation()
No behavior change.
2024-02-27 07:02:02 +01:00
Nico Weber
5e9395b808 pdf: Make render_page() take a Page instead of page_index
No behavior change.
2024-02-27 07:02:02 +01:00
Nico Weber
29f5182e51 LibGfx+PDFViewer: Add RotationDirection::Flip and use it in PDFViewer
No behavior change.
2024-02-27 07:02:02 +01:00
Nico Weber
5b223080ae LibGfx: Make RotationDirection an enum class
All code pretended it was one already.

No behavior change.
2024-02-27 07:02:02 +01:00
Nico Weber
75e5ed7aea LibGfx: Survive empty simple glyphs with 0 contours
Some fonts have empty slices for glyphs with 0 contours, even though
the spec requires them to store a 0 for instructionLength as far as
I can tell. But let's not assert on invalid fonts like this, but instead
handle them gracefully.

Supersedes #22570.

Fixes the last two crashes on my 1000-file test set: 0000246.pdf and
0000431.pdf.
2024-02-27 07:01:05 +01:00
Nico Weber
cafaaa0e76 LibPDF: Don't crash on zero-width characters in type1 fonts
Since ScaledFont bakes the size of the font into the font type, we
do the same for Type1 fonts, and then have to divide by the font height
when figuring out what to scale by. For a target width of 0, chances are
the source width is also 0, and we end up with NaN due to dividing
0 by 0. This then triggered the `VERIFY(isfinite(error))` in
can_approximate_bezier_curve() in Painter.cpp.

Check for this case and scale by 0 instead of dividing.

It could happen that the denominator is 0 without the numerator being 0,
but it's not clear what that's supposed to mean. In this case we'd end
up with +inf/-inf, which would also trigger the assert. I haven't seen
this case in practice, so let's not worry about that for now.

(A nicer longer-term fix is probably to make LibPDF use VectorFont
instead of ScaledFont, so that we don't have to bake the font size into
the font type. Then we won't need this division at all. In the meantime,
this fixes the crash.)

Fixes a crash on page 66 of
https://developer.apple.com/library/archive/documentation/mac/pdf/Text.pdf

Fixes a crash on page 37 of
https://open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf

Fixes crashes in `0000310.pdf`, `0000430.pdf`, `0000229.pdf`.

Brings down the number of crashes on my 1000 file test set from
5 with 3 distinct stacks to 2 with 1 distinct stack.

(The number went up from 3 crashes with 2 distinct stacks to 5/3 when we
started rendering much more text when Type0 font support was added.
This fixes the crashes we had before Type0 support.)
2024-02-27 07:01:05 +01:00
Tim Ledbetter
ee765e241e LibWeb: Allow performance timestamps to have sub-millisecond precision
Rather than returning the number of whole elapsed milliseconds, we now
return the number of elapsed nanoseconds divided by one million. This
allows us to make use of the fractional part of the double that is
returned.
2024-02-26 16:12:20 -07:00
Tim Ledbetter
05c571bf9b LibWeb: Use a precise timer for performance timestamps 2024-02-26 16:12:20 -07:00
Tim Ledbetter
679fe00d10 LibCore+Utilities: Replace ElapsedTimer precise flag with an enum
Previously, `true` was passed into the ElapsedTimer constructor if a
precise timer was required. We now use an enum to more explicitly
specify whether we would like a precise or a coarse timer.
2024-02-26 16:12:20 -07:00
Kenneth Myhra
0b64a71603 LibWeb: Make File a Serializable object 2024-02-26 16:10:20 -07:00
Kenneth Myhra
27445f3132 LibWeb: Add ability to {,de}serialize platform objects
This adds the ability to serialize and deserialize serializable platform
object in structured_serialize() and structured_deserialize().
2024-02-26 16:10:20 -07:00
Kenneth Myhra
394c38729f LibWeb: Make Blob a Serializable object 2024-02-26 16:10:20 -07:00
Kenneth Myhra
fc12402b49 LibWeb: Add abstract class Serializable
This adds the abstract class Serializable which platform objects defined
as Serializable objects can implement to support their appropriate
serialization and deserialization steps.
2024-02-26 16:10:20 -07:00
Kenneth Myhra
dcf5ff5178 LibWeb: Move serialize_* methods outside scope of Serializer class
These methods are useful independent of the class Serializer, so let's
move their declarations to the header file and and outside the scope of
the Serializer class.
2024-02-26 16:10:20 -07:00
Kenneth Myhra
985d0dd270 LibWeb: Move deserialize_* methods outside scope of Deserializer class
These methods are useful independent of the class Deserializer, so let's
move their declarations to the header file and and outside the scope of
the Deserializer class.
2024-02-26 16:10:20 -07:00
implicitfield
414bfed6fe mkfs.fat: Add support for autodetecting FAT type based on file size 2024-02-26 13:26:47 -07:00
implicitfield
f4112a0f65 mkfs.fat: Prefer using AK::Array over C-style arrays 2024-02-26 13:26:47 -07:00
implicitfield
012f2fd712 mkfs.fat: Fill in the last known free cluster count hint
This allows generated FAT32 file systems to pass fsck.fat without
tripping any warnings.
2024-02-26 13:26:47 -07:00
implicitfield
e91f60e0f5 CMake: Replace bespoke utility name mangling logic
Instead of manually removing the '.cpp' extension, we can simply ask
CMake to give us the file name without the last extension.
2024-02-26 13:26:47 -07:00
Aarushi Chauhan
564e619f57 AboutDialog: Port to GML Complier 2024-02-26 13:20:42 -07:00
Andrew Kaster
0a55749a39 Ladybird+Userland: Use ByteString for candidate server paths
We've adopted a stance that paths should be ByteStrings rather than
UTF-8 strings, so apply that to the Ladybird helpers.
2024-02-26 13:16:27 -07:00
Andrew Kaster
9918dcd4d5 LibWebView: Extend GENERATED_SOURCES list instead of replacing 2024-02-26 13:16:27 -07:00
Lucas CHOLLET
fb81668d8f LibGfx/JPEGLoader: Check earlier for quantization tables presence
This patch brings few small QoL improvements:
 - We don't need to read the Huffman stream before returning an error
   due to a missing quantization table.
 - We check the table presence only once per scan instead of once per
   MCU.
 - `dequantize()` is now infallible.
2024-02-26 20:13:25 +00:00
Bastiaan van der Plaat
c41b359ca5 LibWeb: Use WebIDL types where possible instead of C types 2024-02-26 19:26:13 +00:00
Timothy Flynn
f1d6693990 LibWebView: Reduce overhead of updating a cookie's last access time
Getting a document's cookie value currently involves:

1. Doing a large SELECT statement and filtering the results to match
   the document and some query parameters based on the cookie RFC.
2. For every cookie selected this way, doing an UPDATE to set its last
   access time.
3. For every UPDATE, do a DELETE to remove all expired cookies.

There's no need to perform cookie expiration for every UPDATE. Instead,
we can do the expiration once after all the UPDATEs are complete.

This reduces time spent waiting for cookies on https://twinings.co.uk
from ~1.9s to ~1.3s on my machine.
2024-02-26 19:59:09 +01:00
Timothy Flynn
ab4d4f0711 Browser: Implement the <input type=file> UI 2024-02-26 14:18:49 +01:00
Timothy Flynn
108521a566 LibWeb+LibWebView+WebContent: Implement more <input type=file> behavior
We had previous implemented some plumbing for file input elements in
commit 636602a54e.

This implements the return path for chromes to inform WebContent of the
file(s) the user selected. This patch includes a dummy implementation
for headless-browser to enable testing.
2024-02-26 14:18:49 +01:00
Timothy Flynn
435c2c24d1 LibWeb: Create a shadow tree for <input type=file> elements
This creates a button to prompt users to select a file, and a label to
show information about the selected file(s). Clicking either shadow
element will activate the input element.
2024-02-26 14:18:49 +01:00
Timothy Flynn
8319c7cfb8 LibWeb: Move code to update HTMLInputElement's shadow tree to a helper
We currently copy-paste a series of if statements to selectively update
the shadow tree elements for some <input> types. This will soon become
longer as more shadow trees are implemented for other types.

This patch just moves those checks to a single location to make adding
more shadow trees easier.
2024-02-26 14:18:49 +01:00
Ali Mohammad Pur
5232afa13d RequestServer+LibProtocol: Make starting requests fully async
This makes it so the clients don't have to wait for RS to become
responsive, potentially allowing them to do other things while RS
handles the connections.
Fixes #23306.
2024-02-26 14:13:37 +01:00
Aliaksandr Kalenik
18d26142f0 LibWeb: Skip StackingContext with erroneously large rect in GPU painter
If the GPU painter encounters a stacking context that requires the
allocation of a framebuffer so large, it is likely due to a layout
mistake, for now, we can skip it instead of crashing because of a
failed allocation.

Fixes https://github.com/SerenityOS/serenity/issues/22608
2024-02-26 07:40:42 +01:00
Sönke Holz
6d48b6724d LibELF: Ignore mapping symbols when symbolicating RISC-V ELFs 2024-02-25 17:33:39 -07:00
Dan Klishch
120d6b2f21 LibCore: Decouple handling of timers and waiting for events
This introduces a new TimeoutSet class for use in
EventLoopImplementationUnix. It is responsible for finding a timer that
expires the soonest and for firing expired timers. TimeoutSet expects
timeouts to be subclasses of EventLoopTimeout, of which EventLoopTimer
is now a subclass, obviously.

TimeoutSet stores timeouts in a binary heap, so
EventLoopImplementationUnix should handle large amounts of timers a lot
better now.

TimeoutSet also supports scheduling of timeouts whose fire time is
relative to the start of the next event loop iteration (i. e. ones
that directly bound polling time). This functionality will reveal its
full potential later with the implementation of asynchronous sockets but
it is currently used to implement zero-timeout timers that are an analog
of Core::deferred_invoke with slightly different semantics.
2024-02-25 17:24:36 -07:00
Dan Klishch
b77996884e LibCore+Ladybird: Don't force timer ids to be integer just to remap them
If we don't force event loop to fit timer id into integer, we can
eliminate awkward IDAllocator inside EventLoopImplementations.
2024-02-25 17:24:36 -07:00
Dan Klishch
bed4af6fef LibCore+Ladybird: Make unregistering timer infallible
Let's force calling code to provide valid timer ids. No code changes are
required since, surprise, nobody used this obscure functionality.
2024-02-25 17:24:36 -07:00
Dan Klishch
21097d1c9e LibCore+Ladybird: Don't store timer_id in Core::TimerEvent 2024-02-25 17:24:36 -07:00
Matthew Olsson
0f54d797d2 LibWeb: Handle pre-existing animations when considering animation-name
If a DOM::Element has an animation-name property, then in addition to
remembering where it came from, it will also remember the
Animations::Animation object that was created for it. This allows
StyleComputer to cancel that animation if the animation-name property
changes as well as to apply any changes required (for example, if
animation-play-state changes from "running" to "paused", it needs to
call .pause() on the animation).
2024-02-25 21:12:42 +00:00
Matthew Olsson
b235620315 LibWeb: Pause keyframe animations during creation when necessary 2024-02-25 21:12:42 +00:00
Matthew Olsson
2ee022dead LibWeb: Set KeyframeEffect's pseudo-element if applicable 2024-02-25 21:12:42 +00:00
Matthew Olsson
921f6c1e78 LibWeb: Run play tasks before pause tasks
The logic of play() and pause() assumes this to be the case
2024-02-25 21:12:42 +00:00
Timothy Flynn
090dbac5a3 Revert "LibWeb: Allow bypassing transient activation checks for tests"
This reverts commit e52c30cbd5.

It's highly possible that this test was flaky on CI due to mixing units
of seconds and milliseconds in the transient activation calculation.
Revert the workaround for that commit in an attempt to avoid needless
ad-hoc behavior.
2024-02-25 12:35:49 -05:00