Commit graph

13449 commits

Author SHA1 Message Date
asynts 59e7ffa86d AK: Make the return type of dbgputstr consistent. 2020-10-04 19:18:32 +02:00
Andreas Kling 4cf3a1eb41 Browser: Remove dbgln() statement that was crashing on startup
Don't have time to dig into this right now, but let's unbreak Browser.
2020-10-04 17:12:11 +02:00
Andreas Kling 6f5322409d Browser: Fix build after dbgf() -> dbgln() rename 2020-10-04 17:09:01 +02:00
asynts e089855af0 UserspaceEmulator: Remove remaining printf calls. 2020-10-04 17:04:55 +02:00
asynts d5ffb51a83 AK: Don't add newline for outf/dbgf/warnf.
In the future all (normal) output should be written by any of the
following functions:

    out    (currently called new_out)
    outln
    dbg    (currently called new_dbg)
    dbgln
    warn   (currently called new_warn)
    warnln

However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)

I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
2020-10-04 17:04:55 +02:00
Andreas Kling 4237089a21 LibJS: Remove unused Heap::interpreter() 2020-10-04 17:03:33 +02:00
Andreas Kling bfa97b9357 LibJS: Remove Cell::interpreter()
It's never necessary to find the current Interpreter for a given Cell
anymore. Get rid of this accessor.
2020-10-04 17:03:33 +02:00
Andreas Kling a007b3c379 LibJS: Move "strict mode" state to the call stack
Each call frame now knows whether it's executing in strict mode.
It's no longer necessary to access the scope stack to find this mode.
2020-10-04 17:03:33 +02:00
Andreas Kling f41b5a4535 AK: Add Formatter for FlyString :^) 2020-10-04 17:03:33 +02:00
asynts 616af36d91 Browser: Use format functions instead of printf. 2020-10-04 14:23:25 +02:00
asynts b23f66e151 AK: Add formatter for URL. 2020-10-04 14:23:25 +02:00
asynts aa283d235a AK: Add special formatter for char.
When we format a character we want to put the ascii value and not the
decimal value. The old behaviour can be obtained with '{:d}'.
2020-10-04 14:23:25 +02:00
Matthew Olsson 6eb6752c4c LibJS: Strict mode is now handled by Functions and Programs, not Blocks
Since blocks can't be strict by themselves, it makes no sense for them
to store whether or not they are strict. Strict-ness is now stored in
the Program and FunctionNode ASTNodes. Fixes issue #3641
2020-10-04 10:46:12 +02:00
Peter Elliott 1b3f9c170c Userland: tar: support extracting gzipped files 2020-10-04 00:16:40 +02:00
Peter Elliott b7c7c80ee2 Userland: Add tar command 2020-10-04 00:16:40 +02:00
Peter Elliott 99ee93149c LibTar: Create LibTar and TarStream
TarStream parses the contents of a tar file from an InputStream
2020-10-04 00:16:40 +02:00
asynts 1f90e4ab8d AK: Replace a write_or_error call with write.
Implicit conversions suck...
2020-10-03 20:16:26 +02:00
asynts b33921531d AK: Make Buffered<T> non-copyable. 2020-10-03 20:16:26 +02:00
Andreas Kling e64f43c3a7 LibGUI: Fix null pointer dereference in enter/leave event handling
If an enter/leave event is delivered to a widget after it is removed
from a window, we can't just assume a window is gonna be there.

Fixes #3669.
2020-10-03 19:47:56 +02:00
Andreas Kling 3b2120e7b6 LibGUI: Don't paint borders for invisible bars in ToolBarContainer 2020-10-03 19:43:25 +02:00
asynts 9f00afd8cd AK: Add missing Bytes::slice call in Buffered<T>. 2020-10-03 17:33:14 +02:00
Andreas Kling 00f47bba23 LibGUI: Don't accomodate invisible children in ToolBarContainer height
Skip over invisible children so they don't take up vertical space in
the container. Also make sure we update the preferred size whenever the
widget layout is invalidated.

Fixes #3139.
2020-10-03 14:01:37 +02:00
AnotherTest 2c3842bfe6 Shell: Fix badly worded help string for '--format' 2020-10-03 12:40:03 +02:00
Linus Groh bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
Emanuele Torre 4e86c34ef0 LibC: Remove unnecessary fallthrough comments.
A "fallthrough comment" or `[[fallthrough]]` is only required after
non-empty `case`s.
2020-10-03 12:35:40 +02:00
Luke 9dee140a9f LibWeb: Add empty IDL bindings for current SVG elements
Nothing in them right now as the classes don't contain the IDL
methods.
2020-10-03 00:30:49 +02:00
asynts 6351a56d27 AK+Format: Do some housekeeping in the format implementation. 2020-10-02 20:48:19 +02:00
AnotherTest ac5e08a541 HackStudio: Abstract away language-server details
This commit moves all the logic that deals with the language server
(from HackStudio) into a LanguageClient class, provides some functions
to make constructing them easier, and makes all language servers use a
singular IPC definition.
Also fixes the FIXME about making the autocompletion async.
This makes adding language servers in the future significantly less
duplicate-y, and significantly easier :^)
2020-10-02 20:47:57 +02:00
Andreas Kling 44f9637e20 Browser: Add a special context menu for images
Now, right-clicking on an image allows you to open that image in this
tab or a new tab. You can also copy the image URL, and even copy the
image itself to the clipboard! :^)

Copying to the clipboard will not work in a multi-process context yet,
since we need to send the image bitmap across the IPC boundary and this
patch does not do that.
2020-10-02 19:03:10 +02:00
Andreas Kling 91b49dd9d0 LibWeb: Add a PageClient callback for image context menu requests
When the user right-clicks on an image, you might want to show a
special context menu, separate from the regular link context menu.

This patch only implements enough of the functionality to get this
working in a single-process context.
2020-10-02 19:02:47 +02:00
Andreas Kling d00bfd0eaa Browser: Move the opening of a download window to its own function
This should probably grow into a proper download manager at some point,
but for now let's at least move it out of the context menu callback.
2020-10-02 19:00:45 +02:00
Andreas Kling fa18baf3e8 LibJS: Add Value::is_nullish() 2020-10-02 18:01:27 +02:00
Nico Weber ef1b21004f Everywhere: Fix typos
Mostly in comments, but sprintf() now prints "August" instead of
"Auguest" so that's something.
2020-10-02 16:03:17 +02:00
Tom 7399874479 AK: Add trivial structure validation to SharedBuffer
If we're sharing buffers, we only want to share trivial structures
as anything else could potentially share internal pointers, which
most likely is going to cause problems due to different address
spaces.

Fix the GUI::SystemTheme structure, which was not trivial, which
is now caught at compile time.

Fixes #3650
2020-10-02 15:38:07 +02:00
Tom 87f20f704c Kernel: Add checks for is_trivially_copyable to copy_to/from_user
If we're copying structures, we only ever want to copy trivially
copyable structures.
2020-10-02 15:38:07 +02:00
Tom bb92eab9ce AK: Add is_trivial and is_trivially_copyable 2020-10-02 15:38:07 +02:00
Linus Groh 91bcad7cce Base: Add missing options to the Shell(1) man page 2020-10-02 14:40:54 +02:00
asynts ba3488a6d5 UserspaceEmulator: Replace printf usages with format.
This replaces almost all usages. Some have to remain because 'outf'
always appends a newline. (It inherits this behaviour from LogStream.)
2020-10-02 13:44:42 +02:00
asynts fb7a94c959 AK: Add formatter for pointer types. 2020-10-02 13:44:42 +02:00
asynts ebafc5b4d2 AK: Add formatter for boolean values. 2020-10-02 13:44:42 +02:00
utku 7e9cd8a860
Keymaps: Add Colemak keymap (#3658)
Leave CapsLock as is, as the Colemak Windows driver also does
(Colemak originally maps CapsLock as Backspace).
2020-10-02 13:44:16 +02:00
Tibor Nagy 18c67b4002 LibGUI: Fix 1px misalignment of ColorButton selections in ColorPicker
Also use shrunken() to calculate the selection rects.
2020-10-02 13:08:32 +02:00
zilrich a2ffe95a8c
Meta: Update OpenSUSE build dependencies (#3655) 2020-10-02 13:08:06 +02:00
AnotherTest 254d66cd81 Shell: Assert that the same pid is not given to waitpid()
Theoretically, this assertion should never trip (at least, on serenity
where we don't really reuse PIDs).
This change should be considered temporary, until we figure out whether
waitpid() is being called twice (and succeeding) for one given PID.
2020-10-01 21:20:14 +02:00
AnotherTest 519d1811fd Shell: Wait for *any* child to change state when receiving a SIGCHLD
This really just works around the core issue, which is that we have no
reliable way to know exactly who raised the signal (yet).
Fixes #3645, in a very weird (yet apparently standard) way.
2020-10-01 21:20:14 +02:00
AnotherTest a7828434c0 Shell: Sneak a way into being a session leader 2020-10-01 21:20:14 +02:00
Tibor Nagy 422cb50e4e Userland: Fix buffer overflow in unzip
It's not a great idea reading file names into a 4 byte sized buffer.
2020-10-01 21:15:35 +02:00
Andreas Kling bd5abbc454 LibJS: Fix fatal mistake in HeapBlock::cell_from_possible_pointer()
When scanning for potential heap pointers during conservative GC,
we look for any value that is an address somewhere inside a heap cell.

However, we were failing to account for the slack at the end of a
block (which occurs whenever the block storage size isn't an exact
multiple of the cell size.) Pointers inside the trailing slack were
misidentified as pointers into "last_cell+1".

Instead of skipping over them, we would treat this garbage data as a
live cell and try to mark it. I believe this is the test-js crash that
has been terrorizing Travis for a while. :^)
2020-10-01 21:07:12 +02:00
Andreas Kling 0245e0f03a DevTools: Remove VisualBuilder and FormCompiler
This functionality is being moved to HackStudio so let's not confuse
people by keeping the old stuff around.
2020-10-01 21:07:12 +02:00
Andreas Kling 6c9a3ecf42 LibIPC: Silence a warning when compiling with gcc -O0 2020-10-01 19:16:35 +02:00