Commit graph

49229 commits

Author SHA1 Message Date
Nico Weber 97b7e494e4 Everywhere: Use ARCH(AARCH64) instead of AK_ARCH_AARCH64
The former is typo-resistant after 349e54d5375a4a, so make use of that.
2023-04-14 19:15:19 +02:00
Tim Schumacher 50f42407f6 Documentation: Add build dependencies for SerenityOS :^) 2023-04-14 19:00:46 +02:00
Timothy Flynn 781287c1e3 LibWeb: Do not dereference empty Optional in ReadableStream::visit_edges
There are quite a few steps between a ReadableStream being created and
its controller being set. If GC occurs between those points, we will
have an empty Optional in ReadableStream::visit_edges. Seen on YouTube.
2023-04-14 18:55:59 +02:00
Tim Schumacher 9be5dcfd89 Kernel: Also search the main program for stack size requests 2023-04-14 16:12:04 +01:00
Tim Schumacher ed74f792e2 Kernel: Pick the maximum out of the requested stack sizes 2023-04-14 16:12:04 +01:00
Tim Schumacher dcd462a050 Lagom: Add an option for standalone fuzzers to BuildFuzzers.sh
This builds simple fuzzing binaries without any oss-fuzz specific
configuration and without any LibFuzzer instrumentation.
2023-04-14 16:08:00 +01:00
Tim Ledbetter bebcf71bdc LibMarkdown: Avoid catastrophic backtracking in thematic break regex
Fixes #17937
2023-04-14 16:02:59 +01:00
Linus Groh 0abdffc33d LibWeb/Streams: Rename one instance of 'e' to 'exception'
This is what we call it everywhere else.
2023-04-14 16:35:17 +02:00
Linus Groh 6b35cca65b LibWeb/Streams: Add FIXMEs to incorrect invoke_callback() invocations 2023-04-14 16:35:17 +02:00
Linus Groh 1c165b67ef LibWeb/Streams: Use MUST_OR_THROW_OOM() when creating JS exceptions
This cannot throw unless we OOM.
2023-04-14 16:35:17 +02:00
Linus Groh d192f44523 LibWeb/Streams: Make most algorithms return a NonnullGCPtr
Only the 'start algorithm' ever returns undefined (as a null GCPtr), so
let's type the others more strictly.
2023-04-14 16:35:17 +02:00
Nico Weber fc15fc36ce AK: Make math work on arm hosts again
957f89ce4a added some tweaks for serenity-on-aarch64.
It broke anythingelse-on-aarch64 hosts though, so only do these tweaks
when targeting serenity.

(I wonder if AK/Math.h should fall back to the system math routines
when not targeting serenity in general. Would probably help ladybird
performance. On the other hand, the serenity routines would see less
use and hence exposure and love.)
2023-04-14 16:16:42 +02:00
Ethan Yeager bf5a18babb PixelPaint: Correct gradient tool's position during preview 2023-04-14 13:42:45 +01:00
Karol Kosek e8fe35b1e5 LibWeb: Resolve more background-related properties
This change adds rules for background-attachment, background-clip,
background-image, background-origin, and background-repeat.

As a result, Window.getComputedStyle() will no longer return empty
strings on these properties after a page is loaded, and the background
shorthand will show the resolved values instead of the default ones for
these values. :^)
2023-04-14 12:44:59 +01:00
Julian Offenhäuser e32ab161ae WindowServer: Fix alt shortcut navigation for non-default keymaps
Some keymaps will bind key presses with the alt modifier to characters
other than the unmodified one, in which case you couldn't activate the
alt shortcuts in the menu bar before.

We now ask the current keymap for the code point that is mapped to the
pressed (unmodified) key instead.
2023-04-14 12:38:40 +01:00
stelar7 e59137d4f6 LibTLS: Add RFC explanation of AlertDescription values 2023-04-14 12:32:04 +01:00
stelar7 9059694216 LibTLS: Show enum value instead of underlying value where possible 2023-04-14 12:32:04 +01:00
stelar7 5853d9642a LibTLS: Move AlertDescription to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 e8945f15f4 LibTLS: Move CipherSuite to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 da8edece29 LibTLS: Move HashAlgorithm to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 fba7695dcc LibTLS: Move SignatureAlgorithm to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 e5f81475e5 LibTLS: Move ECPointFormat to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 a4855aef17 LibTLS: Rename NamedCurve to SupportedGroup
This matches the wording used in the IANA registry and TLS 1.3
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 6df3ffaf45 LibTLS: Move ECCurveType to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7 0fea6e7f13 LibTLS: Move NameType to Extensions.h 2023-04-14 12:32:04 +01:00
stelar7 9110f26c79 LibTLS: Rename HandshakeExtension to ExtensionType
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
stelar7 c30ee1b89b LibTLS: Update HandshakeType value names to match IANA registry values 2023-04-14 12:32:04 +01:00
stelar7 611a235a52 LibTLS: Rename AlertLevel Critial to FATAL
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
stelar7 ca6b8bfe7f LibTLS: Rename Version to ProtocolVersion
This matches the wording used in the TLS RFC
Also define GREASE values as specified in RFC8701
2023-04-14 12:32:04 +01:00
stelar7 082e64e167 LibTLS: Rename MessageType to ContentType
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
Arda Cinar 1cfc630d13 LibC: Implement if_indextoname and if_nametoindex 2023-04-14 12:29:03 +01:00
Arda Cinar 38dc54317c Kernel/Net: Implement SIOCGIFINDEX and SIOCGIFNAME for sockets
These ioctls exist on Linux and can be used to implement libc functions
if_indextoname and if_nametoindex (without needing to parse any JSON).
2023-04-14 12:29:03 +01:00
Andreas Kling 47c21cc349 LibWeb: Honor column-gap and row-gap CSS properties in flex layout
This isn't actually part of CSS-FLEXBOX-1, but all major engines honor
these properties in flex layout, and it's widely used on the web.

There's a bug open against the flexbox spec where fantasai says the
algorithm will be updated in CSS-FLEXBOX-2:
https://github.com/w3c/csswg-drafts/issues/2336

I've added comments to all the places where we adjust calculations for
gaps with "CSS-FLEXBOX-2" so we can find them easily. When that spec
becomes available, we can add proper spec links.
2023-04-14 13:22:07 +02:00
Brendan Kelly 7dd3c4a79c SoundPlayer: Check if loader is null
This patch prevents SoundPlayer from crashing when attempting to "seek"
when no file has been loaded
2023-04-14 07:13:32 -04:00
Zaggy1024 5e3192c8d9 LibVideo/VP9: Extend the borders on reference frames to avoid branching
Extending the borders on reference frames so that motion vectors that
point outside the reference frame allows `predict_inter_block()` to
avoid some branches to clamp the sample coordinates in its loops.

This results in about a 25% improvement in decode time of a motion-
heavy YouTube video (~20.8s -> ~15.6s).
2023-04-14 07:11:45 -04:00
Zaggy1024 08b90bb2d0 LibVideo/VP9: Clamp reference frame prediction coords outside loops
Moving the clamping of the coordinates of the reference frame samples
as well as some bounds checks outside of the loop reduces the branches
needed in the `predict_inter_block()` significantly.

This results in a whopping ~41% improvement in decode performance
of an inter-prediction-heavy YouTube video (~35.4s -> ~20.8s).
2023-04-14 07:11:45 -04:00
Zaggy1024 bc49af08b4 LibVideo/VP9: Pre-calculate inter-frames' reference frame scale factors
Changing the calculation of reference frame scale factors to be done on
a per-frame basis reduces the amount of work done in
`predict_inter_block()`, which is a big hotspot in most videos.

This reduces decode times in a test video from YouTube by about 5%
(~37.2s -> ~35.4s).
2023-04-14 07:11:45 -04:00
Zaggy1024 5cd5edc3bd LibVideo/VP9: Copy data to reference frames row by row
This changes the order of the loop copying data to a reference frame
store so that it copies each row in a contiguous line rather than
copying a column at a time, which caused unnecessary branches.

This reduces the decode time on a fairly long 720p YouTube video by
about 14.5% (~43.5s to ~37.2s).
2023-04-14 07:11:45 -04:00
Zaggy1024 dfd0eb877f TestVP9Decode: Dequeue frames from the decoder after sending a sample
Frames must be dequeued from the decoder, or the queue will grow
continuously until OOM.
2023-04-14 07:07:38 -04:00
Zaggy1024 e1b3f9a26e LibVideo/Matroska: Remove assertion that cue seeks find earlier samples
Files can contain a first keyframe that is timestamped later than zero.
We don't want to crash in those cases, so don't assert that it can't
happen.
2023-04-14 12:05:52 +01:00
Zaggy1024 d4c33a7134 LibGUI: Only redraw sliders after the on_change callback has finished
This prevents the seek slider in VideoPlayer from skipping forward and
then back when fast seeking is enabled. Previously, it was possible for
a single frame to render before the actual seek position in the seek
bar was set.
2023-04-14 12:05:52 +01:00
Zaggy1024 e391f18e9e LibVideo: Remove Starting playback state in favor of Seeking to zero 2023-04-14 12:05:52 +01:00
Zaggy1024 4df9ef487d VideoPlayer: Use rounded seconds for the timestamp label
Previously, the time would read "00:00:01" when the timestamp was
merely 1 millisecond past the start of the video. If a video does not
start with a sample at timestamp 0, then, seeking to the start would
display that text rather than "00:00:00".
2023-04-14 12:05:52 +01:00
Zaggy1024 79779aff18 VideoPlayer: Update the current timestamp on state changes
The state could change and cause a timestamp change without the video
frame event firing, which could desync the seek bar from the video's
actual time.
2023-04-14 12:05:52 +01:00
Zaggy1024 dc049e36cf LibVideo: Add a method to get the playback state from PlaybackManager 2023-04-14 12:05:52 +01:00
Zaggy1024 b081967762 LibVideo: Always present a frame when not fast-exiting seek
Previously, there was some leftover logic in `SeekingStateHandler`
which would avoid presenting a frame if it didn't find a frame both
before and after the target frame. However, this logic was unnecessary
as the `on_enter()` function would check if it needed to present a
frame and exit seeking if not.

This allows seeking to succeed if the Seeking handler cannot find a
frame before the one to be seeked to, which could occur if the first
frame of a video is not at timestamp 0.
2023-04-14 12:05:52 +01:00
Zaggy1024 989f965f54 LibVideo: Dispatch PlaybackManager state changes after on_enter()
Previously, the state change was dispatched before the new state that
was adopted had been entered, causing it to have invalid state.
2023-04-14 12:05:52 +01:00
Zaggy1024 41ed0cbbce LibVideo: Improve logging when PLAYBACK_MANAGER_DEBUG=on
This adds a timestamp to the debug output when presenting a frame, so
it can be clear the frame spacing between a presented frame and a state
change.

The seeking state will also now print when it early-exits if the seek
point is within the current sample's duration.
2023-04-14 12:05:52 +01:00
Matthew Olsson db1be40b13 LibWeb: Propogate OOM errors from readable_stream_reader_generic_cancel 2023-04-14 13:03:34 +02:00
Matthew Olsson f9d6a161e8 LibWeb: Add ByteStreamController to ReadableStreamController type 2023-04-14 13:03:34 +02:00