Commit Graph

21354 Commits

Author SHA1 Message Date
Daniel Bertalan
4cf6963a1c LibVT: Add missing cursor movement escape sequences
This commit adds support for the following ANSI escape sequences:
- `CNL` - Cursor Next Line
- `CPL` - Cursor Previous Line
- `VPR` - Line Position Relative
- `HPA` - Character Position Absolute
- `HPR` - Character Position Relative
2021-05-29 15:50:24 +02:00
Mart G
07e3934f01 LibGUI: Distribute remaining pixels in BoxLayout to fill the entire area
Previously, the layout algorithm preferred to give every item an equally
sized slice of the remaining space. This meant that not the entire area
was used when the remaining size did not divide evenly by the number of
items. This caused, for example, the ResizeCorner in HexEditor to be a
couple of pixels left of the actual corner for some sizes of the window.

Now, the remaining pixels are distributed on a first come, first served
basis. However, only one pixel is distributed at a time. This means
items towards the left might me a pixel larger than their siblings
towards the right.
2021-05-29 15:50:04 +02:00
Gunnar Beutner
77f9f442d8 Kernel: Don't overrun the buffer in krealloc()
The allocation_size_in_chunks field contains the bytes necessary for
the AllocationHeader so we need to subtract that when we try to figure
out how much user data we have to copy.

Fixes #7549.
2021-05-29 17:28:45 +04:30
Jesse Buhagiar
e2989424c7 DisplaySettings: Set monitor widget color if no image is selected
The monitor widget now displays the selected colour if no background
image has been selected.

Resolves #7491
2021-05-29 13:30:19 +01:00
Brendan Coles
90e9d1a0a1 HexEditor: Add find_all_strings() function 2021-05-29 16:26:12 +04:30
Stephan Unverwerth
10ceeb092f Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00
Marcus Nilsson
0aa0e00dd5 Browser: Add title to go back/forward context menu
Adds page title to the context menu for go back/forward.
2021-05-29 12:03:41 +01:00
Ali Mohammad Pur
3f5eb6446b LibGUI: Make HeaderView act only on the visible sections
i.e. Drawing them, or handling mouse events on them.
Fixes #7505.
2021-05-29 13:31:41 +04:30
DexesTTP
4bbf954ad0 LibTLS: Allow using other hash algorithms for HMAC
The standard allows for ciphers to define which hash to use.
Fixes #7348
2021-05-29 13:29:46 +04:30
DexesTTP
cb4a0dec8a LibTLS: Use a more precise KeyExchangeAlgorithm enum
The old enumeration didn't allow discriminating the key exchange
algorithms used, but only allowed the handshake with the server. With
this new enumeration, we can know which key exchange algorithm we are
actually supposed to use :^)
2021-05-29 13:29:46 +04:30
DexesTTP
dd35aa7725 LibTLS: Add IANA Hex codes for all recommended cipher suites
Also sort the existing cipher suites, and remove the unsupported ones.
We don't support any of these recommended ciphers, but at least we now
know which ones we should focus on :^)
2021-05-29 13:29:46 +04:30
Andreas Kling
8658f20af7 Meta: Update FUNDING.yml again
Apparently I didn't understand the format correctly.. :^)
2021-05-29 09:59:49 +02:00
Andreas Kling
2bd7449b59 Meta: Update FUNDING.yml
Let's keep it simple and stick to GitHub Sponsors here on GitHub.
And add Linus since he's on GitHub Sponsors now as well! :^)
2021-05-29 09:57:13 +02:00
Brian Gianforcaro
99e23a711d AK+Kernel: Hide AK::adopt_own from usage in the Kernel
We want to discourage folks from using APIs which lull you into a sense
of false safety in terms of OOM. There are cases where you want to force
allocations to succeed or crash, but those should use a more explicit
API than `AK::adopt_own(.)`.
2021-05-29 09:04:05 +02:00
Brian Gianforcaro
9b1ff3d3ac Kernel: Make Region creation API OOM safe
- Make Region::create_kernel_only OOM safe.

- Make Region::create_user_accessible mostly OOM safe, there are still
  some tendrils to untangle before it and be completely fixed.
2021-05-29 09:04:05 +02:00
Brian Gianforcaro
ab63449ab7 Kernel: Make PerformanceEventBuffer creation API OOM safe 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
8fc6168f21 Kernel: Make Space::create API OOM safe 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
d570048c9e Kernel: Make CoreDump::create API OOM safe 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
32f96eb937 Kernel: Remove usage of adopt_own in MultiProcessorParser 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
af2c3ab524 Kernel: Remove usage of adopt_own in KString 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
f4d7151c3c Kernel: Make KBuffer APIs OOM safe 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
864b1a65e3 Kernel: Make ContiguousVMObject factory API OOM safe 2021-05-29 09:04:05 +02:00
Brian Gianforcaro
cb45b2c001 Kernel: Make AnonymousVMObject::clone() API OOM safe
Propagate allocation failure of m_shared_committed_cow_pages,
and uncommit previously committed COW pages on failure.

This method needs a closer look in terms of error handling, as we
will eventually need to rollback all changes on allocation failure.
Alternatively we could allocate the anonymous object much earlier
and only initialize it once the other steps have succeeded.
2021-05-29 09:04:05 +02:00
Brian Gianforcaro
65d5f81afc Kernel: Make PrivateInodeVMObject factory APIs OOM safe 2021-05-29 09:04:05 +02:00
Linus Groh
d947253c51 LibWeb: Also call page_did_start_loading() for FrameLoader::Type::Reload
Surprisingly this is not used by the browser's page reload functionality
but only JS's location.reload() - that's probably why this hasn't been
noticed yet. Make sure we notify the page client about the load start in
that case as well. :^)
2021-05-29 01:27:06 +01:00
Linus Groh
56e69c4f2e LibWeb: Call page_did_start_loading() before load_resource()
Otherwise we would sometimes (dependent on the load time, I believe) end
up setting the document and eventually calling title change callbacks
before communicating that the page started loading.
2021-05-29 01:17:36 +01:00
Linus Groh
94a56c3aee Browser: Pass Tab::on_title_change title argument as const reference 2021-05-29 01:14:04 +01:00
Linus Groh
507c5b6248 Browser: Remove redundant parameter names from Tab::on_{g,s}et_cookie 2021-05-29 01:12:24 +01:00
Tobias Christiansen
301eb998c6 LibWeb: Improve performance of CSS custom property resolution
By memoizing already resolved custom properties in the DOM::Element,
we achieve a notable speed increase when loading SerenityOS on GitHub.
2021-05-29 00:58:07 +04:30
Tobias Christiansen
3ede1d08f5 LibWeb: Avoid unnecessary String copy in parsing CSS custom properties 2021-05-29 00:58:07 +04:30
Gunnar Beutner
4fca9ee060 Kernel: Allow building the kernel with -O0
Unfortunately the kernel doesn't run with -O0 but at least it can be
successfully built with this change.
2021-05-28 19:52:22 +01:00
Marcus Nilsson
b06d01f040 SystemMonitor: Disable menu items for inaccessible process
Disable the context menu items if user cannot access the process.

Fixes #7486
2021-05-28 18:45:57 +01:00
Jesse Buhagiar
c94e1206bd Meta: Add LibGL to README :^)
Think this is fleshed out and cool enough to warrant being
in the README :^)
2021-05-28 17:55:45 +01:00
Gunnar Beutner
0ee8c1ed27 Ports: Install mbedtls into the right directory and build shared libs
Previously we'd install mbedtls into /lib, /include, etc. Instead we
should install this port into /usr/local/lib.

This also builds shared libraries for this port.
2021-05-28 16:40:02 +01:00
Jesse Buhagiar
2753505962 SystemMonitor: Use u64 for disk sizes
This fixes #7288, which was being caused by unsigned 32-bit integer
overflow
2021-05-28 16:37:25 +01:00
Jesse Buhagiar
786275feb8 LibGUI: Add u64 type to LibGUI::Variant
`uint` has also been more appropriately renamed to
u32.
2021-05-28 16:37:25 +01:00
Gunnar Beutner
9adcfd5726 Kernel: Don't crash when writing a coredump with an unnamed region
Previously we'd try to call ByteBuffer::append(nullptr, 1) when we
came across a VM region that had no name.
2021-05-28 16:48:17 +02:00
Tobias Christiansen
fd6b04055c LibWeb: Resolve custom properties
The way to get the custom properties is pretty weird and this code is
as far from optimized as it gets but somehow it works :^)
2021-05-28 10:45:38 +01:00
Tobias Christiansen
bf9c5ffb3f LibWeb: StyleResolver: Keep track of specificity of matched selector
This way it gets easier to compare matches.
2021-05-28 10:45:38 +01:00
Tobias Christiansen
c4588a2cde LibWeb: Add parsing for custom properties
This parses 'some-property: var(--some-name)' and stores its findings
in a CustomStyleValue.
It also parses the custom properties like '--some-name: some-value' and
puts them into the StyleProperty.
2021-05-28 10:45:38 +01:00
Tobias Christiansen
0d7169b91a LibWeb: Store custom properties in CSSStyleDeclaration
Keep them around when parsing and store them in the CSSStyleDeclaration
when done.
2021-05-28 10:45:38 +01:00
Tobias Christiansen
f0c6160362 LibWeb: Add CustomStyleValue
This extends StyleValue and can hold the identifier of the custom
property.
2021-05-28 10:45:38 +01:00
Tobias Christiansen
8396099e0e LibWeb: Add PropertyID::Custom to code generator 2021-05-28 10:45:38 +01:00
Andreas Kling
9d801d2345 Kernel: Rename Custody::create() => try_create()
The try_ prefix indicates that this may fail. :^)
2021-05-28 11:23:00 +02:00
Andreas Kling
9a827ad3da Kernel: Use a KString for Custody::m_name 2021-05-28 11:21:00 +02:00
Andreas Kling
fc9ce22981 Kernel: Use KString for Region names
Replace the AK::String used for Region::m_name with a KString.

This seems beneficial across the board, but as a specific data point,
it reduces time spent in sys$set_mmap_name() by ~50% on test-js. :^)
2021-05-28 09:37:09 +02:00
Andreas Kling
a1944ec966 Kernel: Add missing AK/Format.h include in KResult.h 2021-05-28 09:37:09 +02:00
Andreas Kling
856f20f91f Kernel: Add try_copy_kstring_from_user()
This is a convenience function that works the same as our old
copy_string_from_user(), but this returns a KString (and can fail!)
2021-05-28 09:37:09 +02:00
Andreas Kling
279383a8f3 Kernel: Add KString, a single-owner string with OOM failure exposion
This is a simple string class for use in the kernel. It encapsulates
a length + character array in a single-allocation object.

Main differences from AK::String:

- Single-owner (no reference counting.)
- Allocation failures are exposed, not hidden.

The basic idea is to allow better and more precise string management
in the kernel.
2021-05-28 09:37:09 +02:00
Gunnar Beutner
377b06c8ac Kernel: Ignore duplicate SYN packets
When receiving a SYN packet for a connection that's in the "SYN
received" state we should ignore the duplicate SYN packet instead of
closing the connection. This can happen when we didn't accept the
connection in time and our peer has sent us another SYN packet because
it thought that the initial SYN packet was lost.
2021-05-28 08:01:00 +02:00