New issue
Advanced search Search tips

Issue 812105 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Importing Attr nodes with namespace fails

Project Member Reported by tkent@chromium.org, Feb 14 2018

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.

 

Comment 1 by rakina@chromium.org, Feb 16 2018

Status: Available (was: Untriaged)

Comment 2 by tkent@chromium.org, Feb 20 2018

Owner: tkent@chromium.org
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Comment 4 by tkent@chromium.org, Feb 20 2018

Labels: M-66
Status: Fixed (was: Started)

Sign in to add a comment