Last Comment Bug 323052 - A non empty BODY element triggers the *:empty CSS selector
: A non empty BODY element triggers the *:empty CSS selector
: testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: 1.8 Branch
: All All
: P1 normal (vote)
: mozilla1.9beta4
Assigned To: David Baron :dbaron: ⌚️UTC-10
: Jet Villegas (:jet)
: 188953 (view as bug list)
Depends on: 98997
  Show dependency treegraph
Reported: 2006-01-11 09:41 PST by Simon Proctor
Modified: 2008-02-19 12:58 PST (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Test Case (255 bytes, text/html)
2006-01-11 09:42 PST, Simon Proctor
no flags Details

Description Simon Proctor 2006-01-11 09:41:45 PST
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.
Comment 1 Simon Proctor 2006-01-11 09:42:45 PST
Created attachment 208204 [details]
Test Case

Source of test page.
Comment 2 Simon Proctor 2006-01-11 12:32:57 PST
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

Just tested. Same effect.
Comment 3 Ryan Jones 2006-01-11 15:47:35 PST
Same here:

Mozilla/5.0 (Windows; U; Win98; en-US; rv: Gecko/20060110 Firefox/

Ryan Jones
Comment 4 Adam Guthrie 2006-01-11 21:41:06 PST

*** This bug has been marked as a duplicate of 98997 ***
Comment 5 David Baron :dbaron: ⌚️UTC-10 2006-01-11 21:43:30 PST
*** Bug 188953 has been marked as a duplicate of this bug. ***
Comment 6 David Baron :dbaron: ⌚️UTC-10 2006-01-12 13:33:03 PST
I'm going to reopen this so people find it in searches since it's not obviously dynamic.
Comment 7 Mats Lindblad 2006-01-17 02:19:30 PST
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 ... ;)
Comment 8 David Baron :dbaron: ⌚️UTC-10 2006-01-17 15:35:53 PST
Whatever it is (please check the spec), it doesn't belong in this bug report.
Comment 9 David Baron :dbaron: ⌚️UTC-10 2008-02-19 12:58:17 PST
Fixed by checkin of bug 401291, which fixed bug 98997, at 2008-02-18 22:17 -0800.

Note You need to log in before you can comment on or make changes to this bug.