Changes between Version 39 and Version 40 of WebKitIDL
- Timestamp:
- Feb 19, 2012 9:59:47 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebKitIDL
v39 v40 1 1 = THIS DOCUMENT IS STILL DRAFT = 2 3 [#naming-rules naming rules] 2 4 3 5 = Overview = … … 90 92 * CPP: WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.h, WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.cpp 91 93 92 = Basic naming rules of IDL attribute = 94 = Basic naming rules of IDL attribute = [=#naming-rules] 93 95 94 96 There are a few rules of IDL attribute naming: … … 170 172 void func2(in int a, in int b, in [Optional=DefaultIsUndefined] int c); 171 173 void func3(in int a, in int b, in [Optional=DefaultIsUndefined] DOMString c, in [Optional=DefaultIsNullString] DOMString d); 172 } 174 }; 173 175 }}} 174 176 … … 198 200 ] HTMLFoo { 199 201 void func(in int a, in [Callback] int b); 200 } 202 }; 201 203 }}} 202 204 … … 237 239 interface XXX { 238 240 [JSCustom] void func(in int a, in int b); 239 } 241 }; 240 242 }}} 241 243 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: … … 253 255 interface XXX { 254 256 attribute [JSCustomGetter] DOMString str; 255 } 257 }; 256 258 }}} 257 259 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: … … 269 271 interface XXX { 270 272 attribute [JSCustomSetter] DOMString str; 271 } 273 }; 272 274 }}} 273 275 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: … … 285 287 interface XXX { 286 288 [V8Custom] void func(in int a, in int b); 287 } 289 }; 288 290 }}} 289 291 You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature: … … 301 303 interface XXX { 302 304 attribute [V8CustomGetter] DOMString str; 303 } 305 }; 304 306 }}} 305 307 You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature: … … 317 319 interface XXX { 318 320 attribute [V8CustomSetter] DOMString str; 319 } 321 }; 320 322 }}} 321 323 You need to prepare WebCore/bindings/v8/custom/V8XXXCustom.cpp and write custom bindings in the following signature: … … 344 346 [CallWith=ScriptArguments|CallStack] void func3(in int a, in int b); 345 347 [CallWith=CallStack|ScriptArguments] void func4(in int a, in int b); 346 } 348 }; 347 349 }}} 348 350 [CallWith] can be specified on interfaces but it has a different meaning. Refer to the [Constructor] section for [CallWith] on interfaces. … … 360 362 HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called. 361 363 362 == [Check AccessToNode](m,a) ==364 == [CheckSecurityForNode](m,a) == 363 365 364 366 Summary: It checks if a given Node access is allowed in terms of security. 365 367 366 Usage: [Check AccessToNode] can be specified on methods and attributes:367 {{{ 368 attribute [Check AccessToNode] Node contentDocument;369 [Check AccessToNode] SVGDocument getSVGDocument();368 Usage: [CheckSecurityForNode] can be specified on methods and attributes: 369 {{{ 370 attribute [CheckSecurityForNode] Node contentDocument; 371 [CheckSecurityForNode] SVGDocument getSVGDocument(); 370 372 }}} 371 373 372 374 In 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 [Check AccessToNode].375 If the security check is needed, you should specify [CheckSecurityForNode]. 374 376 This is really important for security. 375 377 … … 446 448 interface DOMWindow { 447 449 attribute [Replaceable] screenX; 448 } 450 }; 449 451 }}} 450 452 … … 499 501 attribute [CachedAttribute] DOMString normalValue; 500 502 attribute [CachedAttribute] SerializedScriptValue serializedValue; 501 } 503 }; 502 504 }}} 503 505 … … 599 601 Usage: The possible usage is 600 602 {{{ 601 interface [Supplemental=YYY] XXX { ... } 603 interface [ 604 Supplemental=YYY 605 ] XXX { 606 }; 602 607 }}} 603 608 where XXX implements YYY. [Supplemental] can be specified on interfaces. … … 646 651 CallWith=ScriptExecutionContext|ScriptState 647 652 ] XXX { 648 } 653 }; 649 654 }}} 650 655 … … 709 714 attribute DOMString str1; 710 715 attribute [InitializedByEventConstructor] DOMString str2; 711 } 716 }; 712 717 }}} 713 718 … … 749 754 NamedConstructor=Audio() 750 755 ] HTMLAudioElement { 751 } 756 }; 752 757 }}} 753 758 … … 767 772 ConstractorParameters=4 768 773 ] XXX { 769 } 774 }; 770 775 }}} 771 776 … … 792 797 ConstructorParameters=2 793 798 ] XXX { 794 } 799 }; 795 800 }}} 796 801 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: … … 810 815 ConstructorParameters=2 811 816 ] XXX { 812 } 817 }; 813 818 }}} 814 819 You need to prepare WebCore/bindings/v8/custom/V8XXXConstructor.cpp and write custom bindings: … … 834 839 Conditional=INDEXED_DATABASE 835 840 ] XXX { 836 } 841 }; 837 842 }}} 838 843 {{{ … … 840 845 attribute [Conditional=INDEXED_DATABASE] DOMString str; 841 846 [Conditional=INDEXED_DATABASE] void open(); 842 } 847 }; 843 848 }}} 844 849 … … 860 865 V8EnabledAtRuntime 861 866 ] XXX { 862 } 867 }; 863 868 }}} 864 869 {{{ … … 868 873 [V8EnabledAtRuntime] void open1(); 869 874 [V8EnabledAtRuntime=foo] void open2(); 870 } 875 }; 871 876 }}} 872 877 … … 896 901 CustomToJSObject 897 902 ] XXX { 898 } 903 }; 899 904 }}} 900 905 … … 919 924 }}} 920 925 921 == [Check AccessToFrame](i), [DoNotCheckAccessToFrame](m,a), [DoNotCheckAccessToFrameOnGetter](a), [DoNotCheckAccessToFrameOnSetter](a) ==926 == [CheckSecurity](i), [DoNotCheckSecurity](m,a), [DoNotCheckSecurityOnGetter](a), [DoNotCheckSecurityOnSetter](a) == 922 927 923 928 Summary: It checks if a given Frame access is allowed or not, in terms of security. 924 929 925 Usage: [Check AccessToFrame] can be specified on interfaces.926 [DoNotCheck AccessToFrame] can be specified on methods or attributes which belong to interfaces which have [CheckAccessToFrame].927 [DoNotCheck AccessToFrameOnGetter] and [DoNotCheckAccessToFrameOnSetter] can be specified on attributes928 which belong to interfaces which have [Check AccessToFrame]:929 {{{ 930 interface [ 931 Check AccessToFrame930 Usage: [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 933 which belong to interfaces which have [CheckSecurity]: 934 {{{ 935 interface [ 936 CheckSecurity 932 937 ] DOMWindow { 933 938 attribute DOMString str1; 934 attribute [DoNotCheck AccessToFrame] DOMString str2:935 attribute [DoNotCheck AccessToFrameOnGetter] DOMString str3:936 attribute [DoNotCheck AccessToFrameOnSetter] DOMString str4:939 attribute [DoNotCheckSecurity] DOMString str2: 940 attribute [DoNotCheckSecurityOnGetter] DOMString str3: 941 attribute [DoNotCheckSecurityOnSetter] DOMString str4: 937 942 void func1(); 938 [DoNotCheck AccessToFrame] void func2();939 } 943 [DoNotCheckSecurity] void func2(); 944 }; 940 945 }}} 941 946 942 947 Consider the case where you access window.parent from inside iframe which comes from a different origin. 943 948 While it is allowed to access window.parent, it is not allowed to access window.parent.document. 944 In such cases, you need to specify [Check AccessToFrame] in order to check949 In such cases, you need to specify [CheckSecurity] in order to check 945 950 whether a given Frame is allowed to access the attribute or method. 946 951 This is really important for security. 947 952 948 If you specify [Check AccessToFrame] on an interface, the security check is enabled on all the attributes and methods in the interface.953 If you specify [CheckSecurity] on an interface, the security check is enabled on all the attributes and methods in the interface. 949 954 To disable the security check for some attribute or method, you can use 950 [DoNotCheck AccessToFrame], [DoNotCheckAccessToFrameOnGetter] or [DoNotCheckAccessToFrameOnSetter].951 952 * [DoNotCheck AccessToFrame] on a method disables the security check for the method.953 * [DoNotCheck AccessToFrame] on an attribute disables the security check for a getter and setter of the attribute.954 * [DoNotCheck AccessToFrameOnGetter] on an attribute disables the security check for a getter of the attribute.955 * [DoNotCheck AccessToFrameOnSetter] on an attribute disables the security check for a setter of the attribute.956 * [DoNotCheck AccessToFrame] 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]. 957 962 958 963 == [IndexedGetter](i) == … … 967 972 IndexedGetter 968 973 ] XXX { 969 } 974 }; 970 975 }}} 971 976 … … 984 989 CustomIndexedSetter 985 990 ] XXX { 986 } 991 }; 987 992 }}} 988 993 … … 1016 1021 NamedGetter 1017 1022 ] XXX { 1018 } 1023 }; 1019 1024 }}} 1020 1025 … … 1034 1039 CustomNamedSetter 1035 1040 ] XXX { 1036 } 1041 }; 1037 1042 }}} 1038 1043 … … 1084 1089 EventTarget 1085 1090 ] XXX { 1086 } 1091 }; 1087 1092 }}} 1088 1093 … … 1100 1105 const unsigned short NOT_FOUND_ERR = 123; 1101 1106 const unsigned short SYNTAX_ERR = 124; 1102 } 1107 }; 1103 1108 }}} 1104 1109 … … 1121 1126 ActiveDOMObject 1122 1127 ] XMLHttpRequest { 1123 } 1128 }; 1124 1129 }}} 1125 1130 … … 1139 1144 V8DependentLifeTime 1140 1145 ] XXX { 1141 } 1146 }; 1142 1147 }}} 1143 1148 … … 1155 1160 CustomDeleteProperty 1156 1161 ] XXX { 1157 } 1162 }; 1158 1163 }}} 1159 1164 … … 1205 1210 ] SharedWorkerContext { 1206 1211 ...; 1207 } 1212 }; 1208 1213 }}} 1209 1214 … … 1217 1222 CustomCall 1218 1223 ] XXX { 1219 } 1224 }; 1220 1225 }}} 1221 1226 … … 1254 1259 JSCustomGetOwnPropertySlotAndDescriptor 1255 1260 ] XXX { 1256 } 1261 }; 1257 1262 }}} 1258 1263 … … 1340 1345 JSGenerateToNativeObject 1341 1346 ] XXX { 1342 } 1347 }; 1343 1348 }}} 1344 1349 … … 1356 1361 JSCustomHeader 1357 1362 ] XXX { 1358 } 1363 }; 1359 1364 }}} 1360 1365 … … 1373 1378 JSLegacyParent=JSDOMWindowBase 1374 1379 ] DOMWindow { 1375 } 1380 }; 1376 1381 }}} 1377 1382 … … 1387 1392 JSInlineGetOwnPropertySlot 1388 1393 ] XXX { 1389 } 1394 }; 1390 1395 }}} 1391 1396 … … 1399 1404 JSNoStaticTables 1400 1405 ] XXX { 1401 } 1406 }; 1402 1407 }}} 1403 1408