bfgeek.bsky.social
@bfgeek.bsky.social
If you wanted to drop by Mountain View I'd be happy to say hi if you have spare time.
October 28, 2025 at 6:58 PM
Reposted
Yes, but the browsers have implemented this optimization differently.

WebKit/Firefox have the same optimization in that they use (effectively) a linked-list of HashMap(s).

There are some performance cliffs with this - lookups can be slow, e.g. you check a HashMap, then check its parent, etc.
October 13, 2025 at 6:52 PM
I should have started with, the initial implementations of custom properties just used a single HashMap, and copied at each level, but this was slow (both for copying the large HashMap, and comparing for invalidation purposes).
October 13, 2025 at 6:54 PM
Lookups are generally fast as the trie is generally shallow (max depth of 8 nodes with a fanout of 4 bits, but often only 3-4 deep), and equality checking is relatively quick.
October 13, 2025 at 6:52 PM
HAMTs are used often in functional language implementations, its main benefits are that it avoids the slow HashMap copies (you only need to copy part of the data-structure for mutating a single entry), and due to this more memory efficient.
October 13, 2025 at 6:52 PM
Blink used to only have a linked-list of 2 (sort of). This however was hit these cliffs more often, we now use a Array-Mapped-Trie:
en.wikipedia.org/wiki/Hash_ar...
source.chromium.org/chromium/chr...
I personally tried the linked-list approach but found it was relatively slow on benchmarks.
Hash array mapped trie - Wikipedia
en.wikipedia.org
October 13, 2025 at 6:52 PM
So avoid the cliffs they limit the length of the linked-list to 4, and only copy add the last HashMap to the chain if it has more than 8 entries.

searchfox.org/wubkat/sourc...
searchfox.org/firefox-main...

Its possible to hit performance cliffs if you exceed these limits (copying HashMaps is slow)
searchfox.org
October 13, 2025 at 6:52 PM
Yes, but the browsers have implemented this optimization differently.

WebKit/Firefox have the same optimization in that they use (effectively) a linked-list of HashMap(s).

There are some performance cliffs with this - lookups can be slow, e.g. you check a HashMap, then check its parent, etc.
October 13, 2025 at 6:52 PM
I think this only happens from some IPs, likely some poorly configured "DDoS" firewall or something.
October 4, 2025 at 2:35 AM
Did they localise the unit conversion? E.g. us cup is ~237ml , UK ~250. Don't get me started on tablespoon, teaspoon conversions.
September 4, 2025 at 4:39 PM
There's a reason I killed it many moons ago :) chromium-review.googlesource.com/c/chromium/s...
Gerrit Code Review
chromium-review.googlesource.com
August 27, 2025 at 8:18 PM
Zoom and DPI affects the blink maximum. A lot of this is when conversion from/to float/double/fixed-precision occurs.
August 7, 2025 at 8:44 PM
Note the prefixed ones behave very differently. In firefox the prefixed version only works in the inline axis, in Safari the block axis behaves like quirky percentages.
August 7, 2025 at 8:39 PM
A thing to keep in mind is that the performance of a native variant is likely to be worse than a polyfill (bindings overhead as DOMRect etc arent JS native objects)
July 5, 2025 at 4:46 PM
`container-type` forces `layout` containment, which forces an independent formatting context for the subgrid (it'll be a separate grid layout). The other browsers are wrong here.
June 30, 2025 at 7:51 PM
... you need a 16?-patch - e.g. various T-intersections, etc. Maybe that isn't needed, but don't want to repeat the usage problems of border-image.

cc/ @tabatkins.com
June 11, 2025 at 7:00 PM
(I'm helping with this feature)

If you can come up with a good syntax let us know!

Supporting images is clearly a usecase that this should support at some stage - but I don't think I've met a webdev that can use border-image out of the box. The situation here is "worse" as instead of a 9-patch...
June 11, 2025 at 7:00 PM
.... so if you can come up with a good syntax for this use-case please let us know!

(I don't think i've met a web-developer that can successfully use border-image first try).
June 11, 2025 at 4:38 PM
This is a very good base proposal, e.g. it does what column-rule-* could already do with some minimal extensions. It covers a lot of use-cases.

There are some further extensions to the syntax - but are difficult. (supporting images). The prior art here (border-image) isn't really intuitive....
June 11, 2025 at 4:38 PM
selectors (classes/ids) are. (For clarification). Hits CSS tooling which does renaming that isn't aware of this; accidentally load something up in quirks mode and you generated class of ".aB" suddenly matches more things!
June 6, 2025 at 5:04 AM
"except for the things we name ourselves" - except in quirks mode :)
June 5, 2025 at 8:26 PM