Commit Graph

34622 Commits

Author SHA1 Message Date
Brian Gianforcaro
f648a79f42 Base: Add new quote to fortunes.json 2022-02-19 19:43:24 -08:00
Anton Kling
1ad7aa7136 ls: Add option -1 which lists one file per line 2022-02-19 18:18:13 -08:00
Brian Gianforcaro
70f3fa2dd2 Kernel: Set new process name in do_exec before waiting for the tracer
While investigating why gdb is failing when it calls `PT_CONTINUE`
against Serenity I noticed that the names of the programs in the
System Monitor didn't make sense. They were seemingly stale.

After inspecting the kernel code, it became apparent that the sequence
occurs as follows:

    1. Debugger calls `fork()`
    2. The forked child calls `PT_TRACE_ME`
    3. The `PT_TRACE_ME` instructs the forked process to block in the
       kernel waiting for a signal from the tracer on the next call
       to `execve(..)`.
    4. Debugger waits for forked child to spawn and stop, and then it
       calls `PT_ATTACH` followed by `PT_CONTINUE` on the child.
    5. Currently the `PT_CONTINUE` fails because of some other yet to
       be found bug.
    6. The process name is set immediately AFTER we are woken up by
       the `PT_CONTINUE` which never happens in the case I'm debugging.

This chain of events leaves the process suspended, with the name  of
the original (forked) process instead of the name we inherit from
the `execve(..)` call.

To avoid such confusion in the future, we set the new name before we
block waiting for the tracer.
2022-02-19 18:04:32 -08:00
Luke Wilde
3479f1c4e8 LibWeb: Add support for the options variant of {add,remove}EventListener
This also adds a variant of {add,remove}_event_listener called
{add,remove}_event_listener_with_options.

This is used internally to perform {add,remove}_event_listener with a
default constructed options struct. It was done like this because
default constructing the Variant with the options struct requires the
struct defintions to be present, which requires us to include
AbortSignal.h, which would cause a circular include as AbortSignal.h
includes EventTarget.h.
2022-02-20 02:03:24 +01:00
Luke Wilde
0e6c7eea0f LibWeb: Add AbortSignal as a wrappable type 2022-02-20 02:03:24 +01:00
Luke Wilde
ced7e8ab28 LibWeb: Add support for dictionary types to union types
This also fixes some indentation issues in the generated code.
2022-02-20 02:03:24 +01:00
Luke Wilde
d0ebe80f69 LibWeb: Add dictionary types to idl_type_name_to_cpp_type
This allows dictionaries to appear in sequences, records and unions.
2022-02-20 02:03:24 +01:00
Luke Wilde
567abd52a3 LibWeb: Add support for optional, non-nullable wrapper types 2022-02-20 02:03:24 +01:00
Luke Wilde
86650e37fe LibWeb: Don't perform ToObject when converting values to wrapper types
WebIDL checks the type of the value is Object instead of performing
ToObject on the value.

https://webidl.spec.whatwg.org/#implements
2022-02-20 02:03:24 +01:00
Idan Horowitz
60bc5e3b5b LibJS: Trim all types of whitespace characters before parsing numbers 2022-02-19 22:16:30 +00:00
Idan Horowitz
232e830a0a LibJS: Mark %{Async,}IteratorPrototype%[@@iterator] as Configurable
We were accidentally marking it as Enumerable instead.
2022-02-19 22:16:30 +00:00
Peter Ross
5b32b46ebc LibC: Do not write value when scanf assignment value is suppressed
This change has the positive side-effect of causing scanf to *segfault*
when a NULL pointer argument is passed to scanf.
e.g. sscanf(str, "%d", NULL);
2022-02-20 00:13:08 +03:30
Peter Ross
31079a56d7 LibC: Do not include suppressed assignments in scanf return value 2022-02-20 00:13:08 +03:30
Andrew Kaster
7b0f3b6811 Toolchain: Set CMAKE_NM for Clang and GNU toolchain files
Make sure that we set CMAKE_NM, it's possible that some version of
CMake could choose a host nm binary instead of the ones we just built.

It's unlikely that host nm will understand our .dyn.relr segments unless
it's from binutils 2.38 or higher, so it might complain.
2022-02-19 21:27:46 +01:00
Michiel Visser
7dcfb82e16 LibGfx: Fix JPG decoding bug on rare grayscale images
Some grayscale JPG images might have the horizontal and vertical sample
factor set to 2. However, the macroblocks in these images are not
interleaved as they would be in color images.
2022-02-19 21:27:34 +01:00
Luke Wilde
10581cfaeb LibWeb: Use DOMParserSupportedType enum for DOMParser.parseFromString
Previously it would accept any DOMString, as we didn't support enums at
the time. Now it will only accept what's specified in the
DOMParserSupportedType enum.

This also adds spec comments to DOMParser::parse_from_string.
2022-02-19 21:27:08 +01:00
Zack Penn
a65e1fa828 killall: Port to LibMain and LibCore 2022-02-19 19:44:29 +01:00
Zack Penn
681b643093 paste: Port to LibMain and LibCore 2022-02-19 19:44:29 +01:00
Sam Atkins
7880718fa8 LibWeb: Implement @supports selector(.foo)
This is defined in
https://www.w3.org/TR/css-conditional-4/#at-supports-ext which just
became a CR. :^)
2022-02-19 19:33:54 +01:00
isakBSD
c50ea8c1dd Documentation: Add texinfo as a dependency for Fedora 2022-02-19 18:27:21 +00:00
Idan Horowitz
29dd9d75ef LibJS: Do not create a prototype property on AsyncFunction instances 2022-02-19 18:06:39 +00:00
Idan Horowitz
08d1ae58b1 LibJS: Initialize {Async,}{Generator,}Function constructors properly
We were previously manually initializing them instead of just calling
GlobalObject::initialize_constructor, which aside from duplicating code
also meant we didn't set the required name property.
2022-02-19 18:06:39 +00:00
Idan Horowitz
de238ff351 LibJS: Use FunctionConstructor as the proto of AsyncFunctionConstructor
We were accidentally using FunctionPrototype instead.
2022-02-19 18:06:39 +00:00
Andreas Kling
a4bc7e2d96 LibWeb: Hack BFC to always remember to handle position:absolute elements
Normally we don't layout position:absolute elements until after the
parent formatting context has assigned dimensions to the current
formatting context's root box.

However, some of our parent contexts (especially FFC) don't do this
reliably, which makes position:absolute children have 0x0 dimensions.

Hack this for now by making ~BFC() pretend that the parent assigned
dimensions if it hadn't done it already.
2022-02-19 16:42:02 +01:00
Andreas Kling
c8051f8b5b LibWeb: Add Layout::Node::debug_description()
This returns a String with this format:

- LayoutNodeClassName<TAG_NAME>#id.class1.class2.class3

I've rewritten this function 10+ times at this point, so I'm just gonna
add it to the repository for future debugging needs. :^)
2022-02-19 16:39:32 +01:00
Andreas Kling
cf5eeb9f4b LibWeb: Share QualifiedName data between identical instances
Adopt the same pattern as AK::FlyString, reducing sizeof(QualifiedName)
to the size of a pointer.

This reduces the size of DOM::Element by 24 bytes.
2022-02-19 14:45:59 +01:00
Andreas Kling
4b900bc100 AK: Add fast path in String::trim() and String::trim_whitespace()
If the trimmed string would be the entire string, just return *this
instead of creating a new StringImpl.
2022-02-19 14:45:59 +01:00
Andreas Kling
25504f6a1b LibWeb: Use Vector::clear_with_capacity() in HTMLTokenizer
This avoids constantly reallocating the Vector<HTMLToken>.
2022-02-19 14:45:59 +01:00
Andreas Kling
2dd3b54827 AK: Make CaseInsensitiveStringTraits allocation-free
Instead of calling String::to_lowercase(), do case-insensitive hashing
and comparison.
2022-02-19 14:45:59 +01:00
Andreas Kling
1b6ed558bb LibWeb: Move QualifiedName into the Web::DOM namespace 2022-02-19 14:45:59 +01:00
Andreas Kling
cdd1a9f128 LibWeb: Move QualifiedName.h into LibWeb/DOM/ 2022-02-19 14:45:59 +01:00
Andreas Kling
a97586c24a LibWeb: Shrink DOM::EventTarget by 80 bytes
Do this by converting two Function members into virtual functions:
- legacy_pre_activation_behavior
- legacy_cancelled_activation_behavior
2022-02-19 14:45:59 +01:00
Andreas Kling
bfe69e9d0d LibWeb: Cache and reuse some very common StyleValue objects
Length values: auto, 0px, 1px
Color values: black, white, transparent
2022-02-19 14:45:59 +01:00
Andreas Kling
141b01d3e3 LibWeb: Turn StyleProperties::m_property_values into an Array
After style computation, every StyleProperties has a value for every
PropertyID. Given this, it's simpler, faster and less memory-heavy to
use an Array instead of a HashMap. :^)
2022-02-19 14:45:59 +01:00
Linus Groh
eca8208a34 Kernel: Increase i8042 IO attempt counts, again
This is very similar to the change that was done in 32053e8, except it
turned out that the new limit of 50 iterations was not enough when
testing on bare metal - most IO operations would succeed in the first or
second iteration, but two of them took 140 and 150 iterations
respectively.
Increase the limit from 50 to 250 to account for this, and have some
additional headroom.
2022-02-19 13:37:51 +00:00
Linus Groh
37a04b739a Kernel: Only do i8042 existence check via probing as a fallback
This caused an initialization failure of the i8042 when I tested on
bare metal. We cannot entirely get rid of this method as QEMU for
example doesn't indicate the existence of an i8042 via ACPI, but we can
get away with only doing the manual probing if ACPI is disabled or we
didn't get a 'yes' from it.
Increasing the number of maximum loops did eventually lead to a
successful return from the function, but would later fail the actual
self test.
2022-02-19 13:37:51 +00:00
Daniel Bertalan
ee9125fa9a Meta: Use correct variable for checking if the mold linker is used
This variable was originally called USE_MOLD_LINKER, but it was changed
to ENABLE_MOLD_LINKER during review to be consistent with other
configuration options. I branched off the commits that added RELR
support before this change, and I failed to update the variable name
there.
2022-02-19 14:21:52 +02:00
Maciej
c375182be6 Base: Add some Supplemental Arrows C to KaticaRegular/Bold 10
They are used by fonts.serenityos.net title :^)

Codepoints added: U+1F800-U+1F80B, U+1F810-U+1F813

PDF: https://www.unicode.org/charts/PDF/U1F800.pdf
2022-02-19 13:27:42 +02:00
Gunnar Beutner
6b9913f010 Meta: Explicitly set number of available inodes for genext2fs
According to its manpage genext2fs tries to create the file system with
as few inodes as possible. This causes SerenityOS to fail at boot time
when creating temporary files.
2022-02-19 13:13:22 +02:00
Gunnar Beutner
7a65bd8efb AK: Don't use x86 assembly when building for non-x86 targets
This allows Lagom to be built successfully for Apple M1.

Fixes #12644.
2022-02-19 13:13:22 +02:00
Vrins
12d75b10f3 LibWeb: Inspector content_size tooltip in document view
This adds a small tooltip in the browser showing the size of the
element that currently selected in the inspector view. This allows
for easier debugging since you dont have to dump the layout tree :^).
2022-02-19 11:39:41 +01:00
Debdut Chakraborty
7527b52efc Documentation: Add Userland/ to qtcreator include path 2022-02-19 11:39:08 +01:00
Maciej
3e1c1c0b16 LibWeb: Add support for CSS image-rendering property
Currently only "auto" and "pixelated" values are supported.
2022-02-19 11:38:46 +01:00
Itamar
246b42b635 LibGUI: Guard against use-after-free in Clipboard::the()
We now make sure that a VERIFY will fail if Clipboard::the() is called
after the destruction of its static-local variables.
2022-02-19 11:38:29 +01:00
Itamar
4d2357f8f3 HackStudio: Don't store a global RefPtr to the HackStudioWidget
Previously, we stored a RefPtr to the HackStudioWidget in the
global scope.

This led to a destruction-order related use-after-free bug, where the
global HackStudioWidget instance destructed after the static-local
GUI::Clipboard instance.
When HackStudioWidget destructs it attempts to use the global Clipboard
instance, which had already been freed.

This caused the Hack Studio process to spin endlessly on exit because
it attempted to access the HashTable of the freed Clipboard object.

We now store a global WeakPtr to the HackStudioWidget instead, and
limit the lifetime of the object to the main function scope.
2022-02-19 11:38:29 +01:00
Jakub Berkop
895a050e04 Kernel: Fixed argument passing for profiling_enable syscall
Arguments larger than 32bit need to be passed as a pointer on a 32bit
architectures. sys$profiling_enable has u64 event_mask argument,
which means that it needs to be passed as an pointer. Previously upper
32bits were filled by garbage.
2022-02-19 11:37:02 +01:00
Daniel Bertalan
0f2e18403c Meta: Make serenity.sh gdb work with the Clang toolchain
We now pass along the toolchain type to all subcommands. This ensures
that gdb will load the correct debug information for kernels compiled
with Clang, and the following warning won't appear with the GNU
toolchain:

> WARNING: unknown toolchain 'gdb'. Defaulting to GNU.
>         Valid values are 'Clang', 'GNU' (default)
2022-02-19 11:36:08 +01:00
Simon Danner
0787571192 Filemanager: Only enable rename if available 2022-02-19 11:35:53 +01:00
kperdlich
ad722a9f06 Shell: Use an opaque default color for BarewordLiteral
Use an opaque default color for BarewordLiteral in
Syntax Highlighter to avoid transparent barewords.
2022-02-19 11:33:28 +01:00
Adam Plumb
34825ad3d1 LibWeb: Return current document URL if form action missing or empty 2022-02-19 11:31:53 +01:00