Changeset 294166 in webkit
- Timestamp:
- May 13, 2022, 11:06:14 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 26 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/timeline/resources/timeline-event-utilities.js (modified) (2 diffs)
-
LayoutTests/inspector/timeline/timeline-event-screenshots-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-screenshots.html (added)
-
LayoutTests/inspector/timeline/timeline-recording-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/protocol/Timeline.json (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/TimelineRecordFactory.cpp (modified) (1 diff)
-
Source/WebCore/inspector/TimelineRecordFactory.h (modified) (1 diff)
-
Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp (modified) (7 diffs)
-
Source/WebCore/inspector/agents/InspectorTimelineAgent.h (modified) (4 diffs)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (modified) (8 diffs)
-
Source/WebInspectorUI/UserInterface/Base/Setting.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (modified) (3 diffs)
-
Source/WebInspectorUI/UserInterface/Images/IdentifierIcons.svg (modified) (3 diffs)
-
Source/WebInspectorUI/UserInterface/Main.html (modified) (3 diffs)
-
Source/WebInspectorUI/UserInterface/Models/Instrument.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Models/ScreenshotsInstrument.js (added)
-
Source/WebInspectorUI/UserInterface/Models/ScreenshotsTimelineRecord.js (added)
-
Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Test.html (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ContentView.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ScreenshotsTimelineOverviewGraph.css (added)
-
Source/WebInspectorUI/UserInterface/Views/ScreenshotsTimelineOverviewGraph.js (added)
-
Source/WebInspectorUI/UserInterface/Views/ScreenshotsTimelineView.css (added)
-
Source/WebInspectorUI/UserInterface/Views/ScreenshotsTimelineView.js (added)
-
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r294156 r294166 1 2022-05-13 Anjali Kumar <anjalik_22@apple.com> 2 3 Web Inspector: [Meta] Implement Timelines Film Strip 4 https://bugs.webkit.org/show_bug.cgi?id=239350 5 6 Reviewed by Devin Rousso and Patrick Angle. 7 8 * inspector/timeline/resources/timeline-event-utilities.js: 9 (TestPage.registerInitializer.InspectorTest.TimelineEvent.captureTimelineWithScript): 10 (TestPage.registerInitializer): 11 * inspector/timeline/timeline-event-screenshots-expected.txt: Added. 12 * inspector/timeline/timeline-event-screenshots.html: Added. 13 * inspector/timeline/timeline-recording-expected.txt: 14 1 15 2022-05-13 Tim Nguyen <ntim@apple.com> 2 16 -
trunk/LayoutTests/inspector/timeline/resources/timeline-event-utilities.js
r251856 r294166 6 6 InspectorTest.TimelineEvent = {}; 7 7 8 InspectorTest.TimelineEvent.captureTimelineWithScript = function({expression, eventType }) {8 InspectorTest.TimelineEvent.captureTimelineWithScript = function({expression, eventType, timelineType}) { 9 9 let savePageDataPromise = InspectorTest.awaitEvent("SavePageData").then((event) => { 10 10 return event.data; … … 16 16 if (WI.timelineManager.capturingState === WI.TimelineManager.CapturingState.Active) { 17 17 let recording = WI.timelineManager.activeRecording; 18 let scriptTimeline = recording.timelines.get(WI.TimelineRecord.Type.Script);18 let timeline = recording.timelines.get(timelineType ?? WI.TimelineRecord.Type.Script); 19 19 20 let recordAddedListener = scriptTimeline.addEventListener(WI.Timeline.Event.RecordAdded, (recordAddedEvent) => {20 let recordAddedListener = timeline.addEventListener(WI.Timeline.Event.RecordAdded, (recordAddedEvent) => { 21 21 let {record} = recordAddedEvent.data; 22 if ( record.eventType !== eventType)22 if (eventType && record.eventType !== eventType) 23 23 return; 24 24 25 scriptTimeline.removeEventListener(WI.Timeline.Event.RecordAdded, recordAddedListener);25 timeline.removeEventListener(WI.Timeline.Event.RecordAdded, recordAddedListener); 26 26 27 27 InspectorTest.log("Stopping Capture..."); -
trunk/LayoutTests/inspector/timeline/timeline-recording-expected.txt
r261121 r294166 36 36 "discontinuities": [], 37 37 "instrumentTypes": [ 38 "timeline-record-type-screenshots", 38 39 "timeline-record-type-network", 39 40 "timeline-record-type-layout", -
trunk/LayoutTests/platform/gtk/TestExpectations
r294146 r294166 1200 1200 webkit.org/b/147229 inspector/css/modify-rule-selector.html [ Skip ] # Timeout 1201 1201 1202 webkit.org/b/240349 inspector/timeline/timeline-event-screenshots.html [ Skip ] 1203 1202 1204 webkit.org/b/142292 fast/images/animated-gif-zooming.html [ Timeout ] 1203 1205 -
trunk/Source/JavaScriptCore/ChangeLog
r294154 r294166 1 2022-05-13 Anjali Kumar <anjalik_22@apple.com> 2 3 Web Inspector: [Meta] Implement Timelines Film Strip 4 https://bugs.webkit.org/show_bug.cgi?id=239350 5 6 Reviewed by Devin Rousso and Patrick Angle. 7 8 * inspector/protocol/Timeline.json: 9 1 10 2022-05-13 Lauro Moura <lmoura@igalia.com> 2 11 -
trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json
r251959 r294166 31 31 "CancelAnimationFrame", 32 32 "FireAnimationFrame", 33 "ObserverCallback" 33 "ObserverCallback", 34 "Screenshot" 34 35 ] 35 36 }, … … 44 45 "Memory", 45 46 "Heap", 46 "Animation" 47 "Animation", 48 "Screenshot" 47 49 ] 48 50 }, -
trunk/Source/WebCore/ChangeLog
r294164 r294166 1 2022-05-13 Anjali Kumar <anjalik_22@apple.com> 2 3 Web Inspector: [Meta] Implement Timelines Film Strip 4 https://bugs.webkit.org/show_bug.cgi?id=239350 5 6 Reviewed by Devin Rousso and Patrick Angle. 7 8 Test: inspector/timeline/timeline-event-screenshots.html 9 10 * inspector/TimelineRecordFactory.cpp: 11 (WebCore::TimelineRecordFactory::createScreenshotData): 12 * inspector/TimelineRecordFactory.h: 13 * inspector/agents/InspectorTimelineAgent.cpp: 14 (WebCore::InspectorTimelineAgent::didComposite): 15 (WebCore::InspectorTimelineAgent::willPaint): 16 (WebCore::InspectorTimelineAgent::didPaint): 17 (WebCore::InspectorTimelineAgent::toggleInstruments): 18 (WebCore::InspectorTimelineAgent::captureScreenshot): 19 (WebCore::toProtocol): 20 (WebCore::InspectorTimelineAgent::createRecordEntry): 21 (WebCore::InspectorTimelineAgent::pushCurrentRecord): 22 * inspector/agents/InspectorTimelineAgent.h: 23 1 24 2022-05-13 Michael Catanzaro <mcatanzaro@redhat.com> 2 25 -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r266885 r294166 162 162 } 163 163 164 Ref<JSON::Object> TimelineRecordFactory::createScreenshotData(const String& imageData, int width, int height) 165 { 166 Ref<JSON::Object> data = JSON::Object::create(); 167 data->setString("imageData"_s, imageData); 168 data->setInteger("width"_s, width); 169 data->setInteger("height"_s, height); 170 return data; 171 } 172 164 173 void TimelineRecordFactory::appendLayoutRoot(JSON::Object& data, const FloatQuad& quad) 165 174 { -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r266885 r294166 59 59 static Ref<JSON::Object> createObserverCallbackData(const String& callbackType); 60 60 static Ref<JSON::Object> createPaintData(const FloatQuad&); 61 static Ref<JSON::Object> createScreenshotData(const String& imageData, int width, int height); 61 62 62 63 static void appendLayoutRoot(JSON::Object& data, const FloatQuad&); -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
r287486 r294166 56 56 #include <JavaScriptCore/InspectorScriptProfilerAgent.h> 57 57 #include <JavaScriptCore/ScriptArguments.h> 58 #include <wtf/SetForScope.h> 58 59 #include <wtf/Stopwatch.h> 59 60 … … 424 425 didCompleteCurrentRecord(TimelineRecordType::Composite); 425 426 m_startedComposite = false; 427 428 if (m_instruments.contains(Protocol::Timeline::Instrument::Screenshot)) 429 captureScreenshot(); 426 430 } 427 431 428 432 void InspectorTimelineAgent::willPaint(Frame& frame) 429 433 { 434 if (m_isCapturingScreenshot) 435 return; 436 430 437 pushCurrentRecord(JSON::Object::create(), TimelineRecordType::Paint, true, &frame); 431 438 } … … 433 440 void InspectorTimelineAgent::didPaint(RenderObject& renderer, const LayoutRect& clipRect) 434 441 { 442 if (m_isCapturingScreenshot) 443 return; 444 435 445 if (m_recordStack.isEmpty()) 436 446 return; … … 579 589 toggleAnimationInstrument(state); 580 590 break; 591 case Protocol::Timeline::Instrument::Screenshot: { 592 break; 593 } 581 594 } 582 595 } … … 647 660 else 648 661 animationAgent->stopTracking(); 662 } 663 } 664 665 void InspectorTimelineAgent::captureScreenshot() 666 { 667 SetForScope isTakingScreenshot(m_isCapturingScreenshot, true); 668 669 auto snapshotStartTime = timestamp(); 670 auto& frame = m_inspectedPage.mainFrame(); 671 auto viewportRect = m_inspectedPage.mainFrame().view()->unobscuredContentRect(); 672 if (auto snapshot = snapshotFrameRect(frame, viewportRect, { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() })) { 673 auto snapshotRecord = TimelineRecordFactory::createScreenshotData(snapshot->toDataURL("image/png"_s), viewportRect.width(), viewportRect.height()); 674 pushCurrentRecord(WTFMove(snapshotRecord), TimelineRecordType::Screenshot, false, &frame, snapshotStartTime); 675 didCompleteCurrentRecord(TimelineRecordType::Screenshot); 649 676 } 650 677 } … … 738 765 case TimelineRecordType::ObserverCallback: 739 766 return Protocol::Timeline::EventType::ObserverCallback; 767 768 case TimelineRecordType::Screenshot: 769 return Protocol::Timeline::EventType::Screenshot; 740 770 } 741 771 … … 814 844 } 815 845 816 InspectorTimelineAgent::TimelineRecordEntry InspectorTimelineAgent::createRecordEntry(Ref<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame )817 { 818 Ref<JSON::Object> record = TimelineRecordFactory::createGenericRecord( timestamp(), captureCallStack ? m_maxCallStackDepth : 0);846 InspectorTimelineAgent::TimelineRecordEntry InspectorTimelineAgent::createRecordEntry(Ref<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame, std::optional<double> startTime) 847 { 848 Ref<JSON::Object> record = TimelineRecordFactory::createGenericRecord(startTime.value_or(timestamp()), captureCallStack ? m_maxCallStackDepth : 0); 819 849 setFrameIdentifier(&record.get(), frame); 820 850 return TimelineRecordEntry(WTFMove(record), WTFMove(data), JSON::Array::create(), type); 821 851 } 822 852 823 void InspectorTimelineAgent::pushCurrentRecord(Ref<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame )824 { 825 pushCurrentRecord(createRecordEntry(WTFMove(data), type, captureCallStack, frame ));853 void InspectorTimelineAgent::pushCurrentRecord(Ref<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame, std::optional<double> startTime) 854 { 855 pushCurrentRecord(createRecordEntry(WTFMove(data), type, captureCallStack, frame, startTime)); 826 856 } 827 857 -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h
r278253 r294166 80 80 81 81 ObserverCallback, 82 83 Screenshot, 82 84 }; 83 85 … … 156 158 void enableBreakpoints(); 157 159 160 void captureScreenshot(); 161 158 162 friend class TimelineRecordStack; 159 163 … … 179 183 void sendEvent(Ref<JSON::Object>&&); 180 184 void appendRecord(Ref<JSON::Object>&& data, TimelineRecordType, bool captureCallStack, Frame*); 181 void pushCurrentRecord(Ref<JSON::Object>&&, TimelineRecordType, bool captureCallStack, Frame* );185 void pushCurrentRecord(Ref<JSON::Object>&&, TimelineRecordType, bool captureCallStack, Frame*, std::optional<double> startTime = std::nullopt); 182 186 void pushCurrentRecord(const TimelineRecordEntry& record) { m_recordStack.append(record); } 183 187 184 TimelineRecordEntry createRecordEntry(Ref<JSON::Object>&& data, TimelineRecordType, bool captureCallStack, Frame* );188 TimelineRecordEntry createRecordEntry(Ref<JSON::Object>&& data, TimelineRecordType, bool captureCallStack, Frame*, std::optional<double> startTime = std::nullopt); 185 189 186 190 void setFrameIdentifier(JSON::Object* record, Frame*); … … 217 221 #endif 218 222 bool m_startedComposite { false }; 223 bool m_isCapturingScreenshot { false }; 219 224 }; 220 225 -
trunk/Source/WebInspectorUI/ChangeLog
r293727 r294166 1 2022-05-13 Anjali Kumar <anjalik_22@apple.com> 2 3 Web Inspector: [Meta] Implement Timelines Film Strip 4 https://bugs.webkit.org/show_bug.cgi?id=239350 5 6 Reviewed by Devin Rousso and Patrick Angle. 7 8 Add the ability to see screenshots taken of the viewport within the Timelines tab. The purpose of the 9 screenshots is to provide more context to the other data presented within the Timelines tab, so that 10 developers can improve the efficiency of their page loading times. They can see what is painting on their 11 pages in addition to when the paints are occuring. 12 13 The screenshots presented are taken immediately after each composite. They are designed to be layered 14 on top of one another as opposed to being presented in a non-overlapping fashion in order to provide developers 15 with the exact screenshot that occured during a particular point in time on the timeline. This allows developers 16 to zoom in and pinpoint the exact moment the page looked like that particularly rendered screenshot. 17 18 When a screenshot is clicked on, the details section opens up to an enlarged view of that particular image. 19 Developers can utilize this to view each screenshot in greater detail. 20 21 This feature is named "Screenshots" (one word), as in the UI we currently have existing strings for "Capture 22 Screenshot" and "Could not capture screenshot". 23 24 * Localizations/en.lproj/localizedStrings.js: 25 * UserInterface/Base/Setting.js: 26 * UserInterface/Controllers/TimelineManager.js: 27 (WI.TimelineManager.defaultTimelineTypes): 28 (WI.TimelineManager.prototype._processRecord): 29 (WI.TimelineManager.prototype._updateAutoCaptureInstruments): 30 * UserInterface/Images/IdentifierIcons.svg: 31 * UserInterface/Main.html: 32 * UserInterface/Models/Instrument.js: 33 (WI.Instrument.createForTimelineType): 34 * UserInterface/Models/ScreenshotsInstrument.js: Added. 35 (WI.ScreenshotsInstrument): 36 (WI.ScreenshotsInstrument.supported): 37 (WI.ScreenshotsInstrument.prototype.get timelineRecordType): 38 * UserInterface/Models/ScreenshotsTimelineRecord.js: Added. 39 (WI.ScreenshotsTimelineRecord): 40 (WI.ScreenshotsTimelineRecord.async fromJSON): 41 (WI.ScreenshotsTimelineRecord.prototype.toJSON): 42 (WI.ScreenshotsTimelineRecord.prototype.get imageData): 43 (WI.ScreenshotsTimelineRecord.prototype.get width): 44 (WI.ScreenshotsTimelineRecord.prototype.get height): 45 * UserInterface/Models/TimelineRecord.js: 46 (WI.TimelineRecord.async fromJSON): 47 * UserInterface/Models/TimelineRecording.js: 48 (WI.TimelineRecording.prototype.addRecord): 49 * UserInterface/Test.html: 50 * UserInterface/Views/ContentView.js: 51 (WI.ContentView.createFromRepresentedObject): 52 * UserInterface/Views/ScreenshotsTimelineOverviewGraph.css: Added. 53 (body .sidebar > .panel.navigation.timeline > .timelines-content li.item.screenshots,): 54 (.timeline-overview-graph.screenshots > img): 55 (.timeline-overview-graph.screenshots > img.selected): 56 * UserInterface/Views/ScreenshotsTimelineOverviewGraph.js: Added. 57 (WI.ScreenshotsTimelineOverviewGraph): 58 (WI.ScreenshotsTimelineOverviewGraph.prototype.get height): 59 (WI.ScreenshotsTimelineOverviewGraph.prototype.layout): 60 (WI.ScreenshotsTimelineOverviewGraph.prototype.updateSelectedRecord): 61 (WI.ScreenshotsTimelineOverviewGraph.prototype._visibleRecords): 62 * UserInterface/Views/ScreenshotsTimelineView.css: Added. 63 (.timeline-view.screenshots): 64 (.timeline-view.screenshots > img): 65 (.timeline-view.screenshots > img.selected): 66 * UserInterface/Views/ScreenshotsTimelineView.js: Added. 67 (WI.ScreenshotsTimelineView): 68 (WI.ScreenshotsTimelineView.prototype.reset): 69 (WI.ScreenshotsTimelineView.prototype.clear): 70 (WI.ScreenshotsTimelineView.prototype.get showsFilterBar): 71 (WI.ScreenshotsTimelineView.prototype.layout): 72 (WI.ScreenshotsTimelineView.prototype.selectRecord): 73 (WI.ScreenshotsTimelineView.prototype._selectTimelineRecord): 74 (WI.ScreenshotsTimelineView.prototype._visibleRecords): 75 * UserInterface/Views/SettingsTabContentView.js: 76 (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): 77 * UserInterface/Views/TimelineIcons.css: 78 (.screenshots-icon .icon): 79 (@media (prefers-color-scheme: dark) .screenshots-icon .icon): 80 * UserInterface/Views/TimelineOverviewGraph.js: 81 (WI.TimelineOverviewGraph.createForTimeline): 82 * UserInterface/Views/TimelineTabContentView.js: 83 (WI.TimelineTabContentView.displayNameForTimelineType): 84 (WI.TimelineTabContentView.iconClassNameForTimelineType): 85 (WI.TimelineTabContentView.genericClassNameForTimelineType): 86 (WI.TimelineTabContentView.iconClassNameForRecord): 87 (WI.TimelineTabContentView.displayNameForRecord): 88 1 89 2022-05-03 Patrick Angle <pangle@apple.com> 2 90 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r293409 r294166 106 106 localizedStrings["2D"] = "2D"; 107 107 localizedStrings["720p"] = "720p"; 108 /* Text indicating that the local override intercepts the request phase of network activity. */108 /* Text indicating that the local override will block the network activity with an access error. */ 109 109 localizedStrings["Access Control @ Local Override Type"] = "Access Control"; 110 110 localizedStrings["Accessibility"] = "Accessibility"; … … 281 281 /* Tooltip for a timestamp marker that represents when a CSS animation/transition is canceled */ 282 282 localizedStrings["Canceled"] = "Canceled"; 283 /* Text indicating that the local override will always block the network activity. */283 /* Text indicating that the local override will block the network activity with a cancellation error. */ 284 284 localizedStrings["Cancellation @ Local Override Type"] = "Cancellation"; 285 285 localizedStrings["Canvas"] = "Canvas"; … … 606 606 localizedStrings["Enable Inspector Bootstrap Script"] = "Enable Inspector Bootstrap Script"; 607 607 localizedStrings["Enable Local Override"] = "Enable Local Override"; 608 localizedStrings["Enable Preview Features"] = "Enable Preview Features";609 608 localizedStrings["Enable Program"] = "Enable Program"; 610 609 localizedStrings["Enable Rule"] = "Enable Rule"; … … 733 732 localizedStrings["Garbage Collection"] = "Garbage Collection"; 734 733 localizedStrings["General"] = "General"; 735 /* Text indicating that the local override intercepts the response phase of network activity. */734 /* Text indicating that the local override will block the network activity with a general error. */ 736 735 localizedStrings["General @ Local Override Type"] = "General"; 737 736 localizedStrings["Getter"] = "Getter"; … … 1306 1305 localizedStrings["Screen Shot %s-%s-%s at %s.%s.%s"] = "Screen Shot %s-%s-%s at %s.%s.%s"; 1307 1306 localizedStrings["Screen size:"] = "Screen size:"; 1307 localizedStrings["Screenshots"] = "Screenshots"; 1308 1308 localizedStrings["Script"] = "Script"; 1309 1309 localizedStrings["Script Element %d"] = "Script Element %d"; … … 1382 1382 localizedStrings["Show Remaining (%d)"] = "Show Remaining (%d)"; 1383 1383 localizedStrings["Show Scope Chain on pause"] = "Show Scope Chain on pause"; 1384 localizedStrings["Show Screenshots"] = "Show Screenshots"; 1384 1385 localizedStrings["Show all actions"] = "Show all actions"; 1385 1386 localizedStrings["Show all resources"] = "Show all resources"; … … 1443 1444 /* Property value for `font-variant-numeric: stacked-fractions`. */ 1444 1445 localizedStrings["Stacked Fractions @ Font Details Sidebar Property Value"] = "Stacked Fractions"; 1445 localizedStrings["Staging:"] = "Staging:";1446 1446 localizedStrings["Stalled"] = "Stalled"; 1447 1447 localizedStrings["Start"] = "Start"; … … 1587 1587 /* Name of Timelines Tab */ 1588 1588 localizedStrings["Timelines Tab Name"] = "Timelines"; 1589 /* Text indicating that the local override will skip all network activity and instead immediately serve the response. */ 1589 localizedStrings["Timelines:"] = "Timelines:"; 1590 /* Text indicating that the local override will block the network activity with an timeout error. */ 1590 1591 localizedStrings["Timeout @ Local Override Type"] = "Timeout"; 1591 1592 localizedStrings["Timer %d Fired"] = "Timer %d Fired"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r292156 r294166 233 233 experimentalAllowInspectingInspector: new WI.Setting("experimental-allow-inspecting-inspector", false), 234 234 experimentalCSSCompletionFuzzyMatching: new WI.Setting("experimental-css-completion-fuzzy-matching", true), 235 experimentalShowScreenshotsTimeline: new WI.Setting("experimental-show-screenshots-timeline", false), 235 236 236 237 // Protocol -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r269359 r294166 118 118 } 119 119 120 let defaultTypes = [ 121 WI.TimelineRecord.Type.Network, 122 WI.TimelineRecord.Type.Layout, 123 WI.TimelineRecord.Type.Script, 124 WI.TimelineRecord.Type.RenderingFrame, 125 ]; 120 let defaultTypes = []; 121 122 if (WI.ScreenshotsInstrument.supported()) 123 defaultTypes.push(WI.TimelineRecord.Type.Screenshots); 124 125 defaultTypes.push(WI.TimelineRecord.Type.Network); 126 defaultTypes.push(WI.TimelineRecord.Type.Layout); 127 defaultTypes.push(WI.TimelineRecord.Type.Script); 128 defaultTypes.push(WI.TimelineRecord.Type.RenderingFrame); 126 129 127 130 if (WI.CPUInstrument.supported()) … … 987 990 return new WI.ScriptTimelineRecord(WI.ScriptTimelineRecord.EventType.AnimationFrameCanceled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.id); 988 991 992 case InspectorBackend.Enum.Timeline.EventType.Screenshot: 993 console.assert(isNaN(endTime)); 994 995 return new WI.ScreenshotsTimelineRecord(startTime, recordPayload.data.imageData, recordPayload.data.width, recordPayload.data.height); 996 989 997 default: 990 998 console.error("Missing handling of Timeline Event Type: " + recordPayload.type); … … 1345 1353 instrumentSet.add(InspectorBackend.Enum.Timeline.Instrument.CPU); 1346 1354 break; 1355 case WI.TimelineRecord.Type.Screenshots: 1356 instrumentSet.add(InspectorBackend.Enum.Timeline.Instrument.Screenshot); 1357 break; 1347 1358 case WI.TimelineRecord.Type.Memory: 1348 1359 instrumentSet.add(InspectorBackend.Enum.Timeline.Instrument.Memory); -
trunk/Source/WebInspectorUI/UserInterface/Images/IdentifierIcons.svg
r258039 r294166 29 29 30 30 .dark.red { 31 --fill: hsl(359, 69%, 25%); 32 --outline: hsl(357, 77%, 59%); 33 } 34 35 .light.pink { 36 --fill: hsl(360, 64%, 75%); 37 --stroke: hsl(360, 54%, 62%); 38 --outline: hsl(360, 54%, 62%); 39 } 40 41 .dark.pink { 31 42 --fill: hsl(359, 69%, 25%); 32 43 --outline: hsl(357, 77%, 59%); … … 132 143 </symbol> 133 144 145 <symbol id="screenshot" viewBox="0 0 16 16"> 146 <path d="M10.5,4.94 L10.1875,4.26205342 C10.1875,4.26205342 9.92668194,3.69 9.5625,3.69 L6.4375,3.69 C6.07272974,3.69 5.8125,4.2620534 5.8125,4.2620534 L5.5,4.94 L4.48858987,4.94 C4.48858987,4.94 3.3125,5.03898711 3.3125,6.19 L3.3125,10.565 C3.3125,11.7160129 4.48858987,11.815 4.48858987,11.815 L11.4375,11.815 C11.4375,11.815 12.6875,11.7160129 12.6875,10.565 L12.6875,6.19 C12.6875,5.03898711 11.4375,4.94 11.4375,4.94 L10.5,4.94 Z" fill="white" stroke="var(--stroke)" stroke-width="0.625"/> 147 <path d="M8,10.565 C9.38071187,10.565 10.5,9.44571188 10.5,8.065 C10.5,6.68428812 9.38071187,5.565 8,5.565 C6.61928812,5.565 5.5,6.68428812 5.5,8.065 C5.5,9.44571188 6.61928812,10.565 8,10.565 Z" fill="white" stroke="var(--stroke)" stroke-width="0.625"/> 148 <path d="M8,9.315 C8.69035594,9.315 9.25,8.75535594 9.25,8.065 C9.25,7.37464406 8.69035594,6.815 8,6.815 C7.30964406,6.815 6.75,7.37464406 6.75,8.065 C6.75,8.75535594 7.30964406,9.315 8,9.315 Z" fill="white" stroke="var(--stroke)" stroke-width="0.625"/> 149 </symbol> 150 134 151 <symbol id="barchart" viewBox="0 0 16 16"> 135 152 <rect stroke-linejoin="round" fill="white" x="9.5" y="4" width="3" height="8" stroke="var(--stroke)"/> … … 166 183 <g id="RenderingFramesInstrument-light" class="light red"><use href="#circle"/><use href="#barchart"/></g> 167 184 <g id="RenderingFramesInstrument-dark" class="dark red"><use href="#circle"/><use href="#barchart"/></g> 185 <g id="ScreenshotsInstrument-light" class="light pink"><use href="#circle"/><use href="#screenshot"/></g> 186 <g id="ScreenshotsInstrument-dark" class="dark pink"><use href="#circle"/><use href="#screenshot"/></g> 168 187 <g id="ScriptsInstrument-light" class="light purple"><use href="#circle"/><use href="#script"/></g> 169 188 <g id="ScriptsInstrument-dark" class="dark purple"><use href="#circle"/><use href="#script"/></g> -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r292781 r294166 209 209 <link rel="stylesheet" href="Views/ScopeBar.css"> 210 210 <link rel="stylesheet" href="Views/ScopeChainDetailsSidebarPanel.css"> 211 <link rel="stylesheet" href="Views/ScreenshotsTimelineOverviewGraph.css"> 212 <link rel="stylesheet" href="Views/ScreenshotsTimelineView.css"> 211 213 <link rel="stylesheet" href="Views/ScriptContentView.css"> 212 214 <link rel="stylesheet" href="Views/ScriptDetailsTimelineView.css"> … … 492 494 <script src="Models/Revision.js"></script> 493 495 <script src="Models/ScopeChainNode.js"></script> 496 <script src="Models/ScreenshotsInstrument.js"></script> 497 <script src="Models/ScreenshotsTimelineRecord.js"></script> 494 498 <script src="Models/ScriptInstrument.js"></script> 495 499 <script src="Models/ScriptSyntaxTree.js"></script> … … 843 847 <script src="Views/ScopeBarItem.js"></script> 844 848 <script src="Views/ScopeChainDetailsSidebarPanel.js"></script> 849 <script src="Views/ScreenshotsTimelineOverviewGraph.js"></script> 850 <script src="Views/ScreenshotsTimelineView.js"></script> 845 851 <script src="Views/ScriptClusterTimelineView.js"></script> 846 852 <script src="Views/ScriptContentView.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Instrument.js
r251227 r294166 47 47 case WI.TimelineRecord.Type.Media: 48 48 return new WI.MediaInstrument; 49 case WI.TimelineRecord.Type.Screenshots: 50 return new WI.ScreenshotsInstrument; 49 51 default: 50 52 console.error("Unknown TimelineRecord.Type: " + type); -
trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js
r251959 r294166 64 64 case WI.TimelineRecord.Type.Media: 65 65 return WI.MediaTimelineRecord.fromJSON(json); 66 case WI.TimelineRecord.Type.Screenshots: 67 return WI.ScreenshotsTimelineRecord.fromJSON(json); 66 68 default: 67 69 console.error("Unknown TimelineRecord.Type: " + json.type, json); … … 206 208 HeapAllocations: "timeline-record-type-heap-allocations", 207 209 Media: "timeline-record-type-media", 210 Screenshots: "timeline-record-type-screenshots", 208 211 }; 209 212 -
trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
r261108 r294166 340 340 || record.type === WI.TimelineRecord.Type.CPU 341 341 || record.type === WI.TimelineRecord.Type.Memory 342 || record.type === WI.TimelineRecord.Type.HeapAllocations) 342 || record.type === WI.TimelineRecord.Type.HeapAllocations 343 || record.type === WI.TimelineRecord.Type.Screenshots) 343 344 return; 344 345 -
trunk/Source/WebInspectorUI/UserInterface/Test.html
r292781 r294166 215 215 <script src="Models/Revision.js"></script> 216 216 <script src="Models/ScopeChainNode.js"></script> 217 <script src="Models/ScreenshotsInstrument.js"></script> 218 <script src="Models/ScreenshotsTimelineRecord.js"></script> 217 219 <script src="Models/ScriptInstrument.js"></script> 218 220 <script src="Models/ScriptSyntaxTree.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js
r293409 r294166 101 101 if (timelineType === WI.TimelineRecord.Type.Media) 102 102 return new WI.MediaTimelineView(representedObject, extraArguments); 103 104 if (timelineType === WI.TimelineRecord.Type.Screenshots) 105 return new WI.ScreenshotsTimelineView(representedObject, extraArguments); 103 106 } 104 107 -
trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
r292156 r294166 401 401 experimentalSettingsView.addSeparator(); 402 402 403 let timelinesGroup = experimentalSettingsView.addGroup(WI.UIString("Timelines:")); 404 timelinesGroup.addSetting(WI.settings.experimentalShowScreenshotsTimeline, WI.UIString("Show Screenshots")); 405 403 406 let reloadInspectorButton = document.createElement("button"); 404 407 reloadInspectorButton.textContent = WI.UIString("Reload Web Inspector"); … … 416 419 }, reloadInspectorContainerElement); 417 420 } 421 422 listenForChange(WI.settings.experimentalShowScreenshotsTimeline); 418 423 419 424 if (hasCSSDomain) { -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css
r258039 r294166 36 36 } 37 37 38 .screenshots-icon .icon { 39 content: url(../Images/IdentifierIcons.svg#ScreenshotsInstrument-light); 40 } 41 38 42 .memory-icon .icon { 39 43 content: url(../Images/IdentifierIcons.svg#MemoryInstrument-light); … … 155 159 } 156 160 161 .screenshots-icon .icon { 162 content: url(../Images/IdentifierIcons.svg#ScreenshotsInstrument-dark); 163 } 164 157 165 .memory-icon .icon { 158 166 content: url(../Images/IdentifierIcons.svg#MemoryInstrument-dark); -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js
r270134 r294166 76 76 return new WI.MediaTimelineOverviewGraph(timeline, timelineOverview); 77 77 78 if (timelineType === WI.TimelineRecord.Type.Screenshots) 79 return new WI.ScreenshotsTimelineOverviewGraph(timeline, timelineOverview); 80 78 81 throw new Error("Can't make a graph for an unknown timeline."); 79 82 } -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js
r270134 r294166 133 133 return WI.UIString("Media & Animations"); 134 134 return WI.UIString("Media"); 135 case WI.TimelineRecord.Type.Screenshots: 136 return WI.UIString("Screenshots"); 135 137 default: 136 138 console.error("Unknown Timeline type:", timelineType); … … 159 161 case WI.TimelineRecord.Type.Media: 160 162 return "media-icon"; 163 case WI.TimelineRecord.Type.Screenshots: 164 return "screenshots-icon"; 161 165 default: 162 166 console.error("Unknown Timeline type:", timelineType); … … 185 189 case WI.TimelineRecord.Type.Media: 186 190 return "media"; 191 case WI.TimelineRecord.Type.Screenshots: 192 return "screenshots"; 187 193 default: 188 194 console.error("Unknown Timeline type:", timelineType); … … 267 273 case WI.TimelineRecord.Type.CPU: 268 274 case WI.TimelineRecord.Type.Memory: 275 case WI.TimelineRecord.Type.Screenshots: 269 276 // Not used. Fall through to error just in case. 270 277 … … 303 310 case WI.TimelineRecord.Type.CPU: 304 311 case WI.TimelineRecord.Type.Memory: 312 case WI.TimelineRecord.Type.Screenshots: 305 313 // Not used. Fall through to error just in case. 306 314 default:
Note:
See TracChangeset
for help on using the changeset viewer.