Release Vulpes OS Preview 26 with Gecko 161.0 and Tundra 0.2.0

This commit is contained in:
OverSu 2026-12-01 22:22:00 +01:00
commit e241a42d2f
3 changed files with 1305 additions and 331 deletions

View file

@ -46,7 +46,20 @@ export class VulpesChild extends JSWindowActorChild {
const params = Cu.cloneInto(data, {});
params.contextId = native.browsingContext.id;
if (params.operation === 'geometry') {
const rect = native.getBoundingClientRect();
const bounds = native.getBoundingClientRect();
const left = Math.max(0, bounds.left);
let top = Math.max(0, bounds.top);
if (this.document.location.hostname === 'system.localhost') {
const bar = this.document.getElementById('statusbar');
if (bar?.checkVisibility({checkOpacity:true, checkVisibilityCSS:true})) {
const header = bar.getBoundingClientRect();
if (header.top <= top && header.width > 0) top = Math.max(top, header.bottom);
}
}
// Gaia's collapsing toolbar can scroll the iframe above the viewport.
// Hit-test and position the native view within the same visible rectangle.
const rect = {left, top, width: Math.min(win.innerWidth, bounds.right) - left,
height: Math.min(win.innerHeight, bounds.bottom) - top};
const unobscured = frameUnobscured(this.document, native, rect);
params.geometry = {
left: rect.left + win.mozInnerScreenX,

View file

@ -31,7 +31,7 @@ export class WebInputChild extends JSWindowActorChild {
const editable = element?.isContentEditable || element?.localName === 'textarea' ||
(element?.localName === 'input' && ['text','search','email','url','tel','password','number'].includes(element.type));
if (!editable || element.disabled || element.readOnly) {
if (event.type === 'click') this.sendAsyncMessage('Vulpes:InputFocus', null);
if (event.type === 'click' && event.isTrusted) this.sendAsyncMessage('Vulpes:WebDismissInput', null);
return;
}
this.editor ||= new InputEditor(this.contentWindow);
@ -39,6 +39,25 @@ export class WebInputChild extends JSWindowActorChild {
this.sendAsyncMessage('Vulpes:InputFocus', this.editor.state());
}
receiveMessage(message) {
if (message.name === 'Vulpes:PageIcon') {
const doc = this.document;
const origin = doc.location.origin;
const candidates = [...doc.querySelectorAll('link[rel~="icon" i][href]')]
.map(link => ({href:link.href, sizes:link.getAttribute('sizes') || ''}));
candidates.push({href:origin + '/favicon.ico', sizes:''});
return (async () => {
for (const candidate of candidates.slice(0, 12)) {
let url;
try { url = new URL(candidate.href); } catch { continue; }
if (url.origin !== origin || !['https:', 'http:'].includes(url.protocol)) continue;
const image = doc.createElement('img');
image.src = url.href;
try { await image.decode(); } catch { continue; }
if (image.naturalWidth) return {href:url.href, sizes:candidate.sizes};
}
return null;
})();
}
if (message.name !== 'Vulpes:Edit' || !this.editor) throw Error('INPUT_CONTEXT_EXPIRED');
return this.editor.edit(message.data);
}

View file

@ -14,6 +14,16 @@ export class WebInputParent extends JSWindowActorParent {
}
return;
}
if (message.name === 'Vulpes:WebDismissInput') {
if (!Runtime.identity(this) && Runtime.inputIdentity(this) && Runtime.input.focus) {
const owner = Runtime.input.focus.actor;
if (owner.browsingContext.top === this.browsingContext.top ||
(Runtime.identity(owner)?.id === 'system' &&
owner.browsingContext.top.embedderElement.ownerDocument ===
this.browsingContext.top.embedderElement.ownerDocument)) Runtime.input.hide();
}
return;
}
if (message.name !== 'Vulpes:InputFocus') throw Error('METHOD_NOT_SUPPORTED');
if (Runtime.identity(this)) return; // Bundled apps already use VulpesChild.
Runtime.input.changed(this, message.data);