Ignore:
Timestamp:
Dec 18, 2008, 10:19:06 AM (16 years ago)
Author:
[email protected]
Message:

2008-12-18 Cameron Zwarich <[email protected]>

Reviewed by Geoff Garen.

Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
<https://bugs.webkit.org/show_bug.cgi?id=21855>
<rdar://problem/6278244>

If JavaScript is not currently executing, the handleEvent member function
of JSAbstractEventListener should set the dynamic global object to the
global object of the context in which the event occurred.


If this is not set, then JavaScriptCore will simply take the global object
of the context where the event handler function was created, which may be
a different frame. This will cause the popup blocker to incorrectly block
windows opened from onclick events inside of an iframe whose handler was
created in the outer frame, as it will check the outer frame and see that
it is not processing any events.

JavaScriptCore:

  • interpreter/Interpreter.cpp:
  • runtime/JSGlobalObject.h: (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):

WebCore:

  • bindings/js/JSEventListener.cpp: (WebCore::JSAbstractEventListener::handleEvent):

WebKitTools:

  • DumpRenderTree/mac/EventSendingController.h:
  • DumpRenderTree/mac/EventSendingController.mm: (+[EventSendingController isSelectorExcludedFromWebScript:]): Expose scheduleAsynchronousClick to JavaScript. (-[EventSendingController scheduleAsynchronousClick]): Add.

LayoutTests:

  • fast/events/popup-blocking-click-in-iframe-expected.txt: Added.
  • fast/events/popup-blocking-click-in-iframe.html: Added.
  • fast/events/resources/popup-blocking-click-in-iframe-otherFrame.html: Added.
  • platform/gtk/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r39374 r39377  
    865865}
    866866
    867 class DynamicGlobalObjectScope : Noncopyable {
    868 public:
    869     DynamicGlobalObjectScope(CallFrame* callFrame, JSGlobalObject* dynamicGlobalObject)
    870         : m_dynamicGlobalObjectSlot(callFrame->globalData().dynamicGlobalObject)
    871         , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot)
    872     {
    873         m_dynamicGlobalObjectSlot = dynamicGlobalObject;
    874     }
    875 
    876     ~DynamicGlobalObjectScope()
    877     {
    878         m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject;
    879     }
    880 
    881 private:
    882     JSGlobalObject*& m_dynamicGlobalObjectSlot;
    883     JSGlobalObject* m_savedDynamicGlobalObject;
    884 };
    885 
    886867JSValue* Interpreter::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
    887868{
Note: See TracChangeset for help on using the changeset viewer.