Commit graph

56913 commits

Author SHA1 Message Date
Andreas Kling
a24c543921 LibJS: Update spec steps & add missing assertions in ResolveExport 2023-12-03 20:46:55 +01:00
Andreas Kling
40d2560a93 LibJS: Update spec steps & add missing assertions in GetExportedNames 2023-12-03 20:46:55 +01:00
Andreas Kling
467a5ceb18 LibJS: Split big VERIFY conditions into smaller ones in CyclicModule
This makes assertion failures here more informative.
2023-12-03 20:46:55 +01:00
Andreas Kling
b08683e588 LibWeb: Don't capture stack variables by reference in MainThreadVM hooks 2023-12-03 20:46:55 +01:00
Andreas Kling
0817d8bda6 LibJS+LibWeb: Make CyclicModule & GraphLoadingState GC-allocated
This allows them to participate in the ownership graph and fixes a
lifetime issue in module loading found by ASAN.

Co-Authored-By: networkException <networkexception@serenityos.org>
2023-12-03 20:46:55 +01:00
Andreas Kling
aa7501a66a LibJS: Set initial state of CyclicModule.[[Status]] to NEW
This is what the specification tells us to do:
https://tc39.es/ecma262/#cyclic-module-record

Co-Authored-By: networkException <networkexception@serenityos.org>
2023-12-03 20:46:55 +01:00
Bastiaan van der Plaat
01f000acb0 LibWeb: Add HTML col element span attribute 2023-12-03 20:29:14 +01:00
Bastiaan van der Plaat
7e6fc9c26e LibWeb: Add textarea cols and rows attribute 2023-12-03 20:29:14 +01:00
Bastiaan van der Plaat
f3db0003c2 LibWeb: Add script element text getter setter 2023-12-03 20:29:14 +01:00
Bastiaan van der Plaat
529fd0a65c LibWeb: Add HTML legend element form getter 2023-12-03 20:29:14 +01:00
Bastiaan van der Plaat
fb7b03d162 LibWeb: Add support for the input size attribute 2023-12-03 20:29:14 +01:00
Kenneth Myhra
d9fb116bcc Tests/LibWeb: Initialize Blob with string and read it from arrayBuffer() 2023-12-03 20:28:10 +01:00
Kenneth Myhra
b72489409a Tests/LibWeb: Initialize Blob with string and read it from text() 2023-12-03 20:28:10 +01:00
Kenneth Myhra
000ea9d73b LibWeb: Avoid crashing because of empty incumbent settings object stack
This fixes an issue where we end up in a state where we have no
execution context + a main thread event loop with an empty incumbent
settings object stack.
2023-12-03 20:28:10 +01:00
Lucas CHOLLET
0a80daef90 LibGfx/TIFF: Don't include the null-byte terminator when reading strings 2023-12-03 20:27:00 +01:00
Lucas CHOLLET
a382ea7c1f LibGfx/TIFF: Consider ASCII and UTF-8 as containers
The generator will now create APIs that return a single `String`
instead of a `Vector<String>`.
2023-12-03 20:27:00 +01:00
Shannon Booth
a8caa3edbc LibWeb/Tests: Add a test to cover byte stream enqueue and respond 2023-12-03 20:26:14 +01:00
Shannon Booth
48aa9fbe07 LibWeb: Implement ReadableByteStreamController.enqueue 2023-12-03 20:26:14 +01:00
Shannon Booth
feb7fbb95d LibWeb: Implement ReadableStreamBYOBRequest.respond
The parameter in IDL is left as an unsigned long instead of an unsigned
long long as the IDL generator does not currently support that.
2023-12-03 20:26:14 +01:00
Shannon Booth
08be5deb3f LibWeb: Implement AO ReadableByteStreamControllerRespond 2023-12-03 20:26:14 +01:00
Shannon Booth
2ab933e534 LibWeb: Implement AO ReadableByteStreamControllerRespondInternal 2023-12-03 20:26:14 +01:00
Shannon Booth
426cbd8ed3 LibWeb: Implement AO ReadableByteStreamControllerRespondInClosedState 2023-12-03 20:26:14 +01:00
Shannon Booth
be2195cb8c LibWeb: Implement AO ReadableByteStreamControllerRespondInReadableState 2023-12-03 20:26:14 +01:00
Shannon Booth
0245be70d8 LibWeb: Implement Streams AO CanTransferArrayBuffer 2023-12-03 20:26:14 +01:00
Shannon Booth
9d0700e770 LibWeb: Fix IDL getter for ReadableByteStreamController byobRequest
We were previously only returning the controllers current
[[byobRequest]] instead of taking into account pending pull intos.

Rename the getter function which would return the controllers
[[byobRequest]] slot to `raw_byob_request` to differentiate it from
the IDL getter.

This also leaves a FIXME for a spec step which we are also not currently
implementing correctly.
2023-12-03 20:26:14 +01:00
Shannon Booth
1e607f5775 LibWeb: Fix some missing initialize overrides for some Streams classes
This is some more motivation for me to get around to automatically
generate these initialize calls at some point.
2023-12-03 20:26:14 +01:00
Shannon Booth
b2a0a41503 LibWeb: Use TypedArrayBase::kind for pull into constructor lookup 2023-12-03 20:26:14 +01:00
Shannon Booth
a9a3dcd952 LibWeb: Use ArrayBufferView in ReadableStreamBYOBRequest 2023-12-03 20:26:14 +01:00
Ali Mohammad Pur
4893dfdc57 Ports: Update Jakt to the latest commit 2023-12-03 14:11:23 +01:00
Ali Mohammad Pur
167b54d03d Ports: Make the LLVM port install its ocaml bindings somewhere else
By default the bindings go to /usr/local on the host, which is a very
big no-no; this path is not affected by CMAKE_INSTALL_PREFIX, so this
commit sets the LLVM_OCAML_INSTALL_PATH variable instead.
It should be noted that disabling the ocaml bindings doesn't make all
the users of this variable go away, so this commit doesn't do so.

This also sorts the -DFOO options passed to cmake, because...sorting.
2023-12-03 14:11:23 +01:00
hanaa12G
e6cde722c9 LibLine: Reset m_times_tab_pressed in interrupt handling code
We forgot to reset all the variables that keep track of suggestion
state, resulting in an underflow value when calculating the lines to
display completion suggestions later.

Setting `m_times_tab_pressed` to 0 apparently forces it to recalculate
the those variables and seems to fix the problem.

Fixes #22128
2023-12-03 10:02:51 +03:30
Shannon Booth
f976ec005c LibWeb: Port DOM::Document from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
c4d3134436 LibWeb: Port NavigatorLanguage from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
a8f5ebeddd LibWeb: Port DOM::Node from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
89bbf53745 LibWeb: Port CSS Parser from DeprecatedString
These are the last instances of DeprecatedString in the CSS folder.
2023-12-02 22:54:53 +01:00
Shannon Booth
2cf3819caf LibWeb: Port HTMLFieldSetElement from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
cc43dbf56e LibWeb: Port HTMLTextAreaElement from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
a7b8828db2 LibWeb: Port call_user_object_operation from DeprecatedString 2023-12-02 22:54:53 +01:00
Shannon Booth
6813dcaff8 LibWeb: Return FlyString const& from CSS::Parser::Token
This allows us to not need to convert back to a FlyString when we need
one.
2023-12-02 22:54:53 +01:00
Timothy Flynn
b9902fef36 LibWebView: Add a draggable separator between the two Inspector panes 2023-12-02 22:54:06 +01:00
Timothy Flynn
b10934af27 Ladybird/AppKit: Implement cursor images for row-resize and col-resize 2023-12-02 22:54:06 +01:00
Timothy Flynn
582f19ba24 Ladybird: Allow opening the Inspector with both ctrl+shift+I and F12
Ladybird on Serenity currently only uses F12, and on other platforms
only uses ctrl+shift+I. Most browsers support both hotkeys, so let's do
the same for consistency.

Note that the AppKit chrome cannot support both shortcuts. macOS does
not allow setting multiple "key equivalent" strings on an action. There
are some questionable hacks we could do to support this eventually, but
for now, just ctrl+shift+I is supported on macOS.
2023-12-02 22:54:06 +01:00
Timothy Flynn
1d03301037 LibWeb: Allow JS event handlers to stop propagation of mousemove events
This follows similar logic to keydown events.
2023-12-02 22:54:06 +01:00
Nico Weber
7f5e9a0236 LibGfx/ICC: Support for A curves and CLUT in LutAToBTagData::evaluate()
`lerp_nd()` is very similar to PDF::SampleFunction::evaluate(). But we
know that the result is a FloatVector3 in the ICC code (at least for
now), so we can save a bunch of redundant computation by returning
all three channels of the LUT at once.

This is enough for images using mAB with A curve / CLUT if the
profile connecting space is PCSXYZ, such as for Upper_Right.jpg
from https://www.color.org/version4html.xalter like so:

    % Build/lagom/icc --name sRGB --reencode-to serenity-sRGB.icc
    % Build/lagom/bin/image -o out.png \
        --convert-to-color-profile serenity-sRGB.icc \
        ~/Downloads/Upper_Right.jpg
2023-12-02 22:26:13 +01:00
Nico Weber
1c88b82dfc LibPDF: Do less work in SampledFunction::evaluate()'s inner loop
Instead of recomputing the left index and the float amount in that
interval for each coordinate all the time, do it once when we
preprocess the input coordinates.

One line less, faster, and arguably easier to read.

No behavior change.
2023-12-02 22:26:13 +01:00
Nico Weber
54883b7d41 LibPDF: Remove get_bounds lambda in SampledFunction::evaluate()
Using `min()` to guarantee the left index is never == `size() - 1`,
even for an interpolation value of 1.0, is less code, and arguably
easier to understand as well.

No behavior change.
2023-12-02 22:26:13 +01:00
Nico Weber
d9fd72007e LibPDF: Add a spec comment to SampledFunction::sample() 2023-12-02 22:26:13 +01:00
Idan Horowitz
aad5c58996 LibPDF: Eliminate reference cycle between OutlineItem parent/children
Since all parents held a reference pointer to their children, and all
children held reference pointers to their parents, both objects would
never get free'd once the document was no longer being used.

Fixes ossfuzz-63833.
2023-12-02 22:23:53 +01:00
Aliaksandr Kalenik
681771d210 LibGfx+LibWeb: Calculate and save glyph positions during layout
Previously, we determined the positions of glyphs for each text run at
the time of painting, which constituted a significant portion of the
painting process according to profiles. However, since we already go
through each glyph to figure out the width of each fragment during
layout, we can simultaneously gather data about the position of each
glyph in the layout phase and utilize this information in the painting
phase.

I had to update expectations for a couple of reference tests. These
updates are due to the fact that we now measure glyph positions during
layout using a 1x font, and then linearly scale each glyph's position
to device pixels during painting. This approach should be acceptable,
considering we measure a fragment's width and height with an unscaled
font during layout.
2023-12-02 22:06:11 +01:00
Idan Horowitz
1a35621930 LibGfx: Eliminate multiplication integer overflow in planar_to_chunky
Multiplying two u16s will result in a i32 sized result, which will
overflow to negative values for large input values.

Fixes ossfuzz-64198.
2023-12-02 11:46:03 +01:00