Title: [246509] trunk/Source/WebInspectorUI
- Revision
- 246509
- Author
- [email protected]
- Date
- 2019-06-17 12:30:54 -0700 (Mon, 17 Jun 2019)
Log Message
Web Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
https://bugs.webkit.org/show_bug.cgi?id=198860
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.get styleSheets):
(WI.CSSManager.prototype.inspectorStyleSheetsForFrame):
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
(WI.CSSManager.prototype._inspectorStyleSheetsForFrame): Deleted.
Expose a way to fetch all inspector stylesheets for a given frame.
Make sure to associate inspector stylesheets with their frame.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addResourcesRecursivelyForFrame):
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded):
Add paths for inspector stylesheet creation/fetching when grouping by path.
Sort inspector stylesheets as the first item of an origin/frame when grouping by path.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (246508 => 246509)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-06-17 19:29:18 UTC (rev 246508)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-06-17 19:30:54 UTC (rev 246509)
@@ -1,3 +1,25 @@
+2019-06-17 Devin Rousso <[email protected]>
+
+ Web Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
+ https://bugs.webkit.org/show_bug.cgi?id=198860
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Controllers/CSSManager.js:
+ (WI.CSSManager.prototype.get styleSheets):
+ (WI.CSSManager.prototype.inspectorStyleSheetsForFrame):
+ (WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
+ (WI.CSSManager.prototype._inspectorStyleSheetsForFrame): Deleted.
+ Expose a way to fetch all inspector stylesheets for a given frame.
+ Make sure to associate inspector stylesheets with their frame.
+
+ * UserInterface/Views/SourcesNavigationSidebarPanel.js:
+ (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
+ (WI.SourcesNavigationSidebarPanel.prototype._addResourcesRecursivelyForFrame):
+ (WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded):
+ Add paths for inspector stylesheet creation/fetching when grouping by path.
+ Sort inspector stylesheets as the first item of an origin/frame when grouping by path.
+
2019-06-17 Jamal Nasser <[email protected]>
Web Inspector: Go To Line dialog is white when in Dark Mode
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (246508 => 246509)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js 2019-06-17 19:29:18 UTC (rev 246508)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js 2019-06-17 19:30:54 UTC (rev 246509)
@@ -179,7 +179,7 @@
get styleSheets()
{
- return [...this._styleSheetIdentifierMap.values()];
+ return Array.from(this._styleSheetIdentifierMap.values());
}
get defaultAppearance()
@@ -299,9 +299,14 @@
return styles;
}
+ inspectorStyleSheetsForFrame(frame)
+ {
+ return this.styleSheets.filter((styleSheet) => styleSheet.isInspectorStyleSheet() && styleSheet.parentFrame === frame);
+ }
+
preferredInspectorStyleSheetForFrame(frame, callback, doNotCreateIfMissing)
{
- var inspectorStyleSheets = this._inspectorStyleSheetsForFrame(frame);
+ var inspectorStyleSheets = this.inspectorStyleSheetsForFrame(frame);
for (let styleSheet of inspectorStyleSheets) {
if (styleSheet[WI.CSSManager.PreferredInspectorStyleSheetSymbol]) {
callback(styleSheet);
@@ -314,7 +319,9 @@
if (CSSAgent.createStyleSheet) {
CSSAgent.createStyleSheet(frame.id, function(error, styleSheetId) {
+ const url = ""
let styleSheet = WI.cssManager.styleSheetForIdentifier(styleSheetId);
+ styleSheet.updateInfo(url, frame, styleSheet.origin, styleSheet.isInlineStyleTag(), styleSheet.startLineNumber, styleSheet.startColumnNumber);
styleSheet[WI.CSSManager.PreferredInspectorStyleSheetSymbol] = true;
callback(styleSheet);
});
@@ -490,18 +497,6 @@
// Private
- _inspectorStyleSheetsForFrame(frame)
- {
- let styleSheets = [];
-
- for (let styleSheet of this.styleSheets) {
- if (styleSheet.isInspectorStyleSheet() && styleSheet.parentFrame === frame)
- styleSheets.push(styleSheet);
- }
-
- return styleSheets;
- }
-
_nodePseudoClassesDidChange(event)
{
var node = event.target;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js (246508 => 246509)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js 2019-06-17 19:29:18 UTC (rev 246508)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js 2019-06-17 19:30:54 UTC (rev 246509)
@@ -574,6 +574,7 @@
_compareTreeElements(a, b)
{
const rankFunctions = [
+ (treeElement) => treeElement instanceof WI.CSSStyleSheetTreeElement && treeElement.representedObject.isInspectorStyleSheet(),
(treeElement) => treeElement === this._mainFrameTreeElement,
(treeElement) => treeElement instanceof WI.FrameTreeElement,
(treeElement) => {
@@ -589,12 +590,10 @@
let aRank = rankFunctions.findIndex((rankFunction) => rankFunction(a));
let bRank = rankFunctions.findIndex((rankFunction) => rankFunction(b));
- if (aRank >= 0 && bRank >= 0) {
- if (aRank < bRank)
- return -1;
- if (bRank < aRank)
- return 1;
- }
+ if ((aRank >= 0 && bRank < 0) || aRank < bRank)
+ return -1;
+ if ((bRank >= 0 && aRank < 0) || bRank < aRank)
+ return 1;
return a.mainTitle.extendedLocaleCompare(b.mainTitle) || a.subtitle.extendedLocaleCompare(b.subtitle);
}
@@ -739,6 +738,11 @@
for (let childFrame of frame.childFrameCollection)
this._addResourcesRecursivelyForFrame(childFrame);
+
+ if (WI.settings.resourceGroupingMode.value === WI.Resource.GroupingMode.Path) {
+ for (let styleSheet of WI.cssManager.inspectorStyleSheetsForFrame(frame))
+ this._addResource(styleSheet);
+ }
}
_addScript(script)
@@ -1922,11 +1926,15 @@
if (!styleSheet.isInspectorStyleSheet())
return;
- let frameTreeElement = this.treeElementForRepresentedObject(styleSheet.parentFrame);
- if (!frameTreeElement)
- return;
+ if (WI.settings.resourceGroupingMode.value === WI.Resource.GroupingMode.Type) {
+ let frameTreeElement = this.treeElementForRepresentedObject(styleSheet.parentFrame);
+ if (frameTreeElement) {
+ frameTreeElement.addRepresentedObjectToNewChildQueue(styleSheet);
+ return;
+ }
+ }
- frameTreeElement.addRepresentedObjectToNewChildQueue(styleSheet);
+ this._addResource(styleSheet);
}
_handleTargetAdded(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes