-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Site Isolation] iframe processes do not handle mouse events after op…
…ening a context menu https://bugs.webkit.org/show_bug.cgi?id=269446 rdar://122997776 Reviewed by Alex Christensen. When the web process is waiting for the client to open a context menu, all mouse events are ignored. With site isolation, iframe processes weren't being notified when a context menu had opened. So, the processes would not handle mouse events after one context menu was opened. Instead of updating this value in each web process, we should just not send the event from the UI process when waiting for a context menu to open. * LayoutTests/http/tests/site-isolation/mouse-events/context-menu-event-twice-expected.txt: Added. * LayoutTests/http/tests/site-isolation/mouse-events/context-menu-event-twice.html: Added. * Source/WebKit/UIProcess/WebContextMenuProxy.cpp: (WebKit::WebContextMenuProxy::useContextMenuItems): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::showContextMenu): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/WebProcess/WebPage/WebContextMenu.cpp: (WebKit::WebContextMenu::show): * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mouseEvent): (WebKit::WebPage::didShowContextMenu): Deleted. * Source/WebKit/WebProcess/WebPage/WebPage.h: (WebKit::WebPage::startWaitingForContextMenuToShow): Deleted. * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: Canonical link: https://commits.webkit.org/274771@main
- Loading branch information
1 parent
f8d35c1
commit 42d2cca
Showing
9 changed files
with
62 additions
and
29 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LayoutTests/http/tests/site-isolation/mouse-events/context-menu-event-twice-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Verifies that the iframe receives a context menu event twice. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS iframe received context menu event. | ||
PASS iframe received context menu event. | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
30 changes: 30 additions & 0 deletions
30
LayoutTests/http/tests/site-isolation/mouse-events/context-menu-event-twice.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- webkit-test-runner [ SiteIsolationEnabled=true ] --> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<script> | ||
description("Verifies that the iframe receives a context menu event twice."); | ||
jsTestIsAsync = true; | ||
|
||
var messageCount = 0; | ||
addEventListener("message", (event) => { | ||
if (event.data != "contextmenu") | ||
return; | ||
|
||
testPassed("iframe received context menu event."); | ||
messageCount++; | ||
if (messageCount == 1) { | ||
eventSender.mouseDown(2); | ||
eventSender.mouseUp(2); | ||
} else if (messageCount == 2) | ||
finishJSTest(); | ||
}); | ||
|
||
function onLoad() { | ||
let frame = document.getElementById("frame"); | ||
let x = frame.offsetParent.offsetLeft + frame.offsetLeft + frame.offsetWidth / 2; | ||
let y = frame.offsetParent.offsetTop + frame.offsetTop + frame.offsetHeight / 2; | ||
eventSender.mouseMoveTo(x, y); | ||
eventSender.mouseDown(2); | ||
eventSender.mouseUp(2); | ||
} | ||
</script> | ||
<iframe onload="onLoad()" id="frame" src="http://localhost:8000/site-isolation/mouse-events/resources/context-menu-event-listener.html"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters