Age | Commit message (Collapse) | Author |
|
This removes a set of complex reference cycles between DOM, layout tree
and browsing context.
It also makes lifetimes much easier to reason about, as the DOM and
layout trees are now free to keep each other alive.
|
|
(And BrowsingContextGroup had to come along for the ride as well.)
This solves a number of nasty reference cycles between browsing
contexts, history items, and their documents.
|
|
This fixes an issue where GC would kill the internal realm if it ran at
the wrong time during startup. Found by aggressively GC'ing between
every allocation.
|
|
This prevents a reference cycle between a HTMLParser opened via
document.open() and the document. It was one of many things keeping
some documents alive indefinitely.
|
|
Due to the way we lazily construct prototypes and constructors for web
platform interfaces, it's possible for nested GC allocation to occur
while GC objects have been allocated but not fully constructed.
If the garbage collector ends up running in this state, it may attempt
to call JS::Cell::visit_edges() on an object whose vtable pointer hasn't
been set up yet.
This patch works around the issue by deferring GC while intrinsics are
being brought up. Furthermore, we also create a dummy global object for
the internal realm, and populate it with intrinsics. This works around
the same issue happening when allocating something (like the default UA
stylesheets) in the internal realm.
These solutions are pretty hacky and sad, so I've left FIXMEs about
finding a nicer way.
|
|
Having the cache be strong created a reference cycle between DOM nodes
and their pseudo elements.
|
|
We were taking AK::Function and then passing them along to
NativeFunction, which takes a SafeFunction. This works, since
SafeFunction will transparently wrap AK::Function in a CallableWrapper
when assigned, but it was causing us to accumulate thousands of
pointless wrappers around direct function pointers.
By using SafeFunction at every step of the setup call chain, we no
longer create any CallableWrappers for the majority of native functions
in LibJS. Also, the number of heap-registered SafeFunctions in a new
realm goes down from ~5000 to 5. :^)
|
|
Direct function pointers don't have captures, so we don't need to
register the SafeFunction with the Heap when it's just wrapping a
function pointer.
|
|
Instead of storing two JS::Handles into the DOM, we can combine them
into a single one.
If the layout node is anonymous, m_dom_node points to the DOM::Document.
Otherwise, m_dom_node points to the associated DOM node.
The anonymous state is moved to an m_anonymous boolean member.
This cuts the number of JS::Handles created by the layout tree in half
(and shrinks Layout::Node by 8 bytes).
|
|
Now that the ESO is a JS::Cell, we can just store them as NonnullGCPtr
and mark them in visit_edges().
|
|
When a new document becomes the active document of a browsing context,
we now notify the old document, allowing it to tear down its layout
tree. In the future, there might be more cleanups we'd like to do here.
|
|
Capturing a WeakPtr to a GC-allocated object in a JS::SafeFunction is
basically pointless, since the SafeFunction mechanism will then keep
the object alive anyway.
|
|
|
|
Cleaning up an old FIXME from before discard was implemented.
|
|
These functions were previously ad-hoc and returned the active
document's window. They now correctly teturn the browsing context's
WindowProxy instead.
|
|
All the machinery for this was already in place, we just never created
the actual WindowProxy and installed it.
|
|
These aren't necessary in the first place since {Nonnull,}GCPtr has
operator T*()
|
|
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/9b139a1
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/eec8efab
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/895854d9
|
|
๐ - U+1F411 sheep
๐ - U+1F417 boar
๐ท - U+1F437 pig face
๐ป - U+1F43B bear face
๐ผ - U+1F43C panda face
|
|
Polygonal selection tool allows for the drawing of any arbitrary
polygonal shape. It tracks clicked points in a vector, upon double
clicking we finalize the polygon and generate the selection mask. The
user can press the escape key during selection to cancel.
The mask is generated as follows:
- First we calculate the size of the bounding rect needed to hold the
polygon
- We add 2 pixels to height/width to allow us a 1 pixel border, the
polygon will be centered in this bitmap
- Draw the polygon into the bitmap via Gfx::Painter, making sure to
connect final polygon point to the first to ensure an enclosed shape
- Generate a selection mask the size of the bitmap, with all pixels
initially selected
- Perform a flood fill from (0,0) which is guaranteed to be outside the
polygon
- For every pixel reached by the flood fill, we clear the selected pixel
from the selection mask
- Finally we merge the selection mask like other selection tools.
|
|
|
|
This fixes a bug which shows up when a layer is offset and the selection
range includes pixels that are outside the current layer bitmap rect. We
would still try to delete that pixel from the bitmap since there was no
contains() check.
|
|
|
|
Instead of using absolute paths which is considered an abstraction layer
violation between the kernel and userspace, let's not hardcode the path
to children PID directories but instead we can use relative path links
to them.
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/606d8a2
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a08330a
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a4d17b1
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/01d5fbe
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/1b83226
|
|
|
|
|
|
|
|
|
|
According to the OpenGL 2.0 spec ยง 2.8, the data for each attribute type
pointer is normalized according to the type. The only exception to this
is `glVertexAttribPointer` which accepts a `normalized` parameter, but
we have not yet implemented that API.
|
|
|
|
This implements the state and context parameters for all packing and
unpacking parameters accepted by `glPixelStore*`.
|
|
|
|
|
|
|
|
According to the spec, enabling the client-side vertex array should
behave as if `glVertex` is executed after all other states such as the
normal, color, etc. have changed. We were not changing these states if
the client-side vertex array was disabled which probably does not affect
a lot of applications, but this seems like the correct thing to do. :^)
|
|
No implemented functionality, but this makes it easier to see if
software is using this family of functions.
|
|
We were invoking `frac_int_range` twice to get the `alpha` and `beta`
values to interpolate between 4 texels, but these call into
`floor_int_range` again. Let's not repeat the work.
|
|
This makes it easier to correlate slow instructions in the disassembly
view of ProfileViewer.
|
|
There is no need to access the Device's members for alpha testing; pass
in the required alpha function and reference value.
|
|
We are either not using these defaults or they are already the
`GLContext`'s defaults to begin with.
|
|
|
|
We only support 2D indexing into textures at the moment, so don't
perform any work trying to support the Z coordinate.
|