aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
...
* feat: support pre-edit text display for IME (#35535)DK Liao2025-02-193-4/+23
| | | | | | | | | | | | | * feat: support pre-edit text display for IME Signed-off-by: DK Liao <dklassic@gmail.com> * enable ime by show_ime Signed-off-by: DK Liao <dklassic@gmail.com> --------- Signed-off-by: DK Liao <dklassic@gmail.com>
* script: add skeleton implementation of `FontFace` API (#35262)Mukilan Thiyagarajan2025-02-1910-7/+663
| | | | | | | | | | | | | | | | This patch implements the `FontFace` interface, but with some caveats 1. The interface is only exposed on `Window`. Support for Workers will be handled in the future. 2. The concept of `css-connected` `FontFace` is not implemented, so `@font-face` rules in stylesheets will not be represented in the DOM. 3. The constructor only supports using `url()` strings as source and `ArrayBuffer` and `ArrayBufferView` are not supported yet. A skeleton implementation of the `load` method of `FontFaceSet` is also implemented in this patch. The intention is to support some web pages that don't load without this method. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Ensure that qualified-name segments start with a valid start character (#35530)Simon Wülker2025-02-194-137/+141
| | | | | | | | | | | | | | | | | * Add spec comments to various methods Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Ensure that qualified-name segments start with a valid start character Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* feat: add `Notification` Web API binding (#34842)Jason Tsai2025-02-183-0/+588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: add Notification Web API binding Signed-off-by: Jason Tsai <git@pews.dev> * chore: update spec link Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * fix: index overflow Signed-off-by: Jason Tsai <git@pews.dev> * test(tidy): add notification WebIDL standard URL Signed-off-by: Jason Tsai <git@pews.dev> * fix: allow crown::unrooted_must_root Signed-off-by: Jason Tsai <git@pews.dev> * implement GetPermission Signed-off-by: Jason Tsai <git@pews.dev> * fix silent type Signed-off-by: Jason Tsai <git@pews.dev> * add all properties Signed-off-by: Jason Tsai <git@pews.dev> * test: add Notification to global Signed-off-by: Jason Tsai <git@pews.dev> * chore: update wpt manifest and fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * test: temp skip notifications Signed-off-by: Jason Tsai <git@pews.dev> * add vibration and apply suggestions Signed-off-by: Jason Tsai <git@pews.dev> * partially implement RequestPermission Signed-off-by: Jason Tsai <git@pews.dev> * call Permission request permission algorithm Signed-off-by: Jason Tsai <git@pews.dev> * chore: pub crate Notification Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * chore: crown attribute Signed-off-by: Jason Tsai <git@pews.dev> * fix part of suggestions Signed-off-by: Jason Tsai <git@pews.dev> * fix: store private `Action` structure Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix typo Signed-off-by: Jason Tsai <git@pews.dev> * fix: serialize images URL Signed-off-by: Jason Tsai <git@pews.dev> * fix: use globalscope as environment settings object Signed-off-by: Jason Tsai <git@pews.dev> * chore: add pref `dom_notification_enabled` and default to disabled Signed-off-by: Jason Tsai <git@pews.dev> * fix: use `descriptor_permission_state` Signed-off-by: Jason Tsai <git@pews.dev> * apply suggestions Signed-off-by: Jason Tsai <git@pews.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net> * test: remove passed meta Signed-off-by: Jason Tsai <git@pews.dev> * test: enable notification prefs in mozilla tests Signed-off-by: Jason Tsai <git@pews.dev> --------- Signed-off-by: Jason Tsai <git@pews.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* script: Add custom logging representation for DOM interfaces. (#35416)Josh Matthews2025-02-181-14/+73
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Make WebBluetooth an optional feature. (#35479)Josh Matthews2025-02-1819-12/+46
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Don't attempt to report style attribute for non-htmlelements to devtools ↵Simon Wülker2025-02-171-3/+5
| | | | | (#35519) Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* window: avoid NonNull<JSObject> in NamedGetter (#35508)Gae242025-02-172-21/+7
| | | Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* implement Touchevent prevent default behavior (#35031)Bi Fuguo2025-02-172-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement Touchevent prevent default behavior * The status change logic of the `TouchHandler` is changed. > The `WaitingForScript` state is canceled. TouchAction can be identified based on the current touch type and numbers if touch points. * Sends current event to script thread along with recognized `TouchAction`. > After dispatch event, script thread sends a `TouchEventProcess(EventResult)` message to main thread. If the event is set to `DefaultAllowed`, the corresponding `TouchAction` information is added. * After receiving `DefaultAllowed(TouchAction)` message, main thread executes corresponding action. > `DefaultPrevented(TouchEventType)` is received. Use `prevent_click` to mark that the default `Click` is blocked, and `prevent_move` to mark that the default `Scroll` and `Zoom` are blocked. In this way, all TouchActions implement preventDefault. Signed-off-by: Bi Fuguo <1782765876@qq.com> * fix some suggestions * support preventDefault fling * move `TouchAction` to share touch directory * check preventDefault everytime when touch * fix zoom ineffective Signed-off-by: Bi Fuguo <1782765876@qq.com> * fix some suggestions rename on_event_processed to on_touch_event_processed clear unused features Signed-off-by: Bi Fuguo <1782765876@qq.com> * Optimizes pan performance by continuously sliding without waiting for the eventhandler. Signed-off-by: kongbai1996 <1782765876@qq.com> * resolve conflict Signed-off-by: kongbai1996 <1782765876@qq.com> --------- Signed-off-by: Bi Fuguo <1782765876@qq.com> Signed-off-by: kongbai1996 <1782765876@qq.com>
* dom: expose obsolete `scheme` attribute for meta tag (#35505)Euclid Ye2025-02-171-0/+5
| | | | | | | | | | | | | * dom: expose obsolete `scheme` attribute for meta tag Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> * update tests Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* `DataTransferItem`: improve spec compliance (#35418)Gae242025-02-165-123/+180
| | | | | | | | | | | | | | | | | | | | | * DataTransfer: remove PlainString and Binary structs Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add DataTransferItemList remove() test case Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * bring datatransferitem closer to the spec Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * queue a task to invoke the callback Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* chore: Update wgpu (#35503)Samson2025-02-161-7/+6
| | | | | | | | | | | | | | | | | | * Update wgpu https://github.com/gfx-rs/wgpu/commit/d8833d079833c62b4fd00325d0ba08ec0c8bc309 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fix tidy Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* script: implement HTMLHyperlinkElementUtils for HTMLAreaElement (#35482)shanehandley2025-02-164-359/+678
| | | | | | This makes some common functionality in HTMLAreaElement and HTMLAnchorElement shared code. Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: Take away Fallible from new_resolved and new_rejected (#35473)Kingsley Yung2025-02-157-35/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Take away Fallible from new_resolved and new_rejected Both Promise::new_resolved and new_rejected only return `Ok`. We don't need them to be fallible. Simply return `Rc<Promise>`, instead of `Fallible<Rc<Promise>>`. Also, clean up relevant code. Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> * script: pull_algorithm becomes infallible The method pull_algorithm only returns `Some(Ok(_))`, which means it is infallible. Clean up the returned type. Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> * script: generic_initialize becomes infallible The method generic_initialize only returns `Ok(())`, which means it is infallible. Clean up the returned type. Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
* script: remove non-actionable todo from script/dom/document.rs (#35472)shanehandley2025-02-151-2/+1
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* chore: Remove outdated FIXME. (#35458)Josh Matthews2025-02-141-1/+0
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* libservo: change 'request_fullscreen_state_change' API to a notification ↵Mukilan Thiyagarajan2025-02-131-2/+2
| | | | | (#35445) Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* dom: IntersectionObserver initialization (#35314)Steven Novaryo2025-02-136-18/+434
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add internal slot definition Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Add initialization for new IntersectionObserver Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Move observer initialization Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Update WPT tests Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Make a copy of style IntersectionObserverRootMargin Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Move initialization to account for rooted expression Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix some fields typing Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Impl rest of IntersectionObserver interface Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix tidy issue Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Apply types logic and tidy fix from suggestions Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Add allow unrooted for add registration to element Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* Use surfman with glow bindings (take II) (#35422)Samson2025-02-131-3/+2
| | | | | | | | | | | | | | | * Reapply "Use surfman with glow bindings (#34328)" (#35402) This reverts commit 0fed99590a9377d8be071e457ecb1b3284f9ef27. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * update surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* libservo: Expose a single `InputEvent` type and pass it to script (#35430)Martin Robinson2025-02-126-310/+270
| | | | | | | | | | | | | | | | | | | | | | | | This change exposes a single `InputEvent` type and now there is only a single delegate method for this `WebViewDelegate::notify_input_event`. - Clipboard events are now handled as `EditingAction` inpute events. In the future this can include things like "Select All", etc. In addition, many parts of the dance to pass these events can now be simplified due to this abstraction. - All forwarded events are handled the same way in the `Constellation`, though they may carry an optional hit test (for events that have a `point`) which affects which `Pipeline` they are sent to. - In the `ScriptThread` we now accept these `InputEvents` and use them everywhere. Now all "compositor events" are "input events". - This allows removing several data structures which are no longer necessary. - We no longer inform the embedder when an event was handled by a WebView as that was only important for a MDI feature that will no longer be so important the full-featured `WebView` API. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* script: reset spurious frame counter *only* when reflow is triggered (#35435)Mukilan Thiyagarajan2025-02-121-3/+4
| | | | | | | | | | | | | | | I had applied a review suggestion in the previous PR to combine the nested conditions, but this is wrong as this meant the spurious frame callback was getting reset not just when the reflow was triggered by the callback, but also each time the counter reached the threshold. The test added in the previous PR also had issues with the upstream WPT repo's lint checks - `test.step_timeout` should be used instead of the `setTimeout` function. This patch fixes the counter update logic and also addresses the linting issue caught by upstream's linter. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Add Precustomized state to CustomElementState (#35392)Taym Haddadi2025-02-122-0/+13
| | | | | | | | | | | | | * add Precustomized state to CustomElementState Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Update test expectation Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* feat: dispatch mouse `contextmenu` event to DOM and embedder (#35364)Jason Tsai2025-02-121-2/+82
| | | | | | | | | | | | | * feat: dispatch mouse contextmenu event to DOM and embedder Signed-off-by: Jason Tsai <git@pews.dev> * chore: add parameters names as inline comments Signed-off-by: Jason Tsai <git@pews.dev> --------- Signed-off-by: Jason Tsai <git@pews.dev>
* script: fix spurious animation checks to correctly invoke rAF callbacks (#35387)Mukilan Thiyagarajan2025-02-121-17/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After running an `rAF` callback, if no new callbacks were registered, we send a `NoAnimationFramesCallback` to the compositor to stop ticking animations using video refresh callbacks. This interacts badly with the mechanism to track spurious animations frames i.e. rAF callbacks that don't mutate the DOM. Such 'faked' rAF callbacks are triggered by registering a oneshot timer instead of the compositor callback. The compositor's refresh callback is never enabled back again once a non-spurious rAF callback runs and registers a new rAF callback. If the former callback resets the `spurious_animations_frames` counter, then when the latter rAF callback runs, it will not schedule a OneShotTimer timer for any rAF callback that itself registers, since the counter was reset previously. Hence that third rAF callback that never runs as it relies on the compsitor's refresh callback, which was disabled previously. The current logic also doesn't actually recognize spurious animation frames because the `spurious_animations_frames` counter is updated at the end of the `run_the_animation_frame_callbacks`, effectively meaning `was_faking_animation_frames` and `self.is_faking_animation_frames` will always be the same value but the logic effectively only runs when `(!was_faking && is_faking)` is true. This patch fixes the logic to detect spurious animations frames by moving logic to update the counter to be before the check for spurious frames. It also ensures that the compositor's refesh callbacks is re-enabled once we see a non-spurious callback. Fixes #35386 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* bindings: Support non-object this values for callbacks. (#35427)Josh Matthews2025-02-122-11/+13
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Let script/webgpu feature imply script_traits/webgpu (#35424)Oriol Brufau2025-02-111-1/+1
| | | | | Fixes error when running `cargo clippy -r -p script --features webgpu`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: remove a fixed todo from script/dom/xmlhttprequest.rs (#35417)shanehandley2025-02-111-6/+1
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: make Error::to_jsval safe (#35411)Stephen Muss2025-02-108-64/+41
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* implemented feture and tests (#35309)Domenico Rizzo2025-02-101-2/+9
| | | Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Revert "Use surfman with glow bindings (#34328)" (#35402)Samson2025-02-101-2/+3
| | | | | This reverts commit 503bb10c5b1fafe01ebfb6b320902be2e8671c69. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* libservo: Flesh out permissions API (#35396)Martin Robinson2025-02-104-104/+119
| | | | | | | | | | | | | - Update the script crate to better reflect the modern Permission specifcation -- removing the necessity for an `Insecure` variant of the permissions prompt. - Have all allow/deny type requests in the internal API use an `AllowOrDeny` enum for clarity. - Expose `PermissionsRequest` and `PermissionFeature` data types to the API and use them in the delegate method. - Update both servoshell implementations to use the API. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* script: Add shadow dom check to custom element constructor (#35382)Max T.2025-02-091-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Add shadow dom check to custom element constructor Signed-off-by: maxtidev <max@maxti.dev> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Remove unnecessary custom-elements upgrading test .ini Signed-off-by: maxtidev <max@maxti.dev> * script: tidy comments in run_upgrade_constructor Signed-off-by: maxtidev <max@maxti.dev> --------- Signed-off-by: maxtidev <max@maxti.dev> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> Co-authored-by: maxtidev <max@maxti.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* dom: Always replace unpaired surrogates when handling page text (#35381)Martin Robinson2025-02-093-52/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: > JavaScript strings are potentially ill-formed UTF-16 (arbitrary > Vec<u16>) and can contain unpaired surrogates. Rust’s String type is > well-formed UTF-8 and can not contain any surrogate. Surrogates are > never emitted when decoding bytes from the network, but they can sneak > in through document.write, the Element.innerHtml setter, or other DOM > APIs. In 2015, Servo launched an experiment to see if unpaired surrogates cropped up in page content. That experiment caused Servo to panic if unpaired surrogates were encountered with a request to report the page to bug #6564. During that time several pages were reported with unpaired surrogates, causing Servo to panic. In addition, when running the WPT tests Servo will never panic due to the `-Z replace-surrogates` option being passed by the test driver. Motivation: After this 10 year experiment, it's clear that unpaired surrogates are a real concern in page content. Several reports were filed of Servo panicking after encountering them in real world pages. A complete fix for this issue would be to somehow maintain unpaired surrogates in the DOM, but that is a much larger task than simply emitting U+FFD instead of an unpaired surrogate. Since it is clear that this kind of content exists, it is better for Servo to try its best to handle the content rather than crash as production browsers should not crash due to user content when possible. In this change, I modify Servo to always replace unpaired surrogates. It would have been ideal to only crash when debug assertions are enabled, but debug assertions are enabled by default in release mode -- so this wouldn't be effective for WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Replace unnecessary macro in get_constructor_object_from_local_name ↵Max T.2025-02-091-137/+132
| | | | | | (#35383) Signed-off-by: maxtidev <max@maxti.dev> Co-authored-by: maxtidev <max@maxti.dev>
* make report_pending_exception safe and adjust callers (#35351)Nolen Scaife2025-02-088-43/+41
| | | Signed-off-by: Nolen Scaife <nolen@scaife.org>
* suppress build warnings when disabling webgpu and webxr (#35379)webbeef2025-02-088-15/+26
| | | Signed-off-by: webbeef <me@webbeef.org>
* Handle assigned slottables in an Event's path (#35380)Simon Wülker2025-02-081-6/+44
| | | | | | | | | | | | | * Handle slots in an event's path Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: make methods of ErrorInfo safe (#35367)Stephen Muss2025-02-071-22/+31
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* servoshell: Move `headless` setting to ServoShellPreferences (#35377)Martin Robinson2025-02-076-23/+0
| | | | | | | | | | This is only used in servoshell, even though it was plumbed through script previously. It's just about how the `RenderingContext` is set up, which is something managed entirely outside of servo itself. In addition, make the name of `servo_shell_preferences` in `app.rs` more consistent with the rest of the codebase. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: make throw_invalid_this and throw_constructor_without_new safe (#35360)Stephen Muss2025-02-073-14/+15
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* deps: Upgrade to `webrender@0.66` (#35325)Martin Robinson2025-02-0711-11/+13
| | | | | | | | | In addition to some small API changes, this downstream version of WebRender no longer depends on a very old version of time. This is the last step toward removing the dependency on `time0.1`. The review for this commit should also include: https://github.com/servo/webrender/commit/9f552bebab81a73e62068c42d94be2f9c0586ce4 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add a `ClipboardDelegate` and a default implementation (#35297)Martin Robinson2025-02-073-29/+38
| | | | | | | | | | | | | | | | | Add a `ClipboardDelegate` to the `WebView` API and a default implementation in libservo for this delegate that works on Mac, Windows, and Linux. Support for Android will be added in the future. This means that embedders do not need to do anything special to get clipboard support, but can choose to override it or implement it for other platforms. In addition, this adds support for handling fetches of clipboard contents and renames things to reflect that eventually other types of clipboard content will be supported. Part of this is removing the string argument from the `ClipboardEventType::Paste` enum because script will need to get other types of content from the clipboard than just a string. It now talks to the embedder to get this information directly. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Annotate steps for custom element creation. (#35354)Josh Matthews2025-02-072-43/+82
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Implement ServoLayoutNode::traversal_parent (#35338)Simon Wülker2025-02-078-166/+76
| | | | | | | | | | | | | | | | | | | | | This fixes common crash related to slottables, currently present on wpt.fyi. Previously, the traversal parent of `Text` nodes was incorrectly assumed to always be the parent or shadow host. That caused crashes inside stylo's bloom filter. Now the traversal parent is the slot that the node is assigned to, if any, and the parent/shadow host otherwise. The slottable data for Text/Element nodes is now stored in NodeRareData. This is very cheap, because NodeRareData will already be instantiated for assigned slottables anyways, because the containing_shadow_root field will be set (since assigned slottables are always in a shadow tree). This change is necessary because we need to hand out references to the assigned slot to stylo and that is not possible to do (without unsafe code) if we need to downcast the node first. As a side effect, this reduces the size of `Text` from 256 to 232 bytes, because the slottable data is no longer stored there. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update `pixels::unmultiply_inplace` to support RB swap and use it in ↵Euclid Ye2025-02-063-4110/+1
| | | | | | | | | | | | | | | canvas_state (#35313) * update unmultiply_inplace to handle reversed RGB Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> * Reuse unmultiply_inplace instead of manual compute; remove unused Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Inform the devtools about shadow roots on a node (#35294)Simon Wülker2025-02-053-19/+55
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Make generated proxy handlers and DOM object hooks generic (#35292)Josh Matthews2025-02-056-6/+28
| | | | | | | | | | | | | * script: Make DOM proxy handlers generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make finalize and trace hooks generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add support for Upgrade request to a potentially trustworthy URL. (#34986)Shubham Gupta2025-02-0529-14/+137
| | | | | | | | | | | | | | | | * Add support for Upgrade request to a potentially trustworthy URL. Signed-off-by: Shubham Gupta <shubham13297@gmail.com> * script: Support inheritable insecure request policy in documents and workers. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Shubham Gupta <shubham.gupta@chromium.org> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* script: delay Mutation initialization (#35291)Euclid Ye2025-02-055-23/+31
| | | Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Use surfman with glow bindings (#34328)Samson2025-02-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use glowing surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Port https://github.com/servo/webxr/pull/255 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fmt Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix stale TODO Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>