Commit graph

52845 commits

Author SHA1 Message Date
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
Lucas CHOLLET
d2dd4142d1 LibCompress: Make CanonicalCode::read_symbol const 2023-07-21 10:47:34 -06:00
Lucas CHOLLET
f79165cefe AK: Make FixedArray movable 2023-07-21 10:47:34 -06:00
Timothy Flynn
77d7f715e3 LibJS+CI: Remove bytecode optimization passes for now
These passes have not been shown to actually optimize any JS, and tests
have become very flaky with optimizations enabled. Until some measurable
benefit is shown, remove the optimization passes to reduce overhead of
maintaining bytecode operations and to reduce CI churn. The framework
for optimizations will live on in git history, and can be restored once
proven useful.
2023-07-21 19:47:36 +03:30
Nico Weber
164c132928 LibPDF: Fix dumping of toplevel indirects
An indirect object starts `42 0 obj`, not `obj 42 0`.
2023-07-21 10:44:50 -04:00
Andreas Kling
6232ad3a0d LibJS: Remove "uprooting" mechanism from garbage collector
The Heap::uproot_cell() API was used to implement markAsGarbage() which
was used in 3 tests to forcibly destroy a value, even if it had
references on the stack or elsewhere.

This patch rewrites the 3 tests that used this mechanism to be
structured in a way that allows garbage collection to collect the values
as intended without hacks. And now that the uprooting mechanism is no
longer needed, it's uprooted as well.

This fixes 3 test-js tests in bytecode mode. :^)
2023-07-21 14:14:00 +02:00
Andreas Kling
9054b1bc14 LibJS: Always taint parsing environment on call to eval()
We had an edge case where calls to eval() left the environment untainted
*if* `eval` had also been declared as a local variable in the same
parsing context.

This broke the expected direct eval behavior when the variable `eval`
was still pointing at the global `eval` function.

This patch fixes the issue by simply always tainting the environment
when a call to something named `eval` is encountered. It doesn't seem
worth worrying about optimizing the case where someone is calling their
own function named `eval`..

Fixes 1 test-js test in bytecode mode. :^)
2023-07-21 14:14:00 +02:00
Andreas Kling
c90bf22d29 LibJS/Bytecode: Use primitive this for strict mode GetByValue
GetByValue now shares code with GetById to elide the synthetic wrapper
objects for primitive values in strict mode.

Fixes 2 test-js tests in bytecode mode. :^)
2023-07-21 14:14:00 +02:00
Andreas Kling
7253d021fc LibJS/Bytecode: Factor out determining the base object from GetById
This will allow us to use the same logic in GetByValue (in a subsequent
commit.)
2023-07-21 14:14:00 +02:00
Andreas Kling
6de22ec789 LibJS/Bytecode: Rename RegisterWindow to CallFrame
This is a better name for what it actually represents.
2023-07-21 14:14:00 +02:00
Liav A
061ebd0b15 Ports: Update acpica-tools to use other upstream
Also, update it to the latest revision, which makes it possible to build
without most of the patches we needed before, but now we need our own
definitions for LibC includes and to disable errors for the warning
bad-function-cast.
2023-07-21 12:48:24 +02:00