1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #13570 from calixteman/xfa_field

XFA - By default a text ui has only one line when in a field element
This commit is contained in:
calixteman 2021-06-17 09:09:59 +02:00 committed by GitHub
commit 335d4cb2fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 7 deletions

View file

@ -18,6 +18,7 @@ import {
$addHTML,
$appendChild,
$childrenToHTML,
$clean,
$content,
$extra,
$finalize,
@ -4820,11 +4821,7 @@ class TextEdit extends XFAObject {
"on",
]);
this.id = attributes.id || "";
this.multiLine = getInteger({
data: attributes.multiLine,
defaultValue: 1,
validate: x => x === 0,
});
this.multiLine = attributes.multiLine || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, [
@ -4838,6 +4835,17 @@ class TextEdit extends XFAObject {
this.margin = null;
}
[$clean](builder) {
super[$clean](builder);
const parent = this[$getParent]();
const defaultValue = parent instanceof Draw ? 1 : 0;
this.multiLine = getInteger({
data: this.multiLine,
defaultValue,
validate: x => x === 0 || x === 1,
});
}
[$toHTML](availableSpace) {
// TODO: incomplete.
const style = toStyle(this, "border", "font", "margin");