From 5f16cbd2c05c1b84007293db9b06e571f0b1befb Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 21 Sep 2016 12:29:39 +0200 Subject: [PATCH] When rendering forms, don't use `element.value` since it prevents the AnnotationLayer rasterizer (in `test/driver.js`) from parsing the elements correctly Without this, the reference test images will have empty fields despite the viewer working as intended. --- src/display/annotation_layer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 5324476a8..3fc536d18 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -448,14 +448,18 @@ var TextWidgetAnnotationElement = ( var element = null; if (this.renderInteractiveForms) { + // NOTE: We cannot set the values using `element.value` below, since it + // prevents the AnnotationLayer rasterizer in `test/driver.js` + // from parsing the elements correctly for the reference tests. if (this.data.multiLine) { element = document.createElement('textarea'); + element.textContent = this.data.fieldValue; } else { element = document.createElement('input'); element.type = 'text'; + element.setAttribute('value', this.data.fieldValue); } - element.value = this.data.fieldValue; element.disabled = this.data.readOnly; if (this.data.maxLen !== null) {