Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing documentation for contentRect/contentBoxSize/borderBoxSize/devicePixelContentBoxSize bindings #10269

Closed
samal-rasmussen opened this issue Jan 23, 2024 · 2 comments

Comments

@samal-rasmussen
Copy link

samal-rasmussen commented Jan 23, 2024

Describe the bug

Bindings for contentRect/contentBoxSize/borderBoxSize/devicePixelContentBoxSize were added in this pr: #8022

They were mentioned in the Changelog and June 2023 blog entry: Changelog, blog

But nothing about them was ever added to the docs.

The right place to describe then is probably around here: https://svelte.dev/docs/element-directives#block-level-element-bindings

Reproduction

Here's a REPL with the feature in action: Svelte 5 preview REPL

<script>
	let borderBoxSize;
	let contentBoxSize;

	$: borderBoxWidth = borderBoxSize ? borderBoxSize[0].inlineSize : -1;
	$: borderBoxHeight = borderBoxSize ? borderBoxSize[0].blockSize : -1;

	$: contentBoxWidth = contentBoxSize ? contentBoxSize[0].inlineSize : -1;
	$: contentBoxHeight = contentBoxSize ? contentBoxSize[0].blockSize : -1;
</script>

<div bind:borderBoxSize bind:contentBoxSize></div>

<p>border box size = {borderBoxWidth} x {borderBoxHeight}</p>
<p>content box size = {contentBoxWidth} x {contentBoxHeight}</p>

<style>
	div {
		padding: 10px;
		width: 80px;
		height: 40px;
		background-color: steelblue;
	}
</style>

Note: The contentBoxSize binding is currently broken in Svelte 4: #8583

Logs

No response

System Info

See repl.

Severity

annoyance

@brunnerh
Copy link
Member

brunnerh commented Jan 23, 2024

Duplicate of

@samal-rasmussen
Copy link
Author

There it was. I did try to find it :)

@samal-rasmussen samal-rasmussen closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants