Changeset 66875 in webkit


Ignore:
Timestamp:
Sep 7, 2010 4:14:33 AM (14 years ago)
Author:
kent.hansen@nokia.com
Message:

2010-09-07 Kent Hansen <kent.hansen@nokia.com>

Reviewed by Andreas Kling.

[Qt] tst_QWebFrame::connectAndDisconnect() fails on WebKit trunk because qt_sender is never set
https://bugs.webkit.org/show_bug.cgi?id=44697

When the signal handler is a JS function, qt_sender is stuffed into a temporary
object that's pushed onto the function's scope before the function is invoked, and
popped again afterwards.

We were pushing this new scope object _after_ calling JSFunction::getCallData(),
and relying on JSC::call() to use the fresh scope chain from the function object.
However, this is no longer the case; JSC::call() uses the scope chain passed in
the CallData argument. Hence, we need to set up the scope before the function's
CallData is queried.

  • bridge/qt/qt_runtime.cpp: (JSC::Bindings::QtConnectionObject::execute):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66869 r66875  
     12010-09-07  Kent Hansen  <kent.hansen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] tst_QWebFrame::connectAndDisconnect() fails on WebKit trunk because __qt_sender__ is never set
     6        https://bugs.webkit.org/show_bug.cgi?id=44697
     7
     8        When the signal handler is a JS function, __qt_sender__ is stuffed into a temporary
     9        object that's pushed onto the function's scope before the function is invoked, and
     10        popped again afterwards.
     11
     12        We were pushing this new scope object _after_ calling JSFunction::getCallData(),
     13        and relying on JSC::call() to use the fresh scope chain from the function object.
     14        However, this is no longer the case; JSC::call() uses the scope chain passed in
     15        the CallData argument. Hence, we need to set up the scope before the function's
     16        CallData is queried.
     17
     18        * bridge/qt/qt_runtime.cpp:
     19        (JSC::Bindings::QtConnectionObject::execute):
     20
    1212010-09-07  Kwang Yul Seo  <skyul@company100.net>
    222
  • trunk/WebCore/bridge/qt/qt_runtime.cpp

    r65999 r66875  
    17941794                        }
    17951795                    }
    1796                     CallData callData;
    1797                     CallType callType = m_funcObject->getCallData(callData);
    17981796                    // Stuff in the __qt_sender property, if we can
     1797                    ScopeChain oldsc = ScopeChain(NoScopeChain());
     1798                    JSFunction* fimp = 0;
    17991799                    if (m_funcObject->inherits(&JSFunction::info)) {
    1800                         JSFunction* fimp = static_cast<JSFunction*>(m_funcObject.get());
     1800                        fimp = static_cast<JSFunction*>(m_funcObject.get());
    18011801
    18021802                        JSObject* qt_sender = QtInstance::getQtInstance(sender(), ro, QScriptEngine::QtOwnership)->createRuntimeObject(exec);
     
    18041804                        PutPropertySlot slot;
    18051805                        wrapper->put(exec, Identifier(exec, "__qt_sender__"), qt_sender, slot);
    1806                         ScopeChain oldsc = fimp->scope();
     1806                        oldsc = fimp->scope();
    18071807                        ScopeChain sc = oldsc;
    18081808                        sc.push(wrapper);
    18091809                        fimp->setScope(sc);
    1810 
    1811                         call(exec, fimp, callType, callData, m_thisObject, l);
     1810                    }
     1811
     1812                    CallData callData;
     1813                    CallType callType = m_funcObject->getCallData(callData);
     1814                    call(exec, m_funcObject, callType, callData, m_thisObject, l);
     1815
     1816                    if (fimp)
    18121817                        fimp->setScope(oldsc);
    1813                     } else {
    1814                         call(exec, m_funcObject, callType, callData, m_thisObject, l);
    1815                     }
    18161818                }
    18171819            }
Note: See TracChangeset for help on using the changeset viewer.