This is an attempt to fix the hanging CI on macOS caused by some
screenshot requests being stuck unprocessed. With this change, we at
least make sure that the HTML event loop processing, which triggers
repainting, will happen as long as there are navigables that need to be
repainted.
(cherry picked from commit 72b4d44d07e12cc04bde90872e2f31aaab64aa00)
There are a few instances where comments and documentation have minor
grammar issues likely resulting from English being the author's second
language.
This PR fixes several such cases, changing to idiomatic English and
resolving where it is unclear whether the user or program/code is
being referred to.
This avoids an unnecessary lossy conversion for the current time from
double to i32. And avoids an UBSAN failure on macOS that's dependent
on the current uptime.
(cherry picked from commit 55c1b5d1f4d7c82f0a68323260cb2e0f7de2faae,
amended to fix a typo in the commit message)
On several platforms, we don't yet have audio
support, so audio devices are missing. Instead of
having AudioServer crash repeatedly, and not
having the ability to open any app that relies on
it, we should instead handle missing devices
gracefully. This implementation is minimal, audio
device hotplugging support and such should be
implemented together with multi-device support.
AudioServer will start up and seem to function
normally without an audio device, but it will
pretend the device has a sample rate of 44.1 kHz
and all audio input is discarded.
This implements the start of lossless webp's compression scheme,
which is almost, but not quite, entirely unlike deflate.
The green channel is now green-or-length, and has up to 280
entries, instead of up to 256 before. We now use the 40-entry
distance code (even though it only ever stores 1s now).
Due to this, a few places change to taking spans instead of
Array<256>s.
The spec only has the transform from prefix or distance code
to value. The inverse prefix_decompose() in this patch is
my own invention. I checked with a python script that it's
a true inverse (see PR for the script).
We now look for back-references with a distance of 1, which is
equivalent to run-length encoding. It's fairly fast to compute,
but leaves compression on the table. Full window-based
back references will be in a future PR.
We also still don't do color cache entries yet, but that should
be fairly straightforward to add. (It will make the green channel
larger than 280 entries.)
We still use a single global huffman table for the entire image.
Doing one per tile should be doable with the organization we now
have, and might also be in a future PR.
File sizes, and perf numbers on HEAD before this patch series (see
previous commit for perf comparison to previous commit):
sunset-retro.png (876K):
1.7M -> 1.6M,
25.3 ms ± 0.5 ms -> 27.5 ms ± 0.8 ms
(helps little; from 1.94x as input to 1.83x as large.
About 5% smaller, for about a 10% slowdown.)
wow.gif (nee giphy.gif) (184k):
3.9M -> 1.4M
105.7 ms ± 1.7 ms -> 74.0 ms ± 1.1 ms
(from 21.2x as big as the gif input to 7.6x as big.
About 64% smaller, for a 28% speed _up_.)
7z7c.gif (11K):
40K -> 8.4K
13.9 ms ± 0.6 ms -> 12.9 ms ± 0.5 ms
(from 3.6x as big as the gif input to 0.76x as big :^)
About 79% smaller, for a 7% speed _up_.)
We now do this in two passes instead of in one. This is virtually free
performance-wise, and allows nicer factoring.
Perf numbers after this change (see previous commit for perf numbers
before):
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 26.7 ms ± 0.8 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 14.5 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 108.2 ms ± 2.2 ms
No behavior change yet, but this will allow us to emit distance/length
and color cache symbols in addition to literal symbols.
Not super expensive perf-wise. Before:
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 25.3 ms ± 0.5 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 13.9 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 105.7 ms ± 1.7 ms
After:
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 26.1 ms ± 0.6 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 14.4 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 106.5 ms ± 1.9 ms
Take Spans instead of Arrays. There's no need to have one copy of this
function for every possible array size passed to it.
Hardcode the inline size of the BinaryHeap to 288 for now. If this
becomes a performance issue in the future, we can make that size
an (optional) template parameter then.
No behavior change.
There are three compiler bugs that influence this decision:
- Clang writing to (validly) destroyed coroutine frame with -O0 and
-fsanitize=null,address under some conditions
(https://godbolt.org/z/17Efq5Ma5) (AK_COROUTINE_DESTRUCTION_BROKEN);
- GCC being unable to handle statement expressions in coroutines
(AK_COROUTINE_STATEMENT_EXPRS_BROKEN);
- GCC being unable to deduce template type parameter for TryAwaiter
with nested CO_TRYs (AK_COROUTINE_TYPE_DEDUCTION_BROKEN).
Instead of growing an ifdef soup in AK/Coroutine.h and
LibTest/AsyncTestCase.h, define three macros in AK/Platform.h that
correspond to these bugs and use them accordingly in the said files.
In case the user requests this, init can drop directly to a shell
without trying to spawn SystemServer.
To test this on x86-64, run:
```
Meta/serenity.sh run x86_64 GNU "init_args=emergency"
```
Also, init will drop to emergency shell if mounting filesystems with
`mount -a` failed for some reason.
This functionality can be useful in many cases.
For example, if the user needs to perform a command that must not alter
a corrupted filesystem state, then this mode is useful as the filesystem
should be mounted in read-only mode.
Another example is the ability to get a functioning system in case
SystemServer behaves badly or inconsistently, or the user specified a
wrong fstab entry, so proceeding to boot is probably a bad option.
Let's make SystemServer simpler by not involving it with the basic
system initialization sequence.
That initialization sequence can be done in another program that
theoretically can be put in another filesystem.
Co-authored-by: Tim Schumacher <timschumi@gmx.de>
If the user only wants to get the byte count of a set of files, then for
each file we can simply seek it to get the byte count instead of
iterating over all the bytes.
Both Element's and ShadowRoot's setHTMLUnsafe, and Document's static
parseHTMLUnsafe methods are implemented.
(cherry picked from commit ce8d3d17c4f2fcca8fac0ff4a832c8f50a011fc7)
Dialog elements now correctly establish a close watcher when
shown modally.
This means modal dialogs now correctly close with an escape key press.
(cherry picked from commit d86a6e1bec858a35935ba6839c154ba2482d33e6)
No other browser allows opening the select element dropdown with the
select.click() function.
This change stops this happening in Ladybird.
(cherry picked from commit 564e546ff0bd78cc7ba770b53377457bf1ef88d6)
Similarly to OpenBSD nc, an option to just connect without transmitting
any actual data is added.
However, we don't allow UDP-mode when testing a remote service, as it
will always succeed and has no technical meaning for the user if they're
not able to view the traffic on the remote machine.
Adds the showPicker() function for select elements.
This doesn't do the check for "being rendered" which is in the spec.
(cherry picked from commit 5098ed6b1f881659dbdab10c74a0e17b362ce7a8)
This implements most of the CloseWatcher API from the html spec.
AbortSignal support is unimplemented.
Integration with dialogs and popovers is also unimplemented.
(cherry picked from commit b216046234560df531e1a32269e5dfa18f8f240c,
manually amended to replace a single `UIEvents::KeyCode::Key_Escape`
with `KeyCode::Key_Escape` in EventHandler.cpp since we don't have
the second commit of https://github.com/LadybirdBrowser/ladybird/pull/86)
Multiple APIs have moved from the DOM Parsing and Serialization spec to
HTML.
Updates spec URLs and comments.
Delete InnerHTML file:
- Make parse_fragment a member of Element, matching serialize_fragment
on Node.
- Move inner_html_setter inline into Element and ShadowRoot as per the
spec.
Add FIXME to Range.idl for Trusted Types createContextualFragment
(cherry picked from commit 9171c3518358cd2d146ffbd7582e4c1247a1daa7)
Previously, no event was fired on middle click. This change also allows
the UI to open a link in a new tab on middle click.
(cherry picked from commit 31d7fa244232c2a2239dbf6017ba9e3dd191ec2e)
This simulates click of the middle mouse button, which is necessary for
testing whether the `auxevent` fires correctly.
(cherry picked from commit 728fca1b1ffd8b472bc8524e5e8ec8443de011a5)
...and shadow tree with TextNode for "value" attribute is created.
This means InlineFormattingContext is used, and button's text now
respects CSS text-decoration properties and unicode-ranges.
(cherry picked from commit 8feaecd5c8d02a2fdb989a9a9671e008d1c3a7de)
Apple Clang doesn't like this, rather than waiting for their version of
random-clang-commit-to-call-a-release to catch up with llvm trunk, just
work around the issue.
Fixes#186.
(cherry picked from commit 8c9d3b30cf62016ffb03e425f1e7e3f2461262bf)
This fixes https://html5test.com/ as previously an exception was being
thrown after trying to access this attribute which would then result in
a popup about the test failing (and none of the test results being
shown).
(cherry picked from commit e0bbbc729b6aad04ceff5f67c3e2868b65970047,
manually amended with the output of `git clang-format master`)
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.
(cherry picked from commit 7950992fc21e2428a7f32954bbe893a2b2d58cf7,
manually amended with the output of `git clang-format master`)
The values aren't that complex, so it doesn't make much sense to have a
dedicated generator for them. Parsing them manually also allows us to
have much more control over the produced values, so as a result of this
change, EasingStyleValue becomes much more ergonomic.
(cherry picked from commit 667e313731f06fabf2a3f75893c3e8f15a4172be,
manually amended with the output of `git clang-format master`)
This fixes an issue where entering EXAMPLE.COM into the URL bar in the
browser would fail to load as expected.
(cherry picked from commit 1a4b042664f8fddbfa70f009c5873b1f8575bf0b)