Chrome 63 - SVG中带有umlaut的href标识符无法显示

3

在Chrome 63中,具有umlauts的SVG元素其ID被引用时,将不会显示。

Chrome 62(及之前版本)、Firefox 57和Edge正确显示SVG。

以下示例在Chrome 63中无法显示SVG:

<svg id="TextBoxA" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" viewBox="0 0 230 110" width="230" height="110"  encoding="UTF-8" >
 <defs>
  <g id="ThisIsAnUmlautä">
   <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="230" height="110" version="1.1">
    <path d="M0,0 h230 v110 l-230,0 z" fill="#444444"></path>
    <path d="M3,3 h224 v104 l-224,0 z" fill="#d13d73"></path>
    <text x="25" y="89" style="fill: #000000; stroke: none; font-size: 88px;">Aüöä</text>
   </svg>
  </g>
 </defs>
 <g>
  <use href="#ThisIsAnUmlautä" opacity="1"></use>
 </g>
</svg>

没有umlaut字符的id工作示例:

<svg id="TextBoxA" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" viewBox="0 0 230 110" width="230" height="110"  encoding="UTF-8" >
 <defs>
  <g id="ThisIsAnUmlaut">
   <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="230" height="110" version="1.1">
    <path d="M0,0 h230 v110 l-230,0 z" fill="#444444"></path>
    <path d="M3,3 h224 v104 l-224,0 z" fill="#d13d73"></path>
    <text x="25" y="89" style="fill: #000000; stroke: none; font-size: 88px;">Aüöä</text>
   </svg>
  </g>
 </defs>
 <g>
  <use href="#ThisIsAnUmlaut" opacity="1"></use>
 </g>
</svg>

错误报告:https://bugs.chromium.org/p/chromium/issues/detail?id=792848

问题

如评论中所指出,改变的意图可能只能由Chromium开发人员之一回答。

知道是否允许在SVG id中使用umlauts会很有帮助(现在已经确认答案在这里:ISO表格中SVG id有效字符)。

因此,目前除了删除umlauts之外,是否有其他解决此问题的方法?


@RobertLongson 我已经添加了具体的问题。 - Robar
你需要一位Chrome开发者来回应这个Bug报告,以确认它是否是有意为之。 - Robert Longson
1个回答

0

这显然是Chromium中的一个漏洞。我的漏洞报告已经合并到https://bugs.chromium.org/p/chromium/issues/detail?id=779420

Chromium开发人员表示,这个漏洞已经被修复,将会在Chrome 64中发布。

在此之前,只有一个解决方法:替换所有umlauts或完全避免使用umlauts。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接