Skip to content

[css-env] safe-area-insets-* for embedded document by iframe #4670

@makotokato

Description

@makotokato

safe-area-insets-* is the defines for visible rectangle such as cutout support. But I guess that it is unclear for embedded document by iframe.

  • Chrome seems to be 0 in embedded (child) document by iframe.
  • Safari seem be same value for parent document and embedded (child) document.

What correct behaviour for embedded document?

parent

...
<meta name="viewport"
  content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<style>
body {
       padding: 10px;
	margin: 0px;
}
iframe {
	padding: 0px;
	margin: 0px;
	border: none;
}
</style>
<iframe width="100%" height="100%" src="child.html"></iframe>
...

child / embedded document

...
<style>
#content {
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
</style>
<div id="content">
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions