Commit graph

52110 commits

Author SHA1 Message Date
Shannon Booth
49c8d22f50 LibJS: Propagate OOM in GetModifySetValueInBuffer AO 2023-07-06 14:55:46 +01:00
Shannon Booth
81c8e642b9 LibJS: Handle OOM in NumericToRawBytes AO 2023-07-06 14:55:46 +01:00
Zaggy1024
ddb7b59af0 LibAudio: Always add a seek point once the FLAC header has parsed 2023-07-06 14:27:57 +01:00
Zaggy1024
9d5819e9e2 LibAudio: Seek accurately to the target frame in the FLAC loader
Instead of using a seek tolerance value to get close enough to the
target, we can skip frames forward until we pass the target, then seek
back to the previous frame. That puts us in a position to immediately
decode the frame containing the target sample.
2023-07-06 14:27:57 +01:00
Zaggy1024
f2d9280342 LibAudio: Skip FLAC samples even if already close to seek target
Previously, the FLAC loader would not skip samples to reach its seek
target if it saw that the current sample in the loader is closer to the
target than the seek point it finds. This prevents seeking forward when
there are no seek points past the current position.
2023-07-06 14:27:57 +01:00
Zaggy1024
ee1903e641 LibAudio: Always insert a seek point at sample 0 if not present
Previously, the calculation of the distance to the previous seekpoint
would always behave as if a seek point existed at sample 0, meaning
that it would never place a seek point there. If we instead treat it as
the maximum distance if no sample is present, a seek point will be
placed.
2023-07-06 14:27:57 +01:00
Zaggy1024
a8dc97d95d LibAudio: Don't return a seek point if it is after the desired sample
If the seek table was incomplete, without any seek points available
before the target point, `SeekTable::seek_point_before()` would instead
return the first seek point after the target. Check whether the seek
point is before the target before returning it.
2023-07-06 14:27:57 +01:00
Andreas Kling
42675971e2 LibWeb: Resolve inline-block percentage padding against 0, not infinity
When the containing block has an indefinite width, any descendants with
a percentage size should resolve that against 0, not infinity.

Fixes an assertion failure when loading https://www.gnu.org/
2023-07-06 14:25:40 +01:00
Andreas Kling
5955a504e0 LibWeb: Allow font-family names to start with -
We achieve this by making properties that accept a custom-ident value
skip the "someone else's vendor prefix" check for values that start with
a `-` character.

This fixes an issue where e.g `font-family: Arial, -apple-system` would
be rejected by the parser completely. We now treat `-apple-system` like
an identifier in such cases.

Also add `valid-types` metadata for the `font-family` property so this
actually works. :^)
2023-07-06 14:30:06 +02:00
Andreas Kling
dfdb31f5b0 LibWeb: Accept MIME types starting with "application/font" for CSS fonts
Although "application/font-woff" is apparently "deprecated", it's very
much still in use on the web, so we should not be rejecting it.
2023-07-06 14:30:06 +02:00
volovikariel
541bf17a4a Meta: Add missing package in Devcontainer
When using Ladybird in a Devcontainer, the qt6-multimedia-dev package is
missing from the install.sh file.
2023-07-06 13:28:19 +02:00
volovikariel
0498f8dabe Ladybird: Add ccache as a build requirement
As ccache is nice to have when rebuilding Ladybird, adding it to the
build instructions may improve the experience for newcomers.
2023-07-06 13:28:19 +02:00
volovikariel
7cd8c3f708 Ladybird: Replace gcc-12 requirement with g++-12
The build instructions include build-essential,
which installs gcc and g++.
However, build-essential's currently stable version (v12.9) depends on
a version of g++ < 12, thus, Ladybird doesn't build.
2023-07-06 13:28:19 +02:00
Shannon Booth
696c92882a LibDiff: Add a forwarding header 2023-07-06 13:22:37 +02:00
Shannon Booth
84b187e375 diff: Only output a unified/context header if there is a diff 2023-07-06 13:22:37 +02:00
Daniel Bertalan
c6c20d3bf3 LibJS/Bytecode: Use CopyDataProperties AO for destructuring
The previous ad-hoc implementation ignored the non-enumerable flag.
2023-07-06 12:11:02 +01:00
Jonah
afb07281ad Browser+LibWebView: Load and Display ARIA Properites and State
The inspector widget now has a new ARIA tab which displays an
individual element's ARIA properties and state. The view itself
is pretty basic for now, just being a table- there is definitely room
for some better UX here but it's enough for a first cut.
2023-07-06 11:21:36 +01:00
Jonah
e9840bfd4e LibWeb: Build out the ARIA role model
We now have implemented the ARIA role model. These classes will
control which states and properties are exposed to end users.
2023-07-06 11:21:36 +01:00
Jonah
125792e5ff LibWeb: Add helper functions for handling ARIA state and properties
These will make serializing and calculating default values easier.
2023-07-06 11:21:36 +01:00
Jonah
57a6d577ad LibWeb: Add AriaData object to parse ARIAMixin data
This provides an easily serializeable interface for us to use in IPC.
2023-07-06 11:21:36 +01:00
kleines Filmröllchen
10931dceb8 SystemMonitor: Only read process command line once
Process command line reading took up 50% (!) of all of SystemMonitor's
work. However, a process's command line per definition never changes, so
we can read it once and carry it over. Also, if we couldn't read a
process's command line once, it is close to impossible that we'll ever
be able to read it in the future. Therefore, skip reading such command
lines again as well.

This commit also converts the command line itself to use String, while
we're at it.
2023-07-06 11:07:45 +01:00
kleines Filmröllchen
7d53767ce8 SystemMonitor: Don't reopen process statistics file on every update
This file can just remain open; we seek to its start anyways.
This previously accounted for over 5% of SystemMonitor runtime.
2023-07-06 11:07:45 +01:00
kleines Filmröllchen
26d8ac844c Terminal: Modernize
- Replace C with C++
- Use Core::System, Core::Account and Core::Process wrappers
- Remove DeprecatedString
- Remove invalid close() call to the pts file descriptor in the shell
  child (the fd cannot be valid there anymore since it's an
  automatically-closing fd, we just previously ignored this error)
2023-07-06 11:07:11 +01:00
kleines Filmröllchen
8258618caf LibAudio: Mix multi-channel files more properly
We downsample multi-channel files into stereo for now, which at least
makes the other channels listenable. The new multi-channel downmix
helper is intended to be used for other formats with the same or similar
channel arrangement, such as QOA.
2023-07-06 10:44:42 +01:00
kleines Filmröllchen
fc70d88367 LibAudio: Handle unknown-sized streams better
Especially FLAC had an issue here before, but the loader infrastructure
itself wouldn't handle end of stream properly if the "available samples"
information didn't match up.
2023-07-06 10:44:42 +01:00
kleines Filmröllchen
e9e95b1899 LibAudio: Fix escaped partitions
A missing sign extension and a wrong data type broke these before.
2023-07-06 10:44:42 +01:00
Linus Groh
69c42eaf8b Base: Stop generating strace(1) manpage 2023-07-06 10:41:49 +01:00
Andre Herbst
4844e8869e Ports/imagemagick: Replace --host=... with --with-sysroot
... to prevent linking against libs from build host. I.e. if
Ports/fontconfig is already installed imagemagick tries to
link against it in /usr/local/lib and fails to build.
--host=... will already be passed by ../.port_include.sh
2023-07-06 10:17:29 +01:00
kleines Filmröllchen
a3f6236bec LibC: Convert semaphore and termcap to String 2023-07-06 10:15:37 +01:00
kleines Filmröllchen
bd13cc0732 GamesSettings+LibCards: Get rid of DeprecatedString 2023-07-06 10:15:37 +01:00
kleines Filmröllchen
afaea38be2 Base: Expand "See Also" sections of many manpages
This commit focuses on the CLI utilities.
2023-07-06 10:03:48 +01:00
Andi Gallo
f544132fe8 LibWeb: Some improvements for painting of collapsed table borders
Follow the specification in making the borders centered on the grid
lines. This avoids visual bugs due to double-rendering of borders on
either side of an edge and paves the way for a full implementation of
the harmonization algorithm for collapsed borders.

Currently, this still lacks complete handling of row and column spans.
Also, the box model for cells still considers the full width of the
internal borders instead of just half, as the specification requires.
Some additional handling of rounding issues will be needed to avoid very
subtle visual bugs.

Despite these limitations, this improves the appearance of all the
tables with collapsed borders I've tried while limiting the amount of
change to something reasonable.
2023-07-06 10:31:51 +02:00
Andi Gallo
f6d2a21d27 LibWeb: Store table cell indices and spans in PaintableBox
The adjacency information is required to position borders correctly
between columns and rows.
2023-07-06 10:31:51 +02:00
Andi Gallo
98c5efc385 LibWeb: Move collapsed table border painting to a separate function
Move painting of cell borders to a separated function since doing it
correctly has to consider the entire grid as a whole for the collapsed
borders case.
2023-07-06 10:31:51 +02:00
Andi Gallo
f489d85edd LibWeb: Separate comparator for cell border specificity
Add a cell border specificity comparator which preserves the winning
border logic according to specification and makes it possible to sort
borders by specificity. This will be important for handling the style of
table cell corners in a way consistent with other browsers.
2023-07-06 10:31:51 +02:00
Andi Gallo
85c1b93eb7 LibWeb: Resolve table border conflicts at edge level
This better conforms to specification, which describes border conflict
resolution by edge, not by element.
2023-07-06 10:31:51 +02:00
Daniel Bertalan
b39d8af5a6 LibJS/Bytecode: Remove redundant property uniqueness check
This invariant is enforced by virtue of `items` being a HashTable.
2023-07-06 10:30:42 +02:00
Daniel Bertalan
d0dce5c60f LibJS/Bytecode: Handle shadowed non-enumerable properties in for-in
Invariants 5 and 6 of the `EnumerateObjectProperties` AO mean that we
must not include an enumerate property if there is a non-enumerable
property higher up the prototype chain with the same name. The previous
implementation did not adhere to this, as `EnumerableOwnPropertyNames`
does not carry information about present but non-enumerable properties.
2023-07-06 10:30:42 +02:00
Sam Atkins
f21a30e45f LibWeb: Use CSSNumericType for CalculatedStyleValue resolved type 2023-07-06 09:28:16 +02:00
Sam Atkins
4d84080fdc LibWeb: Implement "Determine the type of a calculation" algorithm
This is sitting alongside our old implementation for the moment.
2023-07-06 09:28:16 +02:00
Sam Atkins
38f954cba5 LibWeb: Generate function for what properties resolve percentages to
This is required by "determine the type of a calculation".
https://www.w3.org/TR/css-values-4/#determine-the-type-of-a-calculation
2023-07-06 09:28:16 +02:00
Sam Atkins
be7093ab0d LibWeb: Implement CSSNumericType
This represents the type of a calculation, which may involve multiplying
or dividing the various numeric types together (eg, length*length, or
length/time, or whatever).

For now, I've made "Return failure" in each algorithm return an empty
Optional. This may or may not be a good solution but we'll see. :^)
2023-07-06 09:28:16 +02:00
Sam Atkins
434bac3c67 LibWeb: Return true for is_operator_node() for math-function nodes 2023-07-06 09:28:16 +02:00
Andreas Kling
3372a691da LibWeb: Don't let items flex to infinite size in column layout
When sizing under a max-content constraint, we allow flex lines to have
an infinite amount of "remaining space", but we shouldn't let infinity
leak into the geometry of items. So treat it as zero in arithmetic.

This fixes an issue where inline SVGs with natural aspect ratio (from
viewBox) but no natural width or height could get an infinite size as
flex items.
2023-07-06 09:25:48 +02:00
Timothy Flynn
00d8e221f3 Meta: Support enabling compile-time format string checking on Lagom 2023-07-06 08:55:11 +02:00
Timothy Flynn
eed0c32357 IPCMagicLinter: Add missing format parameter to an error log 2023-07-06 08:55:11 +02:00
Luke Wilde
442ca4f9b4 LibJS: Avoid RequireObjectCoercible when creating super references
This is part of an old normative change that happened soon after
Andreas made `super` closer to spec in 1270df2.
See https://github.com/tc39/ecma262/pull/2267/

This was introduced into bytecode by virtue of copy and paste :^)

Bytecode results:
Summary:
    Diff Tests:
        +2     -2 
2023-07-06 08:54:46 +02:00
Luke Wilde
b271d9a6bf LibJS/Bytecode: Use proper this for receiver in get/set for super expr
Summary:
    Diff Tests:
        +14     -2     -12 📝
2023-07-06 08:54:46 +02:00
Andi Gallo
b7d23162cc LibWeb: Set the definite width flag in set_max_content_width
It was setting the definite flag for height.
2023-07-06 08:54:28 +02:00
Shannon Booth
0f040456a7 LibWeb: Add ReadableStreamGetReaderOptions to ReadableStream.getReader
Co-Authored-By: Matthew Olsson <mattco@serenityos.org>
2023-07-05 23:33:20 +01:00