Commit Graph

60240 Commits

Author SHA1 Message Date
MacDue
a6a40a5bc6 LibWeb: Stub out SVGTransform 2024-04-01 21:10:35 +02:00
Nico Weber
ce11a34fc6 Tests/LibGfx: Add a jbig2 test for transposed text segments
See the PR adding this test for local changes to `jbig2`.
I used the shell script mentioned in #23659, except I added the line
`-txt -Param -Transposed 1` at the very end of the .ini file.

As with all the symbol test cases, after running

    Meta/jbig2_to_pdf.py -o foo.pdf foo.jb2 399 400

the file opens up ok in Chrome and Firefox (but not Safari), so
maybe it's not completely broken.
2024-04-01 14:41:17 +02:00
Nico Weber
b04569c1da LibGfx/JBIG2: Implement support for transposed text regions
Only the coordinates get transposed -- the bitmaps apparently don't.
And all the prose amounts to "if the transposed bit is set, swap
instance s and t coordinates before painting", as far as I can tell.

Makes pages 3/4 and 7/8 in 0001346.pdf render. (But here the feature
isn't used to render transposed text -- it just has stripes that keep s
roughy constant, which would normally produce vertical runs but here
produces regular horizontal runs. It's not clear to me why this feature
is used for these pages!)
2024-04-01 14:41:17 +02:00
Nico Weber
ca6ebedf58 LibGfx/JBIG2: Simplify non-transposed text region coordinate math
If the origin is on the right, we need to subtract width - 1 from s,
if it's on top bottom, we need to subtract height - 1 from t.

No behavior change.
2024-04-01 14:41:17 +02:00
Shannon Booth
851114e462 LibWeb/Tests: Add a basic set of tests for document.all 2024-04-01 14:41:00 +02:00
Shannon Booth
249ee0a30e LbiWeb: Return an HTMLAllCollection from document.all 2024-04-01 14:41:00 +02:00
Shannon Booth
1f59e21829 LibWeb: Implement HTMLAllCollection
This collection has some pretty strange behaviour, particularly with the
IsHTMLDDA slot which is defined in the javascript spec specifically for
this object.

This commit implements pretty much all of this interface, besides from
the custom [[Call]].

There is also no caching over this collection. Since it is a live
collection over the entire document, the performance is never going to
be great, and I am not convinced any speedup for this legacy interface
is worth a massive cache.
2024-04-01 14:41:00 +02:00
Shannon Booth
897f55ca8a LibWeb: Use NonnullGCPtr for HTMLCollection::collect_matching_elements
The pointers here can never be null, so lets engrain that into the type
for clarity.
2024-04-01 14:41:00 +02:00
Shannon Booth
e590e92399 LibWeb: Add HTMLCollection as a platform object
It is returned by the IDL of HTMLAllCollection.
2024-04-01 14:41:00 +02:00
Shannon Booth
713d8dc0f8 LibJS: Add support for constructing a PropertyKey from a FlyString 2024-04-01 14:41:00 +02:00
Shannon Booth
8fa0730b84 LibWeb: Remove resolved FIXME about caching in HTMLCollection 2024-04-01 14:41:00 +02:00
Aliaksandr Kalenik
9098fa23a2 LibWeb: Catch up with the spec on document destroy, abort and unload
These changes do not solve hanging `location.reload()` and
`location.go()` but only align implementation with the latest edits in
the specification.

`WindowProxy-Get-after-detaching-from-browsing-context` test output is
affected because `iframe.remove();` no longer synchronously does
destruction of a document, but queues a task on event loop.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-04-01 13:23:58 +02:00
Nico Weber
43752a1ff8 LibGfx/JBIG2: Remove a now-unneeded void cast
We've been reading `segment_page_association_size_is_32_bits` a bit
further down for a while now.

No behavior change.
2024-04-01 08:27:10 +01:00
Timothy Flynn
9af8c61b29 Ports: Update ports that depend on LibCore to depend on LibCoreMinimal
Looks like we need to be explicit for make-based ports.
2024-03-31 19:22:32 +02:00
Timothy Flynn
dd54780d5e Ladybird/Qt: Place the tab audio state button on the right on macOS
On macOS, the "close tab" button is on the left, so we should place the
audio state button on the right to avoid conflict. Rather than an OS
ifdef, we do this by detecting if the left side is occupied.
2024-03-31 14:29:17 +02:00
Timothy Flynn
3e659b10f0 Ladybird/Qt: Reference the correct tab when handling the audio icon
We were errantly always referring to the active tab when the audio play
state changed, and when clicking a tab's audio state button, by way of
BrowserWindow::view().

It turns out we also can't copy / rely on the tab index provided to the
signal in any asynchronous context. If the tabs are rearranged, so are
their indices. Instead, capture a pointer to the tab of interest - this
should be safe as we wouldn't be able to click a tab's audio button if
that tab no longer exists.

With this change, we can click the audio button from any tab in the Qt
chrome, and re-arrange tabs at will. The AppKit and Serenity chromes do
not have this issue.
2024-03-31 14:29:17 +02:00
MacDue
06ed56f4f6 LibWeb: Paint SVGDecodedImageData via Navigable::paint()
Going via the `ViewportPaintable` missed some steps (in particular
computing clip rects), which meant nested SVGs within SVGs-as-images
were completely clipped.
2024-03-30 21:35:22 +01:00
Kenneth Myhra
4b66f5662b LibWeb: Correct spec steps for serializable objects
This aligns us with the current spec steps for serializable objects in
StructuredSerializeInternal.
2024-03-30 21:26:37 +01:00
Shannon Booth
9dc2b0bba3 LibWeb: Add a basic test for [EnforceRange]
This is a basic test - but does cover the two bugs in the previous
two commits.
2024-03-30 21:21:23 +01:00
Shannon Booth
7abedd2fed LibWasm: Fix reference-to-stack-local from {Memory,Table}Instance
Allocating a MemoryInstance or TableInstance from Store would result in
a reference to a stack allocated {Memory,Table}Type that would
immediately fall out of scope.

The MemoryInstance case was causing ASAN issues for a LibWeb based test
- I don't have a reproducer for TableInstance, but it looks like it
suffers from the exact same problem.
2024-03-30 21:21:23 +01:00
Shannon Booth
d725076c7f LibWeb: Fix a silly mistake for bitLength 64 in conversion to int
Which was resulting in 32 bit numbers getting the max array like
index instead of 64 bit numbers!
2024-03-30 21:21:23 +01:00
Shannon Booth
a09849072e LibWeb: Pass through [EnforceRange] and [Clamp] extended attributes
To the 'convert to int' AO. Nothing actually makes use of the [Clamp]
attribute yet in our implementation, but we may as well add support for
it now since it is trivial to do do.
2024-03-30 21:21:23 +01:00
Idan Horowitz
56b0066485 Meta: Remove explicit default library type for lagom libraries
This partially reverts d1e2d2a4, which made us explicitly specify the
library type for lagom libraries. This broke the fuzzer build, which
relies on the BUILD_SHARED_LIBS cmake variable to enable static builds.
2024-03-30 14:42:15 -04:00
Kenneth Myhra
40d62a4365 LibWeb: Add missing spec link for ImageData constructor 2024-03-30 19:29:14 +01:00
Kenneth Myhra
c17171b86c LibWeb: Add ImageData constructor with data 2024-03-30 19:29:14 +01:00
Kenneth Myhra
900a889eb1 LibWeb+LibIDL: Add support for overloading constructors 2024-03-30 19:29:14 +01:00
Kenneth Myhra
09779ab4a6 LibWeb: Add Uint8ClampedArray as supported parameter type
Adds Uint8ClampedArray as supported parameter type to our
BindingsGenerator.
2024-03-30 19:29:14 +01:00
Timothy Flynn
f374e64dfc Ladybird/AppKit: Display a tool tip on the tab mute button 2024-03-30 19:28:20 +01:00
Timothy Flynn
9e4ffbcf70 Ladybird/AppKit: Support muting an entire page
We already display a speaker icon on tabs which are playing audio. This
allows the user to click that icon to mute the tab, at which point the
icon is replaced with a muted speaker icon.

We would previously hide the icon when audio stopped playing. We now do
this only if the tab isn't muted. If it is muted, the muted speaker icon
remains on the tab so that the page isn't stuck in a muted state.
2024-03-30 19:28:20 +01:00
Timothy Flynn
0da5d5a0d0 Ladybird/Qt: Display a tool tip on the tab mute button 2024-03-30 19:28:20 +01:00
Timothy Flynn
45b03bf75d Ladybird/Qt: Support muting an entire page
We already display a speaker icon on tabs which are playing audio. This
allows the user to click that icon to mute the tab, at which point the
icon is replaced with a muted speaker icon.

We would previously hide the icon when audio stopped playing. We now do
this only if the tab isn't muted. If it is muted, the muted speaker icon
remains on the tab so that the page isn't stuck in a muted state.
2024-03-30 19:28:20 +01:00
Timothy Flynn
f61f55d397 LibWeb+LibWebView+WebContent: Support muting an entire page
This adds an IPC for chromes to mute a tab. When muted, we trigger an
internal volume change notification and indicate that the user agent has
overriden the media volume.
2024-03-30 19:28:20 +01:00
Timothy Flynn
7c31343df0 LibWeb: Store the ID of all media elements on a page
This will be used to inform the media elements when the user has muted
the page.
2024-03-30 19:28:20 +01:00
Timothy Flynn
9fc8c37414 LibWebView: Handle mutliple audio tracks when audio play state changes
For example, if a page has multiple audio elements all actively playing
audio, we don't want to broadcast a play state change when only one of
them stop playing.
2024-03-30 19:28:20 +01:00
Matthew Olsson
c7c7ed780b LibWeb: Make request-animation-frame-order test async
Even though this test worked fine, it does use requestAnimationFrame
callbacks, so lets make it async to ensure it doesn't timeout.
2024-03-30 19:26:58 +01:00
Matthew Olsson
328ad9a2f0 LibWeb: Use InternalAnimationTimeline in existing tests 2024-03-30 19:26:58 +01:00
Matthew Olsson
f0119a818b LibWeb: Add animation-effect method tests 2024-03-30 19:26:58 +01:00
Matthew Olsson
e298e8af5a LibWeb: Add some async/animation test utilities 2024-03-30 19:26:58 +01:00
Matthew Olsson
b2907f62a6 LibWeb: Reject invalid easing functions in AnimationEffect.updateTiming 2024-03-30 19:26:58 +01:00
Nico Weber
ab7da32d25 LibGfx/JPEG2000: Support jpx extended 'colr' boxes
The T.800 spec says there should only be one 'colr' box, but the
extended jpx file format spec in T.801 annex M allows having multiple.

Method 2 is a basic ICC profile, while method 3 (jpx-only) allows full
ICC profiles. Support that.

For the test, I opened buggie.png in Photoshop, converted it to
grayscale, and saved it as a JPEG2000, with "JP2 Compatible" checked
and "Include Transparency" unchecked. I also unchecked "Include
Metadata", and "Lossless". I left "Fast Mode" checked and the quality
at the default 50.
2024-03-30 10:01:07 +01:00
Nico Weber
3f740fc727 Tests/LibGfx: Add some ICC coverage for the JPEG2000 loader 2024-03-30 10:01:07 +01:00
Nico Weber
578f301017 LibGfx/ISOBMFF: Print box type if a box fails to consume all its data 2024-03-30 10:01:07 +01:00
Andreas Kling
f90489acd6 Revert "LibWeb: Fix endless spinning in apply_the_history_step()"
This reverts commit 609a72f7c7.
2024-03-30 08:28:16 +01:00
Andreas Kling
872fa58ef8 Revert "LibWeb: Fix hanging location.reload() when SHE is populated by fetching"
This reverts commit 966b042db6.
2024-03-30 08:28:05 +01:00
Andreas Kling
14f2012c8b LibWeb: Fix a bunch of bad stack captures in AudioContext
It's not safe to capture a local NonnullGCPtr by reference in a closure
that will execute at some arbitrary time in the future when the local is
out of scope.
2024-03-30 08:25:59 +01:00
Andreas Kling
6103884c18 LibWeb: Add some extra browsing context null checks
I saw a suspicious null dereference in
check_if_access_between_two_browsing_contexts_should_be_reported(),
but I have no idea how to reproduce it.

Still, it seems harmless to paper over it with a FIXME debug log.
2024-03-30 08:15:49 +01:00
MacDue
d2f971a919 LibXML: Don't emit a parser error for failing to resolve DTD URI
This prevented loading SVGs such as:
https://mdn.github.io/learning-area/html/multimedia-and-embedding/mdn-splash-page-finished/mdn.svg

Where the DTD is not in the hardcoded unified DTD in LibWeb. It also
prevented loading any SVG with a broken link for a DTD, which other
browsers just seem to ignore.
2024-03-30 07:36:50 +01:00
Aliaksandr Kalenik
966b042db6 LibWeb: Fix hanging location.reload() when SHE is populated by fetching
Adds a hack to address spec bug https://github.com/whatwg/html/issues/9869
2024-03-30 07:35:55 +01:00
Aliaksandr Kalenik
609a72f7c7 LibWeb: Fix endless spinning in apply_the_history_step()
While waiting for a task that populates a session history entry, we
can't limit the processing of the event loop to the
`NavigationAndTraversal` task source. This is because fetching uses the
`Networking` task source, which also needs to be processed.

Since making a fetch request might take some time, we want to process
everything on the event loop while waiting, to avoid blocking user
interactions.

It is still possible to use `spin_processing_tasks_with_source_until()`
on subsequent steps of `apply_the_history_step()`.

Also modifies test that was flaky.
2024-03-30 07:35:55 +01:00
Aliaksandr Kalenik
baf589deef LibWeb: Add missing navigable destroyed check 2024-03-30 07:35:55 +01:00