Commit graph

38825 commits

Author SHA1 Message Date
kleines Filmröllchen
07d712ea00 AK: Add saturating addition and subtraction to Checked 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
746d3c1131 AudioServer: Explicitly cast between numeric types in the mixer 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
cb8e37d436 LibAudio: Add spec comments to the FlacLoader
This way the FlacLoader can be more easily understood by someone that
doesn't already know the format inside out.
2022-06-23 23:16:34 +01:00
Andreas Kling
c03a0e7260 LibWeb: Fix unsafe capture of ref-to-local when setting up load timeout
We were capturing a reference to a stack local and then persisting the
closure, causing it to dereference a long-gone object when invoked.
2022-06-23 20:37:29 +02:00
CodeforEvolution
a02ee29af9 LibWeb/CSS: Check for NULL block statement when parsing font-face rule
This prevents font-face rules without a block statement from crashing
LibWeb during CSS parsing.

The issue was discovered by Lubrsi during CSS parser fuzzing. :)
Fixes #14141.
2022-06-23 19:14:24 +01:00
MacDue
f807fe6f6c Base: Add box-shadow + border-radius HTML examples
This now also shows the same box-shadows on the right on top of a
background to test the clipping underneath the content.
2022-06-23 19:13:24 +01:00
MacDue
4ffbe9284e LibGfx: Slap an -O3 optimization #pragma on FastBoxBlurFilter
This is done elsewhere in LibGfx, but adding it here is more of a
prayer for speed.
2022-06-23 19:13:24 +01:00
MacDue
30a0ed6678 LibGfx: Avoid AK::Function indirection in FastBoxBlurFilter + flatten it
This dropped a few percent when profiling Lubrsi's test.
2022-06-23 19:13:24 +01:00
MacDue
bb48a61d50 LibGfx: Flatten AntiAliasingPainter::draw_ellipse_part()
This seemed to drop the time spent here a few percent in profiling.
2022-06-23 19:13:24 +01:00
MacDue
ff1e61bd11 LibWeb: Support using a border-radius with a box-shadow
This commit adds support for using all your favorite border radii with
box-shadow, that is elliptical, circular, rounded rectangle etc. :^)

There is some work needed to make this more performant. The larger
your border radius is the larger the corner bitmap needs to be,
which means more time spent in FastBoxBlurFilter. There are probably
some tricks to bring this down.

Fixes #14325
2022-06-23 19:13:24 +01:00
MacDue
13c4c735b8 LibWeb: Add 'inside' clip mode to BorderRadiusCornerClipper
The default clip mode 'outside' clips everything outside the corner,
'inside' does the opposite :^)
2022-06-23 19:13:24 +01:00
MacDue
08baeb1e7d LibWeb: Pass border radii data to shadow painting
This is not used yet, but will be needed for painting shadows on
elements that have a border-radius.
2022-06-23 19:13:24 +01:00
Hendiadyoin1
5bf84a5b0e AK: Zero previous pointer *after* fixing the insertion list in HashTable 2022-06-23 20:25:12 +03:00
Tim Schumacher
f03838fac8 Tests: Add tests for wcsftime 2022-06-23 15:45:04 +01:00
Tim Schumacher
ffb95bace4 LibC: Implement wcsftime using a makeshift solution 2022-06-23 15:45:04 +01:00
Idan Horowitz
a79796ea4a LibJS: Implement stage 3 proposal FinalizationRegistry changes
Specifically the 'Symbol as WeakMap Keys Proposal'.
2022-06-23 10:57:52 +03:00
Idan Horowitz
53ed8decaf LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
dbd0110721 LibJS: Implement WeakSet changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
a80d3fdf49 LibJS: Implement WeakMap changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
22a78e8a2c LibJS: Implement the CanBeHeldWeakly abstract operation
This AO is required for implementing the rest of the stage 3 'Symbol as
WeakMap Keys Proposal'.
2022-06-23 10:57:52 +03:00
Ali Mohammad Pur
8e26edc8de Base: Add a quote to the fortunes database 2022-06-22 20:58:14 +01:00
Idan Horowitz
eb02425ef9 AK: Clear the previous and next pointers of deleted HashTable buckets
Usually the values of the previous and next pointers of deleted buckets
are never used, as they're not part of the main ordered bucket chain,
but if an in-place rehashing is done, which results in the bucket being
turned into a free bucket, the stale pointers will remain, at which
point any item that is inserted into said free-bucket will have either
a stale previous pointer if the HashTable was empty on insertion, or a
stale next pointer, resulting in undefined behaviour.

This commit also includes a new HashMap test that reproduces this issue
2022-06-22 21:53:13 +02:00
Andreas Kling
7953bd8391 LibWeb: Implement "transferred size suggestion" for flex items 2022-06-22 18:36:17 +02:00
Ali Mohammad Pur
910a44d5f2 LibLine: Use the real shown line count around in cleanup()
Previously we would leave artifacts on screen if a change caused the
buffer to span fewer lines than the current buffer.
This commit records the shown line count and uses that instead of trying
to guess the previous line count (and failing most of the time).
2022-06-22 15:45:27 +02:00
MacDue
92a1e9607d Base: Document /proc/{pid}/children in proc(7) manpage 2022-06-22 13:29:17 +01:00
Michał Lach
e9dae38f38 Terminal+TerminalSettings: Add caret customization 2022-06-22 12:12:00 +01:00
Michał Lach
e2b0f6795f LibVT+Kernel: Separate the caret shapes and its steadiness
Currently CursorStyle enum handles both the styles and the steadiness or
blinking of the terminal caret, which doubles the amount of its entries.
This commit changes CursorStyle to CursorShape and moves the blinking
option to a seperate boolean value.
2022-06-22 12:12:00 +01:00
Idan Horowitz
1950e79d48 Kernel: Eliminate possible KASLR leak by disabling CR4.FSGSBASE
The RDGSBASE userspace instruction allows programs to read the contents
of the gs segment register which contains a kernel pointer to the base
of the current Processor struct.

Since we don't use this instruction in Serenity at the moment, we can
simply disable it for now to ensure we don't break KASLR. Support can
later be restored once proper swapping of the contents of gs is done on
userspace/kernel boundaries.
2022-06-22 07:52:35 +03:00
Tim Schumacher
2df56f840f Revert "Toolchain: Load x64 executables at a higher address"
Now that the lower pages can be unmapped and more of the virtual
address range is available to us, we can actually use the default
mapping address of x86_64 again.

This reverts commit 292398b585.
2022-06-21 22:38:15 +01:00
Tim Schumacher
d2b87419ac LibELF: Only collect region sizes before reserving memory
This keeps us from needlessly allocating storage via `malloc` as part
of the `Vector`s that early, which we might conflict on while reserving
memory for the main executable.
2022-06-21 22:38:15 +01:00
Tim Schumacher
c0b31796a8 LibELF: Unmap the source file temporarily while reserving space
This further reduces the chance that we will conflict with data that is
already present at the target location.
2022-06-21 22:38:15 +01:00
Tim Schumacher
c1d8612eb5 LibELF: Store DynamicLoader ELF images using an OwnPtr
This is preparation work for the next commit, where we will replace the
stored ELF image mid-load.
2022-06-21 22:38:15 +01:00
Tim Schumacher
07208feae7 LibELF: Actually do the library mapping as early as possible
We previously trusted the `map` part in `map_library` too much, and
assumed that this would already lock in the binary at its final place.

However, the `map()` function of the loader was only called in
`load_main_library`, which ran only right before jumping to the
entrypoint.

Make our binary loading a bit more stable by actually mapping the binary
right after we read its information, and only do the linking right
before jumping to the entrypoint.
2022-06-21 22:38:15 +01:00
Tim Schumacher
cedec9751a Kernel: Decrease the amount of address space offset randomization
This is basically unchanged since the beginning of 2020, which is a year
before we had proper ASLR.

Now that we have a proper ASLR implementation, we can turn this down a
bit, as it is no longer our only protection against predictable dynamic
loader addresses, and it actually obstructs the default loading address
of x86_64 quite frequently.
2022-06-21 22:38:15 +01:00
Tim Schumacher
cead476816 LibC: Make scanf read an unsigned long when using %lu 2022-06-21 22:38:15 +01:00
Tim Schumacher
a880457380 LibC: Don't change the stack canary across function boundaries 2022-06-21 22:38:15 +01:00
Andreas Kling
75e8b1305d LibWeb: Actually distribute free space to flex items with auto margins
We were not applying the distributed space to the used offset of flex
items, as we were only assigning the margins to the layout state of the
box, not the internal FlexItem::margins.
2022-06-21 21:18:00 +02:00
Andreas Kling
99e96f951f LibWeb: Implement (some of) "automatic minimum size" for flex items 2022-06-21 21:06:19 +02:00
Andreas Kling
967b257518 LibWeb: Make FFC prepare replaced child boxes for layout
Before we ask a replaced box about its intrinsic dimensions, we have
to "prepare" the box, which tells it to go and work out what its
intrinsic dimensions are.

I've added a FIXME about how this is silly (and clearly bug-prone)
but this patch only patches it locally in FFC for now.
2022-06-21 20:40:26 +02:00
Andreas Kling
85f2f8ab3f LibWeb: Make sure we layout absolutely positioned children of FFC 2022-06-21 20:17:28 +02:00
Torstennator
5aeb6552f0 PixelPaint: Add level sliders for brightness, contrast and gamma
This patch adds a basic dialog to change brightness, contrast and gamma
correction for the selected layer.
2022-06-21 18:23:01 +01:00
Luke Wilde
69c451e485 Ports: Update OpenSSL to 1.1.1p
This also changes the source to fetch OpenSSL from the OpenSSL site, as
1.1.1p is not currently available from the usual source.
2022-06-21 18:14:55 +01:00
Linus Groh
83ae4ee767 Meta: Add Benjamin Maxwell to the contributors list :^) 2022-06-21 17:29:47 +01:00
Kenneth Myhra
c805987329 LibWeb: Add timeout functionality to ResourceLoader
Add timeout functionality to ResourceLoader and use it from
XMLHttpRequest.
2022-06-21 10:29:14 +01:00
Kenneth Myhra
8b42c05648 LibWeb: Add XMLHttpRequest::timeout setter and getter 2022-06-21 10:29:14 +01:00
Kenneth Myhra
1e1d59cc25 RequestServer: Do not VERIFY(request.total_size.has_value())
If the request is stopped RequestServer::did_finish_request() will crash
on the VERIFY() call since request.total_size.has_value() returns false.

Let us instead use a conditional expression to verify if it has a value
and then call async_request_finished().
2022-06-21 10:29:14 +01:00
Grigoris Pavlakis
2fa907b31a Ports/gltron: Use sdl12-compat instead of SDL2 2022-06-20 23:24:45 +01:00
Grigoris Pavlakis
c98a275931 Ports: Add SDL_sound for SDL 1.2 2022-06-20 23:24:45 +01:00
Grigoris Pavlakis
de31f51bbe Ports: Move SDL_sound to SDL2_sound 2022-06-20 23:24:45 +01:00
Mike Akers
27f93a3052 LibGUI: Prevent CenterWithinParent Dialogs from appearing offscreen
When a dialog is created the position is checked against the Desktop's
rect and repositioned to be entirely visible. If the dialog is larger
than the desktop's rect it is just centered.
2022-06-20 16:50:25 +01:00