Compare the following examples (using innerHTML to add content): 1) http://jsfiddle.net/gtXYC/0/ (works) 2) http://jsfiddle.net/gtXYC/1/ (broken) Same problem using appendChild() instead of innerHTML: 3) http://jsfiddle.net/gtXYC/2/ (works) 4) http://jsfiddle.net/gtXYC/3/ (broken) Examples 1/3: The div's background-color changes based on whether the div is empty or not. Examples 2/4: Same situation, except that the visibility of the div should change. The problem is that :empty still matches after content is added to the div.
Verified as fixed with WebKit Nightly Version 5.1.5 (6534.55.3, r115022).
(In reply to comment #1) > Verified as fixed with WebKit Nightly Version 5.1.5 (6534.55.3, r115022). Are we sure the test cases attached on this bug are covered? Shouldn't we land them to prevent a regression?
Since we don't know what fixed this, and haven't landed tests, this is WORKSFORME at best. I agree with Julien that we should investigate the need to land tests.
$ bisect-builds http://jsfiddle.net/gtXYC/1/ -r 109280:109476 -p -s Fails: r109280 Works: r109476 http://trac.webkit.org/log/trunk/?rev=109476&stop_rev=109281 See http://trac.webkit.org/changeset/109417/trunk :empty still applies to elements made non-empty via page dynamics. https://bugs.webkit.org/show_bug.cgi?id=79734 Covered by test: http://trac.webkit.org/browser/trunk/LayoutTests/fast/selectors/empty-element-made-non-empty.html?rev=109417
*** This bug has been marked as a duplicate of bug 79734 ***
Thank you for researching when this got fixed!