Changeset 195835 in webkit
- Timestamp:
- Jan 29, 2016 12:35:30 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r195819 r195835 1 2016-01-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Duplicate tab-types being saved to setting, causing duplicate tabs to be opened 4 https://bugs.webkit.org/show_bug.cgi?id=153659 5 <rdar://problem/24413157> 6 7 Reviewed by Brian Burg. 8 9 * UserInterface/Base/Main.js: 10 (WebInspector.contentLoaded): 11 (WebInspector._rememberOpenTabs): 12 De-duplicate the setting when building the list of tabs for existing 13 cases where the setting has duplicates and de-duplicate storing into 14 the setting, which was causing the issue to begin with. 15 1 16 2016-01-29 Devin Rousso <dcrousso+webkit@gmail.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r194572 r195835 391 391 this._pendingOpenTabs = []; 392 392 393 // Previously we may have stored duplicates in this setting. Avoid creating duplicate tabs. 393 394 let openTabTypes = this._openTabsSetting.value; 395 let seenTabTypes = new Set; 394 396 395 397 for (let i = 0; i < openTabTypes.length; ++i) { 396 398 let tabType = openTabTypes[i]; 399 400 if (seenTabTypes.has(tabType)) 401 continue; 402 seenTabTypes.add(tabType); 403 397 404 if (!this.isTabTypeAllowed(tabType)) { 398 405 this._pendingOpenTabs.push({tabType, index: i}); … … 468 475 WebInspector._rememberOpenTabs = function() 469 476 { 477 let seenTabTypes = new Set; 470 478 let openTabs = []; 471 479 … … 478 486 console.assert(tabContentView.type, "Tab type can't be null, undefined, or empty string", tabContentView.type, tabContentView); 479 487 openTabs.push(tabContentView.type); 488 seenTabTypes.add(tabContentView.type); 480 489 } 481 490 482 491 // Keep currently unsupported tabs in the setting at their previous index. 483 for (let {tabType, index} of this._pendingOpenTabs) 492 for (let {tabType, index} of this._pendingOpenTabs) { 493 if (seenTabTypes.has(tabType)) 494 continue; 484 495 openTabs.insertAtIndex(tabType, index); 496 seenTabTypes.add(tabType); 497 } 485 498 486 499 this._openTabsSetting.value = openTabs;
Note: See TracChangeset
for help on using the changeset viewer.