Commit Graph

566 Commits

Author SHA1 Message Date
Shubham Gupta
ba7ad0d8aa wpt: Add a delay to load to valid image to overcome false positive PASS (#43357)
This adds a delay of 2 seconds for loading a valid image. This is added
to potentially overcome the race condition happening while reporting
LCP, to save from false positive result.

Testing: WPT tests is `TIMED OUT` as expected.

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-03-17 16:03:33 +00:00
Simon Wülker
708f5de35b script: Support constructing FontFaces from ArrayBuffers (#43281)
Testing: This change adds new tests
Fixes https://github.com/servo/servo/issues/39657
Part of https://github.com/servo/servo/issues/6098

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-15 22:13:56 +00:00
Servo WPT Sync
2442ef7dc4 Sync WPT with upstream (15-03-2026) (#43274)
Automated downstream sync of changes from upstream as of 15-03-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-03-15 01:33:03 +00:00
Simon Wülker
020c651f21 script: Mark canvas as dirty after updating image data (#43218)
This makes https://theintraclinic.com/archive/minecraft4k-js/ work
correctly in servo.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-12 20:04:21 +00:00
Taym Haddadi
eabf3c70bb constellation(storage): validate storage event source and scope session fanout by webview (#43096)
Follow the spec and tightenings storage event routing in Constellation
by validating that a BroadcastStorageEvent comes from the same origin as
its source pipeline, while preserving existing localStorage fanout
behavior.

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-03-12 15:14:55 +00:00
Euclid Ye
e88c5dd752 script: Notify embedder coalesced events to resolve potential WebDriver deadlock (#43202)
Notify embedder the coalesced wheel/mousemove event.

We also stop cloning every single entry in `pending_input_event`.

Testing: This should unblock the potential WebDriver thread deadlock
when receiving simultaneous wheel or pointer inputs from multiple
sources.
We added a new test that stably deadlock on
74c16ffd8a.
Firefox/Safari/Chrome all pass the new test.
Fixes:
https://github.com/servo/servo/issues/43136#issuecomment-4031702204

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-12 12:40:04 +00:00
Martin Robinson
f0c5b37c24 wpt: Use the default Servo user agent for WPT tests (#43185)
Some WPT tests [^1] rely on the user agent reflecting that of a real
browser or platform. This change makes it so that the user agent that
Servo uses when running the WPT is the default one, which includes the
platform.

[^1]:
aae5c4cd97/tests/wpt/tests/resources/accesskey.js (L16)

Testing: This causes some access key tests to pass on macOS.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-11 19:16:38 +00:00
Euclid Ye
605291b7e0 webdriver: Support interspersed scroll actions via event queue (#43126)
Scroll and PointerMove is quite similar. We did so for `PointeMove` in
https://github.com/servo/servo/pull/42289 +
https://github.com/servo/servo/pull/42946.

Imagine having 3 non-zero duration scroll actions with origin at
different Elements.
Previously we would wait for one to be fully dispatched before moving to
next action,
instead of interspersed.

We also consolidate `PendingPointerMove` and
newly added `PendingScroll` into `enum PendingActions`.

Testing: 
[Existing tests behaviour not
changing.](https://github.com/servo/servo/actions/runs/22887005716).
Added a wdspec test.
Previously: `['wheel', 'wheel', 'wheel', 'wheel', 'wheel', 'wheel',
'wheel', 'wheel', 'wheel', 'move']`
Now: `['wheel', 'move', 'wheel', 'move', 'wheel', 'move', 'move',
'wheel', 'wheel', 'move', 'move', 'wheel', 'wheel', 'move', 'move',
'wheel']`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-11 03:43:39 +00:00
Euclid Ye
c1aaaaf18c css: Enable jump-start, jump-both, jump-end, jump-none step-position (#43061)
Bumps stylo to https://github.com/servo/stylo/pull/323
As tested with examples, all step-position keywords now work:
https://drafts.csswg.org/css-easing-2/#typedef-step-position

Testing: New passing WPT. Several in `moveBefore` goes from TIMEOUT to
`FAIL`, as the API is not enabled in Servo. Added 4 new tests to test
the proper rendering.
Fixes: #43060

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-09 10:55:06 +00:00
Jonathan Schwender
1632e61ed6 servoshell: Rename executable to servoshell. (#42958)
This should help clarify the difference between servo the library /
engine and servoshell the browser (demo).

Other changes: 

- Removed etc/servo.sb ( [apple sandbox profile
format](https://angelica.gitbook.io/hacktricks/macos-hardening/macos-security-and-privilege-escalation/macos-security-protections/macos-sandbox#sandbox-profiles))
since it is not needed anymore. See [this
comment](https://github.com/servo/servo/pull/42958#discussion_r2876253489)
for more details.

Testing: This is a very invasive change, and there are bound to be
scripts / places I have overlooked. Searching for usages of `servo` is
very hard, since it's also the name of the library.
Try run: https://github.com/servo/servo/actions/runs/22637676818

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-03-07 08:08:38 +00:00
Euclid Ye
cab4416d4c webdriver: Enable pointerMove to perform smooth transition over specified duration (#42946)
Enable `pointerMove` to perform a smooth transition over specified
duration.

- Sync move/scroll interval with default tick duraiton in testdriver:
a60a8b1b4d/tests/wpt/tests/resources/testdriver-actions.js (L34-L38)
- Fully process all pending pointer moves within this tick. This is one
of the conditions that is
[required](https://w3c.github.io/webdriver/#dfn-perform-a-pointer-move:~:text=There%20are%20no%20pending%20asynchronous%20waits%20arising%20from%20the%20last%20invocation%20of%20the%20dispatch%20tick%20actions%20steps%2E)
to finish this tick. Previously, the pending move events might be
processed in next Tick, if they have long duration.


https://github.com/user-attachments/assets/8692086f-32bb-45f3-ae0c-a072f68e1e84


https://github.com/user-attachments/assets/35af99a9-889b-41c1-91e2-55f22ad453a1

Testing: Added a WPT test. I'm surprised it is not covered by existing
tests, given the huge behaviour difference.
Fixes: https://github.com/servo/servo/issues/42950
Part of https://github.com/servo/servo/issues/41620

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-06 01:49:28 +00:00
Steven Novaryo
a672397f2d layout: Add a query for getting the effective overflow of an element and use it in script (#42251)
In layout calculation within script, Instead of relying on the computed
values for overflow, query the overflow from layout for its used value
to accurately reflect whether an element establish a scroll container.
This query will be used for `IntersectionObserver` as well.

Testing: There are new `IntersectionObserver` WPT failures:
- `intersection-observer/isIntersecting-change-events.html`
- `intersection-observer/containing-block.html`

The failures are more than likely a false positive because intersection
observation steps wasn't supposed to trigger a reflow, but it was
before. It could be caused by the implementation of
`IntersectionObserver` in major UAs being a little bit different from
the spec in the calculation of `threshold` and `isIntersecting` .

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-03-05 11:35:32 +00:00
Servo WPT Sync
0343706a02 Sync WPT with upstream (04-03-2026) (#43011)
Automated downstream sync of changes from upstream as of 04-03-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-03-04 07:24:31 +00:00
Loïc Denuzière
1970e57b26 paint: Bound screenshot to the viewport (#42739)
Ensure that the screenshot rectangle is bounded by the width and height
of the viewport.

Testing: The WPT test `test_clip_huge_element_to_viewport` now passes
instead of crashing. It is also fixed so that the returned screenshot
size is the expected 800x600; it would otherwise be 792x600 due to the
body margin.

Fixes: #42530

---------

Signed-off-by: Loic Denuziere <loic@denuziere.net>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-04 06:43:24 +00:00
Euclid Ye
914121ef25 pointerevent_support.js: touchScrollInTarget smoothly (#42652)
The util `function touchScrollInTarget` aims to touch scroll the target
smoothly. However, currently it creates **accelerating** scrolling: as
the coordinates of `target` keep changing during the touch move which we
use as origin. This is not intended.

What's worse, this can trigger [out of
bound](https://w3c.github.io/webdriver/#ref-for-dfn-move-target-out-of-bounds-2:~:text=If%20y%20is%20less%20than%200%20or%20greater%20than%20the%20height%20of%20the%20viewport%20in%20CSS%20pixels%2C%20then%20return%20error%20with%20error%20code%20move%20target%20out%20of%20bounds%2E)
WebDriver error, and the tests never work.

This has caused problem for Firefox/Safari as well, e.g.
[pointerevent_touch-action-table-none-test_touch.html](https://wpt.fyi/results/pointerevents/pointerevent_touch-action-table-none-test_touch.html?run_id=5177777654595584&run_id=5095681367998464&run_id=5083756189974528).

Testing: Updated expectations of existing tests.




Before for `pointerevent_touch-action-table-none-test_touch.html`:


https://github.com/user-attachments/assets/7f14eee7-bdec-4ea4-a83e-684b2b65d951

After:



https://github.com/user-attachments/assets/9b05a9e6-164d-419c-a519-383dab856a4c

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-03 14:22:01 +00:00
Euclid Ye
6c82b3178e paint: Track whether script is handling touchmove per TouchId (#42926)
As titled. The change is prepared a while ago to eliminate dead code, 
but the test case added requires change from `testdriver-actions.js`: 
https://github.com/web-platform-tests/wpt/pull/57607 just landed by
latest wpt-sync: https://github.com/servo/servo/pull/42925.

Part of https://github.com/servo/servo/issues/41923

Testing: Added a WPT test.
Fixes: https://github.com/servo/servo/issues/42921

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-01 08:54:24 +00:00
Servo WPT Sync
62e9ce8129 Sync WPT with upstream (01-03-2026) (#42925)
Automated downstream sync of changes from upstream as of 01-03-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-03-01 01:36:06 +00:00
Martin Robinson
467df3d8e4 media: Propagate errors from GStreamerMediaStream::encoded (#42914)
Instead of unwrapping in `GStreamerMediaStream::encoded`, properly
propagate errors to callers. This prevents panics when we fail to
build GStreamer pipelines in this code path. This is probably the first
of many changes to avoid `unwrap()`ing in this code.

Testing: This change adds a WPT crash test.
Fixes: #36844.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-27 18:16:43 +00:00
Oriol Brufau
d5c55eb87c layout: Fix bottom margin of block-in-inline getting ignored (#42889)
In order to know whether a block box can collapse its bottom margin with
the bottom margin of its last child, we need to check its tentative
block size. Most usually, this will be the block size of the containing
block that is used when laying out the children.

However, anonymous blocks do not establish a containing block. So using
the containing block for children meant that we were using the tentative
block size of its parent. If that parent had a definite size, this would
prevent the anonymous block from collapsing bottom margins with its
children. This situation could happen when placing a block-level inside
of an inline box.

This patch fixes the problem by using an indefinite tentative block size
for anonymous blocks, instead of the containing block for children.

Testing: Adding new test
Fixes: #42469

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-27 10:23:21 +00:00
Oriol Brufau
ee40ecdc7c build(deps): bump Stylo to "Make custom properties animatable" (#42858)
Bumps Stylo to https://github.com/servo/stylo/pull/316

Testing: Various tests improve

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-27 02:43:54 +00:00
Oriol Brufau
876abf9001 layout: Remove box damage for parent when we can reuse the box (#42847)
This fixes an oversight from #42783: when detecting that a box can be
reused, we weren't clearing the box damage propagated to ancestors, so
ancestors were still recollecting children.

This exposed some problems in
`rebuild_box_tree_from_independent_formatting_context()`:
1. When reusing a block-level box that established an independent
formatting context, we weren't checking that the new style was still
block-level.
2. When reusing a block-level abspos box, we weren't checking if the new
original display was inline-level, preventing it from being handled as a
block-level because of the static position.
3. When reusing a flex item, we weren't checking if the `order` had
changed.

Testing: we have test coverage for the 3 problems above:
1. Covered by
`/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html`,
and also adding a new `/css/css-display/display-flow-root-dynamic.html`.
2. Covered by `/css/CSS2/abspos/hypothetical-box-dynamic.html`
3. Covered by `/css/css-display/order-dynamic.html`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-02-26 19:23:04 +00:00
Oriol Brufau
e0bd48f16a layout: Fix abspos position when it would be preceded by phantom line (#42586)
The static position of an abspos is the hypothetical position that it
would have had in the normal flow. If the abspos is inside inline layout
and it had a block-level original display, then the static position is
computed as if the abspos was a block-level that breaks the inline.

Usually this places the static position after the current line. However,
if the abspos is not preceded by any text, padding, border, margin,
preserved newline or atomic inline, then the static position should be
as if the abspos was preceded by a 0px tall phantom line. Previously we
weren't taking that into account.

Note that browsers aren't completely interoperable in corner cases.

Testing: Adding 3 new tests. Blink fails the 2nd one and Gecko fails the
3rd one. WebKit and Servo pass them all.
Fixes: #41990

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-26 18:20:46 +00:00
Oriol Brufau
80318ad25e layout: Let OutsideMarker store an IndependentFormattingContext (#42864)
`OutsideMarker` was storing the `BlockFormattingContext` and the
`LayoutBoxBase` in separate fields. Now it will store an entire
`IndependentFormattingContext` in a single field.

In particular, this fixes the issue that `OutsideMarker::repair_style()`
wasn't calling `BlockFormattingContext::repair_style()`. Now we can just
rely on `IndependentFormattingContext::repair_style()`, which correctly
repairs the style of both the `BlockFormattingContext` and the
`LayoutBoxBase`.

Also, the `BlockLevelBox::repair_style()` was repairing the style of the
`LayoutBoxBase` twice, for all kinds of block-level boxes. This removes
the duplication.

Testing: Adding a new test
Fixes: #42779

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-26 09:55:15 +00:00
Euclid Ye
051ab6c2e7 wpt.fyi: Remove Servo workaround which runs single process for wdspec (#42867)
This is the sibling PR of https://github.com/servo/servo/pull/42842. The
workaround is introduced 6 years ago, but no longer valid: it introduces
discrepancy (more fails/panic) comparing to our own dashboard, e.g.
[this](https://wpt.fyi/results/webdriver/tests/classic/take_element_screenshot?run_id=5128593131962368&run_id=5186271220858880&run_id=5149229946503168&run_id=5179428868194304).

[Relevant Zulip
thread](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Jump.20in.20WPT.20results/near/575917400).

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-26 06:23:35 +00:00
Tim van der Lippe
756af3bf37 script: Fix loading of about:srcdoc documents (#41959)
Align with the spec and implement part of its lazy loading
steps. Most tests use non-srcdoc lazy loading URLs, so most
tests will not pass until the other parts are implemented
as well.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-25 19:57:41 +00:00
Oriol Brufau
60c5977291 layout: Correctly repair OutsideMarker::list_item_style (#42825)
`OutsideMarker::repair_style()` was setting `list_item_style` to the
style of the marker, not the style of the list item.

This patch sets it to `node.parent_style(context)` instead, and it fixes
`ServoThreadSafeLayoutNode::parent_style()` to take the pseudo-element
chain into account. This requires modifying a bunch of logic to pass the
`SharedStyleContext` around.

Testing: Adding a new test

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-25 13:25:45 +00:00
Josh Matthews
ab9bb8ac97 python: Run flake8 on WPT tooling to match upstream. (#42823)
This should prevent recurring issues with exported WPT changes being
prevented from merging due to failing linting checks upstream.

Testing: Can't test WPT linting integration at this point in time.
Fixes: #40662

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-02-24 20:00:10 +00:00
Oriol Brufau
8dfda0979d layout: Let TableSlotCell store an IndependentFormattingContext (#42778)
`TableSlotCell` was storing the `BlockFormattingContext` and the
`LayoutBoxBase` in separate fields. Now it will store an entire
`IndependentFormattingContext` in a single field.

In particular, this fixes the issue that `TableSlotCell::repair_style()`
wasn't calling `BlockFormattingContext::repair_style()`. Now we can just
rely on the correct `IndependentFormattingContext::repair_style()`.

Testing: Adding a new test
Fixes: #42777

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-23 21:17:07 +00:00
Euclid Ye
c661dd08e1 servo harness: Reduce recursive execution for shutdown (#42770)
I like `servo` runner, or better known as its previous name
`servodriver` to some people.
However, it is getting quite often that I use `legacy`, or better known
as its previous name `servo`.
This is because `servo (previously servodriver)` harness shutdown very
slowly due to its shutdown command
https://github.com/servo/servo/pull/40455

- This PR improves the shutdown command in the way as titled.
- Avoids accidental Prockill that may happen after regular shutdown.
This may be related to @jschwe's report that coverage for WPT still
reports empty more often than it should.

Previously, shutdown is like:
```
 0:15.06 INFO Trying to shut down gracefully by extension command
 0:18.13 DEBUG Servo has shut down normally. HTTPConnectionPool(host='127.0.0.1', port=8378): Max retries exceeded with url: /status (Caused by NewConnectionError("HTTPConnection(host='127.0.0.1', port=8378): Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it"))
 0:18.13 DEBUG Stopping WebDriver
 0:20.19 DEBUG Servo has shut down normally. HTTPConnectionPool(host='127.0.0.1', port=8378): Max retries exceeded with url: /status (Caused by NewConnectionError("HTTPConnection(host='127.0.0.1', port=8378): Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it"))
 0:22.24 DEBUG Servo has shut down normally. HTTPConnectionPool(host='127.0.0.1', port=8378): Max retries exceeded with url: /status (Caused by NewConnectionError("HTTPConnection(host='127.0.0.1', port=8378): Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it"))
 0:14.99 DEBUG Hanging up on WebDriver session
```

Now:
```
 INFO Trying to shut down gracefully by extension command
 0:18.41 DEBUG Servo has shut down normally. HTTPConnectionPool(host='127.0.0.1', port=9098): Max retries exceeded with url: /status (Caused by NewConnectionError("HTTPConnection(host='127.0.0.1', port=9098): Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it"))
 0:18.41 DEBUG TestRunnerManager cleanup
 0:15.30 DEBUG Hanging up on WebDriver session
```

Testing: Locally, this reduce shutdown time from about 5 sec to 1 sec,
counting from "Trying to shut down gracefully by extension command".

[Try](https://github.com/servo/servo/actions/runs/22295662553/job/64492009162).

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-23 08:48:08 +00:00
Euclid Ye
27fd7dfa30 webdriver: Check missing params before dispatch scroll action (#42745)
This actually happens at a very early stage:
https://w3c.github.io/webdriver/#dfn-process-a-wheel-action
However, for some reason webdriver crate does not check it for this
particular case.
This PR moves the check to the beginning of dispatch scroll action.

Testing: Added a wdspec test.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-22 13:29:56 +00:00
Tim van der Lippe
c6c29fcd33 script: Implement focus support for contenteditable elements (#42734)
There is no specification for this, but there are relevant
WPT tests in `selection/contenteditable`. This PR implements
the required changes to make sure that when such an element
is focused (programmatically), it selects the correct node.

The implementation is therefore entirely reverse-engineered
based on existing browser behavior and commented to hopefully
make it make sense.

Part of #7492
Part of #12776
Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-22 09:26:15 +00:00
Servo WPT Sync
c2333e1521 Sync WPT with upstream (22-02-2026) (#42744)
Automated downstream sync of changes from upstream as of 22-02-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-02-22 01:31:52 +00:00
Aki
58994df9c9 script: Use decode_with_bom_removal for UTF-8 decoding in Blob, Worker, and Module (#42265)
This PR replaces decode with decode_with_bom_removal when decoding UTF-8
text in several places. Some UTF-8 files start with a BOM (Byte Order
Mark). The specification says this should be removed when decoding.
decode_with_bom_removal does this correctly, so this change makes the
behavior more spec-compliant.

Testing: The project builds successfully.
Fixes: #42239

---------

Signed-off-by: lunlunsan <210350985+lunlunsan@users.noreply.github.com>
Signed-off-by: act2510akitake <210350985+act2510akitake@users.noreply.github.com>
Signed-off-by: Aki <210350985+act2510akitake@users.noreply.github.com>
Signed-off-by: act2510akitake <210350985+act2510akitake@users.noreply.github.com.>
Co-authored-by: lunlunsan <210350985+lunlunsan@users.noreply.github.com>
Co-authored-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-20 10:47:43 +00:00
Euclid Ye
e98e4c9d30 script: Use touchstart element as event target for touchmove/touchend/touchcancel (#42654)
[Spec](https://w3c.github.io/touch-events/#dfn-touchend:~:text=screen%2E-,The,element,-%2E)
for touchmove/touchend/touchcancel:
> The target of this event must be the same Element on which the [touch
point](https://w3c.github.io/touch-events/#dfn-touch-point) started when
it was first placed on the surface, even if the [touch
point](https://w3c.github.io/touch-events/#dfn-touch-point) has since
moved outside the interactive area of the target element.

Also, previously `touchend` can be fired after `touchcancel`, which was
wrong and fixed in this PR.

Testing: Fully passes `/touch-events/multi-touch-interfaces.html` (511
subtests) and new passes in
`pointerevents\compat\pointerevent_touch_target_after_pointerdown_target_removed.tentative.html`.

We also take the chance to update `pointercancel` related tests
introduced in https://github.com/servo/servo/pull/41937: `touchcancel`
should not be followed by `touchend` according to
[spec](https://w3c.github.io/touch-events/#dfn-touchcancel).

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-20 09:42:43 +00:00
aquaThirsty
87ff2021a2 script: Turn scrollParent into a function and change wpt tests (#42689)
Turn `scrollParent` into a function as the CSSWG resolved in
https://github.com/w3c/csswg-drafts/issues/12731#issuecomment-3885728833

Testing: updating wpt tests
`tests/wpt/tests/css/cssom-view/scrollParent.html` and
`tests/wpt/tests/css/cssom-view/scrollParent-shadow-tree.html`
Fixes: #42547

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-02-17 21:21:12 +00:00
Servo WPT Sync
9b6b9ccd2e Sync WPT with upstream (15-02-2026) (#42627)
Automated downstream sync of changes from upstream as of 15-02-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-02-15 07:12:51 +00:00
Gae24
49adfed9a8 script: implement resolve_a_module_integrity_metadata (#42604)
`ImportMap` _integrity_ entry was practically unused, since it is only
needed for [resolving a module integrity
metadata](https://html.spec.whatwg.org/multipage/#resolving-a-module-integrity-metadata).
Now, we correctly initialize `ScriptFetchOptions` when loading a
module's descendants.
I slightly modified `nonimport-integrity.html` test to run
`modulepreload` test cases at the end. Since we haven't an
implementation for it, the test timeout, making the test cases that
comes after them not run.

Testing: More tests start passing
Part of #37553

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-14 10:26:49 +00:00
Martin Robinson
25b4121ad7 layout: Ensure layout damage clears inline content size cache of parent (#42574)
This change fixes an issue where layout damage to a node was not
clearing the inline content size cache of the parent node. In addition
it starts to clean up the damage traversal logic in preparation for
changes to the way that damage is processed and box tree layout is done.

Testing: This change adds a new WPT test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
2026-02-12 12:21:50 +00:00
Oriol Brufau
ec984b3c76 layout: SVG with zero size should get natural ratio from viewBox (#42545)
This logic was (accidentally?) changed in #40761. Revert it back to the
original one, which is simpler, and matches Blink and WebKit.

Testing: Adding new test

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-12 04:10:48 +00:00
webbeef
39d946b01d script: Implement pointer events (#41290)
Remaining failures are due to the missing implementation of the pointer
capture and pointer lock APIs, as well as:

Requires User Activation support:
/html/user-activation/activation-trigger-pointerevent.html?mouse

Blocked on https://github.com/servo/servo/issues/41227 :
/pointerevents/compat/pointerevent_mouse-pointer-on-scrollbar.html

Requires persistentDeviceId:

/pointerevents/persistentDeviceId/get-persistendeviceid-from-pointer-event.tentative.html
/pointerevents/persistentDeviceId/get-persistendeviceid-from-pointer-mouse-event.tentative.html

Requires pointerenter, pointerover, pointerout, pointerleave events:
/pointerevents/pointerevent_pointerId_scope.html

Requires pointerrawupdate event:
/pointerevents/pointerevent_pointerrawupdate.html
/pointerevents/pointerevent_pointerrawupdate.https.html

Consider implementing non-standard attributes toElement and fromElement:
See https://w3c.github.io/pointerevents/#attributes-and-default-actions

Fails because the pointerId is always 0 for pointermove, maybe caused by
commit 7b00b54ee8 :
/pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html?touch
https://github.com/servo/servo/issues/41250


Testing: Updated wpt expectations
Fixes: https://github.com/servo/servo/issues/38435

Signed-off-by: webbeef <me@webbeef.org>
2026-02-10 07:44:59 +00:00
Tim van der Lippe
8ae4cbebaf script: Fix crash when failed requests finish from a previous generation (#42481)
Most likely a regression introduced in #42208 where the pending loads
counter has been reset. For successful request this wasn't an issue, but
for failed requests it was. Therefore, guard against these generation
request problems by bailing out as soon as we post-process the request
(which we do for all failed requests).

Fixes #42477

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-10 07:00:48 +00:00
Euclid Ye
c5b391390e paint: Unify scrolling/pinch zoom behaviour across platforms (#42387)
There has been a weird discrepancy between headed/headless test
automation,
as stated in #42386 and
https://github.com/servo/servo/issues/42320#issuecomment-3846005540.
The problem identified is more general than the intial issue: 
we need to use CSS Pixel and Device Pixel consistently in these cases.

- Convert threshold unit to ensure cross-platform consistency.
- Adjust `TOUCH_PAN_MIN_SCREEN_PX`: this is tested on Android/Ohos,
to match the pinch/scrolling threshold of Firefox/Chrome.

This is critical for test automation which always relies on CSS pixel.

Testing: Added which ensures pinch zoom does happen, and there is no
crash for #42320.
Fixes: #42386

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-09 00:01:30 +00:00
Servo WPT Sync
614c4e407e Sync WPT with upstream (08-02-2026) (#42433)
Automated downstream sync of changes from upstream as of 08-02-2026
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2026-02-08 03:49:29 +00:00
Euclid Ye
ccd271c8a5 testdriver harness: Allow duration 0 for actions/tick (#42398)
Previously, even if you explicitly set duration 0, it still ends up with
`None`.
But you can set duration 0 in wdspec python tests.
This complies with
[spec](https://w3c.github.io/webdriver/#dfn-process-a-wheel-action:~:text=If%20duration%20is%20not%20undefined%20and%20duration%20is%20not%20an%20Integer%20greater%20than%20or%20equal%20to%200%2C%20return%20error%20with%20error%20code%20invalid%20argument%2E):
duration can be greater than or equal to 0.

Testing: There is no existing testdriver tests that use duration 0.
Fixes: https://github.com/web-platform-tests/wpt/issues/57606
Found in:
https://github.com/servo/servo/pull/42387#issuecomment-3859501808

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-08 01:25:31 +00:00
Euclid Ye
5a5d71d67e wpt: Fix syntax error in pointerevent_touch-propagates-when-target-is-video_touch.html (#42405)
The syntax is wrong. We cannot pass an Element as duration. Only Firefox
[was passing
this](https://wpt.fyi/results/pointerevents/pointerevent_touch-propagates-when-target-is-video_touch.html?run_id=5098406608633856&run_id=5170937667518464&run_id=4715813002280960&run_id=5136051728547840),
which is a bug of geckodriver: 


Testing: Updated expectation of existing tests.
This blocks https://github.com/servo/servo/pull/42398,
https://github.com/servo/servo/pull/42387.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-06 14:04:33 +00:00
Luke Warlow
5f884cfe29 layout: Do not consider pseudo-elements widgets for the purposes of replaced content (#42332)
When an element has an image content value or list-style-image value
they end up duplicating the content of the element inside the generated
'::marker'.

This is caused by code inside IndependentFormattingContext for user
agent widgets (all user agent shadow dom), this code is specifically
aimed at video and audio elements.

This patch adapts that code to be more specific to elements without a
pseudo-element chain (e.g. audio and video)

Testing: newly added test crashes on main servo (slightly flakily), but
passes consistently now.
Fixes: #42329 
Fixes: #41231

---------

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-02-05 16:01:35 +00:00
Martin Robinson
f3fa9668cf layout: Handle zero-sized positioning areas when laying out a dimension for background-repeat (#42303)
The specification says that the rounding of the tile size should only
happen
when the positioning size is not zero. This change makes us follow the
specification in this case.

Testing: This PR adds a new WPT crash test.
Fixes: #42216

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-04 07:53:15 +00:00
Tim van der Lippe
19c2f93cab script: Fix handling changes to relevant attributes for stylesheets (#42273)
We weren't removing stylesheets when we should be doing so. This most
notably happens when the stylesheet no longer has a href or its "rel"
changes.

The crash is also fixed, since the issue was that we were passing the
value of the attribute that was changed as if it were an href. However,
if we set the type attribute, then that's not the href.

To fix that, we now retrieve the href inside the method so we always
have the correct value.

Fixes #42259

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2026-02-02 13:37:38 +00:00
Tim van der Lippe
e8aa7d51ba script: Set host for template content (#42276)
A template element should set the host of a DocumentFragment. However,
it didn't have a host yet. That's because ShadowRoot declares a host
attribute which returns Element, but its property is declared on
DocumentFragment.

Therefore, define the host on DocumentFragment instead and use it in all
relevant points for shadow roots. Then, update the pre-insert validity
check to use the correct host-including variant of inclusive ancestors.
Lastly, set the host of the template to wire it all up.

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-02 08:25:54 +00:00
TIN TUN AUNG
17f7c87088 script: add force option for assign-slottables for a tree (#42250)
In the case of node removal, if the subtree of the removed node contains
`<slot>` element, force traverse down to each `<slot>` element is needed
to reset the assignment of the slottables that currently being assigned
to the `<slot>` element. This changes add this force option to
`assign_slottables_for_a_tree`, and only set true to node removal.

Testing: Should be covered by current WPT test, [try
run](https://github.com/rayguo17/servo/actions/runs/21504337658)
Fixes: https://github.com/servo/servo/issues/35188
https://github.com/servo/servo/issues/42182

cc @TimvdLippe @simonwuelker @xiaochengh

---------

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
Signed-off-by: rayguo17 <rayguo17@gmail.com>
2026-02-02 07:25:13 +00:00