A change to a counter "definition" propagates to all subsequent
instances of this counter: descendents, siblings and their descendents
(the "next tree slice"). Rebuilding the layout tree (from the parent
node) covers at least the "next_tree_slice".
Some callers need the raw nul-terminated c-string in this callback, to
pass to some other ICU method. But other callers will want a StringView.
We know the length already in `icu_string_enumeration_to_list`, so let's
just pass it along to avoid `strlen`.
We were manually doing this for the calendar keyword, and would need to
do so for the collation keyword as well. I wasn't aware of this API
originally, so let's start using it.
For example, button inputs shouldn't have a cursor
displayed in their text since they're not editable,
and are not meant to be editable.
Fixes#4140
Co-authored-by: Sam Atkins <sam@ladybird.org>
On Windows, ICU does not look at the TZ environment variable at all. So
to support changing time zones in test-js, let's set ICU's default time
zone directly.
Note that we no longer deal with "null" time zone strings. We just cache
whatever ICU thinks is the current time zone before attempting to change
it, for which we never have a null result.
Co-authored-by: Andrew Kaster <andrew@ladybird.org>
Before this change each built-in iterator object has a boolean
`m_next_method_was_redefined`. If user code later changed the iterator’s
prototype (e.g. `Object.setPrototypeOf()`), we still believed the
built-in fast-path was safe and skipped the user supplied override,
producing wrong results.
With this change
`BuiltinIterator::as_builtin_iterator_if_next_is_not_redefined()` looks
up the current `next` property and verifies that it is still the
built-in native function.
The test CSSStyleDeclaration-has-indexed-property-getter is a frequent
source of merge conflicts between PRs that are adding to or otherwise
modifying the list of supported CSS properties.
This is primarily because the test prints out a numeric index of each
property along with the property. As far as I can tell the indexes are
inconsequential for what the test is trying to verify. So lets modify
the printout to only contain the properties without indexes.
This mirrors the existing caching logic for int32 constants.
Avoids duplication of string constants in m_constants which could
result in stack overflows for large scripts with a lot of similar
strings.
Especially on new setups, it is handy for `headless-browser --run-tests`
to "just work". Anyone using ladybird.py will have LADYBIRD_SOURCE_DIR
set in their environment already.
The streams AO that we were calling to close the stream would assert
if it was not in a readable state. This version of close is exported
publicly in the streams specification, and properly handles this
situation.
Fixes a crash in the imported test, and happens to fix some others!
This header file is never included by any other headers, and including
it would require adding the fontconfig include paths to the swift
interop header generation, which is not desirable.
We haven't built a universal binary in over 11 months. The name is
confusing, and actually breaks esvu on macOS. The fact that nobody
has complained suggests that this is not a common use case..
On my Linux machine with 32 cores, ninja actually defaults to 34 jobs.
By defaulting ourselves to multiprocessing.cpu_count(), we actually
decrease the number of jobs used.
We don't need to pick a host compiler every time ladybird.py is invoked.
We only need to do so when configuring the Build directory.
This shaves about 10ms off an invocation of `ladybird.py build` on my
machine, going from ~170ms to ~160ms.
Not cleaning these up by rejecting or resolving the promise causes
the main thread to try to reject them at EventLoop::exit() time.
If the RenderThread has already been destroyed by then, we get into
use-after-free territory and segfault.
We already had all necessary things for pseudo elements support in place
except ability to save transition properties in Animatable. This commit
adds the missing part.
The way we echo the cache keys for output variables strips these quotes.
So when we save the caches at the end of CI, the keys are sans quotes.
This patch adds an extra cache restore key without quotes to allow jobs
to fetch their own caches again. This will become moot once all runners
are able to use the Blacksmith cache action.
In WindowProxy.[[Get]] it's not guaranteed that the current principal
global object has an associated document at the moment. This may happen
if a script is continuing to execute while a navigation has been
initiated.
Because of that, we can't blindly dereference the active document
pointer, so this patch adds a null check.