Changeset 126001 in webkit
- Timestamp:
- Aug 20, 2012 12:21:16 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126000 r126001 1 2012-08-20 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: toolbar causes 8 reflows upon opening 4 https://bugs.webkit.org/show_bug.cgi?id=94422 5 6 Reviewed by Yury Semikhatsky. 7 8 Toolbar's overflow code causes inspector to do 8 reflows upon opening. 9 Fixing it via introducing batch toolbar update. 10 11 * inspector/front-end/Toolbar.js: 12 (WebInspector.Toolbar): 13 (WebInspector.Toolbar.prototype.setCoalescingUpdate): 14 (WebInspector.Toolbar.prototype._updateDropdownButtonAndHideDropdown): 15 * inspector/front-end/inspector.css: 16 (body.compact .toolbar-icon): 17 (body.compact .toolbar-icon.custom-toolbar-icon): 18 (body.compact .toolbar-item:active .toolbar-icon): 19 (body.compact .toolbar-label): 20 (body.compact .toolbar-item.resources .toolbar-icon): 21 (body.compact .toolbar-item.network .toolbar-icon): 22 (body.compact .toolbar-item.scripts .toolbar-icon): 23 (body.compact .toolbar-item.timeline .toolbar-icon): 24 (body.compact .toolbar-item.profiles .toolbar-icon): 25 (body.compact .toolbar-item.audits .toolbar-icon): 26 (body.compact .toolbar-item.console .toolbar-icon): 27 * inspector/front-end/inspector.js: 28 (WebInspector.get _setCompactMode): 29 (WebInspector.windowResize): 30 1 31 2012-08-19 Kentaro Hara <haraken@chromium.org> 2 32 -
trunk/Source/WebCore/inspector/front-end/Toolbar.js
r125871 r126001 43 43 document.getElementById("close-button-left").addEventListener("click", this._onClose, true); 44 44 document.getElementById("close-button-right").addEventListener("click", this._onClose, true); 45 this._coalescingLevel = 0; 45 46 } 46 47 47 48 WebInspector.Toolbar.prototype = { 48 set compact(compact) 49 { 50 if (compact) 51 this.element.addStyleClass("toolbar-small"); 52 else 53 this.element.removeStyleClass("toolbar-small"); 54 this._updateDropdownButtonAndHideDropdown(); 49 /** 50 * @param {boolean} enabled 51 */ 52 setCoalescingUpdate: function(enabled) 53 { 54 this._coalescingLevel += enabled ? 1 : -1; 55 if (!this._coalescingLevel) 56 this._updateDropdownButtonAndHideDropdown(); 55 57 }, 56 58 … … 178 180 _updateDropdownButtonAndHideDropdown: function() 179 181 { 182 if (this._coalescingLevel) 183 return; 180 184 this._setDropdownVisible(false); 181 185 -
trunk/Source/WebCore/inspector/front-end/inspector.css
r125879 r126001 112 112 } 113 113 114 .toolbar-small.toolbar-icon {114 body.compact .toolbar-icon { 115 115 width: 24px; 116 116 height: 24px; … … 119 119 } 120 120 121 .toolbar-small.toolbar-icon.custom-toolbar-icon {121 body.compact .toolbar-icon.custom-toolbar-icon { 122 122 background-position-x: -32px; 123 123 } … … 127 127 } 128 128 129 .toolbar-small.toolbar-item:active .toolbar-icon {129 body.compact .toolbar-item:active .toolbar-icon { 130 130 background-position-y: 24px; 131 131 } … … 141 141 } 142 142 143 .toolbar-small.toolbar-label {143 body.compact .toolbar-label { 144 144 display: inline-block; 145 145 margin-left: 3px; … … 396 396 } 397 397 398 .toolbar-small.toolbar-item.resources .toolbar-icon {398 body.compact .toolbar-item.resources .toolbar-icon { 399 399 background-position-x: -24px; 400 400 } … … 404 404 } 405 405 406 .toolbar-small.toolbar-item.network .toolbar-icon {406 body.compact .toolbar-item.network .toolbar-icon { 407 407 background-position-x: -48px; 408 408 } … … 412 412 } 413 413 414 .toolbar-small.toolbar-item.scripts .toolbar-icon {414 body.compact .toolbar-item.scripts .toolbar-icon { 415 415 background-position-x: -72px; 416 416 } … … 420 420 } 421 421 422 .toolbar-small.toolbar-item.timeline .toolbar-icon {422 body.compact .toolbar-item.timeline .toolbar-icon { 423 423 background-position-x: -96px; 424 424 } … … 428 428 } 429 429 430 .toolbar-small.toolbar-item.profiles .toolbar-icon {430 body.compact .toolbar-item.profiles .toolbar-icon { 431 431 background-position-x: -120px; 432 432 } … … 436 436 } 437 437 438 .toolbar-small.toolbar-item.audits .toolbar-icon {438 body.compact .toolbar-item.audits .toolbar-icon { 439 439 background-position-x: -144px; 440 440 } … … 444 444 } 445 445 446 .toolbar-small.toolbar-item.console .toolbar-icon {446 body.compact .toolbar-item.console .toolbar-icon { 447 447 background-position-x: -168px; 448 448 } -
trunk/Source/WebCore/inspector/front-end/inspector.js
r125980 r126001 257 257 else 258 258 body.removeStyleClass("compact"); 259 260 // This may be called before doLoadedDone, hence the bulk of inspector objects may 261 // not be created yet. 262 if (WebInspector.toolbar) 263 WebInspector.toolbar.compact = x; 264 265 if (WebInspector.drawer) 266 WebInspector.drawer.resize(); 259 WebInspector.windowResize(); 267 260 }, 268 261 … … 521 514 this._createGlobalStatusBarItems(); 522 515 516 WebInspector._installDockToRight(); 517 523 518 this.toolbar = new WebInspector.Toolbar(); 524 WebInspector._installDockToRight(); 525 519 this.toolbar.setCoalescingUpdate(true); 526 520 var panelDescriptors = this._panelDescriptors(); 527 521 for (var i = 0; i < panelDescriptors.length; ++i) 528 522 WebInspector.inspectorView.addPanel(panelDescriptors[i]); 523 this.toolbar.setCoalescingUpdate(false); 529 524 530 525 this.addMainEventListeners(document); … … 641 636 WebInspector.windowResize = function(event) 642 637 { 643 WebInspector.inspectorView.doResize(); 644 WebInspector.drawer.resize(); 645 WebInspector.toolbar.resize(); 646 WebInspector.settingsController.resize(); 638 if (WebInspector.inspectorView) 639 WebInspector.inspectorView.doResize(); 640 if (WebInspector.drawer) 641 WebInspector.drawer.resize(); 642 if (WebInspector.toolbar) 643 WebInspector.toolbar.resize(); 644 if (WebInspector.settingsController) 645 WebInspector.settingsController.resize(); 647 646 } 648 647
Note: See TracChangeset
for help on using the changeset viewer.