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 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 Usage: `[URL]` can be specified on DOMString attributes that have `[Reflect]` ex
tended attribute specified only: | 1532 Usage: `[URL]` can be specified on DOMString attributes that have `[Reflect]` ex
tended attribute specified only: |
1533 | 1533 |
1534 ```webidl | 1534 ```webidl |
1535 [Reflect, URL] attribute DOMString url; | 1535 [Reflect, URL] attribute DOMString url; |
1536 ``` | 1536 ``` |
1537 | 1537 |
1538 You need to specify `[URL]` if a given DOMString represents a URL, since getters
of URL attributes need to be realized in a special routine in Blink, i.e. `Elem
ent::getURLAttribute(...)`. If you forgot to specify `[URL]`, then the attribute
getter might cause a bug. | 1538 You need to specify `[URL]` if a given DOMString represents a URL, since getters
of URL attributes need to be realized in a special routine in Blink, i.e. `Elem
ent::getURLAttribute(...)`. If you forgot to specify `[URL]`, then the attribute
getter might cause a bug. |
1539 | 1539 |
1540 Only used in some HTML*ELement.idl files and one other place. | 1540 Only used in some HTML*ELement.idl files and one other place. |
1541 | 1541 |
1542 ### [NoImplHeader] _(i)_ | |
1543 | |
1544 Summary: `[NoImplHeader]` indicates that a given interface does not have a corre
sponding header file in the impl side. | |
1545 | |
1546 Usage: `[NoImplHeader]` can be specified on any interface: | |
1547 | |
1548 ```webidl | |
1549 [ | |
1550 NoImplHeader, | |
1551 ] interface XXX { | |
1552 ...; | |
1553 }; | |
1554 ``` | |
1555 | |
1556 Without `[NoImplHeader]`, the IDL compiler assumes that there is XXX.h in the im
pl side. With `[NoImplHeader]`, you can tell the IDL compiler that there is no X
XX.h. You can use `[NoImplHeader]` when all of the DOM attributes and methods of
the interface are implemented in Blink-in-JS and thus don't have any C++ header
file. | |
1557 | |
1558 ## Temporary Blink-specific IDL Extended Attributes | 1542 ## Temporary Blink-specific IDL Extended Attributes |
1559 | 1543 |
1560 These extended attributes are _temporary_ and are only in use while some change
is in progress. Unless you are involved with the change, you can generally ignor
e them, and should not use them. | 1544 These extended attributes are _temporary_ and are only in use while some change
is in progress. Unless you are involved with the change, you can generally ignor
e them, and should not use them. |
1561 | 1545 |
1562 ### [LegacyTreatAsPartialInterface] _(i)_ | 1546 ### [LegacyTreatAsPartialInterface] _(i)_ |
1563 | 1547 |
1564 Summary: `[LegacyTreatAsPartialInterface]` on an interface that is the target of
an `implements` statement means that the interface is treated as a partial inte
rface, meaning members are accessed via static member functions in a separate cl
ass, rather than as instance methods on the instance object `*impl` or class met
hods on the C++ class implementing the (main) interface. This is legacy from ori
ginal implementation of `implements`, and is being removed ([Bug 360435](https:/
/crbug.com/360435), nbarth@). | 1548 Summary: `[LegacyTreatAsPartialInterface]` on an interface that is the target of
an `implements` statement means that the interface is treated as a partial inte
rface, meaning members are accessed via static member functions in a separate cl
ass, rather than as instance methods on the instance object `*impl` or class met
hods on the C++ class implementing the (main) interface. This is legacy from ori
ginal implementation of `implements`, and is being removed ([Bug 360435](https:/
/crbug.com/360435), nbarth@). |
1565 | 1549 |
1566 | 1550 |
1567 ### [CachedAccessor] _(a)_ | 1551 ### [CachedAccessor] _(a)_ |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 Added to members of a partial interface definition (and implemented interfaces w
ith `[LegacyTreatAsPartialInterface]`, due to [Bug 360435](https://crbug.com/360
435)) when merging `.idl` files for two reasons. Firstly, these members are impl
emented in a separate class from the class for the (main) interface definition,
so this name data is needed. This is most clearly _written_ as an extended attri
bute on the partial interface definition, but this is discarded during merging (
only the members are merged, into flat lists of methods, attributes, and constan
ts), and thus this extended attribute is put on the members. Secondly, members o
f partial interface definitions are called differently (via static member functi
ons of the separate class, not instance methods or class methods of the main cla
ss), and thus there needs to be a flag indicating that the member comes from a p
artial interface definition. | 1635 Added to members of a partial interface definition (and implemented interfaces w
ith `[LegacyTreatAsPartialInterface]`, due to [Bug 360435](https://crbug.com/360
435)) when merging `.idl` files for two reasons. Firstly, these members are impl
emented in a separate class from the class for the (main) interface definition,
so this name data is needed. This is most clearly _written_ as an extended attri
bute on the partial interface definition, but this is discarded during merging (
only the members are merged, into flat lists of methods, attributes, and constan
ts), and thus this extended attribute is put on the members. Secondly, members o
f partial interface definitions are called differently (via static member functi
ons of the separate class, not instance methods or class methods of the main cla
ss), and thus there needs to be a flag indicating that the member comes from a p
artial interface definition. |
1652 | 1636 |
1653 ## Undocumented Blink-specific IDL Extended Attributes | 1637 ## Undocumented Blink-specific IDL Extended Attributes |
1654 | 1638 |
1655 *** note | 1639 *** note |
1656 **FIXME:** The following need documentation: | 1640 **FIXME:** The following need documentation: |
1657 *** | 1641 *** |
1658 | 1642 |
1659 * `[PerWorldBindings]` :: interacts with `[LogActivity]` | 1643 * `[PerWorldBindings]` :: interacts with `[LogActivity]` |
1660 * `[OverrideBuiltins]` :: used on named accessors | 1644 * `[OverrideBuiltins]` :: used on named accessors |
1661 * `[ImplementedInPrivateScript]`, `[OnlyExposedToPrivateScript]` | |
1662 | 1645 |
1663 ------------- | 1646 ------------- |
1664 | 1647 |
1665 Derived from: [http://trac.webkit.org/wiki/WebKitIDL](http://trac.webkit.org/wik
i/WebKitIDL) Licensed under [BSD](http://www.webkit.org/coding/bsd-license.html)
: | 1648 Derived from: [http://trac.webkit.org/wiki/WebKitIDL](http://trac.webkit.org/wik
i/WebKitIDL) Licensed under [BSD](http://www.webkit.org/coding/bsd-license.html)
: |
1666 | 1649 |
1667 *** aside | 1650 *** aside |
1668 BSD License | 1651 BSD License |
1669 Copyright (C) 2009 Apple Inc. All rights reserved. | 1652 Copyright (C) 2009 Apple Inc. All rights reserved. |
1670 | 1653 |
1671 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: |
1672 | 1655 |
1673 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. |
1674 | 1657 |
1675 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. |
1676 | 1659 |
1677 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. |
1678 *** | 1661 *** |
1679 | 1662 |
1680 [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 |