Commit graph

41097 commits

Author SHA1 Message Date
martinfalisse b7d053421e LibWeb: Calculate sizes of known grid track sizes
Calculate the sizes of grid tracks for which there is a clear size
(length or percentage has been specified).
2022-09-14 00:09:14 +02:00
martinfalisse 6b649b6343 LibWeb: Start sizing grid tracks
The second part of formatting the display grid is calculating the sizes
of the columns and rows.
2022-09-14 00:09:14 +02:00
martinfalisse 902bdc8f15 LibWeb: Position remaining grid items 2022-09-14 00:09:14 +02:00
martinfalisse 707b76ed41 LibWeb: Position grid items with fixed row positions 2022-09-14 00:09:14 +02:00
martinfalisse f143fefca2 LibWeb: Position grid items with fixed position values 2022-09-14 00:09:14 +02:00
martinfalisse e0cd63f531 LibWeb: Add array to keep track of grid boxes left to place
This structure will be useful to subtract from after placing different
boxes into the grid.
2022-09-14 00:09:14 +02:00
martinfalisse a2ecb903af LibWeb: New start at layouting out the grid
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.
2022-09-14 00:09:14 +02:00
martinfalisse df88e2bd8e LibWeb: Add spec utility function for GridTrackSize
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".
2022-09-14 00:09:14 +02:00
martinfalisse 9681eb89a6 LibWeb: Add helper function for creating auto GridTrackSizes
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.
2022-09-14 00:09:14 +02:00
martinfalisse ad221164d5 LibWeb: Allow having auto GridTrackPlacements
For grid-row-start, grid-column-end and similar values it is possible to
have auto values (nothing was specified, for example).
2022-09-14 00:09:14 +02:00
martinfalisse 0613972f0c LibWeb: Only set has_span if there is a number following the css value
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.
2022-09-14 00:09:14 +02:00
martinfalisse 493c6cf0fd LibWeb: Parse flexible length values for GridTrackSizes
Fix a bug as well as implement new functionality by parsing flexible
length values for GridTrackSizes.
2022-09-14 00:09:14 +02:00
martinfalisse 2fa124e8d9 LibWeb: Use float for GridTrackSize length value
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.
2022-09-14 00:09:14 +02:00
martinfalisse ca3d479f6f Base: Add more tests for display: grid 2022-09-14 00:09:14 +02:00
Hendiadyoin1 1ea90e340c LibWeb: Visit all edge-members in WorkerGlobalScope 2022-09-13 20:55:21 +02:00
Hendiadyoin1 34439a04e8 LibWeb: Add a visit_edges for DOM/Event 2022-09-13 20:55:21 +02:00
Hendiadyoin1 e68a35611b LibJS: Mark test262's __assert_fail as extern "C" and use
...`__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]]`.
2022-09-13 20:55:21 +02:00
Hendiadyoin1 5bd34f115e LibWeb: Add some missing includes 2022-09-13 20:55:21 +02:00
Jelle Raaijmakers 6dcc808994 LibSoftGPU: Reduce subpixel precision from 6 to 4 bits
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`).
2022-09-13 20:20:03 +02:00
Jelle Raaijmakers bac7a12fb9 LibGL: Simplify setting the color mask 2022-09-13 20:20:03 +02:00
Jelle Raaijmakers 8e3b7df408 LibGL: Implement GL_SAMPLES, GL_SAMPLE_BUFFERS context parameters
We do not support multisampling right now, so we return constant values
that indicate this.
2022-09-13 20:20:03 +02:00
Jelle Raaijmakers 62846b4691 LibGL: Implement all glMultiTexCoord*f API methods 2022-09-13 20:20:03 +02:00
Jelle Raaijmakers eda1ffba73 LibGL: Implement GL_TEXTURE_LOD_BIAS for texture objects 2022-09-13 20:20:03 +02:00
Jelle Raaijmakers 59fc2a4aad LibGL: Implement all glRasterPos2* API methods 2022-09-13 20:20:03 +02:00
Jelle Raaijmakers 7e85ec3431 Ports: Do not allow clean* to be overridden
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.
2022-09-13 13:44:01 -04:00
Jelle Raaijmakers 5bfc61bc69 Ports: Actually clean port build directory
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.
2022-09-13 13:44:01 -04:00
djwisdom 27fa038ffa Ports: Update serenity-theming use latest commit fbd26ec 2022-09-13 13:40:26 -04:00
networkException 40984d3355 Meta: Add confirmation for toolchain rebuilds if there's one already 2022-09-13 13:39:15 -04:00
Sam Atkins 76f524c1d6 Base: Skip Shell tests
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.
2022-09-13 13:14:59 -04:00
Timothy Flynn 10727ade4c Meta: Add Lagom option to disable building LibWeb
Compiling LibWeb for Lagom can add quite a bit of compile time. Add a
CMake option to disable it locally.
2022-09-13 17:05:20 +02:00
Andreas Kling 2cc947ede4 Kernel: Use correct timestamp in sys$utimens()
We were mixing up the nanosecond and second parts of the timestamps.

Regressed in 280694bb46.
2022-09-13 17:03:31 +02:00
Andreas Kling 54e0e85581 LibWeb: Treat percentage width/height as "auto" more consistently in BFC
Since we can't resolve percentage sizes against an indefinitely-sized
containing block, treat the sizes as "auto" in all these cases.
2022-09-13 17:03:31 +02:00
Andreas Kling 71ca857b67 LibWeb: Break lines until we have enough space between floats
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.
2022-09-13 17:03:31 +02:00
Andreas Kling c9a7853fef LibWeb: Include all floating descendants in BFC root's automatic height
Before this change, we were only considering floating boxes that were
immediate children of the BFC root.
2022-09-13 17:03:31 +02:00
Ben Wiederhake 005cd4e456 Meta: Remove unused and outdated lint-missing-resources.sh lint
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.
2022-09-13 08:29:09 +00:00
Ben Wiederhake 93b8e76133 Meta: Remove unused and outdated check-syscall-lists.sh lint
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.
2022-09-13 08:29:09 +00:00
Ben Wiederhake 616b3dc718 Meta: Fix check for AK test inclusion
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.
2022-09-13 08:29:09 +00:00
davidot 1d846e5591 LibWeb: Visit internal fields of Crypto in visit_edges
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>
2022-09-12 20:14:58 -04:00
Ben Wiederhake 0e901f8c68 Shell: Sort CompletionSuggestions for paths lexicographically
This used to be ordered by inode, which can be surprising.
2022-09-12 16:49:48 +01:00
networkException 802cf9bc69 Everywhere: Use my very shiny serenityos.org email :^) 2022-09-12 15:13:12 +01:00
Ali Mohammad Pur 660d2b53b1 LibRegex: Account for eof after \<x> when 'x' leads to legacy behaviour 2022-09-12 16:03:57 +04:30
Ali Mohammad Pur 48442059fc LibRegex: Consume exactly two chars for escaped characters
We were previously consuming an extra char afterwards, which could be
the charclass terminator, leading to possible OOB accesses.
2022-09-12 16:03:57 +04:30
Filiph Sandström 7e1e208d08 Kernel: Add basic aarch64 support to MemoryManager
FIXME: There's still a lot to do like for example, port `quickmap_page`.
This does however get us further into the boot process than before.
2022-09-12 00:56:44 +01:00
Filiph Sandström 14fe03569a Kernel: Add support for displaying critical output on aarch64 2022-09-12 00:56:44 +01:00
Filiph Sandström 3b331a83e2 Kernel: Include CommandLine as a part of aarch64 2022-09-12 00:56:44 +01:00
Filiph Sandström fcd1cf4e1b Kernel: Include DeviceManagement as a part of aarch64 2022-09-12 00:56:44 +01:00
networkException 45aeba15c8 CharacterMap: Allow resizing the unicode block list
Previously we would constrain the unicode block list to a width of 175,
causing it to stick to the splitter when manually resizing.

This patch allows resizing the list properly while retaining the new
width when resizing the window.
2022-09-11 23:25:08 +01:00
Linus Groh 81f1183e28 Tubes: Run clang-format 2022-09-11 23:24:33 +01:00
Jelle Raaijmakers 9dfe50170e Demos: Add Tubes :^) 2022-09-11 22:45:49 +01:00
Jelle Raaijmakers 16ca9ec762 LibGfx: Templatize VectorN::length()
This allows us to get a `float` length from an `IntVector3` without
needing to convert to `FloatVector3` first.
2022-09-11 22:45:49 +01:00