[pdfjs] Remove inline style for CSP compliance

RESOLVED DUPLICATE of bug 1012656

Status

RESOLVED DUPLICATE of bug 1012656
4 years ago
4 years ago

People

(Reporter: pauljt, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

User Story

+++ This bug was initially created as a clone of Bug #1021724 +++

The keyboard app use setAttribute style which is blocked by CSP - see 968907 for details.
Need to replace 
https://github.com/mozilla-b2g/gaia/blob/master/apps/keyboard/js/render.js#L913

with something like

contentNode.style.width=width;
(Reporter)

Description

4 years ago
PDFjs uses a lot of inline styles of the form:

this.bar.setAttribute('style', 'width: calc(100% - ' +
                                         scrollbarWidth + 'px);');

We have two options here I think:
- change all of these to use CSSOM instead (ie this.bar.style.width=...)
- make pdfjs a privileged app.

(actually we should really do BOTH of these things).


PDFjs only needs settings access, and this will be exposed to privileged apps on a per-permission basis when bug 846200 lands.

The following lines use setAttribute to set a style:

https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/viewer.js#L277
https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/viewer.js#L1448
https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/viewer.js#L5057
https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/viewer.js#L5059
https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/viewer.js#L5061

https://github.com/mozilla-b2g/gaia/blob/master/apps/pdfjs/content/web/debugger.js#L68
Sounds a duplicate of bug 1012656
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1012656
You need to log in before you can comment on or make changes to this bug.