Commit graph

518 commits

Author SHA1 Message Date
Steven Novaryo
5580704438
Implement Input type=text UA Shadow DOM (#37065)
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>
2025-05-30 12:02:10 +00:00
Euclid Ye
45072ae2e0
Let input JS event be dispatched by keydown instead of keypress (#37078)
1. Let `input` JS event be dispatched by `keydown` instead of
`keypress`, according to spec
2. Fire `input` event for Backspace and Delete. But do so only when
something is actually deleted

Testing: Manually tested and compared with other browsers.
Fixes: #37051
cc @xiaochengh

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-05-28 08:51:05 +00:00
Martin Robinson
856ffa6ecb
layout: When there is no restyle damage, do not re-layout (#37048)
When the computed restyle damage is empty, do not do a layout. Instead,
just rebuild the display list. In the future, even that can be omitted,
but that requires changes to the compositor.

These kind of relayouts commonly happen when the cursor is moving around
the page and no style rules cause changes to :hover.

Testing: This is covered existing WPT tests and should only have
performance
impacts. Unfortunately there are currently no performance tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-05-21 15:52:11 +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
elomscansio
b1d0b6a37b
htmlinputelement: Update radio group validity logic for disconnected trees (#36431)
This PR updates the validity state revalidation behavior for radio input
elements, ensuring consistent logic regardless of tree connectivity.

---

**What’s changed:**  
- we now always update the validity state.
- Handled more edge cases for disconnected trees, shadow roots, and
cross-tree movement.
- Ensured that radio group updates still trigger when a parent is moved
into a different root.
- Updated test expectations in
`radio-disconnected-group-owner.html.ini`.

---

**Why this matters:**  
The updated logic aligns better with the [HTML
specification](https://html.spec.whatwg.org/multipage/input.html#radio-button-group),
especially regarding radio group behavior in disconnected trees or
shadow DOM.

These changes improve validity propagation in scenarios like:
- Appending inputs into a disconnected form
- Shadow roots acting as radio group containers
- Cross-tree movement of radio buttons

---

**Tests:**  
- Modified `radio-disconnected-group-owner.html.ini`
  - Removed a test that now passes
- Added a failing test expectation caused by a spec bug: the fragment
parsing algorithm uses the connected tree for HTML set via `innerHTML`,
affecting radio group computation

---

**Spec reference:**  
https://html.spec.whatwg.org/multipage/input.html#radio-button-group

---
<!-- 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 an errors
- [ ] These changes fix #

<!-- Either: -->
- [X] There are tests for these changes

Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
2025-04-28 01:24:43 +00:00
Nico Burns
c792e6db7c
Use version of markup5ever with web_atoms crate (#36542)
Upgrades `markup5ever` and fixes "unnecessary import" lints.

See https://github.com/servo/html5ever/pull/599
And https://github.com/servo/stylo/pull/173

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-04-19 11:49:37 +00:00
Yerkebulan Tulibergenov
5d84acc06e
add CanGc as argument to methods in HTMLInputElement, HTMLLinkElement (#36504)
add CanGc as argument to methods in HTMLInputElement, HTMLLinkElement

Testing: These changes do not require tests because they are a refactor.
Addresses part of https://github.com/servo/servo/issues/34573.

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
2025-04-13 20:42:52 +00:00
webbeef
3c4ec17180
textinput: position the caret at the end when selecting input (#36478)
When clicking on a text input element, we currently position the caret
at the very beginning, even if there is already text present. That makes
is annoying when you want to add text, and doesn't match what other
browsers do.
Instead, this change positions the caret at the end of the current text.

Testing: Not covered by any wpt tests (rightly so I think).

Signed-off-by: webbeef <me@webbeef.org>
2025-04-11 20:24:16 +00:00
elomscansio
1f558a0d49
Fix radio group validity update when removing or selecting an input (#36252)
This PR fixes an issue where radio inputs in the same group failed to
correctly update their `validity.valueMissing` state when:

- A **checked radio button was removed** from the DOM.
- A **different radio button was selected** by user interaction.

This behavior caused mismatches with how browsers like Firefox handle
radio group validation.

---

### Changes in This PR

#### Radio group revalidation on DOM removal
- Updated `unbind_from_tree()` to revalidate other radio buttons in the
same group when a checked input is removed.
- Uses `UnbindContext::parent` as the DOM root to ensure the correct
context is used during traversal.

#### New helper: `find_related_radios()`
- Encapsulates logic for finding other inputs in the same group.
- Used during both removal and attribute changes for consistency.

#### Validation on `checked`/`value` updates
- Introduced `update_related_validity_states()` to revalidate all group
members when a radio's `checked` or `value` is changed.

#### Web Platform Test (WPT) coverage
- Created a new WPT file: `radio-group-valueMissing.html`.
- Tests follow recommended `test()` pattern:
  - **Precondition**: Assert initial `valueMissing`.
  - **Action**: Remove or select a radio.
  - **Postcondition**: Assert expected `valueMissing`.

#### Manifest updated
- The WPT manifest now includes the new test.

---
<!-- 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 #36110

<!-- Either: -->
- [X] There are tests for these changes

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
2025-04-06 23:26:15 +00:00
Andrei Volykhin
3bc0eeab8f
dom: Firing "click" event as synthetic pointer event (#36274)
According to specification

https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-click-event
"Firing a click event at target means firing a synthetic pointer event
named click at target"

So need to replace synthetic mouse event with "click" type to pointer
event.

https://w3c.github.io/pointerevents/#the-click-auxclick-and-contextmenu-events
https://www.w3.org/TR/uievents/#event-type-click

Firing "click" event could be triggered from script or by UA:
- element.click()
(https://html.spec.whatwg.org/multipage/interaction.html#dom-click)
- form implicit submission
(https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission)
- keyboard activation (space)

---
- [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
tests/wpt/tests/shadow-dom/event-composed.html
tests/wpt/tests/uievents/interface/click-event.htm

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-04-02 11:20:25 +00:00
MDCODE247
be38c5478f
script: Use RegExpFlag_UnicodeSets when validating regular expressions in HTMLInputElement (#36236)
Changed `RegExpFlag_Unicode` to `RegExpFlag_UnicodeSets` in all
instances.

Testing: Ran `./mach test-wpt
tests/wpt/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html`
and all tests passed successfully.
Fixes: #36075

---------

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>
2025-04-01 07:29:24 +00:00
Kunga Derick Abongho
83da63f638
resolve issue #36074 new_js_regex and matches_js_regex need a CanGc argument (#36111)
* new_js_regex and matches_js_regex need a CanGc argument

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* new_js_regex and matches_js_regex need a CanGc argument

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* edit Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

---------

Signed-off-by: dericko681 <abonghoderick@gmail.com>
2025-03-29 13:09:56 +00:00
Barigbue Nbira
5a4e232cb6
fix: prevent missing value error for radio button inputs without a name (#36197)
Signed-off-by: Barigbue <barigbuenbira@gmail.com>
2025-03-28 11:20:59 +00:00
Simon Wülker
517f99e067
Start implementing the URLPattern API (#36144)
* Start working on a basic URLPattern implementation

This is API part of Interop 2025, so we should definitely support it!

This change implements the basic workflow for parsing
and compiling URL patterns. Parts of it are stubbed out and will be
implemented later.

For now the API is preference-gated behind "dom_urlpattern_enabled".

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Preference-gate the URLPattern API

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix full wildcard value (Should be ".*" not "*")

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-27 10:39:57 +00:00
Jerens Lensun
efd6e86393
fix: radio input element don't trigger validity state (#36103)
Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
2025-03-23 19:16:48 +00:00
Greg Morenz
4ecf0909e5
Use explicit reborrows with mozjs::MutableHandle (#35892)
* Explicitly reborrow MutableHandles

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Unify jsapi_wrappers

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Format mozjs changes

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Update mozjs version

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

---------

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
2025-03-23 01:23:52 +00:00
elomscansio
80434d4644
Fix form validation for readonly inputs and update WPT expectations (#36090)
The HTML specification states that an input element with the `readonly`
attribute must be barred from constraint validation. Our implementation
previously included an extra check (`does_readonly_apply()`) to verify
if `readonly` applies to the input type, which is unnecessary.

This caused three test failures in:
tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini

- Removed `does_readonly_apply()` as it is not required for validation.
- Removed `tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini` since the test now passes.

To update the Web Platform Test expectations, see:
https://book.servo.org/hacking/testing.html#updating-web-platform-test-expectations

Fixes servo/servo#36076

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
2025-03-22 19:35:13 +00:00
Nico Burns
f527217bdc
Use new stylo crate renames (#35898)
Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-03-12 00:02:12 +00:00
DK Liao
ce4ba30992
feat: display file chosen for input file (#35789)
Signed-off-by: DK Liao <dklassic@gmail.com>
2025-03-10 03:55:38 +00:00
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-03 11:26:53 +00:00
Simon Wülker
be6765447d
Update to rust 1.85 (#35628)
* Update to rust 1.85

This is needed for cargo-deny

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Upgrade crown

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Clippy fixes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-02-24 17:44:35 +00:00
Auguste Baum
b0b0289014
refactor: propagate CanGc arguments through callers (#35591)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
2025-02-23 00:34:51 +00:00
Auguste Baum
863d2ce871
Propagate CanGc arguments through callers in constructors (#35541)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
2025-02-20 16:17:45 +00:00
DK Liao
720bc725b0
feat: support pre-edit text display for IME (#35535)
* feat: support pre-edit text display for IME

Signed-off-by: DK Liao <dklassic@gmail.com>

* enable ime by show_ime

Signed-off-by: DK Liao <dklassic@gmail.com>

---------

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-02-19 11:22:57 +00:00
Martin Robinson
643885e6f1
deps: Upgrade to webrender@0.66 (#35325)
In addition to some small API changes, this downstream version of
WebRender no longer depends on a very old version of time. This is the
last step toward removing the dependency on `time0.1`.

The review for this commit should also include: 9f552bebab

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-07 11:57:26 +00:00
chickenleaf
62f1dbebff
servoshell: Migrate to egui-file-dialog from tinyfiledialogs (#34823)
This is the first step toward completely replacing tinyfiledialogs with
an egui-based solution.

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-04 18:24:24 +00:00
Josh Matthews
c94ac5bccb
Move various reflector types and traits to script_bindings (#35279)
* script: Move Reflector to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-02-04 06:58:08 +00:00
Delan Azabani
5e9de2cb61
Include WebViewId into EmbedderMsg variants where possible (#35211)
`EmbedderMsg` was previously paired with an implicit
`Option<WebViewId>`, even though almost all variants were either always
`Some` or always `None`, depending on whether there was a `WebView
involved.

This patch adds the `WebViewId` to as many `EmbedderMsg` variants as
possible, so we can call their associated `WebView` delegate methods
without needing to check and unwrap the `Option`. In many cases, this
required more changes to plumb through the `WebViewId`.

Notably, all `Request`s now explicitly need a `WebView` or not, in order
to ensure that it is passed when appropriate.

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-01-30 11:15:35 +00:00
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use cfg(crown) instead of a cargo feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +00:00
Gae24
d470f219b1
Implement Clipboard Event Api (#33576)
* implement ClipboardEvent interface

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* draft implementation of clipboard events

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* handle received clipboard events inside html elemtents

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* use rustdoc style

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix compilation errors due to rebase

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update arboard crate

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* improve paste events

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* code cleanup

revert arboard crate's update, handle text only

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* restrict visibility of some methods to script crate

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* propagate CanGc argument

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* simplify handle_clipboard_msg

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* remove code duplication

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix potential borrow hazard

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* add clipboard_event pref, restore unit test code

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* retrict visibility of some document's methods

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* check if clipboardevent is trusted

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* enable clipboardevent

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix compilation for egl ports

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-01-15 19:45:29 +00:00
Simon Wülker
e8e4cb726b
Remove incorrect TODO comment in htmlinputelement.rs (#34970)
* Add doc comments to InputType

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add doc comment to HtmlInputElement::checked_changed

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Remove incorrect TODO comment

The comment indicated that we should fire a change
event at a radio input when changed the checkedness.

This is incorrect, as events should only be fired as
part of the input element's activation behaviour.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-01-13 16:27:31 +00:00
Josh Matthews
c94d909a86
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mass pub->pub(crate) conversion.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide existing dead code warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix unit tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* More formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-10 08:19:19 +00:00
Martin Robinson
e42b4b793d
script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843)
Expose two new helpers and start using them as much as possible.

- `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty
 owns a `Node`. This may be different than `.global()` in the case that
 the `Node` was adopted by a different `Document`.
- `Window::as_global_scope`: A helper to avoid having to cast so much
  when treating a `Window` like a `GlobalScope`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-07 09:56:02 +00:00
cybai (Haku)
2575a0daf1
Check regex syntax for pattern attribute with CheckRegexSyntax from mozjs (#28364)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-06 17:49:59 +00:00
Martin Robinson
b2eda71952
script: Move TaskManager to GlobalScope (#34827)
This is a simplification of the internal `TaskQueue` API that moves the
`TaskManager` to the `GlobalScope` itself. In addition, the handling of
cancellers is moved to the `TaskManager` as well. This means that no
arguments other than the `task` are necessary for queueing tasks, which
makes the API a lot easier to use and cleaner.

`TaskSource` now also keeps a copy of the canceller with it, so that
they always know the proper way to cancel any tasks queued on them.

There is one complication here. The event loop `sender` for dedicated
workers is constantly changing as it is set to `None` when not handling
messages. This is because this sender keeps a handle to the main
thread's `Worker` object, preventing garbage collection while any
messages are still in flight or being handled. This change allows
setting the `sender` on the `TaskManager` to `None` to allow proper
garbabge collection.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-04 08:41:50 +00:00
Martin Robinson
e8f75c9aea
script: Expose node helpers as NodeTraits and give more descriptive names (#34832)
This puts a few commonly used `Node` helpers into a trait (`NodeTraits`)
and gives them more descriptive names and documentation. The renames:

- `document_from_node` -> `NodeTraits::owner_document`
- `window_from_node` -> `NodeTraits::owner_window`
- `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner`
- `containing_shadow_root` -> `NodeTraits::containing_shadow_root`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-03 18:55:01 +00:00
Martin Robinson
621ddd749c
Elide lifetimes where possible after rustup (#34824)
The new version of rust allows us to elide some lifetimes and clippy is
now complaining about this. This change elides them where possible and
removes the clippy exceptions.

Fixes #34804.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-03 18:54:44 +00:00
Simon Wülker
9168375b33
Differentiate between missing/invalid value in make_enumerated_getter! (#34412)
* Create spec-compliant version of create_enumerated_getter

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Use new make_enumerated_getter! macro everywhere

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Remove old make_enumerated_getter macro

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Return lowercased value from make_enumerated_getter macro

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-11-28 00:54:03 +00:00
Josh Matthews
e956f3124c
Generate a trait abstracting over all known DOM interfaces (#34357)
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Update trait implementations with new generic type.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 07:35:14 +00:00
shanehandley
313597f325
fix: allow form submission for input [type=image] (#34203)
* fix: allow form submission for input [type=image]

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Fix comments and use existing can_gc where available

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-11-14 14:28:48 +00:00
Wulan Seruniati Salim
d3e0efbc21
Cleanup: Remove reference to closed issue 7193 (#34039)
Signed-off-by: Wulan Seruniati Salim <wulanseruniati@gmail.com>
2024-10-28 17:28:31 +00:00
chickenleaf
bb4932026c
cangc fixes in node.rs (#33984)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-23 22:44:50 +00:00
tanishka
7fbd2a521e
CanGc fixes from eventtarget.rs (#33973)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-22 22:43:52 +00:00
chickenleaf
ebfea9b352
CanGc fixes in several files (#33958)
* few cangc fixes

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* few cangc fixes

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-21 21:32:22 +00:00
chickenleaf
9acb25521e
CanGc changes from fontfaceset.rs (#33920)
* CanGc changes from fontfaceset.rs

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* Update components/script/dom/bindings/codegen/Bindings.conf

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: chickenleaf <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-10-21 12:28:56 +00:00
tanishka
65c866285f
Multiple CanGc fixes in components/script/dom (#33924)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-20 16:07:15 +00:00
tanishka
a57b6a3f79
CanGc fixes through focusevent.rs & hashchangeevent.rs (#33921)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-20 08:05:11 +00:00
tanishka
cd7b66be58
CanGc fixes in components/script/dom (#33880)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
2024-10-17 12:49:00 +00:00
Simon Wülker
7df30f3788
Replace .map_or(false with Option::is_some_and (#33468)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-16 10:03:52 +00:00
Martin Robinson
8842fe9df5
script: Use time@0.3 for input elements and do conversion in a &str trait (#33355)
This changes converts all input element parsing and normalization to use
`time` instead of `chrono`. `time` is used by our dependencies, so it
makes sense to work toward removing the Servo dependency on chrono.

In addition, parsing and normalization also moves to a trait on &str to
prepare for the possibility of all script parsers moving to a separate
crate that can have unit tests written against it.

Code duplication is eliminated when possible and more conversion is done
using integer types. These two things together mean we pass more tests
now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-09 14:33:16 +00:00