Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Jan 3, 2025
2 parents 8a403a9 + 05a7df6 commit 05798ff
Show file tree
Hide file tree
Showing 427 changed files with 7,023 additions and 2,646 deletions.
16 changes: 16 additions & 0 deletions JSTests/microbenchmarks/array-prototype-with-contiguous.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function test(array, key, value) {
array.with(key, value);
}
noInline(test);

var array = [
{ value: 12 }, { value: 4 }, { value: 4 }, { value: 66 }, { value: 56 },
{ value: 44 }, { value: 44 }, { value: 38 }, { value: 65 }, { value: 89 },
{ value: 2 }, { value: 45 }, { value: 789 }, { value: 56 }, { value: 432 },
{ value: 677 }, { value: 2234 }, { value: 77 }, { value: 3457 }, { value: 133 },
{ value: 6544 }, { value: 76 }, { value: 17 }, { value: 322 }, { value: 34 }
];

for (let i = 0; i < 1e6; ++i) {
test(array, 14, { value: 34 });
}
10 changes: 10 additions & 0 deletions JSTests/microbenchmarks/array-prototype-with-double.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function test(array, key, value) {
array.with(key, value);
}
noInline(test);

var array = [12.5, 4.5, 4.5, 66.5, 56.5, 44.5, 44.5, 38.5, 65.5, 89.5, 2.5, 45.5, 789.5, 56.5, 432.5, 677.5, 2234.5, 77.5, 3457.5, 133.5, 6544.5, 76.5, 17.5, 322.5, 34.5];

for (let i = 0; i < 1e6; ++i) {
test(array, 14, 324.6);
}
10 changes: 10 additions & 0 deletions JSTests/microbenchmarks/array-prototype-with-int32.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function test(array, key, value) {
array.with(key, value);
}
noInline(test);

var array = [12, 4, 4, 66, 56, 44, 44, 38, 65, 89, 2, 45, 789, 56, 432, 677, 2234, 77, 3457, 133, 6544, 76, 17, 322, 34];

for (let i = 0; i < 1e6; ++i) {
test(array, 14, 324);
}
87 changes: 87 additions & 0 deletions JSTests/stress/array-prototype-with-fast.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
function sameArray(a, b) {
if (a.length !== b.length)
throw new Error(`Expected length ${b.length} but got ${a.length}`);
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
throw new Error(`Index ${i}: Expected ${b[i]} but got ${a[i]}`);
}
}
}

// ArrayWithInt32 * Int32
{
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const newArr = arr.with(2, 12);
sameArray(arr, [1, 2, 3, 4, 5, 6, 7, 8, 9]);
sameArray(newArr, [1, 2, 12, 4, 5, 6, 7, 8, 9]);
}

// ArrayWithInt32 * Double
{
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const newArr = arr.with(2, 1.2);
sameArray(arr, [1, 2, 3, 4, 5, 6, 7, 8, 9]);
sameArray(newArr, [1, 2, 1.2, 4, 5, 6, 7, 8, 9]);
}

// ArrayWithInt32 * Contiguous
{
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const obj = {};
const newArr = arr.with(2, obj);
sameArray(arr, [1, 2, 3, 4, 5, 6, 7, 8, 9]);
sameArray(newArr, [1, 2, obj, 4, 5, 6, 7, 8, 9]);
}

// ArrayWithDouble * Int32
{
const arr = [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9];
const newArr = arr.with(2, 12);
sameArray(arr, [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
sameArray(newArr, [1.1, 1.2, 12, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
}

// ArrayWithDouble * Double
{
const arr = [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9];
const newArr = arr.with(2, 12.1);
sameArray(arr, [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
sameArray(newArr, [1.1, 1.2, 12.1, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
}

// ArrayWithDouble * Other
{
const arr = [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9];
const obj = {};
const newArr = arr.with(2, obj);
sameArray(arr, [1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
sameArray(newArr, [1.1, 1.2, obj, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9]);
}

// ArrayWithContiguous * Int32
{
const shared = {};
const arr = [shared, shared, shared, shared, shared, shared, shared, shared, shared];
const newArr = arr.with(2, 12);
sameArray(arr, [shared, shared, shared, shared, shared, shared, shared, shared, shared]);
sameArray(newArr, [shared, shared, 12, shared, shared, shared, shared, shared, shared]);
}

// ArrayWithContiguous * Double
{
const shared = {};
const arr = [shared, shared, shared, shared, shared, shared, shared, shared, shared];
const newArr = arr.with(2, 12.1);
sameArray(arr, [shared, shared, shared, shared, shared, shared, shared, shared, shared]);
sameArray(newArr, [shared, shared, 12.1, shared, shared, shared, shared, shared, shared]);
}

// ArrayWithContiguous * Other
{
const shared = {};
const arr = [shared, shared, shared, shared, shared, shared, shared, shared, shared];
const obj2 = {};
const newArr = arr.with(2, obj2);
sameArray(arr, [shared, shared, shared, shared, shared, shared, shared, shared, shared]);
sameArray(newArr, [shared, shared, obj2, shared, shared, shared, shared, shared, shared]);
}
35 changes: 13 additions & 22 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -4934,17 +4934,10 @@ webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/backgr
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/background-size-document-root-vrl-004.html [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/background-size-document-root-vrl-006.html [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/background-size-document-root-vrl-008.html [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-043.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-047.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-048.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-050.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-054.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-055.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-056.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-058.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-060.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-062.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-063.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-slr-066.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-srl-057.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/block-flow-direction-vlr-018.xht [ ImageOnlyFailure ]
Expand All @@ -4962,15 +4955,9 @@ webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/inline
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/inline-block-alignment-slr-009.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/inline-table-alignment-003.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/inline-table-alignment-005.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-043.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-047.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-048.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-050.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-053.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-054.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-056.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-058.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-slr-060.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-srl-055.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-vlr-016.xht [ ImageOnlyFailure ]
webkit.org/b/209080 imported/w3c/web-platform-tests/css/css-writing-modes/line-box-direction-vrl-015.xht [ ImageOnlyFailure ]
Expand Down Expand Up @@ -5056,7 +5043,6 @@ imported/w3c/web-platform-tests/css/css-flexbox/gap-019.html [ ImageOnlyFailure
imported/w3c/web-platform-tests/css/css-flexbox/inline-flexbox-vertical-rl-image-flexitem-crash-print.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-size/col-wrap-013.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-flexbox/intrinsic-size/col-wrap-014.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-flexbox/percentage-padding-003.html [ ImageOnlyFailure ]

# text-combine-upright bugs
webkit.org/b/234704 imported/w3c/web-platform-tests/css/css-writing-modes/text-combine-upright-layout-rules-001.html [ ImageOnlyFailure ]
Expand Down Expand Up @@ -5237,6 +5223,18 @@ webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/inline-list.ht
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/inline-list-marker.html [ ImageOnlyFailure ]
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/inline-list-with-table-child.html [ ImageOnlyFailure ]
webkit.org/b/214457 imported/w3c/web-platform-tests/css/css-lists/list-item-definition.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-002.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-002.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-004.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-scope-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-scope-002.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-scope-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counters-scope-004.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/nested-marker-styling.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-list-item-2.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-list-item-slot-order.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-lists/counter-list-item.html [ ImageOnlyFailure ]
Expand Down Expand Up @@ -6188,13 +6186,7 @@ imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/js
imported/w3c/web-platform-tests/import-maps/acquiring/modulepreload.html [ Skip ]
imported/w3c/web-platform-tests/import-maps/acquiring/modulepreload-link-header.html [ Skip ]

imported/w3c/web-platform-tests/import-maps/dynamic-integrity.html [ DumpJSConsoleLogInStdErr ]
imported/w3c/web-platform-tests/import-maps/static-integrity.html [ DumpJSConsoleLogInStdErr ]
imported/w3c/web-platform-tests/import-maps/no-referencing-script-integrity.html [ DumpJSConsoleLogInStdErr ]
imported/w3c/web-platform-tests/import-maps/nonimport-integrity.html [ DumpJSConsoleLogInStdErr ]

# These tests have been timing out since their import.
imported/w3c/web-platform-tests/import-maps/data-driven [ Skip ]
imported/w3c/web-platform-tests/import-maps/ [ DumpJSConsoleLogInStdErr ]

# Imported tests that are timing out because the feature is not yet implemented.
imported/w3c/web-platform-tests/content-security-policy/report-hash [ Skip ]
Expand Down Expand Up @@ -7117,7 +7109,6 @@ imported/w3c/web-platform-tests/css/css-break/float-015.tentative.html [ ImageOn
imported/w3c/web-platform-tests/css/css-break/float-016.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/float-017.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/forced-break-at-fragmentainer-start-000.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/form-control.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/fragmented-autowidth-fc-root-beside-floats.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/inline-with-float-004.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-break/line-after-unbreakable-float-after-padding.html [ ImageOnlyFailure ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ PASS: axCombobox.selectedChildren().length === 0
Setting activedescendant to 1 and selected to 2:
notification: AXActiveElementChanged
activeElement: item1
selectedChildren: [ item1 ]
notification: AXSelectedChildrenChanged
activeElement: item1
selectedChildren: [ item1 ]
Setting activedescendant to 2:
notification: AXActiveElementChanged
activeElement: item2
selectedChildren: [ item2 ]
Setting activedescendant to 3:
notification: AXActiveElementChanged
activeElement: item3
selectedChildren: [ item3 ]
Selecting 3:
notification: AXSelectedChildrenChanged
activeElement: item3
selectedChildren: [ item3 ]

PASS successfullyParsed is true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@
var activeElementChangeCount = 0;
var selectedChildrenChangeCount = 0;
accessibilityController.addNotificationListener((target, notification) => {
if (notification == "AXActiveElementChanged" || notification == "AXSelectedChildrenChanged") {
if (notification === "AXActiveElementChanged") {
output += `notification: ${notification}\n`;
logActiveElementAndSelectedChildren(axCombobox);
notification == "AXActiveElementChanged" ? ++activeElementChangeCount : ++selectedChildrenChangeCount;
output += ` activeElement: ${axCombobox.activeElement.domIdentifier}\n`;
++activeElementChangeCount;
}

if (notification == "AXSelectedChildrenChanged") {
output += `notification: ${notification}\n`;
outputSelectedChildren(axCombobox);
++selectedChildrenChangeCount;
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ On macOS, a combobox should map aria-activedescendant to AXSelectedChildren.
PASS: combobox.selectedChildrenCount === 1
PASS: activeDescendant.role === 'AXRole: AXGroup'
PASS: activeDescendant.title === 'AXTitle: item2'
PASS: combobox.selectedChildAtIndex(0).title === 'AXTitle: item1'

PASS successfullyParsed is true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,29 @@

<input type="text" role="combobox" id="combobox" aria-label="Combobox" aria-activedescendant="item2">
<div role="list">
<div role="listitem">item1</div>
<div role="listitem" id="item1" aria-label="item1">item1</div>
<div role="listitem" id="item2" aria-label="item2">item2</div>
</div>

<script>
var output = "On macOS, a combobox should map aria-activedescendant to AXSelectedChildren.\n";

if (window.accessibilityController) {
window.jsTestIsAsync = true;

var combobox = accessibilityController.accessibleElementById("combobox");
output += expect("combobox.selectedChildrenCount", "1");
activeDescendant = combobox.selectedChildAtIndex(0);
output += expect("activeDescendant.role", "'AXRole: AXGroup'");
output += expect("activeDescendant.title", "'AXTitle: item2'");
debug(output);

document.getElementById("combobox").setAttribute("aria-activedescendant", "item1");
setTimeout(async function() {
output += await expectAsync("combobox.selectedChildAtIndex(0).title", "'AXTitle: item1'");

debug(output);
finishJSTest();
}, 0);
}
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ PASS: axList.selectedChildren().length === 0
Setting activedescendant to 1 and selected to 2:
notification: AXActiveElementChanged
activeElement: item1
selectedChildren: [ item2 ]
notification: AXSelectedChildrenChanged
activeElement: item1
selectedChildren: [ item2 ]
Setting activedescendant to 2:
notification: AXActiveElementChanged
activeElement: item2
selectedChildren: [ item2 ]
Setting activedescendant to 3:
notification: AXActiveElementChanged
activeElement: item3
selectedChildren: [ item2 ]
Selecting 3:
notification: AXSelectedChildrenChanged
activeElement: item3
selectedChildren: [ item2, item3 ]

PASS successfullyParsed is true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@
var activeElementChangeCount = 0;
var selectedChildrenChangeCount = 0;
axList.addNotificationListener((notification) => {
if (notification == "AXActiveElementChanged" || notification == "AXSelectedChildrenChanged") {
if (notification === "AXActiveElementChanged") {
output += `notification: ${notification}\n`;
logActiveElementAndSelectedChildren(axList);
notification == "AXActiveElementChanged" ? ++activeElementChangeCount : ++selectedChildrenChangeCount;
output += ` activeElement: ${axList.activeElement.domIdentifier}\n`;
++activeElementChangeCount;
}

if (notification == "AXSelectedChildrenChanged") {
output += `notification: ${notification}\n`;
outputSelectedChildren(axList);
++selectedChildrenChangeCount;
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ PASS: axList.selectedChildren().length === 0
Setting activedescendant to 1 and selected to 2:
notification: AXActiveElementChanged
activeElement: item1
selectedChildren: [ item2 ]
notification: AXSelectedChildrenChanged
activeElement: item1
selectedChildren: [ item2 ]
Setting activedescendant to 2:
notification: AXActiveElementChanged
activeElement: item2
selectedChildren: [ item2 ]
Setting activedescendant to 3:
notification: AXActiveElementChanged
activeElement: item3
selectedChildren: [ item2 ]
Selecting 3:
notification: AXSelectedChildrenChanged
activeElement: item3
selectedChildren: [ item2, item3 ]

PASS successfullyParsed is true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@
var activeElementChangeCount = 0;
var selectedChildrenChangeCount = 0;
axList.addNotificationListener((notification) => {
if (notification == "AXActiveElementChanged" || notification == "AXSelectedChildrenChanged") {
if (notification === "AXActiveElementChanged") {
output += `notification: ${notification}\n`;
logActiveElementAndSelectedChildren(axList);
notification == "AXActiveElementChanged" ? ++activeElementChangeCount : ++selectedChildrenChangeCount;
output += ` activeElement: ${axList.activeElement.domIdentifier}\n`;
++activeElementChangeCount;
}

if (notification == "AXSelectedChildrenChanged") {
output += `notification: ${notification}\n`;
outputSelectedChildren(axList);
++selectedChildrenChangeCount;
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To manually run this test, double click inside the red box below and verify that no selection appears.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS getSelection().type is not 'Range'
PASS successfullyParsed is true

TEST COMPLETE


Loading

0 comments on commit 05798ff

Please sign in to comment.