css: add isEmptyText in node interface

This commit is contained in:
Pierre Tachoire
2024-03-25 17:45:19 +01:00
parent 2c7650cdb1
commit 4e61a50946
3 changed files with 16 additions and 2 deletions

View File

@@ -383,8 +383,10 @@ pub const Selector = union(enum) {
while (c != null) {
if (c.?.isElement()) return false;
// TODO check text node content equals an empty
// string ("")
if (c.?.isText()) {
if (try c.?.isEmptyText()) continue;
return false;
}
c = try c.?.nextSibling();
}