Previously, the presence of surrounding whitespace would give file paths
the `https` schema instead of the `file` schema, making navigation
unsuccessful.
(cherry picked from commit ff7ca5c48c316e07b1bf631b2d7ed14c358dfa42)
This fixes many tests on
wpt/html/webappapis/scripting/events/event-handler-all-global-events.html
(cherry picked from commit 59f74b909ba161a143fb4cd5cbaf6dcf6734d240)
This fixes wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
(cherry picked from commit ffb3a28684b1b4c028af93aa6d7d9194f002d503)
This allows selection to work within shadow roots and prevents the
selection being cleared if the mouse moves outside of the current
document or shadow root.
(cherry picked from commit e5d1261640a71a672c5cd19910f5f6288e65ed04)
Previously the input element was displayed with value 0, when no value
was set in the HTML. Now it uses `value_sanitization_algorithm()`, which
will calculate the default value.
In `value_sanitization_algorithm()` there was a logical mistake/typo.
The comment from the spec says "unless the maximum is less than the
minimum".
The added layout test would fail without the code changes.
Fixes#520
(cherry picked from commit 191531b7b18d2edf97dc7bf88a9c19903eeae2d5)
Now that we pass an `old_value` parameter to `attribute_changed` it is
no longer necessary to store the current attribute state in
`HTMLScriptElement`.
(cherry picked from commit aa4e18fca50b261eabd5672a3f1163b4ac7ef50b)
This aligns AO transform_stream_error_writable_and_unblock_write() with
the spec.
No functional change is introduced by this amendment.
(cherry picked from commit 24bed027b2db59935da185d3bd490718ccb37baa)
We now defer looking up the various identifiers by IdentifierTableIndex
until the last moment. This allows us to avoid the retrieval in common
cases like when a property access is cached.
Knocks a ~12% item off the profile on https://ventrella.com/Clusters/
(cherry picked from commit 509c10d14db0f2e2ce2b89f307d9dd360b855eb5,
amended to mark the two `throw_null_or_undefined_property_get` functions
static, as -Wmissing-declarations pointed out on CI)
Now that the Interpreter is the only user of these functions, we might
as well keep them in Interpreter.cpp which makes CLion less confused.
(cherry picked from commit ae0cfe4f2d260bfd804364c17f28494e3e8964c9)
Previously, when `WindowOrWorkerGlobalScope.reportError()` was called
the `filename` property of the dispatched error event was blank. It is
now populated with the full path of the active script.
(cherry picked from commit 34b987366449313c96a73ec1d70e88e60f2c4510)
Previously, setting CSS `line-height: 0` on an `input` element would
result in no text being displayed.
Other browsers handle this by setting the minimum height to the
"normal" value for single line inputs.
(cherry picked from commit 629068c2a7eb02db37ffb4fe8d536306ee71e156)
This method was unused and a FIXME remained for combining it with
another, similar method.
(cherry picked from commit df7f7268db5edb37b735f30586d774544537e342)
Previously the entire slider track was colored.
Now only the lower part of the slider track (left side of the thumb) is
colored.
Chrome and Firefox do the same.
(cherry picked from commit 7766909415312b971252f8c7750b0a1873fd5ba0)
This fixes some WPT failures caused by the "view" parameter not being
initialized from the property bag.
(cherry picked from commit 932a7d4d819fac9d0acfe4184574488dd69f94ec)
These methods were overriding properties specified by the EventInit
property bags in the constructor for WheelEvent and MouseEvent.
They appear to be legacy code and no longer relevant, as they would have
been used for ensuring natively dispatched events had the correct
properties --- This is now done in separate create methods, such as
MouseEvent::create_from_platform_event.
This fixes a couple WPT failures (e.g. in
/dom/events/Event-subclasses-constructors.html)
(cherry picked from commit 2c396b5378fec5f4470e1e1e950806dff8005f08)
This method puts the given node and all of its sub-tree into a
normalized form. A normalized sub-tree has no empty text nodes and no
adjacent text nodes.
(cherry picked from commit 0a0651f34ea927a0ca44dc5d2c7786f3dcf8da25)
Solving using the unconstrained height, when solving for bottom, would
either leave a gap over overflow its container.
(cherry picked from commit bee42160c5e2cdb949e6057f029391ee7e0fa9fa)
The first time Document learns its viewport size, we now suppress firing
of the resize event.
This fixes an issue on multiple websites that were not expecting resize
events to fire so early in the loading process.
(cherry picked from commit 4e7558c88b7a993686bb3dc173731e677efe5e26)
This allows global `let` and `const` variable accesses to be cached
by the GetGlobal instruction, and works even when the access is in a
different translation unit from the declaration.
Knocks a ~10% item off the profile on https://ventrella.com/Clusters/
(cherry picked from commit 9448c957c136e62b374a0f8998d1d51906e59fb5)
From https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model:
When a script element el that is not parser-inserted experiences one
of the events listed in the following list, the user agent must
immediately prepare the script element el:
- [...]
- The script element is connected and has a src attribute set where
previously the element had no such attribute.
(cherry picked from commit d890be6e0f7db08ab39ba546cb3421b50b687cda)
The style of input and textarea elements is now invalidated when focus
is changed to a new element. This ensures any `:focus` selectors are
applied correctly.
(cherry picked from commit 572324d47b99bcfbc5db5ff6aef0d6c4eb15ce4c)
Instead of using fixed arbitrary colors for the background of the bar,
AccentColor and Background are now used.
(cherry picked from commit 062a266574a24fe13f2a77401b97f833c3cdd099)
If a favicon image response status was not ok,
we would still attempt to decode the received body data.
(cherry picked from commit 7f04ceb4f6889921ba055ce87476762b9eba262e)
If an image response status was not ok, we would still pass the received
body data to ImageDecoder which is not correct.
(cherry picked from commit 8085e3eb2655ba412fd803a38c4e58d1dc3b3c3b)
Like 1132c858e9, out-of-flow elements such
as float elements would get inserted into block level `::before` and
`::after` pseudo-element nodes when they should instead be inserted as a
sibling to the pseudo element. This change fixes that.
This fixes a few layout issues on the swedish tax agency website
(skatteverket.se). :^)
(cherry picked from commit 9ed2669fc801a3475c9f383ae7221b6a2b1a7fa5)
The concept of out-of-flow and in-flow elements is used in a few places
in the layout code. This change refactors these concepts into functions.
(cherry picked from commit 196922ae5b44044cbf7baaf28fbfedba1b3d11f3)
The logic of the comment "the region between the high boundary and the
maximum value must be treated as the optimum region" is correct.
However, the code below covered only two cases, the optimum case was
missing.
Fixes#473
(cherry picked from commit a676bd97a745cd7a4b33bb779e00ec68cb1d3c7c)
This matches libwebp (see ZeroFillCanvas() call in
libwebp/src/demux/anim_decode.c:355 and ZeroFillFrameRect() call
in line 435, but in WebPAnimDecoderGetNext()) and makes files
written e.g. by asesprite look correct -- even though the old
behavior is also spec-compliant and arguably makes more sense.
Now nothing looks at the background color stored in the file.
See PR for an example image where it makes a visible difference.
Instead, simplify things by allowing the user to specify a specific
device entry in the configuration file, by specifying a minor number.
The first example of such device is the /dev/beep, as it resides on the
"generic" device node family (as it has a major number of 1).
However, because it can be skipped (if the user disables the beep device
through a kernel commandline option), we can't just create it blindly.
Therefore, when iterating on the configuration file the DeviceMapper
code detects the entry has a specific minor number of 10, and creates
a special DeviceNodeMatch (with a specific minor number being included).
When an event from /dev/devctl that notifies on the existence of the
/dev/beep device arrives, we find this specific match and don't create
an actual DeviceNodeFamily object, but rather blindly create a device
node.Mapper: Remove the concept of pluggable once devices
Instead, let the user define them through a configuration file which can
be written with the assistance of /sys/kernel/chardev_major_allocs and
/sys/kernel/blockdev_major_allocs files.
It turns out we cannot use function multi-versioning with "sha" feature
or even just plain ifunc resolvers without preprocessor guards. So,
instead of feeding ifdef-soup monster, we just use static member
function pointer.
Moving the kernel into the SHA1 class makes it possible to not pass
class members as parameters to it. This, however, requires us to
disambiguate different target "clones" of the kernel using some kind
of template.
This also removes `[[gnu::target("sse4.2")]]` from nested functions:
since we don't explicitly use any of the SSE4.2 intrinsics there, the
said target is unneeded. Note that this won't prevent compiler from
choosing SSE4.2 intrinsics as the affected functions are always inlined
into `transform_impl_sha1` that has `[[gnu::target("sse4.2")]]`.
This warning is triggered when one accepts or returns vectors from a
function (that is not marked with [[gnu::target(...)]]) which would have
been otherwise passed in register if the current translation unit had
been compiled with more permissive flags wrt instruction selection (i.
e. if one adds -mavx2 to cmdline). This will never be a problem for us
since we (a) never use different instruction selection options across
ABI boundaries; (b) most of the affected functions are actually
TU-local.
Moreover, even if we somehow properly annotated all of the SIMD helpers,
calling them across ABI (or target) boundaries would still be very
dangerous because of inconsistent and bogus handling of
[[gnu::target(...)]] across compilers. See
https://github.com/llvm/llvm-project/issues/64706 and
https://www.reddit.com/r/cpp/comments/17qowl2/comment/k8j2odi .
This patch adds the common Ctrl-W shortcut to make_quit_action as an
alternate shortcut by default.
The shortcut can be disabled in programs using this key binding for a
different purpose, e.g. closing tabs, or instances where the "close
window" concept would not be applicable, such as CatDog.
To the best of my knowledge, I have disabled the shortcut for any
existing programs in the system where the aforementioned examples or any
additional conflicts would apply.
Using the path rasterizer here is much slower than simply drawing four
lines. This also more accurately shows the (real) clip as the bounding
box is truncated to an int before adding it as a clip rect.
Fixes#23056
This now matches the behavior of did_request_link_context_menu and
friends. Previously the coordinates relative to the page rather than
viewport were sent to the chrome.
(cherry picked from commit 990cf9b4e9476d15494a9538614762119d759b2d)
As far as I know, they're not in the spec and don't serve any purposes
in the internals of LibWasm.
(cherry picked from commit 5382fbb6171555264e29872029330e1373b39671)
NaN bit patterns are now (hopefully) preserved. `static_cast` does not
preserve the bit pattern of a given NaN, so ideally we'd use some other
sort of cast and avoid `static_cast` altogether, but that's a large
change for this commit. For now, this fixes the issues found in spec
tests.
(cherry picked from commit c882498d4450c4c2e46d77a8ab36afc4eb412c00)
The main intention of this change is to have a consistent look and
behavior across all scrollbars, including elements with
`overflow: scroll` and `overflow: auto`, iframes, and a page.
Before:
- Page's scrollbar is painted by Browser (Qt/AppKit) using the
corresponding UI framework style,
- Both WebContent and Browser know the scroll position offset.
- WebContent uses did_request_scroll_to() IPC call to send updates.
- Browser uses set_viewport_rect() to send updates.
After:
- Page's scrollbar is painted on WebContent side using the same style as
currently used for elements with `overflow: scroll` and
`overflow: auto`. A nice side effects: scrollbars are now painted for
iframes, and page's scrollbar respects scrollbar-width CSS property.
- Only WebContent knows scroll position offset.
- did_request_scroll_to() is no longer used.
- set_viewport_rect() is changed to set_viewport_size().
(cherry picked from commit 5285e22f2aa09152365179865f135e7bc5d254a5)
Co-authored-by: Jamie Mansfield <jmansfield@cadixdev.org>
Co-authored-by: Nico Weber <thakis@chromium.org>
This is a hack needed to preserve current behaviour after making set
viewport_rect() being not async in upcoming changes.
For example both handle_mousedown and handle_mouseup should use the same
viewport scroll offset even though handle_mousedown runs focusing steps
that might cause scrolling to focused element:
- handle_mousedown({ 0, 0 })
- run_focusing_steps()
- set_focused_element()
- scroll_into_viewport() changes viewport scroll offset
- handle_mouseup({ 0, 0 })
(cherry picked from commit 50920b05953a6bc2aacb07d291d503052caadf15)
When compiling with `-O2 -g1` optimizations (as done in the main
Serenity build), no out-of-line definitions end up emitted for
`Value::to_numeric`, causing files that reference the function but don't
include the definition from `ValueInlines.h` to add an undefined
reference in LibJS.so.
Add inode watchers on the /tmp/system/devicemap/family/{mouse,keyboard}/
directories.
Then instruct those watchers to dispatch a refresh call to the vectors
which hold references to these devices.
This utility lists all devices' major number allocations, for character
and block devices. It can help the user to figure out the DeviceMapper
service manages spawning of device nodes in /dev and other associated
files under the /tmp/system/devicemap directory.
The new mechanism is basically adding or removing symbolic links to
device nodes in /dev. These symbolic links are located in the directory
of /tmp/system/devicemap/nodes/{block,char} which contain subdirectories
for major number allocation, which then hold these symbolic links.
An interested userspace program could then open an inode watcher on the
subdirectories which hold the symbolic link for added or removed links
to indicate hotplug events of insertion or removal of a device.
There is simply no advantage with putting both virtual console devices
and serial TTY devices on the same major number.
Putting them on separate major numbers greatly simplifies the allocation
mechanism on the DeviceMapper code, because it no longer needs to
calculate offsets of minor numbers, and should start from number 0 to
theoretically infinite amount of device nodes.
Otherwise we'd hit a VERIFY in AK::SIMD::shuffle() when that operand
contains an out-of-range value, the spec tests indicate that a swizzle
with an out-of-range index should return 0.
We currently pretend that these return an ElfAddr, while in actuality
they return a function pointer.
UBSAN may check this and complain about it, so let's just disable it
for that line.
Any data that sticks around in a decoder, especially frames that
haven't been retrieved, may cause issues for playback.
(cherry picked from commit c128a19903c42d5a66153445c457d41dc7ed30a1)
The timestamp offset of a block was being converted from i16 to u64, so
negative values would overflow and cause timestamps that fall before
the cluster's timestamp from being close to the minimum representable
i64.
The math is also now done using saturating operations to prevent any
other similar issues from occurring.
(cherry picked from commit ef99e701b7372a409b11a4fa1d1196a76580eb0e)
H.264 in Matroska can have blocks with unordered timestamps. Without
passing these to the decoder when providing data, the decoder will be
unable to reorder the frames to presentation order.
VideoFrame will now include a timestamp that is used by the
PlaybackManager, rather than assuming that it is the same timestamp
returned by the demuxer.
(cherry picked from commit f6a4973578c4692f33283aee1c089afd0cdae508)
This is necessary to give H.264 decoders the data they need to
initialize, including frame size and profile.
(cherry picked from commit 457a69786b788d3158813156d11e70980f50f7b7)
The function is separated from the string-to-enum function it uses, and
the order is also inconsistent with header.
(cherry picked from commit bf1e0fac94e0d8599c0c540c24883ca5f5ea4131)
These aren't particularly small objects, but we were still copying them
around all over the place. When TrackEntry contains data buffers, they
won't need to be copied as well.
(cherry picked from commit 55fda2068b7334acaba2673c80c01c019aaf7075)
This should halve the size of frames in memory for frames with 8-bit
color components, which is the majority of videos.
Calculation of the size of subsampled planes has also been consolidated
into a struct. There are likely some places that will still need to
change over to this, but it should prevent issues due to differing
handling of rounding/ceiling.
(cherry picked from commit 40fe0cb9d5c40a5ee568a3196bf19452ea8fed2b)
BT.2020 will mainly be used with bit depths greater than 8, so having
this specialization is mostly pointless until we use fixed-point math
for higher bit depths.
(cherry picked from commit fe2a63d485bc9d494b06a780043eae21adfd6854)
Apparently I forgot to put read the value for this field, though this
generally doesn't matter since video bitstreams usually specify CICP as
well.
(cherry picked from commit d3f88b4987730e396bc41c2674edddb53845cb37)
This change is in preparation for implementing audio codecs into the
library and using audio as timing for video playback.
(cherry picked from commit 7c10e1a08d7a109b63c9258578eb98aa9dcc1425)
No effect on sunset-retro.png since that's not animated.
wow.gif (nee giphy.gif) (184k):
1.4M -> 255K
74.0 ms ± 1.1 ms -> 86.9 ms ± 3.3 ms
(from 7.6x as big as the gif input to 1.4x as big.
About 82% smaller, for a 16% slowdown.)
7z7c.gif (11K):
8.4K -> 8.6K
12.9 ms ± 0.5 ms -> 12.7 ms ± 0.5 ms
(2.4% bigger, so the transform makes things a bit worse for this
image.)
AnimationWriter already only stores the smallest rect that contains
changing pixels between two frames. For example, when doing a screen
recording and only the mouse cursor moves, we already only encode
the pixels in the (single) rectangle containing old and new mouse cursor
positions.
Within that rectangle, there can still be many pixels that are identical
over the two frames. When possible, we now replace all identical pixels
with transparent black. This has two advantages:
1. It can reduce the number of colors in the image. In particular,
for wow.gif (and likely many other gifs), new frames had more
than 256 colors before, and have fewer than 256 colors after this
change.
2. Long run of identical pixels compress better.
In some cases, this transform might make things slighly worse,
for example if the input image already consists of long runs of
a single color. We'll now add another color to it (transparent black),
without it helping much. And the decoder now must do some blending,
slowing down decoding a bit.
But most of the time this should be a pretty big win. We can tweak
the heuristic when to do it later.
This transform is possible when:
* The new frame doesn't already have transparent pixels (which are
different from the old frame)
* The encoder/decoder can handle frames with transparent pixels
For the latter reason, encoders currently have to opt in to this.
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)
Previously, part of the procedure we used to sanitize URLs entered via
the command line would check the host against the public suffix
database. This led to some valid, but not publicly accessible URLs
being treated as invalid.
(cherry picked from commit e9f34c7bd1e72da9a57a721d4ad501e8208cc986)
The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.
Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.
`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.
(cherry picked from commit 6b2c4599017f512279cb26c0d3c48aa5a9453007)
They are now blocked on pages which:
- Don't have an opaque origin (should be only user-initiated or about:)
- Aren't other file: pages
- Aren't other resource: pages
(cherry picked from commit 1f3285eb0410ff5c902e148932205d9e4b7fbd9b)
Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)
(cherry picked from commit 862fc91b2cf9bee9b7f180cdf930c6c99b5dd053)
Let's log which property we're trying to look up, since that's the most
interesting part!
(cherry picked from commit f7a83e57554c7a98cda165ea1fa18356a6ee54d9)
To make this straightforward, CSSKeyframesRule now uses a CSSRuleList
for internal storage.
(cherry picked from commit 7f2c833a39e150c7372299dcfe4d2d5590ae779f)
This readonly attribute returns the containing CSS rule, or null (in the
case of element inline style).
(cherry picked from commit a12d28fd3053638ce6f4215bed2d8d45cda86375)
The data segment offset should be checked _before_ checking if the
contents of the segment are non-existent.
(cherry picked from commit 78c56d80f90f913e4cbc14c865af308c6af9aeae)
Previously, navigating to or from `about:newtab` caused a crash due to
inadvertent null dereferences when checking whether a request or
response to a request should be blocked as mixed content.
(cherry picked from commit 572ebe00eacd5aaeecc17207c75c6bf2327a3897)
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.
(cherry picked from commit 7b67fa706fd2dabfda3c72a752ac70d8c95bb060;
amended commit message to say "LibWeb:" instead of "DOM:")
This implements a stub ElementInternals object which implements the
shadowRoot getter only.
Also implement attachInternals function.
(cherry picked from commit a65f1ecc375fa02deeab5d0e7ab4702972ffa72e)
This change solves a crash where it was possible that the
"Color Masking" could try to access pixel coordinates that where beyond
the boundaries of the image.
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.
This fixes an issue where [FIXME] methods broke feature detection on
some sites.
(cherry picked from commit 2f5cf8ac204a58dc2a6f722dd95015c6c2fb7a78)
Properties marked with the [[Unimplemented]] attribute behave as normal
but invoke the `VM::on_unimplemented_property_access callback` when
they are accessed.
(cherry picked from commit 88d425f32b3b49d5dfa8d86e6e4e2c263cd450d4)
If a flex item has a preferred aspect ratio and the flex basis is not
definite, we were falling back to using stretch-fit for the main size,
since that appeared to match other browsers.
However, we missed the case where we actually have a definite cross size
through which the preferred aspect ratio can be naturally resolved.
(cherry picked from commit db1faef786dbd1722bbe6a1f4a5616f3069bdb6a)
This was made redundant in GH-12971 (SerenityOS), and removing it drops
a FIXME :^)
See:
- https://github.com/SerenityOS/serenity/pull/12971
(cherry picked from commit be08abbf8a0a62ae46275c3133f711c27b2efa02)
This stuff has moved from a mixin defined by the DOM Parsing spec, over
to the HTML spec, where they are now defined as partial interfaces for
Element and ShadowRoot.
There's also some new functionality that we don't implement yet, so
patch marks them as FIXME properties.
(cherry picked from commit 0c47b3ff971437c4bd3923134d26ad086b5f6a75)
And let the old shadow_root(), which was only supposed to be used by
bindings, be called shadow_root_for_bindings() instead.
This makes it much easier to read DOM code, and we don't have to worry
about when to use shadow_root_internal() or why.
(cherry picked from commit f4bdf562127c12a7af18029777a88d4260af82d3)
We now honor the shadowrootmode attribute on template elements while
parsing, and instantiate a shadow tree as required by the spec.
(cherry picked from commit 9eb4b91168145def5677cd41057d34ecf369372b)
The bulk of this function is moved to a new "attach a shadow root"
helper, designed to be used both from here and the HTML parser.
(cherry picked from commit 043ad0eb7644a529c1ffbd4de9a4b89771808c84,
and amended to make `is_valid_shadow_host_name()` static.
The expectation with these messages is that no other code is allowed to
run while we're waiting for the response to arrive.
Not meeting this requirement did not degrade any (observable)
functionality, however.
These were made invalid with P1787, and Clang (19) trunk started warning
on them with https://github.com/llvm/llvm-project/pull/80801.
(cherry picked from commit 397774d42272fff8dbc6d8d53616d79667d6608a)
The default implementation of die() causes the client process to simply
exit cleanly. This prevents any tests from recognizing that something
went wrong, as the process exits with a code of 0. With this patch, we
still just exit when the connection dies, but with a fatal signal. In
the future, we will want to launch a new RequestServer process and
re-establish client connections.
(cherry picked from commit d1ec32e28feee10c2c36f4cd0d496b8a95d375f8)
These can use an EnvironmentCoordinate for caching, just like normal
binding lookups. Saves a bunch of time for repeated typeof checks.
(cherry picked from commit 60a05ef414f804fe0c44d20fe13c795800826368)
This is actually safe everywhere but in the topmost program scope.
For web compatibility reasons, we have to flush all top-level bindings
to the environment, in case a subsequent separate <script> program
comes looking for them.
(cherry picked from commit 9d21d88374cf440ddf381e02a597a59ad329ed62)
Instead of displaying locals as "locN", we now show them as "name~N".
This makes it a lot easier to follow bytecode dumps, especially in
longer functions.
Note that we keep displaying the local index, to avoid confusion in case
there are multiple separate locals with the same name in one executable.
(cherry picked from commit 0aa8cb7dac60c88eac3bb7674e3fe575cf1da60b)
When resuming execution of a suspended function, we must not overwrite
any cached `this` value with something from the ExecutionContext.
This was causing an empty JS::Value to leak into the VM when resuming
an async arrow function, since the "this mode" for such functions is
lexical and thus ExecutionContext will have an empty `this`.
It became a problem due to the bytecode optimization where we allow
ourselves to assume that `this` remains cached after we've executed a
ResolveThisBinding in this (or the first) basic block of the executable.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/138
(cherry picked from commit a91bb72dabe54849657720e36e19a3d3b737055f)
Instead, let's create a new class called AvailablePortDatabase that will
handle updating (from the Internet, by using our repository) of the list
and instantiating an object that could be used for querying.