Commit graph

56346 commits

Author SHA1 Message Date
Michiel Visser
be68f747b6 AK: Add shorthands for u384, u768, and u1536 2023-11-11 14:40:10 +03:30
Michiel Visser
6b5c6e7c03 LibCrypto: Move JacobianPoint into the curve cpp file 2023-11-11 14:40:10 +03:30
Matthew Olsson
4efbb10a36 LibWeb: Keep track of associated Animations in AnimationTimeline
This allows the timeline to propagate changes in time to any relevant
animation objects.
2023-11-11 08:58:08 +01:00
Matthew Olsson
0d3c8a1cd9 LibWeb: Implement AnimationEffect's transformed_progress helper 2023-11-11 08:58:08 +01:00
Matthew Olsson
611faf3645 LibWeb: Add a timing function to AnimationEffect 2023-11-11 08:58:08 +01:00
Matthew Olsson
66bd75f2b9 LibWeb: Add a TimingFunction struct implementing the Web Easing spec
This is mostly a copy-paste of the algorithms already in StyleComputer
with spec links and comments. The only thing that really changed is the
handling of values outside of the range [0, 1] in the cubic bezier
function.

The implementation in StyleComputer will be removed in a later commit.
2023-11-11 08:58:08 +01:00
Jesús (gsus) Lapastora
1850652881 LibJS/Bytecode: Check if eval function is a function
When overriding 'eval' to a non-function value, the interpreter would
crash. Now it handles this case swiftly, throwing a TypeError.
2023-11-11 08:56:12 +01:00
Nico Weber
a9ef65e64a LibPDF: For multi-output SampledFunctions, fix output colors
For N outputs, the outputs aren't stored in N independent planes.
Instead, N output values are stored right next to each other in
the stream data.
2023-11-11 08:55:37 +01:00
Nico Weber
ec739460e0 LibPDF: Add test for SampledFunction and fix bugs found by it
* SampledFunction now keeps the StreamObject it gets data from alive
  (doesn't matter too much in practice, but does matter in the test,
  where nothing else keeps the stream alive).

* If a sample is an integer, we would previously sample that value
  twice and then divide by zero when interpolating. Make sure to
  sample 1 unit apart.
2023-11-11 08:55:37 +01:00
Idan Horowitz
e58209e5cf LibJS: Skip an always-false branch in the JIT to_boolean slow case 2023-11-11 08:55:18 +01:00
Timothy Flynn
9e637de58a Ladybird/AppKit: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Timothy Flynn
6732a38cf8 Ladybird/Qt: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Timothy Flynn
9421ffd4ec Browser: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Timothy Flynn
306850652f LibWebView+WebContent: Add an IPC hook to insert data into the clipboard 2023-11-11 08:54:37 +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
Timothy Flynn
78d455e231 LibWeb: Add an Internals API to trigger a user-activated (trusted) event
Some DOM APIs are restricted to user-activated events. For example, you
can't just invoke `navigator.clipboard.writeText` from JS - it has to be
accompanied by a user gesture, such as a mouse-down event. This adds an
Internals API to simulate such a gesture.
2023-11-11 08:54:37 +01:00
Matthew Olsson
6761791c9a LibIDL: Require the 'attribute' keyword when parsing attributes 2023-11-11 08:52:50 +01:00
Matthew Olsson
b081cf077e LibIDL: Verify inner type of nullable type is valid 2023-11-11 08:52:50 +01:00
Matthew Olsson
1a94241f58 IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
Matthew Olsson
3ff481938e IDL: Fix syntax errors
All attributes must have an "attribute" keyword, and "any?" is invalid
(as "any" includes "null" as well).
2023-11-11 08:51:51 +01:00
Matthew Olsson
26e6c47d0a IDL: Add missing spec links
The only IDL interface without a spec link is Internals
2023-11-11 08:51:51 +01:00
Tim Ledbetter
1eae02a018 LibGfx/OpenType: Add validation for OpenType head table values
Previously, a crash would occur if a font file had an invalid
IndexToLocFormat value.
2023-11-11 08:51:02 +01:00
Shannon Booth
87a4a5b302 LibWeb: Remove FIXMe's for HTML attribute serialization steps
As far as I can tell all of these steps are just equivalent to using the
qualified name. Add some tests which cover some of these cases, and
remove the FIXME's.
2023-11-11 08:50:25 +01:00
Shannon Booth
96fc1741b5 LibWeb: Return an Optional<String> from HTMLToken::attribute
Move away from using a nullable StringView.
2023-11-11 08:50:25 +01:00
Shannon Booth
72bb928dd8 LibWeb: Add spec comments to HTMLParser::handle_in_body
I have been going down into a bit of a rabbit hole trying to figure out
why the namespace is not getting set up properly on certain attributes.
At one stage, I thought the issue might have been around here where
attributes were being adjusted (it is not). I started adding spec
comments to understand what was happening, and by the time I realised it
wasn't in this place, I was already in too deep!

Add a whole bunch of spec comments, and leave one or two minor FIXME's
where the spec seems to have changed since this was originally
implemented.
2023-11-11 08:50:25 +01:00
Shannon Booth
45b63b463a LibWeb: Add Element::for_each_attribute(Function<void(Attr const&)>)
This is useful when you are wanting to interate over attributes and need
more information than just the name and value.
2023-11-11 08:50:25 +01:00
Shannon Booth
a8fd4fab00 LibWeb: Port HTMLParser::serialize_html_fragment from DeprecatedString 2023-11-11 08:50:25 +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
Aliaksandr Kalenik
048e179572 LibAccelGfx: Use wrapping functions with error check for OpenGL calls
This change introduces GL.h with error check wrappers for all the
OpenGL functions we used so far.

For now, the error check is simply:
`VERIFY(glGetError() == GL_NO_ERROR);`
but that is better than continuing execution after encounting an error.
2023-11-11 08:47:12 +01:00
Sönke Holz
da88d766b2 Kernel/riscv64: Make the kernel compile
This commits inserts TODOs into all necessary places to make the kernel
compile on riscv64!
2023-11-10 15:51:31 -07:00
Sönke Holz
b6ac2ed34d Kernel/riscv64: Implement RISC-V SmapDisabler 2023-11-10 15:51:31 -07:00
Sönke Holz
cb1b0c4101 Kernel/riscv64: Add initial PageDirectory header 2023-11-10 15:51:31 -07:00
Sönke Holz
fd8858ace2 Kernel/riscv64: Add RISC-V Syscall API 2023-11-10 15:51:31 -07:00
Sönke Holz
6824d2a788 Userland+Tests: Add initial riscv64 support 2023-11-10 10:30:08 -07:00
Michiel Visser
c6b2a07326 LibCrypto: Add static_assert to check that A = -3 mod p
This is required for some optimization made in the file. While this
should always be the case for the SECP256r1 curve, it is good to check
it anyway.
2023-11-10 09:54:00 -07:00
Michiel Visser
4f4034d1a4 LibCrypto: Also check Z when checking if point is on the curve 2023-11-10 09:54:00 -07:00
Michiel Visser
399dc211fa LibCrypto: Use simplified u256 constructor when reading big endian data 2023-11-10 09:54:00 -07:00
Michiel Visser
153cd3ecf0 LibCrypto: Use square-and-multiply loop for modular_inverse
Instead of using the hand unrolled version of the square-and-multiply
algorithm, we now simply use a loop.
2023-11-10 09:54:00 -07:00
Michiel Visser
5b658c341c LibCrypto: Change modular_add_order to match modular_add 2023-11-10 09:54:00 -07:00
Michiel Visser
d746c01716 LibCrypto: Simplify modular addition and subtraction
Instead of building the REDUCE_PRIME constant on the fly from the carry
flag, we now simply use the constant in combination with select. This
improves the readablility of the functions significantly.
2023-11-10 09:54:00 -07:00
Michiel Visser
5da070ba5e LibCrypto: Remove many magic constants and calculate them instead
Instead of having a large list of magical constants, we now only have
the curve prime, a, b, and order, which are all taken from the
specification. All the other helper constants are now calculated from
the curve paramters.
2023-11-10 09:54:00 -07:00
Nico Weber
323ba7404c LibPDF: Implement SampledFunction::evaluate() for some sampled functions
Things now work for functions that are all of:
* linear
* 1-D input
* 8 bits per sample
2023-11-10 15:03:30 +00:00
Nico Weber
fd1876441a LibPDF: Implement SampledFunction::create() 2023-11-10 15:03:30 +00:00
Andreas Kling
2520c46224 LibJS/JIT: Resolve the GetCalleeAndThisFromEnvironment cache at JIT time 2023-11-10 14:49: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
Nico Weber
ed7549c64f pdf: Add a --json flag that currently affects only --debugging-stats 2023-11-10 14:46:06 +01:00
Nico Weber
cd9f4655ec LibPDF: Tweak implementation of postscript roll op
Since positive offsets roll to the right, it makes more sense
to do the big reverse first. Gets rid of an awkward minus sign.

No behavior change.
2023-11-10 14:45:38 +01:00
Nico Weber
b23ed86889 LibPDF: Implement StitchingFunction::evaluate() 2023-11-10 14:45:16 +01:00
Nico Weber
ba34ddeb21 LibPDF: Implement StitchingFunction creation 2023-11-10 14:45:16 +01:00