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

Remove <base> tag from the Firefox built-in viewer (bug 1821408) #16153

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

calixteman
Copy link
Contributor

The tag is used to resolve relative URIs within the document. Newly added SVG filters use a relative URI which then use the URI in base but this one mismatches with the document URI and consequently filters are not found in the Firefox viewer.
So this patch just removes and replace few relative URLs by absolute ones.

@calixteman
Copy link
Contributor Author

@Snuffleupagus, it should be really safe to do that:
https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
and @emilio confirmed me that the only purpose of <base> is to resolve relative URIs within a document.

Just to be sure I checked that the origin:
https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/dom/base/nsGlobalWindowInner.cpp#3670
is the correct and it's.
Anyway, I could have overlooked something but overall it should be safe.

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, hopefully this won't break some weird edge-case; thank you!

web/viewer.html Outdated Show resolved Hide resolved
web/viewer.html Outdated Show resolved Hide resolved
The tag <base> is used to resolve relative URIs within the document.
Newly added SVG filters use a relative URI which then use the URI in base
but this one mismatches with the document URI and consequently filters are
not found in the Firefox viewer.
So this patch just removes <base> and replace few relative URLs by absolute
ones.
@calixteman
Copy link
Contributor Author

/botio integrationtest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/78cd618f241d7c0/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

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

Total script time: 4.33 mins

  • Integration Tests: FAILED

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/78cd618f241d7c0/output.txt

Total script time: 13.57 mins

  • Integration Tests: FAILED

@calixteman calixteman merged commit 945855a into mozilla:master Mar 14, 2023
@calixteman calixteman deleted the rm_base branch March 14, 2023 09:40
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 21, 2023
…viewers,emilio,marco

SVG filters weren't working correctly because of a mismatch between filter URI
and document URI. The problem has been fixed in:
  mozilla/pdf.js#16153
and here's the test.

Differential Revision: https://phabricator.services.mozilla.com/D172223
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 22, 2023
…viewers,emilio,marco

SVG filters weren't working correctly because of a mismatch between filter URI
and document URI. The problem has been fixed in:
  mozilla/pdf.js#16153
and here's the test.

Differential Revision: https://phabricator.services.mozilla.com/D172223
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 28, 2023
…viewers,emilio,marco, a=dsmith

SVG filters weren't working correctly because of a mismatch between filter URI
and document URI. The problem has been fixed in:
  mozilla/pdf.js#16153
and here's the test.

Differential Revision: https://phabricator.services.mozilla.com/D172223
aosmond pushed a commit to aosmond/gecko that referenced this pull request May 18, 2023
…viewers,emilio,marco, a=dsmith

SVG filters weren't working correctly because of a mismatch between filter URI
and document URI. The problem has been fixed in:
  mozilla/pdf.js#16153
and here's the test.

Differential Revision: https://phabricator.services.mozilla.com/D172223
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.

SVG-filters, for transfer maps, are not applied in the Firefox PDF Viewer
3 participants