Changeset 87429 in webkit


Ignore:
Timestamp:
May 26, 2011 2:04:32 PM (13 years ago)
Author:
robert@webkit.org
Message:

2011-05-02 Robert Hogan <robert@webkit.org>

Reviewed by Adam Roben.

[Qt] Allow popup windows from plugins when initiated by a user gesture

https://bugs.webkit.org/show_bug.cgi?id=41292

  • platform/qt/Skipped: Unskip plugin-initiate-popup-window.html
  • platform/qt/plugins/plugin-initiate-popup-window-expected.txt: Copied from LayoutTests/platform/mac/plugins/plugin-initiate-popup-window-expected.txt.
  • plugins/plugin-initiate-popup-window.html: Plugins are only windowless

by default on OSX, so make the plugins windowless explicitly.

2011-05-02 Robert Hogan <robert@webkit.org>

Reviewed by Adam Roben.

[Qt] Allow popup windows from plugins when initiated by a user gesture

https://bugs.webkit.org/show_bug.cgi?id=41292

If the event is from a user gesture and the plugin doesn't support
NPN_PushPopupsEnabledState() and NPN_PopPopupsEnabledState(), allow popups.

  • plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::dispatchNPEvent):

2011-05-02 Robert Hogan <robert@webkit.org>

Reviewed by Adam Roben.

[Qt] Allow popup windows from plugins when initiated by a user gesture

https://bugs.webkit.org/show_bug.cgi?id=41292

Support parameters introduced in plugin-initiate-popup-window.html

  • DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: (webkit_test_plugin_new_instance): (webkit_test_plugin_handle_event):
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87423 r87429  
     12011-05-02  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        [Qt] Allow popup windows from plugins when initiated by a user gesture
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=41292
     8
     9        * platform/qt/Skipped: Unskip plugin-initiate-popup-window.html
     10        * platform/qt/plugins/plugin-initiate-popup-window-expected.txt: Copied from LayoutTests/platform/mac/plugins/plugin-initiate-popup-window-expected.txt.
     11        * plugins/plugin-initiate-popup-window.html: Plugins are only windowless
     12                                                     by default on OSX, so make the plugins windowless explicitly.
     13
    1142011-05-26  Mihai Parparita  <mihaip@chromium.org>
    215
  • trunk/LayoutTests/platform/qt/Skipped

    r87423 r87429  
    356356# ---- plugins rendered in incorrect position ?
    357357plugins/embed-attributes-style.html
    358 
    359 # https://bugs.webkit.org/show_bug.cgi?id=41292
    360 plugins/plugin-initiate-popup-window.html
    361358
    362359# https://bugs.webkit.org/show_bug.cgi?id=60722
  • trunk/LayoutTests/plugins/plugin-initiate-popup-window.html

    r68630 r87429  
    6666</head>
    6767<body onload="window.setTimeout(test, 0);">
    68 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="mouse::popup_by_mousedown()"></embed><br>
    69 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="key::popup_by_keydown()"></embed><br>
     68<embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="mouse::popup_by_mousedown()" windowedplugin="false"></embed><br>
     69<embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="key::popup_by_keydown()" windowedplugin="false"></embed><br>
    7070Specify a script and a mouse/keyboard event to the plugin. The specified script will be evaluated in the browser when the specified event is received by the plugin. The test is for bug https://bugs.webkit.org/show_bug.cgi?id=41292.<br>
    7171Opening window by mouse down is <span id="mousedown_output">FAILED</span><br>
  • trunk/Source/WebCore/ChangeLog

    r87424 r87429  
     12011-05-02  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        [Qt] Allow popup windows from plugins when initiated by a user gesture
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=41292
     8
     9        If the event is from a user gesture and the plugin doesn't support
     10        NPN_PushPopupsEnabledState() and NPN_PopPopupsEnabledState(), allow popups.
     11
     12        * plugins/qt/PluginViewQt.cpp:
     13        (WebCore::PluginView::dispatchNPEvent):
     14
    1152011-05-26  Leandro Gracia Gil  <leandrogracia@chromium.org>
    216
  • trunk/Source/WebCore/plugins/qt/PluginViewQt.cpp

    r86870 r87429  
    385385        return false;
    386386
     387    bool shouldPop = false;
     388
     389    if (m_plugin->pluginFuncs()->version < NPVERS_HAS_POPUPS_ENABLED_STATE
     390        && (event.type == ButtonRelease || event.type == 3 /*KeyRelease*/)) {
     391        pushPopupsEnabledState(true);
     392        shouldPop = true;
     393    }
     394
    387395    PluginView::setCurrentPluginView(this);
    388396#if USE(JSC)
     
    393401    setCallingPlugin(false);
    394402    PluginView::setCurrentPluginView(0);
     403
     404    if (shouldPop)
     405        popPopupsEnabledState();
    395406
    396407    return accepted;
  • trunk/Tools/ChangeLog

    r87423 r87429  
     12011-05-02  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Adam Roben.
     4
     5        [Qt] Allow popup windows from plugins when initiated by a user gesture
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=41292
     8
     9        Support parameters introduced in plugin-initiate-popup-window.html
     10
     11        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
     12        (webkit_test_plugin_new_instance):
     13        (webkit_test_plugin_handle_event):
     14
    1152011-05-26  Mihai Parparita  <mihaip@chromium.org>
    216
  • trunk/Tools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp

    r86887 r87429  
    110110            } else if (!strcasecmp(argn[i], "onPaintEvent") && !obj->onPaintEvent)
    111111                obj->onPaintEvent = strdup(argv[i]);
     112            else if (!strcasecmp(argn[i], "evaluatescript")) {
     113                char* script = argv[i];
     114                if (script == strstr(script, "mouse::")) {
     115                    obj->mouseDownForEvaluateScript = true;
     116                    obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("mouse::") - 1);
     117                } else if (script == strstr(script, "key::"))
     118                    obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("key::") - 1);
     119                // When testing evaluate script on mouse-down or key-down, allow event logging to handle events.
     120                if (obj->evaluateScriptOnMouseDownOrKeyDown)
     121                    obj->eventLogging = true;
     122            }
    112123        }
    113124
     
    302313            if (obj->eventLogging)
    303314                pluginLog(instance, "mouseDown at (%d, %d)", evt->xbutton.x, evt->xbutton.y);
     315           if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
     316                executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
    304317            break;
    305318        case KeyRelease:
     
    310323            if (obj->eventLogging)
    311324                pluginLog(instance, "keyDown '%c'", keyEventToChar(&evt->xkey));
     325           if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
     326                executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
    312327            break;
    313328        case MotionNotify:
Note: See TracChangeset for help on using the changeset viewer.