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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 804 |
805 ```webidl | 805 ```webidl |
806 interface XXX { | 806 interface XXX { |
807 [Custom=PropertyGetter|PropertyQuery|PropertyEnumerator] getter Foo (DOMStri
ng name); | 807 [Custom=PropertyGetter|PropertyQuery|PropertyEnumerator] getter Foo (DOMStri
ng name); |
808 }; | 808 }; |
809 ``` | 809 ``` |
810 | 810 |
811 You can write custom bindings as V8XXX::namedPropertyQuery(...) and V8XXX::named
PropertyEnumerator(...) in Source/bindings/v8/custom/V8XXXCustom.cpp: | 811 You can write custom bindings as V8XXX::namedPropertyQuery(...) and V8XXX::named
PropertyEnumerator(...) in Source/bindings/v8/custom/V8XXXCustom.cpp: |
812 | 812 |
813 ```c++ | 813 ```c++ |
814 v8::Handle<v8::Integer> V8XXX::namedPropertyQuery(v8::Local<v8::String> name, co
nst v8::AccessorInfo& info) | 814 v8::Local<v8::Integer> V8XXX::namedPropertyQuery(v8::Local<v8::String> name, con
st v8::AccessorInfo& info) |
815 { | 815 { |
816 ...; | 816 ...; |
817 } | 817 } |
818 | 818 |
819 v8::Handle<v8::Array> V8XXX::namedPropertyEnumerator(const v8::AccessorInfo& inf
o) | 819 v8::Local<v8::Array> V8XXX::namedPropertyEnumerator(const v8::AccessorInfo& info
) |
820 { | 820 { |
821 ...; | 821 ...; |
822 } | 822 } |
823 ``` | 823 ``` |
824 | 824 |
825 #### [Custom=LegacyCallAsFunction] _(i) _deprecated_ | 825 #### [Custom=LegacyCallAsFunction] _(i) _deprecated_ |
826 | 826 |
827 Summary: `[Custom=LegacyCallAsFunction]` allows you to write custom bindings for
call(...) of a given interface. | 827 Summary: `[Custom=LegacyCallAsFunction]` allows you to write custom bindings for
call(...) of a given interface. |
828 | 828 |
829 Usage: `[Custom=LegacyCallAsFunction]` can be specified on interfaces: | 829 Usage: `[Custom=LegacyCallAsFunction]` can be specified on interfaces: |
830 | 830 |
831 ```webidl | 831 ```webidl |
832 [ | 832 [ |
833 Custom=LegacyCallAsFunction, | 833 Custom=LegacyCallAsFunction, |
834 ] interface XXX { | 834 ] interface XXX { |
835 ... | 835 ... |
836 }; | 836 }; |
837 ``` | 837 ``` |
838 | 838 |
839 If you want to write custom bindings for XXX.call(...), you can use `[Custom=Leg
acyCallAsFunction]`. | 839 If you want to write custom bindings for XXX.call(...), you can use `[Custom=Leg
acyCallAsFunction]`. |
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::Local<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args) |
845 { | 845 { |
846 ...; | 846 ...; |
847 } | 847 } |
848 ``` | 848 ``` |
849 | 849 |
850 ### [CustomElementCallbacks] _(m, a)_ | 850 ### [CustomElementCallbacks] _(m, a)_ |
851 | 851 |
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. | 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. |
853 | 853 |
854 *** note | 854 *** note |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 [ | 1404 [ |
1405 CustomConstructor(float x, float y, optional DOMString str), | 1405 CustomConstructor(float x, float y, optional DOMString str), |
1406 ] interface XXX { | 1406 ] interface XXX { |
1407 ... | 1407 ... |
1408 }; | 1408 }; |
1409 ``` | 1409 ``` |
1410 | 1410 |
1411 Then you can write custom bindings in Source/bindings/v8/custom/V8XXXConstructor
Custom.cpp: | 1411 Then you can write custom bindings in Source/bindings/v8/custom/V8XXXConstructor
Custom.cpp: |
1412 | 1412 |
1413 ```c++ | 1413 ```c++ |
1414 v8::Handle<v8::Value> V8XXX::constructorCallback(const v8::Arguments& args) | 1414 v8::Local<v8::Value> V8XXX::constructorCallback(const v8::Arguments& args) |
1415 { | 1415 { |
1416 ...; | 1416 ...; |
1417 } | 1417 } |
1418 ``` | 1418 ``` |
1419 | 1419 |
1420 ### [FlexibleArrayBufferView] | 1420 ### [FlexibleArrayBufferView] |
1421 | 1421 |
1422 Summary: `[FlexibleArrayBufferView]` wraps a parameter that is known to be an Ar
rayBufferView (or a subtype of, e.g. typed arrays) with a FlexibleArrayBufferVie
w. | 1422 Summary: `[FlexibleArrayBufferView]` wraps a parameter that is known to be an Ar
rayBufferView (or a subtype of, e.g. typed arrays) with a FlexibleArrayBufferVie
w. |
1423 | 1423 |
1424 The FlexibleArrayBufferView itself can then either refer to an actual ArrayBuffe
rView or a temporary copy (for small payloads) that may even live on the stack.
The idea is that copying the payload on the stack and referring to the temporary
copy saves creating global handles (resulting in weak roots) in V8. Note that `
[FlexibleArrayBufferView]` will actually result in a TypedFlexibleArrayBufferVi
ew wrapper for typed arrays. | 1424 The FlexibleArrayBufferView itself can then either refer to an actual ArrayBuffe
rView or a temporary copy (for small payloads) that may even live on the stack.
The idea is that copying the payload on the stack and referring to the temporary
copy saves creating global handles (resulting in weak roots) in V8. Note that `
[FlexibleArrayBufferView]` will actually result in a TypedFlexibleArrayBufferVi
ew wrapper for typed arrays. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: | 1562 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: |
1563 | 1563 |
1564 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. | 1564 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. |
1565 | 1565 |
1566 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. | 1566 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. |
1567 | 1567 |
1568 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. | 1568 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. |
1569 *** | 1569 *** |
1570 | 1570 |
1571 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) | 1571 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) |
OLD | NEW |