mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Merge pull request #16141 from Snuffleupagus/FilterFactory-docId
Include the document-id in the SVG-filter names (PR 16062 follow-up)
This commit is contained in:
commit
05f29c8720
2 changed files with 7 additions and 4 deletions
|
@ -53,11 +53,14 @@ class FilterFactory {
|
|||
|
||||
#_defs;
|
||||
|
||||
#docId;
|
||||
|
||||
#document;
|
||||
|
||||
#id = 0;
|
||||
|
||||
constructor({ ownerDocument = globalThis.document } = {}) {
|
||||
constructor({ docId, ownerDocument = globalThis.document } = {}) {
|
||||
this.#docId = docId;
|
||||
this.#document = ownerDocument;
|
||||
}
|
||||
|
||||
|
@ -132,7 +135,7 @@ class FilterFactory {
|
|||
// We create a SVG filter: feComponentTransferElement
|
||||
// https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement
|
||||
|
||||
const id = `transfer_map_${this.#id++}`;
|
||||
const id = `g_${this.#docId}_transfer_map_${this.#id++}`;
|
||||
const url = `url(#${id})`;
|
||||
this.#cache.set(maps, url);
|
||||
this.#cache.set(key, url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue