mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
update comments to reflect preference-based bucketing
This commit is contained in:
@@ -478,11 +478,10 @@ const BucketKey = union(enum) {
|
|||||||
other,
|
other,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Returns the bucket key for a compound selector, or null if the selector
|
/// Returns the best bucket key for a compound selector, or null if it contains
|
||||||
/// ends with a dynamic pseudo-class that we should skip (hover, active, focus, etc.)
|
/// a dynamic pseudo-class we should skip (hover, active, focus, etc.)
|
||||||
|
/// Priority: id > class > tag > other
|
||||||
fn getBucketKey(compound: Selector.Compound) ?BucketKey {
|
fn getBucketKey(compound: Selector.Compound) ?BucketKey {
|
||||||
// Iterate parts in reverse to find the most specific bucketing key
|
|
||||||
// Priority: id > class > tag > other
|
|
||||||
var best_key: BucketKey = .other;
|
var best_key: BucketKey = .other;
|
||||||
|
|
||||||
for (compound.parts) |part| {
|
for (compound.parts) |part| {
|
||||||
|
|||||||
Reference in New Issue
Block a user