Commit Graph

60007 Commits

Author SHA1 Message Date
Matthew Olsson
e4dba9d932 LibWeb: Cache the last CSS play-state value on KeyframeEffect
This way we can just leave it alone if the property hasn't changed.
Notably, if the play-state property has been set to 'paused', and then
the user gets the animation with JS and calls .play() on it, it should
start playing despite the play-state property value.
2024-03-27 09:40:05 -06:00
Nico Weber
1570751d64 Tests/LibGfx: Add a jbig2 file using refinement in the symbol segment
This adds a test for the code added in #23710.

I created this file using `jbig2` (see below for details), but as
usual it required a bunch of changes to it to make it actually produce
spec-compliant output. See the PR adding this image for my local diff.

I created the test image file by running this shell script with
`jbig2` tweaked as described above:

    #!/bin/bash

    set -eu

    S=Tests/LibGfx/test-inputs/bmp/bitmap.bmp

    # See make-symbol-jbig.sh (the script in #23659) for the general
    # setup and some comments. See also make-symbol-textrefine.sh (in
    # #23713).
    #
    # `-Ref` takes 5 arguments:
    # 1. The symbol ID of this symbol (like after a `-Simple`)
    # 2. A bmp file that the base symbol gets refined to
    # 3. The ID of the base symbol
    # 4. dx, dy
    cat << EOF > jbig2-symbol-symbolrefine.ini
    -sym -Seg 1
    -sym -file -numClass -HeightClass 3 -WidthClass 1
    -sym -file -numSymbol 3
    -sym -file -Height 250
    -sym -file -Width 120 -Simple 0 mouth-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 100
    -sym -file -Width 100 -Simple 1 nose-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -file -Height 30
    -sym -file -Width 30 -Simple 2 top_eye-1bpp.bmp
    -sym -file -EndOfHeightClass
    -sym -Param -Huff_DH 0
    -sym -Param -Huff_DW 0

    -sym -Seg 2
    -sym -file -numClass -HeightClass 1 -WidthClass 1
    -sym -file -numSymbol 1
    -sym -file -Height 30
    -sym -file -Width 30 -Ref 3 bottom_eye-1bpp.bmp 2 0 0
    -sym -file -EndOfHeightClass
    -sym -Param -Huff_DH 0
    -sym -Param -Huff_DW 0
    -sym -Param -RefTemplate 1

    -txt -Seg 3
    -txt -Param -numInst 4
        -ID 2 108 50 -ID 3 265 60 -ID 1 100 135 -ID 0 70 232
    -txt -Param -RefCorner 1
    -txt -Param -Xlocation 0
    -txt -Param -Ylocation 0
    -txt -Param -W 399
    -txt -Param -H 400
    EOF

    J=$HOME/Downloads/T-REC-T.88-201808-I\!\!SOFT-ZST-E/Software
    J=$J/JBIG2_SampleSoftware-A20180829/source/jbig2

    $J -i "${S%.bmp}" -f bmp -o symbol-symbolrefine -F jb2 \
        -ini jbig2-symbol-symbolrefine.ini
2024-03-27 11:20:08 -04:00
Kenneth Myhra
816e0c14c3 Ports: Update glib to 2.80.0 2024-03-27 16:19:15 +01:00
Kenneth Myhra
5cbb18ac90 Ports: Update curl to 8.7.1 2024-03-27 16:19:15 +01:00
Daniel La Rocque
1e1906865c LibJS: Remove ToTemporalDateTimeRoundingIncrement
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/aca38be
2024-03-26 17:22:46 -04:00
Nico Weber
2e6626ae3b LibGfx/JBIG2: Tweak spec comment quote characters 2024-03-26 17:21:47 -04:00
Nico Weber
6842299959 LibGfx/JBIG2: Fix a comment typo 2024-03-26 17:21:47 -04:00
Nico Weber
6ff446fd30 LibGfx/JBIG2: Fix a comment typo 2024-03-26 17:21:47 -04:00
Nico Weber
a2a5fc76aa LibGfx/JBIG2: Don't assert on unexpected OOB values in the bitstream
This should only happen on either invalid inputs or if our code has
a bug (gasp!). Printing an error instead of asserting seems nicer.
2024-03-26 17:21:47 -04:00
Nico Weber
b3c423e4ca LibGfx/ISOBMFF: Implement JPEG2000DefaultDisplayResolutionBox
Found e.g. in http://opf-labs.org/format-corpus/jp2k-formats/balloon.jpf
2024-03-26 17:19:03 -04:00
Nico Weber
a9ef2fac01 LibGfx/ISOBMFF: Introduce JPEG2000ResolutionSubboxBase
No behavior change.
2024-03-26 17:19:03 -04:00
Nico Weber
a971625c49 LibGfx/ISOBMFF: Implement UserExtensionBox
.jpf (JPEG2000) files written by Photoshop contain a whole bunch of
these boxes.

fileformats.archiveteam.org/wiki/Boxes/atoms_format lists a few
UUID types. Of those 3, these are in Photoshop-written .jpf files:

* 0537cdab-9d0c-4431-a72a-fa561f2a113e Exif
* 2c4c0100-8504-40b9-a03e-562148d6dfeb Photoshop Image Resource
* be7acfcb-97a9-42e8-9c71-999491e3afac XMP
2024-03-26 17:19:03 -04:00
Timothy Flynn
45fa6249df LibJS: Do not unnecessarily revalidate a TypedArray
No effective change, as ValidateTypedArray would call the validation AO
that the spec wants us to call manually. But no need to do it twice.
2024-03-26 17:11:26 -04:00
Ali Mohammad Pur
ea692338c2 LibCrypto: Allow CMS padding to span an entire block
This is in line with what the spec states, the previous implementation
excluded the case where the original message's length is a multiple of
block_size, which would lead to a full block of padding.
2024-03-26 19:39:03 +00:00
Timothy Flynn
d74059580c LibWeb: Return the correct substring when parsing an HTTP quoted string
We were off-by-one when returning the result of parsing a quoted string
in Web::Fetch::Infrastructure::collect_an_http_quoted_string. Instead of
backtracking the lexer and consuming the backtracked string, do a simple
substring operation.
2024-03-26 19:19:13 +00:00
Timothy Flynn
576c2f4f4d LibURL+LibUnicode+LibWebView: Handle punycode directly in LibURL
We had defined punycode handling in LibUnicode when LibURL (AK at the
time) was unable to depend on LibUnicode. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn
5ddfcfd07e LibCore+LibTimeZone: Move TZDB utilities from LibTimeZone to LibCore
We had weakly defined a couple utilities needed by Core::DateTime when
LibCore was unable to depend on LibTimeZone. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn
9b1b91f98a LibFileSystem: Depend on the minimal LibCore source set 2024-03-26 12:25:21 -04:00
Timothy Flynn
6f65e188f0 Meta/Tools: Depend on the minimal LibCore source set 2024-03-26 12:25:21 -04:00
Timothy Flynn
f7ddcb1f98 LibCore: Separate some LibCore sources into a minimal object library
We have been dancing around circular dependencies between LibCore and
generated sources. For example, LibURL currently cannot depend on
LibUnicode because the LibUnicode generators depend on LibCore, and
LibCore depends on LibURL. LibTimeZone is in a similar situation.

To alleviate this, we can define the minimal sources that the code
generators need as an object library. This will allow the generators to
depend on this library, rather than the full LibCore.
2024-03-26 12:25:21 -04:00
Timothy Flynn
4c08a1e0c0 Meta: Remove serenity_lib_static() CMake helper function
Its one user (LibMain) can now just specify a STATIC library type in an
invocation of serenity_lib().
2024-03-26 12:25:21 -04:00
Timothy Flynn
d1e2d2a4df Meta: Allow specifying the library type when invoking serenity_lib()
This will allow creating object libraries with this function.
2024-03-26 12:25:21 -04:00
Timothy Flynn
c8febe5169 LibCore: Update FIXME in LibCore's CMakeLists.txt
We have a FileWatcher implementation for macOS.
2024-03-26 12:25:21 -04:00
Tim Ledbetter
8e6e938167 LibWeb: Remove AbortSignal::follow()
This no longer has any callers.
`AbortSignal::create_dependent_abort_signal()` should be used instead.
2024-03-26 11:42:40 +01:00
Tim Ledbetter
17e64cf08b LibWeb/Fetch: Replace usages of AbortSignal::follow() in Fetch::Request
Since the introduction of `AbortSignal::any()`, the specification says
`AbortSignal::create_dependent_abort_signal()` should be used where
`AbortSignal::follow` was previously.
2024-03-26 11:42:40 +01:00
Andreas Kling
3d78f86a2f LibWeb: Don't ask RequestServer to prefetch DNS for file: and data: URLs 2024-03-26 11:39:45 +01:00
Andreas Kling
41cc8e75f2 LibJS: Make PromiseJob store callback as a HeapFunction
This is a speculative fix for a flake seen on CI where a JobCallback
captured by a PromiseJob callback was GC'd prematurely.
2024-03-26 05:47:24 +01:00
Matthew Olsson
43b0b3fa80 LibWeb: Add a test to ensure style invalidations don't reset animations 2024-03-26 05:47:09 +01:00
Matthew Olsson
cf54ba01ac LibWeb: Be more strict about invoking .play() on element animations
We don't want to always invoke the .play() method if an animation is
relevant and had a play state of running, as the play state is
essentially just "paused" or "not paused". We replace that relevancy
check with the inverse of the pause check so we don't constantly call
.play() on animations that are finished.

Also duplicates and moves the temporary context into both blocks, since
most of the time neither condition will be true.
2024-03-26 05:47:09 +01:00
Matthew Olsson
e2dfef90fb LibWeb: Remove useless animation relevancy check
This is already done in Animatable::get_animations()
2024-03-26 05:47:09 +01:00
Andrew Kaster
0743a33266 LibWeb: Add roundtrip SubtleCrypto import/export test using JWK 2024-03-25 17:01:23 -06:00
Andrew Kaster
95303ae4a1 Tests: Use asyncTest instead of test(async) in PBKDF2 importKey test 2024-03-25 17:01:23 -06:00
Andrew Kaster
cddbdf5ae9 LibWeb: Implement skeleton of RSA-OAEP decrypt for SubtleCrypto
The actual Crypto algorithm part isn't implemented yet, so we just copy
the ciphertext and claim that's the plaintext :^)
2024-03-25 17:01:23 -06:00
Andrew Kaster
29b68a1b10 LibWeb: Implement skeleton of RSA-OAEP encrypt for SubtleCrypto
The actual Crypto algorithm part isn't implemented yet, so we just copy
the plaintext and claim that's the ciphertext :^)
2024-03-25 17:01:23 -06:00
Andrew Kaster
d71bd185c6 LibWeb: Implement skeleton of SubtleCrypto.decrypt 2024-03-25 17:01:23 -06:00
Andrew Kaster
df3d0538a9 LibWeb: Implement skeleton of SubtleCrypto.encrypt
No algorithms implement this yet, but this is the high level entry
point.
2024-03-25 17:01:23 -06:00
Andrew Kaster
ae4d90c88a LibWeb: Error out SubtleCrypto.digest with a OOM on Buffer copy error
Instead of returning a custom OperationError, let's just return a LibJS
defined OOM error instead.
2024-03-25 17:01:23 -06:00
Andrew Kaster
497f3ca0fd LibWeb: Store PBKDF2Params' salt field as a ByteBuffer directly
Rather than trying to store a Handle to a WebIDL::BufferSource, let's
look ahead to what the spec wants us to do with this field and get a
copy of the bytes held by the buffer source right away.
2024-03-25 17:01:23 -06:00
Andrew Kaster
a0623a47de LibWeb: Implement importKey for RSA-OAEP 2024-03-25 17:01:23 -06:00
Andrew Kaster
28dc076764 LibWeb: Use a forgiving base64url encoding for JWK export 2024-03-25 17:01:23 -06:00
Andrew Kaster
562068e001 LibTLS: Implement ASN.1 parser function for PrivateKeyInfo
LibWeb wants to parse these for Web Crypto. In theory Certificate
parsing in LibTLS should use it as well.
2024-03-25 17:01:23 -06:00
Andrew Kaster
7b27c1ce6c LibTLS: Export parse_subject_public_key_info
LibWeb wants to call this for Web Crypto.
2024-03-25 17:01:23 -06:00
Andrew Kaster
e422c93537 LibWeb: Make normalize_an_algorithm from SubtleCrypto public
We'll need to call this from other source files when implementing
specific algorithms.
2024-03-25 17:01:23 -06:00
Sönke Holz
ec5cfc031e Kernel/riscv64: Add Linux boot header
This allows us to boot via U-Boot's booti command.
2024-03-25 14:30:39 -06:00
Dan Klishch
d99d66e358 JSSpecCompiler: Pave a way for representing compile-time objects 2024-03-25 14:28:52 -06:00
Dan Klishch
3077e516a2 JSSpecCompiler: Parse properties list clause title 2024-03-25 14:28:52 -06:00
Dan Klishch
ec16556fea JSSpecCompiler: Add option to silence all diagnostics and use in tests
In the future, we will probably want to test regressions in diagnostics
too but let's not do that for now.
2024-03-25 14:28:52 -06:00
Dan Klishch
0e7c33b1be JSSpecCompiler: Let FunctionDeclaration know its name and category
This is achieved by moving ClauseHeader::{AbstractOperation,Accessor,
Method} to Function.h itself and storing them in FunctionDeclaration.

This commit also introduces QualifiedName class that is used to store
function's name split by '.' (just like it appear in the spec).
2024-03-25 14:28:52 -06:00
Hendiadyoin1
70cfa60f56 LibCrypto: Remove now unused temporary BigInt buffers
Plus 1 drive-by division->shift optimization
2024-03-25 14:26:29 -06:00
Hendiadyoin1
c96d44e9cf LibCrypto: Use a right shift for division in NumberTheory::Power 2024-03-25 14:26:29 -06:00