Commit Graph

11737 Commits

Author SHA1 Message Date
Andreas Kling
6e221adade LibWeb: Send key events to the WebContent process
This makes contenteditable work in multi-process mode. :^)
2020-08-03 19:58:59 +02:00
Andreas Kling
ea9ac3155d Unicode: s/codepoint/code_point/g
Unicode calls them "code points" so let's follow their style.
2020-08-03 19:06:41 +02:00
Andreas Kling
b139fb9f38 Kernel: Use Userspace<T> in sys$link() and sys$symlink() 2020-08-03 18:40:28 +02:00
Andreas Kling
67fe92bc4f Meta: Add Nico Weber to the contributors list :^) 2020-08-03 18:37:24 +02:00
Tom
ad48bd1aca WindowServer: Bring window stack to front when clicking on frame
When clicking on a window's frame that is blocked by a modal
window, we want to bring the entire window stack to the front
regardless of where the user clicked in the frame (not just the
icon).
2020-08-03 18:34:39 +02:00
Tom
f4a5c9b6c2 Kernel: Consolidate timeout logic
Allow passing in an optional timeout to Thread::block and move
the timeout check out of Thread::Blocker. This way all Blockers
implicitly support timeouts and don't need to implement it
themselves. Do however allow them to override timeouts (e.g.
for sockets).
2020-08-03 18:23:00 +02:00
Tom
df52061cdb AK: Add more time convenience functions and comparison operators 2020-08-03 18:23:00 +02:00
Mathieu PATUREL
7d12e0c7f1 LibGUI: WidgetScrollable scrolls horizontally when shift is pressed 2020-08-03 18:16:49 +02:00
Tom
8b0b653471 LibIPC: Fix waiting for specific message
When waiting for a specific message, only consider messages
from the peer endpoint. Otherwise a message with the same id
for the local endpoint may be misinterpreted.

This fixes the Terminal sometimes hanging after bootup because
a local endpoint message is mistaken for the CreateMenuResponse
message.
2020-08-03 15:59:11 +02:00
Tom
c813bb7355 Kernel: Fix a few Thread::block related races
We need to have a Thread lock to protect threading related
operations, such as Thread::m_blocker which is used in
Thread::block.

Also, if a Thread::Blocker indicates that it should be
unblocking immediately, don't actually block the Thread
and instead return immediately in Thread::block.
2020-08-03 15:59:11 +02:00
Tom
df3c8267d4 AK: Fix adding timeval/timespec
tv_usec and tv_nsec should always be less than one second.
2020-08-03 15:59:11 +02:00
Nico Weber
18e8fd333c CppLexer: Actually give raw strings type RawString
This fixes a regrettable mistake in 9ee1edae2a.
No behavior change.
2020-08-03 15:54:33 +02:00
Andreas Kling
e27726dc92 LibWeb: Add the Document.documentElement API
Also change DOM::Document::document_element() to return an Element*
and not an HTML::HTMLHtmlElement since that's not the only kind of
documentElement we might encounter.
2020-08-03 13:30:18 +02:00
Ben Wiederhake
64a82100bd SystemMonitor: Provide new 'Inspect' action 2020-08-03 13:02:49 +02:00
Ben Wiederhake
b1f7632610 SystemMonitor: Use icon for 'Profile' action 2020-08-03 13:02:49 +02:00
Ben Wiederhake
45632986a4 SystemMonitor: Try to keep focus in 'Stacks' 2020-08-03 13:02:49 +02:00
Ben Wiederhake
cd39eea7a9 SystemMonitor: Split up kmalloc labels
Otherwise, the numbers overflow the space after a while.
2020-08-03 13:02:49 +02:00
Brian Gianforcaro
cb167ea388 Kernel: Use for-each loops in unveil syscall 2020-08-03 12:54:51 +02:00
Luke
bc15144972 LibWeb: Move contentEditable from Element to HTMLElement
HTMLElement is the only interface that includes ElementContentEditable
in the HTML specification. This makes sense, as Element is also a base
class for elements in other specifications such as SVG,
which definitely shouldn't be editable.

Also adds a test for the attribute based on what Andreas did in the
video that added it.
2020-08-03 12:47:58 +02:00
Brian Gianforcaro
64ba289cfb LibCore: ConfFile::read_entry should not sneakily write default entries
I noticed on boot, WindowServer was getting an veil error:

    [WindowServer(13:13)]: Rejecting path '/res/themes/Default.ini' since it hasn't been unveiled with 'c' permission.
    [WindowServer(13:13)]: 0xc014367f  _ZN6Kernel3VFS34validate_path_against_process_veilEN2AK10StringViewEi +681
    [WindowServer(13:13)]: 0xc01439d7  _ZN6Kernel3VFS12resolve_pathEN2AK10StringViewERNS_7CustodyEPNS1_6RefPtrIS3_EEii +163
    [WindowServer(13:13)]: 0xc0143d03  _ZN6Kernel3VFS4openEN2AK10StringViewEitRNS_7CustodyENS1_8OptionalINS_9UidAndGidEEE +121
    [WindowServer(13:13)]: 0xc016fbc4  _ZN6Kernel7Process8sys$openEPKNS_7Syscall14SC_open_paramsE +854
    [WindowServer(13:13)]: 0xc0164af8  syscall_handler +1320
    [WindowServer(13:13)]: 0xc0164541  syscall_asm_entry +49
    [WindowServer(13:13)]: 0x08097ca0  open_with_path_length +24
    [WindowServer(13:13)]: 0x08097cf8  open +63
    [WindowServer(13:13)]: 0x080a3c59  fopen +31
    [WindowServer(13:13)]: 0x0806abf0  _ZN4Core10ConfigFile4syncEv +48
    [WindowServer(13:13)]: 0x0806af6a  _ZN4Core10ConfigFileD2Ev +16
    [WindowServer(13:13)]: 0x08093e2a  _ZN3Gfx17load_system_themeERKN2AK6StringE +1869
    [WindowServer(13:13)]: 0x08048633  main +491
    [WindowServer(13:13)]: 0x08048dae  _start +94

With some digging I found out that the ConfigFile class was causing
trying to flush writes of default values, not present in the .ini
file back to disk on destruction of the object.

This sneaky behavior from ConfigFile seems to violate the public facing
semantics of the function (it's const). It also makes it very hard to reason
about the system with technologies like unveil where we are trying to
explicitly state what is exposed to apps, how those exposed items can be
used.

The functionality also doesn't seem to be all that useful, as we'll just
return the default value from the API's anyway.

This change removes the write back of default values.
2020-08-02 21:11:28 +02:00
Muhammad Zahalqa
615ba0f368
AK: Fix overflow and mixed-signedness issues in binary_search() (#2961) 2020-08-02 21:10:35 +02:00
Brian Gianforcaro
2242f69cd6 Kernel: Use Userspace<T> in unveil syscall 2020-08-02 20:54:17 +02:00
Brian Gianforcaro
9db5a1b92f Kernel: Use Userspace<T> in sched_getparam syscall 2020-08-02 20:53:48 +02:00
Tom
f011c420c1 Kernel: Fix signal delivery when no syscall is made
This fixes a regression introduced by the new software context
switching where the Kernel would not deliver a signal unless the
process is making system calls. This is because the TSS no longer
updates the CS value, so the scheduler never considered delivery
as the process always appeared to be in kernel mode. With software
context switching we can just set up the signal trampoline at
any time and when the processor returns back to user mode it'll
get executed. This should fix e.g. killing programs that are
stuck in some tight loop that doesn't make any system calls and
is only pre-empted by the timer interrupt.

Fixes #2958
2020-08-02 20:50:29 +02:00
Brian Gianforcaro
6e54d0c072 AK: Remove relative_paths test from TestLexicalPath
This test appears to be testing functionality that doesn't
exist. Just remove it.

Closes old bug #2388

CC @bugaevc
2020-08-02 20:48:37 +02:00
Brian Gianforcaro
1f7c61b15f LibDebug: Disable and cleanup DebugSession breakpoints on destruction
Breakpoints need to be disabled before we detach from the debugee.

I noticed this while looking into the fact that if you continue
executing a program in sdb (/bin/ls) where you had previously
set a breakpoint, it would crash on sdb exit once the debugee died
with an assert on HashMap destruction where we were iterating
while clearing is set. This change also happens to fix this assert.
2020-08-02 19:26:58 +02:00
Matthew Olsson
81187c4ead LibWeb: Fix some SVG crashes/hangs
- parse_flag now only parses one digit instead of consuming an entirely
valid number
- match_number => match_coordinate
- match_coordinate now returns true if `ch()` is '.'
- parse_number no longer matches a +/-
- Don't crash when encountering one of the three unsupported path
commands. Instead, just skip them. No reason to crash the browser over a
silly SVG element :)
2020-08-02 19:16:40 +02:00
AnotherTest
97256ad977 ProtocolServer+LibTLS: Pipe certificate requests from LibTLS to clients
This makes gemini.circumlunar.space (and some more gemini pages) work
again :^)
2020-08-02 18:57:51 +02:00
AnotherTest
9d3ffa096a LibTLS: Add (basic) support for sending client certificates 2020-08-02 18:57:51 +02:00
AnotherTest
e54a5b7fb8 LibCrypto: Format the comments in ASN1/PEM.h correctly 2020-08-02 18:57:51 +02:00
Ben Wiederhake
3f2b78a063 Build: Build libstdc++ in parallel 2020-08-02 18:50:28 +02:00
Ben Wiederhake
cdcc09f63b Travis: 'configure' is too chatty for CI
./configure generates about 3500 lines in a few seconds. Noone will ever read
those lines and they make loading the Travis webpage slower. And if there is
ever a problem, it will be because the Travis base image changed (which happens
only rarely) in a way that interferes with compiling gcc (which is incredibly
unlikely), or we update gcc (which happens very rarely) and gcc doesn't like
the Travis iamge (which again is incredibly unlikely). In all of these cases,
finding the culprit will be self-evident.
2020-08-02 18:50:28 +02:00
Ben Wiederhake
32158c45e4 Travis: Extra safety, build Serenity in parallel
This won't have much impact, because it's *only* Serenity that will be built
in parallel. This should save about a minute.
2020-08-02 18:50:28 +02:00
Andreas Kling
7811cf3520 LibWeb: Implement the Element.contentEditable IDL attribute 2020-08-02 17:34:50 +02:00
Andreas Kling
07e13e9868 LibWeb: Only allow editing of elements with contenteditable="true"
We now respect the contenteditable HTML attribute and only let you
edit content inside explicitly editable elements.
2020-08-02 17:34:50 +02:00
Andreas Kling
8b16c61ff8 LibWeb: Add very basic backspace support to content editing 2020-08-02 17:34:50 +02:00
Andreas Kling
bc299754f6 LibWeb: Allow inserting text at the cursor by typing characters :^)
This works everywhere right now, but it's obviously not going to stay
that way forever. :^)

Note that this does not advance the cursor correctly for whitespace
since the cursor is DOM-based and doesn't take whitespace collapsing
into account yet.
2020-08-02 17:34:50 +02:00
Andreas Kling
2c679d0c8b LibWeb: Add a blinking text cursor :^)
Each Web::Frame now has a cursor that sits at a DOM::Position. It will
blink and look like a nice regular text cursor.

It doesn't really do anything yet, but it will eventually.
2020-08-02 17:34:50 +02:00
Andreas Kling
e496a74bb3 LibWeb: Add a basic DOM::Position class
This will be used for editable content. :^)
2020-08-02 17:34:50 +02:00
Ben Wiederhake
58240aedd9 Tests: License headers, clang-format, clearer output 2020-08-02 17:15:36 +02:00
Ben Wiederhake
29eceebdbf Tests: Build automatically, fix compilation errors 2020-08-02 17:15:36 +02:00
Tom
538b985487 Kernel: Remove ProcessInspectionHandle and make Process RefCounted
By making the Process class RefCounted we don't really need
ProcessInspectionHandle anymore. This also fixes some race
conditions where a Process may be deleted while still being
used by ProcFS.

Also make sure to acquire the Process' lock when accessing
regions.

Last but not least, there's no reason why a thread can't be
scheduled while being inspected, though in practice it won't
happen anyway because the scheduler lock is held at the same
time.
2020-08-02 17:15:11 +02:00
Tom
5bbf6ed46b Kernel: Fix some crashes due to missing locks
We need to hold m_lock when accessing m_regions.
2020-08-02 17:15:11 +02:00
Tom
728de56481 Kernel: Prevent recursive calls into the scheduler
Upon leaving a critical section (such as a SpinLock) we need to
check if we're already asynchronously invoking the Scheduler.
Otherwise we might end up triggering another context switch
as soon as leaving the scheduler lock.

Fixes #2883
2020-08-02 17:15:11 +02:00
Andreas Kling
a19304c9d6 Kernel: Remove a bunch of duplicate forward declarations 2020-08-02 11:01:00 +02:00
Andreas Kling
e526fa572a Kernel: Convert some more syscalls to Userspace<T>
These are really straightforward when all the helpers just work.
2020-08-02 11:01:00 +02:00
Andreas Kling
9bcf0b70cb AK: Hack Userspace<T> to not break Qt Creator syntax highlighting
This is a very cheesy patch and I don't like it, but as Qt Creator does
not grok C++20 concepts yet, this makes it possible to still use syntax
highlighting.

We'll remove this hack the moment it stops being a problem. Note that
it doesn't actually affect the build since we use GCC, not Clang.
2020-08-02 11:01:00 +02:00
Ben Wiederhake
597b0c9efd WindowServer: Redraw MenuApplets on add/delete 2020-08-02 11:00:50 +02:00
Brian Gianforcaro
2a74c59dec Kernel: Use Userspace<T> in pledge syscall 2020-08-02 10:56:43 +02:00
Brian Gianforcaro
ba4cf59d04 Kernel: Use Userspace<T> in setkeymap syscall 2020-08-02 10:56:33 +02:00