Commit fea5366
committed
Make sure we are no longer show the previous page when running a JS prompt
https://bugs.webkit.org/show_bug.cgi?id=215782
<rdar://problem/67698601>
Reviewed by Simon Fraser.
Source/WebCore:
Add linked-on-after check for the behavior change to minimize the risk of
breakage.
* platform/cocoa/VersionChecks.h:
Source/WebKit:
Make sure we are no longer show the previous page when running a JS prompt.
If we have not yet done a layer tree commit since the last load commit, then
we are likely still showing the previous page. If we are asked to run a JS
prompt / alert / confirm at this point, it would be confusing to still show
the previous page. In order to address the issue, we now make the view blank
in such scenario (ideally, we'd have painted the new page but this is
currently not a trivial thing to do).
To make the view blank, the approach chosen was to add a blank overlay view
on top of the content. This overlay view gets taken down as soon as we
paint the view again.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hasBlankOverlay]):
(-[WKWebView _setHasBlankOverlay:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::setHasBlankOverlay):
* UIProcess/Cocoa/WKBlankOverlayView.h: Added.
* UIProcess/Cocoa/WKBlankOverlayView.mm: Added.
(-[WKBlankOverlayView initWithFrame:]):
* UIProcess/PageClient.h:
(WebKit::PageClient::setHasBlankOverlay):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateRendering):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::didUpdateRendering):
Canonical link: https://commits.webkit.org/236096@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275434 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 54c27eb commit fea5366Copy full SHA for fea5366
22 files changed
+281-5Lines changed: 281 additions & 5 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- Source
- WebCore
- platform/cocoa
- WebKit
- UIProcess
- API/Cocoa
- Cocoa
- ios
- mac
- WebKit.xcodeproj
- WebProcess/WebPage
- mac
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
1 | 14 | |
2 | 15 | |
3 | 16 | |
|
Collapse file
Source/WebCore/platform/cocoa/VersionChecks.h
Copy file name to clipboardExpand all lines: Source/WebCore/platform/cocoa/VersionChecks.h+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
71 | 71 | |
72 | 72 | |
73 | 73 | |
| 74 | + |
74 | 75 | |
75 | 76 | |
76 | 77 | |
| ||
92 | 93 | |
93 | 94 | |
94 | 95 | |
| 96 | + |
95 | 97 | |
96 | 98 | |
97 | 99 | |
|
Collapse file
+51Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
1 | 52 | |
2 | 53 | |
3 | 54 | |
|
Collapse file
Source/WebKit/SourcesCocoa.txt
Copy file name to clipboardExpand all lines: Source/WebKit/SourcesCocoa.txt+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
413 | 413 | |
414 | 414 | |
415 | 415 | |
| 416 | + |
416 | 417 | |
417 | 418 | |
418 | 419 | |
|
Collapse file
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1455 | 1455 | |
1456 | 1456 | |
1457 | 1457 | |
| 1458 | + |
| 1459 | + |
| 1460 | + |
| 1461 | + |
| 1462 | + |
| 1463 | + |
| 1464 | + |
| 1465 | + |
| 1466 | + |
| 1467 | + |
| 1468 | + |
| 1469 | + |
| 1470 | + |
| 1471 | + |
| 1472 | + |
| 1473 | + |
| 1474 | + |
| 1475 | + |
| 1476 | + |
| 1477 | + |
1458 | 1478 | |
1459 | 1479 | |
1460 | 1480 | |
|
Collapse file
Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
| 28 | + |
28 | 29 | |
29 | 30 | |
30 | 31 | |
| ||
132 | 133 | |
133 | 134 | |
134 | 135 | |
| 136 | + |
| 137 | + |
135 | 138 | |
136 | 139 | |
137 | 140 | |
|
Collapse file
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
366 | 366 | |
367 | 367 | |
368 | 368 | |
| 369 | + |
| 370 | + |
369 | 371 | |
370 | 372 | |
371 | 373 | |
|
Collapse file
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
| 63 | + |
| 64 | + |
63 | 65 | |
64 | 66 | |
65 | 67 | |
|
Collapse file
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
| 31 | + |
31 | 32 | |
32 | 33 | |
33 | 34 | |
| ||
79 | 80 | |
80 | 81 | |
81 | 82 | |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
82 | 88 | |
83 | 89 | |
84 | 90 | |
|
Collapse file
Source/WebKit/UIProcess/Cocoa/WKBlankOverlayView.h
Copy file name to clipboard+46Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
0 commit comments