On Wed Apr 10 15:44:56 2024 +0000, Gabriel Ivăncescu wrote:
Yeah, I usually kept this in mind when designing this interface per prop. They don't necessarily have to be mshtml objects, if jscript had them itself, we'd need the same thing; i.e. it's not an interoperability issue, but rather object-specific. Anyway, for those objects, my plan was to override the dispex props too with another vtbl. This would change "get_prop_vtbl" to apply to *all* props of course; I haven't done that in this MR because I didn't want to complicate it, but it is doable for the most part. Most objects would just return the dispex prop vtbl for dispex props, but those objects would return a different vtbl that first overrides certain operations (for the async props), and then forwards to the dispex props. This way we avoid special checks for those objects. Of course, indexed props would remain the same as in this MR. Note that the "prop_desc" and the per-property vtbl isn't really an object owning an actual reference, it's just to simplify the code (we don't even hold ref to the object). It's basically just saying how the prop can operate. Do you still want to move them to the object vtbl? Doing so would require adding checks everywhere where it's used for the dispex props, unless I make them mandatory, and then fill most objects with the dispex methods. The latter might keep the caller side clean.
This ultimately is an interop issue with MSHML. We will need an interface that exposes more dispex capabilities by this MR (by allowing using arbitrary names) outside jscript. I imagine that internally, in jscript, we will have a similar interface on dispex side. For jscript objects, they would operate on that internal interface. For external (MSHTML) object, those could be routed on `builtin_info_t` layer to the public interface (or something like that). Is that right? This means that those two interfaces need to be compatible.
It's hard to comment on slices of the design without a big picture. For the big picture, the most important thing seems to be how the interop interface will look like. Could you draft the interface that we could discus it? Just a (not necessarily even compiling) header or IDL snippet should be enough for now.