Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My ears pricked up at "The culprit for this is the heap allocation by default dogma.."

https://mastodon.social/@akkartik/100357841646414633 (Mastodon doesn't have in-page anchors, but search for 'memory allocator'.)



  > document.querySelectorAll('[id]').length
  0
That caught me by surprise. Especially when it has its class entry-center to indicate “this is the actively focused message”, to not load to that point in the page or at least have an ID to jump to there seems surprising.

(A pure CSS solution for centering it on the page with an anchor: make the .entry-center `position: relative`, and give it a new child <div id=jump> with CSS `position: absolute; top: calc(50% - 50vh)`. The downside is that if the entire .entry-center is taller than the viewport, it will still be centered on the page, rather than sitting at the top. I suspect that defect could be solved if you used two nodes instead of just one, combining margin and padding, since padding can’t be negative.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: