Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome Chrome第二个SVG元素中的foreignObject_Google Chrome_Svg_Webkit - Fatal编程技术网

Google chrome Chrome第二个SVG元素中的foreignObject

Google chrome Chrome第二个SVG元素中的foreignObject,google-chrome,svg,webkit,Google Chrome,Svg,Webkit,我对Chrome和foreignObject有一个问题,我想把它放在一个SVG元素中,这个SVG元素是另一个SVG元素的子元素,出于某种原因Chrome似乎不喜欢这样。我是在语法中遗漏了什么,还是时间文件是错误报告 例如: <svg width="400" height="600" xmlns="http://www.w3.org/2000/svg" version="1.1"> <foreignObject x="0" y="0" width="400" height

我对Chrome和foreignObject有一个问题,我想把它放在一个SVG元素中,这个SVG元素是另一个SVG元素的子元素,出于某种原因Chrome似乎不喜欢这样。我是在语法中遗漏了什么,还是时间文件是错误报告

例如:

<svg width="400" height="600" xmlns="http://www.w3.org/2000/svg" version="1.1">
    <foreignObject x="0" y="0" width="400" height="200" overflow="hidden" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="pointer-events: all;">
        <div contenteditable="true" xmlns="http://www.w3.org/1999/xhtml" style="background: black; color: white;">
            <div>This works!</div>
        </div>
        <textarea>Here we can select text</textarea>
    </foreignObject>
    <svg x="0" y="200" xmlns="http://www.w3.org/2000/svg" version="1.1">
        <foreignObject x="0" y="0" width="400" height="200" overflow="hidden" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="pointer-events: all;">
          <div contenteditable="true" xmlns="http://www.w3.org/1999/xhtml" style="background: black; color: white;">
            <div>But this does not in chrome, why not?</div>
          </div>
          <textarea>Unable to select text, but it's posible to edit</textarea>
        </foreignObject>
    </svg>
</svg>

这管用!
在这里我们可以选择文本
但这不适用于chrome,为什么不呢?
无法选择文本,但可以编辑

我遇到了同样的问题,只是我没有让它在Chrome中工作(你的示例的第一部分也适用于我)。你是否已经填写了一份错误报告,或者同时发现了更多的错误?我已经在谷歌提交了一份错误报告,但没有多少活动。