Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify annotation data passing #6232

Merged

Conversation

timvandermeij
Copy link
Contributor

We can avoid the getData method call by just accessing the data property on the annotation object. We can avoid get annotationRefs by directly using its result (like all other methods in that file). Finally, getAnnotations in api.js can be simplified by interchanging the cases, i.e., always returing the promise and only creating it when it does not exist yet.

I have verified with 15 test files with different annotation types (Link, Text, Widget, Markup, et cetera) that rendering has not changed.

@Snuffleupagus Could you review this PR?

@timvandermeij timvandermeij changed the title Simply annotation data passing Simplify annotation data passing Jul 18, 2015
@timvandermeij timvandermeij force-pushed the annotations-data-passing branch from eebb555 to 981202f Compare July 18, 2015 15:57
}
return annotationsData;
},

get annotations() {
var annotations = [];
var annotationRefs = (this.annotationRefs || []);
var annotationRefs = (this.getInheritedPageProp('Annots') || []);
Copy link
Member

Choose a reason for hiding this comment

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

While you're at it, remove the parentheses. They are not required, and do not enhance the readability of this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the new commit.

@timvandermeij timvandermeij force-pushed the annotations-data-passing branch from 981202f to 995c5ba Compare July 19, 2015 12:03
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/d3613037ba95209/output.txt

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/88b6a79c47252a7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/3f8eb82a935f957/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/3f8eb82a935f957/output.txt

Total script time: 18.28 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/88b6a79c47252a7/output.txt

Total script time: 18.76 mins

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

Snuffleupagus added a commit that referenced this pull request Jul 19, 2015
@Snuffleupagus Snuffleupagus merged commit d3e90cf into mozilla:master Jul 19, 2015
@Snuffleupagus
Copy link
Collaborator

Looks good, thanks!

@timvandermeij timvandermeij deleted the annotations-data-passing branch July 19, 2015 16:44
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.

4 participants