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

Issue 662153 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 643772
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Couldn't close tab by clicking X, or command+w. Only File > close tab worked

Project Member Reported by treffyn@google.com, Nov 3 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
1. Open new tab
2. Try to close new tab by clicking on the (x) next to the tab, or pressing Command + W
Please see video here: https://drive.google.com/open?id=0B0r7j1PFpKVURFFyTXVya3VSVG8

What is the expected behavior?

What went wrong?
The tab wouldn't close.
This has happened a few times on new tabs, but doesn't happen every time.

Did this work before? N/A 

Chrome version: 54.0.2840.71  Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
 
Components: -UI UI>Browser>TabStrip
Labels: Needs-Feedback
So does Cmd-W sometimes not work or does it always work?

I wonder if this isn't "couldn't close", but "was waiting on the page for some reason" (e.g. trying to run an unload handler of some sort) and File>Close tab didn't do that (or by the time it was tried, the page was unblocked, or whatever).

We can't always instantaneously close tabs.  This may be WAI, although perhaps there's a way to give better feedback.

Comment 3 by treffyn@google.com, Nov 4 2016

Yeah, sorry for the vague feedback.
It does happen more often when chrome is running really slow.
In these situations Cmd-W doesn't work, but File>Close Tab usually does.
..although, as you were saying, it could be because the page has finished
loading. ..it just usually feels like File>Close tab is somehow doing
something Cmd-W can't.
Cc: ojan@chromium.org
Components: UI>Browser>Navigation
If this is due to some kind of unload handler, then likely certain pages will tend to exhibit it more frequently.  If you always try cmd-w first and then fall back to the Close Tab menu item, then that could be biasing the perception.  You could try intentionally using Close Tab first.

I don't know the current status of unload handler handling and how it's wired to our different tab-closing options.  Maybe Ojan does.

Comment 5 by creis@chromium.org, Nov 4 2016

Cc: creis@chromium.org a...@chromium.org
If it's related to the beforeunload or unload handler, I would expect the tab to close 1 second after you try to close it (or maybe slightly longer, if the machine is under heavy load).  The only time that doesn't work is if you have a DevTools window open for the tab, in which case the timer is disabled.

If that's true, though, I wouldn't expect the X, Command+W, or File->Close Tab to act any differently.

Avi, do you know if File->Close Tab is wired up to a different action than Command+W?  (I would guess that they're the same.)

Comment 6 by a...@chromium.org, Nov 4 2016

The traces for the three ways are:

Clicking (X) in tab:

content::WebContentsImpl::~WebContentsImpl() + 14
TabStripModel::InternalCloseTab(content::WebContents*, int, bool) + 313
TabStripModel::InternalCloseTabs(std::__1::vector<int, std::__1::allocator<int> > const&, unsigned int) + 1789
TabStripModel::CloseWebContentsAt(int, unsigned int) + 67
-[TabStripController closeTab:] + 429
-[TabController closeTab:] + 160

File > Close Tab:

content::WebContentsImpl::~WebContentsImpl() + 14
TabStripModel::InternalCloseTab(content::WebContents*, int, bool) + 313
TabStripModel::InternalCloseTabs(std::__1::vector<int, std::__1::allocator<int> > const&, unsigned int) + 1789
chrome::CloseTab(Browser*) + 41
chrome::BrowserCommandController::ExecuteCommandWithDisposition(int, WindowOpenDisposition) + 772
CommandUpdater::ExecuteCommandWithDisposition(int, WindowOpenDisposition) + 312
_os_activity_initiate + 75
-[NSApplication sendAction:to:from:] + 460
-[BrowserCrApplication sendAction:to:from:] + 734
-[NSMenuItem _corePerformAction] + 336
-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
_os_activity_initiate + 75
-[NSMenu performActionForItemAtIndex:] + 131
-[NSMenu _internalPerformActionForItemAtIndex:] + 35
-[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 107

Command+W:

content::WebContentsImpl::~WebContentsImpl() + 14
TabStripModel::InternalCloseTab(content::WebContents*, int, bool) + 313
TabStripModel::InternalCloseTabs(std::__1::vector<int, std::__1::allocator<int> > const&, unsigned int) + 1789
chrome::CloseTab(Browser*) + 41
chrome::BrowserCommandController::ExecuteCommandWithDisposition(int, WindowOpenDisposition) + 772
CommandUpdater::ExecuteCommandWithDisposition(int, WindowOpenDisposition) + 312
_os_activity_initiate + 75
-[NSApplication sendAction:to:from:] + 460
-[BrowserCrApplication sendAction:to:from:] + 734
-[NSMenuItem _corePerformAction] + 336
-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
_os_activity_initiate + 75
-[NSMenu performKeyEquivalent:] + 357
-[NSApplication _handleKeyEquivalent:] + 920
-[NSApplication sendEvent:] + 4274

(X) goes directly to the tab model while the menu (either moused or shortcut keyed) goes through chrome::CloseTab(). These are for about:blank tabs, though, and I don't know if the ones you're using are doing anything fancy.
Project Member

Comment 7 by sheriffbot@chromium.org, Nov 12 2016

Labels: -Needs-Feedback Needs-Review
Owner: shrike@chromium.org
Thank you for providing more feedback. Adding requester "shrike@chromium.org" for another review and adding "Needs-Review" label for tracking.

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

Comment 8 by shrike@chromium.org, Nov 14 2016

Cc: shrike@chromium.org
Owner: sdy@chromium.org
Hey sdy@ - can you look into this to see how the Close X path might be failing?

Comment 9 by tapted@chromium.org, Nov 23 2016

Status: Assigned (was: Unconfirmed)

Comment 10 by sdy@chromium.org, Feb 23 2017

Mergedinto: 643772
Status: Duplicate (was: Assigned)

Sign in to add a comment