Skip to content
Permalink
Browse files
[ContentChangeObserver] Subframe load should not reset content observ…
…ation on the mainframe

https://bugs.webkit.org/show_bug.cgi?id=196408
<rdar://problem/49436797>

Reviewed by Simon Fraser.

Source/WebKit:

Hover intent fails when an unrelated frame commits a load the same time.
cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
(If the current frame navigates away, willDetachPage takes care of canceling the observation.)

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cancelPotentialTap):
(WebKit::WebPage::cancelPotentialTapInFrame):

LayoutTests:

* fast/events/touch/ios/content-observation/hover-while-loading-subframe-expected.txt: Added.
* fast/events/touch/ios/content-observation/hover-while-loading-subframe.html: Added.

Canonical link: https://commits.webkit.org/210693@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbaradlay committed Mar 30, 2019
1 parent bc0a5c4 commit d4432dea150a8219e569b8d90d4d3d3d2dc42235
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 1 deletion.
@@ -1,3 +1,14 @@
2019-03-30 Zalan Bujtas <zalan@apple.com>

[ContentChangeObserver] Subframe load should not reset content observation on the mainframe
https://bugs.webkit.org/show_bug.cgi?id=196408
<rdar://problem/49436797>

Reviewed by Simon Fraser.

* fast/events/touch/ios/content-observation/hover-while-loading-subframe-expected.txt: Added.
* fast/events/touch/ios/content-observation/hover-while-loading-subframe.html: Added.

2019-03-30 Antti Koivisto <antti@apple.com>

Hit-testing of boxes over scrollers should account for border-radius
@@ -0,0 +1,2 @@
PASS if 'clicked' text is not shown below.

@@ -0,0 +1,62 @@
<html>
<head>
<title>This tests the case when a subframe is getting loaded while hovering.</title>
<script src="../../../../../resources/basic-gestures.js"></script>
<style>
#tapthis {
width: 400px;
height: 400px;
border: 1px solid green;
}

#becomesVisible {
display: none;
width: 100px;
height: 100px;
background-color: green;
overflow: hidden;
}

</style>
<script>
async function test() {
if (!window.testRunner || !testRunner.runUIScript)
return;
if (window.internals)
internals.settings.setContentChangeObserverEnabled(true);

testRunner.waitUntilDone();
testRunner.dumpAsText();

let rect = tapthis.getBoundingClientRect();
let x = rect.left + rect.width / 2;
let y = rect.top + rect.height / 2;

await tapAtPoint(x, y);
}
</script>
</head>
<body onload="test()">
<div id=tapthis>PASS if 'clicked' text is not shown below.</div>
<div id=becomesVisible></div>
<pre id=result></pre>
<iframe id=iframe src="foobar.html"></iframe>
<script>
tapthis.addEventListener("mouseover", function( event ) {
iframe.src = "data:text/html;charset=utf-8,subframe content";
becomesVisible.style.display = "block";
document.body.offsetHeight;
if (window.testRunner)
testRunner.notifyDone();
}, false);

becomesVisible.addEventListener("click", function( event ) {
result.innerHTML = "clicked hidden";
}, false);

tapthis.addEventListener("click", function( event ) {
result.innerHTML = "clicked";
}, false);
</script>
</body>
</html>
@@ -1,3 +1,19 @@
2019-03-30 Zalan Bujtas <zalan@apple.com>

[ContentChangeObserver] Subframe load should not reset content observation on the mainframe
https://bugs.webkit.org/show_bug.cgi?id=196408
<rdar://problem/49436797>

Reviewed by Simon Fraser.

Hover intent fails when an unrelated frame commits a load the same time.
cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
(If the current frame navigates away, willDetachPage takes care of canceling the observation.)

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cancelPotentialTap):
(WebKit::WebPage::cancelPotentialTapInFrame):

2019-03-29 John Wilander <wilander@apple.com>

Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
@@ -910,13 +910,14 @@ static void dispatchSyntheticMouseMove(Frame& mainFrame, const WebCore::FloatPoi

void WebPage::cancelPotentialTap()
{
if (m_potentialTapNode)
m_potentialTapNode->document().contentChangeObserver().willNotProceedWithClick();
cancelPotentialTapInFrame(*m_mainFrame);
}

void WebPage::cancelPotentialTapInFrame(WebFrame& frame)
{
if (m_potentialTapNode) {
m_potentialTapNode->document().contentChangeObserver().willNotProceedWithClick();
auto* potentialTapFrame = m_potentialTapNode->document().frame();
if (potentialTapFrame && !potentialTapFrame->tree().isDescendantOf(frame.coreFrame()))
return;

0 comments on commit d4432de

Please sign in to comment.