Commit Graph

1406 Commits

Author SHA1 Message Date
Tim Schumacher
1878488c04 Meta: Commonize network device settings 2022-04-20 14:12:34 +02:00
Ali Mohammad Pur
302a0c54f0 Base: Add some default completions to shellrc 2022-04-18 19:53:10 +04:30
Sam Atkins
42d87239a8 LibWeb: Generate some metadata about transform functions
This will be used to parse and validate their parameters.
2022-04-18 14:16:28 +02:00
Sam Atkins
872ad98eba LibWeb: Generate TransformFunction to/from string functions 2022-04-18 14:16:28 +02:00
Sam Atkins
5f3498d50f LibWeb: Add code generator for CSS transform functions
This first step just generates the TransformFunction enum, but more will
follow.
2022-04-18 14:16:28 +02:00
Tim Schumacher
8c278bba43 Meta: Keep timestamps of manually copied toolchain output 2022-04-17 10:53:31 -07:00
Jelle Raaijmakers
8cfabbcd93 Tests: Implement reference image testing for LibGL
Each LibGL test can now be tested against a reference QOI image.
Initially, these images can be generated by setting `SAVE_OUTPUT` to
`true`, which will save a bunch of QOI images to `/home/anon`.
2022-04-17 09:58:29 +04:30
Sam Atkins
d564cf1e89 LibCore+Everywhere: Make Core::Stream read_line() return StringView
Similar reasoning to making Core::Stream::read() return Bytes, except
that every user of read_line() creates a StringView from the result, so
let's just return one right away.
2022-04-16 13:27:51 -04:00
Sam Atkins
3b1e063d30 LibCore+Everywhere: Make Core::Stream::read() return Bytes
A mistake I've repeatedly made is along these lines:
```c++
auto nread = TRY(source_file->read(buffer));
TRY(destination_file->write(buffer));
```

It's a little clunky to have to create a Bytes or StringView from the
buffer's data pointer and the nread, and easy to forget and just use
the buffer. So, this patch changes the read() function to return a
Bytes of the data that were just read.

The other read_foo() methods will be modified in the same way in
subsequent commits.

Fixes #13687
2022-04-16 13:27:51 -04:00
Sam Atkins
a20188cd91 LibWeb: Use generated enum code for property value validation
This has the nice benefit of removing a lot of duplicated lists of
values from Properties.json. :^)
2022-04-14 14:54:06 +02:00
Sam Atkins
c66da0f2cb LibWeb: Assign an underlying type to generated CSS enums
I'm *pretty* sure that even a u32 would be overkill but you never know
with CSS specs.
2022-04-14 14:54:06 +02:00
Sam Atkins
c50661067d LibWeb: Generate and use to_string(css_enum) functions
The only one that's actually used is for Repeat, but it's easy to
generate them so might as well. :^)
2022-04-14 14:54:06 +02:00
Sam Atkins
9bf511caa3 LibWeb: Generate to_value_id() functions 2022-04-14 14:54:06 +02:00
Sam Atkins
3f61f869c8 LibWeb: Generate ValueID-to-enum conversion functions 2022-04-14 14:54:06 +02:00
Sam Atkins
a97944e483 LibWeb: Add a new code generator for CSS enums
Alias values are represented by "alias-name=real-name".

We have a lot of repetitive code for converting between ValueID and
property-specific enums. Let's see if we can generate it. :^)

This first step just produces the enums, from a JSON file. The values in
there are a duplication of what's in Properties.json, but eventually
those will go away.
2022-04-14 14:54:06 +02:00
Sam Atkins
c449cabae3 LibWeb: Move CSS Parser into new Web::CSS::Parser namespace
The goal here is to move the parser-internal classes into this namespace
so they can have more convenient names without causing collisions. The
Parser itself won't collide, and would be more convenient to just
remain `CSS::Parser`, but having a namespace and a class with the same
name makes C++ unhappy.
2022-04-12 23:03:46 +02:00
EWouters
d89a58216d Ports/pt2-clone: Update pt2-clone to version 1.43
Upgrade patches to git style, add ReadMe.md and remove from the list
of ports missing descriptions.
2022-04-11 19:43:56 -07:00
EWouters
cf0798158a Ports/klong: Update klong to version 20220315
Upgrade patch to git style, add ReadMe.md and remove from the list of
ports missing descriptions.
2022-04-11 19:43:56 -07:00
EWouters
769615fc48 Ports/gawk: Update gawk to version 5.1.1
The patch for config.sub is no longer required.

This also removes gawk from the list of ports missing descriptions as
it no longer has any patches.
2022-04-11 19:43:56 -07:00
EWouters
8828b038f5 Ports/diffutils: Update diffutils to version 3.8
The fnmatch patch that was added in 6de6dff is reverted because it is
not clear why it is necessary, as discussed in #9206.

This also removes diffutils from the list of ports missing descriptions
as it no longer has any patches.
2022-04-11 19:43:56 -07:00
Simon Wanner
4cbbb72ce8 Meta/Lagom: Add a fuzzer for the WOFF parser 2022-04-09 23:48:18 +02:00
Simon Wanner
bf6d64c199 LibGfx: Add a loader the Web Open Font Format (WOFF)
This format is 'just' a zlib compressed wrapper for TrueType/OpenType
which makes implementing it rather convenient. :^)
2022-04-09 23:48:18 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Simon Wanner
6f8fd91f22 LibGfx: Move TTF files from TrueTypeFont/ to Font/TrueType/ 2022-04-09 23:48:18 +02:00
stelar7
ce08fae13b Meta: Add fuzzer for Poly1305 2022-04-08 14:02:02 +04:30
Timothy Flynn
1f2542247f LibUnicode: Upgrade to CLDR version 41.0.0
Release notes: https://cldr.unicode.org/index/downloads/cldr-41

Note that the HourCycleRegion enum now contains 272 entires, thus needs
to be bumped from u8 to u16.
2022-04-07 08:29:10 -04:00
Timothy Flynn
8a46794ff8 LibUnicode: Replace individual UCD file downloads with single UCD.zip
Instead of downloading nearly 20 files individually, we can download a
single .zip file similar to how we download a single CLDR .zip. This is
to reduce the number of connections/downloads to/from unicode.org.
2022-04-06 17:12:08 -07:00
Stephan Unverwerth
5bb76e9b63 LibGL+LibGPU+LibSoftGPU: Load SoftGPU driver dynamically
This loads libsoftgpu.so during GLContext creation and instantiates the
device class which is then passed into the GLContext constructor.
2022-04-06 11:32:24 +02:00
Kenneth Myhra
0b86574293 LibWeb: Verify argument_check before generating if statement
This fixes an error where we would generate an empty 'if' statement body
if argument_check was empty.
2022-04-05 22:33:44 +02:00
Kenneth Myhra
887e13f364 LibWeb: Get argument count from Function::parameters::size()
Previously this retrieved argument count from Function::length() which
did not return the correct count in all situations.
2022-04-05 22:33:44 +02:00
Kenneth Myhra
ba23d036bd LibWeb: Add IDLGenerators::is_primitive()
This adds the is_primitive() method as described in the Web IDL
specification. is_primitive() returns true if the type is a bigint,
boolean or numeric type.
2022-04-05 22:33:44 +02:00
Timothy Flynn
b36c3a68d8 js: Convert non-UTF-8 encoded files to UTF-8 before parsing 2022-04-05 00:14:29 +01:00
Nico Weber
fd82121319 Tests: Add some test coverage for the TTF parser
This is in Tests/LibTTF instead of Tests/LibGfx because Tests/LibGfx
depends on serenity's file system layout and can't run in lagom,
but this new test runs just fine in lagom.
2022-04-03 19:16:03 +02:00
Nico Weber
9b24600779 Meta: Give Lagom build errors colored diagnostics
Non-lagom builds get this from the root CMakeLists.txt file,
but lagom builds didn't before this change.
2022-04-03 19:16:03 +02:00
Jelle Raaijmakers
9ca15793e7 Meta: Move screenshots into subdir
It's a bit neater to give them their own directory instead of jamming
them in between our shell scripts :^)
2022-04-03 13:14:15 +01:00
Jelle Raaijmakers
31b72c20f0 Meta: Check port property for ports in the linter
We now make sure the directory name and `port` property are identical.
2022-04-03 12:35:14 +01:00
Sam Atkins
b07659d00c Meta+LibWeb: Port PropertyID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Sam Atkins
fc81d6c9f3 Meta+LibWeb: Port ValueID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Sam Atkins
cb406e79f4 Meta+LibWeb: Port MediaFeatureID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Idan Horowitz
b172b56757 LibWeb: Include relevant headers in IDL constructor implementations
Similarly to implementations of prototype methods, the implementations
of constructors sometimes require generated types.
2022-04-02 13:13:37 +03:00
Idan Horowitz
a7f2d46b49 LibWeb: Support integral default values for IDL unions 2022-04-02 13:13:37 +03:00
Idan Horowitz
32d142b06c LibWeb: Remove no-op calls to emit_includes_for_all_imports for headers
When called with is_header=true the method was essentailly a no-op.
2022-04-02 13:13:37 +03:00
Idan Horowitz
110d73d786 LibWeb: Strip double quotes from IDL enum default values 2022-04-02 13:13:37 +03:00
Idan Horowitz
3ee8b5e534 LibWeb: Cache and reuse resolved IDL imports instead of rejecting them
This ensures that transitive imports succeed even if they were directly
imported beforehand.
2022-04-02 12:22:48 +04:30
Ali Mohammad Pur
265dd9b445 Meta: Avoid showing elements in extremely large vectors in gdb
This is most often just an invalid vector anyway.
2022-04-01 21:41:41 +01:00
Ali Mohammad Pur
899888bbf2 Meta: Update gdb script for changes in HashTable 2022-04-01 21:41:41 +01:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Idan Horowitz
852ae6c195 Meta: Switch to clang-format-14 as the standard formatter
Now that clang-format-14 ubuntu packages are available, it's time to
finally upgrade our clang-format version. This version brings with it
a bunch of useful features with const-placement being the most notable.
These will be enabled in the following commits.
2022-04-01 21:24:45 +01:00
Liav A
d0abae8907 Kernel: Stop debug spam when using mmap on /dev/mem device
This is not really useful and quite annoying so let's disable it by
default.
2022-04-01 19:59:45 +02:00
Tim Schumacher
743922984c Fuzzers: Add a basic input shim when running standalone 2022-03-31 22:11:04 -07:00
Tim Schumacher
bf502ae3b0 CMake: Allow building fuzzing targets without libFuzzer or OSS-Fuzz 2022-03-31 22:11:04 -07:00
Tim Schumacher
e3519b8e5c Meta: Rename Fuzzer flags to ENABLE_FUZZERS_{LIBFUZZER,OSSFUZZ} 2022-03-31 22:11:04 -07:00
EWouters
98db3a3ce9 Meta: Fix format-string in the port linter 2022-03-31 21:59:20 -07:00
Matthew Olsson
5f9d35909d LibPDF: Move font files into their own directory 2022-03-31 18:10:45 +02:00
Idan Horowitz
f45d361f03 LibWeb: Replace ad-hoc EventHandler type with callback function typedef 2022-03-31 01:10:47 +02:00
Idan Horowitz
1c4f128fd1 LibWeb: Add support for IDL callback functions 2022-03-31 01:10:47 +02:00
Idan Horowitz
9ff79c9d54 LibWeb: Support non-interface top-level extended attributes 2022-03-31 01:10:47 +02:00
Idan Horowitz
c14cb65215 LibWeb: Add support for IDL typedefs 2022-03-31 01:10:47 +02:00
Idan Horowitz
f0cd28dedd LibWeb: Stop generating C++ includes for non-code-generating IDL files
Specifically, IDL files that do not include interface or enumeration
declarations do not generate any code, and as such should not be
included.
2022-03-31 01:10:47 +02:00
Pankaj Raghav
820a653725 Meta: Use 4k logical and physical blocks for nvme in QEMU
4k logical blocks are better for block devices in QEMU as they align
with the underlying filesystem which typically has 4k logical blocks
such as our EXT2 filesystem.
2022-03-30 19:31:12 +03:00
Timothy Flynn
066352c9aa LibJS+LibUnicode: Align ECMA-402 "sanctioned" terminology with UTS 35
This is an editorial change in the Intl spec. See:
https://github.com/tc39/ecma402/commit/087995c
https://github.com/tc39/ecma402/commit/233d29c

This also adds a missing spec link for the sanctioned units and fixes a
broken spec link for IsSanctionedSingleUnitIdentifier. In LibUnicode,
the NumberFormat generator is updated to use the constexpr helper to
retrieve sanctioned units.
2022-03-30 14:24:32 +01:00
Tom Maisey
d63cb35c0d Meta: Fix e2fsck variable on macOS in build-image-qemu.sh
Despite carefully adding homebrew's e2fsprogs to the PATH,
the script then defined E2FSCK as if we are always on Linux.
2022-03-30 01:57:51 -07:00
Idan Horowitz
824cf570d3 LibWeb: Stop casting unsigned long IDL return values to i32
These values may not fit into an i32.
2022-03-30 08:56:25 +03:00
Idan Horowitz
44601a8e74 LibWeb: Support IDL optional integer arguments 2022-03-30 08:56:25 +03:00
Kenneth Myhra
de7d333d43 markdown-check: Port to LibMain 2022-03-29 21:28:29 -07:00
Jelle Raaijmakers
c637795888 Ports: Update PHP to 8.1.4 2022-03-29 22:49:27 +01:00
Andreas Kling
ab4c73746c LibWeb: Add @@toStringTag own property on wrappers
This makes wrappers stringify to the expected "[object InterfaceName]"
instead of just "[object Object]".
2022-03-29 17:03:15 +02:00
Karol Kosek
dcb24e943d Tests: Add a basic UTF-8 to UTF-8 LibTextCodec test 2022-03-29 01:01:32 +02:00
Daniel Bertalan
3d0178a2f7 Meta: Do not try to unzip the already decompressed WASM test suite .tar
WASM_SPEC_TEST_TAR_PATH actually refers to a tarball that has already
been decompressed with gzip, so running `tar -xzf` on it fails.

I introduced this mistake in 66582a875f.

There is no need to keep an intermediary plain .tar file around, we can
pass the WASM_SPEC_TEST_GZ_PATH .tar.gz directly to `tar -xzf`.
2022-03-29 00:00:36 +02:00
Ali Mohammad Pur
67357fe984 LibXML: Add a fairly basic XML parser
Currently this can parse XML and resolve external resources/references,
and read a DTD (but not apply or verify its rules).
That's good enough for _most_ XHTML documents as the HTML 5 spec
enforces its own rules about document well-formedness, and does not make
use of XML DTDs (aside from a list of predefined entities).

An accompanying `xml` utility is provided that can read and dump XML
documents, and can also run the XML conformance test suite.
2022-03-28 23:11:48 +02:00
Hendiadyoin1
bd6927ecab Meta: Refactor the IPC-compiler and port it to LibMain
This does a few things in total:
* Ports the IPC-compiler to LibMain
* Extract some compiler steps into separate functions
* Minify some appends to use appendln (or appendff in the case of
  StringBuilder)

This reduces the clang-tidies maximum cognitive-complexity score for
this file from 325 to under 100.
2022-03-28 23:08:08 +02:00
Daniel Bertalan
66582a875f Meta: Specify -z when decompressing tar.gz archives
While GNU tar automatically detects the used compression algorithm,
POSIX requires that we specify -z if the tarball is compressed with
gzip.

Fixes a build error on OpenBSD.
2022-03-27 12:17:59 -07:00
Linus Groh
6ca03b915e Kernel: Support all Intel-defined CPUID feature flags for EAX=1
We're now able to detect all the regular CPUID feature flags from
ECX/EDX for EAX=1 :^)

None of the new ones are being used for anything yet, but they will show
up in /proc/cpuinfo and subsequently lscpu and SystemMonitor.

Note that I replaced the periods from the SSE 4.1 and 4.2 instructions
with underscores, which matches the internal enum names, Linux's
/proc/cpuinfo and the general pattern of replacing special characters
with underscores to limit feature names to [a-z0-9_].

The enum member stringification has been moved to a new function for
better re-usability and to avoid cluttering up Processor.cpp.
2022-03-27 18:54:56 +02:00
Linus Groh
4727b5bd4d Meta: Fix path to GCC's addr2line in serenity.sh
I'm not sure when this changed, but the path is wildly different now.
2022-03-27 18:54:56 +02:00
Sam Atkins
d6901d2119 Meta: Add range checking to all numeric CSS types
We did already have range checking for the `<integer>` and `<number>`
types, but this patch adds this functionality to all numeric types
(dimensions and percentages).

The syntax in Properties.json is taken from the spec:
https://www.w3.org/TR/css-values-3/#numeric-ranges

eg, `length [0,∞]` defines that a Length is allowed as long as it has a
positive value.

The implementation here allows for any number to be the positive or
negative limit, even though only 0 and positive/negative infinity are
meaningful values without a unit.
2022-03-26 18:15:08 +01:00
Andreas Kling
261cd1d4c7 LibWeb: Mark CSS properties as not affecting stacking context by default
We were mistakenly treating all CSS properties as if changing them
requires a rebuild of the stacking context tree.
2022-03-25 11:57:30 +01:00
Tim Schumacher
fad1114d4d Meta: Remove obsolete HeaderCheck .gitignore
This appears to be a remnant from the earlier HeaderCheck revisions,
where CMakeLists.txt was automatically generated.

Now that a (static) copy of CMakeLists.txt is checked in, this file
doesn't have any effect anymore.
2022-03-24 20:11:39 -07:00
Idan Horowitz
45c5fcf5cb Meta: Disable KASLR when debugging the kernel with GDB
This lets GDB resolve the kernel symbols correctly.
2022-03-24 23:36:56 +00:00
Idan Horowitz
5626e1b324 LibWeb: Rename PARSER_DEBUG => HTML_PARSER_DEBUG
Since this macro was created we gained a couple more parsers in the
system :^)
2022-03-24 21:37:49 +01:00
Lenny Maiorani
e08cd4d608 CMake: Add serenity_lib_static 2022-03-24 03:04:57 +01:00
Timothy Flynn
324f709d29 LibWeb: Support IDL default values of "null" for optional arguments
This is a bit strange in the IDL syntax, but e.g., in HTMLSelectElement,
we have (simplified):

    undefined add(optional (HTMLElement or long)? before = null)

This could instead become:

    undefined add(optional (HTMLElement or long) before)

This change generates code for the former as if it were the latter.
2022-03-22 02:08:15 +01:00
Timothy Flynn
57296393ed LibWeb: Begin implementing SVGRectElement's SVGAnimatedLength attributes 2022-03-21 21:04:39 +01:00
Timothy Flynn
3ebc5cc58e LibWeb: Support generating IDL float types
The float type is used quite a bit in the SVG spec.
2022-03-21 21:04:39 +01:00
Andreas Kling
8c88ee1165 LibWeb: Only invalidate stacking context tree for opacity/z-index change
I came across some websites that change an elements CSS "opacity" in
their :hover selectors. That caused us to relayout on hover, which we'd
like to avoid.

With this patch, we now check if a property only affects the stacking
context tree, and if nothing layout-affecting has changed, we only
invalidate the stacking context tree, causing it to be rebuilt on next
paint or hit test.

This makes :hover { opacity: ... } rules much faster. :^)
2022-03-21 13:03:33 +01:00
Nico Weber
681fac07ed Meta: Always disable kvm on aarch64 hosts for now
run.sh builds i686 by default, and the aarch64 port of serenity
isn't very far along yet.

Without this change, `run.sh` without arguments unceremoniously
fails with:

    [0/1] cd .../serenity/Build/i686 && /usr...
          ENITY_ARCH=i686 /home/thakis/src/serenity/Meta/run.sh
    qemu-system-i386: invalid accelerator kvm

That's because /dev/kvm exists, but that's no good on a non-intel host.
2022-03-20 19:53:47 -07:00
Nico Weber
20c6dabaff Lagom: Build with -fsigned-char
When building on an arm host system, char defaults to unsigned,
leading to errors such as:

  serenity/AK/StringBuilder.cpp:198:20:
    error: comparison is always true due to limited range of data type
           [-Werror=type-limits]
    198 |             if (ch >= 0 && ch <= 0x1f)
        |

Building with -fsigned-char makes things work like on Intel, and
it's what we already do in Kernel/CMakeLists.txt for the same reasons.
2022-03-20 19:53:47 -07:00
Brian Gianforcaro
97f622747b Everywhere: Move commonmark.spec.json to /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
95b295971d Everywhere: Move tests to /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
16bee0ba79 Everywhere: Move js/web/wasm tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Brian Gianforcaro
67fc81a65a Everywhere: Move cpp-tests under /home/anon/Tests 2022-03-20 22:20:59 +01:00
Ali Mohammad Pur
612d5f201a Meta: Skip wasm tests whose modules cannot be loaded
Also add support for a few more assertion types to go along with it.
2022-03-20 10:44:32 +03:30
Brian Gianforcaro
66e7ac1954 Meta: Error out on find_program errors with CMake less than 3.18
We have seen some cases where the build fails for folks, and they are
missing unzip/tar/gzip etc. We can catch some of these in CMake itself,
so lets make sure to handle that uniformly across the build system.

The REQUIRED flag to `find_program` was only added on in CMake 3.18 and
above, so we can't rely on that to actually halt the program execution.
2022-03-19 15:01:22 -07:00
Itamar
b6f358689c CMake: Modify include path when building from Hack Studio
With regular builds, the generated IPC headers exist inside the Build
directory. The path Userland/Services under the build directory is
added to the include path.

For in-system builds the IPC headers are installed at /usr/include/.
To support this, we add /usr/include/Userland/Services to the build path
when building from Hack Studio.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2022-03-19 22:02:44 +01:00
Itamar
fe7d28e870 CMake: Install generated IPC headers under /usr/include in compile_ipc()
Generated IPC headers are now installed under /usr/include in the
system's filesystem image.
2022-03-19 22:02:44 +01:00
stelar7
60c228b914 LibWeb: Handle nullish this_value when creating idl functions 2022-03-19 17:40:23 +00:00
Lenny Maiorani
4c5e9f5633 Everywhere: Deduplicate day/month name constants
Day and month name constants are defined in numerous places. This
pulls them together into a single place and eliminates the
duplication. It also ensures they are `constexpr`.
2022-03-18 23:48:50 +00:00
Timothy Flynn
c0dd188c4d LibTimeZone: Update to TZDB version 2022a
https://mm.icann.org/pipermail/tz-announce/2022-March/000070.html
2022-03-17 16:38:33 +00:00
Andreas Kling
275db39c94 LibWeb: Annotate which CSS properties may affect layout
This patch adds CSS::property_affects_layout(PropertyID) which tells us
whether a CSS property would affect layout if it were changed.

This will be used to avoid unnecessary relayout work when something
changes that really only requires us to repaint the page.

To mark a property as not affecting layout, set "affects-layout" to
false in the corresponding Properties.json entry. Note that all
properties affect layout by default.
2022-03-16 18:06:45 +01:00
Ali Mohammad Pur
ab55abb0f8 Meta: Enable all wasm extensions when building test suite
...and let LibWasm do the validation instead of removing the test when a
module is invalid.
Also, one of the tests has an integer literal starting with zero, so
account for this to make it not fail :^)
2022-03-16 15:44:52 +00:00
sin-ack
436262ea3a Meta: Use the ImplementedAs value in the attribute setter
Co-Authored-By: Luke Wilde <lukew@serenityos.org>
2022-03-16 00:38:31 +01:00