<dialog> element containing SVG expands in size when setting textContent within
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: aquarius, Assigned: emilio)
References
(Regression)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0
Steps to reproduce:
Visit https://jsbin.com/jaxixif/1/edit?html,output
or use the following code (also attached):
<!doctype html>
<html lang="en">
<head>
<style>
dialog svg { padding: 2px; }
</style>
</head>
<body>
<dialog>
<details>
<summary>Click this to see the bug</summary>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
role="img" viewBox="0 0 100 10" id="graph">
</svg>
<div><b></b></div>
</details>
</div>
</body>
</html>
<script>
tickingCountdown = setInterval(() => {
// we set the textContent. We don't add to it.
document.querySelector("b").textContent = "watch the dialog grow!";
}, 1000);
document.querySelector("dialog").showModal();
</script>
and click the summary to open.
Actual results:
Every tick of the interval, the dialog grows by a small amount.
This doesn't happen if the (empty) SVG is not present, and it doesn't happen in Chrome, so I think it's some sort of layout bug.
Expected results:
This expanding shouldn't happen!
Reporter | ||
Comment 1•2 years ago
|
||
A video is attached demonstrating the "growing".
Reporter | ||
Comment 2•2 years ago
|
||
As a data point, putting the <svg> inside a <div> seems to fix this, although I have no idea why.
Comment 3•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::SVG' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•2 years ago
|
||
The severity field is not set for this bug.
:dholbert, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 5•2 years ago
|
||
It seems something about SVG intrinsic sizing is wrongly stateful.
Looks extremely suspicious (from bug 1162418).
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
This is just bug 1340715, will try to fix this there.
Description
•