Commit graph

2708 commits

Author SHA1 Message Date
Nico Weber
ec190baa55 MacPDF: Replace newlines with spaces in outline titles
Else, outline items that have newlines in them end up with a weird
vertical offset.

(This does affect the outline item's tooltip, which shows the whole
title. But not having a newline there seems alright, arguably
preferable.)
2023-11-21 10:07:41 +01:00
Nico Weber
e13954410a MacPDF: Show tooltip with full title on elided outline titles 2023-11-21 10:07:41 +01:00
Nico Weber
fac0a456e6 MacPDF: Use correct encoding for outline titles
The title of an OutlineItem is already in UTF-8.

This is currently done in LibPDF's Parser::parse_string(). I think
that's not quite the right place (it shouldn't be done for all strings)
and not done quite right (text strings should convert from
PDFDocEncoding to UTF-8 unless prefixed by an UTF-8 BOM), but even if
that changes, I think we'll keep OutlineItem.title in UTF-8.
2023-11-21 10:07:41 +01:00
Sam Atkins
148f873321 LibWeb: Merge background-position parsing into position code
Implemented by adding the extra 3-value syntax as its own case and only
running it when parsing background-position. I'm sure it could be
implemented in a smarter way but this is still a bunch less code than
before. :^)
2023-11-21 01:29:26 +01:00
Sam Atkins
26d6ba6f58 LibWeb: Parse the CSS position type automatically
This means `object-position` will no longer incorrectly accept the
3-value background-position syntax.

Remove the now-ambiguous and unused `position` enum while we're at it.
(This enum only existed as a hack.)
2023-11-21 01:29:26 +01:00
Andreas Kling
bfd354492e LibWeb: Put most LibWeb GC objects in type-specific heap blocks
With this change, we now have ~1200 CellAllocators across both LibJS and
LibWeb in a normal WebContent instance.

This gives us a minimum heap size of 4.7 MiB in the scenario where we
only have one cell allocated per type. Of course, in practice there will
be many more of each type, so the effective overhead is quite a bit
smaller than that in practice.

I left a few types unconverted to this mechanism because I got tired of
doing this. :^)
2023-11-19 22:00:48 +01:00
Sam Atkins
b74f5b1ca1 Meta: Publish dumped ref-test images as an Azure CI artifact
Whenever the tests produce a `test-dumps` directory, publish the files
in it as an artifact. This lets us peek at the screenshots and see
what's mismatched, instead of just having to guess.
2023-11-18 07:49:59 -05:00
Martin Janiczek
b56e022ce8 AK: Add roundtrip fuzzer for Base64 2023-11-18 10:01:29 +01:00
Martin Janiczek
0465ba242b LibCompress: Upgrade compression fuzzer into a roundtrip fuzzer 2023-11-18 10:01:29 +01:00
Timothy Flynn
6e928e426a Meta: Add test-js to the GN build 2023-11-18 01:16:05 -07:00
Timothy Flynn
3c5909f47e Meta: Update GN build to use CLDR version 44.0.1
See: 38dd284915
2023-11-18 01:16:05 -07:00
Timothy Flynn
19d50ee2c2 Meta: Extract .zip file directories in an encoding-agnostic manner
The current implementation fails if a file in the archive is not valid
UTF-8. The CLDR 44.0.1 package unfortunately contains such files (it
errantly has .DS_Store files).
2023-11-18 01:16:05 -07:00
Timothy Flynn
b65c07082b Meta: Properly handle GN unit tests which define their own deps
If a unit tests defines a `deps` array, the unit test template would
have tried to overwrite it (and it is actually an error to overwrite
a non-empty list with another non-empty list).
2023-11-18 01:16:05 -07:00
Timothy Flynn
6a73e027a0 Meta: Remove explicit setting of output_dir in GN unit test template
This is causing unit tests to be linked in //Build/obj/Tests rather than
//Build/bin. Note that object files are not affected by this change.
2023-11-18 01:16:05 -07:00
Timothy Flynn
392d9d080d Meta: Port recent changes to GN build
80071b1d48face038a60b98fc8c3414de1cb9633
3f6a26d07d1536eb5e4e39eedfd4e0135eabf536
2023-11-18 01:16:05 -07:00
Simon Wanner
86b85aa68b LibJS: Introduce Builtins
Builtins are functions that can be detected during bytecode generation
and enable fast-paths in the JIT.
2023-11-17 19:06:25 +01:00
Dan Klishch
2dba79bc6b Meta: Globally disable floating point contraction
FP contraction is a standard-conforming behavior which allows the
compiler to calculate intermediate results of expressions containing
floating point numbers with a greater precision than the expression type
allows. And in theory, it enables additional optimizations, such as
replacing `a * b + c` with fma(a, b, c).

Unfortunately, it is extremely hard to predict when the contraction will
happen. For example, Clang 17 on x86_64 with the default options will
use FMA only for constant-folded non-constexpr expressions. So, in
practice, FP contraction leads to hard-to-find bugs and inconsistencies
between executables compiled with different toolchains or for different
OSes. And we had two instances of this happening last week.

Since we did not ever used -mfma on x86_64, this patch can only possibly
regress performance on Apple ARM devices, where FMA is enabled by
default. However, this regression will likely be negligible since the
difference would be one additional add instruction, which would be then
likely executed in parallel with something else.
2023-11-16 19:05:13 -05:00
Aliaksandr Kalenik
61a2e59d87 LibAccelGfx+WebContent: Add GPU painter support on macOS
With these changes it is now possible to create OpenGL context on macOS
and run GPU-painter. For now only QT client has a CLI param that turns
it on though.
2023-11-16 15:13:16 +01:00
Timothy Flynn
2c1bbf5a99 AK+LibIDL: Put IDL dbgln statement behind a debug flag
This is a bit spammy now that we are performing some overload resolution
at build time. The fallback to an interface has generally worked fine on
the types it warns about (BufferSource, Module, etc.) so let's not warn
about it for every build.
2023-11-15 23:42:53 +01:00
Timothy Flynn
50406f541b Meta: Port recent changes to GN build
124c378472
2023-11-15 11:28:39 -05:00
Timothy Flynn
665a95e39e Meta: Support (and default to) Ladybird's AppKit chrome in the GN build
The Qt chrome may be used by setting `enable_qt = true` in args.gn.
2023-11-14 14:29:35 -05:00
Timothy Flynn
652bbe172b Meta: Port recent changes to GN build
86ee7d219e
75caccafa4
1b30b510b9
bb43bd2dee
6322d68b1b
73ef102b01
923027b1df
dfa79ba6d8
66c9696687
521f8bd5f2
734076946b
0df06ce273
1ca46afa2f
66bd75f2b9
43dc9dfb69
4b94b0b561
4c5d48f861
c4efc0a5aa
3999c74237
4d356cfca5
2023-11-14 09:36:36 -05:00
Timothy Flynn
6ac57448af Meta: Explicitly set the sysroot path during Lagom builds
Otherwise, we don't set the -isysroot flag, and my mac is unable to
build with GN.
2023-11-14 09:36:36 -05:00
Tim Ledbetter
1793f51bc6 LibDNS: Make DNS packet parsing fallible
Previously, a DNS packet containing an invalid name would be returned
with an empty name. With this change, an error is returned if any error
is encountered during parsing.
2023-11-14 10:12:44 +01:00
Matthew Olsson
5824916f8c LibWeb: Add KeyframeEffect IDL objects 2023-11-14 10:12:02 +01:00
Matthew Olsson
99bb5a1d08 IDLGenerators: Allow specifying multiple constructors 2023-11-14 10:12:02 +01:00
Lucas CHOLLET
86ee7d219e LibCompress/LZW: Use its own debug flag
The file still used the `GIF_DEBUG` flag from when it was a part of the
GIF decoder. Let's give `LZWDecoder` its own flag.
2023-11-12 13:56:27 +01:00
Matthew Olsson
82c36b303c IDLGenerators: Do not emit null literals as default values 2023-11-11 22:45:16 +01:00
Timothy Flynn
4b94b0b561 LibWeb: Begin implementing the Clipboard API
https://w3c.github.io/clipboard-apis/

This implements enough for navigator.clipboard.writeText(String).
2023-11-11 08:54:37 +01:00
Idan Horowitz
f2410071cd LibIDL: Support dictionary types when distinguishing argument indices 2023-11-11 08:48:25 +01:00
Idan Horowitz
f837f02eea LibIDL+LibWeb: Resolve distinguishing argument index at build time
Aside from the obvious performance benefits, this will allow us to
properly handle dictionary types. (whose dictionary-ness is only known
at build-time)

Much of the rest of the overload resolution algorithm steps can (and
should) be evaluated at build-time as well, but this is a good first
step.
2023-11-11 08:48:25 +01:00
Nico Weber
8f4966fc5c test_pdf.py: Output tweaks
* Count files that are password-protected
* Use `pdf --json` to groups by missing feature and then by file
  instead of by file first, feature second
* Count files that render with issues
* Print number of files without issues last
* Always print all crash stacks
2023-11-10 14:46:06 +01:00
Andrew Kaster
a0d8990c82 CMake: Bump CMake minimum up to 3.21 to work around CLion bug
Fix the recursive directory bug in CLion Nova EAP's CMake version in a
way that doesn't also break `./Meta/serenity.sh run lagom ladybird`.

This brings the Lagom minimum required closer to the Serenity minimum
required. Which is still fine, because the serenity.sh script knows how
to build CMake from source if a developer's local copy is too old.
2023-11-10 09:36:22 +01:00
Andrew Kaster
7eda36bbf4 CMake: Don't recursively include Ladybird/Lagom in buggy CMake versions
Ran into this with the new EAP for CLion Nova. When using Ladybird as
source directory, we would recursively look in Ladybird --> Lagom -->
Ladybird when exporting components. This seems to be because
ENABLE_LAGOM_LADYBIRD is set to ON by Ladybird's CMakeLists and
something about their build, when invoked from their IDE, has buggy
behavior around the SUBDIRECTORIES directory property.
2023-11-10 08:32:12 +01:00
iliadsh
89da731aa6 LibJS+LibWeb: Devirtualize may_interfere_with_indexed_property_access() 2023-11-10 08:22:44 +01:00
Tim Schumacher
a2f60911fe AK: Rename GenericTraits to DefaultTraits
This feels like a more fitting name for something that provides the
default values for Traits.
2023-11-09 10:05:51 -05:00
Matthew Olsson
0df06ce273 LibWeb: Add the AnimationEffect IDL object 2023-11-08 09:58:18 +01:00
Matthew Olsson
e03e710d1b IDLGenerators: Support nullable dictionary members with default values
When wrapping dictionary members, generate_wrap_statement was called
with the pattern "auto {} = ...", where "..." was determined based on
the variable's type. However, in generate_wrap_statement, if a type is
nullable it generates an if statement, so this would end up generating
something along the lines of

    if (!retval.member.has_value()) {
    	auto wrapped_member0_value = JS::js_null();
    } else {
    	auto wrapped_member0_value = JS::Value(...);
    }

...which makes the declaration inaccessible. It now generates the same
code, but the "auto" declaration (now an explicit JS::Value declaration)
is outside of the if-statement.
2023-11-08 09:58:18 +01:00
Matthew Olsson
111e0159ff IDLGenerators: Allow specifying default non-empty string values 2023-11-08 09:58:18 +01:00
Luke Wilde
eaa3b85864 LibWeb: Fix "ParameterizedTypeType" -> "ParameterizedType" typo for IDL 2023-11-08 09:55:24 +01:00
Luke Wilde
34cd69e623 LibWeb: Add support for WindowProxy in IDL -> CPP, unions, constructors 2023-11-08 09:55:24 +01:00
Luke Wilde
280199fb08 LibWeb: Recognise MessagePort as a platform object in IDL generator 2023-11-08 09:55:24 +01:00
Tim Ledbetter
e1099a1757 Fuzzers: Use a single fuzzer to test all LibTextCodec encodings
This commit replaces the 5 fuzzers that previously tested LibTextCodec
with a single fuzzer. We now rely on the fuzzer to generate the
encoding and separate it from the encoded data with a magic separator.
This increases the overall coverage of LibTextCodec and eliminates the
possibility of the same error being generated by multiple fuzzers.
2023-11-08 09:39:49 +01:00
Tim Ledbetter
7d717986de Lagom: Copy fuzzer dictionary files to Oss-Fuzz $OUT directory
When building fuzzers for Oss-Fuzz using `BuildFuzzers.sh --oss-fuzz`,
fuzzer dictionary files are now copied to the `$OUT` directory. This
allows them to be used automatically by the corresponding fuzzer.
2023-11-08 09:39:49 +01:00
Tim Ledbetter
33ad384a7d Fuzzers: Add a DNS packet fuzzer 2023-11-08 09:38:36 +01:00
Timothy Flynn
350fdf1e43 LibCore+LibTimeZone: Support time zone names in Core::DateTime::parse
LibCore currently cannot depend on LibTimeZone directly. All build-time
code generators depend on LibCore, so there'd be a circular dependency:
LibCore -> LibTimeZone -> GenerateTZData -> LibCore.

So to support parsing time zone names and applying their offsets, add a
couple of weakly-defined helper functions. These work similar to the way
AK::String declares some methods that LibUnicode defines. Any user who
wants to parse time zone names (from outside of LibCore itself) can link
against LibTimeZone to receive full support.
2023-11-08 09:28:17 +01:00
Timothy Flynn
fefbbff0a5 LibEDID: Replace the HTML-based PNP ID parser with a CSV-based parser
The PNP ID file is now a CSV file. Update the generator to handle the
new format.
2023-11-08 08:19:04 +01:00
Timothy Flynn
a02e0afa41 LibEDID: Replace a few DeprecatedString::formatted with String::number
And remove one that was for unused data.
2023-11-08 08:19:04 +01:00
Timothy Flynn
936e97b066 LibEDID: Format PNP ID data a little more cleanly
Namely, do not append unnecessary new lines between PNP ID entries. This
just makes the generated code a bit easier to look through.
2023-11-08 08:19:04 +01:00
Sam Atkins
763b08c23f LibWeb: Remove now-unused CSS::PositionValue type and associated parsing
All the users now use PositionStyleValue instead.
2023-11-07 22:00:24 +00:00