-
Notifications
You must be signed in to change notification settings - Fork 28
co19_2 html tests should not use document.registerElement #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We may want to remove some of these tests or switch to run the tests with the web_components polyfill that was used for browsers that didn't implement the API before it was spec-ed. For context, CustomElements were implemented for Dart when the spec was at version 0.5. It was later noticed that the newer APIs required defining ES6 classes in a way that was not easily compatible with Dart, so we are not fully supporting the new API in Dart at this time. I am not sure, but I don't believe |
Here is the issue describing our decision on not adding support for custom-elements v1 (dart-lang/sdk#27445) |
I'm trying to check if void define (
String name,
Object constructor,
[Map options]
) The second argument is a constructor. But you cannot tear-off a constructor in Dart. Closure also doesn't work class Foo extends HtmlElement {
Foo.created() : super.created();
...
}
}
main() {
var tag = 'x-foo';
window.customElements.define(tag, () => new Foo.created()); // Error in JS. 'execute 'define' on 'CustomElementRegistry': The callback provided as parameter 2 is not a function.'
...
} @sigmundch @srujzs , could you, please, advice how to use |
I'll toy around to see if there's an alternative to this or if we should just remove tests if the functionality doesn't make sense anymore like @sigmundch suggested. I'll have to get back to you on this one. |
@srujzs any update on this? |
I haven't spent much time on this, but both you and @sigmundch is right that we can't supply a constructor here for |
Spent a little more time on this, but I don't think there's any way to use |
@srujzs thank you! I'll rewrite these tests |
@srujzs I don't see that |
I think that's just stale documentation at this point and For the above tests, if the behavior that is being tested does not need to rely on custom elements to work (I can't really tell from a quick inspection), it may be still useful to have those tests but use something other than custom elements. I suppose one other alternative is using |
…art-lang#1382) Authored by @sgrekhov. Removes two tests that do not serve the stated purpose.
2022-08-04 [email protected] dart-lang/co19#993. FFI tests refactored and improved (dart-lang/co19#1387) 2022-08-04 [email protected] dart-lang/co19#993. [FFI] Missed tests added for some new types (dart-lang/co19#1386) 2022-08-03 [email protected] Fixes dart-lang/co19#1129. Don't expect any proxy routine in case of DIRECT connection (dart-lang/co19#1383) 2022-08-03 [email protected] dart-lang/co19#993. [FFI] Missed tests added for some new types (dart-lang/co19#1384) 2022-07-29 [email protected] dart-lang/co19#673. IFrame tests that don't actually test IFrame removed (dart-lang/co19#1382) 2022-07-29 [email protected] dart-lang/co19#1363. Some delays removed or reduced (dart-lang/co19#1380) 2022-07-29 [email protected] dart-lang/co19#1363 Async `for-in` test updated according to the current specification (dart-lang/co19#1379) 2022-07-27 [email protected] dart-lang/co19#1363. Yield each tests updated to the current specification (dart-lang/co19#1374) 2022-07-27 [email protected] Fixes dart-lang/co19#1375. Add test for final variable in a for-in loop (dart-lang/co19#1378) 2022-07-25 [email protected] dart-lang/co19#1363. Tests for yield updated to the current specification (dart-lang/co19#1370) Change-Id: Ie92f4b2157284777177012320883247411e214fa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254140 Reviewed-by: Erik Ernst <[email protected]> Commit-Queue: Alexander Thomas <[email protected]>
All of these tests use deprecated API and were removed as part of #1405. Closed |
2022-09-30 [email protected] Fixes dart-lang/co19#1478. Failures of the new co19_2 roll fixed. (dart-lang/co19#1480) 2022-09-28 [email protected] dart-lang/co19#195. RawDatagramSocket tests fixed (dart-lang/co19#1465) 2022-08-31 [email protected] dart-lang/co19#1405. Don't use deprecated API in co19_2 tests (dart-lang/co19#1409) 2022-08-31 [email protected] dart-lang/co19#1405. co19_2. BytesBuilder tests moved from dart:io to dart:typed_data (dart-lang/co19#1411) 2022-08-23 [email protected] dart-lang/co19#1394. Add missing compile-error (dart-lang/co19#1397) 2022-08-03 [email protected] dart-lang/co19#1129. In case of DIRECT connection don't expect any proxy routine called (dart-lang/co19#1385) 2022-07-29 [email protected] dart-lang/co19#673. IFrame tests that don't actually test IFrame removed (dart-lang/co19#1381) 2022-07-27 [email protected] Fixes dart-lang/co19#1376. Broken co19_2 test fixed (dart-lang/co19#1377) 2022-07-12 [email protected] Fixes dart-lang/co19#1356. Add analyzer errors on references to not included library parts (dart-lang/co19#1359) 2022-07-05 [email protected] Fixes dart-lang/co19#1309. Update error expectations according to the current behavior (dart-lang/co19#1351) 2022-07-04 [email protected] Fixes dart-lang/co19#1343. Use correct 'part' and 'part of' directives (dart-lang/co19#1350) 2022-07-01 [email protected] Fixes dart-lang/co19#1313. Pre-nnbd tests for focus_A01_t01 and blur_A01_t01 updated to their version in master (dart-lang/co19#1345) Change-Id: Iec8355f25b2c87b3dd83d84d2bab95812bbd0686 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262204 Reviewed-by: Alexander Thomas <[email protected]> Commit-Queue: Alexander Thomas <[email protected]>
document.registerElement
(ordocument.register
in thedart:html
library) has been deprecated and removed in Chrome 80. In order to replicate the same behavior,window.customElements.define
is preferred instead. See https://developer.mozilla.org/en-US/docs/Web/API/Document/registerElement for more details.This currently affects the following tests:
co19_2/LibTest/html/Element/attributeChanged_A01_t01
co19_2/LibTest/html/Element/enteredView_A01_t01
co19_2/LibTest/html/Element/leftView_A01_t01
co19_2/LibTest/html/Element/tagName_A01_t03
co19_2/LibTest/html/IFrameElement/IFrameElement.created_A01_t01
co19_2/LibTest/html/IFrameElement/tagName_A01_t03
The error looks like:
The text was updated successfully, but these errors were encountered: