- From: ArkadiuszMichalski <notifications@github.com>
- Date: Thu, 05 Nov 2015 03:57:45 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Message-ID: <whatwg/dom/issues/104/154040531@github.com>
Me again, this is small test case: ``` <!DOCTYPE html> <html> <body> <div id="contener"> <p name="test">P1 (name="test") in DIV.</p> <p id="test">P2 (id="test") in DIV.</p> <p id="Test">P3 (id="Test") in DIV.</p> <p name="Test">P4 (name="Test") in DIV.</p> </div> <script> var contener = document.getElementById("contener"); var newP = document.createElementNS("", "P"); newP.setAttribute("name", "TEST"); newP.textContent = "New P in DIV without namespace and created inside script."; contener.insertBefore(newP, contener.firstChild); var collection = contener.children; console.log("collection.length: " + collection.length); console.log("collection.hasOwnProperty('TEST'): " + collection.hasOwnProperty('TEST')); if (collection.namedItem('TEST')){ console.log("collection.namedItem('TEST').textContent: " + collection.namedItem('TEST').textContent); console.log("collection['TEST'].textContent: " + collection['TEST'].textContent); } console.log(collection); </script> </body> </html> ``` I try research Web IDL to see what is corelation beetwen method and supported property names (if we use getter in IDL definition for method) but still have some question: 1. This supported property names should always be listed in DevTools when we inspect collection? For HTMLCollection I see they are, but only for elements in HTML namespace with `name` attribute. But in the other site, for NameNodeMap, I don't see this supported property names in DevTools, I ask because supported property indices are always display. 2. Checking `obj.hasOwnProperty()` when passing as argument one of supported property names should always return `true` or not? I ask because see strange behaviour, especially for `NameNodeMap.hasOwnProperty()`, when browsers usually do not pay attention to size characters, and sometimes Firefox and Chrome product different result so I can't determine what's going on. --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/104#issuecomment-154040531
Received on Thursday, 5 November 2015 11:58:14 UTC