Bug 79518 - Web Inspector: Close TabbedPanes on middle click of tab handle
Summary: Web Inspector: Close TabbedPanes on middle click of tab handle
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 12:05 PST by Dan Beam
Modified: 2012-02-27 00:51 PST (History)
12 users (show)

See Also:


Attachments
Patch (1.48 KB, patch)
2012-02-24 12:06 PST, Dan Beam
no flags Details | Formatted Diff | Diff
Patch (1.47 KB, patch)
2012-02-24 23:14 PST, Dan Beam
no flags Details | Formatted Diff | Diff
Patch (1.45 KB, patch)
2012-02-25 13:41 PST, Dan Beam
no flags Details | Formatted Diff | Diff
Patch (2.08 KB, patch)
2012-02-25 13:46 PST, Dan Beam
no flags Details | Formatted Diff | Diff
Patch (2.14 KB, patch)
2012-02-25 17:01 PST, Dan Beam
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Beam 2012-02-24 12:05:50 PST
Corresponding webkit bug with patch to implement http://crbug.com/115551

If the feature ends up not being wanted, ignore this.
Comment 1 Dan Beam 2012-02-24 12:06:56 PST
Created attachment 128780 [details]
Patch
Comment 2 Alexander Pavlov (apavlov) 2012-02-24 22:43:27 PST
Comment on attachment 128780 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128780&action=review

> Source/WebCore/inspector/front-end/TabbedPane.js:619
> +            if (event.button == 1 || event.target.classList.contains('tabbed-pane-header-tab-close-button'))

Quotes are used instead of apostrophes for string literals across Web Inspector.
Also, to determine if a CSS class is present on an element, you should use event.target.hasStyleClass("tabbed-pane-header-tab-close-button"); for better readability (Element.prototype.hasStyleClass is defined in utilities.js).
Comment 3 Dan Beam 2012-02-24 23:14:30 PST
Created attachment 128857 [details]
Patch
Comment 4 Alexander Pavlov (apavlov) 2012-02-24 23:21:59 PST
Comment on attachment 128857 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128857&action=review

You need a ChangeLog entry for WebKit patches as well. It can be put together by the Tools/Scripts/prepare-ChangeLog script. I believe having one, together with the comparison fix (see below), will qualify as a good patch.

> Source/WebCore/inspector/front-end/TabbedPane.js:619
> +            if (event.button == 1 || event.target.hasStyleClass("tabbed-pane-header-tab-close-button"))

Sorry for overlooking this, we use the === comparison whenever possible.

Also, don't forget to set the r? flag on the patches you upload for the review.
Comment 5 Dan Beam 2012-02-25 13:41:16 PST
Created attachment 128881 [details]
Patch
Comment 6 Dan Beam 2012-02-25 13:46:59 PST
Created attachment 128882 [details]
Patch
Comment 7 WebKit Review Bot 2012-02-25 13:52:52 PST
Attachment 128882 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Dan Beam 2012-02-25 17:01:06 PST
Created attachment 128895 [details]
Patch
Comment 9 Alexander Pavlov (apavlov) 2012-02-26 08:53:35 PST
Comment on attachment 128895 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128895&action=review

> Source/WebCore/ChangeLog:8
> +        No new tests. (OOPS!)

ChangeLogs should never have the OOPS! string (there is a presubmit check that will prevent your patch from landing.) pfeldman and vsevik will know better if this functionality is/should be covered with a test. Otherwise the patch looks fine.
Comment 10 Pavel Feldman 2012-02-26 09:31:02 PST
Comment on attachment 128895 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128895&action=review

Thanks for the fix, I'll fix the ChangeLog and land it.

> Source/WebCore/ChangeLog:6
> +        Reviewed by Alexander Pavlov.

To avoid further confusion, let me clarify. ChangeLog must contain "Reviewed by NOBODY (OOPS!)." string. No other OOPS should be there. Reviewer is being filled in upon landing automatically.

> Source/WebCore/inspector/front-end/TabbedPane.js:618
> +        if (this._closeable && (event.button === 1 || event.target.hasStyleClass("tabbed-pane-header-tab-close-button")))

nit: I would make closeButtonSpan tab's field and compare it here.
Comment 11 Pavel Feldman 2012-02-27 00:51:32 PST
Committed r108966: <http://trac.webkit.org/changeset/108966>