Commit graph

51084 commits

Author SHA1 Message Date
stelar7
e72b7c5de2 LibWeb: Serialize Time according to spec 2023-05-31 05:56:25 +02:00
Simon Wanner
b5ba479d65 LibWeb: Render svg-as-image with 1:1 scaling factor
We're passing the SVGDecodedImageData a size in device pixels, so it's
incorrect to apply the host page's device_pixels_per_css_pixels on top
of that.
2023-05-30 21:28:18 +02:00
Simon Wanner
29088f58ed LibWeb/Tests: Add missing newline in inset-shorthand-property.txt 2023-05-30 21:28:18 +02:00
Aliaksandr Kalenik
393068afba WebContent: Wait for Resource to load in wait_for_navigation_to_complete
Fixes wait_for_navigation_to_complete() so it actually waits for
ongoing page loading request in FrameLoader to complete.
2023-05-30 20:40:23 +02:00
Aliaksandr Kalenik
31b9729333 LibWeb: Add Page::has_ongoing_navigation()
Introduce has_ongoing_navigation() that allows to check if resource
state in FrameLoading is pending. This API is going to be used in
upcoming fix for wait_for_navigation_to_complete() in WebDriver.
2023-05-30 20:40:23 +02:00
Nico Weber
d1d9d7a4f3 WebP/Lossy: Use correct test image for coefficient skipping
I somehow added the wrong image here. 4.webp is the one described
by the comment in the test. Now test actually uses the image it
claims to use.

No behavior change.
2023-05-30 18:56:03 +02:00
Aliaksandr Kalenik
857ceb215c LibWeb/WebDriver: Support resolve with callback in execute_async_script
Before execute_async_script supported returning value from script to
/execute/async caller only if script returns promise that resolves into
returned value. This change fixes execute_async_script to also support
returning value to caller using callback that is always passed to
script as a last argument.
2023-05-30 18:55:47 +02:00
Fabian Dellwing
33815d550b Meta: Update cacert.pem 2023-05-30 13:05:19 +02:00
Ali Mohammad Pur
0e3fb39a0a LibWeb: Make 'optional BufferSource' IDL arguments actually optional
Previously this was compiled to require an object despite the IDL file
specifying 'optional'.
This commit makes IDLGenerator respect this modifier, and fixes the only
affected instance.
2023-05-30 12:50:13 +02:00
Daniel Bertalan
540ea9f1c4 CI: Do not expect test-results.log to exist on AArch64
The AArch64 port is still unstable, and in some cases, we may encounter
a kernel panic or Shell crash that prevents `test-results.log` from
being written to disk. The CI job would fail when we tried to print out
the contents of this non-existent file. We have been ignoring its
contents anyway, so let's not read it at all.
2023-05-30 11:44:57 +02:00
Andi Gallo
7f9ede07bc LibWeb: Set margin, padding and border for replaced boxes
Separating the paths for replaced and non-replaced floating boxes lost
the logic for margin, padding and border which was done by
compute_width_for_floating_box. Set them the same way as we do for
block-level replaced elements, per the specification.
2023-05-30 10:09:47 +02:00
Andi Gallo
e48074e401 LibWeb: Make font selection closer to specification
Add matching on family name, style and weight. This improves the fonts
used by the MDN examples.
2023-05-30 07:47:57 +02:00
stelar7
518679b0dd LibWeb: Adjust change event timing for input elements 2023-05-30 06:17:36 +02:00
Shannon Booth
06593a81da LibJS: Align MathObject::atan closer to spec
This is not an observable difference. Nonetheless, it seems like a good
idea to be as close to the spec as possible, so let's do that.
2023-05-30 06:16:20 +02:00
Shannon Booth
979973ca0e LibJS: Add spec comments to MathObject::atan 2023-05-30 06:16:20 +02:00
Nico Weber
b7e31ba194 WebP/Lossy: Add test for lossy webp with uncompressed alpha
The alpha channel of a lossy webp is always stored separately from
the (lossy) RGB data. Alpha is either compressed in a lossless webp
that stores just the alpha data, or it's stored completely
uncompressed. (But again, even if it's compressed, it's losslessly
compressed.)

This adds a test for uncompressed alpha, which I hadn't tested before.
It seems to work correctly, though :^)

I generated the test image by running:

    ~/Downloads/libwebp-1.3.0-mac-arm64/bin/cwebp \
      -alpha_method 0 \
      Tests/LibGfx/test-inputs/extended-lossless.webp \
      -o Tests/LibGfx/test-inputs/extended-lossy-uncompressed-alpha.webp
2023-05-30 06:14:56 +02:00
Nico Weber
a22cbc9a28 WebP/Lossy: Add an additional test case
This image covers two things that aren't covered by the existing
tests, and I found it useful for testing locally. The image's license
allows redistributing it, so add it as a test case.
2023-05-30 06:14:56 +02:00
Nico Weber
f3beff0930 WebP/Lossy: Tweak some comments 2023-05-30 06:14:56 +02:00
Nico Weber
74b50c046b WebP/Lossy: Check that file contains enough data for first partition 2023-05-30 06:14:56 +02:00
FalseHonesty
cabfb7867c LibWeb: Add support for parsing 'inset' shorthand CSS property 2023-05-30 06:02:06 +02:00
Timothy Flynn
e129c8049b LibWeb: Restore protection against empty HTMLImageElement resources
This if-statement was erroneously dropped in commit 8ff8309.
2023-05-30 05:50:07 +02:00
Ben Wiederhake
365b2bf945 Shell: Prefer File and FileSystem over DeprecatedFile 2023-05-30 00:21:59 +02:00
Ben Wiederhake
0c86ee3876 Shell: Rewrite Shell::possibly_print_error without deprecated API
Also, not allocating copies of the current string all the time should be
a tiny bit more efficient. We can do this because the 'current_line' is
only used while reporting the error, so it will not be used once we
begin reading the next line.
2023-05-30 00:21:59 +02:00
Ben Wiederhake
8df8f4d75a Shell: Rewrite Shell::runnable_path_for without deprecated API
Also, not allocating a vector for the parts should be a tiny bit more
efficient.
2023-05-30 00:21:59 +02:00
Aliaksandr Kalenik
0bef3085dd LibWeb: Output names of inner table boxes in layout dump
Since there are no table-specific boxes anymore it would be nice to
output their types additionally in layout dump so we can tell table
boxes from "regular" boxes.
2023-05-29 21:36:17 +02:00
Aliaksandr Kalenik
787f2d2a10 LibWeb: Remove Layout::TableCellBox
Special box types for inner table boxes might conflict with special
types for <button>, <input> or <label>.
2023-05-29 21:36:17 +02:00
Aliaksandr Kalenik
3a3a085404 LibWeb: Remove Layout::TableRowBox
Special box types for inner table boxes might conflict with special
types for <button>, <input> or <label>.
2023-05-29 21:36:17 +02:00
Aliaksandr Kalenik
578a937f94 LibWeb: Remove Layout::TableRowGroupBox
Special box types for inner table boxes might conflict with special
types for <button>, <input> or <label>.
2023-05-29 21:36:17 +02:00
Andreas Kling
af004ff0ef LibWeb: Support min-content for width, min-width and max-width
We're gonna need to handle this in many more places, this patch only
adds it to calculate_inner_width().
2023-05-29 21:29:25 +02:00
Andreas Kling
97c510329c LibWeb: Support max-content for width, min-width and max-width
We're gonna need to handle this in many more places, this patch only
adds it to calculate_inner_width().
2023-05-29 21:29:25 +02:00
Nico Weber
358d94b57a WebP/Lossy: Add some basic tests 2023-05-29 19:44:45 +02:00
Nico Weber
f8e4a0a268 WebP/Lossy: Implement prediction and inverse DCT
This could be a bit prettier, but it works :^)
2023-05-29 19:44:45 +02:00
Nico Weber
fe6960286c WebP/Lossy: Add function for inverse 4x4 DCT from spec 2023-05-29 19:44:45 +02:00
Tim Ledbetter
8bb6a820e2 Help: Sort search results by score
This makes pages with matching titles appear at the top of the search
results.
2023-05-29 10:47:48 -06:00
Tim Ledbetter
556c4ac358 LibGUI: Allow FilteringProxyModel to optionally sort results by score
When the `FilteringOptions::SortByScore` flag is set, filtered indices
are sorted by match score in descending order, meaning the most
relevant results should appear first.

The default behavior of FilteringProxyModel is unchanged.
2023-05-29 10:47:48 -06:00
Tim Ledbetter
a042c4e93d Help: Perform a fuzzy match on the page title when searching
This allows for slight misspellings to still return a result.
2023-05-29 10:47:48 -06:00
Nico Weber
d1b5eec154 WebP/Lossy: Implement macroblock coefficient decoding
This basically adds the line

    u8 token = TRY(
        tree_decode(decoder, COEFFICIENT_TREE,
        header.coefficient_probabilities[plane][band][tricky],
        last_decoded_value == DCT_0 ? 2 : 0));

and calls it once for the 16 coefficients of a discrete cosine transform
that covers a 4x4 pixel subblock.

And then it does this 24 or 25 times per macroblock, for the 4x4 Y
subblocks and the 2x2 each U and V subblocks (plus an optional Y2 block
for some macroblocks).

It then adds a whole bunch of machinery to be able to compute `plane`,
`band`, and in particular `tricky` (which depends on if the
corresponding left or above subblock has non-zero coefficients).

(It also does dequantization, and does an inverse Walsh-Hadamard
transform when needed, to end up with complete DCT coefficients
in all cases.)
2023-05-29 10:41:53 -06:00
Nico Weber
b7483b636d WebP/Lossy: Add static data needed for decoding coefficients
Also add `vp8_short_inv_walsh4x4_c()` from the spec for the inverse
Walsh-Hadamard transform. The YUV output data must bitwise match the
behavior of the spec, so there isn't a ton of flexibility of how to
do this particular function.
2023-05-29 10:41:53 -06:00
Timothy Flynn
8ff8309202 LibWeb: Update workarounds for fetching CORS cross-origin responses
Now that the processResponseConsumeBody algorithm receives the internal
response body of the fetched object, we do not need to go out of our way
to read its body from outside of fetch.

However, several elements do still need to manually inspect the internal
response for other data, such as response headers and status. Note that
HTMLScriptElement already does the new workaround as a proper spec step.
2023-05-29 17:12:46 +02:00
Timothy Flynn
6406a561ef LibWeb: Handover the fetch response's internal body data upon completion
These is a normative change to the Fetch spec. See:
https://github.com/whatwg/fetch/commit/9003266
https://github.com/whatwg/fetch/commit/b5a587b
2023-05-29 17:12:46 +02:00
Aliaksandr Kalenik
258f3ea952 LibWeb: Remove Layout::TableBox
Solves conflict in layout tree "type system" when elements <label> (or
<button>) can't have `display: table` because Box can't be
Layout::Label (or Layout::ButtonBox) and Layout::TableBox at the same
time.
2023-05-29 14:12:29 +02:00
Tim Ledbetter
269310268d watch: Avoid overflow for large interval values
Previously `usleep()` was being used, which was being passed a 32-bit
signed integer as a parameter. This caused an overflow for intervals
larger than 2147 seconds.
2023-05-29 14:11:49 +02:00
Ben Wiederhake
ffc52b35fc userdel: Removal of files does not require creation rights 2023-05-29 13:45:01 +02:00
Josh Spicer
084ba2ef9d Meta: Remove unnecessary dot in file name
Fixes a small typo in the file name.

Codespaces and other tools implementing the spec
https://containers.dev/implementors/spec/#devcontainerjson
will expect this file naming pattern.
2023-05-29 13:42:08 +02:00
Tim Schumacher
58b1d9c319 AK: Correctly calculate size of the last AllocatingMemoryStream chunk 2023-05-29 13:30:46 +02:00
Tim Schumacher
52aab50914 AK: Handle empty trailing chunks in AllocatingMemoryStream::offset_of 2023-05-29 13:30:46 +02:00
Tim Schumacher
9a7ae52b31 AK: Expose AllocatingMemoryStream::CHUNK_SIZE
This allows the tests to use that information confidently.
2023-05-29 13:30:46 +02:00
Ben Wiederhake
2b8a527478 AudioApplet: Read and apply config value only once 2023-05-29 13:22:58 +02:00
Ben Wiederhake
f38dcc64b5 AudioApplet: Store default config value in a single place
The hope is that this can later be used to:
- verify that all accesses to the same key use the same default value,
- and extract the default values more easily.
2023-05-29 13:22:58 +02:00
Ben Wiederhake
8df7b42078 FileSystemAccessServer: Don't transmit unused data
The server cannot use these values anywhere, because this method always
sets 'prompt = ShouldPrompt::No'. This saves a bunch of roundtrips for
all clients that use FSAS to read abritrary files.
2023-05-29 13:17:22 +02:00