7. Content profile
The Names Browser has no web engine. It draws a fixed subset of HTML and CSS, called LNS Static Profile v1, with Qt Quick. Anything outside the subset is ignored: never run, never fetched.
Describes the profile as implemented in Names Browser core 0.3.6 (static_render.rs, sanitize.rs, cache.rs, lib.rs at 4a3c32a) and written up in STATIC-PROFILE.md. Where the two differ, this page follows the code and says so. The gateway's behaviour is from the round-3 sanitize.mjs.
7.1 Rules
A page is an HTML file: either a file from Logos Storage, verified as in section 6, or the name's on-chain page (section 6.8). The core parses it into a bounded tree, applies the page's CSS, and returns a render tree. The interface draws that tree with native Qt items: boxes, text, images, a canvas for SVG, rows, columns, grids and a scroll view.
- No page script runs. There is no JavaScript engine for pages.
- A page cannot make a network request. Every file it uses comes through the verified tree.
- Unsupported HTML, CSS and SVG are dropped, and the rest of the page still draws.
The profile describes what the Names Browser draws. A client that draws more is still a client, but a page that uses more will look different in the Names Browser.
7.1.1 Rules every client keeps
A client MUST NOT run page scripts. <script>, inline on* handlers, javascript: URLs and CSS expression() are removed.
A client MUST NOT load a subresource from outside the site. http://, https:// and // URLs in <link>, <img>, @font-face and CSS url() are refused.
STRIP_CONTENT_TAGS and the URL checks in static_render.rs. Gateway: sanitizeHtml, sanitizeCss, sanitizeSvg and the CSP in sanitize.mjs.
The Names Browser also caps every input (section 7.9). A page over a cap is cut short or the item is dropped. Basecamp does not stall or crash.
7.2 Elements
| Group | Elements |
|---|---|
| Document | html head title meta link style body |
| Structure | header nav main section article aside footer div span |
| Text | h1–h6 p a strong b em i small code pre blockquote br hr |
| Lists | ul ol li dl dt dd |
| Tables | table thead tbody tr th td |
| Media | img figure figcaption svg |
| Disclosure | details (with open) summary |
7.2.1 Attributes
- On every element:
id,class,style,aria-label. a:hrefanddownload.img:src,alt,width,height.link:rel="stylesheet"andhref. Otherrelvalues are ignored.meta:charsetonly. Othermetatags, includinghttp-equiv="refresh", are ignored.title: shown in the tab, capped at 200 characters.
7.2.2 Removed and ignored elements
Removed with their content: script iframe object embed textarea xmp noembed noframes noscript plaintext math template canvas audio video source track input select button.
Ignored, content kept: any other tag, such as form, label, u or a custom element. The tag has no effect, and the text inside it is drawn as ordinary text.
STATIC-PROFILE.md lists button as ignored. The code removes it with its content (STRIP_CONTENT_TAGS in static_render.rs).
7.2.3 Hidden content
The Names Browser drops content that CSS hides or moves out of sight: display: none, visibility: hidden or collapse, clip: rect(…), clip-path: inset(50%), a 1 × 1 box with overflow: hidden, and an absolute or fixed box moved off the top or left. It reads position, top, left, overflow, visibility, clip and clip-path only for this test. It does not position boxes, so a positioned box that stays visible is drawn in normal flow.
7.3 Links
| Link target | Names Browser |
|---|---|
lns://… | Opens in the browser. |
| Site-relative path | Resolved against the current page, opens in the browser. |
https://… without credentials | Shows a bar with Open in Browser and Copy Link. Never fetched by the Names Browser. |
cid://… | Parsed and kept as a link in markup, but opening it directly is refused in Names Browser 0.4.6 because nothing pins its SHA-256 and the CID multihash is not verified (sections 4.7 and 6.2.2). |
Same-page anchor only, such as #top | Removed. The text is kept, without a link. |
http: javascript: data: file: mailto: basecamp:, credentialed URLs | Removed. |
A link with a download attribute adds a Save button (section 6.6). Link targets are capped at 1,024 bytes, and an address at 2,048 bytes.
7.4 Selectors
CSS comes from <style> blocks, from up to 16 <link rel="stylesheet"> files on the site, and from style="" attributes.
| Selector | Example | Specificity |
|---|---|---|
| Universal | * | 0,0,0 |
| Type | h1 | 0,0,1 |
| Class | .card | 0,1,0 |
| ID | #hero | 1,0,0 |
:root (matches html) | :root | 0,1,0 |
:hover on links and boxes | a:hover | 0,1,0 |
| Compound | div.card#top | sum of parts |
| Descendant and child | nav a, ul > li | sum of parts |
| Selector list | h1, h2 | each on its own |
Other pseudo-classes and pseudo-elements, such as ::before and :nth-child(), never match. Attribute selectors and sibling combinators are not in the profile.
7.4.1 Cascade
- Order: browser defaults, then linked and inline stylesheets in document order, then
style="", then!important. Ties go to specificity, then source order. - Inherited:
color,font-family,font-size,font-weight,font-style,line-height,letter-spacing,text-align,text-transformand custom properties. - Custom properties:
--name: valueon any ancestor, read withvar(--name)orvar(--name, fallback). Nesting resolves to depth 8, with cycle protection.
7.5 Properties
| Group | Properties | Values |
|---|---|---|
| Colour and background | color, background-color, background | Hex (3, 4, 6, 8 digits), rgb(), rgba(), hsl(), hsla(), named colours, transparent, currentColor. background also takes linear-gradient() with an angle or to <side>. |
| Text | font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-align, text-decoration, text-transform | Site fonts and the generics sans-serif, serif, monospace, system-ui, ui-sans-serif, ui-serif, ui-monospace. Sizes in px, rem, em, %. Weights normal, bold, 100–900. underline, line-through, none. |
| Box | margin, padding and their sides, border, border-width, -color, -style, each side, border-radius | One to four values in px, rem, em. margin: 0 auto centres. Solid borders only. One radius for all corners. |
| Size | width, min-width, max-width, height, min-height, max-height | px, rem, em, %, vw, auto |
| Layout | display, flex-direction, flex-wrap, gap, row-gap, column-gap, justify-content, align-items, flex | display: block, inline, inline-block, flex, grid, none. flex: a number. |
| Grid | grid-template-columns | px, fr, auto, repeat(n, …), repeat(auto-fit or auto-fill, minmax(<px>, 1fr)) |
| Effects | opacity, box-shadow | 0 to 1. One shadow: x, y, blur, spread, colour, or none. |
| Images | object-fit | contain, cover, fill, none, scale-down |
| Lists | list-style, list-style-type | none, disc, circle, square, decimal |
Any other property or value is ignored. list-style is handled by the code but is not in STATIC-PROFILE.md.
There are no CSS background images. A declaration whose value contains url( is dropped everywhere except in @font-face, even for a path on the same site. So is any value that contains http:// or https://.
A client MUST ignore CSS url() values that point outside the site, expression() and javascript:.
parse_css_declarations_capped in static_render.rs drops a declaration containing expression(, javascript:, http://, https://, @import, or (outside @font-face) url(. Gateway: sanitizeCss in sanitize.mjs rewrites url() to site paths or drops it.
7.6 Media queries
Rules inside @media apply only while the condition holds.
- Features:
min-widthandmax-width(inpx,remorem), andprefers-color-scheme: darkorlight. Combine withandor commas.screenandallare accepted. Rules are re-evaluated when the window is resized or Basecamp's theme changes. - Other at-rules, including
@import, are ignored.
7.7 Fonts
A site can bring its own fonts. Without them, text uses the generic families in section 7.5.
@font-face takes font-family, src, font-weight and font-style. src must be a site-relative path or an inline base64 data: font URL of at most 512 KiB. Up to 16 fonts per page, 4 MiB per font file.
Although the CSS parser accepts data:font/ttf, otf, woff and woff2 prefixes (as well as application/x-font-ttf and application/font-woff), the core's font isolator (sanitize_and_isolate_font in cache.rs) only loads raw TrueType (.ttf) and OpenType (.otf) SFNT files. WOFF and WOFF2 are refused, as are fonts declaring reserved system or interface family names. Each loaded font's name table is rewritten to a private family name (section 6.4). The gateway serves .ttf, .otf, .woff and .woff2 to ordinary browsers.
7.8 Images and SVG
7.8.1 Images
An img source may be:
- A site-relative path that resolves to a pinned entry. The file is verified, then its magic bytes must be PNG, JPEG, GIF or WebP, or it must be an SVG file of at most 64 KiB, drawn with the SVG subset below.
- An inline
data:image/png,jpeg,giforwebpbase64 URL of at most 256 KiB.
A cid:// source and any outside URL are not loaded. object-fit is supported (section 7.5).
| Image limit | Value |
|---|---|
| Raster file | 4 MiB |
| Width or height | 4,096 px |
| Pixels per image | 16,777,216 (16 × 1024 × 1024) |
| Pixels per page | 67,108,864 (64 × 1024 × 1024) |
Inline data: image | 256 KiB |
Page pixel budget. Images already in the interface's memory cache can be drawn before the core's own count is added, so a page can reach about twice the per-page budget. Each image is still capped. Finding N1, partly fixed in 0.4.6.
7.8.2 SVG
Inline <svg> and SVG image files are not drawn by an SVG engine. The core turns a small subset into drawing operations on a canvas.
- Elements:
svg,defs,g,path,use href="#id",rect(withrx/ry),circle,polygon. Other elements are skipped. - Attributes:
viewBox,width,height,fill,stroke,stroke-width,stroke-linecap,stroke-linejoin,opacity,transform="translate(x,y)",aria-label. - Rejected: the whole SVG is dropped if its text contains
<script,<foreignObject,<iframe,<embed,<object,<image,<animate,<set,<!ENTITY,<!DOCTYPE,javascript:,http://,https://,data:,file:,url(http,url(data, or an inlineon*=event handler, anywhere, case-insensitively. The standardxmlnsandxmlns:xlinkdeclarations are allowed.
| SVG limit | Value |
|---|---|
| One inline SVG or SVG file | 64 KiB |
| Drawing operations per SVG | 256 |
defs entries per SVG | 128 |
use expansions per SVG | 64 |
polygon tokens per element | 4,096 |
| Path data per SVG | 64 KiB |
| Drawing operations per page | 1,024 |
| Path data per page | 128 KiB |
| Canvas width or height | 2,048 px |
viewBox aspect ratio | at most 100 : 1 |
STATIC-PROFILE.md says "max 512 draw ops" per SVG. The code stops at 256 (MAX_SVG_OPS in sanitize.rs).
7.9 Caps
| Limit | Value | When passed |
|---|---|---|
| HTML per page | 512 KiB | Cut short |
| Parsed nodes per page | 6,000 | Cut short |
| Nesting depth | 64 | Cut short |
| CSS per page, all sources | 256 KiB | Rest ignored |
| CSS rules | 4,096 | Rest ignored |
| CSS declarations | 16,384 | Rest ignored |
| Selectors per rule | 64 | Rest ignored |
| Parts per selector | 16 | Selector never matches |
| Linked stylesheets | 16 | Rest ignored |
| Fonts | 16 per page, 4 MiB each (raw TTF/OTF only) | Not loaded |
var() depth | 8 | Not resolved |
CSS value nesting (calc, repeat, color-mix) | 8 | Dropped |
| Images | section 7.8.1 | Not drawn |
| SVG | section 7.8.2 | Not drawn or cut short |
| Download buttons | 16 per page | Not shown |
| Title | 200 characters | Cut short |
Appendix B lists every limit across the browser, the gateway and the publisher.
7.10 Authoring advice
7.10.1 How the gateway differs
The gateway serves pages to ordinary web browsers. It does not enforce the profile. It removes what is dangerous and lets the visitor's browser draw the rest, so a page can look richer at the gateway than in the Names Browser.
| Topic | Names Browser | Gateway |
|---|---|---|
| Who draws the page | Qt Quick, profile only | The visitor's web browser, full HTML and CSS |
Scripts and on* handlers | Removed | Removed, and blocked by script-src 'none' |
Unsupported CSS (e.g. ::before, position, transitions) | Ignored | Passed through |
@import | Ignored | Kept only for a path on the same site |
| SVG | Small subset drawn on a canvas | A wide allowlist of SVG elements; scripts, animation, foreignObject and outside loads removed |
meta | charset only | A short allowlist of names; no http-equiv |
| Forms | Tag ignored, input, select, button removed | Cannot submit: form-action 'none' and a sandbox without forms |
| Outside links | Confirm bar | Ordinary links, with noopener noreferrer |
| Interface added | Badge and address bar outside the page | A banner inside the page that the page cannot hide |
The gateway's page CSP is default-src 'none' with style-src 'self' 'unsafe-inline', img-src 'self' data:, font-src 'self' data:, media-src 'self', and 'none' for scripts, connections, objects, frames, form actions and base URIs. The HTTP header adds frame-ancestors 'none' and sandbox allow-downloads. Section 8 has the full list.
7.10.2 Pages that look the same in both
- Use only the elements in 7.2 and the properties in 7.5. Everything else works at the gateway and disappears in the Names Browser.
- Lay out with
display: flex,gapandgrid-template-columns. Do not rely onposition,floator::before. - Put colours in custom properties on
:rootand switch them in@media (prefers-color-scheme: dark). Both clients honour it. - Use
<link rel="stylesheet">or<style>, not@import. - Put pictures in
img, not in CSSbackground-imageorurl(). Use colours andlinear-gradient()for backgrounds. - Ship custom fonts as raw
.ttfor.otffiles. The gateway serves.woffand.woff2, but the Names Browser refuses them. - Link files by site-relative paths, not
cid://. The Names Browser loads only what resolves through the tree. - Keep SVG to paths, rectangles, circles and polygons. Keep the text free of
http://,https://anddata:, even in comments, or the Names Browser drops the whole image. - Do not hide content with CSS and expect it to be read. The Names Browser drops hidden boxes, including skip links.
- Use
detailsandsummaryfor anything you would toggle with a script. - Do not count on same-page
#idlinks. The Names Browser removes a link whose target is only a fragment. - Write a real page for every path. Neither client runs a script, so a client-side router shows nothing.
This specification's own pages follow this advice. Their stylesheet uses two declarations outside the profile, overflow-x and border-collapse, for ordinary browsers only.