mozilla/pdf.js — pull request #5585 by timvandermeij (2014-12-25 20:42:28+00:00)
Title: Annotation border styles

This PR implements annotation border styles according to the official PDF specification at https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf, section 8.4. Below is an overview of the changes in this PR:

- Implement constants for all possible border style types
- Implement annotation border style class to encapsulate all border style data for a given annotation
- Implement `getBorderStyle` and `setBorderStyle` on annotations to fill their `AnnotationBorderStyle` object
- Transform old implementation to new implementation of border styles: removes old and incomplete code and makes sure all border styles are handled in `annotation_helper.js`
- Implement unit tests for the annotation border style class
- Add self-created test case for the annotation border styles
- Enable creation of documentation for the annotation border style class (and future documentation for the annotation layer)

Most of the code is rewriting the old code, but there are some minor additions in order to fully adhere to the specification. These are:

- Support for horizontal and vertical corner radii (just a few lines of code)
- Support for dashed and underline border styles (two lines of code in `annotation_helper.js`)

Other unimplemented border styles have been indicated using `warn()` so it's clear that these are missing.

Finally, I have added documentation and unit/regression tests to increase testability of the annotation layer and to avoid regressions.