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

alignment-baseline does not work on <text> in Firefox #23921

Closed
tomfroehle opened this issue Oct 28, 2021 · 3 comments
Closed

alignment-baseline does not work on <text> in Firefox #23921

tomfroehle opened this issue Oct 28, 2021 · 3 comments
Assignees
Labels
data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG

Comments

@tomfroehle
Copy link

tomfroehle commented Oct 28, 2021

MDN URL: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/alignment-baseline

What information was incorrect, unhelpful, or incomplete?

The example has the alignmnet-baseline attribute on a text element. This is not supported (see the comment under the image: 'For object alignment in other elements (such as <text>), see dominant-baseline.')

Specific section or headline?

Example section

What did you expect to see?

An example where the attributes are applied to supported elements.

Did you test this? If so, how?

https://codepen.io/tomfroehle/pen/yLoXKZz

Example in Chrome 95.0.4638.54:
image

Example in FireFox 93.0:
image

MDN Content page report details
@tomfroehle tomfroehle changed the title Issue with "alignment-baseline": (short summary here please) Issue with "alignment-baseline": Example not working in FireFox because it is applied to text-element Oct 28, 2021
@himanshugarg
Copy link

himanshugarg commented Oct 30, 2021

An example where the attributes are applied to supported elements.

Of the two non-deprecated attributes tspan and textPath, I tried creating an example with tspan. Unless I got the svg wrong, that doesn't work either. I tried looking for a Firefox bug, but couldn't find one. Chrome is right here:-

image

<svg width="300" height="120" viewBox="0 0 300 120"
     xmlns="http://www.w3.org/2000/svg">

    <!-- Materialization of anchors -->
    <path d="M30,65 L300,65" stroke="grey" />

    <!-- Anchors in action -->
    <text x="60" y="65">A  <tspan  alignment-baseline="hanging">hanging</tspan></text>
   
    <circle cx="60" cy="65" r="3" fill="red" />
<style><![CDATA[
text{
    font: bold 36px Verdana, Helvetica, Arial, sans-serif;
}
]]></style>
</svg>

@Josh-Cena
Copy link
Member

Josh-Cena commented Jun 10, 2024

Related: mdn/content#22260

The CSS spec for alignment-baseline says it applies to SVG text content elements, which includes text, textPath, and tspan (tref is deprecated). Firefox doesn't implement alignment-baseline yet: https://bugzilla.mozilla.org/show_bug.cgi?id=1403440

@Josh-Cena Josh-Cena changed the title Issue with "alignment-baseline": Example not working in FireFox because it is applied to text-element alignment-baseline does not work on <text> in Firefox Jul 5, 2024
@Elchi3 Elchi3 transferred this issue from mdn/content Jul 22, 2024
@queengooborg queengooborg added the data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG label Aug 15, 2024
@queengooborg queengooborg self-assigned this Aug 15, 2024
@queengooborg
Copy link
Contributor

This data was fixed in #23545!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG
Projects
None yet
Development

No branches or pull requests

4 participants