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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 | 1477 |
1478 | 1478 |
1479 *** note | 1479 *** note |
1480 * The getter cannot have any side effects since calls to the getter will be repl
aced by a cheap property load. | 1480 * The getter cannot have any side effects since calls to the getter will be repl
aced by a cheap property load. |
1481 * It uses a **push approach**, so updates must be _pushed_ every single time, it
**DOES NOT** invalidate/update the cache automatically. | 1481 * It uses a **push approach**, so updates must be _pushed_ every single time, it
**DOES NOT** invalidate/update the cache automatically. |
1482 * Despite being cached, the getter can still be called on certain circumstances,
consistency is a must. | 1482 * Despite being cached, the getter can still be called on certain circumstances,
consistency is a must. |
1483 * The cache **MUST** be initialized before using it. There's no default value li
ke _undefined_ or a _hole_. | 1483 * The cache **MUST** be initialized before using it. There's no default value li
ke _undefined_ or a _hole_. |
1484 *** | 1484 *** |
1485 | 1485 |
1486 | 1486 |
1487 Usage: `[CachedAccessor]` takes no arguments, can be specified on attributes. | 1487 Usage: `[CachedAccessor]` takes an optional argument "Lazy", can be specified on
attributes. |
1488 | 1488 |
1489 ```webidl | 1489 ```webidl |
1490 interface HTMLFoo { | 1490 interface HTMLFoo { |
1491 [CachedAccessor] readonly attribute Bar bar; | 1491 [CachedAccessor] readonly attribute Bar bar; |
1492 }; | 1492 }; |
1493 ``` | 1493 ``` |
1494 | 1494 |
| 1495 ```webidl |
| 1496 interface HTMLFoo { |
| 1497 [CachedAccessor=Lazy] readonly attribute Bar bar; |
| 1498 }; |
| 1499 ``` |
1495 | 1500 |
1496 Register the required property in V8PrivateProperty.h. | 1501 Register the required property in V8PrivateProperty.h. |
1497 To update the cached value (e.g. for HTMLFoo.bar) proceed as follows: | 1502 To update the cached value (e.g. for HTMLFoo.bar) proceed as follows: |
1498 | 1503 |
1499 ```c++ | 1504 ```c++ |
1500 V8PrivateProperty::getHTMLFooBarCachedAccessor().set(context, object, newValue); | 1505 V8PrivateProperty::getHTMLFooBarCachedAccessor().set(context, object, newValue); |
1501 ``` | 1506 ``` |
1502 | 1507 |
1503 | 1508 |
1504 ## Discouraged Blink-specific IDL Extended Attributes | 1509 ## Discouraged Blink-specific IDL Extended Attributes |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: | 1582 Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: |
1578 | 1583 |
1579 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. | 1584 1. Redistributions of source code must retain the above copyright notice, this l
ist of conditions and the following disclaimer. |
1580 | 1585 |
1581 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. | 1586 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. |
1582 | 1587 |
1583 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. | 1588 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. |
1584 *** | 1589 *** |
1585 | 1590 |
1586 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) | 1591 [CrossOriginProperties]: https://html.spec.whatwg.org/multipage/browsers.html#cr
ossoriginproperties-(-o-) |
OLD | NEW |