10:14 | <judge_sour_dough_bread> | judge_sour_dough_bread: seems right, you need to have an HTMLElement -- and not a known HTML element like span , fieldset , button etc -- because I wanted a "mix-in" component, one that can work regardless what element is upgraded to its functionality. Which is why I was trying to use the is attribute, but turns out that in practice (correct me if I am wrong about this, please) one either uses is attribute on a known HTML element, to upgrade to a custom element that specifies extends , or one that uses the custom element name (e.g. foo-bar ) for a component that does not use extends . So, in effect, "mix-ins", contrary to perhaps their general principle, cannot be used without extends ? |
14:17 | <Noam Rosenthal> | Yea I don’t think you can implement a mixin in this particular way, but there might be other forums with more ideas around this (this forum is for working on the standards themselves) |
14:58 | <annevk> | Luke Warlow: feel free to reverse dupe yourself in the future, especially if it's an area you're working on. I think you should be able to do that given you're in the triage team. |
14:59 | <Luke Warlow> | Okay good to note, forgot I had those permissions. |
16:49 | <zcorpan> | annevk: https://github.com/whatwg/html/issues/10077#issuecomment-1997383562 |
18:22 | <Dominic Farolino> | Suppose you want a web API to be able to take as an argument, an instance of a JS class that has some methods, and you want the API to be able to call those methods on the input instance. Do you have to define the param as type any and then just GetMethod(obj, 'method1') , ....? and pull those methods off and store them separately as callback functions, for later invocation? |
18:23 | <Dominic Farolino> | And does that give you the right this value (i.e., the instance of the class w/ the methods) when you're invoking the callbacks later on? I'm pretty sure it doesn't |
18:27 | <annevk> | Is this about Observer? There's an issue discussing that I thought. |
18:27 | <Dominic Farolino> | This is not |
18:27 | <annevk> | Thanks, will hopefully have some details tomorrow. |
18:27 | <Dominic Farolino> | I found https://webidl.spec.whatwg.org/#dfn-callback-this-value though, which is what I'm looking for |
18:27 | <Dominic Farolino> | This is about shared storage worklets |
18:28 | <Dominic Farolino> | So it turns out https://html.spec.whatwg.org/C#fakeworkletglobalscope-process is basically what I was looking for-ish i think |
18:28 | <TabAtkins> | If it's an arbitrary JS class (not an IDL interface), then generally we'll treat it as a dictionary, I think? And pull the methods off when initially passed, stashing them for later calling. |
18:29 | <Dominic Farolino> | That, plus storing the original instance for later use as the callback this value, I guess? |
18:29 | <annevk> | Worklets was the other thing I thought of that might have something like this, yeah. |
18:30 | <annevk> | The one wrinkle here is that this is what interface callback is, essentially, but we generally decided we didn't want that. But maybe we do, sometimes. |
18:33 | <Dominic Farolino> | Heh, yeah but for as long as that scary note above callback interfaces exists, getting away with normal callbacks feels less controversial |
18:55 | <annevk> | These are not normal callbacks though. You're using object here presumably in IDL. That's even more magical. |
22:09 | <snek> | is the parent document of an iframe supposed to lose focus when the iframe is focused? seeing disagreement among browsers |
23:55 | <Domenic> | That, plus storing the original instance for later use as the callback this value, I guess? |
23:57 | <Domenic> | https://github.com/whatwg/webidl/issues/701 is the canonical issue and we did discuss something very similar at https://github.com/WICG/observable/issues/71#issuecomment-1804956795 |