Commit Graph

12984 Commits

Author SHA1 Message Date
Andreas Kling
b62043dbca LibWeb: Protect LayoutCheckBox against crashes after event dispatch
After dispatching a "change" event due to the checked state being
modified, we may have been removed from the layout tree.

Make LayoutCheckBox protect itself to prevent this from crashing.

Also, add a little test page for checkboxes. :^)
2020-09-11 18:42:43 +02:00
Andreas Kling
71092226bd LibWeb: Dispatch a "change" event when <input> checked state changes 2020-09-11 18:42:43 +02:00
Andreas Kling
f2431adf47 LibWeb: Add basic support for <input type=checkbox>
This is implemented entirely inside LibWeb, there is no GUI::CheckBox
widget instantiated, unlike other input types. All input types should
be moved to this new style of implementation.
2020-09-11 18:42:43 +02:00
Andreas Kling
d6889ecf35 LibWeb: Allow layout nodes to receive and track mouse events
To implement form controls internally in LibWeb (necessary for multi
process forms), we'll need the ability to handle events since we can't
rely on LibGUI widgets anymore.

A LayoutNode can now override wants_mouse_events() and if it returns
true, it will now receive mousedown, mousemove and mouseup events. :^)
2020-09-11 18:42:43 +02:00
Andreas Kling
5782099106 LibWeb: Add basic support for boolean IDL attributes :^) 2020-09-11 18:42:43 +02:00
Andreas Kling
e7432efe24 LibWeb: Add the "checked" and "disabled" HTML attributes 2020-09-11 18:42:43 +02:00
Andreas Kling
1a2b626746 LibGUI+LibGfx: Move check box painting to Gfx::StylePainter
This will allow us to render check boxes from other places. :^)
2020-09-11 18:42:43 +02:00
pkotzbach
072e94caa2
LibCore: Fixed DeferredInvoke debug message (#3456) 2020-09-11 18:41:50 +02:00
asynts
3c03ce0c80 LibCompress: Add unit tests for CanonicalCode. 2020-09-11 16:07:45 +02:00
asynts
5c9c0082a1 LibCompress: Move CanonicalCode out of DeflateDecompressor. 2020-09-11 16:07:45 +02:00
asynts
49e6ff8958 LibCompress: Remove unnecessary InputBitStream. 2020-09-11 16:07:45 +02:00
asynts
4af8eea56f LibCompress: Return Optional from decompress_all method. 2020-09-11 16:07:45 +02:00
asynts
7e02cad476 LibCompress: Use OutputMemoryStream in decompress_all methods. 2020-09-11 16:07:45 +02:00
asynts
b0ba7a897f Userland: gunzip if filename doesn't end in .gz append it.
This is the behaviour of gzip on my Linux system.
2020-09-11 16:07:45 +02:00
asynts
049f709d0b AK: Calculate the chunk index correctly in DuplexMemoryStream. 2020-09-11 16:07:45 +02:00
Andreas Kling
dbd2fa8b8f HackStudio: Use widget override cursors 2020-09-11 16:06:00 +02:00
Andreas Kling
d76b2d0baa LibGUI: Use widget override cursors in ColorInput 2020-09-11 14:51:02 +02:00
Andreas Kling
cab422b441 LibGUI: Use widget override cursors in HeaderView 2020-09-11 14:50:30 +02:00
Andreas Kling
69adaf3308 LibGUI: Use widget override cursors in GUI::ResizeCorner 2020-09-11 14:47:38 +02:00
Andreas Kling
8f5b92865d HexEditor: Use widget override cursors 2020-09-11 14:37:30 +02:00
Andreas Kling
5872cb398c LibWeb: Use widget override cursors 2020-09-11 14:28:05 +02:00
Andreas Kling
7a2faecc15 LibGUI: Use widget override cursors in GUI::TextEditor 2020-09-11 14:26:37 +02:00
Andreas Kling
e2050ea0ce LibGUI: Use widget override cursors in GUI::Splitter 2020-09-11 14:26:37 +02:00
Andreas Kling
f475fa3f54 LibVT: Show an I-beam cursor over TerminalWidget
..and implement this using the new widget override cursor mechanism.
2020-09-11 14:26:37 +02:00
Andreas Kling
cf429a788c LibGUI: Add Widget override cursor concept
We got ourselves into a mess by making widgets override the window
cursor whenever they wanted a custom cursor. This patch introduces a
better solution to that issue: per-widget override cursors.

Each widget now has an override cursor that overrides the window
cursor when that widget is hovered.
2020-09-11 14:26:37 +02:00
Andreas Kling
b4f307f982 LibGUI+WindowServer: Rename window "override cursor" to just "cursor"
Let's just say each window has a cursor, there's not really overriding
going on.
2020-09-11 14:26:37 +02:00
Sergey Bugaev
40fbdd4e9e Ports: Add libffi 2020-09-10 19:57:38 +02:00
Tom
0fab0ee96a Kernel: Rename Process::is_ring0/3 to Process::is_kernel/user_process
Since "rings" typically refer to code execution and user processes
can also execute in ring 0, rename these functions to more accurately
describe what they mean: kernel processes and user processes.
2020-09-10 19:57:15 +02:00
Tom
19ffd9d677 Kernel: Fix detecting in what ring a crash happened
The ring is determined based on the CS register. This fixes crashes
being handled as ring 3 crashes even though EIP/CS clearly showed
that the crash happened in the kernel.
2020-09-10 19:57:15 +02:00
Andreas Kling
0f9be82826 LibGfx: Move StandardCursor enum to LibGfx
This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
2020-09-10 19:25:13 +02:00
Andreas Kling
c063a02979 Base: Improved I-beam cursor
Make the I-beam cursor white with a black outline, like all the other
cursors. This makes it show up on dark backgrounds. :^)
2020-09-10 19:05:01 +02:00
Andreas Kling
e860a9aa80 LibGUI: Unregister AbstractView from model on destruction
It was possible to leave stale view pointers in the model after a view
was destroyed while attached to a model.
2020-09-10 18:45:00 +02:00
Andreas Kling
4e0df06f86 IRCClient: Use NonnullRefPtr<IRCClient> throughout
To protect against mishaps during app exit teardown, make sure everyone
who needs to be is a co-owner of the IRCClient object.

Fixes #3451.
2020-09-10 18:45:00 +02:00
Sergey Bugaev
039e529dbe Userland: Fix a signal race condition
It has been possible for a signal to arrive in between us checking
g_interrupted and exiting - sucessfully, even though we were interrupted.

This way, if a signal arrives before we reset the disposition, we
will reliably check for it later; if it arrives afterwards, it'll
kill us automatically.
2020-09-10 16:00:11 +02:00
asynts
0055a28710 AK: Replace LogStream operator for ReadonlyBytes with dump_bytes.
It wasn't actually possible to call

    const LogStream& operator<<(const LogStream&, ReadonlyBytes);

because it was shadowed by

    template<typename T>
    const LogStream& operator<<(const LogStream& stream, Span<T> span);

not sure how I didn't find this when I added the overload.

It would be possible to use SFINAE to disable the other overload,
however, I think it is better to use a different method entirely because
the output can be very verbose:

    void dump_bytes(ReadonlyBytes);
2020-09-10 14:15:02 +02:00
Avery
06218a4074 IPv4: Truncate raw socket reads past buffer length
In addition to being the proper POSIX etiquette, it seems like a bad idea
for issues like the one seen in #3428 to result in a kernel crash. This patch
replaces the current behavior of failing on insufficient buffer size to truncating
SOCK_RAW messages to the buffer size. This will have to change if/when MSG_PEEK
is implemented, but for now this behavior is more compliant and logical than
just bailing.
2020-09-10 12:03:56 +02:00
Nico Weber
61060c0da8 LibVT: Let Terminal keep history in a circular buffer
This makes Terminal::scroll_up() O(1) instead of O(n) in the
size of the history. (It's still O(n) in the size of visible
lines.)

Reduces time to run `disasm /bin/id` with the default terminal
window size from 530ms to 409ms (min-of-5) on my system.
2020-09-10 12:01:26 +02:00
Nico Weber
90d9c83067 LibVT: Let Terminal only expose history_size, not storage 2020-09-10 12:01:26 +02:00
AnotherTest
927e2fc6bc Shell: Do not reset the terminal attributes when command is run in bg
Also removes a FIXME that no longer applies.
2020-09-10 11:20:22 +02:00
AnotherTest
c296bcc1d9 Base: Tweak Shell(5) manpage a bit
Someone brought to my attention that "or missing" is not correct there.
2020-09-10 11:20:22 +02:00
Devashish Jaiswal
2a3166e523
JPGLoader: Check existence of Huffman tables in scan header segment (#3442)
DC and AC table IDs read in the scan header segment weren't validated
against the IDs of Huffman tables read in the DHT segment. This caused
an OOB read when a Huffman table was accessed using the ID read in the
scan header segment. Furthermore, the decoder now replaces the old DC
or AC table if a redefinition has been found prior to the scan header.

Fixes #3439.
2020-09-10 11:20:04 +02:00
Andreas Kling
d830c107ce LibJS: Deal with a FIXME in Shape::ensure_property_table()
Prevent GC while messing with the shape transition chain.
2020-09-09 21:34:02 +02:00
Andreas Kling
606f83436d test-js: Catch SIGINFO and dump the current test name + pass/fail/skip
This is pretty handy if the JS tests take a long time to run and you
wonder what they're doing. :^)
2020-09-09 21:10:23 +02:00
Andreas Kling
f8e59addf7 Kernel+LibC+UE: Introduce SIGINFO (generated with ^T)
This signal is ignored by default, but can be caught to implement state
reporting a la BSD. :^)
2020-09-09 21:10:23 +02:00
Andreas Kling
687aad01be test-js: Add -g option to run a garbage collection on each allocation
This is very slow, but very good at flushing out GC bugs. :^)
2020-09-09 21:10:23 +02:00
Nico Weber
01ff17d374 LibGUI: Do not paint scrollbar button highlight for scrollbars without scrubber
If a scrollbar doesn't have a scrubber (because the view it scrolls is
large enough to display all its contents without scrolling), then
it ignores all clicks. We shouldn't draw a hover highlight that suggests
clickability in that case.
2020-09-09 21:04:15 +02:00
AnotherTest
34d210ecf5 Shell: Update the Shell(5) manpage
This patchset adds the following to the manpage:
- Mention `if` expressions.
- Add section about subshells
- Mention that control structures can now be used as commands
- Update the grammar.
- Fix small header size mistake with "Example"'s being larger than their
  containing sections.
2020-09-09 20:35:21 +02:00
AnotherTest
2488815bdb Shell: Add some tests for subshells 2020-09-09 20:35:21 +02:00
AnotherTest
b194d79c53 Shell: Add the (now) free subshell support 2020-09-09 20:35:21 +02:00
AnotherTest
0fd8d5ad3d Shell: Add a test for control structures as commands 2020-09-09 20:35:21 +02:00