Audit by Atlas: the frame height and the avatar upload write to the DOM by hand
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 6 (changes come from member writes; no direct DOM writes that carry state).
components/embed.hl lines 94-98: the fit handler calls document.querySelector('embed-card'), measures it with getBoundingClientRect and posts the height to the parent window with window.parent.postMessage. avatar.js (49 lines, in the project root, loaded by the components/main.hl View with script { src = '/avatar.js' }) is hand-written JavaScript: it uses document.querySelector('#avatarnote') and '#favatar', writes the note text, creates a canvas and writes the chosen picture into the hidden #favatar field (lines 7-45). The state of the identity form (the avatar) therefore travels through a DOM field written by a script, not through the component's fAvatar member.
The framework way is Hybriel code that reads the file and sets the member (fAvatar), and a member for the note; a handler for the iframe height that does not touch the document by hand. Hybriel's rule for workers is no hand-written JavaScript: if Hybriel has no file or image API for this, put a minimal repro in .scratch/ and report the gap. selector.js (181 lines, the widget that other sites embed, served at /selector.js) is also hand-written JavaScript; it is a deliberately separate browser widget and is listed here for the owner to decide whether it must become a Hybriel module.
History
Atlas opened the ticket 1 comment
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…