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

Open
#4,670 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
css
Domain
frontend, web-dev

Research direction

Start with the issue's parent and child iframe examples, then compare the reported Chrome and Safari behavior for safe-area-insets-* in embedded documents. Read the relevant CSS environment-variable and viewport specifications to determine whether the behavior is defined; done means reaching a standards consensus and recording the expected iframe behavior.

Written by the indexing model from the issue text.

Description

css-env-1

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">
...
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.