Matt Brubeck, a Mozilla engineer, writes about Rust, browser internals, and Firefox for Android, including a toy browser engine series.
HN commenters recommend his toy layout engine series for anyone curious about browsers and cite his posts on Rust borrowing and Fennec's architecture.
> If you watch the talk I linked below
I've watched it several times over the past 2 years
And I've read the posts about writing and HTML engine in Rust when they first came out in 2014
https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html
and ported them to Elixir and still use them in my programming lessons
> Rust was key to the success.
For them
It's important to specify that Rust, built by Firefox, lead to a Firefox success.
Just like Dart, created by Google, is the language of choice for Flutter, also created by Google.
I know you've been working at Mozilla to work on Rust and I believe Rust is very good, but I also think Mozilla could have used other languages, there were a few that could led them to success, but they understood this are times where the "means of production" aren't the machines but engineers tools, and creating a programming language is the best way to control part of that world.
I recently implemented a similar concept to this for HTML emails at shortwave.com, it only works for the subset of non table emails (which we assume are marketing emails and you want to see the full HTML). It allows us to render stuff wayyy faster (especially on mobile where webviews are not cheap). We don't go all the way to pixel layout because we want to have some responsiveness, but it allows for heavily normalized emails (no more neon yellow on a green background with comic-sans font) and some other neat optimizations.
Didn't use yoga but a from scratch implementation. A good starting point is let's build a browser engine [1]. I hope to blog about it at somepoint.
[1]: https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html
I was going to ask for a brief overview of the architectural differences between Fennec, Webkit and Opera, but then I found your informative article here:
http://limpet.net/mbrubeck/2010/10/04/why-fennec-is-different.html
That hit most of my questions. Thanks! Are there any other Android browsers that have cropped up since then that might be worth mentioning? I saw an announcement for Opera Mobile -- does that change the landscape?
I'm currently using Dolphin HD, and am mostly satisfied with it. It's recent 4.0 upgrade helped a lot and took care of almost all my irritations with it. If only it were open source so the last remaining few could get fixed. But I'll check out Firefox Mobile soon and see how it compares.
Let's build a browser engine! [1] by Matt Brubeck is a good place to start. I see Kosmonaut cites it in its README
I once took a stab at rewriting it in C99 using reference counting for memory management [2], so I recognised the screenshot in Kosmonaut immediately.
Unfortunately the article series stops before explaining inline layouts and I never got around to doing anything further with my implementation.
[1] https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html
[2] https://github.com/wernsey/robinson-c
Yes, we support the viewport meta tag: http://limpet.net/mbrubeck/2010/05/10/fennec-meta-viewport.html
We don't yet support touch events. We're working on it, but it will probably not be reading until the next release after 4.0: https://bugzilla.mozilla.org/show_bug.cgi?id=544614
The newly formed W3C Web Events working group will be coming up with a standardized version of the various non-standard touch events invented by Apple, Google, and Mozilla: http://www.w3.org/2010/webevents/
It's not a hack, although I can't really fault you for thinking otherwise. The borrow notations are & (shared) and &mut (exclusive, guarantees mutability regardless of type). 'Interior mutability' is a way of enabling shared data to be mutable. See https://limpet.net/mbrubeck/2019/02/07/rust-a-unique-perspective.html for a more principled explanation, which even improves on Rust's official docs - this is probably best read in combination w/ OP's series.