[webkit-dev] Multiple inheritance in the DOM
Alan Stearns
stearns at adobe.com
Wed Jul 25 17:53:49 PDT 2012
On 7/25/12 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
>
I have an upcoming proposal for a CSSPseudoElement object. You can make a
pseudo-element like ::before or ::after into a CSS Region right now in
WebKit. All that's lacking is a way to access those pseudo-elements from
script.
Thanks,
Alan
More information about the webkit-dev
mailing list