Bug 26570

Summary: webkit fails to respect :empty with display: none;
Product: WebKit Reporter: Jerome Leclanche <jerome>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bohwaz, charette.s, frederic.scherma, ivovlnni, noel.gordon, rik, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 79734    
Attachments:
Description Flags
Testcase
none
Simple test case
none
Patch none

Description Jerome Leclanche 2009-06-20 01:15:29 PDT
Very easy to reproduce:

<style type="text/css">
.e { background-color: red; margin: 5px; width: 90%; }
.e:empty { border: display: none; }
</style>
<div class="e">This is not empty</div>

See attached url for a more detailed testcase.
Comment 1 Jerome Leclanche 2009-06-20 01:16:15 PDT
Created attachment 31590 [details]
Testcase
Comment 2 bohwaz 2010-03-03 15:27:14 PST
Created attachment 49956 [details]
Simple test case
Comment 3 bohwaz 2010-03-03 15:27:48 PST
Bug confirmed, :empty is bogus when used with display: none; (see my testcase)
Comment 4 Anthony Ricaud 2010-03-03 15:35:15 PST
The two attached testcases confirmed this behavior. The testcase inlined in the first comment is wrong (border: display: none;) but confirm too by removing "border:"
Comment 5 Simon Charette 2010-07-20 10:30:51 PDT
*** Bug 42614 has been marked as a duplicate of this bug. ***
Comment 6 Alexey Proskuryakov 2010-08-30 10:13:48 PDT
*** Bug 44871 has been marked as a duplicate of this bug. ***
Comment 7 Jerome Leclanche 2011-05-20 17:01:38 PDT
Looks fixed

WebKit	534.36 (trunk@86496)
Comment 8 Alexey Proskuryakov 2011-05-20 22:34:57 PDT
Thank you for following up!

I'm wondering if we should land a regression test for this.
Comment 9 noel gordon 2011-07-20 01:08:46 PDT
(In reply to comment #8)
> I'm wondering if we should land a regression test for this.

Does fast/css/empty-display-none.html suffice?
Comment 10 noel gordon 2011-07-20 19:38:58 PDT
Created attachment 101547 [details]
Patch

Add a specific test case for variety.
Comment 11 noel gordon 2011-07-25 21:26:59 PDT
(In reply to comment #8)
> Thank you for following up!
> 
> I'm wondering if we should land a regression test for this.

Yes we should. Could you review please?
Comment 12 Alexey Proskuryakov 2011-07-25 23:09:01 PDT
Comment on attachment 101547 [details]
Patch

Nice!
Comment 13 WebKit Review Bot 2011-07-26 00:06:05 PDT
Comment on attachment 101547 [details]
Patch

Clearing flags on attachment: 101547

Committed r91744: <http://trac.webkit.org/changeset/91744>
Comment 14 WebKit Review Bot 2011-07-26 00:06:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Frédéric Scherma 2014-06-27 06:57:32 PDT
In chromium 34 on linux and 35 on osx I've have an issue with a similar case but a bit more complex (see the following jsfiddle):

http://jsfiddle.net/YprUV/47/

When 'remove' button is clicked, 'is empty' should appears, but it doesn't without the workaround I've added (the first empty css 'ul:empty {}').

Try to comment it, and then 'is empty' would not appears.
Comment 16 noel gordon 2014-06-27 07:36:24 PDT
Different because of the combinator perhaps.

>In chromium 34 on linux and 35 on osx

Please do file a bug at crbug.com