New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628702 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug
Team-Security-UX



Sign in to add a comment

Mac: Permissions bubbles don't re-anchor properly when being shown on a dragged-off tab.

Reported by mbl...@yandex-team.ru, Jul 15 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17

Steps to reproduce the problem:
This seems to be a feature of OS X, but it could potentially affect Chromium as well. Affects the Screen bounds of child Widgets in MacViews as well.

Steps to reproduce:
1. Create a parent NSWindow and child NSWindow
2. Update parent's position using setFrame:
3. Child's frame is unchanged, although it should be.

If user moves the parent window, child window's frame is updated right after the window move is stopped.

This bug is particularly nasty, considering the RunMoveLoop in MacViews is implemented via setFrame: on the parent browser.

What is the expected behavior?

What went wrong?
Child window's frame is not updated.

Did this work before? N/A 

Chrome version: n/a  Channel: n/a
OS Version: OS X 10.11.5
Flash Version:
 
Cc: tapted@chromium.org
Cc: durga.behera@chromium.org
Labels: Needs-Feedback
mblsha@ : Thank you for the issue.Could you please help us with a sample url/jsfiddle to triage further from TE end.

Comment 3 by tapted@chromium.org, Jul 22 2016

Labels: -Needs-Feedback
Status: Available (was: Unconfirmed)
We can probably prevent dragging off tabs that have persistent child windows on them, similar to what we do for modal dialogs. Sample steps

1) On Mac, Go to https://permission.site
2) Click "Notifications", bubble should appear
3) Drag the 'permission.site' tab off the browser window

Expected: permission request bubble should reappear at the right location when dragging stops

Actual: Cocoa - bubble disappears and permission request gets wedged. Create a new tab and switch back to unwedge it.
I think the proper solution would be for parent NSWindow to manually update childrens' frames after it was moved. This problem is much more severe in Yandex.Browser so I'll probably experiment with this in the nearest couple of weeks. 
Components: Blink>HTML>Frame

Comment 6 by tapted@chromium.org, Aug 10 2016

Components: -Blink>HTML>Frame UI>Browser>Bubbles Internals>Views
Project Member

Comment 7 by sheriffbot@chromium.org, Aug 10 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 8 by tapted@chromium.org, Aug 11 2017

Cc: -tapted@chromium.org
Components: UI>Browser>Permissions>Prompts
Labels: -Pri-2 M-62 Pri-1
Owner: tapted@chromium.org
Status: Assigned (was: Untriaged)
Summary: Mac: Permissions bubbles don't re-anchor properly when being shown on a dragged-off tab. (was: frame of child NSWindows is not updated when parent is moved using setFrame:)
I don't think there's a way around the general problem except to add appropriate observers and reanchor child windows.

But it might be nice to fix the problem I described in #c4 in m62.

This is "different" (improved, perhaps..) with toolkit-views permission prompts, but it's still pretty weird.

In m62, with --enable-features=CocoaPermissionBubbles, dragging a tab off that has a permission request causes the request to be lost completely until switching tabs away and back.

With toolkit-views bubbles (currently default), the permission request appears on the window created by the dragged-off tab, but it appears at the wrong position. It doesn't re-anchor to the correct position until switching to a new tab and back, or resizing the browser frame.
BTW I've got a report from Apple that this should be fixed in High Sierra but didn't yet verify this.
Status: Started (was: Assigned)
for permission bubbles, I've found a neat fix -> https://chromium-review.googlesource.com/631079

For child windows more generally, code in bubble_anchor_helper_views.mm may help views dialogs shown on Cocoa browser. For mac_views_browser, last I toyed with it for tab-modal dialogs, there didn't seem to be a positioning problem, since some updates were made to ReparentNativeView.

For Cocoa bubbles on a Cocoa browser wrt #c8 "dragging a tab off that has a [Cocoa] permission request causes the request to be lost completely until switching tabs away and back.", by fix doesn't work :/.
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2090e0df2feba38f8e72f549dba44104c400af2f

commit 2090e0df2feba38f8e72f549dba44104c400af2f
Author: Trent Apted <tapted@chromium.org>
Date: Thu Aug 24 04:33:09 2017

Mac: Update permission bubble anchor while tab dragging.

When dragging tabs, the window is repositioned with direct setFrame: calls
which don't automatically reposition child windows. Most dialogs block tab
dragging or dismiss on focus loss. Permission bubbles do not, so ensure
they are anchored correctly during tab drag.

TEST=Have two tabs, navigate to https://permission.site/,
     Padlock: Ensure everything is set to "Ask",
     Click, e.g., Notifications to get a prompt,
     Drag the tab off the browser window.
     Prompt should reappear with a correct position.

Bug:  628702 
Change-Id: I5a0f9fd6b194437f9aec258077a0e16ba6a832e5
Reviewed-on: https://chromium-review.googlesource.com/631079
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496950}
[modify] https://crrev.com/2090e0df2feba38f8e72f549dba44104c400af2f/chrome/browser/ui/cocoa/browser_window_controller.mm

Status: Fixed (was: Started)

Sign in to add a comment