Skip to content

Commit 492dbc7

Browse files
Merge branch 'master' into sadym/userContext.proxy
2 parents ef1358b + 742db34 commit 492dbc7

File tree

38 files changed

+846
-111
lines changed

38 files changed

+846
-111
lines changed

ai/summarizer/summarizer-availability-available.tentative.https.window.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ promise_test(async () => {
1212

1313
promise_test(async () => {
1414
const availability = await Summarizer.availability({
15-
type: 'tl;dr',
15+
type: 'tldr',
1616
format: 'plain-text',
1717
length: 'medium',
1818
expectedInputLanguages: ['en-GB'],
@@ -24,7 +24,7 @@ promise_test(async () => {
2424

2525
promise_test(async () => {
2626
const availability = await Summarizer.availability({
27-
type: 'tl;dr',
27+
type: 'tldr',
2828
format: 'plain-text',
2929
length: 'medium',
3030
expectedInputLanguages: ['es'], // not supported

ai/summarizer/summarizer-availability.tentative.https.window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ promise_test(async () => {
1818
promise_test(async () => {
1919
// An array of plausible test option values.
2020
const kCreateOptionsSpec = [
21-
{type: [undefined, 'tl;dr', 'teaser', 'key-points', 'headline']},
21+
{type: [undefined, 'tldr', 'teaser', 'key-points', 'headline']},
2222
{format: [undefined, 'plain-text', 'markdown']},
2323
{length: [undefined, 'short', 'medium', 'long']},
2424
{expectedInputLanguages: [[], ['en'], ['es'], ['jp', 'fr']]},

clipboard-apis/async-navigator-clipboard-change-event.tentative.https.html

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,79 @@
2525
});
2626
}
2727

28+
let typesToSet_ = ["text/html", "web txt/csv"];
2829
button.onclick = () => document.execCommand("copy");
2930
document.oncopy = (ev) => {
3031
ev.preventDefault();
31-
ev.clipboardData.setData("text/html", `<div>Test html</div>`);
32+
for (let i = 0; i < typesToSet_.length; i++) {
33+
const type = typesToSet_[i];
34+
const data = new Blob([`Test data for ${type}`], {type: type});
35+
ev.clipboardData.setData(type, data);
36+
}
3237
};
3338

34-
function triggerCopyToClipboard() {
39+
function triggerCopyToClipboard(typesToSet) {
40+
if (typesToSet) {
41+
typesToSet_ = typesToSet;
42+
}
3543
return test_driver.click(button);
3644
}
3745

3846
promise_test(async (test) => {
3947
let clipboardChangeEventCount = 0;
4048
let eventType = "";
49+
let capturedEventTypes = null;
4150
navigator.clipboard.addEventListener("clipboardchange", (ev) => {
4251
clipboardChangeEventCount++;
4352
eventType = ev.type;
53+
capturedEventTypes = ev.types;
4454
});
4555
await triggerCopyToClipboard();
4656
assert_equals(clipboardChangeEventCount, 1, "clipboardchange event should be called exactly once");
4757
assert_equals(eventType, "clipboardchange", "Event type should be 'clipboardchange'");
58+
assert_true(capturedEventTypes.includes("text/html"), "types should contain 'text/html'");
59+
assert_false(capturedEventTypes.includes("web txt/csv"), "types should not contain custom MIME type");
4860
}, "clipboardchange event is invoked");
4961

5062
promise_test(async (test) => {
5163
await tryGrantWritePermission();
5264
let clipboardChangeEventCount = 0;
65+
let capturedEventTypes = null;
5366
navigator.clipboard.addEventListener("clipboardchange", (ev) => {
5467
clipboardChangeEventCount++;
68+
capturedEventTypes = ev.types;
5569
});
5670
await navigator.clipboard.writeText("Test text");
5771
await waitForRender();
5872
assert_equals(clipboardChangeEventCount, 1, "clipboardchange event should be called exactly once");
73+
assert_true(capturedEventTypes.includes("text/plain"), "types should contain 'text/plain'");
5974
}, "clipboardchange event is invoked with async clipboard API");
6075

6176
promise_test(async (test) => {
6277
let onClipboardChangeAttributeCount = 0;
63-
navigator.clipboard.onclipboardchange = () => {
78+
let capturedEventTypes = null;
79+
navigator.clipboard.onclipboardchange = (ev) => {
6480
onClipboardChangeAttributeCount++;
81+
capturedEventTypes = ev.types;
6582
};
6683
await triggerCopyToClipboard();
6784
assert_equals(onClipboardChangeAttributeCount, 1, "onclipboardchange attribute should be called exactly once");
85+
assert_true(capturedEventTypes.includes("text/html"), "types should contain 'text/html'");
86+
assert_false(capturedEventTypes.includes("web txt/csv"), "types should not contain custom MIME type");
6887
}, "clipboardchange event is invoked using onclipboardchange attribute");
6988

89+
promise_test(async (test) => {
90+
let onClipboardChangeAttributeCount = 0;
91+
let capturedEventTypes = null;
92+
navigator.clipboard.onclipboardchange = (ev) => {
93+
onClipboardChangeAttributeCount++;
94+
capturedEventTypes = ev.types;
95+
};
96+
await triggerCopyToClipboard(["web txt/csv"]);
97+
assert_equals(onClipboardChangeAttributeCount, 1, "onclipboardchange attribute should be called exactly once");
98+
assert_equals(capturedEventTypes.length, 0, "clipboardchange event should have no types");
99+
}, "clipboardchange event is invoked even when only custom MIME types are set");
100+
70101
promise_test(async (test) => {
71102
let listenerCallCount = 0;
72103
function clipboardChangeListener() {
@@ -89,6 +120,55 @@
89120
assert_equals(listenerCallCount, 2, "Event listener should be called exactly once after re-adding");
90121
}, "clipboardchange event listener behavior when adding, removing, and re-adding");
91122

123+
promise_test(async (test) => {
124+
// https://w3c.github.io/clipboard-apis/#mandatory-data-types-x
125+
const standardTypes = [
126+
"text/plain",
127+
"text/html",
128+
"image/png",
129+
];
130+
const unsupportedTypes = [
131+
"web application/custom",
132+
"web web/proprietary",
133+
"web x-custom/type",
134+
"txt/json",
135+
"text/rtf",
136+
"image/svg+xml",
137+
"text/uri-list",
138+
];
139+
const allTypesToSet = [...standardTypes, ...unsupportedTypes];
140+
141+
let clipboardChangeEventCount = 0;
142+
let capturedEventTypes = null;
143+
144+
navigator.clipboard.addEventListener("clipboardchange", (ev) => {
145+
clipboardChangeEventCount++;
146+
capturedEventTypes = ev.types;
147+
});
148+
149+
await triggerCopyToClipboard(allTypesToSet);
150+
151+
assert_true(clipboardChangeEventCount == 1, "clipboardchange event should be invoked once");
152+
153+
// Check that types is a frozen array
154+
assert_true(Array.isArray(capturedEventTypes), "types should be an array");
155+
assert_true(Object.isFrozen(capturedEventTypes), "types should be frozen");
156+
157+
// Verify all standard types are included
158+
for (const type of standardTypes) {
159+
assert_true(capturedEventTypes.includes(type), `types should contain standard MIME type '${type}'`);
160+
}
161+
162+
// Verify custom types are filtered out
163+
for (const type of unsupportedTypes) {
164+
assert_false(capturedEventTypes.includes(type), `types should not contain custom MIME type '${type}'`);
165+
}
166+
167+
// Verify we have exactly the standard types and nothing else
168+
assert_equals(capturedEventTypes.length, standardTypes.length,
169+
"clipboardchange event types should contain exactly the standard MIME types");
170+
}, "clipboardchange event exposes all standard MIME types and filters non-standard ones");
171+
92172
promise_test(async (test) => {
93173
// Focus the document and acquire permission to write to the clipboard
94174
await test_driver.click(document.body);
@@ -97,6 +177,7 @@
97177
const iframe = document.getElementById('iframe');
98178

99179
let frameEventCount = 0;
180+
let capturedEventTypes = null;
100181
let focusEventFired = false;
101182
iframe.contentWindow.addEventListener("focus", () => {
102183
focusEventFired = true;
@@ -106,6 +187,7 @@
106187
iframe.contentWindow.navigator.clipboard.addEventListener("clipboardchange", () => {
107188
assert_true(focusEventFired, "focus event should fire before clipboardchange event");
108189
frameEventCount++;
190+
capturedEventTypes = event.types;
109191
});
110192

111193
// Ensure iFrame doesn't have the focus
@@ -114,14 +196,23 @@
114196

115197
// Trigger multiple clipboard changes
116198
await navigator.clipboard.writeText("Test text");
117-
await navigator.clipboard.writeText("Test text 2");
199+
200+
// Write HTML to clipboard to ensure the event captured only html and not txt
201+
await navigator.clipboard.write([
202+
new ClipboardItem({
203+
"text/html": new Blob(["<p>Test HTML</p>"], {type: "text/html"})
204+
})
205+
]);
118206
await waitForRender();
119207

120208
assert_equals(frameEventCount, 0, "iframe should not recieve any clipboardchange event yet");
121209

122210
iframe.focus();
123211
assert_true(iframe.contentWindow.document.hasFocus(), "iFrame should have focus");
124212
assert_equals(frameEventCount, 1, "iframe should receive event only 1 event after focus");
213+
assert_equals(capturedEventTypes.length, 1, "clipboardchange event should only have one type");
214+
assert_true(capturedEventTypes.includes("text/html"), "clipboardchange event should only have text/html type");
125215
}, "clipboardchange event should only fire in the focused context");
216+
126217
</script>
127218
</body>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<title>CSS Anchor Positioning: Crash with anchor in multicol</title>
3+
<link rel="help" href="https://issues.chromium.org/issues/324930388">
4+
<style>
5+
.cb {
6+
position: relative;
7+
border: 1px solid black;
8+
}
9+
.columns {
10+
column-count: 4;
11+
column-width: 100px;
12+
width: 320px;
13+
height: 100px;
14+
}
15+
.anchor {
16+
anchor-name: --a1;
17+
width: 100px;
18+
height: 90px;
19+
background: blue;
20+
}
21+
.target {
22+
position: absolute;
23+
position-anchor: --a1;
24+
width: 10px;
25+
height: 10px;
26+
background: purple;
27+
position-try-fallbacks: --pf1, --pf2;
28+
}
29+
@position-try --pf1 {
30+
right: 400px;
31+
bottom: 10px;
32+
}
33+
@position-try --pf2 {
34+
right: 40px;
35+
bottom: 30px;
36+
}
37+
</style>
38+
<body>
39+
PASS if no crash
40+
<div class="columns">
41+
<div class="cb">
42+
<div class="anchor"></div>
43+
<div class="target"></div>
44+
</div>
45+
</div>
46+
</body>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<title>CSS Anchor Positioning: Crash with anchor in multicol (inheritance)</title>
3+
<link rel="help" href="https://issues.chromium.org/issues/324930388">
4+
<style>
5+
.cb {
6+
position: relative;
7+
border: 1px solid black;
8+
}
9+
.columns {
10+
column-count: 4;
11+
column-width: 100px;
12+
width: 320px;
13+
height: 100px;
14+
}
15+
.anchor {
16+
anchor-name: --a1;
17+
width: 100px;
18+
height: 90px;
19+
background: blue;
20+
}
21+
.target {
22+
position: absolute;
23+
position-anchor: --a1;
24+
width: 10px;
25+
height: 10px;
26+
background: purple;
27+
position-try-fallbacks: --pf1, --pf2;
28+
}
29+
.child {
30+
position: fixed;
31+
right: inherit;
32+
bottom: inherit;
33+
}
34+
@position-try --pf1 {
35+
right: 400px;
36+
bottom: 10px;
37+
}
38+
@position-try --pf2 {
39+
right: 40px;
40+
bottom: 30px;
41+
}
42+
</style>
43+
<body>
44+
PASS if no crash
45+
<div class="columns">
46+
<div class="cb">
47+
<div class="anchor"></div>
48+
<div class="target">
49+
<div class="child"></div>
50+
</div>
51+
</div>
52+
</div>
53+
</body>

css/css-borders/tentative/corner-shape/corner-shape-render-fuzzy.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#corner-shaping">
55
<link rel="match" href="corner-shape-any-ref.html">
66
<meta name="fuzzy" content="maxDifference=0-200;totalPixels=0-550">
7-
<meta name="variant" content="?corner-shape=scoop&border-radius=20%&border-width=20px&border-top-color=rebeccapurple&border-bottom-color=blue">
87
<meta name="variant" content="?corner-shape=scoop&border-radius=20%&border-width=20px">
9-
<meta name="variant" content="?corner-top-left-shape=notch&border-radius=40px&border-width=10px&border-color=blue&border-left-color=yellow">
108
<meta name="variant" content="?corner-shape=superellipse(-2)&border-radius=20%&border-width=20px">
119
<meta name="variant" content="?corner-top-left-shape=bevel&border-radius=40px&border-width=10px">
1210
<meta name="variant" content="?corner-top-left-shape=scoop&corner-top-right-shape=scoop&border-radius=50%">
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<title>CSS Conditional: The ident() function in @container/container-name</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-values-5/#ident">
4+
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-rule">
5+
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-name">
6+
<script src="/resources/testharness.js"></script>
7+
<script src="/resources/testharnessreport.js"></script>
8+
<script src="/css/support/computed-testcommon.js"></script>
9+
<div id=target></div>
10+
<script>
11+
let actual_ident = 'ident("--myident" calc(42 * sign(1em - 1px)))';
12+
let expected_ident = '--myident42';
13+
14+
// https://drafts.csswg.org/css-conditional-5/#container-name
15+
test_computed_value('container-name', actual_ident, expected_ident);
16+
test_computed_value('container-name', `--c ${actual_ident}`,
17+
`--c ${expected_ident}`);
18+
19+
// https://drafts.csswg.org/css-conditional-5/#container-shorthand
20+
test_computed_value('container', actual_ident, expected_ident);
21+
test_computed_value('container', `--c ${actual_ident} / size`,
22+
`--c ${expected_ident} / size`);
23+
24+
</script>

css/css-exclusions/wrap-flow-001.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
<div id="log"></div>
4242

4343
<script type="text/javascript">
44-
setup({ explicit_done: true });
45-
44+
setup(() => {
45+
assert_implements(CSS.supports('wrap-flow', 'clear'), "'wrap-flow: clear'");
46+
}, {explicit_done: true});
4647
document.fonts.ready.then(() => {
4748
test(function() {assert_equals(checkLinePos("linesBelow",150,"top"), true)}, "Verify top of the 'linesBelow' span is positioned correctly");
4849
done();

css/css-exclusions/wrap-flow-002.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
<div id="log"></div>
4545

4646
<script type="text/javascript">
47-
setup({ explicit_done: true });
48-
47+
setup(() => {
48+
assert_implements(CSS.supports('wrap-flow', 'start'), "'wrap-flow: start'");
49+
}, {explicit_done: true});
4950
document.fonts.ready.then(() => {
5051
test(function() {assert_equals(checkLinePos("lineLeft1",36,"top"), true)}, "Verify top of the 'lineLeft1' span is positioned correctly");
5152
test(function() {assert_equals(checkLinePos("lineLeft2",48,"top"), true)}, "Verify top of the 'lineLeft2' span is positioned correctly");

css/css-exclusions/wrap-flow-003.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
<div id="log"></div>
4545

4646
<script type="text/javascript">
47-
setup({ explicit_done: true });
48-
47+
setup(() => {
48+
assert_implements(CSS.supports('wrap-flow', 'auto'), "'wrap-flow: auto'");
49+
}, {explicit_done: true});
4950
document.fonts.ready.then(() => {
5051
test(function() {assert_equals(checkLinePos("line1",216,"right"), true)}, "Verify right of the 'line1' span is positioned correctly");
5152
test(function() {assert_equals(checkLinePos("line2",192,"right"), true)}, "Verify right of the 'line2' span is positioned correctly");

0 commit comments

Comments
 (0)