mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
XFA - Support assist element
This commit is contained in:
parent
70434c132f
commit
9bbc194846
2 changed files with 28 additions and 0 deletions
|
@ -501,6 +501,12 @@ class Assist extends XFAObject {
|
|||
this.speak = null;
|
||||
this.toolTip = null;
|
||||
}
|
||||
|
||||
[$toHTML]() {
|
||||
return this.toolTip && this.toolTip[$content]
|
||||
? this.toolTip[$content]
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
class Barcode extends XFAObject {
|
||||
|
@ -1734,6 +1740,11 @@ class Draw extends XFAObject {
|
|||
children: [],
|
||||
};
|
||||
|
||||
const assist = this.assist ? this.assist[$toHTML]() : null;
|
||||
if (assist) {
|
||||
html.attributes.title = assist;
|
||||
}
|
||||
|
||||
const bbox = computeBbox(this, html, availableSpace);
|
||||
|
||||
const value = this.value ? this.value[$toHTML](availableSpace).html : null;
|
||||
|
@ -2345,6 +2356,11 @@ class ExclGroup extends XFAObject {
|
|||
children,
|
||||
};
|
||||
|
||||
const assist = this.assist ? this.assist[$toHTML]() : null;
|
||||
if (assist) {
|
||||
html.attributes.title = assist;
|
||||
}
|
||||
|
||||
delete this[$extra];
|
||||
|
||||
return HTMLResult.success(createWrapper(this, html), bbox);
|
||||
|
@ -2621,6 +2637,11 @@ class Field extends XFAObject {
|
|||
children,
|
||||
};
|
||||
|
||||
const assist = this.assist ? this.assist[$toHTML]() : null;
|
||||
if (assist) {
|
||||
html.attributes.title = assist;
|
||||
}
|
||||
|
||||
const borderStyle = this.border ? this.border[$toStyle]() : null;
|
||||
|
||||
const bbox = computeBbox(this, html, availableSpace);
|
||||
|
@ -4781,6 +4802,11 @@ class Subform extends XFAObject {
|
|||
children,
|
||||
};
|
||||
|
||||
const assist = this.assist ? this.assist[$toHTML]() : null;
|
||||
if (assist) {
|
||||
html.attributes.title = assist;
|
||||
}
|
||||
|
||||
const result = HTMLResult.success(createWrapper(this, html), bbox);
|
||||
|
||||
if (this.breakAfter.children.length >= 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue