1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00
pdf.js/src
Jonas Jenwald 5cbd44b628 Replace most remaining Element.setAttribute("style", ...) usage with Element.style = ... instead
This should hopefully be useful in environments where restrictive CSPs are in effect.
In most cases the replacement is entirely straighforward, and there's only a couple of special cases:
 - For the `src/display/font_loader.js` and `web/pdf_outline_viewer.js `cases, since the elements aren't appended to the document yet, it shouldn't matter if the style properties are set one-by-one rather than all at once.
 - For the `web/debugger.js` case, there's really no need to set the `padding` inline at all and the definition was simply moved to `web/viewer.css` instead.

*Please note:* There's still *a single* case left, in `web/toolbar.js` for setting the width of the zoom dropdown, which is left intact for now.
The reasons are that this particular case shouldn't matter for users of the general PDF.js library, and that it'd make a lot more sense to just try and re-factor that very old code anyway (thus fixing the `setAttribute` usage in the process).
2020-02-05 22:26:47 +01:00
..
core Make the decodeHuffman function, in src/core/jpg.js, slightly more efficient 2020-01-28 14:23:58 +01:00
display Replace most remaining Element.setAttribute("style", ...) usage with Element.style = ... instead 2020-02-05 22:26:47 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
shared Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
doc_helper.js [api-major] Completely remove the global PDFJS object 2018-03-01 18:13:27 +01:00
interfaces.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
license_header.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
license_header_libre.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
pdf.image_decoders.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
pdf.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
pdf.worker.entry.js Update the year in the license_header files 2020-01-05 12:14:03 +01:00
pdf.worker.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
worker_loader.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00