-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Fix DOMFilterFactory.#createUrl
in MOZCENTRAL builds (18417 PR follow-up)
#18430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, with passing tests.
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/d237c8bc52a1012/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/feb921e4f5ea90c/output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrff... I missed that too.
Thank you.
This test should have failed: pdf.js/test/test_manifest.json Lines 8777 to 8782 in 2d25437
@Snuffleupagus do you know why it didn't ? |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/feb921e4f5ea90c/output.txt Total script time: 29.91 mins
Image differences available at: http://54.241.84.105:8877/feb921e4f5ea90c/reftest-analyzer.html#web=eq.log |
Yes, because of the pre-processor; see pdf.js/src/display/display_utils.js Lines 126 to 143 in 2d25437
The idea was to ensure that we actually test the GENERIC code in the PDF.js test-suite, since the Firefox code-path is covered by tests in mozilla-central. Perhaps we should just use the |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/d237c8bc52a1012/output.txt Total script time: 44.15 mins
Image differences available at: http://54.193.163.58:8877/d237c8bc52a1012/reftest-analyzer.html#web=eq.log |
@calixteman Would you prefer the following diff instead, where we'd always check if a diff --git a/src/display/display_utils.js b/src/display/display_utils.js
index 30964c9ab..9d4a41723 100644
--- a/src/display/display_utils.js
+++ b/src/display/display_utils.js
@@ -124,22 +124,19 @@ class DOMFilterFactory extends BaseFilterFactory {
}
#createUrl(id) {
- if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
- if (this.#baseUrl === undefined) {
- const url = this.#document.URL;
- if (url === this.#document.baseURI) {
- // No `<base>`-element present, hence a relative URL should work.
- this.#baseUrl = "";
- } else if (isDataScheme(url)) {
- warn('#createUrl: ignore "data:"-URL for performance reasons.');
- this.#baseUrl = "";
- } else {
- this.#baseUrl = url.split("#", 1)[0];
- }
+ if (this.#baseUrl === undefined) {
+ const url = this.#document.URL;
+ if (url === this.#document.baseURI) {
+ // No `<base>`-element present, hence a relative URL should work.
+ this.#baseUrl = "";
+ } else if (isDataScheme(url)) {
+ warn('#createUrl: ignore "data:"-URL for performance reasons.');
+ this.#baseUrl = "";
+ } else {
+ this.#baseUrl = url.split("#", 1)[0];
}
- return `url(${this.#baseUrl}#${id})`;
}
- return `url(${id})`;
+ return `url(${this.#baseUrl}#${id})`;
}
addFilter(maps) { |
Let's do that: I think it's slightly simpler and it shouldn't add any specific penalty. |
@Snuffleupagus, could you merge this PR asap, and then I'll make a new release. |
…ow-up) Somehow I managed to mess up the URL creation relevant to e.g. MOZCENTRAL builds, which is breaking the pending PDF.js update in mozilla-central; sorry about that! To avoid future issues, we'll now always check if absolute filter-URLs are necessary regardless of the build-target.
2f6551d
to
4c45948
Compare
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/a3981fdab0cd3a1/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/405f05fa597a2a8/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/405f05fa597a2a8/output.txt Total script time: 29.93 mins
Image differences available at: http://54.241.84.105:8877/405f05fa597a2a8/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/a3981fdab0cd3a1/output.txt Total script time: 44.35 mins
Image differences available at: http://54.193.163.58:8877/a3981fdab0cd3a1/reftest-analyzer.html#web=eq.log |
Somehow I managed to mess up the URL creation relevant to e.g. MOZCENTRAL builds, which is breaking the pending PDF.js update in mozilla-central; sorry about that!