Commit graph

57377 commits

Author SHA1 Message Date
Shannon Booth
159eda5c6d AK: Add ByteString::to_number<T>
To mirror the API with StringView and String.
2023-12-23 20:41:07 +01:00
Shannon Booth
cdf84a3e36 AK: Implement StringView::to_number<T> from String::to_number<T>
Do exactly what String does, then use StringView's implementation as
String's new one. This should allow us to call to_number on a
StringView.
2023-12-23 20:41:07 +01:00
Nico Weber
b63eb4a4dd LibPDF: Implement /Mask support with stream object argument 2023-12-23 20:39:11 +01:00
Nico Weber
a3507ef65b LibPDF: Move error for /ImageMask out of load_image()
...and tweak load_image() to support loading mask images
(which don't have a color space and are always 1 bit per pixel).
2023-12-23 20:39:11 +01:00
Nico Weber
3ad9782e25 LibPDF: Extract a apply_alpha_channel() function
No behavior change.
2023-12-23 20:39:11 +01:00
Nico Weber
4bd11c8eb4 LibPDF: Show a 'rendering unsupported' error for images with /Mask key 2023-12-23 20:39:11 +01:00
Timothy Flynn
7d2172ff3d LibLocale: Update to CLDR version 44.1.0
https://cldr.unicode.org/index/downloads/cldr-44#h.nvqx283jwsx
2023-12-23 20:05:36 +01:00
Timothy Flynn
ef6d1dbd4d Meta: Port recent changes to the GN build
5e1499d104
36f0499cc8
64912d4d02
809c5b0b03
2023-12-23 20:05:36 +01:00
Timothy Flynn
7233d5ed3e Meta: Alphabetically sort IDL files in the GN build 2023-12-23 20:05:36 +01:00
Timothy Flynn
697bb27c97 LibTimeZone: Update to TZDB version 2023d
https://mm.icann.org/pipermail/tz-announce/2023-December/000080.html
2023-12-23 20:05:16 +01:00
Nico Weber
80359517bd LibGfx: Do not use double negation in TIFFGenerator.py
No behavior change.
2023-12-23 12:25:08 -05:00
Bastiaan van der Plaat
c30911ab10 LibWeb: Hide select chevron icon when appearance: none; 2023-12-23 10:12:36 +01:00
Bastiaan van der Plaat
29ee576345 LibWeb: Fix select dropdown position when scrolled on a page 2023-12-23 10:12:36 +01:00
Bastiaan van der Plaat
44ff957784 LibWeb: Make -webkit-appearance an alias for the appearance css property 2023-12-23 10:12:36 +01:00
Nico Weber
387fecea7f LibPDF: Fix typo in a variable name
No behavior change.
2023-12-23 10:10:24 +01:00
Aliaksandr Kalenik
02936f6944 LibWebView+WebContent: Drive repainting from WebContent process
With this change, chrome no longer has to ask the WebContent process
to paint the next frame into a specified bitmap. Instead, it allocates
bitmaps and sends them to WebContent, which then lets chrome know when
the painting is done.

This work is a preparation to move the execution of painting commands
into a separate thread. Now, it is much easier to start working on the
next frame while the current one is still rendering. This is because
WebContent does not have to inform chrome that the current frame is
ready before it can request the next frame.

Additionally, as a side bonus, we can now eliminate the
did_invalidate_content_rect and did_change_selection IPC calls. These
were used solely for the purpose of informing chrome that it needed to
request a repaint.
2023-12-22 17:47:34 +01:00
Sam Atkins
ac63d1e59d headless-browser: Clear document and callbacks between tests
While it would be more hygienic to get a fresh Navigable each time,
loading `about:blank` still means we discard the current Document.

This does noticeably increase the duration of running the LibWeb test
suite. On my machine, we go from ~5.5 seconds to ~7.7.
2023-12-22 16:49:06 +01:00
Sam Atkins
1e6cd19b28 LibWeb: Prevent calling test() twice
Calling test() multiple times in the same test file is not actually
valid, and can cause the following test to hang forever. So let's stop
doing that in the one test that did so, and also prevent the same
mistake happening again. :^)

Throwing an exception on subsequent test() calls means that we don't
hang, the test will fail with missing output, and we get a log message
explaining why.
2023-12-22 16:49:06 +01:00
Sam Atkins
99fc3c7551 LibWeb: Stop shadowing location_url
This is a bug. The value set here needs to be visible to later steps.
2023-12-22 15:48:40 +00:00
Ali Mohammad Pur
db34ee357d LibLine: Avoid returning reference to cached suggestion
This caused a dangling reference down the line, which lead to funny
things like the following:
    > cd Bui[tab]
    > cd Bui^@^@

By returning a direct reference to the suggestion in question, we can be
sure that the referenced object is alive until the next suggestion
cycle.
2023-12-22 10:59:56 +01:00
Ali Mohammad Pur
64616d3997 AK: Completely disable rich debug formats on Windows
Half the functions used are not readily available on windows, instead of
creating more ifdef soup, this commit simply disables the rich debug
stuff on windows.
2023-12-22 10:59:21 +01:00
Nico Weber
6723552e95 LibPDF: Add a spec comment and remove a FIXME
I think the ASCIIHexDecode / ASCII85Decode unfilter functions handle
what this FIXME was about already.
2023-12-22 10:58:54 +01:00
Nico Weber
3d07684891 LibPDF: Extract Parser::parse_inline_image()
Pure code move, no intended behavior change.

The motivation is just to make Parser::parse_operators() less nested
and more focused.
2023-12-22 10:58:54 +01:00
Idan Horowitz
f972eda7ed Kernel: Mark cloned volatile purgeable AnonymousVMOjects as purged
Our existing AnonymousVMObject cloning flow contains an optimization
wherein purgeable VMObjects which are marked volatile during the clone
are created as a new zero-filled VMObject (as if it was purged), which
lets us skip the expensive COW process.

Unfortunately, one crucial part was missing: Marking the cloned region
as purged, (which is the value returned from madvise when unmarking the
region as volatile) so the userland logic was left unaware of the
effective zero-ing of their memory region, resulting in odd behaviour
and crashes in places like our malloc's large allocation support.
2023-12-22 10:57:59 +01:00
Shannon Booth
1f88046bb2 LibWeb: Add a test for setting and getting Text data
This is a pretty straightforward test, but I managed to make this crash
on real sites while trying to fix #20971 without any other test in the
existing suite failing.
2023-12-22 08:19:51 +00:00
Lucas CHOLLET
2cfca633ca LibGfx/TIFF: Add support for images with UnassociatedAlpha
UnassociatedAlpha is the one used by GIMP when generating TIFF images
with transparency. Support is added for Grayscale and RGB images as it's
the two that we support right now but managing transparency should be
really straightforward for other types as well.
2023-12-22 08:08:47 +00:00
Lucas CHOLLET
796ece7b35 LibGfx/TIFF: Read the ExtraSamples tag 2023-12-22 08:08:47 +00:00
Andrew Kaster
e89163911c Ladybird/AppKit: Use correct flag name for WebContent debugging
This fixes a CoPilot SNAFU from 1e68e484cc
where I tested the changes on Linux and assumed CI would catch any macOS
problems.
2023-12-21 22:56:47 -05:00
Aliaksandr Kalenik
25e9d2ccf0 Tests/LibWeb: Add ref-tests for "overflow: hidden"
Adds ref-tests from pages used in the following PRs:
https://github.com/SerenityOS/serenity/pull/16035
https://github.com/SerenityOS/serenity/pull/17591
2023-12-21 19:25:31 +01:00
Aliaksandr Kalenik
56658b5354 LibWeb+WebContent: Remove unused page_did_click_link()
Not used since we migrated to navigables.
2023-12-21 19:25:18 +01:00
Aliaksandr Kalenik
d87f3a4101 LibWebView+Ladybird: Remove unused on_scroll_into_view callback
Leftover from 9624eca116
2023-12-21 19:25:18 +01:00
Nico Weber
6032c06f6b Revert "LibPDF: Add basic tiled, coloured pattern rendering"
This reverts commit 8ff87911a3.
2023-12-21 19:24:56 +01:00
Nico Weber
7cb216c95b Revert "LibPDF: Offset PaintStyle when painting so pattern overlaps..."
This reverts commit 8c7fc4fe6c.
2023-12-21 19:24:56 +01:00
Andrew Kaster
1e68e484cc Ladybird: Add command line flag to wait for debugger in WebContent 2023-12-21 19:03:40 +01:00
Andrew Kaster
b4a8d2a19f Meta: Support -DCMAKE_BUILD_TYPE=DEBUG for Lagom builds
It's exhausting to have to do a full rebuild when stashing/unstashing
these changes locally.
2023-12-21 19:03:40 +01:00
Andreas Kling
a264cf79c4 AK: Use fallback builtins for overflow checks in AK::Checked
If we don't have __builtin_add_overflow_p(), we can also try using
__builtin_add_overflow(). This makes debug builds with Clang
significantly faster since they no longer need to use the generic
implementation. Same for multiplication.
2023-12-21 15:31:32 +01:00
Andreas Kling
9f0aa08468 AK: Add ByteString::from_utf8_without_validation()
This will be used by Jakt to create ByteString from string literals
which we can validate at compile time instead of runtime. :^)
2023-12-21 13:49:41 +01:00
Bastiaan van der Plaat
0f37e0ee89 LibWeb: Add basic input range rendering 2023-12-21 13:17:51 +01:00
Aliaksandr Kalenik
d28c400fcb headless-browser: Load test page after callbacks are registered
Eliminates possibility that page will load before callbacks are added.
2023-12-21 10:20:05 +01:00
Aliaksandr Kalenik
2f09bfeff2 headless-browser: Await on_load_finish() while running Text tests
Before this change, it was possible for a text test to finish before
on_load_finish() was triggered, resulting in the subsequent test
receiving the load event from the previous test.
2023-12-21 10:20:05 +01:00
Nicolas Ramz
6ccdb1dc72 LibGfx/ILBMLoader: Add support for 24bit files 2023-12-21 09:19:30 +00:00
Nicolas Ramz
caa13d3960 LibGfx/ILBMLoader: Stop the decoding loop when plane buffer is full
This allows decoding files (eg. 24bit) that may have been badly encoded.
2023-12-21 09:19:30 +00:00
Daniel Bertalan
19a2cc5634 CMake: Query Python interpreter with find_package
This lets us fail early at configure time if a suitable Python 3
interpreter is not present, instead of delaying the error until Ninja
attempts to run `embed_as_string_view.py` to generate a header in the
middle of the build.

Refs #21791
2023-12-20 12:54:08 -07:00
Nico Weber
6de32e5359 LibPDF: Draw inline images
The idea is to massage the inline image data into something that
looks like a regular image, and then use the normal image drawing code:
We translate the inline image abbreviations to the expanded version at
rendering time, then unfilter (i.e. uncompress) the image data at
rendering time, and the go down the usual image drawing path.

Normal streams are unfiltered when they're first accessed, but
inline image streams live in a page's drawing operators, and this
fits the current approach of parsing a page's operators anew
every time the page is rendered.

(We also need to add some special-case handling for color spaces
of inline images: Inline images can use named color spaces, while
regular images always use direct color space objects.)
2023-12-20 12:45:16 -07:00
Andrew Kaster
08108ac579 Meta: Disable -fsanitize=function on macOS with clang 17 or higher
This seems to trip on calling file static functions through a function
pointer directly. Still need to reduce and report upstream.
2023-12-20 12:25:40 -07:00
Andrew Kaster
c0f50b12a4 LibWeb: Post all MessagePort messages over their LocalSockets
This is to allow future changes to do cross-process MessagePorts in an
implementation-agnostic way. Add some tests for this behavior.

Delivering messages that were posted to a MessagePort just before it was
transferred is not yet implemented still.
2023-12-20 12:25:40 -07:00
Andrew Kaster
6e3b816763 LibWeb: Represent transferred objects as an empty object
This matches the behavior of the three major engines.
2023-12-20 12:25:40 -07:00
Aliaksandr Kalenik
cfcec5e18e LibWeb: Scroll to the top after navigating to a new document
This change fixes a bug with running tests where, if one of the
previous tests changes the scroll position, all subsequent tests that
rely on the scroll position will fail. This is because the headless
browser never resets the viewport offset.
2023-12-20 09:48:06 -07:00
Aliaksandr Kalenik
41b065dec9 LibWeb: Do not crash for empty fragment in determine_the_indicated_part
The way this method is used in spec implies it should return
`TopOfTheDocument` if fragment is missing.
2023-12-20 09:48:06 -07:00
Nico Weber
4107c2985e Tests: Add a PDF rendering test
Having some rendering test coverage is motivated by #22362, but this
test wouldn't have found the crashes over there (since colorspaces.pdf
does not contain pattern color spaces). Still, good to have some
in-repo test coverage of PDF rendering.
2023-12-20 12:45:07 +01:00