summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-20LibWeb: Make the layout tree GC-allocatedAndreas Kling
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.
2022-10-20LibWeb: Make BrowsingContext GC-allocatedAndreas Kling
(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.
2022-10-20LibWeb: Hang on to the internal realm with a JS::HandleAndreas Kling
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.
2022-10-20LibWeb: Make the HTMLParser GC-allocatedAndreas Kling
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.
2022-10-20LibWeb: Prevent GC from running during intrinsics allocationAndreas Kling
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.
2022-10-20LibWeb: Cache pseudo element layout nodes weakly on DOM::ElementAndreas Kling
Having the cache be strong created a reference cycle between DOM nodes and their pseudo elements.
2022-10-20LibJS: Make define_native_foo() take SafeFunctionsAndreas Kling
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. :^)
2022-10-20LibJS: Don't register SafeFunction-to-function-pointer with JS::HeapAndreas Kling
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.
2022-10-20LibWeb: Only store one DOM pointer per Layout::NodeAndreas Kling
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).
2022-10-20LibWeb: Don't store JS::Handle<JS::Promise> in EnvironmentSettingsObjectAndreas Kling
Now that the ESO is a JS::Cell, we can just store them as NonnullGCPtr and mark them in visit_edges().
2022-10-20LibWeb: Tear down old layout tree when new document becomes activeAndreas Kling
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.
2022-10-20LibWeb: Remove unnecessary WeakPtr in queue_microtask_impl()Andreas Kling
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.
2022-10-20LibWeb: Use JS::SafeFunction in run_timer_initialization_steps()Andreas Kling
2022-10-20LibWeb: Discard old browsing context after obtaining a new oneAndreas Kling
Cleaning up an old FIXME from before discard was implemented.
2022-10-20LibWeb: Make window.parent and window.top return WindowProxyAndreas Kling
These functions were previously ad-hoc and returned the active document's window. They now correctly teturn the browsing context's WindowProxy instead.
2022-10-20LibWeb: Create and hook up a WindowProxy for each BrowsingContextAndreas Kling
All the machinery for this was already in place, we just never created the actual WindowProxy and installed it.
2022-10-20LibJS: Remove unnecessary operator==() for ({Nonnull,}GCPtr<T>, T*)Andreas Kling
These aren't necessary in the first place since {Nonnull,}GCPtr has operator T*()
2022-10-20Snake: Use emoji for in-game food graphicsXexxa
2022-10-20LibJS: Refactor CalendarFields for better linearityMoustafa Raafat
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/9b139a1
2022-10-20LibJS: Simplify ParseTemporalTimeZoneStringIdan Horowitz
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/eec8efab
2022-10-20LibJS: Refactor ToRelativeTemporalObjectIdan Horowitz
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/895854d9
2022-10-19Base: Add more emojiTobias Lundberg
๐Ÿ‘ - U+1F411 sheep ๐Ÿ— - U+1F417 boar ๐Ÿท - U+1F437 pig face ๐Ÿป - U+1F43B bear face ๐Ÿผ - U+1F43C panda face
2022-10-19PixelPaint: Add Polygonal Select ToolTimothy Slater
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.
2022-10-19PixelPaint: Pass doubleclick events to toolsTimothy Slater
2022-10-19PixelPaint: Ensure bitmap contains selected pixel before deletingTimothy Slater
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.
2022-10-19PixelPaint: Make escape key clear selection for Wand Select ToolTimothy Slater
2022-10-19Kernel: Don't assume paths to children PID directories in ProcFS codeLiav A
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.
2022-10-19LibJS: Remove trivial operations ISO{Year,Month,Day}Moustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/606d8a2
2022-10-19LibJS: Remove trivial operation IsValidISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/a08330a
2022-10-19LibJS: Merge ISOMonthCode and BuildISOMonthCodeMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/a4d17b1
2022-10-19LibJS: Improve alias names in ResolveISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/01d5fbe
2022-10-19LibJS: Simplify ResolveISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/1b83226
2022-10-19WebDriver: Fix old current_window styleTobias Christiansen
2022-10-19WebDriver: Implement `GET /session/{id}/element/{id}/property/{name}`Tobias Christiansen
2022-10-19WebContent+Friends: Add get_element_property IPC and plumbingTobias Christiansen
2022-10-19WebDriver: Implement `GET /session/{session id}/window/handles` endpointLinus Groh
2022-10-19LibGL: Correctly normalize different vertex attribute type pointersJelle Raaijmakers
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.
2022-10-19LibGL: Return `GLboolean` value in `glIsEnabled`Jelle Raaijmakers
2022-10-19LibGL: Implement state for all pixel store parametersJelle Raaijmakers
This implements the state and context parameters for all packing and unpacking parameters accepted by `glPixelStore*`.
2022-10-19LibGL: Don't repeat ourselves in `read_from_vertex_attribute_pointer`Jelle Raaijmakers
2022-10-19LibGL: Implement missing `glDeleteLists` error conditionsJelle Raaijmakers
2022-10-19LibGL: Make `read_from_vertex_attribute_pointer` staticJelle Raaijmakers
2022-10-19LibGL: Do not return early if client-side vertex array is disabledJelle Raaijmakers
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. :^)
2022-10-19LibGL: Add buffer API stubsJelle Raaijmakers
No implemented functionality, but this makes it easier to see if software is using this family of functions.
2022-10-19LibSoftGPU: Call `floor_int_range` only once in `sample_2d_lod`Jelle Raaijmakers
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.
2022-10-19LibSoftGPU: Extract `argb32_color` value in rasterizationJelle Raaijmakers
This makes it easier to correlate slow instructions in the disassembly view of ProfileViewer.
2022-10-19LibSoftGPU: Make alpha testing a static functionJelle Raaijmakers
There is no need to access the Device's members for alpha testing; pass in the required alpha function and reference value.
2022-10-19LibGL: Remove context initialization from testsJelle Raaijmakers
We are either not using these defaults or they are already the `GLContext`'s defaults to begin with.
2022-10-19LibSoftGPU: Clean up `Sampler` importsJelle Raaijmakers
2022-10-19LibSoftGPU: Drop texel Z coordinate from `Sampler`Jelle Raaijmakers
We only support 2D indexing into textures at the moment, so don't perform any work trying to support the Z coordinate.