- From: <bugzilla@jessica.w3.org>
- Date: Wed, 22 Aug 2012 16:59:33 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18645 --- Comment #2 from Dimitri Glazkov <dglazkov@chromium.org> 2012-08-22 16:59:32 UTC --- (In reply to comment #1) > Actually a <select> element will get not only the direct children <option> but > also get non direct children. > > For example, > > <select> > <option>foo</option> > <p><option>bar</option></p> > </select> > > both 'foo' and 'bar' will be used in this case. Right, but in this case, the HTML parser is playing tricks on you. Look at the resulting DOM tree: you'll see that <p> is silently dropped. However, if still you try to create this structure imperatively, you'll see that only <options> that are direct children are shown: http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cselect%3E%0A%3Coption%3Efoo%3C%2Foption%3E%0A%3Cp%3E%3Coption%3Ebar%3C%2Foption%3E%3C%2Fp%3E%0A%3C%2Fselect%3E%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%E2%80%8B%0A%3Cscript%3E%0A%0Avar%20option%20%3D%20document.createElement('option')%3B%0Aoption.textContent%20%3D%20'baz'%3B%0Avar%20p%20%3D%20document.createElement('p')%3B%0Ap.appendChild(option)%3B%0Adocument.querySelector('select').appendChild(p)%3B%0A%0A%3C%2Fscript%3E -- Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug.
Received on Wednesday, 22 August 2012 16:59:34 UTC