- From: Cameron McCormack <cam@mcc.id.au>
- Date: Thu, 30 Jun 2011 10:28:27 +1200
- To: Dimitri Glazkov <dglazkov@chromium.org>
- Cc: Anne van Kesteren <annevk@opera.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
Anne van Kesteren: > > How can Document inherit from TreeScope if it already inherits from Node? Dimitri Glazkov: > TreeScope is a Node. That doesn’t work now that Web IDL allows only single inheritance. Here is how I would write the IDL, if I understand what you want correctly: // augment Element with these two attributes partial interface Element { attribute ShadowRoot shadow setraises(DOMException); attribute String pseudo; }; // a mixin [NoInterfaceObject] interface TreeScope { readonly TreeScope parentTreeScope; Element getElementById(in DOMString elementId); }; // ShadowRoot is a new type of Node interface ShadowRoot : Node { attribute bool applyAuthorSheets; readonly attribute Element shadowHost; }; // which has TreeScope functionality ShadowRoot implements TreeScope; // augment Document with createShadow() partial interface Document { ShadowRoot createShadow(); }; // Documents also have TreeScope functioanlity Document implements TreeScope; -- Cameron McCormack ≝ http://mcc.id.au/
Received on Wednesday, 29 June 2011 22:29:41 UTC