Commit Graph

3095 Commits

Author SHA1 Message Date
Tim Ledbetter
c4d5ae28ea LibWeb: Implement a minimal version of Window.find()
This is a non-standard API that other browsers implement, which
highlights matching text in the current window.

This is just a thin wrapper around our find in page functionality, the
main motivation for adding this API is that it allows us to write tests
for our find in page implementation.
2024-06-27 10:09:39 +02:00
Tim Ledbetter
9585da37ad Tests: Skip css-keyframe-fill-forwards.html ref test
This test is currently causing intermittent CI failures.

(cherry picked from commit 24c75922d8476b5096657acb5a1b4c71454ca616)
2024-06-26 18:56:33 -06:00
Timothy Flynn
bd73dd316d LibTimeZone: Remove LibTimeZone and TZDB data
All users have been ported to the ICU implementation.
2024-06-26 10:14:02 +02:00
Timothy Flynn
672a555f98 LibCore+LibJS+LibUnicode: Port retrieving time zone offsets to ICU
The changes to tests are due to LibTimeZone incorrectly interpreting
time stamps in the TZDB. The TZDB will list zone transitions in either
UTC or the zone's local time (which is then subject to DST offsets).
LibTimeZone did not handle the latter at all.

For example:

The following rule is in effect until November 18, 6PM UTC.

    America/Chicago -5:50:36 - LMT 1883 Nov 18 18:00u

The following rule is in effect until March 1, 2AM in Chicago time. But
at that time, a DST transition occurs, so the local time is actually
3AM.

    America/Chicago -6:00 Chicago C%sT 1936 Mar 1 2:00
2024-06-26 10:14:02 +02:00
Timothy Flynn
1b2d47e6bb LibJS+LibUnicode: Port retrieving available regional time zones to ICU 2024-06-26 10:14:02 +02:00
Timothy Flynn
4fc0fba646 LibCore+LibJS+LibUnicode: Port retrieving available time zones to ICU
This required updating some LibJS spec steps to their latest versions,
as the data expected by the old steps does not quite match the APIs that
are available with the ICU. The new spec steps are much more aligned.
2024-06-26 10:14:02 +02:00
Timothy Flynn
d3e809bcd4 LibJS+LibUnicode: Port retrieving the system time zone to ICU 2024-06-26 10:14:02 +02:00
Timothy Flynn
8331a87f6c LibTimeZone: Rename TestTimeZone to TestTimeZoneDeprecated
This will just allow creating a TestTimeZone in LibUnicode for an ICU-
based implementation.
2024-06-26 10:14:02 +02:00
Ali Mohammad Pur
55e1ab88ad Tests/LibWasm: Don't ignore the result of BigInt::export_data()
Prior to this commit, the test runner was ignoring the result, which
meant that values that fit in less than 128 bits were shifted to remove
the zero words (which is obviously incorrect).
2024-06-25 18:25:53 -06:00
Andreas Kling
7ce350b8c0 Tests: Add a basic test for Declarative Shadow DOM 2024-06-25 19:22:35 +02:00
Zaggy1024
c4c91f02b3 LibMedia: Remove the home-grown VP9 decoder 2024-06-24 12:41:32 -06:00
Zaggy1024
d851945aad Tests/LibMedia: Ensure that frame timestamps increase monotonically 2024-06-24 12:41:32 -06:00
Zaggy1024
bbd8a218a5 AK: Prevent overflow of the min when clamping unsigned values to signed
Also, add some tests for the cases that were broken before.
2024-06-24 12:41:32 -06:00
Zaggy1024
172f4588a7 Tests/AK: Add some quick tests for AK::clamp_to 2024-06-24 12:41:32 -06:00
Zaggy1024
f6a4973578 LibMedia: Give frame timestamps to FFmpeg decoders
H.264 in Matroska can have blocks with unordered timestamps. Without
passing these as the presentation timestamp into the FFmpeg decoder,
the frames will not be returned in chronological order.

VideoFrame will now include a timestamp that is used by the
PlaybackManager, rather than assuming that it is the same timestamp
returned by the demuxer.
2024-06-24 12:41:32 -06:00
Zaggy1024
084cf68dd5 Tests/LibMedia: Add a test for H.264 decoding through FFmpeg 2024-06-24 12:41:32 -06:00
Zaggy1024
48a21d5d6a Tests/LibMedia: Move video decode testing function to a header
This will be useful for other video codecs, but putting all codecs in
one file will be a little messy.
2024-06-24 12:41:32 -06:00
circl
63fa32416d Base: Move test-webm.webm out of /home/anon 2024-06-24 09:45:41 -06:00
Timothy Flynn
3c23ce9007 LibTimeZone: Remove entirely unused time zone methods
Evaluating third-party alternatives to LibTimeZone will be simpler with
unused functionality removed.
2024-06-24 15:04:58 +02:00
Luke Warlow
6014727c20 LibWebView: Allow data URLs in sanitize_url
Allow navigation to data URLs from browser UI.
2024-06-24 06:31:17 -04:00
Timothy Flynn
ebdb92eef6 LibUnicode+Everywhere: Merge LibLocale back into LibUnicode
LibLocale was split off from LibUnicode a couple years ago to reduce the
number of applications on SerenityOS that depend on CLDR data. Now that
we use ICU, both LibUnicode and LibLocale are actually linking in this
data. And since vcpkg gives us static libraries, both libraries are over
30MB in size.

This patch reverts the separation and merges LibLocale into LibUnicode
again. We now have just one library that includes the ICU data.

Further, this will let LibUnicode share the locale cache that previously
would only exist in LibLocale.
2024-06-23 19:52:45 +02:00
Andreas Kling
85a4cfc59b LibWeb: Add the bare minimum to render SVGAElement (<a>) 2024-06-23 19:15:24 +02:00
Andreas Kling
ae906ca497 LibWeb: Treat width: {min,max,fit}-content as auto if ratio unresolvable
This appears to match other engines.
2024-06-23 19:15:24 +02:00
Andreas Kling
db1faef786 LibWeb: Fix overeager fallback to stretch-fit width for some flex items
If a flex item has a preferred aspect ratio and the flex basis is not
definite, we were falling back to using stretch-fit for the main size,
since that appeared to match other browsers.

However, we missed the case where we actually have a definite cross size
through which the preferred aspect ratio can be naturally resolved.
2024-06-23 19:15:24 +02:00
Andreas Kling
9c02ace897 LibWeb: Allow flex-basis: {min,max,fit}-content 2024-06-23 19:15:24 +02:00
Edwin Hoksberg
2b30414c1d LibWeb: Add attribute list that must always be compared without casing 2024-06-22 15:52:04 +02:00
Tim Ledbetter
31d7fa2442 LibWeb: Fire auxclick event on middle click
Previously, no event was fired on middle click. This change also allows
the UI to open a link in a new tab on middle click.
2024-06-22 14:57:36 +02:00
Timothy Flynn
aa3a30870b LibUnicode: Replace code point bidirectional classes with ICU 2024-06-22 14:56:39 +02:00
Andreas Kling
63f8feb9a4 LibWeb: Implement RecordingPainter::draw_text() via draw_text_run()
To get away from the ancient (and buggy) text layout code in
Gfx::Painter, we want to remove all the uses of Painter::draw_text().

As a first step towards this, we implement the draw_text() display list
command in terms of the draw_text_run() command by performing the very
simple necessary layout in draw_text() beforehand.
2024-06-21 10:31:13 +02:00
Andreas Kling
8a3dc5ea0a LibGfx: Remove home-grown PNG codec in favor of libpng+apng 2024-06-21 07:31:37 +02:00
Timothy Flynn
ab56b8c8dc LibUnicode: Remove the locale-unaware text segmentation implementation 2024-06-20 13:46:54 +02:00
Timothy Flynn
3fe0a27fbd LibLocale: Implement an ICU-based text segmenter
Our current segmenter implementation lives in LibUnicode, and is not
locale-aware. We will need such awareness for ECMA-402, and so LibLocale
will be the new home for text segmentation.

The tests here are ported directly from LibUnicode/TestSegmentation.cpp.
2024-06-20 13:46:54 +02:00
Timothy Flynn
5cf818e305 LibUnicode: Replace case transformations and comparison with ICUs
There are a couple of differences here due to using ICU:

1. Titlecasing behaves slightly differently. We previously transformed
   "123dollars" to "123Dollars", as we would use word segmentation to
   split a string into words, then transform the first cased character
   to titlecase. ICU doesn't go quite that far, and leaves the string
   as "123dollars". While this is a behavior change, the only user of
   this API is the `text-transform: capitalize;` CSS rule, and we now
   match the behavior of other browsers.

2. There isn't an API to compare strings with case insensitivity without
   allocating case-folded strings for both the left- and right-hand-side
   strings. Our implementation was previously allocation-free; however,
   in a benchmark, ICU is still ~1.4x faster.
2024-06-20 10:59:55 +02:00
Zaggy1024
7c10e1a08d LibMedia: Rename LibVideo to LibMedia
This change is in preparation for implementing audio codecs into the
library and using audio as timing for video playback.
2024-06-19 07:51:55 +02:00
Timothy Flynn
8d7216f4e0 LibUnicode: Replace IDNA ASCII conversion with ICU 2024-06-18 21:07:56 +02:00
Timothy Flynn
1feef17bf7 LibUnicode: Remove completely unused code point name & block name data
These were used for e.g. the Character Map on Serenity, but are not used
at all for Ladybird.
2024-06-18 21:07:56 +02:00
Diego
1e19be412f LibWasm: Add missing spec extern and prevent spec extern re-use
Add the missing `print` function to the spectest namespace. Also, spec
externs cannot be re-used because operations that modify "memory", for
example, will carry over into subsequent spec test runs. This can be
remedied in the future by implementing some sort of garbage collector
for allocations in the store.
2024-06-18 16:58:33 +02:00
Andreas Kling
b88e0eb50a AK: Remove unused Complex.h 2024-06-18 12:00:14 +02:00
Andreas Kling
fe1aec124e AK: Remove unused ArbitrarySizedEnum class 2024-06-18 12:00:14 +02:00
Andreas Kling
1039acca8c LibGfx: Remove JPEG2000 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
a34a5af939 LibGfx: Remove ILBM image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b6daddb088 LibGfx: Remove JBIG2 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b7f8d7aec5 LibGfx: Remove TGA image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
681a2ac14e LibGfx: Remove support for the various "portable" image formats
These formats are not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
7141319a7c LibGfx: Remove DDS image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
4b4254c3d0 LibGfx: Remove QOI image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
2a888ca626 LibGfx: Remove home-grown JPEG codec in favor of libjpeg-turbo 2024-06-17 17:59:54 +02:00
Matthew Olsson
667e313731 LibWeb: Parse easing values manually
The values aren't that complex, so it doesn't make much sense to have a
dedicated generator for them. Parsing them manually also allows us to
have much more control over the produced values, so as a result of this
change, EasingStyleValue becomes much more ergonomic.
2024-06-16 07:12:46 +02:00
Andreas Kling
4c94202e97 LibWeb: Remove unnecessary FIXME marker for CSSStyleDeclaration.cssFloat 2024-06-14 20:45:37 +02:00
Andreas Kling
19fa630fa7 LibWeb: Make CSSKeyframeRule.parentRule actually point to parent rule 2024-06-14 20:45:37 +02:00