shadow DOM getElementById doesn't return DOM object.
Reported by
ka...@geospock.com,
Sep 23 2016
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Steps to reproduce the problem:
1. Create document containing empty div with id=HERE
2. Add script;
setTimeout(function() {
console.log("Reproduction attempt....");
var mydiv = document.getElementById("HERE");
console.log(mydiv);
console.log(typeof(mydiv));
var otherdiv = document.createElement("div");
var myshad = mydiv.attachShadow({mode: "open"});
myshad.innerHTML = '<div id="SHADDIV">Hello</div>';
var t = myshad.getElementById("SHADDIV");
console.log(t);
console.log(typeof(t));
console.log(Object.keys(t));
t.appendChild(otherdiv); // errors.
}, 500);
3. Open Console. Load page.
What is the expected behavior?
No error.
What went wrong?
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
Did this work before? N/A
Chrome version: 53.0.2785.116 Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
shadow dom getElementById operations are returning an object with no methods. (Can see this in console log).
This upsets appendChild which wants a Node...
,
Sep 26 2016
I can't reproduce the error, using this jsbin: http://jsbin.com/qequqo/edit?html,output on 53.0.2785.116. Could you create a reproducing file and attach to this bug if you can still reproduce?
,
Sep 26 2016
I have a repro at http://www.fysh.org/~katie/browser_bug_testing/shadow_dom/index3.html
,
Sep 26 2016
Your code says it loads polyfill, so it doesn't look like it's using the native shadow DOM for some reasons. Can you debug?
,
Oct 4 2016
Thank you for providing more feedback. Adding requester "kojii@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 4 2016
Closing as I'm not getting responses. Please add comments if you could reproduce without using polyfill, and I'll reopen. |
||||
►
Sign in to add a comment |
||||
Comment 1 by katielau...@gmail.com
, Sep 25 2016