Commit Graph

25204 Commits

Author SHA1 Message Date
Karol Kosek
49ae73022c Taskbar: Set chdir to the home directory when opening applications
Although the chdir was set up for the applications opened from
the quick launch, the regular application list hadn't do this.

This meant that you could open a Terminal or HackStudio project
in the root directory, which isn't so bad, but it's better to stick
to the user home directory.
2021-08-03 09:12:33 +02:00
Thomas Wagenveld
4181c0330c Ping: Add -s argument to specify the payload size of the ping
Change the static buffers to ByteBuffers to deal with the dynamic
size of the incoming and outgoing packets. Use sizeof(struct ip) rather
than the magic number '20' for the IPv4 header size.
Report the size of the reply packet to the console.
2021-08-03 09:06:11 +02:00
Thomas Wagenveld
8b61667924 LibC: Add definition for 'struct ip' in netinet/ip.h
The definition is equal to the one defined by the BSDs.
2021-08-03 09:06:11 +02:00
Marcus Nilsson
0c4977161f PixelPaint: Move properties for LineTool to ToolPropertiesWidget
Remove the context menu for LineTool and use the tool properties
widget for options instead.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
201b901cb1 PixelPaint: Move properties for RectangleTool to ToolPropertiesWidget
Remove the context menu and move the options to the tool properties
widget.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
3392c66c94 PixelPaint: Remove context menu for MoveTool
Remove the context menu for MoveTool and move the actions to the layer
menu instead.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
15e9d0b4d8 PixelPaint: Remove context menu for SprayTool
Remove the context menu for SprayTool and just use the tool properties
widget for options.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
b257d8d284 PixelPaint: Move properties for EllipseTool to ToolPropertiesWidget
Remove the context menu for EllipseTool and use the properties widget
instead for consistency between tools.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
cb6e63e579 PixelPaint: Remove context menu for PenTool
Remove the context menu for PenTool and just use the tool properties
widget.
2021-08-03 09:04:57 +02:00
Marcus Nilsson
e342bef854 PixelPaint: Move properties for EraserTool to ToolPropertiesWidget
Removes the context menu for EraserTool and instead use the
tool properties widget for options.
2021-08-03 09:04:57 +02:00
Linus Groh
f58891ed42 LibJS: Add a js_bigint(VM&, ...) overload and use it
We already have js_string(VM&, ...) and js_symbol(VM&, ...) overloads,
so feels very familiar.
2021-08-03 00:14:48 +01:00
Timothy Flynn
dc9f516339 LibRegex: Generate negated property escapes as a single instruction
These were previously generated as two instructions, Compare [Inverse]
and Compare [Property].
2021-08-02 21:02:09 +04:30
Timothy Flynn
4de4312827 LibRegex: Support property escapes of the form \p{Type=Value}
Before now, only binary properties could be parsed. Non-binary props are
of the form "Type=Value", where "Type" may be General_Category, Script,
or Script_Extension (or their aliases). Of these, LibUnicode currently
supports General_Category, so LibRegex can parse only that type.
2021-08-02 21:02:09 +04:30
Timothy Flynn
011514a384 AK: Fix declaration of {String,StringView}::is_one_of
The declarations need to consume the variadic parameters as "Ts&&..."
for the parameters to be forwarding references.
2021-08-02 21:02:09 +04:30
Timothy Flynn
1e10d6d7ce LibRegex: Support property escapes of Unicode General Categories
This changes LibRegex to parse the property escape as a Variant of
Unicode Property & General Category values. A byte code instruction is
added to perform matching based on General Category values.
2021-08-02 21:02:09 +04:30
Timothy Flynn
5de6d3dd90 LibUnicode: Add public methods to compare and lookup General Categories
Adds methods to retrieve a General Category from a string and to check
if a code point matches a General Category.
2021-08-02 21:02:09 +04:30
Timothy Flynn
f63287cd63 LibUnicode: Initialize manually created Unicode properties inline
Using initializer lists directly in the UnicodeData struct definition
feels a bit cleaner than invoking HashMap::set in main().
2021-08-02 21:02:09 +04:30
Timothy Flynn
16e86ae743 LibUnicode: Generate General Category unions and aliases
This downloads the PropertyValueAliases.txt UCD file, which contains a
set of General Category aliases.

This changes the General Category enumeration to now be generated as a
bitmask. This is to easily allow General Category unions. For example,
the LC (Cased_Letter) category is the union of the Ll, Lu, and Lt
categories.
2021-08-02 21:02:09 +04:30
Gunnar Beutner
f87cc85cd3 LibDebug: Make single-stepping work for x86_64 2021-08-02 17:11:47 +02:00
Gunnar Beutner
594903742b LibX86: Stub out Disassembler::next() for x86_64
LibX86 doesn't currently support x86_64 opcodes which causes Profiler
to crash when clicking on any symbol in the call graph.
2021-08-02 17:11:47 +02:00
Sam Atkins
3bd14941c7 LibWeb: Switch to new CSS Parser :^)
Change all the places that were including the deprecated parser, to
include the new one instead, and then delete the old parser code.

`ParentNode::query_selector[_all]()` now treat their input as a
comma-separated list of selectors, instead of just one, and return
elements that match any of the selectors in that list. This is according
to these specs:

- querySelector/querySelectorAll:
https://dom.spec.whatwg.org/#ref-for-dom-parentnode-queryselector%E2%91%A0
- selector matching algorithm:
https://www.w3.org/TR/selectors-4/#match-against-tree
2021-08-02 19:01:25 +04:30
Sam Atkins
4065eb169c LibWeb: Implement CSS parsing convenience functions
These mostly match the API in `DeprecatedCSSParser.h`. The exception is
that `parse_selector()` returns a `SelectorList` instead of just one
`Selector`. The only uses of that are in
`ParentNode::query_selector[_all]()` which should be matching against a
list, according to the spec.

`parse_html_length()` is an odd case. It's used for `width="200"` cases
in HTML, so is not really CSS related, but does produce a StyleValue.
The values allowed in `width/height` in HTML vary per element, but they
are a lot more restricted than in CSS, so it's slightly inappropriate to
use the CSS parser for them, even though it's convenient.

We also ignore a few functions:

- `parse_line_width()`
- `parse_line_style()`
- `parse_color()`

These are all only used in `StyleResolver`, when it is given a property
value as a String. That won't happen once the old parser is removed.
2021-08-02 19:01:25 +04:30
Sam Atkins
eadcdd21e3 LibWeb: Clarify naming and publicity of CSS Parser methods
`parse_as_foo()` implies that the Parser's internal data is used,
whereas `parse_a_foo()` implies that the passed-in data is used.

Also, made all the `parse_a_foo()` methods private, as they are only
required within the Parser, and this makes the API clearer to outsiders.

The `parse_a(s)_foo()` naming is a little awkward, but it comes from
section 5.3 of the spec, so seemed worth keeping:
https://www.w3.org/TR/css-syntax-3/#parser-entry-points
2021-08-02 19:01:25 +04:30
Sam Atkins
f4b3ab19c0 LibWeb: Only dump parsed CSS stylesheet if logging is enabled 2021-08-02 19:01:25 +04:30
Ali Mohammad Pur
d5984d296f LibRegex: Make Matcher<>::match(Vector<>) take a reference to the vector
It was previously copying the entire vector every time, which is not a
nice thing to do. :^)
2021-08-02 17:22:50 +04:30
Ali Mohammad Pur
a7653e6a05 LibRegex: Use a bump-allocated linked list for fork save states
This makes it avoid the excessively high malloc() traffic.
2021-08-02 17:22:50 +04:30
Ali Mohammad Pur
b034fa9f1f AK: Add a simple bump allocator 2021-08-02 17:22:50 +04:30
Ali Mohammad Pur
85d87cbcc8 LibRegex: Add some tests for Fork{Stay,Jump} performance
Without the previous fixes, these will blow up the stack.
2021-08-02 17:22:50 +04:30
Ali Mohammad Pur
5f342e4fa9 LibRegex: Make Fork{Jump,Stay} non-recursive
This makes very fork-heavy expressions (like `(aa)*`) not run out of
stack space when matching very long strings.
2021-08-02 17:22:50 +04:30
Ali Mohammad Pur
a08870cc19 AK: Correct Tuple's constructor signatures
Tuple previously required rvalue references, this commit makes it accept
forwarding references instead (which was the intention all along).
2021-08-02 17:22:50 +04:30
Gunnar Beutner
17505ea5d9 LibGUI: Ensure that edit actions are disabled for password boxes
This ensures that the user can't copy/cut text from password boxes which
would reveal the password. It also makes sure that the undo/redo actions
stay disabled because it's difficult to reason about what these do
exactly without being able to see the result.
2021-08-02 12:48:55 +01:00
Gunnar Beutner
9179d01915 LibGUI: Remove redundant code 2021-08-02 12:48:55 +01:00
Gunnar Beutner
74af43ed97 Meta: Improve WSL detection for the run.sh script
For users who use a custom kernel with WSL our previous method of
detecting WSL doesn't work. This new check instead detects WSL by
checking if the wslpath utility is available.
2021-08-02 11:47:29 +01:00
Andreas Kling
de7f1bfd58 Mail: Use GUI::PasswordInputDialog to ask for server passwords 2021-08-02 10:13:35 +02:00
Andreas Kling
1f51b72e6d LibGUI: Add a simple GUI::PasswordInputDialog
Asking the user for a password is a fairly common thing, so let's have
a reusable GUI dialog for it! This first iteration only supports having
pre-filled "server" and "username" fields. This can obviously be made
more flexible as needs arise. :^)
2021-08-02 10:13:35 +02:00
Andreas Kling
46cec3a443 LibGUI: Register GUI::PasswordBox to make it availble in GML 2021-08-02 10:13:35 +02:00
Andreas Kling
233870c4d1 Mail: Tweak vertical spacing & margins in main UI layout 2021-08-02 10:13:35 +02:00
Andreas Kling
7d8db2b094 Browser: Tweak vertical spacing in per-tab UI layout 2021-08-02 10:13:35 +02:00
Andrew Kaster
40b0767d88 Meta: Add BUILD_SHARED_LIBS option for Lagom builds
This standard CMake option controls whether add_library() calls will
use STATIC or SHARED by default. The flag is set to on by default
since that's what we want for normal CI jobs and local builds and the
test262 runner, but disabled for oss-fuzz builds.

This should finally fix the oss-fuzz build after it was broken in #9017

oss-fuzz un-breakage was verified by running the following commands in
the oss-fuzz repo:

python infra/helper.py build_image serenity
python infra/helper.py build_fuzzers --sanitizer address --engine afl \
    --architecture x86_64 serenity /path/to/local/checkout/Meta/Lagom
python infra/helper.py check_build --sanitizer address --engine afl \
    --architecture x86_64 serenity
2021-08-02 09:05:28 +02:00
Andrew Kaster
845d403b8c LibAudio: Handle stream errors in FlacLoader
The FlacLoader already has numerous checks for invalid data reads and
for invalid stream states, but it never actually handles the stream
errors on the stream object. By handling them properly we can actually
run FuzzFlacLoader for longer than a few seconds before it hits the
first assertion :^).
2021-08-02 09:05:28 +02:00
brapru
9c3e6f3f63 Kernel: Send RST/ACK if no socket is available
Previously there was no way for Serenity to send a packet without an
established socket connection, and there was no way to appropriately
respond to a SYN packet on a non-listening port. This patch will respond
to any non-established socket attempts with the appropraite RST/ACK,
letting the client know to close the connection.
2021-08-02 02:45:56 +02:00
brapru
63a15ed19d Kernel: Do not send delayed ack in response to RST/ACK
In accordance with RFC 793, if the receiver is in the SYN-SENT state
it should respond to a RST by aborting the connection and immediately
move to the CLOSED state.

Previously the system would ACK all RST/ACKs, and the remote peer would
just respond with more RST packets.
2021-08-02 02:45:56 +02:00
Linus Groh
b5d9b4e7ee Base: Add a quote to fortunes.json 2021-08-02 00:29:08 +01:00
LuK1337
3dd40535c1 VirtualFileSystem: Don't let rename() overwrite non-empty directory
According to POSIX, rename shouldn't succeed if newpath is a non-empty
directory.
2021-08-02 01:04:34 +02:00
Ali Mohammad Pur
f16011e4d1 LibCpp: Allow 'final' in a class declaration with inheritance 2021-08-02 01:03:59 +02:00
Ali Mohammad Pur
010be01694 LibCpp: Add support for east const
Now LibCpp can understand the eastest of consts too :^)
2021-08-02 01:03:59 +02:00
Ali Mohammad Pur
e27ec04cdd LibCpp: Allow 'override' as a function target qualifier
This is just ignored right now.
2021-08-02 01:03:59 +02:00
Ali Mohammad Pur
5f66874ea0 LibCpp: Add support for parsing function types
This makes it work with types like `Function<T(U, V)>`.
2021-08-02 01:03:59 +02:00
Ali Mohammad Pur
b3cbe14569 LibCpp: Allow 'const' after a function's signature
This is too lax for functions that aren't class members, but let's
allow that anyway.
2021-08-02 01:03:59 +02:00
Ali Mohammad Pur
3319114127 LibCpp: Add support for parsing reference types 2021-08-02 01:03:59 +02:00