Merge pull request #13619 from calixteman/bg

XFA - Add back empty subforms (which can have a background)
This commit is contained in:
Brendan Dahl 2021-06-23 16:21:28 -07:00 committed by GitHub
commit d7fdb72a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2154,10 +2154,6 @@ class ExclGroup extends XFAObject {
return HTMLResult.FAILURE; return HTMLResult.FAILURE;
} }
if (children.length === 0) {
return HTMLResult.EMPTY;
}
let marginH = 0; let marginH = 0;
let marginV = 0; let marginV = 0;
if (this.margin) { if (this.margin) {
@ -4337,10 +4333,6 @@ class Subform extends XFAObject {
return HTMLResult.FAILURE; return HTMLResult.FAILURE;
} }
if (children.length === 0) {
return HTMLResult.EMPTY;
}
let marginH = 0; let marginH = 0;
let marginV = 0; let marginV = 0;
if (this.margin) { if (this.margin) {
@ -4649,7 +4641,8 @@ class Template extends XFAObject {
const flush = index => { const flush = index => {
const html = root[$flushHTML](); const html = root[$flushHTML]();
if (html) { if (html) {
hasSomething = true; hasSomething =
hasSomething || (html.children && html.children.length !== 0);
htmlContentAreas[index].children.push(html); htmlContentAreas[index].children.push(html);
} }
}; };
@ -4671,7 +4664,9 @@ class Template extends XFAObject {
const html = root[$toHTML](space); const html = root[$toHTML](space);
if (html.success) { if (html.success) {
if (html.html) { if (html.html) {
hasSomething = true; hasSomething =
hasSomething ||
(html.html.children && html.html.children.length !== 0);
htmlContentAreas[i].children.push(html.html); htmlContentAreas[i].children.push(html.html);
} else if (!hasSomething) { } else if (!hasSomething) {
mainHtml.children.pop(); mainHtml.children.pop();