aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
* servoshell: Do not focus and raise new auxiliary WebDriver-created ↵HEADmainEuclid Ye4 hours4-23/+55
| | | | | | | | | | | | | | | | | | | | | | `WebView`s (#37284) For Desktop port of `request_open_auxiliary_webview`, stay on the original WebView if the request originates WebDriver. This is to make sure `webdriver_server::handle_new_window` does not focus the new window, according to spec. See https://github.com/servo/servo/blob/c7eba2dbbac24e8571d12ce686173a11b287c5ca/tests/wpt/tests/webdriver/tests/classic/new_window/new_window.py#L31-L37 **To clarify**: this won't change the behaviour when user interacts, but only affects WebDriver [New Window](https://w3c.github.io/webdriver/#new-window). Testing: `./mach test-wpt -r --log-raw "D:/servo log/all.txt" ./tests/wpt/tests/webdriver/tests/classic --product servodriver` based on 96b097303783ff12d4a1a7986260ad3c19a31837 --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Support `::part` selector (#37307)Simon Wülker5 hours7-18/+90
| | | | | | | | | | | | | | This is pretty much just wiring up the necessary stylo methods. Note that the `exportparts` attribute is not yet supported, I'll do that in a followup change Testing: Covered by existing web platform tests. This is the first half of https://github.com/servo/servo/issues/35349 Fixes https://github.com/servo/servo/issues/37325 --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* tests: Use Ahem font provided by WPT harness. (#37054)Josh Matthews7 hours2-1/+4
| | | | | | | | | | | #37021 exposed that our tests are trying to load a local file path for Ahem.ttf, but this stops working when we implement the specified CORS protections for our font requests. Luckily, the WPT suite already provides a same-origin version of the same font, so we can just update our CSS to use that font face instead. Testing: Existing WPT coverage. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* [WebDriver] Unify Cookie related Error types (#37339)Euclid Ye9 hours3-40/+30
| | | | | | | | | Remove `embedder/webdriver.rs::WebDriverCookieError` and use universal `ErrorStatus` from webdriver crate. This is needed as we might need to send back more universal error such as `NoSuchWindow`. Testing: No behaviour change. Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Upgrade tungstenite, webpki-roots, and hyper-rustls dependencies. (#37333)Josh Matthews16 hours1-4/+4
| | | | | | | | | | | | This change upgrades some dependencies that required some manual intervention due to duplicate packages and breaking API changes. These changes also allow us to upgrade to ipc-channel 0.20 (https://github.com/servo/ipc-channel/pull/390#discussion_r2070677101), and allow us to upgrade other dependencies that have migrated to rand 0.9 while the ecosystem remains split. Testing: Existing WPT tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Report URI with POST fetch request (#37209)Tim van der Lippe20 hours4-54/+277
| | | | | Part of #4577 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* CSS Grid: percentage sizing fixes (#34948)Nico Burns24 hours4-78/+104
| | | | | | | | | | | | | | | | | | | | | This applies some fixes for CSS Grid percentage sizing. These fixes are mostly within Taffy, but there are some changes in Servo to allow it to communicate whether an item is replaced to Taffy. It also updates Taffy to v0.8.0. Taffy has switched to a tagged pointer representation of length/size styles. Much of the diff here is updating Servo's type conversion code to use the new representation. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes OR --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* [webdriver] Implement get shadow root (#37280)batu_hoang42 hours4-0/+53
| | | | | | | | | | | | | Implement Get Element Shadow Root https://www.w3.org/TR/webdriver2/#dfn-get-element-shadow-root cc: @xiaochengh, @yezhizhen, @PotatoCP Testing: `\tests\wpt\tests\webdriver\tests\classic\get_element_shadow_root\get.py` is blocked by `no_browsing_context` and `closed_window` pass for other sub-tests. Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Fix Sec-Fetch-Site header (#37277)Tim van der Lippe46 hours2-5/+13
| | | | | | | | | | While working on #37209 I discovered that the header was computed incorrectly. After carefully reading the specification, I realized that the link in the spec was wrong and we were missing the fact that for host-domains, we should operate on the registrable domain. Additionally, the same-site call was missing the negation. Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* Change canvas/context/snapshot size from u64 -> u32 (#36827)Sam K2 days14-69/+69
| | | | | | | | | | | | | | | | | | | | | Replaces uses of `euclid::default::Size2D<u64>` with `euclid::default::Size2D<u32>` for the canvas/context/snapshot. This PR includes changes to the following components: - canvas - pixels - script - script_bindings - shared/canvas - shared/snapshot Testing: https://github.com/hashcatHitman/servo/actions/runs/15426115391 (as of 892edc0048dfad28342e5e2ff247c963eb91ed11) Fixes: #36706 --------- Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
* feat(script): add `Supports()` to `htmlscriptelement` (#37313)Jason Tsai2 days2-0/+10
| | | | | | | | Add static method `Supports` to `HTMLScriptElement`. Part of #37262 Testing: relative WPT tests should become `PASS` Signed-off-by: Jason Tsai <git@pews.dev>
* [#26499] Refactors HTMLMediaElement drop logic (#37310)Domenico Rizzo2 days1-15/+38
| | | | | | Testing: No tests added Fixes: Partially #26488 Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* htmlmediaelement: Support seek requests for non seekable fetch context (#37264)Andrei Volykhin3 days1-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to specification the data:// URL protocol doesn't support range request so be able make any seek request to required content position let's allow for non seekable fetch context discard fetched content bytes until seek offset. https://fetch.spec.whatwg.org/#scheme-fetch Some scheme URLs (like data:// URL) doesn't expose "Content-Length" header in response so the total expected size of the stream is unknown and it causes some additional seek request (SeekData) from the media player. Try to post configure stream size after we reached fetch EOS response. Related source code which breaks WPT tests: [tests/wpt/tests/html/canvas/element/manual/imagebitmap/common.sub.js#L56-L78](https://github.com/servo/servo/tree/main/tests/wpt/tests/html/canvas/element/manual/imagebitmap/common.sub.js#L56-L78) Testing: Improvements in the following tests: - html/canvas/element/manual/imagebitmap/createImageBitmap* Fixes: https://github.com/servo/servo/issues/32645 Fixes: https://github.com/servo/servo/issues/32745 Fixes: https://github.com/servo/servo/issues/34119 Fixes: https://github.com/servo/servo/issues/34120 Fixes: https://github.com/servo/servo/issues/34151 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
* layout: Force outside ::marker to establish a BFC (#37252)Oriol Brufau3 days2-21/+17
| | | | | | | | | | | | | | | | | Even though we were continuing the parent BFC, we weren't updating the SequentialLayoutState to have the correct containing block info. That caused problem in the presence of floats. This patch establishes an independent BFC, which avoids the problem. This seems reasonable since outside markers are out-of-flow-ish, and it matches Firefox. Blink implements them as inline-blocks, so they should also establish a BFC. Testing: Adding new tests. Some still fail because of a different issue. Also, adding an expectation for several existing tests that were missing it. Fixes: #37222 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Revert "Implement Input UA Shadow DOM (#37065)" (#37296)webbeef3 days6-313/+36
| | | | | | | | This reverts commit 5580704438a81ffbd183c6e3deb5cbc479ad4d0a. Let's re-land that fix when a working solution is found. Keeping that regression makes it hard to evaluate other potential improvements. Signed-off-by: webbeef <me@webbeef.org>
* Add support for parsing and applying `viewport` `<meta>` (#35901)Shubham Gupta3 days6-19/+248
| | | | | | | | | | | | | | | | | This patch comprises following steps: 1. Parses the `viewport` Attribute from `<meta>`. 2. Creates a `ViewportDescription` struct. 3. Populate values into Viewport struct. 4. Pass & Stash Viewport Description to Webview. 5. Process parsed values of `viewport <meta>` Testing: Tested locally. Fixes: #36159 --------- Signed-off-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* Fix `cargo build -p libservo` on macOS 13 by running Python via `uv` (#37290)delan azabani3 days2-87/+25
| | | | | | | | | | | | | | | | | | The correct way to run Python when building Servo is `uv run python`, unless we are running as a descendant of `uv run python`. In that case, we can use either `uv run python` or `python` (uv does not provide a `python3` on Windows \*). \* for the astute reader, yes, this causes problems for mozjs, which only tries `python3` unless PYTHON3=python :))) Testing: tested manually on macOS 13 (see below), and will be tested in CI Fixes: #37289 ![Screenshot_servo-macos13_2025-06-06_11:35:52](https://github.com/user-attachments/assets/01d4ea38-d405-452f-aeb9-75aada13c907) Signed-off-by: Delan Azabani <dazabani@igalia.com>
* HTMLScriptElement: add `ScriptType::ImportMap` (#37291)Ngo Iok Ui (Wu Yu Wei)3 days1-27/+36
| | | | | | | | | | | | | HTMLScriptElement: add `ScriptType::ImportMap` Part of #37262 This covers most steps that are related to import map. Testing: Existing WPT on HTMLScriptElement should remain the same. --------- Signed-off-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local> Co-authored-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
* Fix timing of change events for `<select>` elements (#37293)Simon Wülker3 days3-20/+61
| | | | | | | | | | | | | | | Fixes two silly bugs in the implementation of `<select>` elements. * We did not fire `input` events * We fired `change` events *before* updating the selected value Both of these are only relevant when the embedder selects a value, so due to our lack of webdriver support we can't test them. With these changes it is possible to switch the language on https://toolbox.googleapps.com/apps/main/. --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix mistakes in webdriver element send keys (#37286)Kenzie Raditya Tirtarahardja3 days1-1/+1
| | | | | | | | | | Fix mistakes from https://github.com/servo/servo/pull/37224. We should return in the middle of send keys if the element is either file input or non typeable form control. Fixes: https://github.com/servo/servo/pull/37224#pullrequestreview-2903871157 Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
* Don't drain ranges across shadow boundaries (#37281)Simon Wülker3 days2-41/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The [live range pre remove steps](https://dom.spec.whatwg.org/#live-range-pre-remove-steps) state that: > For each [live range](https://dom.spec.whatwg.org/#concept-live-range) whose [start node](https://dom.spec.whatwg.org/#concept-range-start-node) is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of node, set its [start](https://dom.spec.whatwg.org/#concept-range-start) to (parent, index). Elements in a shadow tree are not inclusive descendants of their hosts - meaning we should not bubble ranges across shadow boundaries. Includes a small fix to `Node::ranges_is_empty` which makes servo do less work on DOM mutations, as well as some changes to `range.rs` to match the spec better. I made these changes during debugging and they don't feel like they're worth their own PR. Testing: Covered by WPT --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Fix two issues in the XPath parser to pass all `xml_xpath_tests.xml` ↵Ville Lindholm3 days3-59/+104
| | | | | | | | | | | | | | | | | | | tests (#37279) 1. Better handling of namespaces for element and attribute names in XML mode (read: non-HTML mode) 2. While parsing, pass along context on whether we are in an absolute (`/`) or descendant (`//`) part of the query, and use it to correctly enumerate descendants according to where we are in the evaluation of the AST. Testing: All 1024 tests in `xml_xpath_tests.xml` (actually `xml_xpath_runner.html`) pass, as well as some random tests in `text-html-attributes.html`. Fixes: #37278 --------- Signed-off-by: Ville Lindholm <ville@lindholm.dev>
* Fix ReadableStream cancel error message (#37282)Aokingo4 days1-1/+1
| | | | | | | | | Align error message with WHATWG Streams spec by changing: - `'stream is not locked'` to `'stream is locked'` This will match the step 2 of the readablestream cancel method that requires the correct TypeError when the stream is locked. Signed-off-by: Alice Okingo <annekadiso@gmail.com>
* [#26488] Moves the FetchCanceller to a separate droppable struct, in Event ↵Domenico Rizzo4 days1-14/+33
| | | | | | | | Source (#37261) Testing: No tests added. Fixes: partially fixes #26488 Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Use a VecDeque to manage timers (#37080)webbeef4 days1-8/+8
| | | | | | | | | | Profiling speedometer 2.1 on a quad core Intel N100, we spend quite some time in Vec::insert when adding new timers. This is mostly because one of the tests creates a large number of timers (> 10k). Switching to a VecDeque solves that and gets a ~2% score improvement on that device. Signed-off-by: webbeef <me@webbeef.org>
* Implement wb element send keys for file input (#37224)Kenzie Raditya Tirtarahardja4 days4-21/+78
| | | | | | | | | | | | | We can now send keys to file input, which results in uploading file with given filename. Needs `pref=dom_testing_html_input_element_select_files_enabled` flag to work. https://w3c.github.io/webdriver/#element-send-keys Testing: `tests/wpt/meta/webdriver/tests/classic/element_send_keys/{events, file_upload}.py.` Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
* canvas: ensure there is a subpath in `PathBuilderRef` (#37251)sagudev5 days2-1/+33
| | | | | | | | | | | | | | | | This is also required by spec: https://html.spec.whatwg.org/multipage/canvas.html#ensure-there-is-a-subpath and if we not ensure it vello will trigger debug asserts. Enforcing this at `PathBuilderRef` is the lowest possible level that avoids misuse (and avoids IPC messages if we were to do this in content process) while still keeping it from backend. Testing: There are tests in WPT Split of https://github.com/servo/servo/pull/36821 try run: https://github.com/sagudev/servo/actions/runs/15449044694 --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* canvas: Use `Cow<[u8]>` for bytes() getter (#37249)sagudev5 days3-6/+9
| | | | | | | | | | | | I fell into trap of over-generalization in https://github.com/servo/servo/pull/36793, but https://github.com/servo/servo/pull/36821 showed `Cow<[u8]>` is all we need (to reuse existing vec alloc or pass on a slice). Testing: There are WPT tests, but it's just refactor so rust keeps us safe. Split of https://github.com/servo/servo/pull/36821 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* devtools: Fix inspector on Firefox 139 (#37247)eri5 days1-0/+9
| | | | | | | | | | | Added a `target_type` field so that Firefox 139 is happy with showing the inspector. In the future, this should probably include other `TARGET_TYPES` like watcher and process. Testing: Manually tested the inspector in Firefox 139 (not sure if we have automatic devtools tests now). Fixes: #37242 Signed-off-by: eri <eri@inventati.org>
* Dom: Implement AbortSignal ThrowIfAborted method (#37245)Taym Haddadi5 days1-2/+12
| | | | | | Implement the ThrowIfAborted method of AbortSignal; part of https://github.com/servo/servo/issues/36935. Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Fix events filter in wait_for_user_agent_handling_complete (#37241)batu_hoang5 days1-1/+1
| | | | | | Fix a mistake from https://github.com/servo/servo/pull/37095 cc: @xiaochengh Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Add retry for hit tests with expired epoch in result (#37085)batu_hoang5 days2-51/+134
| | | | | | | | | | | | | | | | | | | | | | | | Follow up to [hit_test failed occasionally when the touch event is sent](https://github.com/servo/servo/issues/35788#top) and https://github.com/servo/servo/issues/36676#issuecomment-2882917136, this PR adds a retry for hit tests with expired epoch in result. Hit tests with outdated epoch mean it is too early to perform the hit test. Solution: retry hit test for the event on the next webrender frame. The retry should guarantee that: - Keep the correct order of events - Retry time is not too long Test cases: `./mach test-wpt --product servodriver -r tests\wpt\tests\webdriver\tests\classic\element_click\events.py` cc: @xiaochengh , @yezhizhen --------- Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Fix webdriver wait for response from constellation (#37095)batu_hoang6 days2-9/+30
| | | | | | | | | | | | Webdriver actions only wait for response from constellation if `dispatch_tick_actions` sends at least 1 event. Testing: `./mach test-wpt -r --product servodriver ./tests/wpt/tests/webdriver/tests/classic/perform_actions/perform.py ` cc: @xiaochengh, @yezhizhen Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Implement the `size` presentational hint for `<hr>` elements (#37211)Simon Wülker6 days3-11/+105
| | | | | | | | | | | | | | This presentational hint either sets the width values of all borders, removes the bottom border or sets the height of the element, depending on the context. This change also implements the corresponding idl attribute (and the `noshade` attribute, which does nothing in html5) Testing: Adds new web platform tests --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* dom: implement abort signal reason method (#37227)Gregory Terzian6 days1-2/+3
| | | | | | Implement the `reason` method of `AbortSignal`; part of https://github.com/servo/servo/issues/36935. Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* Implement actions_by_tick for webdriver (#37153)batu_hoang6 days2-214/+258
| | | | | | | | | | | | | | | | | | | | | Implement `actions by tick` according to the spec. The major change is `dispatch_actions` should receive a `actions by ticks` as param. https://w3c.github.io/webdriver/#dispatching-actions > The algorithm to [dispatch actions](https://w3c.github.io/webdriver/#dfn-dispatch-actions) takes a list of actions grouped by [tick](https://w3c.github.io/webdriver/#dfn-ticks), and then causes each action to be run at the appropriate point in the sequence. Reference for types in webdriver: https://hackmd.io/b59NiPcLR_Gagh7r6r7BEw?view cc: @xiaochengh --------- Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Consistently use `Dom` in native promise handlers (#37226)Euclid Ye6 days1-2/+3
| | | | | | | | | | Use `Dom` instead of `DomRoot` for fields of `TransmitBodyPromiseRejectionHandler` to reduce redundant work by GC, according to discussion in https://github.com/servo/servo/issues/33604#issuecomment-2931524400 Fixes: #33604 Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* htmlmediaelement: Fix fetch request race on "seek-data" event (#37002)Andrei Volykhin7 days1-98/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On execution media element load algorithm https://html.spec.whatwg.org/multipage/media.html#media-element-load-algorithm we can observe race condition between parallel running fetch requests: R1: (media element) initial request (see "resource_fetch_algorithm" function) R2: (gstreamer) duration "seek-data" request (see PlayerEvent::SeekData) R3: (gstreamer) continue on last interrupted time "seek-data" request At time there are only one current fetch context for media element but because resource fetch and cancellation are async operations need to identify (by request id) and skip processing outdated fetch request (fetch listener callbacks). Async load in background sequence (stream content length = 2757913): ``` R1 (seek-offset=0): [------------------------------X] R2 (seek-offset=2757866): [---------Y] AS-****-+++-AE R3 (seek-offset=98304): [----------------Z] BS-****-+++BE R1 (seek-offset=0): [------X] R2 (seek-offset=2757866): [--------Y] (discarded data) AS-****---------+++-AE - A*/B* performed seeks (*** seek lock, +++ flush buffer queue + reset EOS) (on Gstreamer streaming thread) - X/Y/Z "end-of-stream" events from fetch requests (on Servo script thread) ``` All incoming input data from different requests are mixed and pushed to active media player, plus abnormal behaviour due to intermixed X/Y/Z "end-of-stream" events. To handle it properly we will unblock seek lock on "seek-data" event (on script thread) as soon as possible (GStreamer will be able to flush buffer queue and reset EOS state) and introduce buffered data source to delay pushing input data/EOS event until media player will be actually ready. Testing: Improvements to the following tests: - /html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html - /html/semantics/embedded-content/the-canvas-element/security.pattern.fillStyle.sub.html Fixes: https://github.com/servo/servo/issues/31931 Fixes: https://github.com/servo/servo/issues/36989 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
* XPath: implement lang() and id() core functions (#34594)Ville Lindholm7 days7-37/+222
| | | | | | | | | | | | | | | | | | | | XPath's `lang()` and `id()` functions were still unimplemented. Also: * Add WPT tests for `id()`. * Fix uniqueness check in `NodesetHelpers::document_order_unique`. * Tweak the AST a bit to make it clearer to express "no predicates". * Fix a parsing bug where "/" was attempted before "//", leaving the "//" branch as always unused. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #34593 - [x] There are tests for these changes --------- Signed-off-by: Ville Lindholm <ville@lindholm.dev>
* dom: implement aborted method of abort signal (#37218)Gregory Terzian7 days1-2/+8
| | | | | | Implement the `aborted` member of `AbortSignal`. Part of https://github.com/servo/servo/issues/36935 Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* dom: implement signal method on abort controller (#37217)Gregory Terzian7 days2-1/+7
| | | | | | | Part of https://github.com/servo/servo/issues/34866 The "Finish current stub for AbortController" item. Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* script: Upgrade `node_ids` to `pipeline_to_node_ids` to track the owner ↵Euclid Ye7 days4-37/+61
| | | | | | | | | | | | | | | | | | | pipeline of the node (#37213) Upgrade `ScriptThread::node_ids` to `pipeline_to_node_ids` to track the owner pipeline of the node This will enable webdriver to know if it is requesting element from other origins and properly distinguish "stale element reference" from "no such element". Testing: [Action run](https://github.com/yezhizhen/servo/actions/runs/15385994907), no regression. We can now pass WebDriver "cross origin" tests. Fixes: #35749 --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* net: Perform CSP checks on fetch responses. (#37154)Tim van der Lippe8 days2-48/+86
| | | | | | | | | | | | | | | | | | | Also add clarifying comments to the SRI WPT tests with regards to the `www.` domain and how that interacts with the integrity checks. Lastly, adjust the casing for `Strict-Dynamic`, as in the post-request check that should also be case-insensitive. Closes servo/servo#37200 Closes servo/servo#36760 Fixes servo/servo#36499 Part of w3c/webappsec-csp#727 Fixes w3c/webappsec-csp#728 Part of servo/servo#4577 Signed-off-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* script: Set HTTP status code when aborting an `XMLHttpRequest` (#37190)Tunahan Karlibas8 days1-0/+3
| | | | | | | | | Correctly set status when aborting a XMLHttpRequest. Testing: WPT test xhr/abort-during-done.window.html --------- Signed-off-by: Tunahan Karlibas <dvt.tnhn.krlbs@icloud.com>
* Split handle_player_event into smaller functions (#37113)Michael Rees8 days1-354/+380
| | | | | | | | | | | | | | | | Split HTMLMediaElement::handle_player_event into smaller functions (#37109) As requested, I also did a quick pass over the entire file looking for if/else blocks that could be converted into early returns, but only found two. Both of those have been changed here. Testing: This doesn't require (new) tests because it is a reorganization of existing code. Fixes: #37109: HTMLMediaElement::handle_player_event is too big --------- Signed-off-by: Michael Rees <mrees@noeontheend.com>
* DevTools: Fix empty `debugger > source` panel (#37197)atbrakhi9 days3-1/+62
| | | | | | | | | | | | | | | | | | | | | This patch fixes the source panel in the DevTools that was broken due to missing breakpoint actor implementation. The client was sending messages to the breakpoint actor that didn't exist in Servo, resulting in "unknown actor" warnings in the logs(See logs in issue description) To fix this this patch implements the `BreakpointListActor` that handles `setBreakpoint` and `setActiveEventBreakpoints` messages with empty replies. This PR does not implement `breakpoint` functionality <img width="1512" alt="image" src="https://github.com/user-attachments/assets/ac4985a6-9fd3-4854-a491-b39241e19d13" /> Fixes: https://github.com/servo/servo/issues/37196 Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* dom: implement signal abort on controller and signal (#37192)Gregory Terzian9 days3-9/+101
| | | | | | | Part of https://github.com/servo/servo/issues/34866 Implement signal abort, and part of running abort steps. Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* layout: Split overflow calculation after fragment tree construction (#37203)Oriol Brufau10 days9-82/+136
| | | | | | | | | | | | | | Instead of computing scrollable overflow while constructing the fragment tree, we will now do it later. In the future this will also allow to only recalculate the overflow without rebuilding the tree when transform properties change, but that's left for a follow-up. Stylo PR: https://github.com/servo/stylo/pull/194 Testing: One test is now passing (more investigation is needed), but otherwise this isn't expected to have any effect. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Constellation can now optionally report memory usage when the page is ↵Narfinger10 days5-1/+14
| | | | | | | | | | | | | | | | | | loaded. (#37151) The constellation can now tell the memory reporter to report the memory to a trace file when a page is loaded. Additionally, we amend the memory reporter to allow a simple message where it will report the memory to a tracing provider (at the moment only OHOS/hitrace is supported but easy extension is possible). I am not sure if this is the right approach or if the embedder should decide to have the memory reporting done. Testing: This does not change functionality of any of the rendering. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
* Implement Input `type=text` UA Shadow DOM (#37065)Steven Novaryo10 days6-36/+313
| | | | | | | | | | | | | | | | | | | | | | | | Implement Shadow Tree construction for input `type=text`, adding a text control inner editor container and placeholder container. Subsequently, due to the changes of the DOM tree structure, the changes will add a new NodeFlag `IS_TEXT_CONTROL_INNER_EDITOR` to handle the following cases. - If a mouse click button event hits a text control inner editor, it will redirect the focus target to its shadow host. - In text run's construction, the text control inner editor container queries the selection from its shadow host. This is later used to resolve caret and selection painting in the display list. This will be the first step of fixing input `type=text` and other single-line text input element widgets. Such as, implementing `::placeholder` selector. Testing: Existing WPT test and new Servo specific appearance WPT. Fixes: #36307 --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>