Commit graph

48030 commits

Author SHA1 Message Date
Andreas Kling f8c075f2b1 AK: Add Queue::tail()
We already had head(), so let's also have tail().
2023-03-14 16:52:44 +01:00
Andreas Kling 479e269c8b WebContent: Give paint requests a chance to happen between input events
Before this patch, we had an issue where the WebContent process could
get backed up with tons of pending input events (especially mouse moves)
and have to work through all of those before responding to a paint
request from the UI process.

This could lead to a situation where we went for a very long time
without seeing any visual updates.

The approach I've taken here is pretty simple, we basically make a queue
of all incoming input events on the WebContent process side, and then
process that queue one event at a time, using a zero timer. This is
basic, but it allows paint requests to come in between the input events
and we do now get more frequent visual updates even during heavy
pressure from input events.
2023-03-14 16:52:44 +01:00
Andreas Kling d1065afdd3 LibWeb: Avoid inside layout of flex items during intrinsic sizing
When we're calculating the intrinsic size of a flex container, we don't
*need* to layout the inside of each flex item. That's only necessary if
the flex items will be seen (as is the case for "normal" layout).

This avoids a whole bunch of unnecessary layout work on pages that use
flexbox layout. :^)
2023-03-14 16:52:44 +01:00
networkException 1a958633fa Ladybird: Rely on transparent text color for location highlighting
This patch replaces the usage of QPalette::PlaceholderText with
QPalette::Text with opacity reduced to roughly 50%. This fixes the non
highlighted spans having an extremely low contrast compared to the
background in dark mode.
2023-03-14 14:56:37 +01:00
Mathis Wiehl b96920a9d6 LibWeb: Consider margins of atomic inlines in layout
According to CSS Inline Layout Module Level 3 § 2.2 Step 1. atomic
inlines should be layed out in a line box based on their margin box.

However, up until this patch we were unconditionally considering only
the border box during line box height calculation. This made us
essentially drop all vertical margins for atomic inlines.
2023-03-14 14:45:40 +01:00
Timothy Flynn 0aa4466ce9 LibWeb: Port {set,clear}{Timeout,Interval} to IDL 2023-03-14 09:07:40 -04:00
Timothy Flynn 6c5e79ce3a LibWeb: Begin adding support for Function IDL types in unions
For example, setTimeout/setInterval use a TimerHandler, which is a union
of (DOMString or Function).
2023-03-14 09:07:40 -04:00
Timothy Flynn 50717ce404 LibWeb: Support variadic "any..." parameters in IDL
For example, this is used by setTimeout/setInterval.
2023-03-14 09:07:40 -04:00
Timothy Flynn 2895b7e733 LibWeb: Port the WindowOrWorkerGlobalScopeMixin timer handler to String
This will make porting to IDL a bit cleaner.
2023-03-14 09:07:40 -04:00
Timothy Flynn dd992e7dad LibWeb: Move timer implementations to WindowOrWorkerGlobalScopeMixin
This is where it belongs according to the spec, and where these methods'
IDL will be placed.

This forces us to implement a few steps closer to the spec as well.
2023-03-14 09:07:40 -04:00
Timothy Flynn b579093ad0 LibWeb: Change HTML::Timer to store its owning window as a JS::Object
Rather than being limited to a Window object, it will also need to be
ownable by a WorkerGlobalScope.
2023-03-14 09:07:40 -04:00
Linus Groh ea11a84332 Documentation: Start documenting LibWeb code style & patterns 2023-03-14 11:31:57 +01:00
Timothy Flynn 97536e4684 LibWeb+Ladybird+Userland: Port window.[alert,confirm,prompt] to String
LibGUI and WebDriver (read: JSON) API boundaries use DeprecatedString,
so that is as far as these changes can reach.

The one change which isn't just a DeprecatedString to String replacement
is handling the "null" prompt response. We previously checked for the
null DeprecatedString, whereas we now represent this as an empty
Optional<String>.
2023-03-13 22:05:22 +00:00
Timothy Flynn b4d3fea002 Ladybird: Add a utility to create a QString from an AK::String 2023-03-13 22:05:22 +00:00
Timothy Flynn fc15968418 WebDriver: Fix typo in browser capabilities key parsing 2023-03-13 17:34:00 -04:00
Linus Groh 6d19a9f9da Toolchain: Use '|' as sed delimiter in Build{Clang,It}.sh, not '@'
The latter is problematic as it may be contained in the username (e.g.
email address-like) and thus the $SRC_ROOT path. This would cause an
invalid sed command to be created, breaking both of these scripts.
2023-03-13 20:12:44 +00:00
Andreas Kling d21d1d99bd LibJS: Don't skip CPU registers when gathering conservative roots
We were accidentally skipping over most of the CPU registers by
incrementing the register index by sizeof(FlatPtr) instead of 1.

This fixes a long-standing issue where live objects could still get
garbage-collected if they were only pointed to by an unlucky register.
2023-03-13 20:50:38 +01:00
Timothy Flynn 6070875564 LibAudio: Update stream APIs used when reading audio metadata 2023-03-13 12:46:42 -04:00
kleines Filmröllchen 68447d8f39 SoundPlayer: Display title and artist in the window title if available 2023-03-13 12:35:17 -04:00
kleines Filmröllchen 0563048949 file: Read more metadata from audio files
We can always read the basic format information (sample rate, bit depth,
etc.), but we will also print artist, album, and title if available in
the metadata.
2023-03-13 12:35:17 -04:00
kleines Filmröllchen a8963a270f LibAudio: Detect and read FLAC metadata
FLAC uses the very simple vorbis comment metadata format, which we can
now read most standard and non-standard fields from.
2023-03-13 12:35:17 -04:00
kleines Filmröllchen d8e8ddedf3 LibAudio: Add a generic audio metadata container
This container has several design goals:
- Represent all common and relevant metadata fields of audio files in a
  unified way.
- Allow perfect recreation of any metadata format from the in-memory
  structure. This requires that we allow non-detected fields to reside
  in an "untyped" miscellaneous collection.

Like with pictures, plugins are free to store their metadata into the
m_metadata field whenever they read it. It is recommended that this
happens on loader creation; however failing to read metadata should not
cause an error in the plugin.
2023-03-13 12:35:17 -04:00
kleines Filmröllchen d1dd753a95 LibAudio: Add a formatter for LoaderError 2023-03-13 12:35:17 -04:00
Daniel Bertalan b668000e44 Meta+Documentation: Allow cross-debugging x86_64 Serenity on M1 Macs
While there is no native GDB on Apple Silicon, a cross-debugger that
supports x86-64 does exist.
2023-03-13 17:02:56 +01:00
Daniel Bertalan 59ba94a2d2 Documentation: Add a note about running on Apple Silicon 2023-03-13 17:02:56 +01:00
Tim Schumacher ae51c1821c Everywhere: Remove unintentional partial stream reads and writes 2023-03-13 15:16:20 +00:00
Tim Schumacher 26516ee160 LibSQL: Always read and write entire heap blocks 2023-03-13 15:16:20 +00:00
Tim Schumacher ba354fa396 LibCore: Use length-checking stream reads and writes for SOCKS5 2023-03-13 15:16:20 +00:00
Tim Schumacher 8032724574 CodeGenerators: Ensure that we always print the entire generated output 2023-03-13 15:16:20 +00:00
Tim Schumacher e007279315 AK: Read and write accumulated BitStream bits directly 2023-03-13 15:16:20 +00:00
Tim Schumacher 424df62b00 LibAudio: Read FLAC MD5 directly into the class member 2023-03-13 15:16:20 +00:00
Tim Schumacher 26ba195cf6 LibArchive: Read Tar archive headers through read_value 2023-03-13 15:16:20 +00:00
Tim Schumacher b623dda765 AK: Remove unneeded overrides for write_until_depleted from BitStream 2023-03-13 15:16:20 +00:00
Tim Schumacher ecd1862859 AK: Rename Stream::write_entire_buffer to Stream::write_until_depleted
No functional changes.
2023-03-13 15:16:20 +00:00
Tim Schumacher a3f73e7d85 AK: Rename Stream::read_entire_buffer to Stream::read_until_filled
No functional changes.
2023-03-13 15:16:20 +00:00
Tim Schumacher d5871f5717 AK: Rename Stream::{read,write} to Stream::{read_some,write_some}
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").

Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).

No functional changes, just a lot of new FIXMEs.
2023-03-13 15:16:20 +00:00
Timothy Flynn 1d5b45f7d9 AK: Compute UTF-8 code point lengths using only leading bytes
We don't need to decode the entire code point to know its length. This
reduces the runtime of decoding a string containing 5 million instances
of U+10FFFF from over 4 seconds to 0.9 seconds.
2023-03-13 15:16:02 +00:00
Lucas CHOLLET 516d2f4892 image: Add an argument to choose to write PPMs in binary or in ASCII 2023-03-13 15:15:41 +00:00
Lucas CHOLLET 13d1721852 image: Support writing to PPM files 2023-03-13 15:15:41 +00:00
Lucas CHOLLET 9c9bd271c8 LibGfx/PortableFormat: Add PortableFormatWriter
Currently, the encoder only output ppm files, but it can easily be
extended to support both PBM and PGM.
2023-03-13 15:15:41 +00:00
Andrew Kaster e32267c902 Documentation: Add query-driver to clangd arguments in NvimConfiguration 2023-03-13 08:00:09 -06:00
Andrew Kaster ad5db213ca Documentation: Update VS Code docs for tone, add query-driver directions 2023-03-13 08:00:09 -06:00
kleines Filmröllchen e20038a04b LibAudio+Piano: Correct header style 2023-03-13 13:59:41 +00:00
Fabian Dellwing 7448db9940 Ports: Add lrzip port 2023-03-13 13:53:58 +01:00
Timothy Flynn 50cef4708c Ladybird: Remove the mode to dump the layout tree
This use case is now handled by headless-browser.
2023-03-13 12:41:10 +00:00
Timothy Flynn 127d2e2098 LibWeb: Run LibWeb layout tests using headless-browser 2023-03-13 12:41:10 +00:00
Timothy Flynn 7090f74524 headless-browser: Add a mode to dump the layout tree after load finish 2023-03-13 12:41:10 +00:00
Timothy Flynn 2845a8e139 headless-browser: Support loading local file:// URLs 2023-03-13 12:41:10 +00:00
Timothy Flynn 31bdd8a918 headless-browser: Massage URLs a bit before loading
This is to mimic what Ladybird and Browser do before trying to load the
URL.
2023-03-13 12:41:10 +00:00
kleines Filmröllchen 4420e48dc3 LibAudio: Use symbolic constants for MP3 frame and granule size 2023-03-13 13:25:42 +01:00