mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-25 08:27:41 +01:00
Fix timing issue with OnDraggableRegionsChanged
When bfcache is disabled use the RenderFrameObserver::DidFinishLoad notification instead of the DidStopLoading notification that originates from the browser process. During fast navigation the DidStopLoading notification may arrive in the renderer after a new navigation has commenced and cause the wrong regions to be reported.
This commit is contained in:
parent
100b457743
commit
ec8076536e
@ -49,6 +49,7 @@
|
|||||||
#include "third_party/blink/public/web/web_navigation_control.h"
|
#include "third_party/blink/public/web/web_navigation_control.h"
|
||||||
#include "third_party/blink/public/web/web_script_source.h"
|
#include "third_party/blink/public/web/web_script_source.h"
|
||||||
#include "third_party/blink/public/web/web_view.h"
|
#include "third_party/blink/public/web/web_view.h"
|
||||||
|
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -337,6 +338,14 @@ void CefFrameImpl::OnDidFinishLoad() {
|
|||||||
if (blink_glue::HasPluginFrameOwner(frame_))
|
if (blink_glue::HasPluginFrameOwner(frame_))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!blink::RuntimeEnabledFeatures::BackForwardCacheEnabled() && IsMain()) {
|
||||||
|
// Refresh draggable regions. Otherwise, we may not receive updated regions
|
||||||
|
// after navigation because LocalFrameView::UpdateDocumentAnnotatedRegion
|
||||||
|
// lacks sufficient context. When bfcache is disabled we use this method
|
||||||
|
// instead of DidStopLoading() because it provides more accurate timing.
|
||||||
|
OnDraggableRegionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
blink::WebDocumentLoader* dl = frame_->GetDocumentLoader();
|
blink::WebDocumentLoader* dl = frame_->GetDocumentLoader();
|
||||||
const int http_status_code = dl->GetWebResponse().HttpStatusCode();
|
const int http_status_code = dl->GetWebResponse().HttpStatusCode();
|
||||||
|
|
||||||
@ -711,10 +720,13 @@ void CefFrameImpl::DidStopLoading() {
|
|||||||
// OnLoadingStateChange.
|
// OnLoadingStateChange.
|
||||||
browser_->OnLoadingStateChange(false);
|
browser_->OnLoadingStateChange(false);
|
||||||
|
|
||||||
// Refresh draggable regions. Otherwise, we may not receive updated regions
|
if (blink::RuntimeEnabledFeatures::BackForwardCacheEnabled()) {
|
||||||
// after navigation because LocalFrameView::UpdateDocumentAnnotatedRegion
|
// Refresh draggable regions. Otherwise, we may not receive updated regions
|
||||||
// lacks sufficient context.
|
// after navigation because LocalFrameView::UpdateDocumentAnnotatedRegion
|
||||||
OnDraggableRegionsChanged();
|
// lacks sufficient context. When bfcache is enabled we can't rely on
|
||||||
|
// OnDidFinishLoad() as the frame may not actually be reloaded.
|
||||||
|
OnDraggableRegionsChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefFrameImpl::ContextLifecycleStateChanged(
|
void CefFrameImpl::ContextLifecycleStateChanged(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user