Commit graph

28897 commits

Author SHA1 Message Date
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
James Mintram 3a9c7ce9d4 Kernel: Add StdLib.cpp to aarch64 build and update stubs in dummy.cpp 2021-10-15 21:48:45 +01:00
James Mintram e8f09279d3 Kernel: Move spinlock into Arch
Spinlocks are tied to the platform they are built for, this is why they
have been moved into the Arch folder. They are still available via
"Locking/Spinlock.h"

An Aarch64 stub has been created
2021-10-15 21:48:45 +01:00
James Mintram dfe4810c3a Kernel: Add cross platform RegisterState header and Aarch64 version
A new RegisterState header includes the platform specific RegisterState
header based on the platform being compiled.

The Aarch64 RegisterState header contains stubs for Debug
2021-10-15 21:48:45 +01:00
James Mintram 0fbeac6011 Kernel: Split SmapDisabler so header is platform independent
A new header file has been created in the Arch/ folder while the
implementation has been moved into a CPP living in the X86 folder.
2021-10-15 21:48:45 +01:00
James Mintram f4fb637914 Kernel: Split ScopedCritical so header is platform independent
A new header file has been created in the Arch/ folder while the
implementation has been moved into a CPP living in the X86 folder.
2021-10-15 21:48:45 +01:00
Sam Atkins 8b57e56d66 LibWeb: Parse "none" value for box-shadow property
Previously, `box-shadow: none` would fail to parse, meaning that in this
example:

```css
p {
  box-shadow: 20px 10px 5px magenta;
}

p.foo {
  box-shadow: none;
}
```

... a `<p class="foo">` would still have a box-shadow, when it should
not have one. Now, we handle the `none` value. :^)
2021-10-15 21:18:50 +01:00
Sam Atkins 7879b98f60 LibWeb: Use W3C urls for CSS-DISPLAY spec links 2021-10-15 21:05:35 +01:00
Sam Atkins d28eeeb207 LibWeb: Use W3C urls for CSS-VALUES-3 spec links 2021-10-15 21:05:35 +01:00
Sam Atkins 2d0c6bde01 LibWeb: Use W3C urls for CSS-CASCADE spec links 2021-10-15 21:05:35 +01:00
Sam Atkins e8d4236bbd LibWeb: Use W3C urls for CSSOM spec links
https://www.w3.org/TR/cssom/ is the more permanent home of the CSSOM
specification's latest version, and is up to date with the draft spec.

Also, https://drafts.csswg.org/ has been down multiple times recently
which made looking things up a pain.
2021-10-15 21:05:35 +01:00
Sam Atkins df85832f32 LibWeb: Implement CSSStyleRule::set_selector_text() 2021-10-15 18:12:20 +01:00
Sam Atkins 0f88a47e58 LibWeb: Add serialization code for CSS{Media,Supports}Rule
The `CSSMediaRule::serialized()` code is to spec. The
`CSSSupportsRule::serialized()` code has no spec right now, but I'm
fairly confident it will be almost identical to media's, so I copied
that for now.
2021-10-15 18:12:20 +01:00
Sam Atkins 46bba44f8b LibWeb: Move media-query-list serialization code to MediaQuery.{h,cpp}
It's not a complicated algorithm, but having it in one place instead of
2, and with spec comments, is nice. :^)
2021-10-15 18:12:20 +01:00
Sam Atkins caac0706c2 LibWeb: Accept a Block token as the body of a CSS At-Rule
I previously fixed this for `consume_a_qualified_rule()` and didn't
notice the same comment in `consume_an_at_rule()` until now.
2021-10-15 18:10:23 +01:00
Nico Weber b135efe870 Kernel: List AK_SOURCES only once 2021-10-15 17:49:54 +01:00
Marcin Undak d14d7ee78b Kernel: Discover initial exception level when booting Aarch64
When booting on RPI3 firmware puts CPU in EL2 mode which is
different from QEMU's default EL3.

I've added logic to discover initial mode at boot
and then act accordingly. This results in Serenity corectly
switching to EL1 on target hardware now.
2021-10-15 17:47:39 +01:00
Marcin Undak ebf810f9a6 Kernel: Make Aarch64 register variables bit more descriptive 2021-10-15 17:47:39 +01:00
Marcin Undak 2d9fa8146c Kernel: Switch processor to EL1 immediately after boot on Aarch64 2021-10-15 17:47:39 +01:00