Commit graph

47478 commits

Author SHA1 Message Date
Andreas Kling
7e76a51cb0 LibWeb: Rename Layout::InitialContainingBlock to Layout::Viewport
The name "initial containing block" was wrong for this, as it doesn't
correspond to the HTML element, and that's specifically what it's
supposed to do! :^)
2023-02-28 12:21:56 +01:00
Cubic Love
60f699338d Base: Improve Presenter Icons
Before, the shading of the Presenter icons was the wrong way round and
the external contrast was not as good as it could be. This has been
rectified and the icons are now light on the left- and dark on the
right-side. Also, they now use the same gray colors as other system
icons, making them sit much more nicely together, and have been
generally improved.
2023-02-28 10:17:40 +01:00
Cubic Love
80d1fc39a4 Base: Update Presenter man page with correct icon + Add a link to open
Use the correct icon in the Presenter application man page and add a
link to open the executable.
2023-02-28 10:17:40 +01:00
Luke Wilde
e864444fe3 LibTextCodec/Latin1: Iterate over input string with u8 instead of char
Using char causes bytes equal to or over 0x80 to be treated as a
negative value and produce incorrect results when implicitly casting to
u32.

For example, `atob` in LibWeb uses this decoder to convert non-ASCII
values to UTF-8, but non-ASCII values are >= 0x80 and thus produces
incorrect results in such cases:
```js
Uint8Array.from(atob("u660"), c => c.charCodeAt(0));
```
This used to produce [253, 253, 253] instead of [187, 174, 180].

Required by Cloudflare's IUAM challenges.
2023-02-28 08:46:06 +00:00
Luke Wilde
1c918e826c LibWeb: Define navigator/clientInformation with define_native_accessor
Defining it as a direct property causes it to have no getter/setter
function, which causes an empty Optional crash when attempting to
access such getter on a cross-origin iframe.

Fixes amazon.com crashing on this particular crash.
2023-02-28 08:45:23 +00:00
Tim Ledbetter
f3d1be933a PixelPaint: Remove shrink_to_fit property from LevelsDialog GML
This was causing the levels dialog to be displayed incorrectly.
2023-02-28 08:44:05 +00:00
Luke Wilde
57cc2bab4b Ports: Add Mednafen 2023-02-28 08:42:45 +00:00
Tim Ledbetter
3112a6b44f PixelPaint: Fix clicking on the layer menu with no image loaded
Previously, clicking on the layer menu with no image loaded would
cause a crash.
2023-02-28 08:37:10 +00:00
Tim Ledbetter
ef54a3c0d2 PixelPaint: Disable levels dialog action when no image is loaded
Previously, clicking on the levels dialog with no image loaded would
cause a crash.
2023-02-28 08:37:10 +00:00
Lucas CHOLLET
a139c77c71 LibGfx: Bubble up allocation failure instead of panicking 2023-02-28 08:33:01 +00:00
Luke Wilde
fc538bc00b LibJS: Add [[nodiscard]] to ThrowCompletionOr<void> 2023-02-27 23:57:08 +00:00
Luke Wilde
8f4bec2b4a LibJS: Add missing TRY in StringIteratorPrototype::next 2023-02-27 23:57:08 +00:00
Luke Wilde
53852452b2 LibJS: Propagate errors from Intrinsics initialization 2023-02-27 23:57:08 +00:00
Luke Wilde
af118f2a67 LibJS: Add missing error propagation to global object initializations 2023-02-27 23:57:08 +00:00
Luke Wilde
fb7aaeff3e LibJS/Bytecode: Return ThrowCompletionOr<void> from CreateVariable op 2023-02-27 23:57:08 +00:00
Luke Wilde
f4be95af69 LibJS: Don't discard ThrowCompletionOr<void> from declaration iteration 2023-02-27 23:57:08 +00:00
Luke Wilde
a964ebc255 LibWeb: Implement Path2D#addPath
Required by Ruffle.
2023-02-27 20:55:09 +01:00
Luke Wilde
1f97adbee8 LibGfx: Add a function that adds two paths together
This will be used by Path2D#addPath in LibWeb.
2023-02-27 20:55:09 +01:00
Luke Wilde
a90667e79c LibWeb: Add initial implementation of DOMMatrix(ReadOnly)
This is currently missing a lot of functions and initialisation from a
<transform-list> string, but is enough for Ruffle.
2023-02-27 20:55:09 +01:00
Luke Wilde
e3a9ed0c26 LibWeb: Make [UseNewAKString] work for enums and stringifiers 2023-02-27 20:55:09 +01:00
Luke Wilde
dec09333a3 LibGfx: Add method to Matrix that determines if the matrix is invertible 2023-02-27 20:55:09 +01:00
Luke Wilde
fcd3b16d63 LibWeb: Visit CallbackType's stored EnvironmentSettingsObject reference 2023-02-27 20:49:00 +01:00
Tim Schumacher
8331d7cd82 LibAudio: Use the proper functions to read WAV samples
Turns out that, if we don't use functions that ensure reading until the
very end of the buffer, we only end up getting the very beginning of
samples and fill the rest with uninitialized data.

While at it, make sure that we read the data that is little endian as a
LittleEndian.
2023-02-27 18:28:12 +01:00
Timothy Flynn
4edd8e8c5e LibGUI: Ensure the "End" key sets the cursor to the visual line end
We are currently setting the physical mouse position to the visual
cursor content location. In a line containing only a multi-code point
emoji, this would set the cursor to column 1 rather than however many
code points there are.
2023-02-27 09:36:37 -05:00
Nico Weber
a81e1a8c4f file: Use StringView instead of DeprecatedString for paths 2023-02-27 15:18:55 +01:00
Nico Weber
4193e53f62 file: Use StringView instead of DeprecatedString for description 2023-02-27 15:18:55 +01:00
Nico Weber
f989d2bb1f file: Use StringView instead of DeprecatedString for mime types 2023-02-27 15:18:55 +01:00
Nico Weber
9f5343e29e file: Remove unnecessary DeprecatedString ctor call
path is already a DeprecatedString.
2023-02-27 15:18:55 +01:00
Patryk Pilipczuk
b87b1472e1 HexEditor: Add BE decoding for UTF16String column in ValueInspector 2023-02-27 13:39:40 +01:00
Lucas CHOLLET
8c1a409263 Tests: Add a test for SOF0 images with several scans
This type of image isn't common, and you can probably only find one by
generating it yourself. It can be done using `cjpeg` with the -scan
argument.

This image has been generated with the following scan file:
0: 0 63 0 0;
1: 0 63 0 0;
2: 0 63 0 0;
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
a40c7354c1 Tests: Rename "test_jpg" to "test_jpeg_sof0_one_scan" 2023-02-27 13:39:22 +01:00
Lucas CHOLLET
f70a7b763f LibGfx: Don't return after the first scan
Finally, it brings support for SOF0 images with several scans.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
2c98eff558 LibGfx: Consider component interleaving when reading a scan
Scan with only one component are by definition not interleaved, meaning
that each value is linearly ordered in the stream. Grayscale images
were supported thanks to a hack, by forcing the subsampling to 1.

Now we properly support grayscale image with other subsampling (even if
it doesn't make sense) and more generally scans with only one component
and any sampling factors.

While this solution is more general than the last one it also feels a
bit hackish. We should probably refactor the way we iterate over
components and macroblocks. But that's work for latter, especially when
we will add support for other subsampling than 4-2-2.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
893659c6aa LibGfx: Move HuffmanStream from the context to the Scan object
Huffman streams are encountered in the scan segment. They have nothing
to do outside this segment, hence they shouldn't outlive the scan.

Please note that this patch changes behavior. The stream is now reset
after each scan.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
ae124c19ef LibGfx: Don't assume that a scan include all components for the image
A scan can contain fewer components that the full image. However, if
there is multiple components, they have to follow the ordering of the
frame header. It means that we can loop over components of the image
and skip those that doesn't correspond.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
947698f29f LibGfx: Consider EOI as a supported marker
For now, we exit after the first scan without needing to parse `EOI`.
However, to read scans in a loop we will need to properly detect and
parse `EOI`.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
698605444b LibGfx: Remove restrictive checks
These checks are only valid for mono-scan SOF0 images, with tables
defined before the start of frame segment.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
d3231ca323 LibGfx: Log spectral information 2023-02-27 13:39:22 +01:00
Lucas CHOLLET
3719f94c63 LibGfx: Log image dimensions only once 2023-02-27 13:39:22 +01:00
Lucas CHOLLET
f98668f8b2 LibGfx: Only iterate components of the current scan
A scan can have fewer components than what the final image contains.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
9fa375b844 LibGfx: Differentiate scan-level and frame-level data for components
This patch brings us closer to the spec point of view. And while it
makes no functional changes, it reduces the number of places where you
can misuse scan-specific data and improve support for multiple scans.
2023-02-27 13:39:22 +01:00
Lucas CHOLLET
508ae37c6e LibGfx: Move scan-related information to its own struct
Putting them directly in the context isn't good for neither readability,
comprehension nor spec compliance.
2023-02-27 13:39:22 +01:00
Tim Ledbetter
cc4184cb47 LibGUI: Don't show non-visible actions in CommandPalette 2023-02-27 13:37:24 +01:00
Nico Weber
5d5f9f52a0 Utilities: Make file print more information for animated images 2023-02-27 13:29:57 +01:00
Nico Weber
a83f4ec186 WebServer: Remove a call to String::from_deprecated_string
guess_mime_type_based_on_filename() returns a StringView, so no
need to bring DeprecatedString's (implicit) ctor into this.

No behavior change.
2023-02-26 21:01:58 -05:00
Hendiadyoin1
8e5ebb04f4 LibJS: Use a pseudo top-level UnwindFrame in GenerateCFG
Previously we assumed that there is always one such frame, now there is.
2023-02-26 23:09:37 +01:00
kleines Filmröllchen
bd1cecb991 Meta: Lower QEMU DirectSound driver timer period to 2ms
10ms (the default) is ridiculous and causes all kinds of glitches if we
actually want to have a low-latency queue.
<https://gitlab.com/qemu-project/qemu/-/issues/1076#note_996636777>
suggests 2ms (and no lower than 1ms). This improves audio glitch
resistance at our current 512 sample buffer size, but going lower is
still not possible.
2023-02-26 22:27:42 +01:00
MacDue
6cf8eeb7a4 LibGfx: Return bool not ErrorOr<bool> from ImageDecoderPlugin::sniff()
Nobody made use of the ErrorOr return value and it just added more
chance of confusion, since it was not clear if failing to sniff an
image should return an error or false. The answer was false, if you
returned Error you'd crash the ImageDecoder.
2023-02-26 19:43:17 +01:00
MacDue
8d9cb538d6 LibGfx: Don't return an error for webp sniff failures
The correct thing to do here is return false, returing an error
crashes the ImageDecoder.
2023-02-26 19:43:17 +01:00
Hendiadyoin1
c696654294 LibJS: Add a missing include to FunctionKind.h 2023-02-26 19:40:09 +01:00