From 6edd29de43f7d921eb91f58ed91e41e3f68df5bd Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 26 Jun 2012 18:22:53 -0700 Subject: [PATCH] Prevent Firebug from crashing in Firefox 13 / Window 7 Summary: Simpler fix for D2572. Not entirely sure why Firebug is crashing Firefox. It appears to be callstack depth related, possibly? You can sort of reproduce this like this: >>> var f = function(n) { n && f(n - 1); } >>> f(10000); // Takes a few ms to run. >>> f(40000); // Takes a few ms to run. >>> f(50000); // Hangs Firefox. If there are 2,000 files, we currently hit a stack depth of around 4,000 with the pass() rules, so it seems like we should be 10x short of exploding. Anyway, this keeps us from increasing stack depth for menus that aren't currently open and stops Firebug from crashing. Test Plan: Clicked 2000-diff revision in Firefox. Reviewers: vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D2870 --- src/__celerity_resource_map__.php | 92 +++++++++---------- .../rsrc/js/application/core/DropdownMenu.js | 4 + 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 90f0387c4b..c4a20f963b 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -457,7 +457,7 @@ celerity_register_resource_map(array( ), 'aphront-form-view-css' => array( - 'uri' => '/res/3e7be7b8/rsrc/css/aphront/form-view.css', + 'uri' => '/res/b60e1526/rsrc/css/aphront/form-view.css', 'type' => 'css', 'requires' => array( @@ -2105,7 +2105,7 @@ celerity_register_resource_map(array( ), 'phabricator-dropdown-menu' => array( - 'uri' => '/res/d55c3771/rsrc/js/application/core/DropdownMenu.js', + 'uri' => '/res/2b4aa4d8/rsrc/js/application/core/DropdownMenu.js', 'type' => 'js', 'requires' => array( @@ -2570,7 +2570,7 @@ celerity_register_resource_map(array( ), array( 'packages' => array( - 'e6c01476' => + 68157940 => array( 'name' => 'core.pkg.css', 'symbols' => @@ -2599,10 +2599,10 @@ celerity_register_resource_map(array( 21 => 'phabricator-flag-css', 22 => 'aphront-error-view-css', ), - 'uri' => '/res/pkg/e6c01476/core.pkg.css', + 'uri' => '/res/pkg/68157940/core.pkg.css', 'type' => 'css', ), - '0c96375e' => + 'f363b322' => array( 'name' => 'core.pkg.js', 'symbols' => @@ -2625,7 +2625,7 @@ celerity_register_resource_map(array( 15 => 'javelin-behavior-phabricator-tooltips', 16 => 'phabricator-prefab', ), - 'uri' => '/res/pkg/0c96375e/core.pkg.js', + 'uri' => '/res/pkg/f363b322/core.pkg.js', 'type' => 'js', ), '32f461a4' => @@ -2766,20 +2766,20 @@ celerity_register_resource_map(array( 'reverse' => array( 'aphront-attached-file-view-css' => '7839ae2d', - 'aphront-crumbs-view-css' => 'e6c01476', - 'aphront-dialog-view-css' => 'e6c01476', - 'aphront-error-view-css' => 'e6c01476', - 'aphront-form-view-css' => 'e6c01476', + 'aphront-crumbs-view-css' => '68157940', + 'aphront-dialog-view-css' => '68157940', + 'aphront-error-view-css' => '68157940', + 'aphront-form-view-css' => '68157940', 'aphront-headsup-action-list-view-css' => '32f461a4', - 'aphront-headsup-view-css' => 'e6c01476', - 'aphront-list-filter-view-css' => 'e6c01476', - 'aphront-pager-view-css' => 'e6c01476', - 'aphront-panel-view-css' => 'e6c01476', - 'aphront-side-nav-view-css' => 'e6c01476', - 'aphront-table-view-css' => 'e6c01476', - 'aphront-tokenizer-control-css' => 'e6c01476', - 'aphront-tooltip-css' => 'e6c01476', - 'aphront-typeahead-control-css' => 'e6c01476', + 'aphront-headsup-view-css' => '68157940', + 'aphront-list-filter-view-css' => '68157940', + 'aphront-pager-view-css' => '68157940', + 'aphront-panel-view-css' => '68157940', + 'aphront-side-nav-view-css' => '68157940', + 'aphront-table-view-css' => '68157940', + 'aphront-tokenizer-control-css' => '68157940', + 'aphront-tooltip-css' => '68157940', + 'aphront-typeahead-control-css' => '68157940', 'differential-changeset-view-css' => '32f461a4', 'differential-core-view-css' => '32f461a4', 'differential-inline-comment-editor' => 'f4bbbd84', @@ -2797,7 +2797,7 @@ celerity_register_resource_map(array( 'javelin-behavior-aphront-basic-tokenizer' => '97f65640', 'javelin-behavior-aphront-drag-and-drop' => 'f4bbbd84', 'javelin-behavior-aphront-drag-and-drop-textarea' => 'f4bbbd84', - 'javelin-behavior-aphront-form-disable-on-submit' => '0c96375e', + 'javelin-behavior-aphront-form-disable-on-submit' => 'f363b322', 'javelin-behavior-audit-preview' => '5e68be89', 'javelin-behavior-buoyant' => 'f4bbbd84', 'javelin-behavior-differential-accept-with-errors' => 'f4bbbd84', @@ -2817,20 +2817,20 @@ celerity_register_resource_map(array( 'javelin-behavior-maniphest-transaction-controls' => '7707de41', 'javelin-behavior-maniphest-transaction-expand' => '7707de41', 'javelin-behavior-maniphest-transaction-preview' => '7707de41', - 'javelin-behavior-phabricator-autofocus' => '0c96375e', - 'javelin-behavior-phabricator-keyboard-shortcuts' => '0c96375e', + 'javelin-behavior-phabricator-autofocus' => 'f363b322', + 'javelin-behavior-phabricator-keyboard-shortcuts' => 'f363b322', 'javelin-behavior-phabricator-object-selector' => 'f4bbbd84', - 'javelin-behavior-phabricator-oncopy' => '0c96375e', - 'javelin-behavior-phabricator-tooltips' => '0c96375e', - 'javelin-behavior-phabricator-watch-anchor' => '0c96375e', - 'javelin-behavior-refresh-csrf' => '0c96375e', + 'javelin-behavior-phabricator-oncopy' => 'f363b322', + 'javelin-behavior-phabricator-tooltips' => 'f363b322', + 'javelin-behavior-phabricator-watch-anchor' => 'f363b322', + 'javelin-behavior-refresh-csrf' => 'f363b322', 'javelin-behavior-repository-crossreference' => 'f4bbbd84', - 'javelin-behavior-workflow' => '0c96375e', + 'javelin-behavior-workflow' => 'f363b322', 'javelin-dom' => '6fb20113', 'javelin-event' => '6fb20113', 'javelin-install' => '6fb20113', 'javelin-json' => '6fb20113', - 'javelin-mask' => '0c96375e', + 'javelin-mask' => 'f363b322', 'javelin-request' => '6fb20113', 'javelin-stratcom' => '6fb20113', 'javelin-tokenizer' => '97f65640', @@ -2842,30 +2842,30 @@ celerity_register_resource_map(array( 'javelin-uri' => '6fb20113', 'javelin-util' => '6fb20113', 'javelin-vector' => '6fb20113', - 'javelin-workflow' => '0c96375e', + 'javelin-workflow' => 'f363b322', 'maniphest-task-summary-css' => '7839ae2d', 'maniphest-transaction-detail-css' => '7839ae2d', - 'phabricator-app-buttons-css' => 'e6c01476', + 'phabricator-app-buttons-css' => '68157940', 'phabricator-content-source-view-css' => '32f461a4', - 'phabricator-core-buttons-css' => 'e6c01476', - 'phabricator-core-css' => 'e6c01476', - 'phabricator-directory-css' => 'e6c01476', + 'phabricator-core-buttons-css' => '68157940', + 'phabricator-core-css' => '68157940', + 'phabricator-directory-css' => '68157940', 'phabricator-drag-and-drop-file-upload' => 'f4bbbd84', - 'phabricator-dropdown-menu' => '0c96375e', - 'phabricator-flag-css' => 'e6c01476', - 'phabricator-jump-nav' => 'e6c01476', - 'phabricator-keyboard-shortcut' => '0c96375e', - 'phabricator-keyboard-shortcut-manager' => '0c96375e', - 'phabricator-menu-item' => '0c96375e', + 'phabricator-dropdown-menu' => 'f363b322', + 'phabricator-flag-css' => '68157940', + 'phabricator-jump-nav' => '68157940', + 'phabricator-keyboard-shortcut' => 'f363b322', + 'phabricator-keyboard-shortcut-manager' => 'f363b322', + 'phabricator-menu-item' => 'f363b322', 'phabricator-object-selector-css' => '32f461a4', - 'phabricator-paste-file-upload' => '0c96375e', - 'phabricator-prefab' => '0c96375e', + 'phabricator-paste-file-upload' => 'f363b322', + 'phabricator-prefab' => 'f363b322', 'phabricator-project-tag-css' => '7839ae2d', - 'phabricator-remarkup-css' => 'e6c01476', + 'phabricator-remarkup-css' => '68157940', 'phabricator-shaped-request' => 'f4bbbd84', - 'phabricator-standard-page-view' => 'e6c01476', - 'phabricator-tooltip' => '0c96375e', - 'phabricator-transaction-view-css' => 'e6c01476', - 'syntax-highlighting-css' => 'e6c01476', + 'phabricator-standard-page-view' => '68157940', + 'phabricator-tooltip' => 'f363b322', + 'phabricator-transaction-view-css' => '68157940', + 'syntax-highlighting-css' => '68157940', ), )); diff --git a/webroot/rsrc/js/application/core/DropdownMenu.js b/webroot/rsrc/js/application/core/DropdownMenu.js index a5b0c8fc0a..f22380c379 100644 --- a/webroot/rsrc/js/application/core/DropdownMenu.js +++ b/webroot/rsrc/js/application/core/DropdownMenu.js @@ -103,6 +103,10 @@ JX.install('PhabricatorDropdownMenu', { }, _onclickglobal : function(e) { + if (!this._open) { + return; + } + if (JX.Stratcom.pass(e)) { return; }