Commit graph

50805 commits

Author SHA1 Message Date
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
Daniel Bertalan 65a97ad503 Tests/Kernel: Do not build TestEFault on AArch64
This test currently causes a kernel panic, as we do not handle SafeMem
exceptions correctly (beb55f726f).
2023-05-28 05:05:09 -06:00
Daniel Bertalan 2a2787b199 Kernel/aarch64: Make Processor::capture_stack_trace stub non-crashing
This is the only kernel issue blocking us from running the test suite.
Having userspace backtraces printed to the debug console during crashes
isn't vital to the system's function, so let's just return an empty
trace and print a FIXME instead of crashing.
2023-05-28 05:05:09 -06:00
Daniel Bertalan 58da4c93fb Toolchain+CI: Remove cache handling logic from BuildIt.sh
Instead of manually compressing/decompressing a toolchain tarball if
`TRY_USE_LOCAL_TOOLCHAIN` is set, let's use the cache action's automatic
built-in compression (which is zstd, I believe).
2023-05-28 05:05:09 -06:00
Daniel Bertalan 18ee6e457d CI: Update actions/cache to v3
This version now natively supports read-only caches (`cache/restore@v3`)
so we no longer need to pin the version to a commit in actions/cache#489
which is an unmerged PR.

The update is mostly mechanical:
- Steps with `CACHE_SKIP_SAVE` not set can use the plain `cache@v3`
  action.
- Steps with `CACHE_SKIP_SAVE` set to a constant `true` are changed to
  `cache/restore@v3`.
- Steps with saving disabled when running on a pull request are changed
  to a pair of `cache/restore@v3` and `cache/save@v3`. This setup is
  used for the large (100s of MB) ccache and Toolchain caches. As caches
  saved in pull requests can only be utilized from within the same PR,
  uploading these would only waste time and our storage quote.
  Therefore, we skip the `save` steps if running on a PR.

Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
2023-05-28 05:05:09 -06:00
Andi Gallo c411b5408e LibWeb: Improve support for selecting an image source
Apply media conditions before selecting a size and add an algorithm to
select an image source based on pixel density.
2023-05-28 12:11:10 +02:00
Andi Gallo 29d29134ba LibWeb: Skip children based on media when updating the source set
If child has a media attribute and its value does not match the
environment, continue to the next child.
2023-05-28 12:11:10 +02:00
Andreas Kling 87ac906ee6 LibJS: Make Error stack traces lazier
Instead of eagerly populating the stack trace with a textual
representation of every call frame, just store the raw source code range
(code, start offset, end offset). From that, we can generate the full
rich backtrace when requested, and save ourselves the trouble otherwise.

This makes test-wasm take ~7 seconds on my machine instead of ~60. :^)
2023-05-28 10:03:11 +02:00
Andreas Kling 6c81b90e5a headless-browser: Call fflush() between tests when running on TTY
This allows us to see the full test name without getting cut off by
stdio buffering. :^)
2023-05-28 08:03:52 +02:00
Nico Weber ea54c58930 WebP/Lossy: Variable naming fix for constants from last pull request 2023-05-27 15:25:00 -06:00
Nico Weber bd5290dd45 WebP/Lossy: Add code to read macroblock metadata 2023-05-27 15:25:00 -06:00
Nico Weber 8159709c83 WebP/Lossy: Add static data tables for reading macroblock metadata 2023-05-27 15:25:00 -06:00
MacDue 02d131bc4d LibWeb: Fix goofy CRC2D.arc() behaviour
This PR corrects the signs of the start/end points that are passed
to the elliptical_arc_to(), it also removes the bogus path.close()
after creating the arc. Now .arc() seems to work correctly.
2023-05-27 22:13:26 +02:00
Andreas Kling f7eb8eed34 Ladybird: Run all layout & text tests in the same process
Instead of starting a new headless-browser for every layout & text test,
headless-browser now gets a mode where it runs all the tests in a single
process.

This is massively faster on my machine, taking a full LibWeb test run
from 14 seconds to less than 1 second. Hopefully it will be a similarly
awesome improvement on CI where it has been soaking up more and more
time lately. :^)
2023-05-27 21:28:05 +02:00
Sam Atkins af68bf862f LibWeb: Resolve border[-color,-style,-width] properties 2023-05-27 20:55:00 +02:00
Sam Atkins abdd4a8733 LibWeb: Add helper for creating resolved values for sided shorthands
...and use it for `margin` and `padding`.

So now, if all four margins are 12px, we output "12px" instead of "12px
12px 12px 12px". This matches the spec's requirement to use the smallest
non-ambiguous representation.
2023-05-27 20:55:00 +02:00
Sam Atkins e8dc8f697b LibWeb: Alphabetize style_value_for_property() property list 2023-05-27 20:55:00 +02:00
Sam Atkins ee1fc56f02 LibWeb: Resolve background-size property 2023-05-27 20:55:00 +02:00
Sam Atkins d5fbec8a49 LibWeb: Resolve background-position[-x,-y] properties 2023-05-27 20:55:00 +02:00
Sam Atkins 3ed2c6da72 LibWeb: Resolve appearance property 2023-05-27 20:55:00 +02:00
Sam Atkins db09f0e0c1 LibWeb: Resolve align-{content,items,self} properties 2023-05-27 20:55:00 +02:00
Sam Atkins 6a51ef9c9b LibWeb: Resolve accent-color property 2023-05-27 20:55:00 +02:00
Sam Atkins 0374b42f20 LibWeb: Remove CSS:: prefix from ResolvedCSSStyleDeclaration.cpp code
These prefixes weren't adding anything except some visual clutter, in
code that already has A::Lot::Of::This.
2023-05-27 20:55:00 +02:00
Andrew Kaster 5fd2fc70e5 LibWebView: Don't re-create WebContent proceses when repeatedly crashing
Serenity handles this in the SystemServer already, but the simplest
place to put this logic is the ViewImplementation base class.

This is trivial to see when running Ladybird without SERENTIY_SOURCE_DIR
set, or set improperly.
2023-05-27 20:09:50 +02:00
Ben Wiederhake bdeccf8844 Chess+ChessEngine: Fix stockfish by setting correct blocking flag
Stockfish apparently cannot handle non-blocking I/O, and it does not
make sense to assume that all chess engines can do so.

Fixes #18946.
2023-05-27 18:44:21 +02:00
Ben Wiederhake 62ebb78433 AK: Enable Core::File to switch blocking-mode during use
This closely mirrors Socket::set_blocking. Note that it does not make
sense to make this a virtual method on a base class, since
SeekableStream and FixedMemoryStream cannot possible be anything except
than blocking.
2023-05-27 18:44:21 +02:00
MacDue 6f8c2dc322 LibWeb: Make SVG transform parser less crashy
Previously, this would blindly use parse_number() without checking if
there was a number to parse. This meant we would crash on transforms
like:
	rotate(BAD 32 0)

Now the attribute just gracefully fails to parse.
2023-05-27 18:40:41 +02:00
Andreas Kling 33500bb6db LibWeb: Protect against null deref during Web::Page initialization
BrowsingContext::set_active_document() may end up asking for the Page's
top level browsing context before Page has one. Do a workaround for now
where we have an API to ask if it's initialized.

Long-term we should find a cleaner solution.
2023-05-27 18:38:40 +02:00
Ben Wiederhake f07ac8f20a HackStudio: Prefer FileSystem over DeprecatedFile
This also straightens out the logic to determine the project_path.
Instead of calling realpath on potentially-null strings and sometimes
not even reading the result, we now only make these calls when required,
and properly handle any error.
2023-05-27 17:30:55 +02:00
Ben Wiederhake 0fab68ee16 LibCoredump: Avoid unnecessary conversion to DeprecatedString 2023-05-27 17:30:55 +02:00
Andreas Kling fdbdc4d5ff LibWeb: Only forward scroll requests for the top-level browsing context
We don't want to scroll the whole web view just because some iframe is
asking to be scrolled.
2023-05-27 17:26:29 +02:00
Andreas Kling 58d3322b0e LibWeb: Don't tell UI process about subframe title changes
This fixes an issue where loading an iframe would cause the current
browser tab title to get overwritten with an empty string.

The problem is that nested browsing contexts can be considered "top
level" during their initialization, but only one browsing context is
ever the Page::top_level_browsing_context(), so that's what we check.
2023-05-27 17:26:29 +02:00
Andreas Kling 7603f8dcae Ladybird: Use the DALL-E ladybird globe as the application icon
This looks a lot more "at home" than usual pixel art logo on
non-SerenityOS systems. :^)

Also, stop using site favicons as the app icon as that made it
annoyingly hard to find Ladybird in task switchers sometimes.
2023-05-27 17:26:29 +02:00
Andreas Kling a98f5c7251 LibWeb: Make resolved serialization of CSS display prefer short form
Although we translate e.g `block` to `block flow` for internal use in
the engine, CSS-DISPLAY-3 tells us to use the short form in
serializations for compatibility reasons.

This adds 9 points to our score on https://html5test.com/ :^)
2023-05-27 16:43:35 +02:00
Nico Weber 8defd55349 WebP/Lossy: Add code to read the frame header in the first partition 2023-05-27 08:31:03 -06:00
Nico Weber 24a3687986 WebP/Lossy: Add WebPLoaderLossyTables.h
This will contain several of the fixed data tables from the VP8 spec.
For starters, it contains the tables needed to read the frame header
in the first partition. These tables are needed to read the
probabilities of the metablock predicition modes, which in turn will
be needed to read the metablock predicition modes themselves.
2023-05-27 08:31:03 -06:00
Nico Weber bbc1f57d1e WebP/Lossy: Add a comment with a summary of the file format 2023-05-27 08:31:03 -06:00