Commit Graph

34172 Commits

Author SHA1 Message Date
Daniel Bertalan
947606afcf LibGfx: Do not draw U+FFFD for unknown glyphs
The Replacement Character (U+FFFD) is most commonly used to signal a
text encoding error, i.e. when a stream of bytes couldn't be converted
to a sequence of code points. For glyphs that don't exist in a
particular font, our rendering logic already does the right thing by
drawing empty boxes (`.notdef`); let's not forcibly turn these into
U+FFFD during rendering.
2024-07-05 13:42:07 +02:00
Jamie Mansfield
0a3082ef05 LibWeb: Add missing edge visit for TextTrack in HTMLTrackElement 2024-07-05 09:17:01 +02:00
matjojo
b7e505365c LibWeb: Save float-intrusion for marker before list elements layout
... to prevent that left-floating elements inside the list element
push the list marker into the (non-floating) content of the list
element.
2024-07-05 07:31:42 +02:00
Tim Ledbetter
66662496e6 LibWeb: Remove ResourceLoader::emit_signpost()
This was only ever used within SerenityOS. The current implementation
of this method did nothing.
2024-07-05 07:15:44 +02:00
Jamie Mansfield
67e3ac8916 LibWeb/HTML: Stub TextTrack IDL interface 2024-07-05 07:15:04 +02:00
Luke Warlow
a9669639ce LibWeb: Implement popover property and attribute
The popover property now reflects the attribute.

It cannot currently use the Reflect IDL concept because the empty string
value is special cased.
2024-07-05 07:14:50 +02:00
Jamie Mansfield
197f57f5d2 Ladybird/Qt: Add actions to set navigator compatibility mode 2024-07-05 07:14:03 +02:00
Jamie Mansfield
1128375dff LibWeb: Support Gecko and WebKit navigator compatibility modes
This will log a debug message when calls are made to the
NavigatorIDMixin that make decisions based on the compatibility mode.
2024-07-05 07:14:03 +02:00
Aliaksandr Kalenik
e713de115c LibWeb+LibCore: Use Vulkan backend for Skia on Linux
Skia now uses GPU-accelerated painting on Linux if Vulkan is available.
Most of the performance gain is currently negated by reading the GPU
backend back into RAM to pass it to the Browser process. In the future,
this could be improved by sharing GPU-allocated memory across the
Browser and WebContent processes.
2024-07-05 07:13:13 +02:00
Aliaksandr Kalenik
70db2bff92 LibWeb: Do not create Metal context when Skia painter is not enabled 2024-07-05 07:13:13 +02:00
rmg-x
ae983a2ef7 LibWeb: Add log_filtered_request() method in ResourceLoader
This will reduce log noise when visiting sites
that have a lot of filtered content.

Previously, red error text would be displayed in
the logs for each filtered URL.
2024-07-04 21:45:30 +01:00
Diego
fce8ed1563 LibWasm: Validate potentially empty else branch in if instruction 2024-07-04 21:47:07 +02:00
Braydn
24adb1c452 LibWeb: Add Web Worker Origin Inheritance
Fetch requests from web workers fail CORS checks because the origin is
not inherited from the outside settings. Ensure web worker origin is
correctly inherited from outside settings
2024-07-04 11:43:25 -06:00
Dennis Camera
176e3ba16a LibCrypto: Use ARM C Language Extensions (ACLE) for CRC32 intrinsics
The __builtin_arm_* intrinsics don't exist on all ARMv8 systems.
Use the standardized ACLE intrinsics, instead.
2024-07-04 16:53:13 +02:00
Jamie Mansfield
61e616c974 LibWeb: Implement Navigator.doNotTrack 2024-07-04 16:42:34 +02:00
Jamie Mansfield
fb20326979 LibWeb: Support sending DNT header with requests 2024-07-04 16:42:34 +02:00
Aliaksandr Kalenik
830b287c46 Everywhere: Remove GPU painter and AccelGfx
GPU painter that uses AccelGfx is slower and way less complete compared
to both default Gfx::Painter and Skia painter. It does not make much
sense to keep it, considering Skia painter already uses Metal backend on
macOS by default and there is an option to enable GPU-accelerated
backend on linux.
2024-07-04 14:47:02 +02:00
Bastiaan van der Plaat
c81a640f3e LibWeb/CSS: Serialize transform scale percentage values as numbers 2024-07-04 14:41:35 +02:00
Tim Ledbetter
34741d09c6 LibWeb: Update Range::set_base_and_extent() to the latest spec text
This allows it to work with content inside shadow roots.
2024-07-04 14:38:56 +02:00
Tim Ledbetter
e5d1261640 LibWeb: Don't update selection if start and end node roots differ
This allows selection to work within shadow roots and prevents the
selection being cleared if the mouse moves outside of the current
document or shadow root.
2024-07-04 14:38:56 +02:00
circl
ceb9c3b797 LibWeb+UI: Add tooltip overriding and use it for <video> tags
This call is used to inform the chrome that it should display a tooltip
now and avoid any hovering timers. This is used by <video> tags to
display the volume percentage when it is changed.
2024-07-04 14:15:51 +02:00
circl
0f7623dd83 LibWeb+UI/Qt: Display 'title' tooltips only when the mouse stops moving
Now instead of sending the position in which the user entered the
tooltip area, send just the text, and let the chrome figure out how to
display it.

In the case of Qt, wait for 600 milliseconds of no mouse movement, then
display it under the mouse cursor.
2024-07-04 14:15:51 +02:00
Luke Warlow
6623177265 LibWeb: Implement support for scrollbar-gutter
This property is now correctly parsed.

Ladybird always uses overlay scrollbars so this property does nothing.
2024-07-04 13:22:40 +02:00
Tim Ledbetter
e76ad9492e LibWeb: Elide boundary checks when constructing find in page ranges
Previously, unnecessary boundary checks were being done when
constructing the range objects used to represent find in page matches.
These checks are no longer performed leading to a significant speedup
when performing find in page queries on pages containing a lot of text.
2024-07-03 15:35:14 +02:00
Tim Ledbetter
156c1083e9 LibWeb: Cache text blocks used by find in page
The first step of the find in page algorithm is to walk the layout tree
of each document on the page and construct a list of strings against
which to search for matches.

Previously, this was being done for each new query, even when the
page content hadn't been updated. The output of this process is now
cached in the viewport node of the associated document. This ensures
that this process is no longer repeated unnceessarily.
2024-07-03 15:35:14 +02:00
Victor Tran
31698281b6 LibWeb: Stop deadlocking on unit tests
Unit tests on macOS deadlock because the WebContent process is waiting
for the next opportunity to render before a screenshot is taken. For
some reason unknown to myself, this opportunity never arrives. In
order to not deadlock, screenshot requests are now also processed
separately from rendering.
2024-07-03 15:01:03 +02:00
Samuel Eisenhandler
7de669dc07 LibWebView: Append remaining source after consuming all tokens
Since "Character" tokens do not have an "end position", viewing source
drops the source contents following the final non-"Character" token.

By handling the EOF token and breaking out of the loop, we avoid this
issue.
2024-07-03 08:59:53 -04:00
Aliaksandr Kalenik
72b4d44d07 LibWeb: Reschedule HTML event loop processing if navigable needs repaint
This is an attempt to fix the hanging CI on macOS caused by some
screenshot requests being stuck unprocessed. With this change, we at
least make sure that the HTML event loop processing, which triggers
repainting, will happen as long as there are navigables that need to be
repainted.
2024-07-02 20:33:45 +02:00
doctortheemh
5f06594bbd LibCore: Include full definition for LocalSocket
clang 19 (git) complains that LocalSocket is an incomplete type
and errors out. Including the full definition fixes the build.
2024-07-02 10:27:45 +02:00
Bastiaan van der Plaat
bff6c0680a LibWeb/Geometry: Make DOMRect doubles unrestricted 2024-07-01 21:30:52 +01:00
Andrew Kaster
55c1b5d1f4 LibWeb: Use double as the argument for AnimationFrameCallbacks
This avoids an unecessary lossy conversion for the current time from
double to i32. And avoids an UBSAN failure on macOS that's dependent
on the current uptime.
2024-07-01 14:29:45 -06:00
Aliaksandr Kalenik
bce7b24cfb LibWeb: Fix painting of paths with storke-width=0 in Skia painter
From SkPaint.h:
"Sets the thickness of the pen used by the paint to outline the shape.
A stroke-width of zero is treated as "hairline" width. Hairlines are
always exactly one pixel wide in device space (their thickness does not
change as the canvas is scaled)."

While we expect stroke-width=0 to simply not be painted.
2024-07-01 18:17:08 +02:00
Aliaksandr Kalenik
877adcc021 LibWeb: Use CornerRadii struct in FillRectWithRoundedCorners command
This makes it consistent with other commands.
2024-07-01 18:17:08 +02:00
Aliaksandr Kalenik
eba33b964e LibWeb: Remove unneeded Web namespace usage in TraversableNavigable.cpp 2024-07-01 18:17:08 +02:00
Aliaksandr Kalenik
3f97f73316 LibWeb: Add m_ prefix to surface member in SkiaSurface 2024-07-01 18:17:08 +02:00
Aliaksandr Kalenik
330d5996ed LibWeb: Fix Skia painter to close paths more correctly
Start point was incorrectly passed into `close_subpath_if_needed()` as
end point, which led to all subpaths being closed.
2024-07-01 18:17:08 +02:00
Andrew Kaster
29b4f21c7b WebContent: Add shutdown_server IPC call to request process exit
This ensures that removing the last view from a WebContentClient will
close its associated process, assuming the WebContent process is not
hung. A more drastic measure will be needed to trigger forcefully
killing the process when it doesn't respond to this request.
2024-07-01 18:10:56 +02:00
Andrew Kaster
4cc3d598f9 LibWebView+LibCore: Manage process lifecycle using a SIGCHLD handler
This large commit also refactors LibWebView's process handling to use
a top-level Application class that uses a new WebView::Process class to
encapsulate the IPC-centric nature of each helper process.
2024-07-01 18:10:56 +02:00
Andrew Kaster
3dea602d92 LibProtocol: Don't crash when RequestServer exits 2024-07-01 18:10:56 +02:00
Ali Mohammad Pur
a4eb46fcca LibWasm/WASI: Don't convert enums and u8s into i64
Doing so results in incorrect values being created, ultimately leading
to traps or errors.

(cherry picked from commit f6c3b333334f7bb5314a844804cb259cf277005e)
2024-07-01 00:05:21 +02:00
Aliaksandr Kalenik
7181c3f2ea Everywhere: Limit layout text fragments to use one font for all glyphs
The ChunkIterator now limits a chunk to using only one font (before, it
was possible to have a chunk with >1 font, when `unicode-range` CSS
property is used).

This change allows us to reduce some complexity in the text shaping and
painting code and makes us compatible with the APIs in Skia and
HarfBuzz.
2024-06-30 19:23:24 +02:00
Aliaksandr Kalenik
d5926a3231 LibGfx+LibWeb: Rename Gfx::VectorFont to Gfx::Typeface
Typeface is a more widely used name for the data represented by
class previously named VectorFont.

Now:
- Typeface represents decoded font that is not ready for rendering
- ScaledFont represents the combination of typeface and size for
  rendering
2024-06-30 13:09:23 +02:00
Aliaksandr Kalenik
e2726ce8e4 LibGfx+LibWeb: Remove Gfx::Typeface
...and use VectorFont directly in FontDatabase.
2024-06-30 13:09:23 +02:00
Tim Ledbetter
bdaa7f0e8e LibWeb: Implement the HTMLTrackElement.kind attribute
This reflects the HTML `kind` attribute.
2024-06-30 13:08:42 +02:00
Aliaksandr Kalenik
4cdc5d2ce9 LibWeb: Add text shadows support in Skia painter 2024-06-28 20:53:39 +02:00
Aliaksandr Kalenik
b27cf1be49 LibWeb: Remove fragment_baseline from PaintTextShadow
Translate text_rect instead, so the struct doesn't have to carry
additional member.
2024-06-28 20:53:39 +02:00
Aliaksandr Kalenik
ebc282207b LibWeb: Save unscaled glyph run in PaintTextShadow command
Implements the same optimization we already have for DrawGlyphRun by
saving unscaled glyph run and scale factor in a painting command, which
allows to avoid copying of glyphs vector to apply scaling during
recording.
2024-06-28 20:53:39 +02:00
Timothy Flynn
6369737676 LibWeb: Ensure SkiaSurface is fully defined before it is allocated
LLVM 18 on macOS correctly errs when we try to allocate an incomplete
SkiaSurface object.
2024-06-28 12:59:10 -04:00
Andreas Kling
cf0912c700 LibIPC: Remove unused AK::Formatter for IPC::Connection 2024-06-28 17:11:24 +02:00
Andreas Kling
4fe21e6d87 LibIPC: Move stuff from Connection.h to .cpp and reduce #include count 2024-06-28 17:11:24 +02:00