Automatic update from web-platform-tests
Enable ShadowRealm testing for DOMException
Adds the appropriate metadata for the existing tests for the functionality
of DOMException to additionally be tested in a ShadowRealm.
Adds the same IDL array to the IDL tests for DOMExceptions in ShadowRealm
as for DOMExceptions in other realms.
--
wpt-commits: 73195b08b0d7a4a4251f8b3399af24efd3de17cc
wpt-pr: 49159
Automatic update from web-platform-tests
Change 'shadowrealm' global into a shorthand for all possible ShadowRealm scopes
In order to automatically run tests not only in a ShadowRealm created in a
window scope, but also in ShadowRealms created in other realms, change the
'shadowrealm' global type to a collection, and rename the existing
ShadowRealm handler to 'shadowrealm-in-window'.
--
Remove monkeypatch of globalThis.self in ShadowRealm
As per https://github.com/whatwg/html/pull/9893, ShadowRealmGlobalScope
should have a `self` attribute already. There is no need to monkeypatch it
for the test harness.
--
Factor out JS code that will be common to multiple ShadowRealm handlers
We will add multiple ShadowRealm handlers, and they will all need to set
up certain global properties. Avoid repeating this code in each handler
as well as in idlharness-shadowrealm.js.
This should also increase readability, which is good since the ShadowRealm
setup code can be confusing.
--
Add 'shadowrealm-in-shadowrealm' global
This will add to any test with global=shadowrealm in its metadata, an
.any.shadowrealm-in-shadowrealm.html variant.
The test wrapper creates an outer ShadowRealm, which creates an inner
ShadowRealm and runs the tests inside that, relaying the results through
the outer ShadowRealm.
--
Add 'shadowrealm-in-dedicatedworker' global
This will add to any test with global=shadowrealm in its metadata, an
.any.shadowrealm-in-dedicatedworker.html variant.
The test loads an intermediate .any.worker-shadowrealm.js wrapper into a
Worker, and forwards the message port to the Worker's message port so that
fetch_tests_from_worker can receive the results.
--
Add 'shadowrealm-in-sharedworker' global
This will add to any test with global=shadowrealm in its metadata, an
.any.shadowrealm-in-sharedworker.html variant.
The test loads the same intermediate .any.worker-shadowrealm.js wrapper as
.any.shadowrealm-in-dedicatedworker.html, but populates a 'port' variable
with the port received from the connect event, instead of calling the
global postMessage since that won't work in a SharedWorker.
--
Add 'shadowrealm-in-serviceworker' global
This will add to any test with global=shadowrealm in its metadata, an
.any.shadowrealm-in-serviceworker.html variant.
We have to use a slightly different .any.serviceworker-shadowrealm.js
wrapper from the wrapper used for the other types of workers, because
dynamic import() is forbidden in ServiceWorker scopes. Instead, add a
utility function to set up a fakeDynamicImport() function inside the
ShadowRealm which uses the fetch adaptor to get the module's source text
and evaluate it in the shadowRealm.
Also add a case for ServiceWorkers to getPostMessageFunc(), which returns
a postMessage() drop-in replacement that broadcasts the message to all
clients, since test result messages from the ShadowRealm are not in
response to any particular message received by the ServiceWorker.
Note '.https.' needs to be added to the test path.
--
Add 'shadowrealm-in-audioworklet' global
This will add to any test with global=shadowrealm in its metadata, an
.any.shadowrealm-in-audioworklet.html variant.
The wrapper here is similar to the one for ServiceWorkers, since dynamic
import() is also forbidden in worklet scopes. But additionally fetch() is
not exposed, so we add a utility function to set up the ability to call
the window realm's fetch() through the AudioWorklet's message port.
We also add /resources/testharness-shadowrealm-audioworkletprocessor.js to
contain most of the AudioWorklet setup boilerplate, so that it isn't
written inline in serve.py.
Note '.https.' needs to be added to the test path.
--
wpt-commits: 9c8db8af89efbe0f67b215af2a6b49e9564e2971, 65a205aea5d02ff5bea7b1a0579287035d02d6c4, eb9c8e7259ef8bd5cca5019c1ca15ccd430e81dc, 3a20c56893472783b5e20c0d61cbb7b7b278cc6d, 7d8458ed291b139307430a102180c9a617d7876e, 42160ae827c863ac6787c8451fe377901c8f0652, 59367bb21d053abb9ed6de3cca5409486816acc9, 60d6c48e5fa76876bc3924b9d6185dfb56c9ab1c
wpt-pr: 49108
Automatic update from web-platform-tests
Put timing values of DocumentTiming in a GCed object
So they can outlive the document, and PerformanceNavigationTiming can
collect them.
Bug: 40793421
Change-Id: I2cbb53862ff9fab08f963d9408ef65ff462e5dd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5935276
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Guohui Deng <guohuideng@microsoft.com>
Reviewed-by: Noam Rosenthal <nrosenthal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384608}
--
wpt-commits: d639d949a473d412a3557eab71eba43a58420f3f
wpt-pr: 49240
Automatic update from web-platform-tests
Shared Storage: Fix web test .well-known file (_ to -)
We fix a typo where an underscore should have been a hyphen.
Bug: 376278213
Change-Id: I8f2675e3e752817ca344abaee45b00371761365d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6033313
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384607}
--
wpt-commits: aa824139f77d4481c518eb5b877405a1a4f44a3b
wpt-pr: 49238
Automatic update from web-platform-tests
Fix min/max-content block size of replaced element
The min-content and max-content sizes on the block axis depend on the
inline size. But when computing the SizeConstraint corresponding to the
inline axis, we were resolving the preferred inline size ignoring
intrinsic keywords. Now we will only ignore `auto`.
Also, this patch refactors the logic to compute the min-content and
max-content block sizes after fully resolving the inline size.
This avoids having to resolve the inline sizing properties twice.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
--
wpt-commits: f1eaa58ed9d3e0a9d875387422878f3640c79f97
wpt-pr: 49234
Automatic update from web-platform-tests
[focus] Make mouse focus use flat tree parent
This is an updated version of patch:
https://crrev.com/c/1514433
Currently, mouse-triggered event will traverse up parentOrShadowHost
to find fallback element to receive mouse focus. This doesn't make sense
for slotted content, where we expect the parent to receive focus to be
the assigned slot. This is fixed by traversing using the Flat Tree.
In the DOM spec for the Dispatch algorithm [1]:
"If isActivationEvent is true, event’s bubbles attribute is true,
activationTarget is null, and parent has activation behavior, then set
activationTarget to parent."
The parent is found using the get the parent algorithm [2]:
"A node’s get the parent algorithm, given an event, returns the node’s
assigned slot, if node is assigned; otherwise node’s parent."
Previously, this patch was reverted because it broke the text selection
in DevTools Network panel, which uses slots. This is fixed by
updating FrameSelection to use flat tree traversal to find parent.
The change is behind flag MouseFocusFlatTreeParent.
[1] https://dom.spec.whatwg.org/#concept-event-dispatch
[2] https://dom.spec.whatwg.org/#get-the-parent
Change-Id: Ibfeaebab0dce4817c34b447f540e784b12b9ab56
Bug: 41420461
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6004068
Auto-Submit: Di Zhang <dizhangg@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384575}
--
wpt-commits: 8c7d2bc8f83d8a38e51178ce132f3eed17275b8b
wpt-pr: 49236
Automatic update from web-platform-tests
Deflake and speed up LoAF tests
The main cause for flakiness in long-animation-frame tests
was the fact that long animation frames can be caused by
arbitrary system operations, unrelated to the ones created by
the test, and those would generate noise that would make the
tests believe that the entries are incorrect.
The previous mitigation was to generate really long LoAFs (360ms),
filter only really-long LoAFs, and also retry 10 times.
However, this brittle approach had several issues:
- In some cases there could be enough noise where this wouldn't filter
it well enough.
- If the implementation itself is flaky, the test would pass.
- It makes the test very slow and CPU-consuming (a generated LoAF is
a CPU spin).
The new approach, is to mark the time during calls to `busy_wait`,
and filter only the LoAFs that contain the actual `busy_wait` call.
This filters out any LoAF that we didn't generate ourselves in the test.
This also allows us to reduce the `busy_wait` time from 360ms to 120ms.
Refactored some tests to call the utils `busy_wait` instead of rolling
their own.
Bug: 40263438
Bug: 41484738
Bug: 369956892
Bug: 336691003
Bug: 335003887
Change-Id: Idf3505aef54837f7d7200b0dc57dffdec7c748c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6022841
Reviewed-by: Scott Haseley <shaseley@chromium.org>
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384560}
--
wpt-commits: 2b26674334f57a229efb3dc31c5d147fa3c27784
wpt-pr: 49237
Automatic update from web-platform-tests
Implement new behavior for popovers contained within invokers
In this case:
```
<button popovertarget=foo>Activate
<div popover id=foo>Clicking me shouldn't close me</div>
</button>
```
clicking the button properly activates the popover, however,
clicking on the popover itself after that should **not** close
the popover. It currently does because the popover click
bubbles to the `<button>` and activates the invoker, which
toggles the popover closed.
This CL changes that behavior so that clicks on the popover
in the case above no longer re-invoke the popover.
Spec PR:
https://github.com/whatwg/html/pull/10770
Bug: 379241451
Change-Id: Iab67127c46a97a081a7818bfd917864729bf8b5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026982
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384498}
--
wpt-commits: 50f7c0548260cdc2f11bface1816a283f9314de8
wpt-pr: 49232
Automatic update from web-platform-tests
Move 'valid codec with spaces' to validButUnsupportedConfigs configs (#48870)
* Move 'valid codec with spaces' to validButUnsupported configs
UA is not expected to support codec strings with whitespaces around it, even though it's a valid config.
* Remove trailing whitespaces at line 100
--
wpt-commits: 30ee69b644196db4964bc2597d6aad7d37e3beed
wpt-pr: 48870
Automatic update from web-platform-tests
DOM: Capture apparent getSelection() getter side effects
This CL adds tests (and unfortunately, expectations) for a bug that has
to do with getters on `getSelection()` having side effects on the
internal range maintained by `blink::DOMSelection`, when a selection's
anchor node is removed from the DOM.
R=masonf
Bug: 379275917
Change-Id: Ic69f910b5d070a55a6f0c3992f45c0ad939124d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026810
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384416}
--
wpt-commits: e60ae5825b9f69af2581e0ae8955f2dbe5e0ebd1
wpt-pr: 49230
Automatic update from web-platform-tests
Refactor pointerevent_poitnerId_scope test
This test was periodically flaking on debug builds. A timeout would
resolve if we did not see the expected number of events. This is
possible due to event coalescing. Added a click on each of the targets
to ensure that we get the expected number of events.
Also removed the manual testing instructions and converted the test to
be promise driven.
Bug: 352327319
Change-Id: I3aefac84b6be0ca76a9678e03eef3c89d0e18092
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020360
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384414}
--
wpt-commits: a113ac4fa26c11b773c3f3cafe95f95370908f41
wpt-pr: 49228
Automatic update from web-platform-tests
[css-values-5] Implement sibling-index() / sibling-count().
This is behind a flag for now, not the least because having such
element-dependent functions available will crash some properties'
parsers, which expect to be able to evaluate calc() expressions
at parse time (for e.g. clamping).
Bug: 40282719
Change-Id: I38d88da8d0492d8725089e4bb3f71944c564a7ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5097285
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384353}
--
wpt-commits: 2bc436578a38a71ad123b53c4fca4965eee916fc
wpt-pr: 49226
Automatic update from web-platform-tests
Fix dialog.requestClose() in two ways
1. The prior implementation ignored the argument to requestClose.
With this CL, requestClose(string) stores away string and then
returns it from the CloseWatcher close event.
2. If the dialog's closedBy state is None (either explicitly or
through the "Auto" state), requestClose throws an exception.
I also added a more significant set of tests for requestClose() in
all states.
This goes along with recent discussion about throwing exceptions if
requestClose() is called when the dialog isn't in the right state,
relative to closedBy:
https://github.com/whatwg/html/issues/10164#issuecomment-2479792309
The spec PR has been updated accordingly:
https://github.com/whatwg/html/pull/10737
Bug: 376516550
Change-Id: I023845844e6afb4da9a71637d517ac78d2861329
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6026242
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1384345}
--
wpt-commits: 6f4f09f92913154e70e9214636ee0e60c65f5d05
wpt-pr: 49223
Depends on D229378
Expose a getter on nsILoadInfo to easily retrieve the fetch destination as a string
This avoids duplicating the mapping logic in JS for webdriver bidi
Differential Revision: https://phabricator.services.mozilla.com/D229384
This changeset synchronizes the initiatorType from the child channel to the parent channel in asyncOpen.
It also removes noscript from initiatorType in nsITimedChannel
Differential Revision: https://phabricator.services.mozilla.com/D229378
Needed to also add the default toolbar color as the default OS navigation bar color
to ensure that we have a proper default if system bars' backgrounds are not updated.
Differential Revision: https://phabricator.services.mozilla.com/D229495
The info that we get from the check is only used for compositor hit test info and it takes a decent amount of time to check.
Differential Revision: https://phabricator.services.mozilla.com/D229290
It treats some inline elements as contextual elements. Then, they will be
preserved in copied HTML fragment. However, if an inline element is an editing
host, we don't want to contain it to the copied fragment because pasting it
causes duplicating same style into same editing host. So, if the style includes
relative style like `font-size: 2em`, it will cause bigger text than the
surrounding text. Additionally, the inline editing host usually has a border
but we don't want to make it appear in editable text.
Unfortunately, with this change, we stop copying the text style specified to
the inline editing host. However, this is same behavior as when the editing
host is a block element like `<div>`. Note that pasted text will be merged into
the inline editing host style. Therefore, if and only if the destination has
different style from the editing host, the result might be different from the
expected one by the user. However, this is a long standing issue, see
bug 1428046, for example.
Differential Revision: https://phabricator.services.mozilla.com/D228623
Previously, we used the primary frame.
This was problematic for image map areas because they don't have a frame, so we were always using the top left of the entire image.
RelativeBounds has been overridden for image map areas to correctly calculate coordinates.
Therefore, rather than special casing image map areas again, use RelativeBounds in DispatchClickEvent.
Differential Revision: https://phabricator.services.mozilla.com/D229300
As part of these tests, we need to wait for all specified DOM events to fire on a node.
We do this by setting up a Promise for each event, wrapping these in a single Promise which resolves when all events fire, storing this wrapping Promise on the Window object, and later (in a separate task) waiting on this wrapping Promise.
Previously, after any event fired, we set the Window object variable holding the wrapping Promise to null in order to clean it up.
This resulted in a race condition where if the first event fired before the second task ran to wait on the wrapping Promise, the second task would simply await null, meaning that it didn't wait at all.
The practical upshot is that we could potentially pass the tests even if the required DOM events never fired and remain blissfully unaware.
To fix this, we instead clear the wrapping Promise variable in the second task after waiting on it.
Without this fix, the test I add in the next patch would pass even without the bug being fixed.
In addition, to make debugging timeouts easier, we now log the id of the element being tested.
Differential Revision: https://phabricator.services.mozilla.com/D229299
This just improves readability.
There should be no functional change except that I gave this Runnable a proper name while I was at it.
Differential Revision: https://phabricator.services.mozilla.com/D229298
We never set this argument to anything other than the default, which meant it always used the LocalAccessible's mContent.
This makes the argument unnecessary and potentially confusing in an area which is already a bit difficult to follow, so just remove it.
There should be no functional change.
Differential Revision: https://phabricator.services.mozilla.com/D229297
This patch adds an `elementClick` trigger listener that can be used like so:
```
trigger: {
id: "elementClicked",
params: ["element-id"],
}
```
Differential Revision: https://phabricator.services.mozilla.com/D228399