Changeset 125005 in webkit
- Timestamp:
- Aug 8, 2012, 12:39:14 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r125003 r125005 1 2012-08-07 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: TabbedPane should use floating point width values for measuring. 4 https://bugs.webkit.org/show_bug.cgi?id=93349 5 6 Reviewed by Pavel Feldman. 7 8 TabbedPane now uses getBoundingClientRect().width instead of offsetWidth for more precise calculation. 9 10 * inspector/front-end/TabbedPane.js: 11 (WebInspector.TabbedPane.prototype._totalWidth): 12 (WebInspector.TabbedPane.prototype._updateTabsDropDown): 13 (WebInspector.TabbedPane.prototype._measureDropDownButton): 14 (WebInspector.TabbedPane.prototype._updateWidths): 15 (WebInspector.TabbedPaneTab.prototype._measure): 16 1 17 2012-08-08 Douglas Stockwell <dstockwell@chromium.org> 2 18 -
trunk/Source/WebCore/inspector/front-end/TabbedPane.js
r123313 r125005 305 305 }, 306 306 307 _totalWidth: function() 308 { 309 return this._headerContentsElement.getBoundingClientRect().width; 310 }, 311 307 312 _updateTabsDropDown: function() 308 313 { 309 var tabsToShowIndexes = this._tabsToShowIndexes(this._tabs, this._tabsHistory, this._ headerContentsElement.offsetWidth, this._measuredDropDownButtonWidth);314 var tabsToShowIndexes = this._tabsToShowIndexes(this._tabs, this._tabsHistory, this._totalWidth(), this._measuredDropDownButtonWidth); 310 315 311 316 for (var i = 0; i < this._tabs.length; ++i) { … … 363 368 this._dropDownButton.addStyleClass("measuring"); 364 369 this._headerContentsElement.appendChild(this._dropDownButton); 365 this._measuredDropDownButtonWidth = this._dropDownButton. offsetWidth;370 this._measuredDropDownButtonWidth = this._dropDownButton.getBoundingClientRect().width; 366 371 this._headerContentsElement.removeChild(this._dropDownButton); 367 372 this._dropDownButton.removeStyleClass("measuring"); … … 374 379 measuredWidths.push(this._tabs[tabId].measuredWidth); 375 380 376 const roundingError = 5; 377 var maxWidth = this._calculateMaxWidth(measuredWidths, this._headerContentsElement.offsetWidth - 5); 381 var maxWidth = this._calculateMaxWidth(measuredWidths, this._totalWidth()); 378 382 379 383 for (var tabId in this._tabs) { … … 658 662 var measuringTabElement = this._createTabElement(true); 659 663 this._measureElement.appendChild(measuringTabElement); 660 this._measuredWidth = measuringTabElement. offsetWidth;664 this._measuredWidth = measuringTabElement.getBoundingClientRect().width; 661 665 this._measureElement.removeChild(measuringTabElement); 662 666 },
Note:
See TracChangeset
for help on using the changeset viewer.