Commit Graph

6 Commits

Author SHA1 Message Date
Narfinger
4fafdd1c23 script: JSContextify parts of DocumentEventHandler (#44241)
This "JSContextify"s part of DocumentEventHandler, namely the actions
from `handle_pending_input_events`.
Additionally, we also switch the MouseEvent and KeyboardEvent. This does
not change yet PointerEvent and some other events used to keep the diff
reasonable.

Testing: This is part of the JSContextify work that is fundamental and
tested by WPT.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-04-15 13:59:07 +00:00
Luke Warlow
55e586737b script: Implement drop-down select multiple (#43189)
Implement drop-down select multiple: 
 - Updates the embedder API to support multi-selects.
- Updates the select element to correctly reset when multiple attribute
is removed.
- Select now renders "n selected" as button text when more than 1, or 0
options are selected.

Note that listbox selects are not yet supported, once they are these new
features will be for `<select multiple size=1>`.

Testing: WPTs and also manually using
https://demo.lukewarlow.dev/css-forms.html. The two test regressions are
due to the lack of listbox support rather than an issue with this PR.
Fixes: #38509

---------

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Signed-off-by: Martin Robinson <martin@abandonedwig.info>
Co-authored-by: Martin Robinson <martin@abandonedwig.info>
2026-04-10 05:47:21 +00:00
Tim van der Lippe
f7876c3db8 script: Pass &mut JSContext to navigate (#43713)
Also move the related `navigate_to_fragment` method next to it.

Part of #40600

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-03-27 17:11:22 +00:00
Babalola Taiwo J
ed8b28b642 script: Merge Window::load_url with ScriptThread::navigate (#43668)
Both `Window::load_url` and `ScriptThread::navigate` implement parts of
the same navigate algorithm from the HTML spec
(https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate).
`ScriptThread::navigate` had only one caller: `Window::load_url`.

This merges both methods into a single `navigate` function in
`navigation.rs`, which is the appropriate home for navigation logic. All
previous callers of `Window::load_url` now call `navigation::navigate`
directly.

Testing: This is a pure refactor with no behaviour changes, so no new
tests are needed. Existing tests cover the navigation paths affected.
Fixes: #43494

---------

Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
2026-03-27 08:38:43 +00:00
Euclid Ye
2f5e3fdb5c cargo: Rename workspace-local library starting with c to servo_* (#43622)
- canvas 
- constellation_traits
- canvas_traits
- constellation

Testing: This should not change any behaviour.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-25 06:04:57 +00:00
elomscansio
7e97e82008 script: Move document DOM interfaces to script/dom/document/ (#43602)
Moves interfaces defined by the document spec to the
script/dom/document/ module from script/dom/.

Testing: Just a refactor shouldn't need any testing
Fixes: Partially #38901

---------

Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
2026-03-24 14:29:07 +00:00