Changes between Version 60 and Version 61 of WebKitIDL


Ignore:
Timestamp:
Feb 21, 2012, 6:20:22 PM (13 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v60 v61  
    547547You should avoid using [ImplementedAs] as much as possible though.
    548548
    549 == [Reflect](a) FIXME == #Reflect
    550 
    551 Summary: ADD SUMMARY
    552 
    553 Usage: [Reflect] can be specified on attributes:
    554 {{{
    555     attribute [Reflect] DOMString str;
    556 }}}
    557 
    558 ADD EXPLANATIONS
     549== [Reflect](a) == #Reflect
     550
     551 * [http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#reflect The spec of Reflect]
     552
     553Summary: [Reflect] indicates that a given attribute should reflect the values of a corresponding content attribute.
     554
     555Usage: The possible usage is [Reflect] or [Reflect=X], where X is the name of a corresponding content attribute.
     556[Reflect] can be specified on attributes:
     557{{{
     558    interface Element {
     559        attribute [Reflect] DOMString id;
     560        attribute [Reflect=class] DOMString className;
     561    };
     562}}}
     563
     564(Informally speaking,) a content attribute means an attribute on an HTML tag:
     565{{{
     566    <div id="foo" class="fooClass"></div>
     567}}}
     568Here 'id' and 'class' are content attributes.
     569
     570If a given attribute in an IDL file is marked as [Reflect],
     571it indicates that the attribute getter returns the value of the corresponding content attribute
     572and that the attribute setter sets the value of the corresponding content attribute.
     573In the above example, 'div.id' returns 'foo', and 'div.id = "bar"' sets "bar" to the 'id' content attribute.
     574
     575If the name of the corresponding content attribute is different from the attribute name in an IDL file,
     576you can specify the content attribute name by [Reflect=X].
     577For example, in case of [Reflect=class], if 'div.className="barClass"' is evaluated, then "barClass" is set to the 'class' content attribute.
     578
     579Whether [Reflect] should be specified or not depends on the spec of each attribute.
    559580
    560581== [Replaceable](a) == #Replaceable
     
    13081329If a given DOM object needs to be kept alive as long as the DOM object has pending activities, you need to specify [ActiveDOMObject].
    13091330For example, [ActiveDOMObject] can be used when the DOM object is expecting events to be raised in the future.
     1331
     1332If you use [ActiveDOMObject], the corresponding WebCore class needs to inherit ActiveDOMObject.
     1333For example, in case of XMLHttpRequest, WebCore/xml/XMLHttpRequest.h would look like this:
     1334{{{
     1335    class XMLHttpRequest : public ActiveDOMObject {
     1336        ...;
     1337    };
     1338}}}
     1339Then you need to implement the virtual methods of the ActiveDOMObject class, e.g. contextDestroyed(), canSuspend(), suspend(), resume() and stop().
    13101340
    13111341If an interface X has [ActiveDOMObject] and an interface Y inherits the interface X,