Skip to content
Permalink
Browse files
HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>

Reviewed by Simon Fraser.

Source/WebKit/mac:

Dismiss HTML form validation bubble on top-level navigation on Mac WK1.

* WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

Source/WebKit2:

Dismiss HTML form validation bubble on top-level navigation on WK2.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):

LayoutTests:

Add layout test coverage.

* http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt: Added.
* http/tests/navigation/navigation-dismisses-validation-bubbles.html: Added.
* http/tests/navigation/resources/check-validation-bubble-not-visible.html: Added.


Canonical link: https://commits.webkit.org/183572@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Dec 16, 2016
1 parent d10e5ca commit 8705369df47ec43c583d263c8f4c548cb07648a4
@@ -1,3 +1,17 @@
2016-12-16 Chris Dumez <cdumez@apple.com>

HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>

Reviewed by Simon Fraser.

Add layout test coverage.

* http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt: Added.
* http/tests/navigation/navigation-dismisses-validation-bubbles.html: Added.
* http/tests/navigation/resources/check-validation-bubble-not-visible.html: Added.

2016-12-16 Ryan Haddad <ryanhaddad@apple.com>

Move the skip expectation for fast/visual-viewport/ios/zoomed-focus-in-fixed.html to ios-simulator-wk2.
@@ -0,0 +1 @@
PASS: The HTML validation bubble is no longer visible after navigating
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<body>
<form>
<input id="testInput" type="text" required>
<input id="testSubmit" type="submit">
</form>
<script>
if (window.testRunner)
testRunner.waitUntilDone();

document.getElementById("testSubmit").onclick = function() {
setTimeout(function() {
window.location = "resources/check-validation-bubble-not-visible.html";
}, 0);
}

onload = function() {
document.getElementById("testSubmit").click();
};
</script>
</body>
</html>
@@ -0,0 +1,24 @@
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}

function getValidationBubbleContents()
{
return `
(function() {
return JSON.stringify(uiController.contentsOfUserInterfaceItem('validationBubble'));
})();`
}
testRunner.runUIScript(getValidationBubbleContents(), function(result) {
validationBubbleContents = JSON.parse(result).validationBubble;
if (validationBubbleContents.message === "")
document.body.innerHTML = "PASS: The HTML validation bubble is no longer visible after navigating";
else
document.body.innerHTML = "FAIL: The HTML validation bubble is still visible after navigating";

if (window.testRunner)
testRunner.notifyDone();
});
</script>
@@ -1,3 +1,16 @@
2016-12-16 Chris Dumez <cdumez@apple.com>

HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>

Reviewed by Simon Fraser.

Dismiss HTML form validation bubble on top-level navigation on Mac WK1.

* WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

2016-12-15 Darin Adler <darin@apple.com>

Use asString instead of toWTFString, toString, or getString when we already checked isString
@@ -3286,6 +3286,8 @@ - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame
[self _didChangeValueForKey: _WebIsLoadingKey];

[self _willChangeValueForKey: _WebMainFrameURLKey];

[self hideFormValidationMessage];
}

[NSApp setWindowsNeedUpdate:YES];
@@ -1,3 +1,16 @@
2016-12-16 Chris Dumez <cdumez@apple.com>

HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>

Reviewed by Simon Fraser.

Dismiss HTML form validation bubble on top-level navigation on WK2.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):

2016-12-16 Jer Noble <jer.noble@apple.com>

Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}.
@@ -3169,8 +3169,10 @@ void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t na
if (frame->isMainFrame() && navigationID)
navigation = &navigationState().navigation(navigationID);

if (frame->isMainFrame())
if (frame->isMainFrame()) {
m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL);
hideValidationMessage();
}

frame->setUnreachableURL(unreachableURL);
frame->didStartProvisionalLoad(url);

0 comments on commit 8705369

Please sign in to comment.