| 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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 | 840 |
| 841 You can write custom `V8XXX::callAsFunctionCallback(...)` in Source/bindings/v8/
custom/V8XXXCustom.cpp: | 841 You can write custom `V8XXX::callAsFunctionCallback(...)` in Source/bindings/v8/
custom/V8XXXCustom.cpp: |
| 842 | 842 |
| 843 ```c++ | 843 ```c++ |
| 844 v8::Handle<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args) | 844 v8::Handle<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args) |
| 845 { | 845 { |
| 846 ...; | 846 ...; |
| 847 } | 847 } |
| 848 ``` | 848 ``` |
| 849 | 849 |
| 850 #### [Custom=VisitDOMWrapper] _(i)_ | |
| 851 | |
| 852 | |
| 853 Summary: Allows you to write custom code for visitDOMWrapper: like `[SetWrapperR
eferenceFrom]`, but with custom code. One use (Nodelist.idl). | |
| 854 | |
| 855 Usage: | |
| 856 | |
| 857 ```webidl | |
| 858 [ | |
| 859 Custom=VisitDOMWrapper, | |
| 860 ] interface XXX { | |
| 861 ... | |
| 862 }; | |
| 863 ``` | |
| 864 | |
| 865 And then in V8XXXCustom.cpp: | |
| 866 | |
| 867 ```c++ | |
| 868 void V8XXX::visitDOMWrapperCustom(v8::Isolate* isolate, ScriptWrappable* scriptW
rappable, v8::Persistent<v8::Object> wrapper) | |
| 869 { | |
| 870 ... | |
| 871 } | |
| 872 ``` | |
| 873 | |
| 874 ### [CustomElementCallbacks] _(m, a)_ | 850 ### [CustomElementCallbacks] _(m, a)_ |
| 875 | 851 |
| 876 Summary: Wraps the method/accessor with a Custom Elements "callback delivery sco
pe" which will dispatch Custom Element callbacks (createdCallback, attributeChan
gedCallback, etc.) before returning to script. | 852 Summary: Wraps the method/accessor with a Custom Elements "callback delivery sco
pe" which will dispatch Custom Element callbacks (createdCallback, attributeChan
gedCallback, etc.) before returning to script. |
| 877 | 853 |
| 878 *** note | 854 *** note |
| 879 This attribute is only for Custom Elements V0, | 855 This attribute is only for Custom Elements V0, |
| 880 and is superceded by `[CEReactions]` for V1. | 856 and is superceded by `[CEReactions]` for V1. |
| 881 *** | 857 *** |
| 882 | 858 |
| 883 If the method/accessor creates elements or modifies DOM nodes in any way, it sho
uld be tagged with this extended attribute. Even if you're not a Node, this may
apply to you! For example [DOMTokenList.toggle](https://code.google.com/p/chromi
um/codesearch#chromium/src/third_party/WebKit/Source/core/dom/DOMTokenList.idl&l
=34) can be reflected in the attribute of its associated element, so it needs to
be tagged with CustomElementCallbacks. If the method/accessor only calls someth
ing that may modify the DOM (for example, it runs user script as a callback) you
don't need to tag your method with `[CustomElementCallbacks]`; that is the resp
onsibility of the binding that actually modifies the DOM. In general over-applyi
ng this extended attribute is safe, with one caveat: | 859 If the method/accessor creates elements or modifies DOM nodes in any way, it sho
uld be tagged with this extended attribute. Even if you're not a Node, this may
apply to you! For example [DOMTokenList.toggle](https://code.google.com/p/chromi
um/codesearch#chromium/src/third_party/WebKit/Source/core/dom/DOMTokenList.idl&l
=34) can be reflected in the attribute of its associated element, so it needs to
be tagged with CustomElementCallbacks. If the method/accessor only calls someth
ing that may modify the DOM (for example, it runs user script as a callback) you
don't need to tag your method with `[CustomElementCallbacks]`; that is the resp
onsibility of the binding that actually modifies the DOM. In general over-applyi
ng this extended attribute is safe, with one caveat: |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1658 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: | 1634 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: |
| 1659 | 1635 |
| 1660 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. | 1636 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. |
| 1661 | 1637 |
| 1662 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. | 1638 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. |
| 1663 | 1639 |
| 1664 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. | 1640 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. |
| 1665 *** | 1641 *** |
| 1666 | 1642 |
| 1667 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) | 1643 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) |
| OLD | NEW |