Commit graph

1499 commits

Author SHA1 Message Date
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
Matthew Olsson
521f8bd5f2 LibWeb: Add AnimationTimeline IDL object 2023-11-07 15:17:09 +01:00
stelar7
27ae172e7e Meta: Implement correct parsing of reflected DOMString 2023-11-07 11:34:21 +01:00
Lucas CHOLLET
8612aee640 Lagom/Fuzzers: Add a fuzzer for our TIFF decoder 2023-11-06 12:29:30 -07:00
Tim Ledbetter
a1f9d2420f Fuzzers: Disable debug logging for all fuzzers
Previously, some fuzzers were generating an excessive amount of debug
logging. This change explicitly disables debug logging for all fuzzers.
This allows higher test throughput and makes the logs easier to read
when fuzzing locally.
2023-11-03 20:56:44 -06:00
Simon Wanner
93908fcbcb LibJS+Embedders: Unify stack trace format for uncaught errors
Previously these handlers duplicated code and used formats that
were different from the one Error.prototype.stack uses.

Now they use the same Error::stack_string function, which accepts
a new parameter for compacting stack traces with repeating frames.
2023-11-02 07:37:41 +01:00
Bastiaan van der Plaat
0104225d9b LibWeb: Add TextEncoder encodeInto 2023-10-29 21:44:53 +01:00
Bastiaan van der Plaat
f1ead552ce LibWeb: Add constructor options to TextDecoder 2023-10-29 21:44:53 +01:00
Aliaksandr Kalenik
7d26cbf523 LibWeb: Add painting command executor that uses LibAccelGfx
This change introduces a command executor for RecordingPainter that
utilizes LibAccelGfx.
2023-10-29 17:13:23 +01:00
Timothy Flynn
8dc25dffc2 LibWebView: Protect URL highlighting against partially-typed URLs
The current helpers assume that a valid URL is a full URL (i.e. contains
the "://" separator between the scheme and domain). This isn't true, as
"file:" alone is parsed as a valid URL.

We must also avoid simply searching for the parsed public suffix in the
original URL string. For example, "com" is a public suffix. If we search
for that in the URL "com.com", we will think the public suffix starts at
index 0.
2023-10-28 19:03:19 +02:00
Andreas Kling
5b87d26027 LibJIT+LibJS: Move JIT::Assembler into a new LibJIT library
This will allow other parts of the system to generate machine code
at runtime. :^)
2023-10-27 19:07:22 +02:00
Lucas CHOLLET
8659a6d3a7 Lagom: Port LibImageDecoderClient to Lagom
This library offers tools to communicate with an ImageDecoder server
through IPC. There is currently no such executable for Lagom but that
shouldn't take long :^)
2023-10-27 07:26:32 +02:00
Dan Klishch
8b49bdb724 Meta+Documentation: Restore links to LibJS website
This partially reverts dacf7265 and 67ca5d65.
2023-10-27 07:08:57 +02:00
Ali Mohammad Pur
aa4360b9a3 Meta: Port LibJS Wasm repl to the new LibJS architecture
This was left behind when removing the AST interpreter, and the CI not
being around made it bitrot.

Co-Authored-By: Dan Klishch <danilklishch@gmail.com>
2023-10-27 05:57:18 +03:30
Martin Janiczek
7c2a569fca LibTest: Add a suite of tests for the generators 2023-10-26 17:26:52 -06:00
Dan Klishch
6ed069ea8d JSSpecCompiler: Provide an adequate command line interface 2023-10-26 15:45:31 -06:00
Dan Klishch
867ce0df52 JSSpecCompiler: Move passes to Passes subdirectory of Compiler/ 2023-10-26 15:45:31 -06:00
Dan Klishch
61fa00d46c JSSpecCompiler: Refactor CompilerPass to accept TranslationUnitRef 2023-10-26 15:45:31 -06:00
Timothy Flynn
9f9e5c0f55 LibWebView: Add an API to query if a host is on the Public Suffix List 2023-10-26 11:06:49 +02:00
Timothy Flynn
d4615c47a4 LibWebView: Generate the Public Suffix List as a compile-time array
No need for this to be a vector on the heap.
2023-10-26 11:06:49 +02:00
Dan Klishch
c2c37de201 JSSpecCompiler: Support Cpp::StringLiteral in C++ AST converter 2023-10-26 10:57:03 +02:00
Dan Klishch
d7b4dc2a6a JSSpecCompiler: Support Cpp::BinaryExpression in C++ AST converter 2023-10-26 10:57:03 +02:00
tetektoza
1c37385904 GMLCompiler: Add enum initializer for button_style property
This patch adds missing enum initializer for button_style property in
enum initializer generator in GML compiler.
2023-10-24 21:47:18 +02:00
Tim Ledbetter
fff1645c6b Fuzzers: Add WOFF2 fuzzer 2023-10-24 13:45:01 +02:00
Tim Ledbetter
03fbd6c0c8 Fuzzers: Add a fuzzer for JsonParser 2023-10-24 07:54:37 +02:00
Andrew Duerig
67ca5d6572 Meta: Update libjs.dev links to test262.fyi 2023-10-24 07:32:19 +02:00
Bastiaan van der Plaat
efadee7e6e Meta+BindingsGenerator: Add curly brackets for numeric union types 2023-10-20 07:20:29 +02:00
Nico Weber
ff4b0e678b MacPDF: Make "Open With" and dropping files on dock tile work
I would've expected that there's some way to have this work
automatically in an NSDocument-based application, but I haven't
found it yet. So manually implement the delegate for now.
2023-10-19 16:52:31 -04:00
Andrew Kaster
4d039b05b2 MacPDF: Load fonts via Core::Resource instead of filesystem paths 2023-10-17 11:02:01 -06:00
Timothy Flynn
a8f0fa5dd4 LibWebView+LibPublicSuffix: Merge LibPublicSuffix into LibWebView
After d2c7e1ea7d, there is now only one
user of LibPublicSuffix - the URL sanitation utility within LibWebView.
Rather than having an entire library for the small Public Suffix data
accessor, merge it into LibWebView.
2023-10-16 09:06:02 -04:00
Ali Mohammad Pur
988c6568a9 LibWeb: Remove Element::set_attribute(name, value?)
That API came from a mistake in the IDL compiler, where reflected
nullable attributes would try to call set_attribute(name, null).
This commit fixes the mistake in the IDL generator, and removes the
meaningless API.
2023-10-14 09:12:41 -04:00
Ali Mohammad Pur
aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30
Ali Mohammad Pur
b20f1da166 Lagom/IDLGenerators: Remove the unused generate_to_deprecated_string fn
There are no more users of this, so remove it and rename
`generate_to_new_string` to `generate_to_string` while we're at it.
2023-10-13 18:33:21 +03:30
Nico Weber
6528f6db26 MacPDF: Make up and down flip pages when PDF view has focus
Previously, it only reacted to arrow left andn arrow right,
and to opt-up and opt-down.
2023-10-11 21:38:15 -04:00
Nico Weber
627b152d49 MacPDF: Make opt-up and opt-down always go to previous / next page
When the outline has focus, arrow keys navigate the outline instead
of changing the current page.

Add opt-up and opt-down as a way to move by one page even when the
outline has focus. (This matches Preview.app.)

xib change: Added two menu Previous Page with key equivalent opt-up
and Next Page with key equivalent opt-down to Go menu and bound them to
goToPreviousPage: and goToNextPage: on First Responder.

When the outline has focus, the responder chain is outline ->
window, so also add the actions on the window controller, and
let that forward to the PDF view.
2023-10-11 21:38:15 -04:00
Andrew Kaster
99ffc935ef Lagom: Include all generated installed files on library targets
Do this with INSTALL_INTERFACE genex include directory rules. We should
really standardize where the generated headers *actually* get installed
to though.
2023-10-11 12:35:35 -04:00
Tim Ledbetter
e6d9bb0774 LibTLS: Don't attempt to read past EOF when parsing TBSCertificate
This allows the decoder to fail gracefully when reading a partial or
malformed TBSCertificate. We also now ensure that the certificate data
is valid before making a copy of it.
2023-10-11 07:08:22 +02:00
Nico Weber
409eb644c8 MacPDF: Unbreak persisting the current page
I broke this when moving from a xib file to creating the UI in code.

https://developer.apple.com/documentation/appkit/nsuserinterfaceitemidentification/1396829-identifier
says:

"Identifiers are used during window restoration operations to uniquely
identify the windows of the application. [...] If you create an item in
Interface Builder and do not set a value for this string, a unique value
is created for the item when the nib file is loaded. For
programmatically created views, you typically set this value after
creating the item but before adding it to a window."

Without this, encodeRestorableStateWithCoder: / restoreStateWithCoder:
in MacPDFView weren't getting called.
2023-10-10 09:50:28 -04:00