mdn / mdn/browser-compat-data

svg.elements.text.textLength - textLength="0" has no effect in Safari / Safari iOS

Open
#27,439 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

browser:safari data:svg needs browser bug
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

Original title: svg.elements.text.lengthAdjust - <lengthAdjust doesn't work on IOS safari, Chrome, and Firefox>

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

I've sent some video to mozilla over social media

https://x.com/TheSonMorning/status/1950212124128481622

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Safari, Firefox

What did you expect to see?

the spacing of the letters of my text string should start squished togeather and invisible, and then after an animation, burst out of nothingness to fill the width of my svg tags; but on mobile devices, the spacing is completely ignored.

Did you test this? If so, how?

Yes. Here is my test code. It works on desktop (firefox linux); but fails on the three mentioned mobile browsers


<html>
<head>
	<title>Frankie Logo</title>
	<style>
		.canvas-container{
			background-color: transparent;
		}

		.stave-line{
			stroke:#1e73be;
			stroke-width:2;
		}

		.note-hidden{
			opacity: 0;
		}

		.note-implode{
			position: absolute !important;
			top: 53px !important;
			left: 135px !important;
			transition 0.25s;
		}

		.note-shrink{
			transform: 0.5s;
			width: 0px;
			height 0px;
			opacity: 0;
		}

		.note-visible{
			opacity:1;
			transition: 0.60s;
		}
		.note1{
			position: absolute;
			top: 88px;
			left: 14px;
		}
		.note2{
			position: absolute;
			top: 72px;
			left: 45px;
		}
		.note3{
			position: absolute;
			top: 81px;
			left: 77px;
		}
		.note4{
			position: absolute;
			top: 88px;
			left: 108px;
		}
		.note5{
			position: absolute;
			top: 66px;
			left: 135px;
		}
		.note6{
			position: absolute;
			top: 74px;
			left: 165px;
		}
		.note7{
			position: absolute;
			top: 84px;
			left: 196px;
		}
		.note8{
			position: absolute;
			top: 96px;
			left: 227px;
		}
		.note9{
			position: absolute;
			top: 79px;
			left: 256px;
		}
		.note10{
			position: absolute;
			top: 88px;
			left: 285px;
		}

		.business-name{
			transition: 1s;
			x: 0;
			textLength: 300;
		}
	</style>
	<script>
		async function shrinkNote(sync){
			sync.classList.add("note-shrink");
		}
		async function implodeNote(sync){
			sync.ontransitionend = async function() {
			};
			sync.ontransitionstart = async function(){
			
				shrinkNote(sync);
			};
			sync.classList.add("note-implode");
		}
		async function showNote(noteID){
			var sync = document.querySelectorAll(".note-hidden")[noteID];
			sync.ontransitionend = async function() {
					implodeNote(sync);	
			};
			sync.ontransitionstart = async function(){
				noteID++;
				if(noteID < 10){
 					showNote(noteID);
				}
			};
			sync.classList.add('note-visible');
		}
	</script>
</head>
<body onload="showNote(0)" bgcolor="grey">
<svg width="300" height="82">
	<line x1="0" x2="300" y1="14.28" y2="14.25" class ="stave-line" />
	<line x1="0" x2="300" y1="28.57" y2="28.57" class ="stave-line" />
	<line x1="0" x2="300" y1="42.85" y2="42.85" class ="stave-line" />
	<line x1="0" x2="300" y1="57.14" y2="57.14" class ="stave-line" />
	<line x1="0" x2="300" y1="71.42" y2="71.42" class ="stave-line" />
<!--	<line x1="0" x2="300" y1="85.71" y2="85.71" class ="stave-line" />
	<line x1="0" x2="300" y1="100" y2="100" class ="stave-line" />!-->
	<text 	id="businessName" 
		name="businessName" 
		fill="#1e73be" 
		stroke="black" 
		y="70" 
		font-size="50" 
		x="150" textlength="0" 
		lengthadjust="spacingAndGlyphs">

		Stagecraft
		<animate 
			attributeName="x" 
			begin="1s"
			dur="0.5s"
			from="150" 
			to="0"
			fill="freeze"/>
		<animate 
			attributeName="textLength" 
			begin="1s"
			dur="0.5s"
			from="0" 
			to="300"
			fill="freeze"/>
	</text>
</svg>
<embed class="note1 note-hidden" name="note1" id="note1" src="./musicnote.svg" width="25" height="25" />
<embed class="note2 note-hidden"  name="note2" id="note2" src="./musicnote.svg" width="25" height="25" />
<embed class="note3 note-hidden"  name="note3" id="note3" src="./musicnote.svg" width="25" height="25" />
<embed class="note4 note-hidden"  name="note4" id="note4" src="./musicnote.svg" width="25" height="25" />
<embed class="note5 note-hidden"  name="note5" id="note5" src="./musicnote.svg" width="25" height="25" />
<embed class="note6 note-hidden"  name="note6" id="note6" src="./musicnote.svg" width="25" height="25" />
<embed class="note7 note-hidden"  name="note7" id="note7" src="./musicnote.svg" width="25" height="25" />
<embed class="note8 note-hidden"  name="note8" id="note8" src="./musicnote.svg" width="25" height="25" />
<embed class="note9 note-hidden"  name="note9" id="note9" src="./musicnote.svg" width="25" height="25" />
<embed class="note10 note-hidden"  name="note10" id="note10" src="./musicnote.svg" width="25" height="25" />
</body>
</html>
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/lengthAdjust

Do you have anything more you want to share?

I'm unsure as to the impacts this has on android devices.
On desktop I've only tried in firefox; which works as expected.

This x post has video of the desktop animation, which works as expected.

And also a screen recording of my iphone, which shows the same exact code failing to respect lengthAdjust="spacingAndGlyphs"

https://x.com/TheSonMorning/status/1950212124128481622

MDN URL

https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/lengthAdjust

MDN metadata
MDN page report details
  • Query: svg.elements.text.lengthAdjust
  • Report started: 2025-07-29T15:11:52.220Z

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.

Research direction

Start with the inline HTML/SVG reproduction and the linked MDN lengthAdjust page, then verify the reported behavior in the listed desktop and mobile browsers. Determine whether the compatibility data for svg.elements.text.lengthAdjust reflects the observed support; done means the issue has a confirmed compatibility conclusion and the corresponding data change is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
documentation, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.