Commit Graph

53919 Commits

Author SHA1 Message Date
Tim Ledbetter
a0a43d1a0e Ports/mc: Update formatting to be consistent with other ports 2023-08-27 01:20:47 +02:00
Tim Ledbetter
c5800229d5 Ports/mc: Remove libtool dependency
This is a build time dependency only. Therefore it is expected to be
present on the host machine prior to installation.
2023-08-27 01:20:47 +02:00
Tim Ledbetter
b2f2156706 Ports/mc: Add --with-sysroot to configopts
This prevents any host dependencies affecting the build and negates
the need to manually specify `ncurses` directories.
2023-08-27 01:20:47 +02:00
Tim Ledbetter
b91cd56a53 Ports/gettext: Update formatting to be consistent with other ports 2023-08-27 01:05:41 +02:00
Tim Ledbetter
07075ac0c2 Ports/gettext: Explicitly disable curses support
This makes the build behave the consistent regardless of whether
`ncurses` or `termcap` was previously installed or not.
2023-08-27 01:05:41 +02:00
Tim Ledbetter
435c53ee1c Ports/gettext: Remove unnecessary wctype patch 2023-08-27 01:05:41 +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
0f9c088302 Ladybird: Install the native style sheet into the JS console web view
Without this, we are unable to render the web view in dark mode.
2023-08-26 15:32:36 -04: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
Sam Atkins
6b66e80fb8 LibWeb: Sort Ref/mainfest.json entries 2023-08-26 15:33:45 +01:00
Liav A
4177e6be8b Kernel: Remove KDSETMODE and KDGETMODE ioctl options from the TTY class
These options are not relevant and are actually meaningless on pure TTY
devices, as they are meant to be effective only for the VirtualConsole
devices.

This also removes the virtual marking from two methods because they're
no longer declared in the TTY class as well.
2023-08-26 16:29:28 +02: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
Shannon Booth
191c87f1cd LibWeb: Handle 'default' value state for input elements
For buttons and the hidden state the value IDL call must return the
empty string if there is no value, and the elements value attribute
otherwise.
2023-08-26 13:51:18 +02:00
Shannon Booth
0f374afc8f LibWeb: Handle radio/checkbox default-or-on value attribute state
If the value attribute is missing, these input elements should be
returning 'on' as their value in their IDL.
2023-08-26 13:51:18 +02:00
Shannon Booth
fc4fd6cb02 LibWeb: Fix empty value attribute for 'file' input returning fakepath
It should be returning the empty string for this case.
2023-08-26 13:51:18 +02:00
Aliaksandr Kalenik
c03e025a32 LibWeb: Disambiguate GridTrackPlacement API
- Ambiguous `raw_value()` method is replaced with `line_number()` and
  `span()`.
- `line_name()` that before returned either line name or area name is
  replaced with `line_name()` and `area_name()`.
- `Position` type is replaced with `Line` and `Area` type so we don't
   have to guess while doing layout.

Affected test expectations:
- `template-lines-and-areas` - improvement over what we had before.
- `named-tracks` - rebaseline a giant test. will have to split it into
  smaller tests in the future.
2023-08-26 13:16:17 +02:00
Andi Gallo
29352f570a LibWeb: Fix table column constrainedness
Adjust implementation to reflect the CSS 2.1 definition of width.
2023-08-26 13:10:45 +02:00
Andreas Kling
c6cb876851 LibWeb: Use a serif font in the default UA style sheet
This matches how most/all other browsers behave today.
2023-08-26 12:13:00 +02:00
Andrew Kaster
587cfa7739 LibWeb: Don't assert when calling navigation properties
The invariants for these property getters are supposed to be checked by
the has_entries_and_events_disabled AO, but we don't have all the
plumbing hooked up between Navigables and Navigation yet.

Add a test to make sure that these methods don't assert when calling
them on a fresh page.
2023-08-26 07:35:50 +01:00
Sam Atkins
aae7905369 Applications: Use native style sheet for WebViews where appropriate 2023-08-25 20:30:20 +01:00
Sam Atkins
7436f4fec2 LibWebView: Add a standard "look like the OS" style sheet
It's quite common to want the web-view to match the native OS widgets,
so let's make that easy to do.
2023-08-25 20:30:20 +01:00
Sam Atkins
84a5c67d6b LibWeb: Use system colors in more places 2023-08-25 20:30:20 +01:00
Sam Atkins
cd273f2312 LibWeb: Use system-color keywords in Default.css 2023-08-25 20:30:20 +01:00
Sam Atkins
848ec538c6 LibWeb: Implement <system-color> and <deprecated-color> keywords
The spec allows for these either to be based on the OS, or to be defined
by the browser. Looking at the other browser engines, there's a mix of
the two options. Since we've had issues with using OS colors as
defaults, let's use hard-coded colors for now. Some of these are based
on the definitions in
https://html.spec.whatwg.org/multipage/rendering.html
2023-08-25 20:30:20 +01:00
Sam Atkins
1dcd63be05 LibWeb: Deduplicate "ident is color" check
Reuse the check from IdentifierStyleValue in the CSS Parser, instead of
duplicating it. This might not be the ideal place to put it, but it
works for now.
2023-08-25 20:30:20 +01:00
Andreas Kling
da8692572a LibWeb: Support media queries with the resolution feature
The resolution is simply 1dppx * device pixel ratio.

This makes high resolution images show up on https://apple.com/
when running on a high-DPI display. :^)
2023-08-25 20:10:47 +02:00
Andreas Kling
b63e393cef LibWeb: Fix broken conversion of CSS <resolution> dpi/dpcm to dppx
Also add a basic test that documents how these media features currently
get serialized, even if they're not identical to other browsers yet.
2023-08-25 20:10:47 +02:00
Andreas Kling
b256e52586 AK: Make Formatter for NonnullOwnPtr<T> format the T
This mirrors the behavior of NonnullRefPtr<T>. If you want to format
the pointer address, call .ptr() on it.
2023-08-25 20:10:47 +02:00
Andrew Kaster
f8e5df7a99 LibWeb: Implement navigation.navigate()
The implementation is incomplete, because our Navigable::navigate
implementation is missing the navigationAPIState parameter. We also
don't have Navigables hooked up completely enough to guarantee that a
fully active document that is not being unloaded always has a Navigable.
2023-08-25 19:51:13 +02:00
Andrew Kaster
34ea470d4f LibWeb: Add AO for navigation_must_be_a_replace to Navigable
This is used by both Navigable and Navigation, so let's put it in
Navigable. Also add a missing AK/String include to make clangd happier
with the Navigable file.
2023-08-25 19:51:13 +02:00
Andrew Kaster
7ad45d9e71 LibWeb: Expose a getter for Document's unload_counter
We need to check this value from the Navigation APIs.
2023-08-25 19:51:13 +02:00