Commit Graph

2417 Commits

Author SHA1 Message Date
Andrew Kaster
804188ac0c Meta: Port 1d59a62944 to gn build 2023-07-31 12:02:17 -06:00
Andreas Kling
cb8664e2e1 LibWeb/BindingsGenerator: Fix the build
I'm not sure why this didn't break on CI, but none of my machines were
able to build without this change.
2023-07-31 07:39:49 +02:00
Andrew Kaster
3dd3120a8a Meta+BindingsGenerator: Only invoke BindingsGenerator once per IDL file
This reduces the number of tasks to schedule, and the complexity of the
build system integrations for the BindingsGenerator. As a bonus, we move
the "only write if changed" feature into the generator to reduce the
build system load on generated files for this generator.
2023-07-30 17:50:44 -06:00
Andrew Kaster
cc3e179b23 Meta: Port 60e35f2a97 to gn build 2023-07-30 16:52:03 -06:00
Andrew Kaster
fac389f648 Meta: Port 1837e94ba4 to gn build 2023-07-30 16:51:33 -06:00
Lucas CHOLLET
005184e4a4 Meta: Use is instead of == to compare types
This fixes the multiple "E721 do not compare types" failures that
appeared during CI runs.
2023-07-29 23:23:25 +01:00
Andreas Kling
13d5d47b56 LibWeb: Implement the CSS all property
This sets all longhand values to one of initial, inherit, unset or
revert. Note that revert is not supported yet, but will be soon.
2023-07-29 19:16:08 +02:00
Timothy Flynn
bbd80d2e4d LibLocale: Replace some slow CLDR vector lookups with a hash map
The LocaleData generator currently stores vectors of unique instances of
CLDR data (e.g. languages, currencies, etc.). For each CLDR file that we
parse, we linearly search through those vectors to decide if the current
field being parsed is unique. Given the size of the CLDR, this adds up
to quite a bit of time.

Augment these vectors with a hash map to store the index of each unique
instance in those vectors. This allows for quickly checking if a field
is unique, and to later look up those indices.

We do not apply this technique to every bit of CLDR data here. For
example, CLDR::character_orders contains only 2 entries. In that case,
it is quicker to search the vector than it is to hash a string key.

This reduces the runtime of GenerateLocaleData from to 2.03s to 1.09s.
2023-07-28 21:05:52 +02:00
Timothy Flynn
e86769c068 LibLocale: Preprocess unique CLDR date fields
Similar to languages and currencies, extract the loop to collect the
unique set of date fields to a preprocessing function. This alone does
not yield any performance improvement, but combined with an upcoming
patch will make the parse_locale_date_fields() a bit faster.
2023-07-28 21:05:52 +02:00
Timothy Flynn
c9b39c0c39 LibLocale: Decide to skip parsing CLDR calendars a little earlier
We currently parse each CLDR calendar, then decide based on its primary
key whether we want to skip it. Instead, we can decide to skip it based
on its file name.

This reduces the runtime of GenerateLocaleData from 2.03s to 1.97s.
2023-07-28 21:05:52 +02:00
Timothy Flynn
63035f029a LibLocale: Cache parsed CLDR files that must be read more than once
The LocaleData generator has to read a few of the CLDR files more than
once, to e.g. prepare some data up front (for reasons why, see commits
c86f7a6 and 0b69e9f). This takes non-neglible time, especially for large
JSON files such as currencies.json. So in these cases, cache the parsed
JSON in a map.

This reduces the runtime of GenerateLocaleData from 2.32s to 2.03s.
2023-07-28 21:05:52 +02:00
Timothy Flynn
b91af3c6a0 LibUnicode: Remove a few generator tracking fields that are now unused
These were used to generate specialized tables. Now that those tables
have been migrated to general 2-stage lookup tables, these fields are
all unused.
2023-07-28 05:28:50 +02:00
Timothy Flynn
456211932f LibUnicode: Perform code point case conversion lookups in constant time
Similar to commit 0652cc4, we now generate 2-stage lookup tables for
case conversion information. Only about 1500 code points are actually
cased. This means that case information is rather highly compressible,
as the blocks we break the code points into will generally all have no
casing information at all.

In total, this change:

    * Does not change the size of libunicode.so (which is nice because,
      generally, the 2-stage lookup tables are expected to trade a bit
      of size for performance).

    * Reduces the runtime of the new benchmark test case added here from
      1.383s to 1.127s (about an 18.5% improvement).
2023-07-28 05:28:50 +02:00
Timothy Flynn
0ee133af90 LibUnicode: Separate code point case information into its own structure
There is no functional change here. This information will compose the
upcoming multistage casing tables in an upcoming patch. Extract it to
its own struct to prepare for that.
2023-07-28 05:28:50 +02:00
Timothy Flynn
a332a8ad19 LibUnicode: Prepare Unicode data generator for multistage casing tables
There is no functional change here. This just adjusts the changes made
in commit 0652cc4 to be a bit more generic for code point casing tables.
We currently only generate property tables, which boil down to a vector
of booleans. Casing tables will be a struct of varying types, so this
generalizes some of the generator to prepare for that ahead of time, to
make the upcoming casing patch smaller / easier to grok.
2023-07-28 05:28:50 +02:00
Timothy Flynn
3fae92eea2 LibUnicode: Search code point properties sequentially at compile time
When generating code point property tables, we currently binary search
the code point range lists for each property to decide if a code point
has that property. However, we are both iterating over the code points
and through the sorted properties in order. This means we do not need
to search code point ranges that are below the current code point at
all. We can even remove the code point ranges that fall below the
current code point, as we will not see a code point in those ranges
again.

On my machine, this reduces the run time of GenerateUnicodeData from
3.4 seconds to 1.2 seconds.
2023-07-28 05:28:50 +02:00
Andrew Kaster
2e0e393889 Meta: Port recent build changes to gn build
This ports the following commits:

e8a63eeb0e
bec07d4af7
0e12503586
2023-07-27 12:08:22 -06:00
Nico Weber
dcb2f3aa89 Meta/gn: Don't use "abspath" for IDL inputs
The idl file lists are used for two things:

1. As inputs for `generate_window_or_worker_interfaces`
2. In a loop in `generate_idl_bindings` and the loop variable
   is passed to `rebase_path`

Both these cases can handle a normal fully-qualified GN path,
so there's no need for the "abspath".

No behavior change.
2023-07-27 10:02:01 -06:00
Nico Weber
406b68a612 Meta: Port 77d7f715e3 to gn 2023-07-27 10:02:01 -06:00
Zaggy1024
66c9696687 LibGfx: Add initial ISO BMFF parsing and a utility to print file info
Currently, the `isobmff` utility will only print the media file type
info from the FileTypeBox (major brand and compatible brands), as well
as the names and sizes of top-level boxes.
2023-07-27 12:02:37 +01:00
Timothy Flynn
47595b9ef0 CI: Set TESTS_ONLY mode for unit tests on Lagom
This disables running benchmark test cases on Lagom in CI. When we run
unit tests on-board Serenity, run-tests sets this environment variable.
We do not use that utility to run unit tests on Lagom, so we've been
running benchmark tests unnecessarily.
2023-07-26 16:09:29 -06:00
Sam Atkins
bf1d680a75 FuzzPDF: Initialize document so page count is accurate
Without calling `initialize()`, the page count is 0, so the loop never
ran and we never actually tested any of the code in `get_page()`.
2023-07-26 06:22:34 -04:00
Andrew Kaster
5028223c37 Meta+Utilities: Make pre-commit checks significantly less verbose
When markdown-check is built, it outputs hundreds of lines of "ignoring
this and that link because reasons". This is extremely not helpful when
trying to figure out exactly which check failed on your commit. Also
remove the timing numbers from lint-ci.sh These are just noise and also
don't help to figure out which pre-commit check failed. Ideally the
output on fail should be "[OK]: Check A" for all the passing checks and
"[FAIL] Check N" with the required context for the failed check.
2023-07-26 06:21:39 -04:00
Timothy Flynn
0652cc48c0 LibUnicode: Perform code point property lookups in constant time
We currently produce a single table for all categories of code point
properties (GeneralCategory, Script, etc.). Each row contains a field
indicating the range of code points to which that property applies. At
runtime, we then do a binary search through that table to decide if a
code point has a property.

This changes our approach to generate a 2-stage lookup table for each of
those categories. There is an in-depth explanation of these tables above
the new `create_code_point_tables` method. The end effect is that code
point property lookup is reduced from a binary search to constant-time
array lookups.

In total, this change:

    * Increases the size of libunicode.so from 2.7 MB to 2.9 MB.

    * Reduces the runtime of the new benchmark test case added here from
      3.576s to 1.020s (a 3.5x speedup).

    * In a profile of resizing a TextEditor window with a 3MB file open,
      the runtime of checking if a code point has a word break property
      reduces from ~81% to ~56%.
2023-07-26 08:36:20 +02:00
Timothy Flynn
8f1d73abde LibUnicode: Use the public CodePointRange in the code generator
The next commit will need a type from LibUnicode/CharacterTypes.h. To
avoid conflicts between that header's CodePointRange and the one that is
defined in the code generator, just use the public definition.
2023-07-26 08:36:20 +02:00
Timothy Flynn
cb128dcf75 LibUnicode: Move the CodePointRangeComparator struct to a public header
Move it out of the generated code so that it may be used by the code
generator itself.
2023-07-26 08:36:20 +02:00
Timothy Flynn
c950f88611 LibUnicode: Stop generating Block property data
We started generating this data in commit 0505e03, but it was unused.
It's still not used, so let's remove it, rather than bloating the size
of libunicode.so with unused data. If we need it in the future, it's
trivial to add back.

Note we *have* always used the block name data from that commit, and
that is still present here.
2023-07-26 08:36:20 +02:00
Andreas Kling
96d5a1edb0 test-js: Run with the JavaScript bytecode VM by default
The AST interpreter is still available behind a new `--ast` flag.

We switch to testing with bytecode in the big run-tests battery on
SerenityOS. Lagom CI continues running both AST and BC.
2023-07-25 20:00:46 +02:00
Dan Klishch
f25745ed27 Meta: Test LibXML on Lagom 2023-07-23 16:09:12 +02:00
Shannon Booth
732ef1e7e9 Meta: Enable test-js bytecode tests 2023-07-23 07:36:13 +02:00
Sebastian Zaha
7696738140 Meta: Port recent LibWeb and LibJS changes to gn build
This ports the following commits:
a8587fe54e
9d7215c636
2023-07-20 06:48:13 +01:00
Timothy Flynn
9d7215c636 LibJS+LibWeb: Move IteratorOperations.h AOs to Iterator.h
Rather than splitting the Iterator type and its AOs into two files,
let's combine them into one file to match every other JS runtime object
that we have.
2023-07-19 14:11:43 +01:00
Timothy Flynn
5703833116 LibJS+LibWeb: Refactor GetIterator to use GetIteratorFromMethod
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/956e5af

This splits the GetIterator AO into two AOs, to remove some recursion
and to (soon) remove optional parameters.
2023-07-19 06:56:51 +02:00
MacDue
b5658d75f5 Fuzzers: Add a DDS fuzzer 2023-07-19 06:52:06 +02:00
MacDue
581236b24a Fuzzers: Add a TinyVG fuzzer 2023-07-19 06:52:06 +02:00
Lucas CHOLLET
4291288a31 LibGfx: Remove ImageDecoderPlugin::initialize()
No plugin is currently overriding the default implementation, which is a
no-op. So we can safely delete it.
2023-07-18 14:34:35 +01:00
Cameron Youell
ae845835d6 Meta: Dont finish lines with only one character in lint-ports.py 2023-07-18 00:17:34 +02:00
Andrew Kaster
5c2c412318 Meta: Bind WritableStreamDefaultController to JS
This was missed in 868cd95069.
2023-07-17 00:00:49 +01:00
Andrew Kaster
6ffed4d62a Meta: Port LibWeb/Streams changes to gn build
This ports the following commits:

c9941ba95b
f86c3ab148
12ff48047f
f1d69d789b
0091a60448
2023-07-17 00:00:49 +01:00
Andrew Kaster
57ad638dcc Meta: Port 618c0402 to gn build 2023-07-17 00:00:49 +01:00
Ali Mohammad Pur
a720feba2f Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts
fddbd11baa made it so the command executed
read `sh -c -- '"script" args*'`, the -- in this command is redundant as
the script name never starts with a dash and can never be interpreted as
an option or a flag.
The actually meaningful placement for -- here is after `$SUDO`, to make
sure `$SUDO` does not incorrectly treat `-c` as an option to itself, and
`$SHELL` cannot be interpreted as an option/flag in the extremely
unlikely event that it starts with a dash.
2023-07-16 16:28:18 +01:00
Sebastian Zaha
3cbfd6382c Meta: Port 16b487c270 to gn build 2023-07-16 09:27:12 -06:00
Daniel Bertalan
e64a8751d1 LibJS: Do not use the $ special character in file names
The dollar sign is a special character in POSIX shells and in the Ninja
build file format. If the file name contains a `$`, something goes wrong
in the escaping/unescaping of this symbol, and CMake/GCC/Clang generate
invalid dependency files where not all instances of `$` are escaped
properly. Because of this, Ninja fails to rebuild `$262Object.cpp` if
the headers included by it have changed.

Stale `$262Object.cpp.o` files have been the cause of mysterious crashes
multiple times which only go away after doing a clean build. Let's
prevent these from happening again by removing the `$` from the
filename.
2023-07-15 11:09:22 -04:00
Kenneth Myhra
90fdd598c2 LibWeb: Make sure we do not generate duplicate variable names 2023-07-15 11:59:39 +02:00
Sam Atkins
618c0402a7 LibWeb: Generate parsing code for CSS math functions 2023-07-15 10:23:33 +02:00
networkException
103913305b README+Meta: Update the screenshot :^)
Recreating the previous screenshot in a current build of the system will
show many, usually subtle, changes in comparison.

This patch adds a new screenshot of the SerenityOS desktop with
Terminal, File Manager, System Monitor and Ladybird visible.
2023-07-14 23:40:58 +02:00
Andrew Kaster
d185217599 Meta: Add gn linter
This just calls ``gn format`` on any .gn or .gni files, but it matches
the pattern of the other linters.
2023-07-13 14:07:25 -06:00
Andrew Kaster
a21a08cc9d Meta: Format LibWeb gn files
This was missed when merging the initial set. Linter should be next :^)
2023-07-13 14:07:25 -06:00
Andrew Kaster
9061ea4e90 Meta: Add a macOS bundle to gn build for ladybird
This allows opening the ladybird.app app bundle on macOS, using Xcode
tools like Instruments on the applications in the app bundle, and even
installing the app bundle into /Applications :^)
2023-07-13 14:07:25 -06:00
Andrew Kaster
18a4e882dc Meta: Setup rpath/install_name for macOS libraries and binaries in gn 2023-07-13 14:07:25 -06:00
Andrew Kaster
8475ccc232 Meta: Port c0f985ffcf to gn build 2023-07-13 14:07:25 -06:00
Andrew Kaster
2f16aa45b7 Meta: Port dd073b2711 to gn build 2023-07-13 14:07:25 -06:00
Ali Mohammad Pur
efa55673cd Meta/CodeGenerators+LibWeb: Add support for 'easing-function' CSS values
This commit makes it possible to let properties accept easing functions
as values, which will be used in a later commit to implement
animation-timing-function.
2023-07-13 05:10:41 +02:00
Ali Mohammad Pur
dd073b2711 Meta/CodeGenerators+LibWeb: Implement parsing CSS easing functions
This only implements the parser bits, no functionality is implemented,
and no properties are parsed because of this.
2023-07-13 05:10:41 +02:00
Sebastian Zaha
c006a1ef41 Meta: Update gn build files with latest changes
Ports the recent CMakeFiles.txt changes and fixes the gn build.
2023-07-12 08:31:43 +01:00
Nico Weber
c3f78d9561 pdf: Add function to render a page of a PDF to a bitmap
Use like so:

    Build/lagom/bin/pdf --render foo.png --page=50 path/to.pdf
2023-07-12 07:54:28 +01:00
Valtteri Koskivuori
2c6b156803 Userland: Teach the file utility about zip files
It now shows a short description with a file and directory counts, and
the total content size uncompressed.
2023-07-11 17:48:57 +01:00
Tim Schumacher
89b0a61067 Ports: Remove support for auth_types other than sha256 2023-07-10 13:08:27 +02:00
Andrew Kaster
91528e94ac Meta: Add example linux gn args, fix CSS build on case-insensitive FS 2023-07-09 16:29:31 -06:00
Andrew Kaster
16b83cd8fb Meta: Add gn build rules for Ladybird 2023-07-09 16:22:58 -06:00
Andrew Kaster
85c8cd5205 Meta: Add gn build rules for LibWeb 2023-07-09 16:22:58 -06:00
Andrew Kaster
7b3d0fb002 Meta: Add gn rules for dependencies of LibWeb
There's a lot of them, and LibWeb is a massive set of files to build as
well, so let's add these first :^).
2023-07-09 16:22:58 -06:00
Andrew Kaster
13a5606cdc Meta: Add gn build rules for LibGL and its dependencies 2023-07-09 16:22:58 -06:00
Andrew Kaster
bf02069a89 Meta: Add dependencies for the JS repl to the gn build 2023-07-09 16:22:58 -06:00
Andrew Kaster
165a67b115 Meta: Add LibJS and its dependencies to gn build 2023-07-09 16:22:58 -06:00
Andrew Kaster
1d3898f308 Meta: Add LibUnicode and LibLocale to gn build
A lot of code gen happening here. These generators are kind of
awkward to work with, and the fact that the CLDR data download
extracts over 8,000 files makes it hard to fit into the explicit
patterns GN expects of us.
2023-07-09 16:22:58 -06:00
Andrew Kaster
b1e94a02fe Meta: Add compiled_action from LLVM, use it to generate TZDB sources 2023-07-09 16:22:58 -06:00
Andrew Kaster
0e24bfb464 Meta: Add file download and archive extraction tools to gn build
Use them to download and extract the TZDB files
2023-07-09 16:22:58 -06:00
Andrew Kaster
05f56e09b5 Meta: Add CodeGenerators and library dependencies for them to gn build 2023-07-09 16:22:58 -06:00
Andrew Kaster
cbda1a6c73 Meta: Add LibTest and Tests/AK to gn build 2023-07-09 16:22:58 -06:00
Andrew Kaster
4bfb146181 Meta: Add the start of a gn build based on the LLVM gn build
"based on" in this context means "largely copied from"
2023-07-09 16:22:58 -06:00
Dominique Liberda
d7644d1d86 Meta: Improve build compatibility with non-GNU userspaces
We depend on GNU-specific du switch `--apparent-size`. Busybox has this
implemented, but as `-b` instead.
Another part of the build system uses `cp --preserve=timestamps`. This
can be replaced by `rsync -t`, and rsync is already used through the
file.

Thanks to those changes, Serenity can be built on a Busybox system,
without GNU coreutils.
2023-07-09 06:16:31 +01:00
Dominique Liberda
fddbd11baa Meta: Implement proper checks for sudo alternatives
This introduces support for building with doas.
2023-07-09 06:16:31 +01:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Timothy Flynn
388d455575 Meta: Switch to clang-format-16 as the standard formatter
This includes a few new options to the .clang-format configuration file
to A) adhere to option changes within clang-format 16 (namely the option
AlignTrailingComments), and B) enforce existing style guide rules with
new clang-format rules.
2023-07-08 10:32:56 +01:00
Andrew Kaster
aa329cb2f8 IPCCompiler: Add option to pass output file path
Instead of requiring the caller to redirect stdout, let's be nice
citizens and add an option for the output file.
2023-07-07 06:41:51 -04:00
Luke Wilde
165abafb80 LibWeb: Add initial implementation of IntersectionObserver
The main missing features are rootMargin, proper nested browsing
context support and content clip/clip-path support.

This makes images appear on some sites, such as YouTube and
howstuffworks.com.
2023-07-07 05:27:25 +02:00
Jonah
e9840bfd4e LibWeb: Build out the ARIA role model
We now have implemented the ARIA role model. These classes will
control which states and properties are exposed to end users.
2023-07-06 11:21:36 +01:00
Sam Atkins
38f954cba5 LibWeb: Generate function for what properties resolve percentages to
This is required by "determine the type of a calculation".
https://www.w3.org/TR/css-values-4/#determine-the-type-of-a-calculation
2023-07-06 09:28:16 +02:00
Timothy Flynn
00d8e221f3 Meta: Support enabling compile-time format string checking on Lagom 2023-07-06 08:55:11 +02:00
Timothy Flynn
eed0c32357 IPCMagicLinter: Add missing format parameter to an error log 2023-07-06 08:55:11 +02:00
kleines Filmröllchen
d7a2b5e65b markdown-check: Allow generating a manpage link graph
Using the cross-page links, we can generate a directed graph showing the
topology of which pages refer to other pages. This is not just for fun:
the links show how often a page is linked (since links are not
deduplicated on purpose), which pairs of pages only have links in one
direction (where a link in the other direction may be useful), which
groups of closely-interlinked pages exist, and which pages have few or
no links to other pages.

The EXTRA_MARKDOWN_CHECK_ARGS argument to the check-markdown script can
be used to inject the -g flag for generating the graph on all manpages.
2023-07-05 16:15:42 +01:00
kleines Filmröllchen
8df714ff1e Meta/Fuzzers: Extract common audio fuzzing code
Apart from the class used audio fuzzers have identical behavior: Create
a memory stream from the fuzzer input and pass this to the loader, then
try to load audio until an error occurs. Since the loader plugins need
to have the same static create() function anyways for LibAudio itself,
we can unify the fuzzer implementations and reduce code duplication.
2023-07-05 11:58:50 +01:00
Timothy Flynn
260b0451b0 LibLocale: Update to CLDR version 43.1.0
https://cldr.unicode.org/index/downloads/cldr-43#h.qobmda543waj
2023-07-04 07:26:50 +02:00
Nico Weber
efad31dac1 Utilities: Add a pdf utility
This utility will learn tricks such as extracting images from PDFs and
dumping tables from PDFs so that we can create code from specs.

It also allows testing LibPDF things in lagom, and allows testing
reading large amounts of PDFs using a shell script.
2023-07-04 06:50:15 +02:00
Sebastian Zaha
ef8f0f4f68 Meta: Update path to ladybird in gdb invocation 2023-07-02 18:43:46 +02:00
Andrew Kaster
e0cf52b024 CI: Enable detect_stack_use_after_return ASAN option 2023-07-01 07:03:11 +02:00
Andrew Kaster
bfd6deed1e AK+Meta: Disable consteval completely when building for oss-fuzz
This was missed in 02b74e5a70

We need to disable consteval in AK::String as well as AK::StringView,
and we need to disable it when building both the tools build and the
fuzzer build.
2023-06-29 15:55:54 -06:00
Lucas CHOLLET
4e0b52d009 Meta: Add a gdb pretty-printer for FixedArray 2023-06-28 08:01:01 +01:00
Daniel
30e67721ae Meta: Fix IDL binding generation for dictionary members
- Previously was generating bad syntax and missed a snakecase conversion
2023-06-28 05:22:51 +02:00
kleines Filmröllchen
5f1dbbaaa6 LibAudio: Extract loader stream creation from the plugins
This removes a lot of duplicated stream creation code from the plugins,
and also simplifies the way that the appropriate plugin is found. This
mirrors the ImageDecoderPlugin design and necessitates new sniffing
methods on the loaders.
2023-06-27 15:28:22 +01:00
implicitfield
1e1fcb2ae7 Meta: Remove unused LLVM_VERSION declaration
All uses of this were removed in c4707ed.
2023-06-27 12:40:38 +02:00
implicitfield
941d68ac2d Toolchain+Ports: Update LLVM to 16.0.6 2023-06-27 12:40:38 +02:00
implicitfield
007f3cdb00 Everywhere: Remove exceptions for using #include <LibC/...>
Once LibC is installed to the sysroot and its conflicts with libc++
are resolved, including LibC headers in such a way will cause errors
with a modern LLVM-based toolchain.
2023-06-27 12:40:38 +02:00
implicitfield
79adeb626b LibC+LibELF: Move ELF definitions from LibC to LibELF
This is needed to avoid including LibC headers in Lagom builds.
Unfortunately, we cannot rely on the build machine to provide a
fully POSIX-compatible ELF header for Lagom builds, so we have to
use our own.
2023-06-27 12:40:38 +02:00
implicitfield
ec636a404b Meta: Make check-style.py complain if a non-AK complex header is used
LibC's complex.h should not be used in C++ code, and libc++'s version
implementation does not follow the Serenity C++ style.
2023-06-27 12:40:38 +02:00
Sam Atkins
5056668ab2 Meta: Add lint check that ports have an executable package.sh 2023-06-25 00:18:52 +02:00
Jelle Raaijmakers
f619b61b00 Lagom: Link aconv with LibFileSystem 2023-06-22 22:27:03 +02:00
kleines Filmröllchen
0d65e5f518 Meta: Add aconv as a Lagom tool 2023-06-22 21:45:54 +02:00
Andreas Kling
6537ed8fff LibJS/Bytecode: Simplify Bytecode::Interpreter lifetime model
The JS::VM now owns the one Bytecode::Interpreter. We no longer have
multiple bytecode interpreters, and there is no concept of a "current"
bytecode interpreter.

If you ask for VM::bytecode_interpreter_if_exists(), it will return null
if we're not running the program in "bytecode enabled" mode.

If you ask for VM::bytecode_interpreter(), it will return a bytecode
interpreter in all modes. This is used for situations where even the AST
interpreter switches to bytecode mode (generators, etc.)
2023-06-22 21:16:17 +02:00
Andreas Kling
6150960671 Tests: Remove test-bytecode-js
This was meant to be a temporary unit testuntil we could run test-js
in bytecode mode. This has been possible for a long time now, so let's
remove the unnecessary extra program.
2023-06-22 21:16:17 +02:00
Daniel Bertalan
3ee908df27 Meta: Always use the default host compiler for the toolchain on macOS
GCC's build fails in `libisl`'s configure step if `CC` is set to
Homebrew Clang with the message "Link Time Optimisation is not
supported". This is likely due to the fact that it tries to use ranlib
from Xcode, which is not compatible with the newer LLVM version's
bitcode format.

The toolchain build runs after `pick_host_compiler` is called, which
selects Homebrew Clang if the installed Xcode version is too old. We
need to unset `CC` and `CXX` for the toolchain build to sidestep the
issue.
2023-06-21 06:49:54 -04:00
Timothy Flynn
421aa8da1e Meta: Document that clang-15 is required, and update the compiler checks
We require clang-15 for consteval.
2023-06-21 06:49:47 -04:00
Lucas CHOLLET
e5685078c1 Meta: Add a gdb pretty-printer for Optional 2023-06-21 06:15:35 +02:00
Timothy Flynn
0fd35b4dd8 Meta: Ignore local includes of .moc files
These are generated by Qt and added to the include path automatically by
CMake.
2023-06-21 06:14:15 +02:00
Cameron Youell
0a0ba4cbc5 Meta: Ignore empty directories in lint-ports
Git doesn't track empty directories, so we can just ignore them
2023-06-19 23:13:36 +02:00
Cameron Youell
bc75fa878e Meta: Use Python to parse a port's package.sh in lint-ports
This reduced the runtime of `lint-ports` from 72s down to 0.5s on
my computer (a reduction of ~99.2%)! While it may not be as
accurate as running `package.sh showproperty` it makes using
`precommit` while editing ports much nicer!
2023-06-19 23:13:36 +02:00
implicitfield
d4f5e6eb81 Fuzzers: Update the path to fuzzer binaries
This was overlooked in 71b184a, which broke the oss-fuzz configuration.
2023-06-19 07:40:17 -04:00
Ali Mohammad Pur
2e2e535abb Meta: Build LibCpp for Lagom 2023-06-18 20:30:21 +02:00
Tim Ledbetter
586b47cede Kernel: Put loopback adapter debug spam behind a flag
This significantly increases loopback adapter speed in normal use.
2023-06-18 08:50:33 +01:00
Sam Atkins
acaf2368ad CodeGenerators: Port GenerateCSSValueID to new SourceGenerator API 2023-06-17 17:48:06 +01:00
Sam Atkins
acb600496b CodeGenerators: Port GenerateCSSTransformFunctions to new SourceGen API 2023-06-17 17:48:06 +01:00
Sam Atkins
d197b4b051 CodeGenerators: Port GenerateCSSPropertyID to new SourceGenerator API 2023-06-17 17:48:06 +01:00
Sam Atkins
e7dd5e5b05 CodeGenerators: Port GenerateCSSMediaFeatureID to new SourceGen API 2023-06-17 17:48:06 +01:00
Sam Atkins
17473e3d5e CodeGenerators: Port GenerateCSSEnums to new SourceGenerator API 2023-06-17 17:48:06 +01:00
Sam Atkins
8e53e5afc4 AK: Propagate errors from SourceGenerator::fork() 2023-06-17 17:48:06 +01:00
Sam Atkins
540cc42618 CodeGenerators: Convert GeneratorUtil to String
I may have got a little carried away propagating some of the errors. :^)
2023-06-17 17:48:06 +01:00
Andreas Kling
d063f35afd LibJS/Bytecode: Leave GlobalDeclarationInstantiation in C++
Don't try to implement this AO in bytecode. Instead, the bytecode
Interpreter class now has a run() API with the same inputs as the AST
interpreter. It sets up the necessary environments etc, including
invoking the GlobalDeclarationInstantiation AO.
2023-06-16 08:40:45 +02:00
Sam Atkins
5cdcd135ab LibWeb: Add parsing for CSS <paint> values
This gets rid of a couple of FIXMEs in Properties.json :^)
2023-06-16 07:03:57 +02:00
Timothy Flynn
6520a9a849 LibWeb: Support TrackEvent instances with an AudioTrack track type 2023-06-14 17:54:40 +02:00
Aliaksandr Kalenik
edf11b3809 Meta: Exclude cloned WPT repo from linting by check-markdown.sh 2023-06-14 06:45:04 +02:00
Aliaksandr Kalenik
0677270a3e Meta: Add WPT in Azure CI 2023-06-14 06:45:04 +02:00
Andreas Kling
f7dc2742a9 CI: Don't run brew update on macOS CI 2023-06-13 17:25:39 +02:00
Andreas Kling
3d67f75bef CI: Disable ASAN's use-after-return check
This has apparently started defaulting to "on" at some point, which
breaks our conservative stack scan in LibJS.
2023-06-13 13:15:34 +02:00
Timothy Flynn
a34e369252 Ladybird+LibWeb+WebContent: Create a platform plugin for playing audio
This creates (and installs upon WebContent startup) a platform plugin to
play audio data.

On Serenity, we use AudioServer to play audio over IPC. Unfortunately,
AudioServer is currently coupled with Serenity's audio devices, and thus
cannot be used in Ladybird on Lagom. Instead, we use a Qt audio device
to play the audio, which requires the Qt multimedia package.

While we use Qt to play the audio, note that we can still use LibAudio
to decode the audio data and retrieve samples - we simply send Qt the
raw PCM signals.
2023-06-13 06:14:01 +02:00
Timothy Flynn
936ec94f81 AK+LibAudio+AudioServer: Silence very noisy debug statements by default
These are spammed quite heavily on the debug console, especially at the
end of audio playback.
2023-06-13 06:14:01 +02:00
Jelle Raaijmakers
5ff80b60cf Meta: Rename BuildIt.sh to BuildGNU.sh
Bring it in line with `Toolchain/BuildClang.sh`.
2023-06-12 16:22:55 -07:00
Andreas Kling
a6c6c24428 Lagom: Allow opting into linking with mold 2023-06-10 17:31:41 -07:00
Ali Mohammad Pur
47248a3511 LibWasm: Keep track of created directory fds in path_create_directory 2023-06-10 07:18:02 +02:00
Zaggy1024
873b0e9470 LibGfx/LibVideo: Read batches of multiple bytes in VPX BooleanDecoder
This does a few things:

- The decoder uses a 32- or 64-bit integer as a reservoir of the data
  being decoded, rather than one single byte as it was previously.
- `read_bool()` only refills the reservoir (value) when the size drops
  below one byte. Previously, it would read out a bit-sized range from
  the data to completely refill the 8-bit value, doing much more work
  than necessary for each individual read.
- VP9-specific code for reading the marker bit was moved to its own
  function in Context.h.
- A debug flag `VPX_DEBUG` was added to optionally enable checking of
  the final bits in a VPX ranged arithmetic decode and ensure that it
  contains all zeroes. These zeroes are a bitstream requirement for
  VP9, and are also present for all our lossy WebP test inputs
  currently. This can be useful to test whether all the data present in
  the range has been consumed.

A lot of the size of this diff comes from the removal of error handling
from all the range decoder reads in LibVideo/VP9 and LibGfx/WebP (VP8),
since it is now checked only at the end of the range.

In a benchmark decoding `Tests/LibGfx/test-inputs/4.webp`, decode times
are improved by about 22.8%, reducing average runtime from 35.5ms±1.1ms
down to 27.4±1.1ms.

This should cause no behavioral changes.
2023-06-10 07:17:12 +02:00
Sam Atkins
5e3da93f1a LibWeb: Add RatioStyleValue and parsing 2023-06-09 20:37:51 +02:00
implicitfield
71b184accf Meta+Lagom: Enable CMAKE_BUILD_WITH_INSTALL_RPATH
On macOS, CMake incorrectly tries to add and/or remove rpaths from files
that it has already processed when it performs installation. Setting the
rpaths during the build process ensures that they are only set once, and
as a bonus, makes installation slightly more performant.

Fixes #10055.
2023-06-08 17:59:53 +02:00
Jelle Raaijmakers
2e3bff7ab1 Meta: Re-add boot drive to aarch64 run configuration
This broke in c2e24a2fa1 where the boot
drive was removed from `SERENITY_MACHINE`. We now add the boot drive to
the common Qemu arguments, so it gets included in the aarch64 run
configuration as well.
2023-06-08 14:43:14 +02:00
Timothy Flynn
cb912f0e1a LibEDID: Ignore duplicate PNP IDs
The PNP IDs data file was recently updated with an accidental duplicate
entry (HONOR Device Co., Ltd.). Rather than breaking everyone's build,
let's just ignore duplicates.
2023-06-08 13:03:14 +02:00
Andreas Kling
7f90b0cab7 LibWeb: Don't override prototype on generated iterator prototypes
Generated iterator prototypes already have the IteratorPrototype as
their prototype, but we were incorrectly hijacking them and rerouting
to ObjectPrototype.

Regressed in cfe663435e.
2023-06-08 10:05:56 +02:00
Ben Wiederhake
4a359b5a42 Meta: Check that local includes can be resolved
If a local include does not point to a file in the repository, it should
be a system include instead. This is now checked on every commit.

While this does introduce significant overhead in terms of percentage,
I think that an additional 10ms on huge commits (or less on smaller
commits) are acceptable:

hyperfine -w1 './Meta/check-style.py AK/*.h AK/*.cpp' # Before
Benchmark 1: ./Meta/check-style.py AK/*.h AK/*.cpp
  Time (mean ± σ):      20.3 ms ±   0.4 ms    [User: 17.1 ms, System: 3.
5 ms]
  Range (min … max):    19.5 ms …  21.6 ms    128 runs

hyperfine -w1 './Meta/check-style.py AK/*.h AK/*.cpp' # After
Benchmark 1: ./Meta/check-style.py AK/*.h AK/*.cpp
  Time (mean ± σ):      32.3 ms ±   0.4 ms    [User: 27.9 ms, System: 4.
4 ms]
  Range (min … max):    31.4 ms …  34.9 ms    91 runs
2023-06-06 23:19:50 +02:00
Ben Wiederhake
6a351376aa Everywhere: Only use local includes where appropriate
If a local include does not point to a file in the repository, it should
be a system include instead.
2023-06-06 23:19:50 +02:00
Andreas Kling
941092e3ad LibWeb: Make CSS/Properties.json "logical-aliases-for" an array
This allows us to specify all aliases properties instead of just one.
2023-06-06 21:02:04 +02:00
Jelle Raaijmakers
c2e24a2fa1 Meta: Use SERENITY_BOOT_DRIVE for aarch64 as well 2023-06-06 06:44:05 -07:00
Jelle Raaijmakers
210e90dab8 Meta: Enable NVME by default
This results in significant performance improvements in both sequential
and random disk reading and writing.
2023-06-06 06:44:05 -07:00
Sam Atkins
2d7308cb88 LibWeb: Support infinite range for CSS properties
This makes `[-∞,∞]` generate valid code, instead of `return ;`
2023-06-02 20:04:23 +02:00
Sam Atkins
51f75d7071 LibWeb: Generate bounds-checking functions for CSS basic types 2023-06-02 17:46:35 +02:00
Fabian Dellwing
33815d550b Meta: Update cacert.pem 2023-05-30 13:05:19 +02:00
Ali Mohammad Pur
0e3fb39a0a LibWeb: Make 'optional BufferSource' IDL arguments actually optional
Previously this was compiled to require an object despite the IDL file
specifying 'optional'.
This commit makes IDLGenerator respect this modifier, and fixes the only
affected instance.
2023-05-30 12:50:13 +02:00
Ali Mohammad Pur
e90752cc21 LibWeb: Add preliminary support for CSS animations
This partially implements CSS-Animations-1 (though there are references
to CSS-Animations-2).
Current limitations:
- Multi-selector keyframes are not supported.
- Most animation properties are ignored.
- Timing functions are not applied.
- Non-absolute values are not interpolated unless the target is also of
  the same non-absolute type (e.g. 10% -> 25%, but not 10% -> 20px).
- The JavaScript interface is left as an exercise for the next poor soul
  looking at this code.

With those said, this commit implements:
- Interpolation for most common types
- Proper keyframe resolution (including the synthetic from-keyframe
  containing the initial state)
- Properly driven animations, and proper style invalidation

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
279924242d LibWeb: Add CSS CompositeStyleValue
This represents the value of properties assigned via their shorthands,
and is expanded when computing actual property values.
2023-05-29 05:35:41 +02:00
Andreas Kling
ad6027433d headless-browser: Print a diff when a test failure occurs
This will make it a lot easier to understand what went wrong, especially
when the failure occurs on CI but not at home.

And of course, use LibDiff to generate the diff! :^)
2023-05-28 22:03:57 +02:00
Karthik Karanth
72507c318a LibWeb: Add logical-alias-for in Properties.json
This allows for succint definitions of logical properties, by allowing
them to inherit initial values, valid identifiers, etc from another
property
2023-05-27 16:02:33 +02:00
Matthew Olsson
f63d027b0b Meta: Fix unresolvable reference to WebIDL::OperationReturnsPromise 2023-05-27 13:55:14 +02:00
Ben Wiederhake
64a2a63df6 LibCore: Drop TestLibCoreIODevice
It does not make sense to test known-working code that is deprecated and
in the process of being removed. Also, this test becomes too cumbersome
to write without using read_all or line iteration in some form, and
migrating the test is just silly.
2023-05-27 07:16:01 +02:00