Commit Graph

57067 Commits

Author SHA1 Message Date
Andrew Kaster
bb217fb0d7 Meta: Add Bastiaan van der Plaat to the contributors list :^) 2023-12-07 14:56:19 -07:00
Bastiaan van der Plaat
3bfc2f5e95 LibWeb: Declare optional parse results inlined in if statements 2023-12-07 16:46:50 -05:00
Bastiaan van der Plaat
1b9a961fb0 LibWeb: Add input stepUp and stepDown functions 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
1a63639518 LibWeb: Move logic to check if valueAsNumber applies to its own function 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
c0751b2a49 LibWeb: Add basis of the convert number to string algorithm functions 2023-12-07 16:46:28 -05:00
Andrew Kaster
39c4a5e948 LibWeb: Add config file for LibWeb tests that skips Worker-echo.html 2023-12-07 16:46:20 -05:00
Andrew Kaster
4786d9e3e6 headless-browser: Add ability to skip tests 2023-12-07 16:46:20 -05:00
Reimar
4299fb604b LibWeb: Add window.status property 2023-12-07 11:02:50 -07:00
Kemal Zebari
3a820ddbdf LibWeb/MimeSniff: Add sniffing in an audio or video context 2023-12-07 10:31:54 -07:00
Kemal Zebari
02ea85da2c LibWeb/MimeSniff: Add sniffing in an image context 2023-12-07 10:31:54 -07:00
Kemal Zebari
ea15501f37 LibWeb/MimeSniff: Add sniffing in a browsing context 2023-12-07 10:31:54 -07:00
Kemal Zebari
f6d3ea33fa LibWeb/MimeSniff: Add match an archive type pattern algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
d5e5a1138f LibWeb/MimeSniff: Add match an audio or video type pattern algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
62ca3b518b LibWeb/MimeSniff: Add the image type pattern matching algorithm 2023-12-07 10:31:54 -07:00
Kemal Zebari
2babc08c17 LibWeb/MimeSniff: Add rules for identifying an unknown mime type
This also implements the pattern matching algorithm since it's
needed.
2023-12-07 10:31:54 -07:00
Kemal Zebari
04e19df06a LibWeb/MimeSniff: Implement Resource
See https://mimesniff.spec.whatwg.org/#resource
2023-12-07 10:31:54 -07:00
Kemal Zebari
a2a61d6941 LibWeb/MimeSniff: Add move/copy construct and assignment to MimeType
This change exists to avoid having to reparse a MIME type when we
need to move/copy elsewhere.
2023-12-07 10:31:54 -07:00
Dan Klishch
96d44b1572 Userland: Make bit-fields compatible with MSVC C++ ABI 2023-12-07 10:28:19 -07:00
Dan Klishch
00928764e9 JSSpecCompiler: Add our first test :^) 2023-12-07 10:13:21 -07:00
Dan Klishch
107a3b44fa JSSpecCompiler: Add regression test runner 2023-12-07 10:13:21 -07:00
Dan Klishch
b7259ab38c LibCore: Support POSIX file actions in Core::Process::spawn 2023-12-07 10:13:21 -07:00
Dan Klishch
d317309d89 Everywhere: Unport Core::System::current_executable_path from new string
Storing paths in AK::String is never correct.
2023-12-07 10:13:21 -07:00
Dan Klishch
610fe28115 Meta: Add option to specify custom test names for Lagom 2023-12-07 10:13:21 -07:00
Dan Klishch
dbd624e875 JSSpecCompiler: Allow dumping AST after specified passes 2023-12-07 10:13:21 -07:00
Andreas Kling
350e6c54d7 LibJS: Remove dedicated iterator result instructions in favor of GetById
When iterating over an iterable, we get back a JS object with the fields
"value" and "done".

Before this change, we've had two dedicated instructions for retrieving
the two fields: IteratorResultValue and IteratorResultDone. These had no
fast path whatsoever and just did a generic [[Get]] access to fetch the
corresponding property values.

By replacing the instructions with GetById("value") and GetById("done"),
they instantly get caching and JIT fast paths for free, making iterating
over iterables much faster. :^)

26% speed-up on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-07 18:12:24 +01:00
Nicolas Ramz
8d68f94282 LibGfx/ILBMLoader: Add HAM6/HAM8 support 2023-12-07 10:08:29 -07:00
Andreas Kling
4699c81fc1 LibJS: Stop converting between Object <-> IteratorRecord all the time
This patch makes IteratorRecord an Object. Although it's not exposed to
author code, this does allow us to store it in a VM register.

Now that we can store it in a VM register, we don't need to convert it
back and forth between IteratorRecord and Object when accessing it from
bytecode.

The big win here is avoiding 3 [[Get]] accesses on every iteration step
of for..of loops. There are also a bunch of smaller efficiencies gained.

20% speed-up on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-07 14:06:34 +01:00
Bastiaan van der Plaat
4966c083df LibWeb: Remove progress element custom paintable use shadow dom instead 2023-12-07 11:37:01 +01:00
Bastiaan van der Plaat
ca94df3c88 LibWeb: Clean up shadow root of meter element 2023-12-07 11:37:01 +01:00
Kemal Zebari
34fa49c344 LibWeb/MimeSniff: Add missing spec comments 2023-12-07 11:11:07 +01:00
Lucas CHOLLET
965da551e3 LibGfx/TIFF: Print the corresponding enum value's name when possible
As an example, for the tag 262 if the value is 5, "LZW" will be
displayed instead of the numeric value.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
2691651abf LibGfx/TIFF: Generated the code to output debug prints
When the `TIFF_DEBUG` flag is set, the TIFF decoder logs every tag and
their values. This is already useful but require the developer to have
the spec handy in order to decrypt each value to its signification. None
of this information is available at runtime, but this is known by the
Python generator. So by generating these debug logs, we drastically
increase their value.

As a bonus point, most of these functions should be useful when we will
display image's metadata in Serenity.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
b82f5d7f3e LibGfx/TIFF: Add a C++ formatter for TIFF::Value 2023-12-07 11:10:55 +01:00
Lucas CHOLLET
6e282538cc LibGfx/TIFF: Generate a C++ helper function to print enums
For a given enum value, this function will return its corresponding name
as a `StringView`.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
f00e9540d5 LibGfx/TIFF: Add an intrinsic way to get the exportable name of Enums
The `TIFFType` enum is exported with a different name to C++. This
change of behavior was handled by manually setting the parameter of a
function. However, we will soon need the exported name in more places,
so let's make it a property of the Enum itself.
2023-12-07 11:10:55 +01:00
Lucas CHOLLET
1d345109c4 LibGfx/TIFF: Move Formatter<Rational>'s definition to TIFFMetadata.h
This will soon be used in TIFFTagHandler.cpp, so the definition needs to
be shared.
2023-12-07 11:10:55 +01:00
Timothy Flynn
71fdf0860e Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node 2023-12-07 10:53:12 +01:00
Timothy Flynn
e3df035c5d Ladybird+LibWebView: Add an Inspector action to copy a node's HTML/text 2023-12-07 10:53:12 +01:00
Timothy Flynn
51a0673b5c Ladybird+LibWebView: Add an Inspector action to copy an attribute value 2023-12-07 10:53:12 +01:00
Timothy Flynn
f7de1369d2 LibWebView+WebContent: Add a WebContent IPC to take DOM node screenshots 2023-12-07 10:53:12 +01:00
Timothy Flynn
a7b98a9761 LibWeb+WebContent+WebWorker: Add an option to skip painting the overlay
This will allow the Inspector to take a screenshot of a DOM node without
the overlay which renders the inspected node outline / box data.
2023-12-07 10:53:12 +01:00
Timothy Flynn
bea11f6d99 LibWebView+WebContent: Add a WebContent IPC to get a DOM node's HTML 2023-12-07 10:53:12 +01:00
Timothy Flynn
8162dc5ee6 LibWeb+LibWebView+WebContent: Separate tag/attribute in Inspector menu
It was a bit short-sighted to combine the tag and attribute names into
one string when the Inspector requests a context menu. We will want both
values for some context menu actions. Send both names, as well as the
attribute value, when requesting the context menu.
2023-12-07 10:53:12 +01:00
Andreas Kling
c9f0f0fc70 LibJS: Elide empty lexical environment in for..in/of blocks
When all the variables in a for..in/of block's lexical scope have been
turned into locals, we don't need to create and immediately abandon an
empty environment for them.

This avoid environment allocation in cases like this:

    function foo(a) {
        for (const x of a) {
        }
    }
2023-12-07 10:52:57 +01:00
Aliaksandr Kalenik
facdbe13c7 Tests/LibWeb: Add ref test for inline node styles
Turn Base/res/html/misc/inline-node.html into ref test.
2023-12-07 10:52:47 +01:00
Aliaksandr Kalenik
d1d6da6ab6 LibWeb: Resolve border radius during layout and save it in paintables
This change fixes a problem that we should not call `to_px()` to
resolve any length or percentage values during paintables traversal
because that is supposed to happen while performing layout.

Also it improves performance because before we were resolving border
radii during each painting phase but now it happens only once during
layout.
2023-12-07 10:52:47 +01:00
Lucas CHOLLET
da134f6867 LibGfx/TIFF: Add support for grayscale images
Images with a single sample per pixel should be interpreted as
grayscale.
2023-12-07 08:17:46 +00:00
Lucas CHOLLET
923d9e834f LibGfx/TIFF: Add support for the SamplesPerPixel tag 2023-12-07 08:17:46 +00:00
Lucas CHOLLET
d9b69c644e LibGfx/TIFF: Allow any number of values for the tag BitsPerSample
Only some specific number of values should be allowed, but let's accept
everything for now and add these checks when the generator will be more
mature.
2023-12-07 08:17:46 +00:00
Lucas CHOLLET
ff73d5464a LibGfx/TIFF: Make loop_over_pixels autonomous for reading samples
Let's make the "read a sample" part independent of the decoder. That
will soon allow us to read samples based on the image's parameter
without duplicating the code for every decoder.
2023-12-07 08:17:46 +00:00