aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
...
* build: upgrade rustc to 1.81.0 (#34270)Mukilan Thiyagarajan2024-12-126-14/+6
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Add embedder event for preferred color scheme and respond to it in the ↵arthmis2024-12-1210-27/+118
| | | | | | | | | | | | | | | | | | | | | | | | LayoutThread (#34532) * respond to winit platform theme changed event and send it to the layout thread Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * refactoring viewport and theme change handling functions based on feedback Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * fixing issues reported by test-tidy Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> * update stylo in order to use color_scheme function on Device Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> --------- Signed-off-by: Lloyd Massiah <artmis9@protonmail.com> Co-authored-by: lazypassion <25536767+lazypassion@users.noreply.github.com>
* Deduplicate taffy layout pbm computation (#34587)Nico Burns2024-12-121-42/+24
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Make sure to cache `inline_content_sizes()` (#34586)Oriol Brufau2024-12-124-11/+16
| | | | | | | | | | | | | | | | The refactoring in 264c0f972fd1a732ee1d1490d78a1d26a65c6f5f stopped caching the `inline_content_sizes()` calls from: - `FlexItemBox::layout_for_block_content_size()` - `IndependentFormattingContext::layout_float_or_atomic_inline()` - `TaffyContainerContext::compute_child_layout()` Also, the call from `OutsideMarker::layout()` was never cached. This patch caches all of them. It's not clear at all which `inline_content_sizes()` are cached and which aren't, so I plan to improve the situation in a follow-up. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Allow running testharness/testdriver/reftests in servodriver (#34550)Josh Matthews2024-12-115-56/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make servodriver a thin wrapper over the base webdriver browser/executor classes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Make ServoWebDriverRefTestExecutor a thin shell over the webdriver reftest executor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Wait for the initial load to complete when opening a new tab via webdriver. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove assumption of a single tab from the webdriver server. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Serialize all keys of JS objects when converting to webdriver values. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Cleanup, docs, etc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Use webview terminology more consistently. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix flake8 errors. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Do not do explicit reflows when handing rAFs (#34576)Martin Robinson2024-12-112-29/+26
| | | | | | | | | | This removes two explicit calls to reflow to detect rAFs that do not modify the DOM and to trigger reflows when the page isn't dirty. This can cause extra reflows, especially when animations are running. This change removes them, relying on *update the rendering* to properly trigger reflows, shortly after running rAF callbacks and after animations are updated. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Clean up inline layout data types a bit (#34563)Martin Robinson2024-12-116-35/+35
| | | | | | | | | | | - Remove the `LayoutBox::InlineBox` variant that was only used for inline level boxes. Now they are stored in `LayoutBox::InlineLevel` along with other kinds of out-of-flow and atomic inline items. - Reduce the size of `InlineItem` by 260 bytes per item by using atomic indirection / pointers. This adds a bit of overhead to access items in exchange for a lot of memory saved. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Make a new `ContainingBlockSize` type (#34565)Martin Robinson2024-12-1113-158/+192
| | | | | | | | This might make caching these values a bit easier in the future. Correcting the visibility of `ContainingBlock` also exposed some new rustc and clippy warnings that are fixed here. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* tidy: Update pattern for checking for missing specification links. (#34552)Josh Matthews2024-12-111-0/+1
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Update response handling in main_fetch (#34570)shanehandley2024-12-112-17/+11
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: Remove 'pending reflow' concept and some explicit reflows (#34558)Martin Robinson2024-12-118-118/+43
| | | | | | | | | | | | | | | | | | The `pending reflow` concept isn't necessary now that *update the rendering* is taking care of triggering reflows at the correct time. `Window::reflow` already avoids reflows if the page is not dirty, so pending reflows is now just an extraneous check as long as *update the rendering* runs properly. This change also removes some explicit reflows, which now wait until the appropriate moment during *update the rendering*. This should remove some extra reflows that are not necessary. Servo needs some way to track that resizing the web view needs to re-layout due to the initial containing block changing. Move handling of `Document::needs_paint` to the script thread and use this, expanding the rustdoc to explain what it is for a bit more clearly. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Rewrite From/TryFrom conversions on generated types to avoid future orphan ↵Josh Matthews2024-12-1140-380/+439
| | | | | | | | | | | | | | | rule violations (#34554) * script: Add traits to allow converting between types that are not defined in the script crate. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Rewrite all From/TryFrom implementations on generated WebIDL types to use new Convert/TryConvert traits. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Don't transfer indefinite `height: stretch` to inline axis (#34557)Oriol Brufau2024-12-101-6/+3
| | | | | | | | | | | | | | | | | | Consider this testcase: ```html <canvas style="aspect-ratio: 1; height: stretch; background: cyan" width="200" height="100"></canvas> ``` To compute the intrinsic inline sizes we were treating `height: stretch` as the natural height (100px) and then transferring that to the inline axis through the preferred aspect ratio. So the element was 100px wide. However, an indefinite `stretch` should be treated as an automatic size, which wouldn't be transferred to the inline axis. The fix actually makes the code slightly simpler. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Do not prioritize *update-the-rendering* in `ScriptThread` message ↵Martin Robinson2024-12-102-103/+75
| | | | | | | | | | | | | | | | | | | | loop (#34539) Instead run *update the rendering* at the end of every process of gathering messages sent to the `ScriptThread`. This ensures that the thread is in a consistent state when the update is finally run and prevents running more than one instance of *update the rendering* per spin of the message loop. In addition: - Move the *run the resize steps* implementation to `Window` and ensure that the realm is active when it is run. - Profile the queueing of the resize message instead of handling it. I think this makes more sense as the profiling seems to be targeting message handling and not *update the rendering*. Additionally, it's difficult to profile from the context of `Window`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Add stub interface for AbortController. (#34519)Josh Matthews2024-12-104-0/+71
| | | | Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: syvb <me@iter.ca>
* tracing: Trace Constellation blocked duration (#34536)Jonathan Schwender2024-12-091-31/+36
| | | | | | | | | | Add a trace for the `select!` macro, so that we can easily identify the amount of time we are blocked in the trace A different option might be to just skip tracing the `handle_request` function entirely, since it contains almost nothing interesting. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* retire deprecated MouseEvent::InitMouseEvent (#34538)Jay Wang2024-12-092-20/+31
| | | | Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
* script: Update the rendering when receiving IPC messages instead of just ↵Martin Robinson2024-12-097-200/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | reflowing (#34486) This changes fixes two issues: 1. A reflow of all `Document`s currently done unconditionally after receving IPC messages in the `ScriptThread`. Reflowing without first updating the animation timeline can lead to transitions finshing as soon as they start (because it looks like time advancement is measaured between calls to `update-the-rendering`). 2. Fix an issue where not all `Pipeline`s were updated during *update the rendering*. The previous code only took into account top level frames and their children. It's not guaranteed that a particular `ScriptThread` is managing any top level frames, depending on the origens of those frames. We should update the rendering of those non-top-level iframes regardless. The new code attempts to order the frames according to the specification as much as possible without knowing the entire frame tree, without skipping any documents managed by the `ScriptThread` in question. In addition, `Documents` is pulled out the `script_thread.rs` and renamed to `DocumentCollection`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Have `SameFormattingContextBlock` be a `LayoutBoxBase` (#34530)Martin Robinson2024-12-092-33/+28
| | | | | | This allows `SameFormattingContextBlock` to cache inline content sizes and will eventually allow it to participate in incremental layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* traverse Shadow DOM boundaries when determining element lang (#34529)Ville Lindholm2024-12-081-1/+1
| | | Signed-off-by: Ville Lindholm <ville@lindholm.dev>
* Add ReferrerPolicy IDL attribute to iframes (#34526)shanehandley2024-12-082-4/+29
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: add `initialize_ui_event` method (#34524)Jay Wang2024-12-082-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | * retire UIEvent::InitUIEvent Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * fix fmt Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * remove unused changes Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * reimplement the spec and reuse wherever we can Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * fix lint Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> --------- Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>
* layout: Add `LayoutBox` to `TableSlotCell` (#34513)Martin Robinson2024-12-083-37/+48
| | | | | | This allows cells to cache their inline content size and will eventually allow them to participate in incremental layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add XPath parser/evaluator (#34463)Ville Lindholm2024-12-0820-7/+3187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add XPath parser/evaluator Signed-off-by: Ville Lindholm <ville@lindholm.dev> * Correctly annotate XPathEvaluator IDL Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: have bindings pass in `can_gc` Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: implement PartialEq for Value for readability Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings for CoreFunctions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: simplify node test code Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add unit tests for string handling xpath functions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * put xpath features behind dom.xpath.enabled pref Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review] remove rstest and insta dev-deps Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: tweak metadata files Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations AGAIN Signed-off-by: Ville Lindholm <ville@lindholm.dev> --------- Signed-off-by: Ville Lindholm <ville@lindholm.dev>
* layout: Add `LayoutBoxBase` and use it for `IndependentFormattingContext` ↵Martin Robinson2024-12-0716-439/+423
| | | | | | | | | | | | | | | | | | (#34507) Add a new struct `LayoutBoxBase`, that will be used throughout the box tree. The idea of this struct is that we have a place to consistently store common layout information (style and node information) and also to cache layout results such as content sizes (inline and maybe later box sizes) and eventually layout results. In addition to the addition of this struct, `IndependentFormattingContext` is flattened slightly so that it directly holds the contents of both replaced and non-replaced elements. This is only added to independent formatting contexts, but will later be added to all block containers as well. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement `ShadowRoot.clonable` attribute (#34514)Simon Wülker2024-12-076-15/+81
| | | | | | | | | | | | | | | | | | | | | | | | | * Implement ShadowRoot clonable attribute Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach test-tidy fixes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * fix clippy warnings Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* net: correct handling of the empty string referrer policy when provided in ↵shanehandley2024-12-071-1/+1
| | | | | requestInit (#34518) Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Add prefs to limit threadpool sizes (#34478)Jonathan Schwender2024-12-078-13/+76
| | | | | | | | | | | | | | | | | | | | | | | | | * Add prefs to limit threadpool sizes Add preferences to control the size of threadpools, so that we can easily reduce the amount of runtime threads and test which pools benefit from more threads. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add pref for Webrender threadpool Add a preference to limit the size of the webrender threadpool. Note: WebRender by default calls hooks which register the threads with a profiler instance that the embedder can register with webrender. Servo currently doesn't register such a profiler with webrender, but in the future we might also want to profile the webrender threadpool. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Make traverse_preorder follow shadow roots (#34503)Josh Matthews2024-12-073-17/+17
| | | | | | | | | | | | | | | | | * script: Ensure shadow-inclusve preorder traversals follow hosted shadow roots. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Handle unregistering element id/name values inside of a shadow root. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Merge shadow root tree iteration logic. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix tracing enabling layout-2013 feature (#34515)Jonathan Schwender2024-12-071-1/+1
| | | | | | Without the `?` layout_2013 is enabled if the tracing feature is selected. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Don't trace SystemFontService loop (#34508)Jonathan Schwender2024-12-061-4/+0
| | | | | | Most of the time here is spent blocking on the channel, and after we received the message we already have a new span. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Create two-phase initialization for generated JS engine bindings (#34366)Josh Matthews2024-12-065-108/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Generate a runtime initialization for static JS binding information. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Replace dummy static initializers with OnceLock. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Only initialize statics for DOM interfaces with interface objects. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Remove one unnecessary Box::leak usage. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide thread-unsafe OnceLock usage inside of a wrapper type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mark ThreadUnsafeOnceLock::get unsafe. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Simplify ThreadUnsafeOnceLock internals. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Upgrade Stylo to 2024-12-04 (#34501)Oriol Brufau2024-12-0610-147/+217
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-12-04 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D229998 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix `stretch` sizes on replaced abspos (#34430)Oriol Brufau2024-12-051-118/+128
| | | | | | | We were sizing absolutely positioned replaced elements within their actual containing block instead of the inset-modified containing block. Then the `stretch` keyword would result in a wrong size. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Update animations once per-Document during `update_the_rendering()` ↵Martin Robinson2024-12-053-60/+71
| | | | | | | | | | | | | | | | | | (#34489) Before, `update_the_rendering()` would update all animations for all Documents once per-Document. Apart from being generally wrong, the specification says this should be done once per-Document. This theoretically means that `update_the_rendering()` is just doing less work every time it runs. In addition: - Don't redirty animations nodes when running rAF callbacks. They should already be dirty when animations are updated. - Perform a microtask checkpoint while updating animations as dictacted by the specification. - Update comments to reflect the specification text. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add `webgpu` feature flag (#34444)atbrakhi2024-12-0550-103/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move script gpu files into webgpu folder Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Modify gpu webidls Signed-off-by: atbrakhi <atbrakhi@igalia.com> * move gpu realted webidl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add webgpu feature to script Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add dummy implementation for gpucanvascontext Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add skip-if CARGO_FEATURE_WEBGPU Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Move NavigatorGPU and workerNavigator GPU to webgpu idl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt and cleanup Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * enable webgpu by default and also some fmt fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Add pref back, fix imports, small cleanups Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* layout: Add missing support for some alignment keywords on absolutely ↵tanishka2024-12-051-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | positioned elements (#34365) * Add missing support for some alignment keywords on absolutely positioned elements Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Check the direction of the alignment container, nits, test expectations In this case we need to check the direction of the static position containing block, not the actual containing block: ```html <!DOCTYPE html> <div style="position: relative"> <div style="display: flex; flex-direction: column; width: 100px; height: 100px; border: solid; direction: rtl"> <div style="position: absolute; width: 20px; height: 20px; background: cyan; top: 20px; align-self: self-start"></div> <div style="position: absolute; width: 20px; height: 20px; background: magenta; bottom: 20px; align-self: self-end"></div> </div> </div> ``` Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Move stylo thread pool mutex to servo layout thread crates (#34480)Nico Burns2024-12-052-3/+19
| | | | | | | | | | | | | | | | | * Eliminate stylo thread pool mutex Signed-off-by: Nico Burns <nico@nicoburns.com> * Reinstate Mutex in the Servo codebase Signed-off-by: Nico Burns <nico@nicoburns.com> * Revert back to main Stylo branch Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Improve performance of flex column layouts by caching (#34461)Oriol Brufau2024-12-032-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Obey min and max properties when computing main size of column flex When laying out a column flex container with an auto preferred main size, we were resolving the used main size to the intrinsic max-content size. However, we weren't clamping this amount between the min and max sizes. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Improve performance of flex column layouts by caching We were already using a cache for layout_for_block_content_size(), but we were only storing the intrinsic block size. Thus when laying out the flex items for real, we would perform new layouts, triggering an exponential complexity in case of nested flexboxes. Now we cache the entire layout result so that we can avoid doing the work again. This improves the results of flexbox-deeply-nested-column-flow.html (a Blink perf test) from ~40 runs/second to ~500 runs/second on my PC. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey min and max properties when computing main size of column flex (#34450)Oriol Brufau2024-12-021-8/+9
| | | | | | | | When laying out a column flex container with an auto preferred main size, we were resolving the used main size to the intrinsic max-content size. However, we weren't clamping this amount between the min and max sizes. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Don't register unconnected shadow roots with their owner document (#34361)Simon Wülker2024-12-024-21/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | * Don't falsely register Shadow Roots as connected Previously, a shadowroot would be registered as connected during the shadow hosts bind_to_tree call, even if the host was being bound to an element that was not itself connected to a document. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Move bind/unbind methods into a VirtualMethod impl Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add DocumentFragment/Shadowroot to vtable_for Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Refactor AbsoluteAxisSolver (#34443)Oriol Brufau2024-12-021-99/+38
| | | | | | | | | | | | | | | | | `AbsoluteAxisSolver::solve()` would compute, among other things, the position of the absolute positioned element if it had start alignment. Then, `AbsoluteAxisSolver::origin_for_alignment_or_justification()` could optionally opt into modifying that alignment if needed. This was quite convoluted and not easy to follow. It's simpler to not compute the position in `AbsoluteAxisSolver::solve()`, and instead do it always in `AbsoluteAxisSolver::origin_for_alignment_or_justification()`, which I'm renaming to `AbsoluteAxisSolver::origin_for_margin_box()` because it aligns the margin box of the abspos within its alignment container. Then the `Anchor` struct becomes useless and can be removed. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: add PointerEvent (#34437)Ngo Iok Ui (Wu Yu Wei)2024-12-024-6/+454
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add PointerEvent webIDL Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Implement all new methods Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Cleanup warnings Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Update wpt meta Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Update interface list Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Update manifest Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Update doc links Signed-off-by: Wu Wayne <yuweiwu@pm.me> --------- Signed-off-by: Wu Yuwei <yuweiwu@pm.me> Signed-off-by: Wu Wayne <yuweiwu@pm.me>
* Fix alignment of abspos child of flexbox with flipped direction (#34426)testOriol Brufau2024-11-301-20/+42
| | | | | | | | | | | | | The containing block for the static position of an absolutely positioned element in flex layout is established by the flex container. However, if the flex container has static position, the actual containing block will be established by another ancestor. If the flex container and the containing block have different directions, the static position needs especial handling when aligning the abspos. We were already trying to do so with the `flip_anchor` flag, but there were bugs. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Dirty video element when clearing video frame data. (#34435)Josh Matthews2024-11-301-1/+2
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Retain the referrer policy when loading an about:blank iframe. (#34432)shanehandley2024-11-301-7/+4
| | | | | This allows the referrer policy to be inherited correctly by the iframe. Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Make Servo compatible with Stylo with `prefers-color-scheme` support (#34423)Nico Burns2024-11-292-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | * Make Servo compatible with Stylo with prefer-color-scheme support Signed-off-by: Nico Burns <nico@nicoburns.com> Update imports to work with deduped version of stylo PR Signed-off-by: Nico Burns <nico@nicoburns.com> Switch back to stylo main branch Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix unit tests Signed-off-by: Nico Burns <nico@nicoburns.com> * Update text expectations Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Refactor computation of preferred aspect ratios (#34416)Oriol Brufau2024-11-2911-113/+133
| | | | | | | | | | | | | | | | | | | * Refactor computation of preferred aspect ratios Computing min/max-content sizes required a ContainingBlock in order to resolve the padding and border when determining the preferred aspect ratio. However, all callers already knew the padding and border, so they can compute the ratio themselves, and pass it directly instead of the ContainingBlock. Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Put preferred aspect ratio into ConstraintSpace Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Ensure taffy uses margin when calling ↵tanishka2024-11-281-1/+1
| | | | | used_size_as_if_inline_element_from_content_box_sizes() (#34421) Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Move script gpu files into webgpu folder (#34415)atbrakhi2024-11-2844-118/+108
| | | Signed-off-by: atbrakhi <atbrakhi@igalia.com>