Skip to content

Implement constants for all annotation types - #6757

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
timvandermeij:annotation-types
Dec 15, 2015
Merged

timvandermeij merged 1 commit into
mozilla:masterfrom
timvandermeij:annotation-types

Conversation

@timvandermeij

Copy link
Copy Markdown
Collaborator

Now we have a full list of all possible annotation types and the numbering corresponds to the order in the specification. Not only is this more consistent and complete, it also prevents having to add these constants when a new annotation type is implemented.

Additionally fix an issue where a regular Widget annotation would not have data.annotationType set. It was only set for a TextWidgetAnnotation, but instead move it to the base Widget annotation class to add it for all Widget annotations (since TextWidgetAnnotation inherits from WidgetAnnotation it will have it too).

This is another part of #5218. I have tested this PR with a set of 20 PDF files with various kinds of annotations (Link, Text, Widget, et cetera) and found no changes in rendering, behavior or printing.

Comment thread src/shared/util.js Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it is new as of PDF 1.7. It was not in https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf, hence why I missed it. Thank you for noticing, I will add it!

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

r=me, with comment addressed.

Now we have a full list of all possible annotation types and the
numbering corresponds to the order in the specification. Not only is
this more consistent and complete, it also prevents having to add these
constants when a new annotation type is implemented.

Additionally fix an issue where a regular Widget annotation would not
have `data.annotationType` set. It was only set for a
TextWidgetAnnotation, but instead move it to the base Widget annotation
class to add it for all Widget annotations (since TextWidgetAnnotation
inherits from WidgetAnnotation it will have it too).
@timvandermeij

Copy link
Copy Markdown
Collaborator Author

/botio-linux preview

@pdfjsbot

Copy link
Copy Markdown

@timvandermeij

Copy link
Copy Markdown
Collaborator Author

/botio test

@pdfjsbot

Copy link
Copy Markdown

@pdfjsbot

Copy link
Copy Markdown

@pdfjsbot

Copy link
Copy Markdown

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/309dc9d82b07e3f/output.txt

Total script time: 19.23 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot

Copy link
Copy Markdown

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/f1452c983e82d50/output.txt

Total script time: 19.92 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij

Copy link
Copy Markdown
Collaborator Author

Merging with r=Snuffleupagus (see above, now that the comment is addressed) and r=me (since it's a trivial patch).

timvandermeij added a commit that referenced this pull request Dec 15, 2015
Implement constants for all annotation types
@timvandermeij
timvandermeij merged commit a6ba210 into mozilla:master Dec 15, 2015
@timvandermeij
timvandermeij deleted the annotation-types branch December 15, 2015 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants