Changeset 27999 in webkit
- Timestamp:
- Nov 24, 2007, 11:18:45 AM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r27998 r27999 1 2007-11-24 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Bug 16112: Some Web Inspector UI elements use offsetWidth and offsetHeight before the stylesheet loads 6 http://bugs.webkit.org/show_bug.cgi?id=16112 7 8 In the places where we use offsetWidth and offsetHeight before 9 the stylesheet loads there is now a check. If the body's 10 offsetWidth is not greater than zero, then set a timeout 11 to do the updates requiring the stylesheet later. 12 13 The three places this happened: 14 - DOM tree selection highlight would show up at the wrong height 15 when using Inspect Element to open the inspector. 16 - DOM tree breadcrumbs would not collapse when using Inspect Element 17 to open the inspector. 18 - Network Timeline divider lines would not show when opening directly 19 into the timeline. 20 21 * page/inspector/DocumentPanel.js: Check if the stylesheet loaded. 22 * page/inspector/NetworkPanel.js: Ditto. 23 * page/inspector/inspector.html: Include the stylesheet before 24 any scripts, this will help get it loaded sooner. 25 1 26 2007-11-24 Kevin Ollivier <kevino@theolliviers.com> 2 27 -
trunk/WebCore/page/inspector/DocumentPanel.js
r27893 r27999 40 40 domView.show = function() { 41 41 InspectorController.highlightDOMNode(panel.focusedDOMNode); 42 panel.updateBreadcrumb Sizes();42 panel.updateBreadcrumb(); 43 43 panel.updateTreeSelection(); 44 44 }; … … 185 185 updateBreadcrumb: function() 186 186 { 187 if (!this.visible) 188 return; 189 187 190 var crumbs = this.views.dom.innerCrumbsElement; 188 191 … … 377 380 updateBreadcrumbSizes: function(focusedCrumb) 378 381 { 382 if (!this.visible) 383 return; 384 385 if (document.body.offsetWidth <= 0) { 386 // The stylesheet hasn't loaded yet, so we need to update later. 387 var panel = this; 388 setTimeout(function() { panel.updateBreadcrumbSizes() }, 0); 389 return; 390 } 391 379 392 var crumbs = this.views.dom.innerCrumbsElement; 380 393 if (!crumbs.childNodes.length) … … 383 396 var crumbsContainer = this.views.dom.crumbsElement; 384 397 if (crumbsContainer.offsetWidth <= 0 || crumbs.offsetWidth <= 0) 385 return; // The cumbs are not visible yet, do nothing.398 return; 386 399 387 400 // A Zero index is the right most child crumb in the breadcrumb. … … 741 754 return; 742 755 756 if (document.body.offsetWidth <= 0) { 757 // The stylesheet hasn't loaded yet, so we need to update later. 758 var element = this; 759 setTimeout(function() { element.updateSelection() }, 0); 760 return; 761 } 762 743 763 if (!this.selectionElement) { 744 764 this.selectionElement = document.createElement("div"); … … 798 818 { 799 819 this.treeOutline.panel.focusedDOMNode = this.representedObject; 800 801 // Call updateSelection twice to make sure the height is correct,802 // the first time might have a bad height because we are in a weird tree state803 820 this.updateSelection(); 804 805 var element = this;806 setTimeout(function() { element.updateSelection() }, 0);807 821 }, 808 822 -
trunk/WebCore/page/inspector/NetworkPanel.js
r27996 r27999 301 301 } 302 302 303 if (document.body.offsetWidth <= 0) { 304 // The stylesheet hasn't loaded yet, so we need to update later. 305 var panel = this; 306 setTimeout(function () { panel.updateTimelineDividersIfNeeded() }, 0); 307 return; 308 } 309 303 310 var dividerCount = Math.round(this.dividersElement.offsetWidth / 64); 304 311 var timeSlice = this.totalDuration / dividerCount; 305 312 306 313 if (this.lastDividerTimeSlice === timeSlice) 307 314 return; -
trunk/WebCore/page/inspector/inspector.html
r27883 r27999 30 30 <head> 31 31 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 32 <link rel="stylesheet" type="text/css" href="inspector.css" /> 32 33 <script type="text/javascript" src="utilities.js"></script> 33 34 <script type="text/javascript" src="treeoutline.js"></script> … … 50 51 <script type="text/javascript" src="ImagePanel.js"></script> 51 52 <script type="text/javascript" src="NetworkPanel.js"></script> 52 <link rel="stylesheet" type="text/css" href="inspector.css" />53 53 </head> 54 54 <body class="detached">
Note:
See TracChangeset
for help on using the changeset viewer.