OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" |
6 | 6 |
7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 581 } |
582 | 582 |
583 - (void)willLoadCurrentURLInWebView { | 583 - (void)willLoadCurrentURLInWebView { |
584 // TODO(stuartmorgan): Get a WKWebView version of the request ID verification | 584 // TODO(stuartmorgan): Get a WKWebView version of the request ID verification |
585 // code working for debug builds. | 585 // code working for debug builds. |
586 } | 586 } |
587 | 587 |
588 - (void)loadRequestForCurrentNavigationItem { | 588 - (void)loadRequestForCurrentNavigationItem { |
589 DCHECK(self.webView && !self.nativeController); | 589 DCHECK(self.webView && !self.nativeController); |
590 DCHECK([self currentSessionEntry]); | 590 DCHECK([self currentSessionEntry]); |
| 591 // If a load is kicked off on a WKWebView with a frame whose size is {0, 0} or |
| 592 // that has a negative dimension for a size, rendering issues occur that |
| 593 // manifest in erroneous scrolling and tap handling (crbug.com/574996, |
| 594 // crbug.com/577793). |
| 595 DCHECK_GT(CGRectGetWidth(self.webView.frame), 0.0); |
| 596 DCHECK_GT(CGRectGetHeight(self.webView.frame), 0.0); |
591 | 597 |
592 web::WKBackForwardListItemHolder* holder = | 598 web::WKBackForwardListItemHolder* holder = |
593 [self currentBackForwardListItemHolder]; | 599 [self currentBackForwardListItemHolder]; |
594 BOOL isFormResubmission = | 600 BOOL isFormResubmission = |
595 (holder->navigation_type() == WKNavigationTypeFormResubmitted || | 601 (holder->navigation_type() == WKNavigationTypeFormResubmitted || |
596 holder->navigation_type() == WKNavigationTypeFormSubmitted); | 602 holder->navigation_type() == WKNavigationTypeFormSubmitted); |
597 web::NavigationItemImpl* currentItem = | 603 web::NavigationItemImpl* currentItem = |
598 [self currentSessionEntry].navigationItemImpl; | 604 [self currentSessionEntry].navigationItemImpl; |
599 NSData* POSTData = currentItem->GetPostData(); | 605 NSData* POSTData = currentItem->GetPostData(); |
600 NSMutableURLRequest* request = [self requestForCurrentNavigationItem]; | 606 NSMutableURLRequest* request = [self requestForCurrentNavigationItem]; |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 runJavaScriptTextInputPanelWithPrompt:prompt | 2059 runJavaScriptTextInputPanelWithPrompt:prompt |
2054 defaultText:defaultText | 2060 defaultText:defaultText |
2055 requestURL:requestURL | 2061 requestURL:requestURL |
2056 completionHandler:completionHandler]; | 2062 completionHandler:completionHandler]; |
2057 } else if (completionHandler) { | 2063 } else if (completionHandler) { |
2058 completionHandler(nil); | 2064 completionHandler(nil); |
2059 } | 2065 } |
2060 } | 2066 } |
2061 | 2067 |
2062 @end | 2068 @end |
OLD | NEW |