Commit graph

49652 commits

Author SHA1 Message Date
Timothy Flynn
8f0b7fa370 LibWeb: Verify that a node has styled properties in its styled accessors
For example, it's possible to access Node::computed_values() on a node
that neither has style nor a parent with style. This ultimately results
in a null pointer dereference when we return parent()->computed_values()
as a fallback. This can be a little tricky to track down due to these
functions being inlined, so add an explicit verification.
2023-04-27 18:28:43 +02:00
Andreas Kling
d053cb6fae LibWeb: Fix bug where box-sizing: border-box made flex items too small
If a flex item has a preferred cross size of "auto", we should not be
subtracting padding and border in the cross axis when computing the
cross size.
2023-04-27 13:57:52 +02:00
Fabian Dellwing
824d23570a Ports: Remove getconf from bash examples
We fail to build `getconf.c` from the builtin examples. And therefore
don't install the rest. If we remove it, we successfully build the
rest of the examples.
2023-04-27 10:25:42 +01:00
Matthew Olsson
ed06429d33 LibWeb: Implement ReadableByteStreamController.error() 2023-04-27 07:57:53 +02:00
Matthew Olsson
c9be755367 LibWeb: Implement ReadableByteStreamController.close() 2023-04-27 07:57:53 +02:00
Matthew Olsson
ef3810d03d LibWeb: Add missing AOs for ReadableByteStreamController.[[PullSteps]] 2023-04-27 07:57:53 +02:00
Matthew Olsson
b57b3c54cc LibWeb: Add ReadableStreamBYOBReader to ReadableStreamReader type 2023-04-27 07:57:53 +02:00
Matthew Olsson
e8ad571082 LibWeb: Add ReadableStreamBYOBReader interface 2023-04-27 07:57:53 +02:00
Matthew Olsson
2b269d4a49 LibWeb: Fix a blatant nullptr dereference in ReadableStreamGenericReader 2023-04-27 07:57:53 +02:00
Aliaksandr Kalenik
9ee64b5694 LibWeb: Prevent margin double-counting with "collapse through" boxes
If there is a remaining margin-bottom in margin collapsing state
tracker after laying out all boxes in the current BFC, it must be
assigned to the last in-flow child since margin collapsing cannot
occur across a formatting context boundary.

The current issue where margin-bottom may be counted twice due to
"collapse through" margins in the last in-flow child box is addressed
with this fix by excluding such boxes during the search for a box to
assign the remaining margin.

Test case coming with this fix has a layout bug with incorrectly
computed line height.
2023-04-27 07:52:12 +02:00
Lucas CHOLLET
7fffa0176f KeyboardPreferenceLoader: Remove usage of DeprecatedFile 2023-04-27 07:29:49 +02:00
Lucas CHOLLET
f92ae03e76 DHCPClient: Remove usage of DeprecatedFile 2023-04-27 07:29:49 +02:00
Lucas CHOLLET
d7ca3a5196 LaunchServer: Remove usage of DeprecatedFile
And use the new `guess_mime_type_based_on_sniffed_bytes` helper.
2023-04-27 07:29:49 +02:00
Lucas CHOLLET
50b5528746 LibCore+file: Factorize code to detect mime-type from bytes of a file
This is always nice to factorize code, but even better when it contains
magic numbers.
2023-04-27 07:29:49 +02:00
Lucas CHOLLET
309a15e2aa LibSymbolication: Use Core::File instead of Core::DeprecatedFile 2023-04-27 07:27:14 +02:00
Lucas CHOLLET
c50b072852 IPCMagicLinter: Port to Core::File 2023-04-27 07:26:32 +02:00
Lucas CHOLLET
b35a6b206b IPCMagicLinter: Use LibMain 2023-04-27 07:26:32 +02:00
Timothy Flynn
4dcdc3bd25 Ladybird: Prohibit GUI interaction of the WebContent process on macOS
The WebContent process behaves a bit awkwardly on macOS. When we launch
the process, we have to create a QGuiApplication to access system fonts.
But on macOS, doing so creates an entry in the Dock, and also causes the
WebContent to be focused. So if you enter cmd+Q without first focusing
the Ladybird GUI, WebContent is closed, while the Ladybird process keeps
running.
2023-04-27 07:26:05 +02:00
Andreas Kling
cc86c07f58 LibGfx: Transform the x axis rotation for elliptical arcs
Without this, copy_transformed() will create paths with bogus elliptical
arcs. This was very noticeable with transformed ellipses in SVG.
2023-04-27 07:24:53 +02:00
Andreas Kling
a77accf3f4 LibGfx: Add AffineTransform::rotation()
Extracts the rotation from a 2D matrix.
2023-04-27 07:24:53 +02:00
Fabian Dellwing
8c1dacecba nc: Add -n option to suppress name resolution 2023-04-26 12:33:25 -06:00
Fabian Dellwing
7cfa108fad nc: Add -p option
With this change we support the well-known and shorter way to
create a listener on all interfaces:

`nc -lvp 1337`

instead of:

`nc -lv 0.0.0.0 1337`
2023-04-26 12:33:25 -06:00
Fabian Dellwing
eff3f52bda nc: Fix off-by-one-error in calls to inet_ntop 2023-04-26 12:33:25 -06:00
Fabian Dellwing
552e317a89 nc: Sort command line arguments alphabetically 2023-04-26 12:33:25 -06:00
Andreas Kling
f61947fa9e LibCore: Remove unused EventLoopManager::wake()
Only EventLoopImplementation needs to know how to wake up.
2023-04-26 19:17:04 +01:00
Andreas Kling
12c73915dc Tests: Re-enable TestLibCoreFileWatcher on macOS
Now that cross-thread event posting is unbroken, this should work.
2023-04-26 19:17:04 +01:00
Andreas Kling
b61a87c03c LibCore: Move post_event() back to EventLoopImplementation
This shouldn't have been moved to EventLoopManager, as the manager is
global and one-per-process, and the implementation is one-per-loop.

This makes cross-thread event posting work again, and unbreaks
SoundPlayer (and probably other things as well.)
2023-04-26 19:17:04 +01:00
Andreas Kling
7035a19645 LibAudio: Wait for enqueuer thread to start before poking its event loop 2023-04-26 19:17:04 +01:00
Fabian Dellwing
6990d4e025 Ports: Cleanup the build process a bit for taskwarrior 2023-04-26 16:54:31 +02:00
Aliaksandr Kalenik
3c89286467 LibWeb: Implement creation of fresh top-level traversables
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-26 15:51:50 +02:00
Aliaksandr Kalenik
9a19bdbfcf LibWeb: Implement Navigable::initialize_navigable() 2023-04-26 15:51:50 +02:00
Aliaksandr Kalenik
74ab8ec4f0 LibWeb: Add step property in SessionHistoryEntry 2023-04-26 15:51:50 +02:00
Timothy Flynn
61c0174fec Browser+Ladybird: Render text in the JS console with a monospace font 2023-04-26 15:43:57 +02:00
Timothy Flynn
d44df16704 Ladybird: Explicitly set the font family for CSS generic fonts
We currently query Qt for system fonts using QFont::setStyleHint(). The
docs from Qt have the following note regarding this API on X11:

    Qt does not support style hints on X11 since this information is not
    provided by the window system.

This prevents any monospace font from working on X11 systems. For now,
work around this by specifying the font-family for fonts which Qt has
listed as mapping to a CSS generic font-family.
2023-04-26 15:43:57 +02:00
LekKit
9fe6dcb50b Ports: Use makeopts in RVVM port 2023-04-26 12:48:56 +02:00
LekKit
1a3009fa2b Ports: Fix RVVM port syntax 2023-04-26 12:48:56 +02:00
LekKit
12730cefce Ports: Add RVVM port 2023-04-26 12:48:56 +02:00
iyush
ac435f914c LibCpp: Support for parsing c-style fixed arrays (arr[2])
Also adds tests for finding declaration of arrays inside
CppComprehension which requires proper parsing for passing.

Side-effect of this patch: if we ctrl+click on array variables, it
should jump to the correct declaration inside HackStudio.
2023-04-26 09:40:25 +01:00
Jelle Raaijmakers
34b04271f4 Ports/SDL2: Handle window close requests correctly
We were going about this the wrong way:

* We should not send `SDL_QUIT` events; SDL2 is doing this for us
  already when the last window is closed, for example.
* The `SDL_WINDOWEVENT_CLOSE` event does not represent a closed window,
  but rather a _request_ from the window manager to close a window.

This resolves the issue with the PrBoom+ port where the quit screen
would not be shown when trying to close the main window.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
e283dfdeb6 Ports/scummvm: Enable release mode
This brings the binary's size down to 100 MiB, from about 600 MiB. The
`--enable-optimizations` flag is implied with `--enable-release`.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
62843befca Ports/SDL2: Stop the audio client when device is closed
This ensures all threads and event loops on the audio client's side are
shut down.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
bff5137cb4 Ports/gltron: Exit the game when SDL_QUIT is received 2023-04-26 09:37:16 +01:00
Andreas Kling
7465362fe7 LibWeb: Clamp CSS z-index to the range of a 32-bit integer
This appears to be consistent with other engines, and fixes many pages
where we were misinterpreting super large z-index values as something
else entirely.
2023-04-26 09:44:43 +02:00
Andreas Kling
cead039e7e Tests: Disable TestLibCoreFileWatcher on macOS temporarily
This broke somehow with the new event loop architecture and will need
debugging, but let's bring the CI back to green first.
2023-04-26 06:34:05 +02:00
Ali Mohammad Pur
6d48719069 Utilities: Add support for loading the WASI module to wasm 2023-04-26 03:47:15 +03:30
Ali Mohammad Pur
7e4e9fdb8f LibWasm: Start implementing WASI
This commit starts adding support for WASI, along with the framework to
implement all the functions (though only a couple are currently
implemented).
2023-04-26 03:47:15 +03:30
Ali Mohammad Pur
eceb244bef LibWasm: Allow Value::to<T>() to perform statically valid conversions
e.g. i32 -> i16 (if within range).
2023-04-26 03:47:15 +03:30
Zaggy1024
b10da81c7c LibVideo: Fast-path converting colors by only matrix coefficients
We don't need to run through the whole floating-point color converter
for videos that use sRGB transfer characteristics and BT.709 color
primaries. This commit adds a new templated inlining function to
ColorConverter to do a very fast fixed-point YCbCr to RGB conversion.

With the fast path, frame conversion times go from ~7.8ms down to
~3.7ms. The fast path can benefit a lot more from extra SIMD vector
width, as well.
2023-04-25 17:44:36 -04:00
Zaggy1024
d6b867ba89 LibVideo/VP9: Force inlining of inverse_transform_2d() and the IDCT
Clang was reluctant to inline these for some reason. However, inlining
them seems to be quite beneficial, reducing decoding time in an intra-
heavy video by about 21% (~12.7s -> ~10.0s).
2023-04-25 17:44:36 -04:00
Zaggy1024
90c0e1ad8f LibVideo/VP9: Pre-calculate the quantizers at the start of each frame
Quantizers are a constant for the whole frame, except when segment
features override them, in which case they are a constant per segment
ID. We take advantage of this by pre-calculating those after reading
the quantization parameters and segmentation features for a frame.
This results in a small 1.5% improvement (~12.9s -> ~12.7s).
2023-04-25 17:44:36 -04:00