Commit graph

50841 commits

Author SHA1 Message Date
Josh Spicer
084ba2ef9d Meta: Remove unnecessary dot in file name
Fixes a small typo in the file name.

Codespaces and other tools implementing the spec
https://containers.dev/implementors/spec/#devcontainerjson
will expect this file naming pattern.
2023-05-29 13:42:08 +02:00
Tim Schumacher
58b1d9c319 AK: Correctly calculate size of the last AllocatingMemoryStream chunk 2023-05-29 13:30:46 +02:00
Tim Schumacher
52aab50914 AK: Handle empty trailing chunks in AllocatingMemoryStream::offset_of 2023-05-29 13:30:46 +02:00
Tim Schumacher
9a7ae52b31 AK: Expose AllocatingMemoryStream::CHUNK_SIZE
This allows the tests to use that information confidently.
2023-05-29 13:30:46 +02:00
Ben Wiederhake
2b8a527478 AudioApplet: Read and apply config value only once 2023-05-29 13:22:58 +02:00
Ben Wiederhake
f38dcc64b5 AudioApplet: Store default config value in a single place
The hope is that this can later be used to:
- verify that all accesses to the same key use the same default value,
- and extract the default values more easily.
2023-05-29 13:22:58 +02:00
Ben Wiederhake
8df7b42078 FileSystemAccessServer: Don't transmit unused data
The server cannot use these values anywhere, because this method always
sets 'prompt = ShouldPrompt::No'. This saves a bunch of roundtrips for
all clients that use FSAS to read abritrary files.
2023-05-29 13:17:22 +02:00
Andreas Kling
5857f24bc8 LibWeb: Only update style for the element being animated by CSS
Unlike DOM mutations, CSS animations don't affect the style of the
entire subtree of the element being animated. This means we only have to
recompute style for the animating element, which is significantly
faster than doing the whole subtree.

This takes idle CPU usage on https://shopify.com/ from 100% to 30% on my
(not massively powerful) laptop. :^)
2023-05-29 06:05:03 +02:00
Ali Mohammad Pur
3ed26e9af8 LibWeb: Respect the CSS animation-direction property for animations 2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
19c92fa354 LibWeb: Respect the animation-fill-mode CSS property 2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
2e71263c5c LibWeb: Make sure finished animations are not restarted
This commit makes the StyleComputer avoid restarting finished animations
(e.g. animations with finite iteration counts that have run to
completion).
As a bonus, it also disables the animation timer when all animations
have finished running.
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
e90752cc21 LibWeb: Add preliminary support for CSS animations
This partially implements CSS-Animations-1 (though there are references
to CSS-Animations-2).
Current limitations:
- Multi-selector keyframes are not supported.
- Most animation properties are ignored.
- Timing functions are not applied.
- Non-absolute values are not interpolated unless the target is also of
  the same non-absolute type (e.g. 10% -> 25%, but not 10% -> 20px).
- The JavaScript interface is left as an exercise for the next poor soul
  looking at this code.

With those said, this commit implements:
- Interpolation for most common types
- Proper keyframe resolution (including the synthetic from-keyframe
  containing the initial state)
- Properly driven animations, and proper style invalidation

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
f07c4ffbc8 LibWeb: Add CSS::Time::to_milliseconds() 2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
b7e3a68bfc LibWeb: Keep track of CSS property source declarations
This allows us to figure out where a specific CSS property comes from,
which is going to be used in a future commit to uniquely identify
running animations.
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
279924242d LibWeb: Add CSS CompositeStyleValue
This represents the value of properties assigned via their shorthands,
and is expanded when computing actual property values.
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
49bb04a6ba LibWeb: Visit CSS block tokens for var() tokens as well
Also extract the equirecursive lambda functions into separate functions
to simplify the code a little bit.
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
5cd01bd644 LibWeb: Allow '0' as a CSS dimension value
The comment mentions that zero is let through, but then immediately
errors out if it sees any number outside quirks mode.
This commit makes that check let zeros through.
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur
e47f81d954 Ladybird+Browser: Add a 'Dump All Resolved Styles' debug option
This option dumps all styles for all elements in the document; very
helpful for finding properties that have changed unintentionally :^)
2023-05-29 05:35:41 +02:00
Andreas Kling
549260d311 headless-browser: Disable content filtering when running tests
URL filtering was taking up a huge amount of time when burning through
the tests. We're not gonna have a bunch of ads to block in our local
tests, so let's just turn it off when running them.
2023-05-28 22:03:57 +02:00
Andreas Kling
ad6027433d headless-browser: Print a diff when a test failure occurs
This will make it a lot easier to understand what went wrong, especially
when the failure occurs on CI but not at home.

And of course, use LibDiff to generate the diff! :^)
2023-05-28 22:03:57 +02:00
Andreas Kling
097b5e4803 WebContent+headless-browser: Use document.body.innerText for text tests
This should be less fickle than the "select all & copy selected text"
trick we were doing earlier.
2023-05-28 22:03:57 +02:00
Andreas Kling
58c1cb80bb Tests/LibWeb: Use the include.js helper in "basic.html" 2023-05-28 22:03:57 +02:00
Aliaksandr Kalenik
ac280277b7 LibWeb: Use HashMap instead of Vector to store grid areas in GFC
Grid areas are accessed by their name (string) so HashMap is more
appropriate data structure to store them.
2023-05-28 21:28:28 +02:00
Karol Kosek
dfde972baf LibGUI: Fix crooked close button on active tabs in the TabWidget
This is a regression from f391ccfe53.
The bug didn't appear on inactive tabs, as they already use
`translated(1, -2)`.
2023-05-28 21:12:19 +02:00
Aliaksandr Kalenik
94fd17a467 LibWeb: Wrap child text sequences of grid container in anonymous blocks
From spec https://drafts.csswg.org/css-grid/#grid-items:
"Each in-flow child of a grid container becomes a grid item, and each
child text sequence is wrapped in an anonymous block container grid
item."

Fixes the problem that text sequences inside grid containers are
ignored and not displayed.
2023-05-28 21:12:04 +02:00
Aliaksandr Kalenik
537256fae2 LibWeb: Treat unresolvable percentages as auto to resolve sizes in GFC
Fixes the bug that currently we always consider tracks with percentage
size as ones with "fixed" length even when available size is not
definite. With this change tracks with percentage size when available
size is not definite will be considered as "intrinsic" sized.
2023-05-28 20:26:05 +02:00
Andreas Kling
30feb95d53 LibWeb: Support reverse flex layout with space-around/space-between
We were not taking reverse flex directions into account when choosing
the initial offset for flex item placement if justify-content were
either space-around or space-between.
2023-05-28 18:02:00 +02:00
Nico Weber
d15ae9fa93 WebP/Lossy: It's 'macroblock', not 'metablock'
Somehow my brain decided to change the name of this concept.
Not sure why, the spec consistently uses 'macroblock'.

No behavior change.
2023-05-28 18:01:31 +02:00
Andi Gallo
b8a097f74b LibWeb: Add missing check in CrossOriginGetOwnPropertyHelper
We have to check that the entry in CrossOriginProperties is the one
actually requested from the caller before executing the body of the
loop. This fixes a crash triggered by YouTube iframe embedding.
2023-05-28 18:00:54 +02:00
Daniel Bertalan
41f7f821f6 Toolchain+Ports: Use ftpmirror.gnu.org for faster downloads
This service automatically redirects to a mirror that's geographically
closer, which should make downloading the tarballs faster. The GNU
project recommends this instead of bombarding their top-level downloads
site.
2023-05-28 06:34:12 -07:00
Daniel Bertalan
9bceff88c8 Toolchain: Fix Linux libisl detection in BuildGDB.sh
There is no top-level `isl.h`, let's check for `isl/version.h` instead.
2023-05-28 06:34:12 -07:00
Daniel Bertalan
4ff30a7302 LibTest: Use the 16 standard ANSI colors in status output
Neither Azure Pipelines' log viewer, nor macOS Terminal.app support full
24-bit RGB color codes, causing the text output to be displayed
incorrectly. Fix this by using one of the 16 standard colors.

Most terminal emulators use a relatively dark shade for red by default,
as seen in the "ANSI escape code" Wikipedia article, so change the
foreground color to white to preserve contrast.
2023-05-28 06:31:59 -07:00
MacDue
778265ae9d LibJS: Fix reading cached source ranges
Made a slight logic error in 95d69fc which meant the dummy range would
be returned even if the source_range_storage contained an actual source
range. This corrects that by resolving the null unrealized range to a
dummy range, and storing that. It then can be treated as a normal source
range.
2023-05-28 14:40:22 +02:00
MacDue
95d69fcf74 LibJS: Fix crash when trying to get source range
Previously, source_range() could crash attempting to read from a null
unrealized->source_code pointer. It looks like the previous behaviour
here was to return a dummy source range, so this commit restores that.

With this loading https://github.com/SerenityOS/serenity works again.
2023-05-28 13:57:51 +02:00
Sam Atkins
a5aabb7940 SpaceAnalyzer: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Sam Atkins
da8da79e62 LibCore: Add wrapper for fstatat()
`Core::System::fstatat()` is similar to our standard `Core::System`
wrappers.

`Core::Directory::stat(relative_path, flags)` is a convenience method if
you already have a Directory, to stat a file relative to it.
2023-05-28 05:51:27 -06:00
Sam Atkins
c140b67be3 AK: Verify that we don't call Error::from_errno(0)
We shouldn't ever make an Error if there wasn't actually an error. :^)
2023-05-28 05:51:27 -06:00
Sam Atkins
6bcde0dcf4 LibCore: Don't record false DirIterator errors
`readdir()` returns null if there is an error, OR if we reached the end.
We don't need to create an Error if there wasn't one.
2023-05-28 05:51:27 -06:00
Sam Atkins
cec8543097 Terminal: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Sam Atkins
28a4adba3d DisplaySettings: Migrate to Core::Directory::for_each_entry() 2023-05-28 05:51:27 -06:00
Rafał Babiarz
fb445fc523 Ladybird: Add placeholder to LocationEdit 2023-05-28 05:47:20 -06:00
Shannon Booth
500552df54 LibWeb: Apply rules for parsing a legacy color value 2023-05-28 13:24:37 +02:00
Shannon Booth
bc54560e59 LibWeb: Add Web::HTML::parse_legacy_color_value
This function follows the "rules for parsing a legacy color value"
which is used in some legacy attributes, such as 'bgcolor' in the body
element.
2023-05-28 13:24:37 +02:00
Shannon Booth
15151d7a4c LibGfx: Add Color::from_named_css_color_string
This is factored out from Color::from_string and determines the color
only from performing an ASCII case-insensitive search over the named
CSS colors.
2023-05-28 13:24:37 +02:00
Andreas Kling
f5bf53bc99 LibWasm: Create AK::StackInfo once per AbstractMachine
This makes test-wasm about 20% faster on my Linux machine :^)
2023-05-28 13:20:56 +02:00
Daniel Bertalan
4cc1de1b03 CI: Add testing for AArch64 :^)
This should help us avoid accidentally breaking the build for AArch64.
Currently, some tests are expected to fail, so CI runs will be
considered successful even if the kernel panics or if there are test
failures.

For now, we have to build Qemu with a custom patch from source in order
for SystemServer to detect self-test mode.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
2e0e80db69 LibC: Ensure that struct group::gr_mem pointers are aligned
Otherwise, we get a UBSan crash in SystemServer before we could even
start running tests on AArch64.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
7987bf5b92 Kernel/aarch64: Add RPi/MMIO.cpp to SOURCES_RUNNING_WITHOUT_MMU
Otherwise, `MMIO::MMIO` will fault on the RPi 3 due to accessing
`__stack_chk_guard` before the kernel is mapped into high memory.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
12a2f741a7 LibCrypto: Add workaround for false -Warray-bounds warning
When building for AArch64 with UBSan enabled, GCC 13.1 reports a false
"array out of bounds" error on access to offset `1 * sizeof(u64)`.
Changing the order of the stores seems to silence it.
2023-05-28 05:05:09 -06:00
Daniel Bertalan
6bcd73a2ff Toolchain: Disable libstdc++ PCH compilation
These are not useful for us, and unnecessarily waste time when building
the toolchain. Even if we used libstdc++ more heavily, our use of
uncommon, PCH-affecting flags and our frequent LibC header changes would
make these ineligible for use anyways.
2023-05-28 05:05:09 -06:00