LibWeb+WebContent: Include rule count in listed CSS style sheets

This commit is contained in:
Timothy Flynn 2025-03-12 14:34:23 -04:00 committed by Tim Flynn
commit cf601a49bb
Notes: github-actions[bot] 2025-03-13 20:57:30 +00:00
3 changed files with 12 additions and 3 deletions

View file

@ -896,6 +896,7 @@ static void gather_style_sheets(Vector<Web::CSS::StyleSheetIdentifier>& results,
if (auto location = sheet.location(); location.has_value())
identifier.url = location.release_value();
identifier.rule_count = sheet.rules().length();
results.append(move(identifier));
}
@ -904,8 +905,10 @@ static void gather_style_sheets(Vector<Web::CSS::StyleSheetIdentifier>& results,
gather_style_sheets(results, *import_rule->loaded_style_sheet());
} else {
// We can gather this anyway, and hope it loads later
results.append({ .type = Web::CSS::StyleSheetIdentifier::Type::ImportRule,
.url = import_rule->url().to_string() });
results.append({
.type = Web::CSS::StyleSheetIdentifier::Type::ImportRule,
.url = import_rule->url().to_string(),
});
}
}
}