Commit graph

60412 commits

Author SHA1 Message Date
Kenneth Myhra a0802b6e29 Tests/LibWeb: Verify we throw when trying to pipe from/to locked streams 2024-04-07 07:01:52 +02:00
Kenneth Myhra 8ff52582ce Tests/LibWeb: Add test to prove we can pipe to a WriteableStream
This proves our ability to pipe the current ReadableStream to a given
WriteableStream.
2024-04-07 07:01:52 +02:00
Kenneth Myhra d3b2cd8ab6 LibWeb: Implement ReadableStream.pipeTo() 2024-04-07 07:01:52 +02:00
Kenneth Myhra 559d983fa1 LibWeb: Implement AO readable_stream_pipe_to()
This is currently a naive implementation of readable_stream_pipe_to()
which will need some further iterations before it is par with the spec.
2024-04-07 07:01:52 +02:00
Kenneth Myhra 12cfa08a09 LibWeb: Use Vector<ByteBuffer> to store chunks in ReadLoopReadRequest
This stores the incoming chunks into a Vector of ByteBuffer in order to
be able to retrieve them in the same order as they came in.
2024-04-07 07:01:52 +02:00
Lucas CHOLLET cb5f30ae98 LibGfx/TIFF: Prevent recursion when following IFD pointers
Fixes oss-fuzz 66587.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66587&sort=-opened&q=proj%3Aserenity%20TIFF&can=1
2024-04-07 06:45:38 +02:00
Aliaksandr Kalenik 2c86633c51 LibWeb: Fix out of order spec step numbers in "create child navigable"
No behaviour change.
2024-04-06 21:57:55 +02:00
Shannon Booth 18520561e7 LibWeb: Fix crash for calculated transition duration/delays
As the parser was trying to directly unwrap an unresolved duration.
Currently we are outputting the wrong results for the serialized
duration, but this is still a step forwards.

Fixes a crash seen on: https://evaparish.com/blog/how-i-edit
2024-04-06 19:35:27 +01:00
Idan Horowitz 945c58c7c1 LibUnicode: Generate and use code point composition mappings
These allow us to binary search the code point compositions based on
the first code point being combined, which makes the search close to
O(log N) instead of O(N).
2024-04-06 14:21:04 -04:00
Idan Horowitz e227bf0f71 LibUnicode: Optimize the canonical composition algorithm implementation
It now takes O(N) time instead of O(N^2) time. Additionally some always
false conditions are removed.
2024-04-06 14:21:04 -04:00
Torben Virtmann 6207405f3d Base: Add and Rework Emoji
- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB
2024-04-06 13:40:45 -04:00
Shannon Booth 8c34842962 AK: Simplify and optimize ASCIICaseInsensitiveFlyStringTraits::equals
The member function `equals_ignoring_ascii_case` has a fast path which
will return early if it is the same FlyString instance.
2024-04-06 09:17:51 -04:00
Shannon Booth f186e7e537 LibWeb: Fill out implementation for navigator.hardwareConcurrency
Instead of always reporting 1 :^)
2024-04-06 07:20:22 +02:00
Shannon Booth 9c9a378455 LibCore: Implement Core::System::hardware_concurrency() 2024-04-06 07:20:22 +02:00
Idan Horowitz 9f31a83c2e LibJSGCVerifier: Assume MarkedVector wrapped members are valid
These are effectively heap roots, so they don't need to be visited.
2024-04-06 06:59:36 +02:00
Idan Horowitz b018114bee LibWeb: Add missing visit_edges implementation to RegExpObject 2024-04-06 06:59:36 +02:00
Idan Horowitz f357998e81 LibWeb: Add missing visit_edges implementation to ModuleNamespaceObject 2024-04-06 06:59:36 +02:00
Idan Horowitz 42853fb980 LibWeb: Add missing visit_edges implementation to MathMLElement 2024-04-06 06:59:36 +02:00
Idan Horowitz c61f341320 LibWeb: Add missing visit_edges implementation to AnimationEffect 2024-04-06 06:59:36 +02:00
Idan Horowitz 46ad9d51df LibWeb: Replace MarkedVector with Vector in AudioTrackList
There's no need to make the m_audio_tracks entries heap roots, we can
visit them instead.
2024-04-06 06:59:36 +02:00
Idan Horowitz 270e0d4b58 LibWeb: Replace MarkedVector with Vector in VideoTrackList
There's no need to make the m_video_tracks entries heap roots, we can
visit them instead.
2024-04-06 06:59:36 +02:00
Idan Horowitz f921952cc3 LibJSGCVerifier: Warn about missing visit_edges impls with GC members
Previously we would only warn about missing calls to visit inside
visit_edges implementations, now we warn as well when there's no
visit_edges implementation at all.
2024-04-06 06:59:36 +02:00
Idan Horowitz c84cd1d668 LibJSGCVerifier: Support marking GCPtr members as raw references
This lets us avoid false positives when a GCPtr-wrapped member is only
a weak reference which is automatically updated by the GC when the
member's gc state is updated.
2024-04-06 06:59:36 +02:00
Shannon Booth c3217754f1 LibWeb: Remove a bunch of calls to to_byte_string
A bunch of this is leftover from pre porting over to new AK::String.
For example, for functions which previously took a ByteString const&
now accepting a StringView.
2024-04-05 20:01:37 -04:00
Shannon Booth 0090b916dd LibJS: Make ParserError::to_string infallible 2024-04-05 20:01:37 -04:00
Andreas Kling d568b15acf LibURL: Avoid expensive IDNA::to_ascii() for all-ASCII domain strings
20% of CPU usage when loading https://utah.edu/ was spent doing these
ASCII conversions in URL parsing.
2024-04-05 16:01:10 -06:00
Fabian Dellwing 520f6ac92a man+tail: Bring the manpage of tail up to date 2024-04-05 15:30:41 -06:00
Fabian Dellwing e511c553a8 tail: Implement byte mode into tail
This works exactly the same as with lines but with bytes instead.
2024-04-05 15:30:41 -06:00
Fabian Dellwing 91e944d793 tail: Choose correct line to output from
Previously we did not match the behaviour of coreutils in our from
start modus and some edge cases with 0 and 1 lines were broken.
2024-04-05 15:30:41 -06:00
stelar7 7c7f01b82f LibWeb: Add RSAOAEP.exportKey for the pkcs8 format 2024-04-05 21:53:12 +02:00
stelar7 b3e112fa51 LibCrypto: Fix off-by-one error when bit count is a multiple of 256 2024-04-05 21:53:12 +02:00
stelar7 f9dd028119 LibWeb: Add RSAOAEP.exportKey for the spki format 2024-04-05 21:53:12 +02:00
Idan Horowitz 1fd6673f87 LibJSGCVerifier: Support building & running with the Lagom build 2024-04-05 21:49:13 +02:00
Nico Weber 2d4964b945 LibGfx/JBIG2: Support custom adaptive template pixels in refinement
The implementation is very similar to #23831.

I created the test exactly like in #23713, except that I replaced the
last four lines in the ini file with:

```
-txt -Param -rATX1 10
-txt -Param -rATY1 -1
-txt -Param -rATX2 4
-txt -Param -rATY2 15
```
2024-04-05 21:32:18 +02:00
Nico Weber 154d0bb458 LibGfx/JBIG2: Extract check_valid_adaptive_template_pixel()
No behavior change.
2024-04-05 21:32:18 +02:00
Nico Weber 200e36aad3 Tests/JBIG2: Remove test_jbig2_size
It's redundant with test_jbig2_decode nowadays.
2024-04-05 21:32:18 +02:00
Aliaksandr Kalenik 188775c4e3 LibWeb: Add a test for history.pushState() that uses setTimeout() 2024-04-05 21:28:41 +02:00
Aliaksandr Kalenik 4ca715d2ef LibWeb: Skip SHTQ processing if ongoing task form queue is not finished
Fixes a bug when session history traversal queue task could be
interrupted by another SHTQ task execution. For example:
1. SHTQ timer callback starts executing a task from the queue.
2. spin_until() is invoked during task execution.
3. SHTQ timer callback starts executing a task from the queue.
2024-04-05 21:28:41 +02:00
Aliaksandr Kalenik 00531573a4 LibWeb: Remove SessionHistoryTraversalQueue::process()
...because existance of this method conflicts with the purpose of
having a queue as it allows to start executing next task in the middle
of ongoing task.

For example:

1. SHTQ timer starts executing a task.
2. Task does SHTQ::process().

Another example:

1. SHTQ::process() start executing a task.
2. task does SHTQ::process().
2024-04-05 21:28:41 +02:00
Aliaksandr Kalenik 11011cf250 LibWeb: Don't rely on SHTQ::process() in process_the_iframe_attributes
`HTMLIFrameElement::inserted()` does following:
1. Init a new navigable. This step appends a task on session history
   traversal queue (SHTQ) that creates a new nested history.
2. Process iframe's attributes

Processing of iframe's attributes might result in synchronous
navigation that fails to get active SHE if SHTQ task that creates
new nested history is not yet completed.

Before this change, a workaround involved forcing the processing of
SHTQ, which was terrible hack because it could occur in the middle of
another SHTQ task.

This change removes the need for "force SHTQ processing" by ensuring
that the processing of iframe's attributes is always executed after
the iframe's navigable nested history has been created.
2024-04-05 21:28:41 +02:00
Aliaksandr Kalenik 8cc2ee34db LibWeb: Check if entryToReplace is contained in session history entries
This small hack will allow us to get rid of "force processing of
session history traversal queue" which is significantly more cumbersome
hack.
2024-04-05 21:28:41 +02:00
Aliaksandr Kalenik adcc3905e5 LibWeb: Pass SynchronousNavigation flag into "apply the history step"
Workaround spec bug by explicitly carrying information whether
navigation is sync (History api, fragment change) or not.

See for more details https://github.com/whatwg/html/issues/10232
2024-04-05 21:28:41 +02:00
Andreas Kling 93ba99f14a LibWeb/WebAssembly: Add missing visit of WebAssembly::Memory::m_buffer 2024-04-05 16:22:54 +02:00
Shannon Booth aab5d4e6f9 LibCore: Prevent SIGPIPE on Sockets by default
While this is the default for an underlying socket, it doesn't seem good
to have this as the default for our socket wrapper.

This fixes a crash in ladybird when connecting to the python HTTP server
with HTTPS.
2024-04-05 16:02:46 +02:00
Timothy Flynn f3053f1d01 Ladybird/Qt: Add a "new tab" button to the Qt chrome
This adds a button on the right side of the location bar to create a new
tab.

Ideally, we would actually use QTabWidget::setCornerWidget to put this
button in the tab bar. But it is surprisingly difficult to make that
look nice on all platforms. Even if we ignore macOS, the CSS to make the
button look right on KDE Plasma may not work well on Gnome. So for now,
this location next to the location bar is horizontally the same that it
would be in the tab bar at least.
2024-04-05 15:27:29 +02:00
Timothy Flynn 795efea64f Ladybird/Qt: Close the browser when the last tab's close button is used
We currently do this already when the last tab is closed via the ctrl-W
shortcut. Move the logic for this to BrowserWindow::close_tab so that we
also close the window when the tab is closed via its close button.
2024-04-05 15:27:29 +02:00
Aliaksandr Kalenik db31fa730a LibWeb: Increase completed jobs number even if navigable is destroyed
...otherwise spin_until() will stuck waiting.
2024-04-05 08:15:07 +02:00
Aliaksandr Kalenik aefed21927 LibWeb: Add missing set_delaying_load_events(false) in navigate()
If navigation early returns before reaching "finalize a cross document
navigation" then we have to make sure delaying load events is disabled.

See spec issue https://github.com/whatwg/html/issues/10252
2024-04-05 08:15:07 +02:00
Andreas Kling b2a099e647 LibWeb: Don't leak entire realm after parsing CSS @supports rule
Before this change, every CSS @supports rule would keep the containing
JS realm alive via a JS::Handle. This led to a GC reference cycle and
the whole realm leaked.

Since we only need the realm at construction time, we can take it as a
parameter instead, and stop storing it.
2024-04-05 08:14:19 +02:00
Andreas Kling 2ef37c0b06 LibWeb: Make EventLoop, TaskQueue, and Task GC-allocated
...and use HeapFunction instead of SafeFunction for task steps.

Since there is only one EventLoop per process, it lives as a global
handle in the VM custom data.

This makes it much easier to reason about lifetimes of tasks, task
steps, and random stuff captured by them.
2024-04-05 08:14:19 +02:00