Commit graph

50838 commits

Author SHA1 Message Date
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
Sam Atkins e8a946c674 LibWeb: Remove StyleValue::has/to_length()
Specifically, stop letting NumericStyleValues holding `0` from
pretending to hold a Length. The parser is now smart enough that we
don't have to do this. :^)
2023-05-27 16:12:25 +02:00
Sam Atkins 6bbf163499 LibWeb: Create a LengthStyleValue for flex-basis of 0
We're about to stop letting 0 NumericStyleValues pretend to be Lengths,
so this will break. As noted, the flex-basis property accepts
`<length>` not `<number>` so this is actually correct.
2023-05-27 16:12:25 +02:00
Sam Atkins 5cbf6eb930 LibWeb: Remove StyleValue::has/to_integer()
Only NumericStyleValue holds integers.

I'm not sure our current distinction between NumericStyleValue holding
an integer or non-integer is useful given it always returns a float.
:thonk:
2023-05-27 16:12:25 +02:00
Sam Atkins 4ecf0b7768 LibWeb: Remove StyleValue::has/to_number()
Only NumericStyleValue holds numbers.

Renamed `to_number()` to `number()` because it's just a getter now.
2023-05-27 16:12:25 +02:00
Sam Atkins 5f755d721e LibWeb: Remove StyleValue::has_rect()
This behaves identically to `is_rect()`
2023-05-27 16:12:25 +02:00
Karthik Karanth f60446bbfe LibWeb: Unit tests for min/max-inline-size 2023-05-27 16:02:33 +02:00
Karthik Karanth 733b74af7c LibWeb: Support min-inline-size & max-inline-size
Currently this assumes that writing-mode is horizontal, and therefore
only affects the min-width/max-width
2023-05-27 16:02:33 +02:00
Karthik Karanth 72507c318a LibWeb: Add logical-alias-for in Properties.json
This allows for succint definitions of logical properties, by allowing
them to inherit initial values, valid identifiers, etc from another
property
2023-05-27 16:02:33 +02:00
Lucas CHOLLET e78d1ec03a LibJS/Runtime: Use Core::File in VM::resolve_imported_module 2023-05-27 06:48:25 -06:00
Andreas Kling edbc732785 Ladybird+Tests/LibWeb: Add very basic text-only test harness
This allows us to create "text tests" in addition to "layout tests".
Text tests work the same as layout tests, but dump the document content
as text and exit upon receiving the window "load" event.
2023-05-27 14:03:49 +02:00
Andreas Kling 3389eed59c headless-browser: Add a --dump-text mode for simplified run & dump tests
This dumps the text content of the page (via a cheesy "select all" +
"get selected text" maneuver) :^)
2023-05-27 14:03:49 +02:00
Matthew Olsson 22e97332fc LibWeb: Throw the correct object when enqueuing to a readable stream 2023-05-27 13:55:14 +02:00
Matthew Olsson 4c8015c1f6 LibWeb: Do not clear stream algorithms (and add corresponding FIXMEs) 2023-05-27 13:55:14 +02:00
Matthew Olsson dd65d60069 LibWeb: Use doubles for Stream's high_water_mark and queue_total_size
This matches the IDL types
2023-05-27 13:55:14 +02:00
Matthew Olsson f63d027b0b Meta: Fix unresolvable reference to WebIDL::OperationReturnsPromise 2023-05-27 13:55:14 +02:00
Matthew Olsson bdfc14f24d LibWeb: Accept explicit "type: undefined" in UnderlyingSource 2023-05-27 13:55:14 +02:00
Matthew Olsson 5d48ade508 LibWeb: Use TRY() to convert invoke_callback result to an ExceptionOr
Otherwise, the JS::Completion is always interpretted as an error by
ExceptionOr.
2023-05-27 13:55:14 +02:00