On Tue Apr 9 22:57:09 2024 +0000, Jacek Caban wrote:
Yeah, MSHTML bindings make it a lot more interesting. In fact, I think we should concentrate on getting that right first. If we have a good enough solution for arbitrary properties, it should be good enough for typed arrays too. The same is not true the other way around. If we introduce an interface with such capabilities, it sounds to me like it should be able to handle builtin MSHTML properties too. Should we plan for that to be the same interface?
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.