aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
* [webdriver] Add synchronization for wheel action (#37260)HEADmainKenzie Raditya Tirtarahardja71 min.6-24/+88
| | | | | | | | | | | Implement action synchronization for wheel event. Previously only done for pointer here https://github.com/servo/servo/pull/36932. Testing: `tests/wpt/meta/webdriver/tests/classic/perform_actions/wheel.py` --------- Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
* Use own ViewportDescription to clamp() initial_scale (#37337)Shubham Gupta5 hours1-2/+1
| | | | | | | | | | | Use own `ViewportDescription` to `clamp()` initial_scale. If use `self` it will use current module `ViewportDescription`, which is old one because new `ViewportDescription` is not set yet. Testing: Tested Locally Fixes: #37338 Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
* script: Replace use of UnsafeCell in WeakRangeVec. (#37327)Josh Matthews6 hours1-146/+130
| | | | | | | | | | | I can't find any historical motivation for the use of UnsafeCell in the implementation of WeakRangeVec from #8506. We can replace all the uses of unsafe in this code by using RefCell, and the resulting code is easier to understand. Testing: Existing WPT tests using Ranges show no behaviour changes. Fixes: #37276 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* [WebDriver] Properly report error: "No such window" (#37385)Euclid Ye15 hours3-7/+108
| | | | | | | | | | For WebDriver, return "No Such Window" properly according to spec. Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt" .\tests\wpt\tests\webdriver\tests\classic\ --product servodriver` --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Update handle_network_event to use BrowsingContextActor for HttpRequest (#37263)Usman Yahaya Baba20 hours4-29/+49
| | | | | | | | | | | | | | - Add browsing_context_actor_name parameter to handle_network_event - Replace NetworkEventMsg in HttpRequest case with BrowsingContextActor::resource_available - Update DevTools caller in lib.rs to pass browsing_context_actor_name Testing: Fixes: https://github.com/servo/servo/issues/33556#issuecomment-2756544430 --------- Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
* layout: Floor free space by 0 in solve_inline_margins_avoiding_floats() (#37362)Oriol Brufau25 hours1-2/+4
| | | | | | | | | | | | | `PlacementAmongFloats` should guarantee that the inline size of the placement rect is at least as big as the inline size of the box, resulting in a non-negative free space. However, that may fail when dealing with huge sizes that need to be saturated to MAX_AU, so this floors the free space by zero. Testing: New crashtest Fixes: #37312 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* feat(script): add `resolve_url_like_module_specifier` to `ModuleTree` (#37340)Jason Tsai36 hours1-16/+19
| | | | | | | | | adding `resolve_url_like_module_specifier` method to `ModuleTree`. Testing: Existing WPT test for script element should pass. Fixes: https://github.com/servo/servo/issues/37316, resolving a URL-like module specifier Signed-off-by: Jason Tsai <git@pews.dev>
* imagebitmap: Add missing basic functionality (#37025)Andrei Volykhin44 hours14-42/+329
| | | | | | | | | | | | | | | | | | | | | | | | Add missing basic functionality for ImageBitmap https://html.spec.whatwg.org/multipage/#imagebitmap including new variant of creation bitmap with source rectangle https://html.spec.whatwg.org/multipage/#dom-createimagebitmap but without support of cropping bitmap data with formatting. Add ImageBitmap to CanvasImageSource union type https://html.spec.whatwg.org/multipage/#canvasimagesource Add ImageBitmap to TexImageSource for WebGL https://registry.khronos.org/webgl/specs/latest/1.0/index.html Testing: Improvements in the following WPT tests - html/canvas/element/manual/imagebitmap/* - html/canvas/element/manual/wide-gamut-canvas/* - html/semantics/embedded-content/the-canvas-element/* - webgl/tests/conformance/textures/image_bitmap_from* - webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm Fixes: https://github.com/servo/servo/issues/34112 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
* servoshell: Do not focus and raise new auxiliary WebDriver-created ↵Euclid Ye47 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ülker48 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 Matthews2 days2-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 Ye2 days3-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 Matthews2 days1-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 Lippe3 days4-54/+277
| | | | | Part of #4577 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* CSS Grid: percentage sizing fixes (#34948)Nico Burns3 days4-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_hoang4 days4-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 Lippe4 days2-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 K4 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 Tsai4 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 Rizzo4 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 Volykhin5 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 Brufau5 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)webbeef5 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 Gupta5 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 azabani5 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)5 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ülker5 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 Tirtarahardja5 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ülker5 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 Lindholm5 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)Aokingo5 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 Rizzo6 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)webbeef6 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 Tirtarahardja6 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)sagudev6 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)sagudev7 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)eri7 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 Haddadi7 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_hoang7 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_hoang7 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_hoang8 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ülker8 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 Terzian8 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_hoang8 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 Ye8 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 Volykhin9 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 Lindholm9 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 Terzian9 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 Terzian9 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 Ye9 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>