Commit graph

65758 commits

Author SHA1 Message Date
Tim Ledbetter
a8719a706b LibWeb: Limit HTMLMarqueeElement attributes to allowed values
If `HTMLMarqueeElemnt.scrollAmount` or `HTMLMarqueeElemnt.scrollDelay`
is set to a value larger than 2147483647, then it should be set to its
default value.
2024-11-27 11:00:25 +01:00
Tim Ledbetter
e5c99b475a IDLGenerators: Set reflected unsigned long value according to spec
Setting an unsigned long attribute with IDL to a value outside the
range 0 to 2147483647, the value should be set to the default value.
2024-11-27 11:00:25 +01:00
devgianlu
601eae47f2 LibWeb: Import WebCryptoAPI ECDH tests from WPT
Import and rebaseline tests related to WebCryptoAPI ECDH. The commits
before this one allow for ~700 tests to pass.
2024-11-27 10:59:48 +01:00
devgianlu
6fa53a4382 LibWeb: Implement ECDH.exportKey 2024-11-27 10:59:48 +01:00
devgianlu
228276a383 LibWeb: Implement ECDH.importKey 2024-11-27 10:59:48 +01:00
devgianlu
e6056ab959 LibWeb: Implement ECDH.deriveBits 2024-11-27 10:59:48 +01:00
devgianlu
4fb19913a1 LibWeb: Switch ECDH.generateKey to use internal keys instead of bytes
Previously, `ECDH::generate_key` was implemented by storing a
`ByteBuffer` in the `InternalKeyData`. This improves the implementation
by using internal structures of already-parsed data.
2024-11-27 10:59:48 +01:00
devgianlu
fd336ed619 LibWeb: Define EcKeyImportParams 2024-11-27 10:59:48 +01:00
devgianlu
6cf89e46c9 LibCrypto: Parse EC private key when parsing an ASN.1 PrivateKeyInfo
Parse and store the `ECPrivateKey` extracted from the
`privateKeyAlgorithm` field of the ASN.1 `PrivateKeyInfo` sequence when
the algorithm identifier is `ec_public_key_encryption`.

The parsing function returns `ErrorOr` instead of an "empty" key, like
`parse_rsa_key` does. To me, this seemed better in terms of reliability.
 As mentioned in the previous commit, there is room for improvement.
2024-11-27 10:59:48 +01:00
devgianlu
5f3f089494 LibCrypto: Implement ECPrivateKey and ECPublicKey
Added basic EC private and public key definitions as well as ASN.1
encoding and decoding.

A lot of refactoring can be made around the ASN.1 processing (here and
in other parts of the codebase) by utilizing what is available
in `LibCrypto::Certificate` as macros, but I think it's outside the
scope of implementing ECDH support for WebCryptoAPI.
2024-11-27 10:59:48 +01:00
devgianlu
a2522172ad LibCrypto: Expose parse_ec_parameters
This will be required to parse the ASN.1 `ECPrivateKey` sequence in the
next commits.
2024-11-27 10:59:48 +01:00
devgianlu
6e54baadea LibCrypto: Add secpxxxr1 OIDs
Added the following OIDs:
    - secp256r1_oid
    - secp384r1_oid
    - secp521r1_oid
2024-11-27 10:59:48 +01:00
devgianlu
f897af36c2 LibCrypto: Add SECPxxxr1 methods to work with points
It looks like the `SECPxxxr1` was made mainly to work with the TLS
implementation which requires everything to be bytes. This is not always
 the case and a loss of generality.

 I have added some methods that take and return `UnsignedBigInteger`s
 for better interoperability with ASN.1 stuff. I would like to remove
 the old methods relying on bytes, but I haven't made my mind around how
  to generalize it for all curves.
2024-11-27 10:59:48 +01:00
devgianlu
9eea94aa14 LibCrypto+LibWeb: Support passing parameters to ASN.1 wrappers
Add support for encoding parameters in `wrap_in_private_key_info` and
`wrap_in_subject_public_key_info` as well as turn `Span<int>` into
`Span<int const>`.
2024-11-27 10:59:48 +01:00
Shannon Booth
1647893fc8 LibWeb/Streams: Update comments for resolved spec bug
Our bug report has been resolved in the same way we had already
applied a fix (just with some asserts added) with:

https://github.com/whatwg/streams/commit/86d07e
2024-11-27 10:58:45 +01:00
Tim Ledbetter
cc0ad0d1ef LibWeb: Use [URL] extended attribute for HTMLInputElement.src 2024-11-26 23:20:20 +00:00
Jelle Raaijmakers
24069d55bf LibWeb: Partially implement MediaSource.isTypeSupported() 2024-11-26 23:51:02 +01:00
Gingeh
0adf261c32 LibWeb: Don't end parsing after reaching the insertion point 2024-11-26 23:50:18 +01:00
Tim Ledbetter
e176871fdf LibWeb: Use [Reflect] to implement HTMLImageElement.decoding
This ensures the correct behavior when the value of the `decoding`
attribute is changed with `setAttribute()`.
2024-11-26 21:56:28 +00:00
Timothy Flynn
0d635100c4 LibJS: Port Date.parse string arguments to String 2024-11-26 15:02:07 -05:00
Timothy Flynn
fc6155cf2c LibJS: Differentiate between failed ISO8601 parsing and invalid values
If we were able to parse an ISO8601 Date string, but the parse results
in an invalid date (e.g. out of the min/max range), we should abort
parsing immediately.
2024-11-26 15:02:07 -05:00
Timothy Flynn
511029807a LibJS: Implement Date.prototype.toTemporalInstant 2024-11-26 15:02:07 -05:00
Timothy Flynn
8e8c133db5 LibJS: Use Temporal for the Date constructor and Date.now() 2024-11-26 15:02:07 -05:00
Timothy Flynn
7aee254708 LibJS: Use correct epoch offset in InterpretISODateTimeOffset 2024-11-26 15:02:00 -05:00
Tim Ledbetter
9face18ab2 LibWeb: Use correct integer parsing rules in HTMLOListElement::start() 2024-11-26 19:09:24 +01:00
Tim Ledbetter
a61883ae88 LibWeb: Use correct integer parsing rules in HTMLLIElement::value() 2024-11-26 19:09:24 +01:00
Tim Ledbetter
67d05b0104 LibWeb: Use [URL] extended attribute for HTMLVideoElement.poster 2024-11-26 19:07:53 +01:00
Tim Ledbetter
8ad3479e0e LibWeb: Update Screen IDL definition to not inherit from EventTarget 2024-11-26 18:44:26 +01:00
Tim Ledbetter
d73f809af5 LibWeb: Implement HTMLElement.enterKeyHint
This reflects the value of the `enterkeyhint` content attribute
2024-11-26 18:38:38 +01:00
Tim Ledbetter
12fc1de9ca LibWeb: Implement HTMLElement.inputMode
This reflects the value of the `inputmode` content attribute
2024-11-26 18:38:38 +01:00
Andreas Kling
733c6b14ff LibWeb: Teach HTMLObjectElement to negotiate natural size with SVGs
We do this by generalizing the code previously used for SVGSVGBox into
something that can be used for NavigableViewportContainer as well.
2024-11-26 18:32:48 +01:00
Andreas Kling
2405805ddf LibWeb: Delay load event in more HTMLObjectElement situation 2024-11-26 18:32:48 +01:00
Andreas Kling
e88286b337 LibWeb: Mark HTMLObjectElement as potentially delaying the load event 2024-11-26 18:32:48 +01:00
Andreas Kling
b859a6f2e0 LibWeb: Recurse into NavigableContentViewport in layout dumps 2024-11-26 18:32:48 +01:00
Andreas Kling
3ebc7fbd28 LibWeb: Create layout node for HTMLObjectElement navigable containers
This makes SVGs in object elements actually render!
2024-11-26 18:32:48 +01:00
Andreas Kling
dd7623eb30 LibWeb: Rename NestedBrowsingContextP => NavigableContainerViewportP
...where P is for Paintable :^)
2024-11-26 18:32:48 +01:00
Andreas Kling
11d966f3ba LibWeb: Make NavigableContainerViewport always have a NavigableContainer
Let's not limit this to only corresponding to an HTMLIFrameElement.
2024-11-26 18:32:48 +01:00
Andreas Kling
443a8539e9 LibWeb: Rename Layout::FrameBox => NavigableContainerViewport 2024-11-26 18:32:48 +01:00
Andreas Kling
eadeec8b8d Tests: Import some svg-in-object-element tests from WPT 2024-11-26 18:32:48 +01:00
Timothy Flynn
a93d32a306 LibJS: Alphabetically sort property keys and error types
And make ErrorType definitions use a better hanging-indent style, to
make it easier to maintain going forward.

i.e. instead of:

    M(VeryLongErrorNameHere, "very long error "
                             "message across multiple "
                             "lines"

We now have:

    M(VeryLongErrorNameHere,
        "very long error message across multiple "
        "lines")
2024-11-26 11:35:15 -05:00
Timothy Flynn
6a9aec29d5 LibJS: Remove unused property names and error types
Held off on this during the Temporal rewrite in favor of just removing
these all in one go.
2024-11-26 11:35:15 -05:00
Timothy Flynn
ade510fe17 LibJS: Pass ISO types by value vs. const-reference more correctly
We were passing types like ISODate by reference so that they could be
used as forward-declarations. But after commit 021a5f4ded, we now have
their full definitions anywhere they're needed. So let's pass ISODate by
value everywhere consistently - it is only 8 bytes.
2024-11-26 11:35:15 -05:00
Timothy Flynn
2d9405e5d7 LibJS: Use the TimeDuration alias a bit less in Temporal
It was a bit of a semantic mistake too use this alias too eagerly.
Namely, it should not be used to refer to epoch nanoseconds. We now only
use the TimeDuration alias where the spec refers to a value as a time
duration.
2024-11-26 11:35:15 -05:00
Jelle Raaijmakers
06863479be LibWeb: Fix various local names for custom elements
This fixes the typo in `HTMLFieldSetElement` and adds valid local names
for `<meta>`, `<ol>` and `<optgroup>`.
2024-11-26 15:52:54 +01:00
stelar7
74828bbd10 LibWeb: Import WPT for idbfactory.open 2024-11-26 14:50:27 +01:00
stelar7
6c9a8362d6 LibWeb: Implement the wait step for open_a_database_connection 2024-11-26 14:50:27 +01:00
stelar7
4357c3229c LibWeb: Implement legacyOutputDidListenersThrowFlag 2024-11-26 14:50:27 +01:00
stelar7
932fb2024e LibWeb: Store IndexedDB Databases mappings properly 2024-11-26 14:50:27 +01:00
stelar7
1656d8fe07 LibWeb: Implement most of upgrade_a_database for IndexedDB 2024-11-26 14:50:27 +01:00
stelar7
ca25f76ccc LibWeb: Remove old FIXMEs 2024-11-26 14:50:27 +01:00