Changeset 152466 in webkit
- Timestamp:
- Jul 8, 2013 2:24:33 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152463 r152466 1 2013-07-08 Radu Stavila <stavila@adobe.com> 2 3 NamedFlowCollection getters should return undefined when there's no NamedFlow 4 https://bugs.webkit.org/show_bug.cgi?id=118463 5 6 Reviewed by Christophe Dumez. 7 8 Added test that validates that NamedFlowCollection getters return undefined 9 when no named flows exist. 10 11 * fast/regions/webkit-named-flow-collection-undefined-expected.txt: Added. 12 * fast/regions/webkit-named-flow-collection-undefined.html: Added. 13 1 14 2013-07-08 David Farler <dfarler@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r152465 r152466 1 2013-07-08 Radu Stavila <stavila@adobe.com> 2 3 NamedFlowCollection getters should return undefined when there's no NamedFlow 4 https://bugs.webkit.org/show_bug.cgi?id=118463 5 6 Reviewed by Christophe Dumez. 7 8 Added new TreatReturnedNullObjectAs attribute for generated methods and set it to Undefined 9 for the item and namedItem methods of DOMNamedFlowCollection. 10 11 Test: fast/regions/webkit-named-flow-collection-undefined.html 12 13 * bindings/scripts/CodeGeneratorJS.pm: 14 (GenerateImplementationFunctionCall): 15 * bindings/scripts/IDLAttributes.txt: 16 * bindings/scripts/test/CPP/WebDOMTestObj.cpp: 17 (WebDOMTestObj::treatReturnedNullObjectAsUndefined): 18 * bindings/scripts/test/CPP/WebDOMTestObj.h: 19 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: 20 (webkit_dom_test_obj_treat_returned_null_object_as_undefined): 21 * bindings/scripts/test/GObject/WebKitDOMTestObj.h: 22 * bindings/scripts/test/JS/JSTestObj.cpp: 23 (WebCore::jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined): 24 * bindings/scripts/test/JS/JSTestObj.h: 25 * bindings/scripts/test/ObjC/DOMTestObj.h: 26 * bindings/scripts/test/ObjC/DOMTestObj.mm: 27 (-[DOMTestObj treatReturnedNullObjectAsUndefined]): 28 * bindings/scripts/test/TestObj.idl: 29 * dom/DOMNamedFlowCollection.idl: 30 1 31 2013-07-06 Changhun Kang <temoochin@company100.net> 2 32 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r152435 r152466 3345 3345 } 3346 3346 3347 if ($function->signature->extendedAttributes->{"TreatReturnedNullObjectAs"} and $function->signature->extendedAttributes->{"TreatReturnedNullObjectAs"} eq "Undefined") { 3348 push(@implContent, $indent . "if (result == jsNull())\n"); 3349 push(@implContent, $indent . " result = jsUndefined();\n\n"); 3350 } 3351 3347 3352 push(@implContent, $indent . "return JSValue::encode(result);\n"); 3348 3353 } -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r152168 r152466 103 103 SuppressToJSObject 104 104 TreatNullAs=NullString 105 TreatReturnedNullObjectAs=Undefined 105 106 TreatReturnedNullStringAs=Null|Undefined 106 107 TreatUndefinedAs=NullString -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
r151563 r152466 991 991 #endif 992 992 993 WebDOMTestObj WebDOMTestObj::treatReturnedNullObjectAsUndefined() 994 { 995 if (!impl()) 996 return WebDOMTestObj(); 997 998 return toWebKit(WTF::getPtr(impl()->treatReturnedNullObjectAsUndefined())); 999 } 1000 993 1001 void WebDOMTestObj::classMethod() 994 1002 { -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
r151563 r152466 189 189 void conditionalMethod3(); 190 190 #endif 191 WebDOMTestObj treatReturnedNullObjectAsUndefined(); 191 192 void classMethod(); 192 193 int classMethodWithOptional(int arg); -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
r151563 r152466 1414 1414 } 1415 1415 1416 WebKitDOMTestObj* 1417 webkit_dom_test_obj_treat_returned_null_object_as_undefined(WebKitDOMTestObj* self) 1418 { 1419 WebCore::JSMainThreadNullState state; 1420 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0); 1421 WebCore::TestObj* item = WebKit::core(self); 1422 RefPtr<WebCore::TestObj> gobjectResult = WTF::getPtr(item->treatReturnedNullObjectAsUndefined()); 1423 return WebKit::kit(gobjectResult.get()); 1424 } 1425 1416 1426 void 1417 1427 webkit_dom_test_obj_class_method(WebKitDOMTestObj* self) -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
r151563 r152466 406 406 407 407 /** 408 * webkit_dom_test_obj_treat_returned_null_object_as_undefined: 409 * @self: A #WebKitDOMTestObj 410 * 411 * Returns: (transfer none): 412 * 413 **/ 414 WEBKIT_API WebKitDOMTestObj* 415 webkit_dom_test_obj_treat_returned_null_object_as_undefined(WebKitDOMTestObj* self); 416 417 /** 408 418 * webkit_dom_test_obj_class_method: 409 419 * @self: A #WebKitDOMTestObj -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r151978 r152466 320 320 { "conditionalMethod3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0, NoIntrinsic }, 321 321 #endif 322 { "treatReturnedNullObjectAsUndefined", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined), (intptr_t)0, NoIntrinsic }, 322 323 { "overloadedMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2, NoIntrinsic }, 323 324 { "classMethodWithClamp", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithClamp), (intptr_t)2, NoIntrinsic }, … … 2504 2505 2505 2506 #endif 2507 2508 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined(ExecState* exec) 2509 { 2510 JSValue thisValue = exec->hostThisValue(); 2511 if (!thisValue.inherits(&JSTestObj::s_info)) 2512 return throwVMTypeError(exec); 2513 JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); 2514 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 2515 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 2516 2517 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->treatReturnedNullObjectAsUndefined())); 2518 if (result == jsNull()) 2519 result = jsUndefined(); 2520 2521 return JSValue::encode(result); 2522 } 2506 2523 2507 2524 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r151832 r152466 210 210 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(JSC::ExecState*); 211 211 #endif 212 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTreatReturnedNullObjectAsUndefined(JSC::ExecState*); 212 213 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(JSC::ExecState*); 213 214 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(JSC::ExecState*); -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
r151832 r152466 168 168 - (void)conditionalMethod3; 169 169 #endif 170 - (DOMTestObj *)treatReturnedNullObjectAsUndefined; 170 171 - (void)classMethod; 171 172 - (int)classMethodWithOptional:(int)arg; -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
r151832 r152466 1053 1053 #endif 1054 1054 1055 - (DOMTestObj *)treatReturnedNullObjectAsUndefined 1056 { 1057 WebCore::JSMainThreadNullState state; 1058 return kit(WTF::getPtr(IMPL->treatReturnedNullObjectAsUndefined())); 1059 } 1060 1055 1061 - (void)classMethod 1056 1062 { -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r152154 r152466 168 168 [Conditional=Condition1] const unsigned short CONDITIONAL_CONST = 0; 169 169 170 // 'TreatReturnedNullObjectAs' extended method 171 [TreatReturnedNullObjectAs=Undefined] TestObj treatReturnedNullObjectAsUndefined(); 172 170 173 #if defined(TESTING_JS) 171 174 [CachedAttribute] readonly attribute any cachedAttribute1; -
trunk/Source/WebCore/dom/DOMNamedFlowCollection.idl
r151499 r152466 36 36 ] interface DOMNamedFlowCollection { 37 37 readonly attribute unsigned long length; 38 getter WebKitNamedFlow item(unsigned long index);39 getter WebKitNamedFlow namedItem(DOMString name);38 [TreatReturnedNullObjectAs=Undefined] getter WebKitNamedFlow item(unsigned long index); 39 [TreatReturnedNullObjectAs=Undefined] getter WebKitNamedFlow namedItem(DOMString name); 40 40 };
Note: See TracChangeset
for help on using the changeset viewer.