forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 8
Add a screenshot timeline to the timelines panel. Screenshots are captured automatically every second during recording. #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
madonk
wants to merge
2
commits into
burg:timelapse
Choose a base branch
from
madonk:screenshots
base: timelapse
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+456 Bytes
(100%)
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Source/WebInspectorUI/UserInterface/ScreenshotTimelineDataGrid.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright (C) 2013 University of Washington. All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions | ||
| * are met: | ||
| * 1. Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in the | ||
| * documentation and/or other materials provided with the distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGrid = function(columns) | ||
| { | ||
| WebInspector.TimelineDataGrid.call(this, columns); | ||
|
|
||
| this.element.classList.add(WebInspector.ScreenshotTimelineDataGrid.ScreenshotDataGridStyleClassName); | ||
| } | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGrid.ScreenshotDataGridStyleClassName = "screenshot-data-grid"; | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGrid.prototype = { | ||
| constructor: WebInspector.ScreenshotTimelineDataGrid, | ||
| __proto__: WebInspector.TimelineDataGrid.prototype, | ||
|
|
||
| // Protected | ||
|
|
||
| callFramePopoverAnchorElement: function() | ||
| { | ||
| return this.selectedNode.elementWithColumnIdentifier("image"); | ||
| } | ||
| } |
99 changes: 99 additions & 0 deletions
99
Source/WebInspectorUI/UserInterface/ScreenshotTimelineDataGridNode.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| /* | ||
| * Copyright (C) 2013 University of Washington. All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions | ||
| * are met: | ||
| * 1. Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in the | ||
| * documentation and/or other materials provided with the distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGridNode = function(screenshotTimelineRecord, baseStartTime) | ||
| { | ||
| WebInspector.DataGridNode.call(this, {}); | ||
|
|
||
| this._record = screenshotTimelineRecord; | ||
| this._baseStartTime = baseStartTime || 0; | ||
| }; | ||
|
|
||
| WebInspector.Object.addConstructorFunctions(WebInspector.ScreenshotTimelineDataGridNode); | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGridNode.IconStyleClassName = "icon"; | ||
| WebInspector.ScreenshotTimelineDataGridNode.SubtitleStyleClassName = "subtitle"; | ||
| WebInspector.ScreenshotTimelineDataGridNode.EmptyImagePlaceholder = "Images/DocumentImage.png"; | ||
| WebInspector.ScreenshotTimelineDataGridNode.EmptyStringPlaceholder = "\u2014"; | ||
| WebInspector.ScreenshotTimelineDataGridNode.ScreenshotStyleClassName = "screenshot"; | ||
| WebInspector.ScreenshotTimelineDataGridNode.EmptyScreenshotStyleClassName = "empty"; | ||
|
|
||
| WebInspector.ScreenshotTimelineDataGridNode.prototype = { | ||
| constructor: WebInspector.ScreenshotTimelineDataGridNode, | ||
| __proto__: WebInspector.DataGridNode.prototype, | ||
|
|
||
| // Public | ||
|
|
||
| get record() | ||
| { | ||
| return this._record; | ||
| }, | ||
|
|
||
| get data() | ||
| { | ||
| return this._record; | ||
| }, | ||
|
|
||
| createCellContent: function(columnIdentifier, cell) | ||
| { | ||
| var emptyString = WebInspector.ScreenshotTimelineDataGridNode.EmptyStringPlaceholder; | ||
| var value = this.data[columnIdentifier]; | ||
|
|
||
| switch (columnIdentifier) { | ||
| case "eventType": | ||
| return WebInspector.ScreenshotTimelineRecord.EventType.displayName(value); | ||
|
|
||
| case "image": | ||
| var source = value; | ||
| var image = document.createElement("img"); | ||
| image.classList.add(WebInspector.ScreenshotTimelineDataGridNode.ScreenshotStyleClassName); | ||
|
|
||
| if (!source) { | ||
| image.src = WebInspector.ScreenshotTimelineDataGridNode.EmptyImagePlaceholder; | ||
| image.classList.add(WebInspector.ScreenshotTimelineDataGridNode.EmptyScreenshotStyleClassName); | ||
| } else { | ||
| image.src = source; | ||
| } | ||
|
|
||
| return image; | ||
|
|
||
| case "x": | ||
| case "y": | ||
| return isNaN(value) ? emptyString : WebInspector.UIString("%d").format(value); | ||
|
|
||
| case "width": | ||
| case "height": | ||
| return isNaN(value) ? emptyString : WebInspector.UIString("%fpx").format(value); | ||
|
|
||
| case "area": | ||
| return isNaN(value) ? emptyString : WebInspector.UIString("%fpx²").format(value); | ||
|
|
||
| case "startTime": | ||
| return isNaN(value) ? emptyString : Number.secondsToString(value - this._baseStartTime); | ||
| } | ||
|
|
||
| return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier); | ||
| } | ||
| } |
94 changes: 94 additions & 0 deletions
94
Source/WebInspectorUI/UserInterface/ScreenshotTimelineRecord.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
|
|
||
| /* | ||
| * Copyright (C) 2013 University of Washington. All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions | ||
| * are met: | ||
| * 1. Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in the | ||
| * documentation and/or other materials provided with the distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
| * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| WebInspector.ScreenshotTimelineRecord = function(startTime, image, x, y, width, height) | ||
| { | ||
| WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Screenshot, startTime, startTime); | ||
|
|
||
| this._startTime = startTime || NaN; | ||
| this._x = x || NaN; | ||
| this._y = y || NaN; | ||
| this._width = width || NaN; | ||
| this._height = height || NaN; | ||
| this._image = image; | ||
| }; | ||
|
|
||
| WebInspector.ScreenshotTimelineRecord.EventType = { | ||
| ImageCaptured: "screenshot-image-captured" | ||
| }; | ||
|
|
||
| WebInspector.ScreenshotTimelineRecord.EventType.displayName = function(eventType) | ||
| { | ||
| return WebInspector.UIString("Image Captured"); | ||
| }; | ||
|
|
||
| WebInspector.ScreenshotTimelineRecord.prototype = { | ||
| constructor: WebInspector.ScreenshotTimelineRecord, | ||
|
|
||
| // Public | ||
|
|
||
| get eventType() | ||
| { | ||
| return WebInspector.ScreenshotTimelineRecord.EventType.ImageCaptured; | ||
| }, | ||
|
|
||
| get startTime() | ||
| { | ||
| return this._startTime; | ||
| }, | ||
|
|
||
| get x() | ||
| { | ||
| return this._x; | ||
| }, | ||
|
|
||
| get y() | ||
| { | ||
| return this._y; | ||
| }, | ||
|
|
||
| get width() | ||
| { | ||
| return this._width; | ||
| }, | ||
|
|
||
| get height() | ||
| { | ||
| return this._height; | ||
| }, | ||
|
|
||
| get area() | ||
| { | ||
| return this._width * this._height; | ||
| }, | ||
|
|
||
| get image() | ||
| { | ||
| return this._image; | ||
| } | ||
| }; | ||
|
|
||
| WebInspector.ScreenshotTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reset this to remove the whitespace changes, so I'm not sure if my version was just out of date or not….