Changeset 58298 in webkit
- Timestamp:
- Apr 27, 2010 2:12:18 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58296 r58298 1 2010-04-27 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove custom bindings for TreeWalker 6 https://bugs.webkit.org/show_bug.cgi?id=38182 7 8 This custom code is just CallWith=ScriptState. 9 10 * WebCore.gypi: 11 * bindings/js/JSTreeWalkerCustom.cpp: 12 (WebCore::JSTreeWalker::markChildren): 13 * bindings/scripts/CodeGeneratorJS.pm: 14 * bindings/scripts/CodeGeneratorV8.pm: 15 * bindings/scripts/test/TestObj.idl: 16 * bindings/v8/custom/V8TreeWalkerCustom.cpp: Removed. 17 * dom/TreeWalker.idl: 18 1 19 2010-04-27 Eric Seidel <eric@webkit.org> 2 20 -
trunk/WebCore/WebCore.gypi
r58236 r58298 788 788 'bindings/v8/custom/V8StyleSheetCustom.cpp', 789 789 'bindings/v8/custom/V8StyleSheetListCustom.cpp', 790 'bindings/v8/custom/V8TreeWalkerCustom.cpp',791 790 'bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp', 792 791 'bindings/v8/custom/V8WebKitPointConstructor.cpp', -
trunk/WebCore/bindings/js/JSTreeWalkerCustom.cpp
r47022 r58298 37 37 filter->markAggregate(markStack); 38 38 } 39 40 JSValue JSTreeWalker::parentNode(ExecState* exec, const ArgList&)41 {42 Node* node = impl()->parentNode(exec);43 if (exec->hadException())44 return jsUndefined();45 return toJS(exec, node);46 }47 48 JSValue JSTreeWalker::firstChild(ExecState* exec, const ArgList&)49 {50 Node* node = impl()->firstChild(exec);51 if (exec->hadException())52 return jsUndefined();53 return toJS(exec, node);54 }55 56 JSValue JSTreeWalker::lastChild(ExecState* exec, const ArgList&)57 {58 Node* node = impl()->lastChild(exec);59 if (exec->hadException())60 return jsUndefined();61 return toJS(exec, node);62 }63 64 JSValue JSTreeWalker::nextSibling(ExecState* exec, const ArgList&)65 {66 Node* node = impl()->nextSibling(exec);67 if (exec->hadException())68 return jsUndefined();69 return toJS(exec, node);70 }71 72 JSValue JSTreeWalker::previousSibling(ExecState* exec, const ArgList&)73 {74 Node* node = impl()->previousSibling(exec);75 if (exec->hadException())76 return jsUndefined();77 return toJS(exec, node);78 }79 80 JSValue JSTreeWalker::previousNode(ExecState* exec, const ArgList&)81 {82 Node* node = impl()->previousNode(exec);83 if (exec->hadException())84 return jsUndefined();85 return toJS(exec, node);86 }87 88 JSValue JSTreeWalker::nextNode(ExecState* exec, const ArgList&)89 {90 Node* node = impl()->nextNode(exec);91 if (exec->hadException())92 return jsUndefined();93 return toJS(exec, node);94 }95 39 96 40 } -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r58296 r58298 1705 1705 1706 1706 my $callWith = $function->signature->extendedAttributes->{"CallWith"}; 1707 if ($callWith && $callWith eq "DynamicFrame") { 1708 push(@implContent, " Frame* dynamicFrame = toDynamicFrame(exec);\n"); 1709 push(@implContent, " if (!dynamicFrame)\n"); 1710 push(@implContent, " return jsUndefined();\n"); 1707 if ($callWith) { 1708 my $callWithArg = "COMPILE_ASSERT(false)"; 1709 if ($callWith eq "DynamicFrame") { 1710 push(@implContent, " Frame* dynamicFrame = toDynamicFrame(exec);\n"); 1711 push(@implContent, " if (!dynamicFrame)\n"); 1712 push(@implContent, " return jsUndefined();\n"); 1713 $callWithArg = "dynamicFrame"; 1714 } elsif ($callWith eq "ScriptState") { 1715 $callWithArg = "exec"; 1716 } 1711 1717 $functionString .= ", " if $paramIndex; 1712 $functionString .= "dynamicFrame";1718 $functionString .= $callWithArg; 1713 1719 $paramIndex++; 1714 1720 } … … 1886 1892 } else { 1887 1893 push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, "", $functionString, "castedThisObj") . ";\n"); 1894 $callWith = $function->signature->extendedAttributes->{"CallWith"}; 1895 if ($callWith and $callWith eq "ScriptState") { 1896 push(@implContent, $indent . "if (exec->hadException())\n"); 1897 push(@implContent, $indent . " return jsUndefined();\n"); 1898 } 1888 1899 push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; 1889 1900 -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r58295 r58298 2334 2334 2335 2335 my $index = 0; 2336 my $hasScriptState = 0; 2336 2337 2337 2338 my $callWith = $function->signature->extendedAttributes->{"CallWith"}; 2338 if ($callWith && $callWith eq "DynamicFrame") { 2339 $result .= $indent . "Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();\n"; 2340 $result .= $indent . "if (!enteredFrame)\n"; 2341 $result .= $indent . " return v8::Undefined();\n"; 2339 if ($callWith) { 2340 my $callWithArg = "COMPILE_ASSERT(false)"; 2341 if ($callWith eq "DynamicFrame") { 2342 $result .= $indent . "Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();\n"; 2343 $result .= $indent . "if (!enteredFrame)\n"; 2344 $result .= $indent . " return v8::Undefined();\n"; 2345 $callWithArg = "enteredFrame"; 2346 } elsif ($callWith eq "ScriptState") { 2347 $result .= $indent . "EmptyScriptState state;\n"; 2348 $callWithArg = "&state"; 2349 $hasScriptState = 1; 2350 } 2342 2351 $functionString .= ", " if $index; 2343 $functionString .= "enteredFrame";2352 $functionString .= $callWithArg; 2344 2353 $index++; 2345 2354 $numberOfParameters++ … … 2398 2407 } elsif ($returnsListItemPodType) { 2399 2408 $result .= $indent . "RefPtr<SVGPODListItem<$nativeReturnType> > result = $functionString;\n"; 2400 } elsif ( @{$function->raisesExceptions} or $returnsPodType or $isPodType or IsSVGTypeNeedingContextParameter($returnType)) {2409 } elsif ($hasScriptState or @{$function->raisesExceptions} or $returnsPodType or $isPodType or IsSVGTypeNeedingContextParameter($returnType)) { 2401 2410 $result .= $indent . $nativeReturnType . " result = $functionString;\n"; 2402 2411 } else { … … 2406 2415 } 2407 2416 2417 if ($hasScriptState) { 2418 $result .= $indent . "if (state.hadException())\n"; 2419 $result .= $indent . " return throwError(state.exception());\n" 2420 } 2421 2408 2422 if (@{$function->raisesExceptions}) { 2409 $result .= $indent . "if (UNLIKELY(ec))\n" . $indent . " goto fail;\n"; 2423 $result .= $indent . "if (UNLIKELY(ec))\n"; 2424 $result .= $indent . " goto fail;\n"; 2410 2425 } 2411 2426 -
trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
r58295 r58298 184 184 WebCore::TestObj * item = WebKit::core(self); 185 185 item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg); 186 187 } 188 189 void 190 webkit_dom_test_obj_with_script_state_void (WebKitDOMTestObj *self) 191 { 192 g_return_if_fail (self); 193 WebCore::TestObj * item = WebKit::core(self); 194 item->withScriptStateVoid(); 195 196 } 197 198 WebKitDOMTestObj* 199 webkit_dom_test_obj_with_script_state_obj (WebKitDOMTestObj *self) 200 { 201 g_return_val_if_fail (self, 0); 202 WebCore::TestObj * item = WebKit::core(self); 203 PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObj()); 204 WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get())); 205 return res; 186 206 187 207 } -
trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
r58295 r58298 87 87 88 88 WEBKIT_API void 89 webkit_dom_test_obj_with_script_state_void (WebKitDOMTestObj *self); 90 91 WEBKIT_API WebKitDOMTestObj* 92 webkit_dom_test_obj_with_script_state_obj (WebKitDOMTestObj *self); 93 94 WEBKIT_API void 89 95 webkit_dom_test_obj_method_with_optional_arg (WebKitDOMTestObj *self, glong opt); 90 96 -
trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r58295 r58298 129 129 #endif 130 130 131 static const HashTableValue JSTestObjPrototypeTableValues[ 19] =131 static const HashTableValue JSTestObjPrototypeTableValues[21] = 132 132 { 133 133 { "voidMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) }, … … 146 146 { "withDynamicFrameAndUserGesture", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1 THUNK_GENERATOR(0) }, 147 147 { "withDynamicFrameAndUserGestureASAD", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2 THUNK_GENERATOR(0) }, 148 { "withScriptStateVoid", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0 THUNK_GENERATOR(0) }, 149 { "withScriptStateObj", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0 THUNK_GENERATOR(0) }, 148 150 { "methodWithOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) }, 149 151 { "methodWithNonOptionalArgAndOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) }, … … 582 584 } 583 585 586 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 587 { 588 UNUSED_PARAM(args); 589 if (!thisValue.inherits(&JSTestObj::s_info)) 590 return throwError(exec, TypeError); 591 JSTestObj* castedThisObj = static_cast<JSTestObj*>(asObject(thisValue)); 592 TestObj* imp = static_cast<TestObj*>(castedThisObj->impl()); 593 594 imp->withScriptStateVoid(exec); 595 return jsUndefined(); 596 } 597 598 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 599 { 600 UNUSED_PARAM(args); 601 if (!thisValue.inherits(&JSTestObj::s_info)) 602 return throwError(exec, TypeError); 603 JSTestObj* castedThisObj = static_cast<JSTestObj*>(asObject(thisValue)); 604 TestObj* imp = static_cast<TestObj*>(castedThisObj->impl()); 605 606 607 JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->withScriptStateObj(exec))); 608 if (exec->hadException()) 609 return jsUndefined(); 610 return result; 611 } 612 584 613 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) 585 614 { -
trunk/WebCore/bindings/scripts/test/JS/JSTestObj.h
r58295 r58298 101 101 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); 102 102 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); 103 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); 104 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); 103 105 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); 104 106 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); -
trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
r58295 r58298 66 66 - (void)withDynamicFrameAndUserGesture:(int)intArg; 67 67 - (void)withDynamicFrameAndUserGestureASAD:(int)intArg optionalArg:(int)optionalArg; 68 - (void)withScriptStateVoid; 69 - (DOMTestObj *)withScriptStateObj; 68 70 - (void)methodWithOptionalArg:(int)opt; 69 71 - (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt; -
trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
r58295 r58298 234 234 } 235 235 236 - (void)withScriptStateVoid 237 { 238 IMPL->withScriptStateVoid(); 239 } 240 241 - (DOMTestObj *)withScriptStateObj 242 { 243 return kit(WTF::getPtr(IMPL->withScriptStateObj())); 244 } 245 236 246 - (void)methodWithOptionalArg:(int)opt 237 247 { -
trunk/WebCore/bindings/scripts/test/TestObj.idl
r58295 r58298 67 67 [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGesture(in long intArg); 68 68 [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGestureASAD(in long intArg, in [Optional] long optionalArg); 69 [CallWith=ScriptState] void withScriptStateVoid(); 70 [CallWith=ScriptState] TestObj withScriptStateObj(); 69 71 70 72 // 'Optional' extended attribute -
trunk/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r58295 r58298 329 329 imp->withDynamicFrameAndUserGestureASAD(enteredFrame, intArg, optionalArg, processingUserGesture()); 330 330 return v8::Handle<v8::Value>(); 331 } 332 333 static v8::Handle<v8::Value> withScriptStateVoidCallback(const v8::Arguments& args) 334 { 335 INC_STATS("DOM.TestObj.withScriptStateVoid"); 336 TestObj* imp = V8TestObj::toNative(args.Holder()); 337 EmptyScriptState state; 338 imp->withScriptStateVoid(&state); 339 if (state->hadException()) 340 return throwError(state->exception()); 341 return v8::Handle<v8::Value>(); 342 } 343 344 static v8::Handle<v8::Value> withScriptStateObjCallback(const v8::Arguments& args) 345 { 346 INC_STATS("DOM.TestObj.withScriptStateObj"); 347 TestObj* imp = V8TestObj::toNative(args.Holder()); 348 EmptyScriptState state; 349 RefPtr<TestObj> result = imp->withScriptStateObj(&state); 350 if (state->hadException()) 351 return throwError(state->exception()); 352 return toV8(result.release()); 331 353 } 332 354 … … 466 488 {"withDynamicFrameAndUserGesture", TestObjInternal::withDynamicFrameAndUserGestureCallback}, 467 489 {"withDynamicFrameAndUserGestureASAD", TestObjInternal::withDynamicFrameAndUserGestureASADCallback}, 490 {"withScriptStateVoid", TestObjInternal::withScriptStateVoidCallback}, 491 {"withScriptStateObj", TestObjInternal::withScriptStateObjCallback}, 468 492 {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback}, 469 493 {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback}, -
trunk/WebCore/dom/TreeWalker.idl
r52537 r58298 32 32 setter raises(DOMException); 33 33 34 [C ustom] Node parentNode();35 [C ustom] Node firstChild();36 [C ustom] Node lastChild();37 [C ustom] Node previousSibling();38 [C ustom] Node nextSibling();39 [C ustom] Node previousNode();40 [C ustom] Node nextNode();34 [CallWith=ScriptState] Node parentNode(); 35 [CallWith=ScriptState] Node firstChild(); 36 [CallWith=ScriptState] Node lastChild(); 37 [CallWith=ScriptState] Node previousSibling(); 38 [CallWith=ScriptState] Node nextSibling(); 39 [CallWith=ScriptState] Node previousNode(); 40 [CallWith=ScriptState] Node nextNode(); 41 41 }; 42 42
Note: See TracChangeset
for help on using the changeset viewer.