Commit graph

28448 commits

Author SHA1 Message Date
Simon Wülker
33a68eb2d5
Remove CoreResourceMsg::Synchronize (#37019)
This message is unused.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-15 20:20:55 +00:00
Simon Wülker
b100a98e1d
Fully support <input type=color> (#36992)
This change adds a shadow-tree widget for `<input type=color>` elements.
It also involves some changes to the way layout interacts with the DOM,
because currently all `input` and `textarea` elements are rendered as
plain text and their descendants are ignored. This obviously doesn't
work for `<input type={color, date, range, etc}>`.


![image](https://github.com/user-attachments/assets/4f16c3b0-1f79-4095-b19d-1153f5853dd5)

<details><summary>HTML used for the screenshot above</summary>

```html
<input type=color>
```

</details>



Testing: I doubt that this affects WPT tests, because the appearance and
behaviour of the widget is almost entirely unspecified.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-15 17:30:38 +00:00
Simon Wülker
f9382fcaa0
Remove layout-2013 profiling categories (#37014)
This change also removes the ProfilingCategory::variant_name function,
because strum_macros::IntoStaticStr is already being used and does the
same thing.

Testing: This change compiles and that's good enough

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-15 16:54:02 +00:00
Oriol Brufau
cd0dbb9afb
layout: Obey intrinsic min/max block sizes on flex containers (#36973)
Intrinsic sizing keywords weren't working correctly on the min and max
block sizes of a flex container, because we weren't setting the
`CacheableLayoutResult::content_block_size` to the right value. This
also ensures that `align-content` aligns within the final size of the
container.

Note it's not very clear what to do for single-line containers, they are
being discussed in https://github.com/w3c/csswg-drafts/issues/12123

Testing: Adding new WPT tests. There are still some failures, but most
subtests would fail without this change.
Fixes: #36981

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-05-15 07:57:07 +00:00
Sebastian C
103cbed928
HSTS list memory reduction and fixes (#37000)
Combines the 2 time values in the HSTS entry with a single timestamp for
expiration. (9MB savings per list)

The previous time representations were based on system boot time which
meant that the `hsts_list.json` round trip across boots resulted in
completely erroneous expiration times.

The preload list is now initialized separately from the public and
private lists and shared by both, cutting memory use in half.

Overall takes memory use from 64MB for HSTS to 24MB.

Expired HSTS entries are now removed from the list when updating an
entry and subdomains can be added to a list if the superdomain does not
already include them.

Testing: New unit tests added
Related to #25929 but the next step would be to attempt to use
https://github.com/BurntSushi/fst Which will be explored in a follow-up.

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-05-15 04:06:57 +00:00
Oriol Brufau
1cceb5f6a0
layout: Inform child layout about final block size (#36980)
Before this patch it wasn't possibly to simultaneously support intrinsic
min/max sizes and content alignment in the block axis. For example,
block containers only support the former, and flex containers only the
latter.

The reason is that the final block size was decided by the parent
formatting context *after* performing layout, while content alignment is
performed *during* layout.

To address the problem, this introduces the struct `LazySize`, which
contains the data to resolve the final size, except for the intrinsic
size. Thus the parent formatting context can first create a `LazySize`,
then pass it to the child layout so that (if necessary) it can compute
the final size once the intrinsic one is known, and after layout the
parent formatting context uses it to actually size the child.

This PR just provides the functionality that will be used by follow-ups,
but at this point no layout is using the `LazySize` provided by the
parent, so there shouldn't be any behavior change yet.

Testing: Unnecessary (no behavior change)
This is part of #36981 and #36982

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-05-14 20:35:49 +00:00
Oriol Brufau
1499e2a874
Remove some references to layout 2013 vs layout 2020 (#37007)
We no longer have both layout systems.

Testing: not needed (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-05-14 19:53:48 +00:00
Tim van der Lippe
a24fce3ae7
Implement inner slot for cryptographic nonce (#36965)
Also update the `html/dom/reflection-metadata.html` test
to handle the case where `nonce` does not reflect back
to the attribute after an IDL change.

Part of https://github.com/servo/servo/issues/4577
Fixes https://github.com/web-platform-tests/wpt/issues/43286

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-14 10:21:21 +00:00
webbeef
3aff272e14
chore: update webdriver to 0.53 (#37001)
Updates webdriver to the current version.

Testing: No breakage of CI tests

Signed-off-by: webbeef <me@webbeef.org>
2025-05-14 08:22:40 +00:00
sagudev
fdb9c0af12
canvas: Move generic implementations into GenericPathBuilder trait (#36999)
There is no reason to require this impls, because we already have
written them in generic way.

Testing: Just refactoring, but there are WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-05-14 03:51:56 +00:00
Steven Novaryo
a572bf1191
layout: Propagate specified info for flex item (#36993)
We should propagate specified info for flex items. This will prevent the
loss of it for boxes that have this info (e.g. table or grid).

Testing: Adding new WPT tests

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-13 21:10:40 +00:00
Tim van der Lippe
c985c08737
Implement iframe.srcdoc trusted type sink (#36960)
Part of https://github.com/servo/servo/issues/36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-13 21:07:13 +00:00
Narfinger
991be359a3
libservo: Allow embedders to execute JavaScript scripts via the API (#35720)
This change adds a new `WebView` API `evaluate_javascript()`, which
allows embedders to
execute JavaScript code and wait for a reply asynchronously. Ongoing
script execution is
tracked by a libservo `JavaScriptEvaluator` struct, which maps an id to
the callback passed
to the `evaluate_javascript()` method. The id is used to track the
script and its execution
through the other parts of Servo.

Testing: This changes includes `WebView` unit tests.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-05-13 12:54:18 +00:00
Kenzie Raditya Tirtarahardja
91c4c7b998
Fix origin relative coordinate for wheel scroll and refactoring (#36985)
- Wheel scroll action can get coordinates relative to an element origin
([previously](https://github.com/servo/servo/pull/36744) only
implemented for viewport).
- Extract the element coordinate into a function

Testing: Partially
`tests/wpt/tests/infrastructure/testdriver/actions/wheelScroll.html`,
but we still have synchronization problem. You can try to add sleep in
the test to see OK result.

cc: @xiaochengh @longvatrong111 @yezhizhen

Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
2025-05-13 10:46:27 +00:00
Andrei Volykhin
6468734aea
svg: Add mock SVGImageElement interface (#36975)
Add mock SVGImageElement interface to fix TIMEOUT WPT tests
which are related to ImageBitmap (html/canvas/*).
https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGImageElement

Rationality of this change to fire event "error" on any attempt to fetch
image resource on href attribute change to not block WPT tests
execution.

Some WPT tests use the legacy namespace attribute "xlink:href", so
support for it was added to source code.
https://svgwg.org/svg2-draft/linking.html#XLinkHrefAttribute
 - setAttributeNS("http://www.w3.org/1999/xlink", 'xlink:href', src);

Testing: Covered by existed WPT tests
 - fetch/metadata/generated/svg-image*
 - html/canvas/element/manual/*
 - html/dom/idlharness.https.html
 - html/semantics/embedded-content/the-canvas-element/*
 - html/webappapis/scripting/events/event-handler-all-global-events.html
 - mozilla/interfaces.https.html

Fixes: https://github.com/servo/servo/issues/35881

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-13 10:43:10 +00:00
Euclid Ye
e4f62d5c16
Remove duplicate click event in simulate_mouse_click (#36957)
After `InputEvent::Touch` processed by Script, it sends
`TouchEventProcessed` back to Constellation, which goes through hit-test
etc. and loops back to Script again. However,
`WebViewRenderer::simulate_mouse_click` should not send
`MouseButtonAction::Click` due to #36413

Testing: Manually tested by converting mouse to touch

cc @jdm @xiaochengh

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-05-13 10:25:09 +00:00
Martin Robinson
8808f9a468
layout: Add a repaint-only incremental layout mode (#36978)
This change adds the simplest kind of incremental layout. When Servo
detects that all style changes only require a repaint, only run stacking
context tree and WebRender display list generation. This means that
these kind of restyles do not need a re-layout. Instead, the existing
box and fragment trees will be used and the styles of damaged nodes will
be updated in their box and fragment tree nodes.

This requires a new style repair DOM traversal for nodes that have had
their style damaged. In addition, careful accounting of all the places
where we store style must happen in order ot update those styles.

Testing: This is covered by existing WPT tests as it should not change
observable behavior.

We have created a test case which shows a 50% speedup when run
in Servo, even though there still a long way to go to match the speed
of other browsers:
https://gist.github.com/mrobinson/44ec87d028c0198917a7715a06dd98a0

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-12 17:03:50 +00:00
Oriol Brufau
51fa6cdcb6
layout: Split AbsoluteAxisSolver::solve() into different methods (#36970)
Abspos layout used to solve sizing and margins simultaneously. This
patch refactors the logic to solve them separately, resulting in simpler
code.

Testing: Unneeded (no change in behavior)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-05-12 16:30:53 +00:00
Taym Haddadi
62569979ff
Make transform stream transferrable (#36905)
Part of https://github.com/servo/servo/issues/34676

#36739 needs to be merged first.

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-05-12 16:02:06 +00:00
Ngo Iok Ui (Wu Yu Wei)
aa4ad0f2be
fix: ReadableStream::get_in_memory_bytes too large (#36914)
Fix a IPC hang due to `ReadableStream::get_in_memory_bytes` could return
really huge chunk.

Testing: WPT on ReadableStream should pass
Fixes: IPC hang when transferring huge chunk bytes from `ReadableStream`


cc @gterzian @Taym95 since this is also related to ReadableStream.

---------

Signed-off-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
Co-authored-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
2025-05-12 16:00:14 +00:00
Gae24
c37d5572fd
codegen: use FromJSValConvertible trait for Promise (#36966)
Before it was only used when converting to a `Record`, using it all the
times allow us to remove two methods.
Plus added a helper method in CodegenRust.py to avoid repeated code.

Testing: a successful build and existing tests should cover the changes.
Fixes: #36410

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-05-12 11:05:46 +00:00
Tim van der Lippe
d780fb7695
Implement trusted HTML sinks for Element (#36941)
Also implements a conversion for `TrustedHTMLOrNullIsEmptyString`
to `TrustedHTMLOrString` to avoid introducing a separate
`get_trusted_script_compliant_string` for the new type.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-12 10:53:03 +00:00
Martin Robinson
a0dd2c1beb
layout: Share styles to inline box children via SharedInlineStyles (#36896)
`TextRun`s use their parent style to render. Previously, these styles
were cloned and stored directly in the box tree `TextRun` and resulting
`TextFragment`s. This presents a problem for incremental layout.
Wrapping the style in another layer of shared ownership and mutability
will allow updating all `TextFragment`s during repaint-only incremental
layout by simply updating the box tree styles of the original text
parents.

This adds a new set of borrows when accessing text styles, but also
makes it so that during box tree block construction
`InlineFormattingContext`s are created lazily and now
`InlineFormattingContextBuilder::finish` consumes the builder, making
the API make a bit more sense. This should also improve performance of
box tree block construction slightly.

Testing: This should not change observable behavior and thus is covered
by existing WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-12 09:38:50 +00:00
Euclid Ye
db83601b62
Fix comment and add TODO for webdriver pointermove (#36929)
Testing: No. Just updating comments

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-05-12 08:20:43 +00:00
Simon Wülker
41283220dd
Update select shadow tree when contents of selected option change (#36958)
The label that is displayed inside a `<select>` element is that of the
selected option, or it's text contents if the option does not have a
label. Therefore, we need to update the `<select>` shadow tree when the
contents of the selected option change.

Testing: Covered by existing web platform tests
Fixes https://github.com/servo/servo/issues/36926
Fixes https://github.com/servo/servo/issues/36925

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-11 16:21:56 +00:00
Tim van der Lippe
4821bc0ab0
Implement is-element-nonceable (#36961)
Unfortunately while it now passes almost all cases in
`tests/wpt/tests/content-security-policy/script-src/nonce-enforce-blocked.html`,
the test in question doesn't pass yet as it requires all cases to be
correct. Here, we still miss the "check for duplicate attributes during
parsing". Since we don't have this information available yet from the
parser, skip this for now.

Part of #36437

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-11 15:38:13 +00:00
Simon Wülker
dc0e7587bf
Don't attempt to resize Offscreencanvas without a rendering context (#36855)
When the canvas context mode is a placeholder then we shouldn't resize
the context.

Testing: Includes a new test
Fixes: https://github.com/servo/servo/issues/36846

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-11 15:27:33 +00:00
webbeef
e702bde9bf
Delete WR images when dropping the ImageCacheStore (#36956)
This deletes images from WR when dropping the ImageCacheStore for a
WebView.

Testing: Run `./mach run --enable-experimental-web-platform-features
unsplash.com` and then open `about:memory` in a new tab. On Linux we end
up with ~30MB of WR images. Then close the unsplash.com tab and measure
memory again, it will down to ~1.25MB

Fixes: https://github.com/servo/servo/issues/25927

Signed-off-by: webbeef <me@webbeef.org>
2025-05-11 04:01:49 +00:00
webbeef
9c3069366e
Prevent overflow in intersection observer area evaluation (#36955)
Prevent overflowing by not calculating the area and reordering
arithmetic operations.

Testing: No regression in wpt tests:
1495105545
Fixes: https://github.com/servo/servo/issues/36940

Signed-off-by: webbeef <me@webbeef.org>
2025-05-11 03:05:47 +00:00
Kenzie Raditya Tirtarahardja
924fd06f14
Check receiver response in actions.rs (#36928)
Extend `wait_for_script_response()`
(https://github.com/servo/servo/pull/35024) for `actions.rs`

Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
2025-05-10 19:27:19 +00:00
Keith Yeung
da1c49299b
Update the list of global and window event handlers (#36894)
There's an expanded list of event handlers content attributes that need
to be forwarded to the corresponding window of the body element, and
this PR adds the remaining ones. The full list can be seen in [this
link](https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers-on-elements%2C-document-objects%2C-and-window-objects%3Aevent-handlers-6).

Testing: Covered by various WPT tests

---------

Signed-off-by: Keith Yeung <kungfukeith11@gmail.com>
2025-05-10 15:54:13 +00:00
Tim van der Lippe
d0de4e64d2
Add CSP check for inline style attribute (#36923)
To be able to abort the update, extract the functionality into a
separate method. Otherwise, we don't run the `node.rev_version` at the
end, which according to the comment is probably important.

Not all `style-src` tests pass and I don't fully understand why yet, but
I presume it has to do with some special quirks of stylesheets that
other CSP checks don't have. All `style-src-attr-elem` tests pass
though.

Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-09 17:36:55 +00:00
atbrakhi
2aaf9695df
DevTools: Improve resource_available to handle multiple connections (#36933)
This patch improves the `resource_available` trait to handle multiple
connections. In this patch we also remove the redundant
`resource_available` from worker actor

Testing: Existing tests in DevTools already tests for this. We do not
need to add new test
Fixes: part of #36027

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-05-09 12:06:33 +00:00
Taym Haddadi
e5347eceac
WebIDL Fix ImageData constructor to take a Uint8ClampedArray instead of js_object (#31398)
<!-- Please describe your changes on the following line: -->

Fix ImageData constructor to take a Uint8ClampedArray instead of
js_object

---
<!-- 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] These changes fix #31320

<!-- Either: -->
- [x] These changes do not require tests because there is not behavior
change.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-05-09 11:05:56 +00:00
Martin Robinson
53be79a5b5
layout: Resolve canvas background properties during painting (#36917)
Instead of resolving the canvas background properties (essentially
keeping a possible reference to the `<body>`'s style) during fragment
tree construction, wait until painting to possibly find the style on an
appropriate `<body>` fragment. This is possible now because `Fragment`
keeps a list of flags with relevant information about the root and
`<body>` elements.

A benefit of this approach is that styles aren't cached in the fragment
tree, which would be problematic for incremental layout. In addition,
the old code was making an effort to transform the `<body>`'s background
by the root element's transform. Only Safari does this and there was
a resolution the WG that this should not happen in
https://github.com/w3c/csswg-drafts/issues/6683.

Testing:
 - `/css/css-transforms/transform-translate-background-001.html`
 - `/css/css-transforms/transform-translate-background-002.html`
 - `/css/CSS2/floats/float-root.html`
 
Fixes: #30475.
Closes: #30569.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-09 10:36:53 +00:00
Astraea Quinn S
8473946d11
[OH] allow setting log_filter via prefs.json (#36916)
This PR allows us to set the `log_filter` via `prefs.json` as well as
commandline arguments.

Priority goes commandline > prefs.json > compile-time default.

Testing: I compiled and run servo on an OH device, and then checked the
logs:

```
hdc hilog | tee log | rg 'Set log_filter to'
```

```
05-08 15:25:59.389 55824 55993 D A00000/org.servo.servo/servoshell::prefs: Set log_filter to: Some("debug,geometry=trace")
```

Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
2025-05-08 16:10:30 +00:00
Euclid Ye
f58b0c6ad4
rework webdriver deserialization to avoid false-positive cycle error (#36908)
1. Avoid false-positive cycle error when deserilizing
 - Only detect cycle for Objects
  - Remove last element of seen when success
2. Cite spec

Testing: `./mach test-wpt --product servodriver -r
tests\wpt\tests\webdriver\tests\classic\element_click\events.py`
Fixes: #36890 
cc @jdm @xiaochengh

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-05-08 13:54:58 +00:00
Tim van der Lippe
b6b80d4f6f
Correct event_target for CSP violations (#36887)
All logic is implemented in `report_csp_violations` to avoid
pulling in various element-logic into SecurityManager.

Update the `icon-blocked.sub.html` WPT test to ensure that
the document is the correct target (verified in Firefox and Chrome).

Fixes #36806

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-05-08 10:46:31 +00:00
Taym Haddadi
f3f4cc5500
Script implement TransformStream and TransformStreamDefaultController (#36739)
Part of https://github.com/servo/servo/issues/34676

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-05-08 08:45:57 +00:00
Martin Robinson
d39b9f05ff
webgl: Use glow::Context::supported_extensions() to implement getSupportedExtensions() (#36911)
Not only does this simplify the code, it fixes a problem where we were
attempting to use an OpenGL 3.0 API on an incompatible GL context.

Testing: There are already tests for `getSupportedExtensions()` in the
WebGL
suite, but effectively testing this requires drivers that do not support
a particular version of OpenGL, so it is a bit hard to actually test.
Fixes: #36852.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-05-08 08:34:52 +00:00
Andrei Volykhin
bc9f55bcc9
pixels: Actually write pixels in MULTIPLY generic_transform_inplace operations (#36895)
Multiply operations applied in `generic_transform_inplace` were
calculating the new pixel values, but not actually writing them.
This changes fixes that issue.

Testing: /webgl/tests/conformance/context/premultiplyalpha-test.html
Fixes: #35759

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-08 07:38:02 +00:00
Martin Robinson
c6de8fc8e6
constellation: Ignore zombie_process warning (#36904)
`rust-analyzer` shows a `zombie_process` warning, but only on macOS as
far
as I can tell. This change ignores the warning here. We aren't currently
in a position where we can reliably `wait()` on spawned processes, which
needs to happen as part of a larger multiprocess / cleanup effort.

Testing: No testing as this just ignores an LSP warning.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-05-07 19:37:27 +00:00
Gae24
5b913441d4
async clipboard: implement readText (#36689)
part of #36084
Testing: Only idl harness tests will pass for now

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-05-07 15:11:37 +00:00
Martin Robinson
348eede37b
layout: Store shared styles for table backgrounds in SharedBackgroundStyle (#36893)
Table cells share background styles with their track and track group
boxes. When a track and track group style is repaired, this new data
structure will allow reparing the style of the cell `Fragment`s without
having to lay the table out again or walk through `Fragment`s and
individually repair their background styles.

Testing: This doesn't change behavior and is thus tested by existing
WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-07 11:44:59 +00:00
Simon Wülker
23c327a988
script: Serialize a custom element's "is" value as an attribute (#36888)
Testing: Covered by web platform tests

[try
run](1486889324)

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-05-07 10:29:14 +00:00
batu_hoang
b2e51820e4
Set proper button value in WebDriver - ElementClick command (#36871)
Fix ElementClick: `ElementClick` should use `MouseButton::Left` to
create `action`.

Testing: No pass test now. Tests still fail because of other issues.
For: https://github.com/servo/servo/issues/36658

cc: @xiaochengh , @yezhizhen , @PotatoCP

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-05-07 08:58:01 +00:00
Kenzie Raditya Tirtarahardja
eaf9224799
Implement wheel action in webdriver (#36744)
https://w3c.github.io/webdriver/#wheel-actions

Test:
`tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::{test_null_response_value,test_params_actions_origin_outside_viewport[element],test_params_actions_origin_outside_viewport[viewport]},
tests/wpt/tests/webdriver/tests/classic/perform_actions/perform.py`
Fixes: https://github.com/servo/servo/issues/36720

cc: @xiaochengh @longvatrong111 @yezhizhen

Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
2025-05-07 08:41:34 +00:00
Josh Matthews
f47e69c112
Improve some webdriver conformance tests results (#36673)
These changes allow test_dom_token_list from
/execute_script/collections.py to pass, and various tests in
/execute_script/arguments.py to expose new failures.

Testing: Not run in CI yet, but verified results from
tests/wpt/tests/webdriver/tests/classic/{execute_script,execute_async_script}
locally.
Fixes: #35738

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-05-07 07:22:29 +00:00
Josh Matthews
a18c6e2c78
Fix double borrow panic in Node.childNodes (#36889)
`ensure_rare_data` returns a RefMut that extends the borrow of
Node.rare_data. This can lead to a panic in any method that triggers a
GC while this borrow is outstanding, such as Node.childNodes.

Testing: Manual testing on the testcase from the issue. It is impossible
to create a deterministic WPT crash test that is fast enough and can be
counted upon to continue working in the future.
Fixes: #36868

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-05-07 04:35:26 +00:00
Josh Matthews
ba8f923201
Various memory measurement improvements (#36834)
The two significant changes here are 1) a commit that frees memory used
to perform memory reporting once the reporting is complete, 2) memory
reporting for the system font service. There are various other commits
that remove `#[ignore_malloc_size_of]` attributes for data that we are
now able to measure, but they do not significantly change our
measurements when testing servo.org.

Testing: Comparing the output of about:memory on servo.org.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-05-07 04:00:12 +00:00