Currently, disabled text colors are hardcoded. They look good in Default
and light themes, but no so good in dark ones. This PR adds new
variables for all themes to correctly display disabled text.
- Perform a typed this check
- Use the 'associated URL' as the source of truth
- Don't append default port number in the host getter
- Don't return default port number in the port getter
- Add empty checks to the hash and search getters instead of returning
'#' and '?' strings from the string builder
https://html.spec.whatwg.org/multipage/history.html#relevant-document
> A Location object has an associated relevant Document, which is this
> Location object's relevant global object's browsing context's active
> document, if this Location object's relevant global object's browsing
> context is non-null, and null otherwise.
This revealed a variety of issues, mostly missing origin checks,
conflating concepts like the 'associated URL', and serialization
(incorrect fallback values, string vs number, etc).
This commit fixes none of these issues, only adds FIXMEs.
When recomputing the style for an element that previously didn't have
a corresponding layout node, it may become necessary to create a layout
node for it.
However, we should not do this if it's within a subtree that can't have
layout children. Nor should we do it for elements who have an ancestor
with display:none.
This matches the rename of RGBA32 to ARGB32. It also makes more sense
when you see it used with 32-bit hexadecimal literals:
Before:
Color::from_rgba(0xaarrggbb)
After:
Color::from_argb(0xaarrggbb)
The ARGB32 typedef is used for 32-bit #AARRGGBB quadruplets. As such,
the name RGBA32 was misleading, so let's call it ARGB32 instead.
Since endianness is a thing, let's not encode any assumptions about byte
order in the name of this type. ARGB32 is basically a "machine word"
of color.
Not sure why these are doubles in the IDL definition, both the IDL in
the spec and the implementation in the CanvasRenderingContext2D class
use integers.
Also add support for HTMLCanvasElement for the image parameter, leading
to replacing HTMLImageElement with the CanvasImageSource Variant type.
Also stub out the 'check the usability of the image argument' and 'is
not origin-clean' operations, while taking into consideration that these
can throw (and require DOM::ExceptionOr).
We were calculating the reflected control points in the svg smooth
curve instructions incorrectly, and this issue was masked by the fact
that we were treating it as a relative coordinate in relative mode.
...and implement SoftCPU::read_memory<T> with it.
This allows the MMU to read a typed object (using 1-byte reads), which
is significantly nicer to use than reading the struct fields manually.
Instead of making it hold the shadow data as another `T`, make it hold
the data as a byte array, and allow it to read the byte array as `T`.
This makes it much easier to make a "read_typed" function in the MMU.
Our setInterval implementation currently crashes on DuckDuckGo when it's
invoked with a string argument. In this path, we were creating a native
function to evaluate and execute that string. That evaluation was always
returning a Completion, but NativeFunction expects ThrowCompletionOr.
The conversion from Completion to ThrowCompletionOr would fail a VERIFY
because that conversion is only valid if the Completion is an error; but
we would trigger this conversion even on success.
This change re-implements setTimeout & setInterval in direct accordance
with the spec. So we avoid making that NativeFunction altogether, and
DDG can progress past its invocation to the timer. With this change, we
also have other features we did not previously support, such as passing
any number of arguments to the timers. This does not implement handling
of nesting levels yet.
Some callers, e.g. setTimeout / setInterval, will want to invoke this AO
with an arguments list retrieved from the JS VM (as opposed to invoking
it with a variadic list at the call site).
`CharacterBitmap` instances are generated at run-time and put on the
heap, but they can be created in a `constexpr` context and stored in
static memory.
Also, remove additional `width` and `height` `static` values in favor
of using the `constexpr` member functions of `CharacterBitmap`.
These changes also include the removal of some initialization code
which tests if the `CharacterBitmap` is created since it is always
created and removes function-local `static` values which cause
run-time branches to ensure it is initialized each time the function
is called.
There is nothing in the `Size` class which cannot be `constexpr`, but
without it being `constexpr` it prevents other things from being
`constexpr`-capable.
`Gfx::Vector[2,3,4]` are nearly identical implementations. This code
redundancy does not follow the DRY (Don't Repeat Yourself) principle
leading to possible out-of-sync errors between the classes.
Combining these classes into a class template which can be specialized
for each needed size makes the differences obvious through
`constexpr-if` blocks and `requires` clauses.
When calculating the intrinsic width of a block-level box, we were
previously measuring the content boxes of children. This meant that
shrink-to-fit sized blocks didn't gain enough width to contain children
with horizontal padding and/or border.