Changeset 193646 in webkit
- Timestamp:
- Dec 7, 2015 12:57:35 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 1 deleted
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r193645 r193646 1 2015-12-07 Brian Burg <bburg@apple.com> 2 3 Web Inspector: Uncaught Exception page should have better styles and handle more error cases 4 https://bugs.webkit.org/show_bug.cgi?id=151923 5 6 Reviewed by Timothy Hatcher. 7 8 Add a check for InspectorFrontendAPI before calling it. This can fail 9 easily if an uncaught exception stalls initial loading, or whenever 10 the Inspector frontend is reloaded. 11 12 * inspector/InspectorFrontendClientLocal.cpp: 13 (WebCore::InspectorFrontendClientLocal::evaluateOnLoad): 14 1 15 2015-12-07 Beth Dakin <bdakin@apple.com> 2 16 -
trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
r192756 r193646 372 372 { 373 373 if (m_frontendLoaded) 374 m_frontendPage->mainFrame().script().executeScript(" InspectorFrontendAPI.dispatch(" + expression + ")");374 m_frontendPage->mainFrame().script().executeScript("if (InspectorFrontendAPI) InspectorFrontendAPI.dispatch(" + expression + ")"); 375 375 else 376 376 m_evaluateOnLoad.append(expression); -
trunk/Source/WebInspectorUI/ChangeLog
r193615 r193646 1 2015-12-07 Brian Burg <bburg@apple.com> 2 3 Web Inspector: Uncaught Exception page should have better styles and handle more error cases 4 https://bugs.webkit.org/show_bug.cgi?id=151923 5 6 Reviewed by Timothy Hatcher. 7 8 Restructure the Uncaught Exception reporting page to act more like 9 a modal sheet. Distinguish between uncaught exceptions before and 10 after the frontend is initially loaded. If the frontend is loaded, 11 add a clickable link that dismisses the sheet and ignores the error. 12 If the inspector finished loading, then only show at most one 13 exception at a time, since subsequent interactions can cause spurious 14 errors when the sheet is active. 15 16 Split existing code into multiple functions so it's easier to follow. 17 Add miscellaneous guards against internal corruption and weird cases. 18 19 * UserInterface/Base/Main.js: 20 (WebInspector.contentLoaded): Store the flag on the global object 21 in case WebInspector becomes shadowed or otherwise unusable. 22 23 * UserInterface/Debug/UncaughtExceptionReporter.css: Renamed from Source/WebInspectorUI/UserInterface/Debug/CatchEarlyErrors.css. 24 (div.sheet-container): 25 (div.uncaught-exception-sheet): 26 (div.uncaught-exception-sheet a): 27 (div.uncaught-exception-sheet a:active): 28 (div.uncaught-exception-sheet h2): 29 (div.uncaught-exception-sheet h1 > img): 30 (div.uncaught-exception-sheet h2 > img): 31 (div.uncaught-exception-sheet dl): 32 (div.uncaught-exception-sheet dt): 33 (div.uncaught-exception-sheet dd): 34 (div.uncaught-exception-sheet ul): 35 (div.uncaught-exception-sheet li): 36 * UserInterface/Debug/UncaughtExceptionReporter.js: Renamed from CatchEarlyErrors.js. 37 (stopEventPropagation): Allow clicking whitelisted links on the sheet. 38 (blockEventHandlers): 39 (unblockEventHandlers): 40 (handleUncaughtException): 41 (dismissErrorSheet): 42 (createErrorSheet.insertWordBreakCharacters): 43 (createErrorSheet): 44 (handleLinkClick): 45 * UserInterface/Main.html: 46 * UserInterface/Protocol/MessageDispatcher.js: 47 (WebInspector.dispatchMessageFromBackend): Don't try to dispatch 48 messages from the backend when showing the error sheet. They will 49 probably fail, so suspend dispatching until the sheet is dismissed. 50 1 51 2015-12-06 Devin Rousso <dcrousso+webkit@gmail.com> 2 52 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r193507 r193646 176 176 WebInspector.contentLoaded = function() 177 177 { 178 // If a loading error page was already shown, then don't set up the Inspector UI. 179 if (window.__earlyErrors) 178 // If there was an uncaught exception earlier during loading, then 179 // abort loading more content. We could be in an inconsistent state. 180 if (window.__uncaughtExceptions) 180 181 return; 181 182 … … 431 432 this.showSplitConsole(); 432 433 433 this._contentLoaded = true; 434 // Store this on the window in case the WebInspector global gets corrupted. 435 window.__frontendCompletedLoad = true; 434 436 435 437 if (this.runBootstrapOperations) -
trunk/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.css
r193645 r193646 24 24 */ 25 25 26 body.caught-early-error {27 margin: 50px 65px;28 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;29 font-size: 11pt;30 max-width: 700px;31 min-width: 400px;32 background-color: #fefefe;33 overflow: scroll;26 .sheet-container { 27 position: absolute; 28 left: 0; 29 right: 0; 30 top: 0; 31 bottom: 0; 32 z-index: 10000; 33 background-color: hsl(0, 0%, 96%); 34 34 } 35 35 36 body.caught-early-error h1, 37 body.caught-early-error h2 { 38 font-size: 16pt; 39 font-weight: bold; 36 .uncaught-exception-sheet { 37 padding: 50px 55px 50px 65px; 38 font-family: '-webkit-system-font'; 39 font-size: 11pt; 40 overflow-y: auto; 41 min-width: 400px; 42 color: hsl(0, 0%, 40%); 43 } 44 45 .uncaught-exception-sheet a { 46 text-decoration: underline; 47 color: hsl(240, 55%, 30%); 48 cursor: pointer; 49 font-weight: 500; 50 font-size: 97%; 51 } 52 .uncaught-exception-sheet a:hover, 53 .uncaught-exception-sheet a:active { 54 color: hsl(240, 55%, 25%); 55 } 56 57 .uncaught-exception-sheet h1, 58 .uncaught-exception-sheet h2 { 59 font-size: 24px; 60 line-height: 28px; 40 61 margin-bottom: 0px; 41 62 margin-top: 10px; 63 font-weight: normal; 42 64 } 43 65 44 body.caught-early-error h1 > img { 66 .uncaught-exception-sheet h2 { 67 margin-top: 40px; 68 } 69 70 .uncaught-exception-sheet h1 > img { 45 71 height: 35px; 46 72 position: relative; 47 73 margin-left: -50px; 48 margin-top: - 7px;74 margin-top: -5px; 49 75 float: left; 50 76 } 51 77 52 body.caught-early-errorh2 > img {78 .uncaught-exception-sheet h2 > img { 53 79 height: 25px; 54 80 position: relative; … … 58 84 } 59 85 60 body.caught-early-error dt { 61 font-weight: 600; 62 font-style: italic; 86 .uncaught-exception-sheet dl { 87 max-width: 600px; 63 88 } 64 89 65 body.caught-early-error dd { 66 margin: 10px 0 20px 10px; 90 .uncaught-exception-sheet dt { 91 font-style: italic; 92 font-size: 17px; 67 93 } 68 94 69 body.caught-early-error ul { 95 .uncaught-exception-sheet dd { 96 margin: 10px 0 20px 10px; 97 font-size: 13px; 98 line-height: 18px; 99 } 100 101 .uncaught-exception-sheet ul { 70 102 font-family: Menlo, monospace; 71 font-size: 75%; 72 margin: 0; 103 font-size: 12px; 104 line-height: 18px; 105 margin: 0 0 0 2px; 73 106 padding: 0; 74 107 } 75 108 76 body.caught-early-errorli {109 .uncaught-exception-sheet li { 77 110 margin-bottom: 20px; 111 word-break: break-word; 78 112 } -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r192906 r193646 186 186 <link rel="stylesheet" href="Controllers/CodeMirrorTokenTrackingController.css"> 187 187 188 <link rel="stylesheet" href="Debug/ CatchEarlyErrors.css">189 190 <script src="Debug/ CatchEarlyErrors.js"></script>188 <link rel="stylesheet" href="Debug/UncaughtExceptionReporter.css"> 189 190 <script src="Debug/UncaughtExceptionReporter.js"></script> 191 191 192 192 <script src="External/CodeMirror/codemirror.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Protocol/MessageDispatcher.js
r188946 r193646 66 66 this._messagesToDispatch.push(message); 67 67 68 // If something has gone wrong and the uncaught exception sheet is showing, 69 // then don't try to dispatch more messages. Dispatching causes spurious uncaught 70 // exceptions and cause the sheet to overflow with hundreds of logged exceptions. 71 if (window.__uncaughtExceptions && window.__uncaughtExceptions.length) 72 return; 73 68 74 if (this._dispatchTimeout) 69 75 return;
Note: See TracChangeset
for help on using the changeset viewer.