For some specific cases (one of them see below) where are requirement to
identify the reason of the attribute mutation (by whom/why it was
changed - by cloning, parser or directly), so the following `reason`
parameter was added to `AttributeMutation::Set` option.
Note that for the HTMLMediaElement the internal `muted` state should be
set to true when the element is created and the element has a `muted`
content attribute specified (should be done once on the first attribute
mutation caused by parser or cloning).
See https://html.spec.whatwg.org/multipage/#dom-media-muted
Testing: Improvements in the following tests
-
html/semantics/embedded-content/media-elements/user-interface/muted.html
Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This PR adds context menu support with clickable menu items in the
Minibrowser. The menu appears on right click and supports basic
navigation actions (Back, Forward, Reload).
Testing: We already have tests for ContextMenu in WebView API test.
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Servo has a lot of comments like this:
```rust
// https://example-spec.com/#do-the-thing
fn do_the_thing() {}
```
and I keep turning these into doc comments whenever I'm working close to
one of them. Doing so allows me to hover over a function call in an IDE
and open its specification without having to jump to the function
definition first. This change fixes all of these comments at once.
This was done using `find components -name '*.rs' -exec perl -i -0777
-pe 's|^([ \t]*)// (https?://.*)\n\1(fn )|\1/// <$2>\n\1$3|mg' {} +`.
Note that these comments should be doc comments even within trait `impl`
blocks, because rustdoc will use them as fallback documentation when the
method definition on the trait does not have documentation.
Testing: Comments only, no testing required
Preparation for https://github.com/servo/servo/pull/39552
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
script: add CanGc as argument to VirtualMethods::children_changed
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>
Previously the `<input type=file>` would wait synchronously for file
selection
results from the embedder. This change moves that synchronous wait to
the
`FileManager` worker thread. The main benefit is that script is not
blocked waiting
for the embedder. The synchronous wait on the worker thread is not a
large issue
because it is run from a thread pool, though a later change could also
remove
that synchronous wait.
In addition, the API surface for file selection changes a bit as there
is now a `dismiss`
method which differentiates between selecting no file and not making a
choice at
all.
Testing: Covered by exiting WPT, WebDriver conformance, and unit tests.
---------
Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
in #39709, we introduced a single “form control” or “embedder control”
delegate that requests the embedder’s input for <select> and
<input type="color"> elements.
this patch partially merges <input type="file"> elements into that
new system, and renames “form controls” to “embedder controls” for
consistency.
internally we continue to use a separate code path where the embedder
directly communicates with the file manager thread. subsequent work will
make the messages asynchronous via the constellation and script thread,
like other embedder controls.
Testing: this is currently tricky to write an automated test for; we
expect to write a WebDriver test for this once we make the communication
asynchronous
---------
Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
In some situations, web content may need to hide embedder controls. For
example, when focus shifts when a `<select>` box is open or when the
element showing the control is removed from the DOM. This change adds a
new API to hide embedder controls when that happens.
Testing: This change adds a new API test.
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Before responses to `FormControl` requests were handled synchronous in
script (ie they would block the page). This change makes it so that they
are handled asynchronously, with their responses filtering back through
the Constellation. This should fix many WPT tests when run with
WebDriver.
Testing: There are some WebDriver-based test for this, but they do
not quite pass yet. More investigation is required, but this is
necessary to get them to pass.
Fixes: #39652Fixes: #37013
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
This is part of the future work of implementing LazyDOMString as
outlined in https://github.com/servo/servo/issues/39479.
We use str() method or direct implementations on DOMString for these
methods. We also change some types.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: This is essentially just renaming a method and a type and
should not change functionality.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This file was missed in 07b2ff5d60
(#39325). See that commit for the motivation.
Testing: Covered by existing web platform tests.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>