Commit graph

18655 commits

Author SHA1 Message Date
Andreas Kling
a959ccc1d0 Meta: Add link to Discord in CONTRIBUTING.md 2021-04-13 18:27:36 +02:00
Andreas Kling
b08d4ccd56 Utilities: Remove the "html" program
This is not used for anything, it was just a simple test program for
LibWeb back in the early days (before Browser existed.)
2021-04-13 18:24:47 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Timothy Flynn
86bdfa1edf Browser: Implement spec-compliant cookie storage
https://tools.ietf.org/html/rfc6265#section-5.3

This includes a bit of an update to how cookies are first parsed. The
storage spec requires some extra information from the parsing steps than
just the actual values that were parsed. For example, it needs to know
whether Max-Age or Expires (or both) were specified to give precedence
to Max-Age. To accommodate this, the parser now uses an intermediate
struct for storing this information. The final Cookie struct is not
created until the storage steps.

The storage itself is also updated to be keyed by a combo of the cookie
name, domain, and path.

Retrieving cookies was updated to use the spec's domain-matching
algorithm, but otherwise is not written to the spec yet. This also does
not handle evicting expired cookies yet.
2021-04-13 15:52:50 +02:00
Idan Horowitz
a0111f6a3e Meta: Enable pull_request_target context for the notify_discord action
While we did allow the notify_discord job to run inside the context,
we didnt ask github to run in that context. This commit also uses the
"action-wait-for-check" sub-action to ensure the posted build results
are accurate for pull requests (since the build workflow is done in a
separate context for PRs)
2021-04-13 15:51:44 +02:00
Linus Groh
45133d8ada LibJS: Unset m_unwind_until_label in stop_unwind()
I don't see a reason to keep this intact, that might only surprise us
down the line...
2021-04-13 15:40:52 +02:00
Linus Groh
4ee965f916 LibJS: Add set_exception() and change throw_exception() to take a reference
Sometimes we just want to set m_exception to some value we stored
previously, without really "throwing" it again - that's what
set_exception() does now. Since we have clear_exception(), it does take
a reference, i.e. you don't set_exception(nullptr). For consistency I
updated throw_exception() to do the same.
2021-04-13 15:40:52 +02:00
Linus Groh
f2abe42ecb LibJS: Update empty TryStatement result value to undefined
It's what the spec wants us to do, although I'm not sure if it has an
observable effect anywhere, as we don't expose empty values. Let's do it
anyway.
2021-04-13 15:40:52 +02:00
Linus Groh
7cbede4342 LibJS: Fix return value of TryStatement with finalizer
Previously we would always return the result of executing the finalizer,
however the spec dictates the finalizer result must only be returned for
a non-normal completion.
I added some more comments along the way, which should make it more
clear what's going on - the unwinding and exception flow isn't super
straightforward here.
2021-04-13 15:40:52 +02:00
Linus Groh
e8cbcc2fbf LibJS: Replace two more uses of unwind(ScopeType::None) with stop_unwind()
Same thing, but a lot more clear.
2021-04-13 15:40:52 +02:00
Itamar
f52c3cabcf HackStudio: Add ClassView tab for viewing classes in a tree structure
This enables the user to view and navigate classes with a TreeView that
is updated by the LanguageServer as it parses the code.

It offers a new neat way to view the project's structure :^)
2021-04-13 15:16:27 +02:00
Itamar
5adfcd54d8 LanguageServers: Only notify client about updated declarations
If the declarations haven't changed since we last notified the client,
then there's no need to do so.
2021-04-13 15:16:27 +02:00
Itamar
667926df73 HackStudio: Store known symbol declarations in ProjectDeclarations
They were previously stored inside the Locator widget. I moved them to
the globally visible ProjectDeclarations class so they can also be used
by other widgets.
2021-04-13 15:16:27 +02:00
Itamar
b87791cada LibCpp: Add 'Namespace' and 'Member' declaration types 2021-04-13 15:16:27 +02:00
Itamar
c6c83bd80e HackStudio+LibCpp: Include class members in Locator 2021-04-13 15:16:27 +02:00
tuqqu
c8ad1df143 LibJS: Array.from mapFn fixes + thisArg support
* Callback mapFn now properly supports second argument (index)
* Support of thisArg to be passed as "this" in vm.call
* Tests for all cases
2021-04-13 15:16:16 +02:00
FalseHonesty
2ed5d19407 LibGUI+HackStudio: Add way to tell FilePicker to open a folder
This now means that when trying to open a folder, one can click on
the folder and press open instead of having to actually step into
the desired folder. Of course, it also means it won't let you open
non-directories anymore.
2021-04-13 15:16:07 +02:00
Brendan Coles
ce010de74f LibC: getaddrinfo: Set addrinfo sin_port to 0 if service arg is NULL 2021-04-13 15:10:14 +02:00
Andreas Kling
bf1ef6533c FileManager+FileOperation: Show byte progress of current file
What I meant for the GUI progress bars to show:

- Bytes copied of the current file
- Files copied of the total set

What it actually showed:

- Bytes copied of the total bytes
- Files copied of the total set

This patch fixes it by showing byte progress of the current file
instead of byte progress of total bytes.
2021-04-13 10:12:50 +02:00
Andreas Kling
1ca22b46f9 LibGUI: Allow GUI::ProgressBar to have min() == max() 2021-04-13 10:12:50 +02:00
Andreas Kling
a5420ee3d0 FileManager: Use a Core::File for the FileOperation pipes
Instead of popen()/pclose(), we now open the pipes manually and wrap
them in a friendly Core::File object.
2021-04-13 10:12:50 +02:00
Andreas Kling
f54e290548 FileManager: Use FileOperation to perform drag&drop copy out-of-process
And display the progress of the copy operation in a separate window. :^)

Note that this patch only updates the drag&drop code path to use the new
mechanism. We still have to go through FileManager and make use of this
everywhere.

We also need to support additional operations, like Move, Delete, etc.

Still, this is quite cool! :^)
2021-04-13 10:12:50 +02:00
Andreas Kling
4205038c45 FileOperation: Add a new helper program for out-of-process file ops
This is a helper program for FileManager that performs a file operation
in a separate process and reports progress on standard out.

This initial implementation only supports the "Copy" operation and does
not do any detailed error handling.
2021-04-13 10:12:50 +02:00
breakgimme
42abda2a19
Keymaps: Add pl keymap (#6282) 2021-04-13 00:06:18 +02:00
jacob gw
42e63d0a94 Shell: flush stderr and stdout when using builtins
This fixed some tests that were failing.
Thanks @alimpfard for this fix!
2021-04-13 00:02:46 +02:00
jacob gw
cb22a6642d Shell: add type builtin 2021-04-13 00:02:46 +02:00
Brian Gianforcaro
1d7a0ab5ea Kernel: Mark s_syscall_table const so it ends up in ro_data. 2021-04-12 23:56:57 +02:00
Gunnar Beutner
84ad8a51d3 Ports: Link curl against openssl and disable non-blocking I/O
For some reason curl complains that SSL_connect() fails when
non-blocking I/O is enabled. With blocking I/O it works just
fine though.
2021-04-12 22:44:49 +02:00
Gunnar Beutner
317b2d7f92 Ports: Remove configure option which disables getattrinfo() for curl 2021-04-12 22:44:49 +02:00
Gunnar Beutner
f34d951f28 Ports: Fix for building openssh 2021-04-12 22:44:49 +02:00
Gunnar Beutner
30b038f8d9 LibC: Implement getaddrinfo(), freeaddrinfo(), gai_strerror() and getnameinfo() 2021-04-12 22:44:49 +02:00
Gunnar Beutner
8fcf91b030 LibC: The port numbers returned by getservby*() should be in network byte order 2021-04-12 22:44:49 +02:00
Gunnar Beutner
287a93a2a4 LibC: Validate the len argument for inet_ntop() 2021-04-12 22:44:49 +02:00
FalseHonesty
bffa1a0df8 LibDebug: Stop parsing unhandled variable types
Previously, when trying to debug variables with more complex
types (such as String), we would crash the debugger simply because
it didn't know how to handle types that were irrelevant anyways.
Now we just skip data we don't yet know how to handle.
2021-04-12 22:43:33 +02:00
FalseHonesty
cffc0a4f45 HackStudio: Fix debugger preview for char variables 2021-04-12 22:43:33 +02:00
FalseHonesty
d295095993 LibDebug+HackStudio: Fix crashes relating to debugger variable preview
For one, viewing a variable who's type contained a subprogram will
no longer crash HackStudio. Additionally, the variable view will
handle invalid enum values gracefully now, fixing another crash.
Finally, deeply nested (nest count > 1) structures will have their
memory addresses properly set, fixing the final crash I found.
2021-04-12 22:43:33 +02:00
FalseHonesty
c778164f64 HackStudio: Properly support Debugger's new source root concept
HackStudio's debugger instance has its source root property updated
when switching projects, and breakpoints will properly canonicalize
their file paths as the Debugger now expects.
2021-04-12 22:43:33 +02:00
Gunnar Beutner
0f98569617 Ports: Remove obsolete patches for <limits.h> 2021-04-12 22:37:34 +02:00
Gunnar Beutner
e95cb252be Toolchain: Install system headers before building GCC
GCC determines whether the system's <limits.h> header is usable
and installs a different version of its own <limits.h> header
depending on whether the system header file exists.

If the system header is missing GCC's <limits.h> header does not
include the system header via #include_next.

For this to work we need to install LibC's headers before
attempting to build GCC.

Also, re-running BuildIt.sh "hides" this problem because at that
point the sysroot directory also already has a <limits.h> header
file from the previous build.
2021-04-12 22:37:34 +02:00
Timothy Flynn
3f4e90f32b AK: Fix StringView::find_last_of for one-character views
The find_last_of implementations were breaking out of the search loop
too early for single-character string views. This caused a crash in
CookieJar setting a cookie on google.com - CookieJar::default_path knew
there was at least one "/" in a string view, but find_last_of returned
nullopt, so dereferencing the optional caused a crash.

Fixes #6273
2021-04-12 22:37:00 +02:00
Timothy Flynn
d363ed8872 Browser: Change value of "the latest representable date" for cookies
Setting the year to NumericLimits<unsigned>::max() resulted in the
following datetime: -2-12-31 00:00:00.

Instead, set the latest datetime to the last second of the year 9999.
2021-04-12 22:37:00 +02:00
Timothy Flynn
5496d71e4a Browser: Add debug command to dump cookies
Using document.cookie only lets the test page see the name/value pair;
the value returned will not included the parsed attributes.
2021-04-12 22:37:00 +02:00
Timothy Flynn
fc03f8d959 Base: Update cookie test page to set some attributes 2021-04-12 22:37:00 +02:00
Timothy Flynn
cab2e2dded Browser: Process Expires cookie attribute 2021-04-12 22:37:00 +02:00
Timothy Flynn
2370efbea6 AK: Add a predicate variant of StringView::split_view 2021-04-12 22:37:00 +02:00
Gunnar Beutner
0497986572 LibC: Use dbgln() in strerror() and strsignal()
Printing error messages to stdout can have unintended side effects
depending on what the program is doing.
2021-04-12 22:34:07 +02:00
Gunnar Beutner
44486e8818 LibC: Turn CRASH() into a function and add noreturn attribute
This way CRASH() can be used in functions that are themselves
marked as noreturn.
2021-04-12 22:30:06 +02:00
Valtteri Koskivuori
d5e1250061 WindowServer: Fix notification placement
No more top bar, no more extra padding. Spacing is equal on the top and
on the left, so it looks pretty tidy.
2021-04-12 18:11:43 +02:00
David Isaksson
73411ee181 Meta: Add .vim directory to .gitignore 2021-04-12 18:04:13 +02:00
RickySeverino
21ecd5b804 HackStudio: Allow users to drag and drop files into the editor 2021-04-12 18:03:55 +02:00