Fenced Frames: Addressing issues with invalid urn:uuid in fenced frames
The following issues are addressed:
1. In ShadowDOM implementation, the CanAccessDataForOrigin CHECK fails
while committing error page since it's trying to commit
initiator origin navigation into a process locked to urn: URL. This is
fixed by allowing error page isolation for fenced frames.
2. WebContentsObserverConsistencyChecker and
RenderFrameHostImpl::FailedNavigation expect the navigation to be
considered started before failing.
3. OnRequestFailedInternal() should not skip throttle as throttles
should get a chance to run on WillFailRequest() and override the error
page behavior.
Bug: 1264224
Change-Id: I8598250077fc4681d6e932e78534bc30a379ee45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3285384
Reviewed-by: Shivani Sharma <[email protected]>
Reviewed-by: Ćukasz Anforowicz <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Commit-Queue: Nan Lin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#947675}
diff --git a/content/browser/renderer_host/frame_tree_node.cc b/content/browser/renderer_host/frame_tree_node.cc
index f6ba4e0a..ae493b5 100644
--- a/content/browser/renderer_host/frame_tree_node.cc
+++ b/content/browser/renderer_host/frame_tree_node.cc
@@ -24,6 +24,7 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/common/navigation_params_utils.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/site_isolation_policy.h"
#include "content/public/common/content_features.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h"
@@ -875,4 +876,15 @@
fenced_frame_nonce_ = nonce;
}
+bool FrameTreeNode::IsErrorPageIsolationEnabled() const {
+ // Enable error page isolation for fenced frames in both MPArch and ShadowDOM
+ // modes to address the issue with invalid urn:uuid (crbug.com/1264224).
+ //
+ // Note that `IsMainFrame()` only covers MPArch, therefore we add explicit
+ // `IsFencedFrameRoot()` check for ShadowDOM, at least until error page
+ // isolation is supported for subframes in crbug.com/1092524.
+ return SiteIsolationPolicy::IsErrorPageIsolationEnabled(IsMainFrame() ||
+ IsFencedFrameRoot());
+}
+
} // namespace content