stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

StarBrowser

  • 7 Devlogs
  • 21 Total hours

A Web browser made in rust

Open comments for this post

4h 6m 14s logged

First in the UI and Rendering architecture I added a 2010 style chrome colour palette. I also implemented new vertex, rect and ui structs with layout_ui() to calculate and position the tab strip, address bat, navi buttons and the content viewport. I also made a new WGSL shader pipeline and vertex buffer for rendering flat colour rectangles. I then added normalise_url(), fetch_page(), navigate(), go_history() and reload(). Then I updated the core State struct, removed the raw display_text stering and replaced it with rectangle pipelines, address input state, focus flags, document title tracking, history stacks, scroll offsets and mouse tracking. I rewrote window_event() and app resume logic to handle the mouse movements, vlivks, wheel scrolling and keyboard typing including Enter backspace and shortcuts with ctrl and alt. I also removed the esc to quit application and it now just refocuses onto the addrtess bar. And render() draws the UI rectabgles first, then the address text, tabs buttons and page text with clipping and scroll offsets on a white background.

I also made a new HTML Parser module. With tokenisation and scanning, it includfes void/raw text element lists, entitity decoding with &amp, &nbdp, etc, character scanning and attribute parsing. parse() constructs the existing HTMLDocument and HTMLNode types from client.rs which handles comments, doctypes, closing tags and script/style. With DOM Utils it includfes is_block_level(), extract_visible_text() which skips , , and tags while infecting liner breaks around block elements and nodewalking and title extraction (find_title()).

I also deleted cssrom.rs whcih I originally had plans for but I just merged them into parser.rs and cascade.rs.

My current limitations are rendering since the pages only display as plain text so no images, hyperlinks, styling or CSS in general. There is also network bliocking where page fetching is synchronus and blocks the UI window while loading.

0
0
26
Open comments for this post

8h 1m 43s logged

I can guarantee you I am not dead even though its been like 3 months. I build about the entire css engine. I can now display the web page’s html onto the app. In the app you can’t scroll down as I still need to implement that but this is progress. A lot of the functionality is there in my code but it is unused since I need to do a whole lot more work on it but this devlog is already 8 hours and I don’t want to go over 10 so I’m making a devlog here.

tokenise.rs is a css level 3 tokeniser and is pretty much the architecture. units.rs is just simple unit and angle conversion. colour.rs is just colour parsing. colours.rs is mostly just the colour-name hex table. selectors.rs is the full selector parser. parser.rs is the component valuesa dn declarations into a Stylesheet model. cascade.rs matches an element against a stylesheet and sorts it by specificity/order. box_model.rs and layout.rs just set the layout of the app’s edges/borders/padding/margin and a block-layout pass decoupled from font types that dont exist in the app natively.

I would write a lot more and style the devlog better but this new stardance thing with the animations everywhere make it almost impossible to type properly and I’m on a gaming laptop

0
0
36
Open comments for this post

2h 39m 26s logged

Added Protocol::connect_tls() method using rustls::StreamOwned<rustls::ClientConnection, TcpStream>.
Created AllowAnyVerifier implementing rustls::client::danger::ServerCertVerifier to accept any certificate
AddedClient::connect_tls() that loads ca-certificates.crt if present otherwise falls back to system certs
TLS now works for HTTP1_1 and HTTP2_0 protocols
New DNSCache struct with Arc<Mutex<HashMap<String, DNSCacheEntry»> thread-safe, TTL-based
DNSCacheEntry stores resolved SocketAddr list + expiry timestamp
resolve_dns() now uses trust_dns_resolver::Resolver::from_system_conf() for proper DNS lookups, with fallback to ToSocketAddrs
parse_url() extracts the host, port, and TLS flag from http:// or https:// URLs
Handles explicit ports (example.com:8080) and defaults (80/443)
connect_to() now calls resolve_and_connect() which uses DNS cache + TLS decision logic
Client now tracks redirect_count
send_request() detects 3xx status codes, reads location header, and follows redirects
HTMLTag -enum of all standard HTML5 tags
HTMLAttribute -name/value pairs
HTMLNode - tag + attributes + children + optional text content
HTMLDocument -doctype + root node
HTMLTag::from_string() - case-insensitive parser for all tags

1
0
4
Open comments for this post

1h 36m 38s logged

I added text rendering to the wgpu window so it displays the HTTP status code instead of just printing it to the console. The window now shows “Status: 200” (or whatever the server returns)

0
0
4
Open comments for this post

2h 14m 11s logged

I added response decoding and support for http0.9 1.0 and 1.1. These guides: browser.engineering, firefox guides and servo were amazing resources for learning how HTTP works and with encoding/decoding requests and responses. I mostly just followed along with how firefox worked and built my way away from it but the code formatting went a bit off in the middle (it was 4:30am I have an exam in 4 hours I was tired)
Next I want to print everything in the UI instead of terminal

0
0
5
Open comments for this post

31m 21s logged

Added the initial browser engine foundataion. I added basic support for http protocol and implemented http request encoding.

0
0
2
Open comments for this post

2h 16m 26s logged

I created the basic app here but it just shows a colour right now. I was following a tutorial on basic rust because I’m still learning it.

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…