A non empty BODY element triggers the *:empty CSS selector

RESOLVED FIXED in mozilla1.9beta4

Status

()

Core
CSS Parsing and Computation
P1
normal
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: Simon Proctor, Assigned: dbaron)

Tracking

({testcase})

1.8 Branch
mozilla1.9beta4
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
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.
(Reporter)

Comment 1

11 years ago
Created attachment 208204 [details]
Test Case

Source of test page.
(Reporter)

Comment 2

11 years ago
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

Just tested. Same effect.

Comment 3

11 years ago
Same here:

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

Ryan Jones

Updated

11 years ago
Assignee: nobody → dbaron
Component: General → Style System (CSS)
Keywords: testcase
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → ian
Hardware: PC → All
Version: unspecified → 1.8 Branch

Comment 4

11 years ago

*** This bug has been marked as a duplicate of 98997 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
(Assignee)

Comment 5

11 years ago
*** Bug 188953 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 6

11 years ago
I'm going to reopen this so people find it in searches since it's not obviously dynamic.
Status: RESOLVED → UNCONFIRMED
Depends on: 98997
Resolution: DUPLICATE → ---
(Assignee)

Updated

11 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P1

Comment 7

11 years ago
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 ... ;)
(Assignee)

Comment 8

11 years ago
Whatever it is (please check the spec), it doesn't belong in this bug report.
(Assignee)

Updated

10 years ago
QA Contact: ian → style-system
(Assignee)

Comment 9

9 years ago
Fixed by checkin of bug 401291, which fixed bug 98997, at 2008-02-18 22:17 -0800.
Status: NEW → RESOLVED
Last Resolved: 11 years ago9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
You need to log in before you can comment on or make changes to this bug.