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

Issue 710491 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Web modals don't bounce when clicking out of the modal window.

Project Member Reported by moshayedi@chromium.org, Apr 11 2017

Issue description

When we click on the parts of UI that window modal (e.g. extension uninstall dialog) or system modal (e.g. javascript alert) dialog boxes filter out, we get a bounce animation informing users that they cannot click on those parts while the modal dialog is open.

This is also the intended behavior for web modals (i.e. MODAL_TYPE_CHILD, e.g. "Cast..." or print dialogs), as it seems from the code in window_modality_controller.cc. However, we don't get the animation for web modals.

This happens in all platforms (ChromeOS, Linux, ...) and is not a mus+ash specific bug.

 
The reason is:
 - window_modality_controller.cc assumes web modals are transient children of their parent.
 - But, NativeWidgetAura::InitNativeWidget() doesn't add web modals as transient child, because params.child is true for them.
 - params.child is set to true in dialog_delegate.cc:

  // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child
  // widgets to prevent top-level window behavior (independent movement, etc).
  params.child = parent && (delegate->GetModalType() == ui::MODAL_TYPE_CHILD);
Status: Assigned (was: Started)
Cc: moshayedi@chromium.org
Owner: ----

Comment 4 by sky@chromium.org, Jul 24 2017

Owner: e...@chromium.org

Comment 5 by e...@chromium.org, Aug 18 2017

So when we do the naive thing and not key setting params.child on MODAL_TYPE_CHILD (per #1), we break a whole bunch of tests.

For example, PrintPreviewDialogControllerUnitTest.GetOrCreatePreviewDialog. I'm able to bring up the dialog just fine, but it is crashing in the unit tests. This may have something to do with not having a root window?

Comment 6 by e...@chromium.org, Aug 18 2017

It seems like purely a problem with tests.

NativeWidgetAura::InitNativeWidget() tries to get the root window when doing anything other than simple direct child attachment. At least all tests that invoke DialogTestBrowserWindow don't have a RootWindow; comments in the constructor calls out that it's tricky to get one.

So fixing the actual bug here is a one liner, but fixing the tests to work afterwards...

Comment 7 by e...@chromium.org, Aug 21 2017

The problem runs deeper than this.

The code in window_modality_controller.cc relies on walking across transient children. So the first attempt at fixing is to just ensure that params.child isn't set when building a web modal dialog in DialogDelegate. Some tests break, but if I go ahead and fix the tests by threading a GetContext() to the dialog, all the tests pass. Great. But there are no tests for dialog location, and in all chromeos, these dialogs are mispositioned. It looks like a location/root_location problem again.

Comment 8 by e...@chromium.org, Aug 22 2017

Labels: -Pri-1 OS-Chrome OS-Linux OS-Windows Pri-3
This isn't mus specific, and has been broken without comment for almost a year and a half. It's also really difficult to fix due to a bunch of assumptions in the dialog handling code.

If anyone wants to take this, go ahead. This sits at the bottom of my queue.

Comment 9 by e...@chromium.org, Sep 12 2017

Owner: ----
Status: Available (was: Assigned)
Cc: -mfomitchev@chromium.org
Project Member

Comment 11 by sheriffbot@chromium.org, Nov 22

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.

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

Sign in to add a comment