Commit graph

62918 commits

Author SHA1 Message Date
simonkrauter
54066ec5a4 LibWeb: Use absolute padding box to calculate max scroll offset
In `PaintableBox::set_scroll_offset()` the scrollport size was measured
by `content_size()` instead of `absolute_padding_box_rect()`.

Fixes #788
2024-07-23 17:59:17 +02:00
sideshowbarker
1d03944a9c CI: Make notes-push workflow return zero even when “git push” fails
It’s possible but unlikely that a push of generated notes back to the
remote can fail with a message like

> [remote rejected] ... cannot > lock ref 'refs/notes/commits': is at
> f3648f50bb but expected 47686bf473

See https://github.com/LadybirdBrowser/ladybird/actions/runs/10054314539

So this change makes the call to “git push” for notes not return 0 even
if it fails — because it’s not actually a fatal error when it happens,
and not something we need to stop and fix. Instead, it fixes itself.

Specifically: If one CI job for a PR merge/push to master generates
some notes but fails to push them to the origin, the notes don’t get
dropped on the floor and lost.

Instead, the notes-generator tool looks at the entire history; and if it
finds commits that don’t have notes — even if those commits are not part
of the PR push/merge it’s operating on — it generates notes for those.

In other words, if notes for one PR push/job fail for some reason to get
pushed back to the remote, they get regenerated by the next PR push/job.
2024-07-23 11:47:55 +02:00
Andreas Kling
14beda00c9 LibJS: Rename Value::typeof() to Value::typeof_()
This to avoid clashing with the GCC typeof extension, which apparently
confuses clang-format.
2024-07-23 11:47:37 +02:00
Andreas Kling
d0b11af387 LibJS: Make typeof a lot faster by caching all possible results
The typeof operator has a very small set of possible resulting strings,
so let's make it much faster by caching those strings on the VM.

~8x speed-up on this microbenchmark:

    for (let i = 0; i < 10_000_000; ++i) {
        typeof i;
    }
2024-07-23 11:47:37 +02:00
Andreas Kling
3b7534b362 LibWeb: Use correct scope when removing style sheet inside a shadow tree
Before this change, removing a style element from inside a shadow tree
would cause it to be unregistered with the document-level list of sheets
instead of the shadow-root-level list.

This would eventually lead to a verification failure if someone tried to
update the text contents of that style element, since it was still in
the shadow-root-level list, but now with a null owner element.

Fixes a crash on https://www.swedbank.se/
2024-07-23 11:12:18 +02:00
Andreas Kling
ebacb921da LibWeb: Verify something was removed in StyleSheetList::remove_sheet()
This would have saved me an hour of debugging, so putting it here for
the next person. :^)
2024-07-23 11:12:18 +02:00
Jamie Mansfield
835986de7b LibWeb/WebGL: Stub missing properties in WebGLRenderingContextBase 2024-07-23 09:04:57 +02:00
Timothy Flynn
d58a8b5146 LibWebView+UI: Raise the chrome process open file limit
The default limit (at least on Linux) causes us to run out of file
descriptors at around 15 tabs. Increase this limit to 8k. This is a
rather arbitrary number, but matches the limit set by Chrome.
2024-07-23 09:04:42 +02:00
Timothy Flynn
4451b4fda0 LibCore: Log errors from pipe2 when creating an event loop 2024-07-23 09:04:42 +02:00
Timothy Flynn
0d6115e8ae LibCore: Add system call wrappers around getrlimit and setrlimit 2024-07-23 09:04:42 +02:00
bbb651
7b10eb7225 LibWeb: Add new expected window properties to test
Adds `AudioBufferSourceNode` and `BiquadFilterNode` to the
all-window-properties test.
2024-07-23 09:02:43 +02:00
bbb651
64663d53fa WebAudio: Stub BiquadFilterNode 2024-07-23 09:02:43 +02:00
bbb651
6672fb4b47 WebAudio: Stub AudioBufferSourceNode 2024-07-23 09:02:43 +02:00
Kenneth Myhra
92f6336fe8 Tests/LibWeb: Move existing Fetch tests in under the Fetch folder 2024-07-23 09:02:21 +02:00
Kenneth Myhra
b8fa572c67 LibWeb: Implement formData() method steps for x-www-form-urlencoded
The Response interface of the Fetch API can now parse form urlencoded
bodies when Content-Type is set to 'application/x-www-form-urlencoded'.
2024-07-23 09:02:21 +02:00
Aliaksandr Kalenik
7047fcf761 LibWeb: Separate paint-only property resolution by paintable type
Having resolution of all properties for all paintable types in a single
function was hard to iterate on, so this change separates it into
smaller functions per paintable type.
2024-07-23 09:00:48 +02:00
Lucas CHOLLET
aba435a652 LibGfx/JPEGXL: Add support for animated images 2024-07-23 08:59:34 +02:00
Lucas CHOLLET
d9a2c62ed4 LibGfx/JPEGXL: Make JPEGXLLoadingContext non [copy,move]able 2024-07-23 08:59:34 +02:00
Timothy Flynn
b659b62dec Documentation: Add pkg-config to Debian dependencies 2024-07-23 08:59:05 +02:00
Timothy Flynn
40a617dbab CI: Remove a couple unneeded system dependencies
libqt6svg6-dev - We don't use Qt's SVG support any longer.

qt6-multimedia-dev - We already install libpulse-dev, so the Qt6
multimedia package is unused.
2024-07-23 08:59:05 +02:00
Timothy Flynn
61da7d2213 Documentation: Recommend installing PulseAudio on Debian by default 2024-07-23 08:59:05 +02:00
Timothy Flynn
5b38057802 CI+Documentation: Alphabetically sort system dependencies 2024-07-23 08:59:05 +02:00
Tim Ledbetter
bd1213d0c5 LibWeb: Return a NodeList from document.getElementsByName()
This aligns our implementation with the specification.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
e40352b6b5 LibWeb: Ensure document.getElementsByName("") returns no elements
Previously, if a document had any element with a name attribute that
was  set to the empty string, then `document.getElementsByName("")` and
`element.getElementsByName("")` would return a collection including
those elements.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
0fceede029 LibWeb: Ensure document.getElementsByClassName("") returns no elements
Previously, `document.getElementsByClassName("")` would return a
collection containing all elements in the given document.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
faf64bfb41 LibWeb: Move get_elements_by_name implementation to ParentNode
Previously, we had two implementations of the same function in
`Document` and `Element`, which had inadvertantly diverged.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
f666d967d6 LibWeb: Ensure document.getElementById("") returns null
Previously, if a document had an element whose id was the empty string,
then `document.getElementById("")` and `element.getElementById("")`
would return that element.
2024-07-23 08:58:22 +02:00
Ali Mohammad Pur
18499c4eac RequestServer: Make the ThreadPool global
Previously we made one thread pool per ipc client, which is excessive
and can eat up all the available fds very fast.
Fixes #760.
2024-07-23 08:56:59 +02:00
Tim Ledbetter
c396054c87 Meta: Update mailmap with my new ladybird.org email address 2024-07-22 23:01:57 +01:00
Jamie Mansfield
01ff3d4286 Ladybird/Qt: Add missing filters for TVG icons
Ladybird now uses the correct theme colours when hovering over icons.
2024-07-22 12:59:36 -04:00
Andrew Kaster
989b4ac127 CMake: Ensure that dependency targets are built before AppKit UI files 2024-07-22 09:31:22 -06:00
Aliaksandr Kalenik
2ead999f2b LibGfx+LibWeb: Remove typeface classes for WOFF fonts
This change removes wrappers inherited from Gfx::Typeface for WOFF and
WOFF2 fonts. The only purpose they served is owning of ttf ByteBuffer
produced by decoding a WOFF/WOFF2 font. Now new FontData class is
responsible for holding ByteBuffer when a font is constructed from
non-externally owned memory.
2024-07-22 15:05:04 +02:00
mobounya
2497f43989 LibWeb: Update update_for_history_step_application
Update 'update_for_history_step_application' to meet some of the specs
introduced in https://github.com/whatwg/html/pull/9856 and in
https://github.com/whatwg/html/pull/9990
2024-07-22 10:39:46 +02:00
Lucas CHOLLET
1039561280 LibGfx: Use libjxl to decode JPEG XL images
It currently doesn't support animated image.

Note that Gfx::Bitmap has no support for get_pixel when the format is
RGBA8888. This is why it has been removed from the tests.
2024-07-22 09:15:16 +02:00
Tim Ledbetter
d417b75683 LibWeb/SVG: Ensure SVG transform has an inverse before using it
This avoids a crash that occurred when calling `getBBox()` on an SVG
element that had a transform with no inverse.

Found by Domato.
2024-07-22 09:13:25 +02:00
Tim Ledbetter
4cdafea363 LibWeb: Don't crash when SVG viewbox has a width of 0
Previously, `SVGSVGBox` would have a natural aspect ratio of 0 if it
had a viewbox with zero width. This led to a division by zero, causing
a crash.

Found by Domato.
2024-07-22 09:13:25 +02:00
Tim Ledbetter
604f6040a1 LibWeb: Clamp paintable box maximum scroll offset to 0
Previously calling `PaintableBox::set_scroll_offset()` with a
PaintableBox whose content size was larger than its scrollble overflow
rect would cause a crash.

Found by Domato.
2024-07-22 09:13:25 +02:00
Olekoop
6b88e43b3b LibAudio: Implement PlaybackStream for Android using Oboe
https://github.com/google/oboe

There are many ways to implement audio for Android, however this is
the recommended way to do it.
2024-07-21 16:09:36 -06:00
lmutter
abddd0ac1b UI/Qt: Move New Tab button in tab bar 2024-07-21 16:04:12 -06:00
circl
37f93e4be1 LibWeb: Replace templated retarget function with a regular one
The templating is not necessary anywhere and was effectively just a cast
2024-07-21 16:01:32 -06:00
circl
3adfdd3257 UI: Rename s_serenity_resource_root to s_ladybird_resource_root 2024-07-21 15:59:25 -06:00
Andrew Kaster
922c6bde87 CMake: Enable policy 0157 for more control over Swift compile mode 2024-07-21 15:55:47 -06:00
Andrew Kaster
68ce5f8290 Ladybird/AppKit: Port TaskManager window to Swift
This is just a direct port of the Objective-C++ code to Swift 6.
A future patch should probably update it to actually use SwiftUI.
2024-07-21 15:55:47 -06:00
Andrew Kaster
4066ce2c7e CMake: Ensure C/C++ compile options only applied when compiling C/C++ 2024-07-21 15:55:47 -06:00
Holger Hans Peter Freyther
02ba51f203 LibWeb/DOM: Avoid repeated calls to Node::navigable
Minor optimization to avoid looking up the navigable during a
layout operation.
2024-07-21 21:53:43 +02:00
Timothy Flynn
74d644a216 AK: Explicitly check for null data in Utf16View
The underlying CPU-specific instructions for operating on UTF-16 strings
behave differently for null inputs. Add an explicit check for this state
for consistency.
2024-07-21 19:57:07 +02:00
Timothy Flynn
144452d638 AK: Explicitly check for null data in Utf8View
The underlying CPU-specific instructions for operating on UTF-8 strings
behave differently for null inputs. Add an explicit check for this state
for consistency.
2024-07-21 19:57:07 +02:00
Edwin Hoksberg
ac6126e263 LibWeb: Support percentage values in SVG line element 2024-07-21 19:56:38 +02:00
Edwin Hoksberg
356bddbdbb LibWeb: Support percentage values in SVG text positioning element 2024-07-21 19:56:38 +02:00
Timothy Flynn
4795b9206c LibWebView: Prevent displaying two scroll bars in the inspector console
We currently display scroll bars for the JS console and its parent tab
container. We want the console output to be separately scrollable from
the tab content, but since both containers are scrollable, we end up
with nested scroll bars. This also makes actually scrolling feel pretty
awkward.

Prevent this by making the tab container non-scrollable when the JS
console is shown.
2024-07-21 19:31:35 +02:00