Merge pull request #13639 from calixteman/old_break
XFA - Replace deprecated break element (bug 1718053)
This commit is contained in:
commit
03dff1c5f5
@ -4222,6 +4222,46 @@ class Subform extends XFAObject {
|
||||
}
|
||||
|
||||
[$toHTML](availableSpace) {
|
||||
if (this.break) {
|
||||
// break element is deprecated so plug it on one of its replacement
|
||||
// breakBefore or breakAfter.
|
||||
if (this.break.after !== "auto" || this.break.afterTarget !== "") {
|
||||
const node = new BreakAfter({
|
||||
targetType: this.break.after,
|
||||
target: this.break.afterTarget,
|
||||
startNew: this.break.startNew.toString(),
|
||||
});
|
||||
node[$globalData] = this[$globalData];
|
||||
this[$appendChild](node);
|
||||
this.breakAfter.push(node);
|
||||
}
|
||||
|
||||
if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
|
||||
const node = new BreakBefore({
|
||||
targetType: this.break.before,
|
||||
target: this.break.beforeTarget,
|
||||
startNew: this.break.startNew.toString(),
|
||||
});
|
||||
node[$globalData] = this[$globalData];
|
||||
this[$appendChild](node);
|
||||
this.breakBefore.push(node);
|
||||
}
|
||||
|
||||
if (this.break.overflowTarget !== "") {
|
||||
const node = new Overflow({
|
||||
target: this.break.overflowTarget,
|
||||
leader: this.break.overflowLeader,
|
||||
trailer: this.break.overflowTrailer,
|
||||
});
|
||||
node[$globalData] = this[$globalData];
|
||||
this[$appendChild](node);
|
||||
this.overflow.push(node);
|
||||
}
|
||||
|
||||
this[$removeChild](this.break);
|
||||
this.break = null;
|
||||
}
|
||||
|
||||
if (this.presence === "hidden" || this.presence === "inactive") {
|
||||
return HTMLResult.EMPTY;
|
||||
}
|
||||
|
1
test/pdfs/xfa_bug1718053.pdf.link
Normal file
1
test/pdfs/xfa_bug1718053.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://bug1718053.bmoattachments.org/attachment.cgi?id=9228759
|
@ -938,6 +938,14 @@
|
||||
"lastPage": 2,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "xfa_bug1718053",
|
||||
"file": "pdfs/xfa_bug1718053.pdf",
|
||||
"md5": "252d728d2c456dcb81699342a71c42ea",
|
||||
"link": true,
|
||||
"rounds": 1,
|
||||
"enableXfa": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "xfa_bug1717681",
|
||||
"file": "pdfs/xfa_bug1717681.pdf",
|
||||
"md5": "435b1eae7e017b1a932fe204d1ba8be5",
|
||||
|
Loading…
Reference in New Issue
Block a user