Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: trunk/Source/devtools/front_end/CSSStyleModel.js

Issue 196743008: Revert 169371 "DevTools: defer styles delta calculation to until..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | trunk/Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/devtools/front_end/CSSStyleModel.js
===================================================================
--- trunk/Source/devtools/front_end/CSSStyleModel.js (revision 169387)
+++ trunk/Source/devtools/front_end/CSSStyleModel.js (working copy)
@@ -169,23 +169,7 @@
*/
allStyleSheets: function()
{
- var values = Object.values(this._styleSheetIdToHeader);
- /**
- * @param {!WebInspector.CSSStyleSheetHeader} a
- * @param {!WebInspector.CSSStyleSheetHeader} b
- * @return {number}
- */
- function styleSheetComparator(a, b)
- {
- if (a.sourceURL < b.sourceURL)
- return -1;
- else if (a.sourceURL > b.sourceURL)
- return 1;
- return a.startLine - b.startLine || a.startColumn - b.startColumn;
- }
- values.sort(styleSheetComparator);
-
- return values;
+ return Object.values(this._styleSheetIdToHeader);
},
/**
@@ -361,6 +345,7 @@
mediaQueryResultChanged: function()
{
+ this._styleLoader.reset();
this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged);
},
@@ -398,6 +383,7 @@
*/
_fireStyleSheetChanged: function(styleSheetId)
{
+ this._styleLoader.reset();
if (!this._pendingCommandsMajorState.length)
return;
@@ -427,6 +413,7 @@
frameIdToStyleSheetIds[styleSheetHeader.frameId] = styleSheetIds;
}
styleSheetIds.push(styleSheetHeader.id);
+ this._styleLoader.reset();
this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetAdded, styleSheetHeader);
},
@@ -446,6 +433,7 @@
if (!Object.keys(this._styleSheetIdsForURL[url]).length)
delete this._styleSheetIdsForURL[url];
}
+ this._styleLoader.reset();
this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetRemoved, header);
},
@@ -1535,6 +1523,16 @@
}
WebInspector.CSSStyleModel.ComputedStyleLoader.prototype = {
+ reset: function()
+ {
+ for (var nodeId in this._nodeIdToCallbackData) {
+ var callbacks = this._nodeIdToCallbackData[nodeId];
+ for (var i = 0; i < callbacks.length; ++i)
+ callbacks[i](null);
+ }
+ this._nodeIdToCallbackData = {};
+ },
+
/**
* @param {!DOMAgent.NodeId} nodeId
* @param {function(?WebInspector.CSSStyleDeclaration)} userCallback
« no previous file with comments | « trunk/Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | trunk/Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698