mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Revert fix for bug 1838855 (bug 1849876)
The issue described in the mentioned bug is reall because Acrobat is rendering the XFA instead of the Acroform. The original patch just tried to workaround the issue but it induces some regressions.
This commit is contained in:
parent
a7d829155b
commit
ee3ac35e05
5 changed files with 8 additions and 79 deletions
|
@ -1661,17 +1661,6 @@ class WidgetAnnotation extends Annotation {
|
|||
if (data.fieldName === undefined) {
|
||||
data.fieldName = this._constructFieldName(dict);
|
||||
}
|
||||
if (
|
||||
data.fieldName &&
|
||||
/\[\d+\]$/.test(data.fieldName) &&
|
||||
!dict.has("Kids") &&
|
||||
dict.has("T")
|
||||
) {
|
||||
data.baseFieldName = data.fieldName.substring(
|
||||
0,
|
||||
data.fieldName.lastIndexOf("[")
|
||||
);
|
||||
}
|
||||
|
||||
if (data.actions === undefined) {
|
||||
data.actions = collectActions(xref, dict, AnnotationActionEventType);
|
||||
|
|
|
@ -1710,11 +1710,6 @@ class PDFDocument {
|
|||
name = name === "" ? partName : `${name}.${partName}`;
|
||||
}
|
||||
|
||||
if (!field.has("Kids") && field.has("T") && /\[\d+\]$/.test(name)) {
|
||||
// We've a terminal node: strip the index.
|
||||
name = name.substring(0, name.lastIndexOf("["));
|
||||
}
|
||||
|
||||
if (!promises.has(name)) {
|
||||
promises.set(name, []);
|
||||
}
|
||||
|
|
|
@ -1197,7 +1197,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||
element.setAttribute("data-element-id", id);
|
||||
|
||||
element.disabled = this.data.readOnly;
|
||||
element.name = this.data.baseFieldName || this.data.fieldName;
|
||||
element.name = this.data.fieldName;
|
||||
element.tabIndex = DEFAULT_TAB_INDEX;
|
||||
|
||||
this._setRequired(element, this.data.required);
|
||||
|
@ -1499,7 +1499,7 @@ class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||
element.disabled = data.readOnly;
|
||||
this._setRequired(element, this.data.required);
|
||||
element.type = "checkbox";
|
||||
element.name = data.baseFieldName || data.fieldName;
|
||||
element.name = data.fieldName;
|
||||
if (value) {
|
||||
element.setAttribute("checked", true);
|
||||
}
|
||||
|
@ -1584,7 +1584,7 @@ class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||
element.disabled = data.readOnly;
|
||||
this._setRequired(element, this.data.required);
|
||||
element.type = "radio";
|
||||
element.name = data.baseFieldName || data.fieldName;
|
||||
element.name = data.fieldName;
|
||||
if (value) {
|
||||
element.setAttribute("checked", true);
|
||||
}
|
||||
|
@ -1697,7 +1697,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
|
|||
|
||||
selectElement.disabled = this.data.readOnly;
|
||||
this._setRequired(selectElement, this.data.required);
|
||||
selectElement.name = this.data.baseFieldName || this.data.fieldName;
|
||||
selectElement.name = this.data.fieldName;
|
||||
selectElement.tabIndex = DEFAULT_TAB_INDEX;
|
||||
|
||||
let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue