From 3dbd84c2242b2956ad58d2400562bb04d46b5674 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Fri, 31 Aug 2018 14:48:38 -0700 Subject: [PATCH] docs: add notes on OOPIF webview's behaviors (#14409) --- docs/api/webview-tag.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index f3213fed362e..902598d17946 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -62,6 +62,20 @@ and displays a "loading..." message during the load time: ``` +## Internal implementation + +Under the hood `webview` is implemented with [Out-of-Process iframes (OOPIFs)](https://www.chromium.org/developers/design-documents/oop-iframes). +The `webview` tag is essentially a custom element using shadow DOM to wrap an +`iframe` element inside it. + +So the behavior of `webview` is very similar to a cross-domain `iframe`, as +examples: + +* When clicking into a `webview`, the page focus will move from the embedder + frame to `webview`. +* You can not add keyboard event listeners to `webview`. +* All reactions between the embedder frame and `webview` are asynchronous. + ## CSS Styling Notes Please note that the `webview` tag's style uses `display:flex;` internally to