Commit Graph

27882 Commits

Author SHA1 Message Date
Andreas Kling
edec5a157c LibWeb: Add missing TreeNode::visit_edges() in Paintable::visit_edges() 2023-08-28 23:36:22 +02:00
Andreas Kling
6238860c6d LibWeb: Simplify PaintableBox::enclosing_stacking_context() 2023-08-28 23:36:22 +02:00
Andrew Kaster
6e64bf5464 LibWeb: Remove outdated old_queue_global_event_with_document
The FIXME here describes an old constraint on JS Interpreters which no
longer holds. It hails from a time when we had the global object and
JS realm attached to the document.
2023-08-28 12:57:05 +02:00
Tim Ledbetter
9808f8164f find: Use PosixExtended regex syntax instead of PosixBasic
This is the same syntax used by `grep -E`.
2023-08-28 13:43:43 +03:30
Tim Ledbetter
0a02c7a926 find: Add the -regex and -iregex options
These options match a given regular expression against the whole file
path. `-iregex` is identical to `-regex` except it is case-insensitive.
2023-08-28 11:51:14 +03:30
Andreas Kling
2a86bd8c91 LibWeb: Fire the fail callback on SharedImageRequest when they fail
This fixes an issue where failed image loads would delay the document
load event forever.
2023-08-28 10:19:46 +02:00
Andrew Kaster
b1f06e42ce LibWeb: Implement navigation.{traverseTo, back, forward}
The proper abstract operations on Navigable and TraversableNavigable are
not quite ready to call from Navigation. With this commit all of the
user-facing APIs of Navigation are in place, and the stage should be set
to implement the parts of the navigation and traversal AOs that need to
interact with the Navigation object.
2023-08-28 09:47:11 +02:00
Andrew Kaster
03eae09619 LibWeb: Implement snapshotting source snapshot params per the spec 2023-08-28 09:47:11 +02:00
Andrew Kaster
798a1b2751 LibWeb: Implement navigation.reload()
This has the same issue as navigate(), in that we currently cannot
guarantee that there is a valid navigable on every fully loaded
document.
2023-08-28 09:47:11 +02:00
Aliaksandr Kalenik
b66f65dc9e LibWeb: Define if identifier represent area or line during layout [GFC]
This fixes regression introduced in
c03e025a32 by assuming that it is
possible to determine whether identifier stands for line or area
during parsing.
2023-08-28 09:19:41 +02:00
Andrew Kaster
b7f9634f6c LibCore: Add default version for Lagom applications
Instead of grabbing `uname -vr` on non-Serenity platforms, let's just
hardcode a version. This prevents Lagom builds of applications like
Shell or Ladybird from reporting their version as that of the host OS.
2023-08-27 19:01:32 -04:00
Beckett Normington
8bc1f1b63e LibC: Add drand48, srand48
These functions are required for the `perl5` port's random function to
operate correctly. As a bonus, this allows us to remove a nasty patch
that replaces `drand48` with `random`.
2023-08-28 00:40:35 +02:00
Luke Wilde
af2886449a LibWeb: Implement PerformanceObserver 2023-08-27 23:27:44 +02:00
Liav A
5055883b9f Utilities/ps: Add process start time column in full format mode
Just like on Linux, we can easily print the process creation time. The
format of a printed time is either "hour:minute" if the process started
today, or "short_month_name:day_of_the_month" (for example, "Aug26").
2023-08-27 22:53:22 +02:00
Liav A
aee5f4e4b2 Kernel: Remove the /sys/kernel/constants directory
The name for this directory is a bit awkward. Also, the distinction of
constant information is not really valuable as I thought it would be, so
let's bring that information back into the /sys/kernel directory.
2023-08-27 22:50:22 +02:00
Liav A
751aae77bc Kernel: Rename /sys/kernel/variables => /sys/kernel/conf
The name "variables" is a bit awkward and what the directory entries are
really about is kernel configuration so let's make it clear with the new
name.
2023-08-27 22:50:22 +02:00
Kemal Zebari
3151099b21 LibWeb/Fetch: Use parsed referrer's origin in Request::construct_impl 2023-08-27 15:44:21 -04:00
Tim Ledbetter
94b247ec3c sort: Allow multi-character separators to be given with the -t option 2023-08-27 15:42:46 -04:00
Tim Ledbetter
e6112446db sort: Add the -z option to split lines on \0 rather than a newline 2023-08-27 15:42:46 -04:00
Timothy Flynn
b7676cc436 LibJS: Disable Temporal custom time zone test
This test has been flaky for quite some time. Disable it for now, and
revisit once we've caught up with the Temporal spec.
2023-08-27 15:26:40 -04:00
Tim Ledbetter
edd49c1531 find: Add the -readable, -writable and -executable options 2023-08-27 09:46:11 -04:00
Shannon Booth
b0eea51335 LibWeb: Port DOMTokenList from DeprecatedString to String 2023-08-27 05:34:54 +02:00
Shannon Booth
d706f9f241 LibWeb: Port HTMLSelectElement from DeprecatedString to String 2023-08-27 05:34:54 +02:00
Shannon Booth
d5409a056a LibWeb: Port HTMLCollection from DeprecatedString to String 2023-08-27 05:34:54 +02:00
Shannon Booth
ebdfe2e863 LibWeb: Port DocumentType from DeprecatedString to String 2023-08-27 05:34:54 +02:00
Shannon Booth
9117bcfd61 LibWeb: Port DOMImplementation from DeprecatedString to String 2023-08-27 05:34:54 +02:00
Shannon Booth
d8ae02ef59 LibWeb: Add spec comments to DOMImplementation 2023-08-27 05:34:54 +02:00
Aliaksandr Kalenik
d3d67857b2 LibWeb: Use containing block width to measure fit-content width in GFC
When the grid layout gets to
`resolve_items_box_metrics(GridDimension::Column)`, we've already
determined the width of each column. However, the widths of the
individual grid items themselves haven't been set. Rather than using
`get_available_space_for_item()`, which returns an indefinite size if
an item's width/height hasn't been set, we should use the already
known track width as the available size to calculate the fit-content
width.
2023-08-27 05:11:55 +02:00
Tim Ledbetter
08cb49c2bd useradd: Simplify uid validation 2023-08-26 19:01:22 -04:00
Tim Ledbetter
8955560801 useradd: Allow group name or number to be used with the -g option 2023-08-26 19:01:22 -04:00
Kemal Zebari
4533794c32 LibWeb/Fetch: Use origins in Cross-Origin-Embedder-Policy algorithm 2023-08-26 18:44:21 -04:00
Zaggy1024
b33a71a35e LibAudio: Remove unnecessary m_bitstream field from MP3Loader
We can just create a `BigEndianInputBitStream` where it is needed
instead of storing one in the class. After making `read_header()`
static, the only other user of the field was `read_size_information()`,
so let's do that there and then remove the field.
2023-08-26 18:43:23 -04:00
Zaggy1024
c1d4ff919a LibAudio: Remove the m_current_frame field from MP3Loader
This field was only used within one function, where it could just be a
local variable.
2023-08-26 18:43:23 -04:00
Zaggy1024
88a9ff76b0 LibAudio: Read the full MP3 frame header when synchronizing to a frame
This makes the checks for a frame header more consistent, so if the
conditions for allowed frame headers change, there are less scattered
lines that will need to be changed.

`synchronize()` will now also properly scan the second byte of the hex
sequence `FF FF F0` as a sync code, where previously it would see
`FF F` and skip on to `F0`, ignoring its preceding `FF` that would
indicate that it is a sync code.
2023-08-26 18:43:23 -04:00
Zaggy1024
cbdf49de30 LibAudio: Pass raw streams to MP3 synchronize() and read_frame()
`synchronize()` can be simplified greatly by checking whole bytes with
bitwise operations, and doing so also avoids the overhead of reading
individual bits from a bitstream.

Making `read_frame()` also take a `SeekableStream` will allow it to be
used inside `synchronize()` in the next commit.
2023-08-26 18:43:23 -04:00
Zaggy1024
1847155b12 LibAudio: Make MP3LoaderPlugin::read_header() static
This will allow us to use the function when sniffing for an MP3 file to
enable consistent checks for valid frame headers.
2023-08-26 18:43:23 -04:00
Zaggy1024
e087d35cd8 LibAudio: Accurately skip MP3 frames using the actual header size
Prevously, the header size was used to calculate the `slot_count` field
of `MP3::Header`, but `build_seek_table()` just used the maximum size
of the header instead, causing it not to seek far enough, and in cases
where a possible sync code occurred two bytes before the next frame, it
would read that possible sync code as if it was a real frame. It would
then either reject it due to bad field values, or could possibly skip
over the next real frame due to a larger calculated frame size in the
bogus frame.

By fixing this issue, we now properly calculate the duration of MP3
files where these fake sync codes occur. In the case of the raw file
for this podcast:

https://changelog.com/podcast/554

the duration goes from 1:21:57 to 1:22:47, which is the real duration
according to the player user interface.
2023-08-26 18:43:23 -04:00
Zaggy1024
5b8895fff0 LibAudio: Create MP3 seek table first and then seek sample 0 to play
The seek table must locate the first MP3 frame in the file, so it makes
sense to locate the samples for the sample table first, then that
information to seek to the first frame.
2023-08-26 18:43:23 -04:00
Zaggy1024
49be09e5b2 LibAudio: Skip ID3 tags before synchronizing to MP3 frames
Previously, we would just start from byte 0 and check individual bytes
of the file until we find two bytes starting with `FF F`, and then
assume that that was the MP3 frame sync code. However, some ID3v2 tags
do not have to be what is referred to as "unsynchronized", meaning that
they can contain that `FF F` sequence and cause our decoder to think it
has found a frame.

To avoid this happening, we can read a minimal amount of the ID3 header
to determine how many bytes to skip before attempting to find the MP3
frames.

This allows the recent podcast with Andreas to play here:

https://changelog.com/podcast/554
2023-08-26 18:43:23 -04:00
Zaggy1024
2dc75a37d2 LibAudio: Set MP3 seek points to their frame's first sample
Seek points were being created after adding to the sample count in
`build_seek_table()`, meaning that they would be offset forward by
`MP3::frame_size` samples.

This also allows us to remove the hardcoded sample 0 seek point that
was previously added, since a seek point at sample 0 will now be added
by the loop.
2023-08-26 18:43:23 -04:00
Zaggy1024
89fb4af429 LibAudio: Default-initizalize all types in MP3Types.h 2023-08-26 18:43:23 -04:00
MacDue
71baa8c31a LibWeb: Add CSSPixels::nearest_value_for(FloatingPoint)
This is intended to annotate conversions from unknown floating-point
values to CSSPixels, and make it more obvious the fp value will be
rounded to the nearest fixed-point value.
2023-08-26 23:53:45 +02:00
MacDue
360c0eb509 LibWeb: Remove implicit conversion from float and double to CSSPixels
In general it is not safe to convert any arbitrary floating-point value
to CSSPixels. CSSPixels has a resolution of 0.015625, which for small
values (e.g. scale factors between 0 and 1), can produce bad results
if converted to CSSPixels then scaled back up. In the worst case values
can underflow to zero and produce incorrect results.
2023-08-26 23:53:45 +02:00
Timothy Flynn
3f122b7335 LibWebView: Allow using native/user style sheets on Lagom
Move the methods to set the native/user style sheets to the base
ViewImplementation class. We must also generate the native style sheet
explicitly for now, as LibWebView on Lagom isn't able to include the
main LibWebView CMakeLists.txt file yet.
2023-08-26 15:32:36 -04:00
Timothy Flynn
7df48756d6 LibWeb: Use SystemColor::button_text for ButtonText CSS values 2023-08-26 19:24:22 +02:00
Aliaksandr Kalenik
0060fe3095 LibWeb: Account for float intrusions in list marker x offset 2023-08-26 19:07:56 +02:00
Sam Atkins
240ec9aeed LibWeb: Treat invalid StyleValues that included var() as unset
This means StyleComputer::resolve_unresolved_style_value() always
returns a value, so we can change its return type.

However, it does still return an UnresolvedStyleValue sometimes, so we
can't remove those checks from the user code.
2023-08-26 15:33:45 +01:00
Adam Harald Jørgensen
258af88b29 LibGUI: Fix search highlighting so that it matches the search query
There is a bug in the "search by typing" feature of
AbstractView, where the highlighted text shown in items' title won't
match the search query if the search query contains whitespace.
This commit fixes that bug.

The bug is caused by a bad assumption made in
AbstractView::draw_item_text about the Painter::draw_text API.
Specifically that the function passed to it will be called for each
code point of the string instead of for each drawable glyph.

This is fixed by not relying on looking at the length of the highlight
string, but instead looking at its content.
2023-08-26 09:09:47 -04:00
Shannon Booth
f115e44066 LibWeb: Implement value attribute of RadioNodeList 2023-08-26 13:51:18 +02:00
Shannon Booth
708263790a LibWeb: Implement LiveNodeList::first_matching
This function returns the first element which matches both the filter
for the LiveNodeList collection itself, and a further filter that is
supplied as an argument to this function.
2023-08-26 13:51:18 +02:00