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

[api-minor] Implement API to get MarkInfo from the catalog. #12525

Merged
merged 2 commits into from
Oct 30, 2020

Conversation

brendandahl
Copy link
Contributor

Trying to get more data so we can decide whether to implement tagged pdfs.

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

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

Looks good with these comments addressed. I think the requestIdleCallback usage is quite a nice solution here!

src/core/obj.js Outdated Show resolved Hide resolved
src/display/api.js Outdated Show resolved Hide resolved
src/display/api.js Outdated Show resolved Hide resolved
web/app.js Outdated Show resolved Hide resolved
@brendandahl brendandahl force-pushed the mark-info branch 2 times, most recently from 8ea121d to 008d693 Compare October 29, 2020 21:13
Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

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

Looks good and can be merged with the final comment addressed!

/**
* @typedef {Object} MarkInfo
* Properties correspond to Table 321 of the PDF 32000-1:2008 spec. Values
* are null if not defined by the PDF.
Copy link
Contributor

Choose a reason for hiding this comment

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

null -> false

@timvandermeij
Copy link
Contributor

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/21120e56b479603/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/21120e56b479603/output.txt

Total script time: 3.55 mins

  • Unit Tests: FAILED

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 29, 2020

TEST-UNEXPECTED-FAIL | gets markInfo | in firefox | Expected undefined to equal false. Expected undefined to equal false.
TEST-UNEXPECTED-FAIL | gets markInfo | in chrome | Expected undefined to equal false. Expected undefined to equal false.

Ah, it seems that Object.create creates an empty object instead of the prefilled one (tried in the web console). I think you can simply remove Object.create here:

const markInfo = {
  Marked: false,
  UserProperties: false,
  Suspects: false,
};

Not sure why Travis does like it. Maybe it does work in Node.js?

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 30, 2020

Ah, it seems that Object.create creates an empty object instead of the prefilled one (tried in the web console).

The argument is used as the prototype, which doesn't survive the structured cloning algorithm.
If you actually want a null prototype, which I assume is indeed the case here, then the following is probably the way to go:

const markInfo = Object.assign(Object.create(null), {
  Marked: false,
  UserProperties: false,
  Suspects: false,
});

Not sure why Travis does like it. Maybe it does work in Node.js?

Probably because those tests run with workers disabled.

web/app.js Outdated Show resolved Hide resolved
web/app.js Show resolved Hide resolved
web/app.js Outdated Show resolved Hide resolved
web/app.js Outdated Show resolved Hide resolved
web/app.js Outdated Show resolved Hide resolved
@timvandermeij
Copy link
Contributor

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/e8b9171fdff5716/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/abf377e340e41f8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/e8b9171fdff5716/output.txt

Total script time: 3.50 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/abf377e340e41f8/output.txt

Total script time: 4.61 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/620a8eba477c68d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/620a8eba477c68d/output.txt

Total script time: 3.99 mins

Published

@timvandermeij timvandermeij merged commit e341e6e into mozilla:master Oct 30, 2020
@timvandermeij
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants