From f5ced146cb6390013b758248366531259b023b72 Mon Sep 17 00:00:00 2001 From: Ifeanyi Chima Date: Tue, 24 Mar 2026 11:04:43 +0100 Subject: [PATCH] Bug 1716806 - Add separator space between radio buttons/checkboxes and their labels --- src/core/xfa/template.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 4c643d51722a5..e8110c15ddb11 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -1225,9 +1225,13 @@ class Caption extends XFAObject { const children = []; if (typeof value === "string") { + const parent = this[$getParent](); + const needsSpace = parent?.ui?.checkButton; children.push({ name: "#text", - value, + value: needsSpace && !value.startsWith("\u00A0") + ? "\u00A0" + value + : value, }); } else { children.push(value); @@ -3890,26 +3894,26 @@ class Occur extends XFAObject { this.initial = attributes.initial !== "" ? getInteger({ - data: attributes.initial, - defaultValue: "", - validate: x => true, - }) + data: attributes.initial, + defaultValue: "", + validate: x => true, + }) : ""; this.max = attributes.max !== "" ? getInteger({ - data: attributes.max, - defaultValue: -1, - validate: x => true, - }) + data: attributes.max, + defaultValue: -1, + validate: x => true, + }) : ""; this.min = attributes.min !== "" ? getInteger({ - data: attributes.min, - defaultValue: 1, - validate: x => true, - }) + data: attributes.min, + defaultValue: 1, + validate: x => true, + }) : ""; this.use = attributes.use || ""; this.usehref = attributes.usehref || ""; @@ -4378,9 +4382,8 @@ class Pattern extends XFAObject { const endColor = this.color ? this.color[$toStyle]() : "#000000"; const width = 5; const cmd = "repeating-linear-gradient"; - const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${ - 2 * width - }px`; + const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width + }px`; switch (this.type) { case "crossHatch": return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;