Age | Commit message (Collapse) | Author |
|
Well... sort of. This adds the function itself and all the scaffolding
from the ShadowRealm API (and basically completes its implementation).
However, we do not nearly have enough support for modules and imports,
so we currently pretend whatever was attempted to be imported failed -
once we have HostImportModuleDynamically it should be relatively easy to
complete the implementation.
|
|
|
|
|
|
Step 12 was using `lhs.is_bigint()` instead of `rhs.is_bigint()`,
meaning you got:
```js
1n == Object(1n); // true
Object(1n) == 1n; // false
```
This also adds spec comments to is_loosely_equal.
|
|
This finally allows LibWeb to scroll pages horizontally instead of just
clipping things at the right edge.
|
|
As outlined in the previous commit, this should be more reliable than
Interpreter::realm(), as we don't always have access to an Interpreter.
|
|
This is just another workaround, but it should be much more reliable
than Interpreter::realm(), especially when allocating NativeFunctions
and ECMAScriptFunctionObjects: we're guaranteed to have a GlobalObject
at that point, and it likely was set as the GlobalObject of a Realm and
can lead us back to it. We're however not guaranteed that the VM can
give us an Interpreter, which is why functions in LibWeb can be a bit
crashy at the moment.
We use a WeakPtr<Realm> to properly handle the unlikely case where the
Realm goes away after associating a GlobalObject to it.
We'll always need _something_ of this sort if we want to support
OrdinaryFunctionCreate and CreateBuiltinFunction without the explicit
realm argument while no JS is running, because they want to use the
current Realm Record (always in the first and as fallback in the second
case).
|
|
This makes everything within the stacking context stick show up in the
correct position.
|
|
|
|
|
|
Per spec, the initial containing block (ICB) should have the size of the
viewport. We have only done this for the width until now, since we had
no way to express scrollable overflow.
This patch adds Layout::Box::m_overflow_data, an optional struct that
can hold on to information about a box's overflow. Then we have BFC
set the ICB up with some scrollable overflow instead of sizing it to fit
its content vertically.
This fixes a number of broken layouts where correctness depends on
having the appropriate ICB height.
|
|
This allows callers to unset the respective intrinsic sizes by passing
an empty Optional.
|
|
Now that we can ask any Box about its intrinsic aspect ratio, let's fix
a FIXME in FlexFormattingContext.
|
|
|
|
Apparently it's not only replaced elements that can have intrinsic
sizes, so let's move this concept from ReplacedBox to Box. To avoid
bloating Box, we make the accessors virtual.
|
|
The Completion constructor `VERIFY()`s that the passed argument is not
an empty Value, so normal_completion({}) would crash (although it's
currently not being used anywhere).
We want to pass an empty Optional<Value> instead.
|
|
Note there are a couple of type differences between the spec and the IDL
file added in this commit. For example, we will need to support a type
of Variant to handle spec types such as "(double or sequence<double>)".
But for now, this allows web pages to construct an IntersectionObserver
with any valid type.
|
|
|
|
|
|
This commit adds the ShadowRealm object itself, its constructor, and
prototype (currently empty).
|
|
This is a new concept from the ShadowRealm API stage 3 proposal:
https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects
|
|
|
|
|
|
|
|
This will allow some more expressive code in FlexFormattingContext.
|
|
Since FFC is only ever run() on the flex container, we can assume (but
verify) that the run box is the flex container and use an accessor
throughout. The end result: less parameter passing.
|
|
This gives all member functions access to these vectors without having
to pass them as arguments.
|
|
This is mainly to validate that inputs are treated as inputs only and
don't get written to.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Determining the available main and cross space is now done by a separate
function. The signature is a little bit hairy since this function
computes some things that are used by subsequent algorithm steps.
Factoring can definitely be improved further.
|
|
Continuing on the quest towards making FlexFormattingContext readable.
|
|
This is what the spec calls it and makes the code much less ambiguous.
|
|
Let's begin splitting the FlexFormattingContext layout algorithm into
separate functions to make it more manageable.
|
|
In CSS 'none' is not a valid value for min-width or min-height. The
fallback resolved value should be 'auto' for them.
|
|
Per css-sizing-3:
Additionally, the size of the containing block of an absolutely
positioned element is always definite with respect to that element.
As I understand this, it doesn't mean that all absolutely positioned
boxes have definite size, but that the containing block of an absolutely
positioned descendant has definite size from the perspective of the
descendant.
|
|
This new implementation of pread saves two lseek system calls and is
thread-safe thanks to it simply forwarding the call to the pread system
call.
|
|
|
|
|
|
|
|
|