diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-01 11:08:40 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-01 12:16:21 +0000 |
commit | 03c549e0392f92c02536d3f86d5e1d8dfa3435ac (patch) | |
tree | fe49d170a929b34ba82cd10db1a0bd8e3760fa4b /chromium/chrome/browser/resources/pdf | |
parent | 5d013f5804a0d91fcf6c626b2d6fb6eca5c845b0 (diff) |
BASELINE: Update Chromium to 91.0.4472.160
Change-Id: I0def1f08a2412aeed79a9ab95dd50eb5c3f65f31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/pdf')
4 files changed, 18 insertions, 8 deletions
diff --git a/chromium/chrome/browser/resources/pdf/elements/shared-css.html b/chromium/chrome/browser/resources/pdf/elements/shared-css.html index 16e61e42588..f53ceae474d 100644 --- a/chromium/chrome/browser/resources/pdf/elements/shared-css.html +++ b/chromium/chrome/browser/resources/pdf/elements/shared-css.html @@ -2,6 +2,7 @@ <style> cr-icon-button { --cr-icon-button-fill-color: var(--pdf-toolbar-text-color); + --cr-icon-button-focus-outline-color: var(--google-grey-500); margin: 0; } diff --git a/chromium/chrome/browser/resources/pdf/pdf_viewer.html b/chromium/chrome/browser/resources/pdf/pdf_viewer.html index 386bd576254..fbc809859cd 100644 --- a/chromium/chrome/browser/resources/pdf/pdf_viewer.html +++ b/chromium/chrome/browser/resources/pdf/pdf_viewer.html @@ -58,15 +58,14 @@ } #content-focus-rectangle { - border: 2px solid var(--google-grey-600); + border: 2px solid var(--google-grey-500); border-radius: 2px; box-sizing: border-box; height: 100%; pointer-events: none; - position: fixed; + position: absolute; + top: 0; width: 100%; - /* z-index for this should be higher than toolbar. */ - z-index: 5; } viewer-ink-host { @@ -107,6 +106,7 @@ #main { flex: 1; overflow: hidden; + position: relative; } #scroller { @@ -176,7 +176,8 @@ <div id="sizer"></div> <div id="content"></div> </div> - <div> + <div id="content-focus-rectangle" hidden$="[[!documentHasFocus_]]"></div> + </div> </div> <template is="dom-if" if="[[showPasswordDialog_]]" restamp> @@ -197,5 +198,3 @@ <if expr="chromeos"> <viewer-form-warning id="form-warning"></viewer-form-warning> </if> - -<div id="content-focus-rectangle" hidden$="[[!documentHasFocus_]]"></div> diff --git a/chromium/chrome/browser/resources/pdf/pdf_viewer.js b/chromium/chrome/browser/resources/pdf/pdf_viewer.js index 3212a430738..2b3ccb1f19c 100644 --- a/chromium/chrome/browser/resources/pdf/pdf_viewer.js +++ b/chromium/chrome/browser/resources/pdf/pdf_viewer.js @@ -972,7 +972,7 @@ export class PDFViewerElement extends PDFViewerBaseElement { const result = await this.currentController.saveAttachment(index); // Cap the PDF attachment size at 100 MB. This cap should be kept in sync - // with and is also enforced in pdf/out_of_process_instance.cc. + // with and is also enforced in pdf/pdf_view_plugin_base.h. const MAX_FILE_SIZE = 100 * 1000 * 1000; const bufView = new Uint8Array(result.dataToSave); assert( diff --git a/chromium/chrome/browser/resources/pdf/viewport.js b/chromium/chrome/browser/resources/pdf/viewport.js index c852530aec9..b3749d35f68 100644 --- a/chromium/chrome/browser/resources/pdf/viewport.js +++ b/chromium/chrome/browser/resources/pdf/viewport.js @@ -341,6 +341,16 @@ export class Viewport { */ getViewportRect_() { const zoom = this.getZoom(); + // Zoom can be 0 in the case of a PDF that is in a hidden iframe. Avoid + // returning undefined values in this case. See https://crbug.com/1202725. + if (zoom === 0) { + return { + x: 0, + y: 0, + width: 0, + height: 0, + }; + } return { x: this.position.x / zoom, y: this.position.y / zoom, |