[webkit-dev] Multiple inheritance in the DOM

Alan Stearns stearns at adobe.com
Wed Jul 25 18:14:26 PDT 2012


On 7/25/12 6:12 PM, "Sam Weinig" <sam at webkit.org> wrote:

>
>On Jul 25, 2012, at 5:37 PM, Sam Weinig <sam at webkit.org> wrote:
>
>> 
>> On Jul 25, 2012, at 5:13 PM, Alan Stearns <stearns at adobe.com> wrote:
>> 
>>> On 7/25/12 4:49 PM, "Kentaro Hara" <haraken at chromium.org> wrote:
>>> 
>>>>>>>> A) Should we push back on the folks writing the CSS Regions
>>>>>>>> specification to avoid using multiple inheritance?  As far as I
>>>>>>> know,
>>>>>>>> this is the only instance of multiple inheritance in the platform.
>>>>>>>> Historically, EventTarget used multiple inheritance, but that's
>>>>>>>>been
>>>>>>>> fixed in DOM4 [4].
>>>> 
>>>> If it is possible to avoid the multiple inheritance, that would be
>>>>best.
>>> 
>>> From the WebIDL side, it's not strictly multiple inheritance. It's
>>>merely
>>> a supplemental interface that more than one object can implement. None
>>>of
>>> the members of the Region interface can clash with any of the members
>>>of
>>> the object that implements it.
>>> 
>>> Right now Elements can become CSS Regions, but in the future other
>>>objects
>>> will be able to become CSS Regions. As far as I know, the correct way
>>>to
>>> specify this kind of relation is with WebIDL supplemental interfaces.
>>>I'd
>>> rather figure out the correct way to add this WebIDL functionality to
>>> WebKit now, than put something else into the spec and WebKit that we'll
>>> have to change later.
>>> 
>>> Thanks,
>>> 
>>> Alan
>> 
>> What other objects do you envision implementing CSSRegion?  With the
>>spec written the way it is now, I see no reason to make anything
>>virtual, or even have a Region class.  Just implement it in Element.  If
>>need to pull things out for code reuse purposes, we can do that when it
>>comes to that, but right now, there doesn't seem to be a need to
>>complicate things.
>> 
>> -Sam
>
>So, what I said isn't quite right, as I understand you actually can get a
>Region object (via getRegions()).  But, the point of not needing to solve
>the issue right now remains true (though thin).

No, you'll never actually get a Region object. What you get is a
sequence<Region> whose members will all be Elements or some other object
that implements the Region interface.

>
>That said, adding this type of multiple inheritance to the platform seems
>undesirable, and I think the standards body should work harder to come up
>with a solution that does not require it.
>
>-Sam
>
>




More information about the webkit-dev mailing list