Commit graph

48050 commits

Author SHA1 Message Date
Timothy Flynn
c11860bdcd Meta: Download pci.ids and usb.ids to Build/caches
This ensures we only need to download these files once for all build
configurations. We similarly download the UCD, CLDR, and TZDB to this
cache directory as well.
2023-03-15 11:26:34 +01:00
Pankaj Raghav
6ff85aa19a Kernel/Ramdisk: Propagate error during Ramdisk initialize
Use the same pattern for Ramdisk similar to other storage devices during
device initialization. This will propagate errors if the Ramdisk fails
to initialize.
2023-03-15 11:25:59 +01:00
Pankaj Raghav
b204da94b0 Kernel/Storage: Use NonnullRefPtr for storage controllers
Storage controllers are initialized during init and are never modified.
NonnullRefPtr can be safely used instead of the NonnullLockRefPtr. This
also fixes one of the UB issue that was there when using an NVMe device
because of NonnullLockRefPtr.

We can add proper locking when we need to modify the storage controllers
after init.
2023-03-15 11:25:59 +01:00
Seal Sealy
0dbca4af06 Ports: Add taskwarrior port 2023-03-15 07:59:51 +00:00
implicitfield
ba8bd2e558 LibGUI: Do not attempt to close non-existent notifications 2023-03-15 07:52:08 +00:00
Matthew Olsson
0c7eac8d9a Lagom: Remove debug line in LibJSGCVerifier 2023-03-15 08:48:49 +01:00
Matthew Olsson
b5f01bd212 Spreadsheet: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
Matthew Olsson
7c0c1c8f49 LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
Matthew Olsson
1df3652e27 LibJS: Allow constructing a Handle<T> from a {Nonnull,}GCPtr<T> 2023-03-15 08:48:49 +01:00
Matthew Olsson
5094dcf615 LibJS: Allow constructing a GCPtr from another GCPtr of convertible type 2023-03-15 08:48:49 +01:00
Matthew Olsson
93a5a54927 LibJS: Allow GCPtr and NonnullGCPtr to be hashed 2023-03-15 08:48:49 +01:00
gustrb
5141c86587 AK: Rename CaseInsensitiveStringViewTraits to reflect intent
Now it is called `CaseInsensitiveASCIIStringViewTraits`, so we can be
more specific about what data structure does it operate onto. ;)
2023-03-14 21:34:32 +00:00
Seal Sealy
8ba6cd6ab9 Ports: Add bzip3 port 2023-03-14 21:41:46 +01:00
Timothy Flynn
9c569e8a0f LibWeb: Implement the [PutForwards] IDL extended attribute
For example, consider the attribute:

    interface Element {
        [PutForwards=value] readonly attribute DOMTokenList classList;
    }

When `classList` is set, we should instead set the attribute `value` on
the `classList` attribute of the Element interface.
2023-03-14 16:30:19 -04:00
Mathis Wiehl
3bd1d8bf6c LibWeb: Invalidate styles on font load
It is not sufficient to just invalidate layout when a new font has
loaded, because while it was loading we might have chosen a fallback
font-family value instead.

Invalidate style instead.
2023-03-14 21:07:44 +01:00
Andreas Kling
50f9a86086 LibWeb/Tests: Remove image from a test
The image made the test flaky when running on my machine, so this
doesn't seem safe at the moment. We can just hardcode the dimensions.

Eventually we should make it possible to use external images in tests,
but for now let's not flake up the CI.
2023-03-14 18:49:37 +01:00
Andreas Kling
c598c092c2 LibWeb: Actually instantiate ::before/::after pseudo elements when found
Regressed in 3e970540b4.

Thanks to Luke for noticing the issue on YouTube! :^)
2023-03-14 18:47:20 +01:00
Timothy Flynn
e6dc3c291e LibWeb: Prevent variadic arguments from reserving heaps of memory
Don't try to reserve capacity for a variadic arguments list unless we
actually have enough arguments to fill it with anything. Otherwise we
may overflow to an extremely large size if, e.g., the argument count
is 0 and the start of the variadic arguments is index 1.
2023-03-14 16:41:35 +00:00
Andreas Kling
3e970540b4 LibWeb: Don't compute full style for ::before/::after unless matched
Before this patch, we would build full computed style for these pseudo
elements, for every DOM element, even if no ::before/::after selector
actually matched.

This was a colossal waste of time, and we can also just not do that.
Instead, just abort pseudo element style resolution early if no relevant
selectors matched. :^)
2023-03-14 16:53:03 +01:00
Andreas Kling
a58d84407f WebContent: Coalesce multiple sequential MouseMove events
This can avoid getting into a situation where lots of MouseMove events
are queued up and they all trigger relayout (or something else that
takes a lot of time).

To make sure that we don't get out of sync with the input events queue
on the UI process side, we still send acknowledgements for coalesced
MouseMoves. There's room for improvement here.

My Discord friends list is now pleasantly responsive. :^)
2023-03-14 16:52:44 +01:00
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