Bug 42614 - :empty css selector is not working correctly
Summary: :empty css selector is not working correctly
Status: RESOLVED DUPLICATE of bug 26570
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://vitresimpec.com/webkit/:empty-...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 22:18 PDT by Simon Charette
Modified: 2010-07-20 10:30 PDT (History)
2 users (show)

See Also:


Attachments
Testcase (839 bytes, text/html)
2010-07-19 22:18 PDT, Simon Charette
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Charette 2010-07-19 22:18:36 PDT
Created attachment 62033 [details]
Testcase

Webkit browsers Chrome 5 (Win & Linux), Chromium 6 (Win & Linux), and Safari latest on PC all behave the same and don't respect the :empty selector correctly. Hitting the "force redraw" button or zooming the page force webkit to respect the pseudo-class correctly.

See http://www.w3.org/TR/css3-selectors/#empty-pseudo.
Comment 1 Simon Charette 2010-07-19 22:21:05 PDT
Download the file locally while i host a version. The attachment seems to work fine here but locally it fails.
Comment 2 Simon Charette 2010-07-19 22:25:33 PDT
Comment on attachment 62033 [details]
Testcase

><!doctype html>
><html>
>  <head>
>    <style type="text/css">
>      h2:empty,
>      tbody:empty,
>      thead:empty {
>        display: none;
>      }
>      h2:not(:empty),
>      tbody:not(:empty),
>      thead:not(:empty) {
>        background: green;
>      }
>    </style>
>  </head>
>  <body>
>    <a href="https://bug-42614-attachments.webkit.org/attachment.cgi?id=62033">Reload</a>
>    <input onclick="document.body.innerHTML = document.body.innerHTML" id="refresher" type="button" value="force redraw (document.body.innerHTML = document.body.innerHTML)" />
>    <h2>I'm not empty</h2>
>    <table>
>      <thead>
>        <tr>
>          <th>/html/body/table/thead/tr/th</th>
>        </tr>
>      </thead>
>      <tbody>
>        <tr>
>          <td>/html/body/table/tbody/tr/td</td>
>        </tr>
>      </tbody>
>      <tr>
>        <td>/html/body/table/tr/td => /html/body/table/tbody[2]/tr/td</td>
>      </tr>
>    </table>
>  </body>
></html>
>
Comment 3 Simon Charette 2010-07-19 22:52:45 PDT
There seems to be a layout cache issue somehow. On linux chromium 6.0.470.0 (52837) i can only reproduce locally but on windows chromium 6.0.446.0 (50541) fails both online and offline (same with chrome 5.0.375.99 and safari 5.0).
Comment 4 mitz 2010-07-20 10:25:22 PDT
Looks like a duplicate of bug 26570.
Comment 5 Simon Charette 2010-07-20 10:30:51 PDT
It is a dupplicate, sorry. Still the report is old.

*** This bug has been marked as a duplicate of bug 26570 ***