From feafb394d6e46d353eccf3bcc06e1913c43c9a2b Mon Sep 17 00:00:00 2001
From: Brendan Dahl <brendan.dahl@gmail.com>
Date: Thu, 22 Aug 2013 12:29:06 -0700
Subject: [PATCH] Use text widget annotation appearance stream if it is
 available.

---
 src/shared/annotation.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/shared/annotation.js b/src/shared/annotation.js
index a6487d77e..e53164f09 100644
--- a/src/shared/annotation.js
+++ b/src/shared/annotation.js
@@ -100,6 +100,7 @@ var Annotation = (function AnnotationClosure() {
     }
 
     this.appearance = getDefaultAppearance(dict);
+    data.hasAppearance = !!this.appearance;
   }
 
   Annotation.prototype = {
@@ -406,7 +407,7 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
   var parent = WidgetAnnotation.prototype;
   Util.inherit(TextWidgetAnnotation, WidgetAnnotation, {
     hasHtml: function TextWidgetAnnotation_hasHtml() {
-      return !!this.data.fieldValue;
+      return !this.data.hasAppearance && !!this.data.fieldValue;
     },
 
     getHtmlElement: function TextWidgetAnnotation_getHtmlElement(commonObjs) {
@@ -434,6 +435,9 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
     },
 
     getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator) {
+      if (this.appearance) {
+        return Annotation.prototype.getOperatorList.call(this, evaluator);
+      }
 
       var promise = new Promise();
       var opList = new OperatorList();