Commit graph

50165 commits

Author SHA1 Message Date
Tim Ledbetter
c09d0c4816 LibManual: Allow querying on a help URL
This allows Help and man to open pages from a help URL specified on
the command line.
2023-05-08 21:03:19 -06:00
Tim Ledbetter
6ab13489ee LibManual: Ensure page exists when opening a help URL
Previously, Help could crash when attempting to open a help URL for a
page that doesn't exist.
2023-05-08 21:03:19 -06:00
Timothy Flynn
d6b786b3fe AK: Use consteval String factories on macOS
Xcode 14.3 ships with clang 15, which supports our usage of consteval to
validate short strings at compile time.
2023-05-08 20:54:31 -06:00
Timothy Flynn
872e18f660 LibWeb: Convert Navigable::navigate's csp_navigation_type to an enum
Some versions of clang will have an issue using a consteval function to
set the optional parameter's default value. For example, see:
https://stackoverflow.com/questions/68789984/immediate-function-as-default-function-argument-initializer-in-clang

This doesn't need to be a String anyways, so let's make it an enum.
2023-05-08 20:54:31 -06:00
martinfalisse
f7c27556fa Documentation: Homogenize Ladybird build instructions
Change the file name so that it is similar to the other build
instructions and may be easier to find :^).
2023-05-08 20:53:25 -06:00
Lucas CHOLLET
844e374de1 LibGfx/JPEG: Fix faded 4-channels images 2023-05-08 19:28:51 +02:00
Lucas CHOLLET
e81baa0464 LibGfx/JPEG: Discard the correct number of bytes
This path has never been tested as it requires a non-standard APP
segment. We (un?)fortunately found one, and it exposed a silly bug.
2023-05-08 19:26:17 +02:00
Aliaksandr Kalenik
5896f4c400 LibWeb: Implement "populate session history entry" step in navigate()
Implements
https://html.spec.whatwg.org/multipage/browsing-the-web.html#finalize-a-cross-document-navigation
2023-05-08 17:53:59 +02:00
Aliaksandr Kalenik
0444df1a7c LibWeb: Implement "clear the forward session history" for traversable
https://html.spec.whatwg.org/multipage/browsing-the-web.html#clear-the-forward-session-history
2023-05-08 17:53:59 +02:00
Andreas Kling
1ebae7a779 LibWeb: Stop changing width of block-level flex containers during layout
If the parent BFC can come up with a nice stretch-fit width for the flex
container, it will have already done so *before* even entering flex
layout. There's no need to do it again, midway through the flex layout
algorithm.

This wasn't just unnecessary, but we were also doing it incorrectly and
not taking margins into account when calculating the amount of available
space for stretch-fit. This led to oversized flex containers in the
presence of negative margins.

Fixes #18614
2023-05-08 15:56:00 +02:00
Aliaksandr Kalenik
771208d2e2 LibWeb: Fix auto height calculation for table inside BFC
`calculate_max_content_height` expects the available width as the
second argument. However, the available height was mistakenly passed
before. This did not seem to cause any problems because TFC currently
does not respect height sizing constraints but still needs to be fixed.
2023-05-08 14:52:48 +02:00
martinfalisse
ea61296738 LibWeb: Use layout-test-mode for layout tests
Also do some test changes to test it out :^)
2023-05-08 14:47:52 +02:00
martinfalisse
c719a542c5 LibWeb: Add --layout-test-mode flag to HeadlessBrowser
The `layout-test-mode` flag changes the font to be SerenitySans as this
is the font used for layout tests for cross-platform compatibility of
tests.
2023-05-08 14:47:52 +02:00
martinfalisse
af26b76e0a LibWebView: Use Vector for arguments to WebContent
In a future commit will add some more conditional arguments to the
array and so it's easier to have it be a Vector.
2023-05-08 14:47:52 +02:00
martinfalisse
00e446facd Ladybird: Move arguments parsing before FontPluginQt init
In a future commit will pass arguments parsed to the FontPluginQt
constructor.
2023-05-08 14:47:52 +02:00
Nico Weber
65c7145e69 LibGfx/WebP: Move lossless decoder to its own file
Pure code move (except of removing `static` on the two public functions
in the new header), not behavior change.
2023-05-08 12:52:05 +02:00
Nico Weber
4f1c9a4ba2 LibGfx/WebP: Let decode_webp_chunk_VP8L_header() take ReadonlyBytes
Both callers already have the assert, and that way the function
doesn't have to know about Chunk.
2023-05-08 12:52:05 +02:00
Nico Weber
9d4da5af43 LibGfx/WebP: Store pointer to lossless data in VP8LHeader struct
This way, the size of the header in bytes is only known in
decode_webp_chunk_VP8L_header().
2023-05-08 12:52:05 +02:00
Nico Weber
5252f1cd60 LibGfx/WebP: Stop storing vp8_header and vp8l_header in context
They're not needed on the context.
2023-05-08 12:52:05 +02:00
Nico Weber
135b029250 LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_contents()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
97d085abea LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_image()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
356cadc350 LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_prefix_code
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
2f1f62cb3b LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_header()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Andreas Kling
3f4de06fc2 LibWeb: Cache the root element font metrics when calculating them
The root element font metrics were getting queried again and again
during style computation. Before this change we would do some work to
recalculate them each time.

This patch simply caches them in a StyleComputer member. Since style
updates always start with the root element, we know that it'll be
up-to-date by the time we look at any other element.

Before this change, we were spending ~5% of CPU time on Google Groups
in root_element_font_metrics().
2023-05-08 12:13:20 +02:00
Ahmed Hussein
214eaebe73 LibGUI: Use cursor position when calculating autoscroll delta
Autoscroll delta now takes into account the cursor
position relative to the widget inner rect height
to allow for faster rubber band autoscrolling.
2023-05-08 11:28:52 +02:00
Andreas Kling
064b7a6216 LibWeb: Make HTMLObjectElement invalidate the document layout
This is an oversized hammer for sure, but we have to make sure the
layout tree gets rebuilt in case the object representation changes.
Since "throw out the entire layout tree" is the finest tool we have
right now, it'll have to do.

This fixes an issue where the eyes on Acid2 would sometimes not show up
until the next layout invalidation occurred.
2023-05-08 10:26:09 +02:00
Kenneth Myhra
11a89a9d6e Documentation: Add libslirp-dev as a required dependency for QEMU
After the update to QEMU 8.0 libslirp-dev is a required dependency.
2023-05-08 09:30:09 +02:00
Andreas Kling
70db40c9b0 LibWeb: Don't include Layout/Node.h from DOM/Element.h
This required moving the CSS::StyleProperty destruct out of line.
2023-05-08 09:29:44 +02:00
Andreas Kling
e43027091d LibWeb: Don't include HTML/Window.h from DOM/Element.h
This required moving HTML::ScrollOptions to its own header file.
2023-05-08 09:29:44 +02:00
Andreas Kling
ac0c30ce62 LibWeb: Don't include WindowGlobalMixin from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
67d2e32984 LibWeb: Don't include DOM/NamedNodeMap.h from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
f7678e2797 LibWeb: Don't include Layout/TreeBuilder.h from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
4399ca2d82 LibWeb: Don't include CSS/CSSStyleDeclaration.h from DOM/Element.h
This required splitting out CSS::StyleProperty into its own file and
out-of-lining Element::layout_node().
2023-05-08 09:29:44 +02:00
Andreas Kling
5b5fbecb38 LibWeb: Don't include DOM/Attr.h from DOM/Element.h
This required moving Element::for_each_attribute() out of line, but that
seems harmless enough.
2023-05-08 09:29:44 +02:00
Andreas Kling
43616316de LibWeb: Don't include CSS/StyleComputer.h from Element.h and Document.h
This made editing StyleComputer.h unpleasant for no reason.
2023-05-08 09:29:44 +02:00
Kemal Zebari
5ba5beb50f Tests: Add more tests for JsonArray
At an attempt to detect future regressions in AK/JsonArray, this
snapshot adds additional tests for it to TestJSON.cpp.
2023-05-08 07:39:49 +01:00
Kenneth Myhra
03ca560b2d Ports: Update dosbox-staging to 0.77.1
This version of 'dosbox-staging' uses the meson build system.

Previous versions of dosbox-staging started in windowed mode with a
resolution of 320x200. This version starts in windowed mode with a
resolution of 640x480.

Audio was stuttering a bit in previous versions, but it sounds like it
might have become a bit worse. This is probably because of higher CPU
usage and the audio server/client not able to keep up.

Added a post_install() section to package script which outputs a link to
dosbox-staging's release notes.
2023-05-08 08:03:31 +02:00
Kenneth Myhra
9541f23376 Ports: Clean up 'package.sh' for dosbox-staging
This makes dosbox-staging's 'package.sh' conform to our coding standards
for bash scripts.
2023-05-08 08:03:31 +02:00
Kenneth Myhra
4eaac2ff1e Ports: Add opusfile 0.12 2023-05-08 08:03:31 +02:00
Kenneth Myhra
748289211a Ports: Add libopus 1.3.1 2023-05-08 08:03:31 +02:00
Ben Wiederhake
ac5cef1b66 LibCrypto+LibTLS: Avoid crashing on invalid input
Fixes #18307.
2023-05-08 06:43:28 +02:00
Andreas Kling
f37f081f15 LibWeb: Don't relayout when visibility changes between visible/hidden
Layout will be identical for both of those values, so only a repaint is
necessary. If it changes to/from "collapse" however, we do need to
relayout. This means we can't simply use the "affects-layout" mechanism.
We have to write a little bit of custom code.

This makes Google Groups (and surely many other sites) significantly
more responsive by avoiding large amounts of layout work.
2023-05-08 06:42:17 +02:00
Pankaj Raghav
53d47c6614 Documentation: Update information regarding MSIx for NVMe :^)
Now we support MSIx for NVMe. Retain the information about using
nvme_poll until MSIx is tested on a Bare metal system.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
9b3b0531e5 Kernel: Add MSIx support to NVMe
Add MSIx support to NVMe. Prefer MSIx over pin-based interrupts as they
are more efficient and all modern hardware support them.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
bfcf7ab3e8 Kernel: Pass NVMeController reference to NVMequeue
This is in preparation for adding MSI(x) support to the NVMe device.
NVMeInterruptQueue needs access to the PCI device to deal with MSI(x)
interrupts. It is ok to pass the NVMeController as a reference to the
NVMeQueue as NVMeController is the one that owns the NVMeQueue.

This is very similar to how AHCIController passes its reference to its
interrupt handler.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
693e3419b7 NVMe: Use an explicit Queue type instead of using an Optional irq
Add an explicit QueueType enum which could be used to create a poll or
an interrupt queue. This is better than passing an Optional<irq>.

This refactoring is in preparation for adding MSIx support to NVMe.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
feb48cbc7c Kernel: Introduce PCIIRQHandler
PCIIRQHandler is a generic IRQ handler that the device driver can
inherit to use either Pin or MSI(x) based interrupt mechanism.

The PCIIRQHandler can do what the existing IRQHandler can do for pin
based interrupts but also deal with MSI based interrupts. We can
hopefully convert all the PCI based devices to use this handler so that
MSI(x) can be used.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
82cf0bfb75 Kernel: Add APIs to PCI Device to use MSI(x)
Add reserve_irqs, allocate_irq, enable_interrupt and disable_interrupt
API to a PCI device.

reserve_irqs() can be used by a device driver that would like to
reserve irqs for MSI(x) interrupts. The API returns the type of IRQ
that was reserved by the PCI device. If the PCI device does not support
MSI(x), then it is a noop.

allocate_irq() API can be used to allocate an IRQ at an index. For
MSIx the driver needs to map the vector table into the memory and add
the corresponding IRQ at the given index. This API will return the
actual IRQ that was used so that the driver can use it create interrupt
handler for that IRQ.

{enable, disable}_interrupt API is used to enable or disable a
particular IRQ at the given index. It is a noop for pin-based
interrupts. This could be used by IRQHandler to enable or disable an
interrupt.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
f0b6eb6932 Kernel: Implement helpers to manipulate MSI(x) data structures
MSIx table entry is used to program interrupt vectors and it is
architecture specific. Add helper functions declaration in
Arch/PCIMSI.h. The definition of the function is placed in the
respective arch specific code.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
bf7ac06d7b Kernel: Implement {enable,disable}_msix interrupts in PCI Device
Implement enabling and disabling MSIx interrupts for a PCI device.

Removes two TODO()s from PCI::Device.cpp :^)
2023-05-07 21:16:41 +02:00