Changes between Version 34 and Version 35 of WebKitIDL


Ignore:
Timestamp:
Feb 16, 2012 10:44:25 PM (12 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v34 v35  
    291291In terms of security, node.contentDocument should return undefined if the parent frame and the child frame are from different origins.
    292292If the security check is needed, you should specify [CheckAccessToNode].
     293This is really important for security.
    293294
    294295=== * [StrictTypeChecking](m,a) FIXME ===
     
    496497If you forgot to specify [URL], then the attribute getter might cause a bug.
    497498
    498 === * [JSWindowEventListener](a) ===
     499=== * [JSWindowEventListener](a) FIXME ===
    499500
    500501Summary: ADD SUMMARY
     
    839840}}}
    840841
    841 === * [CheckDomainSecurity](i), [DoNotCheckDomainSecurity](m,a), [DoNotCheckDomainSecurityOnGetter](a), [DoNotCheckDomainSecurityOnSetter](a) ===
    842 
    843 === * [IndexedGetter](i), [CustomIndexedGetter](i) ===
    844 
    845 === * [NamedGetter](i), [CustomNamedGetter](i), [CustomNamedSetter](i) ===
    846 
    847 === * [EventTarget](i) ===
     842=== * [CheckAccessToFrame](i), [DoNotCheckAccessToFrame](m,a), [DoNotCheckAccessToFrameOnGetter](a), [DoNotCheckAccessToFrameOnSetter](a) ===
     843
     844Summary: It checks if a given Frame access is allowed or not, in terms of security.
     845
     846Usage: [CheckAccessToFrame] can be specified on interfaces.
     847[DoNotCheckAccessToFrame] can be specified on methods or attributes which belong to interfaces which have [CheckAccessToFrame].
     848[DoNotCheckAccessToFrameOnGetter] and [DoNotCheckAccessToFrameOnSetter] can be specified on attributes
     849which belong to interfaces which have [CheckAccessToFrame]:
     850{{{
     851    interface [
     852        CheckAccessToFrame
     853    ] DOMWindow {
     854        attribute DOMString str1;
     855        attribute [DoNotCheckAccessToFrame] DOMString str2:
     856        attribute [DoNotCheckAccessToFrameOnGetter] DOMString str3:
     857        attribute [DoNotCheckAccessToFrameOnSetter] DOMString str4:
     858        void func1();
     859        [DoNotCheckAccessToFrame] void func2();
     860    }
     861}}}
     862
     863Consider the case where you access window.parent from inside iframe which comes from a different origin.
     864While it is allowed to access window.parent, it is not allowed to access window.parent.document.
     865In such cases, you need to specify [CheckAccessToFrame] in order to check
     866whether a given Frame is allowed to access the attribute or method.
     867This is really important for security.
     868
     869If you specify [CheckAccessToFrame] on an interface, the security check is enabled on all the attributes and methods in the interface.
     870To disable the security check for some attribute or method, you can use
     871[DoNotCheckAccessToFrame], [DoNotCheckAccessToFrameOnGetter] or [DoNotCheckAccessToFrameOnSetter].
     872
     873 * [DoNotCheckAccessToFrame] on a method disables the security check for the method.
     874 * [DoNotCheckAccessToFrame] on an attribute disables the security check for a getter and setter of the attribute.
     875 * [DoNotCheckAccessToFrameOnGetter] on an attribute disables the security check for a getter of the attribute.
     876 * [DoNotCheckAccessToFrameOnSetter] on an attribute disables the security check for a setter of the attribute.
     877 * [DoNotCheckAccessToFrame] on an attribute is equivalent to [DoNotCheckAccessToFrameOnGetter, DoNotCheckAccessToFrameOnSetter].
     878
     879=== * [IndexedGetter](i) ===
     880
     881 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-indexed-properties The spec of indexed properties] (Note: The WebKit IDL explained below behaves differently from the spec)
     882
     883Summary: [IndexedGetter] means that a given interface should have a getter of indexed properties.
     884
     885Usage: [IndexedGetter] can be specified on interfaces:
     886{{{
     887    interface [
     888        IndexedGetter
     889    ] XXX {
     890    }
     891}}}
     892
     893Indexed getters define the behavior when XXX[i] is evaluated.
     894The bindings code is generated automatically so that XXX[i] behaves equivalent to XXX.item(i).
     895
     896=== * [CustomIndexedSetter](i) ===
     897
     898 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-indexed-properties The spec of indexed properties] (Note: The WebKit IDL explained below behaves differently from the spec)
     899
     900Summary: [CustomIndexedSetter] allows us to write custom bindings for a setter of indexed properties.
     901
     902Usage: [CustomIndexedSetter] can be specified on interfaces:
     903{{{
     904    interface [
     905        CustomIndexedSetter
     906    ] XXX {
     907    }
     908}}}
     909
     910Indexed setters define the behavior when "XXX[i] = ..." is evaluated.
     911[CustomIndexedSetter] allows us to write the custom bindings.
     912
     913 * In JavaScriptCore, you can write JSXXX::indexSetter(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     914{{{
     915    void JSXXX::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)
     916    {
     917        ...;
     918    }
     919}}}
     920 * In V8, you can write V8XXX::indexedPropertyGetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     921{{{
     922    v8::Handle<v8::Value> V8XXX::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
     923    {
     924        ...;
     925    }
     926}}}
     927
     928=== * [NamedGetter](i) ===
     929
     930 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-named-properties The spec of named properties] (Note: The WebKit IDL explained below behaves differently from the spec)
     931
     932Summary: [NamedGetter] means that a given interface should have a getter of named properties.
     933
     934Usage: [NamedGetter] can be specified on interfaces:
     935{{{
     936    interface [
     937        NamedGetter
     938    ] XXX {
     939    }
     940}}}
     941
     942Named getters define the behavior when XXX.foooooooo is evaluated, where foooooooo is not an attribute of a given interface.
     943The bindings code is generated automatically so that XXX.foooooooo behaves equivalent to XXX.namedItem(i).
     944
     945=== [CustomNamedGetter](i), [CustomNamedSetter](i) ===
     946
     947 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-named-properties The spec of named properties] (Note: The WebKit IDL explained below behaves differently from the spec)
     948
     949Summary: [CustomNamedGetter]/[CustomNamedSetter] allows us to write custom bindings for a getter/setter of named properties.
     950
     951Usage: They can be specified on interfaces:
     952{{{
     953    interface [
     954        CustomNamedGetter,
     955        CustomNamedSetter
     956    ] XXX {
     957    }
     958}}}
     959
     960Named getters define the behavior when XXX.foooooooo is evaluated, where foooooooo is not an attribute of a given interface.
     961Named setters define the behavior when "XXX.foooooooo = ..." is evaluated.
     962[CustomNamedGetter] and [CustomNamedSetter] allow us to write the custom bindings.
     963
     964 * With [CustomNamedGetter] in JavaScriptCore, you can write JSXXX::canGetItemsForName(...) and JSXXX::nameGetter(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     965{{{
     966    bool JSXXX::canGetItemsForName(ExecState*, XXX* impl, const Identifier& propertyName)
     967    {
     968        ...;
     969    }
     970
     971    JSValue JSXXX::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
     972    {
     973        ...;
     974    }
     975}}}
     976 * With [CustomNamedGetter] in V8, you can write V8XXX::namedPropertyGetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     977{{{
     978    v8::Handle<v8::Value> V8XXX::namedPropertyGetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&)
     979    {
     980        ...;
     981    }
     982}}}
     983 * With [CustomNamedSetter] in JavaScriptCore, you can write JSXXX::putDelegate(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     984{{{
     985    bool JSXXX::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot&)
     986    {
     987        ...;
     988    }
     989}}}
     990 * With [CustomNamedSetter] in V8, you can write V8XXX::namedPropertySetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     991{{{
     992    v8::Handle<v8::Value> V8XXX::namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&)
     993    {
     994        ...;
     995    }
     996}}}
     997
     998=== * [EventTarget](i) FIXME ===
     999
     1000Summary: ADD SUMMARY
     1001
     1002Usage: [EventTarget] can be specified on interfaces.
     1003{{{
     1004    interface [
     1005        EventTarget
     1006    ] XXX {
     1007    }
     1008}}}
     1009
     1010ADD EXPLANATIONS
    8481011
    8491012=== * [DoNotCheckConstants](i) ===
    8501013
    851 === * [ActiveDOMObject](i), [V8DependentLifeTime](i) ===
     1014Summary: [DoNotCheckConstants] stops inserting compile-time assertions for constants of a given interface.
     1015
     1016Usage: [DoNotCheckConstants] can be specified on interfaces:
     1017{{{
     1018    interface [
     1019        DoNotCheckConstants
     1020    ] XXX {
     1021        const unsigned short NOT_FOUND_ERR = 123;
     1022        const unsigned short SYNTAX_ERR = 124;
     1023    }
     1024}}}
     1025
     1026Without [DoNotCheckConstants], compile-time assertions are generated to check if the constant values defined in IDL files
     1027are equal to the constant values in WebKit implementation.
     1028In the above example, if NOT_FOUND_ERR were 100 in WebKit implementation, the build will fail.
     1029Basically values of all constants are defined in the spec,
     1030and thus the values defined in IDL files and the values in WebKit implementations should be equal to the values defined in the spec.
     1031
     1032If you want to introduce non-speced constant values and allow different values between IDL files and WebKit implementation,
     1033you can specify [DoNotCheckConstants] on the interface to skip the compile-time assertions.
     1034
     1035=== * [ActiveDOMObject](i) ===
     1036
     1037Summary: [ActiveDOMObject] indicates that a DOM object should be kept alive when the DOM object has pending activities.
     1038
     1039Usage: [ActiveDOMObject] can be specified on interfaces:
     1040{{{
     1041    interface [
     1042        ActiveDOMObject
     1043    ] XMLHttpRequest {
     1044    }
     1045}}}
     1046
     1047If a given DOM object needs to be kept alive as long as the DOM object has pending activities, you need to specify [ActiveDOMObject].
     1048For example, [ActiveDOMObject] can be used when the DOM object is expecting events to be raised.
     1049
     1050If an interface X has [ActiveDOMObject] and an interface Y inherits the interface X,
     1051then the interface Y should also have [ActiveDOMObject].
     1052
     1053=== * [V8DependentLifeTime](i) FIXME ===
     1054
     1055Summary: ADD SUMMARY
     1056
     1057Usage: [V8DependentLifeTime] can be specified on interfaces.
     1058{{{
     1059    interface [
     1060        V8DependentLifeTime
     1061    ] XXX {
     1062    }
     1063}}}
     1064
     1065ADD EXPLANATIONS
    8521066
    8531067=== * [CustomEnumerateProperty](i), [CustomDeleteProperty](i) ===
     1068
     1069Summary: [CustomEnumerateProperty] allows us to write custom bindings for the case where properties of a given interface are enumerated.
     1070[CustomDeleteProperty] allows us to write custom bindings for the case where a property of a given interface is deleted.
     1071
     1072Usage: They can be specified on interfaces:
     1073{{{
     1074    interface [
     1075        CustomEnumerateProperty,
     1076        CustomDeleteProperty
     1077    ] XXX {
     1078    }
     1079}}}
     1080
     1081With [CustomEnumerateProperty], you can write custom bindings when properties of XXX are enumerated.
     1082Specifically, you can write JSXXX::getOwnPropertyNames(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1083{{{
     1084    void JSXXX::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
     1085    {
     1086        ...;
     1087    }
     1088}}}
     1089and V8XXX::namedPropertyQuery(...) and V8XXX::namedPropertyEnumerator(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     1090{{{
     1091    v8::Handle<v8::Integer> V8XXX::namedPropertyQuery(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     1092    {
     1093        ...;
     1094    }
     1095
     1096    v8::Handle<v8::Array> V8XXX::namedPropertyEnumerator(const v8::AccessorInfo& info)
     1097    {
     1098        ...;
     1099    }
     1100}}}
     1101
     1102With [CustomDeleteProperty], you can write custom bindings for the case where a property of XXX is deleted.
     1103Specifically, you can write JSXXX::deleteProperty(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1104{{{
     1105    bool JSXXX::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
     1106    {
     1107        ...;
     1108    }
     1109}}}
     1110and V8XXX::namedPropertyDeleter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     1111{{{
     1112    v8::Handle<v8::Boolean> V8XXX::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     1113    {
     1114        ...;
     1115    }
     1116}}}
    8541117
    8551118=== * [IsWorkerContext](i) ===
     
    8661129}}}
    8671130
    868 
    8691131=== * [CustomCall](i) ===
     1132
     1133Summary: [CustomCall] allows us to write custom bindings for call(...) of a given interface.
     1134
     1135Usage: [CustomCall] can be specified on interfaces:
     1136{{{
     1137    interface [
     1138        CustomCall
     1139    ] XXX {
     1140    }
     1141}}}
     1142
     1143If you want to write custom bindings for XXX.call(...), you can use [CustomCall].
     1144
     1145 * In JavaScriptCore, you can write JSXXX::getCallData(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1146{{{
     1147    JSC::CallType JSXXX::getCallData(JSC::JSCell* cell, JSC::CallData& callData)
     1148    {
     1149        ...;
     1150    }
     1151}}}
     1152 * In V8, you can write V8XXX::callAsFunctionCallback(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
     1153{{{
     1154    v8::Handle<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args)
     1155    {
     1156        ...;
     1157    }
     1158}}}
    8701159
    8711160=== * [JSCustomToNativeObject](i), [JSCustomFinalize](i), [JSCustomIsReachable](i), [JSCustomMarkFunction](i), [JSCustomNamedGetterOnPrototype](i), [JSCustomPushEventHandlerScope](i), [JSCustomDefineOwnProperty](i), [JSCustomDefineOwnPropertyOnPrototype](i), [JSCustomGetOwnPropertySlotAndDescriptor](i) ===
     
    10221311}}}
    10231312
    1024 === * [JSNoStaticTables](i) ===
     1313=== * [JSNoStaticTables](i) FIXME ===
    10251314
    10261315Summary: ADD SUMMARY