Commit 5ced8e4e authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Don't send DidStartProvisionalLoad notifications for JS urls and XSLT documents

We typically expect DidStartProvisionaLoad messages to be paired with a
DidCommitLoad when the navigation is successful. For pseudo-navigations like
XSLT processing and javascript: urls, we skip the DidCommitLoad message.
If we do not also skip the DidStartProvisionalLoad message, listeners that
expect these notifications to be paired will get confused (e.g., the
inspector debugger may leave breakpoints disabled in the new Document).

Bug: 1095920
Change-Id: I5bdd18b3f4103d5d2c52fe48060c1114efb21b0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254818
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801573}
parent d2f3749c
......@@ -1021,8 +1021,14 @@ void FrameLoader::CommitNavigation(
base::AutoReset<bool> scoped_committing(&committing_navigation_, true);
progress_tracker_->ProgressStarted();
frame_->GetFrameScheduler()->DidStartProvisionalLoad(frame_->IsMainFrame());
probe::DidStartProvisionalLoad(frame_);
// In DocumentLoader, the matching DidCommitLoad messages are only called
// for kRegular commits. Skip them here, too, to ensure we match
// start/commit message pairs.
if (commit_reason == CommitReason::kRegular) {
frame_->GetFrameScheduler()->DidStartProvisionalLoad(
frame_->IsMainFrame());
probe::DidStartProvisionalLoad(frame_);
}
DCHECK(Client()->HasWebView());
scoped_refptr<SecurityOrigin> security_origin =
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="xslt.xslt"?>
<TEST/>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="iso8859-1"/>
<xsl:template match="TEST">
<body>
<script>
debugger;
</script>
</body>
</xsl:template>
</xsl:stylesheet>
Test that debugger breakpoints still work after reloading an xslt document
(async function(testRunner) {
var {page, session, dp} = await testRunner.startURL('resources/xslt.xml',
'Test that debugger breakpoints still work after reloading an xslt document');
await dp.Debugger.enable();
await dp.Page.enable();
await dp.Runtime.enable();
await Promise.all([
dp.Page.reload(),
dp.Debugger.oncePaused(),
]);
testRunner.completeTest();
})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment