Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=249756 Reviewed by Chris Dumez. Resync web platform tests for custom elements as of b8cffc4. * LayoutTests/imported/w3c/web-platform-tests/common/gc.js: Added. (self.garbageCollect.async if): (self.garbageCollect.gcRec): (self.garbageCollect): * LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry-constructor-and-callbacks-are-held-strongly.html: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/ElementInternals-accessibility-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-accessibility-expected.txt. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/ElementInternals-accessibility.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-accessibility.html. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-target-element-is-held-strongly.html: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/AriaMixin-element-attributes-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/AriaMixin-element-attributes.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/AriaMixin-string-attributes-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/AriaMixin-string-attributes.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/CustomElementRegistry-constructor.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/CustomElementRegistry-constructor.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/CustomElementRegistry-multi-register.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/CustomElementRegistry-multi-register.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-init-registry.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-init-registry.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/w3c-import.log: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/when-defined-reentry-crash.html: Added. Canonical link: https://commits.webkit.org/258252@main
- Loading branch information
Showing
20 changed files
with
458 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Does a best-effort attempt at invoking garbage collection. Attempts to use | ||
* the standardized `TestUtils.gc()` function, but falls back to other | ||
* environment-specific nonstandard functions, with a final result of just | ||
* creating a lot of garbage (in which case you will get a console warning). | ||
* | ||
* This should generally only be used to attempt to trigger bugs and crashes | ||
* inside tests, i.e. cases where if garbage collection happened, then this | ||
* should not trigger some misbehavior. You cannot rely on garbage collection | ||
* successfully trigger, or that any particular unreachable object will be | ||
* collected. | ||
* | ||
* @returns {Promise<undefined>} A promise you should await to ensure garbage | ||
* collection has had a chance to complete. | ||
*/ | ||
self.garbageCollect = async () => { | ||
// https://testutils.spec.whatwg.org/#the-testutils-namespace | ||
if (self.TestUtils?.gc) { | ||
return TestUtils.gc(); | ||
} | ||
|
||
// Use --expose_gc for V8 (and Node.js) | ||
// to pass this flag at chrome launch use: --js-flags="--expose-gc" | ||
// Exposed in SpiderMonkey shell as well | ||
if (self.gc) { | ||
return self.gc(); | ||
} | ||
|
||
// Present in some WebKit development environments | ||
if (self.GCController) { | ||
return GCController.collect(); | ||
} | ||
|
||
console.warn( | ||
'Tests are running without the ability to do manual garbage collection. ' + | ||
'They will still work, but coverage will be suboptimal.'); | ||
|
||
for (var i = 0; i < 1000; i++) { | ||
gcRec(10); | ||
} | ||
|
||
function gcRec(n) { | ||
if (n < 1) { | ||
return {}; | ||
} | ||
|
||
let temp = { i: "ab" + i + i / 100000 }; | ||
temp += "foo"; | ||
|
||
gcRec(n - 1); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...3c/web-platform-tests/custom-elements/reactions/AriaMixin-element-attributes-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
PASS ariaActiveDescendantElement in Element must enqueue an attributeChanged reaction when adding aria-activedescendant content attribute | ||
PASS ariaActiveDescendantElement in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaControlsElements in Element must enqueue an attributeChanged reaction when adding aria-controls content attribute | ||
PASS ariaControlsElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaDescribedByElements in Element must enqueue an attributeChanged reaction when adding aria-describedby content attribute | ||
PASS ariaDescribedByElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaDetailsElements in Element must enqueue an attributeChanged reaction when adding aria-details content attribute | ||
PASS ariaDetailsElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
FAIL ariaErrorMessageElement in Element must enqueue an attributeChanged reaction when adding aria-errormessage content attribute assert_array_equals: lengths differ, expected array ["attributeChanged"] length 1, got [] length 0 | ||
FAIL ariaErrorMessageElement in Element must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected array ["constructed", "connected", "attributeChanged"] length 3, got ["constructed", "connected"] length 2 | ||
PASS ariaFlowToElements in Element must enqueue an attributeChanged reaction when adding aria-flowto content attribute | ||
PASS ariaFlowToElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaLabelledByElements in Element must enqueue an attributeChanged reaction when adding aria-labelledby content attribute | ||
PASS ariaLabelledByElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaOwnsElements in Element must enqueue an attributeChanged reaction when adding aria-owns content attribute | ||
PASS ariaOwnsElements in Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
|
65 changes: 65 additions & 0 deletions
65
...ported/w3c/web-platform-tests/custom-elements/reactions/AriaMixin-element-attributes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Custom Elements: CEReactions on Element interface</title> | ||
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> | ||
<meta name="assert" content="Element attributes of AriaAttributes interface must have CEReactions"> | ||
<meta name="help" content="https://dom.spec.whatwg.org/#element"> | ||
<meta name="help" content="https://w3c.github.io/DOM-Parsing/"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../resources/custom-elements-helpers.js"></script> | ||
<script src="./resources/reactions.js"></script> | ||
</head> | ||
<body> | ||
<div id="log"></div> | ||
<div id="parentElement"></div> | ||
<script> | ||
|
||
function testElementReflectAttribute(jsAttributeName, contentAttributeName, validValue1, validValue2, name, getParentElement) { | ||
test(function () { | ||
let element = define_new_custom_element([contentAttributeName]); | ||
let instance = document.createElement(element.name); | ||
assert_array_equals(element.takeLog().types(), ['constructed']); | ||
parentElement.appendChild(instance); | ||
assert_array_equals(element.takeLog().types(), ['connected']); | ||
instance[jsAttributeName] = validValue1; | ||
let logEntries = element.takeLog(); | ||
assert_array_equals(logEntries.types(), ['attributeChanged']); | ||
|
||
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: null, newValue: "", namespace: null}); | ||
}, name + ' must enqueue an attributeChanged reaction when adding ' + contentAttributeName + ' content attribute'); | ||
|
||
test(function () { | ||
let element = define_new_custom_element([contentAttributeName]); | ||
let instance = document.createElement(element.name); | ||
parentElement.appendChild(instance); | ||
instance[jsAttributeName] = validValue1; | ||
assert_array_equals(element.takeLog().types(), ['constructed', 'connected', 'attributeChanged']); | ||
instance[jsAttributeName] = validValue2; | ||
var logEntries = element.takeLog(); | ||
assert_array_equals(logEntries.types(), ['attributeChanged']); | ||
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: "", newValue: "", namespace: null}); | ||
}, name + ' must enqueue an attributeChanged reaction when replacing an existing attribute'); | ||
} | ||
|
||
const dummy1 = document.createElement('div'); | ||
dummy1.id = 'dummy1'; | ||
document.body.appendChild(dummy1); | ||
|
||
const dummy2 = document.createElement('div'); | ||
dummy2.id = 'dummy2'; | ||
document.body.appendChild(dummy2); | ||
|
||
testElementReflectAttribute('ariaActiveDescendantElement', 'aria-activedescendant', dummy1, dummy2, 'ariaActiveDescendantElement in Element'); | ||
testElementReflectAttribute('ariaControlsElements', 'aria-controls', [dummy1], [dummy2], 'ariaControlsElements in Element'); | ||
testElementReflectAttribute('ariaDescribedByElements', 'aria-describedby', [dummy1], [dummy2], 'ariaDescribedByElements in Element'); | ||
testElementReflectAttribute('ariaDetailsElements', 'aria-details', [dummy1], [dummy2], 'ariaDetailsElements in Element'); | ||
testElementReflectAttribute('ariaErrorMessageElement', 'aria-errormessage', dummy1, dummy2, 'ariaErrorMessageElement in Element'); | ||
testElementReflectAttribute('ariaFlowToElements', 'aria-flowto', [dummy1], [dummy2], 'ariaFlowToElements in Element'); | ||
testElementReflectAttribute('ariaLabelledByElements', 'aria-labelledby', [dummy1], [dummy2], 'ariaLabelledByElements in Element') | ||
testElementReflectAttribute('ariaOwnsElements', 'aria-owns', [dummy1], [dummy2], 'ariaOwnsElements in Element') | ||
|
||
</script> | ||
</body> | ||
</html> |
78 changes: 78 additions & 0 deletions
78
...w3c/web-platform-tests/custom-elements/reactions/AriaMixin-string-attributes-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|
||
PASS ariaAtomic on Element must enqueue an attributeChanged reaction when adding aria-atomic content attribute | ||
PASS ariaAtomic on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaAutoComplete on Element must enqueue an attributeChanged reaction when adding aria-autocomplete content attribute | ||
PASS ariaAutoComplete on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaBusy on Element must enqueue an attributeChanged reaction when adding aria-busy content attribute | ||
PASS ariaBusy on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaChecked on Element must enqueue an attributeChanged reaction when adding aria-checked content attribute | ||
PASS ariaChecked on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaColCount on Element must enqueue an attributeChanged reaction when adding aria-colcount content attribute | ||
PASS ariaColCount on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaColIndex on Element must enqueue an attributeChanged reaction when adding aria-colindex content attribute | ||
PASS ariaColIndex on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaColSpan on Element must enqueue an attributeChanged reaction when adding aria-colspan content attribute | ||
PASS ariaColSpan on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaCurrent on Element must enqueue an attributeChanged reaction when adding aria-current content attribute | ||
PASS ariaCurrent on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaDisabled on Element must enqueue an attributeChanged reaction when adding aria-disabled content attribute | ||
PASS ariaDisabled on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaExpanded on Element must enqueue an attributeChanged reaction when adding aria-expanded content attribute | ||
PASS ariaExpanded on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaHasPopup on Element must enqueue an attributeChanged reaction when adding aria-haspopup content attribute | ||
PASS ariaHasPopup on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaHidden on Element must enqueue an attributeChanged reaction when adding aria-hidden content attribute | ||
PASS ariaHidden on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaInvalid on Element must enqueue an attributeChanged reaction when adding aria-invalid content attribute | ||
PASS ariaInvalid on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaKeyShortcuts on Element must enqueue an attributeChanged reaction when adding aria-keyshortcuts content attribute | ||
PASS ariaKeyShortcuts on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaLabel on Element must enqueue an attributeChanged reaction when adding aria-label content attribute | ||
PASS ariaLabel on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaLevel on Element must enqueue an attributeChanged reaction when adding aria-level content attribute | ||
PASS ariaLevel on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaLive on Element must enqueue an attributeChanged reaction when adding aria-live content attribute | ||
PASS ariaLive on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaModal on Element must enqueue an attributeChanged reaction when adding aria-modal content attribute | ||
PASS ariaModal on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaMultiLine on Element must enqueue an attributeChanged reaction when adding aria-multiline content attribute | ||
PASS ariaMultiLine on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaMultiSelectable on Element must enqueue an attributeChanged reaction when adding aria-multiselectable content attribute | ||
PASS ariaMultiSelectable on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaOrientation on Element must enqueue an attributeChanged reaction when adding aria-orientation content attribute | ||
PASS ariaOrientation on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaPlaceholder on Element must enqueue an attributeChanged reaction when adding aria-placeholder content attribute | ||
PASS ariaPlaceholder on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaPosInSet on Element must enqueue an attributeChanged reaction when adding aria-posinset content attribute | ||
PASS ariaPosInSet on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaPressed on Element must enqueue an attributeChanged reaction when adding aria-pressed content attribute | ||
PASS ariaPressed on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaReadOnly on Element must enqueue an attributeChanged reaction when adding aria-readonly content attribute | ||
PASS ariaReadOnly on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRelevant on Element must enqueue an attributeChanged reaction when adding aria-relevant content attribute | ||
PASS ariaRelevant on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRequired on Element must enqueue an attributeChanged reaction when adding aria-required content attribute | ||
PASS ariaRequired on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRoleDescription on Element must enqueue an attributeChanged reaction when adding aria-roledescription content attribute | ||
PASS ariaRoleDescription on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRowCount on Element must enqueue an attributeChanged reaction when adding aria-rowcount content attribute | ||
PASS ariaRowCount on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRowIndex on Element must enqueue an attributeChanged reaction when adding aria-rowindex content attribute | ||
PASS ariaRowIndex on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaRowSpan on Element must enqueue an attributeChanged reaction when adding aria-rowspan content attribute | ||
PASS ariaRowSpan on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaSelected on Element must enqueue an attributeChanged reaction when adding aria-selected content attribute | ||
PASS ariaSelected on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaSetSize on Element must enqueue an attributeChanged reaction when adding aria-setsize content attribute | ||
PASS ariaSetSize on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaSort on Element must enqueue an attributeChanged reaction when adding aria-sort content attribute | ||
PASS ariaSort on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaValueMax on Element must enqueue an attributeChanged reaction when adding aria-valuemax content attribute | ||
PASS ariaValueMax on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaValueMin on Element must enqueue an attributeChanged reaction when adding aria-valuemin content attribute | ||
PASS ariaValueMin on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaValueNow on Element must enqueue an attributeChanged reaction when adding aria-valuenow content attribute | ||
PASS ariaValueNow on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
PASS ariaValueText on Element must enqueue an attributeChanged reaction when adding aria-valuetext content attribute | ||
PASS ariaValueText on Element must enqueue an attributeChanged reaction when replacing an existing attribute | ||
|
Oops, something went wrong.