Commit Graph

28915 Commits

Author SHA1 Message Date
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
Sam Atkins
5c1427f3e0 LibWeb: Remove old ANPlusB parsing code
This was left over from the old CSS parser, so we no longer need it. :^)
2021-10-16 15:16:27 +01:00
Nico Weber
4d555e8b95 Lagom: Do not use -fno-sematic-interposition in fuzzer builds
Apparently it breaks the fuzzer build. There's probably a better fix
for this, but for now just unbreak the fuzzer build.
Keep this for non-fuzzer builds though since it's apparently a 17%
speedup for running test262 tests :^)
2021-10-16 14:45:06 +01:00
Luke Wilde
1ea3f34823 LibWeb: Implement Node.getRootNode 2021-10-16 10:51:23 +02:00
Rodrigo Tobar
1f4a6e7c22 SystemMonitor: Use a TableView to display the thread stack
Using a table display this information in a much more organised and
flexible way than than what can be achieved with a TextEditor.
2021-10-15 22:10:03 -07:00
Rodrigo Tobar
6a3b24db0a SystemMonitor: Remove unnecessary header inclusion 2021-10-15 22:10:03 -07:00
Rodrigo Tobar
9199f0836a LibSymbolication: Make Symbol comparable
All its members are comparable themselves, so this can be defaulted.
Making it comparable will allow us, among other things, to check if a
list of symbols (i.e., the result of calling the symbolicate functions)
is equal or not to another, which in turn will allow us to avoid
refreshing the SystemMonitor's Stack tab when successive symbolicated
stacks are the same.
2021-10-15 22:10:03 -07:00
Eric Seifert
89e52faa22 Ports: Use ruby irb legacy mode
Legacy mode seems to work better than the --nomultiline --nosingleline
mode I was using.
2021-10-15 21:56:06 -07:00
Tim Schumacher
8ced224f04 Ports: Enable wide-char support for ncurses
Hello ncursesw!
2021-10-15 21:50:19 -07:00
Tim Schumacher
420bdccf0b LibC: Implement mbsrtowcs 2021-10-15 21:50:19 -07:00
Tim Schumacher
b0babd062e LibC: Implement wcsrtombs 2021-10-15 21:50:19 -07:00
Daniel Bertalan
fccb06b2cd AK: Use UnicodeUtils::code_point_to_utf8 in StringBuilder 2021-10-15 21:50:19 -07:00
Daniel Bertalan
c8367df746 LibC: Implement wcrtomb
This function converts a single wide character into its multibyte
representation (UTF-8 in our case). It is called from libc++'s
`std::basic_ostream<wchar_t>::flush`, which gets called at program exit
from a global destructor in order to flush `std::wcout`.
2021-10-15 21:50:19 -07:00
Tim Schumacher
9c29e6cde7 LibC: Partially implement wcwidth 2021-10-15 21:50:19 -07:00
Tim Schumacher
a66c358c52 LibC: Stub out tdelete 2021-10-15 21:50:19 -07:00
Tim Schumacher
4b423a5ec7 LibC: Implement twalk 2021-10-15 21:50:19 -07:00
Tim Schumacher
7448626bae LibC: Implement tfind and tsearch 2021-10-15 21:50:19 -07:00
Marcin Undak
d045181375 Documentation: Add RunningOnRaspberryPi page
This is a first draft targeted for existing developers.
2021-10-16 00:36:51 +01:00
Tim Schumacher
20fc93410c LibC: Mark termcap symbols as weak
Otherwise, we may end up preferring those over the more accurate
implementation in ncurses (if available).
2021-10-15 14:47:41 -07:00
Nico Weber
ec9488a58c Lagom: Build with -fno-no-semantic-interposition
Lagom: Build with -fno-no-semantic-interposition

We build with this in non-lagom builds, and serenity's gcc even adds it
to its CC1_SPEC. Let's use it for lagom too.

Reduces the number of dynamic relocations in liblagom-js.so.0.0.0 (per
`objdump -R`) from 15133 to 14534, and increases its size back to 91M
(95156800 bytes), probably due to more inlining being possible.
This might help perf of lagom binaries.
2021-10-15 21:59:42 +01:00
Nico Weber
b11d660ff8 Lagom: Build with -fno-exceptions
We build with this in non-lagom builds, so there's no reason not
to use it in lagom builds as well.

Reduces the size of liblagom-js.so.0.0.0 from 94M to 90M
(from 98352784 to 93831056 bytes to be exact).
2021-10-15 21:59:42 +01:00