Skip to content

Commit

Permalink
LocalDOMWindow::resizeTo with extra arg
Browse files Browse the repository at this point in the history
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 <steimel@chromium.org>
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: WICG/document-picture-in-picture#104

    Bug: 1354325
  • Loading branch information
cdesouza-chromium committed Dec 13, 2023
1 parent 2f2b36a commit b2381d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit b2381d7

Please sign in to comment.