Commit graph

48896 commits

Author SHA1 Message Date
Ali Mohammad Pur c7409af627 LibHTTP: Tolerate extra \r\n in chunked-encoding last block size
Some servers put CR/LF there, so let's tolerate that behaviour.
Fixes #18151.
2023-04-02 20:42:39 +02:00
martinfalisse 289285cd6e LibWeb: Add borders functionality to CSS Grid 2023-04-02 19:08:04 +02:00
martinfalisse 6f52272d34 LibWeb: Fix regression in definite grid row heights
Fixes a row height bug when a grid item in a row has a definite height.
2023-04-02 19:08:04 +02:00
martinfalisse e65f4b3dc5 LibWeb: Rename PositionedBox to GridItem
This seems like a more accurate description of what this class really
is, and easier to understand in my opinion.
2023-04-02 19:08:04 +02:00
Idan Horowitz 8da31764b9 Meta: Enable asm-view symbol demangling in the gdb kernel debug script
This makes sure that symbol names are demangled in the assembly view.
2023-04-02 20:05:17 +03:00
Idan Horowitz b8437a03e7 Meta: Update AArch64 kernel base address in the gdb kernel debug script
The correct value for now is 0, since the AArch64 linker script uses
a hard-coded memory layout, so the offset is already automatically
applied.
2023-04-02 20:05:17 +03:00
Andreas Kling 8bb0be7d4f LibWeb: Don't apply presentational hints to associated pseudo elements
CSS properties generated by presentational hints in content attributes
should not leak into pseudo elements.
2023-04-02 15:00:06 +02:00
Andreas Kling 620a34a463 LibWeb: Don't apply element inline style to associated pseudo elements
An element's inline style, if present, should not leak into any pseudo
elements generated by that element.
2023-04-02 15:00:06 +02:00
Timothy Flynn eed956b473 AK: Increase LittleEndianOutputBitStream's buffer size and remove loops
This is very similar to the LittleEndianInputBitStream bit buffer change
from 8e834d4bb2.

We currently buffer one byte of data for the underlying stream. And when
we put bits onto that buffer, we do so 1 bit at a time.

This replaces the u8 buffer with a u64. And instead of looping at all,
we perform bitwise operations to write the desired number of bits.

Using the "enwik8" file as a test (100MB uncompressed, commonly used in
benchmarks: https://www.mattmahoney.net/dc/enwik8.zip), compression time
decreases from:

    13.62s to 10.9s on Serenity (cold)
    13.62s to 9.22s on Serenity (warm)
    2.93s to 2.32s on Linux

One caveat is that this requires explicitly flushing any leftover bits
when the caller is done with the stream. The byte buffer implementation
implicitly flushed its data every time the buffer was byte-aligned, as
doing so would always fill the byte. This is no longer the case. But for
now, this should be fine as the one user of this class, DEFLATE, already
has a "flush everything now that we're done" finalizer.
2023-04-02 10:54:37 +02:00
Andrew Kaster d74fa5e283 Toolchain: Allow many patches for gdb and add clang workaround
This ports https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae61525fcf456ab395d55c45492a106d1275873a
from upstream binutils, which enables building with the newest host
clang versions.
2023-04-02 10:52:28 +02:00
Andrew Kaster af01203733 Toolchain: Update gdb to version 13.1 2023-04-02 10:52:28 +02:00
Tim Schumacher 57516c3a9e Toolchain: Create an nm symlink for Clang
This is required for building the QEMU port using Clang.
2023-04-02 00:05:03 -06:00
Andreas Kling 9cded6e1b5 LibWeb: Fix application of intrinsic aspect ratio to flex column items
The intrinsic aspect ratio of a box is a width:height ratio, so if we
have the width and need the height, we should divide, not multiply. :^)
2023-04-02 06:45:44 +02:00
Andreas Kling 2413de7e10 LibWeb: Make HTMLImageElement loads delay the document load event
This is something we're supposed to do according to the HTML spec.
Note that image loading is currently completely ad-hoc, and this just
adds a simple DocumentLoadEventDelayer to the existing implementation.

This will allow us to use images in layout tests, which rely on the
document load event firing at a predictable time.
2023-04-02 06:45:44 +02:00
Linus Groh 3709d11212 LibJS: Parse secondary expressions with the original forbidden token set
Instead of passing the continuously merged initial forbidden token set
(with the new additional forbidden tokens from each parsed secondary
expression) to the next call of parse_secondary_expression(), keep a
copy of the original set and use it as the base for parsing the next
secondary expression.

This bug prevented us from properly parsing the following expression:

```js
0 ?? 0 ? 0 : 0 || 0
```

...due to LogicalExpression with LogicalOp::NullishCoalescing returning
both DoubleAmpersand and DoublePipe in its forbidden token set.

The following correct AST is now generated:

Program
  (Children)
    ExpressionStatement
      ConditionalExpression
        (Test)
          LogicalExpression
            NumericLiteral 0
            ??
            NumericLiteral 0
        (Consequent)
          NumericLiteral 0
        (Alternate)
          LogicalExpression
            NumericLiteral 0
            ||
            NumericLiteral 0

An alternate solution I explored was only merging the original forbidden
token set with the one of the last parsed secondary expression which is
then passed to match_secondary_expression(); however that led to an
incorrect AST (note the alternate expression):

Program
  (Children)
    ExpressionStatement
      LogicalExpression
        ConditionalExpression
          (Test)
            LogicalExpression
              NumericLiteral 0
              ??
              NumericLiteral 0
          (Consequent)
            NumericLiteral 0
          (Alternate)
            NumericLiteral 0
        ||
        NumericLiteral 0

Truth be told, I don't know enough about the inner workings of the
parser to fully explain the difference. AFAICT this patch has no
unintended side effects in its current form though.

Fixes #18087.
2023-04-02 06:45:37 +02:00
Nico Weber 85d0637058 LibCompress: Make CanonicalCode::from_bytes() return ErrorOr<>
No intended behavior change.
2023-04-02 06:19:46 +02:00
Matthew Olsson 36ca1386e8 LibWeb: Add ReadableStream.locked/cancel()/getReader() 2023-04-01 23:43:07 +01:00
Matthew Olsson d8710aa604 LibWeb: Implement ReadableStream's constructor 2023-04-01 23:43:07 +01:00
Matthew Olsson 66dec1bf54 LibWeb: Add UnderlyingSource struct for ReadableStream constructor 2023-04-01 23:43:07 +01:00
Matthew Olsson bc9919178e LibWeb: Add ReadableStreamDefaultController 2023-04-01 23:43:07 +01:00
Matthew Olsson f99d6e177f IDLGenerators: Support nullable double values 2023-04-01 23:43:07 +01:00
Matthew Olsson 222e3c32cd LibWeb: Add ReadableStreamDefaultReader 2023-04-01 23:43:07 +01:00
Matthew Olsson 7ff657ef57 LibWeb: Add the stream queue-related abstract operations 2023-04-01 23:43:07 +01:00
Matthew Olsson fe69d66a4e LibWeb: Add the ReadableStreamGenericReader mixin interface 2023-04-01 23:43:07 +01:00
MacDue f409f68a9a LibWeb: Use scaled font when painting list item markers
This now uses the current font (rather than the painter's default)
and scales it correctly. This is not perfect though as just naviely
doing .draw_text() here does not follow the proper text layout logic
so this is misaligned (by a pixel or two) with the text in the <li>.
2023-04-01 22:39:47 +01:00
MacDue 14f937b292 LibWeb: Use scaled font when painting text shadows
This fixes painting text shadows at non-100% zoom.
2023-04-01 22:39:47 +01:00
MacDue 7061a3d8e6 LibWeb: Add .scaled_font() helper to Layout::Node
This returns the font scaled for the current zoom level.
2023-04-01 22:39:47 +01:00
Eli Youngs f3c450559f Base: Document the -f option for grep 2023-04-01 13:49:47 -06:00
Eli Youngs 9bc45c0ae8 grep: Read patterns from a file with -f 2023-04-01 13:49:47 -06:00
martinfalisse 57cdb0c972 LibWeb: Add display grid automated tests 2023-04-01 21:45:29 +02:00
martinfalisse 7028f75779 Tests: Use layout tests placed in subdirectories
Allows organizing layout tests into subdirectories.
2023-04-01 21:45:29 +02:00
Timothy Flynn 593a4a4232 Meta: Install PCI and USB ID files directly into /res
The install() command used by 1e36d54493
installs the provided file into the *directory* named by the DESTINATION
parameter. So if we ask it to install pci.ids to /res/pci.ids, the final
destination will be /res/pci.ids/pci.ids.
2023-04-01 08:48:28 -04:00
Tim Schumacher ad31265e60 LibCompress: Implement block size validation for XZ streams 2023-04-01 13:57:54 +02:00
Tim Schumacher 20f1a29202 LibCompress: Factor out the list of XZ check sizes 2023-04-01 13:57:54 +02:00
Tim Schumacher b451964bbc Tests: Document input of the xz_utils_good_1_block_header_1 test case 2023-04-01 13:57:54 +02:00
Nico Weber bc70d7bb77 LibCompress: Reduce indentation in CompressedBlock::try_read_more()
...by removing `else` after `return`.

No behavior change.
2023-04-01 13:57:39 +02:00
Andreas Kling bc6e61adec LibWeb: Don't churn HTML::EventLoop while in microtask checkpoint
At the end of HTML::EventLoop::process(), the loop reschedules itself if
there are more runnable tasks available.

However, the condition was flawed: we would reschedule if there were any
microtasks queued, but those tasks will not be processed if we're
currently within the scope of a microtask checkpoint.

To fix this, we now only reschedule the HTML event loop for microtask
processing *if* we're not already in a microtask checkpoint.

This fixes the 100% CPU churn seen when looking at PRs on GitHub. :^)
2023-04-01 12:45:47 +01:00
Tim Ledbetter a5b9fb28c2 Base: Remove trailing colons from man page headings
Most man pages don't have these, so removing them where they do exist
makes things more consistent.
2023-04-01 11:49:57 +01:00
Tim Ledbetter 8f253a745e Base: Update man pages for utilities
Man pages for utilities now more closely resemble ArgsParser output
2023-04-01 11:49:57 +01:00
Tim Ledbetter 37bbd20cee LibCore: Remove colons from markdown header names in ArgsParser
This makes formatting more consistent across man pages.
2023-04-01 11:49:57 +01:00
Timothy Flynn da6f32e5d8 gzip: Use utilities from LibCompress to (de)compress files 2023-04-01 08:15:49 +02:00
Timothy Flynn 7ec91dfde7 LibCompress: Add a utility to GZIP compress an entire file
This is copy-pasted from the gzip utility, along with its existing TODO.
This is currently only needed by that utility, but this gives us API
symmetry with GzipDecompressor, and helps ensure we won't end up in a
situation where only one utility receives optimizations that should be
received by all interested parties.
2023-04-01 08:15:49 +02:00
Timothy Flynn 857f559a06 gunzip+LibCompress: Move utility to decompress files to GzipDecompressor
This is to allow re-using this method (and any optimization it receives)
by other utilities, like gzip.
2023-04-01 08:15:49 +02:00
MacDue df577b457a Browser: Add tooltip to reset zoom level button 2023-03-31 21:46:56 +01:00
MacDue 7f3844c048 Ladybird: Add tooltip to reset zoom level button 2023-03-31 21:46:56 +01:00
sbcohen2000 9e21b3f216 KeyboardSettings: Add checkbox to enable Caps Lock mapping to Ctrl
This patch adds an additional control to KeyboardSettings allowing
the user to map Caps Lock to Ctrl. Previously, this was only possible
by writing to /sys/kernel/variables/caps_lock_to_ctrl.

Writing to /sys/kernel/variables/caps_lock_to_ctrl requires root
privileges, but KeyboardSettings will not attempt to elevate
the privilege of the user if they are not root. Instead, the
checkbox is rendered as un-editable.
2023-03-31 12:45:21 -04:00
Liav A 07b83cf3fa Kernel/HID: Don't update the remapped Ctrl modifier unconditionally
Instead, only update it when the Caps Lock key event is generated and
remapping to the Ctrl key is enabled.

This fixes a bug that when enabling remapping Caps Lock key to the Ctrl
key, the original Ctrl key is no longer usable.
2023-03-31 12:45:12 -04:00
Nico Weber c3b8b3124c LibCompress: Remove two needless heap allocations 2023-03-31 08:44:30 -06:00
Sam Atkins 88d64fcb55 LibWeb: Add HTMLAnchorElement.referrerPolicy property 2023-03-31 11:36:41 +01:00
Sam Atkins 0c19d3aa58 LibWeb: Add HTMLAnchorElement.text getter and setter
And a FIXME for the missing `referrerPolicy` property.
2023-03-31 11:36:41 +01:00