Firefox支持对齐基线属性?

[英]Firefox support for alignment-baseline property?


Does Firefox have any support at all for the alignment-baseline property? When I inspect (using Firebug) SVG elements for which the alignment-baseline property has been explicitly set, Firebug does not list this property at all (IOW it treats is as noise). No matter what value I assign to this property, the appearance of the displayed text never changes, further suggesting that FF ignores this property altogether.

Firefox是否对alignment-baseline属性有任何支持?当我检查(使用Firebug)已明确设置了alignment-baseline属性的SVG元素时,Firebug根本不会列出此属性(IOW它将其视为噪声)。无论我赋给此属性的值是什么,显示文本的外观都不会改变,这进一步表明FF完全忽略了这个属性。

(One other sign that FF's support for this property may be busted is that the link given in the page cited above for the CSS documentation for this property is dead-as-a-doornail.)

(FF对此属性的支持可能被破坏的另一个迹象是,上面引用的关于此属性的CSS文档的页面中给出的链接是死的 - 作为doornail。)

Assuming that, as it appears, FF does not support the alignment-baseline property, what is the value of this property that would most closely replicate FF's default behavior?

假设FF看起来不支持alignment-baseline属性,这个属性的值最接近复制FF的默认行为是什么?

EDIT: For example, view this jsFiddle with both Chrome and FF; each line of displayed text displayed a highlighted word that has been produced with code of the following form:

编辑:例如,使用Chrome和FF查看此jsFiddle;每行显示的文本显示一个突出显示的单词,该单词是使用以下形式的代码生成的:

<tspan style="alignment-baseline:alphabetic">alphabetic</tspan>

Note that all the lines look the same in FF, but not so in Chrome.

请注意,所有行在FF中看起来都相同,但在Chrome中则不然。

There are a few possible candidate values for this property to replicate FF's default behavior (namely, auto, alphabetic, mathematic, and inherit); unfortunately, this experiment cannot decide the matter, and it's not clear to me which of the possible options would match FF's default behavior in the greatest fraction of cases.

此属性有一些可能的候选值来复制FF的默认行为(即auto,alphabetic,mathematic和inherit);不幸的是,这个实验无法决定这个问题,而且我不清楚哪种可能的选项会匹配FF在大多数情况下的默认行为。

2 个解决方案

#1


26  

It seems that alignment-baseline is ment to be used only for portions of <text>, that is for elements tspan, tref etc. For the main <text> element use the dominant-baseline attribute.

似乎对齐基线仅用于 的部分,即元素tspan,tref等。对于主 元素,使用dominant-baseline属性。

(This is what @Tanel Eero wrote above as a comment. I'm re-stating it here so the question can get an accepted answer).

(这是@Tanel Eero在上面写的评论。我在这里重新陈述,所以这个问题可以得到一个可接受的答案)。

#2


8  

The Mozilla Developer Network website states that the style can only be used on certain elements:

Mozilla开发者网络网站声明该样式只能用于某些元素:

The following elements can use the alignment-baseline attribute

以下元素可以使用alignment-baseline属性

<tspan>
<tref>
<altglyph>
<textpath>

So that seems to be your main issue as I understand that you are trying to apply it to a SVG.

因此,这似乎是您的主要问题,因为我了解您正在尝试将其应用于SVG。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2013/10/06/bbc634c49f3cb9ba34017b61efc79e8a.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号