Files
browser/src
Karl Seguin 6352863d6e css: Respect @layer priority
Builds ontop of https://github.com/lightpanda-io/browser/pull/2719 and adds
the missing layer-priority.

This can be broken down into two parts. The first is the hot read path. This
code is unchanged...same buckets and same u64 priority comparison.

What has changed is the build/rebuild step and how / what the
VisibilityRule.priority means. priority used to be 32bits for specificity and
32bits for doc order (specificity tie-breaker). Priority is now 12bits for
layer rank, 30bits for specificity and 22bits for doc order. Specificity was
only using 30bits, and the smaller doc order means we can now only represent
4 million rules (Facebook, which has _a lot_ of rules, has ~50K and like 95% of
those are not visibility rules..so we have plenty of space still).

But layer ordering is complicated because you need to parse everything before
you know the final order. So our build now accumulates intermediary results and
does a final iteration through the VisibilityRule to |= the rank_layer bits of
their priority. This is no-op if there are no layers (common case for now).
Because of this intermediary work, I've added a build_arena that is build/
rebuild specific. Possibly overkill since we don't expect sites to have
thousands of layers, but it's cheap to add (except now you need to think: should
I use the build_arena or self.arena).
2026-07-17 17:54:40 +08:00
..
2026-07-17 17:54:40 +08:00
2026-07-08 10:19:38 +08:00
2026-07-14 11:32:52 +08:00
2026-07-14 09:17:14 +08:00
2026-07-09 20:59:58 +08:00
2026-07-14 09:17:14 +08:00
2026-06-24 18:16:02 +08:00
2026-07-14 09:17:14 +08:00
2026-05-29 09:32:03 +08:00
2026-07-16 18:54:59 +08:00
2026-07-14 09:17:14 +08:00
2026-07-02 11:23:45 +02:00
2026-07-14 09:17:14 +08:00
2026-07-14 11:32:52 +08:00
2026-07-17 09:13:33 +08:00
2026-05-25 18:05:11 +02:00