Skip to content
Merged
6 changes: 6 additions & 0 deletions css/css-fonts/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ features:
- crash-font-face-invalid-descriptor.html
- web-font-no-longer-accessible-when-stylesheet-removed.html
- test_datafont_same_origin.html
- name: font-feature-settings
files:
- font-feature-settings-*
- font-default-03.html
- font-default-04.html
- variable-in-feature-crash.html
- name: font-weight
files:
- font-weight-*
3 changes: 3 additions & 0 deletions css/css-fonts/parsing/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ features:
- name: font-variant-position
files:
- font-variant-position-*
- name: font-feature-settings
files:
- font-feature-settings-*
3 changes: 3 additions & 0 deletions css/css-overflow/line-clamp/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
features:
- name: line-clamp
files: "**"
6 changes: 5 additions & 1 deletion css/css-overflow/parsing/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ features:
- scroll-button*
- name: scrollbar-gutter
files:
- scrollbar-gutter-*
- scrollbar-gutter-*
- name: line-clamp
files:
- line-clamp-*
- webkit-line-clamp-*
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ features:
- name: speak
files:
- speak.html
- name: font-feature-settings
files:
- font-feature-settings.html
- name: font-variant
files:
- font-variant.html
Expand Down
8 changes: 0 additions & 8 deletions document-picture-in-picture/base-uri.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
promise_test(async (t) => {
await test_driver.bless('request PiP window from top window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The initial placeholder is in many ways not initialized, e.g. doesn't have the right base
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

assert_equals(pipWindow.document.baseURI, document.baseURI, "Base URIs match");
});
</script>
Expand Down
7 changes: 0 additions & 7 deletions document-picture-in-picture/display-mode.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// Ensure the async load doesn't blow away the iframe later on.
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

await new Promise(requestAnimationFrame);
assert_true(
!!pipWindow.matchMedia('(display-mode: picture-in-picture)'.matches),
Expand Down
17 changes: 10 additions & 7 deletions document-picture-in-picture/focus-opener.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@
<iframe></iframe>
<script>
promise_test(async (t) => {
await test_driver.bless('request PiP window from top window');
const pipWindow = await documentPictureInPicture.requestWindow();

// Blur this window by focusing the iframe. This will allow us to detect that
// the document picture-in-picture window has focused us.
// Ensure this window is blurred so that we can detect that the
// document PiP window has focused us.
const blurPromise = new Promise(async (resolve) => {
window.addEventListener('blur', resolve, { once: true });
await test_driver.bless('focus inner iframe to blur window');
document.getElementsByTagName('iframe')[0].focus();
});

await test_driver.bless('request PiP window from top window');
const pipWindow = await documentPictureInPicture.requestWindow();

// The PiP might be focused automatically.
// But to be safe that this window is blured, focus the iframe.
await test_driver.bless('focus inner iframe to blur window');
document.getElementsByTagName('iframe')[0].focus();
await blurPromise;

// Now focus this window from the document picture-in-picture window's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
await test_driver.bless('request PiP window from top window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The initial placeholder is in many ways not initialized, e.g. doesn't have the right base
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const fsResult = new Promise((res, rej) => {
document.body.addEventListener('fullscreenchange', res);
document.body.addEventListener('fullscreenerror', rej);
Expand Down
4 changes: 2 additions & 2 deletions document-picture-in-picture/pip-resize.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

await assert_throws_dom('NotAllowedError', pipWindow.DOMException, () =>
pipWindow.resizeTo(pipWindow.outerWidth, pipWindow.outerHeight + 100)
, 'resizeTo requires user acivation');
, 'resizeTo requires user activation');

await test_driver.bless('resize window');
let resized = new Promise(res => pipWindow.addEventListener("resize", res, { once: true }));
Expand All @@ -38,7 +38,7 @@

await assert_throws_dom('NotAllowedError', pipWindow.DOMException, () =>
pipWindow.resizeBy(100, 0)
, 'resizeBy requires user acivation');
, 'resizeBy requires user activation');

await test_driver.bless('resize window');
let resized = new Promise(res => pipWindow.addEventListener("resize", res, { once: true }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const ifr = pipWindow.document.createElement("iframe");
pipWindow.document.body.append(ifr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<iframe id="same-origin-iframe" src="/common/blank.html"></iframe>
<body>
<script>
promise_test(async (t) => {
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The async load could blow away our document while blessing causing an error
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

assert_false(navigator.userActivation.isActive, 'the opener should initially not have user activation');
assert_false(pipWindow.navigator.userActivation.isActive, 'the PiP window should initially not have user activation');

Expand All @@ -36,42 +30,26 @@
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The async load could blow away our document while blessing causing an error
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const ifr = pipWindow.document.createElement("iframe");
ifr.src = 'https://{{hosts[alt][www]}}:{{ports[https][0]}}/common/blank.html';
pipWindow.document.body.append(ifr);
await new Promise(res => ifr.addEventListener('load', res, { once: true }));

assert_false(navigator.userActivation.isActive, 'opener initially not active');
assert_false(pipWindow.navigator.userActivation.isActive, 'PiP initially not active');

await test_driver.bless('activate cross-origin iframe', null, ifr.contentWindow);
await test_driver.bless('activate iframe', null, ifr.contentWindow);

assert_true(navigator.userActivation.isActive, 'activation propagated to opener');

pipWindow.open().close();

assert_false(navigator.userActivation.isActive, 'activation was consumed in opener');
assert_false(pipWindow.navigator.userActivation.isActive, 'activation was consumed in PiP');
}, 'user activation propagates from cross-origin iframe in PiP to opener');
}, 'user activation propagates from iframe in PiP to opener');

promise_test(async (t) => {
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The async load could blow away our document while blessing causing an error
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const ifr = document.getElementById("same-origin-iframe");

assert_false(navigator.userActivation.isActive, 'opener initially not active');
Expand All @@ -89,13 +67,6 @@
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
// The async load could blow away our document while blessing causing an error
assert_true(true, "Waiting for pip window to load");
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const ifr = document.getElementById("same-origin-iframe");

assert_false(navigator.userActivation.isActive, 'opener initially not active');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,29 @@
<div id="div"></div>
<script>

function waitForEnter() {
return new Promise(resolve =>
documentPictureInPicture.addEventListener("enter", resolve, { once: true })
);
}

promise_test(async (t) => {
const enter = waitForEnter();

await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();

assert_true(!!pipWindow.document,
'Window should contain a document');
assert_true(documentPictureInPicture.window === pipWindow,
'DocumentPictureInPicture.window should match the current window');

await enter; // avoid issues in the next subtest
}, 'requestWindow resolves with the PiP window');

promise_test(async (t) => {
const enter = waitForEnter();

await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();
const div = document.getElementById('div');
Expand All @@ -34,12 +46,49 @@
'The div should have moved away from the original document');
assert_true(pipWindow.document.body.contains(div),
'The div should have moved to the PiP document');

await enter; // avoid issues in the next subtest
}, 'Elements can be moved from opener to PiP document');

promise_test(async (t) => {
const enter = waitForEnter();

await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();
assert_equals(pipWindow.document.readyState, "complete", "PiP document ready state is complete");

await enter; // avoid issues in the next subtest
}, 'PiP document is fully loaded');

promise_test(async (t) => {
let events = [];

const enter = new Promise(resolve => {
documentPictureInPicture.onenter = () => {
events.push("enter");
resolve();
}
});

await test_driver.bless('request PiP window');
const request = documentPictureInPicture.requestWindow()
.then(() => {
events.push("requestWindow");
});

// Microtask to resolve request should already be queued
const microtask = Promise.resolve().then(() => events.push("microtask"));

assert_true(!!documentPictureInPicture.window, "window property should be set synchronous");

await Promise.all([enter, request, microtask]);

assert_equals(
events.join(),
"requestWindow,microtask,enter",
"Got the expected order of actions"
);

}, "requestWindow timing");
</script>
</body>
5 changes: 0 additions & 5 deletions document-picture-in-picture/support/popup-opens-pip.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
if (data.type == 'request-pip') {
pipWindow = await documentPictureInPicture.requestWindow();

if (pipWindow.document.readyState != "complete") {
// about:blank should load synchronous, but Gecko is still working on that...
await new Promise(res => pipWindow.addEventListener("load", res, { once: true }));
}

const script = pipWindow.document.createElement('script');
script.innerHTML = get_pip_code(data.channelName);
pipWindow.document.body.append(script);
Expand Down
4 changes: 4 additions & 0 deletions dom/collections/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
features:
- name: dataset
files:
- domstringmap-supported-property-names.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
"use strict";

document.addEventListener("DOMContentLoaded", () => {
const dialog = document.querySelector("dialog");
dialog.close();
dialog.show();
getSelection().collapse(dialog, 1); // After the <hr>
document.execCommand("justifyFull");
}, {once: true});
</script>
</head>
<body>
<dialog open contenteditable><hr><textarea>
</textarea>
<br contenteditable="false">
3 changes: 3 additions & 0 deletions html/browsers/offline/browser-state/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
features:
- name: online
files: "**"
5 changes: 5 additions & 0 deletions html/dom/elements/global-attributes/WEB_FEATURES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ features:
- name: title-attr
files:
- title-manual.html
- name: dataset
files:
- dataset-*
- custom-attrs.html
- data_unicode_attr.html
Loading
Loading