Commit graph

49217 commits

Author SHA1 Message Date
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
Matthew Olsson
bd7809cc18 LibWeb: Mostly implement ReadableByteStreamController.[[ReleaseSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson
51abecc8bc LibWeb: Mostly implement ReadableByteStreamController.[[PullSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson
c97f6b7701 LibWeb: Implement ReadableByteStreamController.[[CancelSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson
8274906301 LibWeb: Expose ReadableStream::m_state and use in AOs
This allows us to be a bit closer to the spec phrasing and matches
what we do with WritableStream
2023-04-14 13:03:34 +02:00
Ali Mohammad Pur
eba466b8e7 LibRegex: Avoid calling GenericLexer::consume() past EOF
The consume(size_t) overload consumes "at most" as many bytes as
requested, but consume() consumes exactly one byte.
This commit makes sure to avoid consuming past EOF.

Fixes #18324.
Fixes #18325.
2023-04-14 12:33:54 +02:00
Luke Wilde
821702fadd LibWeb: Set Comment's prototype
This makes YouTube's thumbnails start appearing on the homepage.
Yes,seriously.

Simply put, this is because this check failed when Comment had the
incorrect prototype:
90cb97f847/packages/shadycss/src/style-util.js (L397)

This causes it to try and reconvert style sheets that are already in
Shady format, which would cause it to spuriously add things such as
class selectors on the end of tag selectors. This caused nothing to
match the selectors.

When YouTube is generating the thumbnails, it checks if the thumbnail
grid container has a non-zero clientWidth. If it's zero, it simply
bails generating thumbnails. Since the selectors for this container did
not apply, we would not properly create a paint box for it, causing
clientWidth to return zero.
2023-04-14 12:30:43 +02:00
Tim Schumacher
18565dd286 Ports/llvm: Increase the default stack size for LLVM executables 2023-04-14 10:05:05 +02:00
Tim Schumacher
b1136ba357 AK: Efficiently resize CircularBuffer seekback copy distance
Previously, if we copied the last byte for a length of 100, we'd
recalculate the read span 100 times and memmove one byte 100 times,
which resulted in a lot of overhead.

Now, if we know that we have two consecutive copies of the data, we just
extend the distance to cover both copies, which halves the number of
times that we recalculate the span and actually call memmove.

This takes the running time of the attached benchmark case from 150ms
down to 15ms.
2023-04-14 10:03:42 +02:00
Matteo Benetti
3e1626acdc Spreadsheet+LibSyntax: Never insert spans directly
Function `CellSyntaxHighlighter::rehighlight()` direct inserted spans
to TextDocument `m_span` vector missing out important reordering and
merging operation carried out by `TextDocument::set_spans()`.

This caused overlapping spans for a cell with only a `=` symbol
(one for the actual token and one for the highlighting) to
miscalculate `start` and `end` value and a `length` value (of
`size_t` type) with a `0-1` substraction (result: 18446744073709551615)
causing `Utf32View::substring_view()` to fail the
`!Checked<size_t>::addition_would_overflow(offset, length)` assertion

This remove the possibility to directly alter `TextDocument`'s spans
thus forcing the utilization of `HighlighterClient::do_set_spans()`
interface function.

Proper refactor have been applied to
`CellSyntaxHighlighter::rehighlight()` function
2023-04-14 10:00:52 +02:00
Cubic Love
fb47b988ca Base: Add US English Apple Macintosh keymap
Add the full alt + shift-alt keymap for the EN-US Apple Keyboard Layout
2023-04-14 10:00:06 +02:00
Linus Groh
89503a0cfe LibJS: Port PrototypeObject::typed_this_value() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
a23dd88f61 LibJS: Port PrototypeObject::typed_this_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00