Commit graph

34049 commits

Author SHA1 Message Date
Andreas Kling
9391311760 LibWeb: Make HTMLInputElement move cursor into text node when focused
This mechanism feels rather awkward, but it's better than nothing.
2022-02-06 22:13:13 +01:00
Andreas Kling
65bd4477db LibWeb: Plumb OOPWV focus state across the IPC boundary
This makes focus outlines show up in OOPWV at last! :^)
2022-02-06 22:13:13 +01:00
Andreas Kling
a062e803c5 LibWeb: Implement (most of) HTMLElement.focus()
The main deviation from the spec is that we don't have a straightforward
representation of the spec's "focusable area" concept.

I've left a bunch of FIXME's around for our future selves. :^)
2022-02-06 22:13:13 +01:00
Andreas Kling
1165a94624 LibWeb: Implement BrowsingContext::currently_focused_area()
This is "currently focused area of a top level browsing context"
from the HTML spec.
2022-02-06 22:13:13 +01:00
Andreas Kling
83523cabda Kernel: Fix bugs in TCP state handling in FinWait1 & FinWait2
1. When receiving FIN while in FinWait1, we now reply with ACK
   in addition to the FinWait1->Closing transition.

2. When receiving FIN|ACK while in FinWait1, we now reply with
   ACK and transition from FinWait1->TimeWait.

3. When receiving FIN while in FinWait2, we now reply with ACK.
2022-02-06 22:13:13 +01:00
Andreas Kling
7247f0204d Kernel: Send only FIN when shutting down TCP socket from ESTABLISHED
We were previously sending FIN|ACK for some reason.
2022-02-06 22:13:13 +01:00
Sam Atkins
bf178e0196 LibWeb: Implement SVG S (SmoothCurve) commands
These were being parsed, but skipped when rendering. With this fix, the
SVG on discord's invite screen looks pretty nice! :^)
2022-02-06 22:13:07 +01:00
Sam Atkins
dc7e73a0b7 LibWeb: Don't dump all stylesheets with CSS_PARSER_DEBUG enabled
Browser has a handy debug menu option to dump all stylesheets, so we
don't need to spam the console with this. (All the spam massively slows
down page loads.)
2022-02-06 22:13:07 +01:00
Andrew Pietila
3758dffd16 Meta: Don't override SERENITY_QEMU_DISPLAY_DEVICE if it is already set 2022-02-06 18:29:25 +00:00
Hendiadyoin1
fbb798f98c AK: Move integral log2 and exp to IntegerMath.h 2022-02-06 17:52:33 +00:00
Hendiadyoin1
f6ddaef8bf Soundplayer: Use exp() instead of pow(E, n) 2022-02-06 17:52:33 +00:00
Hendiadyoin1
3e135f347f Userland: Use AK::pow<I> where applicable 2022-02-06 17:52:33 +00:00
Hendiadyoin1
9ba9691d19 AK: Use integral power for FixedPoint formatting
This removes an ifdef for the Kernel
2022-02-06 17:52:33 +00:00
Hendiadyoin1
581c23dc55 AK: Introduce IntegralMath.h starting with pow<I> 2022-02-06 17:52:33 +00:00
sin-ack
64f135d90f LibCore+Userland: Remove Core::TCPSocket :^)
This was deprecated in favor of Core::Stream::TCPSocket, and now has no
users.
2022-02-06 17:28:17 +00:00
Timothy Flynn
cb57475168 LibJS: Implement BigInt.asUintN 2022-02-06 15:49:54 +00:00
Timothy Flynn
460c2caaf7 LibJS: Implement BigInt.asIntN 2022-02-06 15:49:54 +00:00
Timothy Flynn
72b3ea49d6 LibJS: Enable Temporal tests that now pass
These pass now that negative zero is disallowed by SignedBigInteger.
2022-02-06 15:49:54 +00:00
Timothy Flynn
b0d6399f60 LibCrypto: Do not allow signed big integers to be negative zero
If a big integer were to become negative zero, set the sign to instead
be positive. This prevents odd scenarios where users of signed big ints
would falsely think the result of some big int arithmetic is negative.
2022-02-06 15:49:54 +00:00
Andreas Kling
4d785b9aa0 LibJS: Mark Completion constructors with ALWAYS_INLINE
These were showing up in profiles.
2022-02-06 16:30:57 +01:00
Andreas Kling
41fe02e012 LibWeb: Rename "frame" to "browsing_context" in various places
We renamed the Frame class to BrowsingContext a while back, but forgot
to update some variable names.
2022-02-06 16:22:58 +01:00
Andreas Kling
5dd4b3eaaa LibWeb: Put ResolvedCSSStyleDeclaration debug spam behind a macro
Blowing up the debug console with a fajillion FIXME's whenever you
navigate in the web inspector is no fun.
2022-02-06 16:22:58 +01:00
Sviatoslav Peleshko
3caac65cc8 CrashReporter: Capture backtrace progress callback's arguments by value
Previously we captured them by reference, but when the deferred code
finally runs from an event loop, the references may be stale.
In that case, value and max of the progressbar are set with random
numbers.
If we were especially unlucky, the `frame_count` turned into a negative
int, and would crash at `VERIFY(min <= max)`.
2022-02-06 18:25:05 +03:30
Miika Hämynen
46ed6303a2 less: Add hotkeys f and b to scroll screen up/down 2022-02-06 13:44:53 +01:00
sin-ack
42a76b6c2d LibHTTP: Propagate and gracefully handle errors in Job
Most of these errors mean that we will fail the job, but it won't crash
the application, at least.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
3f614a8fca LibWebSocket: Switch to using Core::Stream
As LibTLS now supports the Core::Stream APIs, we can get rid of the
split paths for TCP/TLS and significantly simplify the code as well.
Provided to you free of charge by the Core::Stream-ification team :^)
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
d66c513131 Base: Replace the WebSocket demo target URL with a working one
websocket.org was shutdown somewhere in late 2021, switch to
websocket.events to make the demo work.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
8339415939 Base: Format the WebSocket demo page with prettier 2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
63b4c35ec7 WebSocket: Pledge rpath and unveil /etc/timezone
This is required for timezone stuff, otherwise we'd just crash.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
6f5ab30253 LibTLS: Remove some unused/unimplemented declarations 2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
aafc451016 Userland: Convert TLS::TLSv12 to a Core::Stream::Socket
This commit converts TLS::TLSv12 to a Core::Stream object, and in the
process allows TLS to now wrap other Core::Stream::Socket objects.
As a large part of LibHTTP and LibGemini depend on LibTLS's interface,
this also converts those to support Core::Stream, which leads to a
simplification of LibHTTP (as there's no need to care about the
underlying socket type anymore).
Note that RequestServer now controls the TLS socket options, which is a
better place anyway, as RS is the first receiver of the user-requested
options (though this is currently not particularly useful).
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
7a95c451a3 LibCore: Stop buffering when a zero-size slice is read regardless of EOF
The meaning of EOF depends on the underlying socket, but an empty slice
should terminate the buffering (otherwise we'd just spin forever).
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
9ee5107871 LibCore: Rewrite BufferedStream::read_until_any_of() with memmem
This function used to sometimes return the entire input instead of the
value up to the delimiter, fix that and rewrite it to be a bit more
readable.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
f4d841077d LibCore: Make sure BufferedSocket takes the buffer into account
pending_bytes() and can_read_without_blocking() should also take
the buffered data into account, otherwise we'll end up pretending that
the socket cannot be read from while it has buffered data.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
33a4048f55 LibCore: Add Core::Stream::Socket::set_notifications_enabled()
This is equivalent to Core::Socket::set_notifications_enabled(), and
serves to disable the on_ready_to_read() notifications, as the sockets
often implement these using the event loop, this method can help avoid
waking the event loop and spamming useless calls to on_ready_to_read().
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
07f444439c LibCore: Take StringViews by value in Stream::* function arguments 2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
8a1dfbd484 LibCore: Add a pure virtual parent to Core::Stream::BufferedSocket<T>
And declare a few of the stream classes in the forwarding header.
2022-02-06 13:10:10 +01:00
Ali Mohammad Pur
9cf1c382df AK: Replace 'consteval' with 'constexpr' in some Variant helpers
CLion and/or clangd didn't like the consteval and highlighted visit() as
an error, just replace it with constexpr as it makes no difference here.
2022-02-06 13:10:10 +01:00
sin-ack
04d68117c2 LibCore: Remove Core::LocalSocket :^) 2022-02-06 10:28:19 +01:00
sin-ack
0249c92313 LibCore: Use Core::Stream::LocalSocket in InspectorServerConnection 2022-02-06 10:28:19 +01:00
sin-ack
f823648bae LibCore: Use SystemServerTakeover functionality in LocalServer
This removes the duplicate code in
LocalServer::take_over_from_system_server and replaces it with
Core::take_over_accepted_socket_from_system_server.
2022-02-06 10:28:19 +01:00
sin-ack
259ed04087 LibCore: Implement LocalSocket::release_fd
release_fd() releases the fd associated with the LocalSocket it is
called on. This is analogous to release_value() on container objects in
AK, after which the object does not contain the value.
2022-02-06 10:28:19 +01:00
sin-ack
89d9a1afc0 LibCore+LibIPC: Move SystemServerTakeover.{h,cpp} to LibCore
This functionality is required by Core::LocalServer and LibIPC depends
on LibCore.

take_over_accepted_socket_from_system_server has also been renamed to
take_over_socket_from_system_server as the socket need not be accepted
before taking it over. :^)
2022-02-06 10:28:19 +01:00
Matthias-Sleurink
032ffbcf64 PixelPaint: Don't overwrite images with project file on save
The ImageEditor tracks whether it was loaded from an image
(the alternative being a project file.) If it was loaded from an image
file we redirect save project actions to save as instead.
2022-02-06 07:22:57 +00:00
BodgeMaster
e74e6087b0 Ports: Update nano to version 6.0
This is just a bump of the version number in a couple places.
Tested to work.
2022-02-06 07:16:59 +00:00
BodgeMaster
d49a516366 Ports: Update wget to version 1.21.2
This is another one where I just changed the version number and it
worked.
2022-02-06 03:20:25 +00:00
Morten Larsen
951e4490fb LibGfx: Avoid inclusion of xmmintrin.h on non-X86 architectures
Gamma.h includes xmmintrin.h, which is X86-only. The file contains
code in other places that is compiled conditionally on __SSE__, so the
same macro is used to determine inclusion of the header.
2022-02-06 03:15:00 +00:00
Morten Larsen
2c3b297895 Lagom: Exclude libraries with X86 code when building for macOS on Arm
The CMakeLists.txt for Lagom contains a few libraries and executables
with X86-specific code. By excluding those libraries, Lagom builds
for macOS on Arm as well. The places are marked FIXME to be removed
when the libraries will build for Arm.
2022-02-06 03:15:00 +00:00
Andreas Kling
d30cbf5d72 LibWeb: Remove unnecessary check for 0-sized fragments in InlineNode
We should no longer be generating empty fragments at the start and end
of an InlineNode, so we can drop this check.
2022-02-06 02:15:59 +01:00
Andreas Kling
3ad08a932c LibWeb: Only compute containing block rect once in InlineNode::paint() 2022-02-06 02:15:49 +01:00