Changeset 46444 in webkit
- Timestamp:
- Jul 27, 2009 5:21:00 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r46443 r46444 1 2009-07-27 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 fix more obvious global object lookups 6 https://bugs.webkit.org/show_bug.cgi?id=27745 7 8 No new tests for these changes. I believe in many cases 9 testing to be impossible. Lack of testing justification next to 10 each change below. The remaining pieces of bug 27634 will all 11 need tests. 12 13 * bindings/js/JSDOMWindowBase.cpp: 14 (WebCore::JSDOMWindowBase::updateDocument): not testable. 15 * bindings/js/JSDataGridColumnListCustom.cpp: 16 (WebCore::JSDataGridColumnList::nameGetter): no testing for this incomplete feature. 17 * bindings/js/JSEventListener.cpp: 18 (WebCore::JSEventListener::handleEvent): would require outer frame to trigger an event in the inner frame 19 * bindings/js/JSEventTarget.cpp: 20 (WebCore::toJS): covered by other tests, always correct to pass the globalObject through. 21 * bindings/js/JSHTMLElementCustom.cpp: 22 (WebCore::JSHTMLElement::pushEventHandlerScope): unclear when this could be triggered. 23 * bindings/js/JSHTMLOptionsCollectionCustom.cpp: 24 (WebCore::JSHTMLOptionsCollection::remove): toJS seems superfluous here to begin with. 25 * bindings/js/JSLazyEventListener.cpp: 26 (WebCore::JSLazyEventListener::parseCode): would require outer frame to trigger inner frame event. 27 * bindings/js/ScriptController.cpp: 28 (WebCore::ScriptController::jsObjectForPluginElement): only used for NPAPI binding, unclear how to test. 29 * bindings/js/ScriptEventListener.cpp: 30 (WebCore::createAttributeEventListener): unclear how to test. 31 * bindings/js/ScriptObject.cpp: 32 (WebCore::ScriptGlobalObject::set): unclear how to test/inspector only. 33 * bindings/js/ScriptObjectQuarantine.cpp: 34 (WebCore::getQuarantinedScriptObject): unclear how to test. 35 * bindings/objc/DOMInternal.mm: 36 (-[WebScriptObject _initializeScriptDOMNodeImp]): unclear how to test. 37 1 38 2009-07-27 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> 2 39 -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r46346 r46444 64 64 ASSERT(d()->impl->document()); 65 65 ExecState* exec = globalExec(); 66 symbolTablePutWithAttributes(Identifier(exec, "document"), toJS(exec, d()->impl->document()), DontDelete | ReadOnly);66 symbolTablePutWithAttributes(Identifier(exec, "document"), toJS(exec, this, d()->impl->document()), DontDelete | ReadOnly); 67 67 } 68 68 -
trunk/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
r45338 r46444 47 47 { 48 48 JSDataGridColumnList* thisObj = static_cast<JSDataGridColumnList*>(asObject(slot.slotBase())); 49 return toJS(exec, thisObj-> impl()->itemWithName(propertyName));49 return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyName)); 50 50 } 51 51 -
trunk/WebCore/bindings/js/JSEventListener.cpp
r46431 r46444 72 72 // xmlhttprequest objects. See http://bugs.webkit.org/show_bug.cgi?id=13275 73 73 // FIXME: Is this check still necessary? Requests are supposed to be stopped before clearGlobalObject() is called. 74 ASSERT(globalObject); 74 75 if (!globalObject) 75 76 return; … … 108 109 109 110 MarkedArgumentBuffer args; 110 args.append(toJS(exec, event));111 args.append(toJS(exec, globalObject, event)); 111 112 112 113 Event* savedEvent = globalObject->currentEvent(); … … 128 129 thisValue = globalObject->toThisObject(exec); 129 130 else 130 thisValue = toJS(exec, event->currentTarget());131 thisValue = toJS(exec, globalObject, event->currentTarget()); 131 132 globalObject->globalData()->timeoutChecker.start(); 132 133 retval = call(exec, jsFunction, callType, callData, thisValue, args); -
trunk/WebCore/bindings/js/JSEventTarget.cpp
r46369 r46444 66 66 namespace WebCore { 67 67 68 JSValue toJS(ExecState* exec, JSDOMGlobalObject* , EventTarget* target)68 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget* target) 69 69 { 70 70 if (!target) … … 74 74 // SVGElementInstance supports both toSVGElementInstance and toNode since so much mouse handling code depends on toNode returning a valid node. 75 75 if (SVGElementInstance* instance = target->toSVGElementInstance()) 76 return toJS(exec, instance);76 return toJS(exec, globalObject, instance); 77 77 #endif 78 78 79 79 if (Node* node = target->toNode()) 80 return toJS(exec, node);80 return toJS(exec, globalObject, node); 81 81 82 82 if (DOMWindow* domWindow = target->toDOMWindow()) 83 return toJS(exec, domWindow);83 return toJS(exec, globalObject, domWindow); 84 84 85 85 if (XMLHttpRequest* xhr = target->toXMLHttpRequest()) 86 return toJS(exec, xhr);86 return toJS(exec, globalObject, xhr); 87 87 88 88 if (XMLHttpRequestUpload* upload = target->toXMLHttpRequestUpload()) 89 return toJS(exec, upload);89 return toJS(exec, globalObject, upload); 90 90 91 91 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 92 92 if (DOMApplicationCache* cache = target->toDOMApplicationCache()) 93 return toJS(exec, cache);93 return toJS(exec, globalObject, cache); 94 94 #endif 95 95 96 96 if (MessagePort* messagePort = target->toMessagePort()) 97 return toJS(exec, messagePort);97 return toJS(exec, globalObject, messagePort); 98 98 99 99 #if ENABLE(WORKERS) 100 100 if (Worker* worker = target->toWorker()) 101 return toJS(exec, worker);101 return toJS(exec, globalObject, worker); 102 102 103 103 if (DedicatedWorkerContext* workerContext = target->toDedicatedWorkerContext()) … … 107 107 #if ENABLE(SHARED_WORKERS) 108 108 if (SharedWorker* sharedWorker = target->toSharedWorker()) 109 return toJS(exec, sharedWorker);109 return toJS(exec, globalObject, sharedWorker); 110 110 #endif 111 111 -
trunk/WebCore/bindings/js/JSHTMLElementCustom.cpp
r37705 r46444 39 39 40 40 // The document is put on first, fall back to searching it only after the element and form. 41 scope.push(asObject(toJS(exec, element->ownerDocument())));41 scope.push(asObject(toJS(exec, globalObject(), element->ownerDocument()))); 42 42 43 43 // The form is next, searched before the document, but after the element itself. 44 44 if (HTMLFormElement* form = element->form()) 45 scope.push(asObject(toJS(exec, form)));45 scope.push(asObject(toJS(exec, globalObject(), form))); 46 46 47 47 // The element is on top, searched first. 48 scope.push(asObject(toJS(exec, element)));48 scope.push(asObject(toJS(exec, globalObject(), element))); 49 49 } 50 50 -
trunk/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
r43122 r46444 92 92 { 93 93 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl()); 94 JSHTMLSelectElement* base = static_cast<JSHTMLSelectElement*>(asObject(toJS(exec, imp->base())));94 JSHTMLSelectElement* base = static_cast<JSHTMLSelectElement*>(asObject(toJS(exec, globalObject(), imp->base()))); 95 95 return base->remove(exec, args); 96 96 } -
trunk/WebCore/bindings/js/JSLazyEventListener.cpp
r45383 r46444 118 118 ScopeChain scope = listenerAsFunction->scope(); 119 119 120 JSValue thisObj = toJS(exec, m_ originalNode);120 JSValue thisObj = toJS(exec, m_globalObject, m_originalNode); 121 121 if (thisObj.isObject()) { 122 122 static_cast<JSNode*>(asObject(thisObj))->pushEventHandlerScope(exec, scope); -
trunk/WebCore/bindings/js/ScriptController.cpp
r46431 r46444 328 328 JSLock lock(SilenceAssertionsOnly); 329 329 ExecState* exec = globalObject()->globalExec(); 330 JSValue jsElementValue = toJS(exec, plugin);330 JSValue jsElementValue = toJS(exec, globalObject(), plugin); 331 331 if (!jsElementValue || !jsElementValue.isObject()) 332 332 return 0; -
trunk/WebCore/bindings/js/ScriptEventListener.cpp
r46431 r46444 73 73 { 74 74 JSLock lock(SilenceAssertionsOnly); 75 toJS(globalObject->globalExec(), node); 75 // FIXME: Should pass the global object associated with the node 76 toJS(globalObject->globalExec(), globalObject, node); 76 77 } 77 78 -
trunk/WebCore/bindings/js/ScriptObject.cpp
r46431 r46444 127 127 { 128 128 JSLock lock(SilenceAssertionsOnly); 129 scriptState->lexicalGlobalObject()->putDirect(Identifier(scriptState, name), toJS(scriptState, value)); 129 JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject()); 130 globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value)); 130 131 return handleException(scriptState); 131 132 } -
trunk/WebCore/bindings/js/ScriptObjectQuarantine.cpp
r46431 r46444 70 70 return false; 71 71 72 ExecState* exec = toJSDOMWindow(frame)->globalExec(); 72 JSDOMGlobalObject* globalObject = toJSDOMWindow(frame); 73 ExecState* exec = globalObject->globalExec(); 73 74 74 75 JSLock lock(SilenceAssertionsOnly); 75 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, database))));76 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, globalObject, database)))); 76 77 77 78 return true; … … 85 86 ASSERT(storage); 86 87 87 ExecState* exec = toJSDOMWindow(frame)->globalExec(); 88 JSDOMGlobalObject* globalObject = toJSDOMWindow(frame); 89 ExecState* exec = globalObject->globalExec(); 88 90 89 91 JSLock lock(SilenceAssertionsOnly); 90 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, storage))));92 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, globalObject, storage)))); 91 93 92 94 return true; … … 101 103 102 104 JSLock lock(SilenceAssertionsOnly); 103 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, node)))); 105 // FIXME: Should use some sort of globalObjectFromNode() 106 quarantinedObject = ScriptObject(asObject(JSInspectedObjectWrapper::wrap(exec, toJS(exec, deprecatedGlobalObjectForPrototype(exec), node)))); 104 107 105 108 return true; -
trunk/WebCore/bindings/objc/DOMInternal.mm
r42618 r46444 124 124 if (!frame) 125 125 return; 126 127 JSC::ExecState *exec = frame->script()->globalObject()->globalExec(); 128 126 127 // The global object which should own this node. 128 WebCore::JSDOMGlobalObject* globalObject = frame->script()->globalObject(); 129 JSC::ExecState *exec = globalObject->globalExec(); 130 129 131 // Get (or create) a cached JS object for the DOM node. 130 JSC::JSObject *scriptImp = asObject(WebCore::toJS(exec, nodeImpl));132 JSC::JSObject *scriptImp = asObject(WebCore::toJS(exec, globalObject, nodeImpl)); 131 133 132 134 JSC::Bindings::RootObject* rootObject = frame->script()->bindingRootObject();
Note: See TracChangeset
for help on using the changeset viewer.