Implement raw export of HMAC keys. JWT export of HMAC keys will come in
a separate PR.
Testing: WPT
Fixes: Partially #39060
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Phantom line boxes should be treated as non-existing for most purposes,
so don't let them affect the baseline of their block container.
Testing: An existing test passes, and also adding a new one which
doesn't rely on `<button>`
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Autoincrementedness was previously being reported as always false. This
PR makes the state become queried from the backend, as the spec
specifies. Additionally this PR ensures the backend correctly handles an
object store which autoincrements.
Testing: WPT
Fixes: None
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Adds epoch to each WR image op command that is sent to compositor. The
renderer now has a `FrameDelayer` data structure that is responsible for
tracking when a frame is ready to be displayed. When asking canvases to
update their rendering, they are given an optional `Epoch` which denotes
the `Document`'s canvas epoch. When all image updates for that `Epoch`
are seen in the renderer, the frame can be displayed.
Testing: Existing WPT tests
Fixes: #35733
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
In #38745, we changed the id of Frame and Window as the result of
`ToString` trait. This PR
- adapts the parsing of frame/window accordingly.
- for frame, return the
[WindowProxy](https://developer.mozilla.org/en-US/docs/Web/API/WindowProxy)
object of the iframe as it's supposed to do.
Testing: `execute_{async_}script/arguments.py`
---------
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Replaced usage of `typed_insert` since it ended converting `UTF-8` to
lowercase.
Removed one of the test cases since it wasn't following spec since
[xhr/205](https://github.com/whatwg/xhr/pull/205).
Testing: Changes covered by wpt
Fixes: #20436
---------
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Instead of doing font selection and text shaping in `canvas`, move this
to `script`. This allows canvas to use the shared `Document`
`FontContext`, which has access to web fonts. In addition, ensure that
there is a font style accessible for `OffscreenCanvas` in workers.
Testing: This causes a number of WPT tests to start to pass as web fonts
are
supported on canvas again. In addition, some start to fail as they
expose other
issues:
- The lack of support for the `Context2D.fontStretch` property
- Issues with zerosize gradient interpolation.
- Differences between quoted and unquoted font family names. This seems
like
a timing issue with the way we are handling web fonts. The test seems to
be
expecting Local fonts to be available immediately (without waiting for
them
to load). This isn't how Servo works ATM. Seems like an issue with the
test.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Sets the indexeddb request error when the backend errors out. This also
matches statements to the spec.
Testing: Covered by WPT
Fixes: General indexeddb
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
- Add `ShadowRoot` to `JSValue` to avoid
`WebDriverJSError::UnknownType`, and
`JavaScriptEvaluationError::SerializationError` when execute JS from
embedder.
- Add unit test.
- Move [is_detached](https://w3c.github.io/webdriver/#dfn-is-detached)
to `fn is_detached` to be reused.
- Other random simplification.
Testing: WebDriver conformance tests.
---------
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Fixes a check for empty options in `getAll(options)` and makes url
comparison with exclude fragments set to true.
Testing: New passing WPT tests
Part of #37674
---------
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
We pass in the new trait implementation to process the value,
which the CSP crate calls in its implementation. Additionally,
since the request url can change, we need to propagate that
to load_data as well.
This also avoids a crash when a discarded browsing context is
accessed while navigating the iframes in the WPT tests. This
is a known issue, but hampers investigation into actual
Trusted Types support.
All tests using iframes don't work, as they don't have the
correct browsing context. The other tests do work, but some
fail on header ascii parsing (#36801) or error while handling
errors. That last one I don't understand based on the current
code and I would need to do a deep-dive in the existing code
to understand better what's going on.
Part of #36258
Part of #37920
---------
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Currently the embedding API only provides the embedder with the URL for
a favicon. This is not great, for multiple reasons:
* Loading the icon should happen according to the fetch spec which is
not easy for the embedder to recreate (consider CSP, timing information
etc)
* Rasterizing a svg favicon is not trivial
With this change, servo fetches and rasterizes the icon to a bitmap
which is then passed to the embedder.
Testing: I'm not sure how I can write tests for the embedding api. I've
tested the correctness manually using
https://github.com/servo/servo/pull/36680.
Prepares for https://github.com/servo/servo/pull/36680
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
We really want to remove font-kit from dep tree, so this is the first
step into removing raqote from servo. While vello_cpu is not perfect
replacement, I am confident that we will resolve all issues eventually:
https://github.com/servo/servo/issues/38345 (most important ones already
have PRs).
Reviewable per commit.
Testing: Existing WPT tests.
Try run: https://github.com/sagudev/servo/actions/runs/17138369290
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Bumps [data-url](https://github.com/servo/rust-url) from 0.3.1 to 0.3.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/servo/rust-url/commits">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
Parameterize and rename both `Layout::content_box_query` and
`Layout::content_boxes_query` to support the query of rendered padding
area and content area that accounts for transform and scroll. Both of
these query have been misleading for a time since they are using border
box, instead of content box of a Node.
This PR adds a new type `layout_api::BoxAreaType` to be passed from
`ScriptThread` to `LayoutThread` to query the respective area. It is
then used for the query within `IntersectionObserver` to pass several
WPTs.
Testing: Existing WPT Coverage.
---------
Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
Testing: These changes should be covered by existing web platform tests
and `image`'s own test suite.
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This adds the remaining window as well as specific svg and animation
listeners. The test suite was erroring before, as we don't implement
`SVGAnimationElement` yet. Now, the test gracefully checks if the
interface exists before doing a lookup.
Part of #36258
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Previously, the script-thread would assert the pipeline was closed if no
pending load was found, but it did not check whether the pipeline was
closed before processing the page headers. Since incomplete loads are
removed only when page headers are processed, this means the page
headers were processed even if the pipeline had been closed before the
page headers were available. If the pipeline had been closed as part of
exiting the constellation, it was possible for the constellation to have
exited by the time the page headers became available(since the
script-thread closes a pipeline independently from ongoing navigation
fetches), which would produce a panic on trying to communicate with the
constellation to obtain the browsing context info.
Note: due to the nature of the problem, I cannot verify that this fixes
the crash test, although logically this appears to make sense, and a
couple of days of WPT runs should tell us more.
Testing: A crash test was added; unfortunately the crash was
intermittent.
Fixes: https://github.com/servo/servo/issues/36747
---------
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Add logic that was accidentally removed in #38745. Otherwise it is very
weird when using webdriver as a human, as we still stays on the original
tab.
Testing: ~this should not affect any test. Even if the tab is not
"visible" previously, all programmatic interaction works fine.~ Stably
pass `test_history_pushstate` in `back.py` and `forward.py`.
---------
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
These changes fix a large number of panics that can manifest as
intermittent test failures. They also add more specification text to
various IDBObjectStore methods and implement missing steps that check
for whether an object store is deleted.
Testing: Existing test coverage.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
We wouldn't handle the AttributeMutation::Removed for
attribute event listeners and wouldn't remove the
corresponding event listener. Added the necessary
logic (using the newly EventTarget::is_content_event_handler
to correctly only do this for known event handlers) and
added links to the relevant parts of the spec.
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This is an implementation of the `prevent_scroll` feature in the focus
transaction system. It allows to control whether focusing an element
should prevent scrolling or not.
Spec:
https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll
Testing: Existing WPT tests
Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
While building the stacking context tree we were assuming that `<body>`
would have propagated its `overflow` value to the viewport, and thus its
used `overflow` would be `visible`.
However, the element that propagates `overflow` can be the root element
instead. Since #38598 we are correctly taking this into account in
`effective_overflow()`, so we no longer need to do anything special in
the stacking context logic.
Testing: `css/css-overflow/overflow-body-propagation-012.html`
Fixes: #38799
Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
Testing: WebDriver Conformance test. In addition to fixing all "Element
Intercepted" errors in
https://github.com/yezhizhen/servo/actions/runs/17142506541, we are able
to fix many other tests.
Fixes: #38837
---------
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Previously we immediately passed the KeyboardEvent to embedder. Now we
make element send keys go through the dispatch action which required by
spec. CompositionEvent still immediately passed through embedder
Testing: Should make
`./tests/wpt/tests/webdriver/tests/classic/element_send_keys/` more
stable.
Fixes: https://github.com/servo/servo/issues/38354
Fixes: https://github.com/servo/servo/issues/38442
---------
Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
Servo shows a behavior unlike FF and Safari(I don't have Chrome), where
stopping a window does not cancel planned form navigation, resulting in
an infinite navigation loop. The current behavior of Servo does seem to
follow the wording of the spec, so I will open a [companion issue at the
spec](https://github.com/whatwg/html/issues/11562), and I have also
written a WPT tests for the non-standard but widely followed behavior.
This PR also adds a beginning of an implementation of the "ongoing
navigation" concept, which is used by the spec to cancel navigations,
and which is used in this PR only to cancel planned form navigations.
The generation id concept, which corresponds to the planned navigation
concept in the spec, is turned into a simple struct private cell, and is
documented per the spec.
Testing: A new WPT test is added
Fixes: Only one part of https://github.com/servo/servo/issues/36747
---------
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
None of our automated tests were executing the initial DB setup code
because the requested version always matched.
Testing: Existing WPT coverage.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This PR contains 2 parts:
1. Refactor webdriver session.
2. Improve webdriver window handles:
- Webdriver always get window handles from script thread by default.
- If script thread is blocked by user prompt, embedder stores the window
handle before user prompt appears, then webdriver can get window handle
from embedder.
Testing: Clear timeout cause by user prompt blocking script thread:
https://github.com/longvatrong111/servo/actions/runs/17033900026
---------
Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
The `<input>` element inner container should be stretch to its
containing block. This would allow the alignment of the text. This is
done by adding `min-width: 100%`. It is required because we are not
using a custom layout contrary to Firefox and Chrome.
Testing: New Servo specific WPT.
---------
Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
Additionally, several methods were updated with
spec comments. That's because the "adopt the document
from the element document" step was missing.
By adding these spec comments, I also restructured
some code to avoid duplication of mutation records
and custom element reaction queueing.
Node.textContent doesn't propagate the error yet,
as that method has a lot of separate callers of
elements that wouldn't fail. I will refactor those
in a follow-up PR to keep things manageable.
This implements part of the DOM integration from
https://github.com/whatwg/dom/pull/1268
Part of #36258
---------
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
This is a first draft at implementing the required infrastructure for
CookieStore, which requires setting up IPC between script and the
resource thread to allow for async/"in parallel" handling of cookie
changes that have a promise API.
Cookie Store also will need to receive change events when cookies for a
url are changed so the architecture needs to support that.
Expect this PR to be reworked once the architecture becomes more
settled, cookie change events will be implemented in follow up PRs
Testing: WPT tests exist for this API
Part of #37674
---------
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
Adds the `matrixTransform` function for `DOMPointReadOnly`.
Testing: Covered by WPT tests (`css/geometry`)
---------
Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
The `overflow-*` values of either the root element or the `<body>` get
propagated to the viewport. However, we were missing this part:
> The element from which the value is propagated must then have a used
`overflow` value of `visible`.
See https://drafts.csswg.org/css-overflow/#overflow-propagation
Testing:
- `css/cssom-view/scrolling-quirks-vs-nonquirks.html`
- `css/css-overflow/overflow-body-propagation-007.html`
- `css/css-overflow/overflow-body-propagation-008.html`
- `css/css-overflow/overflow-body-propagation-009.html`
- `css/css-overflow/scrollable-overflow-with-nested-elements-001.html`
- `css/css-overflow/scrollable-overflow-with-nested-elements-002.html`
- `css/css-overflow/scrollable-overflow-with-nested-elements-003.html`
- `css/css-overflow/scrollable-overflow-with-nested-elements-004.html`
- `css/css-overflow/scrollbar-gutter-scroll-into-view.html`
Failures:
- `css/css-overflow/overflow-body-propagation-010.html`
Failing because of missing support for `contain: paint`.
- `css/css-overflow/scrollable-overflow-with-nested-elements-005.html`
Failing because of wrong `data-expected-height`, but correct
`data-expected-scroll-height` which is core of this PR.
`data-expected-height` can be dealt separately.
Fixes: #38248
---------
Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>