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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1022 | 1022 |
1023 ```webidl | 1023 ```webidl |
1024 [NotEnumerable] attribute DOMString str; | 1024 [NotEnumerable] attribute DOMString str; |
1025 [NotEnumerable] void foo(); | 1025 [NotEnumerable] void foo(); |
1026 ``` | 1026 ``` |
1027 | 1027 |
1028 `[NotEnumerable]` indicates that the method or attribute is not enumerable. | 1028 `[NotEnumerable]` indicates that the method or attribute is not enumerable. |
1029 | 1029 |
1030 ### [OriginTrialEnabled] _(i, m, a, c)_ | 1030 ### [OriginTrialEnabled] _(i, m, a, c)_ |
1031 | 1031 |
1032 Summary: Like `[RuntimeEnabled]`, it controls at runtime whether bindings are ex posed, but uses a different mechanism for enabling experimental features. | 1032 Summary: Like `[RuntimeEnabled]`, it controls at runtime whether bindings are ex posed, but uses a different mechanism for enabling experimental features. |
Jeffrey Yasskin
2016/04/08 00:07:49
Can you clarify that OriginTrialEnabled=WebBluetoo
iclelland
2016/04/08 14:51:32
Yes -- that is triggered by the presence of "WebBl
| |
1033 | 1033 |
1034 Usage: `[OriginTrialEnabled=FeatureName]`. FeatureName must be included in [Runt imeEnabledFeatures.in](https://code.google.com/p/chromium/codesearch#chromium/sr c/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in), and is the same value that would be used with `[RuntimeEnabled]`. | 1034 Usage: `[OriginTrialEnabled=FeatureName]`. FeatureName must be included in [Runt imeEnabledFeatures.in](https://code.google.com/p/chromium/codesearch#chromium/sr c/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in), and is the same value that would be used with `[RuntimeEnabled]`. |
1035 | 1035 |
1036 ```webidl | 1036 ```webidl |
1037 [ | 1037 [ |
1038 OriginTrialEnabled=MediaSession | 1038 OriginTrialEnabled=MediaSession |
1039 ] interface MediaSession { ... }; | 1039 ] interface MediaSession { ... }; |
1040 ``` | 1040 ``` |
1041 | 1041 |
1042 When there is an active origin trial for the current execution context, the feat ure is enabled at runtime, and the binding would be exposed to the web. `[Origin TrialEnabled]` also includes a check for the associated runtime flag, so feature s can be enabled in that fashion, even without an origin trial. | 1042 When there is an active origin trial for the current execution context, the feat ure is enabled at runtime, and the binding would be exposed to the web. `[Origin TrialEnabled]` also includes a check for the associated runtime flag, so feature s can be enabled in that fashion, even without an origin trial. |
1043 | 1043 |
1044 `[OriginTrialEnabled]` has similar semantics to `[RuntimeEnabled]`, and is inten ded as a drop-in replacement. For example, `[OriginTrialEnabled]` _cannot_ be ap plied to arguments, see `[RuntimeEnabled]` for reasoning. The key implementation difference is that `[OriginTrialEnabled]` wraps the generated code with `if (Or iginTrials::FeatureNameEnabled(...)) { ...code... }`. | 1044 `[OriginTrialEnabled]` has similar semantics to `[RuntimeEnabled]`, and is inten ded as a drop-in replacement. For example, `[OriginTrialEnabled]` _cannot_ be ap plied to arguments, see `[RuntimeEnabled]` for reasoning. The key implementation difference is that `[OriginTrialEnabled]` wraps the generated code with `if (Or iginTrials::FeatureNameEnabled(...)) { ...code... }`. |
1045 | 1045 |
1046 *** note | |
1047 **FIXME:** Currently, due to [Bug 586594](https://crbug.com/586594), the `[Origi nTrialEnabled]` attribute must be used _in addition to_ `[RuntimeEnabled]`, inst ead of being used as a replacement. | |
1048 *** | |
1049 | |
1050 For more information, see [RuntimeEnabledFeatures](https://code.google.com/p/chr omium/codesearch#chromium/src/third_party/WebKit/Source/platform/RuntimeEnabledF eatures.in) and [OriginTrialContext](https://code.google.com/p/chromium/codesear ch#chromium/src/third_party/WebKit/Source/core/origin_trials/OriginTrialContext. h). | 1046 For more information, see [RuntimeEnabledFeatures](https://code.google.com/p/chr omium/codesearch#chromium/src/third_party/WebKit/Source/platform/RuntimeEnabledF eatures.in) and [OriginTrialContext](https://code.google.com/p/chromium/codesear ch#chromium/src/third_party/WebKit/Source/core/origin_trials/OriginTrialContext. h). |
1051 | 1047 |
1052 ### [PostMessage] _(m)_ | 1048 ### [PostMessage] _(m)_ |
1053 | 1049 |
1054 Summary: Tells the code generator to generate postMessage method used in Workers , Service Workers etc. | 1050 Summary: Tells the code generator to generate postMessage method used in Workers , Service Workers etc. |
1055 | 1051 |
1056 Usage: `[PostMessage]` can be specified on methods | 1052 Usage: `[PostMessage]` can be specified on methods |
1057 | 1053 |
1058 ```webidl | 1054 ```webidl |
1059 [PostMessage] void postMessage(any message, optional sequence<Transferable> tran sfer); | 1055 [PostMessage] void postMessage(any message, optional sequence<Transferable> tran sfer); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1568 Copyright (C) 2009 Apple Inc. All rights reserved. | 1564 Copyright (C) 2009 Apple Inc. All rights reserved. |
1569 | 1565 |
1570 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | 1566 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
1571 | 1567 |
1572 1. Redistributions of source code must retain the above copyright notice, this l ist of conditions and the following disclaimer. | 1568 1. Redistributions of source code must retain the above copyright notice, this l ist of conditions and the following disclaimer. |
1573 | 1569 |
1574 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. | 1570 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. |
1575 | 1571 |
1576 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. | 1572 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. |
1577 *** | 1573 *** |
OLD | NEW |