On Mon May 13 09:57:45 2024 +0000, Jacek Caban wrote:
Ah, right, shadow dispids would take care of it. The `PROP_PROXY` thing is confusing to me, I'm not yet sure what to think about it. I thought that the point of this MR is to allow external properties to not need `dispex_prop_t` (just like jscript internal indexed props). I can see how some things are easier this way (through I feel like the same would be true for other parts if we didn't allocate those). It may be useful to allow "shadowing" properties for some cases, but for that a flag in `dispex_prop_t` could be enough, I'm not sure it needs a new property type. Did you consider something like that? Is it not feasible?
We have to use `dispex_prop_t` because we need the name and DISPID for them in this case, they're not just indices.
PROP_PROXY is simply a prop that delegates to mshtml side, it's very similar to PROP_BUILTIN except the "builtin" here is on mshtml, so we just store the necessary info to access it (mshtml DISPID, basically). Note that it is *not* for functions or accessors, it's for the other props (custom props for instance), just like PROP_BUILTIN.
There's other ways of implementing it but this is the most straightforward, I think, since it simply forwards.
I'm not sure how to implement these custom props *without* dispex_prop_t because, again, we need a name and that's what dispex_prop_t facility is for.
I could make an exception for indexed mshtml props (custom props that are just indices), but that needs special-casing and I don't think it's good to complicate this initial design with it. It can come later, since it doesn't affect functionality, just an optimization.
BTW for "shadowing props". PROP_PROXY props aren't special in the sense of shadowing other props, they're props just like PROP_BUILTIN for example. The "overriding" props (in localStorage for instance) are special, though, but that's not related to PROP_PROXY directly; they override any prop, not just PROP_PROXY.
I think it helps if you think of PROP_PROXY just like PROP_BUILTIN except the builtin code is in mshtml, but that's it.