Changes between Version 39 and Version 40 of WebKitIDL


Ignore:
Timestamp:
Feb 19, 2012 9:59:47 PM (10 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v39 v40  
    11= THIS DOCUMENT IS STILL DRAFT =
     2
     3[#naming-rules naming rules]
    24
    35= Overview =
     
    9092 * CPP: WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.h, WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.cpp
    9193
    92 = Basic naming rules of IDL attribute =
     94= Basic naming rules of IDL attribute = [=#naming-rules]
    9395
    9496There are a few rules of IDL attribute naming:
     
    170172        void func2(in int a, in int b, in [Optional=DefaultIsUndefined] int c);
    171173        void func3(in int a, in int b, in [Optional=DefaultIsUndefined] DOMString c, in [Optional=DefaultIsNullString] DOMString d);
    172     }
     174    };
    173175}}}
    174176
     
    198200    ] HTMLFoo {
    199201        void func(in int a, in [Callback] int b);
    200     }
     202    };
    201203}}}
    202204
     
    237239    interface XXX {
    238240        [JSCustom] void func(in int a, in int b);
    239     }
     241    };
    240242}}}
    241243You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
     
    253255    interface XXX {
    254256        attribute [JSCustomGetter] DOMString str;
    255     }
     257    };
    256258}}}
    257259You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
     
    269271    interface XXX {
    270272        attribute [JSCustomSetter] DOMString str;
    271     }
     273    };
    272274}}}
    273275You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
     
    285287    interface XXX {
    286288        [V8Custom] void func(in int a, in int b);
    287     }
     289    };
    288290}}}
    289291You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature:
     
    301303    interface XXX {
    302304        attribute [V8CustomGetter] DOMString str;
    303     }
     305    };
    304306}}}
    305307You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature:
     
    317319    interface XXX {
    318320        attribute [V8CustomSetter] DOMString str;
    319     }
     321    };
    320322}}}
    321323You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature:
     
    344346        [CallWith=ScriptArguments|CallStack] void func3(in int a, in int b);
    345347        [CallWith=CallStack|ScriptArguments] void func4(in int a, in int b);
    346     }
     348    };
    347349}}}
    348350[CallWith] can be specified on interfaces but it has a different meaning. Refer to the [Constructor] section for [CallWith] on interfaces.
     
    360362HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called.
    361363
    362 ==  [CheckAccessToNode](m,a) ==
     364==  [CheckSecurityForNode](m,a) ==
    363365
    364366Summary: It checks if a given Node access is allowed in terms of security.
    365367
    366 Usage: [CheckAccessToNode] can be specified on methods and attributes:
    367 {{{
    368     attribute [CheckAccessToNode] Node contentDocument;
    369     [CheckAccessToNode] SVGDocument getSVGDocument();
     368Usage: [CheckSecurityForNode] can be specified on methods and attributes:
     369{{{
     370    attribute [CheckSecurityForNode] Node contentDocument;
     371    [CheckSecurityForNode] SVGDocument getSVGDocument();
    370372}}}
    371373
    372374In terms of security, node.contentDocument should return undefined if the parent frame and the child frame are from different origins.
    373 If the security check is needed, you should specify [CheckAccessToNode].
     375If the security check is needed, you should specify [CheckSecurityForNode].
    374376This is really important for security.
    375377
     
    446448    interface DOMWindow {
    447449        attribute [Replaceable] screenX;
    448     }
     450    };
    449451}}}
    450452
     
    499501        attribute [CachedAttribute] DOMString normalValue;
    500502        attribute [CachedAttribute] SerializedScriptValue serializedValue;
    501     }
     503    };
    502504}}}
    503505
     
    599601Usage: The possible usage is
    600602{{{
    601     interface [Supplemental=YYY] XXX { ... }
     603    interface [
     604        Supplemental=YYY
     605    ] XXX {
     606    };
    602607}}}
    603608where XXX implements YYY. [Supplemental] can be specified on interfaces.
     
    646651        CallWith=ScriptExecutionContext|ScriptState
    647652    ] XXX {
    648     }
     653    };
    649654}}}
    650655
     
    709714        attribute DOMString str1;
    710715        attribute [InitializedByEventConstructor] DOMString str2;
    711     }
     716    };
    712717}}}
    713718
     
    749754        NamedConstructor=Audio()
    750755    ] HTMLAudioElement {
    751     }
     756    };
    752757}}}
    753758
     
    767772        ConstractorParameters=4
    768773    ] XXX {
    769     }
     774    };
    770775}}}
    771776
     
    792797        ConstructorParameters=2
    793798    ] XXX {
    794     }
     799    };
    795800}}}
    796801You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
     
    810815        ConstructorParameters=2
    811816    ] XXX {
    812     }
     817    };
    813818}}}
    814819You need to prepare WebCore/bindings/v8/custom/V8XXXConstructor.cpp and write custom bindings:
     
    834839        Conditional=INDEXED_DATABASE
    835840    ] XXX {
    836     }
     841    };
    837842}}}
    838843{{{
     
    840845        attribute [Conditional=INDEXED_DATABASE] DOMString str;
    841846        [Conditional=INDEXED_DATABASE] void open();
    842     }
     847    };
    843848}}}
    844849
     
    860865        V8EnabledAtRuntime
    861866    ] XXX {
    862     }
     867    };
    863868}}}
    864869{{{
     
    868873        [V8EnabledAtRuntime] void open1();
    869874        [V8EnabledAtRuntime=foo] void open2();
    870     }
     875    };
    871876}}}
    872877
     
    896901        CustomToJSObject
    897902    ] XXX {
    898     }
     903    };
    899904}}}
    900905
     
    919924}}}
    920925
    921 ==  [CheckAccessToFrame](i), [DoNotCheckAccessToFrame](m,a), [DoNotCheckAccessToFrameOnGetter](a), [DoNotCheckAccessToFrameOnSetter](a) ==
     926==  [CheckSecurity](i), [DoNotCheckSecurity](m,a), [DoNotCheckSecurityOnGetter](a), [DoNotCheckSecurityOnSetter](a) ==
    922927
    923928Summary: It checks if a given Frame access is allowed or not, in terms of security.
    924929
    925 Usage: [CheckAccessToFrame] can be specified on interfaces.
    926 [DoNotCheckAccessToFrame] can be specified on methods or attributes which belong to interfaces which have [CheckAccessToFrame].
    927 [DoNotCheckAccessToFrameOnGetter] and [DoNotCheckAccessToFrameOnSetter] can be specified on attributes
    928 which belong to interfaces which have [CheckAccessToFrame]:
    929 {{{
    930     interface [
    931         CheckAccessToFrame
     930Usage: [CheckSecurity] can be specified on interfaces.
     931[DoNotCheckSecurity] can be specified on methods or attributes which belong to interfaces which have [CheckSecurity].
     932[DoNotCheckSecurityOnGetter] and [DoNotCheckSecurityOnSetter] can be specified on attributes
     933which belong to interfaces which have [CheckSecurity]:
     934{{{
     935    interface [
     936        CheckSecurity
    932937    ] DOMWindow {
    933938        attribute DOMString str1;
    934         attribute [DoNotCheckAccessToFrame] DOMString str2:
    935         attribute [DoNotCheckAccessToFrameOnGetter] DOMString str3:
    936         attribute [DoNotCheckAccessToFrameOnSetter] DOMString str4:
     939        attribute [DoNotCheckSecurity] DOMString str2:
     940        attribute [DoNotCheckSecurityOnGetter] DOMString str3:
     941        attribute [DoNotCheckSecurityOnSetter] DOMString str4:
    937942        void func1();
    938         [DoNotCheckAccessToFrame] void func2();
    939     }
     943        [DoNotCheckSecurity] void func2();
     944    };
    940945}}}
    941946
    942947Consider the case where you access window.parent from inside iframe which comes from a different origin.
    943948While it is allowed to access window.parent, it is not allowed to access window.parent.document.
    944 In such cases, you need to specify [CheckAccessToFrame] in order to check
     949In such cases, you need to specify [CheckSecurity] in order to check
    945950whether a given Frame is allowed to access the attribute or method.
    946951This is really important for security.
    947952
    948 If you specify [CheckAccessToFrame] on an interface, the security check is enabled on all the attributes and methods in the interface.
     953If you specify [CheckSecurity] on an interface, the security check is enabled on all the attributes and methods in the interface.
    949954To disable the security check for some attribute or method, you can use
    950 [DoNotCheckAccessToFrame], [DoNotCheckAccessToFrameOnGetter] or [DoNotCheckAccessToFrameOnSetter].
    951 
    952  * [DoNotCheckAccessToFrame] on a method disables the security check for the method.
    953  * [DoNotCheckAccessToFrame] on an attribute disables the security check for a getter and setter of the attribute.
    954  * [DoNotCheckAccessToFrameOnGetter] on an attribute disables the security check for a getter of the attribute.
    955  * [DoNotCheckAccessToFrameOnSetter] on an attribute disables the security check for a setter of the attribute.
    956  * [DoNotCheckAccessToFrame] on an attribute is equivalent to [DoNotCheckAccessToFrameOnGetter, DoNotCheckAccessToFrameOnSetter].
     955[DoNotCheckSecurity], [DoNotCheckSecurityOnGetter] or [DoNotCheckSecurityOnSetter].
     956
     957 * [DoNotCheckSecurity] on a method disables the security check for the method.
     958 * [DoNotCheckSecurity] on an attribute disables the security check for a getter and setter of the attribute.
     959 * [DoNotCheckSecurityOnGetter] on an attribute disables the security check for a getter of the attribute.
     960 * [DoNotCheckSecurityOnSetter] on an attribute disables the security check for a setter of the attribute.
     961 * [DoNotCheckSecurity] on an attribute is equivalent to [DoNotCheckSecurityOnGetter, DoNotCheckSecurityOnSetter].
    957962
    958963==  [IndexedGetter](i) ==
     
    967972        IndexedGetter
    968973    ] XXX {
    969     }
     974    };
    970975}}}
    971976
     
    984989        CustomIndexedSetter
    985990    ] XXX {
    986     }
     991    };
    987992}}}
    988993
     
    10161021        NamedGetter
    10171022    ] XXX {
    1018     }
     1023    };
    10191024}}}
    10201025
     
    10341039        CustomNamedSetter
    10351040    ] XXX {
    1036     }
     1041    };
    10371042}}}
    10381043
     
    10841089        EventTarget
    10851090    ] XXX {
    1086     }
     1091    };
    10871092}}}
    10881093
     
    11001105        const unsigned short NOT_FOUND_ERR = 123;
    11011106        const unsigned short SYNTAX_ERR = 124;
    1102     }
     1107    };
    11031108}}}
    11041109
     
    11211126        ActiveDOMObject
    11221127    ] XMLHttpRequest {
    1123     }
     1128    };
    11241129}}}
    11251130
     
    11391144        V8DependentLifeTime
    11401145    ] XXX {
    1141     }
     1146    };
    11421147}}}
    11431148
     
    11551160        CustomDeleteProperty
    11561161    ] XXX {
    1157     }
     1162    };
    11581163}}}
    11591164
     
    12051210    ] SharedWorkerContext {
    12061211        ...;
    1207     }
     1212    };
    12081213}}}
    12091214
     
    12171222        CustomCall
    12181223    ] XXX {
    1219     }
     1224    };
    12201225}}}
    12211226
     
    12541259        JSCustomGetOwnPropertySlotAndDescriptor
    12551260    ] XXX {
    1256     }
     1261    };
    12571262}}}
    12581263
     
    13401345        JSGenerateToNativeObject
    13411346    ] XXX {
    1342     }
     1347    };
    13431348}}}
    13441349
     
    13561361        JSCustomHeader
    13571362    ] XXX {
    1358     }
     1363    };
    13591364}}}
    13601365
     
    13731378        JSLegacyParent=JSDOMWindowBase
    13741379    ] DOMWindow {
    1375     }
     1380    };
    13761381}}}
    13771382
     
    13871392        JSInlineGetOwnPropertySlot
    13881393    ] XXX {
    1389     }
     1394    };
    13901395}}}
    13911396
     
    13991404        JSNoStaticTables
    14001405    ] XXX {
    1401     }
     1406    };
    14021407}}}
    14031408