Importing Attr nodes with namespace fails |
|||
Issue description
Chrome Version: 66 canary
OS: All
What steps will reproduce the problem?
(1) Open the following HTML document:
<!DOCTYPE html>
<pre></pre>
<script>
function log(m) { document.querySelector('pre').textContent += m + '\n' }
var doc = document.implementation.createHTMLDocument();
doc.body.setAttributeNS('urn:test', 'p:name', 'value');
var original = doc.body.getAttributeNodeNS('urn:test', 'name');
log('original prefix: ' + original.prefix);
log('original namespace: ' + original.namespaceURI);
var imported = document.importNode(original, true);
log('imported prefix: ' + imported.prefix);
log('imported namespace: ' + imported.namespaceURI);
</script>
(2) Observe the rendered page
What is the expected result?
original prefix: p
original namespace: urn:test
imported prefix: p
imported namespace: urn:test
What happens instead?
original prefix: p
original namespace: urn:test
imported prefix: null
imported namespace: null
Please use labels and text to provide additional information.
Firefox works correctly, and Safari TP fails.
,
Feb 20 2018
,
Feb 20 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/71b093d2c834e0a4e15149022e4f88ab144ac805 commit 71b093d2c834e0a4e15149022e4f88ab144ac805 Author: Kent Tamura <tkent@chromium.org> Date: Tue Feb 20 07:09:22 2018 Fix a bug that document.importNode() doesn't clone Attr nodes with namespace. We should just call Attr::Clone(). Bug: 812089 , 812105 Change-Id: I163769e134a52d82b88834ae29083a01a3480e95 Reviewed-on: https://chromium-review.googlesource.com/925865 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#537730} [modify] https://crrev.com/71b093d2c834e0a4e15149022e4f88ab144ac805/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Document-importNode.html [modify] https://crrev.com/71b093d2c834e0a4e15149022e4f88ab144ac805/third_party/WebKit/Source/core/dom/Document.cpp
,
Feb 20 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by rakina@chromium.org
, Feb 16 2018