【问题标题】:ForeignObject are ignored in a use tag by WebkitWebkit 在使用标签中忽略了 ForeignObject
【发布时间】:2015-06-13 04:50:33
【问题描述】:

<use> 标签内使用时,Webkit 将忽略外来对象接缝。

代码:

<body>
    <svg id="my-svg" width="140" height="70" style="width: 140px; height: 70px;">
        <g x="10" y="10" width="80" height="60">
            <svg x="10" y="10" width="80" height="60">
                <rect width="80" height="70" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
            </svg>
        </g>
        <g x="55" y="35" width="85" height="17">
            <foreignObject width="85" height="17" x="55" y="35">
                <p xmlns="http://www.w3.org/1999/xhtml" style="margin: 0;">Lorem</p>
            </foreignObject>
        </g>
    </svg>

    <svg pointer-events="none" x="15" y="10" width="141" height="71">
        <use xlink:href="#my-svg"></use>
    </svg>
</body>

Chrome/Safari/Opera 中的结果:

Firefox 中的结果

我的代码正确吗?有什么解决办法吗?

【问题讨论】:

    标签: html google-chrome firefox svg webkit


    【解决方案1】:

    这似乎是 Webkit 中的一个错误,暂时不会修复...

    https://bugs.webkit.org/show_bug.cgi?id=91515

    【讨论】:

      猜你喜欢
      • 2012-04-21
      • 2013-02-17
      • 2012-08-07
      • 1970-01-01
      • 2014-10-07
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      相关资源
      最近更新 更多