Commit 53523844 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@0baf3c7090fa1cb218a9c59fdd9a35a324554c61

Using wpt-import in Chromium c650bce8.
With Chromium commits locally applied on WPT:
d8d7248d "Move forced colors tests to wpt"
999a3129 "[LayoutNG] Fix line breaking behavior after out-of-flow objects"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
foolip@chromium.org, lpz@chromium.org, robertma@chromium.org:
  external/wpt/tools
mcasas@chromium.org:
  external/wpt/geolocation-API
mstensho@chromium.org:
  external/wpt/css/css-multicol
timvolodine@chromium.org, reillyg@chromium.org:
  external/wpt/orientation-event

NOAUTOREVERT=true
TBR=lpz

No-Export: true
Change-Id: Ic9dcdc7fe26ebe599ebe30ae1472d2377bb1c54c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795663Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#695212}
parent de3b5ad7
...@@ -2,9 +2,9 @@ on: pull_request ...@@ -2,9 +2,9 @@ on: pull_request
name: Synchronize the Pull Request Preview name: Synchronize the Pull Request Preview
jobs: jobs:
update-pr-preview: update-pr-preview:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1.0.0 - uses: actions/checkout@v1
with: with:
ref: refs/heads/master ref: refs/heads/master
fetch-depth: 1 fetch-depth: 1
......
on: push on:
push:
branches:
- master
name: Build & Publish Documentation Website name: Build & Publish Documentation Website
jobs: jobs:
website-build-and-publish: website-build-and-publish:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@v1
with:
fetch-depth: 1
- name: website-build-and-publish - name: website-build-and-publish
uses: ./tools/docker/documentation uses: ./tools/docker/documentation
env: env:
......
on: push on:
push:
branches:
- master
name: Build & Release Manifest name: Build & Release Manifest
jobs: jobs:
manifest-build-and-tag: manifest-build-and-tag:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@v1
with:
fetch-depth: 1
- name: manifest-build-and-tag - name: manifest-build-and-tag
uses: ./tools/docker/github uses: ./tools/docker/github
env: env:
......
This is a testharness.js-based test.
PASS e.style['background'] = "red, green" should not set the property value
FAIL e.style['background'] = "black 0 url(https://example.invalid/) / cover" should not set the property value assert_equals: expected "" but got "url(\"https://example.invalid/\") 0px center / cover black"
Harness: the test ran to completion.
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
</head> </head>
<body> <body>
<script> <script>
// <bg-layer> does not allow a <color>.
test_invalid_value("background", "red, green"); test_invalid_value("background", "red, green");
// A `/ <bg-size>` is only allowed directly after a <bg-position>.
test_invalid_value("background", "black 0 url(https://example.invalid/) / cover");
</script> </script>
</body> </body>
</html> </html>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</style> </style>
<article> <article>
<div class="container" style="border-bottom: none; height: 200px;"> <div class="container" style="border-bottom: none; height: 200px; margin-top: 1em;">
<div class="block">block1</div> <div class="block">block1</div>
</div> </div>
</article> </article>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
height: 250px; height: 250px;
background-color: pink; background-color: pink;
border: 20px solid purple; border: 20px solid purple;
margin-top: 1em;
} }
div.block { div.block {
width: 100px; width: 100px;
......
// GENERATED CONTENT - DO NOT EDIT // GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports // Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports) // (https://github.com/tidoust/reffy-reports)
// Source: Geolocation API Specification 2nd Edition (https://www.w3.org/TR/geolocation-API/) // Source: Geolocation API Specification (https://w3c.github.io/geolocation-api/)
partial interface Navigator { partial interface Navigator {
readonly attribute Geolocation geolocation; [SameObject] readonly attribute Geolocation geolocation;
}; };
[NoInterfaceObject] [Exposed=Window]
interface Geolocation { interface Geolocation {
void getCurrentPosition(PositionCallback successCallback, void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback, optional PositionErrorCallback errorCallback,
optional PositionOptions options); optional PositionOptions options = {});
long watchPosition(PositionCallback successCallback, long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback, optional PositionErrorCallback errorCallback,
optional PositionOptions options); optional PositionOptions options = {});
void clearWatch(long watchId); void clearWatch(long watchId);
}; };
callback PositionCallback = void (Position position); callback PositionCallback = void (GeolocationPosition position);
callback PositionErrorCallback = void (PositionError positionError); callback PositionErrorCallback = void (GeolocationPositionError positionError);
dictionary PositionOptions { dictionary PositionOptions {
boolean enableHighAccuracy = false; boolean enableHighAccuracy = false;
...@@ -30,14 +30,14 @@ dictionary PositionOptions { ...@@ -30,14 +30,14 @@ dictionary PositionOptions {
[Clamp] unsigned long maximumAge = 0; [Clamp] unsigned long maximumAge = 0;
}; };
[NoInterfaceObject] [Exposed=Window, SecureContext]
interface Position { interface GeolocationPosition {
readonly attribute Coordinates coords; readonly attribute GeolocationCoordinates coords;
readonly attribute DOMTimeStamp timestamp; readonly attribute DOMTimeStamp timestamp;
}; };
[NoInterfaceObject] [Exposed=Window, SecureContext]
interface Coordinates { interface GeolocationCoordinates {
readonly attribute double latitude; readonly attribute double latitude;
readonly attribute double longitude; readonly attribute double longitude;
readonly attribute double? altitude; readonly attribute double? altitude;
...@@ -47,8 +47,8 @@ interface Coordinates { ...@@ -47,8 +47,8 @@ interface Coordinates {
readonly attribute double? speed; readonly attribute double? speed;
}; };
[NoInterfaceObject] [Exposed=Window]
interface PositionError { interface GeolocationPositionError {
const unsigned short PERMISSION_DENIED = 1; const unsigned short PERMISSION_DENIED = 1;
const unsigned short POSITION_UNAVAILABLE = 2; const unsigned short POSITION_UNAVAILABLE = 2;
const unsigned short TIMEOUT = 3; const unsigned short TIMEOUT = 3;
......
...@@ -19,10 +19,10 @@ partial interface Presentation { ...@@ -19,10 +19,10 @@ partial interface Presentation {
readonly attribute PresentationReceiver? receiver; readonly attribute PresentationReceiver? receiver;
}; };
[Constructor(USVString url), [SecureContext, Exposed=Window]
Constructor(sequence<USVString> urls),
SecureContext, Exposed=Window]
interface PresentationRequest : EventTarget { interface PresentationRequest : EventTarget {
constructor(USVString url);
constructor(sequence<USVString> urls);
Promise<PresentationConnection> start(); Promise<PresentationConnection> start();
Promise<PresentationConnection> reconnect(USVString presentationId); Promise<PresentationConnection> reconnect(USVString presentationId);
Promise<PresentationAvailability> getAvailability(); Promise<PresentationAvailability> getAvailability();
...@@ -37,9 +37,9 @@ interface PresentationAvailability : EventTarget { ...@@ -37,9 +37,9 @@ interface PresentationAvailability : EventTarget {
attribute EventHandler onchange; attribute EventHandler onchange;
}; };
[Constructor(DOMString type, PresentationConnectionAvailableEventInit eventInitDict), [SecureContext, Exposed=Window]
SecureContext, Exposed=Window]
interface PresentationConnectionAvailableEvent : Event { interface PresentationConnectionAvailableEvent : Event {
constructor(DOMString type, PresentationConnectionAvailableEventInit eventInitDict);
[SameObject] readonly attribute PresentationConnection connection; [SameObject] readonly attribute PresentationConnection connection;
}; };
...@@ -64,17 +64,17 @@ interface PresentationConnection : EventTarget { ...@@ -64,17 +64,17 @@ interface PresentationConnection : EventTarget {
// Communication // Communication
attribute BinaryType binaryType; attribute BinaryType binaryType;
attribute EventHandler onmessage; attribute EventHandler onmessage;
void send(DOMString message); void send (DOMString message);
void send(Blob data); void send (Blob data);
void send(ArrayBuffer data); void send (ArrayBuffer data);
void send(ArrayBufferView data); void send (ArrayBufferView data);
}; };
enum PresentationConnectionCloseReason { "error", "closed", "wentaway" }; enum PresentationConnectionCloseReason { "error", "closed", "wentaway" };
[Constructor(DOMString type, PresentationConnectionCloseEventInit eventInitDict), [SecureContext, Exposed=Window]
SecureContext, Exposed=Window]
interface PresentationConnectionCloseEvent : Event { interface PresentationConnectionCloseEvent : Event {
constructor(DOMString type, PresentationConnectionCloseEventInit eventInitDict);
readonly attribute PresentationConnectionCloseReason reason; readonly attribute PresentationConnectionCloseReason reason;
readonly attribute DOMString message; readonly attribute DOMString message;
}; };
......
...@@ -64,8 +64,9 @@ partial interface ServiceWorkerGlobalScope { ...@@ -64,8 +64,9 @@ partial interface ServiceWorkerGlobalScope {
attribute EventHandler onpushsubscriptionchange; attribute EventHandler onpushsubscriptionchange;
}; };
[Constructor(DOMString type, optional PushEventInit eventInitDict = {}), Exposed=ServiceWorker, SecureContext] [Exposed=ServiceWorker, SecureContext]
interface PushEvent : ExtendableEvent { interface PushEvent : ExtendableEvent {
constructor(DOMString type, optional PushEventInit eventInitDict = {});
readonly attribute PushMessageData? data; readonly attribute PushMessageData? data;
}; };
...@@ -75,8 +76,9 @@ dictionary PushEventInit : ExtendableEventInit { ...@@ -75,8 +76,9 @@ dictionary PushEventInit : ExtendableEventInit {
PushMessageDataInit data; PushMessageDataInit data;
}; };
[Constructor(DOMString type, optional PushSubscriptionChangeEventInit eventInitDict = {}), Exposed=ServiceWorker, SecureContext] [Exposed=ServiceWorker, SecureContext]
interface PushSubscriptionChangeEvent : ExtendableEvent { interface PushSubscriptionChangeEvent : ExtendableEvent {
constructor(DOMString type, optional PushSubscriptionChangeEventInit eventInitDict = {});
readonly attribute PushSubscription? newSubscription; readonly attribute PushSubscription? newSubscription;
readonly attribute PushSubscription? oldSubscription; readonly attribute PushSubscription? oldSubscription;
}; };
......
...@@ -4,43 +4,43 @@ ...@@ -4,43 +4,43 @@
// Source: Screen Capture (https://w3c.github.io/mediacapture-screen-share/) // Source: Screen Capture (https://w3c.github.io/mediacapture-screen-share/)
partial interface MediaDevices { partial interface MediaDevices {
Promise<MediaStream> getDisplayMedia (optional DisplayMediaStreamConstraints constraints = {}); Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamConstraints constraints = {});
}; };
dictionary DisplayMediaStreamConstraints { dictionary DisplayMediaStreamConstraints {
(boolean or MediaTrackConstraints) video = true; (boolean or MediaTrackConstraints) video = true;
(boolean or MediaTrackConstraints) audio = false; (boolean or MediaTrackConstraints) audio = false;
}; };
partial dictionary MediaTrackSupportedConstraints { partial dictionary MediaTrackSupportedConstraints {
boolean displaySurface = true; boolean displaySurface = true;
boolean logicalSurface = true; boolean logicalSurface = true;
boolean cursor = true; boolean cursor = true;
boolean restrictOwnAudio = true; boolean restrictOwnAudio = true;
}; };
partial dictionary MediaTrackConstraintSet { partial dictionary MediaTrackConstraintSet {
ConstrainDOMString displaySurface; ConstrainDOMString displaySurface;
ConstrainBoolean logicalSurface; ConstrainBoolean logicalSurface;
ConstrainDOMString cursor; ConstrainDOMString cursor;
ConstrainBoolean restrictOwnAudio; ConstrainBoolean restrictOwnAudio;
}; };
partial dictionary MediaTrackSettings { partial dictionary MediaTrackSettings {
DOMString displaySurface; DOMString displaySurface;
boolean logicalSurface; boolean logicalSurface;
DOMString cursor; DOMString cursor;
}; };
enum DisplayCaptureSurfaceType { enum DisplayCaptureSurfaceType {
"monitor", "monitor",
"window", "window",
"application", "application",
"browser" "browser"
}; };
enum CursorCaptureConstraint { enum CursorCaptureConstraint {
"never", "never",
"always", "always",
"motion" "motion"
}; };
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<div id="log"></div> <div id="log"></div>
<math <math
oncopy="window.copyHappened = true" oncopy="window.copyHappened1 = true"
oncut="window.cutHappened = true" oncut="window.cutHappened1 = true"
onpaste="window.pasteHappened = true" onpaste="window.pasteHappened1 = true"
> >
<mi>E</mi> <mi>E</mi>
</math> </math>
...@@ -56,10 +56,62 @@ ...@@ -56,10 +56,62 @@
); );
compiledHandler(); compiledHandler();
assert_true( assert_true(
window[name + "Happened"], window[`${name}Happened1`],
"Calling the handler must run the code" "Calling the handler must run the code"
); );
}, `${handlerName}: the content attribute must be compiled into a function as the corresponding property`); }, `${handlerName}: the content attribute must be compiled into a function as the corresponding property`);
test(() => {
const mathEl = document.createElementNS(
"http://www.w3.org/1998/Math/MathML",
"math"
);
assert_equals(mathEl[handlerName], null, `The ${handlerName} property must be null (no attribute)`);
mathEl.setAttribute(handlerName, `window.${handlerName}Happened2 = true;`);
const compiledHandler = mathEl[handlerName];
assert_equals(
typeof compiledHandler,
"function",
`The ${handlerName} property must be a function (set attribute)`
);
compiledHandler();
assert_true(
window[`${handlerName}Happened2`],
"Calling the handler must run the code (set attribute)"
);
window[`${handlerName}Happened2`] = false;
const clonedMathEl = mathEl.cloneNode(true);
const clonedCompiledHandler = clonedMathEl[handlerName];
assert_equals(
typeof clonedCompiledHandler,
"function",
`The ${handlerName} property must be a function (clone node)`
);
clonedCompiledHandler();
assert_true(
window[`${handlerName}Happened2`],
"Calling the handler must run the code (clone node)"
);
mathEl.setAttribute(handlerName, `window.${handlerName}Happened3 = true;`);
const newCompiledHandler = mathEl[handlerName];
assert_equals(
typeof newCompiledHandler,
"function",
`The ${handlerName} property must be a function (modify attribute)`
);
newCompiledHandler();
assert_true(
window[`${handlerName}Happened3`],
"Calling the handler must run the code (modify attribute)"
);
mathEl.removeAttribute(handlerName);
assert_equals(mathEl[handlerName], null, `The ${handlerName} property must be null (remove attribute)`);
}, `${handlerName}: dynamic changes on the attribute`);
} }
EVENTS.forEach(name => { EVENTS.forEach(name => {
......
...@@ -3,11 +3,16 @@ ...@@ -3,11 +3,16 @@
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>MathML 'ElementCSSInlineStyle` Dynamic Tests</title> <title>MathML 'ElementCSSInlineStyle` Dynamic Tests</title>
<style>
mspace {
background-color: green;
}
</style>
</head> </head>
<body> <body>
<span>This tests that `ElementCSSInlineStyle` interface changes update rendering.</span> <span>This tests that `ElementCSSInlineStyle` interface changes update rendering.</span>
<div> <div>
<math style="background-color: green"><mspace width="50px" height="100px"/><mspace width="50px" height="100px"/></math> <math><mspace width="50px" height="100px"/><mspace width="50px" height="100px"/></math>
</div> </div>
</body> </body>
</html> </html>
...@@ -57,25 +57,72 @@ ...@@ -57,25 +57,72 @@
); );
}, `${name}: the default value must be null`); }, `${name}: the default value must be null`);
test(() => {
const div = document.getElementById("container");
div.innerHTML = `<math ${name}="window.${name}Happened1 = true;"></math>`;
const compiledHandler = div.firstElementChild[name];
assert_equals(
typeof compiledHandler,
"function",
`The ${name} property must be a function`
);
compiledHandler();
assert_true(
window[`${name}Happened1`],
"Calling the handler must run the code"
);
}, `${name}: the content attribute must be compiled into a function as the corresponding property`);
test(() => { test(() => {
const el = document.createElementNS( const el = document.createElementNS(
"http://www.w3.org/1998/Math/MathML", "http://www.w3.org/1998/Math/MathML",
"math" "math"
); );
el.setAttribute(name, `window.${name}Happened = true;`); assert_equals(el[name], null, `The ${name} property must be null (no attribute)`);
const compiledHandler = el[name];
el.setAttribute(name, `window.${name}Happened2 = true;`);
const compiledHandler = el[name];
assert_equals( assert_equals(
typeof compiledHandler, typeof compiledHandler,
"function", "function",
`The ${name} property must be a function` `The ${name} property must be a function (set attribute)`
); );
compiledHandler(); compiledHandler();
assert_true( assert_true(
window[name + "Happened"], window[`${name}Happened2`],
"Calling the handler must run the code" "Calling the handler must run the code (set attribute)"
);
window[`${name}Happened2`] = false;
const clonedEl = el.cloneNode(true);
const clonedCompiledHandler = clonedEl[name];
assert_equals(
typeof clonedCompiledHandler,
"function",
`The ${name} property must be a function (clone node)`
);
clonedCompiledHandler();
assert_true(
window[`${name}Happened2`],
"Calling the handler must run the code (clone node)"
); );
}, `${name}: the content attribute must be compiled into a function as the corresponding property`);
el.setAttribute(name, `window.${name}Happened3 = true;`);
const newCompiledHandler = el[name];
assert_equals(
typeof newCompiledHandler,
"function",
`The ${name} property must be a function (modify attribute)`
);
newCompiledHandler();
assert_true(
window[`${name}Happened3`],
"Calling the handler must run the code (modify attribute)"
);
el.removeAttribute(name);
assert_equals(el[name], null, `The ${name} property must be null (remove attribute)`);
}, `${name}: dynamic changes on the attribute`);
test(() => { test(() => {
const element = document.createElementNS( const element = document.createElementNS(
...@@ -97,3 +144,5 @@ ...@@ -97,3 +144,5 @@
done(); done();
}); });
</script> </script>
<div style="display: none" id="container"></div>
spec: https://w3c.github.io/deviceorientation/spec-source-orientation.html spec: https://w3c.github.io/deviceorientation/
suggested_reviewers: suggested_reviewers:
- reillyeon - reillyeon
- timvolodine - timvolodine
...@@ -267,7 +267,10 @@ def fetch_event_data(): ...@@ -267,7 +267,10 @@ def fetch_event_data():
def main(): def main():
args = get_parser().parse_args() args = get_parser().parse_args()
event = fetch_event_data() if "TASK_EVENT" in os.environ:
event = json.loads(os.environ["TASK_EVENT"])
else:
event = fetch_event_data()
if event: if event:
set_variables(event) set_variables(event)
......
This is a testharness.js-based test.
FAIL Only allow one share call at a time, which is controlled by the [[sharePromise]] internal slot. assert_throws: function "function() { throw e }" threw object "AbortError: Internal error: could not connect to Web Share interface." that is not a DOMException InvalidStateError: property "code" is equal to 20, expected 11
Harness: the test ran to completion.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="help" href="https://github.com/w3c/web-share/pull/113" />
<title>WebShare Test: only one share at a time</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
</head>
<body>
<script>
promise_test(async t => {
const [, promise2, promise3] = await test_driver.bless(
"share needs user activation",
() => {
return [
navigator.share({ title: "should be pending" }),
navigator.share({ title: "should reject" }),
navigator.share({ title: "should also reject" }),
];
}
);
await Promise.all([
promise_rejects(t, "InvalidStateError", promise2),
promise_rejects(t, "InvalidStateError", promise3),
]);
}, "Only allow one share call at a time, which is controlled by the [[sharePromise]] internal slot.");
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment