Commit graph

28935 commits

Author SHA1 Message Date
Daniel Bertalan
9869b598d5 AK: Make Span trivially copy-constructible
There is no need to have a user-defined copy constructor that simply
calls the base class's copy constructor. By having the compiler generate
it for us, Span is made trivially copyable, so it can be passed in
registers.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
c524f58290 Toolchain: Introduce stubs for core system libraries
This allows the linker to link against these dynamic libraries when
compiling libc++/libunwind, without having to do a separate
bootstrapping LibC build.

Without this change, libc++ would fail to pick up the need to link to
`LibPthread` if no prior builds of it existed. Because of this, we'd
immediately have an assertion failure in SystemServer, as mutexes are
used for the safe construction of function-local static variables.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
95c32fdf19 LibC: Primitively implement wcsxfrm
The `wcsxfrm` function copies a wide character string into a buffer,
such that comparing the new string against any similarly pre-processed
string with `wcscmp` produces the same result as if the original strings
were compared with `wcscoll`.

Our current `wcscoll` implementation is simply an alias for `wcscmp`, so
`wcsxfrm` needs to perform no actions other than copying the string.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
13e6d9d71a LibC: Implement wcslcpy 2021-10-17 17:09:58 +01:00
Daniel Bertalan
e6164d35fa LibC: Fix wcsrchr declaration to return a non-const wchar*
This is how the standard specifies it; similarly to the already
correctly declared wcschr function.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
763a69d46d LibC: Stub out mbsnrtowcs 2021-10-17 17:09:58 +01:00
Daniel Bertalan
54eee525e6 LibC: Stub out wcsnrtombs 2021-10-17 17:09:58 +01:00
Daniel Bertalan
57f0c12b9a LibC: Implement wmemcmp 2021-10-17 17:09:58 +01:00
Daniel Bertalan
685045176b LibC: Add ELAST errno macro
The ELAST macro is used on many systems to refer to the largest possible
valid errno value. LLVM's libc++ uses errno values of ELAST+1 and
ELAST+2 internally, and defines an arbitrary fallback value for
platforms which don't have the macro. This means that it's possible for
their internal errno numbers could coincide with values we actually use,
which would be a very bad thing.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
b5fcb10493 LibC: Forward-declare struct tm in wchar.h
The C standard specifies that this forward-declaration be present in
wchar.h, and is needed in order to build libstdc++.
2021-10-17 17:09:58 +01:00
Tim Schumacher
20986b7066 Prekernel: Force enable PAE on Intel Pentium M CPUs 2021-10-17 16:15:36 +01:00
Tim Schumacher
e8808b259a Prekernel: Split early boot printing into two subroutines 2021-10-17 16:15:36 +01:00
Karol Kosek
0a54a86a8b FontEditor: Accept file drops 2021-10-17 13:53:08 +01:00
Karol Kosek
a0cb8cfefd FontEditor: Add FontEditorWidget::open_file() function
This part is also quite needed when opening files from drag-and-drop
events.
2021-10-17 13:53:08 +01:00
Karol Kosek
72378fd36c FontEditor: Reuse the request_close() function in Open action 2021-10-17 13:53:08 +01:00
Timothy Flynn
59caa4edda Base: Add a test page for the various element attribute APIs 2021-10-17 13:51:10 +01:00
Timothy Flynn
5d4cd061c7 LibWeb: Implement the Element attributes getter 2021-10-17 13:51:10 +01:00
Timothy Flynn
c62b70d88f LibWeb: Reimplement Element attribute related methods with NamedNodeMap 2021-10-17 13:51:10 +01:00
Timothy Flynn
2a3ac02ef1 LibWeb: Implement (most of) NamedNodeMap to store attributes 2021-10-17 13:51:10 +01:00
Timothy Flynn
454d218716 LibWeb: Set an attribute's owning element when it is known 2021-10-17 13:51:10 +01:00
Timothy Flynn
e01dfaac9a LibWeb: Implement Attribute closer to the spec and with an IDL file
Note our Attribute class is what the spec refers to as just "Attr". The
main differences between the existing implementation and the spec are
just that the spec defines more fields.

Attributes can contain namespace URIs and prefixes. However, note that
these are not parsed in HTML documents unless the document content-type
is XML. So for now, these are initialized to null. Web pages are able to
set the namespace via JavaScript (setAttributeNS), so these fields may
be filled in when the corresponding APIs are implemented.

The main change to be aware of is that an attribute is a node. This has
implications on how attributes are stored in the Element class. Nodes
are non-copyable and non-movable because these constructors are deleted
by the EventTarget base class. This means attributes cannot be stored in
a Vector or HashMap as these containers assume copyability / movability.
So for now, the Vector holding attributes is changed to hold RefPtrs to
attributes instead. This might change when attribute storage is
implemented according to the spec (by way of NamedNodeMap).
2021-10-17 13:51:10 +01:00
Timothy Flynn
8d27292fac LibWeb: Alphabetize LibWeb's forward and JS wrapper declarations 2021-10-17 13:51:10 +01:00
SeekingBlues
638f39fbc1 sysctl: Allow showing or setting multiple variables
The `-w` option is enforced when setting variables.
2021-10-17 14:46:59 +02:00
SeekingBlues
3d174e3ad2 Kernel/ProcFS: Provide a way to write to ProcFS inodes
ProcFSGlobalInode now calls `write_bytes()`, `truncate()` and
`set_mtime()` on its associated component. This allows us to write 0 or
1 to a ProcFSSystemBoolean component to toggle a boolean value.
2021-10-17 14:46:59 +02:00
Linus Groh
f8e89306e0 Ports: Remove long unused SERENITY_ROOT from .hosted_defs.sh 2021-10-17 13:26:26 +01:00
Tim Schumacher
e01c968d00 Ports: Add an Angband port :^) 2021-10-17 12:40:48 +01:00
Tim Schumacher
ed8c1e961c Ports: Provide designated wide-char versions of ncurses 2021-10-17 12:40:48 +01:00
Tim Schumacher
3336c382fb LibC: Implement wctob 2021-10-17 12:40:48 +01:00
Tim Schumacher
e58e50997c LibC: Implement mbstowcs 2021-10-17 12:40:48 +01:00
Tim Schumacher
4893e3ef47 LibC: Implement wctomb 2021-10-17 12:40:48 +01:00
Tim Schumacher
52621093c7 Kernel: Print CPU check errors by writing to VRAM 2021-10-17 12:25:50 +01:00
Idan Horowitz
c488f5a59d LibJS: Convert to_property_key() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Idan Horowitz
1639ed7e0a LibJS: Convert to_double() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Idan Horowitz
51c33b3b35 LibJS: Convert to_bigint_uint64() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Idan Horowitz
df181809fd LibJS: Convert to_bigint_int64() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Idan Horowitz
e87cea8248 LibJS: Convert to_bigint() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Idan Horowitz
b8f101888b LibJS: Convert to_numeric() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
James Mintram
e35222a76e Kernel: Move ScopedCritical + SmapDisabler CPP files into x86 common 2021-10-16 15:43:41 -07:00
Tim Schumacher
418d69c0ad Ports: Fix dependencies for SDL2
We are doing nonstandard stuff with our headers, so SDL assumed that
both iconv and dlopen are available inside LibC, which they aren't.

Fix that by adding a dependency on libiconv and adding additional
linker flags.
2021-10-16 15:36:04 -07:00
Luke Wilde
126d6d0838 LibWeb: Implement Event.composedPath
I originally implemented this as something to use the new sequence
wrapper, however, after having a look at uses with grep.app, it's used
often, for example:
- Bootstrap 5 Dropdowns
- Polymer
- Angular
- Closure
2021-10-17 01:34:02 +03:00
Luke Wilde
cb821e1539 LibWeb: Convert ArrayFromVector wrapper to instead be sequence<T>
This adds the ParamatizedType, as `Vector<String>` doesn't encode the
full type information. It is a separate struct as you can't have
`Vector<Type>` inside of `Type`. This also makes Type RefCounted
because I had to make parse_type return a pointer to make dynamic
casting work correctly.

The reason I made it RefCounted instead of using a NonnullOwnPtr is
because it causes compiler errors that I don't want to figure out right
now.
2021-10-17 01:34:02 +03:00
James Mintram
8e4d53f216 Kernel: Add MiniStdLib to the Aarch64 kernel 2021-10-16 23:31:52 +01:00
Felix Rauch
183a2ec8bd PixelPaint: Create an empty layer when the last layer is removed
Previously, when the last layer got deleted, the active layer was
set to nullptr, causing a crash.

Now, we create a new transparent background layer with the image
dimensions instead.
2021-10-16 18:10:11 +01:00
Sam Atkins
9f6a09837b LibWeb: Serialize selectors only in CSSStyleRule::selector_text()
Previously, this was returning the serialization for the whole style
rule, which isn't what we want.
2021-10-16 15:16:27 +01:00
Sam Atkins
e72286c0ec LibWeb: Use the serialize_a_{identifier,string} algorithms for selectors
Also fixed that serializing an attribute selector never output the
value.
2021-10-16 15:16:27 +01:00
Sam Atkins
d775212f19 LibWeb: Insert commas between serialized CSS selectors
For convenience, we create a Formatter for Selector, so we can use
`StringBuilder.join()`.
2021-10-16 15:16:27 +01:00
Sam Atkins
e5d3a9d10b LibWeb: Fix pseudo-element selector serialization
We want to check the last SimpleSelector, not the first one. We don't
have to check that a SimpleSelector exists since a CompoundSelector
without one is invalid.
2021-10-16 15:16:27 +01:00
Sam Atkins
3deb58e4bc LibWeb: Fix CSS selector combinator serialization
Two bugs here:
- We were looking at the wrong CompoundSelector's combinator.
- We weren't adding a space after the combinator.
2021-10-16 15:16:27 +01:00
Sam Atkins
ec51b40a4f LibWeb: Move CSS selector-serialization code to Selector.{h,cpp}
Also, renamed `builder` to `s` to match spec comments, and fixed a
find-and-replace typo where some pseudo-class names were
"last-of-pseudo_class" instead of "last-of-type".
2021-10-16 15:16:27 +01:00
Sam Atkins
75c9313d7d LibWeb: Implement more CSS serializers and make them more ergonomic
This implements these algorithms from the CSSOM-1 spec:
- serialize a string
- serialize a URL

Also, we now have two versions of each of the serialization functions:
One that returns a String as before, and the other that takes a
StringBuilder to write into. This saves creating extra StringBuilders
when they are not needed. :^)
2021-10-16 15:16:27 +01:00