RESOLVED FIXED Bug 77865
Web Inspector: Closed computed style sidebar pane rebuilds, resulting in slowness
https://bugs.webkit.org/show_bug.cgi?id=77865
Summary Web Inspector: Closed computed style sidebar pane rebuilds, resulting in slow...
Alexander Pavlov (apavlov)
Reported 2012-02-06 04:47:42 PST
Patch to follow
Attachments
Patch (36.76 KB, patch)
2012-02-06 06:37 PST, Alexander Pavlov (apavlov)
no flags
Patch (8.46 KB, patch)
2012-02-06 08:51 PST, Alexander Pavlov (apavlov)
no flags
Patch (15.16 KB, patch)
2012-02-06 10:18 PST, Alexander Pavlov (apavlov)
no flags
Patch (13.65 KB, patch)
2012-02-07 03:52 PST, Alexander Pavlov (apavlov)
no flags
Patch (12.38 KB, patch)
2012-02-07 07:39 PST, Alexander Pavlov (apavlov)
pfeldman: review+
Alexander Pavlov (apavlov)
Comment 1 2012-02-06 06:37:57 PST
Pavel Feldman
Comment 2 2012-02-06 07:35:24 PST
Comment on attachment 125633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125633&action=review > Source/WebCore/inspector/front-end/StylesSidebarPane.js:258 > + resultStyles.computedStyle = new WebInspector.CSSStyleDeclaration({ cssProperties: [], shorthandEntries: {} }); Why not null? > Source/WebCore/inspector/front-end/StylesSidebarPane.js:-493 > - _markUsedProperties: function(styleRules, usedProperties, disabledComputedProperties) I'd suggest that you remove disabledComputedProperties as a separate change. > Source/WebCore/inspector/front-end/StylesSidebarPane.js:854 > + // Overriding expand() rather than onexpand() to eliminate visual slowness due to a possible backend trip. Why exactly is this needed? > LayoutTests/http/tests/inspector/elements-test.js:86 > +InspectorTest.selectNodeAndWaitForStyles = function(idValue, expandComputedStyles, callback) Not the best change to the harness given that all the clients now need to think about the computed style. I'd suggest that you introduce a separate command that expands it separately. > LayoutTests/http/tests/inspector/elements-test.js:107 > + InspectorTest.runAfterPendingDispatches(function() { We should not use runAfterPendingDispatches if at all possible.
Alexander Pavlov (apavlov)
Comment 3 2012-02-06 08:51:50 PST
Pavel Feldman
Comment 4 2012-02-06 08:58:48 PST
Comment on attachment 125657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125657&action=review > Source/WebCore/inspector/front-end/StylesSidebarPane.js:864 > + if (WebInspector.panels.elements.sidebarPanes.styles.sections[0][0].propertiesElement.children.length) You should never access styles via the panel. > Source/WebCore/inspector/front-end/StylesSidebarPane.js:870 > + _expandedForTest: function(node) You could sniff instead. > LayoutTests/inspector/elements/elements-panel-styles.html:11 > + InspectorTest.selectNodeAndWaitForStylesWithComputed("foo", step1); It would be great to have a test that checks that computed style is not loaded initially, but is loaded on demand.
Alexander Pavlov (apavlov)
Comment 5 2012-02-06 10:18:52 PST
Pavel Feldman
Comment 6 2012-02-07 03:23:37 PST
Comment on attachment 125665 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125665&action=review > Source/WebCore/inspector/front-end/StylesSidebarPane.js:860 > + WebInspector.SidebarPane.prototype.expand.call(this, userCallback); You could sniff this in a test. > Source/WebCore/inspector/front-end/StylesSidebarPane.js:866 > + WebInspector.panels.elements.sidebarPanes.styles._refreshComputedStyleSection(callback.bind(this, userCallback)); I would leave this as the only path for the sake of the code simplicity.
Alexander Pavlov (apavlov)
Comment 7 2012-02-07 03:52:25 PST
Pavel Feldman
Comment 8 2012-02-07 06:09:25 PST
Comment on attachment 125807 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125807&action=review > Source/WebCore/inspector/front-end/StylesSidebarPane.js:429 > + if (nodeComputedStyle || nodeComputedStyle === null) Why did this change? > Source/WebCore/inspector/front-end/StylesSidebarPane.js:618 > + if (computedStyle || computedStyle === null) Why did this change? > Source/WebCore/inspector/front-end/StylesSidebarPane.js:863 > + WebInspector.panels.elements.sidebarPanes.styles._refreshComputedStyleSection(callback.bind(this)); You should not reach out for this via the elements panel.
Alexander Pavlov (apavlov)
Comment 9 2012-02-07 07:39:50 PST
Alexander Pavlov (apavlov)
Comment 10 2012-02-08 02:01:10 PST
Note You need to log in before you can comment on or make changes to this bug.