2011-04-19 Stuart Morgan <stuartmorgan@chromium.org>

        Reviewed by Tony Chang.

        [chromium] Clicking on plugin for first time blocks focus shift
        https://bugs.webkit.org/show_bug.cgi?id=58419

        Added new test for cross-iframe focus changes on plugin clicks.

        * plugins/mouse-click-iframe-to-plugin-expected.txt: Added.
        * plugins/mouse-click-iframe-to-plugin.html: Added.
2011-04-19  Stuart Morgan  <stuartmorgan@chromium.org>

        Reviewed by Tony Chang.

        [chromium] Clicking on plugin for first time blocks focus shift
        https://bugs.webkit.org/show_bug.cgi?id=58419

        Switched to using FocusController when moving focus to a plugin
        so that cross-frame focus changes are handled correctly.

        * src/WebPluginContainerImpl.cpp:
        (WebKit::WebPluginContainerImpl::handleMouseEvent):

git-svn-id: svn://svn.chromium.org/blink/trunk@84270 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6ee96fd4
2011-04-19 Stuart Morgan <stuartmorgan@chromium.org>
Reviewed by Tony Chang.
[chromium] Clicking on plugin for first time blocks focus shift
https://bugs.webkit.org/show_bug.cgi?id=58419
Added new test for cross-iframe focus changes on plugin clicks.
* plugins/mouse-click-iframe-to-plugin-expected.txt: Added.
* plugins/mouse-click-iframe-to-plugin.html: Added.
2011-04-19 Jungshik Shin <jshin@chromium.org> 2011-04-19 Jungshik Shin <jshin@chromium.org>
Reviewed by David Levin Reviewed by David Levin
<html>
<head>
<script>
function runTest() {
frameDocument = document.getElementById('frame').contentWindow.document;
frameDocument.body.innerHTML = "<textarea id=textarea cols=50 rows=5 onblur='this.style.backgroundColor=\"green\"'></textarea>";
var textarea = frameDocument.getElementById('textarea');
textarea.focus();
if (!window.layoutTestController) {
output.textContent = "Click on the plugin (the blue rectangle); if the text field turns green the test has passed, otherwise it has failed.";
} else {
eventSender.mouseMoveTo(60, 60);
eventSender.mouseDown();
eventSender.mouseUp();
if (frameDocument.activeElement != textarea) {
document.getElementById('output').textContent = "PASSED";
}
layoutTestController.dumpAsText();
}
}
</script>
</head>
<body onload="runTest();">
<embed type="application/x-shockwave-flash" src="resources/simple_blank.swf" width="100" height="100"></embed><br>
<iframe id="frame" width="640"></iframe>
<div id="output">FAILED</div>
</body>
</html>
2011-04-19 Stuart Morgan <stuartmorgan@chromium.org>
Reviewed by Tony Chang.
[chromium] Clicking on plugin for first time blocks focus shift
https://bugs.webkit.org/show_bug.cgi?id=58419
Switched to using FocusController when moving focus to a plugin
so that cross-frame focus changes are handled correctly.
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::handleMouseEvent):
2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> 2011-04-19 Vsevolod Vlasov <vsevik@chromium.org>
Reviewed by Pavel Feldman. Reviewed by Pavel Feldman.
......
...@@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) ...@@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
return; return;
if (event->type() == eventNames().mousedownEvent) { if (event->type() == eventNames().mousedownEvent) {
// Ensure that the frame containing the plugin has focus.
Frame* containingFrame = parentView->frame(); Frame* containingFrame = parentView->frame();
if (Page* currentPage = containingFrame->page()) if (Page* currentPage = containingFrame->page())
currentPage->focusController()->setFocusedFrame(containingFrame); currentPage->focusController()->setFocusedNode(m_element, containingFrame);
// Give focus to our containing HTMLPluginElement. else
containingFrame->document()->setFocusedNode(m_element); containingFrame->document()->setFocusedNode(m_element);
} }
WebCursorInfo cursorInfo; WebCursorInfo cursorInfo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment