TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How Browsers Lay Out Web Pages

269 pointsby pavpanchekhaabout 4 years ago

8 comments

helsinkiandrewabout 4 years ago
This is excellent. However much effort I&#x27;ve put in I&#x27;ve always found HTML or rather CSS impenetrable. When doing something a little more complex I will often end up with something that works (or breaks) without fully understanding why.<p>Are there any other good references that give a good underlying understanding of HTML&#x2F;CSS without just giving examples of the various elements?
评论 #26710719 未加载
评论 #26709888 未加载
评论 #26713349 未加载
评论 #26709995 未加载
评论 #26710722 未加载
londons_exploreabout 4 years ago
For those wanting to dive deeper, the layout code in Chromium is surprisingly easy to read considering its a 20+ year old codebase.<p>This is a good starting point:<p><a href="https:&#x2F;&#x2F;source.chromium.org&#x2F;chromium&#x2F;chromium&#x2F;src&#x2F;+&#x2F;master:third_party&#x2F;blink&#x2F;renderer&#x2F;core&#x2F;layout&#x2F;layout_object.h;l=178;drc=bba0186702ff39303c487a012626e5fba8ab42ed;bpv=1;bpt=1" rel="nofollow">https:&#x2F;&#x2F;source.chromium.org&#x2F;chromium&#x2F;chromium&#x2F;src&#x2F;+&#x2F;master:t...</a>
评论 #26713287 未加载
评论 #26711639 未加载
chakspakabout 4 years ago
This tutorial looks amazing. I know what I&#x27;m going to be doing the next few weekends.
评论 #26710113 未加载
评论 #26708917 未加载
评论 #26707856 未加载
评论 #26707952 未加载
chris_wotabout 4 years ago
This is excellent, but I also recommend the following that describes how <i>text</i> is laid out of the screen:<p><a href="https:&#x2F;&#x2F;raphlinus.github.io&#x2F;text&#x2F;2020&#x2F;10&#x2F;26&#x2F;text-layout.html" rel="nofollow">https:&#x2F;&#x2F;raphlinus.github.io&#x2F;text&#x2F;2020&#x2F;10&#x2F;26&#x2F;text-layout.html</a>
Inityxabout 4 years ago
I wish this web page used a smaller font, 24px (18pt) is really, really large. (HN comments are 9pt.)<p>The page&#x27;s ToC uses 60% of the body font, which is ~10pt.
评论 #26708601 未加载
评论 #26708183 未加载
评论 #26708533 未加载
评论 #26712323 未加载
评论 #26708106 未加载
jasimabout 4 years ago
&gt; Finally, functional languages tend to fight against large, mutually-linked, mutable data structures, yet the layout engine of a browser is all about that.<p>Is the DOM (and LayoutObject et al.) truly a case where imperative object-oriented programming shines? In pure FP operations like insertion, bidirectional traversal, and moving objects between parents can be cumbersome because there is no implicit identity for the objects.<p>Curious whether this is true, or is there a way to implement a DOM-like API with mostly immutable values?
divanabout 4 years ago
Random thought: why do we still call them &quot;web pages&quot;? They&#x27;re not hypertext pages anymore and browsers are not hypertext document browsers anymore.<p>(It should probably be called &quot;VM for UI apps that run directly from URL and written in UI stack that has never been intended for UI apps, and has weird tabbed window manager&quot;)
ksecabout 4 years ago
&gt; Elements like &lt;body&gt; and &lt;header&gt; contain blocks stacked vertically. But elements like &lt;p&gt; and &lt;h1&gt; contain text and lay that text out horizontally in lines. ( In European languages, at least! )<p>Another day, another features despite PDF not being perfect, is still miles ahead of HTML. I am not even sure if there are any intention to bring vertical Japanese subtext feature to HTML.
评论 #26709500 未加载
评论 #26712867 未加载