Commit Graph

52655 Commits

Author SHA1 Message Date
Dan Klishch
2f7527b0a4 LibXML: Actually append resolved references when parsing content 2023-07-23 16:09:12 +02:00
Dan Klishch
f25745ed27 Meta: Test LibXML on Lagom 2023-07-23 16:09:12 +02:00
Shannon Booth
732ef1e7e9 Meta: Enable test-js bytecode tests 2023-07-23 07:36:13 +02:00
Shannon Booth
d766014787 LibJS/Tests: Set failing bytecode tests as xfail when in bytecode mode
This should allow us to enable running test-js in bytecode mode in CI.
2023-07-23 07:36:13 +02:00
Shannon Booth
9b66e87bd8 LibJS/Tests: Run 'delete always evaluates the lhs' in bytecode mode
As this test passes for bytecode, but fails in AST.
2023-07-23 07:36:13 +02:00
Shannon Booth
2401c0ff7e LibJS/Tests: Add support for expected failure (xfail) tests
To allow us to add tests that are failing now, but can be enabled as
soon as a change is made to make it pass (without any opportunity to
forget about enabling it).

Additionally, support is added for `xfailIf`, for tests that are
expected to fail given a certain condition, but are expected to pass
otherwise. This is intended to be used for tests that fail in bytecode
mode, but pass in AST (and vice versa).
2023-07-23 07:36:13 +02:00
Shannon Booth
cb23eaa92d test-js: Add global function to determine if using bytecode interpreter
This is intended to be used in adding test-js tests where there is
different behaviour between the AST interpreter and bytecode mode.
In particular, this is useful for tests which fail in AST, but pass in
bytecode, as the AST interpreter is run in CI but bytecode is not.
2023-07-23 07:36:13 +02:00
Shannon Booth
af60c740e3 LibTest: Add support for xfail JavaScriptTestRunner tests
This is meant to be used in a similar manner to skipping tests, with the
extra advantage that if the test begins passing unexpectedly, the test
will fail.

Being notified of unexpected passes allows for the test to be updated to
the correct expectation.
2023-07-23 07:36:13 +02:00
Kenneth Myhra
2c06ad3a05 Tests/LibWeb: Add primitives test for structuredClone() 2023-07-23 06:37:14 +02:00
Kenneth Myhra
8c88e8f896 LibWeb: Add primitive support to Structured{Serialize,Deserialize}
This adds support for Undefined, Null, Boolean, BigInt, and String to
AOs StructuredSerializeInternal and StructuredDeserialize.
2023-07-23 06:37:14 +02:00
MacDue
b30a1b957d LibWeb: Add support for SVG <tspan> elements 2023-07-23 06:32:39 +02:00
MacDue
0e12503586 LibWeb: Split SVGTextContentElement into spec defined subclasses
As part of this move properties/methods to the correct subclass
(position related properties go under SVGTextPositioningElement).

SVG text element hierarchy:

  SVGTextContentElement
           ^- SVGTextPositioningElement
                     ^- SVGTextElement
                     ^- SVGTSpanElement
           ^- SVGTextPathElement (TODO)
           ^- SVGTRefElement (TODO)
2023-07-23 06:32:39 +02:00
Nico Weber
77e6dbab33 LibPDF: Fix symbol for text_next_line_show_string_set_spacing operator
It's `"`, not `''`.

Now the `text_next_line_show_string_set_spacing` gets called and logs
a TODO at page render time if `"` is used in a PDF:

    warning: Rendering of feature not supported:
        draw operation: text_next_line_show_string_set_spacing

It caused a parse error (also at page render time) previously:

    [parse_value @ .../LibPDF/Parser.cpp:104]
        Parser error at offset 611: Unexpected char """
2023-07-22 12:25:30 -04:00
Nico Weber
18b86b1868 LibPDF: Apply text matrix scale to character and word spacing 2023-07-22 12:24:29 -04:00
Nico Weber
e3cc05b935 LibPDF: Don't ignore word_spacing 2023-07-22 12:24:29 -04:00
Timothy Flynn
05fbd31727 Revert "LibC: Remove duplicate log statement"
This reverts commit 58c91f0a99.
2023-07-22 12:19:53 -04:00
Timothy Flynn
e62cb539fd Revert "FileManager: Remove duplicate log statement"
This reverts commit e0b7717a6a.
2023-07-22 12:19:53 -04:00
Timothy Flynn
685c8c3d40 Revert "AK: Automatically copy all warn/warnln logs to debug console"
This reverts commit d48c68cf3f.

Unfortunately, this currently copies some warn() invocations that we do
*not* want in the debug console, such as test-js's use of OSC command 9
to report progress.
2023-07-22 12:19:53 -04:00
Michal Grich
2e9fcc17a0 SystemMonitor: Fix calculation of CPU percentage
This commit addresses an issue when 'Zombie' threads are
included in CPU % calculation. This caused negative
time_scheduled_diff, resulting in a data type overflow.
2023-07-22 08:54:23 -04:00
Lucas CHOLLET
89e2431517 Tests/LibGfx: Add a first test for JPEG XL images
This image uses the modular encoding with a very simple prediction tree.
It also makes use of two features: upsampling (x2 factor) and a
non-standard bit depth (10 bits). The file has been generated on
https://jxl-art.surma.technology/ , with the following input:

Width 64
Height 64
Upsample 2
Bitdepth 10

if N > 300
  - NE -6
  - W 6
2023-07-22 08:52:57 -04:00
Lucas CHOLLET
9975bdb2d1 LibGfx/JPEGXL: Align the stream to byte boundary before reading a frame
As this is stated in the spec, all frames are byte-aligned.
2023-07-22 08:52:57 -04:00
Xexxa
ea88242d1c Base: Add more emoji
🐹 - U+1F439 HAMSTER
🦂 - U+1F982 SCORPION
🥐 - U+1F950 CROISSANT
🫕 - U+1FAD5 FONDUE
🏫 - U+1F3EB SCHOOL
🚑 - U+1F691 AMBULANCE
🛺 - U+1F6FA AUTO RICKSHAW
🧧 - U+1F9E7 RED ENVELOPE
🥍 - U+1F94D LACROSSE
🤿 - U+1F93F DIVING MASK
🥽 - U+1F97D GOGGLES
🩺 - U+1FA7A STETHOSCOPE
2023-07-22 08:50:46 -04:00
Xexxa
ad645c7103 Base: Add more emoji
🏵️ - U+1F3F5 ROSETTE
🦠 - U+1F9A0 MICROBE
🪽 - U+1FABD WING

Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2023-07-22 08:50:46 -04:00
Andreas Kling
5d6169793a Ladybird+LibWebView: Respawn with same JS interpreter after crash
WebView::ViewImplementation now remembers which JS interpreter it
started with, and uses the same setting if the WebContent process
crashes and we have to spawn a new one.
2023-07-22 08:49:59 -04:00
Timothy Flynn
8b23bbf58e LibJS: Read properties from the Intl.DateTimeFormat options object once
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/02bd03a

This is observable just due to reading the properties one less time. It
would have been possible for e.g. the property values to change between
those invocations.
2023-07-22 10:18:55 +02:00
Timothy Flynn
3a4cdf77ba LibJS: Move Intl.DateTimeFormat creation to CreateDateTimeFormat AO
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/b6ed64b
https://github.com/tc39/ecma402/commit/6e3b70d

This moves Intl.DateTimeFormat creation to InitializeDateTimeFormat and
renames that AO to CreateDateTimeFormat.
2023-07-22 10:18:55 +02:00
Timothy Flynn
ea774111e8 LibJS: Raise the upper minimum/maximum fraction digit limit to 100
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/f6d2945
2023-07-22 10:18:55 +02:00
Lucas CHOLLET
3fdf5072ec LibCompress/Brotli: Remove CanonicalCode::clear()
This function was used in a single place and don't provide a huge
benefit over simply recreating the object.
2023-07-22 07:10:47 +02:00
Andi Gallo
63e72feee1 LibWeb: Add additional term to the table cell min contribution
Align with specification.
2023-07-22 07:06:50 +02:00
Andi Gallo
6104e4ecb5 LibWeb: Simplify specified size formulas when computing cell measures
Make it clearer how it's supposed to work relative to specification.
2023-07-22 07:06:50 +02:00
Andi Gallo
6dfa1c2548 LibWeb: Distribute excess width to columns as in specification 2023-07-22 07:06:50 +02:00
Andi Gallo
eb20eeb54c LibWeb: Use column and row size for cell outer sizes
Better aligns our implementation with the specification, which requires
that we check columns and column groups too.
2023-07-22 07:06:50 +02:00
Andi Gallo
28509e3edd LibWeb: Check column or row size attributes for constrainedness
Better aligns our implementation with the specification, which requires
that columns and groups of columns are checked too.
2023-07-22 07:06:50 +02:00
Andi Gallo
19a26533a9 LibWeb: Make the type of column whether it's percent or not
Change how we store type of columns. It was used where the specification
only distinguishes between percent and everything else, so it makes more
sense to store and use it as a boolean.
2023-07-22 07:06:50 +02:00
Andi Gallo
0314e26ef4 LibWeb: Linear interpolation between table width sizing guesses
Make used widths of the columns a linear combination of two consecutive
sizing-guesses when the assignable table width is less than or equal to
the max-content sizing-guess, as the specification describes.
2023-07-22 07:06:50 +02:00
Andi Gallo
030b1a197b LibWeb: Don't use the preferred increment as reference for distribution
The specification says we should distribute excess width proportionally
to the width of the cell, not to the preferred increment. Doing the
latter leads to distributing all excess width to just the cells which
demand some increment, even if it's very modest. Moreover, there's code
which partially implements the correct criteria just below the one we
remove here.
2023-07-22 07:06:50 +02:00
Andi Gallo
13687085dd LibWeb: Better align outer max sizes for cells with the specification
The formulas are different between the constrained and non-constrained.
2023-07-22 07:06:50 +02:00
Andi Gallo
81d0b17987 LibWeb: Rework the computation of {min, max-}size and size for cells
Follow the specification more closely when computing the cell measures.
2023-07-22 07:06:50 +02:00
Andi Gallo
a9a5224132 LibWeb: Add 'outer' prefix to {min, max}_{width, height}
Follow the specification terminology.
2023-07-22 07:06:50 +02:00
Andreas Kling
1768d70823 Revert "LibJS: Remove "uprooting" mechanism from garbage collector"
This reverts commit 6232ad3a0d.

Unfortunately this introduced some flakiness on CI, so it wasn't
quite this simple.
2023-07-22 06:53:26 +02:00
Lucas CHOLLET
a2955501d3 LibGfx/JPEGXL: Don't decode the header twice
This is something I missed when I ported the JPEG XL decoder to the new
plugin interface (decoding the header at creation). First sorry because
that's entirely my fault, second sorry because a test should have caught
that.
2023-07-21 22:25:56 -04:00
Lucas CHOLLET
65565d377b LibGfx/JPEGXL: Accept images with high bit depth
Instead of rejecting them, we truncate each value to 8 bits. This is
clearly a hack, but given the lack of support of variable bit-depth in
`Bitmap` this is the only sensible change.

This allows us to display "Iceberg" on https://jpegxl.info/art/.
2023-07-21 19:34:21 -04:00
Tim Ledbetter
6710622bf7 file: Add -b option to omit file name from output 2023-07-21 19:32:43 -04:00
Aliaksandr Kalenik
fd9b3bdc94 LibWeb: Support auto vertical margins for grid items 2023-07-21 21:09:45 +02:00
Andreas Kling
9f06e130a2 LibJS/Bytecode: Keep saved return value in call frame register
This fixes an issue where returning inside a `try` block and then
calling a function inside `finally` would clobber the saved return
value from the `try` block.

Note that we didn't need to change the base of register allocation,
since it was already 1 too high.

With this fixed, https://microsoft.com/edge loads in bytecode mode. :^)

Thanks to Luke for reducing the issue!
2023-07-21 19:15:33 +02:00
Lucas CHOLLET
475f1b6083 LibCore+LibGfx+LibGUI: Consider JPEG XL files as images
This includes registering the mime type and adding it to both the list
of supported image format and the filter for images type in LibGUI.
2023-07-21 10:47:34 -06:00
Lucas CHOLLET
e8a63eeb0e LibGfx/JPEGXL: Add a JPEG-XL decoder :^)
JPEG-XL is a new image format standardized by the same committee as the
original JPEG image format. It has all the nice feature of recent
formats, and great compression ratios. For more details, look at:
https://jpegxl.info/

This decoder is far from being feature-complete, as it features a grand
total of 60 FIXMEs and TODOs but anyway, it's still a good start.

I developed this decoder in the Serenity way, I just try to decode a
specific image while staying as close as possible to the specification.

Considering that the format supports a lot of options, and that we
basically support only one possibility for each of them, I'm pretty sure
that we can only decode the image I've developed this decoder for.

Which is:
0aff 3ffa 9101 0688 0001 004c 384b bc41
5ced 86e5 2a19 0696 03e5 4920 8038 000b
2023-07-21 10:47:34 -06:00
Lucas CHOLLET
bb834ed765 LibCompress: Add a constructor to Brotli::CanonicalCode
This constructor will be used by the JPEG-XL decoder to support a
non-standard special case. Other user should only use other
constructors.
2023-07-21 10:47:34 -06:00
Lucas CHOLLET
96eace8390 LibCompress: Move CanonicalCode in the Brotli namespace
The class was an inner class of `BrotliDecompressionStream`, let's move
it outside the `Stream` object in order to ease the access to user only
interested in this part.
2023-07-21 10:47:34 -06:00
Lucas CHOLLET
9248fd7f33 LibCompress: Move CanonicalCode's initializers inside CanonicalCode
These routines:
 - read_prefix_code
 - read_simple_prefix_code
 - read_complex_prefix_code

 were methods of `BrotliDecompressionStream` taking a `CanonicalCode` as
 an out parameter. This patch puts them in `CanonicalCode` as static
 methods.
2023-07-21 10:47:34 -06:00