Commit graph

51784 commits

Author SHA1 Message Date
Shannon Booth
a92d94f4e9 LibWeb/Tests: Add basic test for ByteLengthQueuingStrategy 2023-06-23 13:27:29 +02:00
Shannon Booth
a975fca42e LibWeb: Implement size attribute of ByteLengthQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth
b2a51e86e5 LibWeb/Tests: Add basic test for CountQueuingStrategy 2023-06-23 13:27:29 +02:00
Shannon Booth
49689e5d8e LibWeb: Implement size attribute of CountQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth
6d93692bc5 LibWeb: Add IDL definition for 'Function'
This is used in ByteLengthQueuingStrategy and CountQueuingStrategy
in the Streams spec.
2023-06-23 13:27:29 +02:00
Shannon Booth
4f217947b3 LibWeb: Implement QueuingStrategy for Web::Streams::ReadableStream 2023-06-23 13:27:29 +02:00
Andreas Kling
e5c7d8407b LibJS/Bytecode: Support private class fields
This is accomplished with two new instructions:
- GetPrivateById
- PutPrivateById

Looks like 1616 new passes on test262. :^)
2023-06-23 08:53:10 +02:00
Andreas Kling
467ea86179 LibJS: Use bytecode for generator function default parameters
Otherwise there's a mismatch between which interpreter we use.
This fixes a regression in the AST interpreter score on test262.
2023-06-23 08:09:50 +02:00
Tim Ledbetter
702054dcbc wc: Add -L option to show the length of the longest line
If more than one file is specified on the command line and the `-L`
option is used, the totals field will show the longest line
encountered; it is not a sum like the other values.
2023-06-23 06:24:33 +02:00
Andi Gallo
8e52d1125d LibWeb: Take specified height into account for automatic table height
Track table grid height stretched to the specified height and use it to
set the final box height in TFC.

Fixes #19563.
2023-06-23 06:24:08 +02:00
Aliaksandr Kalenik
04a5196a5d LibWeb: Add fast_is<T>() for SVGUseElement
is<SVGUseElement> quite hot in profiles
2023-06-23 06:23:42 +02:00
kleines Filmröllchen
80a228383b AK: Simplify MaybeOwned constructor
The previous version had a sequence of calls that are likely not
optimized out, while this version is strictly a sequence of static type
conversion which are always fully optimized out.
2023-06-23 01:34:27 +02:00
kleines Filmröllchen
7a6b1f179b AK: Explicitly make MaybeOwned noncopyable
Copying an owning MaybeOwned is forbidden.
2023-06-23 01:34:27 +02:00
Tim Ledbetter
75c61172e3 Base: Add man page for dirname(1) 2023-06-22 17:26:51 -04:00
Tim Ledbetter
e259c3b38a dirname: Add support for multiple paths 2023-06-22 17:26:51 -04:00
Tim Ledbetter
828caf12a6 dirname: Add -z option for null terminated output 2023-06-22 17:26:51 -04:00
Tim Ledbetter
c1c35f4f59 mkdir: Add -v option to print a message for each created directory 2023-06-22 22:35:30 +02:00
Tim Ledbetter
925ea4e854 mkdir: Replace LibC function calls with LibCore equivalents 2023-06-22 22:35:30 +02:00
Jelle Raaijmakers
f619b61b00 Lagom: Link aconv with LibFileSystem 2023-06-22 22:27:03 +02:00
Jelle Raaijmakers
56da2c5db6 aconv: Remove usage of ancient Core::DeprecatedFile
That'll teach me for merging without waiting for CI :^)
2023-06-22 21:53:00 +02:00
kleines Filmröllchen
0d65e5f518 Meta: Add aconv as a Lagom tool 2023-06-22 21:45:54 +02:00
kleines Filmröllchen
57b3858fbc Utilities: Add aconv for converting between audio formats
The intention for this utility is to eventually become a general-purpose
multimedia conversion tool like ffmpeg (except probably not with as many
supported formats, stream mappings and filters). For now, we can not
write any video format so the added complexity is not necessary at the
moment.
2023-06-22 21:45:54 +02:00
kleines Filmröllchen
de17cd018e LibAudio: Add accessor to "real" PCM sample format of loader 2023-06-22 21:45:54 +02:00
kleines Filmröllchen
cd2e890304 LibAudio: Handle all integer PCM sample formats "correctly" in WavWriter
WavWriter needs a TON of modernization work, but for now this commit
just tackles two FIXMEs by converting samples correctly into all
supported integer PCM formats. The supported formats are only signed
16-bit and unsigned 8-bit for now, but can be expanded later. At least
we don't produce horrible speaker-destroying noise when writing any
other format.
2023-06-22 21:45:54 +02:00
Lucas CHOLLET
102fdf6305 AK: Override read_until_filled in FixedMemoryStream
This specialized method allow significant performance improvements for
the user.
2023-06-22 21:32:45 +02:00
Lucas CHOLLET
d00a563462 LibGfx/PortableFormat: Write directly to the bitmap
No need to copy the data first to a Vector and then to the Bitmap. We
can skip this unnecessary step.
2023-06-22 21:32:45 +02:00
Daniel
d8c1150f6b LibWeb: Respect "no-store" directive in cache-control header 2023-06-22 21:24:23 +02:00
Andreas Kling
cd08515957 LibJS/Bytecode: Support named evaluation of anonymous functions 2023-06-22 21:16:17 +02:00
Andreas Kling
f4fe9f09a1 LibJS/Bytecode: Perform ShadowRealm evaluations in bytecode when enabled 2023-06-22 21:16:17 +02:00
Andreas Kling
6537ed8fff LibJS/Bytecode: Simplify Bytecode::Interpreter lifetime model
The JS::VM now owns the one Bytecode::Interpreter. We no longer have
multiple bytecode interpreters, and there is no concept of a "current"
bytecode interpreter.

If you ask for VM::bytecode_interpreter_if_exists(), it will return null
if we're not running the program in "bytecode enabled" mode.

If you ask for VM::bytecode_interpreter(), it will return a bytecode
interpreter in all modes. This is used for situations where even the AST
interpreter switches to bytecode mode (generators, etc.)
2023-06-22 21:16:17 +02:00
Andreas Kling
6150960671 Tests: Remove test-bytecode-js
This was meant to be a temporary unit testuntil we could run test-js
in bytecode mode. This has been possible for a long time now, so let's
remove the unnecessary extra program.
2023-06-22 21:16:17 +02:00
Lucas CHOLLET
b7c30f3096 image: Support JPEG as an output format 2023-06-22 21:13:04 +02:00
Lucas CHOLLET
226b214142 LibGfx/JPEG: Add a JPEG encoder :^)
This encoder is very naive as it only output SOF0 images and uses
pre-defined Huffman tables.

There is also a small bug with quantization which make using it
over-degrade the quality.
2023-06-22 21:13:04 +02:00
Lucas CHOLLET
503720b574 LibGfx/JPEG: Put generic definitions in a shared header
That file holds information that are used by both a decoder and an
encoder.
2023-06-22 21:13:04 +02:00
Timothy Flynn
3dac2f7e58 LibWeb: Decrease size of the media timeline box a tiny bit
Had this staged and meant to amend 8e3e068d75, as it makes the media
controls look a bit more balanced in size, but forgot to actually
commit.
2023-06-22 14:20:26 -04:00
Timothy Flynn
8e3e068d75 LibWeb: Paint the media timeline above the other media controls
It's a little bit of a battle to fit all of the media controls in the
available width of the media element. We currently cram everything on
one horizontal line. We've made adjustments to be able to fit it all,
but the controls (in particular the media timeline) are rather squished.

This paints the timeline above the other media controls now. This
provides much more granular control over the playback position when
scrubbing, and makes it much more likely for the timeline to render at
all.
2023-06-22 20:05:19 +02:00
Timothy Flynn
b306db359a LibWeb: Begin scrubbing the media timeline and volume on mouse-down
This feels a bit more natural than waiting until the first mouse-move
event to begin scrubbing.
2023-06-22 20:05:19 +02:00
Timothy Flynn
f6e10ecbfd Ladybird: Set the sample rate on the audio device's audio format
For example, on https://xboygeniusx.bandcamp.com/album/the-record, a
song with a duration of 03:52 would actually complete in 03:33 on my
machine. This issue only affects Ladybird on Lagom; on Serenity, we
already take the entire 03:52 to play the song.
2023-06-22 18:19:21 +02:00
Aliaksandr Kalenik
2cbc9a6642 LibWeb: Start fleshing out Navigable::choose_a_navigable()
Equivalent of `choose_a_browsing_context` for navigables.
2023-06-22 18:18:50 +02:00
Aliaksandr Kalenik
473848be0e LibWeb: Do not treat size of abspos items as definite
This fixes the issue when size of abspos items is considered to be
resolvable without performing layout which is not correct in the
scenarious when top/right/bottom/left properties are not auto.
2023-06-22 18:18:04 +02:00
Timothy Flynn
1c991e5582 LibWeb: Add missing invocation to forget a media element's tracks
On bandcamp, this missing invocation would cause a playlist to loop one
single track indefinitely.
2023-06-22 14:58:43 +02:00
Shannon Booth
9cb4bf0683 LibWeb: Implement QueuingStrategy for Web::Streams::WritableStream 2023-06-22 06:58:23 +02:00
Shannon Booth
33f6e5d516 LibWeb: Implement Streams AO ExtractSizeAlgorithm(strategy) 2023-06-22 06:58:23 +02:00
Shannon Booth
060c130c82 LibWeb: Implement SetUpReadableByteStreamControllerFromUnderlyingSource 2023-06-22 06:58:23 +02:00
Shannon Booth
9ea597016a LibWeb: Implement Streams AO ExtractHighWaterMark(strategy, defaultHWM) 2023-06-22 06:58:23 +02:00
Shannon Booth
e1d71454eb LibWeb: Correct parameter name in Web::Streams::ReadableStream::cancel
This aligns with the name given in the implementation file and is a
better description of what is being passed in.
2023-06-22 06:58:23 +02:00
Shannon Booth
314eeeb9b2 LibWeb: Const qualify Web::Streams::ReadableStream::locked 2023-06-22 06:58:23 +02:00
Shannon Booth
42c102ecb6 LibWeb: Add IDL definition for Web::Streams::QueuingStrategy 2023-06-22 06:58:23 +02:00
Timothy Flynn
9df2d6ee0f LibWeb: Implement scrubbing of the media element timeline and volume
This implements the ability to drag the timeline and volume buttons on
UA-rendered media controls. The two behave a bit differently:

Volume is updated as the user drags the volume button. This isn't a very
expensive operation, so updating in real-time and hearing the volume
change feels nice.

The current time, on the other hand, is not committed until the user
releases the mouse button. Performing a seek every time we get a mouse-
move event is pretty laggy, especially for video. However, we still want
to render updates on the timeline itself (so the position of the button
and the timestamp update as you drag). To do so, we internally pause the
media and override the timestamp provided to the layout node.

In the future, we may be able to seek video periodically to provide some
visual feedback. For example, we can seek after every N seconds of
scrubbing, or when the user pauses scrubbing for a while.
2023-06-22 06:58:07 +02:00
Timothy Flynn
bcd222cfae Ladybird+LibWeb+WebContent: Prevent out-of-bounds seeking audio elements
It's currently possible to seek to the total sample count of an audio
loader. We must limit seeking to one less than that count.

This mistake was duplicated in both AudioCodecPluginSerenity/Ladybird,
so the computation was moved to a helper in the base AudioCodecPlugin.
2023-06-22 06:58:07 +02:00