Now that the positions of each grid item have been calculated, and the
sizes of the individual rows and columns ascertained, can actually
layout the different items.
According to the spec it's necessary to:
1. Layout the cells in the grid
2. Find the sizes of the rows and columns
Since I had started to do this backwards, and as I expand in future
commits, I take here the opportunity to start with a clean state.
The occupation_grid keeps track of which cells in the grid have been
filled out.
Often in the spec they talk about intrinsic_track_sizes and this way can
have a clearer way of checking if a GridTrackSize is indeed an
"intrinsic track size".
Makes it more convenient to create auto GridTrackSizes. I think having
an auto GridTrackSize be defined by an auto Length value kind of
confusing, and this at least helps when creating one.
To follow spec more closely, only set the has_span value if there is a
number immediately following, like "span 2". Otherwise the span value
should be ignored.
Use float instead of int for the GridTrackSize length value as
FlexibleLengths can be "1fr" as well as ".49fr" in grid-track-row
and grid-track-column values.
...`__attribute__((__noreturn__))`
This is more inline with the definition in glibc's version of the file,
and stops clang from complaining about it originally not being declared
as `[[no_return]]`.
With 6 bits of precision, the maximum triangle coordinate we can
handle is sqrt(2^31 / (1 << 6)^2) = ~724. Rendering to a target of
800x600 or higher quickly becomes a mess because of integer overflow.
By reducing the subpixel precision to 4 bits, we support coordinates up
to ~2896, which means that we can (try to) render to target sizes like
2560x1440.
This fixes the main menu backdrop for the Half-Life port. It also
introduces more white pixel artifacts in Quake's water / lava
rendering, but this is a level geometry visualization bug (see
`r_novis`).
There were only two packages making use of this functionality, but it
seems more sensible to have a fixed implementation for the cleaning of
ports - especially now they delete the entire build directory and/or
dist files.
The functionality for `./package.sh clean` was a bit weird: based on
whether you were working in dev mode, it would try to delete either
`$workdir` or `$nongit_workdir` and `*.out` from your `pwd`.
The new functionality is pretty clear: `./package.sh clean` deletes the
entire build directory for the port regardless of what mode you're in,
`./package.sh clean_dist` removes all `$files`, and
`./package.sh clean_all` does both.
We have a high random failure rate on Shell tests, even with two of them
already manually disabled for being flaky. For now, let's skip them in
automated/CI testing so that "real" failures are more obvious.
Two of the tests have early-exits to disable them, which I wanted to
remove, but that makes `Meta/lint-shell-scripts.sh` very cross, so I'll
leave them.
Before this change, we'd always insert one line box fragment, even when
a float was taking up too much space on the line, and the fragment
didn't actually fit.
We now perform line breaks until we have enough space between floats.
This fixes many page layouts where we'd previously see small fragments
of inline content outside the right edge of the containing block.
This was apparently never used by anyone except me, and currently
fails silently.
The script originally allowed easy inspection of potentially missing
resources, but that seems no longer useful. Even after restoring the
script to a working state, I found nothing with it.
A somewhat usable version might be available at
https://github.com/BenWiederhake/serenity/tree/historic/lint-missing-resources.sh
However, there seems to be no interest in the script, so it is better to
remove it.
This was apparently never used by anyone except me, and currently
fails silently.
The script originally allowed easy inspection of the difference between:
1. The list of declared syscalls according to Kernel/API/Syscall.h
2. The list of syscalls implemented by the UserspaceEmulator according
to Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
3. The list of syscalls documented in Base/usr/share/man/man2/.
Here's how the script could have been updated:
SYSCALLS_KERNEL="$(echo 'Kernel syscalls'; echo; \
grep -Eo '^ +S\(.*, NeedsBigProcessLock::' Kernel/API/Syscall.h | \
sed -Ee 's-^ +S\((.+), .*-\1-' | sort)"
SYSCALLS_UE="$(echo 'Implemented in UserspaceEmulator'; echo; \
grep -Eo '^ +case SC_.*:$' \
Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp | \
sed -Ee 's,^ +case SC_(.*):$,\1,' | sort)"
SYSCALLS_MAN2="$(echo 'Documented syscalls'; echo; \
find Base/usr/share/man/man2/ ! -type d -printf '%f\n' | \
sed -Ee 's,\.md,,' | sort)"
diff --color=always \
<(echo "${SYSCALLS_KERNEL}") <(echo "${SYSCALLS_UE}")
diff --color=always \
<(echo "${SYSCALLS_KERNEL}") <(echo "${SYSCALLS_MAN2}")
A more readable version might be available at
https://github.com/BenWiederhake/serenity/tree/historic/syscall-linting
However, there seems to be no interest in the script, so it is better to
remove it.
basename from GNU coreutils 8.32 (the default on Debian Bullseye, as
bash 5.2.0 does not include basename as a built-in command) does not
accept multiple arguments. This will cause the command to fail with no
output, and the error code not being propagated for some reason. This
means that the loop never gets executed, and thus the check never
actually does anything. This commit fixes that behavior by calling
'basename' multiple times.
Not visiting the field holding SubtleCrypto in Crypto caused subtle
crashes all over the Value functions, due to accessing SubtleCrypto
after it was garbage collected (and potentially replaced by a new cell).
This meant that the crashes were only appearing in Value::to_boolean,
Value::typeof, etc. Which then held pointer to things that looked like
Shapes, Environments and other non-Object Cells.
To find the actual cause, all pointer used to construct Values were
checked and if a pointer was none of the allowed types, the backtrace
is logged.
Co-authored-by: Luke Wilde <lukew@serenityos.org>