Commit graph

29651 commits

Author SHA1 Message Date
hanaa12G e6c363ac63 Shell: Allow to parse command interactively when hitting Enter key 2023-11-11 14:44:10 +03:30
Michiel Visser 927dc1f02a LibTLS: Add support for SECP384r1 2023-11-11 14:40:10 +03:30
Michiel Visser 6322d68b1b LibCrypto: Add SECP384r1 implementation
This implementation is basically a copy-paste of the SECP256r1
implementation with all "256" replaced with "384".

In the future it might be nice to make this generic, instead of having
two almost identical copies of code.
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 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 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 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
Simon Wanner a3399fa13a LibJS/JIT: Expand Mul fast path to double & i32 combinations
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner 867b8146cf LibJS/JIT: Expand Sub fast path to double & i32 combinations
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner 5edab2679c LibJS/JIT: Expand Add fast path to double & i32 combinations
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner d91b376393 LibJS/JIT: Add helper for generating combined i32 & double fastpaths
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner 578912aa6c LibJIT: Support unordered double comparison 2023-11-10 11:01:59 +01:00