From dc9beda182856feadf0dea5747852e82e683f56f Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 6 Dec 2019 13:14:25 -0800 Subject: [PATCH] feat: remove deprecated setLayoutZoomLevelLimits (#21383) --- docs/api/breaking-changes.md | 8 ++++++++ docs/api/web-contents.md | 11 ----------- docs/api/web-frame.md | 9 --------- docs/api/webview-tag.md | 11 ----------- lib/browser/api/web-contents.js | 1 - lib/renderer/api/web-frame.ts | 7 ------- 6 files changed, 8 insertions(+), 39 deletions(-) diff --git a/docs/api/breaking-changes.md b/docs/api/breaking-changes.md index 75c7157fec7b..ab8cff86ad46 100644 --- a/docs/api/breaking-changes.md +++ b/docs/api/breaking-changes.md @@ -20,6 +20,14 @@ const { remote } = require('electron') remote.webContents.fromId(webview.getWebContentsId()) ``` +### `webFrame.setLayoutZoomLevelLimits()` + +Chromium has removed support for changing the layout zoom level limits, and it +is beyond Electron's capacity to maintain it. The function was deprecated in +Electron 8.x, and has been removed in Electron 9.x. The layout zoom level limits +are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined +[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11). + ## Planned Breaking API Changes (8.0) ### Values sent over IPC are now serialized with Structured Clone Algorithm diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 953344397db3..000396cb3a2a 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1113,17 +1113,6 @@ Sets the maximum and minimum pinch-to-zoom level. > contents.setVisualZoomLevelLimits(1, 3) > ``` -#### `contents.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_ - -* `minimumLevel` Number -* `maximumLevel` Number - -Returns `Promise` - -Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - -**Deprecated:** This API is no longer supported by Chromium. - #### `contents.undo()` Executes the editing command `undo` in web page. diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index da51509d47e3..7b459244add4 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -56,15 +56,6 @@ Sets the maximum and minimum pinch-to-zoom level. > webFrame.setVisualZoomLevelLimits(1, 3) > ``` -### `webFrame.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_ - -* `minimumLevel` Number -* `maximumLevel` Number - -Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - -**Deprecated:** This API is no longer supported by Chromium. - ### `webFrame.setSpellCheckProvider(language, provider)` * `language` String diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 6b9b5867d298..2804a02d78b5 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -635,17 +635,6 @@ Returns `Promise` Sets the maximum and minimum pinch-to-zoom level. -### `.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)` _Deprecated_ - -* `minimumLevel` Number -* `maximumLevel` Number - -Returns `Promise` - -Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. - -**Deprecated:** This API is no longer supported by Chromium. - ### `.showDefinitionForSelection()` _macOS_ Shows pop-up dictionary that searches the selected word on the page. diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index a6e841e851f9..282efb16bd6a 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -173,7 +173,6 @@ const webFrameMethods = [ 'insertCSS', 'insertText', 'removeInsertedCSS', - 'setLayoutZoomLevelLimits', 'setVisualZoomLevelLimits' ] diff --git a/lib/renderer/api/web-frame.ts b/lib/renderer/api/web-frame.ts index 623cb7706636..7b34e87229d1 100644 --- a/lib/renderer/api/web-frame.ts +++ b/lib/renderer/api/web-frame.ts @@ -1,10 +1,7 @@ import { EventEmitter } from 'events' -import { deprecate } from 'electron' const binding = process.electronBinding('web_frame') -const setLayoutZoomLevelLimitsWarning = deprecate.warnOnce('setLayoutZoomLevelLimits') - class WebFrame extends EventEmitter { constructor (public context: Window) { super() @@ -48,10 +45,6 @@ class WebFrame extends EventEmitter { get routingId () { return binding._getRoutingId(this.context) } - - setLayoutZoomLevelLimits () { - setLayoutZoomLevelLimitsWarning() - } } // Populate the methods.