robnyman / domassistant

Automatically exported from code.google.com/p/domassistant
1 stars 0 forks source link

DOM Assistant fails to match :empty if a node contains an HTML comment #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
DOMAssistant should doesn't match :empty if a node contains only HTML 
commments. Probably an IE only bug since comments are traversable through the 
DOM

http://www.w3.org/TR/css3-selectors/#empty-pseudo

6.6.5.12. :empty pseudo-class

The :empty pseudo-class represents an element that has no children at all. In 
terms of the document tree, only element nodes and content nodes (such as DOM 
[DOM-LEVEL-3-CORE] text nodes, CDATA nodes, and entity references) whose data 
has a non-zero length must be considered as affecting emptiness; comments, 
processing instructions, and other nodes must not affect whether an element is 
considered empty or not. 

Original issue reported on code.google.com by keithjcl...@gmail.com on 14 Aug 2010 at 4:27

GoogleCodeExporter commented 9 years ago
Hi Keith, can you provide a test case?

Original comment by chengh...@gmail.com on 14 Aug 2010 at 6:20

GoogleCodeExporter commented 9 years ago
I've attached a test case. Open it in IE8 and inspect the red bars with IE's 
developer tools and you'll see one / two HTML comment nodes. These should be 
ignored when checking for empty. 

DOMAssistant checks for .firstChild and since a comment node is a valid node in 
IE the test passes even though no content exists.

Hope that helps

Keith

Original comment by keithjcl...@gmail.com on 15 Aug 2010 at 8:50

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by chengh...@gmail.com on 18 Aug 2010 at 8:37