OLD | NEW |
1 # Blink IDL Extended Attributes | 1 # Blink IDL Extended Attributes |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 ## Introduction | 5 ## Introduction |
6 | 6 |
7 The main interest in extended attributes are their _semantics_: Blink implements
many more extended attributes than the Web IDL standard, to specify various beh
avior. | 7 The main interest in extended attributes are their _semantics_: Blink implements
many more extended attributes than the Web IDL standard, to specify various beh
avior. |
8 | 8 |
9 The authoritative list of allowed extended attributes and values is [bindings/ID
LExtendedAttributes.txt](https://code.google.com/p/chromium/codesearch#chromium/
src/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt). This is compl
ete but not necessarily precise (there may be unused extended attributes or valu
es), since validation is run on build, but coverage isn't checked. | 9 The authoritative list of allowed extended attributes and values is [bindings/ID
LExtendedAttributes.txt](https://code.google.com/p/chromium/codesearch#chromium/
src/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt). This is compl
ete but not necessarily precise (there may be unused extended attributes or valu
es), since validation is run on build, but coverage isn't checked. |
10 | 10 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 ] interface Foo {}; | 511 ] interface Foo {}; |
512 | 512 |
513 interface Bar : Foo {}; // inherits [ActiveScriptWrappable] from Foo | 513 interface Bar : Foo {}; // inherits [ActiveScriptWrappable] from Foo |
514 ``` | 514 ``` |
515 | 515 |
516 If a given DOM object needs to be kept alive as long as the DOM object has pendi
ng activities, you need to specify `[ActiveScriptWrappable]` and `[DependentLife
time]`. For example, `[ActiveScriptWrappable]` can be used when the DOM object i
s expecting events to be raised in the future. | 516 If a given DOM object needs to be kept alive as long as the DOM object has pendi
ng activities, you need to specify `[ActiveScriptWrappable]` and `[DependentLife
time]`. For example, `[ActiveScriptWrappable]` can be used when the DOM object i
s expecting events to be raised in the future. |
517 | 517 |
518 If you use `[ActiveScriptWrappable]`, the corresponding Blink class needs to inh
erit ActiveScriptWrappable and override hasPendingActivity(). For example, in ca
se of XMLHttpRequest, core/xml/XMLHttpRequest.h would look like this: | 518 If you use `[ActiveScriptWrappable]`, the corresponding Blink class needs to inh
erit ActiveScriptWrappable and override hasPendingActivity(). For example, in ca
se of XMLHttpRequest, core/xml/XMLHttpRequest.h would look like this: |
519 | 519 |
520 ```c++ | 520 ```c++ |
521 class XMLHttpRequest : public ActiveScriptWrappable | 521 class XMLHttpRequest : public ActiveScriptWrappable<XMLHttpRequest> |
522 { | 522 { |
523 // Returns true if the object needs to be kept alive. | 523 // Returns true if the object needs to be kept alive. |
524 bool hasPendingActivity() const override { return ...; } | 524 bool hasPendingActivity() const override { return ...; } |
525 } | 525 } |
526 ``` | 526 ``` |
527 | 527 |
528 ### [PerWorldBindings] _(m, a)_ | 528 ### [PerWorldBindings] _(m, a)_ |
529 | 529 |
530 Summary: Generates faster bindings code by avoiding check for isMainWorld(). | 530 Summary: Generates faster bindings code by avoiding check for isMainWorld(). |
531 | 531 |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: | 1654 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: |
1655 | 1655 |
1656 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. | 1656 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. |
1657 | 1657 |
1658 2. Redistributions in binary form must reproduce the above copyright notice, thi
s list of conditions and the following disclaimer in the documentation and/or ot
her materials provided with the distribution. | 1658 2. Redistributions in binary form must reproduce the above copyright notice, thi
s list of conditions and the following disclaimer in the documentation and/or ot
her materials provided with the distribution. |
1659 | 1659 |
1660 THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS “AS IS” AND ANY EXP
RESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE
S OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, I
NCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMI
TED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI
TS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHE
THER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
BILITY OF SUCH DAMAGE. | 1660 THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS “AS IS” AND ANY EXP
RESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE
S OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, I
NCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMI
TED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI
TS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHE
THER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
BILITY OF SUCH DAMAGE. |
1661 *** | 1661 *** |
1662 | 1662 |
1663 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) | 1663 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) |
OLD | NEW |