From 5f626a4a8cc4d6e8d63d5ebaf03653676a0889bf Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Fri, 1 Dec 2023 10:05:53 +0000 Subject: [PATCH] `LocalDOMWindow::resizeTo` with extra arg The override for `LocalDOMWindow::resizeTo` was broken by the addition of an extra exception state argument. This argument is of no consequence to the override itself. This change adjusts the override to pass the exception state along. Chromium change: https://chromium.googlesource.com/chromium/src/+/f17e2aa8de58031d15efa2c0f6de1e0fb48d0b09 commit f17e2aa8de58031d15efa2c0f6de1e0fb48d0b09 Author: Tommy Steimel Date: Wed Nov 29 17:32:08 2023 +0000 [document pip] Allow resizeTo()/resizeBy() via user gesture Currently, we don't allow picture-in-picture windows to use the resizeTo() and resizeBy() APIs to prevent abuse. This CL adds a user gesture requirement to those APIs for document picture-in-picture windows to allow them to use those APIs while limiting the potential for abuse. Specification: https://github.com/WICG/document-picture-in-picture/pull/104 Bug: 1354325 --- .../blink/renderer/core/frame/local_dom_window.cc | 9 ++++++--- .../blink/renderer/core/frame/local_dom_window.h | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.cc b/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.cc index 42541126c939..af2418bf16ea 100644 --- a/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.cc @@ -95,13 +95,16 @@ int LocalDOMWindow::screenY() const { : screenY_ChromiumImpl(); } -void LocalDOMWindow::resizeTo(int width, int height) const { +void LocalDOMWindow::resizeTo(int width, + int height, + ExceptionState& exception_state) const { ExecutionContext* context = GetExecutionContext(); if (BlockScreenFingerprinting(context)) { resizeTo_ChromiumImpl(width + outerWidth_ChromiumImpl() - outerWidth(), - height + outerHeight_ChromiumImpl() - outerHeight()); + height + outerHeight_ChromiumImpl() - outerHeight(), + exception_state); } else { - resizeTo_ChromiumImpl(width, height); + resizeTo_ChromiumImpl(width, height, exception_state); } } diff --git a/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.h b/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.h index 68b819496e1d..8f2bac4da56d 100644 --- a/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.h +++ b/chromium_src/third_party/blink/renderer/core/frame/local_dom_window.h @@ -36,8 +36,9 @@ screenY_ChromiumImpl() const; \ int screenTop -#define resizeTo \ - resizeTo_ChromiumImpl(int width, int height) const; \ +#define resizeTo \ + resizeTo_ChromiumImpl(int width, int height, \ + ExceptionState& exception_state) const; \ void resizeTo #define moveTo \