webcomponents / custom-elements-everywhere

Custom Element + Framework Interoperability Tests.
https://custom-elements-everywhere.com
Other
1.19k stars 103 forks source link

Add tests for ability to work with customized built-ins #376

Open franktopel opened 5 years ago

franktopel commented 5 years ago

Check if frameworks are able to recognize the special meaning of the is=""-attribute, and that it cannot be handled like a traditional attribute when it comes to dynamic element creation.

robdodson commented 5 years ago

@franktopel hm that's interesting.

I guess a strawman proposal would be to create an element like <a is="x-link"> and verifying that it has both the properties associated with a regular link, as well as any properties added by the type extension.

jonyc commented 5 years ago

It seems Angular still does not handle the is="" attribute correctly when rendering: https://github.com/angular/angular/issues/6827#issuecomment-475379813.

Maybe the test could include something like comparing the innerText of the extended button in the following demos: Angular (not working): https://stackblitz.com/edit/angular-dginkc React (working): https://stackblitz.com/edit/react-saktyo

MichaelBrimer commented 4 years ago

And it is still not working in Angular, I have tested https://stackblitz.com/edit/angular-dginkc with Angular version 8.2.14 and Angular version 9.0.0-rc.7. It would be nice to have test for this and it would also be more fair for React, since at the moment the first impression is that it a100% works in Angular but not in React. Btw I work in Angular.

robdodson commented 4 years ago

I think this would be a tricky test to add because the is="" attribute is not and likely will never be supported in Safari.

Kim-Andersen commented 4 years ago

@rob

I think this would be a tricky test to add because the is="" attribute is not and likely will never be supported in Safari.

What makes you think Safari likely will never support this?

Also, does that mean that you only consider scenarios that are well supported by all major browsers?

robdodson commented 4 years ago

What makes you think Safari likely will never support this?

This comment from Safari is the best explanation I could find: https://github.com/w3c/webcomponents/issues/509#issuecomment-230700060

Also, does that mean that you only consider scenarios that are well supported by all major browsers?

Yeah I think so. I feel weird asking a framework to do work to support a feature which another browser actively opposes.

I think if all the browsers agreed to a feature, but just hadn't gotten around to implementing it yet, that would be a different scenario and it would make sense to have tests then.