User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 While testing the CSS 3 selectors I tried the :empty selector only to find it had matched the body of the page. Reproducible: Always Steps to Reproduce: 1. Create a page with content. And use :empty as a selector. Actual Results: The BODY element was selected by the selector, (checking in the DOM inspector showed it was the BODY element and not the HEAD or HTML ones). Expected Results: The BOSY element should not be matched unless it is empty.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Just tested. Same effect.
Same here: Mozilla/5.0 (Windows; U; Win98; en-US; rv:22.214.171.124) Gecko/20060110 Firefox/126.96.36.199 Ryan Jones
*** This bug has been marked as a duplicate of 98997 ***
*** Bug 188953 has been marked as a duplicate of this bug. ***
I'm going to reopen this so people find it in searches since it's not obviously dynamic.
This may not be a bug but it seems that it's more of an unfortunate side-effect; When you use :empty it get applied to emtpy tags/elements like <input/> which may not be what you want since they may have a value and shouldn't be affected. Empty should meen "no value" right? To me it's faulty behavior. But that's just me ... ;)
Whatever it is (please check the spec), it doesn't belong in this bug report.
Fixed by checkin of bug 401291, which fixed bug 98997, at 2008-02-18 22:17 -0800.