MiniBrowser WK1 fails to update URL for within-page navigations
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2017 22:12:09 +0000 (22:12 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2017 22:12:09 +0000 (22:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168173

Reviewed by Tim Horton.

Implement -webView:didChangeLocationWithinPageForFrame: so that clicking on named
anchors updates the URL field.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController webView:didChangeLocationWithinPageForFrame:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/MiniBrowser/mac/WK1BrowserWindowController.m

index 8882354..1886d52 100644 (file)
@@ -1,3 +1,16 @@
+2017-02-11  Simon Fraser  <simon.fraser@apple.com>
+
+        MiniBrowser WK1 fails to update URL for within-page navigations
+        https://bugs.webkit.org/show_bug.cgi?id=168173
+
+        Reviewed by Tim Horton.
+        
+        Implement -webView:didChangeLocationWithinPageForFrame: so that clicking on named
+        anchors updates the URL field.
+
+        * MiniBrowser/mac/WK1BrowserWindowController.m:
+        (-[WK1BrowserWindowController webView:didChangeLocationWithinPageForFrame:]):
+
 2017-02-10  John Wilander  <wilander@apple.com>
 
         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
index e0ef1dd..e761c2c 100644 (file)
@@ -352,6 +352,15 @@ static BOOL areEssentiallyEqual(double a, double b)
     [self updateTitle:nil];
 }
 
+- (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame
+{
+    if (frame != [sender mainFrame])
+        return;
+
+    NSURL *committedURL = [[[frame dataSource] request] URL];
+    urlText.stringValue = committedURL._web_userVisibleString;
+}
+
 - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
 {
     if (frame != [sender mainFrame])