| Summary: | Web Inspector: Sometimes CSS resources don't update after editing via Styles panel | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||||||
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Blocker | CC: | graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, tobi+webkit, webkit-bug-importer | ||||||||
| Priority: | P1 | Keywords: | InRadar | ||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Attachments: |
|
||||||||||
Created attachment 254324 [details]
Animated GIF of the problem 2
Assertion failed:
markAsNeedsRefresh StyleDetailsPanel.js:82
visibilityDidChange CSSStyleDetailsSidebarPanel.js:128
removeSidebarPanel Sidebar.js:97
showDetailsSidebarPanels ContentBrowserTabContentView.js:166
dispatch Object.js:123
dispatchEventToListeners Object.js:130
_dispatchCurrentRepresentedObjectsDidChangeEvent ContentBrowser.js:462
_currentContentViewDidChange ContentBrowser.js:503
dispatch Object.js:123
dispatchEventToListeners Object.js:130
closeAllContentViewsContentView Container.js:389
_showDOMTreeContentView ElementsTabContentView.js:88
_mainResourceDidChange ElementsTabContentView.js:105
dispatch Object.js:123
dispatchEventToListeners Object.js:138
_dispatchMainResourceDidChangeEvent Frame.js:473
commitProvisionalLoad Frame.js:137
frameDidNavigate FrameResourceManager.js:104
frameNavigated PageObserver.js:41
dispatchEvent InspectorBackend.js:352
_dispatchEvent InspectorBackend.js:232
dispatch InspectorBackend.js:87
dispatchNextQueuedMessageFromBackend MessageDispatcher.js:41
Assertion failed:
_stopTracking CodeMirrorTokenTrackingController.js:201
enabled CodeMirrorTokenTrackingController.js:80
editingControllerDidStartEditing SourceCodeTextEditor.js:1649
hoverMenuButtonWasPressed CodeMirrorEditingController.js:172
_handleClickEvent HoverMenu.js:98
handleEvent HoverMenu.js:84
index.html:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css"/>
</head>
<body> blah </body>
</html>
style.css:
body {
background: #000;
color: #CCC;
}
Same stacktrace, fixed formatting: Assertion failed: markAsNeedsRefresh StyleDetailsPanel.js:82 visibilityDidChange CSSStyleDetailsSidebarPanel.js:128 removeSidebarPanel Sidebar.js:97 showDetailsSidebarPanels ContentBrowserTabContentView.js:166 dispatch Object.js:123 dispatchEventToListeners Object.js:130 _dispatchCurrentRepresentedObjectsDidChangeEvent ContentBrowser.js:462 _currentContentViewDidChange ContentBrowser.js:503 dispatch Object.js:123 dispatchEventToListeners Object.js:130 closeAllContentViewsContentView Container.js:389 _showDOMTreeContentView ElementsTabContentView.js:88 _mainResourceDidChange ElementsTabContentView.js:105 dispatch Object.js:123 dispatchEventToListeners Object.js:138 _dispatchMainResourceDidChangeEvent Frame.js:473 commitProvisionalLoad Frame.js:137 frameDidNavigate FrameResourceManager.js:104 frameNavigated PageObserver.js:41 dispatchEvent InspectorBackend.js:352 _dispatchEvent InspectorBackend.js:232 dispatch InspectorBackend.js:87 dispatchNextQueuedMessageFromBackend MessageDispatcher.js:41 Assertion failed: _stopTracking CodeMirrorTokenTrackingController.js:201 enabled CodeMirrorTokenTrackingController.js:80 editingControllerDidStartEditing SourceCodeTextEditor.js:1649 hoverMenuButtonWasPressed CodeMirrorEditingController.js:172 _handleClickEvent HoverMenu.js:98 handleEvent HoverMenu.js:84 This problem compounds as multiple tabs may have different editor contents for the same resource. Still relevant!
Reduction:
HTML:
<link rel="stylesheet" href="style.css"/>
style.css:
body {
background: #fff;
color: #CCC;
}
Although, I don't see any errors in the console any longer. Steps: 0. Open the reduction HTML page in the Inspector 1. Inspect body element 2. Add "font-size: 12px" rule 3. Click on "style.css" Expected: style.css resource includes "font-size: 12px". Actual: style.css is unchanged. Created attachment 258865 [details]
[PATCH] Proposed Fix
Comment on attachment 258865 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=258865&action=review > Source/WebInspectorUI/UserInterface/Models/SourceCode.js:194 > + // FIXME: Returning the content in this promise is misleading. It may not be current content Yes, SourceCode or SourceCodeRevision should be the only ways to get the content. Comment on attachment 258865 [details]
[PATCH] Proposed Fix
Rewording the FIXME and landing manually. There are a few places that would need to be updated that I don't fully understand yet (CSSStyleSheet fetching content) to remove the FIXME. This fixes this very common bug so I'll land it now.
It works! Good job, Joe! \o/ |
Created attachment 249789 [details] Animated GIF of the problem I wasn’t able to capture the exact steps to reproduce the problem, because it only happens sometimes.