News for hackers. Stuff that matters.
Re:Imagining CSS for URLs and HTTP Headers by xg15 on Monday November 28, 2022 @11:30AM (#33775663)
> How do we get the DOM? The browser knows how to create it from an HTTP request consisting of a URL, some headers, and some HTML.

I would already call this bit into question. At least originally, the "document" was only the HTML part. The task of HTTP was to shuffle the document around, not itself be part of the document.

In practice today, most documents have a HTTP request attached to it, but you can still see the issues if you try to load HTML from a file or from cache. What is the corresponding HTTP request for that?

I sort of can see the appeal of styling by URL, but that too seems in danger if opening a huge can of worms. Suddenly, you can't test styles locally anymore, because the domain name now influences the selectors. Also, if you move domains and forget to update your styles, suddenly your site will be broken.

> Setting aside the open-ended possibilities people might dream up with non-standard X- headers

What possibilities would that enable that couldn't also be done using data-* attributes?

> imagine being able declare some styles based on the presence of a cookie

Ok, that might be a useful idea after all.

There are no comments on this comment yet.