Commit Graph

1658 Commits

Author SHA1 Message Date
Nico Weber
dd593d16c4 Fuzzers: Add JBIG2 fuzzer 2024-03-09 16:01:22 +01:00
Ali Mohammad Pur
6dfb2f9dc8 Everywhere: Merge the WebSocket service into RequestServer
This keeps the APIs separate as they are wildly different, a future
improvement could be to somehow unify the APIs (if possible).

Closes #23080.
2024-03-06 10:07:27 +01:00
Filiph Siitam Sandström
fd694e8672 AK+Lagom: Make it possible to build for iOS
This commit makes it possible to build AK and most of Lagom for iOS,
based on the work for the Ladybird build demoed on discord:
https://discord.com/channels/830522505605283862/830525031720943627/1211987732646068314
2024-03-03 13:13:42 -07:00
Nico Weber
4e0fe9d9d0 MacPDF: Honor page rotation 2024-02-27 07:02:02 +01:00
Andrew Kaster
5a1944ce64 Meta: Link AK to libexecinfo on BSDs and Haiku
This requirement was missed when AK was split into its own library
in 5945cdc054
2024-02-26 16:04:39 -07:00
Timothy Flynn
108521a566 LibWeb+LibWebView+WebContent: Implement more <input type=file> behavior
We had previous implemented some plumbing for file input elements in
commit 636602a54e.

This implements the return path for chromes to inform WebContent of the
file(s) the user selected. This patch includes a dummy implementation
for headless-browser to enable testing.
2024-02-26 14:18:49 +01:00
Aliaksandr Kalenik
8a829be25c LibWeb: Handle scenario when Window property setter is called on global
This commit fixes a regression introduced in
1528e9109c.

Turns out that the type of `this_value` in the property setter of the
Window object depends on how the variable is accessed. If the property
is accessed as a global variable, then this_value is of type `Window`.
For example:
```js
performance = null
```

However, when it is accessed as a property of the window object,
`this_value` is of type `WindowProxy`. For example:
```js
window.performance = null
```

This commit updates the window property setters generator to handle
both scenarios.

With this change https://discord.com/login works again.
2024-02-25 12:55:30 +01:00
Shannon Booth
f9e5b43b7a LibWeb: Rename URL platform object to DOMURL
Along with putting functions in the URL namespace into a DOMURL
namespace.

This is done as LibWeb is in an awkward situation where it needs
two URL classes. AK::URL is the general purpose URL class which
is all that is needed in 95% of cases. URL in the Web namespace
is needed predominantly for interfacing with the javascript
interfaces.

Because of two URLs in the same namespace, AK::URL has had to be
used throughout LibWeb. If we move AK::URL into a URL namespace,
this becomes more painful - where ::URL::URL is required to
specify the constructor (and something like
::URL::create_with_url_or_path in other places).

To fix this problem - rename the class in LibWeb implementing the
URL IDL interface to DOMURL, along with moving the other Web URL
related classes into this DOMURL folder.

One could argue that this name also makes the situation a little
more clear in LibWeb for why these two URL classes need be used
in the first place.
2024-02-25 08:54:31 +01:00
Shannon Booth
1b6346ee1c LibWeb: Add support for implementing an IDL class with a different name
Add support for the extended attribute "ImplementedAs" for IDL
interfaces too. This allows a class which implements an IDL interface to
have a different class name than the interface itself.
2024-02-25 08:54:31 +01:00
Hendiadyoin1
0fa718ead8 Meta: Compile fdtdump on lagom 2024-02-24 16:43:44 -07:00
implicitfield
84252db976 Utilities: Add mkfs.fat
This adds a basic `mkfs.fat` utility, which can format FAT12, FAT16
and FAT32 partitions.

This does have a few limitations, namely in that FAT12 formatting is
limited to a set known floppy disk sizes, and we can only generate
512-byte sectors.
2024-02-24 15:54:52 -07:00
Dan Klishch
f7c952f842 JSSpecCompiler: Ignore notes in algorithm steps 2024-02-24 15:03:08 -07:00
Dan Klishch
ba61b61d67 JSSpecCompiler: Parse "NewTarget" in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
4d8f74c149 JSSpecCompiler: Parse method headers 2024-02-24 15:03:08 -07:00
Dan Klishch
a35a751f9e JSSpecCompiler: Parse optional arguments groups 2024-02-24 15:03:08 -07:00
Dan Klishch
3e6a07154b JSSpecCompiler: Parse "the *this* value" in expressions 2024-02-24 15:03:08 -07:00
Dan Klishch
ddf26a768c JSSpecCompiler: Parse "Perform <expression>." steps 2024-02-24 15:03:08 -07:00
Dan Klishch
d1fc84c638 JSSpecCompiler: Parse accessor property headers 2024-02-24 15:03:08 -07:00
Dan Klishch
a9f3a14a13 JSSpecCompiler: Simplify value handling in TextParser::parse_expression 2024-02-24 15:03:08 -07:00
Dan Klishch
e1a1f4ed1a JSSpecCompiler: Parse lists in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
d14bb7e91e JSSpecCompiler: Make function arguments parsing much simpler
In a nutshell, when we understand that the expression is a function
call (this happens at '(' after an expression), stop parsing expression
and start parsing function arguments. This makes
`FunctionCallCanonicalizationPass` and the workaround for zero argument
function calls obsolete.
2024-02-24 15:03:08 -07:00
Dan Klishch
990e30f458 JSSpecCompiler: Parse enumerators in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
3d365326af JSSpecCompiler: Parse '?' before function calls in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
b800276347 JSSpecCompiler: Parse true, false, this, undefined, and null 2024-02-24 15:03:08 -07:00
Dan Klishch
86d54a8684 JSSpecCompiler: Parse arbitrarily large rational numbers in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
bd26e5dce9 JSSpecCompiler: Parse <sup> as raising a number to a power in xspec mode 2024-02-24 15:03:08 -07:00
Dan Klishch
394c9b7006 JSSpecCompiler: Sort token types and operators alphabetically 2024-02-24 15:03:08 -07:00
Tim Ledbetter
b0f57a2785 LibWeb: Add CSSStyleSheet constructor binding 2024-02-24 21:59:28 +01:00
Aliaksandr Kalenik
1528e9109c LibWeb: Add special handling for WindowProxy in [Replaceable] setters
Setters for Window object should consider WindowProxy wrapper by:
- Verifying `this_value` is `WindowProxy` (not `HTML::Window`)
- Defining properties on the underlying Window object instead of on
  the WindowProxy itself.
2024-02-24 08:05:55 +01:00
Nico Weber
24a469f521 Everywhere: Prefer {:#x} over 0x{:x} in format strings
The former automatically adapts the prefix to binary and octal
output, and is what we already use in the majority of cases.

Patch generated by:

    rg -l '0x\{' | xargs sed -i '' -e 's/0x{:/{:#/'

I ran it 4 times (until it stopped changing things) since each
invocation only converted one instance per line.

No behavior change.
2024-02-21 17:54:38 +01:00
Timothy Flynn
939779cad3 LibWeb: Support nullable integral IDL types
We currently support optional integral types, but not nullable types. So
if an IDL contains e.g. "long?", passing null will be coerced to 0.

This will be used by the Inspector, but will also eventually be used by
real IDL interfaces (e.g. HTMLInputElement's selectionStart).
2024-02-20 17:04:36 +01:00
Timothy Flynn
13ed003be1 LibWeb: Extract common integral IDL generators to a helper
We currently repeat the same generator code for all 7 integral types
that we generate C++ for. Extract it to a helper.
2024-02-20 10:20:29 +01:00
Matthew Olsson
39f5e32ee9 IDLGenerators: Add support for custom attribute [ExplicitNull]
This can apply to optional, nullable parameters of platform types. This
will cause the generator to generate the type as
Optional<JS::GCPtr<T>> rather than JS::GCPtr<T>, allowing the
implementation to differentiate between the case where the argument was
not passed, and the case where null or undefined was passed.

Needing to differentiate these two cases is quite niche, hence why it is
an opt-in behavior.
2024-02-19 14:51:56 -05:00
Matthew Olsson
bb527c4351 LibWeb: Add Animations::Animation to IDLGenerators 2024-02-19 12:21:48 +01:00
Ali Mohammad Pur
bc301b6f40 AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK
This is a simple extension of GenericLexer, and is used in more than
just LibXML, so let's move it into AK.
The move also resolves a FIXME, which is removed in this commit.
2024-02-16 15:26:43 +01:00
Tim Ledbetter
89c0e3541e Fuzzers: Add PAM fuzzer 2024-02-14 19:58:46 +01:00
Jelle Raaijmakers
60bd458ed2 LibGL: Allow function name override in API definitions
Instead of limiting ourselves to the key of the property in the JSON,
allow overriding the function name so we can generate completely
different function signatures with very similar names to other existing
API methods (e.g. `glUniform*` vs `glUniform*v`).
2024-02-14 15:09:53 +01:00
Matthew Olsson
212a139292 LibWeb: Add a way to test if a CSS::PropertyID is animatable 2024-02-13 19:44:44 +01:00
Tim Ledbetter
4a7236cabf Everywhere: Prefer _string when constructing strings from literals 2024-02-08 11:01:10 -05:00
Dan Klishch
7945c9d808 JSSpecCompiler: Do not store XML::Node in tokens 2024-02-08 07:05:13 -07:00
Dan Klishch
94f5086b93 JSSpecCompiler: Remove ParseError 2024-02-08 07:05:13 -07:00
Dan Klishch
9a2337f7ad JSSpecCompiler: Get rid of ParseError in Lexer 2024-02-08 07:05:13 -07:00
Dan Klishch
ed04aff1de JSSpecCompiler: Try to get section number even if header parsing failed 2024-02-08 07:05:13 -07:00
Dan Klishch
6b30c4d2f0 JSSpecCompiler: Issue meaningful errors in TextParser 2024-02-08 07:05:13 -07:00
Dan Klishch
dee4978d67 JSSpecCompiler+LibXML: Store location for tokens 2024-02-08 07:05:13 -07:00
Dan Klishch
d219c91ca9 JSSpecCompiler: Make fields in classes from SpecParser.h private 2024-02-08 07:05:13 -07:00
Dan Klishch
cb6e75e890 JSSpecCompiler: Mostly get rid of ParseError in AlgorithmStep
And while on it, create proper logical scopes for algorithm steps.
2024-02-08 07:05:13 -07:00
Dan Klishch
1bd1187c92 JSSpecCompiler: Push ParseError out of AlgorithmStepList 2024-02-08 07:05:13 -07:00
Dan Klishch
c7369f2f93 JSSpecCompiler: Push ParseError out of Algorithm 2024-02-08 07:05:13 -07:00
Dan Klishch
d339ad01bb JSSpecCompiler: Push ParseError out of SpecFunction 2024-02-08 07:05:13 -07:00