Changes between Version 74 and Version 75 of WebKitIDL


Ignore:
Timestamp:
Jul 30, 2012 12:29:06 AM (9 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v74 v75  
    1111 - [#TreatReturnedNullStringAs TreatReturnedNullStringAs(m,a)][[br]]
    1212 - [#Optional Optional(p)][[br]]
     13 - [#Clamp Clamp(a,p)][[br]]
    1314 - [#Callback Callback(i,p)][[br]]
    1415 - [#Custom Custom(m,a), JSCustom(m,a), V8Custom(m,a), CustomGetter(a), JSCustomGetter(a), V8CustomGetter(a), CustomSetter(a), JSCustomSetter(a), V8CustomSetter(a)][[br]]
     
    6364 - [#ArrayClass ArrayClass(i)][[br]]
    6465 - [#OmitConstructor OmitConstructor, Immutable, MasqueradesAsUndefined, CustomGetOwnPropertySlot, ReplaceableConstructor, ExtendsDOMGlobalObject, IsIndex, V8DoNotCheckSignature, NumericIndexedGetter][[br]]
    65  - [#Clamp Clamp(a,p)][[br]]
    6666
    6767= Overview = #Overview
     
    328328d.IsEmpty() and d.IsNull() return true.
    329329
     330== [Clamp](a,p) == #Clamp
     331
     332 * [http://www.w3.org/TR/2012/CR-WebIDL-20120419/#Clamp The spec of Clamp]
     333
     334Summary: [Clamp] indicates that when an ECMAScript Number is converted to the IDL type, out of range values will be clamped to the range of valid values,
     335rather than using the operators that use a modulo operation (ToInt32, ToUint32, etc.).
     336
     337Usage: The [Clamp] extended attribute MUST NOT appear on a read only attribute, or an attribute, operation argument or dictionary member
     338that is not of an integer type.
     339
     340[Clamp] can be specified on  writable attributes:
     341
     342{{{
     343    interface XXX {
     344        attribute [Clamp] unsigned short attributeName;
     345    };
     346}}}
     347
     348[Clamp] can be specified on  extended attributes on methods arguments:
     349
     350{{{
     351    interface GraphicsContext {
     352        void setColor(octet red, octet green, octet blue);
     353        void setColorClamped([Clamp] octet red, [Clamp] octet green, [Clamp] octet blue);
     354    };
     355}}}
     356
     357Calling the non-[Clamp] version of setColor() uses ToUint8 to coerce the Numbers to octets.
     358Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColor(255, 255, 1).
     359
     360Calling the [Clamp] version of setColor() uses clampTo() to coerce the Numbers to octets.
     361Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColorClamped(0, 255, 255).
     362
    330363== [Callback](i,p) FIXME == #Callback
    331364
     
    18031836
    18041837Might be deprecated. Discussion is on-going.
    1805 
    1806 == [Clamp](a,p) == #Clamp
    1807 
    1808  * [http://www.w3.org/TR/2012/CR-WebIDL-20120419/#Clamp The spec of Clamp]
    1809 
    1810 Summary: [Clamp] indicates that when an ECMAScript Number is converted to the IDL type, out of range values will be clamped to the range of valid values,
    1811 rather than using the operators that use a modulo operation (ToInt32, ToUint32, etc.).
    1812 
    1813 Usage: The [Clamp] extended attribute MUST NOT appear on a read only attribute, or an attribute, operation argument or dictionary member
    1814 that is not of an integer type. It also MUST NOT be used in conjunction with the [EnforceRange] extended attribute.
    1815 
    1816 [Clamp] can be specified on  writable attributes:
    1817 
    1818 {{{
    1819     interface XXX {
    1820         attribute [Clamp] unsigned short attributeName;
    1821     };
    1822 }}}
    1823 
    1824 [Clamp] can be specified on  extended attributes on methods arguments:
    1825 
    1826 {{{
    1827     interface GraphicsContext {
    1828         void setColor(octet red, octet green, octet blue);
    1829         void setColorClamped([Clamp] octet red, [Clamp] octet green, [Clamp] octet blue);
    1830     };
    1831 }}}
    1832 
    1833 Calling the non-[Clamp] version of setColor() uses ToUint8 to coerce the Numbers to octets.
    1834 Hence calling context.setColor(-1, 255, 257); // Is equivalent to calling setColor(255, 255, 1).
    1835 
    1836 Calling the [Clamp] version of setColor() uses clampTo() to coerce the Numbers to octets.
    1837 Hence calling context.setColor(-1, 255, 257); // Is equivalent to calling setColorClamped(0, 255, 255).