Commit graph

998 commits

Author SHA1 Message Date
Linus Groh 897471c852 Meta: Don't check for toolchain if serenity.sh target is lagom
This is just silly :^)

    $ serenity run lagom js
    WARNING: unknown toolchain 'js'. Defaulting to GNU.
             Valid values are 'Clang', 'GNU' (default)
2021-11-02 11:09:05 +01:00
Idan Horowitz 19e28d5798 LibWeb: Convert is_named_property_exposed_on_object to ThrowCompletions
This is the last usage of old-style exceptions in the WrapperGenerator.
2021-11-02 10:41:25 +02:00
Ben Wiederhake 55e1edd51b Meta: Check auto-generated manpages for completeness on CI 2021-11-01 21:12:58 +01:00
Ben Wiederhake a4e805756d Meta: Add script to generate and export manpages 2021-11-01 21:12:58 +01:00
Ben Wiederhake 2caad04d23 Base: Add new system-mode that just generates manpages 2021-11-01 21:12:58 +01:00
Timothy Flynn 95e492de59 LibWeb: Convert throw_dom_exception_if_needed() to ThrowCompletionOr
This changes Web::Bindings::throw_dom_exception_if_needed() to return a
JS::ThrowCompletionOr instead of an Optional. This allows callers to
wrap the invocation with a TRY() macro instead of making a follow-up
call to should_return_empty(). Further, this removes all invocations to
vm.exception() in the generated bindings.
2021-10-31 18:51:07 +01:00
Ben Wiederhake f20a42e871 Kernel: Write test that crashes ProcFS 2021-10-31 18:44:12 +01:00
Idan Horowitz ae510db72c FuzzilliJS: Convert native functions to ThrowCompletionOr 2021-10-31 18:20:37 +02:00
Timothy Flynn c19c306744 LibWeb: Convert all generated bindings to ThrowCompletionOr
This also required converting URLSearchParams::for_each and the callback
function it invokes to ThrowCompletionOr. With this, the ReturnType enum
used by WrapperGenerator is removed as all callers would be using
ReturnType::Completion.
2021-10-31 15:48:36 +01:00
Brendan Coles 91de60d912 Lagom/Fuzzers: Add fuzzer for PDF document 2021-10-30 10:33:56 -07:00
Andreas Kling 34cc4803af Websites: Import serenityos.org website changes
I hadn't synced this for a while. The repo copy now matches the live
site once again.
2021-10-30 17:42:26 +02:00
Idan Horowitz 2882a90dec Kernel: Add the IFF_* SIOCGIFFLAGS flag macros 2021-10-28 11:24:36 +02:00
Ben Wiederhake a6ccf6659a Meta: Reimplement license checker in python
On my machine, this script took about 3.4 seconds, and was responsible
for essentially all of the time taken by the precommit hook.

The script is a faithful 1:1 reimplementation, even the regexes are
identical. And yet, it takes about 0.02 seconds, making the pre-commit
hook lightning fast again. Apparently python is just faster in this
case.

Fun fact:
- Just reading all ~4000 files took bash about 1.2 seconds
- Checking the license took another 1.8 seconds in total
- Checking for math.h took another 0.4 seconds in total
- Checking for '#pragma once' took another 0.4 seconds in total

The timing is highly load-dependent, so they don't exactly add up to 3.4
seconds. However, it's good enough to determine that bash is no longer
fit for the purpose of this script.
2021-10-27 11:35:47 -07:00
Ben Wiederhake 8d13f6ddce Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
2021-10-25 23:38:28 +02:00
Ben Wiederhake 09432a8241 Kernel: Separate panic behavior from bootmode
Bootmode used to control panic behavior and SystemServer.
This patch factors panic behavior control into a separate flag.
2021-10-25 23:38:28 +02:00
Ben Wiederhake 542a88a7be Kernel: Separate framebuffers from bootmode
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
2021-10-25 23:38:28 +02:00
Andreas Kling 398c181c79 LibJS: Rename PropertyName to PropertyKey
Let's use the same name as the spec. :^)
2021-10-24 17:18:07 +02:00
Ben Wiederhake fc519d43ba Fuzzing: Update build instructions
The project needs clang-12, which is not on all systems the default
(e.g. Debian Testing).
2021-10-23 19:29:59 +01:00
Ben Wiederhake 20bfd549e9 man.serenityos.org: Make section titles more descriptive 2021-10-22 19:49:28 +03:00
Ben Wiederhake dad47a3dd1 man.serenityos.org: Use pandoc for listings and landing page
This makes all pages look and feel the same, because they all use the
default CSS generated by pandoc. Also, it inserts the banner everywhere
at the top, not only into the top-level index.html.

Credit to @xSlendiX for suggesting that `-B` works here.
2021-10-22 19:49:28 +03:00
Ben Wiederhake 2e613db999 man.serenityos.org: Fix links to man(1), avoid unnecessary shells
This fixes the current bug at the end of less(1), which links to the
wrong file ".html" instead of "man.html".
2021-10-22 19:49:28 +03:00
Ben Wiederhake 7e52b6fa24 man.serenityos.org: Simplify local builds
I simply extracted the script from .github/workflows/manpages.yml,
without significant modification.
2021-10-22 19:49:28 +03:00
Ben Wiederhake 5c04a2d4b3 man.serenityos.org: Add section descriptions to overview page 2021-10-22 19:49:28 +03:00
Idan Horowitz db5df26841 LibJS: Convert Array AOs to ThrowCompletionOr 2021-10-22 15:07:04 +03:00
Liav A cf0dbc9069 Tests: Add a unit test to ensure the /dev/mem device works correctly
To ensure everything works as expected, a unit test was added with
multiple scenarios.
This binary has to have the SetUID flag, and we also bind-mount the
/usr/Tests directory to allow running of SetUID binaries.
2021-10-22 13:13:00 +02:00
Timothy Flynn 8a57885494 Meta: Enable ccache for Lagom by default 2021-10-21 04:35:10 -07:00
Linus Groh 5832de62fe LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
2021-10-21 09:02:23 +01:00
Idan Horowitz 40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz 20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Ben Wiederhake 8de696bdd0 HeaderCheck: It checks some of your headers 2021-10-20 09:20:18 +01:00
Sam Atkins 04c0c103e0 LibWeb: Distinguish between integer and number when checking StyleValues 2021-10-19 19:12:09 +02:00
Sam Atkins 450b782c18 LibWeb: Distinguish between length and percentage values
Though most CSS properties accept either, some do not, so distinguishing
between them lets us catch some invalid values at parse time.
2021-10-19 19:12:09 +02:00
Timothy Flynn d24ae8063b LibWeb: Implement DOMTokenList for managing space-separated tokens lists
DOMTokenList is used as the return type of, e.g., the Element.classList
property.
2021-10-18 23:33:56 +02:00
Timothy Flynn 4d8320a49a LibWeb: Add initial support for IDL methods with variadic parameters
Adds support for methods whose last parameter is a variadic DOMString.
We constructor a Vector<String> of the remaining arguments to pass to
the C++ implementation.
2021-10-18 23:33:56 +02:00
Brian Gianforcaro 8c2a88e492 Meta: Add a gdb pretty printer for AK::Array 2021-10-18 03:27:27 -07:00
Timothy Flynn b11a34330a CI: Build the Clang toolchain a single time for both onboard pipelines
As of the Clang 13 upgrade, we only need to build the toolchain once and
can use that toolchain for both x86_64 and i686. To do this, this breaks
the main Azure configuration into 3 "stages" (Lagom, Toolchain, and
Serenity), where the Serenity stage depends on the Toolchain stage.

This has the added benefit of uploading a new prebuilt toolchain cache
sooner than before, which should help alleviate pressure from PRs.
2021-10-18 03:25:26 -07:00
Idan Horowitz 7bbb92dfe9 LibJS: Convert to_u16() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz cc94bba5c0 LibJS: Convert to_u32() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz f6a5ff7b00 LibJS: Convert to_i32() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Daniel Bertalan 928665d3bc Meta: Support llvm-addr2line in serenity.sh
With this, the subcommands 'addr2line` and `kaddr2line` work as with the
GNU toolchain.
2021-10-17 17:09:58 +01:00
Daniel Bertalan 06fc64be13 Toolchain+Meta: Update LLVM version to 13.0.0
This commit updates the Clang toolchain's version to 13.0.0, which comes
with better C++20 support and improved handling of new features by
clang-format. Due to the newly enabled `-Bsymbolic-functions` flag, our
Clang binaries will only be 2-4% slower than if we dynamically linked
them, but we save hundreds of megabytes of disk space.

The `BuildClang.sh` script has been reworked to build the entire
toolchain in just three steps: one for the compiler, one for GNU
binutils, and one for the runtime libraries. This reduces the complexity
of the build script, and will allow us to modify the CI configuration to
only rebuild the libraries when our libc headers change.

Most of the compile flags have been moved out to a separate CMake cache
file, similarly to how the Android and Fuchsia toolchains are
implemented within the LLVM repo. This provides a nicer interface than
the heaps of command-line arguments.

We no longer build separate toolchains for each architecture, as the
same Clang binary can compile code for multiple targets.

The horrible mess that `SERENITY_CLANG_ARCH` was, has been removed in
this commit. Clang happily accepts an `i686-pc-serenity` target triple,
which matches what our GCC toolchain accepts.
2021-10-17 17:09:58 +01:00
Timothy Flynn 2a3ac02ef1 LibWeb: Implement (most of) NamedNodeMap to store attributes 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
Idan Horowitz 1639ed7e0a LibJS: Convert to_double() to ThrowCompletionOr 2021-10-17 12:12:35 +01: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
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
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
Timothy Flynn 3ad159537e LibUnicode: Use u16 for unique string indices instead of size_t
Typically size_t is used for indices, but we can take advantage of the
knowledge that there is approximately only 46K unique strings in the
generated UnicodeLocale.cpp file. Therefore, we can get away with using
u16 to store indices. There is a VERIFY that will fail if we ever exceed
the limits of u16.

On x86_64 builds, this reduces libunicode.so from 9.2 MiB to 7.3 MiB.
On i686 builds, this reduces libunicode.so from 3.9 MiB to 3.3 MiB.

These savings are entirely in the .rodata section of the shared library.
2021-10-15 00:06:18 +01:00
Timothy Flynn ebe704a03d LibWeb: Stub out a basic IntersectionObserver interface
Note there are a couple of type differences between the spec and the IDL
file added in this commit. For example, we will need to support a type
of Variant to handle spec types such as "(double or sequence<double>)".
But for now, this allows web pages to construct an IntersectionObserver
with any valid type.
2021-10-14 10:32:51 +02:00
Timothy Flynn ff66218631 LibWeb: Allow creating "any" types in IDL with integral default values
This enables defining "any" types in IDL files such as:

    any threshold = 0;

This isn't able to parse decimal values yet.
2021-10-14 10:32:51 +02:00
Timothy Flynn f91d63af83 LibUnicode: Generate enum/alias from-string methods without a HashMap
The *_from_string() and resolve_*_alias() generated methods are the last
remaining users of HashMap in the LibUnicode generated files (read: the
last methods not using compile-time structures). This converts these
methods to use an array containing pairs of hash values to the desired
lookup value.

Because this code generation is the same between GenerateUnicodeData.cpp
and GenerateUnicodeLocale.cpp, this adds a GeneratorUtil.h header to the
LibUnicode generators to contain the method that generates the methods.
2021-10-13 16:38:51 +02:00
Linus Groh 52976bfac6 LibJS: Convert to_object() to ThrowCompletionOr 2021-10-13 09:55:10 +01:00
Linus Groh 4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Linus Groh 44e70d1bc0 LibJS+LibWeb: Let WrapperGenerator deal with legacy_null_to_empty_string
This concept is not present in ECMAScript, and it bothers me every time
I see it.
It's only used by WrapperGenerator, and even there only relevant in two
places, so let's fully remove it from LibJS and use a simple ternary
expression instead:

    cpp_name = js_name.is_null() && legacy_null_to_empty_string
        ? String::empty()
        : js_name.to_string(global_object);
2021-10-11 23:36:03 +01:00
Linus Groh 661dd32432 LibWeb: Add support for the Promise<T> IDL type to WrapperGenerator
This includes parsing parameterized types (foo<T>) as well as generating
the appropriate code in generate_wrap_statement() and generate_to_cpp().
2021-10-11 13:30:17 +01:00
Linus Groh 7afd215e95 LibWeb: Initialize IDL any values without default value to undefined
Previously this would generate the following code:

    JS::Value foo_value;
    if (!foo.is_undefined())
        foo_value = foo;

Which is dangerous as we're passing an empty value around, which could
be exposed to user code again. This is fine with "= null", for which it
also generates:

    else
        foo_value = JS::js_null();

So, in summary: a value of type `any`, not `required`, with no default
value and no initializer from user code will now default to undefined
instead of an empty value.
2021-10-11 13:30:17 +01:00
Linus Groh a9a7d65099 LibWeb: Replace heycam.github.io/webidl URLs with webidl.spec.whatwg.org
Web IDL is now a WHATWG standard and the specification was moved
accordingly: https://twitter.com/annevk/status/1445311275026821120

The old URLs now redirect, but let's use canonical ones.
2021-10-11 13:15:16 +01:00
Andreas Kling fdc1c15064 LibWeb: Stub out a basic ResizeObserver interface
This patch establishes scaffolding for the ResizeObserver API.
2021-10-11 00:54:01 +02:00
Andreas Kling 5c9ca5c2dc LibWeb: Stub out a basic Selection interface
This patch establishes scaffolding for the Selection API.
2021-10-11 00:32:19 +02:00
Ben Wiederhake e900f94a03 Meta: Run check-markdown as part of 'Azure Linux NoFuzz' 2021-10-10 15:18:55 -07:00
Ben Wiederhake a296f6bb8d Meta: Invoke markdown-checker if available while linting 2021-10-10 15:18:55 -07:00
Ben Wiederhake c06a0bae04 Meta: Fix broken external links
Meta/Lagom/ReadMe.md never had any other name; not sure how that typo
happened.

The link to the non-existent directory is especially vexing because the
text goes on to explain that we don't want such a directory to exist.

Found by running markdown-checker, and 'wget'ing all external links.
2021-10-10 15:18:55 -07:00
Ben Wiederhake 3f88d65b78 markdown-checker: New tool that checks document links 2021-10-10 15:18:55 -07:00
Timothy Flynn 597379e864 LibUnicode: Generate and use unique locale-related alias strings
Almost all of these are already in the unique string list.
2021-10-10 22:21:48 +02:00
Timothy Flynn acb7bd917f LibUnicode: Generate and use unique subtag and complex alias strings 2021-10-10 22:21:48 +02:00
Timothy Flynn 3d67f6bd29 LibUnicode: Generate and use unique list-format strings
The list-format strings used for Intl.ListFormat are small, but quite
heavily duplicated. For example, the string "{0}, {1}" appears 6,519
times. Generate unique strings for this data to avoid duplication.
2021-10-10 22:21:48 +02:00
Timothy Flynn f9e605397c LibUnicode: Generate and use a set of unique locale-related strings
In the generated UnicodeLocale.cpp file, there are 296,408 strings for
localizations of languages, territories, scripts, currencies & keywords.
Of these, only 43,848 (14.8%) are actually unique, so there are quite a
large number of duplicated strings.

This generates a single compile-time array to store these strings. The
arrays for the localizations now store an index into this single array
rather than duplicating any strings.
2021-10-10 22:21:48 +02:00
Timothy Flynn 3f0095b57a LibUnicode: Skip unknown languages and territories
Some CLDR languages.json / territories.json files contain localizations
for some lanuages/territories that are otherwise not present in the CLDR
database. We already don't generate anything in UnicodeLocale.cpp for
these anomalies, but this will stop us from even storing that data in
the generator's memory.

This doesn't affect the output of the generator, but will have an effect
after an upcoming commit to unique-ify all of the strings in the CLDR.
2021-10-10 22:21:48 +02:00
Ben Wiederhake 6d99b7b72e Meta: Re-enable warnings for deprecated copies also for Lagom 2021-10-10 21:21:35 +01:00
Timothy Flynn 79707d83d3 LibUnicode: Stop generating large UnicodeData hash map
The data in this hash map is now available by way of much smaller arrays
and is now unused.
2021-10-10 13:49:37 +02:00
Timothy Flynn d83b262e64 LibUnicode: Generate standalone compile-time array for combining class 2021-10-10 13:49:37 +02:00
Timothy Flynn 9f83774913 LibUnicode: Generate standalone compile-time array for special casing
There are only 112 code points with special casing rules, so this array
is quite small (compared to the size 34,626 UnicodeData hash map that is
also storing this data). Removing all casing rules from UnicodeData will
happen in a subsequent commit.
2021-10-10 13:49:37 +02:00
Timothy Flynn da4b8897a7 LibUnicode: Generate standalone compile-time arrays for simple casing
Currently, all casing information (simple and special) are stored in a
compile-time array of size 34,626, then statically copied to a hash map
at runtime. In an effort to reduce the resulting memory usage, store the
simple casing rules in standalone compile-time arrays. The uppercase map
is size 1,450 and the lowercase map is size 1,433. Any code point not in
a map will implicitly have an identity mapping.
2021-10-10 13:49:37 +02:00
Idan Horowitz 9958277317 Meta: Disable -Wmaybe-uninitialized for Lagom 2021-10-07 21:56:03 +03:00
Nico Weber a7b558bf7d Meta: Warn on rebuild-toolchain i686 clang
It's "Clang" (capitalized). Silently building gcc if the toolchain
isn't know seems a bit unfriendly. So print a warning for this
(and for other unknown toolchains).
2021-10-07 18:34:13 +03:00
Ben Wiederhake 52e9f25403 Everywhere: Change from http to https where feasible
I used "git grep -FIn http://" to find all occurrences, and looked at
each one. If an occurrence was really just a link, and if a https
version exists, and if our Browser can access it at least as well as the
http version, then I changed the occurrence to https.

I'm happy to report that I didn't run into a single site where Browser
can't deal with the https version.
2021-10-05 02:08:08 +02:00
Andreas Kling bf43b0f884 LibWeb: Make IDL-constructed objects aware of their JS wrapper
Having IDL constructors call FooWrapper::create(impl) directly was
creating a wrapper directly without telling the impl object about the
wrapper. This meant that we had wrapped C++ objects with a null
wrapper() pointer.
2021-10-04 12:13:25 +02:00
Linus Groh 2f42675ebd LibJS: Convert ordinary_set_with_own_descriptor() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Linus Groh 3be26f56db LibJS: Convert has_own_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh fb443b3fb4 LibJS: Convert create_data_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh b7e5f08e56 LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the
most used AO of all of them. Definitely worth it though.
2021-10-03 20:14:03 +01:00
davidot ac2c3a73b1 LibJS: Add a specific test for invalid unicode characters in the lexer
Also fixes that it tried to make substrings past the end of the source
if we overran the source length.
2021-10-03 17:42:05 +02:00
Luke Wilde 8d6db36cbb LibWeb: Add support for NodeList
This introduces 3 classes: NodeList, StaticNodeList and LiveNodeList.
NodeList is the base of the static and live versions. Static is a
snapshot whereas live acts on the underlying data and thus inhibits
the same issues we have currently with HTMLCollection.

They were split into separate classes to not have them weirdly
mis-mashed together.

The create functions for static and live both return a NNRP to the base
class. This is to prevent having to do awkward casting at creation
and/or return, as the bindings expect to see the base NodeList only.
2021-10-03 00:18:52 +02:00
Luke Wilde bfd089fbd1 LibWeb: Add support for IDL value iterators
This also renames Interface::iterator_types to pair_iterator_types to
reduce confusion between value and pair iterators.
2021-10-03 00:18:52 +02:00
Linus Groh ba6e4c7ae1 LibJS+LibWeb: Use Object::set_prototype() in more places 2021-10-02 14:53:06 +01:00
Idan Horowitz a4bc3fa255 LibWeb: Initialize IDL-generated prototypes' prototype directly
Instead of setting it to the default object prototype and then
immediately setting it again via internal_set_prototype_of, we can just
set it directly in the parent constructor call.
2021-10-02 13:23:59 +01:00
Andreas Kling 77f0e57b27 RequestServer: Don't hide the SIGINFO state dump behind a debug macro
Until we're confident that RequestServer doesn't need this runtime debug
dump helper, it's much nicer if everyone has it built in, so they can
simply send a SIGINFO if they see it acting up.
2021-10-01 20:17:15 +02:00
Idan Horowitz 43482dfde3 LibWeb: Support dictionary-only IDL files 2021-10-01 20:14:45 +02:00
Idan Horowitz ac25c28c43 LibWeb: Add the missing UIEvent IDL constructor 2021-10-01 20:14:45 +02:00
Idan Horowitz 7b2c63fd87 LibWeb: Add support for unwrapping the WindowObject to WrapperGenerator 2021-10-01 20:14:45 +02:00
Idan Horowitz 4d71f22673 LibWeb: Add the missing ProgressEvent IDL constructor 2021-10-01 20:14:45 +02:00
Idan Horowitz 7f551d7f6a LibWeb: Use the LibWeb source directory as the IDL #import base path
This allows us to include IDL files from other base LibWeb directories
wihout using relative `../foo.idl` references.
2021-10-01 20:14:45 +02:00
Nico Weber 9ec9886b04 Meta: Fix typos 2021-10-01 01:06:40 +01:00
Idan Horowitz 2c6c9b73c8 LibWeb: Add the Web::Crypto namespace, built-in, and getRandomValues
Since we don't support IDL typedefs or unions yet, the responsibility
of verifying the type of the argument is temporarily moved from the
generated Wrapper to the implementation.
2021-09-30 20:02:09 +02:00
Timothy Flynn becbb0ea97 LibUnicode: Upgrade to Unicode version 14.0.0 2021-09-30 17:37:57 +01:00
Timothy Flynn c8dbcdb0bc LibUnicode: Do not compare generated file contents before writing
This is now covered by unicode_data.cmake after the superbuild changes.
2021-09-30 17:37:57 +01:00
Timothy Flynn a466b78bf3 LibUnicode: Remove cached UCD and CLDR files when their version changes 2021-09-30 17:37:57 +01:00
Timothy Flynn 0ec6b4f132 LibUnicode: Use consistent variable naming in unicode_data.cmake
I kept mixing these up in my head.
2021-09-30 17:37:57 +01:00
Timothy Flynn 583d703f61 LibUnicode: Functionalize extraction of CLDR data files 2021-09-30 17:37:57 +01:00
Timothy Flynn ead30c26e5 LibUnicode: Functionalize downloading of UCD data files 2021-09-30 17:37:57 +01:00
Timothy Flynn 87bca78ef2 LibUnicode: Extract UCD and CLDR versions to a CMake variable
This also surrounds expansion of affected URL and path variables with
quotes.
2021-09-30 17:37:57 +01:00
Linus Groh ee8380edea LibJS: Convert internal_own_property_keys() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh fbfb0bb908 LibJS: Convert internal_delete() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh e5409c6ead LibJS: Convert internal_set() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 6c2b974db2 LibJS: Convert internal_get() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh d9895ec12d LibJS: Convert internal_has_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 5da210125e LibJS: Convert internal_define_own_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 0e69a6e487 LibJS: Convert internal_get_own_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 73bae7d779 LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 8c81c84c18 LibJS: Convert internal_set_prototype_of() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh 5148150e1c LibJS: Convert internal_get_prototype_of() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Andreas Kling 6cda24097b LibWeb: Add the CSSStyleRule interface with some limited functionality 2021-09-30 00:00:55 +02:00
Andreas Kling dadb92a155 LibWeb: Generate CSS::property_id_from_camel_case_string()
This allows us to resolve a "camelCase" CSS property name to our own
CSS::PropertyID enum. This will be used by CSSOM bindings.
2021-09-29 21:21:57 +02:00
Andreas Kling 3a4565beec LibWeb: Make CSSRule and CSSRuleList available to JavaScript :^)
This patch makes both of these classes inherit from RefCounted and
Bindings::Wrappable, plus some minimal rejigging to allow us to keep
using them internally while also exposing them to web content.
2021-09-29 21:21:57 +02:00
Idan Horowitz e04f3c713c LibWeb: Add support for custom #import IDL statements
This will currently be used to support dictionary inheritance between
dictionaries defined across different IDL definition files.
2021-09-29 19:38:41 +02:00
Luke Wilde 2202428ca4 LibWeb: Add initial support for the IDL [Unscopable] extended attribute
This adds support for the [Unscopable] extended attribute to attributes
and functions.

I believe it should be applicable to all interface members, but I
haven't done that here.
2021-09-29 17:56:13 +02:00
Luke Wilde 881e9d1341 LibWeb: Make StyleSheetList.item an IDL getter 2021-09-29 14:57:59 +01:00
Ali Mohammad Pur 398435277b RequestServer: Use an OwnPtr for cached connections
Otherwise we'd end up trying to delete the wrong connection if a
connection made before us is deleted.
Fixes _some_ RequestServer spins (though not all...).
This commit also adds a small debug mechanism to RequestServer (which
can be enabled by turning REQUEST_SERVER_DEBUG on), that can dump all
the current active connections in the cache, what they're doing, and how
long they've been doing that by sending it a SIGINFO.
2021-09-29 11:47:18 +02:00
Idan Horowitz 071a358ffb LibWeb: Add support for converting IDL dictionaries to native structs 2021-09-29 10:09:33 +03:00
Idan Horowitz c3810b827a LibWeb: Add support for parsing IDL dictionaries 2021-09-29 10:09:33 +03:00
Idan Horowitz 87f655f2af LibWeb: Change IDL::parse_interface's return type to NonnullOwnPtr
We always returned an interface, so there's no need for the null state.
2021-09-29 10:09:33 +03:00
Idan Horowitz cdde3ba5c5 LibWeb: Add partial support for IDL Iterable declarations
This currently only supports pair iterables (i.e. iterable<key, value>)
support for value iterables (i.e. iterable<value>) is left as TODO().

Since currently our cmake setup calls the WrapperGenerator separately
and unconditionally for each (hard-coded) output file iterable wrappers
have to be explicitly marked so in the CMakeLists.txt declaration, we
could likely improve this in the future by querying WrapperGenerator
for the outputs based on the IDL.
2021-09-28 16:51:27 +02:00
Idan Horowitz 2fab43ba5d LibWeb: Add support for wrapping arbitrary values to WrapperGenerator
This patch essentially just splits the non return-specific logic from
generate_return_statement (i.e. the wrapping of the cpp value into
a javascript one) into a separate function generate_wrap_statement that
can be used to wrap any cpp value during wrapper generation.
2021-09-28 16:51:27 +02:00
Idan Horowitz a11f7868a4 LibWeb: Only consume [a-zA-Z0-9_] characters for IDL types 2021-09-28 16:51:27 +02:00
Luke Wilde 067d839615 LibWeb: Add support for the any type in returning and parameters
Required for CustomEvent.
2021-09-27 18:45:45 +02:00
Luke Wilde d30ec4d790 LibWeb: Add [CustomVisit] IDL interface extended attribute
This custom attribute will be used for objects that hold onto arbitrary
JS::Value's. This is needed as JS::Handle can only be constructed for
objects that implement JS::Cell, which JS::Value doesn't.

This works by overriding the `visit_edges` function in the wrapper.
This overridden function calls the base `visit_edges` and then forwards
it to the underlying implementation.

This will be used for CustomEvent, which must hold onto an arbitrary
JS::Value for it's entire lifespan.
2021-09-27 18:45:45 +02:00
Nico Weber 5565db5aa1 Meta: Pass -serial stdio to qemu on aarch64
With this, `Meta/serenity.sh run aarch64` produces some output on
the terminal :^)
2021-09-26 23:14:01 +00:00
Andreas Kling 43d378940f LibWeb: Add DOMRect and Element.getBoundingClientRect()
This marks our entry into the Web::Geometry namespace, based on the
"Geometry" spec at https://drafts.fxtf.org/geometry/
2021-09-27 01:01:29 +02:00
Luke Wilde 41ae0c0216 LibWeb: Add support for IDL legacy platform objects
A legacy platform object is a non-global platform object that
implements a special operation. A special operation is a getter, setter
and/or deleter. This is particularly used for old collection types,
such as HTMLCollection, NodeList, etc.

This will be used to make these spec-compliant and remove their custom
wrappers. Additionally, it will be used to implement collections that
we don't have yet, such as DOMStringMap.
2021-09-26 18:59:56 +02:00
Idan Horowitz 8dcf4e0346 LibWeb: Return undefined from generated EventHandler setters
Returning an empty value without throwing an exception is no longer
valid.
2021-09-25 23:35:54 +02:00
Sam Atkins 4b554ba92a LibWeb: Clarify StyleValue API with new naming scheme
This does a few things, that are hard to separate. For a while now, it's
been confuzing what `StyleValue::is_foo()` actually means. It sometimes
was used to check the type, and sometimes to see if it could return a
certain value type. The new naming scheme is:

- `is_length()` - is it a LengthStyleValue?
- `as_length()` - casts it to LengthStyleValue
- `has_length()` - can it return a Length?
- `to_length()` - gets the internal value out (eg, Length)

This also means, no more `static_cast<LengthStyleValue const&>(*this)`
stuff when dealing with StyleValues. :^)

Hopefully this will be a bit clearer going forward. There are lots of
places using the original methods, so I'll be going through them to
hopefully catch any issues.
2021-09-24 15:01:43 +02:00
Linus Groh a1a164e6b8 LibWeb: Return undefined from generated setters, not an empty value
These now crash as VM::call() uses ThrowExceptionOr<T>, which refuses to
hold an empty JS::Value as its non-exception result.
We only need to return an empty value when should_return_empty() says
so for the return value of throw_dom_exception_if_needed().

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2021-09-24 12:57:04 +02:00
Sam Atkins b927972da7 LibWeb: Add range-checking to property_accepts_value()
For `number` and `integer` types, you can add a range afterwards to add
a range check, using similar syntax to that used in the CSS specs. For
example:

```json
"font-weight": {
  ...
  "valid-types": [
    "number [1,1000]"
  ],
  ...
}
```

This limits any numbers to the range `1 <= n <= 1000`.
2021-09-23 17:47:40 +02:00
Sam Atkins 11d3098f40 LibWeb: Generate property_accepts_value() function :^)
Previously, we have not been validating the values for CSS declarations
inside the Parser. This causes issues, since we should be discarding
invalid style declarations, so that previous ones are used instead. For
example, in this code:

```css
.foo {
  width: 2em;
  width: orange;
}
```

... the `width: orange` declaration overwrites the `width: 2em` one,
even though it is invalid. According to the spec, `width: orange` should
be rejected at parse time, and discarded, leaving `width: 2em` as the
resulting value.

Many properties (mostly shorthands) are parsed specially, and so they
are already rejected if they are invalid. But for simple properties, we
currently accept any value. With `property_accepts_value()`, we can
check if the value is valid in `parse_css_value()`, and reject it if it
is not.
2021-09-23 17:47:40 +02:00
Sam Atkins a1bc89b814 LibWeb: Generate property_maximum_value_count()
This will allow the CSS Parser to check if a property has been give too
many arguments, and if so, reject it as invalid.
2021-09-23 17:47:40 +02:00
Andreas Kling ca45d34055 LibWeb: Don't add shorthand CSS properties to cascaded values
We already expand shorthands in the cascade, so there's no need to
preserve them in the output.

This patch reorganizes the CSS::PropertyID enum values so that we can
easily iterate over all shorthand or longhand properties.
2021-09-21 16:54:28 +02:00
Timothy Flynn 8084957e88 CI: Create a secondary ccache for the Clang toolchain build
We bust the prebuilt cache when any header in e.g. LibC changes. Doing a
full toolchain rebuild probably isn't necessary, so this adds a separate
ccache to speed up toolchain builds.
2021-09-21 15:39:17 +03:00
Timothy Flynn 4a4e614387 CI: Set ccache path based on template parameter
Currently, the templated steps in Caches.yml rely on the environment
variable CCACHE_DIR being set to configure the ccache location. To
prepare for multiple ccache paths, do not rely on this environment
variable because only one ccache can use it at a time. Instead, pass
the path into the template as a parameter.
2021-09-21 15:39:17 +03:00
Andreas Kling 7ed49e954f LibWeb: Don't print debug spam when looking up missing initial values
I'm about to look up a lot of missing values, and the spam was getting
out of hand.
2021-09-21 12:33:15 +02:00
Andreas Kling 95559c4277 LibWeb: Implement basic support for MessageChannel and MessagePort
This patch adds a basic initial implementation of these API's.

Since LibWeb currently doesn't support workers, this implementation of
messaging doesn't bother with serializing and deserializing messages.
2021-09-19 22:34:44 +02:00
Andreas Kling dd29abe4d6 Meta: Bump default VM memory size to 1 GiB 2021-09-19 22:34:43 +02:00
Brian Gianforcaro aa118642aa Lagom/Fuzzers: Add fuzzer for the LibCrypto PEM parser 2021-09-18 17:15:08 +00:00
Brian Gianforcaro 4f5d71b4e8 Lagom/Fuzzers: Add fuzzer for the LibTLS ASN1 parser 2021-09-18 17:15:08 +00:00
Andrew Kaster aed56b46d4 Documentation: Update Lagom ReadMe with new fuzzer build instructions 2021-09-18 16:38:59 +03:00
Sam Atkins 6ea9edf84b LibWeb: Generate shorthand initial values after their longhands
When parsing shorthand values, we'd like to use
`property_initial_value()` to get their longhand property values,
instead of hard-coding them as we currently do. That involves
recursively calling that function while the `initial_values` map is
being initialized, which causes problems because the shorthands appear
alphabetically before their longhand components, so the longhands aren't
initialized yet!

The solution here is to perform 2 passes when generating the code,
outputting properties without "longhands" first, and the rest after.
This could potentially cause issues when shorthands have multiple
levels, in particular `border` -> `border-color` -> `border-left-color`.
But, we do not currently define a default value for `border`, and
`border-color` takes only a single value, so it's fine for now. :^)
2021-09-17 23:06:45 +02:00
Andreas Kling 11bb6e045f LibWeb: Add the IdleDeadline interface from the RequestIdleCallback spec 2021-09-17 13:20:18 +02:00
Brian Gianforcaro 5c244a7893 Meta: Set SERENITY_ARCH if it is not set in debug-kernel.sh
This appears to have regressed recently in commit 783a58dbc.
2021-09-17 09:16:40 +00:00
Andrew Kaster d0506730b8 Meta: Ensure BUILD_LAGOM is set when running serenity.sh test lagom
If the superbuild created the lagom binary directory, it won't set
BUILD_LAGOM=ON in the CMake cache for that binary directory. Insert a
check into build_target() to make sure that if the user explicitly asks
for the lagom target, we have all our ducks in a row.
2021-09-16 15:47:13 +00:00
Andrew Kaster 454a839f49 CI+Meta: Update Sonar Cloud CI job for new SuperBuild configuration
This requires exposing the `configure` step on the `serenity`
ExternalProject in the SuperBuild CMakeLists so that we can continue to
only build the generated sources and not the entire OS.
2021-09-16 15:47:13 +00:00
Andrew Kaster 04d91e90c2 Meta: Fix Lagom RPATH for non-Ubuntu Linux and macOS hosts
Multi-lib distros like Gentoo and Fedora install lagom-core.so into
lagom-install/lib64 rather than lib. Set the install RPATH based on
CMAKE_INSTALL_LIBDIR to avoid the wrong path being set in the binaries.

Also apply macOS specific RPATH rules to fix the build on that platform.
2021-09-16 15:47:13 +00:00
Ben Wiederhake 51b42e0463 Meta: Make QtCreator aware of all CMake files 2021-09-15 20:21:19 +00:00
Andrew Kaster 368d2ace55 Meta: Add FIXME for not setting BUILD_SHARED_LIBS in Lagom build
This is really the business of the consuming project. We will need to
make changes to libjs-test262 and to oss-fuzz to address this properly.
2021-09-15 19:04:52 +04:30
Andrew Kaster bd7b158c71 Meta: Update serenity.sh for the SuperBuild
Direct build commands to the SuperBuild's binary directory, and
image/run commands to the Serenity binary directory.

As a side benefit, make the lagom target only build Lagom instead of the
entire OS alongside Lagom.
2021-09-15 19:04:52 +04:30
Andrew Kaster b5c98ede08 Meta: Switch to a SuperBuild that splits host and target builds
Replace the old logic where we would start with a host build, and swap
all the CMake compiler and target variables underneath it to trick
CMake into building for Serenity after we configured and built the Lagom
code generators.

The SuperBuild creates two ExternalProjects, one for Lagom and one for
Serenity. The Serenity project depends on the install stage for the
Lagom build. The SuperBuild also generates a CMakeToolchain file for the
Serenity build to use that replaces the old toolchain file that was only
used for Ports.

To ensure that code generators are rebuilt when core libraries such as
AK and LibCore are modified, developers will need to direct their manual
`ninja` invocations to the SuperBuild's binary directory instead of the
Serenity binary directory.

This commit includes warning coalescing and option style cleanup for the
affected CMakeLists in the Kernel, top level, and runtime support
libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN
with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be
confused by a host clang compiler.
2021-09-15 19:04:52 +04:30
Andrew Kaster 904a268872 Meta: Move all options to targetname_options.cmake files
This common strategy of having a serenity_option() macro defined in
either the Lagom or top level CMakeLists.txt allows us to do two things:

First, we can more clearly see which options are Serenity-specific,
Lagom-specific, or common between the target and host builds.

Second, it enables the upcoming SuperBuild changes to set() the options
in the SuperBuild's CMake cache and forward each target's options to the
corresponding ExternalProject.
2021-09-15 19:04:52 +04:30
Andrew Kaster 6e7cc40b18 Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and Lagom
This makes it so we don't need to specify the full path to all the
helper scripts we include() from different places in the codebase and
feels a lot cleaner.
2021-09-15 19:04:52 +04:30
Andrew Kaster a269a32a17 Meta: Use Lagom:: namespaced names for code generators
This will be required when we switch to a SuperBuild that has Lagom as
a configure time dependency, but is a distinct enough change to be
separate.
2021-09-15 19:04:52 +04:30
Andrew Kaster fc8d1bf3ce Meta: Allow specifying alternative paths for downloaded Unicode data
This lets us possibly share downloaded artifacts between different
builds without re-downloading them every time you change toolchains.
2021-09-15 19:04:52 +04:30
Andrew Kaster a6d83e02d2 Meta: Define and use lagom_tool() CMake helper function for all Tools
We'll use this to prevent repeating common tool dependencies. They all
depend on LibCore and AK only. We also want to encapsulate common
install rules for them.
2021-09-15 19:04:52 +04:30
Brian Gianforcaro fbb31b4519 Kernel: Disable lock rank enforcement by default for now
There are a few violations with signal handling that I won't be able to
fix it until later this week. So lets put lock rank enforcement under a
debug option for now so other folks don't hit these crashes until rank
enforcement is more fleshed out.
2021-09-14 18:31:16 +00:00
Ali Mohammad Pur 7e75a16e6f Meta: Tweak the error in check-ak-test-files.sh a bit
This can also be tripped when the change was simply not being committed,
avoid confusing the author by simply mentioning that.
2021-09-14 21:33:15 +04:30
Idan Horowitz fe32c9c3bd LibWeb: Add the URL::searchParams attribute 2021-09-14 00:14:45 +02:00
Idan Horowitz 23997005cf LibWeb: Allow IDL attribute setters to throw DOMExceptions 2021-09-14 00:14:45 +02:00
Idan Horowitz f9a169380c LibWeb: Consume the extra whitespace in stringifier attributes 2021-09-14 00:14:45 +02:00
Andreas Kling 2e4b34b8c3 LibWeb: Generate CSS::{first,last}_property_id constants
These will allow us to iterate through all known CSS properties.
2021-09-13 22:21:57 +02:00
Idan Horowitz 4629f2e4ad LibWeb: Add the Web::URL namespace and move URLEncoder to it
This namespace will be used for all interfaces defined in the URL
specification, like URL and URLSearchParams.

This has the unfortunate side-effect of requiring us to use the fully
qualified AK::URL name whenever we want to refer to the AK class, so
this commit also fixes all such references.
2021-09-13 01:43:10 +02:00
Idan Horowitz 2b78e227f2 LibWeb: Add support for generating a stringifier method/attribute 2021-09-13 01:43:10 +02:00
Idan Horowitz 47e261c691 LibWeb: Escape reserved names of generated wrapper functions
This also adds 'delete' to the list of reserved cpp names.
2021-09-13 01:43:10 +02:00
Sam Atkins af58bddfc8 LibWeb: Generate CSS::property_has_quirk() function
This lets you query if a given Quirk applies to a given PropertyID.
Currently this applies only to the "Hashless hex color" and "Unitless
length" quirks.
2021-09-12 16:30:38 +02:00
Luke Wilde 678dd2d180 LibWeb: Expose the location object via Document.location
Both Window.location and Document.location use the same instance of the
Location object. Some sites use it via Window, some via Document.
2021-09-12 16:07:24 +02:00
Luke Wilde 3faed65e2b LibWeb: Add full support for optional and nullable to IDL string types
Used by History.
2021-09-12 01:41:44 +02:00
Luke Wilde f8eb616fe3 LibWeb: Add support for the IDL any type
The any type is essentially a raw JS::Value.
2021-09-12 01:41:44 +02:00
Timothy Flynn c59b97043e LibWeb: Use ErrorType::NotAnObjectOfType instead of NotA 2021-09-12 00:16:39 +02:00
Idan Horowitz 6704961c82 AK: Replace the mutable String::replace API with an immutable version
This removes the awkward String::replace API which was the only String
API which mutated the String and replaces it with a new immutable
version that returns a new String with the replacements applied. This
also fixes a couple of UAFs that were caused by the use of this API.

As an optimization an equivalent StringView::replace API was also added
to remove an unnecessary String allocations in the format of:
`String { view }.replace(...);`
2021-09-11 20:36:43 +03:00
Timothy Flynn b1d4bcf364 LibUnicode: Generate numeric keyword values for each locale
This is needed for Intl.NumberFormat's usage of the ResolveLocale AO,
where the [[RelevantExtensionKeys]] internal slot will be "nu".
2021-09-11 11:05:50 +01:00
Timothy Flynn 32a2a02489 LibUnicode: Fix typo in listPatterns.json parsing method 2021-09-08 21:08:48 +01:00
Idan Horowitz 24ed8511dd CI+Meta: Add Signed-off-by tag filter to the commit message linter 2021-09-07 20:46:34 +01:00
Idan Horowitz f56bdd2bb7 Meta: Don't immediately continue in serenity.sh's gdb option
This allows us to step through the initial boot instructions.
2021-09-07 12:58:46 +02:00
Idan Horowitz 783a58dbc7 Toolchain: Build aarch64-gdb for cross-debugging on x86 2021-09-07 12:58:46 +02:00
Timothy Flynn 4ad2159812 LibUnicode: Remove Unicode locale variants from CLDR path names
There's only a couple of cases like this, but there are some locale
paths in the CLDR that contain variants. For example, there isn't a
en-US path, but there is a en-US-POSIX path. This interferes with the
operation to search for locales by name. The algorithm is such that
searching for en-US will not result in en-US-POSIX being found. To
resolve this, we should remove variants from the locale name.
2021-09-06 23:49:56 +01:00
Timothy Flynn 3f64a14e06 LibUnicode: Parse and generate the Unicode locale list patterns dataset
This data informs consumers how to join lists of values. For example,
in en-US, the list ["a", "b", "c"] formatted to a string should become
"a, b, and c".
2021-09-06 23:49:56 +01:00
Timothy Flynn 9cd986d8c0 LibUnicode: Extract cldr-misc dataset from CLDR database 2021-09-06 23:49:56 +01:00
Nico Weber f1d1418256 Meta: Unbreak serenity.sh run aarch64 after 918f7cb4a8 2021-09-06 21:57:59 +01:00
Timothy Flynn 077a693de6 LibUnicode: Sort special casing array by locale specificity
This is to simply the Default Case Conversion implementation. Otherwise,
the implementation would need to determine which special casing rule to
apply, instead of just picking the first match.
2021-09-06 15:24:27 +01:00
Timothy Flynn 91db61ae8d LibUnicode: Generate canonical combining class in Unicode data
Will be used by special casing rules.
2021-09-06 15:24:27 +01:00
Ali Mohammad Pur d20fc922c5 Meta: Correct misuse of ByteBuffer::resize() as grow() in FuzziliJS 2021-09-06 01:53:26 +02:00
Ali Mohammad Pur 97e97bccab Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
Tom 918f7cb4a8 Meta: Force legacy xAPIC when using 8 cores or less
This is merely so that we exercise the legacy xAPIC code when we don't
really need x2APIC.
2021-09-04 22:22:58 +02:00
Timothy Flynn e6a2ab1202 LibUnicode: Generate an implementation of the Add Likely Subtags method 2021-09-04 13:51:40 +01:00
Timothy Flynn 28ae63177e LibUnicode: Generate the entire locale likely-subtags dataset
The amount of aliases in the likely-subtags dataset is quite large, so
this also needed to change the way the data is generated. Otherwise, the
compiler would complain about the size of the generated code.

Previously, a static method was generated that would effectively parse
the dataset into a HashMap of Unicode::LanguageID at runtime. We now
perform that parsing at generation-time, and instead generate an Array
of a structure similar to Unicode::LanguageID (we cannot use the same
structure because it contains String and Optional, which cannot be used
at compile-time).
2021-09-04 13:51:40 +01:00
Liav A 8cb4fcdbd8 Meta: Add q35grub option in run.sh
This option is similar to the qgrub option, but instead of starting a
QEMU PIIX4 machine, it starts a QEMU Q35 machine, booting a grub image
disk within it.
2021-09-04 12:54:00 +02:00
Tom 77953a937d Meta: Add the ability to specify clang with serenity.sh
This enables maintaining gcc and clang builds side-by-side.
2021-09-03 23:12:17 +02:00
Luke Wilde ed97ee902b LibWeb: Add support for IDL static functions 2021-09-03 23:11:58 +02:00
Luke Wilde 1d8f8ea5b1 LibWeb: Add initial support for AbortController and AbortSignal
The DOM specification says that the primary use case for these is to
give Promises abort semantics. It is also a prerequisite for Fetch,
as it is used to make Fetch abortable.
a
2021-09-02 09:12:17 +02:00
Timothy Flynn 1fbc5dba08 LibUnicode: Generate Unicode locale likely subtag data
CLDR contains a set of likely subtag data where, given a locale, you can
resolve what is the most likely language, script, or territory of that
locale. This data is needed for resolving territory aliases. These
aliases might contain multiple territories, and we need to resolve which
of those territories is most likely correct for a locale.

Note that the likely subtag data is quite huge (a few thousand entries).
As an optimization encouraged by the spec, we only generate the smallest
subset of this data that we actually need (about 150 entries).
2021-09-01 14:14:47 +01:00
Timothy Flynn 9ae7ac4c87 LibUnicode: Generate complex Unicode locale alias matching
Most alias substitutions are "simple", meaning that alias matching is
done by examining a single locale subtag. However, there are a handful
of "complex" aliases where matching is done by examining multiple
subtags. For example, the variant subtag "lojban" causes the locale
"art-lojban" to be canonicalized to "jbo", but only when the language
subtag is "art" (i.e. this should not occur for the locale "en-lojban").

This generates a method to perform complex alias matching.
2021-09-01 14:14:47 +01:00
Timothy Flynn 9b118f1f06 LibUnicode: Generate Unicode locale alias data
CLDR contains a set of aliases for languages, territories, etc. that no
longer are meant to be used (e.g. due to deprecation). For example, the
language "aam" is deprecated and should be canonicalized as "aas".
2021-09-01 14:14:47 +01:00
Timothy Flynn caf5b6fa6f LibUnicode: Extract cldr-core dataset from CLDR database 2021-09-01 14:14:47 +01:00
Peter Elliott 8d2c04821f Tests: Test LibMarkdown against commonmark test suite
TestCommonmark runs the CommonMark test suite
(https://spec.commonmark.org/0.30/spec.json) against LibMarkdown.
Currently 44/652 tests pass.
2021-08-31 16:53:51 +02:00