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

XFA - Add <a> element in button when an url is detected (bug 1716758) #14076

Merged
merged 1 commit into from
Sep 26, 2021

Conversation

calixteman
Copy link
Contributor

  • it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1716758;
  • some buttons have a JS action with the pattern app.launchURL(...) (or similar) so extract when it's possible the url and generate a element with the href equals to the found url;
  • pdf.js already had some code to handle that so this patch slightly refactor that.

src/shared/util.js Outdated Show resolved Hide resolved
src/shared/util.js Outdated Show resolved Hide resolved
src/core/catalog.js Outdated Show resolved Hide resolved
@Snuffleupagus
Copy link
Collaborator

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/5db7c2d197cc0c8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/534562f106dc040/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/5db7c2d197cc0c8/output.txt

Total script time: 20.31 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  errors: 600
  different ref/snapshot: 6

Image differences available at: http://54.241.84.105:8877/5db7c2d197cc0c8/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/534562f106dc040/output.txt

Total script time: 40.33 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 4
  different first/second rendering: 1

Image differences available at: http://54.193.163.58:8877/534562f106dc040/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

/botio-linux browsertest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/b338d7b8277d8e9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/b338d7b8277d8e9/output.txt

Total script time: 17.47 mins

  • Regression tests: FAILED
  errors: 621
  different ref/snapshot: 4
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/b338d7b8277d8e9/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

/botio-linux browsertest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.241.84.105:8877/54e8329e94e02f8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/54e8329e94e02f8/output.txt

Total script time: 19.25 mins

  • Regression tests: FAILED
  different ref/snapshot: 9
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/54e8329e94e02f8/reftest-analyzer.html#web=eq.log

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

r=me, looks good to me with the comment addressed; thank you!


const pages = factory.getPages();
const a = searchHtmlNode(pages, "name", "a");
expect(a.attributes.href).toEqual("https://github.com/mozilla/pdf.js");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add a check to ensure that the target is also correct, since you're using the "app.launchURL(...)" format to specify the URL?

  - it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1716758;
  - some buttons have a JS action with the pattern `app.launchURL(...)` (or similar) so extract when it's possible the url and generate a <a> element with the href equals to the found url;
  - pdf.js already had some code to handle that so this patch slightly refactor that.
@calixteman
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 2

Live output at: http://54.241.84.105:8877/1be51b0f61f58ea/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 2

Live output at: http://54.193.163.58:8877/c2fae6b90cfe56a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/1be51b0f61f58ea/output.txt

Total script time: 2.81 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/c2fae6b90cfe56a/output.txt

Total script time: 5.62 mins

  • Unit Tests: Passed

@Snuffleupagus Snuffleupagus merged commit 3b3c487 into mozilla:master Sep 26, 2021
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