Closed
Bug 1021730
Opened 11 years ago
Closed 11 years ago
[pdfjs] Remove inline style for CSP compliance
Categories
(Firefox OS Graveyard :: Gaia::PDF Viewer, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1012656
People
(Reporter: pauljt, Unassigned)
References
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;
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
Reporter | ||
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Sounds a duplicate of bug 1012656
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•