<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164543] trunk/Source/WebInspectorUI</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164543">164543</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2014-02-22 09:33:44 -0800 (Sat, 22 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Organize WebInspectorUI/UserInterface into sub-directories.
https://bugs.webkit.org/show_bug.cgi?id=129194
Rubber-stamped by Joseph Pecoraro.
* Scripts/copy-user-interface-resources.sh: Fix Image URLs and Protocol paths.
* UserInterface/Base: Added.
* UserInterface/Controllers: Added.
* UserInterface/Images: Added.
* UserInterface/Main.html: Updated.
* UserInterface/Models Added.
* UserInterface/Protocol Added.
* UserInterface/Views: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcessh">trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptsupdateInspectorBackendCommandsrb">trunk/Source/WebInspectorUI/Scripts/update-InspectorBackendCommands.rb</a></li>
<li><a href="#trunkSourceWebInspectorUIScriptsupdateprettyprinterrb">trunk/Source/WebInspectorUI/Scripts/update-pretty-printer.rb</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebInspectorUI/UserInterface/Base/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseDOMUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseEventHandlerjs">trunk/Source/WebInspectorUI/UserInterface/Base/EventHandler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseEventListenerSetjs">trunk/Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseImageUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/ImageUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseLoadLocalizedStringsjs">trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMIMETypeUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseObjectjs">trunk/Source/WebInspectorUI/UserInterface/Base/Object.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseURLUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseWebInspectorjs">trunk/Source/WebInspectorUI/UserInterface/Base/WebInspector.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Controllers/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersApplicationCacheManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersBranchManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/BranchManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCSSStyleManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorColorEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorColorEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllercss">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorDragToAdjustNumberControllercss">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorDragToAdjustNumberControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorGradientEditingControllercss">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorGradientEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorTokenTrackingControllercss">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorTokenTrackingControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDOMTreeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDragToAdjustControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DragToAdjustController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersFormatterjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/Formatter.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersFormatterContentBuilderjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersFormatterSourceMapjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersFrameResourceManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersIssueManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/IssueManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptLogViewControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptRuntimeCompletionProviderjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersLayerTreeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersLegacyProfileManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/LegacyProfileManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersProbeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersRuntimeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersSourceMapManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersStorageManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Models/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsApplicationCacheFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsApplicationCacheManifestjs">trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheManifest.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsBackForwardEntryjs">trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsBranchjs">trunk/Source/WebInspectorUI/UserInterface/Models/Branch.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsBreakpointjs">trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsBreakpointActionjs">trunk/Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSCompletionsjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSKeywordCompletionsjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSMediajs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSMedia.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSPropertyjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSRulejs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleSheetjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCallFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsColorjs">trunk/Source/WebInspectorUI/UserInterface/Models/Color.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsContentFlowjs">trunk/Source/WebInspectorUI/UserInterface/Models/ContentFlow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCookieStorageObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMSearchMatchObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMStorageObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMStorageObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMTreejs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDatabaseObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDatabaseTableObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseTableObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextjs">trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextListjs">trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsGeometryjs">trunk/Source/WebInspectorUI/UserInterface/Models/Geometry.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsGradientjs">trunk/Source/WebInspectorUI/UserInterface/Models/Gradient.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabasejs">trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabase.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabaseObjectStorejs">trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStore.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabaseObjectStoreIndexjs">trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStoreIndex.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsIssueMessagejs">trunk/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsKeyboardShortcutjs">trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsLayoutTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsLogObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/LogObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsNetworkTimelinejs">trunk/Source/WebInspectorUI/UserInterface/Models/NetworkTimeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProbejs">trunk/Source/WebInspectorUI/UserInterface/Models/Probe.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProbeSetjs">trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProbeSetDataFramejs">trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProbeSetDataTablejs">trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProfilejs">trunk/Source/WebInspectorUI/UserInterface/Models/Profile.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProfileNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsProfileNodeCalljs">trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNodeCall.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsResourcejs">trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsResourceCollectionjs">trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsResourceSearchMatchObjectjs">trunk/Source/WebInspectorUI/UserInterface/Models/ResourceSearchMatchObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsResourceTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsRevisionjs">trunk/Source/WebInspectorUI/UserInterface/Models/Revision.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScopeChainNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptjs">trunk/Source/WebInspectorUI/UserInterface/Models/Script.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSettingjs">trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodejs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeLocationjs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodePositionjs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodePosition.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeRevisionjs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeRevision.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeTextRangejs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTextRange.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeTimelinejs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTimeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceMapjs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceMapResourcejs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTextMarkerjs">trunk/Source/WebInspectorUI/UserInterface/Models/TextMarker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTextRangejs">trunk/Source/WebInspectorUI/UserInterface/Models/TextRange.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelinejs">trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineMarkerjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsUnitBezierjs">trunk/Source/WebInspectorUI/UserInterface/Models/UnitBezier.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Protocol/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolApplicationCacheObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/ApplicationCacheObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolCSSObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolConsoleObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolDOMObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolDOMStorageObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMStorageObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolDatabaseObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/DatabaseObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolDebuggerObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorBackendjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorFrontendAPIjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorFrontendHostStubjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendHostStub.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorJSBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorJSBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolInspectorWebBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorWebBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLayerTreeObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/LayerTreeObserver.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLegacyProfilerObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/LegacyProfilerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLoadInspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolMessageDispatcherjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/MessageDispatcher.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolNetworkObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolPageObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolRuntimeObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Views/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsActivateButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsActivateButtonToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheManifestTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheManifestTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBoxModelDetailsSectionRowcss">trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBoxModelDetailsSectionRowjs">trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBreakpointcss">trunk/Source/WebInspectorUI/UserInterface/Views/Breakpoint.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBreakpointActionViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBreakpointActionViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBreakpointTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectioncss">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCallFrameIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCallFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsClusterContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorAdditionsjs">trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorFormattersjs">trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorOverridescss">trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorOverrides.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsColorPickercss">trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsColorPickerjs">trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsColorWheelcss">trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsColorWheeljs">trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandResultjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleGroupjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessagejs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsolePromptcss">trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsolePromptjs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentBrowsercss">trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentBrowserjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentFlowDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowDOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentFlowIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentFlowTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewContainercss">trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewContainerjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContextMenujs">trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenu.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsControlToolbarItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsControlToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCookieIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/CookieIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMNodeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeUpdaterjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDataGridcss">trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseHostTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseHostTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectioncss">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionDataGridRowjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionDataGridRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionGroupjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionPropertiesRowjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionPropertiesRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionRowjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionSimpleRowjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsEditingcss">trunk/Source/WebInspectorUI/UserInterface/Views/Editing.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsEditingSupportjs">trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionGroupcss">trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionGroupjs">trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFilterBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFilterBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFindBannercss">trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFindBannerjs">trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFolderIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/FolderIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFolderTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFrameContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/FrameContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFrameDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElementPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGenericResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/GenericResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogcss">trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogjs">trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGradientSlidercss">trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGradientSliderjs">trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathComponentcss">trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHoverMenucss">trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHoverMenujs">trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsImageResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsImageResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndeterminateProgressSpinnercss">trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndeterminateProgressSpinnerjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseEntryDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseEntryDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseHostTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseHostTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreIndexTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyBottomUpProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyBottomUpProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyTopDownProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyTopDownProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogIconcss">trunk/Source/WebInspectorUI/UserInterface/Views/LogIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/LogTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsMaincss">trunk/Source/WebInspectorUI/UserInterface/Views/Main.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsMetricsStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/MetricsStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPathComponentIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPopovercss">trunk/Source/WebInspectorUI/UserInterface/Views/Popover.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPopoverjs">trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridcss">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProfileNodeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProfileNodeTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolecss">trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejs">trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsQuickConsoleNavigationBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsoleNavigationBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodePathComponentjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeBarItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeVariableTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView..css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/SearchIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSearchResultTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSectioncss">trunk/Source/WebInspectorUI/UserInterface/Views/Section.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/Section.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSidebarcss">trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSidebarjs">trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSlidercss">trunk/Source/WebInspectorUI/UserInterface/Views/Slider.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSliderjs">trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTimelineTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTimelineTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceMapResourceTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceMapResourceTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsStyleRuleIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/StyleRuleIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingDefaultThemecss">trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingSupportjs">trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulercss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsToggleButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsToggleControlToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsToolbarcss">trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsToolbarjs">trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeElementStatusButtoncss">trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeElementStatusButtonjs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlineDataGridSynchronizerjs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutlineDataGridSynchronizer.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceActivateButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceActivateButtonToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheFramejs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewcss">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheIconscss">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheManagerjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifest.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifestTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceApplicationCacheObserverjs">trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBackForwardEntryjs">trunk/Source/WebInspectorUI/UserInterface/BackForwardEntry.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBlankStylePropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/BlankStylePropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowcss">trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowjs">trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBranchjs">trunk/Source/WebInspectorUI/UserInterface/Branch.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBranchManagerjs">trunk/Source/WebInspectorUI/UserInterface/BranchManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointcss">trunk/Source/WebInspectorUI/UserInterface/Breakpoint.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointjs">trunk/Source/WebInspectorUI/UserInterface/Breakpoint.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointActionjs">trunk/Source/WebInspectorUI/UserInterface/BreakpointAction.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewcss">trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewjs">trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemcss">trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSCompletionsjs">trunk/Source/WebInspectorUI/UserInterface/CSSCompletions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSKeywordCompletionsjs">trunk/Source/WebInspectorUI/UserInterface/CSSKeywordCompletions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSMediajs">trunk/Source/WebInspectorUI/UserInterface/CSSMedia.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSObserverjs">trunk/Source/WebInspectorUI/UserInterface/CSSObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSPropertyjs">trunk/Source/WebInspectorUI/UserInterface/CSSProperty.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSRulejs">trunk/Source/WebInspectorUI/UserInterface/CSSRule.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationjs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclaration.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectioncss">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectionjs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleManagerjs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCSSStyleSheetjs">trunk/Source/WebInspectorUI/UserInterface/CSSStyleSheet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCallFramejs">trunk/Source/WebInspectorUI/UserInterface/CallFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCallFrameIconscss">trunk/Source/WebInspectorUI/UserInterface/CallFrameIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCallFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/CallFrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceClusterContentViewcss">trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorAdditionsjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorAdditions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorColorEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorFormattersjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorFormatters.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorOverridescss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorOverrides.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceColorjs">trunk/Source/WebInspectorUI/UserInterface/Color.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceColorPickercss">trunk/Source/WebInspectorUI/UserInterface/ColorPicker.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceColorPickerjs">trunk/Source/WebInspectorUI/UserInterface/ColorPicker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceColorWheelcss">trunk/Source/WebInspectorUI/UserInterface/ColorWheel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceColorWheeljs">trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewcss">trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewjs">trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPanelcss">trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleCommandjs">trunk/Source/WebInspectorUI/UserInterface/ConsoleCommand.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleCommandResultjs">trunk/Source/WebInspectorUI/UserInterface/ConsoleCommandResult.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleGroupjs">trunk/Source/WebInspectorUI/UserInterface/ConsoleGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleMessagejs">trunk/Source/WebInspectorUI/UserInterface/ConsoleMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleObserverjs">trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsolePromptcss">trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsolePromptjs">trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentBrowsercss">trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentBrowserjs">trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentFlowjs">trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentFlowDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ContentFlowDOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentFlowIconcss">trunk/Source/WebInspectorUI/UserInterface/ContentFlowIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentFlowTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ContentFlowTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/ContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentViewContainercss">trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContentViewContainerjs">trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceContextMenujs">trunk/Source/WebInspectorUI/UserInterface/ContextMenu.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControlToolbarItemcss">trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControlToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCookieIconcss">trunk/Source/WebInspectorUI/UserInterface/CookieIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewcss">trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCookieStorageObjectjs">trunk/Source/WebInspectorUI/UserInterface/CookieStorageObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCookieStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/CookieStorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/DOMDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMNodejs">trunk/Source/WebInspectorUI/UserInterface/DOMNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMNodeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMNodeStylesjs">trunk/Source/WebInspectorUI/UserInterface/DOMNodeStyles.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMObserverjs">trunk/Source/WebInspectorUI/UserInterface/DOMObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMSearchMatchObjectjs">trunk/Source/WebInspectorUI/UserInterface/DOMSearchMatchObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewcss">trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewjs">trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageIconscss">trunk/Source/WebInspectorUI/UserInterface/DOMStorageIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageObjectjs">trunk/Source/WebInspectorUI/UserInterface/DOMStorageObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageObserverjs">trunk/Source/WebInspectorUI/UserInterface/DOMStorageObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/DOMStorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreejs">trunk/Source/WebInspectorUI/UserInterface/DOMTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewcss">trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridcss">trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeElementPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeElementPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeManagerjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinecss">trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMTreeUpdaterjs">trunk/Source/WebInspectorUI/UserInterface/DOMTreeUpdater.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDOMUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/DOMUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDashboardManagerjs">trunk/Source/WebInspectorUI/UserInterface/DashboardManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDashboardViewcss">trunk/Source/WebInspectorUI/UserInterface/DashboardView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDashboardViewjs">trunk/Source/WebInspectorUI/UserInterface/DashboardView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDataGridcss">trunk/Source/WebInspectorUI/UserInterface/DataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDataGridjs">trunk/Source/WebInspectorUI/UserInterface/DataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewcss">trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseHostTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseHostTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseIconcss">trunk/Source/WebInspectorUI/UserInterface/DatabaseIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseObjectjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseObserverjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewcss">trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTableIconcss">trunk/Source/WebInspectorUI/UserInterface/DatabaseTableIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTableObjectjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseTableObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTableTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseTableTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDatabaseTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/DatabaseTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDebuggerObserverjs">trunk/Source/WebInspectorUI/UserInterface/DebuggerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectioncss">trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionDataGridRowjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSectionDataGridRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionGroupjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSectionGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionPropertiesRowjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSectionPropertiesRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionRowjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSectionRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSectionSimpleRowjs">trunk/Source/WebInspectorUI/UserInterface/DetailsSectionSimpleRow.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDragToAdjustControllerjs">trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEditingcss">trunk/Source/WebInspectorUI/UserInterface/Editing.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEditingSupportjs">trunk/Source/WebInspectorUI/UserInterface/EditingSupport.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEventHandlerjs">trunk/Source/WebInspectorUI/UserInterface/EventHandler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEventListenerSectionjs">trunk/Source/WebInspectorUI/UserInterface/EventListenerSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupcss">trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupjs">trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceEventListenerSetjs">trunk/Source/WebInspectorUI/UserInterface/EventListenerSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceExecutionContextjs">trunk/Source/WebInspectorUI/UserInterface/ExecutionContext.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceExecutionContextListjs">trunk/Source/WebInspectorUI/UserInterface/ExecutionContextList.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFilterBarcss">trunk/Source/WebInspectorUI/UserInterface/FilterBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFilterBarjs">trunk/Source/WebInspectorUI/UserInterface/FilterBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFindBannercss">trunk/Source/WebInspectorUI/UserInterface/FindBanner.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFindBannerjs">trunk/Source/WebInspectorUI/UserInterface/FindBanner.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFolderIconcss">trunk/Source/WebInspectorUI/UserInterface/FolderIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFolderTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/FolderTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFormatterjs">trunk/Source/WebInspectorUI/UserInterface/Formatter.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFormatterContentBuilderjs">trunk/Source/WebInspectorUI/UserInterface/FormatterContentBuilder.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFormatterSourceMapjs">trunk/Source/WebInspectorUI/UserInterface/FormatterSourceMap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFramejs">trunk/Source/WebInspectorUI/UserInterface/Frame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFrameContentViewjs">trunk/Source/WebInspectorUI/UserInterface/FrameContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFrameDOMTreeContentViewjs">trunk/Source/WebInspectorUI/UserInterface/FrameDOMTreeContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFrameResourceManagerjs">trunk/Source/WebInspectorUI/UserInterface/FrameResourceManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceFrameTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/FrameTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElementPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGenericResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/GenericResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGeometryjs">trunk/Source/WebInspectorUI/UserInterface/Geometry.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGoToLineDialogcss">trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGoToLineDialogjs">trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGradientjs">trunk/Source/WebInspectorUI/UserInterface/Gradient.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGradientSlidercss">trunk/Source/WebInspectorUI/UserInterface/GradientSlider.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceGradientSliderjs">trunk/Source/WebInspectorUI/UserInterface/GradientSlider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentcss">trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceHierarchicalPathNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceHoverMenucss">trunk/Source/WebInspectorUI/UserInterface/HoverMenu.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceHoverMenujs">trunk/Source/WebInspectorUI/UserInterface/HoverMenu.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImageUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/ImageUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarBluepng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarBlue2xpng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue@2x.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGraypng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGray2xpng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray@2x.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGreenpng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGreen2xpng">trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen@2x.png</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnercss">trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnerjs">trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabasejs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabase.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseEntryDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseEntryDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseHostTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseHostTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStorejs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStore.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewcss">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndex.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndexTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorBackendjs">trunk/Source/WebInspectorUI/UserInterface/InspectorBackend.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorFrontendAPIjs">trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorFrontendHostStubjs">trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorJSBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/InspectorJSBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorObserverjs">trunk/Source/WebInspectorUI/UserInterface/InspectorObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceInspectorWebBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIssueManagerjs">trunk/Source/WebInspectorUI/UserInterface/IssueManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceIssueMessagejs">trunk/Source/WebInspectorUI/UserInterface/IssueMessage.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptLogViewControllerjs">trunk/Source/WebInspectorUI/UserInterface/JavaScriptLogViewController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceJavaScriptRuntimeCompletionProviderjs">trunk/Source/WebInspectorUI/UserInterface/JavaScriptRuntimeCompletionProvider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceKeyboardShortcutjs">trunk/Source/WebInspectorUI/UserInterface/KeyboardShortcut.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridjs">trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeManagerjs">trunk/Source/WebInspectorUI/UserInterface/LayerTreeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeObserverjs">trunk/Source/WebInspectorUI/UserInterface/LayerTreeObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.js</a></li>
<li>trunk/Source/WebInspectorUI/UserInterface/Legacy/</li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyBottomUpProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileManagerjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileObjectjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileTypejs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewcss">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyProfilerObserverjs">trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLegacyTopDownProfileDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLoadInspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/LoadInspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLoadLocalizedStringsjs">trunk/Source/WebInspectorUI/UserInterface/LoadLocalizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogContentViewcss">trunk/Source/WebInspectorUI/UserInterface/LogContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogContentViewjs">trunk/Source/WebInspectorUI/UserInterface/LogContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogIconcss">trunk/Source/WebInspectorUI/UserInterface/LogIcon.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogManagerjs">trunk/Source/WebInspectorUI/UserInterface/LogManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogObjectjs">trunk/Source/WebInspectorUI/UserInterface/LogObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceLogTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/LogTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMIMETypeUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/MIMETypeUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMaincss">trunk/Source/WebInspectorUI/UserInterface/Main.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainjs">trunk/Source/WebInspectorUI/UserInterface/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMessageDispatcherjs">trunk/Source/WebInspectorUI/UserInterface/MessageDispatcher.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMetricsStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/MetricsStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNavigationBarcss">trunk/Source/WebInspectorUI/UserInterface/NavigationBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNavigationBarjs">trunk/Source/WebInspectorUI/UserInterface/NavigationBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/NavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkObserverjs">trunk/Source/WebInspectorUI/UserInterface/NetworkObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkTimelinejs">trunk/Source/WebInspectorUI/UserInterface/NetworkTimeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceObjectjs">trunk/Source/WebInspectorUI/UserInterface/Object.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceObjectPropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/ObjectPropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfacePageObserverjs">trunk/Source/WebInspectorUI/UserInterface/PageObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfacePathComponentIconscss">trunk/Source/WebInspectorUI/UserInterface/PathComponentIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfacePopovercss">trunk/Source/WebInspectorUI/UserInterface/Popover.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfacePopoverjs">trunk/Source/WebInspectorUI/UserInterface/Popover.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbejs">trunk/Source/WebInspectorUI/UserInterface/Probe.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeManagerjs">trunk/Source/WebInspectorUI/UserInterface/ProbeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetjs">trunk/Source/WebInspectorUI/UserInterface/ProbeSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDataFramejs">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataFrame.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridcss">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridjs">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDataTablejs">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataTable.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProbeSetDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/ProbeSetDetailsSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfilejs">trunk/Source/WebInspectorUI/UserInterface/Profile.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileNodejs">trunk/Source/WebInspectorUI/UserInterface/ProfileNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileNodeCalljs">trunk/Source/WebInspectorUI/UserInterface/ProfileNodeCall.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileNodeDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/ProfileNodeDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProfileNodeTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ProfileNodeTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfacePropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/PropertiesSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceQuickConsolecss">trunk/Source/WebInspectorUI/UserInterface/QuickConsole.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceQuickConsolejs">trunk/Source/WebInspectorUI/UserInterface/QuickConsole.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceQuickConsoleNavigationBarjs">trunk/Source/WebInspectorUI/UserInterface/QuickConsoleNavigationBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRemoteObjectjs">trunk/Source/WebInspectorUI/UserInterface/RemoteObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourcejs">trunk/Source/WebInspectorUI/UserInterface/Resource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ResourceClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceCollectionjs">trunk/Source/WebInspectorUI/UserInterface/ResourceCollection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/ResourceDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceIconscss">trunk/Source/WebInspectorUI/UserInterface/ResourceIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceSearchMatchObjectjs">trunk/Source/WebInspectorUI/UserInterface/ResourceSearchMatchObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodePathComponentjs">trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNodePathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceResourceTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRevisionjs">trunk/Source/WebInspectorUI/UserInterface/Revision.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPanelcss">trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRuntimeManagerjs">trunk/Source/WebInspectorUI/UserInterface/RuntimeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceRuntimeObserverjs">trunk/Source/WebInspectorUI/UserInterface/RuntimeObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeBarcss">trunk/Source/WebInspectorUI/UserInterface/ScopeBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeBarjs">trunk/Source/WebInspectorUI/UserInterface/ScopeBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeBarItemjs">trunk/Source/WebInspectorUI/UserInterface/ScopeBarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeChainDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/ScopeChainDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeChainNodejs">trunk/Source/WebInspectorUI/UserInterface/ScopeChainNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScopeVariableTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ScopeVariableTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptjs">trunk/Source/WebInspectorUI/UserInterface/Script.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptContentViewcss">trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptContentViewjs">trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceScriptTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/ScriptTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSearchBarcss">trunk/Source/WebInspectorUI/UserInterface/SearchBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSearchBarjs">trunk/Source/WebInspectorUI/UserInterface/SearchBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSearchIconscss">trunk/Source/WebInspectorUI/UserInterface/SearchIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSearchResultTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/SearchResultTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSectioncss">trunk/Source/WebInspectorUI/UserInterface/Section.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSectionjs">trunk/Source/WebInspectorUI/UserInterface/Section.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSettingjs">trunk/Source/WebInspectorUI/UserInterface/Setting.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSidebarcss">trunk/Source/WebInspectorUI/UserInterface/Sidebar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSidebarjs">trunk/Source/WebInspectorUI/UserInterface/Sidebar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSlidercss">trunk/Source/WebInspectorUI/UserInterface/Slider.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSliderjs">trunk/Source/WebInspectorUI/UserInterface/Slider.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodejs">trunk/Source/WebInspectorUI/UserInterface/SourceCode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeLocationjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeLocation.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodePositionjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodePosition.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeRevisionjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeRevision.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTextRangejs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextRange.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelinejs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceCodeTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/SourceCodeTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceMapjs">trunk/Source/WebInspectorUI/UserInterface/SourceMap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceMapManagerjs">trunk/Source/WebInspectorUI/UserInterface/SourceMapManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceMapResourcejs">trunk/Source/WebInspectorUI/UserInterface/SourceMapResource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSourceMapResourceTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/SourceMapResourceTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceStorageManagerjs">trunk/Source/WebInspectorUI/UserInterface/StorageManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceStorageTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/StorageTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/StyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceStyleRuleIconscss">trunk/Source/WebInspectorUI/UserInterface/StyleRuleIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingDefaultThemecss">trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingDefaultTheme.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingSupportjs">trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingSupport.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextContentViewcss">trunk/Source/WebInspectorUI/UserInterface/TextContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextContentViewjs">trunk/Source/WebInspectorUI/UserInterface/TextContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextEditorcss">trunk/Source/WebInspectorUI/UserInterface/TextEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/TextEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextMarkerjs">trunk/Source/WebInspectorUI/UserInterface/TextMarker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextRangejs">trunk/Source/WebInspectorUI/UserInterface/TextRange.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewcss">trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewjs">trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelinejs">trunk/Source/WebInspectorUI/UserInterface/Timeline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineContentViewcss">trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineContentViewjs">trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineDataGridcss">trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineDataGridjs">trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineIconscss">trunk/Source/WebInspectorUI/UserInterface/TimelineIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineMarkerjs">trunk/Source/WebInspectorUI/UserInterface/TimelineMarker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineObserverjs">trunk/Source/WebInspectorUI/UserInterface/TimelineObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineOverviewcss">trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineOverviewjs">trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/TimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/TimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarcss">trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarjs">trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRecordTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/TimelineRecordTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRecordingjs">trunk/Source/WebInspectorUI/UserInterface/TimelineRecording.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRulercss">trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineRulerjs">trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/TimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/TimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceToggleButtonNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/ToggleButtonNavigationItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceToggleControlToolbarItemjs">trunk/Source/WebInspectorUI/UserInterface/ToggleControlToolbarItem.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceToolbarcss">trunk/Source/WebInspectorUI/UserInterface/Toolbar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceToolbarjs">trunk/Source/WebInspectorUI/UserInterface/Toolbar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtoncss">trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtonjs">trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTreeOutlineDataGridSynchronizerjs">trunk/Source/WebInspectorUI/UserInterface/TreeOutlineDataGridSynchronizer.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceURLUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/URLUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceUnitBezierjs">trunk/Source/WebInspectorUI/UserInterface/UnitBezier.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Utilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceWebInspectorjs">trunk/Source/WebInspectorUI/UserInterface/WebInspector.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2014-02-21 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Organize WebInspectorUI/UserInterface into sub-directories.
+
+ https://bugs.webkit.org/show_bug.cgi?id=129194
+
+ Rubber-stamped by Joseph Pecoraro.
+
+ * Scripts/copy-user-interface-resources.sh: Fix Image URLs and Protocol paths.
+ * UserInterface/Base: Added.
+ * UserInterface/Controllers: Added.
+ * UserInterface/Images: Added.
+ * UserInterface/Main.html: Updated.
+ * UserInterface/Models Added.
+ * UserInterface/Protocol Added.
+ * UserInterface/Views: Added.
+
+2014-02-21 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Add inspection user interface for IndexedDB.
</span><span class="cx">
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=129162
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptscopyuserinterfaceresourcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.sh        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -52,6 +52,9 @@
</span><span class="cx"> # Remove console.assert calls from the Main.js file.
</span><span class="cx"> "${SRCROOT}/Scripts/remove-console-asserts.pl" --input-script "${DERIVED_SOURCES_DIR}/Main.js" --output-script "${DERIVED_SOURCES_DIR}/Main.js"
</span><span class="cx">
</span><ins>+ # Fix Image URLs in the Main.css file by removing the "../".
+ sed -i "" -e "s/\.\.\/Images/Images/g" "${DERIVED_SOURCES_DIR}/Main.css"
+
</ins><span class="cx"> # Export the license into Main.js.
</span><span class="cx"> echo "${LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.js"
</span><span class="cx">
</span><span class="lines">@@ -72,9 +75,9 @@
</span><span class="cx"> ditto "${SRCROOT}/UserInterface/Images" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Images"
</span><span class="cx">
</span><span class="cx"> # Copy over files that are dynamically loaded. The default Inspector*BackendCommands.js and the Legacy directory.
</span><del>- ditto "${SRCROOT}/UserInterface/InspectorJSBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/InspectorJSBackendCommands.js"
- ditto "${SRCROOT}/UserInterface/InspectorWebBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/InspectorWebBackendCommands.js"
- ditto "${SRCROOT}/UserInterface/Legacy" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Legacy"
</del><ins>+ ditto "${SRCROOT}/UserInterface/Protocol/InspectorJSBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/InspectorJSBackendCommands.js"
+ ditto "${SRCROOT}/UserInterface/Protocol/InspectorWebBackendCommands.js" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/InspectorWebBackendCommands.js"
+ ditto "${SRCROOT}/UserInterface/Protocol/Legacy" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Protocol/Legacy"
</ins><span class="cx"> else
</span><span class="cx"> # Keep the files separate for engineering builds.
</span><span class="cx"> ditto "${SRCROOT}/UserInterface" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptsupdateInspectorBackendCommandsrb"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/update-InspectorBackendCommands.rb (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/update-InspectorBackendCommands.rb        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/Scripts/update-InspectorBackendCommands.rb        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> $inspector_web_json_path = Tempfile.new("generated-InspectorWeb.json").path
</span><span class="cx"> $versions_directory_path = File.join WEB_INSPECTOR_PATH, "Versions"
</span><span class="cx"> $web_inspector_user_interface_path = File.join WEB_INSPECTOR_PATH, "UserInterface"
</span><ins>+$web_inspector_protocol_path = File.join WEB_INSPECTOR_PATH, "UserInterface", "Protocol"
</ins><span class="cx">
</span><span class="cx"> class Task
</span><span class="cx"> def initialize(input_json_path, dependency_json_path, type, output_directory_path, verification)
</span><span class="lines">@@ -82,8 +83,8 @@
</span><span class="cx">
</span><span class="cx"> # ToT Inspector json files.
</span><span class="cx"> generate_combined_inspector_json
</span><del>- tasks << Task.new($inspector_js_json_path, nil, "JavaScript", $web_inspector_user_interface_path, true)
- tasks << Task.new($inspector_web_json_path, $inspector_js_json_path, "Web", $web_inspector_user_interface_path, true)
</del><ins>+ tasks << Task.new($inspector_js_json_path, nil, "JavaScript", $web_inspector_protocol_path, true)
+ tasks << Task.new($inspector_web_json_path, $inspector_js_json_path, "Web", $web_inspector_protocol_path, true)
</ins><span class="cx">
</span><span class="cx"> had_error = false
</span><span class="cx"> Dir.glob(File.join($versions_directory_path, "*.json")).each do |version_path|
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIScriptsupdateprettyprinterrb"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Scripts/update-pretty-printer.rb (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Scripts/update-pretty-printer.rb        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/Scripts/update-pretty-printer.rb        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx">
</span><span class="cx"> # Copy the formatter and CodeMirror files from UserInterface to Tools.
</span><span class="cx"> USER_INTERFACE_TO_TOOLS_MAP = {
</span><del>- "UserInterface/CodeMirrorFormatters.js" => "Tools/PrettyPrinting/CodeMirrorFormatters.js",
- "UserInterface/Formatter.js" => "Tools/PrettyPrinting/Formatter.js",
- "UserInterface/FormatterContentBuilder.js" => "Tools/PrettyPrinting/FormatterContentBuilder.js",
</del><ins>+ "UserInterface/Controllers/CodeMirrorFormatters.js" => "Tools/PrettyPrinting/CodeMirrorFormatters.js",
+ "UserInterface/Controllers/Formatter.js" => "Tools/PrettyPrinting/Formatter.js",
+ "UserInterface/Controllers/FormatterContentBuilder.js" => "Tools/PrettyPrinting/FormatterContentBuilder.js",
</ins><span class="cx">
</span><span class="cx"> "UserInterface/External/CodeMirror/codemirror.css" => "Tools/PrettyPrinting/codemirror.css",
</span><span class="cx"> "UserInterface/External/CodeMirror/codemirror.js" => "Tools/PrettyPrinting/codemirror.js",
</span><span class="lines">@@ -35,9 +35,9 @@
</span><span class="cx">
</span><span class="cx"> # Copy only the formatter files from Tools to UserInterface.
</span><span class="cx"> TOOLS_TO_USER_INTERFACE_MAP = {
</span><del>- "Tools/PrettyPrinting/CodeMirrorFormatters.js" => "UserInterface/CodeMirrorFormatters.js",
- "Tools/PrettyPrinting/Formatter.js" => "UserInterface/Formatter.js",
- "Tools/PrettyPrinting/FormatterContentBuilder.js" => "UserInterface/FormatterContentBuilder.js"
</del><ins>+ "Tools/PrettyPrinting/CodeMirrorFormatters.js" => "UserInterface/Controllers/CodeMirrorFormatters.js",
+ "Tools/PrettyPrinting/Formatter.js" => "UserInterface/Controllers/Formatter.js",
+ "Tools/PrettyPrinting/FormatterContentBuilder.js" => "UserInterface/Controllers/FormatterContentBuilder.js"
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> web_inspector_path = File.expand_path File.join(File.dirname(__FILE__), "..")
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceActivateButtonNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ActivateButtonNavigationItem = function(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
-{
- WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
-
- this._defaultToolTip = defaultToolTip;
- this._activatedToolTip = activatedToolTip || defaultToolTip;
- this._role = role;
-};
-
-WebInspector.ActivateButtonNavigationItem.StyleClassName = "activate";
-WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName = "activated";
-
-WebInspector.ActivateButtonNavigationItem.prototype = {
- constructor: WebInspector.ActivateButtonNavigationItem,
-
- // Public
-
- get defaultToolTip()
- {
- return this._defaultToolTip;
- },
-
- get activatedToolTip()
- {
- return this._activatedToolTip;
- },
-
- get activated()
- {
- return this.element.classList.contains(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
- },
-
- set activated(flag)
- {
- if (flag) {
- this.toolTip = this._activatedToolTip;
- this.element.classList.add(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
- if (this._role === "tab")
- this.element.setAttribute("aria-selected", "true");
- } else {
- this.toolTip = this._defaultToolTip;
- this.element.classList.remove(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
- if (this._role === "tab")
- this.element.removeAttribute("aria-selected");
- }
- },
-
- generateStyleText: function(parentSelector)
- {
- var classNames = this._classNames.join(".");
-
- if (this._suppressEmboss)
- var styleText = parentSelector + " ." + classNames + " > .glyph { background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
- else {
- var activatedClassName = "." + WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName;
-
- // Default state.
- var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Normal) + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
-
- // Pressed state.
- styleText += parentSelector + " ." + classNames + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Active) + "); }\n";
-
- // Activated state.
- styleText += parentSelector + " ." + classNames + activatedClassName + ":not(.disabled) > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
-
- // Activated and pressed state.
- styleText += parentSelector + " ." + classNames + activatedClassName + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.ActiveFocus) + "); }\n";
- }
-
- return styleText;
- },
-
- // Private
-
- _additionalClassNames: [WebInspector.ActivateButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName]
-};
-
-WebInspector.ActivateButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceActivateButtonToolbarItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ActivateButtonToolbarItem = function(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss, role)
-{
- WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss, role);
-
- console.assert(label);
-
- this._labelElement = document.createElement("div");
- this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
-
- this.label = label;
-};
-
-WebInspector.ActivateButtonToolbarItem.prototype = {
- constructor: WebInspector.ActivateButtonToolbarItem,
-
- // Public
-
- get label()
- {
- return this._labelElement.textContent;
- },
-
- set label(newLabel)
- {
- console.assert(newLabel);
- if (!newLabel)
- return;
-
- this._labelElement.textContent = newLabel;
- }
-};
-
-WebInspector.ActivateButtonToolbarItem.prototype.__proto__ = WebInspector.ActivateButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,152 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheDetailsSidebarPanel = function() {
- WebInspector.DetailsSidebarPanel.call(this, "application-cache-details", WebInspector.UIString("Storage"), WebInspector.UIString("Storage"), "Images/NavigationItemStorage.svg");
-
- this.element.classList.add(WebInspector.ApplicationCacheDetailsSidebarPanel.StyleClassName);
-
- this._applicationCacheFrame = null;
-
- this._locationManifestURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Manifest URL"));
- this._locationFrameURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Frame URL"));
-
- this._locationGroup = new WebInspector.DetailsSectionGroup([this._locationManifestURLRow, this._locationFrameURLRow]);
-
- this._locationSection = new WebInspector.DetailsSection("application-cache-location", WebInspector.UIString("Location"), [this._locationGroup]);
-
- this._onlineRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Online"));
- this._statusRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));
-
- this._statusGroup = new WebInspector.DetailsSectionGroup([this._onlineRow, this._statusRow]);
-
- this._statusSection = new WebInspector.DetailsSection("application-cache-status", WebInspector.UIString("Status"), [this._statusGroup]);
-
- this.element.appendChild(this._locationSection.element);
- this.element.appendChild(this._statusSection.element);
-
- WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated, this._networkStateUpdated, this);
- WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._frameManifestStatusChanged, this);
-};
-
-WebInspector.ApplicationCacheDetailsSidebarPanel.StyleClassName = "application-cache";
-
-// This needs to be kept in sync with ApplicationCacheManager.js.
-WebInspector.ApplicationCacheDetailsSidebarPanel.Status = {
- 0: "Uncached",
- 1: "Idle",
- 2: "Checking",
- 3: "Downloading",
- 4: "UpdateReady",
- 5: "Obsolete"
-};
-
-WebInspector.ApplicationCacheDetailsSidebarPanel.prototype = {
- constructor: WebInspector.ApplicationCacheDetailsSidebarPanel,
-
- // Public
-
- inspect: function(objects)
- {
- // Convert to a single item array if needed.
- if (!(objects instanceof Array))
- objects = [objects];
-
- var applicationCacheFrameToInspect = null;
-
- // Iterate over the objects to find a WebInspector.ApplicationCacheFrame to inspect.
- for (var i = 0; i < objects.length; ++i) {
- if (objects[i] instanceof WebInspector.ApplicationCacheFrame) {
- applicationCacheFrameToInspect = objects[i];
- break;
- }
- }
-
- this.applicationCacheFrame = applicationCacheFrameToInspect;
-
- return !!this.applicationCacheFrame;
- },
-
- get applicationCacheFrame()
- {
- return this._applicationCacheFrame;
- },
-
- set applicationCacheFrame(applicationCacheFrame)
- {
- if (this._applicationCacheFrame === applicationCacheFrame)
- return;
-
- this._applicationCacheFrame = applicationCacheFrame;
-
- this.needsRefresh();
- },
-
- refresh: function()
- {
- if (!this.applicationCacheFrame)
- return;
-
- this._locationFrameURLRow.value = this.applicationCacheFrame.frame.url;
- this._locationManifestURLRow.value = this.applicationCacheFrame.manifest.manifestURL;
-
- this._refreshOnlineRow();
- this._refreshStatusRow();
- },
-
- // Private
-
- _networkStateUpdated: function(event)
- {
- if (!this.applicationCacheFrame)
- return;
-
- this._refreshOnlineRow();
- },
-
- _frameManifestStatusChanged: function(event)
- {
- if (!this.applicationCacheFrame)
- return;
-
- console.assert(event.data.frameManifest instanceof WebInspector.ApplicationCacheFrame);
- if (event.data.frameManifest !== this.applicationCacheFrame)
- return;
-
- this._refreshStatusRow();
- },
-
- _refreshOnlineRow: function()
- {
- this._onlineRow.value = WebInspector.applicationCacheManager.online ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
- },
-
- _refreshStatusRow: function()
- {
- this._statusRow.value = WebInspector.ApplicationCacheDetailsSidebarPanel.Status[this.applicationCacheFrame.status];
- }
-};
-
-WebInspector.ApplicationCacheDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheFramejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrame.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrame.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,74 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheFrame = function(frame, manifest, status)
-{
- console.assert(frame instanceof WebInspector.Frame);
- console.assert(manifest instanceof WebInspector.ApplicationCacheManifest);
-
- WebInspector.Object.call(this);
-
- this._frame = frame;
- this._manifest = manifest;
- this._status = status;
-};
-
-WebInspector.ApplicationCacheFrame.TypeIdentifier = "application-cache-frame";
-WebInspector.ApplicationCacheFrame.FrameURLCookieKey = "application-cache-frame-url";
-WebInspector.ApplicationCacheFrame.ManifestURLCookieKey = "application-cache-frame-manifest-url";
-
-WebInspector.ApplicationCacheFrame.prototype = {
- constructor: WebInspector.ApplicationCacheFrame,
-
- // Public
-
- get frame()
- {
- return this._frame;
- },
-
- get manifest()
- {
- return this._manifest;
- },
-
- get status()
- {
- return this._status;
- },
-
- set status(status)
- {
- this._status = status;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.ApplicationCacheFrame.FrameURLCookieKey] = this.frame.url;
- cookie[WebInspector.ApplicationCacheFrame.ManifestURLCookieKey] = this.manifest.manifestURL;
- }
-};
-
-WebInspector.ApplicationCacheFrame.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.application-cache-frame > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,250 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-/**
- * @constructor
- * @extends {WebInspector.View}
- */
-WebInspector.ApplicationCacheFrameContentView = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.ApplicationCacheFrame);
-
- WebInspector.ContentView.call(this, representedObject);
-
- this.element.classList.add(WebInspector.ApplicationCacheFrameContentView.StyleClassName);
-
- this.element.classList.add("storage-view");
- this.element.classList.add("table");
-
- this._frame = representedObject.frame;
-
- this._emptyView = WebInspector.createMessageTextView(WebInspector.UIString("No Application Cache information available"), false);
- this._emptyView.classList.add("hidden");
- this.element.appendChild(this._emptyView);
-
- this._markDirty();
-
- var status = representedObject.status;
- this.updateStatus(status);
-
- WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
-}
-
-WebInspector.ApplicationCacheFrameContentView.StyleClassName = "application-cache-frame";
-
-WebInspector.ApplicationCacheFrameContentView.prototype = {
- constructor: WebInspector.ApplicationCacheFrameContentView,
-
- shown: function()
- {
- this._maybeUpdate();
- },
-
- closed: function()
- {
- WebInspector.applicationCacheManager.removeEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
- },
-
- updateLayout: function()
- {
- if (this.dataGrid)
- this.dataGrid.updateLayout();
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.ApplicationCache;
- cookie.frame = this.representedObject.frame.url;
- cookie.manifest = this.representedObject.manifest.manifestURL;
- },
-
- get scrollableElements()
- {
- if (!this._dataGrid)
- return [];
- return [this._dataGrid.scrollContainer];
- },
-
- _maybeUpdate: function()
- {
- if (!this.visible || !this._viewDirty)
- return;
-
- this._update();
- this._viewDirty = false;
- },
-
- _markDirty: function()
- {
- this._viewDirty = true;
- },
-
- _updateStatus: function(event)
- {
- var frameManifest = event.data.frameManifest;
- if (frameManifest !== this.representedObject)
- return;
-
- console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
-
- this.updateStatus(frameManifest.status);
- },
-
- /**
- * @param {number} status
- */
- updateStatus: function(status)
- {
- var oldStatus = this._status;
- this._status = status;
-
- if (this.visible && this._status === WebInspector.ApplicationCacheManager.Status.Idle && (oldStatus === WebInspector.ApplicationCacheManager.Status.UpdateReady || !this._resources))
- this._markDirty();
-
- this._maybeUpdate();
- },
-
- _update: function()
- {
- WebInspector.applicationCacheManager.requestApplicationCache(this._frame, this._updateCallback.bind(this));
- },
-
- /**
- * @param {Object} applicationCache
- */
- _updateCallback: function(applicationCache)
- {
- if (!applicationCache || !applicationCache.manifestURL) {
- delete this._manifest;
- delete this._creationTime;
- delete this._updateTime;
- delete this._size;
- delete this._resources;
-
- this._emptyView.classList.remove("hidden");
-
- if (this._dataGrid)
- this._dataGrid.element.classList.add("hidden");
- return;
- }
-
- // FIXME: are these variables needed anywhere else?
- this._manifest = applicationCache.manifestURL;
- this._creationTime = applicationCache.creationTime;
- this._updateTime = applicationCache.updateTime;
- this._size = applicationCache.size;
- this._resources = applicationCache.resources;
-
- if (!this._dataGrid)
- this._createDataGrid();
-
- this._populateDataGrid();
- this._dataGrid.autoSizeColumns(20, 80);
- this._dataGrid.element.classList.remove("hidden");
-
- this._emptyView.classList.add("hidden");
- },
-
- _createDataGrid: function()
- {
- var columns = { 0: {}, 1: {}, 2: {} };
- columns[0].title = WebInspector.UIString("Resource");
- columns[0].sort = "ascending";
- columns[0].sortable = true;
- columns[1].title = WebInspector.UIString("Type");
- columns[1].sortable = true;
- columns[2].title = WebInspector.UIString("Size");
- columns[2].aligned = "right";
- columns[2].sortable = true;
- this._dataGrid = new WebInspector.DataGrid(columns);
- this.element.appendChild(this._dataGrid.element);
- this._dataGrid.updateLayout();
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._populateDataGrid, this);
- },
-
- _populateDataGrid: function()
- {
- var selectedResource = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.resource : null;
- var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function numberCompare(field, resource1, resource2)
- {
- return sortDirection * (resource1[field] - resource2[field]);
- }
- function localeCompare(field, resource1, resource2)
- {
- return sortDirection * (resource1[field] + "").localeCompare(resource2[field] + "");
- }
-
- var comparator;
- switch (parseInt(this._dataGrid.sortColumnIdentifier, 10)) {
- case 0: comparator = localeCompare.bind(this, "url"); break;
- case 1: comparator = localeCompare.bind(this, "type"); break;
- case 2: comparator = numberCompare.bind(this, "size"); break;
- default: localeCompare.bind(this, "resource"); // FIXME: comparator = ?
- }
-
- this._resources.sort(comparator);
- this._dataGrid.removeChildren();
-
- var nodeToSelect;
- for (var i = 0; i < this._resources.length; ++i) {
- var data = {};
- var resource = this._resources[i];
- data[0] = resource.url;
- data[1] = resource.type;
- data[2] = Number.bytesToString(resource.size);
- var node = new WebInspector.DataGridNode(data);
- node.resource = resource;
- node.selectable = true;
- this._dataGrid.appendChild(node);
- if (resource === selectedResource) {
- nodeToSelect = node;
- nodeToSelect.selected = true;
- }
- }
-
- if (!nodeToSelect && this._dataGrid.children.length)
- this._dataGrid.children[0].selected = true;
- },
-
- _deleteButtonClicked: function(event)
- {
- if (!this._dataGrid || !this._dataGrid.selectedNode)
- return;
-
- // FIXME: Delete Button semantics are not yet defined. (Delete a single, or all?)
- this._deleteCallback(this._dataGrid.selectedNode);
- },
-
- _deleteCallback: function(node)
- {
- // FIXME: Should we delete a single (selected) resource or all resources?
- // InspectorBackend.deleteCachedResource(...)
- // this._update();
- }
-}
-
-WebInspector.ApplicationCacheFrameContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheFrameTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.ApplicationCacheFrame);
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.ApplicationCacheFrameTreeElement.StyleClassName, "", "", representedObject, false);
-
- this.small = true;
-
- this.updateTitles();
-};
-
-WebInspector.ApplicationCacheFrameTreeElement.StyleClassName = "application-cache-frame";
-
-WebInspector.ApplicationCacheFrameTreeElement.prototype = {
- constructor: WebInspector.ApplicationCacheFrameTreeElement,
-
- updateTitles: function()
- {
- var url = this.representedObject.frame.url;
- var parsedURL = parseURL(url);
-
- this.mainTitle = WebInspector.displayNameForURL(url, parsedURL);
-
- // Show the host as the subtitle only if it doesn't match the subtitle of the manifest tree element,
- // and it doesn't match the mainTitle.
- var subtitle = WebInspector.displayNameForHost(parsedURL.host);
-
- // FIXME: This is bad layering. We should not be calling a global object to get this.
- var manifestTreeElement = WebInspector.resourceSidebarPanel.treeElementForRepresentedObject(this.representedObject.manifest);
-
- var subtitleIsDuplicate = subtitle === this._mainTitle || subtitle === manifestTreeElement.subtitle;
- this.subtitle = subtitleIsDuplicate ? null : subtitle;
- }
-};
-
-WebInspector.ApplicationCacheFrameTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.application-cache-manifest .icon {
- content: -webkit-image-set(url(Images/ApplicationCacheManifest.png) 1x, url(Images/ApplicationCacheManifest@2x.png) 2x);
-}
-
-.application-cache-frame .icon {
- content: -webkit-image-set(url(Images/ApplicationCache.png) 1x, url(Images/ApplicationCache@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,198 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManager = function()
-{
- WebInspector.Object.call(this);
-
- if (window.ApplicationCacheAgent)
- ApplicationCacheAgent.enable();
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._childFrameWasRemoved, this);
-
- this._online = true;
-
- this.initialize();
-};
-
-WebInspector.ApplicationCacheManager.Event = {
- Cleared: "application-cache-manager-cleared",
- FrameManifestAdded: "application-cache-manager-frame-manifest-added",
- FrameManifestRemoved: "application-cache-manager-frame-manifest-removed",
- FrameManifestStatusChanged: "application-cache-manager-frame-manifest-status-changed",
- NetworkStateUpdated: "application-cache-manager-network-state-updated"
-};
-
-WebInspector.ApplicationCacheManager.Status = {
- Uncached: 0,
- Idle: 1,
- Checking: 2,
- Downloading: 3,
- UpdateReady: 4,
- Obsolete: 5
-};
-
-WebInspector.ApplicationCacheManager.prototype = {
- constructor: WebInspector.ApplicationCacheManager,
-
- // Public
-
- initialize: function()
- {
- this._applicationCacheObjects = [];
-
- if (window.ApplicationCacheAgent)
- ApplicationCacheAgent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));
- },
-
- networkStateUpdated: function(isNowOnline)
- {
- this._online = isNowOnline;
-
- this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated, {online: this._online});
- },
-
- get online()
- {
- return this._online;
- },
-
- applicationCacheStatusUpdated: function(frameId, manifestURL, status)
- {
- var frame = WebInspector.frameResourceManager.frameForIdentifier(frameId);
- if (!frame)
- return;
-
- this._frameManifestUpdated(frame, manifestURL, status);
- },
-
- requestApplicationCache: function(frame, callback)
- {
- function callbackWrapper(error, applicationCache)
- {
- if (error) {
- callback(null);
- return;
- }
-
- callback(applicationCache);
- }
-
- ApplicationCacheAgent.getApplicationCacheForFrame(frame.id, callbackWrapper);
- },
-
- // Private
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (event.target.isMainFrame()) {
- // If we are dealing with the main frame, we want to clear our list of objects, because we are navigating to a new page.
- this.initialize();
-
- this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.Cleared);
-
- return;
- }
-
- ApplicationCacheAgent.getManifestForFrame(event.target.id, this._manifestForFrameLoaded.bind(this, event.target.id));
- },
-
- _childFrameWasRemoved: function(event)
- {
- this._frameManifestRemoved(event.data.childFrame);
- },
-
- _manifestForFrameLoaded: function(frameId, error, manifestURL)
- {
- if (error)
- return;
-
- var frame = WebInspector.frameResourceManager.frameForIdentifier(frameId);
- if (!frame)
- return;
-
- if (!manifestURL)
- this._frameManifestRemoved(frame);
- },
-
- _framesWithManifestsLoaded: function(error, framesWithManifests)
- {
- if (error)
- return;
-
- for (var i = 0; i < framesWithManifests.length; ++i) {
- var frame = WebInspector.frameResourceManager.frameForIdentifier(framesWithManifests[i].frameId);
- if (!frame)
- continue;
-
- this._frameManifestUpdated(frame, framesWithManifests[i].manifestURL, framesWithManifests[i].status);
- }
- },
-
- _frameManifestUpdated: function(frame, manifestURL, status)
- {
- if (status === WebInspector.ApplicationCacheManager.Status.Uncached) {
- this._frameManifestRemoved(frame);
- return;
- }
-
- if (!manifestURL)
- return;
-
- var manifestFrame = this._applicationCacheObjects[frame.id];
- if (manifestFrame && manifestURL !== manifestFrame.manifest.manifestURL)
- this._frameManifestRemoved(frame);
-
- var oldStatus = manifestFrame ? manifestFrame.status : -1;
- var statusChanged = manifestFrame && status !== oldStatus;
- if (manifestFrame)
- manifestFrame.status = status;
-
- if (!this._applicationCacheObjects[frame.id]) {
- var cacheManifest = new WebInspector.ApplicationCacheManifest(manifestURL);
- this._applicationCacheObjects[frame.id] = new WebInspector.ApplicationCacheFrame(frame, cacheManifest, status);
-
- this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestAdded, {frameManifest: this._applicationCacheObjects[frame.id]});
- }
-
- if (statusChanged)
- this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, {frameManifest: this._applicationCacheObjects[frame.id]});
- },
-
- _frameManifestRemoved: function(frame)
- {
- if (!this._applicationCacheObjects[frame.id])
- return;
-
- delete this._applicationCacheObjects[frame.id];
-
- this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestRemoved, {frame: frame});
- }
-};
-
-WebInspector.ApplicationCacheManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifest.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifest.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifest.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManifest = function(manifestURL)
-{
- WebInspector.Object.call(this);
-
- this._manifestURL = manifestURL;
-};
-
-WebInspector.ApplicationCacheManifest.prototype = {
- constructor: WebInspector.ApplicationCacheManifest,
-
- get manifestURL()
- {
- return this._manifestURL;
- }
-};
-
-WebInspector.ApplicationCacheManifest.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifestTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifestTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifestTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,74 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManifestTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.ApplicationCacheManifest);
-
- WebInspector.StorageTreeElement.call(this, WebInspector.ApplicationCacheManifestTreeElement.StyleClassName, "", representedObject);
-};
-
-WebInspector.ApplicationCacheManifestTreeElement.StyleClassName = "application-cache-manifest";
-
-WebInspector.ApplicationCacheManifestTreeElement.prototype = {
- constructor: WebInspector.ApplicationCacheManifestTreeElement,
-
- // Public
-
- get name()
- {
- if (!this._name)
- this._generateTitles();
-
- return this._name;
- },
-
- get secondaryName()
- {
- if (!this._secondaryName)
- this._generateTitles();
-
- return this._secondaryName;
- },
-
- get categoryName()
- {
- return WebInspector.UIString("Application Cache");
- },
-
- _generateTitles: function()
- {
- var parsedURL = parseURL(this.representedObject.manifestURL);
-
- // Prefer the last path component, with a fallback for the host as the main title.
- this._name = WebInspector.displayNameForURL(this.representedObject.manifestURL, parsedURL);
-
- // Show the host as the subtitle.
- var secondaryName = WebInspector.displayNameForHost(parsedURL.host);
- this._secondaryName = this._name !== secondaryName ? secondaryName : null;
- }
-};
-
-WebInspector.ApplicationCacheManifestTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceApplicationCacheObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.ApplicationCacheObserver.prototype = {
- constructor: WebInspector.ApplicationCacheObserver,
-
- // Events defined by the "ApplicationCache" domain.
-
- applicationCacheStatusUpdated: function(frameId, manifestURL, status)
- {
- WebInspector.applicationCacheManager.applicationCacheStatusUpdated(frameId, manifestURL, status);
- },
-
- networkStateUpdated: function(isNowOnline)
- {
- WebInspector.applicationCacheManager.networkStateUpdated(isNowOnline);
- }
-};
-
-WebInspector.ApplicationCacheObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBackForwardEntryjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BackForwardEntry.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BackForwardEntry.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BackForwardEntry.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/*
- * 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.BackForwardEntry = function(contentView, cookie)
-{
- WebInspector.Object.call(this);
- this._contentView = contentView;
- // Cookies are compared with Object.shallowEqual, so should not store objects or arrays.
- this._cookie = cookie || {};
- this._scrollPositions = [];
-
- contentView.saveToCookie(this._cookie);
-};
-
-WebInspector.BackForwardEntry.prototype = {
- constructor: WebInspector.BackForwardEntry,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get contentView()
- {
- return this._contentView;
- },
-
- get cookie()
- {
- // Cookies are immutable; they represent a specific navigation action.
- return Object.shallowCopy(this._cookie);
- },
-
- prepareToShow: function()
- {
- this._restoreFromCookie();
-
- this.contentView.visible = true;
- this.contentView.shown();
- this.contentView.updateLayout();
- },
-
- prepareToHide: function()
- {
- this.contentView.visible = false;
- this.contentView.hidden();
-
- this._saveScrollPositions();
- },
-
- // Private
-
- _restoreFromCookie: function()
- {
- this._restoreScrollPositions();
- this.contentView.restoreFromCookie(this.cookie);
- },
-
- _restoreScrollPositions: function()
- {
- // If no scroll positions are saved, do nothing.
- if (!this._scrollPositions.length)
- return;
-
- var scrollableElements = this.contentView.scrollableElements || [];
- console.assert(this._scrollPositions.length === scrollableElements.length);
-
- for (var i = 0; i < scrollableElements.length; ++i) {
- var position = this._scrollPositions[i];
- var element = scrollableElements[i];
- if (!element)
- continue;
-
- // Restore the top scroll position by either scrolling to the bottom or to the saved position.
- element.scrollTop = position.isScrolledToBottom ? element.scrollHeight : position.scrollTop;
-
- // Don't restore the left scroll position when scrolled to the bottom. This way the when content changes
- // the user won't be left in a weird horizontal position.
- element.scrollLeft = position.isScrolledToBottom ? 0 : position.scrollLeft;
- }
- },
-
- _saveScrollPositions: function()
- {
- var scrollableElements = this.contentView.scrollableElements || [];
- var scrollPositions = [];
- for (var i = 0; i < scrollableElements.length; ++i) {
- var element = scrollableElements[i];
- if (!element)
- continue;
-
- var position = { scrollTop: element.scrollTop, scrollLeft: element.scrollLeft };
- if (this.contentView.shouldKeepElementsScrolledToBottom)
- position.isScrolledToBottom = element.isScrolledToBottom();
-
- scrollPositions.push(position);
- }
-
- this._scrollPositions = scrollPositions;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseDOMUtilitiesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMUtilitiesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMUtilities.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.displayNameForNode = function(node)
+{
+ var title = node.nodeNameInCorrectCase();
+
+ var idAttribute = node.getAttribute("id");
+ if (idAttribute) {
+ if (/[\s'"]/.test(idAttribute)) {
+ idAttribute = idAttribute.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");
+ title += "[id=\"" + idAttribute + "\"]";
+ } else
+ title += "#" + idAttribute;
+ }
+
+ var classAttribute = node.getAttribute("class");
+ if (classAttribute) {
+ var classes = classAttribute.trim().split(/\s+/);
+ var foundClasses = {};
+
+ for (var i = 0; i < classes.length; ++i) {
+ var className = classes[i];
+ if (className && !(className in foundClasses)) {
+ title += "." + className;
+ foundClasses[className] = true;
+ }
+ }
+ }
+
+ return title;
+}
+
+WebInspector.linkifyNodeReference = function(node)
+{
+ var displayName = WebInspector.displayNameForNode(node);
+
+ var link = document.createElement("span");
+ link.appendChild(document.createTextNode(displayName));
+ link.className = "node-link";
+ link.title = displayName;
+
+ link.addEventListener("click", WebInspector.domTreeManager.inspectElement.bind(WebInspector.domTreeManager, node.id));
+ link.addEventListener("mouseover", WebInspector.domTreeManager.highlightDOMNode.bind(WebInspector.domTreeManager, node.id, ""));
+ link.addEventListener("mouseout", WebInspector.domTreeManager.hideDOMNodeHighlight.bind(WebInspector.domTreeManager));
+
+ return link;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseEventHandlerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceEventHandlerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/EventHandler.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EventHandler.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/EventHandler.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/EventHandler.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventHandler = function(delegate, eventHandlers)
+{
+ this._delegate = delegate;
+ this._eventHandlers = eventHandlers;
+
+ this._tracking = false;
+ this._target = null;
+};
+
+WebInspector.EventHandler.prototype = {
+ constructor: WebInspector.EventHandler,
+
+ // Public
+
+ trackEvents: function(target)
+ {
+ if (this._tracking && target === this._target)
+ return;
+
+ if (this._tracking && this._target)
+ this.stopTrackingEvents();
+
+ Object.getOwnPropertyNames(this._eventHandlers).forEach(function(eventName) {
+ target.addEventListener(eventName, this);
+ }, this);
+
+ this._target = target;
+ this._tracking = true;
+ },
+
+ stopTrackingEvents: function()
+ {
+ if (!this._tracking)
+ return;
+
+ Object.getOwnPropertyNames(this._eventHandlers).forEach(function(eventType) {
+ this._target.removeEventListener(eventType, this);
+ }, this);
+
+ this._tracking = false;
+ },
+
+ handleEvent: function(event)
+ {
+ if (event.currentTarget !== this._target)
+ return;
+
+ var handler = this._eventHandlers[event.type];
+ if (handler)
+ handler.call(this._delegate, event);
+ }
+}
+
+WebInspector.EventHandler.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseEventListenerSetjsfromrev164541trunkSourceWebInspectorUIUserInterfaceEventListenerSetjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EventListenerSet.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.
+ */
+
+// This class supports adding and removing many listeners at once.
+// Add DOM or Inspector event listeners to the set using `register()`.
+// Use `install()` and `uninstall()` to enable or disable all listeners
+// in the set at once.
+WebInspector.EventListenerSet = function(defaultThisObject, name)
+{
+ this.name = name;
+ this._defaultThisObject = defaultThisObject;
+
+ this._listeners = [];
+ this._installed = false;
+}
+
+WebInspector.EventListenerSet.prototype = {
+ register: function(emitter, type, listener, thisObject, useCapture)
+ {
+ console.assert(listener, "Missing listener for event: " + type);
+ console.assert(emitter, "Missing event emitter for event: " + type);
+ console.assert(emitter instanceof WebInspector.Object || emitter instanceof Node || (typeof emitter.addEventListener === "function"), "Event emitter", emitter, " (type:" + type + ") does not implement Node or WebInspector.Object!");
+
+ if (emitter instanceof Node)
+ listener = listener.bind(thisObject || this._defaultThisObject);
+
+ this._listeners.push({emitter: emitter, type: type, listener: listener, thisObject: thisObject, useCapture: useCapture});
+ },
+
+ unregister: function()
+ {
+ if (this._installed)
+ this.uninstall();
+ this._listeners = [];
+ },
+
+ install: function()
+ {
+ console.assert(!this._installed, "Already installed listener group: " + this.name);
+
+ this._installed = true;
+
+ for (var listenerData of this._listeners) {
+ if (listenerData.emitter instanceof Node)
+ listenerData.emitter.addEventListener(listenerData.type, listenerData.listener, listenerData.useCapture);
+ else
+ listenerData.emitter.addEventListener(listenerData.type, listenerData.listener, listenerData.thisObject || this._defaultThisObject);
+ }
+ },
+
+ uninstall: function(unregisterListeners)
+ {
+ console.assert(this._installed, "Trying to uninstall listener group " + this.name + ", but it isn't installed.");
+
+ this._installed = false;
+
+ for (var listenerData of this._listeners) {
+ if (listenerData.emitter instanceof Node)
+ listenerData.emitter.removeEventListener(listenerData.type, listenerData.listener, listenerData.useCapture);
+ else
+ listenerData.emitter.removeEventListener(listenerData.type, listenerData.listener, listenerData.thisObject || this._defaultThisObject);
+ }
+
+ if (unregisterListeners) {
+ this._listeners = [];
+ delete this._defaultThisObject;
+ }
+ },
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseImageUtilitiesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceImageUtilitiesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/ImageUtilities.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ImageUtilities.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/ImageUtilities.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/ImageUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,730 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+// Bump this version when making changes that affect the storage format.
+const _imageStorageFormatVersion = 1;
+
+try {
+ var _generatedImageCacheDatabase = openDatabase("com.apple.WebInspector", 1, "Web Inspector Storage Database", 5 * 1024 * 1024);
+} catch (e) {
+ // If we can't open the database it isn't the end of the world, we just will always generate
+ // the images and not cache them for better load times.
+ console.warn("Can't open database due to: " + e + ". Images will be generated instead of loaded from cache.");
+}
+
+var _initialPrefetchComplete = false;
+var _fetchedCachedImages = {};
+
+var _generatedImageUpdateFunctions = [];
+
+_prefetchCachedImagesAndUpdate();
+
+// Updates each image when the device pixel ratio changes to redraw at the new resolution.
+window.matchMedia("(-webkit-device-pixel-ratio: 1)").addListener(_devicePixelRatioChanged);
+
+// Delete old cached images from localStorage to free up space.
+// FIXME: Remove this once it has been in the builds for a while.
+try {
+ const processedFlagKey = "com.apple.WebInspector.deleted-generated-images";
+
+ if (!window.localStorage[processedFlagKey]) {
+ for (var key in window.localStorage) {
+ if (/^com\.apple\.WebInspector\.generated-(?:colored|embossed)-image-/.test(key))
+ delete window.localStorage[key];
+ }
+
+ window.localStorage[processedFlagKey] = true;
+ }
+} catch (e) {
+ // Ignore.
+}
+
+function _devicePixelRatioChanged()
+{
+ _prefetchCachedImagesAndUpdate();
+}
+
+function _registerGeneratedImageUpdateFunction(update)
+{
+ console.assert(typeof update === "function");
+
+ _generatedImageUpdateFunctions.push(update);
+
+ if (_initialPrefetchComplete)
+ update();
+}
+
+function _logSQLError(tx, error)
+{
+ console.error(error.code, error.message);
+}
+
+function _logSQLTransactionError(error)
+{
+ console.error(error.code, error.message);
+}
+
+function _prefetchCachedImagesAndUpdate()
+{
+ _fetchedCachedImages = {};
+
+ function complete()
+ {
+ _initialPrefetchComplete = true;
+
+ for (var i = 0; i < _generatedImageUpdateFunctions.length; ++i)
+ _generatedImageUpdateFunctions[i]();
+ }
+
+ if (!_generatedImageCacheDatabase) {
+ complete();
+ return;
+ }
+
+ _generatedImageCacheDatabase.transaction(function(tx) {
+ tx.executeSql("SELECT key, imageVersion, data FROM CachedImages WHERE pixelRatio = ? AND formatVersion = ?", [window.devicePixelRatio, _imageStorageFormatVersion], function(tx, result) {
+ for (var i = 0; i < result.rows.length; ++i) {
+ var row = result.rows.item(i);
+ _fetchedCachedImages[row.key] = {data: row.data, imageVersion: row.imageVersion};
+ }
+
+ complete();
+ }, function(tx, error) {
+ // The select failed. That could be because the schema changed or this is the first time.
+ // Drop the table and recreate it fresh.
+
+ tx.executeSql("DROP TABLE IF EXISTS CachedImages");
+ tx.executeSql("CREATE TABLE CachedImages (key TEXT, pixelRatio INTEGER, formatVersion NUMERIC, imageVersion NUMERIC, data BLOB, UNIQUE(key, pixelRatio))", [], null, _logSQLError);
+
+ complete();
+ });
+ }, _logSQLTransactionError);
+}
+
+function saveImageToStorage(storageKey, context, width, height, imageVersion)
+{
+ console.assert(storageKey);
+ console.assert(context);
+ console.assert(typeof width === "number");
+ console.assert(typeof height === "number");
+ console.assert(typeof imageVersion === "number");
+
+ if (!_generatedImageCacheDatabase)
+ return;
+
+ var imageData = context.getImageData(0, 0, width, height);
+ var imageDataPixels = new Uint32Array(imageData.data.buffer);
+
+ var imageDataString = "";
+ for (var i = 0; i < imageDataPixels.length; ++i)
+ imageDataString += (i ? ":" : "") + (imageDataPixels[i] ? imageDataPixels[i].toString(36) : "");
+
+ _generatedImageCacheDatabase.transaction(function(tx) {
+ tx.executeSql("INSERT OR REPLACE INTO CachedImages (key, pixelRatio, imageVersion, formatVersion, data) VALUES (?, ?, ?, ?, ?)", [storageKey, window.devicePixelRatio, imageVersion, _imageStorageFormatVersion, imageDataString], null, _logSQLError);
+ }, _logSQLTransactionError);
+}
+
+function restoreImageFromStorage(storageKey, context, width, height, imageVersion, generateCallback)
+{
+ console.assert(storageKey);
+ console.assert(context);
+ console.assert(typeof width === "number");
+ console.assert(typeof height === "number");
+ console.assert(typeof imageVersion === "number");
+ console.assert(typeof generateCallback === "function");
+
+ if (!_generatedImageCacheDatabase) {
+ generateCallback();
+ return;
+ }
+
+ var imageInfo = _fetchedCachedImages[storageKey];
+
+ if (imageInfo) {
+ // We only want to keep the data around for the first use. These images
+ // are typically only used in one place. This keeps performance good
+ // during page load and frees memory that typically won't be reused.
+ delete _fetchedCachedImages[storageKey];
+ }
+
+ if (imageInfo && (!imageInfo.data || imageInfo.imageVersion !== imageVersion)) {
+ generateCallback();
+ return;
+ }
+
+ if (imageInfo) {
+ // Restore the image from the memory cache.
+ restoreImageData(imageInfo.data);
+ } else {
+ // Try fetching the image data from the database.
+ _generatedImageCacheDatabase.readTransaction(function(tx) {
+ tx.executeSql("SELECT data FROM CachedImages WHERE key = ? AND pixelRatio = ? AND imageVersion = ? AND formatVersion = ?", [storageKey, window.devicePixelRatio, imageVersion, _imageStorageFormatVersion], function(tx, result) {
+ if (!result.rows.length) {
+ generateCallback();
+ return;
+ }
+
+ console.assert(result.rows.length === 1);
+
+ restoreImageData(result.rows.item(0).data);
+ }, function(tx, error) {
+ _logSQLError(tx, error);
+
+ generateCallback();
+ });
+ }, _logSQLTransactionError);
+ }
+
+ function restoreImageData(imageDataString)
+ {
+ var imageData = context.createImageData(width, height);
+ var imageDataPixels = new Uint32Array(imageData.data.buffer);
+
+ var imageDataArray = imageDataString.split(":");
+ if (imageDataArray.length !== imageDataPixels.length) {
+ generateCallback();
+ return;
+ }
+
+ for (var i = 0; i < imageDataArray.length; ++i) {
+ var pixelString = imageDataArray[i];
+ imageDataPixels[i] = pixelString ? parseInt(pixelString, 36) : 0;
+ }
+
+ context.putImageData(imageData, 0, 0);
+ }
+}
+
+function generateColoredImage(inputImage, red, green, blue, alpha, width, height)
+{
+ console.assert(inputImage);
+
+ if (alpha === undefined)
+ alpha = 1;
+
+ if (width === undefined)
+ width = inputImage.width;
+
+ if (height === undefined)
+ height = inputImage.height;
+
+ if (inputImage instanceof HTMLCanvasElement) {
+ // The input is already a canvas, so we can use its context directly.
+ var inputContext = inputImage.getContext("2d");
+ } else {
+ console.assert(inputImage instanceof HTMLImageElement || inputImage instanceof HTMLVideoElement);
+
+ // The input is an image/video element, so we need to draw it into
+ // a canvas to get the pixel data.
+ var inputCanvas = document.createElement("canvas");
+ inputCanvas.width = width;
+ inputCanvas.height = height;
+
+ var inputContext = inputCanvas.getContext("2d");
+ inputContext.drawImage(inputImage, 0, 0, width, height);
+ }
+
+ var imageData = inputContext.getImageData(0, 0, width, height);
+ var imageDataPixels = new Uint32Array(imageData.data.buffer);
+
+ var isLittleEndian = Uint32Array.isLittleEndian();
+
+ // Loop over the image data and set the color channels while preserving the alpha.
+ for (var i = 0; i < imageDataPixels.length; ++i) {
+ if (isLittleEndian) {
+ var existingAlpha = 0xff & (imageDataPixels[i] >> 24);
+ imageDataPixels[i] = red | green << 8 | blue << 16 | (existingAlpha * alpha) << 24;
+ } else {
+ var existingAlpha = 0xff & imageDataPixels[i];
+ imageDataPixels[i] = red << 24 | green << 16 | blue << 8 | existingAlpha * alpha;
+ }
+ }
+
+ // Make a canvas that will be returned as the result.
+ var resultCanvas = document.createElement("canvas");
+ resultCanvas.width = width;
+ resultCanvas.height = height;
+
+ var resultContext = resultCanvas.getContext("2d");
+
+ resultContext.putImageData(imageData, 0, 0);
+
+ return resultCanvas;
+}
+
+function generateColoredImagesForCSS(imagePath, specifications, width, height, canvasIdentifierPrefix)
+{
+ console.assert(imagePath);
+ console.assert(specifications);
+ console.assert(typeof width === "number");
+ console.assert(typeof height === "number");
+
+ var scaleFactor = window.devicePixelRatio;
+ var scaledWidth = width * scaleFactor;
+ var scaledHeight = height * scaleFactor;
+
+ canvasIdentifierPrefix = canvasIdentifierPrefix || "";
+
+ const storageKeyPrefix = "generated-colored-image-";
+
+ var imageElement = null;
+ var pendingImageLoadCallbacks = [];
+
+ _registerGeneratedImageUpdateFunction(update);
+
+ function imageLoaded()
+ {
+ console.assert(imageElement);
+ console.assert(imageElement.complete);
+ for (var i = 0; i < pendingImageLoadCallbacks.length; ++i)
+ pendingImageLoadCallbacks[i]();
+ pendingImageLoadCallbacks = null;
+ }
+
+ function ensureImageIsLoaded(callback)
+ {
+ if (imageElement && imageElement.complete) {
+ callback();
+ return;
+ }
+
+ console.assert(pendingImageLoadCallbacks);
+ pendingImageLoadCallbacks.push(callback);
+
+ if (imageElement)
+ return;
+
+ imageElement = document.createElement("img");
+ imageElement.addEventListener("load", imageLoaded);
+ imageElement.width = width;
+ imageElement.height = height;
+ imageElement.src = imagePath;
+ }
+
+ function restoreImages()
+ {
+ for (var canvasIdentifier in specifications) {
+ // Don't restore active images yet.
+ if (canvasIdentifier.indexOf("active") !== -1)
+ continue;
+
+ var specification = specifications[canvasIdentifier];
+ restoreImage(canvasIdentifier, specification);
+ }
+
+ function restoreActiveImages()
+ {
+ for (var canvasIdentifier in specifications) {
+ // Only restore active images here.
+ if (canvasIdentifier.indexOf("active") === -1)
+ continue;
+
+ var specification = specifications[canvasIdentifier];
+ restoreImage(canvasIdentifier, specification);
+ }
+ }
+
+ // Delay restoring the active states until later to improve the initial page load time.
+ setTimeout(restoreActiveImages, 500);
+ }
+
+ function restoreImage(canvasIdentifier, specification)
+ {
+ const storageKey = storageKeyPrefix + canvasIdentifierPrefix + canvasIdentifier;
+ const context = document.getCSSCanvasContext("2d", canvasIdentifierPrefix + canvasIdentifier, scaledWidth, scaledHeight);
+ restoreImageFromStorage(storageKey, context, scaledWidth, scaledHeight, specification.imageVersion || 0, function() {
+ ensureImageIsLoaded(generateImage.bind(null, canvasIdentifier, specification));
+ });
+ }
+
+ function update()
+ {
+ restoreImages();
+ }
+
+ function generateImage(canvasIdentifier, specification)
+ {
+ console.assert(specification.fillColor instanceof Array);
+ console.assert(specification.fillColor.length === 3 || specification.fillColor.length === 4);
+
+ const context = document.getCSSCanvasContext("2d", canvasIdentifierPrefix + canvasIdentifier, scaledWidth, scaledHeight);
+ context.save();
+ context.scale(scaleFactor, scaleFactor);
+
+ if (specification.shadowColor) {
+ context.shadowOffsetX = specification.shadowOffsetX || 0;
+ context.shadowOffsetY = specification.shadowOffsetY || 0;
+ context.shadowBlur = specification.shadowBlur || 0;
+
+ if (specification.shadowColor instanceof Array) {
+ if (specification.shadowColor.length === 3)
+ context.shadowColor = "rgb(" + specification.shadowColor.join(", ") + ")";
+ else if (specification.shadowColor.length === 4)
+ context.shadowColor = "rgba(" + specification.shadowColor.join(", ") + ")";
+ } else
+ context.shadowColor = specification.shadowColor;
+ }
+
+ var coloredImage = generateColoredImage(imageElement, specification.fillColor[0], specification.fillColor[1], specification.fillColor[2], specification.fillColor[3], scaledWidth, scaledHeight);
+ context.drawImage(coloredImage, 0, 0, width, height);
+
+ const storageKey = storageKeyPrefix + canvasIdentifierPrefix + canvasIdentifier;
+ saveImageToStorage(storageKey, context, scaledWidth, scaledHeight, specification.imageVersion || 0);
+ context.restore();
+ }
+}
+
+function generateEmbossedImages(src, width, height, states, canvasIdentifierCallback, ignoreCache)
+{
+ console.assert(src);
+ console.assert(typeof width === "number");
+ console.assert(typeof height === "number");
+ console.assert(states);
+ console.assert(states.Normal);
+ console.assert(states.Active);
+ console.assert(typeof canvasIdentifierCallback === "function");
+
+ var scaleFactor = window.devicePixelRatio;
+ var scaledWidth = width * scaleFactor;
+ var scaledHeight = height * scaleFactor;
+
+ // Bump this version when making changes that affect the result image.
+ const imageVersion = 2;
+
+ const storageKeyPrefix = "generated-embossed-image-";
+
+ var image = null;
+ var pendingImageLoadCallbacks = [];
+
+ _registerGeneratedImageUpdateFunction(update);
+
+ function imageLoaded()
+ {
+ console.assert(image);
+ console.assert(image.complete);
+ for (var i = 0; i < pendingImageLoadCallbacks.length; ++i)
+ pendingImageLoadCallbacks[i]();
+ pendingImageLoadCallbacks = null;
+ }
+
+ function ensureImageIsLoaded(callback)
+ {
+ if (image && image.complete) {
+ callback();
+ return;
+ }
+
+ console.assert(pendingImageLoadCallbacks);
+ pendingImageLoadCallbacks.push(callback);
+
+ if (image)
+ return;
+
+ image = document.createElement("img");
+ image.addEventListener("load", imageLoaded);
+ image.width = width;
+ image.height = height;
+ image.src = src;
+ }
+
+ function restoreImages()
+ {
+ restoreImage(states.Normal);
+ if (states.Focus)
+ restoreImage(states.Focus);
+
+ function restoreActiveImages()
+ {
+ restoreImage(states.Active);
+ if (states.ActiveFocus)
+ restoreImage(states.ActiveFocus);
+ }
+
+ // Delay restoring the active states until later to improve the initial page load time.
+ setTimeout(restoreActiveImages, 500);
+ }
+
+ function restoreImage(state)
+ {
+ const storageKey = storageKeyPrefix + canvasIdentifierCallback(state);
+ const context = document.getCSSCanvasContext("2d", canvasIdentifierCallback(state), scaledWidth, scaledHeight);
+ restoreImageFromStorage(storageKey, context, scaledWidth, scaledHeight, imageVersion, function() {
+ ensureImageIsLoaded(generateImage.bind(null, state));
+ });
+ }
+
+ function update()
+ {
+ if (ignoreCache)
+ generateImages();
+ else
+ restoreImages();
+ }
+
+ function generateImages()
+ {
+ ensureImageIsLoaded(generateImage.bind(null, states.Normal));
+
+ if (states.Focus)
+ ensureImageIsLoaded(generateImage.bind(null, states.Focus));
+
+ function generateActiveImages()
+ {
+ ensureImageIsLoaded(generateImage.bind(null, states.Active));
+
+ if (states.ActiveFocus)
+ ensureImageIsLoaded(generateImage.bind(null, states.ActiveFocus));
+ }
+
+ // Delay generating the active states until later to improve the initial page load time.
+ setTimeout(generateActiveImages, 500);
+ }
+
+ function generateImage(state)
+ {
+ const depth = 1 * scaleFactor;
+ const shadowDepth = depth;
+ const shadowBlur = depth - 1;
+ const glowBlur = 2;
+
+ const context = document.getCSSCanvasContext("2d", canvasIdentifierCallback(state), scaledWidth, scaledHeight);
+ context.save();
+ context.scale(scaleFactor, scaleFactor);
+
+ context.clearRect(0, 0, width, height);
+
+ if (depth > 0) {
+ // Use scratch canvas so we can apply the draw the white drop shadow
+ // to the whole glyph at the end.
+
+ var scratchCanvas = document.createElement("canvas");
+ scratchCanvas.width = scaledWidth;
+ scratchCanvas.height = scaledHeight;
+
+ var scratchContext = scratchCanvas.getContext("2d");
+ scratchContext.scale(scaleFactor, scaleFactor);
+ } else
+ var scratchContext = context;
+
+ var gradient = scratchContext.createLinearGradient(0, 0, 0, height);
+ if (state === states.Active) {
+ gradient.addColorStop(0, "rgb(60, 60, 60)");
+ gradient.addColorStop(1, "rgb(100, 100, 100)");
+ } else if (state === states.Focus) {
+ gradient.addColorStop(0, "rgb(50, 135, 200)");
+ gradient.addColorStop(1, "rgb(60, 155, 225)");
+ } else if (state === states.ActiveFocus) {
+ gradient.addColorStop(0, "rgb(30, 115, 185)");
+ gradient.addColorStop(1, "rgb(40, 135, 200)");
+ } else {
+ gradient.addColorStop(0, "rgb(90, 90, 90)");
+ gradient.addColorStop(1, "rgb(145, 145, 145)");
+ }
+
+ scratchContext.fillStyle = gradient;
+ scratchContext.fillRect(0, 0, width, height);
+
+ if (depth > 0) {
+ // Invert the image to use as a reverse image mask for the inner shadows.
+ // Pass in the color to use for the opaque areas to prevent "black halos"
+ // later when applying the final image mask.
+
+ if (state === states.Active)
+ var invertedImage = _invertMaskImage(image, 60, 60, 60);
+ else if (state === states.Focus)
+ var invertedImage = _invertMaskImage(image, 45, 145, 210);
+ else if (state === states.ActiveFocus)
+ var invertedImage = _invertMaskImage(image, 35, 125, 195);
+ else
+ var invertedImage = _invertMaskImage(image, 90, 90, 90);
+
+ if (state === states.Focus) {
+ // Double draw the blurry inner shadow to get the right effect.
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(10, 95, 150)", invertedImage);
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(10, 95, 150)", invertedImage);
+
+ // Draw the inner shadow.
+ _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgb(0, 80, 170)", invertedImage);
+ } else if (state === states.ActiveFocus) {
+ // Double draw the blurry inner shadow to get the right effect.
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(0, 80, 100)", invertedImage);
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(0, 80, 100)", invertedImage);
+
+ // Draw the inner shadow.
+ _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgb(0, 65, 150)", invertedImage);
+ } else {
+ // Double draw the blurry inner shadow to get the right effect.
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgba(0, 0, 0, 1)", invertedImage);
+ _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgba(0, 0, 0, 1)", invertedImage);
+
+ // Draw the inner shadow.
+ _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgba(0, 0, 0, 0.6)", invertedImage);
+ }
+ }
+
+ // Apply the mask to keep just the inner shape of the glyph.
+ _applyImageMask(scratchContext, image);
+
+ // Draw the white drop shadow.
+ if (depth > 0)
+ _drawImageShadow(context, 0, shadowDepth, shadowBlur, "rgba(255, 255, 255, 0.6)", scratchCanvas);
+
+ // Draw a subtle glow for the focus states.
+ if (state === states.Focus || state === states.ActiveFocus)
+ _drawImageShadow(context, 0, 0, glowBlur, "rgba(20, 100, 220, 0.4)", scratchCanvas);
+
+ if (!ignoreCache) {
+ const storageKey = storageKeyPrefix + canvasIdentifierCallback(state);
+ saveImageToStorage(storageKey, context, scaledWidth, scaledHeight, imageVersion);
+ }
+
+ context.restore();
+ }
+
+ function _drawImageShadow(context, xOffset, yOffset, blur, color, image) {
+ context.save();
+
+ context.shadowOffsetX = xOffset || 0;
+ context.shadowOffsetY = yOffset || 0;
+ context.shadowBlur = blur || 0;
+ context.shadowColor = color || "black";
+
+ context.drawImage(image, 0, 0, width, height);
+
+ context.restore();
+ }
+
+ function _invertMaskImage(image, red, green, blue) {
+ var bufferCanvas = document.createElement("canvas");
+ bufferCanvas.width = scaledWidth;
+ bufferCanvas.height = scaledHeight;
+
+ var buffer = bufferCanvas.getContext("2d");
+ buffer.scale(scaleFactor, scaleFactor);
+ buffer.drawImage(image, 0, 0, width, height);
+
+ var imageData = buffer.getImageData(0, 0, scaledWidth, scaledHeight);
+ var imageDataPixels = new Uint32Array(imageData.data.buffer);
+
+ red = red || 0;
+ green = green || 0;
+ blue = blue || 0;
+
+ var isLittleEndian = Uint32Array.isLittleEndian();
+
+ for (var i = 0; i < imageDataPixels.length; ++i) {
+ if (isLittleEndian) {
+ var existingAlpha = 0xff & (imageDataPixels[i] >> 24);
+ imageDataPixels[i] = red | green << 8 | blue << 16 | (255 - existingAlpha) << 24;
+ } else {
+ var existingAlpha = 0xff & imageDataPixels[i];
+ imageDataPixels[i] = red << 24 | green << 16 | blue << 8 | 255 - existingAlpha;
+ }
+ }
+
+ buffer.putImageData(imageData, 0, 0);
+
+ return bufferCanvas;
+ }
+
+ function _applyImageMask(context, image) {
+ var maskCanvas = document.createElement("canvas");
+ maskCanvas.width = scaledWidth;
+ maskCanvas.height = scaledHeight;
+
+ var mask = maskCanvas.getContext("2d");
+ mask.scale(scaleFactor, scaleFactor);
+ mask.drawImage(image, 0, 0, width, height);
+
+ var imageData = context.getImageData(0, 0, scaledWidth, scaledHeight);
+ var imageDataPixels = imageData.data;
+
+ var maskImageDataPixels = mask.getImageData(0, 0, scaledWidth, scaledHeight).data;
+
+ for (var i = 3; i < imageDataPixels.length; i += 4)
+ imageDataPixels[i] = maskImageDataPixels[i] * (imageDataPixels[i] / 255);
+
+ context.putImageData(imageData, 0, 0);
+ }
+}
+
+
+var svgImageCache = {};
+
+function loadSVGImageDocumentElement(url, callback)
+{
+ function invokeCallbackWithDocument(svgText) {
+ var parser = new DOMParser;
+ var doc = parser.parseFromString(svgText, "image/svg+xml");
+ callback(doc.documentElement);
+ }
+
+ function imageLoad(event) {
+ if (xhr.status === 0 || xhr.status === 200) {
+ var svgText = xhr.responseText;
+ svgImageCache[url] = svgText;
+ invokeCallbackWithDocument(svgText);
+ } else {
+ console.error("Unexpected XHR status (" + xhr.status + ") loading SVG image: " + url);
+ callback(null);
+ }
+ }
+
+ function imageError(event) {
+ console.error("Unexpected failure loading SVG image: " + url);
+ callback(null);
+ }
+
+ var cachedSVGText = svgImageCache[url];
+ if (cachedSVGText) {
+ invokeCallbackWithDocument(cachedSVGText);
+ return;
+ }
+
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", url, true);
+ xhr.addEventListener("load", imageLoad);
+ xhr.addEventListener("error", imageError);
+ xhr.send();
+}
+
+function wrappedSVGDocument(url, className, title, callback)
+{
+ loadSVGImageDocumentElement(url, function(svgDocument) {
+ if (!svgDocument) {
+ callback(null);
+ return;
+ }
+
+ var wrapper = document.createElement("div");
+ if (className)
+ wrapper.className = className;
+ if (title)
+ wrapper.title = title;
+ wrapper.appendChild(svgDocument);
+
+ callback(wrapper);
+ });
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseLoadLocalizedStringsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLoadLocalizedStringsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LoadLocalizedStrings.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+(function() {
+ if (WebInspector.dontLocalizeUserInterface)
+ return;
+
+ var localizedStringsURL = InspectorFrontendHost.localizedStringsURL();
+ console.assert(localizedStringsURL);
+ if (localizedStringsURL)
+ document.write("<script src=\"" + localizedStringsURL + "\"></script>");
+})();
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMIMETypeUtilitiesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceMIMETypeUtilitiesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/MIMETypeUtilities.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.fileExtensionForURL = function(url)
+{
+ var lastPathComponent = parseURL(url).lastPathComponent;
+ if (!lastPathComponent)
+ return "";
+
+ var index = lastPathComponent.indexOf(".");
+ if (index === -1)
+ return "";
+
+ return lastPathComponent.substr(index + 1);
+};
+
+WebInspector.mimeTypeForFileExtension = function(extension)
+{
+ const extensionToMIMEType = {
+ // Document types.
+ "html": "text/html",
+ "xhtml": "application/xhtml+xml",
+ "xml": "text/xml",
+
+ // Script types.
+ "js": "text/javascript",
+ "json": "application/json",
+ "clj": "text/x-clojure",
+ "coffee": "text/x-coffeescript",
+ "ls": "text/x-livescript",
+ "ts": "text/typescript",
+
+ // Stylesheet types.
+ "css": "text/css",
+ "less": "text/x-less",
+ "sass": "text/x-sass",
+ "scss": "text/x-scss",
+
+ // Image types.
+ "bmp": "image/bmp",
+ "gif": "image/gif",
+ "jpeg": "image/jpeg",
+ "jpg": "image/jpeg",
+ "pdf": "application/pdf",
+ "png": "image/png",
+ "tif": "image/tiff",
+ "tiff": "image/tiff",
+
+ // Font types and Media types are ignored for now.
+
+ // Miscellaneous types.
+ "svg": "image/svg+xml",
+ "txt": "text/plain",
+ "xsl": "text/xsl"
+ };
+
+ return extensionToMIMEType[extension] || null;
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjsfromrev164541trunkSourceWebInspectorUIUserInterfaceMainjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Main.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1826 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Notification = {
+ GlobalModifierKeysDidChange: "global-modifiers-did-change",
+ PageArchiveStarted: "page-archive-started",
+ PageArchiveEnded: "page-archive-ended"
+};
+
+WebInspector.ContentViewCookieType = {
+ ApplicationCache: "application-cache",
+ CookieStorage: "cookie-storage",
+ Database: "database",
+ DatabaseTable: "database-table",
+ DOMStorage: "dom-storage",
+ Resource: "resource", // includes Frame too.
+ Timelines: "timelines",
+};
+
+WebInspector.DebuggableType = {
+ Web: "web",
+ JavaScript: "javascript"
+};
+
+WebInspector.SelectedSidebarPanelCookieKey = "selected-sidebar-panel";
+WebInspector.TypeIdentifierCookieKey = "represented-object-type";
+
+WebInspector.loaded = function()
+{
+ // Tell the InspectorFrontendHost we loaded first to establish communication with InspectorBackend.
+ InspectorFrontendHost.loaded();
+
+ // Initialize WebSocket to communication
+ this._initializeWebSocketIfNeeded();
+
+ // Register observers for events from the InspectorBackend.
+ if (InspectorBackend.registerInspectorDispatcher)
+ InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
+ if (InspectorBackend.registerPageDispatcher)
+ InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
+ if (InspectorBackend.registerConsoleDispatcher)
+ InspectorBackend.registerConsoleDispatcher(new WebInspector.ConsoleObserver);
+ if (InspectorBackend.registerNetworkDispatcher)
+ InspectorBackend.registerNetworkDispatcher(new WebInspector.NetworkObserver);
+ if (InspectorBackend.registerDOMDispatcher)
+ InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
+ if (InspectorBackend.registerDebuggerDispatcher)
+ InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerObserver);
+ if (InspectorBackend.registerDatabaseDispatcher)
+ InspectorBackend.registerDatabaseDispatcher(new WebInspector.DatabaseObserver);
+ if (InspectorBackend.registerDOMStorageDispatcher)
+ InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageObserver);
+ if (InspectorBackend.registerApplicationCacheDispatcher)
+ InspectorBackend.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheObserver);
+ if (InspectorBackend.registerTimelineDispatcher)
+ InspectorBackend.registerTimelineDispatcher(new WebInspector.TimelineObserver);
+ if (InspectorBackend.registerProfilerDispatcher)
+ InspectorBackend.registerProfilerDispatcher(new WebInspector.LegacyProfilerObserver);
+ if (InspectorBackend.registerCSSDispatcher)
+ InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
+ if (InspectorBackend.registerLayerTreeDispatcher)
+ InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeObserver);
+ if (InspectorBackend.registerRuntimeDispatcher)
+ InspectorBackend.registerRuntimeDispatcher(new WebInspector.RuntimeObserver);
+
+ // Enable agents.
+ if (window.InspectorAgent)
+ InspectorAgent.enable();
+
+ // Perform one-time tasks.
+ WebInspector.CSSCompletions.requestCSSNameCompletions();
+ this._generateDisclosureTriangleImages();
+
+ // Listen for the ProvisionalLoadStarted event before registering for events so our code gets called before any managers or sidebars.
+ // This lets us save a state cookie before any managers or sidebars do any resets that would affect state (namely TimelineManager).
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._provisionalLoadStarted, this);
+
+ // Create the singleton managers next, before the user interface elements, so the user interface can register
+ // as event listeners on these managers.
+ this.branchManager = new WebInspector.BranchManager;
+ this.frameResourceManager = new WebInspector.FrameResourceManager;
+ this.storageManager = new WebInspector.StorageManager;
+ this.domTreeManager = new WebInspector.DOMTreeManager;
+ this.cssStyleManager = new WebInspector.CSSStyleManager;
+ this.logManager = new WebInspector.LogManager;
+ this.issueManager = new WebInspector.IssueManager;
+ this.runtimeManager = new WebInspector.RuntimeManager;
+ this.applicationCacheManager = new WebInspector.ApplicationCacheManager;
+ this.timelineManager = new WebInspector.TimelineManager;
+ this.legacyProfileManager = new WebInspector.LegacyProfileManager;
+ this.debuggerManager = new WebInspector.DebuggerManager;
+ this.sourceMapManager = new WebInspector.SourceMapManager;
+ this.layerTreeManager = new WebInspector.LayerTreeManager;
+ this.dashboardManager = new WebInspector.DashboardManager;
+ this.probeManager = new WebInspector.ProbeManager;
+
+ // Enable the Console Agent after creating the singleton managers.
+ if (window.ConsoleAgent)
+ ConsoleAgent.enable();
+
+ // Register for events.
+ this.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
+ this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.InspectModeStateChanged, this._inspectModeStateChanged, this);
+ this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
+ this.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ document.addEventListener("DOMContentLoaded", this.contentLoaded.bind(this));
+
+ document.addEventListener("beforecopy", this._beforecopy.bind(this));
+ document.addEventListener("copy", this._copy.bind(this));
+
+ document.addEventListener("click", this._mouseWasClicked.bind(this));
+ document.addEventListener("dragover", this._dragOver.bind(this));
+ document.addEventListener("focus", WebInspector._focusChanged.bind(this), true);
+
+ window.addEventListener("focus", this._windowFocused.bind(this));
+ window.addEventListener("blur", this._windowBlurred.bind(this));
+ window.addEventListener("resize", this._windowResized.bind(this));
+ window.addEventListener("keydown", this._windowKeyDown.bind(this));
+ window.addEventListener("keyup", this._windowKeyUp.bind(this));
+ window.addEventListener("mousemove", this._mouseMoved.bind(this), true);
+ window.addEventListener("pagehide", this._pageHidden.bind(this));
+
+ // Create settings.
+ this._lastInspectorViewStateCookieSetting = new WebInspector.Setting("last-content-view-state-cookie", {});
+
+ this._navigationSidebarCollapsedSetting = new WebInspector.Setting("navigation-sidebar-collapsed", false);
+ this._navigationSidebarWidthSetting = new WebInspector.Setting("navigation-sidebar-width", null);
+
+ this._lastSelectedDetailsSidebarPanelSetting = new WebInspector.Setting("last-selected-details-sidebar-panel", null);
+ this._detailsSidebarCollapsedSetting = new WebInspector.Setting("details-sidebar-collapsed", true);
+ this._detailsSidebarWidthSetting = new WebInspector.Setting("details-sidebar-width", null);
+
+ this._toolbarDockedRightDisplayModeSetting = new WebInspector.Setting("toolbar-docked-right-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
+ this._toolbarDockedRightSizeModeSetting = new WebInspector.Setting("toolbar-docked-right-size-mode",WebInspector.Toolbar.SizeMode.Normal);
+
+ this._toolbarDockedBottomDisplayModeSetting = new WebInspector.Setting("toolbar-docked-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
+ this._toolbarDockedBottomSizeModeSetting = new WebInspector.Setting("toolbar-docked-size-mode",WebInspector.Toolbar.SizeMode.Small);
+
+ this._toolbarUndockedDisplayModeSetting = new WebInspector.Setting("toolbar-undocked-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
+ this._toolbarUndockedSizeModeSetting = new WebInspector.Setting("toolbar-undocked-size-mode",WebInspector.Toolbar.SizeMode.Normal);
+
+ this._showingSplitConsoleSetting = new WebInspector.Setting("showing-split-console", false);
+ this._splitConsoleHeightSetting = new WebInspector.Setting("split-console-height", 150);
+
+ this._dockButtonToggledSetting = new WebInspector.Setting("dock-button-toggled", false);
+
+ this.showShadowDOMSetting = new WebInspector.Setting("show-shadow-dom", false);
+
+ this.mouseCoords = {
+ x: 0,
+ y: 0
+ };
+
+ this._windowKeydownListeners = [];
+}
+
+WebInspector.contentLoaded = function()
+{
+ // Check for a nightly build by looking for a plus in the version number and a small number of stylesheets (indicating combined resources).
+ var versionMatch = / AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);
+ if (versionMatch && versionMatch[1].indexOf("+") !== -1 && document.styleSheets.length < 10)
+ document.body.classList.add("nightly-build");
+
+ this.debuggableType = InspectorFrontendHost.debuggableType() === "web" ? WebInspector.DebuggableType.Web : WebInspector.DebuggableType.JavaScript;
+ document.body.classList.add(this.debuggableType);
+
+ // Create the user interface elements.
+ this.toolbar = new WebInspector.Toolbar(document.getElementById("toolbar"));
+ this.toolbar.addEventListener(WebInspector.Toolbar.Event.DisplayModeDidChange, this._toolbarDisplayModeDidChange, this);
+ this.toolbar.addEventListener(WebInspector.Toolbar.Event.SizeModeDidChange, this._toolbarSizeModeDidChange, this);
+
+ var contentElement = document.getElementById("content");
+ contentElement.setAttribute("role", "main");
+ contentElement.setAttribute("aria-label", WebInspector.UIString("Content"));
+
+ this.contentBrowser = new WebInspector.ContentBrowser(document.getElementById("content-browser"), this);
+ this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this._contentBrowserRepresentedObjectsDidChange, this);
+ this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
+
+ this.splitContentBrowser = new WebInspector.ContentBrowser(document.getElementById("split-content-browser"), this, true);
+ this.splitContentBrowser.navigationBar.element.addEventListener("mousedown", this._consoleResizerMouseDown.bind(this));
+
+ this.quickConsole = new WebInspector.QuickConsole(document.getElementById("quick-console"));
+ this.quickConsole.addEventListener(WebInspector.QuickConsole.Event.DidResize, this._quickConsoleDidResize, this);
+
+ this._consoleRepresentedObject = new WebInspector.LogObject;
+ this._consoleTreeElement = new WebInspector.LogTreeElement(this._consoleRepresentedObject);
+ this.consoleContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(this._consoleRepresentedObject);
+
+ // FIXME: The sidebars should be flipped in RTL languages.
+ this.leftSidebar = this.navigationSidebar = new WebInspector.Sidebar(document.getElementById("navigation-sidebar"), WebInspector.Sidebar.Sides.Left);
+ this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._sidebarCollapsedStateDidChange, this);
+ this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
+ this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected, this._navigationSidebarPanelSelected, this);
+
+ this.rightSidebar = this.detailsSidebar = new WebInspector.Sidebar(document.getElementById("details-sidebar"), WebInspector.Sidebar.Sides.Right, null, null, WebInspector.UIString("Details"));
+ this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._sidebarCollapsedStateDidChange, this);
+ this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
+ this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected, this._detailsSidebarPanelSelected, this);
+
+ this._reloadPageKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "R", this._reloadPage.bind(this));
+ this._reloadPageIgnoringCacheKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "R", this._reloadPageIgnoringCache.bind(this));
+
+ this._consoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this.toggleConsoleView.bind(this));
+
+ this._inspectModeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "C", this._toggleInspectMode.bind(this));
+
+ this._undoKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "Z", this._undoKeyboardShortcut.bind(this));
+ this._redoKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "Z", this._redoKeyboardShortcut.bind(this));
+ this._undoKeyboardShortcut.implicitlyPreventsDefault = this._redoKeyboardShortcut.implicitlyPreventsDefault = false;
+
+ this.undockButtonNavigationItem = new WebInspector.ToggleControlToolbarItem("undock", WebInspector.UIString("Detach into separate window"), "", "Images/Undock.svg", "", 16, 14);
+ this.undockButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._undock, this);
+
+ this.closeButtonNavigationItem = new WebInspector.ControlToolbarItem("dock-close", WebInspector.UIString("Close"), "Images/Close.svg", 16, 14);
+ this.closeButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.close, this);
+
+ this.toolbar.addToolbarItem(this.closeButtonNavigationItem, WebInspector.Toolbar.Section.Control);
+ this.toolbar.addToolbarItem(this.undockButtonNavigationItem, WebInspector.Toolbar.Section.Control);
+
+ this.resourceSidebarPanel = new WebInspector.ResourceSidebarPanel;
+ this.timelineSidebarPanel = new WebInspector.TimelineSidebarPanel;
+ this.debuggerSidebarPanel = new WebInspector.DebuggerSidebarPanel;
+
+ this.navigationSidebar.addSidebarPanel(this.resourceSidebarPanel);
+ // FIXME: Enable timelines panel for JavaScript inspection.
+ if (this.debuggableType !== WebInspector.DebuggableType.JavaScript)
+ this.navigationSidebar.addSidebarPanel(this.timelineSidebarPanel);
+ this.navigationSidebar.addSidebarPanel(this.debuggerSidebarPanel);
+
+ this.toolbar.addToolbarItem(this.resourceSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
+ // FIXME: Enable timelines panel for JavaScript inspection.
+ if (this.debuggableType !== WebInspector.DebuggableType.JavaScript)
+ this.toolbar.addToolbarItem(this.timelineSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
+ this.toolbar.addToolbarItem(this.debuggerSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
+
+ // The toolbar button for the console.
+ var toolTip = WebInspector.UIString("Show console (%s)").format(WebInspector._consoleKeyboardShortcut.displayName);
+ var activatedToolTip = WebInspector.UIString("Hide console (%s)").format(WebInspector._consoleKeyboardShortcut.displayName);
+ this._consoleToolbarButton = new WebInspector.ActivateButtonToolbarItem("console", toolTip, activatedToolTip, WebInspector.UIString("Console"), "Images/NavigationItemLog.svg");
+ this._consoleToolbarButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleConsoleView, this);
+ this.toolbar.addToolbarItem(this._consoleToolbarButton, WebInspector.Toolbar.Section.Center);
+
+ this.toolbar.addToolbarItem(this.dashboardManager.toolbarItem, WebInspector.Toolbar.Section.Center);
+
+ // The toolbar button for node inspection.
+ if (this.debuggableType === WebInspector.DebuggableType.Web) {
+ var toolTip = WebInspector.UIString("Enable point to inspect mode (%s)").format(WebInspector._inspectModeKeyboardShortcut.displayName);
+ var activatedToolTip = WebInspector.UIString("Disable point to inspect mode (%s)").format(WebInspector._inspectModeKeyboardShortcut.displayName);
+ this._inspectModeToolbarButton = new WebInspector.ActivateButtonToolbarItem("inspect", toolTip, activatedToolTip, WebInspector.UIString("Inspect"), "Images/Crosshair.svg");
+ this._inspectModeToolbarButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleInspectMode, this);
+ this.toolbar.addToolbarItem(this._inspectModeToolbarButton, WebInspector.Toolbar.Section.Center);
+ }
+
+ this.resourceDetailsSidebarPanel = new WebInspector.ResourceDetailsSidebarPanel;
+ this.domNodeDetailsSidebarPanel = new WebInspector.DOMNodeDetailsSidebarPanel;
+ this.cssStyleDetailsSidebarPanel = new WebInspector.CSSStyleDetailsSidebarPanel;
+ this.applicationCacheDetailsSidebarPanel = new WebInspector.ApplicationCacheDetailsSidebarPanel;
+ this.scopeChainDetailsSidebarPanel = new WebInspector.ScopeChainDetailsSidebarPanel;
+ this.probeDetailsSidebarPanel = new WebInspector.ProbeDetailsSidebarPanel;
+
+ this.detailsSidebarPanels = [this.resourceDetailsSidebarPanel, this.applicationCacheDetailsSidebarPanel, this.scopeChainDetailsSidebarPanel,
+ this.domNodeDetailsSidebarPanel, this.cssStyleDetailsSidebarPanel, this.probeDetailsSidebarPanel];
+
+ if (window.LayerTreeAgent) {
+ this.layerTreeSidebarPanel = new WebInspector.LayerTreeSidebarPanel;
+ this.detailsSidebarPanels.splice(this.detailsSidebarPanels.length - 1, 0, this.layerTreeSidebarPanel);
+ }
+
+ this.modifierKeys = {altKey: false, metaKey: false, shiftKey: false};
+
+ // Add the items in reverse order since the last items appear and disappear the least. So they
+ // will not cause the other buttons to visually shift around, keeping things more stable.
+ for (var i = this.detailsSidebarPanels.length - 1; i >= 0; --i) {
+ var toolbarItem = this.detailsSidebarPanels[i].toolbarItem;
+ toolbarItem.hidden = true;
+ this.toolbar.addToolbarItem(toolbarItem, WebInspector.Toolbar.Section.Right);
+ }
+
+ this.toolbar.element.addEventListener("mousedown", this._toolbarMouseDown.bind(this));
+ document.getElementById("docked-resizer").addEventListener("mousedown", this._dockedResizerMouseDown.bind(this));
+
+ this._updateToolbarHeight();
+
+ if (this._navigationSidebarWidthSetting.value)
+ this.navigationSidebar.width = this._navigationSidebarWidthSetting.value;
+
+ if (this._detailsSidebarWidthSetting.value)
+ this.detailsSidebar.width = this._detailsSidebarWidthSetting.value;
+
+ // Update the docked state based on the query string passed when the Web Inspector was loaded.
+ this.updateDockedState(parseLocationQueryParameters().dockSide || "undocked");
+
+ // Tell the frontend API we are loaded so any pending frontend commands can be dispatched.
+ InspectorFrontendAPI.loadCompleted();
+
+ // Set collapsed after loading the pending frontend commands are dispatched so only the final
+ // selected sidebar panel gets shown and has a say in what content view gets shown.
+ this.navigationSidebar.collapsed = this._navigationSidebarCollapsedSetting.value;
+
+ // If InspectorFrontendAPI didn't show a content view, then try to restore the last saved view state.
+ if (!this.contentBrowser.currentContentView && !this.ignoreLastContentCookie)
+ this._restoreInspectorViewStateFromCookie(this._lastInspectorViewStateCookieSetting.value);
+
+ this._updateSplitConsoleHeight(this._splitConsoleHeightSetting.value);
+
+ if (this._showingSplitConsoleSetting.value)
+ this.showSplitConsole();
+}
+
+WebInspector.sidebarPanelForCurrentContentView = function()
+{
+ var currentContentView = this.contentBrowser.currentContentView;
+ if (!currentContentView)
+ return null;
+ return this.sidebarPanelForRepresentedObject(currentContentView.representedObject);
+}
+
+WebInspector.sidebarPanelForRepresentedObject = function(representedObject)
+{
+ if (representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource ||
+ representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.ContentFlow)
+ return this.resourceSidebarPanel;
+
+ if (representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
+ representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
+ representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
+ representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
+ return this.resourceSidebarPanel;
+
+ if (representedObject instanceof WebInspector.TimelineRecording)
+ return this.timelineSidebarPanel;
+
+ // The console does not have a sidebar.
+ if (representedObject instanceof WebInspector.LogObject)
+ return null;
+
+ console.error("Unknown representedObject: ", representedObject);
+ return null;
+}
+
+WebInspector.contentBrowserTreeElementForRepresentedObject = function(contentBrowser, representedObject)
+{
+ // The console does not have a sidebar, so return a tree element here so something is shown.
+ if (representedObject instanceof WebInspector.LogObject)
+ return this._consoleTreeElement;
+
+ var sidebarPanel = this.sidebarPanelForRepresentedObject(representedObject);
+ if (sidebarPanel)
+ return sidebarPanel.treeElementForRepresentedObject(representedObject);
+ return null;
+}
+
+WebInspector.updateWindowTitle = function()
+{
+ var mainFrame = this.frameResourceManager.mainFrame;
+ console.assert(mainFrame);
+
+ var urlComponents = mainFrame.mainResource.urlComponents;
+
+ var lastPathComponent;
+ try {
+ lastPathComponent = decodeURIComponent(urlComponents.lastPathComponent || "");
+ } catch (e) {
+ lastPathComponent = urlComponents.lastPathComponent;
+ }
+
+ // Build a title based on the URL components.
+ if (urlComponents.host && lastPathComponent)
+ var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + lastPathComponent;
+ else if (urlComponents.host)
+ var title = this.displayNameForHost(urlComponents.host);
+ else if (lastPathComponent)
+ var title = lastPathComponent;
+ else
+ var title = mainFrame.url;
+
+ // The name "inspectedURLChanged" sounds like the whole URL is required, however this is only
+ // used for updating the window title and it can be any string.
+ InspectorFrontendHost.inspectedURLChanged(title);
+}
+
+WebInspector.updateDockedState = function(side)
+{
+ if (this._dockSide === side)
+ return;
+
+ this._dockSide = side;
+
+ this.docked = side !== "undocked";
+
+ this._ignoreToolbarModeDidChangeEvents = true;
+
+ if (side === "bottom") {
+ document.body.classList.add("docked");
+ document.body.classList.add("bottom");
+
+ document.body.classList.remove("window-inactive");
+ document.body.classList.remove("right");
+
+ this.toolbar.displayMode = this._toolbarDockedBottomDisplayModeSetting.value;
+ this.toolbar.sizeMode = this._toolbarDockedBottomSizeModeSetting.value;
+ } else if (side === "right") {
+ document.body.classList.add("docked");
+ document.body.classList.add("right");
+
+ document.body.classList.remove("window-inactive");
+ document.body.classList.remove("bottom");
+
+ this.toolbar.displayMode = this._toolbarDockedRightDisplayModeSetting.value;
+ this.toolbar.sizeMode = this._toolbarDockedRightSizeModeSetting.value;
+ } else {
+ document.body.classList.remove("docked");
+ document.body.classList.remove("right");
+ document.body.classList.remove("bottom");
+
+ this.toolbar.displayMode = this._toolbarUndockedDisplayModeSetting.value;
+ this.toolbar.sizeMode = this._toolbarUndockedSizeModeSetting.value;
+ }
+
+ this._ignoreToolbarModeDidChangeEvents = false;
+
+ this._updateDockNavigationItems();
+ this._updateToolbarHeight();
+}
+
+WebInspector.handlePossibleLinkClick = function(event, frame, alwaysOpenExternally)
+{
+ var anchorElement = event.target.enclosingNodeOrSelfWithNodeName("a");
+ if (!anchorElement || !anchorElement.href)
+ return false;
+
+ if (WebInspector.isBeingEdited(anchorElement)) {
+ // Don't follow the link when it is being edited.
+ return false;
+ }
+
+ // Prevent the link from navigating, since we don't do any navigation by following links normally.
+ event.preventDefault();
+ event.stopPropagation();
+
+ this.openURL(anchorElement.href, frame, false, anchorElement.lineNumber);
+
+ return true;
+}
+
+WebInspector.openURL = function(url, frame, alwaysOpenExternally, lineNumber)
+{
+ console.assert(url);
+ if (!url)
+ return;
+
+ // If alwaysOpenExternally is not defined, base it off the command/meta key for the current event.
+ if (alwaysOpenExternally === undefined || alwaysOpenExternally === null)
+ alwaysOpenExternally = window.event ? window.event.metaKey : false;
+
+ if (alwaysOpenExternally) {
+ InspectorFrontendHost.openInNewTab(url);
+ return;
+ }
+
+ var parsedURL = parseURL(url);
+ if (parsedURL.scheme === WebInspector.LegacyProfileType.ProfileScheme) {
+ var profileType = parsedURL.host.toUpperCase();
+ var profileTitle = parsedURL.path;
+
+ // The path of of the profile URL starts with a slash, remove it, so
+ // we can get the actual title.
+ console.assert(profileTitle[0] === '/');
+ profileTitle = profileTitle.substring(1);
+
+ this.timelineSidebarPanel.showProfile(profileType, profileTitle);
+ return;
+ }
+
+ var searchChildFrames = false;
+ if (!frame) {
+ frame = this.frameResourceManager.mainFrame;
+ searchChildFrames = true;
+ }
+
+ console.assert(frame);
+
+ // WebInspector.Frame.resourceForURL does not check the main resource, only sub-resources. So check both.
+ var resource = frame.url === url ? frame.mainResource : frame.resourceForURL(url, searchChildFrames);
+ if (resource) {
+ var position = new WebInspector.SourceCodePosition(lineNumber, 0);
+ this.resourceSidebarPanel.showSourceCode(resource, position);
+ return;
+ }
+
+ InspectorFrontendHost.openInNewTab(url);
+}
+
+WebInspector.close = function()
+{
+ if (this._isClosing)
+ return;
+
+ this._isClosing = true;
+
+ InspectorFrontendHost.closeWindow();
+}
+
+WebInspector.isConsoleFocused = function()
+{
+ return this.quickConsole.prompt.focused;
+}
+
+WebInspector.isShowingSplitConsole = function()
+{
+ return !this.splitContentBrowser.element.classList.contains("hidden");
+}
+
+WebInspector.currentViewSupportsSplitContentBrowser = function()
+{
+ var currentContentView = this.contentBrowser.currentContentView;
+ return !currentContentView || currentContentView.supportsSplitContentBrowser;
+}
+
+WebInspector.toggleSplitConsole = function()
+{
+ if (!this.currentViewSupportsSplitContentBrowser()) {
+ this.toggleConsoleView();
+ return;
+ }
+
+ if (this.isShowingSplitConsole())
+ this.hideSplitConsole();
+ else
+ this.showSplitConsole();
+}
+
+WebInspector.showSplitConsole = function()
+{
+ if (!this.currentViewSupportsSplitContentBrowser()) {
+ this.showFullHeightConsole();
+ return;
+ }
+
+ this.splitContentBrowser.element.classList.remove("hidden");
+
+ this._showingSplitConsoleSetting.value = true;
+
+ if (this.splitContentBrowser.currentContentView !== this.consoleContentView) {
+ // Be sure to close any existing log view in the main content browser before showing it in the
+ // split content browser. We can only show a content view in one browser at a time.
+ this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
+ this.splitContentBrowser.showContentView(this.consoleContentView);
+ } else {
+ // This causes the view to know it was shown and focus the prompt.
+ this.splitContentBrowser.contentViewContainer.shown();
+ }
+
+ if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
+ this.navigationSidebar.collapsed = false;
+
+ this.quickConsole.consoleLogVisibilityChanged(true);
+}
+
+WebInspector.hideSplitConsole = function()
+{
+ this.splitContentBrowser.element.classList.add("hidden");
+
+ this._showingSplitConsoleSetting.value = false;
+
+ // This causes the view to know it was hidden.
+ this.splitContentBrowser.contentViewContainer.hidden();
+
+ this.quickConsole.consoleLogVisibilityChanged(false);
+}
+
+WebInspector.showFullHeightConsole = function(scope)
+{
+ this.splitContentBrowser.element.classList.add("hidden");
+
+ this._showingSplitConsoleSetting.value = false;
+
+ scope = scope || WebInspector.LogContentView.Scopes.All;
+
+ // If the requested scope is already selected and the console is showing, then switch back to All.
+ if (this.isShowingConsoleView() && this.consoleContentView.scopeBar.item(scope).selected)
+ scope = WebInspector.LogContentView.Scopes.All;
+
+ this.consoleContentView.scopeBar.item(scope).selected = true;
+
+ if (this.contentBrowser.currentContentView !== this.consoleContentView) {
+ this._wasShowingNavigationSidebarBeforeFullHeightConsole = !this.navigationSidebar.collapsed;
+
+ // Collapse the sidebar before showing the console view, so the check for the collapsed state in
+ // _revealAndSelectRepresentedObjectInNavigationSidebar returns early and does not deselect any
+ // tree elements in the current sidebar.
+ this.navigationSidebar.collapsed = true;
+
+ // Be sure to close any existing log view in the split content browser before showing it in the
+ // main content browser. We can only show a content view in one browser at a time.
+ this.splitContentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
+ this.contentBrowser.showContentView(this.consoleContentView);
+ }
+
+ console.assert(this.isShowingConsoleView());
+ console.assert(this._consoleToolbarButton.activated);
+
+ this.quickConsole.consoleLogVisibilityChanged(true);
+}
+
+WebInspector.isShowingConsoleView = function()
+{
+ return this.contentBrowser.currentContentView instanceof WebInspector.LogContentView;
+}
+
+WebInspector.showConsoleView = function(scope)
+{
+ this.showFullHeightConsole(scope);
+}
+
+WebInspector.toggleConsoleView = function()
+{
+ if (this.isShowingConsoleView()) {
+ if (this.contentBrowser.canGoBack())
+ this.contentBrowser.goBack();
+ else
+ this.resourceSidebarPanel.showMainFrameSourceCode();
+
+ if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
+ this.navigationSidebar.collapsed = false;
+ } else
+ this.showFullHeightConsole();
+}
+
+WebInspector.UIString = function(string, vararg)
+{
+ if (WebInspector.dontLocalizeUserInterface)
+ return string;
+
+ if (window.localizedStrings && string in window.localizedStrings)
+ return window.localizedStrings[string];
+
+ if (!this._missingLocalizedStrings)
+ this._missingLocalizedStrings = {};
+
+ if (!(string in this._missingLocalizedStrings)) {
+ console.error("Localized string \"" + string + "\" was not found.");
+ this._missingLocalizedStrings[string] = true;
+ }
+
+ return "LOCALIZED STRING NOT FOUND";
+}
+
+WebInspector.restoreFocusFromElement = function(element)
+{
+ if (element && element.isSelfOrAncestor(this.currentFocusElement))
+ this.previousFocusElement.focus();
+}
+
+WebInspector._focusChanged = function(event)
+{
+ // Make a caret selection inside the focused element if there isn't a range selection and there isn't already
+ // a caret selection inside. This is needed (at least) to remove caret from console when focus is moved.
+ // The selection change should not apply to text fields and text areas either.
+
+ if (WebInspector.isEventTargetAnEditableField(event))
+ return;
+
+ var selection = window.getSelection();
+ if (!selection.isCollapsed)
+ return;
+
+ var element = event.target;
+
+ if (element !== this.currentFocusElement) {
+ this.previousFocusElement = this.currentFocusElement;
+ this.currentFocusElement = element;
+ }
+
+ if (element.isInsertionCaretInside())
+ return;
+
+ var selectionRange = element.ownerDocument.createRange();
+ selectionRange.setStart(element, 0);
+ selectionRange.setEnd(element, 0);
+
+ selection.removeAllRanges();
+ selection.addRange(selectionRange);
+}
+
+WebInspector._mouseWasClicked = function(event)
+{
+ this.handlePossibleLinkClick(event);
+}
+
+WebInspector._dragOver = function(event)
+{
+ // Do nothing if another event listener handled the event already.
+ if (event.defaultPrevented)
+ return;
+
+ // Allow dropping into editable areas.
+ if (WebInspector.isEventTargetAnEditableField(event))
+ return;
+
+ // Prevent the drop from being accepted.
+ event.dataTransfer.dropEffect = "none";
+ event.preventDefault();
+}
+
+WebInspector._debuggerDidPause = function(event)
+{
+ this.debuggerSidebarPanel.show();
+
+ // Since the Scope Chain details sidebar panel might not be in the sidebar yet,
+ // set a flag to select and show it when it does become available.
+ this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable = true;
+
+ InspectorFrontendHost.bringToFront();
+}
+
+WebInspector._mainFrameDidChange = function(event)
+{
+ this.updateWindowTitle();
+}
+
+WebInspector._mainResourceDidChange = function(event)
+{
+ if (!event.target.isMainFrame())
+ return;
+
+ this._restoreInspectorViewStateFromCookie(this._lastInspectorViewStateCookieSetting.value, true);
+
+ this.updateWindowTitle();
+}
+
+WebInspector._provisionalLoadStarted = function(event)
+{
+ if (!event.target.isMainFrame())
+ return;
+
+ this._updateCookieForInspectorViewState();
+}
+
+WebInspector._windowFocused = function(event)
+{
+ if (event.target.document.nodeType !== Node.DOCUMENT_NODE || this.docked)
+ return;
+
+ // FIXME: We should use the :window-inactive pseudo class once https://webkit.org/b/38927 is fixed.
+ document.body.classList.remove("window-inactive");
+}
+
+WebInspector._windowBlurred = function(event)
+{
+ if (event.target.document.nodeType !== Node.DOCUMENT_NODE || this.docked)
+ return;
+
+ // FIXME: We should use the :window-inactive pseudo class once https://webkit.org/b/38927 is fixed.
+ document.body.classList.add("window-inactive");
+}
+
+WebInspector._windowResized = function(event)
+{
+ this.toolbar.updateLayout();
+
+ this._contentBrowserSizeDidChange(event);
+}
+
+WebInspector._updateModifierKeys = function(event)
+{
+ var didChange = this.modifierKeys.altKey !== event.altKey || this.modifierKeys.metaKey !== event.metaKey || this.modifierKeys.shiftKey !== event.shiftKey;
+
+ this.modifierKeys = {altKey: event.altKey, metaKey: event.metaKey, shiftKey: event.shiftKey};
+
+ if (didChange)
+ this.notifications.dispatchEventToListeners(WebInspector.Notification.GlobalModifierKeysDidChange, event);
+}
+
+WebInspector._windowKeyDown = function(event)
+{
+ this._updateModifierKeys(event);
+
+ var opposite = !this._dockButtonToggledSetting.value;
+ this.undockButtonNavigationItem.toggled = (event.altKey && !event.metaKey && !event.shiftKey) ? opposite : !opposite;
+}
+
+WebInspector._windowKeyUp = function(event)
+{
+ this._updateModifierKeys(event);
+
+ var opposite = !this._dockButtonToggledSetting.value;
+ this.undockButtonNavigationItem.toggled = (event.altKey && !event.metaKey && !event.shiftKey) ? opposite : !opposite;
+}
+
+WebInspector._mouseMoved = function(event)
+{
+ this._updateModifierKeys(event);
+ this.mouseCoords = {
+ x: event.pageX,
+ y: event.pageY
+ };
+}
+
+WebInspector._pageHidden = function(event)
+{
+ this._updateCookieForInspectorViewState();
+}
+
+WebInspector._undock = function(event)
+{
+ this._dockButtonToggledSetting.value = this.undockButtonNavigationItem.toggled;
+
+ if (this.undockButtonNavigationItem.toggled)
+ InspectorFrontendHost.requestSetDockSide(this._dockSide === "bottom" ? "right" : "bottom");
+ else
+ InspectorFrontendHost.requestSetDockSide("undocked");
+}
+
+WebInspector._updateDockNavigationItems = function()
+{
+ // The close and undock buttons are only available when docked.
+ var docked = this.docked;
+ this.closeButtonNavigationItem.hidden = !docked;
+ this.undockButtonNavigationItem.hidden = !docked;
+
+ if (docked) {
+ this.undockButtonNavigationItem.alternateImage = this._dockSide === "bottom" ? "Images/DockRight.svg" : "Images/DockBottom.svg";
+ this.undockButtonNavigationItem.alternateToolTip = this._dockSide === "bottom" ? WebInspector.UIString("Dock to right of window") : WebInspector.UIString("Dock to bottom of window");
+ }
+
+ this.undockButtonNavigationItem.toggled = this._dockButtonToggledSetting.value;
+}
+
+WebInspector._sidebarCollapsedStateDidChange = function(event)
+{
+ if (event.target === this.navigationSidebar) {
+ this._navigationSidebarCollapsedSetting.value = this.navigationSidebar.collapsed;
+ this._updateNavigationSidebarForCurrentContentView();
+ } else if (event.target === this.detailsSidebar) {
+ if (!this._ignoreDetailsSidebarPanelCollapsedEvent)
+ this._detailsSidebarCollapsedSetting.value = this.detailsSidebar.collapsed;
+ }
+}
+
+WebInspector._detailsSidebarPanelSelected = function(event)
+{
+ if (!this.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
+ return;
+
+ this._lastSelectedDetailsSidebarPanelSetting.value = this.detailsSidebar.selectedSidebarPanel.identifier;
+}
+
+WebInspector._revealAndSelectRepresentedObjectInNavigationSidebar = function(representedObject)
+{
+ if (this.navigationSidebar.collapsed)
+ return;
+
+ var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
+ if (!selectedSidebarPanel)
+ return;
+
+ // If the tree outline is processing a selection currently then we can assume the selection does not
+ // need to be changed. This is needed to allow breakpoints tree elements to be selected without jumping
+ // back to selecting the resource tree element.
+ if (selectedSidebarPanel.contentTreeOutline.processingSelectionChange)
+ return;
+
+ var treeElement = selectedSidebarPanel.treeElementForRepresentedObject(representedObject);
+ if (treeElement)
+ treeElement.revealAndSelect(true, false, true, true);
+ else if (selectedSidebarPanel.contentTreeOutline.selectedTreeElement)
+ selectedSidebarPanel.contentTreeOutline.selectedTreeElement.deselect(true);
+
+ if (!selectedSidebarPanel.contentTreeOutline.selectedTreeElement)
+ selectedSidebarPanel.showDefaultContentView();
+}
+
+WebInspector._updateNavigationSidebarForCurrentContentView = function()
+{
+ if (this.navigationSidebar.collapsed)
+ return;
+
+ var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
+ if (!selectedSidebarPanel)
+ return;
+
+ var currentContentView = this.contentBrowser.currentContentView;
+ if (!currentContentView)
+ return;
+
+ // Ensure the navigation sidebar panel is allowed by the current content view, if not ask the sidebar panel
+ // to show the content view for the current selection.
+ var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
+ if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier)) {
+ selectedSidebarPanel.showContentViewForCurrentSelection();
+
+ // Fetch the current content view again, since it likely changed.
+ currentContentView = this.contentBrowser.currentContentView;
+ }
+
+ if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))
+ currentContentView.__lastNavigationSidebarPanelIdentifer = selectedSidebarPanel.identifier;
+
+ this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
+}
+
+WebInspector._navigationSidebarPanelSelected = function(event)
+{
+ var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
+ if (!selectedSidebarPanel)
+ return;
+
+ this._updateNavigationSidebarForCurrentContentView();
+}
+
+WebInspector._domNodeWasInspected = function(event)
+{
+ WebInspector.domTreeManager.highlightDOMNodeForTwoSeconds(event.data.node.id);
+
+ // Select the Style details sidebar panel if one of the DOM details sidebar panels isn't already selected.
+ if (!(this.detailsSidebar.selectedSidebarPanel instanceof WebInspector.DOMDetailsSidebarPanel))
+ this.detailsSidebar.selectedSidebarPanel = this.cssStyleDetailsSidebarPanel;
+
+ InspectorFrontendHost.bringToFront();
+}
+
+WebInspector._contentBrowserSizeDidChange = function(event)
+{
+ this.contentBrowser.updateLayout();
+ this.splitContentBrowser.updateLayout();
+ this.quickConsole.updateLayout();
+}
+
+WebInspector._quickConsoleDidResize = function(event)
+{
+ this.contentBrowser.updateLayout();
+}
+
+WebInspector._sidebarWidthDidChange = function(event)
+{
+ if (!event.target.collapsed) {
+ if (event.target === this.navigationSidebar)
+ this._navigationSidebarWidthSetting.value = this.navigationSidebar.width;
+ else if (event.target === this.detailsSidebar)
+ this._detailsSidebarWidthSetting.value = this.detailsSidebar.width;
+ }
+
+ this._contentBrowserSizeDidChange(event);
+}
+
+WebInspector._updateToolbarHeight = function()
+{
+ InspectorFrontendHost.setToolbarHeight(this.toolbar.element.offsetHeight);
+}
+
+WebInspector._toolbarDisplayModeDidChange = function(event)
+{
+ if (this._ignoreToolbarModeDidChangeEvents)
+ return;
+
+ if (this._dockSide === "bottom")
+ this._toolbarDockedBottomDisplayModeSetting.value = this.toolbar.displayMode;
+ else if (this._dockSide === "right")
+ this._toolbarDockedRightDisplayModeSetting.value = this.toolbar.displayMode;
+ else
+ this._toolbarUndockedDisplayModeSetting.value = this.toolbar.displayMode;
+
+ this._updateToolbarHeight();
+}
+
+WebInspector._toolbarSizeModeDidChange = function(event)
+{
+ if (this._ignoreToolbarModeDidChangeEvents)
+ return;
+
+ if (this._dockSide === "bottom")
+ this._toolbarDockedBottomSizeModeSetting.value = this.toolbar.sizeMode;
+ else if (this._dockSide === "right")
+ this._toolbarDockedRightSizeModeSetting.value = this.toolbar.sizeMode;
+ else
+ this._toolbarUndockedSizeModeSetting.value = this.toolbar.sizeMode;
+
+ this._updateToolbarHeight();
+}
+
+WebInspector._updateCookieForInspectorViewState = function()
+{
+ var cookie = {};
+ var currentContentView = this.contentBrowser.currentContentView;
+
+ // The console does not have a sidebar, so create a cookie here.
+ if (currentContentView && currentContentView.representedObject instanceof WebInspector.LogObject) {
+ cookie[WebInspector.SelectedSidebarPanelCookieKey] = "console";
+ this._lastInspectorViewStateCookieSetting.value = cookie;
+ return;
+ }
+
+ var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
+ if (!selectedSidebarPanel)
+ return;
+
+ // Restoring view state after inspector re-open or page reload is delegated to navigation sidebars.
+ // This is because some navigation sidebar state (such as breakpoint selections) cannot be inferred
+ // solely based on which content view is visible, or multiple navigation sidebars could be shown.
+ cookie[WebInspector.SelectedSidebarPanelCookieKey] = selectedSidebarPanel.identifier;
+ selectedSidebarPanel.saveStateToCookie(cookie);
+ this._lastInspectorViewStateCookieSetting.value = cookie;
+}
+
+WebInspector._contentBrowserCurrentContentViewDidChange = function(event)
+{
+ var consoleViewShowing = this.isShowingConsoleView();
+ this._consoleToolbarButton.activated = consoleViewShowing;
+
+ if (!this.isShowingSplitConsole())
+ this.quickConsole.consoleLogVisibilityChanged(consoleViewShowing);
+
+ if (!this.currentViewSupportsSplitContentBrowser())
+ this.hideSplitConsole();
+
+ var currentContentView = this.contentBrowser.currentContentView;
+ if (!currentContentView)
+ return;
+
+ var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
+ if (!selectedSidebarPanel)
+ return;
+
+ // Ensure the navigation sidebar panel is allowed by the current content view, if not change the navigation sidebar panel
+ // to the last navigation sidebar panel used with the content view or the first one allowed.
+ var selectedSidebarPanelIdentifier = selectedSidebarPanel.identifier;
+
+ var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
+ if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier)) {
+ console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifer || allowedNavigationSidebarPanels.contains(currentContentView.__lastNavigationSidebarPanelIdentifer));
+ this.navigationSidebar.selectedSidebarPanel = currentContentView.__lastNavigationSidebarPanelIdentifer || allowedNavigationSidebarPanels[0];
+ }
+
+ if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier))
+ currentContentView.__lastNavigationSidebarPanelIdentifer = selectedSidebarPanelIdentifier;
+
+ this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
+}
+
+WebInspector._contentBrowserRepresentedObjectsDidChange = function(event)
+{
+ var currentRepresentedObjects = this.contentBrowser.currentRepresentedObjects;
+ var currentSidebarPanels = this.detailsSidebar.sidebarPanels;
+ var wasSidebarEmpty = !currentSidebarPanels.length;
+
+ // Ignore any changes to the selected sidebar panel during this function so only user initiated
+ // changes are recorded in _lastSelectedDetailsSidebarPanelSetting.
+ this._ignoreDetailsSidebarPanelSelectedEvent = true;
+
+ for (var i = 0; i < this.detailsSidebarPanels.length; ++i) {
+ var sidebarPanel = this.detailsSidebarPanels[i];
+ if (sidebarPanel.inspect(currentRepresentedObjects)) {
+ var currentSidebarPanelIndex = currentSidebarPanels.indexOf(sidebarPanel);
+ if (currentSidebarPanelIndex !== -1) {
+ // Already showing the panel.
+ continue;
+ }
+
+ // The sidebar panel was not previously showing, so add the panel and show the toolbar item.
+ this.detailsSidebar.addSidebarPanel(sidebarPanel);
+ sidebarPanel.toolbarItem.hidden = false;
+
+ if (this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable && sidebarPanel === this.scopeChainDetailsSidebarPanel) {
+ // Select the scope chain sidebar panel since it needs to be shown after pausing in the debugger.
+ delete this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable;
+ this.detailsSidebar.selectedSidebarPanel = this.scopeChainDetailsSidebarPanel;
+
+ this._ignoreDetailsSidebarPanelCollapsedEvent = true;
+ this.detailsSidebar.collapsed = false;
+ delete this._ignoreDetailsSidebarPanelCollapsedEvent;
+ } else if (this._lastSelectedDetailsSidebarPanelSetting.value === sidebarPanel.identifier) {
+ // Restore the sidebar panel selection if this sidebar panel was the last one selected by the user.
+ this.detailsSidebar.selectedSidebarPanel = sidebarPanel;
+ }
+ } else {
+ // The sidebar panel can't inspect the current represented objects, so remove the panel and hide the toolbar item.
+ this.detailsSidebar.removeSidebarPanel(sidebarPanel);
+ sidebarPanel.toolbarItem.hidden = true;
+ }
+ }
+
+ if (!this.detailsSidebar.selectedSidebarPanel && currentSidebarPanels.length)
+ this.detailsSidebar.selectedSidebarPanel = currentSidebarPanels[0];
+
+ this._ignoreDetailsSidebarPanelCollapsedEvent = true;
+
+ if (!this.detailsSidebar.sidebarPanels.length)
+ this.detailsSidebar.collapsed = true;
+ else if (wasSidebarEmpty)
+ this.detailsSidebar.collapsed = this._detailsSidebarCollapsedSetting.value;
+
+ delete this._ignoreDetailsSidebarPanelCollapsedEvent;
+
+ // Stop ignoring the sidebar panel selected event.
+ delete this._ignoreDetailsSidebarPanelSelectedEvent;
+}
+
+WebInspector._restoreInspectorViewStateFromCookie = function(cookie, causedByReload)
+{
+ if (!cookie)
+ return;
+
+ // The console does not have a sidebar, so handle its special cookie here.
+ if (cookie[WebInspector.SelectedSidebarPanelCookieKey] === "console") {
+ this.showFullHeightConsole();
+ return;
+ }
+
+ const matchTypeOnlyDelayForReload = 2000;
+ const matchTypeOnlyDelayForReopen = 1000;
+ var sidebarPanelIdentifier = cookie[WebInspector.SelectedSidebarPanelCookieKey];
+ var sidebarPanel = WebInspector.navigationSidebar.findSidebarPanel(sidebarPanelIdentifier);
+ if (!sidebarPanel)
+ return;
+
+ WebInspector.navigationSidebar.selectedSidebarPanel = sidebarPanel;
+
+ var relaxMatchDelay = causedByReload ? matchTypeOnlyDelayForReload : matchTypeOnlyDelayForReopen;
+ sidebarPanel.restoreStateFromCookie(cookie, relaxMatchDelay);
+}
+
+WebInspector._initializeWebSocketIfNeeded = function()
+{
+ if (!InspectorFrontendHost.initializeWebSocket)
+ return;
+
+ var queryParams = parseLocationQueryParameters();
+
+ if ("ws" in queryParams)
+ var url = "ws://" + queryParams.ws;
+ else if ("page" in queryParams) {
+ var page = queryParams.page;
+ var host = "host" in queryParams ? queryParams.host : window.location.host;
+ var url = "ws://" + host + "/devtools/page/" + page;
+ }
+
+ if (!url)
+ return;
+
+ InspectorFrontendHost.initializeWebSocket(url);
+}
+
+WebInspector._updateSplitConsoleHeight = function(height)
+{
+ const minimumHeight = 64;
+ const maximumHeight = window.innerHeight * 0.55;
+
+ height = Math.max(minimumHeight, Math.min(height, maximumHeight));
+
+ this.splitContentBrowser.element.style.height = height + "px";
+}
+
+WebInspector._consoleResizerMouseDown = function(event)
+{
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ // Only start dragging if the target is one of the elements that we expect.
+ if (!event.target.classList.contains("navigation-bar") && !event.target.classList.contains("flexible-space"))
+ return;
+
+ var resizerElement = event.target;
+ var mouseOffset = resizerElement.offsetHeight - (event.pageY - resizerElement.totalOffsetTop);
+
+ function dockedResizerDrag(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ var height = window.innerHeight - event.pageY - mouseOffset;
+
+ this._splitConsoleHeightSetting.value = height;
+
+ this._updateSplitConsoleHeight(height);
+ }
+
+ function dockedResizerDragEnd(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ this.elementDragEnd(event);
+ }
+
+ this.elementDragStart(resizerElement, dockedResizerDrag.bind(this), dockedResizerDragEnd.bind(this), event, "row-resize");
+}
+
+WebInspector._toolbarMouseDown = function(event)
+{
+ if (event.ctrlKey)
+ return;
+
+ if (this._dockSide === "right")
+ return;
+
+ if (this.docked)
+ this._dockedResizerMouseDown(event);
+ else
+ this._moveWindowMouseDown(event);
+}
+
+WebInspector._dockedResizerMouseDown = function(event)
+{
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ if (!this.docked)
+ return;
+
+ // Only start dragging if the target is one of the elements that we expect.
+ if (event.target.id !== "docked-resizer" && !event.target.classList.contains("toolbar") &&
+ !event.target.classList.contains("flexible-space") && !event.target.classList.contains("item-section"))
+ return;
+
+ var windowProperty = this._dockSide === "bottom" ? "innerHeight" : "innerWidth";
+ var eventProperty = this._dockSide === "bottom" ? "screenY" : "screenX";
+
+ var resizerElement = event.target;
+ var lastScreenPosition = event[eventProperty];
+
+ function dockedResizerDrag(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ var position = event[eventProperty];
+ var dimension = window[windowProperty] - (position - lastScreenPosition);
+
+ if (this._dockSide === "bottom")
+ InspectorFrontendHost.setAttachedWindowHeight(dimension);
+ else
+ InspectorFrontendHost.setAttachedWindowWidth(dimension);
+
+ lastScreenPosition = position;
+ }
+
+ function dockedResizerDragEnd(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ WebInspector.elementDragEnd(event);
+ }
+
+ WebInspector.elementDragStart(resizerElement, dockedResizerDrag.bind(this), dockedResizerDragEnd.bind(this), event, this._dockSide === "bottom" ? "row-resize" : "col-resize");
+}
+
+WebInspector._moveWindowMouseDown = function(event)
+{
+ console.assert(!this.docked);
+
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ // Only start dragging if the target is one of the elements that we expect.
+ if (!event.target.classList.contains("toolbar") && !event.target.classList.contains("flexible-space") &&
+ !event.target.classList.contains("item-section"))
+ return;
+
+ var lastScreenX = event.screenX;
+ var lastScreenY = event.screenY;
+
+ function toolbarDrag(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ var x = event.screenX - lastScreenX;
+ var y = event.screenY - lastScreenY;
+
+ InspectorFrontendHost.moveWindowBy(x, y);
+
+ lastScreenX = event.screenX;
+ lastScreenY = event.screenY;
+ }
+
+ function toolbarDragEnd(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ WebInspector.elementDragEnd(event);
+ }
+
+ WebInspector.elementDragStart(event.target, toolbarDrag, toolbarDragEnd, event, "default");
+}
+
+WebInspector._inspectModeStateChanged = function(event)
+{
+ this._inspectModeToolbarButton.activated = WebInspector.domTreeManager.inspectModeEnabled;
+}
+
+WebInspector._toggleInspectMode = function(event)
+{
+ WebInspector.domTreeManager.inspectModeEnabled = !WebInspector.domTreeManager.inspectModeEnabled;
+}
+
+WebInspector._reloadPage = function(event)
+{
+ PageAgent.reload();
+}
+
+WebInspector._reloadPageIgnoringCache = function(event)
+{
+ PageAgent.reload(true);
+}
+
+WebInspector._toggleInspectMode = function(event)
+{
+ this.domTreeManager.inspectModeEnabled = !this.domTreeManager.inspectModeEnabled;
+}
+
+WebInspector._focusedContentView = function()
+{
+ if (this.contentBrowser.element.isSelfOrAncestor(this.currentFocusElement))
+ return this.contentBrowser.currentContentView;
+ if (this.splitContentBrowser.element.isSelfOrAncestor(this.currentFocusElement))
+ return this.splitContentBrowser.currentContentView;
+ return null;
+}
+
+WebInspector._beforecopy = function(event)
+{
+ var selection = window.getSelection();
+
+ // If there is no selection, see if the focused element or focused ContentView can handle the copy event.
+ if (selection.isCollapsed && !WebInspector.isEventTargetAnEditableField(event)) {
+ var focusedCopyHandler = this.currentFocusElement && this.currentFocusElement.copyHandler;
+ if (focusedCopyHandler && typeof focusedCopyHandler.handleBeforeCopyEvent === "function") {
+ focusedCopyHandler.handleBeforeCopyEvent(event);
+ if (event.defaultPrevented)
+ return;
+ }
+
+ var focusedContentView = this._focusedContentView();
+ if (focusedContentView && typeof focusedContentView.handleCopyEvent === "function") {
+ event.preventDefault();
+ return;
+ }
+
+ return;
+ }
+
+ if (selection.isCollapsed)
+ return;
+
+ // Say we can handle it (by preventing default) to remove word break characters.
+ event.preventDefault();
+}
+
+WebInspector._copy = function(event)
+{
+ var selection = window.getSelection();
+
+ // If there is no selection, pass the copy event on to the focused element or focused ContentView.
+ if (selection.isCollapsed && !WebInspector.isEventTargetAnEditableField(event)) {
+ var focusedCopyHandler = this.currentFocusElement && this.currentFocusElement.copyHandler;
+ if (focusedCopyHandler && typeof focusedCopyHandler.handleCopyEvent === "function") {
+ focusedCopyHandler.handleCopyEvent(event);
+ if (event.defaultPrevented)
+ return;
+ }
+
+ var focusedContentView = this._focusedContentView();
+ if (focusedContentView && typeof focusedContentView.handleCopyEvent === "function") {
+ focusedContentView.handleCopyEvent(event);
+ return;
+ }
+
+ return;
+ }
+
+ if (selection.isCollapsed)
+ return;
+
+ // Remove word break characters from the selection before putting it on the pasteboard.
+ var selectionString = selection.toString().removeWordBreakCharacters();
+ event.clipboardData.setData("text/plain", selectionString);
+ event.preventDefault();
+}
+
+WebInspector._generateDisclosureTriangleImages = function()
+{
+ var specifications = {};
+ specifications["normal"] = {fillColor: [0, 0, 0, 0.5]};
+ specifications["normal-active"] = {fillColor: [0, 0, 0, 0.7]};
+
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, "disclosure-triangle-small-open-");
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, "disclosure-triangle-small-closed-");
+
+ specifications["selected"] = {fillColor: [255, 255, 255, 0.8]};
+
+ generateColoredImagesForCSS("Images/DisclosureTriangleTinyOpen.svg", specifications, 8, 8, "disclosure-triangle-tiny-open-");
+ generateColoredImagesForCSS("Images/DisclosureTriangleTinyClosed.svg", specifications, 8, 8, "disclosure-triangle-tiny-closed-");
+}
+
+WebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor, eventTarget)
+{
+ if (WebInspector._elementDraggingEventListener || WebInspector._elementEndDraggingEventListener)
+ WebInspector.elementDragEnd(event);
+
+ if (element) {
+ // Install glass pane
+ if (WebInspector._elementDraggingGlassPane)
+ WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+
+ var glassPane = document.createElement("div");
+ glassPane.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;z-index:1";
+ glassPane.id = "glass-pane-for-drag";
+ element.ownerDocument.body.appendChild(glassPane);
+ WebInspector._elementDraggingGlassPane = glassPane;
+ }
+
+ WebInspector._elementDraggingEventListener = dividerDrag;
+ WebInspector._elementEndDraggingEventListener = elementDragEnd;
+
+ var targetDocument = event.target.ownerDocument;
+
+ WebInspector._elementDraggingEventTarget = eventTarget || targetDocument;
+ WebInspector._elementDraggingEventTarget.addEventListener("mousemove", dividerDrag, true);
+ WebInspector._elementDraggingEventTarget.addEventListener("mouseup", elementDragEnd, true);
+
+ targetDocument.body.style.cursor = cursor;
+
+ event.preventDefault();
+}
+
+WebInspector.elementDragEnd = function(event)
+{
+ WebInspector._elementDraggingEventTarget.removeEventListener("mousemove", WebInspector._elementDraggingEventListener, true);
+ WebInspector._elementDraggingEventTarget.removeEventListener("mouseup", WebInspector._elementEndDraggingEventListener, true);
+
+ event.target.ownerDocument.body.style.removeProperty("cursor");
+
+ if (WebInspector._elementDraggingGlassPane)
+ WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
+
+ delete WebInspector._elementDraggingGlassPane;
+ delete WebInspector._elementDraggingEventTarget;
+ delete WebInspector._elementDraggingEventListener;
+ delete WebInspector._elementEndDraggingEventListener;
+
+ event.preventDefault();
+}
+
+WebInspector.createMessageTextView = function(message, isError)
+{
+ var messageElement = document.createElement("div");
+ messageElement.className = "message-text-view";
+ if (isError)
+ messageElement.classList.add("error");
+
+ messageElement.textContent = message;
+
+ return messageElement;
+}
+
+WebInspector.createGoToArrowButton = function()
+{
+ if (!WebInspector._generatedGoToArrowButtonImages) {
+ WebInspector._generatedGoToArrowButtonImages = true;
+
+ var specifications = {};
+ specifications["go-to-arrow-normal"] = {fillColor: [0, 0, 0, 0.5]};
+ specifications["go-to-arrow-normal-active"] = {fillColor: [0, 0, 0, 0.7]};
+ specifications["go-to-arrow-selected"] = {fillColor: [255, 255, 255, 0.8]};
+ specifications["go-to-arrow-selected-active"] = {fillColor: [255, 255, 255, 1]};
+
+ generateColoredImagesForCSS("Images/GoToArrow.svg", specifications, 10, 10);
+ }
+
+ function stopPropagation(event)
+ {
+ event.stopPropagation()
+ }
+
+ var button = document.createElement("button");
+ button.addEventListener("mousedown", stopPropagation, true);
+ button.className = "go-to-arrow";
+ button.tabIndex = -1;
+ return button;
+}
+
+WebInspector.createSourceCodeLocationLink = function(sourceCodeLocation, dontFloat, useGoToArrowButton)
+{
+ console.assert(sourceCodeLocation);
+ if (!sourceCodeLocation)
+ return null;
+
+ function showSourceCodeLocation(event)
+ {
+ event.stopPropagation();
+ event.preventDefault();
+
+ if (event.metaKey)
+ this.resourceSidebarPanel.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation);
+ else
+ this.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
+ }
+
+ var linkElement = document.createElement("a");
+ linkElement.className = "go-to-link";
+ linkElement.addEventListener("click", showSourceCodeLocation.bind(this));
+ sourceCodeLocation.populateLiveDisplayLocationTooltip(linkElement);
+
+ if (useGoToArrowButton)
+ linkElement.appendChild(WebInspector.createGoToArrowButton());
+ else
+ sourceCodeLocation.populateLiveDisplayLocationString(linkElement, "textContent");
+
+ if (dontFloat)
+ linkElement.classList.add("dont-float");
+
+ return linkElement;
+}
+
+WebInspector.linkifyLocation = function(url, lineNumber, columnNumber, className)
+{
+ var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
+ if (!sourceCode) {
+ sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
+ if (sourceCode)
+ sourceCode = sourceCode.resource || sourceCode;
+ }
+
+ if (!sourceCode) {
+ var anchor = document.createElement("a");
+ anchor.href = url;
+ anchor.lineNumber = lineNumber;
+ if (className)
+ anchor.className = className;
+ anchor.appendChild(document.createTextNode(WebInspector.displayNameForURL(url) + ":" + lineNumber));
+ return anchor;
+ }
+
+ var sourceCodeLocation = sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
+ var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, true);
+ if (className)
+ linkElement.classList.add(className);
+ return linkElement;
+}
+
+WebInspector.linkifyURLAsNode = function(url, linkText, classes, tooltipText)
+{
+ if (!linkText)
+ linkText = url;
+
+ classes = (classes ? classes + " " : "");
+
+ var a = document.createElement("a");
+ a.href = url;
+ a.className = classes;
+
+ if (typeof tooltipText === "undefined")
+ a.title = url;
+ else if (typeof tooltipText !== "string" || tooltipText.length)
+ a.title = tooltipText;
+
+ a.textContent = linkText;
+ a.style.maxWidth = "100%";
+
+ return a;
+}
+
+WebInspector.linkifyStringAsFragmentWithCustomLinkifier = function(string, linkifier)
+{
+ var container = document.createDocumentFragment();
+ var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|www\.)[\w$\-_+*'=\|\/\\(){}[\]%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({%@&#~]/;
+ var lineColumnRegEx = /:(\d+)(:(\d+))?$/;
+
+ while (string) {
+ var linkString = linkStringRegEx.exec(string);
+ if (!linkString)
+ break;
+
+ linkString = linkString[0];
+ var linkIndex = string.indexOf(linkString);
+ var nonLink = string.substring(0, linkIndex);
+ container.appendChild(document.createTextNode(nonLink));
+
+ var title = linkString;
+ var realURL = (linkString.startsWith("www.") ? "http://" + linkString : linkString);
+ var lineColumnMatch = lineColumnRegEx.exec(realURL);
+ if (lineColumnMatch)
+ realURL = realURL.substring(0, realURL.length - lineColumnMatch[0].length);
+
+ var linkNode = linkifier(title, realURL, lineColumnMatch ? lineColumnMatch[1] : undefined);
+ container.appendChild(linkNode);
+ string = string.substring(linkIndex + linkString.length, string.length);
+ }
+
+ if (string)
+ container.appendChild(document.createTextNode(string));
+
+ return container;
+}
+
+WebInspector.linkifyStringAsFragment = function(string)
+{
+ function linkifier(title, url, lineNumber)
+ {
+ var urlNode = WebInspector.linkifyURLAsNode(url, title, undefined);
+ if (typeof(lineNumber) !== "undefined")
+ urlNode.lineNumber = lineNumber;
+
+ return urlNode;
+ }
+
+ return WebInspector.linkifyStringAsFragmentWithCustomLinkifier(string, linkifier);
+}
+
+WebInspector._undoKeyboardShortcut = function(event)
+{
+ if (!this.isEditingAnyField() && !this.isEventTargetAnEditableField(event)) {
+ this.undo();
+ event.preventDefault();
+ }
+}
+
+WebInspector._redoKeyboardShortcut = function(event)
+{
+ if (!this.isEditingAnyField() && !this.isEventTargetAnEditableField(event)) {
+ this.redo();
+ event.preventDefault();
+ }
+}
+
+WebInspector.undo = function()
+{
+ DOMAgent.undo();
+}
+
+WebInspector.redo = function()
+{
+ DOMAgent.redo();
+}
+
+/**
+ * @param {Element} element
+ * @param {Array.<Object>} resultRanges
+ * @param {string} styleClass
+ * @param {Array.<Object>=} changes
+ */
+WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, styleClass, changes)
+{
+ changes = changes || [];
+ var highlightNodes = [];
+ var lineText = element.textContent;
+ var ownerDocument = element.ownerDocument;
+ var textNodeSnapshot = ownerDocument.evaluate(".//text()", element, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+
+ var snapshotLength = textNodeSnapshot.snapshotLength;
+ if (snapshotLength === 0)
+ return highlightNodes;
+
+ var nodeRanges = [];
+ var rangeEndOffset = 0;
+ for (var i = 0; i < snapshotLength; ++i) {
+ var range = {};
+ range.offset = rangeEndOffset;
+ range.length = textNodeSnapshot.snapshotItem(i).textContent.length;
+ rangeEndOffset = range.offset + range.length;
+ nodeRanges.push(range);
+ }
+
+ var startIndex = 0;
+ for (var i = 0; i < resultRanges.length; ++i) {
+ var startOffset = resultRanges[i].offset;
+ var endOffset = startOffset + resultRanges[i].length;
+
+ while (startIndex < snapshotLength && nodeRanges[startIndex].offset + nodeRanges[startIndex].length <= startOffset)
+ startIndex++;
+ var endIndex = startIndex;
+ while (endIndex < snapshotLength && nodeRanges[endIndex].offset + nodeRanges[endIndex].length < endOffset)
+ endIndex++;
+ if (endIndex === snapshotLength)
+ break;
+
+ var highlightNode = ownerDocument.createElement("span");
+ highlightNode.className = styleClass;
+ highlightNode.textContent = lineText.substring(startOffset, endOffset);
+
+ var lastTextNode = textNodeSnapshot.snapshotItem(endIndex);
+ var lastText = lastTextNode.textContent;
+ lastTextNode.textContent = lastText.substring(endOffset - nodeRanges[endIndex].offset);
+ changes.push({ node: lastTextNode, type: "changed", oldText: lastText, newText: lastTextNode.textContent });
+
+ if (startIndex === endIndex) {
+ lastTextNode.parentElement.insertBefore(highlightNode, lastTextNode);
+ changes.push({ node: highlightNode, type: "added", nextSibling: lastTextNode, parent: lastTextNode.parentElement });
+ highlightNodes.push(highlightNode);
+
+ var prefixNode = ownerDocument.createTextNode(lastText.substring(0, startOffset - nodeRanges[startIndex].offset));
+ lastTextNode.parentElement.insertBefore(prefixNode, highlightNode);
+ changes.push({ node: prefixNode, type: "added", nextSibling: highlightNode, parent: lastTextNode.parentElement });
+ } else {
+ var firstTextNode = textNodeSnapshot.snapshotItem(startIndex);
+ var firstText = firstTextNode.textContent;
+ var anchorElement = firstTextNode.nextSibling;
+
+ firstTextNode.parentElement.insertBefore(highlightNode, anchorElement);
+ changes.push({ node: highlightNode, type: "added", nextSibling: anchorElement, parent: firstTextNode.parentElement });
+ highlightNodes.push(highlightNode);
+
+ firstTextNode.textContent = firstText.substring(0, startOffset - nodeRanges[startIndex].offset);
+ changes.push({ node: firstTextNode, type: "changed", oldText: firstText, newText: firstTextNode.textContent });
+
+ for (var j = startIndex + 1; j < endIndex; j++) {
+ var textNode = textNodeSnapshot.snapshotItem(j);
+ var text = textNode.textContent;
+ textNode.textContent = "";
+ changes.push({ node: textNode, type: "changed", oldText: text, newText: textNode.textContent });
+ }
+ }
+ startIndex = endIndex;
+ nodeRanges[startIndex].offset = endOffset;
+ nodeRanges[startIndex].length = lastTextNode.textContent.length;
+
+ }
+ return highlightNodes;
+}
+
+WebInspector.revertDomChanges = function(domChanges)
+{
+ for (var i = domChanges.length - 1; i >= 0; --i) {
+ var entry = domChanges[i];
+ switch (entry.type) {
+ case "added":
+ if (entry.node.parentElement)
+ entry.node.parentElement.removeChild(entry.node);
+ break;
+ case "changed":
+ entry.node.textContent = entry.oldText;
+ break;
+ }
+ }
+}
+
+WebInspector.archiveMainFrame = function()
+{
+ this.notifications.dispatchEventToListeners(WebInspector.Notification.PageArchiveStarted, event);
+
+ setTimeout(function() {
+ PageAgent.archive(function(error, data) {
+ this.notifications.dispatchEventToListeners(WebInspector.Notification.PageArchiveEnded, event);
+ if (error)
+ return;
+
+ var mainFrame = WebInspector.frameResourceManager.mainFrame;
+ var archiveName = mainFrame.mainResource.urlComponents.host || mainFrame.mainResource.displayName || "Archive";
+ var url = "web-inspector:///" + encodeURI(archiveName) + ".webarchive";
+ InspectorFrontendHost.save(url, data, true, true);
+ }.bind(this));
+ }.bind(this), 3000);
+}
+
+WebInspector.canArchiveMainFrame = function()
+{
+ if (!PageAgent.archive)
+ return false;
+
+ return WebInspector.Resource.Type.fromMIMEType(WebInspector.frameResourceManager.mainFrame.mainResource.mimeType) === WebInspector.Resource.Type.Document;
+}
+
+WebInspector.addWindowKeydownListener = function(listener)
+{
+ if (typeof listener.handleKeydownEvent !== "function")
+ return;
+
+ this._windowKeydownListeners.push(listener);
+
+ this._updateWindowKeydownListener();
+};
+
+WebInspector.removeWindowKeydownListener = function(listener)
+{
+ this._windowKeydownListeners.remove(listener);
+
+ this._updateWindowKeydownListener();
+};
+
+WebInspector._updateWindowKeydownListener = function()
+{
+ if (this._windowKeydownListeners.length > 0)
+ window.addEventListener("keydown", WebInspector._sharedWindowKeydownListener, true);
+ else
+ window.removeEventListener("keydown", WebInspector._sharedWindowKeydownListener, true);
+}
+
+WebInspector._sharedWindowKeydownListener = function(event)
+{
+ for (var i = WebInspector._windowKeydownListeners.length - 1; i >= 0; --i) {
+ if (WebInspector._windowKeydownListeners[i].handleKeydownEvent(event)) {
+ event.stopImmediatePropagation();
+ event.preventDefault();
+ break;
+ }
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/Object.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Object.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Object.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Object.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,236 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.
+ */
+
+/**
+ * @constructor
+ */
+WebInspector.Object = function()
+{
+}
+
+/**
+ * @param {function} constructor
+ */
+WebInspector.Object.addConstructorFunctions = function(subclassConstructor)
+{
+ // Copies the relevant functions the subclass constructor.
+ for (var property in WebInspector.Object) {
+ var value = WebInspector.Object[property];
+ if (typeof value !== "function")
+ continue;
+ if (value === arguments.callee)
+ continue;
+ subclassConstructor[property] = value;
+ }
+}
+
+/**
+ * @param {string} eventType
+ * @param {function(WebInspector.Event)} listener
+ * @param {Object=} thisObject
+ */
+WebInspector.Object.addEventListener = function(eventType, listener, thisObject)
+{
+ thisObject = thisObject || null;
+
+ console.assert(eventType, "Object.addEventListener: invalid event type ", eventType, "(listener: ", listener, "thisObject: ", thisObject, ")");
+ if (!eventType)
+ return;
+
+ console.assert(listener, "Object.addEventListener: invalid listener ", listener, "(event type: ", eventType, "thisObject: ", thisObject, ")");
+ if (!listener)
+ return;
+
+ if (!this._listeners)
+ this._listeners = {};
+
+ var listeners = this._listeners[eventType];
+ if (!listeners)
+ listeners = this._listeners[eventType] = [];
+
+ // Prevent registering multiple times.
+ for (var i = 0; i < listeners.length; ++i) {
+ if (listeners[i].listener === listener && listeners[i].thisObject === thisObject)
+ return;
+ }
+
+ listeners.push({thisObject: thisObject, listener: listener});
+};
+
+/**
+ * @param {string} eventType
+ * @param {function(WebInspector.Event)} listener
+ * @param {Object=} thisObject
+ */
+WebInspector.Object.removeEventListener = function(eventType, listener, thisObject)
+{
+ eventType = eventType || null;
+ listener = listener || null;
+ thisObject = thisObject || null;
+
+ if (!this._listeners)
+ return;
+
+ if (!eventType) {
+ for (eventType in this._listeners)
+ this.removeEventListener(eventType, listener, thisObject);
+ return;
+ }
+
+ var listeners = this._listeners[eventType];
+ if (!listeners)
+ return;
+
+ for (var i = listeners.length - 1; i >= 0; --i) {
+ if (listener && listeners[i].listener === listener && listeners[i].thisObject === thisObject)
+ listeners.splice(i, 1);
+ else if (!listener && thisObject && listeners[i].thisObject === thisObject)
+ listeners.splice(i, 1);
+ }
+
+ if (!listeners.length)
+ delete this._listeners[eventType];
+
+ if (!Object.keys(this._listeners).length)
+ delete this._listeners;
+};
+
+WebInspector.Object.removeAllListeners = function()
+{
+ delete this._listeners;
+};
+
+/**
+ * @param {string} eventType
+ * @return {boolean}
+ */
+WebInspector.Object.hasEventListeners = function(eventType)
+{
+ if (!this._listeners || !this._listeners[eventType])
+ return false;
+ return true;
+};
+
+WebInspector.Object.prototype = {
+ constructor: WebInspector.Object,
+
+ /**
+ * @param {string} eventType
+ * @param {function(WebInspector.Event)} listener
+ * @param {Object=} thisObject
+ */
+ addEventListener: WebInspector.Object.addEventListener,
+
+ /**
+ * @param {string} eventType
+ * @param {function(WebInspector.Event)} listener
+ * @param {Object=} thisObject
+ */
+ removeEventListener: WebInspector.Object.removeEventListener,
+
+ removeAllListeners: WebInspector.Object.removeAllListeners,
+
+ /**
+ * @param {string} eventType
+ * @return {boolean}
+ */
+ hasEventListeners: WebInspector.Object.hasEventListeners,
+
+ /**
+ * @param {string} eventType
+ * @param {*=} eventData
+ * @return {boolean}
+ */
+ dispatchEventToListeners: function(eventType, eventData)
+ {
+ var event = new WebInspector.Event(this, eventType, eventData);
+
+ function dispatch(object)
+ {
+ if (!object || !object._listeners || !object._listeners[eventType] || event._stoppedPropagation)
+ return;
+
+ // Make a copy with slice so mutations during the loop doesn't affect us.
+ var listenersForThisEvent = object._listeners[eventType].slice(0);
+
+ // Iterate over the listeners and call them. Stop if stopPropagation is called.
+ for (var i = 0; i < listenersForThisEvent.length; ++i) {
+ listenersForThisEvent[i].listener.call(listenersForThisEvent[i].thisObject, event);
+ if (event._stoppedPropagation)
+ break;
+ }
+ }
+
+ // Dispatch to listeners of this specific object.
+ dispatch(this);
+
+ // Allow propagation again so listeners on the constructor always have a crack at the event.
+ event._stoppedPropagation = false;
+
+ // Dispatch to listeners on all constructors up the prototype chain, including the immediate constructor.
+ var constructor = this.constructor;
+ while (constructor) {
+ dispatch(constructor);
+
+ if (!constructor.prototype.__proto__)
+ break;
+
+ constructor = constructor.prototype.__proto__.constructor;
+ }
+
+ return event.defaultPrevented;
+ }
+}
+
+/**
+ * @constructor
+ * @param {WebInspector.Object} target
+ * @param {string} type
+ * @param {*=} data
+ */
+WebInspector.Event = function(target, type, data)
+{
+ this.target = target;
+ this.type = type;
+ this.data = data;
+ this.defaultPrevented = false;
+ this._stoppedPropagation = false;
+}
+
+WebInspector.Event.prototype = {
+ constructor: WebInspector.Event,
+
+ stopPropagation: function()
+ {
+ this._stoppedPropagation = true;
+ },
+
+ preventDefault: function()
+ {
+ this.defaultPrevented = true;
+ }
+}
+
+WebInspector.notifications = new WebInspector.Object;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseURLUtilitiesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceURLUtilitiesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/URLUtilities.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+function removeURLFragment(url)
+{
+ var hashIndex = url.indexOf("#");
+ if (hashIndex >= 0)
+ return url.substring(0, hashIndex);
+ return url;
+}
+
+function relativePath(path, basePath)
+{
+ console.assert(path.charAt(0) === "/");
+ console.assert(basePath.charAt(0) === "/");
+
+ var pathComponents = path.split("/");
+ var baseComponents = basePath.replace(/\/$/, "").split("/");
+ var finalComponents = [];
+
+ var index = 1;
+ for (; index < pathComponents.length && index < baseComponents.length; ++index) {
+ if (pathComponents[index] !== baseComponents[index])
+ break;
+ }
+
+ for (var i = index; i < baseComponents.length; ++i)
+ finalComponents.push("..");
+
+ for (var i = index; i < pathComponents.length; ++i)
+ finalComponents.push(pathComponents[i]);
+
+ return finalComponents.join("/");
+}
+
+function parseSecurityOrigin(securityOrigin)
+{
+ securityOrigin = securityOrigin ? securityOrigin.trim() : "";
+
+ var match = securityOrigin.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?$/i);
+ if (!match)
+ return {scheme: null, host: null, port: null};
+
+ var scheme = match[1].toLowerCase();
+ var host = match[2].toLowerCase();
+ var port = Number(match[3]) || null;
+
+ return {scheme: scheme, host: host, port: port};
+}
+
+function parseURL(url)
+{
+ url = url ? url.trim() : "";
+
+ var match = url.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);
+ if (!match)
+ return {scheme: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null};
+
+ var scheme = match[1].toLowerCase();
+ var host = match[2].toLowerCase();
+ var port = Number(match[3]) || null;
+ var wholePath = match[4] || null;
+ var fragment = match[5] || null;
+ var path = wholePath;
+ var queryString = null;
+
+ // Split the path and the query string.
+ if (wholePath) {
+ var indexOfQuery = wholePath.indexOf("?");
+ if (indexOfQuery !== -1) {
+ path = wholePath.substring(0, indexOfQuery);
+ queryString = wholePath.substring(indexOfQuery + 1);
+ }
+ path = resolveDotsInPath(path);
+ }
+
+ // Find last path component.
+ var lastPathComponent = null;
+ if (path && path !== "/") {
+ // Skip the trailing slash if there is one.
+ var endOffset = path[path.length - 1] === "/" ? 1 : 0;
+ var lastSlashIndex = path.lastIndexOf("/", path.length - 1 - endOffset);
+ if (lastSlashIndex !== -1)
+ lastPathComponent = path.substring(lastSlashIndex + 1, path.length - endOffset);
+ }
+
+ return {scheme: scheme, host: host, port: port, path: path, queryString: queryString, fragment: fragment, lastPathComponent: lastPathComponent};
+}
+
+function absoluteURL(partialURL, baseURL)
+{
+ partialURL = partialURL ? partialURL.trim() : "";
+
+ // Return data and javascript URLs as-is.
+ if (partialURL.startsWith("data:") || partialURL.startsWith("javascript:") || partialURL.startsWith("mailto:"))
+ return partialURL;
+
+ // If the URL has a scheme it is already a full URL, so return it.
+ if (parseURL(partialURL).scheme)
+ return partialURL;
+
+ // If there is no partial URL, just return the base URL.
+ if (!partialURL)
+ return baseURL || null;
+
+ var baseURLComponents = parseURL(baseURL);
+
+ // The base URL needs to be an absolute URL. Return null if it isn't.
+ if (!baseURLComponents.scheme)
+ return null;
+
+ // A URL that starts with "//" is a full URL without the scheme. Use the base URL scheme.
+ if (partialURL[0] === "/" && partialURL[1] === "/")
+ return baseURLComponents.scheme + ":" + partialURL;
+
+ // The path can be null for URLs that have just a scheme and host (like "http://apple.com"). So make the path be "/".
+ if (!baseURLComponents.path)
+ baseURLComponents.path = "/";
+
+ // Generate the base URL prefix that is used in the rest of the cases.
+ var baseURLPrefix = baseURLComponents.scheme + "://" + baseURLComponents.host + (baseURLComponents.port ? (":" + baseURLComponents.port) : "");
+
+ // A URL that starts with "?" is just a query string that gets applied to the base URL (replacing the base URL query string and fragment).
+ if (partialURL[0] === "?")
+ return baseURLPrefix + baseURLComponents.path + partialURL;
+
+ // A URL that starts with "/" is an absolute path that gets applied to the base URL (replacing the base URL path, query string and fragment).
+ if (partialURL[0] === "/")
+ return baseURLPrefix + resolveDotsInPath(partialURL);
+
+ // Generate the base path that is used in the final case by removing everything after the last "/" from the base URL's path.
+ var basePath = baseURLComponents.path.substring(0, baseURLComponents.path.lastIndexOf("/")) + "/";
+ return baseURLPrefix + resolveDotsInPath(basePath + partialURL);
+}
+
+function parseLocationQueryParameters(arrayResult)
+{
+ // The first character is always the "?".
+ return parseQueryString(window.location.search.substring(1), arrayResult);
+}
+
+function parseQueryString(queryString, arrayResult)
+{
+ if (!queryString)
+ return arrayResult ? [] : {};
+
+ function decode(string)
+ {
+ try {
+ // Replace "+" with " " then decode precent encoded values.
+ return decodeURIComponent(string.replace(/\+/g, " "));
+ } catch (e) {
+ return string;
+ }
+ }
+
+ var parameters = arrayResult ? [] : {};
+ var parameterStrings = queryString.split("&");
+ for (var i = 0; i < parameterStrings.length; ++i) {
+ var pair = parameterStrings[i].split("=").map(decode);
+ if (arrayResult)
+ parameters.push({name: pair[0], value: pair[1]});
+ else
+ parameters[pair[0]] = pair[1];
+ }
+
+ return parameters;
+}
+
+WebInspector.displayNameForURL = function(url, urlComponents)
+{
+ if (!urlComponents)
+ urlComponents = parseURL(url);
+
+ var displayName;
+ try {
+ displayName = decodeURIComponent(urlComponents.lastPathComponent || "");
+ } catch (e) {
+ displayName = urlComponents.lastPathComponent;
+ }
+
+ return displayName || WebInspector.displayNameForHost(urlComponents.host) || url;
+}
+
+WebInspector.displayNameForHost = function(host)
+{
+ // FIXME <rdar://problem/11237413>: This should decode punycode hostnames.
+ return host;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseUtilitiesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceUtilitiesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Utilities.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1012 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+Object.defineProperty(Object, "shallowCopy",
+{
+ value: function(object)
+ {
+ // Make a new object and copy all the key/values. The values are not copied.
+ var copy = {};
+ var keys = Object.keys(object);
+ for (var i = 0; i < keys.length; ++i)
+ copy[keys[i]] = object[keys[i]];
+ return copy;
+ }
+});
+
+Object.defineProperty(Object, "shallowEqual",
+{
+ value: function(a, b)
+ {
+ // Checks if two objects have the same top-level properties.
+
+ // Check for strict equality in case they are the same object.
+ if (a === b)
+ return true;
+
+ // Only objects can proceed. null is an object, but Object.keys throws for null.
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null)
+ return false;
+
+ var aKeys = Object.keys(a);
+ var bKeys = Object.keys(b);
+
+ // Check that each object has the same number of keys.
+ if (aKeys.length !== bKeys.length)
+ return false;
+
+ // Check if all the keys and their values are equal.
+ for (var i = 0; i < aKeys.length; ++i) {
+ // Check that b has the same key as a.
+ if (!(aKeys[i] in b))
+ return false;
+
+ // Check that the values are strict equal since this is only
+ // a shallow check, not a recursive one.
+ if (a[aKeys[i]] !== b[aKeys[i]])
+ return false;
+ }
+
+ return true;
+ }
+});
+
+Object.defineProperty(Object.prototype, "valueForCaseInsensitiveKey",
+{
+ value: function(key)
+ {
+ if (this.hasOwnProperty(key))
+ return this[key];
+
+ var lowerCaseKey = key.toLowerCase();
+ for (var currentKey in this) {
+ if (currentKey.toLowerCase() === lowerCaseKey)
+ return this[currentKey];
+ }
+
+ return undefined;
+ }
+});
+
+Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithClass",
+{
+ value: function(className)
+ {
+ for (var node = this; node && node !== this.ownerDocument; node = node.parentNode)
+ if (node.nodeType === Node.ELEMENT_NODE && node.classList.contains(className))
+ return node;
+ return null;
+ }
+});
+
+Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithNodeNameInArray",
+{
+ value: function(nameArray)
+ {
+ var lowerCaseNameArray = nameArray.map(function(name) { return name.toLowerCase() });
+ for (var node = this; node && node !== this.ownerDocument; node = node.parentNode) {
+ for (var i = 0; i < nameArray.length; ++i) {
+ if (node.nodeName.toLowerCase() === lowerCaseNameArray[i])
+ return node;
+ }
+ }
+
+ return null;
+ }
+});
+
+Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithNodeName",
+{
+ value: function(nodeName)
+ {
+ return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);
+ }
+});
+
+Object.defineProperty(Node.prototype, "isAncestor",
+{
+ value: function(node)
+ {
+ if (!node)
+ return false;
+
+ var currentNode = node.parentNode;
+ while (currentNode) {
+ if (this === currentNode)
+ return true;
+ currentNode = currentNode.parentNode;
+ }
+
+ return false;
+ }
+});
+
+Object.defineProperty(Node.prototype, "isDescendant",
+{
+ value: function(descendant)
+ {
+ return !!descendant && descendant.isAncestor(this);
+ }
+});
+
+
+Object.defineProperty(Node.prototype, "isSelfOrAncestor",
+{
+ value: function(node)
+ {
+ return !!node && (node === this || this.isAncestor(node));
+ }
+});
+
+
+Object.defineProperty(Node.prototype, "isSelfOrDescendant",
+{
+ value: function(node)
+ {
+ return !!node && (node === this || this.isDescendant(node));
+ }
+});
+
+Object.defineProperty(Node.prototype, "traverseNextNode",
+{
+ value: function(stayWithin)
+ {
+ var node = this.firstChild;
+ if (node)
+ return node;
+
+ if (stayWithin && this === stayWithin)
+ return null;
+
+ node = this.nextSibling;
+ if (node)
+ return node;
+
+ node = this;
+ while (node && !node.nextSibling && (!stayWithin || !node.parentNode || node.parentNode !== stayWithin))
+ node = node.parentNode;
+ if (!node)
+ return null;
+
+ return node.nextSibling;
+ }
+});
+
+Object.defineProperty(Node.prototype, "traversePreviousNode",
+{
+ value: function(stayWithin)
+ {
+ if (stayWithin && this === stayWithin)
+ return null;
+ var node = this.previousSibling;
+ while (node && node.lastChild)
+ node = node.lastChild;
+ if (node)
+ return node;
+ return this.parentNode;
+ }
+});
+
+
+Object.defineProperty(Node.prototype, "rangeOfWord",
+{
+ value: function(offset, stopCharacters, stayWithinNode, direction)
+ {
+ var startNode;
+ var startOffset = 0;
+ var endNode;
+ var endOffset = 0;
+
+ if (!stayWithinNode)
+ stayWithinNode = this;
+
+ if (!direction || direction === "backward" || direction === "both") {
+ var node = this;
+ while (node) {
+ if (node === stayWithinNode) {
+ if (!startNode)
+ startNode = stayWithinNode;
+ break;
+ }
+
+ if (node.nodeType === Node.TEXT_NODE) {
+ var start = (node === this ? (offset - 1) : (node.nodeValue.length - 1));
+ for (var i = start; i >= 0; --i) {
+ if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {
+ startNode = node;
+ startOffset = i + 1;
+ break;
+ }
+ }
+ }
+
+ if (startNode)
+ break;
+
+ node = node.traversePreviousNode(stayWithinNode);
+ }
+
+ if (!startNode) {
+ startNode = stayWithinNode;
+ startOffset = 0;
+ }
+ } else {
+ startNode = this;
+ startOffset = offset;
+ }
+
+ if (!direction || direction === "forward" || direction === "both") {
+ node = this;
+ while (node) {
+ if (node === stayWithinNode) {
+ if (!endNode)
+ endNode = stayWithinNode;
+ break;
+ }
+
+ if (node.nodeType === Node.TEXT_NODE) {
+ var start = (node === this ? offset : 0);
+ for (var i = start; i < node.nodeValue.length; ++i) {
+ if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {
+ endNode = node;
+ endOffset = i;
+ break;
+ }
+ }
+ }
+
+ if (endNode)
+ break;
+
+ node = node.traverseNextNode(stayWithinNode);
+ }
+
+ if (!endNode) {
+ endNode = stayWithinNode;
+ endOffset = stayWithinNode.nodeType === Node.TEXT_NODE ? stayWithinNode.nodeValue.length : stayWithinNode.childNodes.length;
+ }
+ } else {
+ endNode = this;
+ endOffset = offset;
+ }
+
+ var result = this.ownerDocument.createRange();
+ result.setStart(startNode, startOffset);
+ result.setEnd(endNode, endOffset);
+
+ return result;
+
+ }
+});
+
+Object.defineProperty(Element.prototype, "totalOffsetLeft",
+{
+ get: function()
+ {
+ return this.getBoundingClientRect().left;
+ }
+});
+
+Object.defineProperty(Element.prototype, "totalOffsetTop",
+{
+ get: function()
+ {
+ return this.getBoundingClientRect().top;
+ }
+});
+
+Object.defineProperty(Element.prototype, "removeChildren",
+{
+ value: function()
+ {
+ // This has been tested to be the fastest removal method.
+ if (this.firstChild)
+ this.textContent = "";
+ }
+});
+
+Object.defineProperty(Element.prototype, "isInsertionCaretInside",
+{
+ value: function()
+ {
+ var selection = window.getSelection();
+ if (!selection.rangeCount || !selection.isCollapsed)
+ return false;
+ var selectionRange = selection.getRangeAt(0);
+ return selectionRange.startContainer === this || selectionRange.startContainer.isDescendant(this);
+ }
+});
+
+Object.defineProperty(Element.prototype, "removeMatchingStyleClasses",
+{
+ value: function(classNameRegex)
+ {
+ var regex = new RegExp("(^|\\s+)" + classNameRegex + "($|\\s+)");
+ if (regex.test(this.className))
+ this.className = this.className.replace(regex, " ");
+ }
+});
+
+Object.defineProperty(Element.prototype, "createChild",
+{
+ value: function(elementName, className)
+ {
+ var element = this.ownerDocument.createElement(elementName);
+ if (className)
+ element.className = className;
+ this.appendChild(element);
+ return element;
+ }
+});
+
+Object.defineProperty(Element.prototype, "isScrolledToBottom",
+{
+ value: function()
+ {
+ // This code works only for 0-width border
+ return this.scrollTop + this.clientHeight === this.scrollHeight;
+ }
+});
+
+Object.defineProperty(Element.prototype, "recalculateStyles",
+{
+ value: function()
+ {
+ this.ownerDocument.defaultView.getComputedStyle(this);
+ }
+});
+
+Object.defineProperty(DocumentFragment.prototype, "createChild",
+{
+ value: Element.prototype.createChild
+});
+
+Object.defineProperty(Array.prototype, "contains",
+{
+ value: function(value)
+ {
+ return this.indexOf(value) !== -1;
+ }
+});
+
+Object.defineProperty(Array.prototype, "lastValue",
+{
+ get: function()
+ {
+ if (!this.length)
+ return undefined;
+ return this[this.length - 1];
+ }
+});
+
+Object.defineProperty(Array.prototype, "remove",
+{
+ value: function(value, onlyFirst)
+ {
+ for (var i = this.length - 1; i >= 0; --i) {
+ if (this[i] === value) {
+ this.splice(i, 1);
+ if (onlyFirst)
+ return;
+ }
+ }
+ }
+});
+
+Object.defineProperty(Array.prototype, "keySet",
+{
+ value: function()
+ {
+ var keys = {};
+ for (var i = 0; i < this.length; ++i)
+ keys[this[i]] = true;
+ return keys;
+ }
+});
+
+Object.defineProperty(String.prototype, "trimMiddle",
+{
+ value: function(maxLength)
+ {
+ if (this.length <= maxLength)
+ return this;
+ var leftHalf = maxLength >> 1;
+ var rightHalf = maxLength - leftHalf - 1;
+ return this.substr(0, leftHalf) + "\u2026" + this.substr(this.length - rightHalf, rightHalf);
+ }
+});
+
+Object.defineProperty(String.prototype, "trimEnd",
+{
+ value: function(maxLength)
+ {
+ if (this.length <= maxLength)
+ return this;
+ return this.substr(0, maxLength - 1) + "\u2026";
+ }
+});
+
+Object.defineProperty(String.prototype, "collapseWhitespace",
+{
+ value: function()
+ {
+ return this.replace(/[\s\xA0]+/g, " ");
+ }
+});
+
+Object.defineProperty(String.prototype, "escapeCharacters",
+{
+ value: function(chars)
+ {
+ var foundChar = false;
+ for (var i = 0; i < chars.length; ++i) {
+ if (this.indexOf(chars.charAt(i)) !== -1) {
+ foundChar = true;
+ break;
+ }
+ }
+
+ if (!foundChar)
+ return this;
+
+ var result = "";
+ for (var i = 0; i < this.length; ++i) {
+ if (chars.indexOf(this.charAt(i)) !== -1)
+ result += "\\";
+ result += this.charAt(i);
+ }
+
+ return result;
+ }
+});
+
+Object.defineProperty(String.prototype, "escapeForRegExp",
+{
+ value: function()
+ {
+ return this.escapeCharacters("^[]{}()\\.$*+?|");
+ }
+});
+
+Object.defineProperty(String.prototype, "capitalize",
+{
+ value: function()
+ {
+ return this.charAt(0).toUpperCase() + this.slice(1);
+ }
+});
+
+Object.defineProperty(String, "tokenizeFormatString",
+{
+ value: function(format)
+ {
+ var tokens = [];
+ var substitutionIndex = 0;
+
+ function addStringToken(str)
+ {
+ tokens.push({ type: "string", value: str });
+ }
+
+ function addSpecifierToken(specifier, precision, substitutionIndex)
+ {
+ tokens.push({ type: "specifier", specifier: specifier, precision: precision, substitutionIndex: substitutionIndex });
+ }
+
+ var index = 0;
+ for (var precentIndex = format.indexOf("%", index); precentIndex !== -1; precentIndex = format.indexOf("%", index)) {
+ addStringToken(format.substring(index, precentIndex));
+ index = precentIndex + 1;
+
+ if (format[index] === "%") {
+ addStringToken("%");
+ ++index;
+ continue;
+ }
+
+ if (!isNaN(format[index])) {
+ // The first character is a number, it might be a substitution index.
+ var number = parseInt(format.substring(index), 10);
+ while (!isNaN(format[index]))
+ ++index;
+
+ // If the number is greater than zero and ends with a "$",
+ // then this is a substitution index.
+ if (number > 0 && format[index] === "$") {
+ substitutionIndex = (number - 1);
+ ++index;
+ }
+ }
+
+ var precision = -1;
+ if (format[index] === ".") {
+ // This is a precision specifier. If no digit follows the ".",
+ // then the precision should be zero.
+ ++index;
+
+ precision = parseInt(format.substring(index), 10);
+ if (isNaN(precision))
+ precision = 0;
+
+ while (!isNaN(format[index]))
+ ++index;
+ }
+
+ addSpecifierToken(format[index], precision, substitutionIndex);
+
+ ++substitutionIndex;
+ ++index;
+ }
+
+ addStringToken(format.substring(index));
+
+ return tokens;
+ }
+});
+
+Object.defineProperty(String.prototype, "startsWith",
+{
+ value: function(string)
+ {
+ return this.lastIndexOf(string, 0) === 0;
+ }
+});
+
+Object.defineProperty(String.prototype, "hash",
+{
+ get: function()
+ {
+ // Matches the wtf/StringHasher.h (SuperFastHash) algorithm.
+
+ // Arbitrary start value to avoid mapping all 0's to all 0's.
+ const stringHashingStartValue = 0x9e3779b9;
+
+ var result = stringHashingStartValue;
+ var pendingCharacter = null;
+ for (var i = 0; i < this.length; ++i) {
+ var currentCharacter = this[i].charCodeAt(0);
+ if (pendingCharacter === null) {
+ pendingCharacter = currentCharacter;
+ continue;
+ }
+
+ result += pendingCharacter;
+ result = (result << 16) ^ ((currentCharacter << 11) ^ result);
+ result += result >> 11;
+
+ pendingCharacter = null;
+ }
+
+ // Handle the last character in odd length strings.
+ if (pendingCharacter !== null) {
+ result += pendingCharacter;
+ result ^= result << 11;
+ result += result >> 17;
+ }
+
+ // Force "avalanching" of final 31 bits.
+ result ^= result << 3;
+ result += result >> 5;
+ result ^= result << 2;
+ result += result >> 15;
+ result ^= result << 10;
+
+ // Prevent 0 and negative results.
+ return (0xffffffff + result + 1).toString(36);
+ }
+});
+
+Object.defineProperty(String, "standardFormatters",
+{
+ value: {
+ d: function(substitution)
+ {
+ return !isNaN(substitution) ? substitution : 0;
+ },
+
+ f: function(substitution, token)
+ {
+ if (substitution && token.precision > -1)
+ substitution = substitution.toFixed(token.precision);
+ return !isNaN(substitution) ? substitution : (token.precision > -1 ? Number(0).toFixed(token.precision) : 0);
+ },
+
+ s: function(substitution)
+ {
+ return substitution;
+ }
+ }
+});
+
+Object.defineProperty(String, "format",
+{
+ value: function(format, substitutions, formatters, initialValue, append)
+ {
+ if (!format || !substitutions || !substitutions.length)
+ return { formattedResult: append(initialValue, format), unusedSubstitutions: substitutions };
+
+ function prettyFunctionName()
+ {
+ return "String.format(\"" + format + "\", \"" + substitutions.join("\", \"") + "\")";
+ }
+
+ function warn(msg)
+ {
+ console.warn(prettyFunctionName() + ": " + msg);
+ }
+
+ function error(msg)
+ {
+ console.error(prettyFunctionName() + ": " + msg);
+ }
+
+ var result = initialValue;
+ var tokens = String.tokenizeFormatString(format);
+ var usedSubstitutionIndexes = {};
+
+ for (var i = 0; i < tokens.length; ++i) {
+ var token = tokens[i];
+
+ if (token.type === "string") {
+ result = append(result, token.value);
+ continue;
+ }
+
+ if (token.type !== "specifier") {
+ error("Unknown token type \"" + token.type + "\" found.");
+ continue;
+ }
+
+ if (token.substitutionIndex >= substitutions.length) {
+ // If there are not enough substitutions for the current substitutionIndex
+ // just output the format specifier literally and move on.
+ error("not enough substitution arguments. Had " + substitutions.length + " but needed " + (token.substitutionIndex + 1) + ", so substitution was skipped.");
+ result = append(result, "%" + (token.precision > -1 ? token.precision : "") + token.specifier);
+ continue;
+ }
+
+ usedSubstitutionIndexes[token.substitutionIndex] = true;
+
+ if (!(token.specifier in formatters)) {
+ // Encountered an unsupported format character, treat as a string.
+ warn("unsupported format character \u201C" + token.specifier + "\u201D. Treating as a string.");
+ result = append(result, substitutions[token.substitutionIndex]);
+ continue;
+ }
+
+ result = append(result, formatters[token.specifier](substitutions[token.substitutionIndex], token));
+ }
+
+ var unusedSubstitutions = [];
+ for (var i = 0; i < substitutions.length; ++i) {
+ if (i in usedSubstitutionIndexes)
+ continue;
+ unusedSubstitutions.push(substitutions[i]);
+ }
+
+ return {formattedResult: result, unusedSubstitutions: unusedSubstitutions};
+ }
+});
+
+Object.defineProperty(String.prototype, "format",
+{
+ value: function()
+ {
+ return String.format(this, arguments, String.standardFormatters, "", function(a, b) { return a + b; }).formattedResult;
+ }
+});
+
+Object.defineProperty(String.prototype, "insertWordBreakCharacters",
+{
+ value: function()
+ {
+ // Add zero width spaces after characters that are good to break after.
+ // Otherwise a string with no spaces will not break and overflow its container.
+ // This is mainly used on URL strings, so the characters are tailored for URLs.
+ return this.replace(/([\/;:\)\]\}&?])/g, "$1\u200b");
+ }
+});
+
+Object.defineProperty(String.prototype, "removeWordBreakCharacters",
+{
+ value: function()
+ {
+ // Undoes what insertWordBreakCharacters did.
+ return this.replace(/\u200b/g, "");
+ }
+});
+
+Object.defineProperty(Number, "constrain",
+{
+ value: function(num, min, max)
+ {
+ if (num < min)
+ num = min;
+ else if (num > max)
+ num = max;
+ return num;
+ }
+});
+
+Object.defineProperty(Number, "secondsToString",
+{
+ value: function(seconds, higherResolution)
+ {
+ var ms = seconds * 1000;
+
+ if (higherResolution && Math.abs(ms) < 10)
+ return WebInspector.UIString("%.3fms").format(ms);
+ else if (Math.abs(ms) < 10)
+ return WebInspector.UIString("%.2fms").format(ms);
+
+ if (higherResolution && Math.abs(ms) < 100)
+ return WebInspector.UIString("%.2fms").format(ms);
+ else if (Math.abs(ms) < 100)
+ return WebInspector.UIString("%.1fms").format(ms);
+
+ if (higherResolution && Math.abs(ms) < 1000)
+ return WebInspector.UIString("%.1fms").format(ms);
+ else if (Math.abs(ms) < 1000)
+ return WebInspector.UIString("%.0fms").format(ms);
+
+ if (Math.abs(seconds) < 60)
+ return WebInspector.UIString("%.2fs").format(seconds);
+
+ var minutes = seconds / 60;
+ if (Math.abs(minutes) < 60)
+ return WebInspector.UIString("%.1fmin").format(minutes);
+
+ var hours = minutes / 60;
+ if (Math.abs(hours) < 24)
+ return WebInspector.UIString("%.1fhrs").format(hours);
+
+ var days = hours / 24;
+ return WebInspector.UIString("%.1f days").format(days);
+ }
+});
+
+Object.defineProperty(Number, "bytesToString",
+{
+ value: function(bytes, higherResolution)
+ {
+ if (higherResolution === undefined)
+ higherResolution = true;
+
+ if (Math.abs(bytes) < 1024)
+ return WebInspector.UIString("%.0f B").format(bytes);
+
+ var kilobytes = bytes / 1024;
+ if (Math.abs(kilobytes) < 10 || (higherResolution && Math.abs(kilobytes) < 1024))
+ return WebInspector.UIString("%.2f KB").format(kilobytes);
+ else if (Math.abs(kilobytes) < 1024)
+ return WebInspector.UIString("%.1f KB").format(kilobytes);
+
+ var megabytes = kilobytes / 1024;
+ if (higherResolution || Math.abs(megabytes) < 10)
+ return WebInspector.UIString("%.2f MB").format(megabytes);
+ else
+ return WebInspector.UIString("%.1f MB").format(megabytes);
+ }
+});
+
+Object.defineProperty(Uint32Array, "isLittleEndian",
+{
+ value: function()
+ {
+ if ("_isLittleEndian" in this)
+ return this._isLittleEndian;
+
+ var buffer = new ArrayBuffer(4);
+ var longData = new Uint32Array(buffer);
+ var data = new Uint8Array(buffer);
+
+ longData[0] = 0x0a0b0c0d;
+
+ this._isLittleEndian = data[0] === 0x0d && data[1] === 0x0c && data[2] === 0x0b && data[3] === 0x0a;
+
+ return this._isLittleEndian;
+ }
+});
+
+function isEmptyObject(object)
+{
+ for (var property in object)
+ return false;
+ return true;
+}
+
+function isEnterKey(event)
+{
+ // Check if this is an IME event.
+ return event.keyCode !== 229 && event.keyIdentifier === "Enter";
+}
+
+function resolveDotsInPath(path)
+{
+ if (!path)
+ return path;
+
+ if (path.indexOf("./") === -1)
+ return path;
+
+ console.assert(path.charAt(0) === "/");
+
+ var result = [];
+
+ var components = path.split("/");
+ for (var i = 0; i < components.length; ++i) {
+ var component = components[i];
+
+ // Skip over "./".
+ if (component === ".")
+ continue;
+
+ // Rewind one component for "../".
+ if (component === "..") {
+ if (result.length === 1)
+ continue;
+ result.pop();
+ continue;
+ }
+
+ result.push(component);
+ }
+
+ return result.join("/");
+}
+
+function parseMIMEType(fullMimeType)
+{
+ if (!fullMimeType)
+ return {type: fullMimeType, boundary: null, encoding: null};
+
+ var typeParts = fullMimeType.split(/\s*;\s*/);
+ console.assert(typeParts.length >= 1);
+
+ var type = typeParts[0];
+ var boundary = null;
+ var encoding = null;
+
+ for (var i = 1; i < typeParts.length; ++i) {
+ var subparts = typeParts[i].split(/\s*=\s*/);
+ if (subparts.length !== 2)
+ continue;
+
+ if (subparts[0].toLowerCase() === "boundary")
+ boundary = subparts[1];
+ else if (subparts[0].toLowerCase() === "charset")
+ encoding = subparts[1].replace("^\"|\"$", ""); // Trim quotes.
+ }
+
+ return {type: type, boundary: boundary || null, encoding: encoding || null};
+}
+
+function simpleGlobStringToRegExp(globString, regExpFlags)
+{
+ // Only supports "*" globs.
+
+ if (!globString)
+ return null;
+
+ // Escape everything from String.prototype.escapeForRegExp except "*".
+ var regexString = globString.escapeCharacters("^[]{}()\\.$+?|");
+
+ // Unescape all doubly escaped backslashes in front of escaped asterisks.
+ // So "\\*" will become "\*" again, undoing escapeCharacters escaping of "\".
+ // This makes "\*" match a literal "*" instead of using the "*" for globbing.
+ regexString = regexString.replace(/\\\\\*/g, "\\*");
+
+ // The following regex doesn't match an asterisk that has a backslash in front.
+ // It also catches consecutive asterisks so they collapse down when replaced.
+ var unescapedAsteriskRegex = /(^|[^\\])\*+/g;
+ if (unescapedAsteriskRegex.test(globString)) {
+ // Replace all unescaped asterisks with ".*".
+ regexString = regexString.replace(unescapedAsteriskRegex, "$1.*");
+
+ // Match edge boundaries when there is an asterisk to better meet the expectations
+ // of the user. When someone types "*.js" they don't expect "foo.json" to match. They
+ // would only expect that if they type "*.js*". We use \b (instead of ^ and $) to allow
+ // matches inside paths or URLs, so "ba*.js" will match "foo/bar.js" but not "boo/bbar.js".
+ // When there isn't an asterisk the regexString is just a substring search.
+ regexString = "\\b" + regexString + "\\b";
+ }
+
+ return new RegExp(regexString, regExpFlags);
+}
+
+Object.defineProperty(Array.prototype, "lowerBound",
+{
+ // Return index of the leftmost element that is equal or greater
+ // than the specimen object. If there's no such element (i.e. all
+ // elements are smaller than the specimen) returns array.length.
+ // The function works for sorted array.
+ value: function(object, comparator)
+ {
+ function defaultComparator(a, b)
+ {
+ return a - b;
+ }
+ comparator = comparator || defaultComparator;
+ var l = 0;
+ var r = this.length;
+ while (l < r) {
+ var m = (l + r) >> 1;
+ if (comparator(object, this[m]) > 0)
+ l = m + 1;
+ else
+ r = m;
+ }
+ return r;
+ }
+});
+
+Object.defineProperty(Array.prototype, "upperBound",
+{
+ // Return index of the leftmost element that is greater
+ // than the specimen object. If there's no such element (i.e. all
+ // elements are smaller than the specimen) returns array.length.
+ // The function works for sorted array.
+ value: function(object, comparator)
+ {
+ function defaultComparator(a, b)
+ {
+ return a - b;
+ }
+ comparator = comparator || defaultComparator;
+ var l = 0;
+ var r = this.length;
+ while (l < r) {
+ var m = (l + r) >> 1;
+ if (comparator(object, this[m]) >= 0)
+ l = m + 1;
+ else
+ r = m;
+ }
+ return r;
+ }
+});
+
+Object.defineProperty(Array.prototype, "binaryIndexOf",
+{
+ value: function(value, comparator)
+ {
+ var index = this.lowerBound(value, comparator);
+ return index < this.length && comparator(value, this[index]) === 0 ? index : -1;
+ }
+});
+
+function insertionIndexForObjectInListSortedByFunction(object, list, comparator, insertionIndexAfter)
+{
+ if (insertionIndexAfter) {
+ return list.upperBound(object, comparator);
+ } else {
+ return list.lowerBound(object, comparator);
+ }
+}
+
+function insertObjectIntoSortedArray(object, array, comparator)
+{
+ array.splice(insertionIndexForObjectInListSortedByFunction(object, array, comparator), 0, object);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseWebInspectorjsfromrev164541trunkSourceWebInspectorUIUserInterfaceWebInspectorjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Base/WebInspector.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/WebInspector.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/WebInspector.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/WebInspector.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+const WebInspector = {}; // Namespace
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBlankStylePropertiesSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BlankStylePropertiesSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BlankStylePropertiesSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BlankStylePropertiesSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-/**
- * @constructor
- * @extends {WebInspector.StylePropertiesSection}
- */
-WebInspector.BlankStylePropertiesSection = function(parentPane, defaultSelectorText)
-{
- WebInspector.StylePropertiesSection.call(this, parentPane, {selectorText: defaultSelectorText, rule: {isViaInspector: true}}, true, false, false);
- this.element.classList.add("blank-section");
-}
-
-WebInspector.BlankStylePropertiesSection.prototype = {
- get isBlank()
- {
- return !this._normal;
- },
-
- expand: function()
- {
- if (!this.isBlank)
- WebInspector.StylePropertiesSection.prototype.expand.call(this);
- },
-
- editingSelectorCommitted: function(element, newContent, oldContent, context, moveDirection)
- {
- if (!this.isBlank) {
- WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.call(this, element, newContent, oldContent, context, moveDirection);
- return;
- }
-
- function successCallback(newRule, doesSelectorAffectSelectedNode)
- {
- var styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };
- this.makeNormal(styleRule);
-
- if (!doesSelectorAffectSelectedNode) {
- this.noAffect = true;
- this.element.classList.add("no-affect");
- }
-
- this._selectorRefElement.textContent = WebInspector.UIString("via inspector");
- this.expand();
- if (this.element.parentElement) // Might have been detached already.
- this._moveEditorFromSelector(moveDirection);
- }
-
- WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCallback.bind(this), this.editingSelectorCancelled.bind(this));
- },
-
- editingSelectorCancelled: function()
- {
- if (!this.isBlank) {
- WebInspector.StylePropertiesSection.prototype.editingSelectorCancelled.call(this);
- return;
- }
-
- this.pane.removeSection(this);
- },
-
- makeNormal: function(styleRule)
- {
- this.element.classList.remove("blank-section");
- this.styleRule = styleRule;
- this.rule = styleRule.rule;
-
- // FIXME: replace this instance by a normal WebInspector.StylePropertiesSection.
- this._normal = true;
- }
-}
-
-WebInspector.BlankStylePropertiesSection.prototype.__proto__ = WebInspector.StylePropertiesSection.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,133 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.details-section .row.box-model {
- padding: 6px;
- text-align: center;
- white-space: nowrap;
-}
-
-.details-section .row.box-model .label {
- position: absolute;
- color: black;
- margin-left: 3px;
- padding-left: 2px;
- padding-right: 2px;
-}
-
-.details-section .row.box-model .position {
- border: 1px rgb(66%, 66%, 66%) dotted;
- background-color: rgb(231, 231, 231);
- display: inline-block;
- text-align: center;
- padding: 3px;
- margin: 3px;
-}
-
-.details-section .row.box-model .margin {
- border: 1px dashed;
- background-color: rgb(231, 231, 231);
- display: inline-block;
- text-align: center;
- vertical-align: middle;
- padding: 3px;
- margin: 3px;
-}
-
-.details-section .row.box-model .margin.active {
- background-color: rgba(246, 178, 107, .66);
-}
-
-.details-section .row.box-model .border {
- border: 1px black solid;
- background-color: rgb(231, 231, 231);
- display: inline-block;
- text-align: center;
- vertical-align: middle;
- padding: 3px;
- margin: 3px;
-}
-
-.details-section .row.box-model .border.active {
- background-color: rgba(255, 229, 153, .66);
-}
-
-.details-section .row.box-model .padding {
- border: 1px grey dashed;
- background-color: rgb(231, 231, 231);
- display: inline-block;
- text-align: center;
- vertical-align: middle;
- padding: 3px;
- margin: 3px;
-}
-
-.details-section .row.box-model .padding.active {
- background-color: rgba(147, 196, 125, .55);
-}
-
-.details-section .row.box-model .content {
- position: static;
- border: 1px gray solid;
- background-color: rgb(231, 231, 231);
- display: inline-block;
- text-align: center;
- vertical-align: middle;
- padding: 3px;
- margin: 3px;
- min-width: 80px;
- overflow: visible;
-}
-
-.details-section .row.box-model .content.active {
- background-color: rgba(111, 168, 220, .66);
-}
-
-.details-section .row.box-model .content span {
- display: inline-block;
-}
-
-.details-section .row.box-model .editing {
- position: relative;
- z-index: 100;
-}
-
-.details-section .row.box-model .left {
- display: inline-block;
- vertical-align: middle;
-}
-
-.details-section .row.box-model .right {
- display: inline-block;
- vertical-align: middle;
-}
-
-.details-section .row.box-model .top {
- display: inline-block;
-}
-
-.details-section .row.box-model .bottom {
- display: inline-block;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,428 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BoxModelDetailsSectionRow = function() {
- WebInspector.DetailsSectionRow.call(this, WebInspector.UIString("No Box Model Information"));
-
- this.element.classList.add(WebInspector.BoxModelDetailsSectionRow.StyleClassName);
-
- this._nodeStyles = null;
-};
-
-WebInspector.BoxModelDetailsSectionRow.StyleClassName = "box-model";
-WebInspector.BoxModelDetailsSectionRow.StyleValueDelimiters = " \xA0\t\n\"':;,/()";
-WebInspector.BoxModelDetailsSectionRow.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;
-
-WebInspector.BoxModelDetailsSectionRow.prototype = {
- constructor: WebInspector.BoxModelDetailsSectionRow,
-
- // Public
-
- get nodeStyles()
- {
- return this._nodeStyles;
- },
-
- set nodeStyles(nodeStyles)
- {
- this._nodeStyles = nodeStyles;
-
- this._refresh();
- },
-
- // Private
-
- _refresh: function()
- {
- if (this._ignoreNextRefresh) {
- delete this._ignoreNextRefresh;
- return;
- }
-
- this._updateMetrics();
- },
-
- _getPropertyValueAsPx: function(style, propertyName)
- {
- return Number(style.propertyForName(propertyName).value.replace(/px$/, "") || 0);
- },
-
- _getBox: function(computedStyle, componentName)
- {
- var suffix = componentName === "border" ? "-width" : "";
- var left = this._getPropertyValueAsPx(computedStyle, componentName + "-left" + suffix);
- var top = this._getPropertyValueAsPx(computedStyle, componentName + "-top" + suffix);
- var right = this._getPropertyValueAsPx(computedStyle, componentName + "-right" + suffix);
- var bottom = this._getPropertyValueAsPx(computedStyle, componentName + "-bottom" + suffix);
- return { left: left, top: top, right: right, bottom: bottom };
- },
-
- _highlightDOMNode: function(showHighlight, mode, event)
- {
- event.stopPropagation();
-
- var nodeId = showHighlight ? this.nodeStyles.node.id : 0;
- if (nodeId) {
- if (this._highlightMode === mode)
- return;
- this._highlightMode = mode;
- WebInspector.domTreeManager.highlightDOMNode(nodeId, mode);
- } else {
- delete this._highlightMode;
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- }
-
- for (var i = 0; this._boxElements && i < this._boxElements.length; ++i) {
- var element = this._boxElements[i];
- if (nodeId && (mode === "all" || element._name === mode))
- element.classList.add("active");
- else
- element.classList.remove("active");
- }
- },
-
- _updateMetrics: function()
- {
- // Updating with computed style.
- var metricsElement = document.createElement("div");
-
- var self = this;
- var style = this._nodeStyles.computedStyle;
-
- function createElement(type, value, name, propertyName, style)
- {
- // Check if the value is a float and whether it should be rounded.
- var floatValue = parseFloat(value);
- var shouldRoundValue = (!isNaN(floatValue) && floatValue % 1 !== 0);
-
- var element = document.createElement(type);
- element.textContent = shouldRoundValue ? ("~" + Math.round(floatValue * 100) / 100) : value;
- if (shouldRoundValue)
- element.title = value;
- element.addEventListener("dblclick", this._startEditing.bind(this, element, name, propertyName, style), false);
- return element;
- }
-
- function createBoxPartElement(style, name, side, suffix)
- {
- var propertyName = (name !== "position" ? name + "-" : "") + side + suffix;
- var value = style.propertyForName(propertyName).value;
- if (value === "" || (name !== "position" && value === "0px"))
- value = "\u2012";
- else if (name === "position" && value === "auto")
- value = "\u2012";
- value = value.replace(/px$/, "");
-
- var element = createElement.call(this, "div", value, name, propertyName, style);
- element.className = side;
- return element;
- }
-
- function createContentAreaWidthElement(style)
- {
- var width = style.propertyForName("width").value.replace(/px$/, "");
- if (style.propertyForName("box-sizing").value === "border-box") {
- var borderBox = self._getBox(style, "border");
- var paddingBox = self._getBox(style, "padding");
-
- width = width - borderBox.left - borderBox.right - paddingBox.left - paddingBox.right;
- }
-
- return createElement.call(this, "span", width, "width", "width", style);
- }
-
- function createContentAreaHeightElement(style)
- {
- var height = style.propertyForName("height").value.replace(/px$/, "");
- if (style.propertyForName("box-sizing").value === "border-box") {
- var borderBox = self._getBox(style, "border");
- var paddingBox = self._getBox(style, "padding");
-
- height = height - borderBox.top - borderBox.bottom - paddingBox.top - paddingBox.bottom;
- }
-
- return createElement.call(this, "span", height, "height", "height", style);
- }
-
- // Display types for which margin is ignored.
- var noMarginDisplayType = {
- "table-cell": true,
- "table-column": true,
- "table-column-group": true,
- "table-footer-group": true,
- "table-header-group": true,
- "table-row": true,
- "table-row-group": true
- };
-
- // Display types for which padding is ignored.
- var noPaddingDisplayType = {
- "table-column": true,
- "table-column-group": true,
- "table-footer-group": true,
- "table-header-group": true,
- "table-row": true,
- "table-row-group": true
- };
-
- // Position types for which top, left, bottom and right are ignored.
- var noPositionType = {
- "static": true
- };
-
- this._boxElements = [];
- var boxes = ["content", "padding", "border", "margin", "position"];
-
- if (!style.properties.length) {
- this.showEmptyMessage();
- return;
- }
-
- var previousBox = null;
- for (var i = 0; i < boxes.length; ++i) {
- var name = boxes[i];
-
- if (name === "margin" && noMarginDisplayType[style.propertyForName("display").value])
- continue;
- if (name === "padding" && noPaddingDisplayType[style.propertyForName("display").value])
- continue;
- if (name === "position" && noPositionType[style.propertyForName("position").value])
- continue;
-
- var boxElement = document.createElement("div");
- boxElement.className = name;
- boxElement._name = name;
- boxElement.addEventListener("mouseover", this._highlightDOMNode.bind(this, true, name === "position" ? "all" : name), false);
- this._boxElements.push(boxElement);
-
- if (name === "content") {
- var widthElement = createContentAreaWidthElement.call(this, style);
- var heightElement = createContentAreaHeightElement.call(this, style);
-
- boxElement.appendChild(widthElement);
- boxElement.appendChild(document.createTextNode(" \u00D7 "));
- boxElement.appendChild(heightElement);
- } else {
- var suffix = (name === "border" ? "-width" : "");
-
- var labelElement = document.createElement("div");
- labelElement.className = "label";
- labelElement.textContent = boxes[i];
- boxElement.appendChild(labelElement);
-
- boxElement.appendChild(createBoxPartElement.call(this, style, name, "top", suffix));
- boxElement.appendChild(document.createElement("br"));
- boxElement.appendChild(createBoxPartElement.call(this, style, name, "left", suffix));
-
- if (previousBox)
- boxElement.appendChild(previousBox);
-
- boxElement.appendChild(createBoxPartElement.call(this, style, name, "right", suffix));
- boxElement.appendChild(document.createElement("br"));
- boxElement.appendChild(createBoxPartElement.call(this, style, name, "bottom", suffix));
- }
-
- previousBox = boxElement;
- }
-
- metricsElement.appendChild(previousBox);
- metricsElement.addEventListener("mouseover", this._highlightDOMNode.bind(this, false, ""), false);
-
- this.hideEmptyMessage();
- this.element.appendChild(metricsElement);
- },
-
- _startEditing: function(targetElement, box, styleProperty, computedStyle)
- {
- if (WebInspector.isBeingEdited(targetElement))
- return;
-
- // If the target element has a title use it as the editing value
- // since the current text is likely truncated/rounded.
- if (targetElement.title)
- targetElement.textContent = targetElement.title;
-
- var context = {box: box, styleProperty: styleProperty};
- var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty);
- context.keyDownHandler = boundKeyDown;
- targetElement.addEventListener("keydown", boundKeyDown, false);
-
- this._isEditingMetrics = true;
-
- var config = new WebInspector.EditingConfig(this._editingCommitted.bind(this), this._editingCancelled.bind(this), context);
- WebInspector.startEditing(targetElement, config);
-
- window.getSelection().setBaseAndExtent(targetElement, 0, targetElement, 1);
- },
-
- _alteredFloatNumber: function(number, event)
- {
- var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
-
- // Jump by 10 when shift is down or jump by 0.1 when Alt/Option is down.
- // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
- var changeAmount = 1;
- if (event.shiftKey && !arrowKeyPressed)
- changeAmount = 100;
- else if (event.shiftKey || !arrowKeyPressed)
- changeAmount = 10;
- else if (event.altKey)
- changeAmount = 0.1;
-
- if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
- changeAmount *= -1;
-
- // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
- // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
- var result = Number((number + changeAmount).toFixed(6));
- if (!String(result).match(WebInspector.BoxModelDetailsSectionRow.CSSNumberRegex))
- return null;
-
- return result;
- },
-
- _handleKeyDown: function(context, styleProperty, event)
- {
- if (!/^(?:Page)?(?:Up|Down)$/.test(event.keyIdentifier))
- return;
-
- var element = event.currentTarget;
-
- var selection = window.getSelection();
- if (!selection.rangeCount)
- return;
-
- var selectionRange = selection.getRangeAt(0);
- if (!selectionRange.commonAncestorContainer.isSelfOrDescendant(element))
- return;
-
- var originalValue = element.textContent;
- var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.BoxModelDetailsSectionRow.StyleValueDelimiters, element);
- var wordString = wordRange.toString();
-
- var matches = /(.*?)(-?(?:\d+(?:\.\d+)?|\.\d+))(.*)/.exec(wordString);
- var replacementString;
- if (matches && matches.length) {
- var prefix = matches[1];
- var suffix = matches[3];
- var number = this._alteredFloatNumber(parseFloat(matches[2]), event);
- if (number === null) {
- // Need to check for null explicitly.
- return;
- }
-
- if (styleProperty !== "margin" && number < 0)
- number = 0;
-
- replacementString = prefix + number + suffix;
- }
-
- if (!replacementString)
- return;
-
- var replacementTextNode = document.createTextNode(replacementString);
-
- wordRange.deleteContents();
- wordRange.insertNode(replacementTextNode);
-
- var finalSelectionRange = document.createRange();
- finalSelectionRange.setStart(replacementTextNode, 0);
- finalSelectionRange.setEnd(replacementTextNode, replacementString.length);
-
- selection.removeAllRanges();
- selection.addRange(finalSelectionRange);
-
- event.handled = true;
- event.preventDefault();
-
- this._ignoreNextRefresh = true;
-
- this._applyUserInput(element, replacementString, originalValue, context, false);
- },
-
- _editingEnded: function(element, context)
- {
- delete this.originalPropertyData;
- delete this.previousPropertyDataCandidate;
- element.removeEventListener("keydown", context.keyDownHandler, false);
- delete this._isEditingMetrics;
- },
-
- _editingCancelled: function(element, context)
- {
- this._editingEnded(element, context);
- this._refresh();
- },
-
- _applyUserInput: function(element, userInput, previousContent, context, commitEditor)
- {
- if (commitEditor && userInput === previousContent)
- return this._editingCancelled(element, context); // nothing changed, so cancel
-
- if (context.box !== "position" && (!userInput || userInput === "\u2012"))
- userInput = "0px";
- else if (context.box === "position" && (!userInput || userInput === "\u2012"))
- userInput = "auto";
-
- userInput = userInput.toLowerCase();
- // Append a "px" unit if the user input was just a number.
- if (/^-?(?:\d+(?:\.\d+)?|\.\d+)$/.test(userInput))
- userInput += "px";
-
- var styleProperty = context.styleProperty;
- var computedStyle = this._nodeStyles.computedStyle;
-
- if (computedStyle.propertyForName("box-sizing").value === "border-box" && (styleProperty === "width" || styleProperty === "height")) {
- if (!userInput.match(/px$/)) {
- console.error("For elements with box-sizing: border-box, only absolute content area dimensions can be applied");
- return;
- }
-
- var borderBox = this._getBox(computedStyle, "border");
- var paddingBox = this._getBox(computedStyle, "padding");
- var userValuePx = Number(userInput.replace(/px$/, ""));
- if (isNaN(userValuePx))
- return;
- if (styleProperty === "width")
- userValuePx += borderBox.left + borderBox.right + paddingBox.left + paddingBox.right;
- else
- userValuePx += borderBox.top + borderBox.bottom + paddingBox.top + paddingBox.bottom;
-
- userInput = userValuePx + "px";
- }
-
- var property = this._nodeStyles.inlineStyle.propertyForName(context.styleProperty);
- property.value = userInput;
- property.add();
- },
-
- _editingCommitted: function(element, userInput, previousContent, context)
- {
- this._editingEnded(element, context);
- this._applyUserInput(element, userInput, previousContent, context, true);
- }
-};
-
-WebInspector.BoxModelDetailsSectionRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBranchjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Branch.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Branch.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Branch.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Branch = function(displayName, revisions, locked)
-{
- WebInspector.Object.call(this);
-
- console.assert(displayName);
-
- this._displayName = displayName;
- this._revisions = revisions instanceof Array ? revisions.slice() : [];
- this._locked = locked || false;
-};
-
-WebInspector.Branch.prototype = {
- constructor: WebInspector.Branch,
-
- // Public
-
- get displayName()
- {
- return this._displayName;
- },
-
- set displayName(displayName)
- {
- console.assert(displayName);
- if (!displayName)
- return;
-
- this._displayName = displayName;
- },
-
- get revisions()
- {
- return this._revisions;
- },
-
- get locked()
- {
- return this._locked;
- },
-
- revisionForRepresentedObject: function(representedObject, doNotCreateIfNeeded)
- {
- for (var i = 0; i < this._revisions.length; ++i) {
- var revision = this._revisions[i];
- if (revision instanceof WebInspector.SourceCodeRevision && revision.sourceCode === representedObject)
- return revision;
- }
-
- if (doNotCreateIfNeeded)
- return null;
-
- if (representedObject instanceof WebInspector.SourceCode) {
- var revision = representedObject.originalRevision.copy();
- representedObject.currentRevision = revision;
- this.addRevision(revision);
- return revision;
- }
-
- return null;
- },
-
- addRevision: function(revision)
- {
- console.assert(revision instanceof WebInspector.Revision);
-
- if (this._locked)
- return;
-
- if (this._revisions.contains(revision))
- return;
-
- this._revisions.push(revision);
- },
-
- removeRevision: function(revision)
- {
- console.assert(revision instanceof WebInspector.Revision);
-
- if (this._locked)
- return;
-
- this._revisions.remove(revision);
- },
-
- reset: function()
- {
- if (this._locked)
- return;
-
- this._revisions = [];
- },
-
- fork: function(displayName)
- {
- var copiedRevisions = this._revisions.map(function(revision) { return revision.copy(); });
- return new WebInspector.Branch(displayName, copiedRevisions);
- },
-
- apply: function()
- {
- for (var i = 0; i < this._revisions.length; ++i)
- this._revisions[i].apply();
- },
-
- revert: function()
- {
- for (var i = this._revisions.length - 1; i >= 0; --i)
- this._revisions[i].revert();
- },
-
- lock: function()
- {
- console.assert(!this._locked);
- this._locked = true;
- },
-
- unlock: function()
- {
- console.assert(this._locked);
- this._locked = false;
- }
-};
-
-WebInspector.Branch.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBranchManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BranchManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BranchManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BranchManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,113 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BranchManager = function()
-{
- WebInspector.Object.call(this);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
- this.initialize();
-}
-
-WebInspector.BranchManager.prototype = {
- constructor: WebInspector.BranchManager,
-
- // Public
-
- initialize: function()
- {
- this._originalBranch = new WebInspector.Branch(WebInspector.UIString("Original"), null, true);
- this._currentBranch = this._originalBranch.fork(WebInspector.UIString("Working Copy"));
- this._branches = [this._originalBranch, this._currentBranch];
- },
-
- get branches()
- {
- return this._branches;
- },
-
- get currentBranch()
- {
- return this._currentBranch;
- },
-
- set currentBranch(branch)
- {
- console.assert(branch instanceof WebInspector.Branch);
- if (!(branch instanceof WebInspector.Branch))
- return;
-
- this._currentBranch.revert();
-
- this._currentBranch = branch;
-
- this._currentBranch.apply();
- },
-
- createBranch: function(displayName, fromBranch)
- {
- if (!fromBranch)
- fromBranch = this._originalBranch;
-
- console.assert(fromBranch instanceof WebInspector.Branch);
- if (!(fromBranch instanceof WebInspector.Branch))
- return;
-
- var newBranch = fromBranch.fork(displayName);
- this._branches.push(newBranch);
- return newBranch;
- },
-
- deleteBranch: function(branch)
- {
- console.assert(branch instanceof WebInspector.Branch);
- if (!(branch instanceof WebInspector.Branch))
- return;
-
- console.assert(branch !== this._originalBranch);
- if (branch === this._originalBranch)
- return;
-
- this._branches.remove(branch);
-
- if (branch === this._currentBranch)
- this._currentBranch = this._originalBranch;
- },
-
- // Private
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- this.initialize();
- }
-};
-
-WebInspector.BranchManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Breakpoint.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Breakpoint.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Breakpoint.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.popover .edit-breakpoint-popover-content {
- width: 420px;
- padding: 5px 15px;
-
- font-family: "Lucida Grande", Helvetica, sans-serif;
- font-size: 11px;
-}
-
-.popover .edit-breakpoint-popover-content.wide {
- width: 460px;
-}
-
-.popover .edit-breakpoint-popover-content > label.toggle {
- color: black;
- font-weight: bold;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.popover .edit-breakpoint-popover-content > table {
- width: 100%;
-}
-
-.popover .edit-breakpoint-popover-content > table > tr > th {
- color: rgb(89, 89, 89);
- font-weight: bold;
- text-align: right;
- width: 1px; /* Shrink to fit. */
- vertical-align: top;
- line-height: 23px;
-}
-
-.popover .edit-breakpoint-popover-content > table > tr > td {
- padding-left: 5px;
-}
-
-#edit-breakpoint-popover-condition {
- width: 100%;
-}
-
-#edit-breakpoint-popoover-auto-continue {
- margin-left: 0;
- margin-right: 4px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Breakpoint.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Breakpoint.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Breakpoint.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,583 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Breakpoint = function(sourceCodeLocationOrInfo, disabled, condition)
-{
- WebInspector.Object.call(this);
-
- if (sourceCodeLocationOrInfo instanceof WebInspector.SourceCodeLocation) {
- var sourceCode = sourceCodeLocationOrInfo.sourceCode;
- var url = sourceCode ? sourceCode.url : null;
- var scriptIdentifier = sourceCode instanceof WebInspector.Script ? sourceCode.id : null;
- var location = sourceCodeLocationOrInfo;
- } else if (sourceCodeLocationOrInfo && typeof sourceCodeLocationOrInfo === "object") {
- var url = sourceCodeLocationOrInfo.url;
- var lineNumber = sourceCodeLocationOrInfo.lineNumber || 0;
- var columnNumber = sourceCodeLocationOrInfo.columnNumber || 0;
- var location = new WebInspector.SourceCodeLocation(null, lineNumber, columnNumber);
- var autoContinue = sourceCodeLocationOrInfo.autoContinue || false;
- var actions = sourceCodeLocationOrInfo.actions || [];
- for (var i = 0; i < actions.length; ++i)
- actions[i] = new WebInspector.BreakpointAction(this, actions[i]);
- disabled = sourceCodeLocationOrInfo.disabled;
- condition = sourceCodeLocationOrInfo.condition;
- } else
- console.error("Unexpected type passed to WebInspector.Breakpoint", sourceCodeLocationOrInfo);
-
- this._id = null;
- this._url = url || null;
- this._scriptIdentifier = scriptIdentifier || null;
- this._disabled = disabled || false;
- this._condition = condition || "";
- this._autoContinue = autoContinue || false;
- this._actions = actions || [];
- this._resolved = false;
-
- this._sourceCodeLocation = location;
- this._sourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationLocationChanged, this);
- this._sourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, this._sourceCodeLocationDisplayLocationChanged, this);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Breakpoint);
-
-WebInspector.Breakpoint.PopoverClassName = "edit-breakpoint-popover-content";
-WebInspector.Breakpoint.WidePopoverClassName = "wide";
-WebInspector.Breakpoint.PopoverConditionInputId = "edit-breakpoint-popover-condition";
-WebInspector.Breakpoint.PopoverOptionsAutoContinueInputId = "edit-breakpoint-popoover-auto-continue";
-WebInspector.Breakpoint.HiddenStyleClassName = "hidden";
-
-WebInspector.Breakpoint.DefaultBreakpointActionType = WebInspector.BreakpointAction.Type.Log;
-
-WebInspector.Breakpoint.TypeIdentifier = "breakpoint";
-WebInspector.Breakpoint.URLCookieKey = "breakpoint-url";
-WebInspector.Breakpoint.LineNumberCookieKey = "breakpoint-line-number";
-WebInspector.Breakpoint.ColumnNumberCookieKey = "breakpoint-column-number";
-
-WebInspector.Breakpoint.Event = {
- DisabledStateDidChange: "breakpoint-disabled-state-did-change",
- ResolvedStateDidChange: "breakpoint-resolved-state-did-change",
- ConditionDidChange: "breakpoint-condition-did-change",
- ActionsDidChange: "breakpoint-actions-did-change",
- AutoContinueDidChange: "breakpoint-auto-continue-did-change",
- LocationDidChange: "breakpoint-location-did-change",
- DisplayLocationDidChange: "breakpoint-display-location-did-change",
-};
-
-WebInspector.Breakpoint.prototype = {
- constructor: WebInspector.Breakpoint,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- set id(id)
- {
- this._id = id || null;
- },
-
- get url()
- {
- return this._url;
- },
-
- get scriptIdentifier()
- {
- return this._scriptIdentifier;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- get resolved()
- {
- return this._resolved && WebInspector.debuggerManager.breakpointsEnabled;
- },
-
- set resolved(resolved)
- {
- if (this._resolved === resolved)
- return;
-
- this._resolved = resolved || false;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
- },
-
- get disabled()
- {
- return this._disabled;
- },
-
- set disabled(disabled)
- {
- if (this._disabled === disabled)
- return;
-
- this._disabled = disabled || false;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.DisabledStateDidChange);
- },
-
- get condition()
- {
- return this._condition;
- },
-
- set condition(condition)
- {
- if (this._condition === condition)
- return;
-
- this._condition = condition;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ConditionDidChange);
- },
-
- get autoContinue()
- {
- return this._autoContinue;
- },
-
- set autoContinue(cont)
- {
- if (this._autoContinue === cont)
- return;
-
- this._autoContinue = cont;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.AutoContinueDidChange);
- },
-
- get actions()
- {
- return this._actions;
- },
-
- get options()
- {
- return {
- condition: this._condition,
- actions: this._serializableActions(),
- autoContinue: this._autoContinue
- };
- },
-
- get info()
- {
- // The id, scriptIdentifier and resolved state are tied to the current session, so don't include them for serialization.
- return {
- url: this._url,
- lineNumber: this._sourceCodeLocation.lineNumber,
- columnNumber: this._sourceCodeLocation.columnNumber,
- disabled: this._disabled,
- condition: this._condition,
- actions: this._serializableActions(),
- autoContinue: this._autoContinue
- };
- },
-
- get probeActions()
- {
- return this._actions.filter(function(action) {
- return action.type === WebInspector.BreakpointAction.Type.Probe;
- });
- },
-
- cycleToNextMode: function()
- {
- if (this.disabled) {
- // When cycling, clear auto-continue when going from disabled to enabled.
- this.autoContinue = false;
- this.disabled = false;
- return;
- }
-
- if (this.autoContinue) {
- this.disabled = true;
- return;
- }
-
- if (this.actions.length) {
- this.autoContinue = true;
- return;
- }
-
- this.disabled = true;
- },
-
- appendContextMenuItems: function(contextMenu, breakpointDisplayElement)
- {
- console.assert(document.body.contains(breakpointDisplayElement), "breakpoint popover display element must be in the DOM");
-
- var boundingClientRect = breakpointDisplayElement.getBoundingClientRect();
-
- function editBreakpoint()
- {
- this._showEditBreakpointPopover(boundingClientRect);
- }
-
- function removeBreakpoint()
- {
- WebInspector.debuggerManager.removeBreakpoint(this);
- }
-
- function toggleBreakpoint()
- {
- this.disabled = !this.disabled;
- }
-
- function toggleAutoContinue()
- {
- this.autoContinue = !this.autoContinue;
- }
-
- function revealOriginalSourceCodeLocation()
- {
- WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(this._sourceCodeLocation);
- }
-
- if (WebInspector.debuggerManager.isBreakpointEditable(this))
- contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint…"), editBreakpoint.bind(this));
-
- if (this.autoContinue && !this.disabled) {
- contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), toggleBreakpoint.bind(this));
- contextMenu.appendItem(WebInspector.UIString("Cancel Automatic Continue"), toggleAutoContinue.bind(this));
- } else if (!this.disabled)
- contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), toggleBreakpoint.bind(this));
- else
- contextMenu.appendItem(WebInspector.UIString("Enable Breakpoint"), toggleBreakpoint.bind(this));
-
- if (!this.autoContinue && !this.disabled && this.actions.length)
- contextMenu.appendItem(WebInspector.UIString("Set to Automatically Continue"), toggleAutoContinue.bind(this));
-
- if (WebInspector.debuggerManager.isBreakpointRemovable(this)) {
- contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString("Delete Breakpoint"), removeBreakpoint.bind(this));
- }
-
- if (this._sourceCodeLocation.hasMappedLocation()) {
- contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString("Reveal in Original Resource"), revealOriginalSourceCodeLocation.bind(this));
- }
- },
-
- createAction: function(type, precedingAction, data)
- {
- var newAction = new WebInspector.BreakpointAction(this, type, data || null);
-
- if (!precedingAction)
- this._actions.push(newAction);
- else {
- var index = this._actions.indexOf(precedingAction);
- console.assert(index !== -1);
- if (index === -1)
- this._actions.push(newAction);
- else
- this._actions.splice(index + 1, 0, newAction);
- }
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
-
- return newAction;
- },
-
- recreateAction: function(type, actionToReplace)
- {
- var newAction = new WebInspector.BreakpointAction(this, type, null);
-
- var index = this._actions.indexOf(actionToReplace);
- console.assert(index !== -1);
- if (index === -1)
- return null;
-
- this._actions[index] = newAction;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
-
- return newAction;
- },
-
- removeAction: function(action)
- {
- var index = this._actions.indexOf(action);
- console.assert(index !== -1);
- if (index === -1)
- return;
-
- this._actions.splice(index, 1);
-
- if (!this._actions.length)
- this.autoContinue = false;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
- },
-
- clearActions: function(type)
- {
- if (!type)
- this._actions = [];
- else
- this._actions = this._actions.filter(function(action) { action.type != type; });
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.Breakpoint.URLCookieKey] = this.url;
- cookie[WebInspector.Breakpoint.LineNumberCookieKey] = this.sourceCodeLocation.lineNumber;
- cookie[WebInspector.Breakpoint.ColumnNumberCookieKey] = this.sourceCodeLocation.columnNumber;
- },
-
- // Protected (Called by BreakpointAction)
-
- breakpointActionDidChange: function(action)
- {
- var index = this._actions.indexOf(action);
- console.assert(index !== -1);
- if (index === -1)
- return;
-
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
- },
-
- // Private
-
- _serializableActions: function()
- {
- var actions = [];
- for (var i = 0; i < this._actions.length; ++i)
- actions.push(this._actions[i].info);
- return actions;
- },
-
- _popoverToggleEnabledCheckboxChanged: function(event)
- {
- this.disabled = !event.target.checked;
- },
-
- _popoverConditionInputChanged: function(event)
- {
- this.condition = event.target.value;
- },
-
- _popoverToggleAutoContinueCheckboxChanged: function(event)
- {
- this.autoContinue = event.target.checked;
- },
-
- _popoverConditionInputKeyDown: function(event)
- {
- if (this._keyboardShortcutEsc.matchesEvent(event) || this._keyboardShortcutEnter.matchesEvent(event)) {
- this._popover.dismiss();
- event.stopPropagation();
- event.preventDefault();
- }
- },
-
- _editBreakpointPopoverContentElement: function()
- {
- var content = this._popoverContentElement = document.createElement("div");
- content.className = WebInspector.Breakpoint.PopoverClassName;
-
- var checkboxElement = document.createElement("input");
- checkboxElement.type = "checkbox";
- checkboxElement.checked = !this._disabled;
- checkboxElement.addEventListener("change", this._popoverToggleEnabledCheckboxChanged.bind(this));
-
- var checkboxLabel = document.createElement("label");
- checkboxLabel.className = "toggle";
- checkboxLabel.appendChild(checkboxElement);
- checkboxLabel.appendChild(document.createTextNode(this._sourceCodeLocation.displayLocationString()));
-
- var table = document.createElement("table");
-
- var conditionRow = table.appendChild(document.createElement("tr"));
- var conditionHeader = conditionRow.appendChild(document.createElement("th"));
- var conditionData = conditionRow.appendChild(document.createElement("td"));
- var conditionLabel = conditionHeader.appendChild(document.createElement("label"));
- var conditionInput = conditionData.appendChild(document.createElement("input"));
- conditionInput.id = WebInspector.Breakpoint.PopoverConditionInputId;
- conditionInput.value = this._condition || "";
- conditionInput.spellcheck = false;
- conditionInput.addEventListener("change", this._popoverConditionInputChanged.bind(this));
- conditionInput.addEventListener("keydown", this._popoverConditionInputKeyDown.bind(this));
- conditionInput.placeholder = WebInspector.UIString("Conditional expression");
- conditionLabel.setAttribute("for", conditionInput.id);
- conditionLabel.textContent = WebInspector.UIString("Condition");
-
- if (DebuggerAgent.setBreakpoint.supports("options")) {
- var actionRow = table.appendChild(document.createElement("tr"));
- var actionHeader = actionRow.appendChild(document.createElement("th"));
- var actionData = this._actionsContainer = actionRow.appendChild(document.createElement("td"));
- var actionLabel = actionHeader.appendChild(document.createElement("label"));
- actionLabel.textContent = WebInspector.UIString("Action");
-
- if (!this._actions.length)
- this._popoverActionsCreateAddActionButton();
- else {
- this._popoverContentElement.classList.add(WebInspector.Breakpoint.WidePopoverClassName);
- for (var i = 0; i < this._actions.length; ++i) {
- var breakpointActionView = new WebInspector.BreakpointActionView(this._actions[i], this, true);
- this._popoverActionsInsertBreakpointActionView(breakpointActionView, i);
- }
- }
-
- var optionsRow = this._popoverOptionsRowElement = table.appendChild(document.createElement("tr"));
- if (!this._actions.length)
- optionsRow.classList.add(WebInspector.Breakpoint.HiddenStyleClassName);
- var optionsHeader = optionsRow.appendChild(document.createElement("th"));
- var optionsData = optionsRow.appendChild(document.createElement("td"));
- var optionsLabel = optionsHeader.appendChild(document.createElement("label"));
- var optionsCheckbox = this._popoverOptionsCheckboxElement = optionsData.appendChild(document.createElement("input"));
- var optionsCheckboxLabel = optionsData.appendChild(document.createElement("label"));
- optionsCheckbox.id = WebInspector.Breakpoint.PopoverOptionsAutoContinueInputId;
- optionsCheckbox.type = "checkbox";
- optionsCheckbox.checked = this._autoContinue;
- optionsCheckbox.addEventListener("change", this._popoverToggleAutoContinueCheckboxChanged.bind(this));
- optionsLabel.textContent = WebInspector.UIString("Options");
- optionsCheckboxLabel.setAttribute("for", optionsCheckbox.id);
- optionsCheckboxLabel.textContent = WebInspector.UIString("Automatically continue after evaluating");
- }
-
- content.appendChild(checkboxLabel);
- content.appendChild(table);
-
- return content;
- },
-
- _popoverActionsCreateAddActionButton: function()
- {
- this._popoverContentElement.classList.remove(WebInspector.Breakpoint.WidePopoverClassName);
- this._actionsContainer.removeChildren();
-
- var addActionButton = this._actionsContainer.appendChild(document.createElement("button"));
- addActionButton.textContent = WebInspector.UIString("Add Action");
- addActionButton.addEventListener("click", this._popoverActionsAddActionButtonClicked.bind(this));
- },
-
- _popoverActionsAddActionButtonClicked: function(event)
- {
- this._popoverContentElement.classList.add(WebInspector.Breakpoint.WidePopoverClassName);
- this._actionsContainer.removeChildren();
-
- var newAction = this.createAction(WebInspector.Breakpoint.DefaultBreakpointActionType);
- var newBreakpointActionView = new WebInspector.BreakpointActionView(newAction, this);
- this._popoverActionsInsertBreakpointActionView(newBreakpointActionView, -1);
- this._popoverOptionsRowElement.classList.remove(WebInspector.Breakpoint.HiddenStyleClassName);
- this._popover.update();
- },
-
- _popoverActionsInsertBreakpointActionView: function(breakpointActionView, index)
- {
- if (index === -1)
- this._actionsContainer.appendChild(breakpointActionView.element);
- else {
- var nextElement = this._actionsContainer.children[index + 1] || null;
- this._actionsContainer.insertBefore(breakpointActionView.element, nextElement);
- }
- },
-
- breakpointActionViewAppendActionView: function(breakpointActionView, newAction)
- {
- var newBreakpointActionView = new WebInspector.BreakpointActionView(newAction, this);
-
- var index = 0;
- var children = this._actionsContainer.children;
- for (var i = 0; children.length; ++i) {
- if (children[i] === breakpointActionView.element) {
- index = i;
- break;
- }
- }
-
- this._popoverActionsInsertBreakpointActionView(newBreakpointActionView, index);
- this._popoverOptionsRowElement.classList.remove(WebInspector.Breakpoint.HiddenStyleClassName);
-
- this._popover.update();
- },
-
- breakpointActionViewRemoveActionView: function(breakpointActionView)
- {
- breakpointActionView.element.remove();
-
- if (!this._actionsContainer.children.length) {
- this._popoverActionsCreateAddActionButton();
- this._popoverOptionsRowElement.classList.add(WebInspector.Breakpoint.HiddenStyleClassName);
- this._popoverOptionsCheckboxElement.checked = false;
- }
-
- this._popover.update();
- },
-
- breakpointActionViewResized: function(breakpointActionView)
- {
- this._popover.update();
- },
-
- willDismissPopover: function(popover)
- {
- console.assert(this._popover === popover);
- delete this._popoverContentElement;
- delete this._popoverOptionsRowElement;
- delete this._popoverOptionsCheckboxElement;
- delete this._actionsContainer;
- delete this._popover;
- },
-
- _showEditBreakpointPopover: function(boundingClientRect)
- {
- var bounds = WebInspector.Rect.rectFromClientRect(boundingClientRect);
- bounds.origin.x -= 1; // Move the anchor left one pixel so it looks more centered.
-
- this._popover = this._popover || new WebInspector.Popover(this);
- this._popover.content = this._editBreakpointPopoverContentElement();
- this._popover.present(bounds.pad(2), [WebInspector.RectEdge.MAX_Y]);
-
- if (!this._keyboardShortcutEsc) {
- this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
- this._keyboardShortcutEnter = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter);
- }
-
- document.getElementById(WebInspector.Breakpoint.PopoverConditionInputId).select();
- },
-
- _sourceCodeLocationLocationChanged: function(event)
- {
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.LocationDidChange, event.data);
- },
-
- _sourceCodeLocationDisplayLocationChanged: function(event)
- {
- this.dispatchEventToListeners(WebInspector.Breakpoint.Event.DisplayLocationDidChange, event.data);
- }
-};
-
-WebInspector.Breakpoint.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointActionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BreakpointAction.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BreakpointAction.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BreakpointAction.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointAction = function(breakpoint, typeOrInfo, data)
-{
- WebInspector.Object.call(this);
-
- console.assert(breakpoint);
- console.assert(typeOrInfo);
-
- this._breakpoint = breakpoint;
-
- if (typeof typeOrInfo === "string") {
- this._type = typeOrInfo;
- this._data = data || null;
- } else if (typeof typeOrInfo === "object") {
- this._type = typeOrInfo.type;
- this._data = typeOrInfo.data || null;
- } else
- console.error("Unexpected type passed to WebInspector.BreakpointAction");
-
- console.assert(typeof this._type === "string");
- this._id = WebInspector.debuggerManager.nextBreakpointActionIdentifier;
-};
-
-WebInspector.BreakpointAction.Type = {
- Log: "log",
- Evaluate: "evaluate",
- Sound: "sound",
- Probe: "probe"
-}
-
-WebInspector.BreakpointAction.prototype = {
- constructor: WebInspector.BreakpointAction,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get breakpoint()
- {
- return this._breakpoint;
- },
-
- get id()
- {
- return this._id;
- },
-
- get type()
- {
- return this._type;
- },
-
- get data()
- {
- return this._data;
- },
-
- set data(data)
- {
- if (this._data === data)
- return;
-
- this._data = data;
-
- this._breakpoint.breakpointActionDidChange(this);
- },
-
- get info()
- {
- var obj = {type: this._type, id: this._id};
- if (this._data)
- obj.data = this._data;
- return obj;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.breakpoint-action-block-header {
- margin-bottom: 3px;
-}
-
-.breakpoint-action-append-button,
-.breakpoint-action-remove-button {
- border: 1px solid rgb(170, 170, 170);
- border-radius: 10px;
- background-size: 16px 16px;
- background-origin: border-box;
- width: 16px;
- height: 16px;
- float: right;
- margin-left: 2px;
- margin-top: 2px;
-}
-
-.breakpoint-action-append-button:active,
-.breakpoint-action-remove-button:active {
- -webkit-filter: brightness(50%);
-}
-
-.breakpoint-action-append-button {
- background-image: url(Images/BreakpointActionAdd.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
-}
-
-.breakpoint-action-remove-button {
- background-image: url(Images/BreakpointActionRemove.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
-}
-
-.breakpoint-action-block-body {
- margin: 1px 2px 6px 2px;
- padding: 8px;
- width: 100%;
- border-radius: 4px;
- border: 1px solid rgb(190, 190, 190);
- background-color: rgba(222, 222, 222, 0.95);
- -webkit-box-shadow: inset 0 0 2px rgb(200, 200, 200);
-}
-
-.breakpoint-action-block-body > input {
- width: 100%;
-}
-
-.breakpoint-action-eval-editor {
- padding: 4px 0 2px 0;
- -webkit-appearance: textfield;
- border: 1px solid rgb(200, 200, 200);
- background: white;
-}
-
-.breakpoint-action-eval-editor > .CodeMirror {
- width: 336px; /* NOTE: Fixed value, manually tuned to .edit-breakpoint-popover-content.wide width */
- height: auto;
-}
-
-.breakpoint-action-eval-editor > .CodeMirror-scroll {
- width: 336px; /* NOTE: Fixed value, manually tuned to .edit-breakpoint-popover-content.wide width */
- overflow: hidden;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointActionView = function(action, delegate, omitFocus)
-{
- WebInspector.Object.call(this);
-
- console.assert(action);
- console.assert(delegate);
- console.assert(DebuggerAgent.BreakpointActionType);
-
- this._action = action;
- this._delegate = delegate;
-
- this._element = document.createElement("div");
- this._element.className = "breakpoint-action-block";
-
- var header = this._element.appendChild(document.createElement("div"));
- header.className = "breakpoint-action-block-header";
-
- var picker = header.appendChild(document.createElement("select"));
- picker.addEventListener("change", this._pickerChanged.bind(this));
-
- for (var key in WebInspector.BreakpointAction.Type) {
- var type = WebInspector.BreakpointAction.Type[key];
- var option = document.createElement("option");
- option.textContent = WebInspector.BreakpointActionView.displayStringForType(type);
- option.selected = this._action.type === type;
- option.value = type;
- picker.add(option);
- }
-
- var appendActionButton = header.appendChild(document.createElement("button"));
- appendActionButton.className = "breakpoint-action-append-button";
- appendActionButton.addEventListener("click", this._appendActionButtonClicked.bind(this));
- appendActionButton.title = WebInspector.UIString("Add new breakpoint action after this action");
-
- var removeActionButton = header.appendChild(document.createElement("button"));
- removeActionButton.className = "breakpoint-action-remove-button";
- removeActionButton.addEventListener("click", this._removeAction.bind(this));
- removeActionButton.title = WebInspector.UIString("Remove this breakpoint action");
-
- this._bodyElement = this._element.appendChild(document.createElement("div"));
- this._bodyElement.className = "breakpoint-action-block-body";
-
- this._updateBody(omitFocus);
-};
-
-WebInspector.BreakpointActionView.displayStringForType = function(type)
-{
- switch (type) {
- case WebInspector.BreakpointAction.Type.Log:
- return WebInspector.UIString("Log Message");
- case WebInspector.BreakpointAction.Type.Evaluate:
- return WebInspector.UIString("Evaluate JavaScript");
- case WebInspector.BreakpointAction.Type.Sound:
- return WebInspector.UIString("Play Sound");
- case WebInspector.BreakpointAction.Type.Probe:
- return WebInspector.UIString("Probe Expression");
- default:
- console.assert(false);
- return "";
- }
-}
-
-WebInspector.BreakpointActionView.prototype = {
- constructor: WebInspector.BreakpointActionView,
-
- // Public
-
- get action()
- {
- return this._action;
- },
-
- get element()
- {
- return this._element;
- },
-
- // Private
-
- _pickerChanged: function(event)
- {
- var newType = event.target.value;
- this._action = this._action.breakpoint.recreateAction(newType, this._action);
- this._updateBody();
- this._delegate.breakpointActionViewResized(this);
- },
-
- _appendActionButtonClicked: function(event)
- {
- var newAction = this._action.breakpoint.createAction(WebInspector.Breakpoint.DefaultBreakpointActionType, this._action);
- this._delegate.breakpointActionViewAppendActionView(this, newAction);
- },
-
- _removeAction: function()
- {
- this._action.breakpoint.removeAction(this._action);
- this._delegate.breakpointActionViewRemoveActionView(this);
- },
-
- _updateBody: function(omitFocus)
- {
- this._bodyElement.removeChildren();
-
- switch (this._action.type) {
- case WebInspector.BreakpointAction.Type.Log:
- this._bodyElement.hidden = false;
-
- var input = this._bodyElement.appendChild(document.createElement("input"));
- input.placeholder = WebInspector.UIString("Message");
- input.addEventListener("change", this._logInputChanged.bind(this));
- input.value = this._action.data || "";
- input.spellcheck = false;
- if (!omitFocus)
- setTimeout(function() { input.focus(); }, 0);
-
- break;
-
- case WebInspector.BreakpointAction.Type.Evaluate:
- case WebInspector.BreakpointAction.Type.Probe:
- this._bodyElement.hidden = false;
-
- var editorElement = this._bodyElement.appendChild(document.createElement("div"));
- editorElement.classList.add("breakpoint-action-eval-editor");
- editorElement.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- this._codeMirror = CodeMirror(editorElement, {
- lineWrapping: true,
- mode: "text/javascript",
- indentWithTabs: true,
- indentUnit: 4,
- matchBrackets: true,
- value: this._action.data || "",
- });
-
- this._codeMirror.on("viewportChange", this._codeMirrorViewportChanged.bind(this));
- this._codeMirror.on("blur", this._codeMirrorBlurred.bind(this));
-
- var completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror);
- completionController.addExtendedCompletionProvider("javascript", WebInspector.javaScriptRuntimeCompletionProvider);
-
- // CodeMirror needs a refresh after the popover displays, to layout, otherwise it doesn't appear.
- setTimeout(function() {
- this._codeMirror.refresh();
- if (!omitFocus)
- this._codeMirror.focus();
- }.bind(this), 0);
-
- break;
-
- case WebInspector.BreakpointAction.Type.Sound:
- this._bodyElement.hidden = true;
- break;
-
- default:
- console.assert(false);
- this._bodyElement.hidden = true;
- break;
- }
- },
-
- _logInputChanged: function(event)
- {
- this._action.data = event.target.value;
- },
-
- _codeMirrorBlurred: function(event)
- {
- // Throw away the expression if it's just whitespace.
- var data = (this._codeMirror.getValue() || "").trim();
-
- if (!data.length)
- this._removeAction();
- else
- this._action.data = data;
- },
-
- _codeMirrorViewportChanged: function(event)
- {
- this._delegate.breakpointActionViewResized(this);
- }
-};
-
-WebInspector.BreakpointActionView.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,78 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.item.breakpoint .status > .status-image {
- width: 21px;
- height: 12px;
- content: url(Images/BreakpointInactiveButton.svg);
- margin-top: 3px;
-}
-
-.item.breakpoint .status > .status-image.resolved {
- content: url(Images/BreakpointButton.svg);
-}
-
-.item.breakpoint .status > .status-image.auto-continue {
- opacity: 0.6;
-}
-
-.item.breakpoint .status > .status-image.disabled {
- opacity: 0.35;
-}
-
-.item.breakpoint .subtitle.formatted-location {
- font-style: italic;
-}
-
-.breakpoint-exception-icon .icon {
- content: url(Images/Exception.svg);
-}
-
-/* When animating a layer on top of a tree element's icon, move the main
-icon to the icon element's background so animations are layered on top. */
-.breakpoint-generic-line-icon .icon {
- background-image: url(Images/ResultLine.svg);
- content: '';
-}
-
-.breakpoint-generic-line-icon .icon > span {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-
- border-radius: 50%;
- -webkit-transform: scale(0);
- -webkit-transition: none;
- background-color: rgba(76, 102, 143, 1);
-}
-
-.data-updated.breakpoint-generic-line-icon .icon > span {
- border-radius: 0;
- -webkit-transform: scale(0.85);
- -webkit-transition: all .4s ease-out;
- background-color: rgba(76, 102, 143, 0.1);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,262 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointTreeElement = function(breakpoint, className, title)
-{
- console.assert(breakpoint instanceof WebInspector.Breakpoint);
-
- if (!className)
- className = WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName;
-
- WebInspector.GeneralTreeElement.call(this, [WebInspector.BreakpointTreeElement.StyleClassName, className], title, null, breakpoint, false);
-
- this._breakpoint = breakpoint;
-
- this._listeners = new WebInspector.EventListenerSet(this, "BreakpointTreeElement listeners");
- if (!title)
- this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.LocationDidChange, this._breakpointLocationDidChange);
- this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateStatus);
- this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateStatus);
- this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateStatus);
-
- this._listeners.register(WebInspector.probeManager, WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetAdded);
- this._listeners.register(WebInspector.probeManager, WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetRemoved);
-
- this._statusImageElement = document.createElement("img");
- this._statusImageElement.className = WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName;
- this._listeners.register(this._statusImageElement, "mousedown", this._statusImageElementMouseDown);
- this._listeners.register(this._statusImageElement, "click", this._statusImageElementClicked);
-
- if (!title)
- this._updateTitles();
- this._updateStatus();
-
- this.status = this._statusImageElement;
- this.small = true;
-
- this._iconAnimationLayerElement = document.createElement("span");
- this.iconElement.appendChild(this._iconAnimationLayerElement);
-};
-
-WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName = "breakpoint-generic-line-icon";
-WebInspector.BreakpointTreeElement.StyleClassName = "breakpoint";
-WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName = "status-image";
-WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName = "resolved";
-WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName = "auto-continue";
-WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName = "disabled";
-WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName = "formatted-location";
-WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName = "data-updated";
-
-WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration = 400; // milliseconds
-
-
-WebInspector.BreakpointTreeElement.prototype = {
- constructor: WebInspector.BreakpointTreeElement,
-
- // Public
-
- get breakpoint()
- {
- return this._breakpoint;
- },
-
- ondelete: function()
- {
- if (!WebInspector.debuggerManager.isBreakpointRemovable(this._breakpoint))
- return false;
-
- WebInspector.debuggerManager.removeBreakpoint(this._breakpoint);
- return true;
- },
-
- onenter: function()
- {
- this._breakpoint.cycleToNextMode();
- return true;
- },
-
- onspace: function()
- {
- this._breakpoint.cycleToNextMode();
- return true;
- },
-
- oncontextmenu: function(event)
- {
- var contextMenu = new WebInspector.ContextMenu(event);
- this._breakpoint.appendContextMenuItems(contextMenu, this._statusImageElement);
- contextMenu.show();
- },
-
- onattach: function()
- {
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
- this._listeners.install();
-
- for (var probeSet of WebInspector.probeManager.probeSets)
- if (probeSet.breakpoint === this._breakpoint)
- this._addProbeSet(probeSet);
- },
-
- ondetach: function()
- {
- WebInspector.GeneralTreeElement.prototype.ondetach.call(this);
-
- this._listeners.uninstall();
-
- if (this._probeSet)
- this._removeProbeSet(this._probeSet);
- },
-
- // Private
-
- _updateTitles: function()
- {
- var sourceCodeLocation = this._breakpoint.sourceCodeLocation;
-
- var displayLineNumber = sourceCodeLocation.displayLineNumber;
- var displayColumnNumber = sourceCodeLocation.displayColumnNumber;
- if (displayColumnNumber > 0)
- this.mainTitle = WebInspector.UIString("Line %d:%d").format(displayLineNumber + 1, displayColumnNumber + 1); // The user visible line and column numbers are 1-based.
- else
- this.mainTitle = WebInspector.UIString("Line %d").format(displayLineNumber + 1); // The user visible line number is 1-based.
-
- if (sourceCodeLocation.hasMappedLocation()) {
- this.subtitle = sourceCodeLocation.formattedLocationString();
-
- if (sourceCodeLocation.hasFormattedLocation())
- this.subtitleElement.classList.add(WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName);
- else
- this.subtitleElement.classList.remove(WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName);
-
- this.tooltip = this.mainTitle + " \u2014 " + WebInspector.UIString("originally %s").format(sourceCodeLocation.originalLocationString());
- }
- },
-
- _updateStatus: function()
- {
- if (this._breakpoint.disabled)
- this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName);
- else
- this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName);
-
- if (this._breakpoint.autoContinue)
- this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
- else
- this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
-
- if (this._breakpoint.resolved)
- this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName);
- else
- this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName);
- },
-
- _addProbeSet: function(probeSet)
- {
- console.assert(probeSet instanceof WebInspector.ProbeSet);
- console.assert(probeSet.breakpoint === this._breakpoint);
- console.assert(probeSet !== this._probeSet);
-
- this._probeSet = probeSet;
- probeSet.addEventListener(WebInspector.ProbeSet.Event.SamplesCleared, this._samplesCleared, this);
- probeSet.dataTable.addEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
- },
-
- _removeProbeSet: function(probeSet)
- {
- console.assert(probeSet instanceof WebInspector.ProbeSet);
- console.assert(probeSet === this._probeSet);
-
- probeSet.removeEventListener(WebInspector.ProbeSet.Event.SamplesCleared, this._samplesCleared, this);
- probeSet.dataTable.removeEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
- delete this._probeSet;
- },
-
- _probeSetAdded: function(event)
- {
- var probeSet = event.data.probeSet;
- if (probeSet.breakpoint === this._breakpoint)
- this._addProbeSet(probeSet);
- },
-
- _probeSetRemoved: function(event)
- {
- var probeSet = event.data.probeSet;
- if (probeSet.breakpoint === this._breakpoint)
- this._removeProbeSet(probeSet);
- },
-
- _samplesCleared: function(event)
- {
- console.assert(this._probeSet);
-
- var oldTable = event.data.oldTable;
- oldTable.removeEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
- this._probeSet.dataTable.addEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
- },
-
- _dataUpdated: function()
- {
- if (this.element.classList.contains(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName)) {
- clearTimeout(this._removeIconAnimationTimeoutIdentifier);
- this.element.classList.remove(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
- // We want to restart the animation, which can only be done by removing the class,
- // performing layout, and re-adding the class. Try adding class back on next run loop.
- window.requestAnimationFrame(this._dataUpdated.bind(this));
- return;
- }
-
- this.element.classList.add(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
- this._removeIconAnimationTimeoutIdentifier = setTimeout(function() {
- this.element.classList.remove(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
- }.bind(this), WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration);
- },
-
-
- _breakpointLocationDidChange: function(event)
- {
- console.assert(event.target === this._breakpoint);
-
- // The Breakpoint has a new display SourceCode. The sidebar will remove us, and ondetach() will clear listeners.
- if (event.data.oldDisplaySourceCode === this._breakpoint.displaySourceCode)
- return;
-
- this._updateTitles();
- },
-
- _statusImageElementMouseDown: function(event)
- {
- // To prevent the tree element from selecting.
- event.stopPropagation();
- },
-
- _statusImageElementClicked: function(event)
- {
- this._breakpoint.cycleToNextMode();
- }
-};
-
-WebInspector.BreakpointTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,72 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.navigation-bar .item.button {
- width: 26px;
-}
-
-.navigation-bar .item.button.text-only {
- width: auto;
- padding: 0 10px;
-
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
- font-family: "Lucida Grande", sans-serif;
- font-size: 11px;
- line-height: 20px;
-
- -webkit-justify-content: center;
-}
-
-.navigation-bar .item.button > .glyph {
- width: 100%;
- height: 100%;
-
- background-repeat: no-repeat;
- background-position: center center;
-}
-
-body.window-inactive .navigation-bar .item.button:not(.suppress-emboss) > .glyph {
- opacity: 0.65;
-}
-
-.navigation-bar .item.button.disabled > .glyph {
- opacity: 0.55 !important;
-}
-
-body.window-inactive .navigation-bar .item.button.disabled:not(.suppress-emboss) > .glyph {
- opacity: 0.35 !important;
-}
-
-.navigation-bar .item.button.suppress-emboss > .glyph {
- opacity: 0.7;
-}
-
-.navigation-bar .item.button.suppress-emboss:active > .glyph {
- opacity: 1;
-}
-
-.navigation-bar .item.button.suppress-emboss.disabled > .glyph {
- opacity: 0.3 !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ButtonNavigationItem = function(identifier, toolTipOrLabel, image, imageWidth, imageHeight, suppressEmboss, role, label) {
- WebInspector.NavigationItem.call(this, identifier);
-
- console.assert(identifier);
- console.assert(toolTipOrLabel);
-
- this.toolTip = toolTipOrLabel;
-
- this._element.addEventListener("click", this._mouseClicked.bind(this));
-
- this._element.setAttribute("role", role || "button");
-
- if (label)
- this._element.setAttribute("aria-label", label);
-
- this._imageWidth = imageWidth || 16;
- this._imageHeight = imageHeight || 16;
- this._suppressEmboss = suppressEmboss || false;
-
- if (suppressEmboss)
- this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName);
-
- if (image)
- this.image = image;
- else
- this.label = toolTipOrLabel;
-};
-
-WebInspector.ButtonNavigationItem.StyleClassName = "button";
-WebInspector.ButtonNavigationItem.DisabledStyleClassName = "disabled";
-WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName = "suppress-bezel";
-WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName = "suppress-emboss";
-WebInspector.ButtonNavigationItem.TextOnlyClassName = "text-only";
-
-WebInspector.ButtonNavigationItem.States = {};
-WebInspector.ButtonNavigationItem.States.Normal = "normal";
-WebInspector.ButtonNavigationItem.States.Active = "active";
-WebInspector.ButtonNavigationItem.States.Focus = "focus";
-WebInspector.ButtonNavigationItem.States.ActiveFocus = "active-focus";
-
-WebInspector.ButtonNavigationItem.Event = {
- Clicked: "button-navigation-item-clicked"
-};
-
-WebInspector.ButtonNavigationItem.prototype = {
- constructor: WebInspector.ButtonNavigationItem,
-
- // Public
-
- get toolTip()
- {
- return this._element.title;
- },
-
- set toolTip(newToolTip)
- {
- console.assert(newToolTip);
- if (!newToolTip)
- return;
-
- this._element.title = newToolTip;
- },
-
- get label()
- {
- return this._element.textContent;
- },
-
- set label(newLabel)
- {
- this._element.classList.add(WebInspector.ButtonNavigationItem.TextOnlyClassName);
- this._element.textContent = newLabel || "";
- if (this.parentNavigationBar)
- this.parentNavigationBar.updateLayout();
- },
-
- get image()
- {
- return this._image;
- },
-
- set image(newImage)
- {
- if (!newImage) {
- this._element.removeChildren();
- return;
- }
-
- this._element.removeChildren();
- this._element.classList.remove(WebInspector.ButtonNavigationItem.TextOnlyClassName);
-
- this._image = newImage;
-
- this._glyphElement = document.createElement("div");
- this._glyphElement.className = "glyph";
- this._element.appendChild(this._glyphElement);
-
- this._updateImage();
- },
-
- get enabled()
- {
- return !this._element.classList.contains(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
- },
-
- set enabled(flag)
- {
- if (flag)
- this._element.classList.remove(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
- else
- this._element.classList.add(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
- },
-
- get suppressBezel()
- {
- return this._element.classList.contains(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
- },
-
- set suppressBezel(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
- else
- this._element.classList.remove(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
- },
-
- generateStyleText: function(parentSelector)
- {
- var classNames = this._classNames.join(".");
-
- if (this._suppressEmboss)
- var styleText = parentSelector + " ." + classNames + " > .glyph { background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
- else {
- // Default state.
- var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier() + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
-
- // Pressed state.
- styleText += parentSelector + " ." + classNames + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Active) + "); }\n";
-
- // Focused state.
- styleText += parentSelector + " ." + classNames + ":not(.disabled):focus > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
- }
-
- return styleText;
- },
-
- // Private
-
- _additionalClassNames: [WebInspector.ButtonNavigationItem.StyleClassName],
- _embossedImageStates: WebInspector.ButtonNavigationItem.States,
- _imageCacheable: true,
-
- _mouseClicked: function(event)
- {
- if (!this.enabled)
- return;
- this.dispatchEventToListeners(WebInspector.ButtonNavigationItem.Event.Clicked);
- },
-
- _canvasIdentifier: function(state)
- {
- console.assert(!this._suppressEmboss);
- return "navigation-item-" + this._identifier + "-" + (state || WebInspector.ButtonNavigationItem.States.Normal);
- },
-
- _updateImage: function()
- {
- if (this._suppressEmboss)
- this._glyphElement.style.backgroundImage = "url(" + this._image + ")";
- else
- this._generateImages();
- },
-
- _generateImages: function()
- {
- console.assert(!this._suppressEmboss);
- if (this._suppressEmboss)
- return;
- generateEmbossedImages(this.image, this._imageWidth, this._imageHeight, this._embossedImageStates, this._canvasIdentifier.bind(this), !this._imageCacheable);
- }
-};
-
-WebInspector.ButtonNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.toolbar .item.button {
- -webkit-align-items: center;
- -webkit-justify-content: center;
-
- padding: 0 6px;
-}
-
-.toolbar.icon-and-label-vertical .item.button {
- -webkit-flex-direction: column;
-}
-
-.toolbar.icon-and-label-horizontal .item.button {
- -webkit-flex-direction: row;
-}
-
-.toolbar .item.button > .glyph {
- width: 32px;
- height: 32px;
-
- background-size: 100% 100% !important;
-
- background-repeat: no-repeat;
- background-position: center center;
-}
-
-.toolbar.small-size .item.button > .glyph {
- width: 24px;
- height: 24px;
-}
-
-.toolbar.label-only .item.button > .glyph {
- display: none;
-}
-
-.toolbar .item.button > .label {
- font-size: 11px;
- font-family: Lucida Grande, sans-serif;
- text-align: center;
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
- color: rgb(60, 60, 60);
-}
-
-.toolbar.label-only .item.activate.button.activated > .label {
- color: rgb(35, 125, 195);
-}
-
-.toolbar.icon-and-label-horizontal .item.button > .label {
- margin-left: 4px;
-}
-
-.toolbar.icon-only .item.button > .label {
- display: none;
-}
-
-body.window-inactive .toolbar .item.button {
- opacity: 0.65;
-}
-
-.toolbar .item.button.disabled {
- opacity: 0.55 !important;
-}
-
-body.window-inactive .toolbar .item.button.disabled {
- opacity: 0.35 !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ButtonToolbarItem = function(identifier, toolTip, label, image, suppressEmboss, role)
-{
- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, 32, 32, suppressEmboss, role);
-
- console.assert(label);
-
- this._labelElement = document.createElement("div");
- this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
-
- this.label = label;
-};
-
-WebInspector.ButtonToolbarItem.LabelStyleClassName = "label";
-
-WebInspector.ButtonToolbarItem.prototype = {
- constructor: WebInspector.ButtonToolbarItem,
-
- // Public
-
- get label()
- {
- return this._labelElement.textContent;
- },
-
- set label(newLabel)
- {
- console.assert(newLabel);
- if (!newLabel)
- return;
-
- this._labelElement.textContent = newLabel;
- }
-};
-
-WebInspector.ButtonToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSCompletionsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSCompletions.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSCompletions.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSCompletions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,272 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
- * Copyright (C) 2010 Joseph Pecoraro. All rights reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @constructor
- */
-WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix)
-{
- this._values = [];
- this._longhands = {};
- this._shorthands = {};
-
- for (var i = 0; i < properties.length; ++i) {
- // COMPATIBILITY (iOS 6): This used to be an array of strings,
- // now it contains objects with a 'name' property. Support both here.
- var property = properties[i];
- if (typeof property === "string") {
- this._values.push(property);
- continue;
- }
-
- var propertyName = property.name;
- this._values.push(propertyName);
-
- var longhands = property.longhands;
- if (longhands) {
- this._longhands[propertyName] = longhands;
-
- for (var j = 0; j < longhands.length; ++j) {
- var longhandName = longhands[j];
-
- var shorthands = this._shorthands[longhandName];
- if (!shorthands) {
- shorthands = [];
- this._shorthands[longhandName] = shorthands;
- }
-
- shorthands.push(propertyName);
- }
- }
- }
-
- this._values.sort();
-
- this._acceptEmptyPrefix = acceptEmptyPrefix;
-}
-
-
-/**
- * @type {WebInspector.CSSCompletions}
- */
-WebInspector.CSSCompletions.cssNameCompletions = null;
-
-WebInspector.CSSCompletions.requestCSSNameCompletions = function()
-{
- function propertyNamesCallback(error, names)
- {
- if (error)
- return;
-
- WebInspector.CSSCompletions.cssNameCompletions = new WebInspector.CSSCompletions(names, false);
-
- var propertyNamesForCodeMirror = {};
- var valueKeywordsForCodeMirror = {"inherit": true, "initial": true};
- var colorKeywordsForCodeMirror = {};
-
- function nameForCodeMirror(name)
- {
- // CodeMirror parses the vendor prefix separate from the property or keyword name,
- // so we need to strip vendor prefixes from our names. Also strip function parenthesis.
- return name.replace(/^-[^-]+-/, "").replace(/\(\)$/, "");
- }
-
- function collectPropertyNameForCodeMirror(propertyName)
- {
- // Properties can also be value keywords, like when used in a transition.
- // So we add them to both lists.
- var codeMirrorPropertyName = nameForCodeMirror(propertyName);
- propertyNamesForCodeMirror[codeMirrorPropertyName] = true;
- valueKeywordsForCodeMirror[codeMirrorPropertyName] = true;
- }
-
- for (var i = 0; i < names.length; ++i) {
- // COMPATIBILITY (iOS 6): This used to be an array of strings,
- // now it contains objects with a 'name' property. Support both here.
- var property = names[i];
- if (typeof property === "string")
- collectPropertyNameForCodeMirror(property);
- else
- collectPropertyNameForCodeMirror(property.name);
- }
-
- for (var propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap) {
- var keywords = WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName];
- for (var i = 0; i < keywords.length; ++i) {
- // Skip numbers, like the ones defined for font-weight.
- if (!isNaN(Number(keywords[i])))
- continue;
- valueKeywordsForCodeMirror[nameForCodeMirror(keywords[i])] = true;
- }
- }
-
- WebInspector.CSSKeywordCompletions._colors.forEach(function(colorName) {
- colorKeywordsForCodeMirror[nameForCodeMirror(colorName)] = true;
- });
-
- function updateCodeMirrorCSSMode(mimeType)
- {
- var modeSpec = CodeMirror.resolveMode(mimeType);
-
- console.assert(modeSpec.propertyKeywords);
- console.assert(modeSpec.valueKeywords);
- console.assert(modeSpec.colorKeywords);
-
- modeSpec.propertyKeywords = propertyNamesForCodeMirror;
- modeSpec.valueKeywords = valueKeywordsForCodeMirror;
- modeSpec.colorKeywords = colorKeywordsForCodeMirror;
-
- CodeMirror.defineMIME(mimeType, modeSpec);
- }
-
- updateCodeMirrorCSSMode("text/css");
- updateCodeMirrorCSSMode("text/x-scss");
- }
-
- if (window.CSSAgent)
- CSSAgent.getSupportedCSSProperties(propertyNamesCallback);
-}
-
-WebInspector.CSSCompletions.prototype = {
- get values()
- {
- return this._values;
- },
-
- startsWith: function(prefix)
- {
- var firstIndex = this._firstIndexOfPrefix(prefix);
- if (firstIndex === -1)
- return [];
-
- var results = [];
- while (firstIndex < this._values.length && this._values[firstIndex].startsWith(prefix))
- results.push(this._values[firstIndex++]);
- return results;
- },
-
- firstStartsWith: function(prefix)
- {
- var foundIndex = this._firstIndexOfPrefix(prefix);
- return (foundIndex === -1 ? "" : this._values[foundIndex]);
- },
-
- _firstIndexOfPrefix: function(prefix)
- {
- if (!this._values.length)
- return -1;
- if (!prefix)
- return this._acceptEmptyPrefix ? 0 : -1;
-
- var maxIndex = this._values.length - 1;
- var minIndex = 0;
- var foundIndex;
-
- do {
- var middleIndex = (maxIndex + minIndex) >> 1;
- if (this._values[middleIndex].startsWith(prefix)) {
- foundIndex = middleIndex;
- break;
- }
- if (this._values[middleIndex] < prefix)
- minIndex = middleIndex + 1;
- else
- maxIndex = middleIndex - 1;
- } while (minIndex <= maxIndex);
-
- if (foundIndex === undefined)
- return -1;
-
- while (foundIndex && this._values[foundIndex - 1].startsWith(prefix))
- foundIndex--;
-
- return foundIndex;
- },
-
- keySet: function()
- {
- if (!this._keySet)
- this._keySet = this._values.keySet();
- return this._keySet;
- },
-
- next: function(str, prefix)
- {
- return this._closest(str, prefix, 1);
- },
-
- previous: function(str, prefix)
- {
- return this._closest(str, prefix, -1);
- },
-
- _closest: function(str, prefix, shift)
- {
- if (!str)
- return "";
-
- var index = this._values.indexOf(str);
- if (index === -1)
- return "";
-
- if (!prefix) {
- index = (index + this._values.length + shift) % this._values.length;
- return this._values[index];
- }
-
- var propertiesWithPrefix = this.startsWith(prefix);
- var j = propertiesWithPrefix.indexOf(str);
- j = (j + propertiesWithPrefix.length + shift) % propertiesWithPrefix.length;
- return propertiesWithPrefix[j];
- },
-
- isShorthandPropertyName: function(shorthand)
- {
- return shorthand in this._longhands;
- },
-
- isLonghandPropertyName: function(longhand)
- {
- return longhand in this._shorthands;
- },
-
- longhandsForShorthand: function(shorthand)
- {
- return this._longhands[shorthand] || [];
- },
-
- shorthandsForLonghand: function(longhand)
- {
- return this._shorthands[longhand] || [];
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSKeywordCompletionsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSKeywordCompletions.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSKeywordCompletions.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSKeywordCompletions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,899 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.CSSKeywordCompletions = {};
-
-WebInspector.CSSKeywordCompletions.forProperty = function(propertyName)
-{
- var acceptedKeywords = ["initial"];
- var isNotPrefixed = propertyName.charAt(0) !== "-";
-
- if (propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
- acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName]);
- else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
- acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap["-webkit-" + propertyName]);
-
- if (propertyName in WebInspector.CSSKeywordCompletions._colorAwareProperties)
- acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
- else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions._colorAwareProperties)
- acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
-
- // Only suggest "inherit" on inheritable properties even though it is valid on all properties.
- if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)
- acceptedKeywords.push("inherit");
- else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions.InheritedProperties)
- acceptedKeywords.push("inherit");
-
- if (acceptedKeywords.contains(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder)) {
- acceptedKeywords.remove(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder);
- acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSCompletions.cssNameCompletions.values);
- }
-
- return new WebInspector.CSSCompletions(acceptedKeywords, true);
-}
-
-WebInspector.CSSKeywordCompletions.isColorAwareProperty = function(propertyName)
-{
- return WebInspector.CSSKeywordCompletions._colorAwareProperties[propertyName] === true;
-}
-
-WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder = "__all-properties__";
-
-WebInspector.CSSKeywordCompletions.InheritedProperties = [
- "azimuth", "border-collapse", "border-spacing", "caption-side", "clip-rule", "color", "color-interpolation",
- "color-interpolation-filters", "color-rendering", "cursor", "direction", "elevation", "empty-cells", "fill",
- "fill-opacity", "fill-rule", "font", "font-family", "font-size", "font-style", "font-variant", "font-weight",
- "glyph-orientation-horizontal", "glyph-orientation-vertical", "image-rendering", "kerning", "letter-spacing",
- "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "marker", "marker-end",
- "marker-mid", "marker-start", "orphans", "pitch", "pitch-range", "pointer-events", "quotes", "resize", "richness",
- "shape-rendering", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "stroke",
- "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity",
- "stroke-width", "tab-size", "text-align", "text-anchor", "text-decoration", "text-indent", "text-rendering",
- "text-shadow", "text-transform", "visibility", "voice-family", "volume", "white-space", "widows", "word-break",
- "word-spacing", "word-wrap", "writing-mode", "-webkit-aspect-ratio", "-webkit-border-horizontal-spacing",
- "-webkit-border-vertical-spacing", "-webkit-box-direction", "-webkit-color-correction", "-webkit-font-feature-settings",
- "-webkit-font-kerning", "-webkit-font-smoothing", "-webkit-font-variant-ligatures",
- "-webkit-hyphenate-character", "-webkit-hyphenate-limit-after", "-webkit-hyphenate-limit-before",
- "-webkit-hyphenate-limit-lines", "-webkit-hyphens", "-webkit-line-align", "-webkit-line-box-contain",
- "-webkit-line-break", "-webkit-line-grid", "-webkit-line-snap", "-webkit-locale", "-webkit-nbsp-mode",
- "-webkit-print-color-adjust", "-webkit-rtl-ordering", "-webkit-text-combine", "-webkit-text-decorations-in-effect",
- "-webkit-text-emphasis", "-webkit-text-emphasis-color", "-webkit-text-emphasis-position", "-webkit-text-emphasis-style",
- "-webkit-text-fill-color", "-webkit-text-orientation", "-webkit-text-security", "-webkit-text-size-adjust",
- "-webkit-text-stroke", "-webkit-text-stroke-color", "-webkit-text-stroke-width", "-webkit-user-modify",
- "-webkit-user-select", "-webkit-writing-mode", "-webkit-cursor-visibility", "image-orientation", "image-resolution",
- "overflow-wrap", "-webkit-text-align-last", "-webkit-text-justify", "-webkit-ruby-position", "-webkit-text-decoration-line",
-
- // iOS Properties
- "-webkit-overflow-scrolling", "-webkit-touch-callout", "-webkit-tap-highlight-color"
-].keySet();
-
-WebInspector.CSSKeywordCompletions._colors = [
- "aqua", "black", "blue", "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", "orange", "purple", "red",
- "silver", "teal", "white", "yellow", "transparent", "currentcolor", "grey", "aliceblue", "antiquewhite",
- "aquamarine", "azure", "beige", "bisque", "blanchedalmond", "blueviolet", "brown", "burlywood", "cadetblue",
- "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan",
- "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
- "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey",
- "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
- "floralwhite", "forestgreen", "gainsboro", "ghostwhite", "gold", "goldenrod", "greenyellow", "honeydew", "hotpink",
- "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
- "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow",
- "limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
- "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
- "mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen",
- "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown",
- "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue",
- "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistle", "tomato", "turquoise", "violet",
- "wheat", "whitesmoke", "yellowgreen", "rgb()", "rgba()", "hsl()", "hsla()"
-];
-
-WebInspector.CSSKeywordCompletions._colorAwareProperties = [
- "background", "background-color", "background-image", "border", "border-color", "border-top", "border-right", "border-bottom",
- "border-left", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", "box-shadow", "color",
- "fill", "outline", "outline-color", "stroke", "text-line-through", "text-line-through-color", "text-overline", "text-overline-color",
- "text-shadow", "text-underline", "text-underline-color", "-webkit-box-shadow", "-webkit-column-rule", "-webkit-column-rule-color",
- "-webkit-text-emphasis", "-webkit-text-emphasis-color", "-webkit-text-fill-color", "-webkit-text-stroke", "-webkit-text-stroke-color",
- "-webkit-text-decoration-color",
-
- // iOS Properties
- "-webkit-tap-highlight-color"
-].keySet();
-
-WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
- "table-layout": [
- "auto", "fixed"
- ],
- "visibility": [
- "hidden", "visible", "collapse"
- ],
- "background-repeat": [
- "repeat", "repeat-x", "repeat-y", "no-repeat", "space", "round"
- ],
- "background-blend-mode": [
- "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
- ],
- "text-underline": [
- "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
- ],
- "content": [
- "list-item", "close-quote", "no-close-quote", "no-open-quote", "open-quote", "attr()", "counter()", "counters()", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
- ],
- "list-style-image": [
- "none", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
- ],
- "clear": [
- "none", "left", "right", "both"
- ],
- "stroke-linejoin": [
- "round", "miter", "bevel"
- ],
- "baseline-shift": [
- "baseline", "sub", "super"
- ],
- "border-bottom-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "margin-top-collapse": [
- "collapse", "separate", "discard"
- ],
- "-webkit-box-orient": [
- "horizontal", "vertical", "inline-axis", "block-axis"
- ],
- "font-stretch": [
- "normal", "wider", "narrower", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
- "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
- ],
- "-webkit-color-correction": [
- "default", "srgb"
- ],
- "border-left-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-writing-mode": [
- "lr", "rl", "tb", "lr-tb", "rl-tb", "tb-rl", "horizontal-tb", "vertical-rl", "vertical-lr", "horizontal-bt"
- ],
- "text-line-through-mode": [
- "continuous", "skip-white-space"
- ],
- "text-overline-mode": [
- "continuous", "skip-white-space"
- ],
- "text-underline-mode": [
- "continuous", "skip-white-space"
- ],
- "text-line-through-style": [
- "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
- ],
- "text-overline-style": [
- "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
- ],
- "text-underline-style": [
- "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
- ],
- "border-collapse": [
- "collapse", "separate"
- ],
- "border-top-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "outline-color": [
- "invert", "-webkit-focus-ring-color"
- ],
- "outline-style": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double", "auto"
- ],
- "cursor": [
- "none", "copy", "auto", "crosshair", "default", "pointer", "move", "vertical-text", "cell", "context-menu",
- "alias", "progress", "no-drop", "not-allowed", "-webkit-zoom-in", "-webkit-zoom-out", "e-resize", "ne-resize",
- "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "ew-resize", "ns-resize",
- "nesw-resize", "nwse-resize", "col-resize", "row-resize", "text", "wait", "help", "all-scroll", "-webkit-grab",
- "-webkit-grabbing", "url()", "-webkit-image-set()"
- ],
- "border-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "size": [
- "a3", "a4", "a5", "b4", "b5", "landscape", "ledger", "legal", "letter", "portrait"
- ],
- "background-image": [
- "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
- ],
- "background-size": [
- "contain", "cover"
- ],
- "direction": [
- "ltr", "rtl"
- ],
- "enable-background": [
- "accumulate", "new"
- ],
- "float": [
- "none", "left", "right"
- ],
- "overflow-x": [
- "hidden", "auto", "visible", "overlay", "scroll", "marquee"
- ],
- "overflow-y": [
- "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
- ],
- "overflow": [
- "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
- ],
- "margin-bottom-collapse": [
- "collapse", "separate", "discard"
- ],
- "-webkit-box-reflect": [
- "none", "left", "right", "above", "below"
- ],
- "text-rendering": [
- "auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"
- ],
- "text-align": [
- "-webkit-auto", "left", "right", "center", "justify", "-webkit-left", "-webkit-right", "-webkit-center", "-webkit-match-parent", "start", "end"
- ],
- "list-style-position": [
- "outside", "inside"
- ],
- "margin-bottom": [
- "auto"
- ],
- "color-interpolation": [
- "linearrgb"
- ],
- "background-origin": [
- "border-box", "content-box", "padding-box"
- ],
- "word-wrap": [
- "normal", "break-word"
- ],
- "font-weight": [
- "normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"
- ],
- "margin-before-collapse": [
- "collapse", "separate", "discard"
- ],
- "text-overline-width": [
- "normal", "medium", "auto", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "text-transform": [
- "none", "capitalize", "uppercase", "lowercase"
- ],
- "border-right-style": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "border-left-style": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "font-style": [
- "italic", "oblique", "normal"
- ],
- "speak": [
- "none", "normal", "spell-out", "digits", "literal-punctuation", "no-punctuation"
- ],
- "text-line-through": [
- "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave", "continuous",
- "skip-white-space"
- ],
- "color-rendering": [
- "auto", "optimizeSpeed", "optimizeQuality"
- ],
- "list-style-type": [
- "none", "disc", "circle", "square", "decimal", "decimal-leading-zero", "arabic-indic", "binary", "bengali",
- "cambodian", "khmer", "devanagari", "gujarati", "gurmukhi", "kannada", "lower-hexadecimal", "lao", "malayalam",
- "mongolian", "myanmar", "octal", "oriya", "persian", "urdu", "telugu", "tibetan", "thai", "upper-hexadecimal",
- "lower-roman", "upper-roman", "lower-greek", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "afar",
- "ethiopic-halehame-aa-et", "ethiopic-halehame-aa-er", "amharic", "ethiopic-halehame-am-et", "amharic-abegede",
- "ethiopic-abegede-am-et", "cjk-earthly-branch", "cjk-heavenly-stem", "ethiopic", "ethiopic-halehame-gez",
- "ethiopic-abegede", "ethiopic-abegede-gez", "hangul-consonant", "hangul", "lower-norwegian", "oromo",
- "ethiopic-halehame-om-et", "sidama", "ethiopic-halehame-sid-et", "somali", "ethiopic-halehame-so-et", "tigre",
- "ethiopic-halehame-tig", "tigrinya-er", "ethiopic-halehame-ti-er", "tigrinya-er-abegede",
- "ethiopic-abegede-ti-er", "tigrinya-et", "ethiopic-halehame-ti-et", "tigrinya-et-abegede",
- "ethiopic-abegede-ti-et", "upper-greek", "upper-norwegian", "asterisks", "footnotes", "hebrew", "armenian",
- "lower-armenian", "upper-armenian", "georgian", "cjk-ideographic", "hiragana", "katakana", "hiragana-iroha",
- "katakana-iroha"
- ],
- "-webkit-text-combine": [
- "none", "horizontal"
- ],
- "outline": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "font": [
- "caption", "icon", "menu", "message-box", "small-caption", "-webkit-mini-control", "-webkit-small-control",
- "-webkit-control", "status-bar", "italic", "oblique", "small-caps", "normal", "bold", "bolder", "lighter",
- "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium",
- "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller", "larger", "serif", "sans-serif", "cursive",
- "fantasy", "monospace", "-webkit-body", "-webkit-pictograph", "-webkit-system-font", "-apple-system-headline",
- "-apple-system-body", "-apple-system-subheadline", "-apple-system-footnote", "-apple-system-caption1",
- "-apple-system-caption2", "-apple-system-short-headline", "-apple-system-short-body",
- "-apple-system-short-subheadline", "-apple-system-short-footnote", "-apple-system-short-caption1",
- "-apple-system-tall-body"
- ],
- "dominant-baseline": [
- "middle", "auto", "central", "text-before-edge", "text-after-edge", "ideographic", "alphabetic", "hanging",
- "mathematical", "use-script", "no-change", "reset-size"
- ],
- "display": [
- "none", "inline", "block", "list-item", "compact", "inline-block", "table", "inline-table",
- "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group",
- "table-column", "table-cell", "table-caption", "-webkit-box", "-webkit-inline-box", "-wap-marquee",
- "-webkit-flex", "-webkit-inline-flex", "-webkit-grid", "-webkit-inline-grid"
- ],
- "image-rendering": [
- "auto", "optimizeSpeed", "optimizeQuality", "-webkit-crisp-edges", "-webkit-optimize-contrast"
- ],
- "alignment-baseline": [
- "baseline", "middle", "auto", "before-edge", "after-edge", "central", "text-before-edge", "text-after-edge",
- "ideographic", "alphabetic", "hanging", "mathematical"
- ],
- "outline-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "text-line-through-width": [
- "normal", "medium", "auto", "thick", "thin"
- ],
- "box-align": [
- "baseline", "center", "stretch", "start", "end"
- ],
- "box-shadow": [
- "none"
- ],
- "text-shadow": [
- "none"
- ],
- "-webkit-box-shadow": [
- "none"
- ],
- "border-right-width": [
- "medium", "thick", "thin"
- ],
- "border-top-style": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "line-height": [
- "normal"
- ],
- "counter-increment": [
- "none"
- ],
- "counter-reset": [
- "none"
- ],
- "text-overflow": [
- "clip", "ellipsis"
- ],
- "-webkit-box-direction": [
- "normal", "reverse"
- ],
- "margin-after-collapse": [
- "collapse", "separate", "discard"
- ],
- "page-break-after": [
- "left", "right", "auto", "always", "avoid"
- ],
- "page-break-before": [
- "left", "right", "auto", "always", "avoid"
- ],
- "page-break-inside": [
- "auto", "avoid"
- ],
- "-webkit-column-break-after": [
- "left", "right", "auto", "always", "avoid"
- ],
- "-webkit-column-break-before": [
- "left", "right", "auto", "always", "avoid"
- ],
- "-webkit-column-break-inside": [
- "auto", "avoid"
- ],
- "-webkit-hyphens": [
- "none", "auto", "manual"
- ],
- "border-image": [
- "repeat", "stretch", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
- ],
- "border-image-repeat": [
- "repeat", "stretch", "space", "round"
- ],
- "-webkit-mask-box-image-repeat": [
- "repeat", "stretch", "space", "round"
- ],
- "position": [
- "absolute", "fixed", "relative", "static", "-webkit-sticky"
- ],
- "font-family": [
- "serif", "sans-serif", "cursive", "fantasy", "monospace", "-webkit-body", "-webkit-pictograph", "-webkit-system-font"
- ],
- "text-overflow-mode": [
- "clip", "ellipsis"
- ],
- "border-bottom-style": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "unicode-bidi": [
- "normal", "bidi-override", "embed", "-webkit-plaintext", "-webkit-isolate", "-webkit-isolate-override"
- ],
- "clip-rule": [
- "nonzero", "evenodd"
- ],
- "margin-left": [
- "auto"
- ],
- "margin-top": [
- "auto"
- ],
- "zoom": [
- "normal", "document", "reset"
- ],
- "z-index": [
- "auto"
- ],
- "width": [
- "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "height": [
- "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "max-width": [
- "none", "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "min-width": [
- "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "max-height": [
- "none", "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "min-height": [
- "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "-webkit-logical-width": [
- "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "-webkit-logical-height": [
- "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "-webkit-max-logical-width": [
- "none", "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "-webkit-min-logical-width": [
- "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
- ],
- "-webkit-max-logical-height": [
- "none", "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "-webkit-min-logical-height": [
- "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
- ],
- "empty-cells": [
- "hide", "show"
- ],
- "pointer-events": [
- "none", "all", "auto", "visible", "visiblepainted", "visiblefill", "visiblestroke", "painted", "fill", "stroke"
- ],
- "letter-spacing": [
- "normal", "calc()", "-webkit-calc()"
- ],
- "word-spacing": [
- "normal", "calc()", "-webkit-calc()"
- ],
- "background-clip": [
- "border-box", "content-box", "padding-box"
- ],
- "-webkit-font-kerning": [
- "auto", "normal", "none"
- ],
- "-webkit-font-smoothing": [
- "none", "auto", "antialiased", "subpixel-antialiased"
- ],
- "border": [
- "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
- ],
- "font-size": [
- "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller",
- "larger"
- ],
- "font-variant": [
- "small-caps", "normal"
- ],
- "vertical-align": [
- "baseline", "middle", "sub", "super", "text-top", "text-bottom", "top", "bottom", "-webkit-baseline-middle"
- ],
- "white-space": [
- "normal", "nowrap", "pre", "pre-line", "pre-wrap"
- ],
- "word-break": [
- "normal", "break-all", "break-word"
- ],
- "text-underline-width": [
- "normal", "medium", "auto", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "text-indent": [
- "-webkit-each-line", "-webkit-hanging"
- ],
- "-webkit-box-lines": [
- "single", "multiple"
- ],
- "clip": [
- "auto", "rect()"
- ],
- "clip-path": [
- "none", "url()", "rectangle()", "circle()", "ellipse()", "polygon()", "inset-rectangle()"
- ],
- "orphans": [
- "auto"
- ],
- "widows": [
- "auto"
- ],
- "margin": [
- "auto"
- ],
- "page": [
- "auto"
- ],
- "-webkit-marquee-increment": [
- "small", "large", "medium"
- ],
- "-webkit-marquee-direction": [
- "left", "right", "auto", "reverse", "forwards", "backwards", "ahead", "up", "down"
- ],
- "-webkit-marquee-style": [
- "none", "scroll", "slide", "alternate"
- ],
- "-webkit-marquee-repetition": [
- "infinite"
- ],
- "-webkit-marquee-speed": [
- "normal", "slow", "fast"
- ],
- "margin-right": [
- "auto"
- ],
- "marquee-speed": [
- "normal", "slow", "fast"
- ],
- "-webkit-text-emphasis": [
- "circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
- ],
- "-webkit-text-emphasis-style": [
- "circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
- ],
- "-webkit-text-emphasis-position": [
- "over", "under"
- ],
- "-webkit-transform": [
- "none",
- "scale()", "scaleX()", "scaleY()", "scale3d()", "rotate()", "rotateX()", "rotateY()", "rotateZ()", "rotate3d()", "skew()", "skewX()", "skewY()",
- "translate()", "translateX()", "translateY()", "translateZ()", "translate3d()", "matrix()", "matrix3d()", "perspective()"
- ],
- "-webkit-cursor-visibility": [
- "auto", "auto-hide"
- ],
- "text-decoration": [
- "none", "underline", "overline", "line-through", "blink"
- ],
- "-webkit-text-decorations-in-effect": [
- "none", "underline", "overline", "line-through", "blink",
- ],
- "-webkit-text-decoration-line": [
- "none", "underline", "overline", "line-through", "blink",
- ],
- "-webkit-text-decoration-style": [
- "solid", "double", "dotted", "dashed", "wavy"
- ],
- "-webkit-text-underline-position": [
- "auto", "alphabetic", "under"
- ],
- "image-resolution": [
- "from-image", "snap"
- ],
- "-webkit-blend-mode": [
- "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
- ],
- "mix": [
- "auto",
- "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
- "clear", "copy", "destination", "source-over", "destination-over", "source-in", "destination-in", "source-out", "destination-out", "source-atop", "destination-atop", "xor"
- ],
- "geometry": [
- "detached", "attached", "grid()"
- ],
- "overflow-wrap": [
- "normal", "break-word"
- ],
- "transition": [
- "none", "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()", "all", WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder
- ],
- "transition-timing-function": [
- "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()"
- ],
- "transition-property": [
- "all", "none", WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder
- ],
- "-webkit-column-progression": [
- "normal", "reverse"
- ],
- "-webkit-box-decoration-break": [
- "slice", "clone"
- ],
- "-webkit-align-content": [
- "flex-start", "flex-end", "center", "space-between", "space-around", "stretch"
- ],
- "-webkit-align-items": [
- "flex-start", "flex-end", "center", "baseline", "stretch"
- ],
- "-webkit-align-self": [
- "auto", "flex-start", "flex-end", "center", "baseline", "stretch"
- ],
- "-webkit-justify-content": [
- "flex-start", "flex-end", "center", "space-between", "space-around"
- ],
- "-webkit-flex-direction": [
- "row", "row-reverse", "column", "column-reverse"
- ],
- "-webkit-flex-wrap": [
- "nowrap", "wrap", "wrap-reverse"
- ],
- "-webkit-flex-flow": [
- "row", "row-reverse", "column", "column-reverse",
- "nowrap", "wrap", "wrap-reverse"
- ],
- "-webkit-flex": [
- "none"
- ],
- "-webkit-flex-basis": [
- "auto"
- ],
- "-webkit-grid-after": [
- "auto"
- ],
- "-webkit-grid-before": [
- "auto"
- ],
- "-webkit-grid-end": [
- "auto"
- ],
- "-webkit-grid-start": [
- "auto"
- ],
- "-webkit-grid-auto-flow": [
- "none", "rows", "columns"
- ],
- "-webkit-grid-column": [
- "auto"
- ],
- "-webkit-grid-row": [
- "auto"
- ],
- "-webkit-grid-columns": [
- "auto", "-webkit-max-content", "-webkit-min-content"
- ],
- "-webkit-grid-rows": [
- "auto", "-webkit-max-content", "-webkit-min-content"
- ],
- "-webkit-ruby-position": [
- "after", "before"
- ],
- "-webkit-text-align-last": [
- "auto", "start", "end", "left", "right", "center", "justify"
- ],
- "-webkit-text-justify": [
- "auto", "none", "inter-word", "inter-ideograph", "inter-cluster", "distribute", "kashida"
- ],
- "max-zoom": [
- "auto"
- ],
- "min-zoom": [
- "auto"
- ],
- "orientation": [
- "auto", "portait", "landscape"
- ],
- "user-zoom": [
- "zoom", "fixed"
- ],
- "-webkit-app-region": [
- "drag", "no-drag"
- ],
- "-webkit-line-break": [
- "auto", "loose", "normal", "strict", "after-white-space"
- ],
- "-webkit-background-composite": [
- "clear", "copy", "source-over", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "xor", "plus-darker", "plus-lighter"
- ],
- "-webkit-mask-composite": [
- "clear", "copy", "source-over", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "xor", "plus-darker", "plus-lighter"
- ],
- "-webkit-animation-direction": [
- "normal", "alternate", "reverse", "alternate-reverse"
- ],
- "-webkit-animation-fill-mode": [
- "none", "forwards", "backwards", "both"
- ],
- "-webkit-animation-iteration-count": [
- "infinite"
- ],
- "-webkit-animation-play-state": [
- "paused", "running"
- ],
- "-webkit-animation-timing-function": [
- "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()"
- ],
- "-webkit-column-span": [
- "all", "none", "calc()", "-webkit-calc()"
- ],
- "-webkit-region-break-after": [
- "auto", "always", "avoid", "left", "right"
- ],
- "-webkit-region-break-before": [
- "auto", "always", "avoid", "left", "right"
- ],
- "-webkit-region-break-inside": [
- "auto", "avoid"
- ],
- "-webkit-region-overflow": [
- "auto", "break"
- ],
- "-webkit-wrap-flow": [
- "auto", "both", "start", "end", "maximum", "clear"
- ],
- "-webkit-wrap-through": [
- "wrap", "none"
- ],
- "-webkit-backface-visibility": [
- "visible", "hidden"
- ],
- "resize": [
- "none", "both", "horizontal", "vertical", "auto"
- ],
- "caption-side": [
- "top", "bottom", "left", "right"
- ],
- "box-sizing": [
- "border-box", "content-box"
- ],
- "-webkit-border-fit": [
- "border", "lines"
- ],
- "-webkit-line-align": [
- "none", "edges"
- ],
- "-webkit-line-snap": [
- "none", "baseline", "contain"
- ],
- "-webkit-nbsp-mode": [
- "normal", "space"
- ],
- "-webkit-print-color-adjust": [
- "exact", "economy"
- ],
- "-webkit-rtl-ordering": [
- "logical", "visual"
- ],
- "-webkit-text-security": [
- "disc", "circle", "square", "none"
- ],
- "-webkit-transform-style": [
- "flat", "preserve-3d"
- ],
- "-webkit-user-drag": [
- "auto", "none", "element"
- ],
- "-webkit-user-modify": [
- "read-only", "read-write", "read-write-plaintext-only"
- ],
- "-webkit-text-stroke-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-border-start-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-border-end-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-border-before-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-border-after-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-column-rule-width": [
- "medium", "thick", "thin", "calc()", "-webkit-calc()"
- ],
- "-webkit-aspect-ratio": [
- "none"
- ],
- "-webkit-filter": [
- "none", "grayscale()", "sepia()", "saturate()", "hue-rotate()", "invert()", "opacity()", "brightness()", "contrast()", "blur()", "drop-shadow()", "custom()"
- ],
- "-webkit-perspective": [
- "none"
- ],
- "-webkit-column-count": [
- "auto", "calc()", "-webkit-calc()"
- ],
- "-webkit-column-gap": [
- "normal", "calc()", "-webkit-calc()"
- ],
- "-webkit-column-axis": [
- "horizontal", "vertical", "auto"
- ],
- "-webkit-column-width": [
- "auto", "calc()", "-webkit-calc()"
- ],
- "-webkit-hyphenate-character": [
- "none"
- ],
- "-webkit-hyphenate-limit-after": [
- "auto"
- ],
- "-webkit-hyphenate-limit-before": [
- "auto"
- ],
- "-webkit-hyphenate-limit-lines": [
- "no-limit"
- ],
- "-webkit-line-grid": [
- "none"
- ],
- "-webkit-locale": [
- "auto"
- ],
- "-webkit-text-orientation": [
- "sideways", "sideways-right", "vertical-right", "upright"
- ],
- "-webkit-line-box-contain": [
- "block", "inline", "font", "glyphs", "replaced", "inline-box", "none", "initial"
- ],
- "-webkit-font-feature-settings": [
- "normal"
- ],
- "-webkit-font-variant-ligatures": [
- "normal", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures"
- ],
- /*
- "-webkit-appearance": [
- "none", "checkbox", "radio", "push-button", "square-button", "button", "button-bevel", "default-button", "inner-spin-button", "-webkit-input-speech-button", "listbox", "listitem", "media-enter-fullscreen-button", "media-exit-fullscreen-button", "media-fullscreen-volume-slider", "media-fullscreen-volume-slider-thumb", "media-mute-button", "media-play-button", "media-overlay-play-button", "media-seek-back-button", "media-seek-forward-button", "media-rewind-button", "media-return-to-realtime-button", "media-toggle-closed-captions-button", "media-slider", "media-sliderthumb", "media-volume-slider-container", "media-volume-slider", "media-volume-sliderthumb", "media-volume-slider-mute-button", "media-controls-background", "media-controls-fullscreen-background", "media-current-time-display", "media-time-remaining-display", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "meter", "progress-bar", "progress-bar-value", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "caret", "searchfield", "searchfield-decoration", "searchfield-results-decoration", "searchfield-results-button", "searchfield-cancel-button", "snapshotted-plugin-overlay", "textfield", "relevancy-level-indicator", "continuous-capacity-level-indicator", "discrete-capacity-level-indicator", "rating-level-indicator", "textarea"
- ],
- */
-
- // iOS Properties
- "-webkit-text-size-adjust": [
- "none", "auto"
- ],
- "-webkit-touch-callout": [
- "default", "none"
- ],
- "-webkit-overflow-scrolling": [
- "auto", "touch"
- ]
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSMediajs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSMedia.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSMedia.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSMedia.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSMedia = function(type, text, sourceCodeLocation)
-{
- WebInspector.Object.call(this);
-
- this._type = type || null;
- this._text = text || "";
- this._sourceCodeLocation = sourceCodeLocation || null;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSMedia);
-
-WebInspector.CSSMedia.Type = {
- MediaRule: "css-media-type-media-rule",
- ImportRule: "css-media-type-import-rule",
- LinkedStyleSheet: "css-media-type-linked-stylesheet",
- InlineStyleSheet: "css-media-type-inline-stylesheet"
-};
-
-WebInspector.CSSMedia.prototype = {
- constructor: WebInspector.CSSMedia,
-
- // Public
-
- get type()
- {
- return this._type;
- },
-
- get text()
- {
- return this._text;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- }
-};
-
-WebInspector.CSSMedia.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.CSSObserver.prototype = {
- constructor: WebInspector.CSSObserver,
-
- // Events defined by the "CSS" domain.
-
- mediaQueryResultChanged: function()
- {
- WebInspector.cssStyleManager.mediaQueryResultChanged();
- },
-
- styleSheetChanged: function(styleSheetId)
- {
- WebInspector.cssStyleManager.styleSheetChanged(styleSheetId);
- },
-
- styleSheetAdded: function(header)
- {
- // FIXME: Not implemented. <rdar://problem/13213680>
- },
-
- styleSheetRemoved: function(header)
- {
- // FIXME: Not implemented. <rdar://problem/13213680>
- },
-
- namedFlowCreated: function(namedFlow)
- {
- WebInspector.domTreeManager.namedFlowCreated(namedFlow);
- },
-
- namedFlowRemoved: function(documentNodeId, flowName)
- {
- WebInspector.domTreeManager.namedFlowRemoved(documentNodeId, flowName);
- },
-
- regionLayoutUpdated: function(namedFlow)
- {
- WebInspector.domTreeManager.regionLayoutUpdated(namedFlow);
- },
-
- regionOversetChanged: function(namedFlow)
- {
- WebInspector.domTreeManager.regionOversetChanged(namedFlow);
- },
-
- registeredNamedFlowContentElement: function(documentNodeId, flowName, contentNodeId, nextContentElementNodeId)
- {
- WebInspector.domTreeManager.registeredNamedFlowContentElement(documentNodeId, flowName, contentNodeId, nextContentElementNodeId);
- },
-
- unregisteredNamedFlowContentElement: function(documentNodeId, flowName, contentNodeId)
- {
- WebInspector.domTreeManager.unregisteredNamedFlowContentElement(documentNodeId, flowName, contentNodeId);
- }
-};
-
-WebInspector.CSSObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSPropertyjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSProperty.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSProperty.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSProperty.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,454 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSProperty = function(index, text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange)
-{
- WebInspector.Object.call(this);
-
- this._ownerStyle = null;
- this._index = index;
-
- this.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange, true);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSProperty);
-
-WebInspector.CSSProperty.Event = {
- Changed: "css-property-changed",
- OverriddenStatusChanged: "css-property-overridden-status-changed"
-};
-
-WebInspector.CSSProperty.prototype = {
- constructor: WebInspector.CSSProperty,
-
- // Public
-
- get ownerStyle()
- {
- return this._ownerStyle;
- },
-
- set ownerStyle(ownerStyle)
- {
- this._ownerStyle = ownerStyle || null;
- },
-
- get index()
- {
- return this._index;
- },
-
- set index(index)
- {
- this._index = index;
- },
-
- update: function(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange, dontFireEvents)
- {
- text = text || "";
- name = name || "";
- value = value || "";
- priority = priority || "";
- enabled = enabled || false;
- overridden = overridden || false;
- implicit = implicit || false;
- anonymous = anonymous || false;
- valid = valid || false;
-
- var changed = false;
-
- if (!dontFireEvents) {
- changed = this._name !== name || this._value !== value || this._priority !== priority ||
- this._enabled !== enabled || this._implicit !== implicit || this._anonymous !== anonymous || this._valid !== valid;
- }
-
- // Use the setter for overridden if we want to fire events since the
- // OverriddenStatusChanged event coalesces changes before it fires.
- if (!dontFireEvents)
- this.overridden = overridden;
- else
- this._overridden = overridden;
-
- this._text = text;
- this._name = name;
- this._value = value;
- this._priority = priority;
- this._enabled = enabled;
- this._implicit = implicit;
- this._anonymous = anonymous;
- this._inherited = name in WebInspector.CSSKeywordCompletions.InheritedProperties;
- this._valid = valid;
- this._styleSheetTextRange = styleSheetTextRange || null;
-
- if (styleDeclarationTextRange)
- this._styleDeclarationTextRange = styleDeclarationTextRange;
- else
- delete this._styleDeclarationTextRange;
-
- this._relatedShorthandProperty = null;
- this._relatedLonghandProperties = [];
-
- delete this._canonicalName;
- delete this._hasOtherVendorNameOrKeyword;
-
- if (!this._updatePropertySoonTimeout) {
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
- }
-
- if (changed)
- this.dispatchEventToListeners(WebInspector.CSSProperty.Event.Changed);
- },
-
- get synthesizedText()
- {
- var name = this.name;
- if (!name)
- return "";
-
- var priority = this.priority;
- return name + ": " + this.value.trim() + (priority ? " !" + priority : "") + ";";
- },
-
- get text()
- {
- return this._text || this.synthesizedText;
- },
-
- set text(text)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._text === text)
- return;
-
- if (isNaN(this._index)) {
- this._text = text || "";
-
- // Clear the name, value and priority since they might not match the text now.
- this._name = "";
- this._value = "";
- this._priority = "";
-
- // Ditto for the canonical and pending properties.
- delete this._canonicalName;
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
-
- return;
- }
-
- this._cancelPendingUpdate();
- this._ownerStyle.nodeStyles.changePropertyText(this, text);
- },
-
- get name()
- {
- if (isNaN(this._index))
- return this._pendingName || this._name;
- return this._name;
- },
-
- set name(name)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._name === name)
- return;
-
- if (isNaN(this._index)) {
- this._name = name;
- this._text = "";
-
- delete this._canonicalName;
- } else {
- this._pendingName = name;
- this._updatePropertySoon();
- }
- },
-
- get canonicalName()
- {
- if (this._canonicalName)
- return this._canonicalName;
-
- this._canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(this.name);
-
- return this._canonicalName;
- },
-
- get value()
- {
- if (isNaN(this._index))
- return this._pendingValue || this._value;
- return this._value;
- },
-
- set value(value)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._value === value)
- return;
-
- if (isNaN(this._index)) {
- this._value = value;
- this._text = "";
- } else {
- this._pendingValue = value;
- this._updatePropertySoon();
- }
- },
-
- get important()
- {
- return this.priority === "important";
- },
-
- set important(important)
- {
- this.priority = important ? "important" : "";
- },
-
- get priority()
- {
- if (isNaN(this._index))
- return this._pendingPriority || this._priority;
- return this._priority;
- },
-
- set priority(priority)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- if (this._priority === priority)
- return;
-
- if (isNaN(this._index)) {
- this._priority = priority;
- this._text = "";
- } else {
- this._pendingPriority = priority;
- this._updatePropertySoon();
- }
- },
-
- get enabled()
- {
- return this._enabled && this._ownerStyle && (!isNaN(this._index) || this._ownerStyle.type === WebInspector.CSSStyleDeclaration.Type.Computed);
- },
-
- set enabled(enabled)
- {
- if (!this._ownerStyle || !this._ownerStyle.editable)
- return;
-
- this._ownerStyle.nodeStyles.changePropertyEnabledState(this, enabled);
- },
-
- get overridden()
- {
- return this._overridden;
- },
-
- set overridden(overridden)
- {
- overridden = overridden || false;
-
- if (this._overridden === overridden)
- return;
-
- var previousOverridden = this._overridden;
-
- this._overridden = overridden;
-
- if (this._overriddenStatusChangedTimeout)
- return;
-
- function delayed()
- {
- delete this._overriddenStatusChangedTimeout;
-
- if (this._overridden === previousOverridden)
- return;
-
- this.dispatchEventToListeners(WebInspector.CSSProperty.Event.OverriddenStatusChanged);
- }
-
- this._overriddenStatusChangedTimeout = setTimeout(delayed.bind(this), 0);
- },
-
- get implicit()
- {
- return this._implicit;
- },
-
- get anonymous()
- {
- return this._anonymous;
- },
-
- get inherited()
- {
- return this._inherited;
- },
-
- get valid()
- {
- return this._valid;
- },
-
- get styleSheetTextRange()
- {
- return this._styleSheetTextRange;
- },
-
- get styleDeclarationTextRange()
- {
- if ("_styleDeclarationTextRange" in this)
- return this._styleDeclarationTextRange;
-
- if (!this._ownerStyle || !this._styleSheetTextRange)
- return null;
-
- var styleTextRange = this._ownerStyle.styleSheetTextRange;
- if (!styleTextRange)
- return null;
-
- var startLine = this._styleSheetTextRange.startLine - styleTextRange.startLine;
- var endLine = this._styleSheetTextRange.endLine - styleTextRange.startLine;
-
- var startColumn = this._styleSheetTextRange.startColumn;
- if (!startLine)
- startColumn -= styleTextRange.startColumn;
-
- var endColumn = this._styleSheetTextRange.endColumn;
- if (!endLine)
- endColumn -= styleTextRange.startColumn;
-
- this._styleDeclarationTextRange = new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
-
- return this._styleDeclarationTextRange;
- },
-
- get relatedShorthandProperty()
- {
- return this._relatedShorthandProperty;
- },
-
- set relatedShorthandProperty(property)
- {
- this._relatedShorthandProperty = property || null;
- },
-
- get relatedLonghandProperties()
- {
- return this._relatedLonghandProperties;
- },
-
- addRelatedLonghandProperty: function(property)
- {
- this._relatedLonghandProperties.push(property);
- },
-
- clearRelatedLonghandProperties: function(property)
- {
- this._relatedLonghandProperties = [];
- },
-
- hasOtherVendorNameOrKeyword: function()
- {
- if ("_hasOtherVendorNameOrKeyword" in this)
- return this._hasOtherVendorNameOrKeyword;
-
- this._hasOtherVendorNameOrKeyword = WebInspector.cssStyleManager.propertyNameHasOtherVendorPrefix(this.name) || WebInspector.cssStyleManager.propertyValueHasOtherVendorKeyword(this.value);
-
- return this._hasOtherVendorNameOrKeyword;
- },
-
- add: function()
- {
- // We can only add if the index is NaN. Return early otherwise.
- if (!this._ownerStyle || !this._ownerStyle.editable || !isNaN(this._index))
- return;
-
- this._cancelPendingUpdate();
- this._ownerStyle.addProperty(this);
- },
-
- remove: function()
- {
- // We can only remove if the index is not NaN. Return early otherwise.
- if (!this._ownerStyle || !this._ownerStyle.editable || isNaN(this._index))
- return;
-
- this._cancelPendingUpdate();
- this._ownerStyle.removeProperty(this);
- },
-
- // Private
-
- _updatePropertySoon: function()
- {
- if (!this._ownerStyle || isNaN(this._index) || this._updatePropertySoonTimeout)
- return;
-
- function performUpdate()
- {
- delete this._updatePropertySoonTimeout;
-
- if (!this._ownerStyle || isNaN(this._index))
- return;
-
- var name = "_pendingName" in this ? this._pendingName : this._name;
- var value = "_pendingValue" in this ? this._pendingValue : this._value;
- var priority = "_pendingPriority" in this ? this._pendingPriority : this._priority;
-
- delete this._pendingName;
- delete this._pendingValue;
- delete this._pendingPriority;
-
- this._ownerStyle.nodeStyles.changeProperty(this, name, value, priority);
- }
-
- this._updatePropertySoonTimeout = setTimeout(performUpdate.bind(this), 0);
- },
-
- _cancelPendingUpdate: function()
- {
- if (!this._updatePropertySoonTimeout)
- return;
- clearTimeout(this._updatePropertySoonTimeout);
- delete this._updatePropertySoonTimeout;
- }
-};
-
-WebInspector.CSSProperty.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSRulejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSRule.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSRule.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSRule.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,204 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSRule = function(nodeStyles, ownerStyleSheet, id, type, sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList)
-{
- WebInspector.Object.call(this);
-
- console.assert(nodeStyles);
- this._nodeStyles = nodeStyles;
-
- this._ownerStyleSheet = ownerStyleSheet || null;
- this._id = id || null;
- this._type = type || null;
-
- this.update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, true);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSRule);
-
-WebInspector.CSSRule.Event = {
- Changed: "css-rule-changed"
-};
-
-WebInspector.CSSRule.Type = {
- Author: "css-rule-type-author",
- User: "css-rule-type-user",
- UserAgent: "css-rule-type-user-agent",
- Inspector: "css-rule-type-inspector"
-};
-
-WebInspector.CSSRule.prototype = {
- constructor: WebInspector.CSSRule,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get ownerStyleSheet()
- {
- return this._ownerStyleSheet;
- },
-
- get editable()
- {
- return !!this._id && (this._type === WebInspector.CSSRule.Type.Author || this._type === WebInspector.CSSRule.Type.Inspector);
- },
-
- update: function(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, dontFireEvents)
- {
- sourceCodeLocation = sourceCodeLocation || null;
- selectorText = selectorText || "";
- selectors = selectors || [];
- matchedSelectorIndices = matchedSelectorIndices || [];
- style = style || null;
- mediaList = mediaList || [];
-
- var changed = false;
- if (!dontFireEvents) {
- changed = this._selectorText !== selectorText || !Object.shallowEqual(this._selectors, selectors) ||
- !Object.shallowEqual(this._matchedSelectorIndices, matchedSelectorIndices) || this._style !== style ||
- !!this._sourceCodeLocation !== !!sourceCodeLocation || this._mediaList.length !== mediaList.length;
- // FIXME: Look for differences in the media list arrays.
- }
-
- if (this._style)
- this._style.ownerRule = null;
-
- this._sourceCodeLocation = sourceCodeLocation;
- this._selectorText = selectorText;
- this._selectors = selectors;
- this._matchedSelectorIndices = matchedSelectorIndices;
- this._style = style;
- this._mediaList = mediaList;
-
- delete this._matchedSelectors;
- delete this._matchedSelectorText;
-
- if (this._style)
- this._style.ownerRule = this;
-
- if (changed)
- this.dispatchEventToListeners(WebInspector.CSSRule.Event.Changed);
- },
-
- get type()
- {
- return this._type;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- get selectorText()
- {
- return this._selectorText;
- },
-
- set selectorText(selectorText)
- {
- console.assert(this.editable);
- if (!this.editable)
- return;
-
- if (this._selectorText === selectorText)
- return;
-
- this._nodeStyles.changeRuleSelector(this, selectorText);
- },
-
- get selectors()
- {
- return this._selectors;
- },
-
- set selectors(selectors)
- {
- this.selectorText = (selectors || []).join(", ");
- },
-
- get matchedSelectorIndices()
- {
- return this._matchedSelectorIndices;
- },
-
- get matchedSelectors()
- {
- // COMPATIBILITY (iOS 6): The selectors array is always empty, so just return an empty array.
- if (!this._selectors.length) {
- console.assert(!this._matchedSelectorIndices.length);
- return [];
- }
-
- if (this._matchedSelectors)
- return this._matchedSelectors;
-
- this._matchedSelectors = this._selectors.filter(function(element, index) {
- return this._matchedSelectorIndices.contains(index);
- }, this);
-
- return this._matchedSelectors;
- },
-
- get matchedSelectorText()
- {
- // COMPATIBILITY (iOS 6): The selectors array is always empty, so just return the whole selector.
- if (!this._selectors.length) {
- console.assert(!this._matchedSelectorIndices.length);
- return this._selectorText;
- }
-
- if ("_matchedSelectorText" in this)
- return this._matchedSelectorText;
-
- this._matchedSelectorText = this.matchedSelectors.join(", ");
-
- return this._matchedSelectorText;
- },
-
- get style()
- {
- return this._style;
- },
-
- get mediaList()
- {
- return this._mediaList;
- },
-
- // Protected
-
- get nodeStyles()
- {
- return this._nodeStyles;
- }
-};
-
-WebInspector.CSSRule.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclaration.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclaration.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclaration.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,310 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclaration = function(nodeStyles, ownerStyleSheet, id, type, node, inherited, text, properties, styleSheetTextRange)
-{
- WebInspector.Object.call(this);
-
- console.assert(nodeStyles);
- this._nodeStyles = nodeStyles;
-
- this._ownerRule = null;
-
- this._ownerStyleSheet = ownerStyleSheet || null;
- this._id = id || null;
- this._type = type || null;
- this._node = node || null;
- this._inherited = inherited || false;
-
- this._pendingProperties = [];
- this._propertyNameMap = {};
-
- this.update(text, properties, styleSheetTextRange, true);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleDeclaration);
-
-WebInspector.CSSStyleDeclaration.Event = {
- PropertiesChanged: "css-style-declaration-properties-changed"
-};
-
-WebInspector.CSSStyleDeclaration.Type = {
- Rule: "css-style-declaration-type-rule",
- Inline: "css-style-declaration-type-inline",
- Attribute: "css-style-declaration-type-attribute",
- Computed: "css-style-declaration-type-computed"
-};
-
-WebInspector.CSSStyleDeclaration.prototype = {
- constructor: WebInspector.CSSStyleDeclaration,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get ownerStyleSheet()
- {
- return this._ownerStyleSheet;
- },
-
- get type()
- {
- return this._type;
- },
-
- get inherited()
- {
- return this._inherited;
- },
-
- get node()
- {
- return this._node;
- },
-
- get editable()
- {
- return !!this._id && ((this._type === WebInspector.CSSStyleDeclaration.Type.Rule && this._ownerRule && this._ownerRule.editable) || this._type === WebInspector.CSSStyleDeclaration.Type.Inline);
- },
-
- update: function(text, properties, styleSheetTextRange, dontFireEvents)
- {
- text = text || "";
- properties = properties || [];
-
- var oldProperties = this._properties || [];
- var oldText = this._text;
-
- this._text = text;
- this._properties = properties;
- this._styleSheetTextRange = styleSheetTextRange;
- this._propertyNameMap = {};
-
- delete this._visibleProperties;
-
- var editable = this.editable;
-
- for (var i = 0; i < this._properties.length; ++i) {
- var property = this._properties[i];
- property.ownerStyle = this;
-
- // Store the property in a map if we arn't editable. This
- // allows for quick lookup for computed style. Editable
- // styles don't use the map since they need to account for
- // overridden properties.
- if (!editable)
- this._propertyNameMap[property.name] = property;
- else {
- // Remove from pendingProperties (if it was pending).
- this._pendingProperties.remove(property);
- }
- }
-
- var removedProperties = [];
- for (var i = 0; i < oldProperties.length; ++i) {
- var oldProperty = oldProperties[i];
-
- if (!this._properties.contains(oldProperty)) {
- // Clear the index, since it is no longer valid.
- oldProperty.index = NaN;
-
- removedProperties.push(oldProperty);
-
- // Keep around old properties in pending in case they
- // are needed again during editing.
- if (editable)
- this._pendingProperties.push(oldProperty);
- }
- }
-
- if (dontFireEvents)
- return;
-
- var addedProperties = [];
- for (var i = 0; i < this._properties.length; ++i) {
- if (!oldProperties.contains(this._properties[i]))
- addedProperties.push(this._properties[i]);
- }
-
- // Don't fire the event if there is text and it hasn't changed.
- if (oldText && this._text && oldText === this._text) {
- // We shouldn't have any added or removed properties in this case.
- console.assert(!addedProperties.length && !removedProperties.length);
- if (!addedProperties.length && !removedProperties.length)
- return;
- }
-
- function delayed()
- {
- this.dispatchEventToListeners(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, {addedProperties: addedProperties, removedProperties: removedProperties});
- }
-
- // Delay firing the PropertiesChanged event so DOMNodeStyles has a chance to mark overridden and associated properties.
- setTimeout(delayed.bind(this), 0);
- },
-
- get ownerRule()
- {
- return this._ownerRule;
- },
-
- set ownerRule(rule)
- {
- this._ownerRule = rule || null;
- },
-
- get text()
- {
- return this._text;
- },
-
- set text(text)
- {
- if (this._text === text)
- return;
-
- this._nodeStyles.changeStyleText(this, text);
- },
-
- get properties()
- {
- return this._properties;
- },
-
- get visibleProperties()
- {
- if (this._visibleProperties)
- return this._visibleProperties;
-
- this._visibleProperties = this._properties.filter(function(property) {
- return !!property.styleDeclarationTextRange;
- });
-
- return this._visibleProperties;
- },
-
- get pendingProperties()
- {
- return this._pendingProperties;
- },
-
- get styleSheetTextRange()
- {
- return this._styleSheetTextRange;
- },
-
- propertyForName: function(name, dontCreateIfMissing)
- {
- console.assert(name);
- if (!name)
- return null;
-
- if (!this.editable)
- return this._propertyNameMap[name] || null;
-
- // Editable styles don't use the map since they need to
- // account for overridden properties.
-
- function findMatch(properties)
- {
- for (var i = 0; i < properties.length; ++i) {
- var property = properties[i];
- if (property.canonicalName !== name && property.name !== name)
- continue;
- if (bestMatchProperty && !bestMatchProperty.overridden && property.overridden)
- continue;
- bestMatchProperty = property;
- }
- }
-
- var bestMatchProperty = null;
-
- findMatch(this._properties);
-
- if (bestMatchProperty)
- return bestMatchProperty;
-
- if (dontCreateIfMissing || !this.editable)
- return null;
-
- findMatch(this._pendingProperties, true);
-
- if (bestMatchProperty)
- return bestMatchProperty;
-
- var newProperty = new WebInspector.CSSProperty(NaN, null, name);
- newProperty.ownerStyle = this;
-
- this._pendingProperties.push(newProperty);
-
- return newProperty;
- },
-
- addProperty: function(property)
- {
- console.assert(property);
- if (!property)
- return;
-
- console.assert(property.ownerStyle === this);
- if (property.ownerStyle !== this)
- return;
-
- console.assert(this.editable);
- if (!this.editable)
- return;
-
- this._nodeStyles.addProperty(property);
- },
-
- removeProperty: function(property)
- {
- console.assert(property);
- if (!property)
- return;
-
- console.assert(property.ownerStyle === this);
- if (property.ownerStyle !== this)
- return;
-
- console.assert(this.editable);
- if (!this.editable)
- return;
-
- this._nodeStyles.removeProperty(property);
- },
-
- // Protected
-
- get nodeStyles()
- {
- return this._nodeStyles;
- }
-};
-
-WebInspector.CSSStyleDeclaration.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectioncss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,153 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.style-declaration-section {
- display: -webkit-flex;
- -webkit-flex-direction: column;
-
- padding: 5px;
-
- background-color: white;
-}
-
-.style-declaration-section + .style-declaration-section {
- border-top: 1px solid rgb(210, 210, 210);
-}
-
-.style-declaration-section.last-in-group {
- margin-bottom: 15px;
-
- box-shadow: rgba(0, 0, 0, 0.3) 0 2px 2px 0;
-}
-
-.style-declaration-section.last-in-group + .style-declaration-section {
- margin-top: 15px;
-
- border-top: none;
-
- box-shadow: rgba(0, 0, 0, 0.3) 0 0 2px 0;
-}
-
-.style-declaration-section:first-child,
-div:not(.style-declaration-section) + .style-declaration-section,
-.style-declaration-section.last-in-group + .style-declaration-section.last-in-group,
-.style-declaration-section.last-in-group + .style-declaration-section:last-child {
- box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px 1px;
-}
-
-.style-declaration-section:last-child {
- margin-bottom: 0 !important;
-}
-
-.style-declaration-section > .header {
- position: relative;
-
- padding: 4px 5px 3px 25px;
-
- font-size: 11px;
- line-height: 12px;
-}
-
-.style-declaration-section > .header > .icon {
- position: absolute;
-
- top: 2px;
- left: 4px;
-
- width: 16px;
- height: 16px;
-}
-
-.style-declaration-section > .header > .selector {
- font-family: Menlo, monospace;
- color: rgb(128, 128, 128);
-
- outline: none;
-
- cursor: text;
-
- word-wrap: break-word;
-
- -webkit-user-select: text;
- -webkit-user-modify: read-write-plaintext-only;
-}
-
-.style-declaration-section > .header > .selector:empty {
- /* This prevents the cursor from disappearing when empty. */
- display: inline-block;
- min-width: 1px;
-}
-
-.style-declaration-section > .header > .selector:empty::before {
- /* This prevents the cursor from positioning badly when empty. */
- content: "";
-}
-
-.style-declaration-section > .header > .selector:focus {
- color: black;
-}
-
-.style-declaration-section.locked > .header > .selector,
-.style-declaration-section.selector-locked > .header > .selector {
- -webkit-user-modify: read-only;
-}
-
-.style-declaration-section.locked > .header::before {
- float: right;
-
- content: "";
-
- width: 8px;
- height: 10px;
-
- background-image: -webkit-canvas(style-lock-normal);
- background-repeat: no-repeat;
- background-position: center;
- background-size: 8px 10px;
-
- margin-left: 5px;
-}
-
-.style-declaration-section > .header > .selector > .matched {
- color: black;
-}
-
-.style-declaration-section > .header > .origin {
- line-height: 10px;
- font-family: "Lucida Grande", sans-serif;
-
- color: rgb(128, 128, 128);
-
- word-wrap: break-word;
- white-space: nowrap;
-}
-
-.style-declaration-section > .header > .origin a {
- white-space: normal;
-}
-
-.style-declaration-section > .header > .origin > .go-to-link {
- color: inherit !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,261 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclarationSection = function(style)
-{
- WebInspector.Object.call(this);
-
- console.assert(style);
- this._style = style || null;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.CSSStyleDeclarationSection.StyleClassName;
-
- this._headerElement = document.createElement("div");
- this._headerElement.className = WebInspector.CSSStyleDeclarationSection.HeaderElementStyleClassName;
-
- this._iconElement = document.createElement("img");
- this._iconElement.className = WebInspector.CSSStyleDeclarationSection.IconElementStyleClassName;
- this._headerElement.appendChild(this._iconElement);
-
- this._selectorElement = document.createElement("span");
- this._selectorElement.className = WebInspector.CSSStyleDeclarationSection.SelectorElementStyleClassName;
- this._selectorElement.setAttribute("spellcheck", "false");
- this._headerElement.appendChild(this._selectorElement);
-
- this._originElement = document.createElement("span");
- this._originElement.className = WebInspector.CSSStyleDeclarationSection.OriginElementStyleClassName;
- this._headerElement.appendChild(this._originElement);
-
- this._propertiesElement = document.createElement("div");
- this._propertiesElement.className = WebInspector.CSSStyleDeclarationSection.PropertiesElementStyleClassName;
-
- this._propertiesTextEditor = new WebInspector.CSSStyleDeclarationTextEditor(this, style);
- this._propertiesElement.appendChild(this._propertiesTextEditor.element);
-
- this._element.appendChild(this._headerElement);
- this._element.appendChild(this._propertiesElement);
-
- var iconClassName;
- switch (style.type) {
- case WebInspector.CSSStyleDeclaration.Type.Rule:
- console.assert(style.ownerRule);
-
- if (style.inherited)
- iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName;
- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Author)
- iconClassName = WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName;
- else if (style.ownerRule.type === WebInspector.CSSRule.Type.User)
- iconClassName = WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName;
- else if (style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
- iconClassName = WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName;
- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Inspector)
- iconClassName = WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName;
- break;
-
- case WebInspector.CSSStyleDeclaration.Type.Inline:
- case WebInspector.CSSStyleDeclaration.Type.Attribute:
- if (style.inherited)
- iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName;
- else
- iconClassName = WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
- break;
- }
-
- console.assert(iconClassName);
- this._element.classList.add(iconClassName);
-
- if (!style.editable)
- this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LockedStyleClassName);
- else if (style.ownerRule) {
- this._commitSelectorKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter, this._commitSelector.bind(this), this._selectorElement);
- this._selectorElement.addEventListener("blur", this._commitSelector.bind(this));
- } else
- this._element.classList.add(WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName);
-
- if (!WebInspector.CSSStyleDeclarationSection._generatedLockImages) {
- WebInspector.CSSStyleDeclarationSection._generatedLockImages = true;
-
- var specifications = {"style-lock-normal": {fillColor: [0, 0, 0, 0.5]}};
- generateColoredImagesForCSS("Images/Locked.svg", specifications, 8, 10);
- }
-
- this.refresh();
-};
-
-WebInspector.CSSStyleDeclarationSection.StyleClassName = "style-declaration-section";
-WebInspector.CSSStyleDeclarationSection.LockedStyleClassName = "locked";
-WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName = "selector-locked";
-WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName = "last-in-group";
-WebInspector.CSSStyleDeclarationSection.HeaderElementStyleClassName = "header";
-WebInspector.CSSStyleDeclarationSection.IconElementStyleClassName = "icon";
-WebInspector.CSSStyleDeclarationSection.SelectorElementStyleClassName = "selector";
-WebInspector.CSSStyleDeclarationSection.OriginElementStyleClassName = "origin";
-WebInspector.CSSStyleDeclarationSection.PropertiesElementStyleClassName = "properties";
-WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName = "matched";
-
-WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName = "author-style-rule-icon";
-WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName = "user-style-rule-icon";
-WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName = "user-agent-style-rule-icon";
-WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName = "inspector-style-rule-icon";
-WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName = "inherited-style-rule-icon";
-WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName = "inherited-element-style-rule-icon";
-
-WebInspector.CSSStyleDeclarationSection.prototype = {
- constructor: WebInspector.CSSStyleDeclarationSection,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get style()
- {
- return this._style;
- },
-
- get lastInGroup()
- {
- return this._element.classList.contains(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
- },
-
- set lastInGroup(last)
- {
- if (last)
- this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
- else
- this._element.classList.remove(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
- },
-
- get focused()
- {
- return this._propertiesTextEditor.focused;
- },
-
- focus: function()
- {
- this._propertiesTextEditor.focus();
- },
-
- refresh: function()
- {
- this._selectorElement.removeChildren();
- this._originElement.removeChildren();
-
- this._originElement.appendChild(document.createTextNode(" \u2014 "));
-
- function appendSelector(selectorText, matched)
- {
- var selectorElement = document.createElement("span");
- if (matched)
- selectorElement.className = WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName;
- selectorElement.textContent = selectorText;
- this._selectorElement.appendChild(selectorElement);
- }
-
- switch (this._style.type) {
- case WebInspector.CSSStyleDeclaration.Type.Rule:
- console.assert(this._style.ownerRule);
-
- var selectors = this._style.ownerRule.selectors;
- var matchedSelectorIndices = this._style.ownerRule.matchedSelectorIndices;
- if (selectors.length && matchedSelectorIndices.length) {
- for (var i = 0; i < selectors.length; ++i) {
- appendSelector.call(this, selectors[i], matchedSelectorIndices.contains(i));
- if (i < selectors.length - 1)
- this._selectorElement.appendChild(document.createTextNode(", "));
- }
- } else
- appendSelector.call(this, this._style.ownerRule.selectorText, true);
-
- if (this._style.ownerRule.sourceCodeLocation) {
- var sourceCodeLink = WebInspector.createSourceCodeLocationLink(this._style.ownerRule.sourceCodeLocation, true);
- this._originElement.appendChild(sourceCodeLink);
- } else {
- var originString;
- switch (this._style.ownerRule.type) {
- case WebInspector.CSSRule.Type.Author:
- originString = WebInspector.UIString("Author Stylesheet");
- break;
-
- case WebInspector.CSSRule.Type.User:
- originString = WebInspector.UIString("User Stylesheet");
- break;
-
- case WebInspector.CSSRule.Type.UserAgent:
- originString = WebInspector.UIString("User Agent Stylesheet");
- break;
-
- case WebInspector.CSSRule.Type.Inspector:
- originString = WebInspector.UIString("Web Inspector");
- break;
- }
-
- console.assert(originString);
- if (originString)
- this._originElement.appendChild(document.createTextNode(originString));
- }
-
- break;
-
- case WebInspector.CSSStyleDeclaration.Type.Inline:
- appendSelector.call(this, WebInspector.displayNameForNode(this._style.node), true);
- this._originElement.appendChild(document.createTextNode(WebInspector.UIString("Style Attribute")));
- break;
-
- case WebInspector.CSSStyleDeclaration.Type.Attribute:
- appendSelector.call(this, WebInspector.displayNameForNode(this._style.node), true);
- this._originElement.appendChild(document.createTextNode(WebInspector.UIString("HTML Attributes")));
- break;
- }
- },
-
- updateLayout: function()
- {
- this._propertiesTextEditor.updateLayout();
- },
-
- // Private
-
- _commitSelector: function(mutations)
- {
- console.assert(this._style.ownerRule);
- if (!this._style.ownerRule)
- return;
-
- var newSelectorText = this._selectorElement.textContent.trim();
- if (!newSelectorText) {
- // Revert to the current selector (by doing a refresh) since the new selector is empty.
- this.refresh();
- return;
- }
-
- this._style.ownerRule.selectorText = newSelectorText;
- }
-};
-
-WebInspector.CSSStyleDeclarationSection.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,161 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.css-style-text-editor {
- background-color: white;
- padding: 2px 0;
-}
-
-.css-style-text-editor > .CodeMirror {
- height: auto;
-}
-
-.css-style-text-editor > .CodeMirror-scroll {
- overflow: hidden;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-placeholder {
- font-family: "Lucida Grande", sans-serif;
- color: rgb(128, 128, 128);
- padding: 0 5px 0 39px;
- text-indent: -14px;
-}
-
-.css-style-text-editor > .CodeMirror pre {
- padding: 1px 5px 1px 39px;
- text-indent: -35px;
-}
-
-.css-style-text-editor > .CodeMirror pre * {
- text-indent: 0;
-}
-
-.css-style-text-editor.read-only > .CodeMirror pre {
- /* Compensate for the missing checkboxes so properties line up with editable styles that have checkboxes. */
- text-indent: -14px;
-}
-
-.css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor {
- display: none;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines pre span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.disabled,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.invalid,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.other-vendor,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.not-inherited,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.overridden {
- text-decoration: line-through;
- -webkit-text-stroke-width: 0.000000000000001px; /* A hack to get a different line-through color. */
- -webkit-text-stroke-color: rgba(0, 0, 0, 0.6);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines pre span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.invalid {
- -webkit-text-stroke-color: rgba(255, 0, 0, 0.6);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.implicit,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.not-inherited {
- opacity: 0.5;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.disabled,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.other-vendor,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.not-inherited,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.overridden {
- -webkit-text-stroke-color: rgba(0, 0, 0, 0.3);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.invalid {
- text-decoration: none;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox] {
- width: 10px;
- height: 10px;
- vertical-align: middle;
- margin: 0 8px 0 3px;
- visibility: hidden;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .checkbox-placeholder {
- display: inline-block;
- width: 21px;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox]:not(:checked),
-.css-style-text-editor > .CodeMirror.CodeMirror-focused .CodeMirror-lines input[type=checkbox],
-.css-style-text-editor:hover > .CodeMirror .CodeMirror-lines input[type=checkbox] {
- visibility: visible;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch {
- display: inline-block;
-
- margin-right: 3px;
- vertical-align: -2px;
-
- width: 1em;
- height: 1em;
-
- position: relative;
-
- /* Make a checkered background for transparent colors to show against. */
- background-image: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(204, 204, 204)),
- -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(204, 204, 204));
- background-color: white;
- background-size: calc(50% + 1px);
- background-position: top left, bottom right;
- background-repeat: no-repeat;
-
- cursor: default;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch > span {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- border: 1px solid rgba(64, 64, 64, 0.4);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch:hover > span {
- border: 1px solid rgba(64, 64, 64, 0.8);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch:active > span {
- border: 1px solid rgba(64, 64, 64, 1);
-}
-
-.css-style-text-editor > .CodeMirror .cm-link {
- /* Style url(...) links as if they are strings. */
- color: rgb(196, 26, 22);
- text-decoration: inherit;
- cursor: inherit;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1007 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclarationTextEditor = function(delegate, style, element)
-{
- WebInspector.Object.call(this);
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.StyleClassName);
- this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- this._showsImplicitProperties = true;
- this._alwaysShowPropertyNames = {};
- this._sortProperties = false;
-
- this._prefixWhitespace = "";
- this._suffixWhitespace = "";
- this._linePrefixWhitespace = "";
-
- this._delegate = delegate || null;
-
- this._codeMirror = CodeMirror(this.element, {
- readOnly: true,
- lineWrapping: true,
- mode: "css-rule",
- electricChars: false,
- indentWithTabs: true,
- indentUnit: 4,
- smartIndent: false,
- matchBrackets: true,
- autoCloseBrackets: true
- });
-
- this._codeMirror.on("change", this._contentChanged.bind(this));
- this._codeMirror.on("blur", this._editorBlured.bind(this));
-
- this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
- this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
-
- this._jumpToSymbolTrackingModeEnabled = false;
- this._tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
- this._tokenTrackingController.mouseOverDelayDuration = 0;
- this._tokenTrackingController.mouseOutReleaseDelayDuration = 0;
- this._tokenTrackingController.mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
-
- this.style = style;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleDeclarationTextEditor);
-
-WebInspector.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor";
-WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
-WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName = "color-swatch";
-WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName = "checkbox-placeholder";
-WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName = "editing-line";
-WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay = 250;
-WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay = 2000;
-
-WebInspector.CSSStyleDeclarationTextEditor.prototype = {
- constructor: WebInspector.CSSStyleDeclarationTextEditor,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(delegate)
- {
- this._delegate = delegate || null;
- },
-
- get style()
- {
- return this._style;
- },
-
- set style(style)
- {
- if (this._style === style)
- return;
-
- if (this._style) {
- this._style.removeEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
- if (this._style.ownerRule && this._style.ownerRule.sourceCodeLocation)
- WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
- }
-
- this._style = style || null;
-
- if (this._style) {
- this._style.addEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
- if (this._style.ownerRule && this._style.ownerRule.sourceCodeLocation)
- WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
- }
-
- this._updateJumpToSymbolTrackingMode();
-
- this._resetContent();
- },
-
- get focused()
- {
- return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
- },
-
- get alwaysShowPropertyNames()
- {
- return Object.keys(this._alwaysShowPropertyNames);
- },
-
- set alwaysShowPropertyNames(alwaysShowPropertyNames)
- {
- this._alwaysShowPropertyNames = (alwaysShowPropertyNames || []).keySet();
-
- this._resetContent();
- },
-
- get showsImplicitProperties()
- {
- return this._showsImplicitProperties;
- },
-
- set showsImplicitProperties(showsImplicitProperties)
- {
- if (this._showsImplicitProperties === showsImplicitProperties)
- return;
-
- this._showsImplicitProperties = showsImplicitProperties;
-
- this._resetContent();
- },
-
- get sortProperties()
- {
- return this._sortProperties;
- },
-
- set sortProperties(sortProperties)
- {
- if (this._sortProperties === sortProperties)
- return;
-
- this._sortProperties = sortProperties;
-
- this._resetContent();
- },
-
- focus: function()
- {
- this._codeMirror.focus();
- },
-
- refresh: function()
- {
- this._resetContent();
- },
-
- updateLayout: function(force)
- {
- this._codeMirror.refresh();
- },
-
- // Protected
-
- didDismissPopover: function(popover)
- {
- if (popover === this._colorPickerPopover)
- delete this._colorPickerPopover;
- },
-
- completionControllerCompletionsHidden: function(completionController)
- {
- var styleText = this._style.text;
- var currentText = this._formattedContent();
-
- // If the style text and the current editor text differ then we need to commit.
- // Otherwise we can just update the properties that got skipped because a completion
- // was pending the last time _propertiesChanged was called.
- if (styleText !== currentText)
- this._commitChanges();
- else
- this._propertiesChanged();
- },
-
- // Private
-
- _clearRemoveEditingLineClassesTimeout: function()
- {
- if (!this._removeEditingLineClassesTimeout)
- return;
-
- clearTimeout(this._removeEditingLineClassesTimeout);
- delete this._removeEditingLineClassesTimeout;
- },
-
- _removeEditingLineClasses: function()
- {
- this._clearRemoveEditingLineClassesTimeout();
-
- function removeEditingLineClasses()
- {
- var lineCount = this._codeMirror.lineCount();
- for (var i = 0; i < lineCount; ++i)
- this._codeMirror.removeLineClass(i, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
- }
-
- this._codeMirror.operation(removeEditingLineClasses.bind(this));
- },
-
- _removeEditingLineClassesSoon: function()
- {
- if (this._removeEditingLineClassesTimeout)
- return;
- this._removeEditingLineClassesTimeout = setTimeout(this._removeEditingLineClasses.bind(this), WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay);
- },
-
- _formattedContent: function()
- {
- // Start with the prefix whitespace we stripped.
- var content = this._prefixWhitespace;
-
- // Get each line and add the line prefix whitespace and newlines.
- var lineCount = this._codeMirror.lineCount();
- for (var i = 0; i < lineCount; ++i) {
- var lineContent = this._codeMirror.getLine(i);
- content += this._linePrefixWhitespace + lineContent;
- if (i !== lineCount - 1)
- content += "\n";
- }
-
- // Add the suffix whitespace we stripped.
- content += this._suffixWhitespace;
-
- return content;
- },
-
- _commitChanges: function()
- {
- if (this._commitChangesTimeout) {
- clearTimeout(this._commitChangesTimeout);
- delete this._commitChangesTimeout;
- }
-
- this._style.text = this._formattedContent();
- },
-
- _editorBlured: function(codeMirror)
- {
- // Clicking a suggestion causes the editor to blur. We don't want to reset content in this case.
- if (this._completionController.isHandlingClickEvent())
- return;
-
- // Reset the content on blur since we stop accepting external changes while the the editor is focused.
- // This causes us to pick up any change that was suppressed while the editor was focused.
- this._resetContent();
- },
-
- _contentChanged: function(codeMirror, change)
- {
- // Return early if the style isn't editable. This still can be called when readOnly is set because
- // clicking on a color swatch modifies the text.
- if (!this._style || !this._style.editable || this._ignoreCodeMirrorContentDidChangeEvent)
- return;
-
- this._markLinesWithCheckboxPlaceholder();
-
- this._clearRemoveEditingLineClassesTimeout();
- this._codeMirror.addLineClass(change.from.line, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
-
- // When the change is a completion change, create color swatches now since the changes
- // will not go through _propertiesChanged until completionControllerCompletionsHidden happens.
- // This way any auto completed colors get swatches right away.
- if (this._completionController.isCompletionChange(change))
- this._createColorSwatches(false, change.from.line);
-
- // Use a short delay for user input to coalesce more changes before committing. Other actions like
- // undo, redo and paste are atomic and work better with a zero delay. CodeMirror identifies changes that
- // get coalesced in the undo stack with a "+" prefix on the origin. Use that to set the delay for our coalescing.
- const delay = change.origin && change.origin.charAt(0) === "+" ? WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0;
-
- // Reset the timeout so rapid changes coalesce after a short delay.
- if (this._commitChangesTimeout)
- clearTimeout(this._commitChangesTimeout);
- this._commitChangesTimeout = setTimeout(this._commitChanges.bind(this), delay);
- },
-
- _updateTextMarkers: function(nonatomic)
- {
- function update()
- {
- this._clearTextMarkers(true);
-
- var styleText = this._style.text;
-
- this._iterateOverProperties(true, function(property) {
- var styleTextRange = property.styleDeclarationTextRange;
- console.assert(styleTextRange);
- if (!styleTextRange)
- return;
-
- var from = {line: styleTextRange.startLine, ch: styleTextRange.startColumn};
- var to = {line: styleTextRange.endLine, ch: styleTextRange.endColumn};
-
- // Adjust the line position for the missing prefix line.
- if (this._prefixWhitespace) {
- --from.line;
- --to.line;
- }
-
- // Adjust the column for the stripped line prefix whitespace.
- from.ch -= this._linePrefixWhitespace.length;
- to.ch -= this._linePrefixWhitespace.length;
-
- this._createTextMarkerForPropertyIfNeeded(from, to, property);
- });
-
- if (!this._codeMirror.getOption("readOnly")) {
- // Matches a comment like: /* -webkit-foo: bar; */
- const commentedPropertyRegex = /\/\*\s*[-\w]+\s*:\s*[^;]+;?\s*\*\//g;
-
- // Look for comments that look like properties and add checkboxes in front of them.
- var lineCount = this._codeMirror.lineCount();
- for (var i = 0; i < lineCount; ++i) {
- var lineContent = this._codeMirror.getLine(i);
-
- var match = commentedPropertyRegex.exec(lineContent);
- while (match) {
- var checkboxElement = document.createElement("input");
- checkboxElement.type = "checkbox";
- checkboxElement.checked = false;
- checkboxElement.addEventListener("change", this._propertyCommentCheckboxChanged.bind(this));
-
- var from = {line: i, ch: match.index};
- var to = {line: i, ch: match.index + match[0].length};
-
- var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
- checkboxMarker.__propertyCheckbox = true;
-
- var commentTextMarker = this._codeMirror.markText(from, to);
-
- checkboxElement.__commentTextMarker = commentTextMarker;
-
- match = commentedPropertyRegex.exec(lineContent);
- }
- }
- }
-
- // Look for colors and make swatches.
- this._createColorSwatches(true);
-
- this._markLinesWithCheckboxPlaceholder();
- }
-
- if (nonatomic)
- update.call(this);
- else
- this._codeMirror.operation(update.bind(this));
- },
-
- _createColorSwatches: function(nonatomic, lineNumber)
- {
- function update()
- {
- var range = typeof lineNumber === "number" ? new WebInspector.TextRange(lineNumber, 0, lineNumber + 1, 0) : null;
-
- // Look for color strings and add swatches in front of them.
- this._codeMirror.createColorMarkers(range, function(marker, color, colorString) {
- var swatchElement = document.createElement("span");
- swatchElement.title = WebInspector.UIString("Click to open a colorpicker. Shift-click to change color format.");
- swatchElement.className = WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName;
- swatchElement.addEventListener("click", this._colorSwatchClicked.bind(this));
-
- var swatchInnerElement = document.createElement("span");
- swatchInnerElement.style.backgroundColor = colorString;
- swatchElement.appendChild(swatchInnerElement);
-
- var codeMirrorTextMarker = marker.codeMirrorTextMarker;
- var swatchMarker = this._codeMirror.setUniqueBookmark(codeMirrorTextMarker.find().from, swatchElement);
-
- swatchInnerElement.__colorTextMarker = codeMirrorTextMarker;
- swatchInnerElement.__color = color;
- }.bind(this));
- }
-
- if (nonatomic)
- update.call(this);
- else
- this._codeMirror.operation(update.bind(this));
- },
-
- _updateTextMarkerForPropertyIfNeeded: function(property)
- {
- var textMarker = property.__propertyTextMarker;
- console.assert(textMarker);
- if (!textMarker)
- return;
-
- var range = textMarker.find();
- console.assert(range);
- if (!range)
- return;
-
- this._createTextMarkerForPropertyIfNeeded(range.from, range.to, property);
- },
-
- _createTextMarkerForPropertyIfNeeded: function(from, to, property)
- {
- if (!this._codeMirror.getOption("readOnly")) {
- // Create a new checkbox element and marker.
-
- console.assert(property.enabled);
-
- var checkboxElement = document.createElement("input");
- checkboxElement.type = "checkbox";
- checkboxElement.checked = true;
- checkboxElement.addEventListener("change", this._propertyCheckboxChanged.bind(this));
- checkboxElement.__cssProperty = property;
-
- var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
- checkboxMarker.__propertyCheckbox = true;
- }
-
- var classNames = ["css-style-declaration-property"];
-
- if (property.overridden)
- classNames.push("overridden");
-
- if (property.implicit)
- classNames.push("implicit");
-
- if (this._style.inherited && !property.inherited)
- classNames.push("not-inherited");
-
- if (!property.valid && property.hasOtherVendorNameOrKeyword())
- classNames.push("other-vendor");
- else if (!property.valid)
- classNames.push("invalid");
-
- if (!property.enabled)
- classNames.push("disabled");
-
- var classNamesString = classNames.join(" ");
-
- // If there is already a text marker and it's in the same document, then try to avoid recreating it.
- // FIXME: If there are multiple CSSStyleDeclarationTextEditors for the same style then this will cause
- // both editors to fight and always recreate their text markers. This isn't really common.
- if (property.__propertyTextMarker && property.__propertyTextMarker.doc.cm === this._codeMirror && property.__propertyTextMarker.find()) {
- // If the class name is the same then we don't need to make a new marker.
- if (property.__propertyTextMarker.className === classNamesString)
- return;
-
- property.__propertyTextMarker.clear();
- }
-
- var propertyTextMarker = this._codeMirror.markText(from, to, {className: classNamesString});
-
- propertyTextMarker.__cssProperty = property;
- property.__propertyTextMarker = propertyTextMarker;
-
- property.addEventListener(WebInspector.CSSProperty.Event.OverriddenStatusChanged, this._propertyOverriddenStatusChanged, this);
-
- this._removeCheckboxPlaceholder(from.line);
- },
-
- _clearTextMarkers: function(nonatomic, all)
- {
- function clear()
- {
- var markers = this._codeMirror.getAllMarks();
- for (var i = 0; i < markers.length; ++i) {
- var textMarker = markers[i];
-
- if (!all && textMarker.__checkboxPlaceholder) {
- var position = textMarker.find();
-
- // Only keep checkbox placeholders if they are in the first column.
- if (position && !position.ch)
- continue;
- }
-
- if (textMarker.__cssProperty) {
- textMarker.__cssProperty.removeEventListener(null, null, this);
-
- delete textMarker.__cssProperty.__propertyTextMarker;
- delete textMarker.__cssProperty;
- }
-
- textMarker.clear();
- }
- }
-
- if (nonatomic)
- clear.call(this);
- else
- this._codeMirror.operation(clear.bind(this));
- },
-
- _iterateOverProperties: function(onlyVisibleProperties, callback)
- {
- var properties = onlyVisibleProperties ? this._style.visibleProperties : this._style.properties;
-
- if (!onlyVisibleProperties) {
- // Filter based on options only when all properties are used.
- properties = properties.filter((function(property) {
- return !property.implicit || this._showsImplicitProperties || property.canonicalName in this._alwaysShowPropertyNames;
- }).bind(this));
-
- if (this._sortProperties)
- properties.sort(function(a, b) { return a.name.localeCompare(b.name) });
- }
-
- for (var i = 0; i < properties.length; ++i) {
- if (callback.call(this, properties[i], i === properties.length - 1))
- break;
- }
- },
-
- _propertyCheckboxChanged: function(event)
- {
- var property = event.target.__cssProperty;
- console.assert(property);
- if (!property)
- return;
-
- var textMarker = property.__propertyTextMarker;
- console.assert(textMarker);
- if (!textMarker)
- return;
-
- // Check if the property has been removed already, like from double-clicking
- // the checkbox and calling this event listener multiple times.
- var range = textMarker.find();
- if (!range)
- return;
-
- var text = this._codeMirror.getRange(range.from, range.to);
-
- function update()
- {
- // Replace the text with a commented version.
- this._codeMirror.replaceRange("/* " + text + " */", range.from, range.to);
-
- // Update the line for any color swatches that got removed.
- this._createColorSwatches(true, range.from.line);
- }
-
- this._codeMirror.operation(update.bind(this));
- },
-
- _propertyCommentCheckboxChanged: function(event)
- {
- var commentTextMarker = event.target.__commentTextMarker;
- console.assert(commentTextMarker);
- if (!commentTextMarker)
- return;
-
- // Check if the comment has been removed already, like from double-clicking
- // the checkbox and calling event listener multiple times.
- var range = commentTextMarker.find();
- if (!range)
- return;
-
- var text = this._codeMirror.getRange(range.from, range.to);
-
- // Remove the comment prefix and suffix.
- text = text.replace(/^\/\*\s*/, "").replace(/\s*\*\/$/, "");
-
- // Add a semicolon if there isn't one already.
- if (text.length && text.charAt(text.length - 1) !== ";")
- text += ";";
-
- function update()
- {
- this._codeMirror.addLineClass(range.from.line, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
- this._codeMirror.replaceRange(text, range.from, range.to);
-
- // Update the line for any color swatches that got removed.
- this._createColorSwatches(true, range.from.line);
- }
-
- this._codeMirror.operation(update.bind(this));
- },
-
- _colorSwatchClicked: function(event)
- {
- if (this._colorPickerPopover)
- return;
-
- var swatch = event.target;
-
- var color = swatch.__color;
- console.assert(color);
- if (!color)
- return;
-
- var colorTextMarker = swatch.__colorTextMarker;
- console.assert(colorTextMarker);
- if (!colorTextMarker)
- return;
-
- var range = colorTextMarker.find();
- console.assert(range);
- if (!range)
- return;
-
- function updateCodeMirror(newColorText)
- {
- function update()
- {
- // The original text marker might have been cleared by a style update,
- // in this case we need to find the new color text marker so we know
- // the right range for the new style color text.
- if (!colorTextMarker || !colorTextMarker.find()) {
- colorTextMarker = null;
-
- var marks = this._codeMirror.findMarksAt(range.from);
- if (!marks.length)
- return;
-
- for (var i = 0; i < marks.length; ++i) {
- var mark = marks[i];
- if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(mark).type !== WebInspector.TextMarker.Type.Color)
- continue;
- colorTextMarker = mark;
- break;
- }
- }
-
- if (!colorTextMarker)
- return;
-
- // Sometimes we still might find a stale text marker with findMarksAt.
- var newRange = colorTextMarker.find();
- if (!newRange)
- return;
-
- range = newRange;
-
- colorTextMarker.clear();
-
- this._codeMirror.replaceRange(newColorText, range.from, range.to);
-
- // The color's text format could have changed, so we need to update the "range"
- // variable to anticipate a different "range.to" property.
- range.to.ch = range.from.ch + newColorText.length;
-
- colorTextMarker = this._codeMirror.markText(range.from, range.to);
-
- swatch.__colorTextMarker = colorTextMarker;
- }
-
- this._codeMirror.operation(update.bind(this));
- }
-
- if (event.shiftKey || this._codeMirror.getOption("readOnly")) {
- var nextFormat = color.nextFormat();
- console.assert(nextFormat);
- if (!nextFormat)
- return;
- color.format = nextFormat;
-
- var newColorText = color.toString();
-
- // Ignore the change so we don't commit the format change. However, any future user
- // edits will commit the color format.
- this._ignoreCodeMirrorContentDidChangeEvent = true;
- updateCodeMirror.call(this, newColorText);
- delete this._ignoreCodeMirrorContentDidChangeEvent;
- } else {
- this._colorPickerPopover = new WebInspector.Popover(this);
-
- var colorPicker = new WebInspector.ColorPicker;
-
- colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, function(event) {
- updateCodeMirror.call(this, event.data.color.toString());
- }.bind(this));
-
- var bounds = WebInspector.Rect.rectFromClientRect(swatch.getBoundingClientRect());
-
- this._colorPickerPopover.content = colorPicker.element;
- this._colorPickerPopover.present(bounds.pad(2), [WebInspector.RectEdge.MIN_X]);
-
- colorPicker.color = color;
- }
- },
-
- _propertyOverriddenStatusChanged: function(event)
- {
- this._updateTextMarkerForPropertyIfNeeded(event.target);
- },
-
- _propertiesChanged: function(event)
- {
- // Don't try to update the document while completions are showing. Doing so will clear
- // the completion hint and prevent further interaction with the completion.
- if (this._completionController.isShowingCompletions())
- return;
-
- // Reset the content if the text is different and we are not focused.
- if (!this.focused && this._style.text !== this._formattedContent()) {
- this._resetContent();
- return;
- }
-
- this._removeEditingLineClassesSoon();
-
- this._updateTextMarkers();
- },
-
- _markLinesWithCheckboxPlaceholder: function()
- {
- if (this._codeMirror.getOption("readOnly"))
- return;
-
- var linesWithPropertyCheckboxes = {};
- var linesWithCheckboxPlaceholders = {};
-
- var markers = this._codeMirror.getAllMarks();
- for (var i = 0; i < markers.length; ++i) {
- var textMarker = markers[i];
- if (textMarker.__propertyCheckbox) {
- var position = textMarker.find();
- if (position)
- linesWithPropertyCheckboxes[position.line] = true;
- } else if (textMarker.__checkboxPlaceholder) {
- var position = textMarker.find();
- if (position)
- linesWithCheckboxPlaceholders[position.line] = true;
- }
- }
-
- var lineCount = this._codeMirror.lineCount();
-
- for (var i = 0; i < lineCount; ++i) {
- if (i in linesWithPropertyCheckboxes || i in linesWithCheckboxPlaceholders)
- continue;
-
- var position = {line: i, ch: 0};
-
- var placeholderElement = document.createElement("div");
- placeholderElement.className = WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName;
-
- var placeholderMark = this._codeMirror.setUniqueBookmark(position, placeholderElement);
- placeholderMark.__checkboxPlaceholder = true;
- }
- },
-
- _removeCheckboxPlaceholder: function(lineNumber)
- {
- var marks = this._codeMirror.findMarksAt({line: lineNumber, ch: 0});
- for (var i = 0; i < marks.length; ++i) {
- var mark = marks[i];
- if (!mark.__checkboxPlaceholder)
- continue;
-
- mark.clear();
- return;
- }
- },
-
- _resetContent: function()
- {
- if (this._commitChangesTimeout) {
- clearTimeout(this._commitChangesTimeout);
- delete this._commitChangesTimeout;
- }
-
- this._removeEditingLineClasses();
-
- // Only allow editing if we have a style, it is editable and we have text range in the stylesheet.
- var readOnly = !this._style || !this._style.editable || !this._style.styleSheetTextRange;
- this._codeMirror.setOption("readOnly", readOnly);
-
- if (readOnly) {
- this.element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
- this._codeMirror.setOption("placeholder", WebInspector.UIString("No Properties"));
- } else {
- this.element.classList.remove(WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
- this._codeMirror.setOption("placeholder", WebInspector.UIString("No Properties \u2014 Click to Edit"));
- }
-
- if (!this._style) {
- this._ignoreCodeMirrorContentDidChangeEvent = true;
-
- this._clearTextMarkers(false, true);
-
- this._codeMirror.setValue("");
- this._codeMirror.clearHistory();
- this._codeMirror.markClean();
-
- delete this._ignoreCodeMirrorContentDidChangeEvent;
-
- return;
- }
-
- function update()
- {
- // Remember the cursor position/selection.
- var selectionAnchor = this._codeMirror.getCursor("anchor");
- var selectionHead = this._codeMirror.getCursor("head");
-
- function countNewLineCharacters(text)
- {
- var matches = text.match(/\n/g);
- return matches ? matches.length : 0;
- }
-
- var styleText = this._style.text;
-
- // Pretty print the content if there are more properties than there are lines.
- // This could be an option exposed to the user; however, it is almost always
- // desired in this case.
-
- if (styleText && this._style.visibleProperties.length <= countNewLineCharacters(styleText.trim()) + 1) {
- // This style has formatted text content, so use it for a high-fidelity experience.
-
- var prefixWhitespaceMatch = styleText.match(/^[ \t]*\n/);
- this._prefixWhitespace = prefixWhitespaceMatch ? prefixWhitespaceMatch[0] : "";
-
- var suffixWhitespaceMatch = styleText.match(/\n[ \t]*$/);
- this._suffixWhitespace = suffixWhitespaceMatch ? suffixWhitespaceMatch[0] : "";
-
- this._codeMirror.setValue(styleText);
-
- if (this._prefixWhitespace)
- this._codeMirror.removeLine(0);
-
- if (this._suffixWhitespace) {
- var lineCount = this._codeMirror.lineCount();
- this._codeMirror.replaceRange("", {line: lineCount - 2}, {line: lineCount - 1});
- }
-
- this._linePrefixWhitespace = "";
-
- var linesToStrip = [];
-
- // Remember the whitespace so it can be restored on commit.
- var lineCount = this._codeMirror.lineCount();
- for (var i = 0; i < lineCount; ++i) {
- var lineContent = this._codeMirror.getLine(i);
-
- var prefixWhitespaceMatch = lineContent.match(/^\s+/);
- if (!prefixWhitespaceMatch)
- continue;
-
- linesToStrip.push(i);
-
- // Only remember the shortest whitespace so we don't loose any of the
- // original author's whitespace if their indentation lengths differed.
- // Using the shortest also makes the adjustment work in _updateTextMarkers.
-
- // FIXME: This messes up if there is a mix of spaces and tabs. One tab
- // will be shorter than 4 or 8 spaces, but will look the same visually.
- if (!this._linePrefixWhitespace || prefixWhitespaceMatch[0].length < this._linePrefixWhitespace.length)
- this._linePrefixWhitespace = prefixWhitespaceMatch[0];
- }
-
- // Strip the whitespace from the beginning of each line.
- for (var i = 0; i < linesToStrip.length; ++i) {
- var lineNumber = linesToStrip[i];
- var from = {line: lineNumber, ch: 0};
- var to = {line: lineNumber, ch: this._linePrefixWhitespace.length};
- this._codeMirror.replaceRange("", from, to);
- }
-
- // Update all the text markers.
- this._updateTextMarkers(true);
- } else {
- // This style does not have text content or it is minified, so we want to synthesize the text content.
-
- this._prefixWhitespace = "";
- this._suffixWhitespace = "";
- this._linePrefixWhitespace = "";
-
- this._codeMirror.setValue("");
-
- var lineNumber = 0;
-
- // Iterate only visible properties if we have original style text. That way we known we only syntesize
- // what was originaly in the style text.
- this._iterateOverProperties(styleText ? true : false, function(property) {
- // Some property text can have line breaks, so consider that in the ranges below.
- var propertyText = property.synthesizedText;
- var propertyLineCount = countNewLineCharacters(propertyText);
-
- var from = {line: lineNumber, ch: 0};
- var to = {line: lineNumber + propertyLineCount};
-
- this._codeMirror.replaceRange((lineNumber ? "\n" : "") + propertyText, from);
- this._createTextMarkerForPropertyIfNeeded(from, to, property);
-
- lineNumber += propertyLineCount + 1;
- });
-
- // Look for colors and make swatches.
- this._createColorSwatches(true);
- }
-
- this._markLinesWithCheckboxPlaceholder();
-
- // Restore the cursor position/selection.
- this._codeMirror.setSelection(selectionAnchor, selectionHead);
-
- // Reset undo history since undo past the reset is wrong when the content was empty before
- // or the content was representing a previous style object.
- this._codeMirror.clearHistory();
-
- // Mark the editor as clean (unedited state).
- this._codeMirror.markClean();
- }
-
- // This needs to be done first and as a separate operation to avoid an exception in CodeMirror.
- this._clearTextMarkers(false, true);
-
- this._ignoreCodeMirrorContentDidChangeEvent = true;
- this._codeMirror.operation(update.bind(this));
- delete this._ignoreCodeMirrorContentDidChangeEvent;
- },
-
- _updateJumpToSymbolTrackingMode: function()
- {
- var oldJumpToSymbolTrackingModeEnabled = this._jumpToSymbolTrackingModeEnabled;
-
- if (!this._style || !this._style.ownerRule || !this._style.ownerRule.sourceCodeLocation)
- this._jumpToSymbolTrackingModeEnabled = false;
- else
- this._jumpToSymbolTrackingModeEnabled = WebInspector.modifierKeys.metaKey && !WebInspector.modifierKeys.altKey && !WebInspector.modifierKeys.shiftKey;
-
- if (oldJumpToSymbolTrackingModeEnabled !== this._jumpToSymbolTrackingModeEnabled) {
- if (this._jumpToSymbolTrackingModeEnabled) {
- this._tokenTrackingController.highlightLastHoveredRange();
- this._tokenTrackingController.enabled = !this._codeMirror.getOption("readOnly");
- } else {
- this._tokenTrackingController.removeHighlightedRange();
- this._tokenTrackingController.enabled = false;
- }
- }
- },
-
- tokenTrackingControllerHighlightedRangeWasClicked: function(tokenTrackingController)
- {
- console.assert(this._style.ownerRule.sourceCodeLocation);
- if (!this._style.ownerRule.sourceCodeLocation)
- return;
-
- // Special case command clicking url(...) links.
- var token = this._tokenTrackingController.candidate.hoveredToken;
- if (/\blink\b/.test(token.type)) {
- var url = token.string;
- var baseURL = this._style.ownerRule.sourceCodeLocation.sourceCode.url;
- WebInspector.openURL(absoluteURL(url, baseURL));
- return;
- }
-
- // Jump to the rule if we can't find a property.
- // Find a better source code location from the property that was clicked.
- var sourceCodeLocation = this._style.ownerRule.sourceCodeLocation;
- var marks = this._codeMirror.findMarksAt(this._tokenTrackingController.candidate.hoveredTokenRange.start);
- for (var i = 0; i < marks.length; ++i) {
- var mark = marks[i];
- var property = mark.__cssProperty;
- if (property) {
- var sourceCode = sourceCodeLocation.sourceCode;
- var styleSheetTextRange = property.styleSheetTextRange;
- sourceCodeLocation = sourceCode.createSourceCodeLocation(styleSheetTextRange.startLine, styleSheetTextRange.startColumn);
- }
- }
-
- WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
- },
-
- tokenTrackingControllerNewHighlightCandidate: function(tokenTrackingController, candidate)
- {
- this._tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
- }
-};
-
-WebInspector.CSSStyleDeclarationTextEditor.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.details.css-style > .navigation-bar {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
-
-.sidebar > .panel.details.css-style > .content {
- position: absolute;
- top: 22px;
- left: 0;
- right: 0;
- bottom: 0;
-
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-.sidebar > .panel.details.css-style > .content > .pseudo-classes {
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
-
- padding: 10px;
-
- display: -webkit-flex;
- -webkit-flex-flow: row wrap;
- -webkit-justify-content: space-around;
-}
-
-.sidebar > .panel.details.css-style > .content > .pseudo-classes > .group {
- display: -webkit-inline-flex;
- -webkit-flex-flow: row wrap;
- -webkit-justify-content: space-around;
- -webkit-flex: 1;
-}
-
-.sidebar > .panel.details.css-style > .content > .pseudo-classes > .group > label {
- color: rgb(96, 96, 96);
- text-shadow: white 0 1px 0;
-
- margin: 0 5px;
- min-width: 55px;
-
- display: inline-block;
- white-space: nowrap;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,240 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDetailsSidebarPanel = function()
-{
- WebInspector.DOMDetailsSidebarPanel.call(this, "css-style", WebInspector.UIString("Styles"), WebInspector.UIString("Style"), "Images/NavigationItemBrushAndRuler.svg", "4");
-
- this._selectedPanel = null;
-
- this._navigationBar = new WebInspector.NavigationBar(null, null, "tablist");
- this._navigationBar.addEventListener(WebInspector.NavigationBar.Event.NavigationItemSelected, this._navigationItemSelected, this);
- this.element.appendChild(this._navigationBar.element);
-
- this._contentElement = document.createElement("div");
- this._contentElement.className = WebInspector.CSSStyleDetailsSidebarPanel.ContentStyleClassName;
-
- this._forcedPseudoClassCheckboxes = {};
-
- if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
- this._forcedPseudoClassContainer = document.createElement("div");
- this._forcedPseudoClassContainer.className = WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesElementStyleClassName;
-
- var groupElement = null;
-
- WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(pseudoClass) {
- // We don't localize the label since it is a CSS pseudo-class from the CSS standard.
- var label = pseudoClass.capitalize();
-
- var labelElement = document.createElement("label");
-
- var checkboxElement = document.createElement("input");
- checkboxElement.addEventListener("change", this._forcedPseudoClassCheckboxChanged.bind(this, pseudoClass));
- checkboxElement.type = "checkbox";
-
- this._forcedPseudoClassCheckboxes[pseudoClass] = checkboxElement;
-
- labelElement.appendChild(checkboxElement);
- labelElement.appendChild(document.createTextNode(label));
-
- if (!groupElement || groupElement.children.length === 2) {
- groupElement = document.createElement("div");
- groupElement.className = WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesGroupElementStyleClassName;
- this._forcedPseudoClassContainer.appendChild(groupElement);
- }
-
- groupElement.appendChild(labelElement);
- }.bind(this));
-
- this._contentElement.appendChild(this._forcedPseudoClassContainer);
- }
-
- this.element.appendChild(this._contentElement);
-
- this._computedStyleDetailsPanel = new WebInspector.ComputedStyleDetailsPanel;
- this._rulesStyleDetailsPanel = new WebInspector.RulesStyleDetailsPanel;
- this._metricsStyleDetailsPanel = new WebInspector.MetricsStyleDetailsPanel;
-
- this._panels = [this._computedStyleDetailsPanel, this._rulesStyleDetailsPanel, this._metricsStyleDetailsPanel];
-
- this._navigationBar.addNavigationItem(this._computedStyleDetailsPanel.navigationItem);
- this._navigationBar.addNavigationItem(this._rulesStyleDetailsPanel.navigationItem);
- this._navigationBar.addNavigationItem(this._metricsStyleDetailsPanel.navigationItem);
-
- this._lastSelectedSectionSetting = new WebInspector.Setting("last-selected-style-details-panel", this._rulesStyleDetailsPanel.navigationItem.identifier);
-
- // This will cause the selected panel to be set in _navigationItemSelected.
- this._navigationBar.selectedNavigationItem = this._lastSelectedSectionSetting.value;
-};
-
-WebInspector.CSSStyleDetailsSidebarPanel.ContentStyleClassName = "content";
-WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesElementStyleClassName = "pseudo-classes";
-WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesGroupElementStyleClassName = "group";
-WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset = 38; // Default height of the forced pseudo classes container. Updated in widthDidChange.
-
-WebInspector.CSSStyleDetailsSidebarPanel.prototype = {
- constructor: WebInspector.CSSStyleDetailsSidebarPanel,
-
- // Public
-
- supportsDOMNode: function(nodeToInspect)
- {
- return nodeToInspect.nodeType() === Node.ELEMENT_NODE;
- },
-
- refresh: function()
- {
- var domNode = this.domNode;
- if (!domNode)
- return;
-
- this._contentElement.scrollTop = this._initialScrollOffset;
-
- for (var i = 0; i < this._panels.length; ++i) {
- delete this._panels[i].element._savedScrollTop;
- this._panels[i].markAsNeedsRefresh(domNode);
- }
-
- this._updatePseudoClassCheckboxes();
- },
-
- visibilityDidChange: function()
- {
- WebInspector.SidebarPanel.prototype.visibilityDidChange.call(this);
-
- if (!this._selectedPanel)
- return;
-
- if (!this.visible) {
- this._selectedPanel.hidden();
- return;
- }
-
- this._navigationBar.updateLayout();
-
- this._updateNoForcedPseudoClassesScrollOffset();
-
- this._selectedPanel.shown();
- this._selectedPanel.markAsNeedsRefresh(this.domNode);
- },
-
- widthDidChange: function()
- {
- this._updateNoForcedPseudoClassesScrollOffset();
-
- if (this._selectedPanel)
- this._selectedPanel.widthDidChange();
- },
-
- // Protected
-
- addEventListeners: function()
- {
- this.domNode.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged, this._updatePseudoClassCheckboxes, this);
- },
-
- removeEventListeners: function()
- {
- this.domNode.removeEventListener(null, null, this);
- },
-
- // Private
-
- get _initialScrollOffset()
- {
- if (!WebInspector.cssStyleManager.canForcePseudoClasses())
- return 0;
- return this.domNode && this.domNode.enabledPseudoClasses.length ? 0 : WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset;
- },
-
- _updateNoForcedPseudoClassesScrollOffset: function()
- {
- if (this._forcedPseudoClassContainer)
- WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset = this._forcedPseudoClassContainer.offsetHeight;
- },
-
- _navigationItemSelected: function(event)
- {
- console.assert(event.target.selectedNavigationItem);
- if (!event.target.selectedNavigationItem)
- return;
-
- var selectedNavigationItem = event.target.selectedNavigationItem;
-
- var selectedPanel = null;
- for (var i = 0; i < this._panels.length; ++i) {
- if (this._panels[i].navigationItem !== selectedNavigationItem)
- continue;
- selectedPanel = this._panels[i];
- break;
- }
-
- console.assert(selectedPanel);
-
- if (this._selectedPanel) {
- this._selectedPanel.hidden();
- this._selectedPanel.element._savedScrollTop = this._contentElement.scrollTop;
- this._selectedPanel.element.remove();
- }
-
- this._selectedPanel = selectedPanel;
-
- if (this._selectedPanel) {
- this._contentElement.appendChild(this._selectedPanel.element);
-
- if (typeof this._selectedPanel.element._savedScrollTop === "number")
- this._contentElement.scrollTop = this._selectedPanel.element._savedScrollTop;
- else
- this._contentElement.scrollTop = this._initialScrollOffset;
-
- this._selectedPanel.shown();
- }
-
- this._lastSelectedSectionSetting.value = selectedNavigationItem.identifier;
- },
-
- _forcedPseudoClassCheckboxChanged: function(pseudoClass, event)
- {
- if (!this.domNode)
- return;
-
- this.domNode.setPseudoClassEnabled(pseudoClass, event.target.checked);
- },
-
- _updatePseudoClassCheckboxes: function()
- {
- if (!this.domNode)
- return;
-
- var enabledPseudoClasses = this.domNode.enabledPseudoClasses;
-
- for (var pseudoClass in this._forcedPseudoClassCheckboxes) {
- var checkboxElement = this._forcedPseudoClassCheckboxes[pseudoClass];
- checkboxElement.checked = enabledPseudoClasses.contains(pseudoClass);
- }
- }
-};
-
-WebInspector.CSSStyleDetailsSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,367 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleManager = function()
-{
- WebInspector.Object.call(this);
-
- if (window.CSSAgent)
- CSSAgent.enable();
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceAdded, this);
- WebInspector.Resource.addEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._resourceContentDidChange, this);
- WebInspector.Resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
-
- WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.AttributeModified, this._nodeAttributesDidChange, this);
- WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.AttributeRemoved, this._nodeAttributesDidChange, this);
- WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged, this._nodePseudoClassesDidChange, this);
-
- this._colorFormatSetting = new WebInspector.Setting("default-color-format", WebInspector.Color.Format.Original);
-
- this._styleSheetIdentifierMap = {};
- this._styleSheetFrameURLMap = {};
- this._nodeStylesMap = {};
-}
-
-WebInspector.CSSStyleManager.ForceablePseudoClasses = ["active", "focus", "hover", "visited"];
-
-WebInspector.CSSStyleManager.prototype = {
- constructor: WebInspector.CSSStyleManager,
-
- // Public
-
- get preferredColorFormat()
- {
- return this._colorFormatSetting.value;
- },
-
- canForcePseudoClasses: function()
- {
- return window.CSSAgent && !!CSSAgent.forcePseudoState;
- },
-
- propertyNameHasOtherVendorPrefix: function(name)
- {
- if (!name || name.length < 4 || name.charAt(0) !== "-")
- return false;
-
- var match = name.match(/^(?:-moz-|-ms-|-o-|-epub-)/);
- if (!match)
- return false;
-
- return true;
- },
-
- propertyValueHasOtherVendorKeyword: function(value)
- {
- var match = value.match(/(?:-moz-|-ms-|-o-|-epub-)[-\w]+/);
- if (!match)
- return false;
-
- return true;
- },
-
- canonicalNameForPropertyName: function(name)
- {
- if (!name || name.length < 8 || name.charAt(0) !== "-")
- return name;
-
- var match = name.match(/^(?:-webkit-|-khtml-|-apple-)(.+)/);
- if (!match)
- return name;
-
- return match[1];
- },
-
- styleSheetForIdentifier: function(id)
- {
- if (id in this._styleSheetIdentifierMap)
- return this._styleSheetIdentifierMap[id];
-
- var styleSheet = new WebInspector.CSSStyleSheet(id);
- this._styleSheetIdentifierMap[id] = styleSheet;
- return styleSheet;
- },
-
- stylesForNode: function(node)
- {
- if (node.id in this._nodeStylesMap)
- return this._nodeStylesMap[node.id];
-
- var styles = new WebInspector.DOMNodeStyles(node);
- this._nodeStylesMap[node.id] = styles;
- return styles;
- },
-
- // Protected
-
- mediaQueryResultChanged: function()
- {
- // Called from WebInspector.CSSObserver.
-
- for (var key in this._nodeStylesMap)
- this._nodeStylesMap[key].mediaQueryResultDidChange();
- },
-
- styleSheetChanged: function(styleSheetIdentifier)
- {
- // Called from WebInspector.CSSObserver.
-
- var styleSheet = this.styleSheetForIdentifier(styleSheetIdentifier);
- console.assert(styleSheet);
-
- styleSheet.noteContentDidChange();
-
- this._updateResourceContent(styleSheet);
- },
-
- // Private
-
- _nodePseudoClassesDidChange: function(event)
- {
- var node = event.target;
-
- for (var key in this._nodeStylesMap) {
- var nodeStyles = this._nodeStylesMap[key];
- if (nodeStyles.node !== node && !nodeStyles.node.isDescendant(node))
- continue;
- nodeStyles.pseudoClassesDidChange(node);
- }
- },
-
- _nodeAttributesDidChange: function(event)
- {
- var node = event.target;
-
- for (var key in this._nodeStylesMap) {
- var nodeStyles = this._nodeStylesMap[key];
- if (nodeStyles.node !== node && !nodeStyles.node.isDescendant(node))
- continue;
- nodeStyles.attributeDidChange(node, event.data.name);
- }
- },
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- // Clear our maps when the main frame navigates.
-
- this._styleSheetIdentifierMap = {};
- this._styleSheetFrameURLMap = {};
- this._nodeStylesMap = {};
- },
-
- _resourceAdded: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- var resource = event.data.resource;
- console.assert(resource);
-
- if (resource.type !== WebInspector.Resource.Type.Stylesheet)
- return;
-
- this._clearStyleSheetsForResource(resource);
- },
-
- _resourceTypeDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Resource);
-
- var resource = event.target;
- if (resource.type !== WebInspector.Resource.Type.Stylesheet)
- return;
-
- this._clearStyleSheetsForResource(resource);
- },
-
- _clearStyleSheetsForResource: function(resource)
- {
- // Clear known stylesheets for this URL and frame. This will cause the stylesheets to
- // be updated next time _fetchInfoForAllStyleSheets is called.
- // COMPATIBILITY (iOS 6): The frame's id was not available for the key, so delete just the url too.
- delete this._styleSheetFrameURLMap[this._frameURLMapKey(resource.parentFrame, resource.url)];
- delete this._styleSheetFrameURLMap[resource.url];
- },
-
- _frameURLMapKey: function(frame, url)
- {
- return (frame ? frame.id + ":" : "") + url;
- },
-
- _lookupStyleSheetForResource: function(resource, callback)
- {
- this._lookupStyleSheet(resource.parentFrame, resource.url, callback);
- },
-
- _lookupStyleSheet: function(frame, url, callback)
- {
- console.assert(frame instanceof WebInspector.Frame);
-
- function syleSheetsFetched()
- {
- callback(this._styleSheetFrameURLMap[key] || this._styleSheetFrameURLMap[url] || null);
- }
-
- var key = this._frameURLMapKey(frame, url);
-
- // COMPATIBILITY (iOS 6): The frame's id was not available for the key, so check for just the url too.
- if (key in this._styleSheetFrameURLMap || url in this._styleSheetFrameURLMap)
- callback(this._styleSheetFrameURLMap[key] || this._styleSheetFrameURLMap[url] || null);
- else
- this._fetchInfoForAllStyleSheets(syleSheetsFetched.bind(this));
- },
-
- _fetchInfoForAllStyleSheets: function(callback)
- {
- console.assert(typeof callback === "function");
-
- function processStyleSheets(error, styleSheets)
- {
- this._styleSheetFrameURLMap = {};
-
- if (error) {
- callback();
- return;
- }
-
- for (var i = 0; i < styleSheets.length; ++i) {
- var styleSheetInfo = styleSheets[i];
-
- // COMPATIBILITY (iOS 6): The info did not have 'frameId', so make parentFrame null in that case.
- var parentFrame = "frameId" in styleSheetInfo ? WebInspector.frameResourceManager.frameForIdentifier(styleSheetInfo.frameId) : null;
-
- var styleSheet = this.styleSheetForIdentifier(styleSheetInfo.styleSheetId);
- styleSheet.updateInfo(styleSheetInfo.sourceURL, parentFrame);
-
- var key = this._frameURLMapKey(parentFrame, styleSheetInfo.sourceURL);
- this._styleSheetFrameURLMap[key] = styleSheet;
- }
-
- callback();
- }
-
- CSSAgent.getAllStyleSheets(processStyleSheets.bind(this));
- },
-
- _resourceContentDidChange: function(event)
- {
- var resource = event.target;
- if (resource === this._ignoreResourceContentDidChangeEventForResource)
- return;
-
- // Ignore if it isn't a CSS stylesheet.
- if (resource.type !== WebInspector.Resource.Type.Stylesheet || resource.syntheticMIMEType !== "text/css")
- return;
-
- function applyStyleSheetChanges()
- {
- function styleSheetFound(styleSheet)
- {
- delete resource.__pendingChangeTimeout;
-
- console.assert(styleSheet);
- if (!styleSheet)
- return;
-
- // To prevent updating a TextEditor's content while the user is typing in it we want to
- // ignore the next _updateResourceContent call.
- resource.__ignoreNextUpdateResourceContent = true;
-
- WebInspector.branchManager.currentBranch.revisionForRepresentedObject(styleSheet).content = resource.content;
- }
-
- this._lookupStyleSheetForResource(resource, styleSheetFound.bind(this));
- }
-
- if (resource.__pendingChangeTimeout)
- clearTimeout(resource.__pendingChangeTimeout);
- resource.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
- },
-
- _updateResourceContent: function(styleSheet)
- {
- console.assert(styleSheet);
-
- function fetchedStyleSheetContent(styleSheet, content)
- {
- delete styleSheet.__pendingChangeTimeout;
-
- console.assert(styleSheet.url);
- if (!styleSheet.url)
- return;
-
- var resource = null;
-
- // COMPATIBILITY (iOS 6): The stylesheet did not always have a frame, so fallback to looking
- // for the resource in all frames.
- if (styleSheet.parentFrame)
- resource = styleSheet.parentFrame.resourceForURL(styleSheet.url);
- else
- resource = WebInspector.frameResourceManager.resourceForURL(styleSheet.url);
-
- if (!resource)
- return;
-
- // Only try to update stylesheet resources. Other resources, like documents, can contain
- // multiple stylesheets and we don't have the source ranges to update those.
- if (resource.type !== WebInspector.Resource.Type.Stylesheet)
- return;
-
- if (resource.__ignoreNextUpdateResourceContent) {
- delete resource.__ignoreNextUpdateResourceContent;
- return;
- }
-
- this._ignoreResourceContentDidChangeEventForResource = resource;
- WebInspector.branchManager.currentBranch.revisionForRepresentedObject(resource).content = content;
- delete this._ignoreResourceContentDidChangeEventForResource;
- }
-
- function styleSheetReady()
- {
- styleSheet.requestContent(fetchedStyleSheetContent.bind(this));
- }
-
- function applyStyleSheetChanges()
- {
- if (styleSheet.url)
- styleSheetReady.call(this);
- else
- this._fetchInfoForAllStyleSheets(styleSheetReady.bind(this));
- }
-
- if (styleSheet.__pendingChangeTimeout)
- clearTimeout(styleSheet.__pendingChangeTimeout);
- styleSheet.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
- }
-}
-
-WebInspector.CSSStyleManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCSSStyleSheetjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CSSStyleSheet.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CSSStyleSheet.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CSSStyleSheet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,155 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleSheet = function(id, url, parentFrame)
-{
- WebInspector.SourceCode.call(this);
-
- console.assert(id);
-
- this._id = id || null;
-
- this.updateInfo(url, parentFrame);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleSheet);
-
-WebInspector.CSSStyleSheet.resetUniqueDisplayNameNumbers = function()
-{
- WebInspector.CSSStyleSheet._nextUniqueDisplayNameNumber = 1;
-}
-
-WebInspector.CSSStyleSheet._nextUniqueDisplayNameNumber = 1;
-
-WebInspector.CSSStyleSheet.Event = {
- ContentDidChange: "stylesheet-content-did-change"
-};
-
-WebInspector.CSSStyleSheet.prototype = {
- constructor: WebInspector.CSSStyleSheet,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get parentFrame()
- {
- return this._parentFrame;
- },
-
- get url()
- {
- return this._url;
- },
-
- get urlComponents()
- {
- if (!this._urlComponents)
- this._urlComponents = parseURL(this._url);
- return this._urlComponents;
- },
-
- get displayName()
- {
- if (this._url)
- return WebInspector.displayNameForURL(this._url, this.urlComponents);
-
- // Assign a unique number to the StyleSheet object so it will stay the same.
- if (!this._uniqueDisplayNameNumber)
- this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
-
- return WebInspector.UIString("Anonymous StyleSheet %d").format(this._uniqueDisplayNameNumber);
- },
-
- // Protected
-
- updateInfo: function(url, parentFrame)
- {
- this._url = url || null;
- delete this._urlComponents;
-
- this._parentFrame = parentFrame || null;
- },
-
- get revisionForRequestedContent()
- {
- return this.currentRevision;
- },
-
- handleCurrentRevisionContentChange: function()
- {
- if (!this._id)
- return;
-
- function contentDidChange(error)
- {
- if (error)
- return;
-
- DOMAgent.markUndoableState();
-
- this.dispatchEventToListeners(WebInspector.CSSStyleSheet.Event.ContentDidChange);
- }
-
- this._ignoreNextContentDidChangeNotification = true;
-
- CSSAgent.setStyleSheetText(this._id, this.currentRevision.content, contentDidChange.bind(this));
- },
-
- canRequestContentFromBackend: function()
- {
- // We can request content if we have an id.
- return !!this._id;
- },
-
- requestContentFromBackend: function(callback)
- {
- if (!this._id) {
- // There is no identifier to request content with. Return false to cause the
- // pending callbacks to get null content.
- return false;
- }
-
- CSSAgent.getStyleSheetText(this._id, callback);
- return true;
- },
-
- noteContentDidChange: function()
- {
- if (this._ignoreNextContentDidChangeNotification) {
- delete this._ignoreNextContentDidChangeNotification;
- return false;
- }
-
- this.markContentAsStale();
- this.dispatchEventToListeners(WebInspector.CSSStyleSheet.Event.ContentDidChange);
- return true;
- }
-};
-
-WebInspector.CSSStyleSheet.prototype.__proto__ = WebInspector.SourceCode.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCallFramejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CallFrame.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CallFrame.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CallFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,105 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CallFrame = function(id, sourceCodeLocation, functionName, thisObject, scopeChain, nativeCode)
-{
- WebInspector.Object.call(this);
-
- console.assert(!sourceCodeLocation || sourceCodeLocation instanceof WebInspector.SourceCodeLocation);
- console.assert(!thisObject || thisObject instanceof WebInspector.RemoteObject);
- console.assert(!scopeChain || scopeChain instanceof Array);
-
- this._id = id || null;
- this._sourceCodeLocation = sourceCodeLocation || null;
- this._functionName = functionName || null;
- this._thisObject = thisObject || null;
- this._scopeChain = scopeChain || [];
- this._nativeCode = nativeCode || false;
-};
-
-WebInspector.CallFrame.prototype = {
- constructor: WebInspector.CallFrame,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- get functionName()
- {
- return this._functionName;
- },
-
- get nativeCode()
- {
- return this._nativeCode;
- },
-
- get thisObject()
- {
- return this._thisObject;
- },
-
- get scopeChain()
- {
- return this._scopeChain;
- },
-
- saveIdentityToCookie: function()
- {
- // Do nothing. The call frame is torn down when the inspector closes, and
- // we shouldn't restore call frame content views across debugger pauses.
- },
-
- collectScopeChainVariableNames: function(callback)
- {
- var result = {this: true};
-
- var pendingRequests = this._scopeChain.length;
-
- function propertiesCollected(properties)
- {
- for (var i = 0; properties && i < properties.length; ++i)
- result[properties[i].name] = true;
-
- if (--pendingRequests)
- return;
-
- callback(result);
- }
-
- for (var i = 0; i < this._scopeChain.length; ++i)
- this._scopeChain[i].object.getAllProperties(propertiesCollected);
- }
-};
-
-WebInspector.CallFrame.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCallFrameIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CallFrameIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CallFrameIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CallFrameIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.function-icon .icon {
- content: url(Images/Function.svg);
-}
-
-.event-listener-icon .icon {
- content: url(Images/EventListener.svg);
-}
-
-.native-icon .icon {
- content: url(Images/Native.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCallFrameTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CallFrameTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CallFrameTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CallFrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CallFrameTreeElement = function(callFrame)
-{
- console.assert(callFrame instanceof WebInspector.CallFrame);
-
- var className = WebInspector.CallFrameTreeElement.FunctionIconStyleClassName;
- if (callFrame.nativeCode)
- className = WebInspector.CallFrameTreeElement.NativeIconStyleClassName;
-
- // This is more than likely an event listener function with an "on" prefix and it is
- // as long or longer than the shortest event listener name -- "oncut".
- if (callFrame.functionName && callFrame.functionName.startsWith("on") && callFrame.functionName.length >= 5)
- className = WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName;
-
- var title = callFrame.functionName || WebInspector.UIString("(anonymous function)");
-
- WebInspector.GeneralTreeElement.call(this, className, title, null, callFrame, false);
-
- if (!callFrame.nativeCode && callFrame.sourceCodeLocation) {
- var displayScriptURL = callFrame.sourceCodeLocation.displaySourceCode.url;
- if (displayScriptURL) {
- this.subtitle = document.createElement("span");
- callFrame.sourceCodeLocation.populateLiveDisplayLocationString(this.subtitle, "textContent");
- // Set the tooltip on the entire tree element in onattach, once the element is created.
- this.tooltipHandledSeparately = true;
- }
- }
-
- this._callFrame = callFrame;
-
- this.small = true;
-};
-
-WebInspector.CallFrameTreeElement.FunctionIconStyleClassName = "function-icon";
-WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName = "event-listener-icon";
-WebInspector.CallFrameTreeElement.NativeIconStyleClassName = "native-icon";
-
-WebInspector.CallFrameTreeElement.prototype = {
- constructor: WebInspector.CallFrameTreeElement,
-
- // Public
-
- get callFrame()
- {
- return this._callFrame;
- },
-
- // Protected
-
- onattach: function()
- {
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
- console.assert(this.element);
-
- if (this.tooltipHandledSeparately) {
- var tooltipPrefix = this.mainTitle + "\n";
- this._callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
- }
- }
-};
-
-WebInspector.CallFrameTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceClusterContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.cluster > .content-view-container {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceClusterContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,257 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ClusterContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this.element.classList.add(WebInspector.ClusterContentView.StyleClassName);
-
- this._contentViewContainer = new WebInspector.ContentViewContainer();
- this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this);
- this.element.appendChild(this._contentViewContainer.element);
-
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
-};
-
-WebInspector.ClusterContentView.StyleClassName = "cluster";
-
-WebInspector.ClusterContentView.prototype = {
- constructor: WebInspector.ClusterContentView,
-
- // Public
-
- get navigationItems()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- return currentContentView ? currentContentView.navigationItems : [];
- },
-
- get contentViewContainer()
- {
- return this._contentViewContainer;
- },
-
- get supportsSplitContentBrowser()
- {
- if (this._contentViewContainer.currentContentView)
- return this._contentViewContainer.currentContentView.supportsSplitContentBrowser;
- return true;
- },
-
- updateLayout: function()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (currentContentView)
- currentContentView.updateLayout();
- },
-
- shown: function()
- {
- this._contentViewContainer.shown();
- },
-
- hidden: function()
- {
- this._contentViewContainer.hidden();
- },
-
- closed: function()
- {
- this._contentViewContainer.closeAllContentViews();
-
- WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
- WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
- WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
- },
-
- canGoBack: function()
- {
- return this._contentViewContainer.canGoBack();
- },
-
- canGoForward: function()
- {
- return this._contentViewContainer.canGoForward();
- },
-
- goBack: function()
- {
- this._contentViewContainer.goBack()
- },
-
- goForward: function()
- {
- this._contentViewContainer.goForward()
- },
-
- get selectionPathComponents()
- {
- if (!this._contentViewContainer.currentContentView)
- return [];
- return this._contentViewContainer.currentContentView.selectionPathComponents;
- },
-
- get supplementalRepresentedObjects()
- {
- if (!this._contentViewContainer.currentContentView)
- return [];
- return this._contentViewContainer.currentContentView.supplementalRepresentedObjects;
- },
-
- get handleCopyEvent()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- return currentContentView && typeof currentContentView.handleCopyEvent === "function" ? currentContentView.handleCopyEvent.bind(currentContentView) : null;
- },
-
- get supportsSave()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- return currentContentView && currentContentView.supportsSave;
- },
-
- get saveData()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- return currentContentView && currentContentView.saveData || null;
- },
-
- get supportsSearch()
- {
- // Always return true so we can intercept the search query to resend it when switching content views.
- return true;
- },
-
- get numberOfSearchResults()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return null;
- return currentContentView.numberOfSearchResults;
- },
-
- get hasPerformedSearch()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return false;
- return currentContentView.hasPerformedSearch;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
- currentContentView.automaticallyRevealFirstSearchResult = reveal;
- },
-
- performSearch: function(query)
- {
- this._searchQuery = query;
-
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
- currentContentView.performSearch(query);
- },
-
- searchCleared: function()
- {
- this._searchQuery = null;
-
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
- currentContentView.searchCleared();
- },
-
- searchQueryWithSelection: function()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return null;
- return currentContentView.searchQueryWithSelection();
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
- currentContentView.revealPreviousSearchResult(changeFocus);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
- currentContentView.revealNextSearchResult(changeFocus);
- },
-
- // Private
-
- _currentContentViewDidChange: function(event)
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (currentContentView && currentContentView.supportsSearch) {
- if (this._searchQuery)
- currentContentView.performSearch(this._searchQuery);
- else
- currentContentView.searchCleared();
- }
-
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
- },
-
- _contentViewSelectionPathComponentDidChange: function(event)
- {
- if (event.target !== this._contentViewContainer.currentContentView)
- return;
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- },
-
- _contentViewSupplementalRepresentedObjectsDidChange: function(event)
- {
- if (event.target !== this._contentViewContainer.currentContentView)
- return;
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
- },
-
- _contentViewNumberOfSearchResultsDidChange: function(event)
- {
- if (event.target !== this._contentViewContainer.currentContentView)
- return;
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
- }
-};
-
-WebInspector.ClusterContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorAdditionsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorAdditions.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorAdditions.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorAdditions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,648 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-(function () {
- // By default CodeMirror defines syntax highlighting styles based on token
- // only and shared styles between modes. This limiting and does not match
- // what we have done in the Web Inspector. So this modifies the XML, CSS
- // and JavaScript modes to supply two styles for each token. One for the
- // token and one with the mode name.
-
- function tokenizeLinkString(stream, state)
- {
- console.assert(state._linkQuoteCharacter !== undefined);
-
- // Eat the string until the same quote is found that started the string.
- // If this is unquoted, then eat until whitespace or common parse errors.
- if (state._linkQuoteCharacter)
- stream.eatWhile(new RegExp("[^" + state._linkQuoteCharacter + "]"));
- else
- stream.eatWhile(/[^\s\u00a0=<>\"\']/);
-
- // If the stream isn't at the end of line then we found the end quote.
- // In the case, change _linkTokenize to parse the end of the link next.
- // Otherwise _linkTokenize will stay as-is to parse more of the link.
- if (!stream.eol())
- state._linkTokenize = tokenizeEndOfLinkString;
-
- return "link";
- }
-
- function tokenizeEndOfLinkString(stream, state)
- {
- console.assert(state._linkQuoteCharacter !== undefined);
- console.assert(state._linkBaseStyle);
-
- // Eat the quote character to style it with the base style.
- if (state._linkQuoteCharacter)
- stream.eat(state._linkQuoteCharacter);
-
- var style = state._linkBaseStyle;
-
- // Clean up the state.
- delete state._linkTokenize;
- delete state._linkQuoteCharacter;
- delete state._linkBaseStyle;
-
- return style;
- }
-
- function extendedXMLToken(stream, state)
- {
- if (state._linkTokenize) {
- // Call the link tokenizer instead.
- var style = state._linkTokenize(stream, state);
- return style && (style + " m-" + this.name);
- }
-
- // Remember the start position so we can rewind if needed.
- var startPosition = stream.pos;
- var style = this._token(stream, state);
-
- if (style === "attribute") {
- // Look for "href" or "src" attributes. If found then we should
- // expect a string later that should get the "link" style instead.
- var text = stream.current().toLowerCase();
- if (text === "href" || text === "src")
- state._expectLink = true;
- else
- delete state._expectLink;
- } else if (state._expectLink && style === "string") {
- delete state._expectLink;
-
- // This is a link, so setup the state to process it next.
- state._linkTokenize = tokenizeLinkString;
- state._linkBaseStyle = style;
-
- // The attribute may or may not be quoted.
- var quote = stream.current()[0];
- state._linkQuoteCharacter = quote === "'" || quote === "\"" ? quote : null;
-
- // Rewind the steam to the start of this token.
- stream.pos = startPosition;
-
- // Eat the open quote of the string so the string style
- // will be used for the quote character.
- if (state._linkQuoteCharacter)
- stream.eat(state._linkQuoteCharacter);
- } else if (style) {
- // We don't expect other tokens between attribute and string since
- // spaces and the equal character are not tokenized. So if we get
- // another token before a string then we stop expecting a link.
- delete state._expectLink;
- }
-
- return style && (style + " m-" + this.name);
- }
-
- function tokenizeCSSURLString(stream, state)
- {
- console.assert(state._urlQuoteCharacter);
-
- // If we are an unquoted url string, return whitespace blocks as a whitespace token (null).
- if (state._unquotedURLString && stream.eatSpace())
- return null;
-
- var ch = null;
- var escaped = false;
- var reachedEndOfURL = false;
- var lastNonWhitespace = stream.pos;
- var quote = state._urlQuoteCharacter;
-
- // Parse characters until the end of the stream/line or a proper end quote character.
- while ((ch = stream.next()) != null) {
- if (ch == quote && !escaped) {
- reachedEndOfURL = true;
- break;
- }
- escaped = !escaped && ch === "\\";
- if (!/[\s\u00a0]/.test(ch))
- lastNonWhitespace = stream.pos;
- }
-
- // If we are an unquoted url string, do not include trailing whitespace, rewind to the last real character.
- if (state._unquotedURLString)
- stream.pos = lastNonWhitespace;
-
- // If we have reached the proper the end of the url string, switch to the end tokenizer to reset the state.
- if (reachedEndOfURL) {
- if (!state._unquotedURLString)
- stream.backUp(1);
- this._urlTokenize = tokenizeEndOfCSSURLString;
- }
-
- return "link";
- }
-
- function tokenizeEndOfCSSURLString(stream, state)
- {
- console.assert(state._urlQuoteCharacter);
- console.assert(state._urlBaseStyle);
-
- // Eat the quote character to style it with the base style.
- if (!state._unquotedURLString)
- stream.eat(state._urlQuoteCharacter);
-
- var style = state._urlBaseStyle;
-
- delete state._urlTokenize;
- delete state._urlQuoteCharacter;
- delete state._urlBaseStyle;
-
- return style;
- }
-
- function extendedCSSToken(stream, state)
- {
- if (state._urlTokenize) {
- // Call the link tokenizer instead.
- var style = state._urlTokenize(stream, state);
- return style && (style + " m-" + (this.alternateName || this.name));
- }
-
- // Remember the start position so we can rewind if needed.
- var startPosition = stream.pos;
- var style = this._token(stream, state);
-
- if (style) {
- if (style === "string-2" && stream.current() === "url") {
- // If the current text is "url" then we should expect the next string token to be a link.
- state._expectLink = true;
- } else if (state._expectLink && style === "string") {
- // We expected a string and got it. This is a link. Parse it the way we want it.
- delete state._expectLink;
-
- // This is a link, so setup the state to process it next.
- state._urlTokenize = tokenizeCSSURLString;
- state._urlBaseStyle = style;
-
- // The url may or may not be quoted.
- var quote = stream.current()[0];
- state._urlQuoteCharacter = quote === "'" || quote === "\"" ? quote : ")";
- state._unquotedURLString = state._urlQuoteCharacter === ")";
-
- // Rewind the steam to the start of this token.
- stream.pos = startPosition;
-
- // Eat the open quote of the string so the string style
- // will be used for the quote character.
- if (!state._unquotedURLString)
- stream.eat(state._urlQuoteCharacter);
- } else if (state._expectLink) {
- // We expected a string and didn't get one. Cleanup.
- delete state._expectLink;
- }
- }
-
- return style && (style + " m-" + (this.alternateName || this.name));
- }
-
- function extendedToken(stream, state)
- {
- // CodeMirror moves the original token function to _token when we extended it.
- // So call it to get the style that we will add an additional class name to.
- var style = this._token(stream, state);
- return style && (style + " m-" + (this.alternateName || this.name));
- }
-
- function extendedCSSRuleStartState(base)
- {
- // CodeMirror moves the original token function to _startState when we extended it.
- // So call it to get the original start state that we will modify.
- var state = this._startState(base);
-
- // Start the stack off like it has already parsed a rule. This causes everything
- // after to be parsed as properties in a rule.
- state.stack = ["rule"];
-
- return state;
- }
-
- CodeMirror.extendMode("css", {token: extendedCSSToken});
- CodeMirror.extendMode("xml", {token: extendedXMLToken});
- CodeMirror.extendMode("javascript", {token: extendedToken});
-
- CodeMirror.defineMode("css-rule", CodeMirror.modes.css);
- CodeMirror.extendMode("css-rule", {token: extendedCSSToken, startState: extendedCSSRuleStartState, alternateName: "css"});
-
- CodeMirror.defineExtension("hasLineClass", function(line, where, className) {
- // This matches the arguments to addLineClass and removeLineClass.
- var classProperty = (where === "text" ? "textClass" : (where == "background" ? "bgClass" : "wrapClass"));
- var lineInfo = this.lineInfo(line);
- if (!lineInfo)
- return false;
-
- if (!lineInfo[classProperty])
- return false;
-
- // Test for the simple case.
- if (lineInfo[classProperty] === className)
- return true;
-
- // Do a quick check for the substring. This is faster than a regex, which requires escaping the input first.
- var index = lineInfo[classProperty].indexOf(className);
- if (index === -1)
- return false;
-
- // Check that it is surrounded by spaces. Add padding spaces first to work with beginning and end of string cases.
- var paddedClass = " " + lineInfo[classProperty] + " ";
- return paddedClass.indexOf(" " + className + " ", index) !== -1;
- });
-
- CodeMirror.defineExtension("setUniqueBookmark", function(position, options) {
- var marks = this.findMarksAt(position);
- for (var i = 0; i < marks.length; ++i) {
- if (marks[i].__uniqueBookmark) {
- marks[i].clear();
- break;
- }
- }
-
- var uniqueBookmark = this.setBookmark(position, options);
- uniqueBookmark.__uniqueBookmark = true;
- return uniqueBookmark;
- });
-
- CodeMirror.defineExtension("toggleLineClass", function(line, where, className) {
- if (this.hasLineClass(line, where, className)) {
- this.removeLineClass(line, where, className);
- return false;
- }
-
- this.addLineClass(line, where, className);
- return true;
- });
-
- CodeMirror.defineExtension("alterNumberInRange", function(amount, startPosition, endPosition, updateSelection) {
- // We don't try if the range is multiline, pass to another key handler.
- if (startPosition.line !== endPosition.line)
- return false;
-
- if (updateSelection) {
- // Remember the cursor position/selection.
- var selectionStart = this.getCursor("start");
- var selectionEnd = this.getCursor("end");
- }
-
- var line = this.getLine(startPosition.line);
-
- var foundPeriod = false;
-
- var start = NaN;
- var end = NaN;
-
- for (var i = startPosition.ch; i >= 0; --i) {
- var character = line.charAt(i);
-
- if (character === ".") {
- if (foundPeriod)
- break;
- foundPeriod = true;
- } else if (character !== "-" && character !== "+" && isNaN(parseInt(character))) {
- // Found the end already, just scan backwards.
- if (i === startPosition.ch) {
- end = i;
- continue;
- }
-
- break;
- }
-
- start = i;
- }
-
- if (isNaN(end)) {
- for (var i = startPosition.ch + 1; i < line.length; ++i) {
- var character = line.charAt(i);
-
- if (character === ".") {
- if (foundPeriod) {
- end = i;
- break;
- }
-
- foundPeriod = true;
- } else if (isNaN(parseInt(character))) {
- end = i;
- break;
- }
-
- end = i + 1;
- }
- }
-
- // No number range found, pass to another key handler.
- if (isNaN(start) || isNaN(end))
- return false;
-
- var number = parseFloat(line.substring(start, end));
-
- // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
- // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
- var alteredNumber = Number((number + amount).toFixed(6));
- var alteredNumberString = alteredNumber.toString();
-
- var from = {line: startPosition.line, ch: start};
- var to = {line: startPosition.line, ch: end};
-
- this.replaceRange(alteredNumberString, from, to);
-
- if (updateSelection) {
- var previousLength = to.ch - from.ch;
- var newLength = alteredNumberString.length;
-
- // Fix up the selection so it follows the increase or decrease in the replacement length.
- if (previousLength != newLength) {
- if (selectionStart.line === from.line && selectionStart.ch > from.ch)
- selectionStart.ch += newLength - previousLength;
-
- if (selectionEnd.line === from.line && selectionEnd.ch > from.ch)
- selectionEnd.ch += newLength - previousLength;
- }
-
- this.setSelection(selectionStart, selectionEnd);
- }
-
- return true;
- });
-
- function alterNumber(amount, codeMirror)
- {
- function findNumberToken(position)
- {
- // CodeMirror includes the unit in the number token, so searching for
- // number tokens is the best way to get both the number and unit.
- var token = codeMirror.getTokenAt(position);
- if (token && token.type && /\bnumber\b/.test(token.type))
- return token;
- return null;
- }
-
- var position = codeMirror.getCursor("head");
- var token = findNumberToken(position);
-
- if (!token) {
- // If the cursor is at the outside beginning of the token, the previous
- // findNumberToken wont find it. So check the next column for a number too.
- position.ch += 1;
- token = findNumberToken(position);
- }
-
- if (!token)
- return CodeMirror.Pass;
-
- var foundNumber = codeMirror.alterNumberInRange(amount, {ch: token.start, line: position.line}, {ch: token.end, line: position.line}, true);
- if (!foundNumber)
- return CodeMirror.Pass;
- }
-
- CodeMirror.defineExtension("rectsForRange", function(range) {
- var lineRects = [];
-
- for (var line = range.start.line; line <= range.end.line; ++line) {
- var lineContent = this.getLine(line);
-
- var startChar = line === range.start.line ? range.start.ch : (lineContent.length - lineContent.trimLeft().length);
- var endChar = line === range.end.line ? range.end.ch : lineContent.length;
- var firstCharCoords = this.cursorCoords({ch: startChar, line: line});
- var endCharCoords = this.cursorCoords({ch: endChar, line: line});
-
- // Handle line wrapping.
- if (firstCharCoords.bottom !== endCharCoords.bottom) {
- var maxY = -Number.MAX_VALUE;
- for (var ch = startChar; ch <= endChar; ++ch) {
- var coords = this.cursorCoords({ch: ch, line: line});
- if (coords.bottom > maxY) {
- if (ch > startChar) {
- var maxX = Math.ceil(this.cursorCoords({ch: ch - 1, line: line}).right);
- lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
- }
- var minX = Math.floor(coords.left);
- var minY = Math.floor(coords.top)
- maxY = Math.ceil(coords.bottom);
- }
- }
- maxX = Math.ceil(coords.right);
- lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
- } else {
- var minX = Math.floor(firstCharCoords.left);
- var minY = Math.floor(firstCharCoords.top);
- var maxX = Math.ceil(endCharCoords.right);
- var maxY = Math.ceil(endCharCoords.bottom);
- lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
- }
- }
- return lineRects;
- });
-
- CodeMirror.defineExtension("createColorMarkers", function(range, callback) {
- var createdMarkers = [];
-
- var start = range instanceof WebInspector.TextRange ? range.startLine : 0;
- var end = range instanceof WebInspector.TextRange ? range.endLine + 1 : this.lineCount();
-
- // Matches rgba(0, 0, 0, 0.5), rgb(0, 0, 0), hsl(), hsla(), #fff, #ffffff, white
- const colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?![-.]))/g;
-
- for (var lineNumber = start; lineNumber < end; ++lineNumber) {
- var lineContent = this.getLine(lineNumber);
- var match = colorRegex.exec(lineContent);
- while (match) {
-
- // Act as a negative look-behind and disallow the color from being prefixing with certain characters.
- if (match.index > 0 && /[-.]/.test(lineContent[match.index - 1])) {
- match = colorRegex.exec(lineContent);
- continue;
- }
-
- var from = {line: lineNumber, ch: match.index};
- var to = {line: lineNumber, ch: match.index + match[0].length};
-
- var foundColorMarker = false;
- var markers = this.findMarksAt(to);
- for (var j = 0; j < markers.length; ++j) {
- if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(markers[j]).type === WebInspector.TextMarker.Type.Color) {
- foundColorMarker = true;
- break;
- }
- }
-
- if (foundColorMarker) {
- match = colorRegex.exec(lineContent);
- continue;
- }
-
- // We're not interested in text within a CSS selector.
- var tokenType = this.getTokenTypeAt(from);
- if (tokenType && (tokenType.indexOf("builtin") !== -1 || tokenType.indexOf("tag") !== -1)) {
- match = colorRegex.exec(lineContent);
- continue;
- }
-
- var colorString = match[0];
- var color = WebInspector.Color.fromString(colorString);
- if (!color) {
- match = colorRegex.exec(lineContent);
- continue;
- }
-
- var marker = this.markText(from, to);
- marker = new WebInspector.TextMarker(marker, WebInspector.TextMarker.Type.Color);
-
- createdMarkers.push(marker);
-
- if (callback)
- callback(marker, color, colorString);
-
- match = colorRegex.exec(lineContent);
- }
- }
-
- return createdMarkers;
- });
-
- CodeMirror.defineExtension("createGradientMarkers", function(range, callback) {
- var createdMarkers = [];
-
- var start = range instanceof WebInspector.TextRange ? range.startLine : 0;
- var end = range instanceof WebInspector.TextRange ? range.endLine + 1 : this.lineCount();
-
- const gradientRegex = /(repeating-)?(linear|radial)-gradient\s*\(\s*/g;
-
- for (var lineNumber = start; lineNumber < end; ++lineNumber) {
- var lineContent = this.getLine(lineNumber);
- var match = gradientRegex.exec(lineContent);
- while (match) {
- var startLine = lineNumber;
- var startChar = match.index;
- var endChar = match.index + match[0].length;
-
- var openParentheses = 0;
- while (c = lineContent[endChar]) {
- if (c === "(")
- openParentheses++;
- if (c === ")")
- openParentheses--;
-
- if (openParentheses === -1) {
- endChar++;
- break;
- }
-
- endChar++;
- if (endChar >= lineContent.length) {
- lineNumber++;
- endChar = 0;
- lineContent = this.getLine(lineNumber);
- if (!lineContent)
- break;
- }
- }
-
- if (openParentheses !== -1) {
- match = gradientRegex.exec(lineContent);
- continue;
- }
-
- var from = {line: startLine, ch: startChar};
- var to = {line: lineNumber, ch: endChar};
-
- var gradientString = this.getRange(from, to);
- var gradient = WebInspector.Gradient.fromString(gradientString);
- if (!gradient) {
- match = gradientRegex.exec(lineContent);
- continue;
- }
-
- var marker = new WebInspector.TextMarker(this.markText(from, to), WebInspector.TextMarker.Type.Gradient);
-
- createdMarkers.push(marker);
-
- if (callback)
- callback(marker, gradient, gradientString);
-
- match = gradientRegex.exec(lineContent);
- }
- }
-
- return createdMarkers;
- });
-
- function ignoreKey(codeMirror)
- {
- // Do nothing to ignore the key.
- }
-
- CodeMirror.keyMap["default"] = {
- "Alt-Up": alterNumber.bind(null, 1),
- "Ctrl-Alt-Up": alterNumber.bind(null, 0.1),
- "Shift-Alt-Up": alterNumber.bind(null, 10),
- "Alt-PageUp": alterNumber.bind(null, 10),
- "Shift-Alt-PageUp": alterNumber.bind(null, 100),
- "Alt-Down": alterNumber.bind(null, -1),
- "Ctrl-Alt-Down": alterNumber.bind(null, -0.1),
- "Shift-Alt-Down": alterNumber.bind(null, -10),
- "Alt-PageDown": alterNumber.bind(null, -10),
- "Shift-Alt-PageDown": alterNumber.bind(null, -100),
- "Cmd-/": "toggleComment",
- "Shift-Tab": ignoreKey,
- fallthrough: "macDefault"
- };
-
- // Register some extra MIME-types for CodeMirror. These are in addition to the
- // ones CodeMirror already registers, like text/html, text/javascript, etc.
- const extraXMLTypes = ["text/xml", "text/xsl"];
- extraXMLTypes.forEach(function(type) {
- CodeMirror.defineMIME(type, "xml");
- });
-
- const extraHTMLTypes = ["application/xhtml+xml", "image/svg+xml"];
- extraHTMLTypes.forEach(function(type) {
- CodeMirror.defineMIME(type, "htmlmixed");
- });
-
- const extraJavaScriptTypes = ["text/ecmascript", "application/javascript", "application/ecmascript", "application/x-javascript",
- "text/x-javascript", "text/javascript1.1", "text/javascript1.2", "text/javascript1.3", "text/jscript", "text/livescript"];
- extraJavaScriptTypes.forEach(function(type) {
- CodeMirror.defineMIME(type, "javascript");
- });
-
- const extraJSONTypes = ["application/x-json", "text/x-json"];
- extraJSONTypes.forEach(function(type) {
- CodeMirror.defineMIME(type, {name: "javascript", json: true});
- });
-
-})();
-
-WebInspector.compareCodeMirrorPositions = function(a, b)
-{
- var lineCompare = a.line - b.line;
- if (lineCompare !== 0)
- return lineCompare;
-
- var aColumn = "ch" in a ? a.ch : Number.MAX_VALUE;
- var bColumn = "ch" in b ? b.ch : Number.MAX_VALUE;
- return aColumn - bColumn;
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorColorEditingControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorColorEditingController = function(codeMirror, marker)
-{
- WebInspector.CodeMirrorEditingController.call(this, codeMirror, marker);
-}
-
-WebInspector.CodeMirrorColorEditingController.prototype = {
- constructor: WebInspector.CodeMirrorColorEditingController,
- __proto__: WebInspector.CodeMirrorEditingController.prototype,
-
- // Public
-
- get initialValue()
- {
- return WebInspector.Color.fromString(this.text);
- },
-
- get cssClassName()
- {
- return "color";
- },
-
- popoverWillPresent: function(popover)
- {
- this._colorPicker = new WebInspector.ColorPicker;
- this._colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, this._colorPickerColorChanged, this);
- popover.content = this._colorPicker.element;
- },
-
- popoverDidPresent: function(popover)
- {
- this._colorPicker.color = this._value;
- },
-
- // Private
-
- _colorPickerColorChanged: function(event)
- {
- this.value = event.target.color;
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.CodeMirror .CodeMirror-lines .completion-hint {
- opacity: 0.4;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,824 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorCompletionController = function(codeMirror, delegate, stopCharactersRegex)
-{
- WebInspector.Object.call(this);
-
- console.assert(codeMirror);
-
- this._codeMirror = codeMirror;
- this._stopCharactersRegex = stopCharactersRegex || null;
- this._delegate = delegate || null;
-
- this._startOffset = NaN;
- this._endOffset = NaN;
- this._lineNumber = NaN;
- this._prefix = "";
- this._completions = [];
- this._extendedCompletionProviders = {};
-
- this._suggestionsView = new WebInspector.CompletionSuggestionsView(this);
-
- this._keyMap = {
- "Up": this._handleUpKey.bind(this),
- "Down": this._handleDownKey.bind(this),
- "Right": this._handleRightOrEnterKey.bind(this),
- "Esc": this._handleEscapeKey.bind(this),
- "Enter": this._handleRightOrEnterKey.bind(this),
- "Tab": this._handleTabKey.bind(this),
- "Cmd-A": this._handleHideKey.bind(this),
- "Cmd-Z": this._handleHideKey.bind(this),
- "Shift-Cmd-Z": this._handleHideKey.bind(this),
- "Cmd-Y": this._handleHideKey.bind(this)
- };
-
- this._handleChangeListener = this._handleChange.bind(this);
- this._handleCursorActivityListener = this._handleCursorActivity.bind(this);
- this._handleHideActionListener = this._handleHideAction.bind(this);
-
- this._codeMirror.addKeyMap(this._keyMap);
-
- this._codeMirror.on("change", this._handleChangeListener);
- this._codeMirror.on("cursorActivity", this._handleCursorActivityListener);
- this._codeMirror.on("blur", this._handleHideActionListener);
- this._codeMirror.on("scroll", this._handleHideActionListener);
-};
-
-WebInspector.CodeMirrorCompletionController.GenericStopCharactersRegex = /[\s=:;,]/;
-WebInspector.CodeMirrorCompletionController.DefaultStopCharactersRegexModeMap = {"css": /[\s:;,{}()]/, "javascript": /[\s=:;,!+\-*/%&|^~?<>.{}()[\]]/};
-WebInspector.CodeMirrorCompletionController.BaseExpressionStopCharactersRegexModeMap = {"javascript": /[\s=:;,!+\-*/%&|^~?<>]/};
-WebInspector.CodeMirrorCompletionController.OpenBracketCharactersRegex = /[({[]/;
-WebInspector.CodeMirrorCompletionController.CloseBracketCharactersRegex = /[)}\]]/;
-WebInspector.CodeMirrorCompletionController.MatchingBrackets = {"{": "}", "(": ")", "[": "]", "}": "{", ")": "(", "]": "["};
-WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName = "completion-hint";
-WebInspector.CodeMirrorCompletionController.CompletionsHiddenDelay = 250;
-WebInspector.CodeMirrorCompletionController.CompletionTypingDelay = 250;
-WebInspector.CodeMirrorCompletionController.CompletionOrigin = "+completion";
-WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin = "+delete-completion";
-
-WebInspector.CodeMirrorCompletionController.prototype = {
- constructor: WebInspector.CodeMirrorCompletionController,
-
- // Public
-
- get delegate()
- {
- return this._delegate;
- },
-
- addExtendedCompletionProvider: function(modeName, provider)
- {
- this._extendedCompletionProviders[modeName] = provider;
- },
-
- updateCompletions: function(completions, implicitSuffix)
- {
- if (isNaN(this._startOffset) || isNaN(this._endOffset) || isNaN(this._lineNumber))
- return;
-
- if (!completions || !completions.length) {
- this.hideCompletions();
- return;
- }
-
- this._completions = completions;
-
- if (typeof implicitSuffix === "string")
- this._implicitSuffix = implicitSuffix;
-
- var from = {line: this._lineNumber, ch: this._startOffset};
- var to = {line: this._lineNumber, ch: this._endOffset};
-
- var firstCharCoords = this._codeMirror.cursorCoords(from);
- var lastCharCoords = this._codeMirror.cursorCoords(to);
- var bounds = new WebInspector.Rect(firstCharCoords.left, firstCharCoords.top, lastCharCoords.right - firstCharCoords.left, firstCharCoords.bottom - firstCharCoords.top);
-
- // Try to restore the previous selected index, otherwise just select the first.
- var index = this._currentCompletion ? completions.indexOf(this._currentCompletion) : 0;
- if (index === -1)
- index = 0;
-
- if (this._forced || completions.length > 1 || completions[index] !== this._prefix) {
- // Update and show the suggestion list.
- this._suggestionsView.update(completions, index);
- this._suggestionsView.show(bounds);
- } else if (this._implicitSuffix) {
- // The prefix and the completion exactly match, but there is an implicit suffix.
- // Just hide the suggestion list and keep the completion hint for the implicit suffix.
- this._suggestionsView.hide();
- } else {
- // The prefix and the completion exactly match, hide the completions. Return early so
- // the completion hint isn't updated.
- this.hideCompletions();
- return;
- }
-
- this._applyCompletionHint(completions[index]);
- },
-
- isCompletionChange: function(change)
- {
- return this._ignoreChange || change.origin === WebInspector.CodeMirrorCompletionController.CompletionOrigin || change.origin === WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin;
- },
-
- isShowingCompletions: function()
- {
- return this._suggestionsView.visible || (this._completionHintMarker && this._completionHintMarker.find());
- },
-
- isHandlingClickEvent: function()
- {
- return this._suggestionsView.isHandlingClickEvent();
- },
-
- hideCompletions: function()
- {
- this._suggestionsView.hide();
-
- this._removeCompletionHint();
-
- this._startOffset = NaN;
- this._endOffset = NaN;
- this._lineNumber = NaN;
- this._prefix = "";
- this._completions = [];
- this._implicitSuffix = "";
- this._forced = false;
-
- if (this._completionDelayTimeout) {
- clearTimeout(this._completionDelayTimeout);
- delete this._completionDelayTimeout;
- }
-
- delete this._currentCompletion;
- delete this._ignoreNextCursorActivity;
- },
-
- close: function()
- {
- this._codeMirror.removeKeyMap(this._keyMap);
-
- this._codeMirror.off("change", this._handleChangeListener);
- this._codeMirror.off("cursorActivity", this._handleCursorActivityListener);
- this._codeMirror.off("blur", this._handleHideActionListener);
- this._codeMirror.off("scroll", this._handleHideActionListener);
- },
-
- // Protected
-
- completionSuggestionsSelectedCompletion: function(suggestionsView, completionText)
- {
- this._applyCompletionHint(completionText);
- },
-
- completionSuggestionsClickedCompletion: function(suggestionsView, completionText)
- {
- // The clicked suggestion causes the editor to loose focus. Restore it so the user can keep typing.
- this._codeMirror.focus();
-
- this._applyCompletionHint(completionText);
- this._commitCompletionHint();
- },
-
- // Private
-
- get _currentReplacementText()
- {
- return this._currentCompletion + this._implicitSuffix;
- },
-
- _hasPendingCompletion: function()
- {
- return !isNaN(this._startOffset) && !isNaN(this._endOffset) && !isNaN(this._lineNumber);
- },
-
- _notifyCompletionsHiddenSoon: function()
- {
- function notify()
- {
- if (this._completionHintMarker)
- return;
-
- if (this._delegate && typeof this._delegate.completionControllerCompletionsHidden === "function")
- this._delegate.completionControllerCompletionsHidden(this);
- }
-
- if (this._notifyCompletionsHiddenIfNeededTimeout)
- clearTimeout(this._notifyCompletionsHiddenIfNeededTimeout);
- this._notifyCompletionsHiddenIfNeededTimeout = setTimeout(notify.bind(this), WebInspector.CodeMirrorCompletionController.CompletionsHiddenDelay);
- },
-
- _applyCompletionHint: function(completionText)
- {
- console.assert(completionText);
- if (!completionText)
- return;
-
- function update()
- {
- this._currentCompletion = completionText;
-
- this._removeCompletionHint(true, true);
-
- var replacementText = this._currentReplacementText;
-
- var from = {line: this._lineNumber, ch: this._startOffset};
- var cursor = {line: this._lineNumber, ch: this._endOffset};
- var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
-
- this._codeMirror.replaceRange(replacementText, from, cursor, WebInspector.CodeMirrorCompletionController.CompletionOrigin);
- this._removeLastChangeFromHistory();
-
- this._codeMirror.setCursor(cursor);
-
- if (cursor.ch !== to.ch)
- this._completionHintMarker = this._codeMirror.markText(cursor, to, {className: WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName});
- }
-
- this._ignoreChange = true;
- this._ignoreNextCursorActivity = true;
-
- this._codeMirror.operation(update.bind(this));
-
- delete this._ignoreChange;
- },
-
- _commitCompletionHint: function()
- {
- function update()
- {
- this._removeCompletionHint(true, true);
-
- var replacementText = this._currentReplacementText;
-
- var from = {line: this._lineNumber, ch: this._startOffset};
- var cursor = {line: this._lineNumber, ch: this._endOffset};
- var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
-
- var lastChar = this._currentCompletion.charAt(this._currentCompletion.length - 1);
- var isClosing = ")]}".indexOf(lastChar);
- if (isClosing !== -1)
- to.ch -= 1 + this._implicitSuffix.length;
-
- this._codeMirror.replaceRange(replacementText, from, cursor, WebInspector.CodeMirrorCompletionController.CompletionOrigin);
-
- // Don't call _removeLastChangeFromHistory here to allow the committed completion to be undone.
-
- this._codeMirror.setCursor(to);
-
- this.hideCompletions();
- }
-
- this._ignoreChange = true;
- this._ignoreNextCursorActivity = true;
-
- this._codeMirror.operation(update.bind(this));
-
- delete this._ignoreChange;
- },
-
- _removeLastChangeFromHistory: function()
- {
- var history = this._codeMirror.getHistory();
-
- // We don't expect a undone history. But if there is one clear it. If could lead to undefined behavior.
- console.assert(!history.undone.length);
- history.undone = [];
-
- // Pop the last item from the done history.
- console.assert(history.done.length);
- history.done.pop();
-
- this._codeMirror.setHistory(history);
- },
-
- _removeCompletionHint: function(nonatomic, dontRestorePrefix)
- {
- if (!this._completionHintMarker)
- return;
-
- this._notifyCompletionsHiddenSoon();
-
- function update()
- {
- var range = this._completionHintMarker.find();
- if (range) {
- this._completionHintMarker.clear();
-
- this._codeMirror.replaceRange("", range.from, range.to, WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin);
- this._removeLastChangeFromHistory();
- }
-
- this._completionHintMarker = null;
-
- if (dontRestorePrefix)
- return;
-
- console.assert(!isNaN(this._startOffset));
- console.assert(!isNaN(this._endOffset));
- console.assert(!isNaN(this._lineNumber));
-
- var from = {line: this._lineNumber, ch: this._startOffset};
- var to = {line: this._lineNumber, ch: this._endOffset};
-
- this._codeMirror.replaceRange(this._prefix, from, to, WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin);
- this._removeLastChangeFromHistory();
- }
-
- if (nonatomic) {
- update.call(this);
- return;
- }
-
- this._ignoreChange = true;
-
- this._codeMirror.operation(update.bind(this));
-
- delete this._ignoreChange;
- },
-
- _scanStringForExpression: function(modeName, string, startOffset, direction, allowMiddleAndEmpty, includeStopCharacter, ignoreInitialUnmatchedOpenBracket, stopCharactersRegex)
- {
- console.assert(direction === -1 || direction === 1);
-
- var stopCharactersRegex = stopCharactersRegex || this._stopCharactersRegex || WebInspector.CodeMirrorCompletionController.DefaultStopCharactersRegexModeMap[modeName] || WebInspector.CodeMirrorCompletionController.GenericStopCharactersRegex;
-
- function isStopCharacter(character)
- {
- return stopCharactersRegex.test(character);
- }
-
- function isOpenBracketCharacter(character)
- {
- return WebInspector.CodeMirrorCompletionController.OpenBracketCharactersRegex.test(character);
- }
-
- function isCloseBracketCharacter(character)
- {
- return WebInspector.CodeMirrorCompletionController.CloseBracketCharactersRegex.test(character);
- }
-
- function matchingBracketCharacter(character)
- {
- return WebInspector.CodeMirrorCompletionController.MatchingBrackets[character];
- }
-
- var endOffset = Math.min(startOffset, string.length);
-
- var endOfLineOrWord = endOffset === string.length || isStopCharacter(string.charAt(endOffset));
-
- if (!endOfLineOrWord && !allowMiddleAndEmpty)
- return null;
-
- var bracketStack = [];
- var bracketOffsetStack = [];
- var lastCloseBracketOffset = NaN;
-
- var startOffset = endOffset;
- var firstOffset = endOffset + direction;
- for (var i = firstOffset; direction > 0 ? i < string.length : i >= 0; i += direction) {
- var character = string.charAt(i);
-
- // Ignore stop characters when we are inside brackets.
- if (isStopCharacter(character) && !bracketStack.length)
- break;
-
- if (isCloseBracketCharacter(character)) {
- bracketStack.push(character);
- bracketOffsetStack.push(i);
- } else if (isOpenBracketCharacter(character)) {
- if ((!ignoreInitialUnmatchedOpenBracket || i !== firstOffset) && (!bracketStack.length || matchingBracketCharacter(character) !== bracketStack.lastValue))
- break;
-
- bracketOffsetStack.pop();
- bracketStack.pop();
- }
-
- startOffset = i + (direction > 0 ? 1 : 0);
- }
-
- if (bracketOffsetStack.length)
- startOffset = bracketOffsetStack.pop() + 1;
-
- if (includeStopCharacter && startOffset > 0 && startOffset < string.length)
- startOffset += direction;
-
- if (direction > 0) {
- var tempEndOffset = endOffset;
- endOffset = startOffset;
- startOffset = tempEndOffset;
- }
-
- return {string: string.substring(startOffset, endOffset), startOffset: startOffset, endOffset: endOffset};
- },
-
- _completeAtCurrentPosition: function(force)
- {
- if (this._codeMirror.somethingSelected()) {
- this.hideCompletions();
- return;
- }
-
- if (this._completionDelayTimeout) {
- clearTimeout(this._completionDelayTimeout);
- delete this._completionDelayTimeout;
- }
-
- this._removeCompletionHint(true, true);
-
- var cursor = this._codeMirror.getCursor();
- var token = this._codeMirror.getTokenAt(cursor);
-
- // Don't try to complete inside comments.
- if (token.type && /\bcomment\b/.test(token.type)) {
- this.hideCompletions();
- return;
- }
-
- var mode = this._codeMirror.getMode();
- var innerMode = CodeMirror.innerMode(mode, token.state).mode;
- var modeName = innerMode.alternateName || innerMode.name;
-
- var lineNumber = cursor.line;
- var lineString = this._codeMirror.getLine(lineNumber);
-
- var backwardScanResult = this._scanStringForExpression(modeName, lineString, cursor.ch, -1, force);
- if (!backwardScanResult) {
- this.hideCompletions();
- return;
- }
-
- var forwardScanResult = this._scanStringForExpression(modeName, lineString, cursor.ch, 1, true, true);
- var suffix = forwardScanResult.string;
-
- this._ignoreNextCursorActivity = true;
-
- this._startOffset = backwardScanResult.startOffset;
- this._endOffset = backwardScanResult.endOffset;
- this._lineNumber = lineNumber;
- this._prefix = backwardScanResult.string;
- this._completions = [];
- this._implicitSuffix = "";
- this._forced = force;
-
- var baseExpressionStopCharactersRegex = WebInspector.CodeMirrorCompletionController.BaseExpressionStopCharactersRegexModeMap[modeName];
- if (baseExpressionStopCharactersRegex)
- var baseScanResult = this._scanStringForExpression(modeName, lineString, this._startOffset, -1, true, false, true, baseExpressionStopCharactersRegex);
-
- if (!force && !backwardScanResult.string && (!baseScanResult || !baseScanResult.string)) {
- this.hideCompletions();
- return;
- }
-
- var defaultCompletions = [];
-
- switch (modeName) {
- case "css":
- defaultCompletions = this._generateCSSCompletions(token, baseScanResult ? baseScanResult.string : null, suffix);
- break;
- case "javascript":
- defaultCompletions = this._generateJavaScriptCompletions(token, baseScanResult ? baseScanResult.string : null, suffix);
- break;
- }
-
- var extendedCompletionsProvider = this._extendedCompletionProviders[modeName];
- if (extendedCompletionsProvider) {
- extendedCompletionsProvider.completionControllerCompletionsNeeded(this, defaultCompletions, baseScanResult ? baseScanResult.string : null, this._prefix, suffix, force);
- return;
- }
-
- if (this._delegate && typeof this._delegate.completionControllerCompletionsNeeded === "function")
- this._delegate.completionControllerCompletionsNeeded(this, this._prefix, defaultCompletions, baseScanResult ? baseScanResult.string : null, suffix, force);
- else
- this.updateCompletions(defaultCompletions);
- },
-
- _generateCSSCompletions: function(mainToken, base, suffix)
- {
- // We only support completion inside CSS rules.
- if (!mainToken.state || !mainToken.state.stack || !mainToken.state.stack.contains("rule"))
- return [];
-
- var token = mainToken;
- var lineNumber = this._lineNumber;
-
- // Scan backwards looking for the current property.
- while (token.state.stack.lastValue === "propertyValue") {
- // Found the beginning of the line. Go to the previous line.
- if (!token.start) {
- --lineNumber;
-
- // No more lines, stop.
- if (lineNumber < 0)
- break;
- }
-
- // Get the previous token.
- token = this._codeMirror.getTokenAt({line: lineNumber, ch: token.start ? token.start : Number.MAX_VALUE});
- }
-
- // If we have a property token and it's not the main token, then we are working on
- // the value for that property and should complete allowed values.
- if (mainToken !== token && token.type && /\bproperty\b/.test(token.type)) {
- var propertyName = token.string;
-
- // If there is a suffix and it isn't a semicolon, then we should use a space since
- // the user is editing in the middle.
- this._implicitSuffix = suffix && suffix !== ";" ? " " : ";";
-
- // Don't use an implicit suffix if it would be the same as the existing suffix.
- if (this._implicitSuffix === suffix)
- this._implicitSuffix = "";
-
- return WebInspector.CSSKeywordCompletions.forProperty(propertyName).startsWith(this._prefix);
- }
-
- this._implicitSuffix = suffix !== ":" ? ": " : "";
-
- // Complete property names.
- return WebInspector.CSSCompletions.cssNameCompletions.startsWith(this._prefix);
- },
-
- _generateJavaScriptCompletions: function(mainToken, base, suffix)
- {
- // If there is a base expression then we should not attempt to match any keywords or variables.
- // Allow only open bracket characters at the end of the base, otherwise leave completions with
- // a base up to the delegate to figure out.
- if (base && !/[({[]$/.test(base))
- return [];
-
- var matchingWords = [];
-
- const prefix = this._prefix;
-
- const declaringVariable = mainToken.state.lexical.type === "vardef";
- const insideSwitch = mainToken.state.lexical.prev ? mainToken.state.lexical.prev.info === "switch" : false;
- const insideBlock = mainToken.state.lexical.prev ? mainToken.state.lexical.prev.type === "}" : false;
- const insideParenthesis = mainToken.state.lexical.type === ")";
- const insideBrackets = mainToken.state.lexical.type === "]";
-
- const allKeywords = ["break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "false", "finally", "for", "function", "if", "in",
- "Infinity", "instanceof", "NaN", "new", "null", "return", "switch", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with"];
- const valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined"];
-
- const allowedKeywordsInsideBlocks = allKeywords.keySet();
- const allowedKeywordsWhenDeclaringVariable = valueKeywords.keySet();
- const allowedKeywordsInsideParenthesis = valueKeywords.concat(["function"]).keySet();
- const allowedKeywordsInsideBrackets = allowedKeywordsInsideParenthesis;
- const allowedKeywordsOnlyInsideSwitch = ["case", "default"].keySet();
-
- function matchKeywords(keywords)
- {
- matchingWords = matchingWords.concat(keywords.filter(function(word) {
- if (!insideSwitch && word in allowedKeywordsOnlyInsideSwitch)
- return false;
- if (insideBlock && !(word in allowedKeywordsInsideBlocks))
- return false;
- if (insideBrackets && !(word in allowedKeywordsInsideBrackets))
- return false;
- if (insideParenthesis && !(word in allowedKeywordsInsideParenthesis))
- return false;
- if (declaringVariable && !(word in allowedKeywordsWhenDeclaringVariable))
- return false;
- return word.startsWith(prefix);
- }));
- }
-
- function matchVariables()
- {
- function filterVariables(variables)
- {
- for (var variable = variables; variable; variable = variable.next) {
- // Don't match the variable if this token is in a variable declaration.
- // Otherwise the currently typed text will always match and that isn't useful.
- if (declaringVariable && variable.name === prefix)
- continue;
-
- if (variable.name.startsWith(prefix) && !matchingWords.contains(variable.name))
- matchingWords.push(variable.name);
- }
- }
-
- var context = mainToken.state.context;
- while (context) {
- filterVariables(context.vars);
- context = context.prev;
- }
-
- filterVariables(mainToken.state.globalVars);
- }
-
- switch (suffix.substring(0, 1)) {
- case "":
- case " ":
- matchVariables();
- matchKeywords(allKeywords);
- break;
-
- case ".":
- case "[":
- matchVariables();
- matchKeywords(["false", "Infinity", "NaN", "this", "true"]);
- break;
-
- case "(":
- matchVariables();
- matchKeywords(["catch", "else", "for", "function", "if", "return", "switch", "throw", "while", "with"]);
- break;
-
- case "{":
- matchKeywords(["do", "else", "finally", "return", "try"]);
- break;
-
- case ":":
- if (insideSwitch)
- matchKeywords(["case", "default"]);
- break;
-
- case ";":
- matchVariables();
- matchKeywords(valueKeywords);
- matchKeywords(["break", "continue", "debugger", "return", "void"]);
- break;
- }
-
- return matchingWords;
- },
-
- _handleUpKey: function(codeMirror)
- {
- if (!this._hasPendingCompletion())
- return CodeMirror.Pass;
-
- if (!this.isShowingCompletions())
- return;
-
- this._suggestionsView.selectPrevious();
- },
-
- _handleDownKey: function(codeMirror)
- {
- if (!this._hasPendingCompletion())
- return CodeMirror.Pass;
-
- if (!this.isShowingCompletions())
- return;
-
- this._suggestionsView.selectNext();
- },
-
- _handleRightOrEnterKey: function(codeMirror)
- {
- if (!this._hasPendingCompletion())
- return CodeMirror.Pass;
-
- if (!this.isShowingCompletions())
- return;
-
- this._commitCompletionHint();
- },
-
- _handleEscapeKey: function(codeMirror)
- {
- var delegateImplementsShouldAllowEscapeCompletion = this._delegate && typeof this._delegate.completionControllerShouldAllowEscapeCompletion === "function";
- if (this._hasPendingCompletion())
- this.hideCompletions();
- else if (this._codeMirror.getOption("readOnly"))
- return CodeMirror.Pass;
- else if (!delegateImplementsShouldAllowEscapeCompletion || this._delegate.completionControllerShouldAllowEscapeCompletion(this))
- this._completeAtCurrentPosition(true);
- else
- return CodeMirror.Pass;
- },
-
- _handleTabKey: function(codeMirror)
- {
- if (!this._hasPendingCompletion())
- return CodeMirror.Pass;
-
- if (!this.isShowingCompletions())
- return;
-
- console.assert(this._completions.length);
- if (!this._completions.length)
- return;
-
- console.assert(this._currentCompletion);
- if (!this._currentCompletion)
- return;
-
- // Commit the current completion if there is only one suggestion.
- if (this._completions.length === 1) {
- this._commitCompletionHint();
- return;
- }
-
- var prefixLength = this._prefix.length;
-
- var commonPrefix = this._completions[0];
- for (var i = 1; i < this._completions.length; ++i) {
- var completion = this._completions[i];
- var lastIndex = Math.min(commonPrefix.length, completion.length);
- for (var j = prefixLength; j < lastIndex; ++j) {
- if (commonPrefix[j] !== completion[j]) {
- commonPrefix = commonPrefix.substr(0, j);
- break;
- }
- }
- }
-
- // Commit the current completion if there is no common prefix that is longer.
- if (commonPrefix === this._prefix) {
- this._commitCompletionHint();
- return;
- }
-
- // Set the prefix to the common prefix so _applyCompletionHint will insert the
- // common prefix as commited text. Adjust _endOffset to match the new prefix.
- this._prefix = commonPrefix;
- this._endOffset = this._startOffset + commonPrefix.length;
-
- this._applyCompletionHint(this._currentCompletion);
- },
-
- _handleChange: function(codeMirror, change)
- {
- if (this.isCompletionChange(change))
- return;
-
- this._ignoreNextCursorActivity = true;
-
- if (!change.origin || change.origin.charAt(0) !== "+") {
- this.hideCompletions();
- return;
- }
-
- // Only complete on delete if we are showing completions already.
- if (change.origin === "+delete" && !this._hasPendingCompletion())
- return;
-
- if (this._completionDelayTimeout) {
- clearTimeout(this._completionDelayTimeout);
- delete this._completionDelayTimeout;
- }
-
- if (this._hasPendingCompletion())
- this._completeAtCurrentPosition(false);
- else
- this._completionDelayTimeout = setTimeout(this._completeAtCurrentPosition.bind(this, false), WebInspector.CodeMirrorCompletionController.CompletionTypingDelay);
- },
-
- _handleCursorActivity: function(codeMirror)
- {
- if (this._ignoreChange)
- return;
-
- if (this._ignoreNextCursorActivity) {
- delete this._ignoreNextCursorActivity;
- return;
- }
-
- this.hideCompletions();
- },
-
- _handleHideKey: function(codeMirror)
- {
- this.hideCompletions();
-
- return CodeMirror.Pass;
- },
-
- _handleHideAction: function(codeMirror)
- {
- // Clicking a suggestion causes the editor to blur. We don't want to hide completions in this case.
- if (this.isHandlingClickEvent())
- return;
-
- this.hideCompletions();
- }
-};
-
-WebInspector.CodeMirrorCompletionController.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.CodeMirror.drag-to-adjust .CodeMirror-lines {
- cursor: col-resize;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorDragToAdjustNumberController = function(codeMirror)
-{
- this._codeMirror = codeMirror;
-
- this._dragToAdjustController = new WebInspector.DragToAdjustController(this);
-};
-
-WebInspector.CodeMirrorDragToAdjustNumberController.prototype = {
- constructor: WebInspector.CodeMirrorDragToAdjustNumberController,
-
- // Public
-
- get enabled()
- {
- return this._dragToAdjustController.enabled;
- },
-
- set enabled(enabled)
- {
- if (this.enabled === enabled)
- return;
-
- this._dragToAdjustController.element = this._codeMirror.getWrapperElement();
- this._dragToAdjustController.enabled = enabled;
- },
-
- // Protected
-
- dragToAdjustControllerActiveStateChanged: function(dragToAdjustController)
- {
- if (!dragToAdjustController.active)
- this._hoveredTokenInfo = null;
- },
-
- dragToAdjustControllerCanBeActivated: function(dragToAdjustController)
- {
- return !this._codeMirror.getOption("readOnly");
- },
-
- dragToAdjustControllerCanBeAdjusted: function(dragToAdjustController)
- {
-
- return this._hoveredTokenInfo && this._hoveredTokenInfo.containsNumber;
- },
-
- dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
- {
- this._codeMirror.alterNumberInRange(amount, this._hoveredTokenInfo.startPosition, this._hoveredTokenInfo.endPosition, false);
- },
-
- dragToAdjustControllerDidReset: function(dragToAdjustController)
- {
- this._hoveredTokenInfo = null;
- },
-
- dragToAdjustControllerCanAdjustObjectAtPoint: function(dragToAdjustController, point)
- {
- var position = this._codeMirror.coordsChar({left: point.x, top: point.y});
- var token = this._codeMirror.getTokenAt(position);
-
- if (!token || !token.type || !token.string) {
- if (this._hoveredTokenInfo)
- dragToAdjustController.reset();
- return false;
- }
-
- // Stop right here if we're hovering the same token as we were last time.
- if (this._hoveredTokenInfo && this._hoveredTokenInfo.line === position.line &&
- this._hoveredTokenInfo.token.start === token.start && this._hoveredTokenInfo.token.end === token.end)
- return this._hoveredTokenInfo.token.type.indexOf("number") !== -1;
-
- var containsNumber = token.type.indexOf("number") !== -1;
- this._hoveredTokenInfo = {
- token: token,
- line: position.line,
- containsNumber: containsNumber,
- startPosition: {
- ch: token.start,
- line: position.line
- },
- endPosition: {
- ch: token.end,
- line: position.line
- }
- };
-
- return containsNumber;
- }
-};
-
-CodeMirror.defineOption("dragToAdjustNumbers", true, function(codeMirror, value, oldValue) {
- if (!codeMirror.dragToAdjustNumberController)
- codeMirror.dragToAdjustNumberController = new WebInspector.CodeMirrorDragToAdjustNumberController(codeMirror);
- codeMirror.dragToAdjustNumberController.enabled = value;
-});
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorEditingControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorEditingController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorEditingController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,190 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorEditingController = function(codeMirror, marker)
-{
- WebInspector.Object.call(this);
-
- this._codeMirror = codeMirror;
- this._marker = marker;
- this._delegate = null;
-
- this._range = marker.range;
-
- // The value must support .toString() and .copy() methods.
- this._value = this.initialValue;
-
- this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
-}
-
-WebInspector.CodeMirrorEditingController.prototype = {
- constructor: WebInspector.CodeMirrorEditingController,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get marker()
- {
- return this._marker;
- },
-
- get range()
- {
- return this._range;
- },
-
- get value()
- {
- return this._value;
- },
-
- set value(value)
- {
- this.text = value.toString();
- this._value = value;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(delegate)
- {
- this._delegate = delegate;
- },
-
- get text()
- {
- var from = {line: this._range.startLine, ch: this._range.startColumn};
- var to = {line: this._range.endLine, ch: this._range.endColumn};
- return this._codeMirror.getRange(from, to);
- },
-
- set text(text)
- {
- var from = {line: this._range.startLine, ch: this._range.startColumn};
- var to = {line: this._range.endLine, ch: this._range.endColumn};
- this._codeMirror.replaceRange(text, from, to);
-
- var lines = text.split("\n");
- var endLine = this._range.startLine + lines.length - 1;
- var endColumn = lines.length > 1 ? lines.lastValue.length : this._range.startColumn + text.length;
- this._range = new WebInspector.TextRange(this._range.startLine, this._range.startColumn, endLine, endColumn);
- },
-
- get initialValue()
- {
- // Implemented by subclasses.
- return this.text;
- },
-
- get cssClassName()
- {
- // Implemented by subclasses.
- return "";
- },
-
- get popover()
- {
- return this._popover;
- },
-
- get popoverPreferredEdges()
- {
- // Best to display the popover to the left or above the edited range since its end position may change, but not its start
- // position. This way we minimize the chances of overlaying the edited range as it changes.
- return [WebInspector.RectEdge.MIN_X, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X];
- },
-
- popoverTargetFrameWithRects: function(rects)
- {
- return WebInspector.Rect.unionOfRects(rects);
- },
-
- presentHoverMenu: function()
- {
- this._hoverMenu = new WebInspector.HoverMenu(this);
- this._hoverMenu.element.classList.add(this.cssClassName);
- this._rects = this._marker.rects;
- this._hoverMenu.present(this._rects);
- },
-
- dismissHoverMenu: function(discrete)
- {
- this._hoverMenu.dismiss(discrete);
- },
-
- popoverWillPresent: function(popover)
- {
- // Implemented by subclasses.
- },
-
- popoverDidPresent: function(popover)
- {
- // Implemented by subclasses.
- },
-
- // Protected
-
- handleKeydownEvent: function(event)
- {
- if (!this._keyboardShortcutEsc.matchesEvent(event) || !this._popover.visible)
- return false;
-
- this.value = this._originalValue;
- this._popover.dismiss();
-
- return true;
- },
-
- hoverMenuButtonWasPressed: function(hoverMenu)
- {
- this._popover = new WebInspector.Popover(this);
- this.popoverWillPresent(this._popover);
- this._popover.present(this.popoverTargetFrameWithRects(this._rects).pad(2), this.popoverPreferredEdges);
- this.popoverDidPresent(this._popover);
-
- WebInspector.addWindowKeydownListener(this);
-
- hoverMenu.dismiss();
-
- if (this._delegate && typeof this._delegate.editingControllerDidStartEditing === "function")
- this._delegate.editingControllerDidStartEditing(this);
-
- this._originalValue = this._value.copy();
- },
-
- didDismissPopover: function(popover)
- {
- delete this._popover;
- delete this._originalValue;
-
- WebInspector.removeWindowKeydownListener(this);
-
- if (this._delegate && typeof this._delegate.editingControllerDidFinishEditing === "function")
- this._delegate.editingControllerDidFinishEditing(this);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorFormattersjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorFormatters.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorFormatters.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorFormatters.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,403 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-// In the inspector token types have been modified to include extra mode information
-// after the actual token type. So we can't do token === "foo". So instead we do
-// /\bfoo\b/.test(token).
-
-CodeMirror.extendMode("javascript", {
- shouldHaveSpaceBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!token) {
- if (content === "(") // Most keywords like "if (" but not "function(" or "typeof(".
- return lastToken && /\bkeyword\b/.test(lastToken) && (lastContent !== "function" && lastContent !== "typeof" && lastContent !== "instanceof");
- if (content === ":") // Ternary.
- return (state.lexical.type === "stat" || state.lexical.type === ")");
- if (content === "!") // Unary ! should not be confused with "!=".
- return false;
- return "+-/*&&||!===+=-=>=<=?".indexOf(content) >= 0; // Operators.
- }
-
- if (isComment)
- return true;
-
- if (/\bkeyword\b/.test(token)) { // Most keywords require spaces before them, unless a '}' can come before it.
- if (content === "else" || content === "catch" || content === "finally")
- return lastContent === "}";
- return false;
- }
-
- return false;
- },
-
- shouldHaveSpaceAfterLastToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (lastToken && /\bkeyword\b/.test(lastToken)) { // Most keywords require spaces after them, unless a '{' or ';' can come after it.
- if (lastContent === "else")
- return true;
- if (lastContent === "catch")
- return true;
- if (lastContent === "return")
- return content !== ";";
- if (lastContent === "throw")
- return true;
- if (lastContent === "try")
- return true;
- if (lastContent === "finally")
- return true;
- if (lastContent === "do")
- return true;
- return false;
- }
-
- if (lastToken && /\bcomment\b/.test(lastToken)) // Embedded /* comment */.
- return true;
- if (lastContent === ")") // "){".
- return content === "{";
- if (lastContent === ";") // In for loop.
- return state.lexical.type === ")";
- if (lastContent === "!") // Unary ! should not be confused with "!=".
- return false;
-
- return ",+-/*&&||:!===+=-=>=<=?".indexOf(lastContent) >= 0; // Operators.
- },
-
- newlinesAfterToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!token) {
- if (content === ",") // In object literals, like in {a:1,b:2}, but not in param lists or vardef lists.
- return state.lexical.type === "}" ? 1 : 0;
- if (content === ";") // Everywhere except in for loop conditions.
- return state.lexical.type !== ")" ? 1 : 0;
- if (content === ":" && state.lexical.type === "}" && state.lexical.prev && state.lexical.prev.type === "form") // Switch case/default.
- return 1;
- return content.length === 1 && "{}".indexOf(content) >= 0 ? 1 : 0; // After braces.
- }
-
- if (isComment)
- return 1;
-
- return 0;
- },
-
- removeLastNewline: function(lastToken, lastContent, token, state, content, isComment, firstTokenOnLine)
- {
- if (!token) {
- if (content === "}") // "{}".
- return lastContent === "{";
- if (content === ";") // "x = {};" or ";;".
- return "};".indexOf(lastContent) >= 0;
- if (content === ":") // Ternary.
- return lastContent === "}" && (state.lexical.type === "stat" || state.lexical.type === ")");
- if (",().".indexOf(content) >= 0) // "})", "}.bind", "function() { ... }()", or "}, false)".
- return lastContent === "}";
- return false;
- }
-
- if (isComment) { // Comment after semicolon.
- if (!firstTokenOnLine && lastContent === ";")
- return true;
- return false;
- }
-
- if (/\bkeyword\b/.test(token)) {
- if (content === "else" || content === "catch" || content === "finally") // "} else", "} catch", "} finally"
- return lastContent === "}";
- return false;
- }
-
- return false;
- },
-
- indentAfterToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- return content === "{" || content === "case" || content === "default";
- },
-
- newlineBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (state._jsPrettyPrint.shouldIndent)
- return true;
-
- return content === "}" && lastContent !== "{"; // "{}"
- },
-
- indentBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (state._jsPrettyPrint.shouldIndent)
- return true;
-
- return false;
- },
-
- dedentsBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- var dedent = 0;
-
- if (state._jsPrettyPrint.shouldDedent)
- dedent += state._jsPrettyPrint.dedentSize;
-
- if (!token && content === "}")
- dedent += 1;
- else if (token && /\bkeyword\b/.test(token) && (content === "case" || content === "default"))
- dedent += 1;
-
- return dedent;
- },
-
- modifyStateForTokenPre: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!state._jsPrettyPrint) {
- state._jsPrettyPrint = {
- indentCount: 0, // How far have we indented because of single statement blocks.
- shouldIndent: false, // Signal we should indent on entering a single statement block.
- shouldDedent: false, // Signal we should dedent on leaving a single statement block.
- dedentSize: 0, // How far we should dedent when leaving a single statement block.
- lastIfIndentCount: 0, // Keep track of the indent the last time we saw an if without braces.
- openBraceStartMarkers: [], // Keep track of non-single statement blocks.
- openBraceTrackingCount: -1, // Keep track of "{" and "}" in non-single statement blocks.
- };
- }
-
- // - Entering:
- // - Preconditions:
- // - last lexical was a "form" we haven't encountered before
- // - last content was ")", "else", or "do"
- // - current lexical is not ")" (in an expression or condition)
- // - Cases:
- // 1. "{"
- // - indent +0
- // - save this indent size so when we encounter the "}" we know how far to dedent
- // 2. "else if"
- // - indent +0 and do not signal to add a newline and indent
- // - mark the last if location so when we encounter an "else" we know how far to dedent
- // - mark the lexical state so we know we are inside a single statement block
- // 3. Token without brace.
- // - indent +1 and signal to add a newline and indent
- // - mark the last if location so when we encounter an "else" we know how far to dedent
- // - mark the lexical state so we know we are inside a single statement block
- if (!isComment && state.lexical.prev && state.lexical.prev.type === "form" && !state.lexical.prev._jsPrettyPrintMarker && (lastContent === ")" || lastContent === "else" || lastContent === "do") && (state.lexical.type !== ")")) {
- if (content === "{") {
- // Save the state at the opening brace so we can return to it when we see "}".
- var savedState = {indentCount:state._jsPrettyPrint.indentCount, openBraceTrackingCount:state._jsPrettyPrint.openBraceTrackingCount};
- state._jsPrettyPrint.openBraceStartMarkers.push(savedState);
- state._jsPrettyPrint.openBraceTrackingCount = 1;
- } else if (state.lexical.type !== "}") {
- // Increase the indent count. Signal for a newline and indent if needed.
- if (!(lastContent === "else" && content === "if")) {
- state._jsPrettyPrint.indentCount++;
- state._jsPrettyPrint.shouldIndent = true;
- }
- state.lexical.prev._jsPrettyPrintMarker = true;
- if (state._jsPrettyPrint.enteringIf)
- state._jsPrettyPrint.lastIfIndentCount = state._jsPrettyPrint.indentCount - 1;
- }
- }
-
- // - Leaving:
- // - Preconditions:
- // - we must be indented
- // - ignore ";", wait for the next token instead.
- // - Cases:
- // 1. "else"
- // - dedent to the last "if"
- // 2. "}" and all braces we saw are balanced
- // - dedent to the last "{"
- // 3. Token without a marker on the stack
- // - dedent all the way
- else if (state._jsPrettyPrint.indentCount) {
- console.assert(!state._jsPrettyPrint.shouldDedent);
- console.assert(!state._jsPrettyPrint.dedentSize);
-
- // Track "{" and "}" to know when the "}" is really closing a block.
- if (!isComment) {
- if (content === "{")
- state._jsPrettyPrint.openBraceTrackingCount++;
- else if (content === "}")
- state._jsPrettyPrint.openBraceTrackingCount--;
- }
-
- if (content === ";") {
- // Ignore.
- } else if (content === "else") {
- // Dedent to the last "if".
- if (lastContent !== "}") {
- state._jsPrettyPrint.shouldDedent = true;
- state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount - state._jsPrettyPrint.lastIfIndentCount;
- state._jsPrettyPrint.lastIfIndentCount = 0;
- }
- } else if (content === "}" && !state._jsPrettyPrint.openBraceTrackingCount && state._jsPrettyPrint.openBraceStartMarkers.length) {
- // Dedent to the last "{".
- var savedState = state._jsPrettyPrint.openBraceStartMarkers.pop();
- state._jsPrettyPrint.shouldDedent = true;
- state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount - savedState.indentCount;
- state._jsPrettyPrint.openBraceTrackingCount = savedState.openBraceTrackingCount;
- } else {
- // Dedent all the way.
- var shouldDedent = true;
- var lexical = state.lexical.prev;
- while (lexical) {
- if (lexical._jsPrettyPrintMarker) {
- shouldDedent = false;
- break;
- }
- lexical = lexical.prev;
- }
- if (shouldDedent) {
- state._jsPrettyPrint.shouldDedent = true;
- state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount;
- }
- }
- }
-
- // Signal for when we will be entering an if.
- if (token && state.lexical.type === "form" && state.lexical.prev && state.lexical.prev !== "form" && /\bkeyword\b/.test(token))
- state._jsPrettyPrint.enteringIf = (content === "if");
- },
-
- modifyStateForTokenPost: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (state._jsPrettyPrint.shouldIndent)
- state._jsPrettyPrint.shouldIndent = false;
-
- if (state._jsPrettyPrint.shouldDedent) {
- state._jsPrettyPrint.indentCount -= state._jsPrettyPrint.dedentSize;
- state._jsPrettyPrint.dedentSize = 0;
- state._jsPrettyPrint.shouldDedent = false;
- }
- }
-});
-
-CodeMirror.extendMode("css", {
- shouldHaveSpaceBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!token) {
- if (content === "{")
- return true;
- return false;
- }
-
- if (isComment)
- return true;
-
- if (/\bkeyword\b/.test(token)) {
- if (content.charAt(0) === "!") // "!important".
- return true;
- return false;
- }
-
- return false;
- },
-
- shouldHaveSpaceAfterLastToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!lastToken) {
- if (lastContent === ",")
- return true;
- return false;
- }
-
- if (/\boperator\b/.test(lastToken)) {
- if (lastContent === ":") // Space in "prop: value" but not in a selectors "a:link" or "div::after" or media queries "(max-device-width:480px)".
- return state.stack.lastValue === "propertyValue";
- return false;
- }
-
- if (/\bcomment\b/.test(lastToken))
- return true;
-
- return false;
- },
-
- newlinesAfterToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!token) {
- if (content === ";")
- return 1;
- if (content === ",") { // "a,b,c,...,z{}" rule list at top level or in @media top level and only if the line length will be large.
- if ((!state.stack.length || state.stack.lastValue === "@media{") && state._cssPrettyPrint.lineLength > 60) {
- state._cssPrettyPrint.lineLength = 0;
- return 1;
- }
- return 0;
- }
- if (content === "{")
- return 1;
- if (content === "}") // 2 newlines between rule declarations.
- return 2;
- return 0;
- }
-
- if (isComment)
- return 1;
-
- return 0;
- },
-
- removeLastNewline: function(lastToken, lastContent, token, state, content, isComment, firstTokenOnLine)
- {
- if (isComment) { // Comment after semicolon.
- if (!firstTokenOnLine && lastContent === ";")
- return true;
- return false;
- }
-
- return content === "}" && (lastContent === "{" || lastContent === "}"); // "{}" and "}\n}" when closing @media.
- },
-
- indentAfterToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- return content === "{";
- },
-
- newlineBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- return content === "}" && (lastContent !== "{" && lastContent !== "}"); // "{}" and "}\n}" when closing @media.
- },
-
- indentBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- return false;
- },
-
- dedentsBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
- {
- return content === "}" ? 1 : 0;
- },
-
- modifyStateForTokenPost: function(lastToken, lastContent, token, state, content, isComment)
- {
- if (!state._cssPrettyPrint)
- state._cssPrettyPrint = {lineLength: 0};
-
- // In order insert newlines in selector lists we need keep track of the length of the current line.
- // This isn't exact line length, only the builder knows that, but it is good enough to get an idea.
- // If we are at a top level, keep track of the current line length, otherwise we reset to 0.
- if (!state.stack.length || state.stack.lastValue === "@media{")
- state._cssPrettyPrint.lineLength += content.length;
- else
- state._cssPrettyPrint.lineLength = 0;
- }
-});
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,119 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.gradient-editing-controller {
- width: 260px;
- height: 109px;
-
- font-family: "Lucida Grande", Helvetica, sans-serif;
-}
-
-.gradient-editing-controller.edits-color {
- height: 306px;
-}
-
-.gradient-editing-controller.radial-gradient {
- height: 78px;
-}
-
-.gradient-editing-controller.edits-color.radial-gradient {
- height: 275px;
-}
-
-.gradient-editing-controller select {
- position: absolute;
- left: 17px;
- top: 9px;
- width: 237px;
-
- font-size: 16px;
-}
-
-.gradient-editing-controller .gradient-slider {
- left: 16px;
- right: 26px;
- top: 42px;
-}
-
-.gradient-editing-controller .color-picker {
- position: absolute;
-
- top: 86px;
- width: 202px;
- height: 172px;
- padding: 0 10px;
-}
-
-.gradient-editing-controller > .color-picker > .slider {
- top: 2px;
- width: 186px;
-}
-
-.gradient-editing-controller > .color-picker > .brightness {
- left: 214px;
-}
-
-.gradient-editing-controller > .color-picker > .opacity {
- left: 237px;
-}
-
-.gradient-editing-controller > label {
- position: absolute;
- top: 85px;
- right: 16px;
-
- text-align: right;
- font-size: 13px;
-}
-
-.gradient-editing-controller.radial-gradient > label {
- display: none;
-}
-
-.gradient-editing-controller.edits-color > label {
- top: 283px;
-}
-
-.gradient-editing-controller > label > input {
- width: 48px;
-
- padding-right: 4px;
- margin-left: 5px;
-
- background-color: white;
-
- border-radius: 4px;
- border: 1px solid rgb(155,155,155);
- box-shadow: inset 0 0 1px 1px rgb(227,227,227);
- outline: 0;
-
- font-size: 13px;
- text-align: right;
-}
-
-.gradient-editing-controller > label.drag-to-adjust,
-.gradient-editing-controller > label.drag-to-adjust > input {
- cursor: col-resize;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,240 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorGradientEditingController = function(codeMirror, marker)
-{
- WebInspector.CodeMirrorEditingController.call(this, codeMirror, marker);
-}
-
-WebInspector.CodeMirrorGradientEditingController.StyleClassName = "gradient-editing-controller";
-WebInspector.CodeMirrorGradientEditingController.EditsColorClassName = "edits-color";
-WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName = "radial-gradient";
-
-WebInspector.CodeMirrorGradientEditingController.GradientTypes = {
- "linear-gradient": {
- type: WebInspector.LinearGradient,
- label: WebInspector.UIString("Linear Gradient"),
- repeats: false
- },
- "radial-gradient": {
- type: WebInspector.RadialGradient,
- label: WebInspector.UIString("Radial Gradient"),
- repeats: false
- },
- "repeating-linear-gradient": {
- type: WebInspector.LinearGradient,
- label: WebInspector.UIString("Repeating Linear Gradient"),
- repeats: true
- },
- "repeating-radial-gradient": {
- type: WebInspector.RadialGradient,
- label: WebInspector.UIString("Repeating Radial Gradient"),
- repeats: true
- }
-};
-
-WebInspector.CodeMirrorGradientEditingController.prototype = {
- constructor: WebInspector.CodeMirrorGradientEditingController,
- __proto__: WebInspector.CodeMirrorEditingController.prototype,
-
- // Public
-
- get initialValue()
- {
- return WebInspector.Gradient.fromString(this.text);
- },
-
- get cssClassName()
- {
- return "gradient";
- },
-
- get popoverPreferredEdges()
- {
- // Since the gradient editor can resize to be quite tall, let's avoid displaying the popover
- // above the edited value so that it may not change which edge it attaches to upon editing a stop.
- return [WebInspector.RectEdge.MIN_X, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X];
- },
-
- popoverTargetFrameWithRects: function(rects)
- {
- // If a gradient is defined across several lines, we probably want to use the first line only
- // as a target frame for the editor since we may reformat the gradient value to fit on a single line.
- return rects[0];
- },
-
- popoverWillPresent: function(popover)
- {
- this._container = document.createElement("div");
- this._container.className = WebInspector.CodeMirrorGradientEditingController.StyleClassName;
-
- this._gradientTypePicker = this._container.appendChild(document.createElement("select"));
- for (var type in WebInspector.CodeMirrorGradientEditingController.GradientTypes) {
- var option = this._gradientTypePicker.appendChild(document.createElement("option"));
- option.value = type;
- option.innerText = WebInspector.CodeMirrorGradientEditingController.GradientTypes[type].label;
- }
- this._gradientTypePicker.addEventListener("change", this);
-
- this._gradientSlider = new WebInspector.GradientSlider;
- this._container.appendChild(this._gradientSlider.element);
-
- this._colorPicker = new WebInspector.ColorPicker;
- this._colorPicker.colorWheel.dimension = 190;
- this._colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, this._colorPickerColorChanged, this);
-
- var angleLabel = this._container.appendChild(document.createElement("label"));
- angleLabel.textContent = WebInspector.UIString("Angle");
-
- this._angleInput = document.createElement("input");
- this._angleInput.type = "text";
- this._angleInput.size = 3;
- this._angleInput.addEventListener("input", this);
- angleLabel.appendChild(this._angleInput);
-
- var dragToAdjustController = new WebInspector.DragToAdjustController(this);
- dragToAdjustController.element = angleLabel;
- dragToAdjustController.enabled = true;
-
- this._updateCSSClassForGradientType();
-
- popover.content = this._container;
- },
-
- popoverDidPresent: function(popover)
- {
- this._gradientSlider.stops = this.value.stops;
-
- if (this.value instanceof WebInspector.LinearGradient) {
- this._gradientTypePicker.value = this.value.repeats ? "repeating-linear-gradient" : "linear-gradient";
- this._angleInput.value = this.value.angle + "\u00B0";
- } else
- this._gradientTypePicker.value = this.value.repeats ? "repeating-radial-gradient" : "radial-gradient"
-
- this._gradientSlider.delegate = this;
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- if (event.type === "input")
- this._handleInputEvent(event);
- else if (event.type === "change")
- this._handleChangeEvent(event);
- },
-
- gradientSliderStopsDidChange: function(gradientSlider)
- {
- this.text = this.value.toString();
- },
-
- gradientSliderStopWasSelected: function(gradientSlider, stop)
- {
- var selectedStop = gradientSlider.selectedStop;
-
- if (selectedStop && !this._container.classList.contains(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName)) {
- this._container.appendChild(this._colorPicker.element);
- this._container.classList.add(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName);
- this._colorPicker.color = selectedStop.color;
- } else if (!selectedStop) {
- this._colorPicker.element.remove();
- this._container.classList.remove(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName);
- }
-
- // Ensure the angle input is not focused since, if it were, it'd make a scrollbar appear as we
- // animate the popover's frame to fit its new content.
- this._angleInput.blur();
-
- this.popover.update();
- },
-
- dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
- {
- var angle = parseFloat(this._angleInput.value) + amount;
- if (Math.round(angle) !== angle)
- angle = angle.toFixed(1);
-
- this._angleInput.value = angle;
- this._angleInputValueDidChange(angle);
- },
-
- // Private
-
- _handleInputEvent: function(event)
- {
- var angle = parseFloat(this._angleInput.value);
- if (isNaN(angle))
- return;
-
- this._angleInputValueDidChange(angle);
- },
-
- _angleInputValueDidChange: function(angle)
- {
- this.value.angle = angle;
- this.text = this.value.toString();
-
- var matches = this._angleInput.value.match(/\u00B0/g);
- if (!matches || matches.length !== 1) {
- var selectionStart = this._angleInput.selectionStart;
- this._angleInput.value = angle + "\u00B0";
- this._angleInput.selectionStart = selectionStart;
- this._angleInput.selectionEnd = selectionStart;
- }
- },
-
- _handleChangeEvent: function(event)
- {
- var descriptor = WebInspector.CodeMirrorGradientEditingController.GradientTypes[this._gradientTypePicker.value];
- if (!(this.value instanceof descriptor.type)) {
- if (descriptor.type === WebInspector.LinearGradient) {
- this.value = new WebInspector.LinearGradient(180, this.value.stops);
- this._angleInput.value = "180\u00B0";
- } else
- this.value = new WebInspector.RadialGradient("", this.value.stops);
-
- this._updateCSSClassForGradientType();
- this.popover.update();
- }
- this.value.repeats = descriptor.repeats;
- this.text = this.value.toString();
- },
-
- _colorPickerColorChanged: function(event)
- {
- this._gradientSlider.selectedStop.color = event.target.color;
- this._gradientSlider.stops = this.value.stops;
- this.text = this.value.toString();
- },
-
- _updateCSSClassForGradientType: function()
- {
- if (this.value instanceof WebInspector.LinearGradient)
- this._container.classList.remove(WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName);
- else
- this._container.classList.add(WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorOverridescss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorOverrides.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorOverrides.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorOverrides.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.CodeMirror {
- z-index: 0;
-}
-
-.CodeMirror,
-.CodeMirror * {
- box-sizing: content-box;
-}
-
-.CodeMirror .CodeMirror-lines {
- /* One pixel bottom padding needed to show the bottom border for matching brackets and search matches. */
- padding: 0 0 1px 0;
-}
-
-.CodeMirror pre {
- padding: 1px 3px 1px 7px;
-}
-
-.CodeMirror .CodeMirror-selected {
- background-color: rgb(212, 212, 212);
-}
-
-.CodeMirror.CodeMirror-focused .CodeMirror-selected {
- background-color: highlight;
-}
-
-.CodeMirror .CodeMirror-cursor {
- pointer-events: none;
-}
-
-.CodeMirror .CodeMirror-lines .CodeMirror-matchingbracket {
- color: inherit;
- background-color: rgba(100, 130, 235, 0.2);
- border-bottom: 1px dotted rgb(20, 20, 235);
-}
-
-.CodeMirror .CodeMirror-lines .CodeMirror-nonmatchingbracket {
- color: inherit;
- background-color: rgba(235, 30, 20, 0.2);
- border-bottom: 1px dotted rgb(235, 30, 20);
-}
-
-.CodeMirror .CodeMirror-gutters {
- background-color: rgb(247, 247, 247);
- border-right: 1px solid rgb(231, 231, 231);
-}
-
-.CodeMirror .CodeMirror-linenumber {
- padding: 0 2px;
- min-width: 21px;
-
- color: rgb(146, 146, 146);
-
- font-size: 9px;
- line-height: 13px;
- font-family: "Lucida Grande", sans-serif;
- text-align: right;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.CodeMirror .jump-to-symbol-highlight {
- color: blue !important;
- text-decoration: underline !important;
- cursor: pointer !important;
- -webkit-text-stroke-width: 0 !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,509 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorTokenTrackingController = function(codeMirror, delegate)
-{
- WebInspector.Object.call(this);
-
- console.assert(codeMirror);
-
- this._codeMirror = codeMirror;
- this._delegate = delegate || null;
- this._mode = WebInspector.CodeMirrorTokenTrackingController.Mode.None;
-
- this._mouseOverDelayDuration = 0;
- this._mouseOutReleaseDelayDuration = 0;
- this._classNameForHighlightedRange = null;
-
- this._enabled = false;
- this._tracking = false;
- this._hoveredTokenInfo = null;
- this._hoveredMarker = null;
-};
-
-WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName = "jump-to-symbol-highlight";
-
-WebInspector.CodeMirrorTokenTrackingController.Mode = {
- None: "none",
- NonSymbolTokens: "non-symbol-tokens",
- JavaScriptExpression: "javascript-expression",
- MarkedTokens: "marked-tokens"
-}
-
-WebInspector.CodeMirrorTokenTrackingController.prototype = {
- constructor: WebInspector.CodeMirrorTokenTrackingController,
-
- // Public
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(x)
- {
- this._delegate = x;
- },
-
- get enabled()
- {
- return this._enabled;
- },
-
- set enabled(enabled)
- {
- if (this._enabled === enabled)
- return;
-
- this._enabled = enabled;
-
- var wrapper = this._codeMirror.getWrapperElement();
- if (enabled) {
- wrapper.addEventListener("mouseenter", this);
- wrapper.addEventListener("mouseleave", this);
- this._updateHoveredTokenInfo({left: WebInspector.mouseCoords.x, top: WebInspector.mouseCoords.y});
- this._startTracking();
- } else {
- wrapper.removeEventListener("mouseenter", this);
- wrapper.removeEventListener("mouseleave", this);
- this._stopTracking();
- }
- },
-
- get mode()
- {
- return this._mode;
- },
-
- set mode(mode)
- {
- var oldMode = this._mode;
-
- this._mode = mode || WebInspector.CodeMirrorTokenTrackingController.Mode.None;
-
- if (oldMode !== this._mode && this._tracking && this._hoveredTokenInfo)
- this._processNewHoveredToken();
- },
-
- get mouseOverDelayDuration()
- {
- return this._mouseOverDelayDuration;
- },
-
- set mouseOverDelayDuration(x)
- {
- console.assert(x >= 0);
- this._mouseOverDelayDuration = Math.max(x, 0);
- },
-
- get mouseOutReleaseDelayDuration()
- {
- return this._mouseOutReleaseDelayDuration;
- },
-
- set mouseOutReleaseDelayDuration(x)
- {
- console.assert(x >= 0);
- this._mouseOutReleaseDelayDuration = Math.max(x, 0);
- },
-
- get classNameForHighlightedRange()
- {
- return this._classNameForHighlightedRange;
- },
-
- set classNameForHighlightedRange(x)
- {
- this._classNameForHighlightedRange = x || null;
- },
-
- get candidate()
- {
- return this._candidate;
- },
-
- get hoveredMarker()
- {
- return this._hoveredMarker;
- },
-
- set hoveredMarker(hoveredMarker)
- {
- this._hoveredMarker = hoveredMarker;
- },
-
- highlightLastHoveredRange: function()
- {
- if (this._candidate)
- this.highlightRange(this._candidate.hoveredTokenRange);
- },
-
- highlightRange: function(range)
- {
- // Nothing to do if we're trying to highlight the same range.
- if (this._codeMirrorMarkedText && this._codeMirrorMarkedText.className === this._classNameForHighlightedRange) {
- var highlightedRange = this._codeMirrorMarkedText.find();
- if (WebInspector.compareCodeMirrorPositions(highlightedRange.from, range.start) === 0 &&
- WebInspector.compareCodeMirrorPositions(highlightedRange.to, range.end) === 0)
- return;
- }
-
- this.removeHighlightedRange();
-
- var className = this._classNameForHighlightedRange || "";
- this._codeMirrorMarkedText = this._codeMirror.markText(range.start, range.end, {className: className});
-
- window.addEventListener("mousemove", this, true);
- },
-
- removeHighlightedRange: function()
- {
- if (!this._codeMirrorMarkedText)
- return;
-
- this._codeMirrorMarkedText.clear();
- delete this._codeMirrorMarkedText;
-
- window.removeEventListener("mousemove", this, true);
- },
-
- // Private
-
- _startTracking: function()
- {
- console.assert(!this._tracking);
- if (this._tracking)
- return;
-
- this._tracking = true;
-
- var wrapper = this._codeMirror.getWrapperElement();
- wrapper.addEventListener("mousemove", this, true);
- wrapper.addEventListener("mouseout", this, false);
- wrapper.addEventListener("mousedown", this, false);
- wrapper.addEventListener("mouseup", this, false);
- window.addEventListener("blur", this, true);
- },
-
- _stopTracking: function()
- {
- console.assert(this._tracking);
- if (!this._tracking)
- return;
-
- this._tracking = false;
- this._candidate = null;
-
- var wrapper = this._codeMirror.getWrapperElement();
- wrapper.removeEventListener("mousemove", this, true);
- wrapper.removeEventListener("mouseout", this, false);
- wrapper.removeEventListener("mousedown", this, false);
- wrapper.removeEventListener("mouseup", this, false);
- window.removeEventListener("blur", this, true);
- window.removeEventListener("mousemove", this, true);
-
- this._resetTrackingStates();
- },
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mouseenter":
- this._mouseEntered(event);
- break;
- case "mouseleave":
- this._mouseLeft(event);
- break;
- case "mousemove":
- if (event.currentTarget === window)
- this._mouseMovedWithMarkedText(event);
- else
- this._mouseMovedOverEditor(event);
- break;
- case "mouseout":
- // Only deal with a mouseout event that has the editor wrapper as the target.
- if (!event.currentTarget.contains(event.relatedTarget))
- this._mouseMovedOutOfEditor(event);
- break;
- case "mousedown":
- this._mouseButtonWasPressedOverEditor(event);
- break;
- case "mouseup":
- this._mouseButtonWasReleasedOverEditor(event);
- break;
- case "blur":
- this._windowLostFocus(event);
- break;
- }
- },
-
- _mouseEntered: function(event)
- {
- this._startTracking();
- },
-
- _mouseLeft: function(event)
- {
- this._stopTracking();
- },
-
- _mouseMovedWithMarkedText: function(event)
- {
- var shouldRelease = !event.target.classList.contains(this._classNameForHighlightedRange);
- if (shouldRelease && this._delegate && typeof this._delegate.tokenTrackingControllerCanReleaseHighlightedRange === "function")
- shouldRelease = this._delegate.tokenTrackingControllerCanReleaseHighlightedRange(this, event.target);
-
- if (shouldRelease) {
- if (!this._markedTextMouseoutTimer)
- this._markedTextMouseoutTimer = setTimeout(this._markedTextIsNoLongerHovered.bind(this), this._mouseOutReleaseDelayDuration);
- return;
- }
-
- clearTimeout(this._markedTextMouseoutTimer);
- delete this._markedTextMouseoutTimer;
- },
-
- _markedTextIsNoLongerHovered: function()
- {
- if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeReleased === "function")
- this._delegate.tokenTrackingControllerHighlightedRangeReleased(this);
- delete this._markedTextMouseoutTimer;
- },
-
- _mouseMovedOverEditor: function(event)
- {
- this._updateHoveredTokenInfo({left: event.pageX, top: event.pageY});
- },
-
- _updateHoveredTokenInfo: function(mouseCoords)
- {
- // Get the position in the text and the token at that position.
- var position = this._codeMirror.coordsChar(mouseCoords);
- var token = this._codeMirror.getTokenAt(position);
-
- if (!token || !token.type || !token.string) {
- if (this._hoveredMarker && this._delegate && typeof this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker === "function") {
- if (!this._codeMirror.findMarksAt(position).contains(this._hoveredMarker.codeMirrorTextMarker))
- this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker(this, this._hoveredMarker);
- }
-
- this._resetTrackingStates();
- return;
- }
-
- // Stop right here if we're hovering the same token as we were last time.
- if (this._hoveredTokenInfo &&
- this._hoveredTokenInfo.position.line === position.line &&
- this._hoveredTokenInfo.token.start === token.start &&
- this._hoveredTokenInfo.token.end === token.end)
- return;
-
- // We have a new hovered token.
- var innerMode = CodeMirror.innerMode(this._codeMirror.getMode(), token.state);
- var codeMirrorModeName = innerMode.mode.alternateName || innerMode.mode.name;
- this._hoveredTokenInfo = {
- token: token,
- position: position,
- innerMode: innerMode,
- modeName: codeMirrorModeName
- };
-
- clearTimeout(this._tokenHoverTimer);
-
- if (this._codeMirrorMarkedText || !this._mouseOverDelayDuration)
- this._processNewHoveredToken();
- else
- this._tokenHoverTimer = setTimeout(this._processNewHoveredToken.bind(this), this._mouseOverDelayDuration);
- },
-
- _mouseMovedOutOfEditor: function(event)
- {
- clearTimeout(this._tokenHoverTimer);
- delete this._hoveredTokenInfo;
- delete this._selectionMayBeInProgress;
- },
-
- _mouseButtonWasPressedOverEditor: function(event)
- {
- this._selectionMayBeInProgress = true;
- },
-
- _mouseButtonWasReleasedOverEditor: function(event)
- {
- delete this._selectionMayBeInProgress;
- this._mouseMovedOverEditor(event);
-
- if (this._codeMirrorMarkedText && this._hoveredTokenInfo) {
- var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
- var marks = this._codeMirror.findMarksAt(position);
- for (var i = 0; i < marks.length; ++i) {
- if (marks[i] === this._codeMirrorMarkedText) {
- if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeWasClicked === "function") {
- // Trigger the clicked delegate asynchronously, letting the editor complete handling of the click.
- setTimeout(function() { this._delegate.tokenTrackingControllerHighlightedRangeWasClicked(this); }.bind(this), 0);
- }
- break;
- }
- }
- }
- },
-
- _windowLostFocus: function(event)
- {
- this._resetTrackingStates();
- },
-
- _processNewHoveredToken: function()
- {
- console.assert(this._hoveredTokenInfo);
-
- if (this._selectionMayBeInProgress)
- return;
-
- this._candidate = null;
-
- switch (this._mode) {
- case WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens:
- this._candidate = this._processNonSymbolToken();
- break;
- case WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression:
- this._candidate = this._processJavaScriptExpression();
- break;
- case WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens:
- this._candidate = this._processMarkedToken();
- break;
- }
-
- if (!this._candidate)
- return;
-
- clearTimeout(this._markedTextMouseoutTimer);
- delete this._markedTextMouseoutTimer;
-
- if (this._delegate && typeof this._delegate.tokenTrackingControllerNewHighlightCandidate === "function")
- this._delegate.tokenTrackingControllerNewHighlightCandidate(this, this._candidate);
- },
-
- _processNonSymbolToken: function()
- {
- // Ignore any symbol tokens.
- var type = this._hoveredTokenInfo.token.type;
- if (!type)
- return null;
-
- var startPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
- var endPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.end};
-
- return {
- hoveredToken: this._hoveredTokenInfo.token,
- hoveredTokenRange: {start: startPosition, end: endPosition},
- };
- },
-
- _processJavaScriptExpression: function()
- {
- // Only valid within JavaScript.
- if (this._hoveredTokenInfo.modeName !== "javascript")
- return null;
-
- var startPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
- var endPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.end};
-
- // If the hovered token is within a selection, use the selection as our expression.
- if (this._codeMirror.somethingSelected()) {
- var selectionRange = {
- start: this._codeMirror.getCursor("start"),
- end: this._codeMirror.getCursor("end")
- };
-
- function tokenIsInRange(token, range)
- {
- return token.line >= range.start.line && token.ch >= range.start.ch &&
- token.line <= range.end.line && token.ch <= range.end.ch;
- }
-
- if (tokenIsInRange(startPosition, selectionRange) || tokenIsInRange(endPosition, selectionRange)) {
- return {
- hoveredToken: this._hoveredTokenInfo.token,
- hoveredTokenRange: selectionRange,
- expression: this._codeMirror.getSelection(),
- expressionRange: selectionRange,
- };
- }
- }
-
- // We only handle vars, definitions, properties, and the keyword 'this'.
- var type = this._hoveredTokenInfo.token.type;
- var isProperty = type.indexOf("property") !== -1;
- var isKeyword = type.indexOf("keyword") !== -1;
- if (!isProperty && !isKeyword && type.indexOf("variable") === -1 && type.indexOf("def") === -1)
- return null;
-
- // Not object literal properties.
- var state = this._hoveredTokenInfo.innerMode.state;
- if (isProperty && state.lexical && state.lexical.type === "}")
- return null;
-
- // Only the "this" keyword.
- if (isKeyword && this._hoveredTokenInfo.token.string !== "this")
- return null;
-
- // Work out the full hovered expression.
- var expression = this._hoveredTokenInfo.token.string;
- var expressionStartPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
- while (true) {
- var token = this._codeMirror.getTokenAt(expressionStartPosition);
- var isDot = token && !token.type && token.string === ".";
- var isExpression = token && token.type && token.type.indexOf("m-javascript") !== -1;
- if (!isDot && !isExpression)
- break;
- expression = token.string + expression;
- expressionStartPosition.ch = token.start;
- }
-
- // Return the candidate for this token and expression.
- return {
- hoveredToken: this._hoveredTokenInfo.token,
- hoveredTokenRange: {start: startPosition, end: endPosition},
- expression: expression,
- expressionRange: {start: expressionStartPosition, end: endPosition},
- };
- },
-
- _processMarkedToken: function()
- {
- return this._processNonSymbolToken();
- },
-
- _resetTrackingStates: function()
- {
- clearTimeout(this._tokenHoverTimer);
- delete this._selectionMayBeInProgress;
- delete this._hoveredTokenInfo;
- this.removeHighlightedRange();
- }
-};
-
-WebInspector.CodeMirrorCompletionController.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceColorjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Color.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Color.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Color.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,665 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.Color = function(format, components)
-{
- this.format = format;
- if (format === WebInspector.Color.Format.HSL || format === WebInspector.Color.Format.HSLA)
- this._hsla = components;
- else
- this._rgba = components;
-
- this.valid = !components.some(function(component) {
- return isNaN(component);
- });
-}
-
-WebInspector.Color.Format = {
- Original: "color-format-original",
- Nickname: "color-format-nickname",
- HEX: "color-format-hex",
- ShortHEX: "color-format-short-hex",
- RGB: "color-format-rgb",
- RGBA: "color-format-rgba",
- HSL: "color-format-hsl",
- HSLA: "color-format-hsla"
-};
-
-WebInspector.Color.fromString = function(colorString)
-{
- var value = colorString.toLowerCase().replace(/%|\s+/g, "");
- const transparentNicknames = ["transparent", "rgba(0,0,0,0)", "hsla(0,0,0,0)"];
- if (transparentNicknames.contains(value)) {
- var color = new WebInspector.Color(WebInspector.Color.Format.Nickname, [0, 0, 0, 0]);
- color.nickname = "transparent";
- color.original = colorString;
- return color;
- }
-
- // Simple - #hex, rgb(), nickname, hsl()
- var simple = /^(?:#([0-9a-f]{3,6})|rgb\(([^)]+)\)|(\w+)|hsl\(([^)]+)\))$/i;
- var match = colorString.match(simple);
- if (match) {
- if (match[1]) { // hex
- var hex = match[1].toUpperCase();
- if (hex.length === 3) {
- return new WebInspector.Color(WebInspector.Color.Format.ShortHEX, [
- parseInt(hex.charAt(0) + hex.charAt(0), 16),
- parseInt(hex.charAt(1) + hex.charAt(1), 16),
- parseInt(hex.charAt(2) + hex.charAt(2), 16),
- 1
- ]);
- } else {
- return new WebInspector.Color(WebInspector.Color.Format.HEX, [
- parseInt(hex.substring(0, 2), 16),
- parseInt(hex.substring(2, 4), 16),
- parseInt(hex.substring(4, 6), 16),
- 1
- ]);
- }
- } else if (match[2]) { // rgb
- var rgb = match[2].split(/\s*,\s*/);
- return new WebInspector.Color(WebInspector.Color.Format.RGB, [
- parseInt(rgb[0]),
- parseInt(rgb[1]),
- parseInt(rgb[2]),
- 1
- ]);
- } else if (match[3]) { // nickname
- var nickname = match[3].toLowerCase();
- if (WebInspector.Color.Nicknames.hasOwnProperty(nickname)) {
- var color = new WebInspector.Color(WebInspector.Color.Format.Nickname, WebInspector.Color.Nicknames[nickname].concat(1));
- color.nickname = nickname;
- color.original = colorString;
- return color;
- } else
- return null;
- } else if (match[4]) { // hsl
- var hsl = match[4].replace(/%/g, "").split(/\s*,\s*/);
- return new WebInspector.Color(WebInspector.Color.Format.HSL, [
- parseInt(hsl[0]),
- parseInt(hsl[1]),
- parseInt(hsl[2]),
- 1
- ]);
- }
- }
-
- // Advanced - rgba(), hsla()
- var advanced = /^(?:rgba\(([^)]+)\)|hsla\(([^)]+)\))$/;
- match = colorString.match(advanced);
- if (match) {
- if (match[1]) { // rgba
- var rgba = match[1].split(/\s*,\s*/);
- return new WebInspector.Color(WebInspector.Color.Format.RGBA, [
- parseInt(rgba[0]),
- parseInt(rgba[1]),
- parseInt(rgba[2]),
- Number.constrain(parseFloat(rgba[3]), 0, 1)
- ]);
- } else if (match[2]) { // hsla
- var hsla = match[2].replace(/%/g, "").split(/\s*,\s*/);
- return new WebInspector.Color(WebInspector.Color.Format.HSLA, [
- parseInt(hsla[0]),
- parseInt(hsla[1]),
- parseInt(hsla[2]),
- Number.constrain(parseFloat(hsla[3]), 0, 1)
- ]);
- }
- }
-
- return null;
-}
-
-WebInspector.Color.prototype = {
- nextFormat: function(format)
- {
- format = format || this.format;
-
- switch (format) {
- case WebInspector.Color.Format.Original:
- return this.simple ? WebInspector.Color.Format.RGB : WebInspector.Color.Format.RGBA;
-
- case WebInspector.Color.Format.RGB:
- case WebInspector.Color.Format.RGBA:
- return this.simple ? WebInspector.Color.Format.HSL : WebInspector.Color.Format.HSLA;
-
- case WebInspector.Color.Format.HSL:
- case WebInspector.Color.Format.HSLA:
- if (this.nickname)
- return WebInspector.Color.Format.Nickname;
- if (this.simple)
- return this._canBeSerializedAsShortHEX() ? WebInspector.Color.Format.ShortHEX : WebInspector.Color.Format.HEX;
- else
- return WebInspector.Color.Format.Original;
-
- case WebInspector.Color.Format.ShortHEX:
- return WebInspector.Color.Format.HEX;
-
- case WebInspector.Color.Format.HEX:
- return WebInspector.Color.Format.Original;
-
- case WebInspector.Color.Format.Nickname:
- if (this.simple)
- return this._canBeSerializedAsShortHEX() ? WebInspector.Color.Format.ShortHEX : WebInspector.Color.Format.HEX;
- else
- return WebInspector.Color.Format.Original;
-
- default:
- console.error("Unknown color format.");
- return null;
- }
- },
-
- get alpha()
- {
- return this._rgba ? this._rgba[3] : this._hsla[3];
- },
-
- get simple()
- {
- return this.alpha === 1;
- },
-
- get rgb()
- {
- var rgb = this.rgba.slice();
- rgb.pop();
- return rgb;
- },
-
- get hsl()
- {
- var hsl = this.hsla.slice();
- hsl.pop();
- return hsl;
- },
-
- get rgba()
- {
- if (!this._rgba)
- this._rgba = this._hslaToRGBA(this._hsla);
- return this._rgba;
- },
-
- get hsla()
- {
- if (!this._hsla)
- this._hsla = this._rgbaToHSLA(this.rgba);
- return this._hsla;
- },
-
- copy: function()
- {
- switch (this.format) {
- case WebInspector.Color.Format.RGB:
- case WebInspector.Color.Format.HEX:
- case WebInspector.Color.Format.ShortHEX:
- case WebInspector.Color.Format.Nickname:
- case WebInspector.Color.Format.RGBA:
- return new WebInspector.Color(this.format, this.rgba);
- case WebInspector.Color.Format.HSL:
- case WebInspector.Color.Format.HSLA:
- return new WebInspector.Color(this.format, this.hsla);
- }
- },
-
- toString: function(format)
- {
- if (!format)
- format = this.format;
-
- switch (format) {
- case WebInspector.Color.Format.Original:
- return this._toOriginalString();
- case WebInspector.Color.Format.RGB:
- return this._toRGBString();
- case WebInspector.Color.Format.RGBA:
- return this._toRGBAString();
- case WebInspector.Color.Format.HSL:
- return this._toHSLString();
- case WebInspector.Color.Format.HSLA:
- return this._toHSLAString();
- case WebInspector.Color.Format.HEX:
- return this._toHEXString();
- case WebInspector.Color.Format.ShortHEX:
- return this._toShortHEXString();
- case WebInspector.Color.Format.Nickname:
- return this._toNicknameString();
- }
-
- throw "invalid color format";
- },
-
- _toOriginalString: function()
- {
- return this.original || this._toNicknameString();
- },
-
- _toNicknameString: function()
- {
- if (this.nickname)
- return this.nickname;
-
- var rgba = this.rgba;
- if (!this.simple) {
- if (rgba[0] === 0 && rgba[1] === 0 && rgba[2] === 0 && rgba[3] === 0)
- return "transparent";
- return this._toRGBAString();
- }
-
- var nicknames = WebInspector.Color.Nicknames;
- for (var nickname in nicknames) {
- if (!nicknames.hasOwnProperty(nickname))
- continue;
-
- var nicknameRGB = nicknames[nickname];
- if (nicknameRGB[0] === rgba[0] && nicknameRGB[1] === rgba[1] && nicknameRGB[2] === rgba[2])
- return nickname;
- }
-
- return this._toRGBString();
- },
-
- _toShortHEXString: function()
- {
- if (!this.simple)
- return this._toRGBAString();
-
- var rgba = this.rgba;
- var r = this._componentToHexValue(rgba[0]);
- var g = this._componentToHexValue(rgba[1]);
- var b = this._componentToHexValue(rgba[2]);
-
- if (r[0] === r[1] && g[0] === g[1] && b[0] === b[1])
- return "#" + r[0] + g[0] + b[0];
- else
- return "#" + r + g + b;
- },
-
- _toHEXString: function()
- {
- if (!this.simple)
- return this._toRGBAString();
-
- var rgba = this.rgba;
- var r = this._componentToHexValue(rgba[0]);
- var g = this._componentToHexValue(rgba[1]);
- var b = this._componentToHexValue(rgba[2]);
-
- return "#" + r + g + b;
- },
-
- _toRGBString: function()
- {
- if (!this.simple)
- return this._toRGBAString();
-
- var rgba = this.rgba;
- return "rgb(" + [rgba[0], rgba[1], rgba[2]].join(", ") + ")";
- },
-
- _toRGBAString: function()
- {
- return "rgba(" + this.rgba.join(", ") + ")";
- },
-
- _toHSLString: function()
- {
- if (!this.simple)
- return this._toHSLAString();
-
- var hsla = this.hsla;
- return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
- },
-
- _toHSLAString: function()
- {
- var hsla = this.hsla;
- return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
- },
-
- _canBeSerializedAsShortHEX: function()
- {
- var rgba = this.rgba;
-
- var r = this._componentToHexValue(rgba[0]);
- if (r[0] !== r[1])
- return false;
-
- var g = this._componentToHexValue(rgba[1]);
- if (g[0] !== g[1])
- return false;
-
- var b = this._componentToHexValue(rgba[2]);
- if (b[0] !== b[1])
- return false;
-
- return true;
- },
-
- _componentToNumber: function(value)
- {
- return Number.constrain(value, 0, 255);
- },
-
- _componentToHexValue: function(value)
- {
- var hex = this._componentToNumber(value).toString(16);
- if (hex.length === 1)
- hex = "0" + hex;
- return hex;
- },
-
- _rgbToHSL: function(rgb)
- {
- var r = this._componentToNumber(rgb[0]) / 255;
- var g = this._componentToNumber(rgb[1]) / 255;
- var b = this._componentToNumber(rgb[2]) / 255;
- var max = Math.max(r, g, b);
- var min = Math.min(r, g, b);
- var diff = max - min;
- var add = max + min;
-
- if (min === max)
- var h = 0;
- else if (r === max)
- var h = ((60 * (g - b) / diff) + 360) % 360;
- else if (g === max)
- var h = (60 * (b - r) / diff) + 120;
- else
- var h = (60 * (r - g) / diff) + 240;
-
- var l = 0.5 * add;
-
- if (l === 0)
- var s = 0;
- else if (l === 1)
- var s = 1;
- else if (l <= 0.5)
- var s = diff / add;
- else
- var s = diff / (2 - add);
-
- h = Math.round(h);
- s = Math.round(s * 100);
- l = Math.round(l * 100);
-
- return [h, s, l];
- },
-
- _hslToRGB: function(hsl)
- {
- var h = parseFloat(hsl[0]) / 360;
- var s = parseFloat(hsl[1]) / 100;
- var l = parseFloat(hsl[2]) / 100;
-
- h *= 6;
- var sArray = [
- l += s *= l < .5 ? l : 1 - l,
- l - h % 1 * s * 2,
- l -= s *= 2,
- l,
- l + h % 1 * s,
- l + s
- ];
- return [
- Math.round(sArray[ ~~h % 6 ] * 255),
- Math.round(sArray[ (h|16) % 6 ] * 255),
- Math.round(sArray[ (h|8) % 6 ] * 255)
- ];
- },
-
- _rgbaToHSLA: function(rgba)
- {
- var hsl = this._rgbToHSL(rgba);
- hsl.push(rgba[3]);
- return hsl;
- },
-
- _hslaToRGBA: function(hsla)
- {
- var rgba = this._hslToRGB(hsla);
- rgba.push(hsla[3]);
- return rgba;
- }
-}
-
-WebInspector.Color.Nicknames = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [237, 164, 61],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
-};
-
-WebInspector.Color.rgb2hsv = function(r, g, b)
-{
- r /= 255;
- g /= 255;
- b /= 255;
-
- var min = Math.min(Math.min(r, g), b);
- var max = Math.max(Math.max(r, g), b);
- var delta = max - min;
-
- var v = max;
- var s, h;
-
- if (max === min)
- h = 0;
- else if (max === r)
- h = (60 * ((g - b) / delta)) % 360;
- else if (max === g)
- h = 60 * ((b - r) / delta) + 120;
- else if (max === b)
- h = 60 * ((r - g) / delta) + 240;
-
- if (h < 0)
- h += 360;
-
- // Saturation
- if (max === 0)
- s = 0;
- else
- s = 1 - (min/max);
-
- return [h, s, v];
-}
-
-WebInspector.Color.hsv2rgb = function(h, s, v)
-{
- if (s === 0)
- return [v, v, v];
-
- h /= 60;
- var i = Math.floor(h);
- var data = [
- v * (1 - s),
- v * (1 - s * (h - i)),
- v * (1 - s * (1 - (h - i)))
- ];
- var rgb;
-
- switch (i) {
- case 0:
- rgb = [v, data[2], data[0]];
- break;
- case 1:
- rgb = [data[1], v, data[0]];
- break;
- case 2:
- rgb = [data[0], v, data[2]];
- break;
- case 3:
- rgb = [data[0], data[1], v];
- break;
- case 4:
- rgb = [data[2], data[0], v];
- break;
- default:
- rgb = [v, data[0], data[1]];
- break;
- }
-
- return rgb;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceColorPickercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ColorPicker.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ColorPicker.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ColorPicker.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.color-picker {
- position: relative;
- width: 256px;
- height: 210px;
- padding: 5px;
-}
-
-.color-picker > * {
- position: absolute;
-}
-
-.color-picker > .slider {
- top: 7px;
- width: 196px;
- -webkit-transform: rotate(-90deg) translateX(-100%);
- -webkit-transform-origin: 0 0;
-}
-
-.color-picker > .brightness {
- left: 215px;
-}
-
-.color-picker > .opacity {
- left: 238px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceColorPickerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ColorPicker.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ColorPicker.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ColorPicker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,157 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ColorPicker = function()
-{
- WebInspector.Object.call(this);
-
- this._colorWheel = new WebInspector.ColorWheel();
- this._colorWheel.delegate = this;
- this._colorWheel.dimension = 200;
-
- this._brightnessSlider = new WebInspector.Slider();
- this._brightnessSlider.delegate = this;
- this._brightnessSlider.element.classList.add("brightness");
-
- this._opacitySlider = new WebInspector.Slider();
- this._opacitySlider.delegate = this;
- this._opacitySlider.element.classList.add("opacity");
-
- this._element = document.createElement("div");
- this._element.className = "color-picker";
-
- this._element.appendChild(this._colorWheel.element);
- this._element.appendChild(this._brightnessSlider.element);
- this._element.appendChild(this._opacitySlider.element);
-
- this._opacity = 0;
- this._opacityPattern = 'url(Images/Checkers.svg)';
-
- this._color = "white";
-};
-
-WebInspector.ColorPicker.Event = {
- ColorChanged: "css-color-picker-color-changed"
-};
-
-WebInspector.ColorPicker.prototype = {
- contructor: WebInspector.ColorPicker,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- set brightness(brightness)
- {
- if (brightness === this._brightness)
- return;
-
- this._colorWheel.brightness = brightness;
-
- this._updateColor();
- this._updateSliders(this._colorWheel.rawColor, this._colorWheel.tintedColor);
- },
-
- set opacity(opacity)
- {
- if (opacity === this._opacity)
- return;
-
- this._opacity = opacity;
- this._updateColor();
- },
-
- get colorWheel()
- {
- return this._colorWheel;
- },
-
- get color()
- {
- return this._color;
- },
-
- set color(color)
- {
- this._dontUpdateColor = true;
-
- this._colorFormat = color.format;
-
- this._colorWheel.tintedColor = color;
- this._brightnessSlider.value = this._colorWheel.brightness;
-
- this._opacitySlider.value = color.alpha;
- this._updateSliders(this._colorWheel.rawColor, color);
-
- delete this._dontUpdateColor;
- },
-
- colorWheelColorDidChange: function(colorWheel)
- {
- this._updateColor();
- this._updateSliders(this._colorWheel.rawColor, this._colorWheel.tintedColor);
- },
-
- sliderValueDidChange: function(slider, value)
- {
- if (slider === this._opacitySlider)
- this.opacity = value;
- else if (slider === this._brightnessSlider)
- this.brightness = value;
- },
-
- // Private
-
- _updateColor: function()
- {
- if (this._dontUpdateColor)
- return;
-
- var opacity = Math.round(this._opacity * 100) / 100;
-
- var components;
- if (this._colorFormat === WebInspector.Color.Format.HSL || this._colorFormat === WebInspector.Color.Format.HSLA)
- components = this._colorWheel.tintedColor.hsl.concat(opacity);
- else
- components = this._colorWheel.tintedColor.rgb.concat(opacity);
-
- this._color = new WebInspector.Color(this._colorFormat, components);
- this.dispatchEventToListeners(WebInspector.ColorPicker.Event.ColorChanged, {color: this._color});
- },
-
- _updateSliders: function(rawColor, tintedColor)
- {
- var rgb = this._colorWheel.tintedColor.rgb;
- var opaque = new WebInspector.Color(WebInspector.Color.Format.RGBA, rgb.concat(1)).toString();
- var transparent = new WebInspector.Color(WebInspector.Color.Format.RGBA, rgb.concat(0)).toString();
-
- this._opacitySlider.element.style.backgroundImage = "linear-gradient(90deg, " + transparent + ", " + opaque + "), " + this._opacityPattern;
- this._brightnessSlider.element.style.backgroundImage = "linear-gradient(90deg, black, " + rawColor + ")";
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceColorWheelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ColorWheel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ColorWheel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ColorWheel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.color-wheel {
- position: relative;
-}
-
-.color-wheel > .crosshair {
- position: absolute;
- top: -4px;
- left: -3px;
- width: 5px;
- height: 5px;
- border: 1px solid black;
- border-radius: 3px;
- pointer-events: none;
- background-color: white;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceColorWheeljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,285 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ColorWheel = function()
-{
- WebInspector.Object.call(this);
-
- this._rawCanvas = document.createElement("canvas");
- this._tintedCanvas = document.createElement("canvas");
- this._finalCanvas = document.createElement("canvas");
-
- this._crosshair = document.createElement("div");
- this._crosshair.className = "crosshair";
-
- this._element = document.createElement("div");
- this._element.className = "color-wheel";
-
- this._element.appendChild(this._finalCanvas);
- this._element.appendChild(this._crosshair);
-
- this._finalCanvas.addEventListener("mousedown", this);
-}
-
-WebInspector.ColorWheel.prototype = {
- contructor: WebInspector.ColorWheel,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- set dimension(dimension)
- {
- this._finalCanvas.width = this._tintedCanvas.width = this._rawCanvas.width = dimension * window.devicePixelRatio;
- this._finalCanvas.height = this._tintedCanvas.height = this._rawCanvas.height = dimension * window.devicePixelRatio;
-
- this._finalCanvas.style.width = this._finalCanvas.style.height = dimension + "px";
-
- this._dimension = dimension;
- // We shrink the radius a bit for better anti-aliasing.
- this._radius = dimension / 2 - 2;
-
- this._setCrosshairPosition(new WebInspector.Point(dimension / 2, dimension / 2));
-
- this._drawRawCanvas();
- this._draw();
- },
-
- get element()
- {
- return this._element;
- },
-
- get brightness()
- {
- return this._brightness;
- },
-
- set brightness(brightness)
- {
- this._brightness = brightness;
- this._draw();
- },
-
- get tintedColor()
- {
- if (this._crosshairPosition)
- return this._colorAtPointWithBrightness(this._crosshairPosition.x * window.devicePixelRatio, this._crosshairPosition.y * window.devicePixelRatio, this._brightness);
-
- return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
- },
-
- set tintedColor(tintedColor)
- {
- var data = this._tintedColorToPointAndBrightness(tintedColor);
- this._setCrosshairPosition(data.point);
- this.brightness = data.brightness;
- },
-
- get rawColor()
- {
- if (this._crosshairPosition)
- return this._colorAtPointWithBrightness(this._crosshairPosition.x * window.devicePixelRatio, this._crosshairPosition.y * window.devicePixelRatio, 1);
-
- return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mousedown":
- this._handleMousedown(event);
- break;
- case "mousemove":
- this._handleMousemove(event);
- break;
- case "mouseup":
- this._handleMouseup(event);
- break;
- }
- },
-
- // Private
-
- _handleMousedown: function(event)
- {
- window.addEventListener("mousemove", this, true);
- window.addEventListener("mouseup", this, true);
-
- this._updateColorForMouseEvent(event);
- },
-
- _handleMousemove: function(event)
- {
- this._updateColorForMouseEvent(event);
- },
-
- _handleMouseup: function(event)
- {
- window.removeEventListener("mousemove", this, true);
- window.removeEventListener("mouseup", this, true);
- },
-
- _pointInCircleForEvent: function(event)
- {
- function distance(a, b)
- {
- return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
- }
-
- function angleFromCenterToPoint(center, point)
- {
- return Math.atan2(point.y - center.y, point.x - center.x);
- }
-
- function pointOnCircumference(c, r, a)
- {
- return new WebInspector.Point(c.x + r * Math.cos(a), c.y + r * Math.sin(a));
- }
-
- var dimension = this._dimension;
- var point = window.webkitConvertPointFromPageToNode(this._finalCanvas, new WebKitPoint(event.pageX, event.pageY));
- var center = new WebInspector.Point(dimension / 2, dimension / 2);
- if (distance(point, center) > this._radius) {
- var angle = angleFromCenterToPoint(center, point);
- point = pointOnCircumference(center, this._radius, angle);
- }
- return point;
- },
-
- _updateColorForMouseEvent: function(event)
- {
- var point = this._pointInCircleForEvent(event);
-
- this._setCrosshairPosition(point);
-
- if (this.delegate && typeof this.delegate.colorWheelColorDidChange === "function")
- this.delegate.colorWheelColorDidChange(this);
- },
-
- _setCrosshairPosition: function(point)
- {
- this._crosshairPosition = point;
- this._crosshair.style.webkitTransform = "translate(" + Math.round(point.x) + "px, " + Math.round(point.y) + "px)";
- },
-
- _tintedColorToPointAndBrightness: function(color)
- {
- var rgb = color.rgb;
- var hsv = WebInspector.Color.rgb2hsv(rgb[0], rgb[1], rgb[2]);
- var cosHue = Math.cos(hsv[0] * Math.PI / 180);
- var sinHue = Math.sin(hsv[0] * Math.PI / 180);
- var center = this._dimension / 2;
- var x = center + (center * cosHue * hsv[1]);
- var y = center - (center * sinHue * hsv[1]);
- return {
- point: new WebInspector.Point(x, y),
- brightness: hsv[2]
- };
- },
-
- _drawRawCanvas: function() {
- var ctx = this._rawCanvas.getContext("2d");
-
- var dimension = this._dimension * window.devicePixelRatio;
- var center = dimension / 2;
-
- ctx.fillStyle = "white";
- ctx.fillRect(0, 0, dimension, dimension);
-
- var imageData = ctx.getImageData(0, 0, dimension, dimension);
- var data = imageData.data;
- for (var j = 0; j < dimension; ++j) {
- for (var i = 0; i < dimension; ++i) {
- var color = this._colorAtPointWithBrightness(i, j, 1);
- if (!color)
- continue;
- var pos = (j * dimension + i) * 4;
- data[pos] = color.rgb[0];
- data[pos + 1] = color.rgb[1];
- data[pos + 2] = color.rgb[2];
- }
- }
- ctx.putImageData(imageData, 0, 0);
- },
-
- _colorAtPointWithBrightness: function(x, y, brightness)
- {
- var center = this._dimension / 2 * window.devicePixelRatio;
- var xDis = x - center;
- var yDis = y - center;
- var distance = Math.sqrt(xDis * xDis + yDis * yDis);
-
- if (distance - center > 0.001)
- return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
-
- var h = Math.atan2(y - center, center - x) * 180 / Math.PI;
- h = (h + 180) % 360;
- var v = brightness;
- var s = Math.max(0, distance) / center;
-
- var rgb = WebInspector.Color.hsv2rgb(h, s, v);
- return new WebInspector.Color(WebInspector.Color.Format.RGBA, [
- Math.round(rgb[0] * 255),
- Math.round(rgb[1] * 255),
- Math.round(rgb[2] * 255),
- 1
- ]);
- },
-
- _drawTintedCanvas: function()
- {
- var ctx = this._tintedCanvas.getContext("2d");
- var dimension = this._dimension * window.devicePixelRatio;
-
- ctx.save();
- ctx.drawImage(this._rawCanvas, 0, 0, dimension, dimension);
- if (this._brightness !== 1) {
- ctx.globalAlpha = 1 - this._brightness;
- ctx.fillStyle = "black";
- ctx.fillRect(0, 0, dimension, dimension);
- }
- ctx.restore();
- },
-
- _draw: function()
- {
- this._drawTintedCanvas();
-
- var ctx = this._finalCanvas.getContext("2d");
- var dimension = this._dimension * window.devicePixelRatio;
- var radius = this._radius * window.devicePixelRatio;
-
- ctx.save();
- ctx.clearRect(0, 0, dimension, dimension);
- ctx.beginPath();
- ctx.arc(dimension / 2, dimension / 2, radius + 1, 0, Math.PI * 2, true);
- ctx.closePath();
- ctx.clip();
- ctx.drawImage(this._tintedCanvas, 0, 0, dimension, dimension);
- ctx.restore();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,78 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.completion-suggestions {
- position: absolute;
- display: block;
-
- background-color: rgba(255, 255, 255, 0.9);
- border-radius: 5px;
-
- z-index: 100;
-
- margin-top: -1px;
- margin-left: -10px;
-
- box-shadow: rgba(0, 0, 0, 0.25) 0 5px 10px, rgba(0, 0, 0, 0.15) 0 0 0 1px;
-}
-
-.completion-suggestions > .completion-suggestions-container {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- overflow-x: hidden;
- overflow-y: auto;
-
- border-radius: 5px;
-}
-
-.completion-suggestions-container > .item {
- padding: 1px 10px;
- margin: 0;
-
- font-size: 11px;
- font-family: Menlo, monospace;
-
- line-height: 16px;
- height: 16px;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- color: black;
-}
-
-.completion-suggestions-container:not(:active) > .item.selected,
-.completion-suggestions-container > .item:active {
- box-shadow: inset rgb(87, 152, 206) 0 1px 0;
- background: -webkit-linear-gradient(top, rgb(110, 167, 216), rgb(36, 114, 181));
-
- color: white;
- text-shadow: rgb(51, 88, 123) 0 1px 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,228 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CompletionSuggestionsView = function(delegate)
-{
- WebInspector.Object.call(this);
-
- this._delegate = delegate || null;
-
- this._selectedIndex = NaN;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.CompletionSuggestionsView.StyleClassName;
-
- this._containerElement = document.createElement("div");
- this._containerElement.className = WebInspector.CompletionSuggestionsView.ContainerElementStyleClassName;
- this._containerElement.addEventListener("mousedown", this._mouseDown.bind(this));
- this._containerElement.addEventListener("mouseup", this._mouseUp.bind(this));
- this._containerElement.addEventListener("click", this._itemClicked.bind(this));
- this._element.appendChild(this._containerElement);
-};
-
-WebInspector.CompletionSuggestionsView.StyleClassName = "completion-suggestions";
-WebInspector.CompletionSuggestionsView.ContainerElementStyleClassName = "completion-suggestions-container";
-WebInspector.CompletionSuggestionsView.ItemElementStyleClassName = "item";
-WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName = "selected";
-
-WebInspector.CompletionSuggestionsView.prototype = {
- constructor: WebInspector.CompletionSuggestionsView,
-
- // Public
-
- get delegate()
- {
- return this._delegate;
- },
-
- get visible()
- {
- return !!this._element.parentNode;
- },
-
- get selectedIndex()
- {
- return this._selectedIndex;
- },
-
- set selectedIndex(index)
- {
- var selectedItemElement = this._selectedItemElement;
- if (selectedItemElement)
- selectedItemElement.classList.remove(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
-
- this._selectedIndex = index;
-
- selectedItemElement = this._selectedItemElement;
- if (!selectedItemElement)
- return;
-
- selectedItemElement.classList.add(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
- selectedItemElement.scrollIntoViewIfNeeded(false);
- },
-
- selectNext: function()
- {
- var count = this._containerElement.children.length;
-
- if (isNaN(this._selectedIndex) || this._selectedIndex === count - 1)
- this.selectedIndex = 0;
- else
- ++this.selectedIndex;
-
- var selectedItemElement = this._selectedItemElement;
- if (selectedItemElement && this._delegate && typeof this._delegate.completionSuggestionsSelectedCompletion === "function")
- this._delegate.completionSuggestionsSelectedCompletion(this, selectedItemElement.textContent);
- },
-
- selectPrevious: function()
- {
- if (isNaN(this._selectedIndex) || this._selectedIndex === 0)
- this.selectedIndex = this._containerElement.children.length - 1;
- else
- --this.selectedIndex;
-
- var selectedItemElement = this._selectedItemElement;
- if (selectedItemElement && this._delegate && typeof this._delegate.completionSuggestionsSelectedCompletion === "function")
- this._delegate.completionSuggestionsSelectedCompletion(this, selectedItemElement.textContent);
- },
-
- isHandlingClickEvent: function()
- {
- return this._mouseIsDown;
- },
-
- show: function(anchorBounds)
- {
- // Measure the container so we can know the intrinsic size of the items.
- this._containerElement.style.position = "absolute";
- document.body.appendChild(this._containerElement);
-
- var containerWidth = this._containerElement.offsetWidth;
- var containerHeight = this._containerElement.offsetHeight;
-
- this._containerElement.removeAttribute("style");
- this._element.appendChild(this._containerElement);
-
- // Lay out the suggest-box relative to the anchorBounds.
- const margin = 10;
- const horizontalPadding = 22;
- const absoluteMaximumHeight = 160;
-
- var x = anchorBounds.origin.x;
- var y = anchorBounds.origin.y + anchorBounds.size.height;
-
- var maximumWidth = window.innerWidth - anchorBounds.origin.x - margin;
- var width = Math.min(containerWidth, maximumWidth - horizontalPadding) + horizontalPadding;
- var paddedWidth = containerWidth + horizontalPadding;
-
- if (width < paddedWidth) {
- // Shift the suggest box to the left to accommodate the content without trimming to the BODY edge.
- maximumWidth = window.innerWidth - margin;
- width = Math.min(containerWidth, maximumWidth - horizontalPadding) + horizontalPadding;
- x = document.body.offsetWidth - width;
- }
-
- var aboveHeight = anchorBounds.origin.y;
- var underHeight = window.innerHeight - anchorBounds.origin.y - anchorBounds.size.height;
- var maximumHeight = Math.min(absoluteMaximumHeight, Math.max(underHeight, aboveHeight) - margin);
- var height = Math.min(containerHeight, maximumHeight);
-
- // Position the suggestions below the anchor. If there is no room, position the suggestions above.
- if (underHeight - height < 0)
- y = aboveHeight - height;
-
- this._element.style.left = x + "px";
- this._element.style.top = y + "px";
- this._element.style.width = width + "px";
- this._element.style.height = height + "px";
-
- document.body.appendChild(this._element);
- },
-
- hide: function()
- {
- this._element.remove();
- },
-
- update: function(completions, selectedIndex)
- {
- this._containerElement.removeChildren();
-
- if (typeof selectedIndex === "number")
- this._selectedIndex = selectedIndex;
-
- for (var i = 0; i < completions.length; ++i) {
- var itemElement = document.createElement("div");
- itemElement.className = WebInspector.CompletionSuggestionsView.ItemElementStyleClassName;
- itemElement.textContent = completions[i];
- if (i === this._selectedIndex)
- itemElement.classList.add(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
- this._containerElement.appendChild(itemElement);
- }
- },
-
- // Private
-
- get _selectedItemElement()
- {
- if (isNaN(this._selectedIndex))
- return null;
-
- var element = this._containerElement.children[this._selectedIndex] || null;
- console.assert(element);
- return element;
- },
-
- _mouseDown: function(event)
- {
- if (event.button !== 0)
- return;
- this._mouseIsDown = true;
- },
-
- _mouseUp: function(event)
- {
- if (event.button !== 0)
- return;
- this._mouseIsDown = false;
- },
-
- _itemClicked: function(event)
- {
- if (event.button !== 0)
- return;
-
- var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.CompletionSuggestionsView.ItemElementStyleClassName);
- console.assert(itemElement);
- if (!itemElement)
- return;
-
- if (this._delegate && typeof this._delegate.completionSuggestionsClickedCompletion === "function")
- this._delegate.completionSuggestionsClickedCompletion(this, itemElement.textContent);
- }
-};
-
-WebInspector.CompletionSuggestionsView.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.details-section > .content > .group > .row.simple.content-flow-link > .value > span > .icon {
- width: 12px;
- height: 12px;
- content: url(Images/ContentFlow.svg);
- margin-right: 4px;
- -webkit-user-select: none;
-}
-
-.details-section > .content > .group > .row.simple.content-flow-link span
-{
- vertical-align: top;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,219 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ComputedStyleDetailsPanel = function()
-{
- WebInspector.StyleDetailsPanel.call(this, WebInspector.ComputedStyleDetailsPanel.StyleClassName, "computed", WebInspector.UIString("Computed"));
-
- this._computedStyleShowAllSetting = new WebInspector.Setting("computed-style-show-all", false);
-
- var computedStyleShowAllLabel = document.createElement("label");
- computedStyleShowAllLabel.textContent = WebInspector.UIString("Show All");
-
- this._computedStyleShowAllCheckbox = document.createElement("input");
- this._computedStyleShowAllCheckbox.type = "checkbox";
- this._computedStyleShowAllCheckbox.checked = this._computedStyleShowAllSetting.value;
- this._computedStyleShowAllCheckbox.addEventListener("change", this._computedStyleShowAllCheckboxValueChanged.bind(this));
- computedStyleShowAllLabel.appendChild(this._computedStyleShowAllCheckbox);
-
- this._propertiesTextEditor = new WebInspector.CSSStyleDeclarationTextEditor(this);
- this._propertiesTextEditor.showsImplicitProperties = this._computedStyleShowAllSetting.value;
- this._propertiesTextEditor.alwaysShowPropertyNames = ["display", "width", "height"];
- this._propertiesTextEditor.sortProperties = true;
-
- var propertiesRow = new WebInspector.DetailsSectionRow;
- var propertiesGroup = new WebInspector.DetailsSectionGroup([propertiesRow]);
- var propertiesSection = new WebInspector.DetailsSection("computed-style-properties", WebInspector.UIString("Properties"), [propertiesGroup], computedStyleShowAllLabel);
-
- propertiesRow.element.appendChild(this._propertiesTextEditor.element);
-
- // Region flow name is used to display the "flow-from" property of the Region Containers.
- this._regionFlowFragment = document.createElement("span");
- this._regionFlowFragment.appendChild(document.createElement("img")).className = "icon";
- this._regionFlowNameLabelValue = this._regionFlowFragment.appendChild(document.createElement("span"));
-
- var goToRegionFlowButton = this._regionFlowFragment.appendChild(WebInspector.createGoToArrowButton());
- goToRegionFlowButton.addEventListener("click", this._goToRegionFlowArrowWasClicked.bind(this));
-
- this._regionFlowNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Region Flow"));
- this._regionFlowNameRow.element.classList.add("content-flow-link");
-
- // Content flow name is used to display the "flow-into" property of the Content nodes.
- this._contentFlowFragment = document.createElement("span");
- this._contentFlowFragment.appendChild(document.createElement("img")).className = "icon";
- this._contentFlowNameLabelValue = this._contentFlowFragment.appendChild(document.createElement("span"));
-
- var goToContentFlowButton = this._contentFlowFragment.appendChild(WebInspector.createGoToArrowButton());
- goToContentFlowButton.addEventListener("click", this._goToContentFlowArrowWasClicked.bind(this));
-
- this._contentFlowNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Content Flow"));
- this._contentFlowNameRow.element.classList.add("content-flow-link");
-
- var flowNamesGroup = new WebInspector.DetailsSectionGroup([this._regionFlowNameRow, this._contentFlowNameRow]);
- this._flowNamesSection = new WebInspector.DetailsSection("content-flow", WebInspector.UIString("Flows"), [flowNamesGroup]);
-
- this._containerRegionsDataGrid = new WebInspector.DOMTreeDataGrid;
- this._containerRegionsDataGrid.element.classList.add("no-header");
-
- var containerRegionsRow = new WebInspector.DetailsSectionDataGridRow(this._containerRegionsDataGrid);
- var containerRegionsGroup = new WebInspector.DetailsSectionGroup([containerRegionsRow]);
- this._containerRegionsFlowSection = new WebInspector.DetailsSection("container-regions", WebInspector.UIString("Container Regions"), [containerRegionsGroup]);
-
- this.element.appendChild(propertiesSection.element);
- this.element.appendChild(this._flowNamesSection.element);
- this.element.appendChild(this._containerRegionsFlowSection.element);
-
- this._resetFlowDetails();
-};
-
-WebInspector.ComputedStyleDetailsPanel.StyleClassName = "computed";
-
-WebInspector.ComputedStyleDetailsPanel.prototype = {
- constructor: WebInspector.ComputedStyleDetailsPanel,
-
- // Public
-
- get regionFlow()
- {
- return this._regionFlow;
- },
-
- set regionFlow(regionFlow)
- {
- this._regionFlow = regionFlow;
- this._regionFlowNameLabelValue.textContent = regionFlow ? regionFlow.name : "";
- this._regionFlowNameRow.value = regionFlow ? this._regionFlowFragment : null;
- this._updateFlowNamesSectionVisibility();
- },
-
- get contentFlow()
- {
- return this._contentFlow;
- },
-
- set contentFlow(contentFlow)
- {
- this._contentFlow = contentFlow;
- this._contentFlowNameLabelValue.textContent = contentFlow ? contentFlow.name : "";
- this._contentFlowNameRow.value = contentFlow ? this._contentFlowFragment : null;
- this._updateFlowNamesSectionVisibility();
- },
-
- get containerRegions()
- {
- return this._containerRegions;
- },
-
- set containerRegions(regions)
- {
- this._containerRegions = regions;
-
- if (!regions || !regions.length) {
- this._containerRegionsFlowSection.element.classList.add("hidden");
- return;
- }
-
- this._containerRegionsDataGrid.removeChildren();
- for (var regionNode of regions)
- this._containerRegionsDataGrid.appendChild(new WebInspector.DOMTreeDataGridNode(regionNode));
-
- this._containerRegionsFlowSection.element.classList.remove("hidden");
- },
-
- refresh: function()
- {
- this._propertiesTextEditor.style = this.nodeStyles.computedStyle;
- this._refreshFlowDetails(this.nodeStyles.node);
- },
-
- // Protected
-
- shown: function()
- {
- WebInspector.StyleDetailsPanel.prototype.shown.call(this);
-
- this._propertiesTextEditor.updateLayout();
- },
-
- widthDidChange: function()
- {
- this._propertiesTextEditor.updateLayout();
- },
-
- // Private
-
- _computedStyleShowAllCheckboxValueChanged: function(event)
- {
- var checked = this._computedStyleShowAllCheckbox.checked;
- this._computedStyleShowAllSetting.value = checked;
- this._propertiesTextEditor.showsImplicitProperties = checked;
- },
-
- _updateFlowNamesSectionVisibility: function()
- {
- this._flowNamesSection.element.classList.toggle("hidden", !this._contentFlow && !this._regionFlow);
- },
-
- _resetFlowDetails : function()
- {
- this.regionFlow = null;
- this.contentFlow = null;
- this.containerRegions = null;
- },
-
- _refreshFlowDetails: function(domNode)
- {
- this._resetFlowDetails();
- if (!domNode)
- return;
-
- function contentFlowInfoReady(error, flowData)
- {
- // Element is not part of any flow.
- if (error || !flowData) {
- this._resetFlowDetails();
- return;
- }
-
- this.regionFlow = flowData.regionFlow;
- this.contentFlow = flowData.contentFlow;
- this.containerRegions = flowData.regions;
- }
-
- WebInspector.domTreeManager.getNodeContentFlowInfo(domNode, contentFlowInfoReady.bind(this));
- },
-
- _goToRegionFlowArrowWasClicked: function()
- {
- WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._regionFlow);
- },
-
- _goToContentFlowArrowWasClicked: function()
- {
- WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node, true);
- }
-};
-
-WebInspector.ComputedStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleCommandjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleCommand.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleCommand.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleCommand.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleCommand = function(command)
-{
- WebInspector.Object.call(this);
-
- this.command = command;
-};
-
-WebInspector.ConsoleCommand.prototype = {
- constructor: WebInspector.ConsoleCommand,
-
- // Public
-
- clearHighlight: function()
- {
- var highlightedMessage = this._formattedCommand;
- delete this._formattedCommand;
- this._formatCommand();
- this._element.replaceChild(this._formattedCommand, highlightedMessage);
- },
-
- highlightSearchResults: function(regexObject)
- {
- regexObject.lastIndex = 0;
- var text = this.command;
- var match = regexObject.exec(text);
- var offset = 0;
- var matchRanges = [];
- while (match) {
- matchRanges.push({ offset: match.index, length: match[0].length });
- match = regexObject.exec(text);
- }
- highlightSearchResults(this._formattedCommand, matchRanges);
- this._element.scrollIntoViewIfNeeded();
- },
-
- matchesRegex: function(regexObject)
- {
- return regexObject.test(this.command);
- },
-
- toMessageElement: function()
- {
- if (!this._element) {
- this._element = document.createElement("div");
- this._element.command = this;
- this._element.className = "console-user-command";
- this._element.setAttribute("data-labelprefix", WebInspector.UIString("Input: "));
-
- this._formatCommand();
- this._element.appendChild(this._formattedCommand);
- }
- return this._element;
- },
-
- // Private
-
- _formatCommand: function()
- {
- this._formattedCommand = document.createElement("span");
- this._formattedCommand.className = "console-message-text source-code";
- this._formattedCommand.textContent = this.command;
- },
-
- toClipboardString: function(isPrefixOptional)
- {
- return (isPrefixOptional ? "" : "> ") + this.command;
- }
-};
-
-WebInspector.ConsoleCommand.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleCommandResultjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleCommandResult.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleCommandResult.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleCommandResult.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleCommandResult = function(result, wasThrown, originatingCommand)
-{
- var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
- this.originatingCommand = originatingCommand;
-
- WebInspector.ConsoleMessageImpl.call(this, WebInspector.ConsoleMessage.MessageSource.JS, level, "", null, WebInspector.ConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]);
-};
-
-WebInspector.ConsoleCommandResult.prototype = {
- constructor: WebInspector.ConsoleCommandResult,
-
- // Public
-
- enforcesClipboardPrefixString: false,
-
- toMessageElement: function()
- {
- var element = WebInspector.ConsoleMessageImpl.prototype.toMessageElement.call(this);
- element.classList.add("console-user-command-result");
- if (!element.getAttribute("data-labelprefix"))
- element.setAttribute("data-labelprefix", WebInspector.UIString("Output: "));
- return element;
- },
-
- get clipboardPrefixString()
- {
- return "< ";
- }
-};
-
-WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessageImpl.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleGroupjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleGroup.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleGroup.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,101 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleGroup = function(parentGroup, isNewSession)
-{
- WebInspector.Object.call(this);
-
- this.parentGroup = parentGroup;
-
- var element = document.createElement("div");
- element.className = "console-group";
- element.group = this;
- this.element = element;
-
- if (isNewSession)
- element.classList.add("new-session");
-
- var messagesElement = document.createElement("div");
- messagesElement.className = "console-group-messages";
- element.appendChild(messagesElement);
- this.messagesElement = messagesElement;
-};
-
-WebInspector.ConsoleGroup.prototype = {
- constructor: WebInspector.ConsoleGroup,
-
- // Public
-
- addMessage: function(msg)
- {
- var element = msg.toMessageElement();
-
- var wrapper = document.createElement("div");
- wrapper.className = WebInspector.LogContentView.ItemWrapperStyleClassName;
- wrapper.messageElement = wrapper.appendChild(element);
-
- if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
- this.messagesElement.parentNode.insertBefore(wrapper, this.messagesElement);
- element.addEventListener("click", this._titleClicked.bind(this));
- element.addEventListener("mousedown", this._titleMouseDown.bind(this));
- var groupElement = element.enclosingNodeOrSelfWithClass("console-group");
- if (groupElement && msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
- groupElement.classList.add("collapsed");
- } else
- this.messagesElement.appendChild(wrapper);
- },
-
- hasMessages: function()
- {
- return !!this.messagesElement.childNodes.length;
- },
-
- // Private
-
- _titleMouseDown: function(event)
- {
- event.preventDefault();
- },
-
- _titleClicked: function(event)
- {
- var groupTitleElement = event.target.enclosingNodeOrSelfWithClass("console-group-title");
- if (groupTitleElement) {
- var groupElement = groupTitleElement.enclosingNodeOrSelfWithClass("console-group");
- if (groupElement)
- if (groupElement.classList.contains("collapsed"))
- groupElement.classList.remove("collapsed");
- else
- groupElement.classList.add("collapsed");
- groupTitleElement.scrollIntoViewIfNeeded(true);
- }
- }
-};
-
-WebInspector.ConsoleGroup.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleMessagejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleMessage.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleMessage.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleMessage.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,115 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleMessage = function(source, level, url, line, column, repeatCount)
-{
- this.source = source;
- this.level = level;
- this.url = url || null;
- this.line = line || 0;
- this.column = column || 0;
-
- repeatCount = repeatCount || 1;
- this.repeatCount = repeatCount;
- this.repeatDelta = repeatCount;
- this.totalRepeatCount = repeatCount;
-}
-
-WebInspector.ConsoleMessage.prototype = {
- /**
- * @return {boolean}
- */
- isErrorOrWarning: function()
- {
- return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error);
- },
-
- updateRepeatCount: function()
- {
- // Implemented by concrete instances
- },
-
- /**
- * @return {WebInspector.ConsoleMessage}
- */
- clone: function()
- {
- // Implemented by concrete instances
- }
-}
-
-/**
- * @param {string} source
- * @param {string} level
- * @param {string} message
- * @param {string=} type
- * @param {string=} url
- * @param {number=} line
- * @param {number=} repeatCount
- * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
- * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.Resource=} request
- *
- * @return {WebInspector.ConsoleMessage}
- */
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, column, repeatCount, parameters, stackTrace, request)
-{
- return new WebInspector.ConsoleMessageImpl(source, level, message, null, type, url, line, column, repeatCount, parameters, stackTrace, request);
-}
-
-// Note: Keep these constants in sync with the ones in Console.h
-WebInspector.ConsoleMessage.MessageSource = {
- HTML: "html",
- XML: "xml",
- JS: "javascript",
- Network: "network",
- ConsoleAPI: "console-api",
- Other: "other"
-};
-
-WebInspector.ConsoleMessage.MessageType = {
- Log: "log",
- Dir: "dir",
- DirXML: "dirxml",
- Trace: "trace",
- StartGroup: "startGroup",
- StartGroupCollapsed: "startGroupCollapsed",
- EndGroup: "endGroup",
- Assert: "assert",
- Result: "result"
-};
-
-WebInspector.ConsoleMessage.MessageLevel = {
- Tip: "tip",
- Log: "log",
- Warning: "warning",
- Error: "error",
- Debug: "debug"
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleMessageImpljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,735 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, column, repeatCount, parameters, stackTrace, request)
-{
- WebInspector.ConsoleMessage.call(this, source, level, url, line, column, repeatCount);
-
- this._linkifier = linkifier;
- this.type = type || WebInspector.ConsoleMessage.MessageType.Log;
- this._messageText = message;
- this._parameters = parameters;
- this._stackTrace = stackTrace;
- this._request = request;
-
- this._customFormatters = {
- "object": this._formatParameterAsObject,
- "array": this._formatParameterAsArray,
- "node": this._formatParameterAsNode,
- "string": this._formatParameterAsString
- };
-}
-
-WebInspector.ConsoleMessageImpl.prototype = {
-
- enforcesClipboardPrefixString: true,
-
- _formatMessage: function()
- {
- this._formattedMessage = document.createElement("span");
- this._formattedMessage.className = "console-message-text source-code";
-
- var messageText;
- if (this.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI) {
- switch (this.type) {
- case WebInspector.ConsoleMessage.MessageType.Trace:
- messageText = document.createTextNode("console.trace()");
- break;
- case WebInspector.ConsoleMessage.MessageType.Assert:
- var args = [WebInspector.UIString("Assertion failed:")];
- if (this._parameters)
- args = args.concat(this._parameters);
- messageText = this._format(args);
- break;
- case WebInspector.ConsoleMessage.MessageType.Dir:
- var obj = this._parameters ? this._parameters[0] : undefined;
- var args = ["%O", obj];
- messageText = this._format(args);
- break;
- default:
- var args = this._parameters || [this._messageText];
- messageText = this._format(args);
- }
- } else if (this.source === WebInspector.ConsoleMessage.MessageSource.Network) {
- if (this._request) {
- this._stackTrace = this._request.stackTrace;
- if (this._request.initiator && this._request.initiator.url) {
- this.url = this._request.initiator.url;
- this.line = this._request.initiator.lineNumber;
- }
- messageText = document.createElement("span");
- if (this.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
- messageText.appendChild(document.createTextNode(this._request.requestMethod + " "));
- messageText.appendChild(WebInspector.linkifyRequestAsNode(this._request));
- if (this._request.failed)
- messageText.appendChild(document.createTextNode(" " + this._request.localizedFailDescription));
- else
- messageText.appendChild(document.createTextNode(" " + this._request.statusCode + " (" + this._request.statusText + ")"));
- } else {
- var fragment = WebInspector.linkifyStringAsFragmentWithCustomLinkifier(this._messageText, WebInspector.linkifyRequestAsNode.bind(null, this._request, ""));
- messageText.appendChild(fragment);
- }
- } else {
- if (this.url) {
- var anchor = WebInspector.linkifyURLAsNode(this.url, this.url, "console-message-url");
- this._formattedMessage.appendChild(anchor);
- }
- messageText = this._format([this._messageText]);
- }
- } else {
- var args = this._parameters || [this._messageText];
- messageText = this._format(args);
- }
-
- if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network || this._request) {
- var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
- if (firstNonNativeCallFrame) {
- var urlElement = this._linkifyCallFrame(firstNonNativeCallFrame);
- this._formattedMessage.appendChild(urlElement);
- } else if (this.url && !this._shouldHideURL(this.url)) {
- var urlElement = this._linkifyLocation(this.url, this.line, this.column);
- this._formattedMessage.appendChild(urlElement);
- }
- }
-
- this._formattedMessage.appendChild(messageText);
-
- if (this._shouldDumpStackTrace()) {
- var ol = document.createElement("ol");
- ol.className = "outline-disclosure";
- var treeOutline = new TreeOutline(ol);
-
- var content = this._formattedMessage;
- var root = new TreeElement(content, null, true);
- content.treeElementForTest = root;
- treeOutline.appendChild(root);
- if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)
- root.expand();
-
- this._populateStackTraceTreeElement(root);
- this._formattedMessage = ol;
- }
-
- // This is used for inline message bubbles in SourceFrames, or other plain-text representations.
- this._message = messageText.textContent;
- },
-
- _shouldDumpStackTrace: function()
- {
- return !!this._stackTrace && this._stackTrace.length && (this.source === WebInspector.ConsoleMessage.MessageSource.Network || this.level === WebInspector.ConsoleMessage.MessageLevel.Error || this.type === WebInspector.ConsoleMessage.MessageType.Trace);
- },
-
- _shouldHideURL: function(url)
- {
- return url === "undefined" || url === "[native code]";
- },
-
- _firstNonNativeCallFrame: function()
- {
- if (!this._stackTrace)
- return null;
-
- for (var i = 0; i < this._stackTrace.length; i++) {
- var frame = this._stackTrace[i];
- if (!frame.url || frame.url === "[native code]")
- continue;
- return frame;
- }
-
- return null;
- },
-
- get message()
- {
- // force message formatting
- var formattedMessage = this.formattedMessage;
- return this._message;
- },
-
- get formattedMessage()
- {
- if (!this._formattedMessage)
- this._formatMessage();
- return this._formattedMessage;
- },
-
- _linkifyLocation: function(url, lineNumber, columnNumber)
- {
- // ConsoleMessage stack trace line numbers are one-based.
- lineNumber = lineNumber ? lineNumber - 1 : 0;
-
- return WebInspector.linkifyLocation(url, lineNumber, columnNumber, "console-message-url");
- },
-
- _linkifyCallFrame: function(callFrame)
- {
- return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
- },
-
- isErrorOrWarning: function()
- {
- return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error);
- },
-
- _format: function(parameters)
- {
- // This node is used like a Builder. Values are continually appended onto it.
- var formattedResult = document.createElement("span");
- if (!parameters.length)
- return formattedResult;
-
- // Formatting code below assumes that parameters are all wrappers whereas frontend console
- // API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.
- for (var i = 0; i < parameters.length; ++i) {
- // FIXME: Only pass runtime wrappers here.
- if (parameters[i] instanceof WebInspector.RemoteObject)
- continue;
-
- if (typeof parameters[i] === "object")
- parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
- else
- parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
- }
-
- // There can be string log and string eval result. We distinguish between them based on message type.
- var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
-
- // Multiple parameters with the first being a format string. Save unused substitutions.
- if (shouldFormatMessage) {
- // Multiple parameters with the first being a format string. Save unused substitutions.
- var result = this._formatWithSubstitutionString(parameters, formattedResult);
- parameters = result.unusedSubstitutions;
- if (parameters.length)
- formattedResult.appendChild(document.createTextNode(" "));
- }
-
- // Single parameter, or unused substitutions from above.
- for (var i = 0; i < parameters.length; ++i) {
- // Inline strings when formatting.
- if (shouldFormatMessage && parameters[i].type === "string")
- formattedResult.appendChild(document.createTextNode(parameters[i].description));
- else
- formattedResult.appendChild(this._formatParameter(parameters[i]));
- if (i < parameters.length - 1)
- formattedResult.appendChild(document.createTextNode(" "));
- }
- return formattedResult;
- },
-
- /**
- * @param {boolean=} forceObjectFormat
- */
- _formatParameter: function(output, forceObjectFormat)
- {
- var type;
- if (forceObjectFormat)
- type = "object";
- else if (output instanceof WebInspector.RemoteObject)
- type = output.subtype || output.type;
- else
- type = typeof output;
-
- var formatter = this._customFormatters[type];
- if (!formatter) {
- formatter = this._formatParameterAsValue;
- output = output.description;
- }
-
- var span = document.createElement("span");
- span.className = "console-formatted-" + type + " source-code";
- formatter.call(this, output, span);
- return span;
- },
-
- _formatParameterAsValue: function(val, elem)
- {
- elem.appendChild(document.createTextNode(val));
- },
-
- _formatParameterAsObject: function(obj, elem)
- {
- elem.appendChild(new WebInspector.ObjectPropertiesSection(obj, obj.description).element);
- },
-
- _formatParameterAsNode: function(object, elem)
- {
- function printNode(nodeId)
- {
- if (!nodeId) {
- // Sometimes DOM is loaded after the sync message is being formatted, so we get no
- // nodeId here. So we fall back to object formatting here.
- this._formatParameterAsObject(object, elem);
- return;
- }
- var treeOutline = new WebInspector.DOMTreeOutline(false, false, true);
- treeOutline.setVisible(true);
- treeOutline.rootDOMNode = WebInspector.domTreeManager.nodeForId(nodeId);
- treeOutline.element.classList.add("outline-disclosure");
- if (!treeOutline.children[0].hasChildren)
- treeOutline.element.classList.add("single-node");
- elem.appendChild(treeOutline.element);
- }
- object.pushNodeToFrontend(printNode.bind(this));
- },
-
- _formatParameterAsArray: function(arr, elem)
- {
- arr.getOwnProperties(this._printArray.bind(this, arr, elem));
- },
-
- _formatParameterAsString: function(output, elem)
- {
- var span = document.createElement("span");
- span.className = "console-formatted-string source-code";
- span.appendChild(WebInspector.linkifyStringAsFragment(output.description));
-
- // Make black quotes.
- elem.classList.remove("console-formatted-string");
- elem.appendChild(document.createTextNode("\""));
- elem.appendChild(span);
- elem.appendChild(document.createTextNode("\""));
- },
-
- _printArray: function(array, elem, properties)
- {
- if (!properties)
- return;
-
- var elements = [];
- for (var i = 0; i < properties.length; ++i) {
- var property = properties[i];
- var name = property.name;
- if (!isNaN(name))
- elements[name] = this._formatAsArrayEntry(property.value);
- }
-
- elem.appendChild(document.createTextNode("["));
- var lastNonEmptyIndex = -1;
-
- function appendUndefined(elem, index)
- {
- if (index - lastNonEmptyIndex <= 1)
- return;
- var span = elem.createChild("span", "console-formatted-undefined");
- span.textContent = WebInspector.UIString("undefined × %d").format(index - lastNonEmptyIndex - 1);
- }
-
- var length = array.arrayLength();
- for (var i = 0; i < length; ++i) {
- var element = elements[i];
- if (!element)
- continue;
-
- if (i - lastNonEmptyIndex > 1) {
- appendUndefined(elem, i);
- elem.appendChild(document.createTextNode(", "));
- }
-
- elem.appendChild(element);
- lastNonEmptyIndex = i;
- if (i < length - 1)
- elem.appendChild(document.createTextNode(", "));
- }
- appendUndefined(elem, length);
-
- elem.appendChild(document.createTextNode("]"));
- },
-
- _formatAsArrayEntry: function(output)
- {
- // Prevent infinite expansion of cross-referencing arrays.
- return this._formatParameter(output, output.subtype && output.subtype === "array");
- },
-
- _formatWithSubstitutionString: function(parameters, formattedResult)
- {
- var formatters = {};
-
- function parameterFormatter(force, obj)
- {
- return this._formatParameter(obj, force);
- }
-
- function stringFormatter(obj)
- {
- return obj.description;
- }
-
- function floatFormatter(obj)
- {
- if (typeof obj.value !== "number")
- return parseFloat(obj.description);
- return obj.value;
- }
-
- function integerFormatter(obj)
- {
- if (typeof obj.value !== "number")
- return parseInt(obj.description);
- return Math.floor(obj.value);
- }
-
- var currentStyle = null;
- function styleFormatter(obj)
- {
- currentStyle = {};
- var buffer = document.createElement("span");
- buffer.setAttribute("style", obj.description);
- for (var i = 0; i < buffer.style.length; i++) {
- var property = buffer.style[i];
- if (isWhitelistedProperty(property))
- currentStyle[property] = buffer.style[property];
- }
- }
-
- function isWhitelistedProperty(property)
- {
- var prefixes = ["background", "border", "color", "font", "line", "margin", "padding", "text", "-webkit-background", "-webkit-border", "-webkit-font", "-webkit-margin", "-webkit-padding", "-webkit-text"];
- for (var i = 0; i < prefixes.length; i++) {
- if (property.startsWith(prefixes[i]))
- return true;
- }
- return false;
- }
-
- // Firebug uses %o for formatting objects.
- formatters.o = parameterFormatter.bind(this, false);
- formatters.s = stringFormatter;
- formatters.f = floatFormatter;
-
- // Firebug allows both %i and %d for formatting integers.
- formatters.i = integerFormatter;
- formatters.d = integerFormatter;
-
- // Firebug uses %c for styling the message.
- formatters.c = styleFormatter;
-
- // Support %O to force object formatting, instead of the type-based %o formatting.
- formatters.O = parameterFormatter.bind(this, true);
-
- function append(a, b)
- {
- if (b instanceof Node)
- a.appendChild(b);
- else if (b) {
- var toAppend = WebInspector.linkifyStringAsFragment(b.toString());
- if (currentStyle) {
- var wrapper = document.createElement("span");
- for (var key in currentStyle)
- wrapper.style[key] = currentStyle[key];
- wrapper.appendChild(toAppend);
- toAppend = wrapper;
- }
- a.appendChild(toAppend);
- }
- return a;
- }
-
- // String.format does treat formattedResult like a Builder, result is an object.
- return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
- },
-
- clearHighlight: function()
- {
- if (!this._formattedMessage)
- return;
-
- var highlightedMessage = this._formattedMessage;
- delete this._formattedMessage;
- this._formatMessage();
- this._element.replaceChild(this._formattedMessage, highlightedMessage);
- },
-
- highlightSearchResults: function(regexObject)
- {
- if (!this._formattedMessage)
- return;
-
- regexObject.lastIndex = 0;
- var text = this.message;
- var match = regexObject.exec(text);
- var offset = 0;
- var matchRanges = [];
- while (match) {
- matchRanges.push({ offset: match.index, length: match[0].length });
- match = regexObject.exec(text);
- }
- highlightSearchResults(this._formattedMessage, matchRanges);
- this._element.scrollIntoViewIfNeeded();
- },
-
- matchesRegex: function(regexObject)
- {
- return regexObject.test(this.message);
- },
-
- toMessageElement: function()
- {
- if (this._element)
- return this._element;
-
- var element = document.createElement("div");
- element.message = this;
- element.className = "console-message";
-
- this._element = element;
-
- switch (this.level) {
- case WebInspector.ConsoleMessage.MessageLevel.Tip:
- element.classList.add("console-tip-level");
- element.setAttribute("data-labelprefix", WebInspector.UIString("Tip: "));
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Log:
- element.classList.add("console-log-level");
- element.setAttribute("data-labelprefix", WebInspector.UIString("Log: "));
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Debug:
- element.classList.add("console-debug-level");
- element.setAttribute("data-labelprefix", WebInspector.UIString("Debug: "));
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Warning:
- element.classList.add("console-warning-level");
- element.setAttribute("data-labelprefix", WebInspector.UIString("Warning: "));
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Error:
- element.classList.add("console-error-level");
- element.setAttribute("data-labelprefix", WebInspector.UIString("Error: "));
- break;
- }
-
- if (this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
- element.classList.add("console-group-title");
-
- element.appendChild(this.formattedMessage);
-
- if (this.repeatCount > 1)
- this.updateRepeatCount();
-
- return element;
- },
-
- _populateStackTraceTreeElement: function(parentTreeElement)
- {
- for (var i = 0; i < this._stackTrace.length; i++) {
- var frame = this._stackTrace[i];
-
- var content = document.createElement("div");
- var messageTextElement = document.createElement("span");
- messageTextElement.className = "console-message-text source-code";
- var functionName = frame.functionName || WebInspector.UIString("(anonymous function)");
- messageTextElement.appendChild(document.createTextNode(functionName));
- content.appendChild(messageTextElement);
-
- if (frame.url && !this._shouldHideURL(frame.url)) {
- var urlElement = this._linkifyCallFrame(frame);
- content.appendChild(urlElement);
- }
-
- var treeElement = new TreeElement(content);
- parentTreeElement.appendChild(treeElement);
- }
- },
-
- updateRepeatCount: function() {
- if (!this.repeatCountElement) {
- this.repeatCountElement = document.createElement("span");
- this.repeatCountElement.className = "bubble";
-
- this._element.insertBefore(this.repeatCountElement, this._element.firstChild);
- }
- this.repeatCountElement.textContent = this.repeatCount;
- },
-
- toString: function()
- {
- var sourceString;
- switch (this.source) {
- case WebInspector.ConsoleMessage.MessageSource.HTML:
- sourceString = "HTML";
- break;
- case WebInspector.ConsoleMessage.MessageSource.XML:
- sourceString = "XML";
- break;
- case WebInspector.ConsoleMessage.MessageSource.JS:
- sourceString = "JS";
- break;
- case WebInspector.ConsoleMessage.MessageSource.Network:
- sourceString = "Network";
- break;
- case WebInspector.ConsoleMessage.MessageSource.ConsoleAPI:
- sourceString = "ConsoleAPI";
- break;
- case WebInspector.ConsoleMessage.MessageSource.Other:
- sourceString = "Other";
- break;
- }
-
- var typeString;
- switch (this.type) {
- case WebInspector.ConsoleMessage.MessageType.Log:
- typeString = "Log";
- break;
- case WebInspector.ConsoleMessage.MessageType.Dir:
- typeString = "Dir";
- break;
- case WebInspector.ConsoleMessage.MessageType.DirXML:
- typeString = "Dir XML";
- break;
- case WebInspector.ConsoleMessage.MessageType.Trace:
- typeString = "Trace";
- break;
- case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
- case WebInspector.ConsoleMessage.MessageType.StartGroup:
- typeString = "Start Group";
- break;
- case WebInspector.ConsoleMessage.MessageType.EndGroup:
- typeString = "End Group";
- break;
- case WebInspector.ConsoleMessage.MessageType.Assert:
- typeString = "Assert";
- break;
- case WebInspector.ConsoleMessage.MessageType.Result:
- typeString = "Result";
- break;
- }
-
- return sourceString + " " + typeString + " " + this.levelString + ": " + this.formattedMessage.textContent + "\n" + this.url + " line " + this.line;
- },
-
- get text()
- {
- return this._messageText;
- },
-
- isEqual: function(msg)
- {
- if (!msg)
- return false;
-
- if (this._stackTrace) {
- if (!msg._stackTrace)
- return false;
- var l = this._stackTrace;
- var r = msg._stackTrace;
- for (var i = 0; i < l.length; i++) {
- if (l[i].url !== r[i].url ||
- l[i].functionName !== r[i].functionName ||
- l[i].lineNumber !== r[i].lineNumber ||
- l[i].columnNumber !== r[i].columnNumber)
- return false;
- }
- }
-
- return (this.source === msg.source)
- && (this.type === msg.type)
- && (this.level === msg.level)
- && (this.line === msg.line)
- && (this.url === msg.url)
- && (this.message === msg.message)
- && (this._request === msg._request);
- },
-
- get stackTrace()
- {
- return this._stackTrace;
- },
-
- /**
- * @return {WebInspector.ConsoleMessage}
- */
- clone: function()
- {
- return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.column, this.repeatCount, this._parameters, this._stackTrace, this._request);
- },
-
- get levelString()
- {
- switch (this.level) {
- case WebInspector.ConsoleMessage.MessageLevel.Tip:
- return "Tip";
- case WebInspector.ConsoleMessage.MessageLevel.Log:
- return "Log";
- case WebInspector.ConsoleMessage.MessageLevel.Warning:
- return "Warning";
- case WebInspector.ConsoleMessage.MessageLevel.Debug:
- return "Debug";
- case WebInspector.ConsoleMessage.MessageLevel.Error:
- return "Error";
- }
- },
-
- get clipboardPrefixString()
- {
- return "[" + this.levelString + "] ";
- },
-
- toClipboardString: function(isPrefixOptional)
- {
- var isTrace = this._shouldDumpStackTrace();
-
- var clipboardString = "";
- if (this._formattedMessage && !isTrace)
- clipboardString = this._formattedMessage.querySelector("span").innerText;
- else
- clipboardString = this.type === WebInspector.ConsoleMessage.MessageType.Trace ? "console.trace()" : this._message || this._messageText;
-
- if (!isPrefixOptional || this.enforcesClipboardPrefixString)
- clipboardString = this.clipboardPrefixString + clipboardString;
-
- if (isTrace) {
- this._stackTrace.forEach(function(frame) {
- clipboardString += "\n\t" + (frame.functionName || WebInspector.UIString("(anonymous function)"));
- if (frame.url)
- clipboardString += " (" + WebInspector.displayNameForURL(frame.url) + ", line " + frame.lineNumber + ")";
- });
- } else {
- var repeatString = this.repeatCount > 1 ? "x" + this.repeatCount : "";
-
- var urlLine = "";
- if (this.url) {
- var components = [WebInspector.displayNameForURL(this.url), "line " + this.line];
- if (repeatString)
- components.push(repeatString);
- urlLine = " (" + components.join(", ") + ")";
- } else if (repeatString)
- urlLine = " (" + repeatString + ")";
-
- if (urlLine) {
- var lines = clipboardString.split("\n");
- lines[0] += urlLine;
- clipboardString = lines.join("\n");
- }
- }
-
- return clipboardString;
- }
-}
-
-WebInspector.ConsoleMessageImpl.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ConsoleObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.ConsoleObserver.prototype = {
- constructor: WebInspector.ConsoleObserver,
-
- // Events defined by the "Console" domain.
-
- messageAdded: function(message)
- {
- if (message.level === "warning" || message.level === "error")
- WebInspector.issueManager.issueWasAdded(message.source, message.level, message.text, message.url, message.line, message.column || 0, message.parameters);
-
- if (message.url === "[native code]") {
- if (message.type === "profile")
- WebInspector.legacyProfileManager.profileWasStartedFromConsole(message.text);
- else if (message.type === "profileEnd")
- WebInspector.legacyProfileManager.profileWasEndedFromConsole();
- }
-
- if (message.source === "console-api" && message.type === "clear")
- return;
-
- WebInspector.logManager.messageWasAdded(message.source, message.level, message.text, message.type, message.url, message.line, message.column || 0, message.repeatCount, message.parameters, message.stackTrace, message.networkRequestId);
- },
-
- messageRepeatCountUpdated: function(count)
- {
- WebInspector.logManager.messageRepeatCountUpdated(count);
- },
-
- messagesCleared: function()
- {
- WebInspector.logManager.messagesCleared();
- }
-};
-
-WebInspector.ConsoleObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsolePromptcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.console-prompt {
- background-color: white;
-}
-
-.console-prompt > .CodeMirror {
- width: 100%;
- height: auto;
-}
-
-.console-prompt > .CodeMirror-scroll {
- overflow: hidden;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsolePromptjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,294 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ConsolePrompt = function(delegate, mimeType, element)
-{
- WebInspector.Object.call(this);
-
- mimeType = parseMIMEType(mimeType).type;
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.ConsolePrompt.StyleClassName);
- this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- this._delegate = delegate || null;
-
- this._codeMirror = CodeMirror(this.element, {
- lineWrapping: true,
- mode: mimeType,
- indentWithTabs: true,
- indentUnit: 4,
- matchBrackets: true
- });
-
- var keyMap = {
- "Up": this._handlePreviousKey.bind(this),
- "Down": this._handleNextKey.bind(this),
- "Ctrl-P": this._handlePreviousKey.bind(this),
- "Ctrl-N": this._handleNextKey.bind(this),
- "Enter": this._handleEnterKey.bind(this),
- "Cmd-Enter": this._handleCommandEnterKey.bind(this)
- };
-
- this._codeMirror.addKeyMap(keyMap);
-
- this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
- this._completionController.addExtendedCompletionProvider("javascript", WebInspector.javaScriptRuntimeCompletionProvider);
-
- this._history = [{}];
- this._historyIndex = 0;
-};
-
-WebInspector.ConsolePrompt.StyleClassName = "console-prompt";
-WebInspector.ConsolePrompt.MaximumHistorySize = 30;
-
-WebInspector.ConsolePrompt.prototype = {
- constructor: WebInspector.ConsolePrompt,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(delegate)
- {
- this._delegate = delegate || null;
- },
-
- get text()
- {
- return this._codeMirror.getValue();
- },
-
- set text(text)
- {
- this._codeMirror.setValue(text || "");
- this._codeMirror.clearHistory();
- this._codeMirror.markClean();
- },
-
- get history()
- {
- this._history[this._historyIndex] = this._historyEntryForCurrentText();
- return this._history;
- },
-
- set history(history)
- {
- this._history = history instanceof Array ? history.slice(0, WebInspector.ConsolePrompt.MaximumHistorySize) : [{}];
- this._historyIndex = 0;
- this._restoreHistoryEntry(0);
- },
-
- get focused()
- {
- return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
- },
-
- focus: function()
- {
- this._codeMirror.focus();
- },
-
- shown: function()
- {
- this._codeMirror.refresh();
- },
-
- updateLayout: function()
- {
- this._codeMirror.refresh();
- },
-
- updateCompletions: function(completions, implicitSuffix)
- {
- this._completionController.updateCompletions(completions, implicitSuffix);
- },
-
- // Protected
-
- completionControllerCompletionsNeeded: function(completionController, prefix, defaultCompletions, base, suffix, forced)
- {
- if (this.delegate && typeof this.delegate.consolePromptCompletionsNeeded === "function")
- this.delegate.consolePromptCompletionsNeeded(this, defaultCompletions, base, prefix, suffix, forced);
- else
- this._completionController.updateCompletions(defaultCompletions);
- },
-
- completionControllerShouldAllowEscapeCompletion: function(completionController)
- {
- // Only allow escape to complete if there is text in the prompt. Otherwise allow it to pass through
- // so escape to toggle the quick console still works.
- return !!this.text;
- },
-
- // Private
-
- _handlePreviousKey: function(codeMirror)
- {
- if (this._codeMirror.somethingSelected())
- return CodeMirror.Pass;
-
- // Pass unless we are on the first line.
- if (this._codeMirror.getCursor().line)
- return CodeMirror.Pass;
-
- var historyEntry = this._history[this._historyIndex + 1];
- if (!historyEntry)
- return CodeMirror.Pass;
-
- this._rememberCurrentTextInHistory();
-
- ++this._historyIndex;
-
- this._restoreHistoryEntry(this._historyIndex);
- },
-
- _handleNextKey: function(codeMirror)
- {
- if (this._codeMirror.somethingSelected())
- return CodeMirror.Pass;
-
- // Pass unless we are on the last line.
- if (this._codeMirror.getCursor().line !== this._codeMirror.lastLine())
- return CodeMirror.Pass;
-
- var historyEntry = this._history[this._historyIndex - 1];
- if (!historyEntry)
- return CodeMirror.Pass;
-
- this._rememberCurrentTextInHistory();
-
- --this._historyIndex;
-
- this._restoreHistoryEntry(this._historyIndex);
- },
-
- _handleEnterKey: function(codeMirror, forceCommit)
- {
- var currentText = this.text;
-
- // Always do nothing when there is just whitespace.
- if (!currentText.trim())
- return;
-
- var cursor = this._codeMirror.getCursor();
- var lastLine = this._codeMirror.lastLine();
- var lastLineLength = this._codeMirror.getLine(lastLine).length;
- var cursorIsAtLastPosition = positionsEqual(cursor, {line: lastLine, ch: lastLineLength});
-
- function positionsEqual(a, b)
- {
- console.assert(a);
- console.assert(b);
- return a.line === b.line && a.ch === b.ch;
- }
-
- function commitTextOrInsertNewLine(commit)
- {
- if (!commit) {
- // Only insert a new line if the previous cursor and the current cursor are in the same position.
- if (positionsEqual(cursor, this._codeMirror.getCursor()))
- CodeMirror.commands.newlineAndIndent(this._codeMirror);
- return;
- }
-
- var historyEntry = this._historyEntryForCurrentText();
-
- // Replace the previous entry if it does not have text or if the text is the same.
- if (this._history[1] && (!this._history[1].text || this._history[1].text === historyEntry.text)) {
- this._history[1] = historyEntry;
- this._history[0] = {};
- } else {
- // Replace the first history entry and push a new empty one.
- this._history[0] = historyEntry;
- this._history.unshift({});
-
- // Trim the history length if needed.
- if (this._history.length > WebInspector.ConsolePrompt.MaximumHistorySize)
- this._history = this._history.slice(0, WebInspector.ConsolePrompt.MaximumHistorySize);
- }
-
- this._historyIndex = 0;
-
- this._codeMirror.setValue("");
- this._codeMirror.clearHistory();
-
- if (this.delegate && typeof this.delegate.consolePromptHistoryDidChange === "function")
- this.delegate.consolePromptHistoryDidChange(this);
-
- if (this.delegate && typeof this.delegate.consolePromptTextCommitted === "function")
- this.delegate.consolePromptTextCommitted(this, currentText);
- }
-
- if (!forceCommit && this.delegate && typeof this.delegate.consolePromptShouldCommitText === "function") {
- this.delegate.consolePromptShouldCommitText(this, currentText, cursorIsAtLastPosition, commitTextOrInsertNewLine.bind(this));
- return;
- }
-
- commitTextOrInsertNewLine.call(this, true);
- },
-
- _handleCommandEnterKey: function(codeMirror)
- {
- this._handleEnterKey(codeMirror, true);
- },
-
- _restoreHistoryEntry: function(index)
- {
- var historyEntry = this._history[index];
-
- this._codeMirror.setValue(historyEntry.text || "");
-
- if (historyEntry.undoHistory)
- this._codeMirror.setHistory(historyEntry.undoHistory);
- else
- this._codeMirror.clearHistory();
-
- this._codeMirror.setCursor(historyEntry.cursor || {line: 0});
- },
-
- _historyEntryForCurrentText: function()
- {
- return {text: this.text, undoHistory: this._codeMirror.getHistory(), cursor: this._codeMirror.getCursor()};
- },
-
- _rememberCurrentTextInHistory: function()
- {
- this._history[this._historyIndex] = this._historyEntryForCurrentText();
-
- if (this.delegate && typeof this.delegate.consolePromptHistoryDidChange === "function")
- this.delegate.consolePromptHistoryDidChange(this);
- }
-};
-
-WebInspector.ConsolePrompt.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentBrowsercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-browser {
- display: -webkit-flex;
- -webkit-flex-direction: column;
-}
-
-.content-browser > .content-view-container {
- display: -webkit-flex;
- -webkit-flex: 1;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentBrowserjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,532 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentBrowser = function(element, delegate, disableBackForward)
-{
- WebInspector.Object.call(this);
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.ContentBrowser.StyleClassName);
-
- this._navigationBar = new WebInspector.NavigationBar;
- this._element.appendChild(this._navigationBar.element);
-
- this._contentViewContainer = new WebInspector.ContentViewContainer;
- this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this);
- this._element.appendChild(this._contentViewContainer.element);
-
- this._findBanner = new WebInspector.FindBanner(this);
- this._findKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._showFindBanner.bind(this));
- this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidShow, this._findBannerDidShow, this);
- this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidHide, this._findBannerDidHide, this);
-
- this._saveKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "S", this._save.bind(this));
- this._saveAsKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "S", this._saveAs.bind(this));
-
- if (!disableBackForward) {
- this._backKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Left, this._backButtonClicked.bind(this));
- this._forwardKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Right, this._forwardButtonClicked.bind(this));
-
- this._backButtonNavigationItem = new WebInspector.ButtonNavigationItem("back", WebInspector.UIString("Back (%s)").format(this._backKeyboardShortcut.displayName), "Images/BackArrow.svg", 9, 9);
- this._backButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._backButtonClicked, this);
- this._backButtonNavigationItem.enabled = false;
- this._navigationBar.addNavigationItem(this._backButtonNavigationItem);
-
- this._forwardButtonNavigationItem = new WebInspector.ButtonNavigationItem("forward", WebInspector.UIString("Forward (%s)").format(this._forwardKeyboardShortcut.displayName), "Images/ForwardArrow.svg", 9, 9);
- this._forwardButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._forwardButtonClicked, this);
- this._forwardButtonNavigationItem.enabled = false;
- this._navigationBar.addNavigationItem(this._forwardButtonNavigationItem);
-
- this._navigationBar.addNavigationItem(new WebInspector.DividerNavigationItem);
- }
-
- this._hierarchicalPathNavigationItem = new WebInspector.HierarchicalPathNavigationItem;
- this._hierarchicalPathNavigationItem.addEventListener(WebInspector.HierarchicalPathNavigationItem.Event.PathComponentWasSelected, this._hierarchicalPathComponentWasSelected, this);
- this._navigationBar.addNavigationItem(this._hierarchicalPathNavigationItem);
-
- this._contentViewSelectionPathNavigationItem = new WebInspector.HierarchicalPathNavigationItem;
-
- this._navigationBar.addNavigationItem(new WebInspector.FlexibleSpaceNavigationItem);
-
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
- WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange, this._contentViewNavigationItemsDidChange, this);
-
- this._delegate = delegate || null;
-
- this._currentContentViewNavigationItems = [];
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ContentBrowser);
-
-WebInspector.ContentBrowser.StyleClassName = "content-browser";
-
-WebInspector.ContentBrowser.Event = {
- CurrentRepresentedObjectsDidChange: "content-browser-current-represented-objects-did-change",
- CurrentContentViewDidChange: "content-browser-current-content-view-did-change"
-};
-
-WebInspector.ContentBrowser.prototype = {
- constructor: WebInspector.ContentBrowser,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get navigationBar()
- {
- return this._navigationBar;
- },
-
- get contentViewContainer()
- {
- return this._contentViewContainer;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(newDelegate)
- {
- this._delegate = newDelegate || null;
- },
-
- get currentContentView()
- {
- return this._contentViewContainer.currentContentView;
- },
-
- get currentRepresentedObjects()
- {
- var representedObjects = [];
-
- var lastComponent = this._hierarchicalPathNavigationItem.lastComponent;
- if (lastComponent && lastComponent.representedObject)
- representedObjects.push(lastComponent.representedObject);
-
- lastComponent = this._contentViewSelectionPathNavigationItem.lastComponent;
- if (lastComponent && lastComponent.representedObject)
- representedObjects.push(lastComponent.representedObject);
-
- var currentContentView = this.currentContentView;
- if (currentContentView) {
- var supplementalRepresentedObjects = currentContentView.supplementalRepresentedObjects;
- if (supplementalRepresentedObjects && supplementalRepresentedObjects.length)
- representedObjects = representedObjects.concat(supplementalRepresentedObjects);
- }
-
- return representedObjects;
- },
-
- updateLayout: function()
- {
- this._navigationBar.updateLayout();
- this._contentViewContainer.updateLayout();
- },
-
- showContentViewForRepresentedObject: function(representedObject, cookie)
- {
- var contentView = this.contentViewForRepresentedObject(representedObject);
- return this._contentViewContainer.showContentView(contentView, cookie);
- },
-
- showContentView: function(contentView, cookie)
- {
- return this._contentViewContainer.showContentView(contentView, cookie);
- },
-
- contentViewForRepresentedObject: function(representedObject, onlyExisting)
- {
- return this._contentViewContainer.contentViewForRepresentedObject(representedObject, onlyExisting);
- },
-
- canGoBack: function()
- {
- var currentContentView = this.currentContentView;
- if (currentContentView && currentContentView.canGoBack())
- return true;
- return this._contentViewContainer.canGoBack();
- },
-
- canGoForward: function()
- {
- var currentContentView = this.currentContentView;
- if (currentContentView && currentContentView.canGoForward())
- return true;
- return this._contentViewContainer.canGoForward();
- },
-
- goBack: function()
- {
- var currentContentView = this.currentContentView;
- if (currentContentView && currentContentView.canGoBack()) {
- currentContentView.goBack();
- this._updateBackForwardButtons();
- return;
- }
-
- this._contentViewContainer.goBack();
-
- // The _updateBackForwardButtons function is called by _currentContentViewDidChange,
- // so it does not need to be called here.
- },
-
- goForward: function()
- {
- var currentContentView = this.currentContentView;
- if (currentContentView && currentContentView.canGoForward()) {
- currentContentView.goForward();
- this._updateBackForwardButtons();
- return;
- }
-
- this._contentViewContainer.goForward();
-
- // The _updateBackForwardButtons function is called by _currentContentViewDidChange,
- // so it does not need to be called here.
- },
-
- findBannerPerformSearch: function(findBanner, query)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.performSearch(query);
- },
-
- findBannerSearchCleared: function(findBanner)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.searchCleared();
- },
-
- findBannerSearchQueryForSelection: function(findBanner)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return null;
-
- return currentContentView.searchQueryWithSelection();
- },
-
- findBannerRevealPreviousResult: function(findBanner)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.revealPreviousSearchResult(!findBanner.showing);
- },
-
- findBannerRevealNextResult: function(findBanner)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.revealNextSearchResult(!findBanner.showing);
- },
-
- // Private
-
- _backButtonClicked: function(event)
- {
- this.goBack();
- },
-
- _forwardButtonClicked: function(event)
- {
- this.goForward();
- },
-
- _saveDataToFile: function(saveData, forceSaveAs)
- {
- console.assert(saveData);
- if (!saveData)
- return;
-
- if (typeof saveData.customSaveHandler === "function") {
- saveData.customSaveHandler(forceSaveAs);
- return;
- }
-
- console.assert(saveData.url);
- console.assert(typeof saveData.content === "string");
- if (!saveData.url || typeof saveData.content !== "string")
- return;
-
- InspectorFrontendHost.save(saveData.url, saveData.content, false, forceSaveAs || saveData.forceSaveAs);
- },
-
- _save: function(event)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSave)
- return;
-
- this._saveDataToFile(currentContentView.saveData);
- },
-
- _saveAs: function(event)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSave)
- return;
-
- this._saveDataToFile(currentContentView.saveData, true);
- },
-
- _showFindBanner: function(event)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- this._findBanner.show();
- },
-
- _findBannerDidShow: function(event)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.automaticallyRevealFirstSearchResult = true;
- },
-
- _findBannerDidHide: function(event)
- {
- var currentContentView = this.currentContentView;
- if (!currentContentView || !currentContentView.supportsSearch)
- return;
-
- currentContentView.automaticallyRevealFirstSearchResult = false;
- },
-
- _contentViewNumberOfSearchResultsDidChange: function(event)
- {
- if (event.target !== this.currentContentView)
- return;
-
- this._findBanner.numberOfResults = this.currentContentView.numberOfSearchResults;
- },
-
- _updateHierarchicalPathNavigationItem: function(representedObject)
- {
- if (!this.delegate || typeof this.delegate.contentBrowserTreeElementForRepresentedObject !== "function")
- return;
-
- var treeElement = representedObject ? this.delegate.contentBrowserTreeElementForRepresentedObject(this, representedObject) : null;
- var pathComponents = [];
-
- while (treeElement && !treeElement.root) {
- var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
- pathComponents.unshift(pathComponent);
- treeElement = treeElement.parent;
- }
-
- this._hierarchicalPathNavigationItem.components = pathComponents;
- },
-
- _updateContentViewSelectionPathNavigationItem: function(contentView)
- {
- var selectionPathComponents = contentView ? contentView.selectionPathComponents || [] : [];
- this._contentViewSelectionPathNavigationItem.components = selectionPathComponents;
-
- if (!selectionPathComponents.length) {
- this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator = false;
- this._navigationBar.removeNavigationItem(this._contentViewSelectionPathNavigationItem);
- return;
- }
-
- // Insert the _contentViewSelectionPathNavigationItem after the _hierarchicalPathNavigationItem, if needed.
- if (!this._navigationBar.navigationItems.contains(this._contentViewSelectionPathNavigationItem)) {
- var hierarchicalPathItemIndex = this._navigationBar.navigationItems.indexOf(this._hierarchicalPathNavigationItem);
- console.assert(hierarchicalPathItemIndex !== -1);
- this._navigationBar.insertNavigationItem(this._contentViewSelectionPathNavigationItem, hierarchicalPathItemIndex + 1);
- this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator = true;
- }
- },
-
- _updateBackForwardButtons: function()
- {
- if (!this._backButtonNavigationItem || !this._forwardButtonNavigationItem)
- return;
-
- this._backButtonNavigationItem.enabled = this.canGoBack();
- this._forwardButtonNavigationItem.enabled = this.canGoForward();
- },
-
- _updateContentViewNavigationItems: function()
- {
- var navigationBar = this.navigationBar;
-
- // First, we remove the navigation items added by the previous content view.
- this._currentContentViewNavigationItems.forEach(function(navigationItem) {
- navigationBar.removeNavigationItem(navigationItem);
- });
-
- var currentContentView = this.currentContentView;
- if (!currentContentView) {
- this._currentContentViewNavigationItems = [];
- return;
- }
-
- var insertionIndex = navigationBar.navigationItems.length;
- console.assert(insertionIndex >= 0);
-
- // Keep track of items we'll be adding to the navigation bar.
- var newNavigationItems = [];
-
- // Go through each of the items of the new content view and add a divider before them.
- currentContentView.navigationItems.forEach(function(navigationItem, index) {
- // Add dividers before items unless it's the first item and not a button.
- if (index !== 0 || navigationItem instanceof WebInspector.ButtonNavigationItem) {
- var divider = new WebInspector.DividerNavigationItem;
- navigationBar.insertNavigationItem(divider, insertionIndex++);
- newNavigationItems.push(divider);
- }
- navigationBar.insertNavigationItem(navigationItem, insertionIndex++);
- newNavigationItems.push(navigationItem);
- });
-
- // Remember the navigation items we inserted so we can remove them
- // for the next content view.
- this._currentContentViewNavigationItems = newNavigationItems;
- },
-
- _updateFindBanner: function(currentContentView)
- {
- if (!currentContentView) {
- this._findBanner.targetElement = null;
- this._findBanner.numberOfResults = null;
- return;
- }
-
- this._findBanner.targetElement = currentContentView.element;
- this._findBanner.numberOfResults = currentContentView.hasPerformedSearch ? currentContentView.numberOfSearchResults : null;
-
- if (currentContentView.supportsSearch && this._findBanner.searchQuery) {
- currentContentView.automaticallyRevealFirstSearchResult = this._findBanner.showing;
- currentContentView.performSearch(this._findBanner.searchQuery);
- }
- },
-
- _dispatchCurrentRepresentedObjectsDidChangeEventSoon: function()
- {
- if (this._currentRepresentedObjectsDidChangeTimeout)
- return;
- this._currentRepresentedObjectsDidChangeTimeout = setTimeout(this._dispatchCurrentRepresentedObjectsDidChangeEvent.bind(this), 0);
- },
-
- _dispatchCurrentRepresentedObjectsDidChangeEvent: function()
- {
- if (this._currentRepresentedObjectsDidChangeTimeout) {
- clearTimeout(this._currentRepresentedObjectsDidChangeTimeout);
- delete this._currentRepresentedObjectsDidChangeTimeout;
- }
-
- this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange);
- },
-
- _contentViewSelectionPathComponentDidChange: function(event)
- {
- if (event.target !== this.currentContentView)
- return;
-
- this._updateContentViewSelectionPathNavigationItem(event.target);
- this._updateBackForwardButtons();
-
- this._updateContentViewNavigationItems();
-
- this._navigationBar.updateLayout();
-
- this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
- },
-
- _contentViewSupplementalRepresentedObjectsDidChange: function(event)
- {
- if (event.target !== this.currentContentView)
- return;
-
- this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
- },
-
- _currentContentViewDidChange: function(event)
- {
- var currentContentView = this.currentContentView;
-
- this._updateHierarchicalPathNavigationItem(currentContentView ? currentContentView.representedObject : null);
- this._updateContentViewSelectionPathNavigationItem(currentContentView);
- this._updateBackForwardButtons();
-
- this._updateContentViewNavigationItems();
- this._updateFindBanner(currentContentView);
-
- this._navigationBar.updateLayout();
-
- this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange);
-
- this._dispatchCurrentRepresentedObjectsDidChangeEvent();
- },
-
- _contentViewNavigationItemsDidChange: function(event)
- {
- if (event.target !== this.currentContentView)
- return;
-
- this._updateContentViewNavigationItems();
- this._navigationBar.updateLayout();
- },
-
- _hierarchicalPathComponentWasSelected: function(event)
- {
- console.assert(event.data.pathComponent instanceof WebInspector.GeneralTreeElementPathComponent);
-
- var treeElement = event.data.pathComponent.generalTreeElement;
- var originalTreeElement = treeElement;
-
- // Some tree elements (like folders) are not viewable. Find the first descendant that is viewable.
- while (treeElement && !WebInspector.ContentView.isViewable(treeElement.representedObject))
- treeElement = treeElement.traverseNextTreeElement(false, originalTreeElement, false);
-
- if (!treeElement)
- return;
-
- this.showContentViewForRepresentedObject(treeElement.representedObject);
- }
-};
-
-WebInspector.ContentBrowser.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentFlowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlow = function(documentNodeIdentifier, name, overset, contentNodes)
-{
- WebInspector.Object.call(this);
-
- this._documentNodeIdentifier = documentNodeIdentifier;
- this._name = name;
- this._overset = overset;
- this._contentNodes = contentNodes;
-};
-
-WebInspector.ContentFlow.Event = {
- OversetWasChanged: "content-flow-overset-was-changed",
- ContentNodeWasAdded: "content-flow-content-node-was-added",
- ContentNodeWasRemoved: "content-flow-content-node-was-removed"
-};
-
-WebInspector.ContentFlow.prototype = {
-
- constructor: WebInspector.ContentFlow,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get id()
- {
- // Use the flow node id, to avoid collisions when we change main document id.
- return this._documentNodeIdentifier + ":" + this._name;
- },
-
- get documentNodeIdentifier()
- {
- return this._documentNodeIdentifier;
- },
-
- get name()
- {
- return this._name;
- },
-
- get overset()
- {
- return this._overset;
- },
-
- set overset(overset)
- {
- if (this._overset === overset)
- return;
- this._overset = overset;
- this.dispatchEventToListeners(WebInspector.ContentFlow.Event.FlowOversetWasChanged);
- },
-
- get contentNodes()
- {
- return this._contentNodes;
- },
-
- insertContentNodeBefore: function(contentNode, referenceNode)
- {
- var index = this._contentNodes.indexOf(referenceNode);
- console.assert(index !== -1);
- this._contentNodes.splice(index, 0, contentNode);
- this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded, {node: contentNode, before: referenceNode});
- },
-
- appendContentNode: function(contentNode)
- {
- this._contentNodes.push(contentNode);
- this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded, {node: contentNode});
- },
-
- removeContentNode: function(contentNode)
- {
- var index = this._contentNodes.indexOf(contentNode);
- console.assert(index !== -1);
- this._contentNodes.splice(index, 1);
- this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, {node: contentNode});
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentFlowDOMTreeContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentFlowDOMTreeContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentFlowDOMTreeContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentFlowDOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlowDOMTreeContentView = function(contentFlow)
-{
- console.assert(contentFlow);
-
- WebInspector.DOMTreeContentView.call(this, contentFlow);
-
- contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded, this._contentNodeWasAdded, this);
- contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, this._contentNodeWasRemoved, this);
-
- this._createContentTrees();
-};
-
-WebInspector.ContentFlowDOMTreeContentView.prototype = {
- constructor: WebInspector.ContentFlowDOMTreeContentView,
- __proto__: WebInspector.DOMTreeContentView.prototype,
-
- // Public
-
- closed: function()
- {
- this.representedObject.removeEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded, this._contentNodeWasAdded, this);
- this.representedObject.removeEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, this._contentNodeWasRemoved, this);
- WebInspector.DOMTreeContentView.prototype.closed.call(this);
- },
-
- getSearchContextNodes: function(callback)
- {
- callback(this.domTreeOutline.children.map(function(treeOutline) {
- return treeOutline.representedObject.id;
- }));
- },
-
- // Private
-
- _createContentTrees: function()
- {
- var contentNodes = this.representedObject.contentNodes;
- for (var contentNode of contentNodes)
- this.domTreeOutline.appendChild(new WebInspector.DOMTreeElement(contentNode));
-
- var documentURL = contentNodes.length ? contentNodes[0].ownerDocument.documentURL : null;
- this._restoreSelectedNodeAfterUpdate(documentURL, contentNodes[0]);
- },
-
- _contentNodeWasAdded: function(event)
- {
- var treeElement = new WebInspector.DOMTreeElement(event.data.node);
- if (!event.data.before) {
- this.domTreeOutline.appendChild(treeElement);
- return;
- }
-
- var beforeElement = this.domTreeOutline.findTreeElement(event.data.before);
- console.assert(beforeElement);
-
- var index = this.domTreeOutline.children.indexOf(beforeElement);
- console.assert(index !== -1);
-
- this.domTreeOutline.insertChild(treeElement, index);
- },
-
- _contentNodeWasRemoved: function(event)
- {
- var treeElement = this.domTreeOutline.findTreeElement(event.data.node);
- console.assert(treeElement);
- this.domTreeOutline.removeChild(treeElement);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentFlowIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentFlowIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentFlowIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentFlowIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.
- */
-
-.content-flow-icon .icon {
- content: url(Images/ContentFlow.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentFlowTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentFlowTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentFlowTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentFlowTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlowTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.ContentFlow);
- WebInspector.GeneralTreeElement.call(this, [WebInspector.ContentFlowTreeElement.StyleClassName, WebInspector.ContentFlowTreeElement.ContentFlowIconStyleClassName], representedObject.name, null, representedObject, false);
-
- this.small = true;
-};
-
-WebInspector.ContentFlowTreeElement.ContentFlowIconStyleClassName = "content-flow-icon";
-
-WebInspector.ContentFlowTreeElement.prototype = {
- constructor: WebInspector.ContentFlowTreeElement
-};
-
-WebInspector.ContentFlowTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view > .indeterminate-progress-spinner {
- position: absolute;
- top: 50%;
- left: 50%;
-
- width: 32px;
- height: 32px;
-
- margin-left: -16px;
- margin-right: -16px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,323 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentView = function(representedObject)
-{
- if (this.constructor === WebInspector.ContentView) {
- // When instantiated directly return an instance of a type-based concrete subclass.
-
- console.assert(representedObject);
-
- if (representedObject instanceof WebInspector.Frame)
- return new WebInspector.FrameContentView(representedObject);
-
- if (representedObject instanceof WebInspector.Resource)
- return new WebInspector.ResourceClusterContentView(representedObject);
-
- if (representedObject instanceof WebInspector.Script)
- return new WebInspector.ScriptContentView(representedObject);
-
- if (representedObject instanceof WebInspector.TimelineRecording)
- return new WebInspector.TimelineContentView(representedObject);
-
- if (representedObject instanceof WebInspector.DOMStorageObject)
- return new WebInspector.DOMStorageContentView(representedObject);
-
- if (representedObject instanceof WebInspector.CookieStorageObject)
- return new WebInspector.CookieStorageContentView(representedObject);
-
- if (representedObject instanceof WebInspector.DatabaseTableObject)
- return new WebInspector.DatabaseTableContentView(representedObject);
-
- if (representedObject instanceof WebInspector.DatabaseObject)
- return new WebInspector.DatabaseContentView(representedObject);
-
- if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
- return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
-
- if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
- return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
-
- if (representedObject instanceof WebInspector.ApplicationCacheFrame)
- return new WebInspector.ApplicationCacheFrameContentView(representedObject);
-
- if (representedObject instanceof WebInspector.DOMTree)
- return new WebInspector.FrameDOMTreeContentView(representedObject);
-
- if (representedObject instanceof WebInspector.LogObject)
- return new WebInspector.LogContentView(representedObject);
-
- if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
- return new WebInspector.LegacyJavaScriptProfileView(representedObject);
-
- if (representedObject instanceof WebInspector.ContentFlow)
- return new WebInspector.ContentFlowDOMTreeContentView(representedObject);
-
- if (typeof representedObject === "string" || representedObject instanceof String)
- return new WebInspector.TextContentView(representedObject);
-
- console.assert(!WebInspector.ContentView.isViewable(representedObject));
-
- throw "Can't make a ContentView for an unknown representedObject.";
- }
-
- // Concrete object instantiation.
- console.assert(this.constructor !== WebInspector.ContentView && this instanceof WebInspector.ContentView);
- console.assert(WebInspector.ContentView.isViewable(representedObject));
-
- WebInspector.Object.call(this);
-
- this._representedObject = representedObject;
-
- this._element = document.createElement("div");
- this._element.classList.add(WebInspector.ContentView.StyleClassName);
-
- this._parentContainer = null;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ContentView);
-
-WebInspector.ContentView.isViewable = function(representedObject)
-{
- if (representedObject instanceof WebInspector.Frame)
- return true;
- if (representedObject instanceof WebInspector.Resource)
- return true;
- if (representedObject instanceof WebInspector.Script)
- return true;
- if (representedObject instanceof WebInspector.TimelineRecording)
- return true;
- if (representedObject instanceof WebInspector.DOMStorageObject)
- return true;
- if (representedObject instanceof WebInspector.CookieStorageObject)
- return true;
- if (representedObject instanceof WebInspector.DatabaseTableObject)
- return true;
- if (representedObject instanceof WebInspector.DatabaseObject)
- return true;
- if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
- return true;
- if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
- return true;
- if (representedObject instanceof WebInspector.ApplicationCacheFrame)
- return true;
- if (representedObject instanceof WebInspector.DOMTree)
- return true;
- if (representedObject instanceof WebInspector.LogObject)
- return true;
- if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
- return true;
- if (representedObject instanceof WebInspector.ContentFlow)
- return true;
- if (typeof representedObject === "string" || representedObject instanceof String)
- return true;
- return false;
-};
-
-WebInspector.ContentView.StyleClassName = "content-view";
-
-WebInspector.ContentView.Event = {
- SelectionPathComponentsDidChange: "content-view-selection-path-components-did-change",
- SupplementalRepresentedObjectsDidChange: "content-view-supplemental-represented-objects-did-change",
- NumberOfSearchResultsDidChange: "content-view-number-of-search-results-did-change",
- NavigationItemsDidChange: "content-view-navigation-items-did-change"
-};
-
-WebInspector.ContentView.prototype = {
- constructor: WebInspector.ContentView,
-
- // Public
-
- get representedObject()
- {
- return this._representedObject;
- },
-
- get navigationItems()
- {
- // Navigation items that will be displayed by the ContentBrowser instance,
- // meant to be subclassed. Implemented by subclasses.
- return [];
- },
-
- get allowedNavigationSidebarPanels()
- {
- // Allow any navigation sidebar panel.
- return [];
- },
-
- get element()
- {
- return this._element;
- },
-
- get parentContainer()
- {
- return this._parentContainer;
- },
-
- get visible()
- {
- return this._visible;
- },
-
- set visible(flag)
- {
- this._visible = flag;
- },
-
- get scrollableElements()
- {
- // Implemented by subclasses.
- return [];
- },
-
- get shouldKeepElementsScrolledToBottom()
- {
- // Implemented by subclasses.
- return false;
- },
-
- get selectionPathComponents()
- {
- // Implemented by subclasses.
- return [];
- },
-
- get supplementalRepresentedObjects()
- {
- // Implemented by subclasses.
- return [];
- },
-
- get supportsSplitContentBrowser()
- {
- // Implemented by subclasses.
- return true;
- },
-
- updateLayout: function()
- {
- // Implemented by subclasses.
- },
-
- shown: function()
- {
- // Implemented by subclasses.
- },
-
- hidden: function()
- {
- // Implemented by subclasses.
- },
-
- closed: function()
- {
- // Implemented by subclasses.
- },
-
- saveToCookie: function(cookie)
- {
- // Implemented by subclasses.
- },
-
- restoreFromCookie: function(cookie)
- {
- // Implemented by subclasses.
- },
-
- canGoBack: function()
- {
- // Implemented by subclasses.
- return false;
- },
-
- canGoForward: function()
- {
- // Implemented by subclasses.
- return false;
- },
-
- goBack: function()
- {
- // Implemented by subclasses.
- },
-
- goForward: function()
- {
- // Implemented by subclasses.
- },
-
- get supportsSearch()
- {
- // Implemented by subclasses.
- return false;
- },
-
- get numberOfSearchResults()
- {
- // Implemented by subclasses.
- return null;
- },
-
- get hasPerformedSearch()
- {
- // Implemented by subclasses.
- return false;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- // Implemented by subclasses.
- },
-
- performSearch: function(query)
- {
- // Implemented by subclasses.
- },
-
- searchCleared: function()
- {
- // Implemented by subclasses.
- },
-
- searchQueryWithSelection: function()
- {
- // Implemented by subclasses.
- return null;
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- // Implemented by subclasses.
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- // Implemented by subclasses.
- }
-};
-
-WebInspector.ContentView.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentViewContainercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view-container {
- position: relative;
- overflow: hidden;
-}
-
-.content-view-container > .content-view {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- overflow: hidden;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContentViewContainerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,413 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentViewContainer = function(element)
-{
- WebInspector.Object.call(this);
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.ContentViewContainer.StyleClassName);
-
- this._backForwardList = [];
- this._currentIndex = -1;
-};
-
-WebInspector.ContentViewContainer.StyleClassName = "content-view-container";
-
-WebInspector.ContentViewContainer.Event = {
- CurrentContentViewDidChange: "content-view-container-current-content-view-did-change"
-};
-
-WebInspector.ContentViewContainer.prototype = {
- constructor: WebInspector.ContentViewContainer,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get currentIndex()
- {
- return this._currentIndex;
- },
-
- get backForwardList()
- {
- return this._backForwardList;
- },
-
- get currentContentView()
- {
- if (this._currentIndex < 0 || this._currentIndex > this._backForwardList.length - 1)
- return null;
- return this._backForwardList[this._currentIndex].contentView;
- },
-
- get currentBackForwardEntry()
- {
- if (this._currentIndex < 0 || this._currentIndex > this._backForwardList.length - 1)
- return null;
- return this._backForwardList[this._currentIndex];
- },
-
- updateLayout: function()
- {
- var currentContentView = this.currentContentView;
- if (currentContentView)
- currentContentView.updateLayout();
- },
-
- contentViewForRepresentedObject: function(representedObject, onlyExisting)
- {
- console.assert(representedObject);
- if (!representedObject)
- return null;
-
- // Iterate over all the known content views for the representedObject (if any) and find one that doesn't
- // have a parent container or has this container as its parent.
- var contentView = null;
- for (var i = 0; representedObject.__contentViews && i < representedObject.__contentViews.length; ++i) {
- var currentContentView = representedObject.__contentViews[i];
- if (!currentContentView._parentContainer || currentContentView._parentContainer === this) {
- contentView = currentContentView;
- break;
- }
- }
-
- console.assert(!contentView || contentView instanceof WebInspector.ContentView);
- if (contentView instanceof WebInspector.ContentView)
- return contentView;
-
- // Return early to avoid creating a new content view when onlyExisting is true.
- if (onlyExisting)
- return null;
-
- try {
- // No existing content view found, make a new one.
- contentView = new WebInspector.ContentView(representedObject);
- } catch (e) {
- console.error(e);
- return null;
- }
-
- // Remember this content view for future calls.
- if (!representedObject.__contentViews)
- representedObject.__contentViews = [];
- representedObject.__contentViews.push(contentView);
-
- return contentView;
- },
-
- showContentViewForRepresentedObject: function(representedObject)
- {
- var contentView = this.contentViewForRepresentedObject(representedObject);
- if (!contentView)
- return null;
-
- this.showContentView(contentView);
-
- return contentView;
- },
-
- showContentView: function(contentView, cookie)
- {
- console.assert(contentView instanceof WebInspector.ContentView);
- if (!(contentView instanceof WebInspector.ContentView))
- return null;
-
- // Don't allow showing a content view that is already associated with another container.
- // Showing a content view that is already associated with this container is allowed.
- console.assert(!contentView.parentContainer || contentView.parentContainer === this);
- if (contentView.parentContainer && contentView.parentContainer !== this)
- return null;
-
- var currentEntry = this.currentBackForwardEntry;
- var provisionalEntry = new WebInspector.BackForwardEntry(contentView, cookie);
- // Don't do anything if we would have added an identical back/forward list entry.
- if (currentEntry && currentEntry.contentView === contentView && Object.shallowEqual(provisionalEntry.cookie, currentEntry.cookie))
- return currentEntry.contentView;
-
- // Showing a content view will truncate the back/forward list after the current index and insert the content view
- // at the end of the list. Finally, the current index will be updated to point to the end of the back/forward list.
-
- // Increment the current index to where we will insert the content view.
- var newIndex = this._currentIndex + 1;
-
- // Insert the content view at the new index. This will remove any content views greater than or equal to the index.
- var removedEntries = this._backForwardList.splice(newIndex, this._backForwardList.length - newIndex, provisionalEntry);
-
- console.assert(newIndex === this._backForwardList.length - 1);
- console.assert(this._backForwardList[newIndex] === provisionalEntry);
-
- // Disassociate with the removed content views.
- for (var i = 0; i < removedEntries.length; ++i) {
- // Skip disassociation if this content view is still in the back/forward list.
- var shouldDissociateContentView = this._backForwardList.some(function(existingEntry) {
- return existingEntry.contentView === removedEntries[i].contentView;
- });
- if (shouldDissociateContentView)
- this._disassociateFromContentView(removedEntries[i]);
- }
-
- // Associate with the new content view.
- contentView._parentContainer = this;
-
- this.showBackForwardEntryForIndex(newIndex);
-
- return contentView;
- },
-
- showBackForwardEntryForIndex: function(index)
- {
- console.assert(index >= 0 && index <= this._backForwardList.length - 1);
- if (index < 0 || index > this._backForwardList.length - 1)
- return;
-
- if (this._currentIndex === index)
- return;
-
- // Hide the currently visible content view.
- var previousEntry = this.currentBackForwardEntry;
- if (previousEntry)
- this._hideEntry(previousEntry);
-
- this._currentIndex = index;
- var currentEntry = this.currentBackForwardEntry;
- console.assert(currentEntry);
-
- this._showEntry(currentEntry);
-
- this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
- },
-
- replaceContentView: function(oldContentView, newContentView)
- {
- console.assert(oldContentView instanceof WebInspector.ContentView);
- if (!(oldContentView instanceof WebInspector.ContentView))
- return;
-
- console.assert(newContentView instanceof WebInspector.ContentView);
- if (!(newContentView instanceof WebInspector.ContentView))
- return;
-
- console.assert(oldContentView.parentContainer === this);
- if (oldContentView.parentContainer !== this)
- return;
-
- console.assert(!newContentView.parentContainer || newContentView.parentContainer === this);
- if (newContentView.parentContainer && newContentView.parentContainer !== this)
- return;
-
- var currentlyShowing = (this.currentContentView === oldContentView);
- if (currentlyShowing)
- this._hideEntry(this.currentBackForwardEntry);
-
- // Disassociate with the old content view.
- this._disassociateFromContentView(oldContentView);
-
- // Associate with the new content view.
- newContentView._parentContainer = this;
-
- // Replace all occurrences of oldContentView with newContentView in the back/forward list.
- for (var i = 0; i < this._backForwardList.length; ++i) {
- if (this._backForwardList[i].contentView === oldContentView)
- this._backForwardList[i].contentView = newContentView;
- }
-
- // Re-show the current entry, because its content view instance was replaced.
- if (currentlyShowing) {
- this._showEntry(this.currentBackForwardEntry);
- this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
- }
- },
-
- closeAllContentViewsOfPrototype: function(constructor)
- {
- if (!this._backForwardList.length) {
- console.assert(this._currentIndex === -1);
- return;
- }
-
- // Do a check to see if all the content views are instances of this prototype.
- // If they all are we can use the quicker closeAllContentViews method.
- var allSamePrototype = true;
- for (var i = this._backForwardList.length - 1; i >= 0; --i) {
- if (!(this._backForwardList[i].contentView instanceof constructor)) {
- allSamePrototype = false;
- break;
- }
- }
-
- if (allSamePrototype) {
- this.closeAllContentViews();
- return;
- }
-
- var oldCurrentContentView = this.currentContentView;
-
- var backForwardListDidChange = false;
- // Hide and disassociate with all the content views that are instances of the constructor.
- for (var i = this._backForwardList.length - 1; i >= 0; --i) {
- var entry = this._backForwardList[i];
- if (!(entry.contentView instanceof constructor))
- continue;
-
- if (entry.contentView === oldCurrentContentView)
- this._hideEntry(entry);
-
- if (this._currentIndex >= i) {
- // Decrement the currentIndex since we will remove an item in the back/forward array
- // that it the current index or comes before it.
- --this._currentIndex;
- }
-
- this._disassociateFromContentView(entry.contentView);
-
- // Remove the item from the back/forward list.
- this._backForwardList.splice(i, 1);
- backForwardListDidChange = true;
- }
-
- var currentEntry = this.currentBackForwardEntry;
- console.assert(currentEntry || (!currentEntry && this._currentIndex === -1));
-
- if (currentEntry && currentEntry.contentView !== oldCurrentContentView || backForwardListDidChange) {
- this._showEntry(currentEntry);
- this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
- }
- },
-
- closeAllContentViews: function()
- {
- if (!this._backForwardList.length) {
- console.assert(this._currentIndex === -1);
- return;
- }
-
- // Hide and disassociate with all the content views.
- for (var i = 0; i < this._backForwardList.length; ++i) {
- var entry = this._backForwardList[i];
- if (i === this._currentIndex)
- this._hideEntry(entry);
- this._disassociateFromContentView(entry.contentView);
- }
-
- this._backForwardList = [];
- this._currentIndex = -1;
-
- this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
- },
-
- canGoBack: function()
- {
- return this._currentIndex > 0;
- },
-
- canGoForward: function()
- {
- return this._currentIndex < this._backForwardList.length - 1;
- },
-
- goBack: function()
- {
- if (!this.canGoBack())
- return;
- this.showBackForwardEntryForIndex(this._currentIndex - 1);
- },
-
- goForward: function()
- {
- if (!this.canGoForward())
- return;
- this.showBackForwardEntryForIndex(this._currentIndex + 1);
- },
-
- shown: function()
- {
- var currentEntry = this.currentBackForwardEntry;
- if (!currentEntry)
- return;
-
- this._showEntry(currentEntry);
- },
-
- hidden: function()
- {
- var currentEntry = this.currentBackForwardEntry;
- if (!currentEntry)
- return;
-
- this._hideEntry(currentEntry);
- },
-
- // Private
-
- _addContentViewElement: function(contentView)
- {
- if (contentView.element.parentNode !== this._element)
- this._element.appendChild(contentView.element);
- },
-
- _removeContentViewElement: function(contentView)
- {
- if (contentView.element.parentNode)
- contentView.element.parentNode.removeChild(contentView.element);
- },
-
- _disassociateFromContentView: function(contentView)
- {
- console.assert(!contentView.visible);
-
- contentView._parentContainer = null;
-
- var representedObject = contentView.representedObject;
- if (!representedObject || !representedObject.__contentViews)
- return;
-
- representedObject.__contentViews.remove(contentView);
-
- contentView.closed();
- },
-
- _showEntry: function(entry)
- {
- console.assert(entry instanceof WebInspector.BackForwardEntry);
-
- this._addContentViewElement(entry.contentView);
- entry.prepareToShow();
- },
-
- _hideEntry: function(entry)
- {
- console.assert(entry instanceof WebInspector.BackForwardEntry);
-
- entry.prepareToHide();
- this._removeContentViewElement(entry.contentView);
- }
-};
-
-WebInspector.ContentViewContainer.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceContextMenujs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ContextMenu.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ContextMenu.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ContextMenu.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,299 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @constructor
- * @param {WebInspector.ContextSubMenuItem} topLevelMenu
- * @param {string} type
- * @param {string=} label
- * @param {boolean=} disabled
- * @param {boolean=} checked
- */
-WebInspector.ContextMenuItem = function(topLevelMenu, type, label, disabled, checked)
-{
- this._type = type;
- this._label = label;
- this._disabled = disabled;
- this._checked = checked;
- this._contextMenu = topLevelMenu;
- if (type === "item" || type === "checkbox")
- this._id = topLevelMenu.nextId();
-}
-
-WebInspector.ContextMenuItem.prototype = {
- id: function()
- {
- return this._id;
- },
-
- type: function()
- {
- return this._type;
- },
-
- /**
- * @return {boolean}
- */
- isEnabled: function()
- {
- return !this._disabled;
- },
-
- /**
- * @param {boolean} enabled
- */
- setEnabled: function(enabled)
- {
- this._disabled = !enabled;
- },
-
- _buildDescriptor: function()
- {
- switch (this._type) {
- case "item":
- return { type: "item", id: this._id, label: this._label, enabled: !this._disabled };
- case "separator":
- return { type: "separator" };
- case "checkbox":
- return { type: "checkbox", id: this._id, label: this._label, checked: !!this._checked, enabled: !this._disabled };
- }
- }
-}
-
-/**
- * @constructor
- * @extends {WebInspector.ContextMenuItem}
- * @param topLevelMenu
- * @param {string=} label
- * @param {boolean=} disabled
- */
-WebInspector.ContextSubMenuItem = function(topLevelMenu, label, disabled)
-{
- WebInspector.ContextMenuItem.call(this, topLevelMenu, "subMenu", label, disabled);
- this._items = [];
-}
-
-WebInspector.ContextSubMenuItem.prototype = {
- /**
- * @param {string} label
- * @param {function} handler
- * @param {boolean=} disabled
- * @return {WebInspector.ContextMenuItem}
- */
- appendItem: function(label, handler, disabled)
- {
- var item = new WebInspector.ContextMenuItem(this._contextMenu, "item", label, disabled);
- this._pushItem(item);
- this._contextMenu._setHandler(item.id(), handler);
- return item;
- },
-
- /**
- * @param {string} label
- * @param {boolean=} disabled
- * @return {WebInspector.ContextMenuItem}
- */
- appendSubMenuItem: function(label, disabled)
- {
- var item = new WebInspector.ContextSubMenuItem(this._contextMenu, label, disabled);
- this._pushItem(item);
- return item;
- },
-
- /**
- * @param {boolean=} disabled
- */
- appendCheckboxItem: function(label, handler, checked, disabled)
- {
- var item = new WebInspector.ContextMenuItem(this._contextMenu, "checkbox", label, disabled, checked);
- this._pushItem(item);
- this._contextMenu._setHandler(item.id(), handler);
- return item;
- },
-
- appendSeparator: function()
- {
- if (this._items.length)
- this._pendingSeparator = true;
- },
-
- _pushItem: function(item)
- {
- if (this._pendingSeparator) {
- this._items.push(new WebInspector.ContextMenuItem(this._contextMenu, "separator"));
- delete this._pendingSeparator;
- }
- this._items.push(item);
- },
-
- /**
- * @return {boolean}
- */
- isEmpty: function()
- {
- return !this._items.length;
- },
-
- _buildDescriptor: function()
- {
- var result = { type: "subMenu", label: this._label, enabled: !this._disabled, subItems: [] };
- for (var i = 0; i < this._items.length; ++i)
- result.subItems.push(this._items[i]._buildDescriptor());
- return result;
- },
-
- __proto__: WebInspector.ContextMenuItem.prototype
-}
-
-/**
- * @constructor
- * @extends {WebInspector.ContextSubMenuItem}
- */
-WebInspector.ContextMenu = function(event) {
- WebInspector.ContextSubMenuItem.call(this, this, "");
- this._event = event;
- this._handlers = {};
- this._id = 0;
-}
-
-WebInspector.ContextMenu.prototype = {
-
- // Public
-
- nextId: function()
- {
- return this._id++;
- },
-
- show: function()
- {
- console.assert(this._event instanceof MouseEvent);
-
- var menuObject = this._buildDescriptor();
-
- if (menuObject.length) {
- WebInspector._contextMenu = this;
- if (this._event.type !== "contextmenu" && typeof InspectorFrontendHost.dispatchEventAsContextMenuEvent === "function") {
- this._menuObject = menuObject;
- this._event.target.addEventListener("contextmenu", this, true);
- InspectorFrontendHost.dispatchEventAsContextMenuEvent(this._event);
- } else
- InspectorFrontendHost.showContextMenu(this._event, menuObject);
- }
- if (this._event)
- this._event.stopImmediatePropagation();
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- this._event.target.removeEventListener("contextmenu", this, true);
- InspectorFrontendHost.showContextMenu(event, this._menuObject);
- delete this._menuObject;
-
- event.stopImmediatePropagation();
- },
-
- // Private
-
- _setHandler: function(id, handler)
- {
- if (handler)
- this._handlers[id] = handler;
- },
-
- _buildDescriptor: function()
- {
- var result = [];
- for (var i = 0; i < this._items.length; ++i)
- result.push(this._items[i]._buildDescriptor());
- return result;
- },
-
- _itemSelected: function(id)
- {
- if (this._handlers[id])
- this._handlers[id].call(this);
- },
-
- /**
- * @param {Object} target
- */
- appendApplicableItems: function(target)
- {
- for (var i = 0; i < WebInspector.ContextMenu._providers.length; ++i) {
- var provider = WebInspector.ContextMenu._providers[i];
- this.appendSeparator();
- provider.appendApplicableItems(this._event, this, target);
- this.appendSeparator();
- }
- },
-
- __proto__: WebInspector.ContextSubMenuItem.prototype
-}
-
-/**
- * @interface
- */
-WebInspector.ContextMenu.Provider = function()
-{
-}
-
-WebInspector.ContextMenu.Provider.prototype = {
- /**
- * @param {WebInspector.ContextMenu} contextMenu
- * @param {Object} target
- */
- appendApplicableItems: function(event, contextMenu, target) { }
-}
-
-/**
- * @param {WebInspector.ContextMenu.Provider} provider
- */
-WebInspector.ContextMenu.registerProvider = function(provider)
-{
- WebInspector.ContextMenu._providers.push(provider);
-}
-
-WebInspector.ContextMenu._providers = [];
-
-WebInspector.contextMenuItemSelected = function(id)
-{
- if (WebInspector._contextMenu)
- WebInspector._contextMenu._itemSelected(id);
-}
-
-WebInspector.contextMenuCleared = function()
-{
- // FIXME: Unfortunately, contextMenuCleared is invoked between show and item selected
- // so we can't delete last menu object from WebInspector. Fix the contract.
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControlToolbarItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.toolbar .item.control {
- -webkit-align-items: center;
- -webkit-justify-content: center;
-
- padding: 3px 2px;
-
- opacity: 0.5;
-}
-
-.toolbar.small-size .item.control {
- padding: 2px;
-}
-
-.toolbar.icon-and-label-horizontal .item.control,
-.toolbar.icon-only .item.control {
- padding: 0 2px;
-}
-
-.toolbar .item.control:hover {
- opacity: 0.8;
-}
-
-.toolbar .item.control:active {
- opacity: 1;
-}
-
-.toolbar .item.control > .glyph {
- width: 16px;
- height: 16px;
-
- background-repeat: no-repeat;
- background-position: center center;
-}
-
-body.window-inactive .toolbar .item.control {
- opacity: 0.35;
-}
-
-.toolbar .item.control.disabled {
- opacity: 0.35 !important;
-}
-
-body.window-inactive .toolbar .item.control.disabled {
- opacity: 0.2 !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControlToolbarItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ControlToolbarItem = function(identifier, toolTip, image, imageWidth, imageHeight)
-{
- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, false);
-};
-
-WebInspector.ControlToolbarItem.StyleClassName = "control";
-
-WebInspector.ControlToolbarItem.prototype = {
- constructor: WebInspector.ControlToolbarItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.ControlToolbarItem.StyleClassName],
-};
-
-WebInspector.ControlToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersApplicationCacheManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,198 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManager = function()
+{
+ WebInspector.Object.call(this);
+
+ if (window.ApplicationCacheAgent)
+ ApplicationCacheAgent.enable();
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._childFrameWasRemoved, this);
+
+ this._online = true;
+
+ this.initialize();
+};
+
+WebInspector.ApplicationCacheManager.Event = {
+ Cleared: "application-cache-manager-cleared",
+ FrameManifestAdded: "application-cache-manager-frame-manifest-added",
+ FrameManifestRemoved: "application-cache-manager-frame-manifest-removed",
+ FrameManifestStatusChanged: "application-cache-manager-frame-manifest-status-changed",
+ NetworkStateUpdated: "application-cache-manager-network-state-updated"
+};
+
+WebInspector.ApplicationCacheManager.Status = {
+ Uncached: 0,
+ Idle: 1,
+ Checking: 2,
+ Downloading: 3,
+ UpdateReady: 4,
+ Obsolete: 5
+};
+
+WebInspector.ApplicationCacheManager.prototype = {
+ constructor: WebInspector.ApplicationCacheManager,
+
+ // Public
+
+ initialize: function()
+ {
+ this._applicationCacheObjects = [];
+
+ if (window.ApplicationCacheAgent)
+ ApplicationCacheAgent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));
+ },
+
+ networkStateUpdated: function(isNowOnline)
+ {
+ this._online = isNowOnline;
+
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated, {online: this._online});
+ },
+
+ get online()
+ {
+ return this._online;
+ },
+
+ applicationCacheStatusUpdated: function(frameId, manifestURL, status)
+ {
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(frameId);
+ if (!frame)
+ return;
+
+ this._frameManifestUpdated(frame, manifestURL, status);
+ },
+
+ requestApplicationCache: function(frame, callback)
+ {
+ function callbackWrapper(error, applicationCache)
+ {
+ if (error) {
+ callback(null);
+ return;
+ }
+
+ callback(applicationCache);
+ }
+
+ ApplicationCacheAgent.getApplicationCacheForFrame(frame.id, callbackWrapper);
+ },
+
+ // Private
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (event.target.isMainFrame()) {
+ // If we are dealing with the main frame, we want to clear our list of objects, because we are navigating to a new page.
+ this.initialize();
+
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.Cleared);
+
+ return;
+ }
+
+ ApplicationCacheAgent.getManifestForFrame(event.target.id, this._manifestForFrameLoaded.bind(this, event.target.id));
+ },
+
+ _childFrameWasRemoved: function(event)
+ {
+ this._frameManifestRemoved(event.data.childFrame);
+ },
+
+ _manifestForFrameLoaded: function(frameId, error, manifestURL)
+ {
+ if (error)
+ return;
+
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(frameId);
+ if (!frame)
+ return;
+
+ if (!manifestURL)
+ this._frameManifestRemoved(frame);
+ },
+
+ _framesWithManifestsLoaded: function(error, framesWithManifests)
+ {
+ if (error)
+ return;
+
+ for (var i = 0; i < framesWithManifests.length; ++i) {
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(framesWithManifests[i].frameId);
+ if (!frame)
+ continue;
+
+ this._frameManifestUpdated(frame, framesWithManifests[i].manifestURL, framesWithManifests[i].status);
+ }
+ },
+
+ _frameManifestUpdated: function(frame, manifestURL, status)
+ {
+ if (status === WebInspector.ApplicationCacheManager.Status.Uncached) {
+ this._frameManifestRemoved(frame);
+ return;
+ }
+
+ if (!manifestURL)
+ return;
+
+ var manifestFrame = this._applicationCacheObjects[frame.id];
+ if (manifestFrame && manifestURL !== manifestFrame.manifest.manifestURL)
+ this._frameManifestRemoved(frame);
+
+ var oldStatus = manifestFrame ? manifestFrame.status : -1;
+ var statusChanged = manifestFrame && status !== oldStatus;
+ if (manifestFrame)
+ manifestFrame.status = status;
+
+ if (!this._applicationCacheObjects[frame.id]) {
+ var cacheManifest = new WebInspector.ApplicationCacheManifest(manifestURL);
+ this._applicationCacheObjects[frame.id] = new WebInspector.ApplicationCacheFrame(frame, cacheManifest, status);
+
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestAdded, {frameManifest: this._applicationCacheObjects[frame.id]});
+ }
+
+ if (statusChanged)
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, {frameManifest: this._applicationCacheObjects[frame.id]});
+ },
+
+ _frameManifestRemoved: function(frame)
+ {
+ if (!this._applicationCacheObjects[frame.id])
+ return;
+
+ delete this._applicationCacheObjects[frame.id];
+
+ this.dispatchEventToListeners(WebInspector.ApplicationCacheManager.Event.FrameManifestRemoved, {frame: frame});
+ }
+};
+
+WebInspector.ApplicationCacheManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersBranchManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBranchManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/BranchManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BranchManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/BranchManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/BranchManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BranchManager = function()
+{
+ WebInspector.Object.call(this);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ this.initialize();
+}
+
+WebInspector.BranchManager.prototype = {
+ constructor: WebInspector.BranchManager,
+
+ // Public
+
+ initialize: function()
+ {
+ this._originalBranch = new WebInspector.Branch(WebInspector.UIString("Original"), null, true);
+ this._currentBranch = this._originalBranch.fork(WebInspector.UIString("Working Copy"));
+ this._branches = [this._originalBranch, this._currentBranch];
+ },
+
+ get branches()
+ {
+ return this._branches;
+ },
+
+ get currentBranch()
+ {
+ return this._currentBranch;
+ },
+
+ set currentBranch(branch)
+ {
+ console.assert(branch instanceof WebInspector.Branch);
+ if (!(branch instanceof WebInspector.Branch))
+ return;
+
+ this._currentBranch.revert();
+
+ this._currentBranch = branch;
+
+ this._currentBranch.apply();
+ },
+
+ createBranch: function(displayName, fromBranch)
+ {
+ if (!fromBranch)
+ fromBranch = this._originalBranch;
+
+ console.assert(fromBranch instanceof WebInspector.Branch);
+ if (!(fromBranch instanceof WebInspector.Branch))
+ return;
+
+ var newBranch = fromBranch.fork(displayName);
+ this._branches.push(newBranch);
+ return newBranch;
+ },
+
+ deleteBranch: function(branch)
+ {
+ console.assert(branch instanceof WebInspector.Branch);
+ if (!(branch instanceof WebInspector.Branch))
+ return;
+
+ console.assert(branch !== this._originalBranch);
+ if (branch === this._originalBranch)
+ return;
+
+ this._branches.remove(branch);
+
+ if (branch === this._currentBranch)
+ this._currentBranch = this._originalBranch;
+ },
+
+ // Private
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ this.initialize();
+ }
+};
+
+WebInspector.BranchManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCSSStyleManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,367 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleManager = function()
+{
+ WebInspector.Object.call(this);
+
+ if (window.CSSAgent)
+ CSSAgent.enable();
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceAdded, this);
+ WebInspector.Resource.addEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._resourceContentDidChange, this);
+ WebInspector.Resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
+
+ WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.AttributeModified, this._nodeAttributesDidChange, this);
+ WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.AttributeRemoved, this._nodeAttributesDidChange, this);
+ WebInspector.DOMNode.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged, this._nodePseudoClassesDidChange, this);
+
+ this._colorFormatSetting = new WebInspector.Setting("default-color-format", WebInspector.Color.Format.Original);
+
+ this._styleSheetIdentifierMap = {};
+ this._styleSheetFrameURLMap = {};
+ this._nodeStylesMap = {};
+}
+
+WebInspector.CSSStyleManager.ForceablePseudoClasses = ["active", "focus", "hover", "visited"];
+
+WebInspector.CSSStyleManager.prototype = {
+ constructor: WebInspector.CSSStyleManager,
+
+ // Public
+
+ get preferredColorFormat()
+ {
+ return this._colorFormatSetting.value;
+ },
+
+ canForcePseudoClasses: function()
+ {
+ return window.CSSAgent && !!CSSAgent.forcePseudoState;
+ },
+
+ propertyNameHasOtherVendorPrefix: function(name)
+ {
+ if (!name || name.length < 4 || name.charAt(0) !== "-")
+ return false;
+
+ var match = name.match(/^(?:-moz-|-ms-|-o-|-epub-)/);
+ if (!match)
+ return false;
+
+ return true;
+ },
+
+ propertyValueHasOtherVendorKeyword: function(value)
+ {
+ var match = value.match(/(?:-moz-|-ms-|-o-|-epub-)[-\w]+/);
+ if (!match)
+ return false;
+
+ return true;
+ },
+
+ canonicalNameForPropertyName: function(name)
+ {
+ if (!name || name.length < 8 || name.charAt(0) !== "-")
+ return name;
+
+ var match = name.match(/^(?:-webkit-|-khtml-|-apple-)(.+)/);
+ if (!match)
+ return name;
+
+ return match[1];
+ },
+
+ styleSheetForIdentifier: function(id)
+ {
+ if (id in this._styleSheetIdentifierMap)
+ return this._styleSheetIdentifierMap[id];
+
+ var styleSheet = new WebInspector.CSSStyleSheet(id);
+ this._styleSheetIdentifierMap[id] = styleSheet;
+ return styleSheet;
+ },
+
+ stylesForNode: function(node)
+ {
+ if (node.id in this._nodeStylesMap)
+ return this._nodeStylesMap[node.id];
+
+ var styles = new WebInspector.DOMNodeStyles(node);
+ this._nodeStylesMap[node.id] = styles;
+ return styles;
+ },
+
+ // Protected
+
+ mediaQueryResultChanged: function()
+ {
+ // Called from WebInspector.CSSObserver.
+
+ for (var key in this._nodeStylesMap)
+ this._nodeStylesMap[key].mediaQueryResultDidChange();
+ },
+
+ styleSheetChanged: function(styleSheetIdentifier)
+ {
+ // Called from WebInspector.CSSObserver.
+
+ var styleSheet = this.styleSheetForIdentifier(styleSheetIdentifier);
+ console.assert(styleSheet);
+
+ styleSheet.noteContentDidChange();
+
+ this._updateResourceContent(styleSheet);
+ },
+
+ // Private
+
+ _nodePseudoClassesDidChange: function(event)
+ {
+ var node = event.target;
+
+ for (var key in this._nodeStylesMap) {
+ var nodeStyles = this._nodeStylesMap[key];
+ if (nodeStyles.node !== node && !nodeStyles.node.isDescendant(node))
+ continue;
+ nodeStyles.pseudoClassesDidChange(node);
+ }
+ },
+
+ _nodeAttributesDidChange: function(event)
+ {
+ var node = event.target;
+
+ for (var key in this._nodeStylesMap) {
+ var nodeStyles = this._nodeStylesMap[key];
+ if (nodeStyles.node !== node && !nodeStyles.node.isDescendant(node))
+ continue;
+ nodeStyles.attributeDidChange(node, event.data.name);
+ }
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ // Clear our maps when the main frame navigates.
+
+ this._styleSheetIdentifierMap = {};
+ this._styleSheetFrameURLMap = {};
+ this._nodeStylesMap = {};
+ },
+
+ _resourceAdded: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ var resource = event.data.resource;
+ console.assert(resource);
+
+ if (resource.type !== WebInspector.Resource.Type.Stylesheet)
+ return;
+
+ this._clearStyleSheetsForResource(resource);
+ },
+
+ _resourceTypeDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Resource);
+
+ var resource = event.target;
+ if (resource.type !== WebInspector.Resource.Type.Stylesheet)
+ return;
+
+ this._clearStyleSheetsForResource(resource);
+ },
+
+ _clearStyleSheetsForResource: function(resource)
+ {
+ // Clear known stylesheets for this URL and frame. This will cause the stylesheets to
+ // be updated next time _fetchInfoForAllStyleSheets is called.
+ // COMPATIBILITY (iOS 6): The frame's id was not available for the key, so delete just the url too.
+ delete this._styleSheetFrameURLMap[this._frameURLMapKey(resource.parentFrame, resource.url)];
+ delete this._styleSheetFrameURLMap[resource.url];
+ },
+
+ _frameURLMapKey: function(frame, url)
+ {
+ return (frame ? frame.id + ":" : "") + url;
+ },
+
+ _lookupStyleSheetForResource: function(resource, callback)
+ {
+ this._lookupStyleSheet(resource.parentFrame, resource.url, callback);
+ },
+
+ _lookupStyleSheet: function(frame, url, callback)
+ {
+ console.assert(frame instanceof WebInspector.Frame);
+
+ function syleSheetsFetched()
+ {
+ callback(this._styleSheetFrameURLMap[key] || this._styleSheetFrameURLMap[url] || null);
+ }
+
+ var key = this._frameURLMapKey(frame, url);
+
+ // COMPATIBILITY (iOS 6): The frame's id was not available for the key, so check for just the url too.
+ if (key in this._styleSheetFrameURLMap || url in this._styleSheetFrameURLMap)
+ callback(this._styleSheetFrameURLMap[key] || this._styleSheetFrameURLMap[url] || null);
+ else
+ this._fetchInfoForAllStyleSheets(syleSheetsFetched.bind(this));
+ },
+
+ _fetchInfoForAllStyleSheets: function(callback)
+ {
+ console.assert(typeof callback === "function");
+
+ function processStyleSheets(error, styleSheets)
+ {
+ this._styleSheetFrameURLMap = {};
+
+ if (error) {
+ callback();
+ return;
+ }
+
+ for (var i = 0; i < styleSheets.length; ++i) {
+ var styleSheetInfo = styleSheets[i];
+
+ // COMPATIBILITY (iOS 6): The info did not have 'frameId', so make parentFrame null in that case.
+ var parentFrame = "frameId" in styleSheetInfo ? WebInspector.frameResourceManager.frameForIdentifier(styleSheetInfo.frameId) : null;
+
+ var styleSheet = this.styleSheetForIdentifier(styleSheetInfo.styleSheetId);
+ styleSheet.updateInfo(styleSheetInfo.sourceURL, parentFrame);
+
+ var key = this._frameURLMapKey(parentFrame, styleSheetInfo.sourceURL);
+ this._styleSheetFrameURLMap[key] = styleSheet;
+ }
+
+ callback();
+ }
+
+ CSSAgent.getAllStyleSheets(processStyleSheets.bind(this));
+ },
+
+ _resourceContentDidChange: function(event)
+ {
+ var resource = event.target;
+ if (resource === this._ignoreResourceContentDidChangeEventForResource)
+ return;
+
+ // Ignore if it isn't a CSS stylesheet.
+ if (resource.type !== WebInspector.Resource.Type.Stylesheet || resource.syntheticMIMEType !== "text/css")
+ return;
+
+ function applyStyleSheetChanges()
+ {
+ function styleSheetFound(styleSheet)
+ {
+ delete resource.__pendingChangeTimeout;
+
+ console.assert(styleSheet);
+ if (!styleSheet)
+ return;
+
+ // To prevent updating a TextEditor's content while the user is typing in it we want to
+ // ignore the next _updateResourceContent call.
+ resource.__ignoreNextUpdateResourceContent = true;
+
+ WebInspector.branchManager.currentBranch.revisionForRepresentedObject(styleSheet).content = resource.content;
+ }
+
+ this._lookupStyleSheetForResource(resource, styleSheetFound.bind(this));
+ }
+
+ if (resource.__pendingChangeTimeout)
+ clearTimeout(resource.__pendingChangeTimeout);
+ resource.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
+ },
+
+ _updateResourceContent: function(styleSheet)
+ {
+ console.assert(styleSheet);
+
+ function fetchedStyleSheetContent(styleSheet, content)
+ {
+ delete styleSheet.__pendingChangeTimeout;
+
+ console.assert(styleSheet.url);
+ if (!styleSheet.url)
+ return;
+
+ var resource = null;
+
+ // COMPATIBILITY (iOS 6): The stylesheet did not always have a frame, so fallback to looking
+ // for the resource in all frames.
+ if (styleSheet.parentFrame)
+ resource = styleSheet.parentFrame.resourceForURL(styleSheet.url);
+ else
+ resource = WebInspector.frameResourceManager.resourceForURL(styleSheet.url);
+
+ if (!resource)
+ return;
+
+ // Only try to update stylesheet resources. Other resources, like documents, can contain
+ // multiple stylesheets and we don't have the source ranges to update those.
+ if (resource.type !== WebInspector.Resource.Type.Stylesheet)
+ return;
+
+ if (resource.__ignoreNextUpdateResourceContent) {
+ delete resource.__ignoreNextUpdateResourceContent;
+ return;
+ }
+
+ this._ignoreResourceContentDidChangeEventForResource = resource;
+ WebInspector.branchManager.currentBranch.revisionForRepresentedObject(resource).content = content;
+ delete this._ignoreResourceContentDidChangeEventForResource;
+ }
+
+ function styleSheetReady()
+ {
+ styleSheet.requestContent(fetchedStyleSheetContent.bind(this));
+ }
+
+ function applyStyleSheetChanges()
+ {
+ if (styleSheet.url)
+ styleSheetReady.call(this);
+ else
+ this._fetchInfoForAllStyleSheets(styleSheetReady.bind(this));
+ }
+
+ if (styleSheet.__pendingChangeTimeout)
+ clearTimeout(styleSheet.__pendingChangeTimeout);
+ styleSheet.__pendingChangeTimeout = setTimeout(applyStyleSheetChanges.bind(this), 500);
+ }
+}
+
+WebInspector.CSSStyleManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorColorEditingControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorColorEditingControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorColorEditingController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorColorEditingController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorColorEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorColorEditingController = function(codeMirror, marker)
+{
+ WebInspector.CodeMirrorEditingController.call(this, codeMirror, marker);
+}
+
+WebInspector.CodeMirrorColorEditingController.prototype = {
+ constructor: WebInspector.CodeMirrorColorEditingController,
+ __proto__: WebInspector.CodeMirrorEditingController.prototype,
+
+ // Public
+
+ get initialValue()
+ {
+ return WebInspector.Color.fromString(this.text);
+ },
+
+ get cssClassName()
+ {
+ return "color";
+ },
+
+ popoverWillPresent: function(popover)
+ {
+ this._colorPicker = new WebInspector.ColorPicker;
+ this._colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, this._colorPickerColorChanged, this);
+ popover.content = this._colorPicker.element;
+ },
+
+ popoverDidPresent: function(popover)
+ {
+ this._colorPicker.color = this._value;
+ },
+
+ // Private
+
+ _colorPickerColorChanged: function(event)
+ {
+ this.value = event.target.color;
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllercssfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.CodeMirror .CodeMirror-lines .completion-hint {
+ opacity: 0.4;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorCompletionControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorCompletionController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,824 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorCompletionController = function(codeMirror, delegate, stopCharactersRegex)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(codeMirror);
+
+ this._codeMirror = codeMirror;
+ this._stopCharactersRegex = stopCharactersRegex || null;
+ this._delegate = delegate || null;
+
+ this._startOffset = NaN;
+ this._endOffset = NaN;
+ this._lineNumber = NaN;
+ this._prefix = "";
+ this._completions = [];
+ this._extendedCompletionProviders = {};
+
+ this._suggestionsView = new WebInspector.CompletionSuggestionsView(this);
+
+ this._keyMap = {
+ "Up": this._handleUpKey.bind(this),
+ "Down": this._handleDownKey.bind(this),
+ "Right": this._handleRightOrEnterKey.bind(this),
+ "Esc": this._handleEscapeKey.bind(this),
+ "Enter": this._handleRightOrEnterKey.bind(this),
+ "Tab": this._handleTabKey.bind(this),
+ "Cmd-A": this._handleHideKey.bind(this),
+ "Cmd-Z": this._handleHideKey.bind(this),
+ "Shift-Cmd-Z": this._handleHideKey.bind(this),
+ "Cmd-Y": this._handleHideKey.bind(this)
+ };
+
+ this._handleChangeListener = this._handleChange.bind(this);
+ this._handleCursorActivityListener = this._handleCursorActivity.bind(this);
+ this._handleHideActionListener = this._handleHideAction.bind(this);
+
+ this._codeMirror.addKeyMap(this._keyMap);
+
+ this._codeMirror.on("change", this._handleChangeListener);
+ this._codeMirror.on("cursorActivity", this._handleCursorActivityListener);
+ this._codeMirror.on("blur", this._handleHideActionListener);
+ this._codeMirror.on("scroll", this._handleHideActionListener);
+};
+
+WebInspector.CodeMirrorCompletionController.GenericStopCharactersRegex = /[\s=:;,]/;
+WebInspector.CodeMirrorCompletionController.DefaultStopCharactersRegexModeMap = {"css": /[\s:;,{}()]/, "javascript": /[\s=:;,!+\-*/%&|^~?<>.{}()[\]]/};
+WebInspector.CodeMirrorCompletionController.BaseExpressionStopCharactersRegexModeMap = {"javascript": /[\s=:;,!+\-*/%&|^~?<>]/};
+WebInspector.CodeMirrorCompletionController.OpenBracketCharactersRegex = /[({[]/;
+WebInspector.CodeMirrorCompletionController.CloseBracketCharactersRegex = /[)}\]]/;
+WebInspector.CodeMirrorCompletionController.MatchingBrackets = {"{": "}", "(": ")", "[": "]", "}": "{", ")": "(", "]": "["};
+WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName = "completion-hint";
+WebInspector.CodeMirrorCompletionController.CompletionsHiddenDelay = 250;
+WebInspector.CodeMirrorCompletionController.CompletionTypingDelay = 250;
+WebInspector.CodeMirrorCompletionController.CompletionOrigin = "+completion";
+WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin = "+delete-completion";
+
+WebInspector.CodeMirrorCompletionController.prototype = {
+ constructor: WebInspector.CodeMirrorCompletionController,
+
+ // Public
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ addExtendedCompletionProvider: function(modeName, provider)
+ {
+ this._extendedCompletionProviders[modeName] = provider;
+ },
+
+ updateCompletions: function(completions, implicitSuffix)
+ {
+ if (isNaN(this._startOffset) || isNaN(this._endOffset) || isNaN(this._lineNumber))
+ return;
+
+ if (!completions || !completions.length) {
+ this.hideCompletions();
+ return;
+ }
+
+ this._completions = completions;
+
+ if (typeof implicitSuffix === "string")
+ this._implicitSuffix = implicitSuffix;
+
+ var from = {line: this._lineNumber, ch: this._startOffset};
+ var to = {line: this._lineNumber, ch: this._endOffset};
+
+ var firstCharCoords = this._codeMirror.cursorCoords(from);
+ var lastCharCoords = this._codeMirror.cursorCoords(to);
+ var bounds = new WebInspector.Rect(firstCharCoords.left, firstCharCoords.top, lastCharCoords.right - firstCharCoords.left, firstCharCoords.bottom - firstCharCoords.top);
+
+ // Try to restore the previous selected index, otherwise just select the first.
+ var index = this._currentCompletion ? completions.indexOf(this._currentCompletion) : 0;
+ if (index === -1)
+ index = 0;
+
+ if (this._forced || completions.length > 1 || completions[index] !== this._prefix) {
+ // Update and show the suggestion list.
+ this._suggestionsView.update(completions, index);
+ this._suggestionsView.show(bounds);
+ } else if (this._implicitSuffix) {
+ // The prefix and the completion exactly match, but there is an implicit suffix.
+ // Just hide the suggestion list and keep the completion hint for the implicit suffix.
+ this._suggestionsView.hide();
+ } else {
+ // The prefix and the completion exactly match, hide the completions. Return early so
+ // the completion hint isn't updated.
+ this.hideCompletions();
+ return;
+ }
+
+ this._applyCompletionHint(completions[index]);
+ },
+
+ isCompletionChange: function(change)
+ {
+ return this._ignoreChange || change.origin === WebInspector.CodeMirrorCompletionController.CompletionOrigin || change.origin === WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin;
+ },
+
+ isShowingCompletions: function()
+ {
+ return this._suggestionsView.visible || (this._completionHintMarker && this._completionHintMarker.find());
+ },
+
+ isHandlingClickEvent: function()
+ {
+ return this._suggestionsView.isHandlingClickEvent();
+ },
+
+ hideCompletions: function()
+ {
+ this._suggestionsView.hide();
+
+ this._removeCompletionHint();
+
+ this._startOffset = NaN;
+ this._endOffset = NaN;
+ this._lineNumber = NaN;
+ this._prefix = "";
+ this._completions = [];
+ this._implicitSuffix = "";
+ this._forced = false;
+
+ if (this._completionDelayTimeout) {
+ clearTimeout(this._completionDelayTimeout);
+ delete this._completionDelayTimeout;
+ }
+
+ delete this._currentCompletion;
+ delete this._ignoreNextCursorActivity;
+ },
+
+ close: function()
+ {
+ this._codeMirror.removeKeyMap(this._keyMap);
+
+ this._codeMirror.off("change", this._handleChangeListener);
+ this._codeMirror.off("cursorActivity", this._handleCursorActivityListener);
+ this._codeMirror.off("blur", this._handleHideActionListener);
+ this._codeMirror.off("scroll", this._handleHideActionListener);
+ },
+
+ // Protected
+
+ completionSuggestionsSelectedCompletion: function(suggestionsView, completionText)
+ {
+ this._applyCompletionHint(completionText);
+ },
+
+ completionSuggestionsClickedCompletion: function(suggestionsView, completionText)
+ {
+ // The clicked suggestion causes the editor to loose focus. Restore it so the user can keep typing.
+ this._codeMirror.focus();
+
+ this._applyCompletionHint(completionText);
+ this._commitCompletionHint();
+ },
+
+ // Private
+
+ get _currentReplacementText()
+ {
+ return this._currentCompletion + this._implicitSuffix;
+ },
+
+ _hasPendingCompletion: function()
+ {
+ return !isNaN(this._startOffset) && !isNaN(this._endOffset) && !isNaN(this._lineNumber);
+ },
+
+ _notifyCompletionsHiddenSoon: function()
+ {
+ function notify()
+ {
+ if (this._completionHintMarker)
+ return;
+
+ if (this._delegate && typeof this._delegate.completionControllerCompletionsHidden === "function")
+ this._delegate.completionControllerCompletionsHidden(this);
+ }
+
+ if (this._notifyCompletionsHiddenIfNeededTimeout)
+ clearTimeout(this._notifyCompletionsHiddenIfNeededTimeout);
+ this._notifyCompletionsHiddenIfNeededTimeout = setTimeout(notify.bind(this), WebInspector.CodeMirrorCompletionController.CompletionsHiddenDelay);
+ },
+
+ _applyCompletionHint: function(completionText)
+ {
+ console.assert(completionText);
+ if (!completionText)
+ return;
+
+ function update()
+ {
+ this._currentCompletion = completionText;
+
+ this._removeCompletionHint(true, true);
+
+ var replacementText = this._currentReplacementText;
+
+ var from = {line: this._lineNumber, ch: this._startOffset};
+ var cursor = {line: this._lineNumber, ch: this._endOffset};
+ var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
+
+ this._codeMirror.replaceRange(replacementText, from, cursor, WebInspector.CodeMirrorCompletionController.CompletionOrigin);
+ this._removeLastChangeFromHistory();
+
+ this._codeMirror.setCursor(cursor);
+
+ if (cursor.ch !== to.ch)
+ this._completionHintMarker = this._codeMirror.markText(cursor, to, {className: WebInspector.CodeMirrorCompletionController.CompletionHintStyleClassName});
+ }
+
+ this._ignoreChange = true;
+ this._ignoreNextCursorActivity = true;
+
+ this._codeMirror.operation(update.bind(this));
+
+ delete this._ignoreChange;
+ },
+
+ _commitCompletionHint: function()
+ {
+ function update()
+ {
+ this._removeCompletionHint(true, true);
+
+ var replacementText = this._currentReplacementText;
+
+ var from = {line: this._lineNumber, ch: this._startOffset};
+ var cursor = {line: this._lineNumber, ch: this._endOffset};
+ var to = {line: this._lineNumber, ch: this._startOffset + replacementText.length};
+
+ var lastChar = this._currentCompletion.charAt(this._currentCompletion.length - 1);
+ var isClosing = ")]}".indexOf(lastChar);
+ if (isClosing !== -1)
+ to.ch -= 1 + this._implicitSuffix.length;
+
+ this._codeMirror.replaceRange(replacementText, from, cursor, WebInspector.CodeMirrorCompletionController.CompletionOrigin);
+
+ // Don't call _removeLastChangeFromHistory here to allow the committed completion to be undone.
+
+ this._codeMirror.setCursor(to);
+
+ this.hideCompletions();
+ }
+
+ this._ignoreChange = true;
+ this._ignoreNextCursorActivity = true;
+
+ this._codeMirror.operation(update.bind(this));
+
+ delete this._ignoreChange;
+ },
+
+ _removeLastChangeFromHistory: function()
+ {
+ var history = this._codeMirror.getHistory();
+
+ // We don't expect a undone history. But if there is one clear it. If could lead to undefined behavior.
+ console.assert(!history.undone.length);
+ history.undone = [];
+
+ // Pop the last item from the done history.
+ console.assert(history.done.length);
+ history.done.pop();
+
+ this._codeMirror.setHistory(history);
+ },
+
+ _removeCompletionHint: function(nonatomic, dontRestorePrefix)
+ {
+ if (!this._completionHintMarker)
+ return;
+
+ this._notifyCompletionsHiddenSoon();
+
+ function update()
+ {
+ var range = this._completionHintMarker.find();
+ if (range) {
+ this._completionHintMarker.clear();
+
+ this._codeMirror.replaceRange("", range.from, range.to, WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin);
+ this._removeLastChangeFromHistory();
+ }
+
+ this._completionHintMarker = null;
+
+ if (dontRestorePrefix)
+ return;
+
+ console.assert(!isNaN(this._startOffset));
+ console.assert(!isNaN(this._endOffset));
+ console.assert(!isNaN(this._lineNumber));
+
+ var from = {line: this._lineNumber, ch: this._startOffset};
+ var to = {line: this._lineNumber, ch: this._endOffset};
+
+ this._codeMirror.replaceRange(this._prefix, from, to, WebInspector.CodeMirrorCompletionController.DeleteCompletionOrigin);
+ this._removeLastChangeFromHistory();
+ }
+
+ if (nonatomic) {
+ update.call(this);
+ return;
+ }
+
+ this._ignoreChange = true;
+
+ this._codeMirror.operation(update.bind(this));
+
+ delete this._ignoreChange;
+ },
+
+ _scanStringForExpression: function(modeName, string, startOffset, direction, allowMiddleAndEmpty, includeStopCharacter, ignoreInitialUnmatchedOpenBracket, stopCharactersRegex)
+ {
+ console.assert(direction === -1 || direction === 1);
+
+ var stopCharactersRegex = stopCharactersRegex || this._stopCharactersRegex || WebInspector.CodeMirrorCompletionController.DefaultStopCharactersRegexModeMap[modeName] || WebInspector.CodeMirrorCompletionController.GenericStopCharactersRegex;
+
+ function isStopCharacter(character)
+ {
+ return stopCharactersRegex.test(character);
+ }
+
+ function isOpenBracketCharacter(character)
+ {
+ return WebInspector.CodeMirrorCompletionController.OpenBracketCharactersRegex.test(character);
+ }
+
+ function isCloseBracketCharacter(character)
+ {
+ return WebInspector.CodeMirrorCompletionController.CloseBracketCharactersRegex.test(character);
+ }
+
+ function matchingBracketCharacter(character)
+ {
+ return WebInspector.CodeMirrorCompletionController.MatchingBrackets[character];
+ }
+
+ var endOffset = Math.min(startOffset, string.length);
+
+ var endOfLineOrWord = endOffset === string.length || isStopCharacter(string.charAt(endOffset));
+
+ if (!endOfLineOrWord && !allowMiddleAndEmpty)
+ return null;
+
+ var bracketStack = [];
+ var bracketOffsetStack = [];
+ var lastCloseBracketOffset = NaN;
+
+ var startOffset = endOffset;
+ var firstOffset = endOffset + direction;
+ for (var i = firstOffset; direction > 0 ? i < string.length : i >= 0; i += direction) {
+ var character = string.charAt(i);
+
+ // Ignore stop characters when we are inside brackets.
+ if (isStopCharacter(character) && !bracketStack.length)
+ break;
+
+ if (isCloseBracketCharacter(character)) {
+ bracketStack.push(character);
+ bracketOffsetStack.push(i);
+ } else if (isOpenBracketCharacter(character)) {
+ if ((!ignoreInitialUnmatchedOpenBracket || i !== firstOffset) && (!bracketStack.length || matchingBracketCharacter(character) !== bracketStack.lastValue))
+ break;
+
+ bracketOffsetStack.pop();
+ bracketStack.pop();
+ }
+
+ startOffset = i + (direction > 0 ? 1 : 0);
+ }
+
+ if (bracketOffsetStack.length)
+ startOffset = bracketOffsetStack.pop() + 1;
+
+ if (includeStopCharacter && startOffset > 0 && startOffset < string.length)
+ startOffset += direction;
+
+ if (direction > 0) {
+ var tempEndOffset = endOffset;
+ endOffset = startOffset;
+ startOffset = tempEndOffset;
+ }
+
+ return {string: string.substring(startOffset, endOffset), startOffset: startOffset, endOffset: endOffset};
+ },
+
+ _completeAtCurrentPosition: function(force)
+ {
+ if (this._codeMirror.somethingSelected()) {
+ this.hideCompletions();
+ return;
+ }
+
+ if (this._completionDelayTimeout) {
+ clearTimeout(this._completionDelayTimeout);
+ delete this._completionDelayTimeout;
+ }
+
+ this._removeCompletionHint(true, true);
+
+ var cursor = this._codeMirror.getCursor();
+ var token = this._codeMirror.getTokenAt(cursor);
+
+ // Don't try to complete inside comments.
+ if (token.type && /\bcomment\b/.test(token.type)) {
+ this.hideCompletions();
+ return;
+ }
+
+ var mode = this._codeMirror.getMode();
+ var innerMode = CodeMirror.innerMode(mode, token.state).mode;
+ var modeName = innerMode.alternateName || innerMode.name;
+
+ var lineNumber = cursor.line;
+ var lineString = this._codeMirror.getLine(lineNumber);
+
+ var backwardScanResult = this._scanStringForExpression(modeName, lineString, cursor.ch, -1, force);
+ if (!backwardScanResult) {
+ this.hideCompletions();
+ return;
+ }
+
+ var forwardScanResult = this._scanStringForExpression(modeName, lineString, cursor.ch, 1, true, true);
+ var suffix = forwardScanResult.string;
+
+ this._ignoreNextCursorActivity = true;
+
+ this._startOffset = backwardScanResult.startOffset;
+ this._endOffset = backwardScanResult.endOffset;
+ this._lineNumber = lineNumber;
+ this._prefix = backwardScanResult.string;
+ this._completions = [];
+ this._implicitSuffix = "";
+ this._forced = force;
+
+ var baseExpressionStopCharactersRegex = WebInspector.CodeMirrorCompletionController.BaseExpressionStopCharactersRegexModeMap[modeName];
+ if (baseExpressionStopCharactersRegex)
+ var baseScanResult = this._scanStringForExpression(modeName, lineString, this._startOffset, -1, true, false, true, baseExpressionStopCharactersRegex);
+
+ if (!force && !backwardScanResult.string && (!baseScanResult || !baseScanResult.string)) {
+ this.hideCompletions();
+ return;
+ }
+
+ var defaultCompletions = [];
+
+ switch (modeName) {
+ case "css":
+ defaultCompletions = this._generateCSSCompletions(token, baseScanResult ? baseScanResult.string : null, suffix);
+ break;
+ case "javascript":
+ defaultCompletions = this._generateJavaScriptCompletions(token, baseScanResult ? baseScanResult.string : null, suffix);
+ break;
+ }
+
+ var extendedCompletionsProvider = this._extendedCompletionProviders[modeName];
+ if (extendedCompletionsProvider) {
+ extendedCompletionsProvider.completionControllerCompletionsNeeded(this, defaultCompletions, baseScanResult ? baseScanResult.string : null, this._prefix, suffix, force);
+ return;
+ }
+
+ if (this._delegate && typeof this._delegate.completionControllerCompletionsNeeded === "function")
+ this._delegate.completionControllerCompletionsNeeded(this, this._prefix, defaultCompletions, baseScanResult ? baseScanResult.string : null, suffix, force);
+ else
+ this.updateCompletions(defaultCompletions);
+ },
+
+ _generateCSSCompletions: function(mainToken, base, suffix)
+ {
+ // We only support completion inside CSS rules.
+ if (!mainToken.state || !mainToken.state.stack || !mainToken.state.stack.contains("rule"))
+ return [];
+
+ var token = mainToken;
+ var lineNumber = this._lineNumber;
+
+ // Scan backwards looking for the current property.
+ while (token.state.stack.lastValue === "propertyValue") {
+ // Found the beginning of the line. Go to the previous line.
+ if (!token.start) {
+ --lineNumber;
+
+ // No more lines, stop.
+ if (lineNumber < 0)
+ break;
+ }
+
+ // Get the previous token.
+ token = this._codeMirror.getTokenAt({line: lineNumber, ch: token.start ? token.start : Number.MAX_VALUE});
+ }
+
+ // If we have a property token and it's not the main token, then we are working on
+ // the value for that property and should complete allowed values.
+ if (mainToken !== token && token.type && /\bproperty\b/.test(token.type)) {
+ var propertyName = token.string;
+
+ // If there is a suffix and it isn't a semicolon, then we should use a space since
+ // the user is editing in the middle.
+ this._implicitSuffix = suffix && suffix !== ";" ? " " : ";";
+
+ // Don't use an implicit suffix if it would be the same as the existing suffix.
+ if (this._implicitSuffix === suffix)
+ this._implicitSuffix = "";
+
+ return WebInspector.CSSKeywordCompletions.forProperty(propertyName).startsWith(this._prefix);
+ }
+
+ this._implicitSuffix = suffix !== ":" ? ": " : "";
+
+ // Complete property names.
+ return WebInspector.CSSCompletions.cssNameCompletions.startsWith(this._prefix);
+ },
+
+ _generateJavaScriptCompletions: function(mainToken, base, suffix)
+ {
+ // If there is a base expression then we should not attempt to match any keywords or variables.
+ // Allow only open bracket characters at the end of the base, otherwise leave completions with
+ // a base up to the delegate to figure out.
+ if (base && !/[({[]$/.test(base))
+ return [];
+
+ var matchingWords = [];
+
+ const prefix = this._prefix;
+
+ const declaringVariable = mainToken.state.lexical.type === "vardef";
+ const insideSwitch = mainToken.state.lexical.prev ? mainToken.state.lexical.prev.info === "switch" : false;
+ const insideBlock = mainToken.state.lexical.prev ? mainToken.state.lexical.prev.type === "}" : false;
+ const insideParenthesis = mainToken.state.lexical.type === ")";
+ const insideBrackets = mainToken.state.lexical.type === "]";
+
+ const allKeywords = ["break", "case", "catch", "const", "continue", "debugger", "default", "delete", "do", "else", "false", "finally", "for", "function", "if", "in",
+ "Infinity", "instanceof", "NaN", "new", "null", "return", "switch", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with"];
+ const valueKeywords = ["false", "Infinity", "NaN", "null", "this", "true", "undefined"];
+
+ const allowedKeywordsInsideBlocks = allKeywords.keySet();
+ const allowedKeywordsWhenDeclaringVariable = valueKeywords.keySet();
+ const allowedKeywordsInsideParenthesis = valueKeywords.concat(["function"]).keySet();
+ const allowedKeywordsInsideBrackets = allowedKeywordsInsideParenthesis;
+ const allowedKeywordsOnlyInsideSwitch = ["case", "default"].keySet();
+
+ function matchKeywords(keywords)
+ {
+ matchingWords = matchingWords.concat(keywords.filter(function(word) {
+ if (!insideSwitch && word in allowedKeywordsOnlyInsideSwitch)
+ return false;
+ if (insideBlock && !(word in allowedKeywordsInsideBlocks))
+ return false;
+ if (insideBrackets && !(word in allowedKeywordsInsideBrackets))
+ return false;
+ if (insideParenthesis && !(word in allowedKeywordsInsideParenthesis))
+ return false;
+ if (declaringVariable && !(word in allowedKeywordsWhenDeclaringVariable))
+ return false;
+ return word.startsWith(prefix);
+ }));
+ }
+
+ function matchVariables()
+ {
+ function filterVariables(variables)
+ {
+ for (var variable = variables; variable; variable = variable.next) {
+ // Don't match the variable if this token is in a variable declaration.
+ // Otherwise the currently typed text will always match and that isn't useful.
+ if (declaringVariable && variable.name === prefix)
+ continue;
+
+ if (variable.name.startsWith(prefix) && !matchingWords.contains(variable.name))
+ matchingWords.push(variable.name);
+ }
+ }
+
+ var context = mainToken.state.context;
+ while (context) {
+ filterVariables(context.vars);
+ context = context.prev;
+ }
+
+ filterVariables(mainToken.state.globalVars);
+ }
+
+ switch (suffix.substring(0, 1)) {
+ case "":
+ case " ":
+ matchVariables();
+ matchKeywords(allKeywords);
+ break;
+
+ case ".":
+ case "[":
+ matchVariables();
+ matchKeywords(["false", "Infinity", "NaN", "this", "true"]);
+ break;
+
+ case "(":
+ matchVariables();
+ matchKeywords(["catch", "else", "for", "function", "if", "return", "switch", "throw", "while", "with"]);
+ break;
+
+ case "{":
+ matchKeywords(["do", "else", "finally", "return", "try"]);
+ break;
+
+ case ":":
+ if (insideSwitch)
+ matchKeywords(["case", "default"]);
+ break;
+
+ case ";":
+ matchVariables();
+ matchKeywords(valueKeywords);
+ matchKeywords(["break", "continue", "debugger", "return", "void"]);
+ break;
+ }
+
+ return matchingWords;
+ },
+
+ _handleUpKey: function(codeMirror)
+ {
+ if (!this._hasPendingCompletion())
+ return CodeMirror.Pass;
+
+ if (!this.isShowingCompletions())
+ return;
+
+ this._suggestionsView.selectPrevious();
+ },
+
+ _handleDownKey: function(codeMirror)
+ {
+ if (!this._hasPendingCompletion())
+ return CodeMirror.Pass;
+
+ if (!this.isShowingCompletions())
+ return;
+
+ this._suggestionsView.selectNext();
+ },
+
+ _handleRightOrEnterKey: function(codeMirror)
+ {
+ if (!this._hasPendingCompletion())
+ return CodeMirror.Pass;
+
+ if (!this.isShowingCompletions())
+ return;
+
+ this._commitCompletionHint();
+ },
+
+ _handleEscapeKey: function(codeMirror)
+ {
+ var delegateImplementsShouldAllowEscapeCompletion = this._delegate && typeof this._delegate.completionControllerShouldAllowEscapeCompletion === "function";
+ if (this._hasPendingCompletion())
+ this.hideCompletions();
+ else if (this._codeMirror.getOption("readOnly"))
+ return CodeMirror.Pass;
+ else if (!delegateImplementsShouldAllowEscapeCompletion || this._delegate.completionControllerShouldAllowEscapeCompletion(this))
+ this._completeAtCurrentPosition(true);
+ else
+ return CodeMirror.Pass;
+ },
+
+ _handleTabKey: function(codeMirror)
+ {
+ if (!this._hasPendingCompletion())
+ return CodeMirror.Pass;
+
+ if (!this.isShowingCompletions())
+ return;
+
+ console.assert(this._completions.length);
+ if (!this._completions.length)
+ return;
+
+ console.assert(this._currentCompletion);
+ if (!this._currentCompletion)
+ return;
+
+ // Commit the current completion if there is only one suggestion.
+ if (this._completions.length === 1) {
+ this._commitCompletionHint();
+ return;
+ }
+
+ var prefixLength = this._prefix.length;
+
+ var commonPrefix = this._completions[0];
+ for (var i = 1; i < this._completions.length; ++i) {
+ var completion = this._completions[i];
+ var lastIndex = Math.min(commonPrefix.length, completion.length);
+ for (var j = prefixLength; j < lastIndex; ++j) {
+ if (commonPrefix[j] !== completion[j]) {
+ commonPrefix = commonPrefix.substr(0, j);
+ break;
+ }
+ }
+ }
+
+ // Commit the current completion if there is no common prefix that is longer.
+ if (commonPrefix === this._prefix) {
+ this._commitCompletionHint();
+ return;
+ }
+
+ // Set the prefix to the common prefix so _applyCompletionHint will insert the
+ // common prefix as commited text. Adjust _endOffset to match the new prefix.
+ this._prefix = commonPrefix;
+ this._endOffset = this._startOffset + commonPrefix.length;
+
+ this._applyCompletionHint(this._currentCompletion);
+ },
+
+ _handleChange: function(codeMirror, change)
+ {
+ if (this.isCompletionChange(change))
+ return;
+
+ this._ignoreNextCursorActivity = true;
+
+ if (!change.origin || change.origin.charAt(0) !== "+") {
+ this.hideCompletions();
+ return;
+ }
+
+ // Only complete on delete if we are showing completions already.
+ if (change.origin === "+delete" && !this._hasPendingCompletion())
+ return;
+
+ if (this._completionDelayTimeout) {
+ clearTimeout(this._completionDelayTimeout);
+ delete this._completionDelayTimeout;
+ }
+
+ if (this._hasPendingCompletion())
+ this._completeAtCurrentPosition(false);
+ else
+ this._completionDelayTimeout = setTimeout(this._completeAtCurrentPosition.bind(this, false), WebInspector.CodeMirrorCompletionController.CompletionTypingDelay);
+ },
+
+ _handleCursorActivity: function(codeMirror)
+ {
+ if (this._ignoreChange)
+ return;
+
+ if (this._ignoreNextCursorActivity) {
+ delete this._ignoreNextCursorActivity;
+ return;
+ }
+
+ this.hideCompletions();
+ },
+
+ _handleHideKey: function(codeMirror)
+ {
+ this.hideCompletions();
+
+ return CodeMirror.Pass;
+ },
+
+ _handleHideAction: function(codeMirror)
+ {
+ // Clicking a suggestion causes the editor to blur. We don't want to hide completions in this case.
+ if (this.isHandlingClickEvent())
+ return;
+
+ this.hideCompletions();
+ }
+};
+
+WebInspector.CodeMirrorCompletionController.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorDragToAdjustNumberControllercssfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.CodeMirror.drag-to-adjust .CodeMirror-lines {
+ cursor: col-resize;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorDragToAdjustNumberControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorDragToAdjustNumberController = function(codeMirror)
+{
+ this._codeMirror = codeMirror;
+
+ this._dragToAdjustController = new WebInspector.DragToAdjustController(this);
+};
+
+WebInspector.CodeMirrorDragToAdjustNumberController.prototype = {
+ constructor: WebInspector.CodeMirrorDragToAdjustNumberController,
+
+ // Public
+
+ get enabled()
+ {
+ return this._dragToAdjustController.enabled;
+ },
+
+ set enabled(enabled)
+ {
+ if (this.enabled === enabled)
+ return;
+
+ this._dragToAdjustController.element = this._codeMirror.getWrapperElement();
+ this._dragToAdjustController.enabled = enabled;
+ },
+
+ // Protected
+
+ dragToAdjustControllerActiveStateChanged: function(dragToAdjustController)
+ {
+ if (!dragToAdjustController.active)
+ this._hoveredTokenInfo = null;
+ },
+
+ dragToAdjustControllerCanBeActivated: function(dragToAdjustController)
+ {
+ return !this._codeMirror.getOption("readOnly");
+ },
+
+ dragToAdjustControllerCanBeAdjusted: function(dragToAdjustController)
+ {
+
+ return this._hoveredTokenInfo && this._hoveredTokenInfo.containsNumber;
+ },
+
+ dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
+ {
+ this._codeMirror.alterNumberInRange(amount, this._hoveredTokenInfo.startPosition, this._hoveredTokenInfo.endPosition, false);
+ },
+
+ dragToAdjustControllerDidReset: function(dragToAdjustController)
+ {
+ this._hoveredTokenInfo = null;
+ },
+
+ dragToAdjustControllerCanAdjustObjectAtPoint: function(dragToAdjustController, point)
+ {
+ var position = this._codeMirror.coordsChar({left: point.x, top: point.y});
+ var token = this._codeMirror.getTokenAt(position);
+
+ if (!token || !token.type || !token.string) {
+ if (this._hoveredTokenInfo)
+ dragToAdjustController.reset();
+ return false;
+ }
+
+ // Stop right here if we're hovering the same token as we were last time.
+ if (this._hoveredTokenInfo && this._hoveredTokenInfo.line === position.line &&
+ this._hoveredTokenInfo.token.start === token.start && this._hoveredTokenInfo.token.end === token.end)
+ return this._hoveredTokenInfo.token.type.indexOf("number") !== -1;
+
+ var containsNumber = token.type.indexOf("number") !== -1;
+ this._hoveredTokenInfo = {
+ token: token,
+ line: position.line,
+ containsNumber: containsNumber,
+ startPosition: {
+ ch: token.start,
+ line: position.line
+ },
+ endPosition: {
+ ch: token.end,
+ line: position.line
+ }
+ };
+
+ return containsNumber;
+ }
+};
+
+CodeMirror.defineOption("dragToAdjustNumbers", true, function(codeMirror, value, oldValue) {
+ if (!codeMirror.dragToAdjustNumberController)
+ codeMirror.dragToAdjustNumberController = new WebInspector.CodeMirrorDragToAdjustNumberController(codeMirror);
+ codeMirror.dragToAdjustNumberController.enabled = value;
+});
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorEditingControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorEditingControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorEditingController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorEditingController = function(codeMirror, marker)
+{
+ WebInspector.Object.call(this);
+
+ this._codeMirror = codeMirror;
+ this._marker = marker;
+ this._delegate = null;
+
+ this._range = marker.range;
+
+ // The value must support .toString() and .copy() methods.
+ this._value = this.initialValue;
+
+ this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
+}
+
+WebInspector.CodeMirrorEditingController.prototype = {
+ constructor: WebInspector.CodeMirrorEditingController,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get marker()
+ {
+ return this._marker;
+ },
+
+ get range()
+ {
+ return this._range;
+ },
+
+ get value()
+ {
+ return this._value;
+ },
+
+ set value(value)
+ {
+ this.text = value.toString();
+ this._value = value;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(delegate)
+ {
+ this._delegate = delegate;
+ },
+
+ get text()
+ {
+ var from = {line: this._range.startLine, ch: this._range.startColumn};
+ var to = {line: this._range.endLine, ch: this._range.endColumn};
+ return this._codeMirror.getRange(from, to);
+ },
+
+ set text(text)
+ {
+ var from = {line: this._range.startLine, ch: this._range.startColumn};
+ var to = {line: this._range.endLine, ch: this._range.endColumn};
+ this._codeMirror.replaceRange(text, from, to);
+
+ var lines = text.split("\n");
+ var endLine = this._range.startLine + lines.length - 1;
+ var endColumn = lines.length > 1 ? lines.lastValue.length : this._range.startColumn + text.length;
+ this._range = new WebInspector.TextRange(this._range.startLine, this._range.startColumn, endLine, endColumn);
+ },
+
+ get initialValue()
+ {
+ // Implemented by subclasses.
+ return this.text;
+ },
+
+ get cssClassName()
+ {
+ // Implemented by subclasses.
+ return "";
+ },
+
+ get popover()
+ {
+ return this._popover;
+ },
+
+ get popoverPreferredEdges()
+ {
+ // Best to display the popover to the left or above the edited range since its end position may change, but not its start
+ // position. This way we minimize the chances of overlaying the edited range as it changes.
+ return [WebInspector.RectEdge.MIN_X, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X];
+ },
+
+ popoverTargetFrameWithRects: function(rects)
+ {
+ return WebInspector.Rect.unionOfRects(rects);
+ },
+
+ presentHoverMenu: function()
+ {
+ this._hoverMenu = new WebInspector.HoverMenu(this);
+ this._hoverMenu.element.classList.add(this.cssClassName);
+ this._rects = this._marker.rects;
+ this._hoverMenu.present(this._rects);
+ },
+
+ dismissHoverMenu: function(discrete)
+ {
+ this._hoverMenu.dismiss(discrete);
+ },
+
+ popoverWillPresent: function(popover)
+ {
+ // Implemented by subclasses.
+ },
+
+ popoverDidPresent: function(popover)
+ {
+ // Implemented by subclasses.
+ },
+
+ // Protected
+
+ handleKeydownEvent: function(event)
+ {
+ if (!this._keyboardShortcutEsc.matchesEvent(event) || !this._popover.visible)
+ return false;
+
+ this.value = this._originalValue;
+ this._popover.dismiss();
+
+ return true;
+ },
+
+ hoverMenuButtonWasPressed: function(hoverMenu)
+ {
+ this._popover = new WebInspector.Popover(this);
+ this.popoverWillPresent(this._popover);
+ this._popover.present(this.popoverTargetFrameWithRects(this._rects).pad(2), this.popoverPreferredEdges);
+ this.popoverDidPresent(this._popover);
+
+ WebInspector.addWindowKeydownListener(this);
+
+ hoverMenu.dismiss();
+
+ if (this._delegate && typeof this._delegate.editingControllerDidStartEditing === "function")
+ this._delegate.editingControllerDidStartEditing(this);
+
+ this._originalValue = this._value.copy();
+ },
+
+ didDismissPopover: function(popover)
+ {
+ delete this._popover;
+ delete this._originalValue;
+
+ WebInspector.removeWindowKeydownListener(this);
+
+ if (this._delegate && typeof this._delegate.editingControllerDidFinishEditing === "function")
+ this._delegate.editingControllerDidFinishEditing(this);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorGradientEditingControllercssfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.gradient-editing-controller {
+ width: 260px;
+ height: 109px;
+
+ font-family: "Lucida Grande", Helvetica, sans-serif;
+}
+
+.gradient-editing-controller.edits-color {
+ height: 306px;
+}
+
+.gradient-editing-controller.radial-gradient {
+ height: 78px;
+}
+
+.gradient-editing-controller.edits-color.radial-gradient {
+ height: 275px;
+}
+
+.gradient-editing-controller select {
+ position: absolute;
+ left: 17px;
+ top: 9px;
+ width: 237px;
+
+ font-size: 16px;
+}
+
+.gradient-editing-controller .gradient-slider {
+ left: 16px;
+ right: 26px;
+ top: 42px;
+}
+
+.gradient-editing-controller .color-picker {
+ position: absolute;
+
+ top: 86px;
+ width: 202px;
+ height: 172px;
+ padding: 0 10px;
+}
+
+.gradient-editing-controller > .color-picker > .slider {
+ top: 2px;
+ width: 186px;
+}
+
+.gradient-editing-controller > .color-picker > .brightness {
+ left: 214px;
+}
+
+.gradient-editing-controller > .color-picker > .opacity {
+ left: 237px;
+}
+
+.gradient-editing-controller > label {
+ position: absolute;
+ top: 85px;
+ right: 16px;
+
+ text-align: right;
+ font-size: 13px;
+}
+
+.gradient-editing-controller.radial-gradient > label {
+ display: none;
+}
+
+.gradient-editing-controller.edits-color > label {
+ top: 283px;
+}
+
+.gradient-editing-controller > label > input {
+ width: 48px;
+
+ padding-right: 4px;
+ margin-left: 5px;
+
+ background-color: white;
+
+ border-radius: 4px;
+ border: 1px solid rgb(155,155,155);
+ box-shadow: inset 0 0 1px 1px rgb(227,227,227);
+ outline: 0;
+
+ font-size: 13px;
+ text-align: right;
+}
+
+.gradient-editing-controller > label.drag-to-adjust,
+.gradient-editing-controller > label.drag-to-adjust > input {
+ cursor: col-resize;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorGradientEditingControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,249 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorGradientEditingController = function(codeMirror, marker)
+{
+ WebInspector.CodeMirrorEditingController.call(this, codeMirror, marker);
+
+ if (!WebInspector.CodeMirrorGradientEditingController.GradientTypes) {
+ WebInspector.CodeMirrorGradientEditingController.GradientTypes = {
+ "linear-gradient": {
+ type: WebInspector.LinearGradient,
+ label: WebInspector.UIString("Linear Gradient"),
+ repeats: false
+ },
+
+ "radial-gradient": {
+ type: WebInspector.RadialGradient,
+ label: WebInspector.UIString("Radial Gradient"),
+ repeats: false
+ },
+
+ "repeating-linear-gradient": {
+ type: WebInspector.LinearGradient,
+ label: WebInspector.UIString("Repeating Linear Gradient"),
+ repeats: true
+ },
+
+ "repeating-radial-gradient": {
+ type: WebInspector.RadialGradient,
+ label: WebInspector.UIString("Repeating Radial Gradient"),
+ repeats: true
+ }
+ };
+ }
+}
+
+WebInspector.CodeMirrorGradientEditingController.StyleClassName = "gradient-editing-controller";
+WebInspector.CodeMirrorGradientEditingController.EditsColorClassName = "edits-color";
+WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName = "radial-gradient";
+
+// Lazily populated in the WebInspector.CodeMirrorGradientEditingController constructor.
+// It needs to be lazy to use UIString after Main.js and localizedStrings.js loads.
+WebInspector.CodeMirrorGradientEditingController.GradientTypes = null;
+
+WebInspector.CodeMirrorGradientEditingController.prototype = {
+ constructor: WebInspector.CodeMirrorGradientEditingController,
+ __proto__: WebInspector.CodeMirrorEditingController.prototype,
+
+ // Public
+
+ get initialValue()
+ {
+ return WebInspector.Gradient.fromString(this.text);
+ },
+
+ get cssClassName()
+ {
+ return "gradient";
+ },
+
+ get popoverPreferredEdges()
+ {
+ // Since the gradient editor can resize to be quite tall, let's avoid displaying the popover
+ // above the edited value so that it may not change which edge it attaches to upon editing a stop.
+ return [WebInspector.RectEdge.MIN_X, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X];
+ },
+
+ popoverTargetFrameWithRects: function(rects)
+ {
+ // If a gradient is defined across several lines, we probably want to use the first line only
+ // as a target frame for the editor since we may reformat the gradient value to fit on a single line.
+ return rects[0];
+ },
+
+ popoverWillPresent: function(popover)
+ {
+ this._container = document.createElement("div");
+ this._container.className = WebInspector.CodeMirrorGradientEditingController.StyleClassName;
+
+ this._gradientTypePicker = this._container.appendChild(document.createElement("select"));
+ for (var type in WebInspector.CodeMirrorGradientEditingController.GradientTypes) {
+ var option = this._gradientTypePicker.appendChild(document.createElement("option"));
+ option.value = type;
+ option.innerText = WebInspector.CodeMirrorGradientEditingController.GradientTypes[type].label;
+ }
+ this._gradientTypePicker.addEventListener("change", this);
+
+ this._gradientSlider = new WebInspector.GradientSlider;
+ this._container.appendChild(this._gradientSlider.element);
+
+ this._colorPicker = new WebInspector.ColorPicker;
+ this._colorPicker.colorWheel.dimension = 190;
+ this._colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, this._colorPickerColorChanged, this);
+
+ var angleLabel = this._container.appendChild(document.createElement("label"));
+ angleLabel.textContent = WebInspector.UIString("Angle");
+
+ this._angleInput = document.createElement("input");
+ this._angleInput.type = "text";
+ this._angleInput.size = 3;
+ this._angleInput.addEventListener("input", this);
+ angleLabel.appendChild(this._angleInput);
+
+ var dragToAdjustController = new WebInspector.DragToAdjustController(this);
+ dragToAdjustController.element = angleLabel;
+ dragToAdjustController.enabled = true;
+
+ this._updateCSSClassForGradientType();
+
+ popover.content = this._container;
+ },
+
+ popoverDidPresent: function(popover)
+ {
+ this._gradientSlider.stops = this.value.stops;
+
+ if (this.value instanceof WebInspector.LinearGradient) {
+ this._gradientTypePicker.value = this.value.repeats ? "repeating-linear-gradient" : "linear-gradient";
+ this._angleInput.value = this.value.angle + "\u00B0";
+ } else
+ this._gradientTypePicker.value = this.value.repeats ? "repeating-radial-gradient" : "radial-gradient"
+
+ this._gradientSlider.delegate = this;
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ if (event.type === "input")
+ this._handleInputEvent(event);
+ else if (event.type === "change")
+ this._handleChangeEvent(event);
+ },
+
+ gradientSliderStopsDidChange: function(gradientSlider)
+ {
+ this.text = this.value.toString();
+ },
+
+ gradientSliderStopWasSelected: function(gradientSlider, stop)
+ {
+ var selectedStop = gradientSlider.selectedStop;
+
+ if (selectedStop && !this._container.classList.contains(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName)) {
+ this._container.appendChild(this._colorPicker.element);
+ this._container.classList.add(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName);
+ this._colorPicker.color = selectedStop.color;
+ } else if (!selectedStop) {
+ this._colorPicker.element.remove();
+ this._container.classList.remove(WebInspector.CodeMirrorGradientEditingController.EditsColorClassName);
+ }
+
+ // Ensure the angle input is not focused since, if it were, it'd make a scrollbar appear as we
+ // animate the popover's frame to fit its new content.
+ this._angleInput.blur();
+
+ this.popover.update();
+ },
+
+ dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
+ {
+ var angle = parseFloat(this._angleInput.value) + amount;
+ if (Math.round(angle) !== angle)
+ angle = angle.toFixed(1);
+
+ this._angleInput.value = angle;
+ this._angleInputValueDidChange(angle);
+ },
+
+ // Private
+
+ _handleInputEvent: function(event)
+ {
+ var angle = parseFloat(this._angleInput.value);
+ if (isNaN(angle))
+ return;
+
+ this._angleInputValueDidChange(angle);
+ },
+
+ _angleInputValueDidChange: function(angle)
+ {
+ this.value.angle = angle;
+ this.text = this.value.toString();
+
+ var matches = this._angleInput.value.match(/\u00B0/g);
+ if (!matches || matches.length !== 1) {
+ var selectionStart = this._angleInput.selectionStart;
+ this._angleInput.value = angle + "\u00B0";
+ this._angleInput.selectionStart = selectionStart;
+ this._angleInput.selectionEnd = selectionStart;
+ }
+ },
+
+ _handleChangeEvent: function(event)
+ {
+ var descriptor = WebInspector.CodeMirrorGradientEditingController.GradientTypes[this._gradientTypePicker.value];
+ if (!(this.value instanceof descriptor.type)) {
+ if (descriptor.type === WebInspector.LinearGradient) {
+ this.value = new WebInspector.LinearGradient(180, this.value.stops);
+ this._angleInput.value = "180\u00B0";
+ } else
+ this.value = new WebInspector.RadialGradient("", this.value.stops);
+
+ this._updateCSSClassForGradientType();
+ this.popover.update();
+ }
+ this.value.repeats = descriptor.repeats;
+ this.text = this.value.toString();
+ },
+
+ _colorPickerColorChanged: function(event)
+ {
+ this._gradientSlider.selectedStop.color = event.target.color;
+ this._gradientSlider.stops = this.value.stops;
+ this.text = this.value.toString();
+ },
+
+ _updateCSSClassForGradientType: function()
+ {
+ if (this.value instanceof WebInspector.LinearGradient)
+ this._container.classList.remove(WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName);
+ else
+ this._container.classList.add(WebInspector.CodeMirrorGradientEditingController.RadialGradientClassName);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorTokenTrackingControllercssfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.CodeMirror .jump-to-symbol-highlight {
+ color: blue !important;
+ text-decoration: underline !important;
+ cursor: pointer !important;
+ -webkit-text-stroke-width: 0 !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorTokenTrackingControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorTokenTrackingControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorTokenTrackingController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,509 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CodeMirrorTokenTrackingController = function(codeMirror, delegate)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(codeMirror);
+
+ this._codeMirror = codeMirror;
+ this._delegate = delegate || null;
+ this._mode = WebInspector.CodeMirrorTokenTrackingController.Mode.None;
+
+ this._mouseOverDelayDuration = 0;
+ this._mouseOutReleaseDelayDuration = 0;
+ this._classNameForHighlightedRange = null;
+
+ this._enabled = false;
+ this._tracking = false;
+ this._hoveredTokenInfo = null;
+ this._hoveredMarker = null;
+};
+
+WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName = "jump-to-symbol-highlight";
+
+WebInspector.CodeMirrorTokenTrackingController.Mode = {
+ None: "none",
+ NonSymbolTokens: "non-symbol-tokens",
+ JavaScriptExpression: "javascript-expression",
+ MarkedTokens: "marked-tokens"
+}
+
+WebInspector.CodeMirrorTokenTrackingController.prototype = {
+ constructor: WebInspector.CodeMirrorTokenTrackingController,
+
+ // Public
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(x)
+ {
+ this._delegate = x;
+ },
+
+ get enabled()
+ {
+ return this._enabled;
+ },
+
+ set enabled(enabled)
+ {
+ if (this._enabled === enabled)
+ return;
+
+ this._enabled = enabled;
+
+ var wrapper = this._codeMirror.getWrapperElement();
+ if (enabled) {
+ wrapper.addEventListener("mouseenter", this);
+ wrapper.addEventListener("mouseleave", this);
+ this._updateHoveredTokenInfo({left: WebInspector.mouseCoords.x, top: WebInspector.mouseCoords.y});
+ this._startTracking();
+ } else {
+ wrapper.removeEventListener("mouseenter", this);
+ wrapper.removeEventListener("mouseleave", this);
+ this._stopTracking();
+ }
+ },
+
+ get mode()
+ {
+ return this._mode;
+ },
+
+ set mode(mode)
+ {
+ var oldMode = this._mode;
+
+ this._mode = mode || WebInspector.CodeMirrorTokenTrackingController.Mode.None;
+
+ if (oldMode !== this._mode && this._tracking && this._hoveredTokenInfo)
+ this._processNewHoveredToken();
+ },
+
+ get mouseOverDelayDuration()
+ {
+ return this._mouseOverDelayDuration;
+ },
+
+ set mouseOverDelayDuration(x)
+ {
+ console.assert(x >= 0);
+ this._mouseOverDelayDuration = Math.max(x, 0);
+ },
+
+ get mouseOutReleaseDelayDuration()
+ {
+ return this._mouseOutReleaseDelayDuration;
+ },
+
+ set mouseOutReleaseDelayDuration(x)
+ {
+ console.assert(x >= 0);
+ this._mouseOutReleaseDelayDuration = Math.max(x, 0);
+ },
+
+ get classNameForHighlightedRange()
+ {
+ return this._classNameForHighlightedRange;
+ },
+
+ set classNameForHighlightedRange(x)
+ {
+ this._classNameForHighlightedRange = x || null;
+ },
+
+ get candidate()
+ {
+ return this._candidate;
+ },
+
+ get hoveredMarker()
+ {
+ return this._hoveredMarker;
+ },
+
+ set hoveredMarker(hoveredMarker)
+ {
+ this._hoveredMarker = hoveredMarker;
+ },
+
+ highlightLastHoveredRange: function()
+ {
+ if (this._candidate)
+ this.highlightRange(this._candidate.hoveredTokenRange);
+ },
+
+ highlightRange: function(range)
+ {
+ // Nothing to do if we're trying to highlight the same range.
+ if (this._codeMirrorMarkedText && this._codeMirrorMarkedText.className === this._classNameForHighlightedRange) {
+ var highlightedRange = this._codeMirrorMarkedText.find();
+ if (WebInspector.compareCodeMirrorPositions(highlightedRange.from, range.start) === 0 &&
+ WebInspector.compareCodeMirrorPositions(highlightedRange.to, range.end) === 0)
+ return;
+ }
+
+ this.removeHighlightedRange();
+
+ var className = this._classNameForHighlightedRange || "";
+ this._codeMirrorMarkedText = this._codeMirror.markText(range.start, range.end, {className: className});
+
+ window.addEventListener("mousemove", this, true);
+ },
+
+ removeHighlightedRange: function()
+ {
+ if (!this._codeMirrorMarkedText)
+ return;
+
+ this._codeMirrorMarkedText.clear();
+ delete this._codeMirrorMarkedText;
+
+ window.removeEventListener("mousemove", this, true);
+ },
+
+ // Private
+
+ _startTracking: function()
+ {
+ console.assert(!this._tracking);
+ if (this._tracking)
+ return;
+
+ this._tracking = true;
+
+ var wrapper = this._codeMirror.getWrapperElement();
+ wrapper.addEventListener("mousemove", this, true);
+ wrapper.addEventListener("mouseout", this, false);
+ wrapper.addEventListener("mousedown", this, false);
+ wrapper.addEventListener("mouseup", this, false);
+ window.addEventListener("blur", this, true);
+ },
+
+ _stopTracking: function()
+ {
+ console.assert(this._tracking);
+ if (!this._tracking)
+ return;
+
+ this._tracking = false;
+ this._candidate = null;
+
+ var wrapper = this._codeMirror.getWrapperElement();
+ wrapper.removeEventListener("mousemove", this, true);
+ wrapper.removeEventListener("mouseout", this, false);
+ wrapper.removeEventListener("mousedown", this, false);
+ wrapper.removeEventListener("mouseup", this, false);
+ window.removeEventListener("blur", this, true);
+ window.removeEventListener("mousemove", this, true);
+
+ this._resetTrackingStates();
+ },
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mouseenter":
+ this._mouseEntered(event);
+ break;
+ case "mouseleave":
+ this._mouseLeft(event);
+ break;
+ case "mousemove":
+ if (event.currentTarget === window)
+ this._mouseMovedWithMarkedText(event);
+ else
+ this._mouseMovedOverEditor(event);
+ break;
+ case "mouseout":
+ // Only deal with a mouseout event that has the editor wrapper as the target.
+ if (!event.currentTarget.contains(event.relatedTarget))
+ this._mouseMovedOutOfEditor(event);
+ break;
+ case "mousedown":
+ this._mouseButtonWasPressedOverEditor(event);
+ break;
+ case "mouseup":
+ this._mouseButtonWasReleasedOverEditor(event);
+ break;
+ case "blur":
+ this._windowLostFocus(event);
+ break;
+ }
+ },
+
+ _mouseEntered: function(event)
+ {
+ this._startTracking();
+ },
+
+ _mouseLeft: function(event)
+ {
+ this._stopTracking();
+ },
+
+ _mouseMovedWithMarkedText: function(event)
+ {
+ var shouldRelease = !event.target.classList.contains(this._classNameForHighlightedRange);
+ if (shouldRelease && this._delegate && typeof this._delegate.tokenTrackingControllerCanReleaseHighlightedRange === "function")
+ shouldRelease = this._delegate.tokenTrackingControllerCanReleaseHighlightedRange(this, event.target);
+
+ if (shouldRelease) {
+ if (!this._markedTextMouseoutTimer)
+ this._markedTextMouseoutTimer = setTimeout(this._markedTextIsNoLongerHovered.bind(this), this._mouseOutReleaseDelayDuration);
+ return;
+ }
+
+ clearTimeout(this._markedTextMouseoutTimer);
+ delete this._markedTextMouseoutTimer;
+ },
+
+ _markedTextIsNoLongerHovered: function()
+ {
+ if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeReleased === "function")
+ this._delegate.tokenTrackingControllerHighlightedRangeReleased(this);
+ delete this._markedTextMouseoutTimer;
+ },
+
+ _mouseMovedOverEditor: function(event)
+ {
+ this._updateHoveredTokenInfo({left: event.pageX, top: event.pageY});
+ },
+
+ _updateHoveredTokenInfo: function(mouseCoords)
+ {
+ // Get the position in the text and the token at that position.
+ var position = this._codeMirror.coordsChar(mouseCoords);
+ var token = this._codeMirror.getTokenAt(position);
+
+ if (!token || !token.type || !token.string) {
+ if (this._hoveredMarker && this._delegate && typeof this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker === "function") {
+ if (!this._codeMirror.findMarksAt(position).contains(this._hoveredMarker.codeMirrorTextMarker))
+ this._delegate.tokenTrackingControllerMouseOutOfHoveredMarker(this, this._hoveredMarker);
+ }
+
+ this._resetTrackingStates();
+ return;
+ }
+
+ // Stop right here if we're hovering the same token as we were last time.
+ if (this._hoveredTokenInfo &&
+ this._hoveredTokenInfo.position.line === position.line &&
+ this._hoveredTokenInfo.token.start === token.start &&
+ this._hoveredTokenInfo.token.end === token.end)
+ return;
+
+ // We have a new hovered token.
+ var innerMode = CodeMirror.innerMode(this._codeMirror.getMode(), token.state);
+ var codeMirrorModeName = innerMode.mode.alternateName || innerMode.mode.name;
+ this._hoveredTokenInfo = {
+ token: token,
+ position: position,
+ innerMode: innerMode,
+ modeName: codeMirrorModeName
+ };
+
+ clearTimeout(this._tokenHoverTimer);
+
+ if (this._codeMirrorMarkedText || !this._mouseOverDelayDuration)
+ this._processNewHoveredToken();
+ else
+ this._tokenHoverTimer = setTimeout(this._processNewHoveredToken.bind(this), this._mouseOverDelayDuration);
+ },
+
+ _mouseMovedOutOfEditor: function(event)
+ {
+ clearTimeout(this._tokenHoverTimer);
+ delete this._hoveredTokenInfo;
+ delete this._selectionMayBeInProgress;
+ },
+
+ _mouseButtonWasPressedOverEditor: function(event)
+ {
+ this._selectionMayBeInProgress = true;
+ },
+
+ _mouseButtonWasReleasedOverEditor: function(event)
+ {
+ delete this._selectionMayBeInProgress;
+ this._mouseMovedOverEditor(event);
+
+ if (this._codeMirrorMarkedText && this._hoveredTokenInfo) {
+ var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
+ var marks = this._codeMirror.findMarksAt(position);
+ for (var i = 0; i < marks.length; ++i) {
+ if (marks[i] === this._codeMirrorMarkedText) {
+ if (this._delegate && typeof this._delegate.tokenTrackingControllerHighlightedRangeWasClicked === "function") {
+ // Trigger the clicked delegate asynchronously, letting the editor complete handling of the click.
+ setTimeout(function() { this._delegate.tokenTrackingControllerHighlightedRangeWasClicked(this); }.bind(this), 0);
+ }
+ break;
+ }
+ }
+ }
+ },
+
+ _windowLostFocus: function(event)
+ {
+ this._resetTrackingStates();
+ },
+
+ _processNewHoveredToken: function()
+ {
+ console.assert(this._hoveredTokenInfo);
+
+ if (this._selectionMayBeInProgress)
+ return;
+
+ this._candidate = null;
+
+ switch (this._mode) {
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens:
+ this._candidate = this._processNonSymbolToken();
+ break;
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression:
+ this._candidate = this._processJavaScriptExpression();
+ break;
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens:
+ this._candidate = this._processMarkedToken();
+ break;
+ }
+
+ if (!this._candidate)
+ return;
+
+ clearTimeout(this._markedTextMouseoutTimer);
+ delete this._markedTextMouseoutTimer;
+
+ if (this._delegate && typeof this._delegate.tokenTrackingControllerNewHighlightCandidate === "function")
+ this._delegate.tokenTrackingControllerNewHighlightCandidate(this, this._candidate);
+ },
+
+ _processNonSymbolToken: function()
+ {
+ // Ignore any symbol tokens.
+ var type = this._hoveredTokenInfo.token.type;
+ if (!type)
+ return null;
+
+ var startPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
+ var endPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.end};
+
+ return {
+ hoveredToken: this._hoveredTokenInfo.token,
+ hoveredTokenRange: {start: startPosition, end: endPosition},
+ };
+ },
+
+ _processJavaScriptExpression: function()
+ {
+ // Only valid within JavaScript.
+ if (this._hoveredTokenInfo.modeName !== "javascript")
+ return null;
+
+ var startPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
+ var endPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.end};
+
+ // If the hovered token is within a selection, use the selection as our expression.
+ if (this._codeMirror.somethingSelected()) {
+ var selectionRange = {
+ start: this._codeMirror.getCursor("start"),
+ end: this._codeMirror.getCursor("end")
+ };
+
+ function tokenIsInRange(token, range)
+ {
+ return token.line >= range.start.line && token.ch >= range.start.ch &&
+ token.line <= range.end.line && token.ch <= range.end.ch;
+ }
+
+ if (tokenIsInRange(startPosition, selectionRange) || tokenIsInRange(endPosition, selectionRange)) {
+ return {
+ hoveredToken: this._hoveredTokenInfo.token,
+ hoveredTokenRange: selectionRange,
+ expression: this._codeMirror.getSelection(),
+ expressionRange: selectionRange,
+ };
+ }
+ }
+
+ // We only handle vars, definitions, properties, and the keyword 'this'.
+ var type = this._hoveredTokenInfo.token.type;
+ var isProperty = type.indexOf("property") !== -1;
+ var isKeyword = type.indexOf("keyword") !== -1;
+ if (!isProperty && !isKeyword && type.indexOf("variable") === -1 && type.indexOf("def") === -1)
+ return null;
+
+ // Not object literal properties.
+ var state = this._hoveredTokenInfo.innerMode.state;
+ if (isProperty && state.lexical && state.lexical.type === "}")
+ return null;
+
+ // Only the "this" keyword.
+ if (isKeyword && this._hoveredTokenInfo.token.string !== "this")
+ return null;
+
+ // Work out the full hovered expression.
+ var expression = this._hoveredTokenInfo.token.string;
+ var expressionStartPosition = {line: this._hoveredTokenInfo.position.line, ch: this._hoveredTokenInfo.token.start};
+ while (true) {
+ var token = this._codeMirror.getTokenAt(expressionStartPosition);
+ var isDot = token && !token.type && token.string === ".";
+ var isExpression = token && token.type && token.type.indexOf("m-javascript") !== -1;
+ if (!isDot && !isExpression)
+ break;
+ expression = token.string + expression;
+ expressionStartPosition.ch = token.start;
+ }
+
+ // Return the candidate for this token and expression.
+ return {
+ hoveredToken: this._hoveredTokenInfo.token,
+ hoveredTokenRange: {start: startPosition, end: endPosition},
+ expression: expression,
+ expressionRange: {start: expressionStartPosition, end: endPosition},
+ };
+ },
+
+ _processMarkedToken: function()
+ {
+ return this._processNonSymbolToken();
+ },
+
+ _resetTrackingStates: function()
+ {
+ clearTimeout(this._tokenHoverTimer);
+ delete this._selectionMayBeInProgress;
+ delete this._hoveredTokenInfo;
+ this.removeHighlightedRange();
+ }
+};
+
+WebInspector.CodeMirrorCompletionController.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDOMTreeManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,833 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @extends {WebInspector.Object}
+ * @constructor
+ */
+WebInspector.DOMTreeManager = function() {
+ /** @type {Object|undefined} */
+ this._idToDOMNode = {};
+ this._document = null;
+ this._attributeLoadNodeIds = {};
+ this._flows = new Map;
+ this._contentNodesToFlowsMap = new Map;
+}
+
+WebInspector.Object.addConstructorFunctions(WebInspector.DOMTreeManager);
+
+WebInspector.DOMTreeManager.Event = {
+ AttributeModified: "dom-tree-manager-attribute-modified",
+ AttributeRemoved: "dom-tree-manager-attribute-removed",
+ CharacterDataModified: "dom-tree-manager-character-data-modified",
+ NodeInserted: "dom-tree-manager-node-inserted",
+ NodeRemoved: "dom-tree-manager-node-removed",
+ DocumentUpdated: "dom-tree-manager-document-updated",
+ ChildNodeCountUpdated: "dom-tree-manager-child-node-count-updated",
+ DOMNodeWasInspected: "dom-tree-manager-dom-node-was-inspected",
+ InspectModeStateChanged: "dom-tree-manager-inspect-mode-state-changed",
+ ContentFlowListWasUpdated: "dom-tree-manager-content-flow-list-was-updated",
+ ContentFlowWasAdded: "dom-tree-manager-content-flow-was-added",
+ ContentFlowWasRemoved: "dom-tree-manager-content-flow-was-removed",
+ RegionLayoutUpdated: "dom-tree-manager-region-layout-updated",
+ RegionOversetChanged: "dom-tree-manager-region-overset-changed"
+};
+
+WebInspector.DOMTreeManager._flowPayloadHashKey = function(flowPayload)
+{
+ // Use the flow node id, to avoid collisions when we change main document id.
+ return flowPayload.documentNodeId + ":" + flowPayload.name;
+};
+
+WebInspector.DOMTreeManager.prototype = {
+ /**
+ * @param {function(WebInspector.DOMDocument)=} callback
+ */
+ requestDocument: function(callback)
+ {
+ if (this._document) {
+ if (callback)
+ callback(this._document);
+ return;
+ }
+
+ if (this._pendingDocumentRequestCallbacks) {
+ this._pendingDocumentRequestCallbacks.push(callback);
+ return;
+ }
+
+ this._pendingDocumentRequestCallbacks = [callback];
+
+ /**
+ * @this {WebInspector.DOMTreeManager}
+ * @param {?Protocol.Error} error
+ * @param {DOMAgent.Node} root
+ */
+ function onDocumentAvailable(error, root)
+ {
+ if (!error)
+ this._setDocument(root);
+
+ for (var i = 0; i < this._pendingDocumentRequestCallbacks.length; ++i) {
+ var callback = this._pendingDocumentRequestCallbacks[i];
+ if (callback)
+ callback(this._document);
+ }
+ delete this._pendingDocumentRequestCallbacks;
+ }
+
+ DOMAgent.getDocument(onDocumentAvailable.bind(this));
+ },
+
+ /**
+ * @param {RuntimeAgent.RemoteObjectId} objectId
+ * @param {function()=} callback
+ */
+ pushNodeToFrontend: function(objectId, callback)
+ {
+ this._dispatchWhenDocumentAvailable(DOMAgent.requestNode.bind(DOMAgent, objectId), callback);
+ },
+
+ /**
+ * @param {string} path
+ * @param {function(?WebInspector.DOMNode)=} callback
+ */
+ pushNodeByPathToFrontend: function(path, callback)
+ {
+ var callbackCast = /** @type {function(*)} */ callback;
+ this._dispatchWhenDocumentAvailable(DOMAgent.pushNodeByPathToFrontend.bind(DOMAgent, path), callbackCast);
+ },
+
+ /**
+ * @param {function(*)=} callback
+ * @return {function(?Protocol.Error,*=)|undefined}
+ */
+ _wrapClientCallback: function(callback)
+ {
+ if (!callback)
+ return;
+ return function(error, result) {
+ if (error)
+ console.error("Error during DOMAgent operation: " + error);
+ callback(error ? null : result);
+ };
+ },
+
+ /**
+ * @param {function(function()=)} func
+ * @param {function(*)=} callback
+ */
+ _dispatchWhenDocumentAvailable: function(func, callback)
+ {
+ var callbackWrapper = /** @type {function(?Protocol.Error, *=)} */ this._wrapClientCallback(callback);
+
+ function onDocumentAvailable()
+ {
+ if (this._document)
+ func(callbackWrapper);
+ else {
+ if (callbackWrapper)
+ callbackWrapper("No document");
+ }
+ }
+ this.requestDocument(onDocumentAvailable.bind(this));
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {string} name
+ * @param {string} value
+ */
+ _attributeModified: function(nodeId, name, value)
+ {
+ var node = this._idToDOMNode[nodeId];
+ if (!node)
+ return;
+ node._setAttribute(name, value);
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, { node: node, name: name });
+ node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeModified, {name: name});
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {string} name
+ */
+ _attributeRemoved: function(nodeId, name)
+ {
+ var node = this._idToDOMNode[nodeId];
+ if (!node)
+ return;
+ node._removeAttribute(name);
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeRemoved, { node: node, name: name });
+ node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeRemoved, {name: name});
+ },
+
+ /**
+ * @param {Array.<DOMAgent.NodeId>} nodeIds
+ */
+ _inlineStyleInvalidated: function(nodeIds)
+ {
+ for (var i = 0; i < nodeIds.length; ++i)
+ this._attributeLoadNodeIds[nodeIds[i]] = true;
+ if ("_loadNodeAttributesTimeout" in this)
+ return;
+ this._loadNodeAttributesTimeout = setTimeout(this._loadNodeAttributes.bind(this), 0);
+ },
+
+ _loadNodeAttributes: function()
+ {
+ /**
+ * @this {WebInspector.DOMTreeManager}
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {?Protocol.Error} error
+ * @param {Array.<string>} attributes
+ */
+ function callback(nodeId, error, attributes)
+ {
+ if (error) {
+ console.error("Error during DOMAgent operation: " + error);
+ return;
+ }
+ var node = this._idToDOMNode[nodeId];
+ if (node) {
+ node._setAttributesPayload(attributes);
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, { node: node, name: "style" });
+ node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeModified, {name: "style"});
+ }
+ }
+
+ delete this._loadNodeAttributesTimeout;
+
+ for (var nodeId in this._attributeLoadNodeIds) {
+ var nodeIdAsNumber = parseInt(nodeId, 10);
+ DOMAgent.getAttributes(nodeIdAsNumber, callback.bind(this, nodeIdAsNumber));
+ }
+ this._attributeLoadNodeIds = {};
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {string} newValue
+ */
+ _characterDataModified: function(nodeId, newValue)
+ {
+ var node = this._idToDOMNode[nodeId];
+ node._nodeValue = newValue;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.CharacterDataModified, {node: node});
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @return {WebInspector.DOMNode|undefined}
+ */
+ nodeForId: function(nodeId)
+ {
+ return this._idToDOMNode[nodeId];
+ },
+
+ _documentUpdated: function()
+ {
+ this._setDocument(null);
+ },
+
+ /**
+ * @param {DOMAgent.Node} payload
+ */
+ _setDocument: function(payload)
+ {
+ this._idToDOMNode = {};
+ if (payload && "nodeId" in payload)
+ this._document = new WebInspector.DOMNode(this, null, false, payload);
+ else
+ this._document = null;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._document);
+ },
+
+ /**
+ * @param {DOMAgent.Node} payload
+ */
+ _setDetachedRoot: function(payload)
+ {
+ new WebInspector.DOMNode(this, null, false, payload);
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} parentId
+ * @param {Array.<DOMAgent.Node>} payloads
+ */
+ _setChildNodes: function(parentId, payloads)
+ {
+ if (!parentId && payloads.length) {
+ this._setDetachedRoot(payloads[0]);
+ return;
+ }
+
+ var parent = this._idToDOMNode[parentId];
+ parent._setChildrenPayload(payloads);
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {number} newValue
+ */
+ _childNodeCountUpdated: function(nodeId, newValue)
+ {
+ var node = this._idToDOMNode[nodeId];
+ node.childNodeCount = newValue;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ChildNodeCountUpdated, node);
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} parentId
+ * @param {DOMAgent.NodeId} prevId
+ * @param {DOMAgent.Node} payload
+ */
+ _childNodeInserted: function(parentId, prevId, payload)
+ {
+ var parent = this._idToDOMNode[parentId];
+ var prev = this._idToDOMNode[prevId];
+ var node = parent._insertChild(prev, payload);
+ this._idToDOMNode[node.id] = node;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.NodeInserted, {node: node, parent: parent});
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} parentId
+ * @param {DOMAgent.NodeId} nodeId
+ */
+ _childNodeRemoved: function(parentId, nodeId)
+ {
+ var parent = this._idToDOMNode[parentId];
+ var node = this._idToDOMNode[nodeId];
+ parent._removeChild(node);
+ this._unbind(node);
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.NodeRemoved, {node:node, parent: parent});
+ },
+
+ /**
+ * @param {DOMAgent.Node} node
+ */
+ _unbind: function(node)
+ {
+ this._removeContentNodeFromFlowIfNeeded(node);
+
+ delete this._idToDOMNode[node.id];
+ for (var i = 0; node.children && i < node.children.length; ++i)
+ this._unbind(node.children[i]);
+ },
+
+ /**
+ * @param {number} nodeId
+ */
+ inspectElement: function(nodeId)
+ {
+ var node = this._idToDOMNode[nodeId];
+ if (node)
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, {node: node});
+
+ this._inspectModeEnabled = false;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.InspectModeStateChanged);
+ },
+
+ inspectNodeObject: function(remoteObject)
+ {
+ function nodeAvailable(nodeId)
+ {
+ remoteObject.release();
+
+ console.assert(nodeId);
+ if (!nodeId)
+ return;
+
+ this.inspectElement(nodeId);
+ }
+
+ remoteObject.pushNodeToFrontend(nodeAvailable.bind(this));
+ },
+
+ /**
+ * @param {string} query
+ * @param {function(number)} searchCallback
+ */
+ performSearch: function(query, searchCallback)
+ {
+ this.cancelSearch();
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {string} searchId
+ * @param {number} resultsCount
+ */
+ function callback(error, searchId, resultsCount)
+ {
+ this._searchId = searchId;
+ searchCallback(resultsCount);
+ }
+ DOMAgent.performSearch(query, callback.bind(this));
+ },
+
+ /**
+ * @param {number} index
+ * @param {?function(DOMAgent.Node)} callback
+ */
+ searchResult: function(index, callback)
+ {
+ if (this._searchId) {
+ /**
+ * @param {?Protocol.Error} error
+ * @param {Array.<number>} nodeIds
+ */
+ function mycallback(error, nodeIds)
+ {
+ if (error) {
+ console.error(error);
+ callback(null);
+ return;
+ }
+ if (nodeIds.length != 1)
+ return;
+
+ callback(this._idToDOMNode[nodeIds[0]]);
+ }
+ DOMAgent.getSearchResults(this._searchId, index, index + 1, mycallback.bind(this));
+ } else
+ callback(null);
+ },
+
+ cancelSearch: function()
+ {
+ if (this._searchId) {
+ DOMAgent.discardSearchResults(this._searchId);
+ delete this._searchId;
+ }
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {string} selectors
+ * @param {function(?DOMAgent.NodeId)=} callback
+ */
+ querySelector: function(nodeId, selectors, callback)
+ {
+ var callbackCast = /** @type {function(*)|undefined} */callback;
+ DOMAgent.querySelector(nodeId, selectors, this._wrapClientCallback(callbackCast));
+ },
+
+ /**
+ * @param {DOMAgent.NodeId} nodeId
+ * @param {string} selectors
+ * @param {function(?Array.<DOMAgent.NodeId>)=} callback
+ */
+ querySelectorAll: function(nodeId, selectors, callback)
+ {
+ var callbackCast = /** @type {function(*)|undefined} */callback;
+ DOMAgent.querySelectorAll(nodeId, selectors, this._wrapClientCallback(callbackCast));
+ },
+
+ /**
+ * @param {?number} nodeId
+ * @param {string=} mode
+ */
+ highlightDOMNode: function(nodeId, mode)
+ {
+ if (this._hideDOMNodeHighlightTimeout) {
+ clearTimeout(this._hideDOMNodeHighlightTimeout);
+ delete this._hideDOMNodeHighlightTimeout;
+ }
+
+ this._highlightedDOMNodeId = nodeId;
+ if (nodeId)
+ DOMAgent.highlightNode.invoke({nodeId: nodeId, highlightConfig: this._buildHighlightConfig(mode)});
+ else
+ DOMAgent.hideHighlight();
+ },
+
+ highlightRect: function(rect, usePageCoordinates)
+ {
+ DOMAgent.highlightRect.invoke({
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ color: {r: 111, g: 168, b: 220, a: 0.66},
+ outlineColor: {r: 255, g: 229, b: 153, a: 0.66},
+ usePageCoordinates: usePageCoordinates
+ });
+ },
+
+ hideDOMNodeHighlight: function()
+ {
+ this.highlightDOMNode(0);
+ },
+
+ /**
+ * @param {?DOMAgent.NodeId} nodeId
+ */
+ highlightDOMNodeForTwoSeconds: function(nodeId)
+ {
+ this.highlightDOMNode(nodeId);
+ this._hideDOMNodeHighlightTimeout = setTimeout(this.hideDOMNodeHighlight.bind(this), 2000);
+ },
+
+ get inspectModeEnabled()
+ {
+ return this._inspectModeEnabled;
+ },
+
+ set inspectModeEnabled(enabled)
+ {
+ function callback(error)
+ {
+ this._inspectModeEnabled = error ? false : enabled;
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.InspectModeStateChanged);
+ }
+
+ DOMAgent.setInspectModeEnabled(enabled, this._buildHighlightConfig(), callback.bind(this));
+ },
+
+ /**
+ * @param {string=} mode
+ */
+ _buildHighlightConfig: function(mode)
+ {
+ mode = mode || "all";
+ var highlightConfig = { showInfo: mode === "all" };
+ if (mode === "all" || mode === "content")
+ highlightConfig.contentColor = {r: 111, g: 168, b: 220, a: 0.66};
+
+ if (mode === "all" || mode === "padding")
+ highlightConfig.paddingColor = {r: 147, g: 196, b: 125, a: 0.66};
+
+ if (mode === "all" || mode === "border")
+ highlightConfig.borderColor = {r: 255, g: 229, b: 153, a: 0.66};
+
+ if (mode === "all" || mode === "margin")
+ highlightConfig.marginColor = {r: 246, g: 178, b: 107, a: 0.66};
+
+ return highlightConfig;
+ },
+
+ _createContentFlowFromPayload: function(flowPayload)
+ {
+ // FIXME: Collect the regions from the payload.
+ var flow = new WebInspector.ContentFlow(flowPayload.documentNodeId, flowPayload.name, flowPayload.overset, flowPayload.content.map(this.nodeForId.bind(this)));
+
+ for (var contentNode of flow.contentNodes) {
+ console.assert(!this._contentNodesToFlowsMap.has(contentNode.id));
+ this._contentNodesToFlowsMap.set(contentNode.id, flow);
+ }
+
+ return flow;
+ },
+
+ _updateContentFlowFromPayload: function(contentFlow, flowPayload)
+ {
+ console.assert(contentFlow.contentNodes.length === flowPayload.content.length);
+ for (var i = 0; i < contentFlow.contentNodes.length; ++i)
+ console.assert(contentFlow.contentNodes[i].id === flowPayload.content[i]);
+
+ // FIXME: Collect the regions from the payload.
+ contentFlow.overset = flowPayload.overset;
+ },
+
+ getNamedFlowCollection: function(documentNodeIdentifier)
+ {
+ function onNamedFlowCollectionAvailable(error, flows)
+ {
+ if (error) {
+ console.error("Error while getting the named flows for document " + documentNodeIdentifier + ": " + error);
+ return;
+ }
+ this._contentNodesToFlowsMap.clear();
+ var contentFlows = [];
+ for (var i = 0; i < flows.length; ++i) {
+ var flowPayload = flows[i];
+ var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
+ var contentFlow = this._flows.get(flowKey);
+ if (contentFlow)
+ this._updateContentFlowFromPayload(contentFlow, flowPayload);
+ else {
+ contentFlow = this._createContentFlowFromPayload(flowPayload);
+ this._flows.set(flowKey, contentFlow);
+ }
+ contentFlows.push(contentFlow);
+ }
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowListWasUpdated, {documentNodeIdentifier: documentNodeIdentifier, flows: contentFlows});
+ }
+ CSSAgent.getNamedFlowCollection(documentNodeIdentifier, onNamedFlowCollectionAvailable.bind(this));
+ },
+
+ namedFlowCreated: function(flowPayload)
+ {
+ var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
+ console.assert(!this._flows.has(flowKey));
+ var contentFlow = this._createContentFlowFromPayload(flowPayload);
+ this._flows.set(flowKey, contentFlow);
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowWasAdded, {flow: contentFlow});
+ },
+
+ namedFlowRemoved: function(documentNodeIdentifier, flowName)
+ {
+ var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName});
+ var contentFlow = this._flows.get(flowKey);
+ console.assert(contentFlow);
+ this._flows.delete(flowKey);
+
+ // Remove any back links to this flow from the content nodes.
+ for (var contentNode of contentFlow.contentNodes)
+ this._contentNodesToFlowsMap.delete(contentNode.id);
+
+ this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowWasRemoved, {flow: contentFlow});
+ },
+
+ _sendNamedFlowUpdateEvents: function(flowPayload)
+ {
+ var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
+ console.assert(this._flows.has(flowKey));
+ this._updateContentFlowFromPayload(this._flows.get(flowKey), flowPayload);
+ },
+
+ regionLayoutUpdated: function(flowPayload)
+ {
+ this._sendNamedFlowUpdateEvents(flowPayload);
+ },
+
+ regionOversetChanged: function(flowPayload)
+ {
+ this._sendNamedFlowUpdateEvents(flowPayload);
+ },
+
+ registeredNamedFlowContentElement: function(documentNodeIdentifier, flowName, contentNodeId, nextContentElementNodeId)
+ {
+ var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName});
+ console.assert(this._flows.has(flowKey));
+ console.assert(!this._contentNodesToFlowsMap.has(contentNodeId));
+
+ var flow = this._flows.get(flowKey);
+ var contentNode = this.nodeForId(contentNodeId);
+
+ this._contentNodesToFlowsMap.set(contentNode.id, flow);
+
+ if (nextContentElementNodeId)
+ flow.insertContentNodeBefore(contentNode, this.nodeForId(nextContentElementNodeId));
+ else
+ flow.appendContentNode(contentNode);
+ },
+
+ _removeContentNodeFromFlowIfNeeded: function(node)
+ {
+ if (!this._contentNodesToFlowsMap.has(node.id))
+ return;
+ var flow = this._contentNodesToFlowsMap.get(node.id);
+ this._contentNodesToFlowsMap.delete(node.id);
+ flow.removeContentNode(node);
+ },
+
+ unregisteredNamedFlowContentElement: function(documentNodeIdentifier, flowName, contentNodeId)
+ {
+ console.assert(this._contentNodesToFlowsMap.has(contentNodeId));
+
+ var flow = this._contentNodesToFlowsMap.get(contentNodeId);
+ console.assert(flow.id === WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName}));
+
+ this._contentNodesToFlowsMap.delete(contentNodeId);
+ flow.removeContentNode(this.nodeForId(contentNodeId));
+ },
+
+ _coerceRemoteArrayOfDOMNodes: function(objectId, callback)
+ {
+ var length, nodes, received = 0, lastError = null, domTreeManager = this;
+
+ function nodeRequested(index, error, nodeId)
+ {
+ if (error)
+ lastError = error;
+ else
+ nodes[index] = domTreeManager._idToDOMNode[nodeId];
+ if (++received === length)
+ callback(lastError, nodes);
+ }
+
+ WebInspector.runtimeManager.getPropertiesForRemoteObject(objectId, function(error, properties) {
+ if (error) {
+ callback(error);
+ return;
+ }
+
+ var lengthProperty = properties.get("length");
+ if (!lengthProperty || lengthProperty.value.type !== "number") {
+ callback(null);
+ return;
+ }
+
+ length = lengthProperty.value.value;
+ if (!length) {
+ callback(null, []);
+ return;
+ }
+
+ nodes = new Array(length);
+ for (var i = 0; i < length; ++i) {
+ var nodeProperty = properties.get(String(i));
+ console.assert(nodeProperty.value.type === "object");
+ DOMAgent.requestNode(nodeProperty.value.objectId, nodeRequested.bind(null, i));
+ }
+ });
+ },
+
+ getNodeContentFlowInfo: function(domNode, resultReadyCallback)
+ {
+ DOMAgent.resolveNode(domNode.id, domNodeResolved.bind(this));
+
+ function domNodeResolved(error, remoteObject)
+ {
+ if (error) {
+ resultReadyCallback(error);
+ return;
+ }
+ // Serialize "backendFunction" and execute it in the context of the page
+ // passing the DOMNode as the "this" reference.
+ var evalParameters = {
+ objectId: remoteObject.objectId,
+ functionDeclaration: backendFunction.toString(),
+ doNotPauseOnExceptionsAndMuteConsole: true,
+ returnByValue: false,
+ generatePreview: false
+ };
+ RuntimeAgent.callFunctionOn.invoke(evalParameters, regionNodesAvailable.bind(this));
+ }
+
+ function regionNodesAvailable(error, remoteObject, wasThrown)
+ {
+ if (error) {
+ resultReadyCallback(error);
+ return;
+ }
+
+ if (wasThrown) {
+ // We should never get here, but having the error is useful for debugging.
+ console.error("Error while executing backend function:", JSON.stringify(remoteObject));
+ resultReadyCallback(null);
+ return;
+ }
+
+ // The backend function can never return null.
+ console.assert(remoteObject.type === "object");
+ console.assert(remoteObject.objectId);
+ WebInspector.runtimeManager.getPropertiesForRemoteObject(remoteObject.objectId, remoteObjectPropertiesAvailable.bind(this));
+ }
+
+ function remoteObjectPropertiesAvailable(error, properties) {
+ if (error) {
+ resultReadyCallback(error);
+ return;
+ }
+
+ var result = {
+ regionFlow: null,
+ contentFlow: null,
+ regions: null
+ };
+
+ var regionFlowNameProperty = properties.get("regionFlowName");
+ if (regionFlowNameProperty && regionFlowNameProperty.value && regionFlowNameProperty.value.value) {
+ console.assert(regionFlowNameProperty.value.type === "string");
+ var regionFlowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: domNode.ownerDocument.id, name: regionFlowNameProperty.value.value});
+ result.regionFlow = this._flows.get(regionFlowKey);
+ }
+
+ var contentFlowNameProperty = properties.get("contentFlowName");
+ if (contentFlowNameProperty && contentFlowNameProperty.value && contentFlowNameProperty.value.value) {
+ console.assert(contentFlowNameProperty.value.type === "string");
+ var contentFlowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: domNode.ownerDocument.id, name: contentFlowNameProperty.value.value});
+ result.contentFlow = this._flows.get(contentFlowKey);
+ }
+
+ var regionsProperty = properties.get("regions");
+ if (!regionsProperty || !regionsProperty.value.objectId) {
+ // The list of regions is null.
+ resultReadyCallback(null, result);
+ return;
+ }
+
+ console.assert(regionsProperty.value.type === "object");
+ console.assert(regionsProperty.value.subtype === "array");
+ this._coerceRemoteArrayOfDOMNodes(regionsProperty.value.objectId, function(error, nodes) {
+ result.regions = nodes;
+ resultReadyCallback(error, result);
+ });
+ }
+
+ // Note that "backendFunction" is serialized and executed in the context of the page.
+ function backendFunction()
+ {
+ function getComputedProperty(node, propertyName)
+ {
+ if (!node.ownerDocument || !node.ownerDocument.defaultView)
+ return null;
+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
+ return computedStyle ? computedStyle[propertyName] : null;
+ }
+
+ function getContentFlowName(node)
+ {
+ for (; node; node = node.parentNode) {
+ var flowName = getComputedProperty(node, "webkitFlowInto");
+ if (flowName && flowName !== "none")
+ return flowName;
+ }
+ return null;
+ }
+
+ var node = this;
+
+ // Even detached nodes have an ownerDocument.
+ console.assert(node.ownerDocument);
+
+ var result = {
+ regionFlowName: getComputedProperty(node, "webkitFlowFrom"),
+ contentFlowName: getContentFlowName(node),
+ regions: null
+ };
+
+ if (result.contentFlowName) {
+ var flowThread = node.ownerDocument.webkitGetNamedFlows().namedItem(result.contentFlowName);
+ if (flowThread)
+ result.regions = flowThread.getRegionsByContent(node);
+ }
+
+ return result;
+ }
+ }
+}
+
+WebInspector.DOMTreeManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDashboardManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DashboardManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,187 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DashboardManager = function() {
+ WebInspector.Object.call(this);
+
+ this.toolbarItem = new WebInspector.NavigationItem("dashboard", "group", WebInspector.UIString("Activity Viewer"));
+ this._view = new WebInspector.DashboardView(this.toolbarItem.element);
+
+ this._waitingForFirstMainResourceToStartTrackingSize = true;
+
+ // Necessary event required to track page load time and resource sizes.
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
+
+ // Necessary events required to track load of resources.
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
+ WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
+
+ // Necessary events required to track console messages.
+ var logManager = WebInspector.logManager;
+ logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._consoleWasCleared, this);
+ logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._consoleWasCleared, this);
+ logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, this._consoleMessageAdded, this);
+ logManager.addEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, this._consoleMessageWasRepeated, this);
+};
+
+WebInspector.DashboardManager.prototype = {
+ constructor: WebInspector.DashboardManager,
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ this._view.resourcesCount = 1;
+ this._view.resourcesSize = WebInspector.frameResourceManager.mainFrame.mainResource.size || 0;
+
+ // Only update the time if we are recording the timeline.
+ if (!WebInspector.timelineManager.recordingEnabled) {
+ this._view.time = 0;
+ return;
+ }
+
+ // We should only track resource sizes on fresh loads.
+ if (this._waitingForFirstMainResourceToStartTrackingSize) {
+ delete this._waitingForFirstMainResourceToStartTrackingSize;
+ WebInspector.Resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._resourceSizeDidChange, this);
+ }
+
+ this._startUpdatingTime();
+ },
+
+ _recordingStopped: function(event)
+ {
+ // If recording stops, we should stop the timer if it hasn't stopped already.
+ this._stopUpdatingTime();
+ },
+
+ _resourceWasAdded: function(event)
+ {
+ ++this._view.resourcesCount;
+ },
+
+ _frameWasAdded: function(event)
+ {
+ ++this._view.resourcesCount;
+ },
+
+ _resourceSizeDidChange: function(event)
+ {
+ this._view.resourcesSize += event.target.size - event.data.previousSize;
+ },
+
+ _startUpdatingTime: function()
+ {
+ this._stopUpdatingTime();
+
+ this._view.time = 0;
+
+ this._timelineBaseTime = Date.now();
+ this._timeIntervalDelay = 50;
+ this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
+ },
+
+ _stopUpdatingTime: function()
+ {
+ if (!this._timeIntervalIdentifier)
+ return;
+
+ clearInterval(this._timeIntervalIdentifier);
+ delete this._timeIntervalIdentifier;
+ },
+
+ _updateTime: function()
+ {
+ var duration = Date.now() - this._timelineBaseTime;
+
+ var timeIntervalDelay = this._timeIntervalDelay;
+ if (duration >= 1000) // 1 second
+ timeIntervalDelay = 100;
+ else if (duration >= 60000) // 60 seconds
+ timeIntervalDelay = 1000;
+ else if (duration >= 3600000) // 1 minute
+ timeIntervalDelay = 10000;
+
+ if (timeIntervalDelay !== this._timeIntervalDelay) {
+ this._timeIntervalDelay = timeIntervalDelay;
+
+ clearInterval(this._timeIntervalIdentifier);
+ this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
+ }
+
+ var mainFrame = WebInspector.frameResourceManager.mainFrame;
+ var mainFrameStartTime = mainFrame.mainResource.firstTimestamp;
+ var mainFrameLoadEventTime = mainFrame.loadEventTimestamp;
+
+ if (isNaN(mainFrameStartTime) || isNaN(mainFrameLoadEventTime)) {
+ this._view.time = duration / 1000;
+ return;
+ }
+
+ this._view.time = mainFrameLoadEventTime - mainFrameStartTime;
+
+ this._stopUpdatingTime();
+ },
+
+ _consoleMessageAdded: function(event)
+ {
+ var message = event.data.message;
+ this._lastConsoleMessageType = message.level;
+ this._incrementConsoleMessageType(message.level, message.totalRepeatCount);
+ },
+
+ _consoleMessageWasRepeated: function(event)
+ {
+ this._incrementConsoleMessageType(this._lastConsoleMessageType, 1);
+ },
+
+ _incrementConsoleMessageType: function(type, increment)
+ {
+ switch (type) {
+ case "log":
+ this._view.logs += increment;
+ break;
+ case "warning":
+ this._view.issues += increment;
+ break;
+ case "error":
+ this._view.errors += increment;
+ break;
+ }
+ },
+
+ _consoleWasCleared: function(event)
+ {
+ this._view.logs = 0;
+ this._view.issues = 0;
+ this._view.errors = 0;
+ }
+};
+
+WebInspector.DashboardManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDebuggerManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DebuggerManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,721 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerManager = function()
+{
+ WebInspector.Object.call(this);
+
+ if (window.DebuggerAgent)
+ DebuggerAgent.enable();
+
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointDisabledStateDidChange, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, this._breakpointEditablePropertyDidChange, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointEditablePropertyDidChange, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointEditablePropertyDidChange, this);
+
+ window.addEventListener("pagehide", this._inspectorClosing.bind(this));
+
+ this._allExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-exceptions", false);
+ this._allUncaughtExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-uncaught-exceptions", false);
+
+ var specialBreakpointLocation = new WebInspector.SourceCodeLocation(null, Infinity, Infinity);
+
+ this._allExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allExceptionsBreakpointEnabledSetting.value);
+ this._allExceptionsBreakpoint.resolved = true;
+
+ this._allUncaughtExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allUncaughtExceptionsBreakpointEnabledSetting.value);
+
+ this._breakpoints = [];
+ this._breakpointURLMap = {};
+ this._breakpointScriptIdentifierMap = {};
+ this._breakpointIdMap = {};
+
+ this._nextBreakpointActionIdentifier = 1;
+
+ this._scriptIdMap = {};
+ this._scriptURLMap = {};
+
+ this._breakpointsSetting = new WebInspector.Setting("breakpoints", []);
+ this._breakpointsEnabledSetting = new WebInspector.Setting("breakpoints-enabled", true);
+
+ if (window.DebuggerAgent)
+ DebuggerAgent.setBreakpointsActive(this._breakpointsEnabledSetting.value);
+
+ this._updateBreakOnExceptionsState();
+
+ function restoreBreakpointsSoon() {
+ for (cookie of this._breakpointsSetting.value)
+ this.addBreakpoint(new WebInspector.Breakpoint(cookie));
+ }
+
+ // Ensure that all managers learn about restored breakpoints,
+ // regardless of their initialization order.
+ setTimeout(restoreBreakpointsSoon.bind(this), 0);
+};
+
+WebInspector.DebuggerManager.Event = {
+ BreakpointAdded: "debugger-manager-breakpoint-added",
+ BreakpointRemoved: "debugger-manager-breakpoint-removed",
+ BreakpointMoved: "debugger-manager-breakpoint-moved",
+ Paused: "debugger-manager-paused",
+ Resumed: "debugger-manager-resumed",
+ CallFramesDidChange: "debugger-manager-call-frames-did-change",
+ ActiveCallFrameDidChange: "debugger-manager-active-call-frame-did-change",
+ ScriptAdded: "debugger-manager-script-added",
+ ScriptsCleared: "debugger-manager-scripts-cleared"
+};
+
+WebInspector.DebuggerManager.prototype = {
+ constructor: WebInspector.DebuggerManager,
+
+ // Public
+
+ get breakpointsEnabled()
+ {
+ return this._breakpointsEnabledSetting.value;
+ },
+
+ set breakpointsEnabled(enabled)
+ {
+ if (this._breakpointsEnabled === enabled)
+ return;
+
+ this._breakpointsEnabledSetting.value = enabled;
+
+ this._allExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
+ this._allUncaughtExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
+
+ for (var i = 0; i < this._breakpoints.length; ++i)
+ this._breakpoints[i].dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
+
+ DebuggerAgent.setBreakpointsActive(enabled);
+
+ this._updateBreakOnExceptionsState();
+ },
+
+ get paused()
+ {
+ return this._paused;
+ },
+
+ get callFrames()
+ {
+ return this._callFrames;
+ },
+
+ get activeCallFrame()
+ {
+ return this._activeCallFrame;
+ },
+
+ set activeCallFrame(callFrame)
+ {
+ if (callFrame === this._activeCallFrame)
+ return;
+
+ this._activeCallFrame = callFrame || null;
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
+ },
+
+ pause: function()
+ {
+ DebuggerAgent.pause();
+ },
+
+ resume: function()
+ {
+ DebuggerAgent.resume();
+ },
+
+ stepOver: function()
+ {
+ DebuggerAgent.stepOver();
+ },
+
+ stepInto: function()
+ {
+ DebuggerAgent.stepInto();
+ },
+
+ stepOut: function()
+ {
+ DebuggerAgent.stepOut();
+ },
+
+ get allExceptionsBreakpoint()
+ {
+ return this._allExceptionsBreakpoint;
+ },
+
+ get allUncaughtExceptionsBreakpoint()
+ {
+ return this._allUncaughtExceptionsBreakpoint;
+ },
+
+ get breakpoints()
+ {
+ return this._breakpoints;
+ },
+
+ breakpointsForSourceCode: function(sourceCode)
+ {
+ console.assert(sourceCode instanceof WebInspector.Resource || sourceCode instanceof WebInspector.Script);
+
+ if (sourceCode instanceof WebInspector.SourceMapResource) {
+ var mappedResourceBreakpoints = [];
+ var originalSourceCodeBreakpoints = this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode);
+ return originalSourceCodeBreakpoints.filter(function(breakpoint) {
+ return breakpoint.sourceCodeLocation.displaySourceCode === sourceCode;
+ });
+ }
+
+ if (sourceCode.url in this._breakpointURLMap) {
+ var urlBreakpoint = this._breakpointURLMap[sourceCode.url] || [];
+ this._associateBreakpointsWithSourceCode(urlBreakpoint, sourceCode);
+ return urlBreakpoint;
+ }
+
+ if (sourceCode instanceof WebInspector.Script && sourceCode.id in this._breakpointScriptIdentifierMap) {
+ var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[sourceCode.id] || [];
+ this._associateBreakpointsWithSourceCode(scriptIdentifierBreakpoints, sourceCode);
+ return scriptIdentifierBreakpoints;
+ }
+
+ return [];
+ },
+
+ scriptForIdentifier: function(id)
+ {
+ return this._scriptIdMap[id] || null;
+ },
+
+ scriptsForURL: function(url)
+ {
+ // FIXME: This may not be safe. A Resource's URL may differ from a Script's URL.
+ return this._scriptURLMap[url] || [];
+ },
+
+ continueToLocation: function(scriptIdentifier, lineNumber, columnNumber)
+ {
+ DebuggerAgent.continueToLocation({scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber});
+ },
+
+ addBreakpoint: function(breakpoint, skipEventDispatch)
+ {
+ console.assert(breakpoint instanceof WebInspector.Breakpoint, "Bad argument to DebuggerManger.addBreakpoint: ", breakpoint);
+ if (!breakpoint)
+ return;
+
+ if (breakpoint.url) {
+ var urlBreakpoints = this._breakpointURLMap[breakpoint.url];
+ if (!urlBreakpoints)
+ urlBreakpoints = this._breakpointURLMap[breakpoint.url] = [];
+ urlBreakpoints.push(breakpoint);
+ }
+
+ if (breakpoint.scriptIdentifier) {
+ var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
+ if (!scriptIdentifierBreakpoints)
+ scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier] = [];
+ scriptIdentifierBreakpoints.push(breakpoint);
+ }
+
+ this._breakpoints.push(breakpoint);
+
+ if (!breakpoint.disabled)
+ this._setBreakpoint(breakpoint);
+
+ if (!skipEventDispatch)
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointAdded, {breakpoint: breakpoint});
+ },
+
+ removeBreakpoint: function(breakpoint)
+ {
+ console.assert(breakpoint);
+ if (!breakpoint)
+ return;
+
+ console.assert(this.isBreakpointRemovable(breakpoint));
+ if (!this.isBreakpointRemovable(breakpoint))
+ return;
+
+ this._breakpoints.remove(breakpoint);
+
+ if (breakpoint.identifier)
+ this._removeBreakpoint(breakpoint);
+
+ if (breakpoint.url) {
+ var urlBreakpoints = this._breakpointURLMap[breakpoint.url];
+ if (urlBreakpoints) {
+ urlBreakpoints.remove(breakpoint);
+ if (!urlBreakpoints.length)
+ delete this._breakpointURLMap[breakpoint.url];
+ }
+ }
+
+ if (breakpoint.scriptIdentifier) {
+ var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
+ if (scriptIdentifierBreakpoints) {
+ scriptIdentifierBreakpoints.remove(breakpoint);
+ if (!scriptIdentifierBreakpoints.length)
+ delete this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
+ }
+ }
+
+ // Disable the breakpoint first, so removing actions doesn't re-add the breakpoint.
+ breakpoint.disabled = true;
+ breakpoint.clearActions();
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointRemoved, {breakpoint: breakpoint});
+ },
+
+ breakpointResolved: function(breakpointIdentifier, location)
+ {
+ // Called from WebInspector.DebuggerObserver.
+
+ var breakpoint = this._breakpointIdMap[breakpointIdentifier];
+ console.assert(breakpoint);
+ if (!breakpoint)
+ return;
+
+ console.assert(breakpoint.id === breakpointIdentifier);
+
+ breakpoint.resolved = true;
+ },
+
+ reset: function()
+ {
+ // Called from WebInspector.DebuggerObserver.
+
+ var wasPaused = this._paused;
+
+ WebInspector.Script.resetUniqueDisplayNameNumbers();
+
+ this._paused = false;
+ this._scriptIdMap = {};
+ this._scriptURLMap = {};
+
+ this._ignoreBreakpointDisplayLocationDidChangeEvent = true;
+
+ // Mark all the breakpoints as unresolved. They will be reported as resolved when
+ // breakpointResolved is called as the page loads.
+ for (var i = 0; i < this._breakpoints.length; ++i) {
+ var breakpoint = this._breakpoints[i];
+ breakpoint.resolved = false;
+ if (breakpoint.sourceCodeLocation.sourceCode)
+ breakpoint.sourceCodeLocation.sourceCode = null;
+ }
+
+ delete this._ignoreBreakpointDisplayLocationDidChangeEvent;
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ScriptsCleared);
+
+ if (wasPaused)
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Resumed);
+ },
+
+ debuggerDidPause: function(callFramesPayload)
+ {
+ // Called from WebInspector.DebuggerObserver.
+
+ if (this._delayedResumeTimeout) {
+ clearTimeout(this._delayedResumeTimeout);
+ delete this._delayedResumeTimeout;
+ }
+
+ var wasStillPaused = this._paused;
+
+ this._paused = true;
+ this._callFrames = [];
+
+ for (var i = 0; i < callFramesPayload.length; ++i) {
+ var callFramePayload = callFramesPayload[i];
+ var sourceCodeLocation = this._sourceCodeLocationFromPayload(callFramePayload.location);
+ // Exclude the case where the call frame is in the inspector code.
+ if (!sourceCodeLocation || !sourceCodeLocation._sourceCode || !sourceCodeLocation._sourceCode._url || sourceCodeLocation._sourceCode._url.indexOf("__WebInspector") === 0)
+ continue;
+ var thisObject = WebInspector.RemoteObject.fromPayload(callFramePayload.this);
+ var scopeChain = this._scopeChainFromPayload(callFramePayload.scopeChain);
+ var callFrame = new WebInspector.CallFrame(callFramePayload.callFrameId, sourceCodeLocation, callFramePayload.functionName, thisObject, scopeChain);
+ this._callFrames.push(callFrame);
+ }
+
+ if (!this._callFrames.length) {
+ this.resume();
+ return;
+ }
+
+ this._activeCallFrame = this._callFrames[0];
+
+ if (!wasStillPaused)
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Paused);
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.CallFramesDidChange);
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
+ },
+
+ debuggerDidResume: function()
+ {
+ // Called from WebInspector.DebuggerObserver.
+
+ function delayedWork()
+ {
+ delete this._delayedResumeTimeout;
+
+ this._paused = false;
+ this._callFrames = null;
+ this._activeCallFrame = null;
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Resumed);
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.CallFramesDidChange);
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
+ }
+
+ // We delay clearing the state and firing events so the user interface does not flash
+ // between brief steps or successive breakpoints.
+ this._delayedResumeTimeout = setTimeout(delayedWork.bind(this), 50);
+ },
+
+ playBreakpointActionSound: function(breakpointActionIdentifier)
+ {
+ InspectorFrontendHost.beep();
+ },
+
+ scriptDidParse: function(scriptIdentifier, url, isContentScript, startLine, startColumn, endLine, endColumn, sourceMapURL)
+ {
+ // Don't add the script again if it is already known.
+ if (this._scriptIdMap[scriptIdentifier]) {
+ console.assert(this._scriptIdMap[scriptIdentifier].url === url);
+ console.assert(this._scriptIdMap[scriptIdentifier].range.startLine === startLine);
+ console.assert(this._scriptIdMap[scriptIdentifier].range.startColumn === startColumn);
+ console.assert(this._scriptIdMap[scriptIdentifier].range.endLine === endLine);
+ console.assert(this._scriptIdMap[scriptIdentifier].range.endColumn === endColumn);
+ return;
+ }
+
+ var script = new WebInspector.Script(scriptIdentifier, new WebInspector.TextRange(startLine, startColumn, endLine, endColumn), url, isContentScript, sourceMapURL);
+
+ this._scriptIdMap[scriptIdentifier] = script;
+
+ if (script.url) {
+ var scripts = this._scriptURLMap[script.url];
+ if (!scripts)
+ scripts = this._scriptURLMap[script.url] = [];
+ scripts.push(script);
+ }
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ScriptAdded, {script: script});
+ },
+
+ isBreakpointRemovable: function(breakpoint)
+ {
+ return breakpoint !== this._allExceptionsBreakpoint && breakpoint !== this._allUncaughtExceptionsBreakpoint;
+ },
+
+ isBreakpointEditable: function(breakpoint)
+ {
+ return this.isBreakpointRemovable(breakpoint);
+ },
+
+ get nextBreakpointActionIdentifier()
+ {
+ return this._nextBreakpointActionIdentifier++;
+ },
+
+ // Private
+
+ _sourceCodeLocationFromPayload: function(payload)
+ {
+ var script = this._scriptIdMap[payload.scriptId];
+ console.assert(script);
+ if (!script)
+ return null;
+
+ return script.createSourceCodeLocation(payload.lineNumber, payload.columnNumber);
+ },
+
+ _scopeChainFromPayload: function(payload)
+ {
+ var scopeChain = [];
+ for (var i = 0; i < payload.length; ++i)
+ scopeChain.push(this._scopeChainNodeFromPayload(payload[i]));
+ return scopeChain;
+ },
+
+ _scopeChainNodeFromPayload: function(payload)
+ {
+ var type = null;
+ switch (payload.type) {
+ case "local":
+ type = WebInspector.ScopeChainNode.Type.Local;
+ break;
+ case "global":
+ type = WebInspector.ScopeChainNode.Type.Global;
+ break;
+ case "with":
+ type = WebInspector.ScopeChainNode.Type.With;
+ break;
+ case "closure":
+ type = WebInspector.ScopeChainNode.Type.Closure;
+ break;
+ case "catch":
+ type = WebInspector.ScopeChainNode.Type.Catch;
+ break;
+ default:
+ console.error("Unknown type: " + payload.type);
+ }
+
+ var object = WebInspector.RemoteObject.fromPayload(payload.object);
+ return new WebInspector.ScopeChainNode(type, object);
+ },
+
+ _debuggerBreakpointActionType: function(type)
+ {
+ switch (type) {
+ case WebInspector.BreakpointAction.Type.Log:
+ return DebuggerAgent.BreakpointActionType.Log;
+ case WebInspector.BreakpointAction.Type.Evaluate:
+ return DebuggerAgent.BreakpointActionType.Evaluate;
+ case WebInspector.BreakpointAction.Type.Sound:
+ return DebuggerAgent.BreakpointActionType.Sound;
+ case WebInspector.BreakpointAction.Type.Probe:
+ return DebuggerAgent.BreakpointActionType.Probe;
+ default:
+ console.assert(false);
+ return DebuggerAgent.BreakpointActionType.Log;
+ }
+ },
+
+ _setBreakpoint: function(breakpoint, callback)
+ {
+ console.assert(!breakpoint.identifier);
+ console.assert(!breakpoint.disabled);
+
+ if (breakpoint.identifier || breakpoint.disabled)
+ return;
+
+ function didSetBreakpoint(error, breakpointIdentifier)
+ {
+ if (error)
+ return;
+
+ this._breakpointIdMap[breakpointIdentifier] = breakpoint;
+
+ breakpoint.identifier = breakpointIdentifier;
+ breakpoint.resolved = true;
+
+ if (typeof callback === "function")
+ callback();
+ }
+
+ // The breakpoint will be resolved again by calling DebuggerAgent, so mark it as unresolved.
+ // If something goes wrong it will stay unresolved and show up as such in the user interface.
+ breakpoint.resolved = false;
+
+ // Convert BreakpointAction types to DebuggerAgent protocol types.
+ // NOTE: Breakpoint.options returns new objects each time, so it is safe to modify.
+ var options;
+ if (DebuggerAgent.BreakpointActionType) {
+ options = breakpoint.options;
+ if (options.actions.length) {
+ for (var i = 0; i < options.actions.length; ++i)
+ options.actions[i].type = this._debuggerBreakpointActionType(options.actions[i].type);
+ }
+ }
+
+ // COMPATIBILITY (iOS 7): iOS 7 and earlier, DebuggerAgent.setBreakpoint* took a "condition" string argument.
+ // This has been replaced with an "options" BreakpointOptions object.
+ if (breakpoint.url) {
+ DebuggerAgent.setBreakpointByUrl.invoke({
+ lineNumber: breakpoint.sourceCodeLocation.lineNumber,
+ url: breakpoint.url,
+ urlRegex: undefined,
+ columnNumber: breakpoint.sourceCodeLocation.columnNumber,
+ condition: breakpoint.condition,
+ options: options
+ }, didSetBreakpoint.bind(this));
+ } else if (breakpoint.scriptIdentifier) {
+ DebuggerAgent.setBreakpoint.invoke({
+ location: {scriptId: breakpoint.scriptIdentifier, lineNumber: breakpoint.sourceCodeLocation.lineNumber, columnNumber: breakpoint.sourceCodeLocation.columnNumber},
+ condition: breakpoint.condition,
+ options: options
+ }, didSetBreakpoint.bind(this));
+ }
+ },
+
+ _removeBreakpoint: function(breakpoint, callback)
+ {
+ if (!breakpoint.identifier)
+ return;
+
+ function didRemoveBreakpoint(error)
+ {
+ if (error)
+ console.error(error);
+
+ delete this._breakpointIdMap[breakpoint.identifier];
+
+ breakpoint.identifier = null;
+
+ // Don't reset resolved here since we want to keep disabled breakpoints looking like they
+ // are resolved in the user interface. They will get marked as unresolved in reset.
+
+ if (typeof callback === "function")
+ callback();
+ }
+
+ DebuggerAgent.removeBreakpoint(breakpoint.identifier, didRemoveBreakpoint.bind(this));
+ },
+
+ _breakpointDisplayLocationDidChange: function(event)
+ {
+ if (this._ignoreBreakpointDisplayLocationDidChangeEvent)
+ return;
+
+ var breakpoint = event.target;
+ if (!breakpoint.identifier || breakpoint.disabled)
+ return;
+
+ // Remove the breakpoint with its old id.
+ this._removeBreakpoint(breakpoint, breakpointRemoved.bind(this));
+
+ function breakpointRemoved()
+ {
+ // Add the breakpoint at its new lineNumber and get a new id.
+ this._setBreakpoint(breakpoint);
+
+ this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointMoved, {breakpoint: breakpoint});
+ }
+ },
+
+ _breakpointDisabledStateDidChange: function(event)
+ {
+ var breakpoint = event.target;
+
+ if (breakpoint === this._allExceptionsBreakpoint) {
+ this._allExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled;
+ this._updateBreakOnExceptionsState();
+ return;
+ }
+
+ if (breakpoint === this._allUncaughtExceptionsBreakpoint) {
+ this._allUncaughtExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled;
+ this._updateBreakOnExceptionsState();
+ return;
+ }
+
+ if (breakpoint.disabled)
+ this._removeBreakpoint(breakpoint);
+ else
+ this._setBreakpoint(breakpoint);
+ },
+
+ _breakpointEditablePropertyDidChange: function(event)
+ {
+ var breakpoint = event.target;
+ if (breakpoint.disabled)
+ return;
+
+ console.assert(this.isBreakpointEditable(breakpoint));
+ if (!this.isBreakpointEditable(breakpoint))
+ return;
+
+ // Remove the breakpoint with its old id.
+ this._removeBreakpoint(breakpoint, breakpointRemoved.bind(this));
+
+ function breakpointRemoved()
+ {
+ // Add the breakpoint with its new condition and get a new id.
+ this._setBreakpoint(breakpoint);
+ }
+ },
+
+ _updateBreakOnExceptionsState: function()
+ {
+ var state = "none";
+
+ if (this._breakpointsEnabledSetting.value) {
+ if (!this._allExceptionsBreakpoint.disabled)
+ state = "all";
+ else if (!this._allUncaughtExceptionsBreakpoint.disabled)
+ state = "uncaught";
+ }
+
+ switch (state) {
+ case "all":
+ // Mark the uncaught breakpoint as unresolved since "all" includes "uncaught".
+ // That way it is clear in the user interface that the breakpoint is ignored.
+ this._allUncaughtExceptionsBreakpoint.resolved = false;
+ break;
+ case "uncaught":
+ case "none":
+ // Mark the uncaught breakpoint as resolved again.
+ this._allUncaughtExceptionsBreakpoint.resolved = true;
+ break;
+ }
+
+ DebuggerAgent.setPauseOnExceptions(state);
+ },
+
+ _inspectorClosing: function(event)
+ {
+ this._saveBreakpoints();
+ },
+
+ _saveBreakpoints: function()
+ {
+ var savedBreakpoints = [];
+
+ for (var i = 0; i < this._breakpoints.length; ++i) {
+ var breakpoint = this._breakpoints[i];
+
+ // Only breakpoints with URLs can be saved. Breakpoints for transient scripts can't.
+ if (!breakpoint.url)
+ continue;
+
+ savedBreakpoints.push(breakpoint.info);
+ }
+
+ this._breakpointsSetting.value = savedBreakpoints;
+ },
+
+ _associateBreakpointsWithSourceCode: function(breakpoints, sourceCode)
+ {
+ this._ignoreBreakpointDisplayLocationDidChangeEvent = true;
+
+ for (var i = 0; i < breakpoints.length; ++i) {
+ var breakpoint = breakpoints[i];
+ if (breakpoint.sourceCodeLocation.sourceCode === null)
+ breakpoint.sourceCodeLocation.sourceCode = sourceCode;
+ // SourceCodes can be unequal if the SourceCodeLocation is associated with a Script and we are looking at the Resource.
+ console.assert(breakpoint.sourceCodeLocation.sourceCode === sourceCode || breakpoint.sourceCodeLocation.sourceCode.url === sourceCode.url);
+ }
+
+ delete this._ignoreBreakpointDisplayLocationDidChangeEvent;
+ }
+};
+
+WebInspector.DebuggerManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDragToAdjustControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDragToAdjustControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/DragToAdjustController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DragToAdjustController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DragToAdjustController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,234 @@
</span><ins>+/*
+ * Copyright (C) 2014 Antoine Quint
+ *
+ * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DragToAdjustController = function(delegate)
+{
+ this._delegate = delegate;
+
+ this._element = null;
+ this._active = false;
+ this._enabled = false;
+ this._dragging = false;
+ this._tracksMouseClickAndDrag = false;
+};
+
+WebInspector.DragToAdjustController.StyleClassName = "drag-to-adjust";
+
+WebInspector.DragToAdjustController.prototype = {
+ constructor: WebInspector.DragToAdjustController,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ set element(element)
+ {
+ this._element = element;
+ },
+
+ set enabled(enabled)
+ {
+ if (this._enabled === enabled)
+ return;
+
+ if (enabled) {
+ this._element.addEventListener("mouseenter", this);
+ this._element.addEventListener("mouseleave", this);
+ } else {
+ this._element.removeEventListener("mouseenter", this);
+ this._element.removeEventListener("mouseleave", this);
+ }
+ },
+
+ get active()
+ {
+ return this._active;
+ },
+
+ set active(active)
+ {
+ if (!this._element)
+ return;
+
+ if (this._active === active)
+ return;
+
+ if (active) {
+ WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
+ this._element.addEventListener("mousemove", this);
+ } else {
+ WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
+ this._element.removeEventListener("mousemove", this);
+ this._setTracksMouseClickAndDrag(false);
+ }
+
+ this._active = active;
+
+ if (this._delegate && typeof this._delegate.dragToAdjustControllerActiveStateChanged === "function")
+ this._delegate.dragToAdjustControllerActiveStateChanged(this);
+ },
+
+ reset: function()
+ {
+ this._setTracksMouseClickAndDrag(false);
+ this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
+
+ if (this._delegate && typeof this._delegate.dragToAdjustControllerDidReset === "function")
+ this._delegate.dragToAdjustControllerDidReset(this);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch(event.type) {
+ case "mouseenter":
+ if (!this._dragging) {
+ if (this._delegate && typeof this._delegate.dragToAdjustControllerCanBeActivated === "function")
+ this.active = this._delegate.dragToAdjustControllerCanBeActivated(this);
+ else
+ this.active = true;
+ }
+ break;
+ case "mouseleave":
+ if (!this._dragging)
+ this.active = false;
+ break;
+ case "mousemove":
+ if (this._dragging)
+ this._mouseWasDragged(event);
+ else
+ this._mouseMoved(event);
+ break;
+ case "mousedown":
+ this._mouseWasPressed(event);
+ break;
+ case "mouseup":
+ this._mouseWasReleased(event);
+ break;
+ case "contextmenu":
+ event.preventDefault();
+ break;
+ }
+ },
+
+ // Private
+
+ _setDragging: function(dragging)
+ {
+ if (this._dragging === dragging)
+ return;
+
+ console.assert(window.event);
+ if (dragging)
+ WebInspector.elementDragStart(this._element, this, this, window.event, "col-resize", window);
+ else
+ WebInspector.elementDragEnd(window.event);
+
+ this._dragging = dragging;
+ },
+
+ _setTracksMouseClickAndDrag: function(tracksMouseClickAndDrag)
+ {
+ if (this._tracksMouseClickAndDrag === tracksMouseClickAndDrag)
+ return;
+
+ if (tracksMouseClickAndDrag) {
+ this._element.classList.add(WebInspector.DragToAdjustController.StyleClassName);
+ window.addEventListener("mousedown", this, true);
+ window.addEventListener("contextmenu", this, true);
+ } else {
+ this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
+ window.removeEventListener("mousedown", this, true);
+ window.removeEventListener("contextmenu", this, true);
+ this._setDragging(false);
+ }
+
+ this._tracksMouseClickAndDrag = tracksMouseClickAndDrag;
+ },
+
+ _modifiersDidChange: function(event)
+ {
+ var canBeAdjusted = WebInspector.modifierKeys.altKey;
+ if (canBeAdjusted && this._delegate && typeof this._delegate.dragToAdjustControllerCanBeAdjusted === "function")
+ canBeAdjusted = this._delegate.dragToAdjustControllerCanBeAdjusted(this);
+
+ this._setTracksMouseClickAndDrag(canBeAdjusted);
+ },
+
+ _mouseMoved: function(event)
+ {
+ var canBeAdjusted = event.altKey;
+ if (canBeAdjusted && this._delegate && typeof this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint === "function")
+ canBeAdjusted = this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint(this, WebInspector.Point.fromEvent(event));
+
+ this._setTracksMouseClickAndDrag(canBeAdjusted);
+ },
+
+ _mouseWasPressed: function(event)
+ {
+ this._lastX = event.screenX;
+
+ this._setDragging(true);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _mouseWasDragged: function(event)
+ {
+ var x = event.screenX;
+ var amount = x - this._lastX;
+
+ if (Math.abs(amount) < 1)
+ return;
+
+ this._lastX = x;
+
+ if (event.ctrlKey)
+ amount /= 10;
+ else if (event.shiftKey)
+ amount *= 10;
+
+ if (this._delegate && typeof this._delegate.dragToAdjustControllerWasAdjustedByAmount === "function")
+ this._delegate.dragToAdjustControllerWasAdjustedByAmount(this, amount);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _mouseWasReleased: function(event)
+ {
+ this._setDragging(false);
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ this.reset();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersFormatterjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFormatterjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/Formatter.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Formatter.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/Formatter.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/Formatter.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,164 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+function Formatter(codeMirror, builder)
+{
+ console.assert(codeMirror);
+ console.assert(builder);
+
+ this._codeMirror = codeMirror;
+ this._builder = builder;
+
+ this._lastToken = null;
+ this._lastContent = "";
+};
+
+Formatter.prototype = {
+ constructor: Formatter,
+
+ // Public
+
+ format: function(from, to)
+ {
+ console.assert(this._builder.originalContent === null);
+ if (this._builder.originalContent !== null)
+ return;
+
+ var outerMode = this._codeMirror.getMode();
+ var content = this._codeMirror.getRange(from, to);
+ var state = CodeMirror.copyState(outerMode, this._codeMirror.getTokenAt(from).state);
+ this._builder.setOriginalContent(content);
+
+ var lineOffset = 0;
+ var lines = content.split("\n");
+ for (var i = 0; i < lines.length; ++i) {
+ var line = lines[i];
+ var startOfNewLine = true;
+ var firstTokenOnLine = true;
+ var stream = new CodeMirror.StringStream(line);
+ while (!stream.eol()) {
+ var innerMode = CodeMirror.innerMode(outerMode, state);
+ var token = outerMode.token(stream, state);
+ var isWhiteSpace = token === null && /^\s*$/.test(stream.current());
+ this._handleToken(innerMode.mode, token, state, stream, lineOffset + stream.start, isWhiteSpace, startOfNewLine, firstTokenOnLine);
+ stream.start = stream.pos;
+ startOfNewLine = false;
+ if (firstTokenOnLine && !isWhiteSpace)
+ firstTokenOnLine = false;
+ }
+
+ if (firstTokenOnLine)
+ this._handleEmptyLine();
+
+ lineOffset += line.length + 1; // +1 for the "\n" removed in split.
+ this._handleLineEnding(lineOffset - 1); // -1 for the index of the "\n".
+ }
+
+ this._builder.finish();
+ },
+
+ // Private
+
+ _handleToken: function(mode, token, state, stream, originalPosition, isWhiteSpace, startOfNewLine, firstTokenOnLine)
+ {
+ // String content of the token.
+ var content = stream.current();
+
+ // Start of a new line. Insert a newline to be safe if code was not-ASI safe. These are collapsed.
+ if (startOfNewLine)
+ this._builder.appendNewline();
+
+ // Whitespace. Collapse to a single space.
+ if (isWhiteSpace) {
+ this._builder.appendSpace();
+ return;
+ }
+
+ // Avoid some hooks for content in comments.
+ var isComment = token && /\bcomment\b/.test(token);
+
+ if (mode.modifyStateForTokenPre)
+ mode.modifyStateForTokenPre(this._lastToken, this._lastContent, token, state, content, isComment);
+
+ // Should we remove the last newline?
+ if (this._builder.lastTokenWasNewline && mode.removeLastNewline(this._lastToken, this._lastContent, token, state, content, isComment, firstTokenOnLine))
+ this._builder.removeLastNewline();
+
+ // Add whitespace after the last token?
+ if (!this._builder.lastTokenWasWhitespace && mode.shouldHaveSpaceAfterLastToken(this._lastToken, this._lastContent, token, state, content, isComment))
+ this._builder.appendSpace();
+
+ // Add whitespace before this token?
+ if (!this._builder.lastTokenWasWhitespace && mode.shouldHaveSpaceBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
+ this._builder.appendSpace();
+
+ // Should we dedent before this token?
+ var dedents = mode.dedentsBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment);
+ while (dedents-- > 0)
+ this._builder.dedent();
+
+ // Should we add a newline before this token?
+ if (mode.newlineBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
+ this._builder.appendNewline();
+
+ // Should we indent before this token?
+ if (mode.indentBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
+ this._builder.indent();
+
+ // Append token.
+ this._builder.appendToken(content, originalPosition);
+
+ // Let the pretty printer update any state it keeps track of.
+ if (mode.modifyStateForTokenPost)
+ mode.modifyStateForTokenPost(this._lastToken, this._lastContent, token, state, content, isComment);
+
+ // Should we indent or dedent after this token?
+ if (!isComment && mode.indentAfterToken(this._lastToken, this._lastContent, token, state, content, isComment))
+ this._builder.indent();
+
+ // Should we add newlines after this token?
+ var newlines = mode.newlinesAfterToken(this._lastToken, this._lastContent, token, state, content, isComment);
+ if (newlines)
+ this._builder.appendMultipleNewlines(newlines);
+
+ // Record this token as the last token.
+ this._lastToken = token;
+ this._lastContent = content;
+ },
+
+ _handleEmptyLine: function()
+ {
+ // Preserve original whitespace only lines by adding a newline.
+ // However, don't do this if the builder just added multiple newlines.
+ if (!(this._builder.lastTokenWasNewline && this._builder.lastNewlineAppendWasMultiple))
+ this._builder.appendNewline(true);
+ },
+
+ _handleLineEnding: function(originalNewLinePosition)
+ {
+ // Record the original line ending.
+ this._builder.addOriginalLineEnding(originalNewLinePosition);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersFormatterContentBuilderjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFormatterContentBuilderjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FormatterContentBuilder.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,229 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+function FormatterContentBuilder(mapping, originalLineEndings, formattedLineEndings, originalOffset, formattedOffset, indentString)
+{
+ this._originalContent = null;
+ this._formattedContent = [];
+ this._formattedContentLength = 0;
+
+ this._startOfLine = true;
+ this.lastTokenWasNewline = false;
+ this.lastTokenWasWhitespace = false;
+ this.lastNewlineAppendWasMultiple = false;
+
+ this._indent = 0;
+ this._indentString = indentString;
+ this._indentCache = ["", this._indentString];
+
+ this._mapping = mapping;
+ this._originalLineEndings = originalLineEndings || [];
+ this._formattedLineEndings = formattedLineEndings || [];
+ this._originalOffset = originalOffset || 0;
+ this._formattedOffset = formattedOffset || 0;
+
+ this._lastOriginalPosition = 0;
+ this._lastFormattedPosition = 0;
+}
+
+FormatterContentBuilder.prototype = {
+ constructor: FormatterContentBuilder,
+
+ // Public
+
+ get originalContent()
+ {
+ return this._originalContent;
+ },
+
+ get formattedContent()
+ {
+ var formatted = this._formattedContent.join("");
+ console.assert(formatted.length === this._formattedContentLength);
+ return formatted;
+ },
+
+ get mapping()
+ {
+ return this._mapping;
+ },
+
+ get originalLineEndings()
+ {
+ return this._originalLineEndings;
+ },
+
+ get formattedLineEndings()
+ {
+ return this._formattedLineEndings;
+ },
+
+ setOriginalContent: function(originalContent)
+ {
+ console.assert(!this._originalContent);
+ this._originalContent = originalContent;
+ },
+
+ appendToken: function(string, originalPosition)
+ {
+ if (this._startOfLine)
+ this._appendIndent();
+
+ this._addMappingIfNeeded(originalPosition);
+
+ this._append(string);
+ this._startOfLine = false;
+ this.lastTokenWasNewline = false;
+ this.lastTokenWasWhitespace = false;
+ },
+
+ appendSpace: function()
+ {
+ if (!this._startOfLine) {
+ this._append(" ");
+ this.lastTokenWasNewline = false;
+ this.lastTokenWasWhitespace = true;
+ }
+ },
+
+ appendNewline: function(force)
+ {
+ if ((!this.lastTokenWasNewline && !this._startOfLine) || force) {
+ this._append("\n");
+ this._addFormattedLineEnding();
+ this._startOfLine = true;
+ this.lastTokenWasNewline = true;
+ this.lastTokenWasWhitespace = false;
+ this.lastNewlineAppendWasMultiple = false;
+ }
+ },
+
+ appendMultipleNewlines: function(newlines)
+ {
+ console.assert(newlines > 0);
+
+ var wasMultiple = newlines > 1;
+
+ while (newlines-- > 0)
+ this.appendNewline(true);
+
+ if (wasMultiple)
+ this.lastNewlineAppendWasMultiple = true;
+ },
+
+ removeLastNewline: function()
+ {
+ console.assert(this.lastTokenWasNewline);
+ console.assert(this._formattedContent.lastValue === "\n");
+ if (this.lastTokenWasNewline) {
+ this._popNewLine();
+ this._startOfLine = false;
+ this.lastTokenWasNewline = false;
+ this.lastTokenWasWhitespace = false;
+ }
+ },
+
+ indent: function()
+ {
+ ++this._indent;
+ },
+
+ dedent: function()
+ {
+ --this._indent;
+
+ console.assert(this._indent >= 0);
+ if (this._indent < 0)
+ this._indent = 0;
+ },
+
+ addOriginalLineEnding: function(originalPosition)
+ {
+ this._originalLineEndings.push(originalPosition);
+ },
+
+ finish: function()
+ {
+ this.appendNewline();
+ },
+
+ // Private
+
+ _popNewLine: function()
+ {
+ var removed = this._formattedContent.pop();
+ this._formattedContentLength -= removed.length;
+ this._formattedLineEndings.pop();
+ },
+
+ _append: function(str)
+ {
+ this._formattedContent.push(str);
+ this._formattedContentLength += str.length;
+ },
+
+ _appendIndent: function()
+ {
+ // Indent is already in the cache.
+ if (this._indent < this._indentCache.length) {
+ this._append(this._indentCache[this._indent]);
+ return;
+ }
+
+ // Indent was not in the cache, fill up the cache up with what was needed.
+ const maxCacheIndent = 20;
+ var max = Math.min(this._indent, maxCacheIndent);
+ for (var i = this._indentCache.length; i <= max; ++i)
+ this._indentCache[i] = this._indentCache[i-1] + this._indentString;
+
+ // Append indents as needed.
+ var indent = this._indent;
+ do {
+ if (indent >= maxCacheIndent)
+ this._append(this._indentCache[maxCacheIndent]);
+ else
+ this._append(this._indentCache[indent]);
+ indent -= maxCacheIndent;
+ } while (indent > 0);
+ },
+
+ _addMappingIfNeeded: function(originalPosition)
+ {
+ if (originalPosition - this._lastOriginalPosition === this._formattedContentLength - this._lastFormattedPosition)
+ return;
+
+ this._mapping.original.push(this._originalOffset + originalPosition);
+ this._mapping.formatted.push(this._formattedOffset + this._formattedContentLength);
+
+ this._lastOriginalPosition = originalPosition;
+ this._lastFormattedPosition = this._formattedContentLength;
+ },
+
+ _addFormattedLineEnding: function()
+ {
+ console.assert(this._formattedContent.lastValue === "\n");
+ this._formattedLineEndings.push(this._formattedContentLength - 1);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersFormatterSourceMapjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFormatterSourceMapjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FormatterSourceMap.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FormatterSourceMap = function(originalLineEndings, formattedLineEndings, mapping)
+{
+ WebInspector.Object.call(this);
+
+ this._originalLineEndings = originalLineEndings;
+ this._formattedLineEndings = formattedLineEndings;
+ this._mapping = mapping;
+};
+
+WebInspector.FormatterSourceMap.fromBuilder = function(builder)
+{
+ return new WebInspector.FormatterSourceMap(builder.originalLineEndings, builder.formattedLineEndings, builder.mapping);
+}
+
+WebInspector.FormatterSourceMap.prototype = {
+ constructor: WebInspector.FormatterSourceMap,
+
+ // Public
+
+ originalToFormatted: function(lineNumber, columnNumber)
+ {
+ var originalPosition = this._locationToPosition(this._originalLineEndings, lineNumber || 0, columnNumber || 0);
+ var formattedPosition = this._convertPosition(this._mapping.original, this._mapping.formatted, originalPosition);
+ return this._positionToLocation(this._formattedLineEndings, formattedPosition);
+ },
+
+ formattedToOriginal: function(lineNumber, columnNumber)
+ {
+ var formattedPosition = this._locationToPosition(this._formattedLineEndings, lineNumber || 0, columnNumber || 0);
+ var originalPosition = this._convertPosition(this._mapping.formatted, this._mapping.original, formattedPosition);
+ return this._positionToLocation(this._originalLineEndings, originalPosition);
+ },
+
+ // Private
+
+ _locationToPosition: function(lineEndings, lineNumber, columnNumber)
+ {
+ var lineOffset = lineNumber ? lineEndings[lineNumber - 1] + 1 : 0;
+ return lineOffset + columnNumber;
+ },
+
+ _positionToLocation: function(lineEndings, position)
+ {
+ var lineNumber = lineEndings.upperBound(position - 1);
+ if (!lineNumber)
+ var columnNumber = position;
+ else
+ var columnNumber = position - lineEndings[lineNumber - 1] - 1;
+ return {lineNumber: lineNumber, columnNumber: columnNumber};
+ },
+
+ _convertPosition: function(positions1, positions2, positionInPosition1)
+ {
+ var index = positions1.upperBound(positionInPosition1) - 1;
+ var convertedPosition = positions2[index] + positionInPosition1 - positions1[index];
+ if (index < positions2.length - 1 && convertedPosition > positions2[index + 1])
+ convertedPosition = positions2[index + 1];
+ return convertedPosition;
+ }
+};
+
+WebInspector.FormatterSourceMap.__proto__ = WebInspector.Object;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersFrameResourceManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFrameResourceManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FrameResourceManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,586 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameResourceManager = function()
+{
+ WebInspector.Object.call(this);
+
+ if (window.PageAgent)
+ PageAgent.enable();
+ if (window.NetworkAgent)
+ NetworkAgent.enable();
+
+ this.initialize();
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.FrameResourceManager);
+
+WebInspector.FrameResourceManager.Event = {
+ FrameWasAdded: "frame-resource-manager-frame-was-added",
+ FrameWasRemoved: "frame-resource-manager-frame-was-removed",
+ MainFrameDidChange: "frame-resource-manager-main-frame-did-change"
+};
+
+WebInspector.FrameResourceManager.prototype = {
+ constructor: WebInspector.FrameResourceManager,
+
+ // Public
+
+ initialize: function()
+ {
+ var oldMainFrame = this._mainFrame;
+
+ this._frameIdentifierMap = {};
+ this._mainFrame = null;
+ this._resourceRequestIdentifierMap = {};
+
+ if (this._mainFrame !== oldMainFrame)
+ this._mainFrameDidChange(oldMainFrame);
+
+ this._waitingForMainFrameResourceTreePayload = true;
+ if (window.PageAgent)
+ PageAgent.getResourceTree(this._processMainFrameResourceTreePayload.bind(this));
+ },
+
+ get mainFrame()
+ {
+ return this._mainFrame;
+ },
+
+ get frames()
+ {
+ var frames = [];
+ for (var key in this._frameIdentifierMap)
+ frames.push(this._frameIdentifierMap[key]);
+
+ return frames;
+ },
+
+ frameForIdentifier: function(frameId)
+ {
+ return this._frameIdentifierMap[frameId] || null;
+ },
+
+ frameDidNavigate: function(framePayload)
+ {
+ // Called from WebInspector.PageObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var frameWasLoadedInstantly = false;
+
+ var frame = this.frameForIdentifier(framePayload.id);
+ if (!frame) {
+ // If the frame wasn't known before now, then the main resource was loaded instantly (about:blank, etc.)
+ // Make a new resource (which will make the frame). Mark will mark it as loaded at the end too since we
+ // don't expect any more events about the load finishing for these frames.
+ var frameResource = this._addNewResourceToFrame(null, framePayload.id, framePayload.loaderId, framePayload.url, null, null, null, null, null, framePayload.name, framePayload.securityOrigin);
+ frame = frameResource.parentFrame;
+ frameWasLoadedInstantly = true;
+
+ console.assert(frame);
+ if (!frame)
+ return;
+ }
+
+ if (framePayload.loaderId === frame.provisionalLoaderIdentifier) {
+ // There was a provisional load in progress, commit it.
+ frame.commitProvisionalLoad(framePayload.securityOrigin);
+ } else {
+ if (frame.mainResource.url !== framePayload.url || frame.loaderIdentifier !== framePayload.loaderId) {
+ // Navigations like back/forward do not have provisional loads, so create a new main resource here.
+ var mainResource = new WebInspector.Resource(framePayload.url, framePayload.mimeType, null, framePayload.loaderId);
+ } else {
+ // The main resource is already correct, so reuse it.
+ var mainResource = frame.mainResource;
+ }
+
+ frame.initialize(framePayload.name, framePayload.securityOrigin, framePayload.loaderId, mainResource);
+ }
+
+ var oldMainFrame = this._mainFrame;
+
+ if (framePayload.parentId) {
+ var parentFrame = this.frameForIdentifier(framePayload.parentId);
+ console.assert(parentFrame);
+
+ if (frame === this._mainFrame)
+ this._mainFrame = null;
+
+ if (frame.parentFrame !== parentFrame)
+ parentFrame.addChildFrame(frame);
+ } else {
+ if (frame.parentFrame)
+ frame.parentFrame.removeChildFrame(frame);
+ this._mainFrame = frame;
+ }
+
+ if (this._mainFrame !== oldMainFrame)
+ this._mainFrameDidChange(oldMainFrame);
+
+ if (frameWasLoadedInstantly)
+ frame.mainResource.markAsFinished();
+ },
+
+ frameDidDetach: function(frameId)
+ {
+ // Called from WebInspector.PageObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var frame = this.frameForIdentifier(frameId);
+ if (!frame)
+ return;
+
+ if (frame.parentFrame)
+ frame.parentFrame.removeChildFrame(frame);
+
+ delete this._frameIdentifierMap[frame.id];
+
+ var oldMainFrame = this._mainFrame;
+
+ if (frame === this._mainFrame)
+ this._mainFrame = null;
+
+ frame.clearExecutionContexts();
+
+ this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.FrameWasRemoved, {frame: frame});
+
+ if (this._mainFrame !== oldMainFrame)
+ this._mainFrameDidChange(oldMainFrame);
+ },
+
+ resourceRequestWillBeSent: function(requestIdentifier, frameIdentifier, loaderIdentifier, request, type, redirectResponse, timestamp, initiator)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+ if (resource) {
+ // This is an existing request which is being redirected, update the resource.
+ console.assert(redirectResponse);
+ resource.updateForRedirectResponse(request.url, request.headers, timestamp);
+ return;
+ }
+
+ var initiatorSourceCodeLocation = this._initiatorSourceCodeLocationFromPayload(initiator);
+
+ // This is a new request, make a new resource and add it to the right frame.
+ resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, request.url, type, request.method, request.headers, request.postData, timestamp, null, null, initiatorSourceCodeLocation);
+
+ // Associate the resource with the requestIdentifier so it can be found in future loading events.
+ this._resourceRequestIdentifierMap[requestIdentifier] = resource;
+ },
+
+ markResourceRequestAsServedFromMemoryCache: function(requestIdentifier)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+
+ // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
+ // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
+ // just doesn't have a requestIdentifier for us to look it up.
+ if (!resource)
+ return;
+
+ resource.markAsCached();
+ },
+
+ resourceRequestWasServedFromMemoryCache: function(requestIdentifier, frameIdentifier, loaderIdentifier, cachedResourcePayload, timestamp, initiator)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ console.assert(!(requestIdentifier in this._resourceRequestIdentifierMap));
+
+ var initiatorSourceCodeLocation = this._initiatorSourceCodeLocationFromPayload(initiator);
+
+ var response = cachedResourcePayload.response;
+ var resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, cachedResourcePayload.url, cachedResourcePayload.type, null, null, timestamp, null, null, initiatorSourceCodeLocation);
+ resource.markAsCached();
+ resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, timestamp);
+ resource.markAsFinished(timestamp);
+
+ if (cachedResourcePayload.sourceMapURL)
+ WebInspector.sourceMapManager.downloadSourceMap(cachedResourcePayload.sourceMapURL, resource.url, resource);
+
+ // No need to associate the resource with the requestIdentifier, since this is the only event
+ // sent for memory cache resource loads.
+ },
+
+ resourceRequestDidReceiveResponse: function(requestIdentifier, frameIdentifier, loaderIdentifier, type, response, timestamp)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+
+ // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
+ // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
+ // just doesn't have a requestIdentifier for us to look it up, but we can try to look it up by its URL.
+ if (!resource) {
+ var frame = this.frameForIdentifier(frameIdentifier);
+ if (frame)
+ resource = frame.resourceForURL(response.url);
+
+ // If we find the resource this way we had marked it earlier as finished via PageAgent.getResourceTree.
+ // Associate the resource with the requestIdentifier so it can be found in future loading events.
+ // and roll it back to an unfinished state, we know now it is still loading.
+ if (resource) {
+ this._resourceRequestIdentifierMap[requestIdentifier] = resource;
+ resource.revertMarkAsFinished();
+ }
+ }
+
+ // If we haven't found an existing Resource by now, then it is a resource that was loading when the inspector
+ // opened and we just missed the resourceRequestWillBeSent for it. So make a new resource and add it.
+ if (!resource) {
+ resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, response.url, type, null, response.requestHeaders, timestamp, null, null);
+
+ // Associate the resource with the requestIdentifier so it can be found in future loading events.
+ this._resourceRequestIdentifierMap[requestIdentifier] = resource;
+ }
+
+ if (response.fromDiskCache)
+ resource.markAsCached();
+
+ resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, timestamp);
+ },
+
+ resourceRequestDidReceiveData: function(requestIdentifier, dataLength, encodedDataLength, timestamp)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+
+ // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
+ // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
+ // just doesn't have a requestIdentifier for us to look it up.
+ if (!resource)
+ return;
+
+ resource.increaseSize(dataLength, timestamp);
+
+ if (encodedDataLength !== -1)
+ resource.increaseTransferSize(encodedDataLength);
+ },
+
+ resourceRequestDidFinishLoading: function(requestIdentifier, timestamp, sourceMapURL)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ // By now we should always have the Resource. Either it was fetched when the inspector first opened with
+ // PageAgent.getResourceTree, or it was a currently loading resource that we learned about in resourceRequestDidReceiveResponse.
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+ console.assert(resource);
+ if (!resource)
+ return;
+
+ resource.markAsFinished(timestamp);
+
+ if (sourceMapURL)
+ WebInspector.sourceMapManager.downloadSourceMap(sourceMapURL, resource.url, resource);
+
+ delete this._resourceRequestIdentifierMap[requestIdentifier];
+ },
+
+ resourceRequestDidFailLoading: function(requestIdentifier, canceled, timestamp)
+ {
+ // Called from WebInspector.NetworkObserver.
+
+ // Ignore this while waiting for the whole frame/resource tree.
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ // By now we should always have the Resource. Either it was fetched when the inspector first opened with
+ // PageAgent.getResourceTree, or it was a currently loading resource that we learned about in resourceRequestDidReceiveResponse.
+ var resource = this._resourceRequestIdentifierMap[requestIdentifier];
+ console.assert(resource);
+ if (!resource)
+ return;
+
+ resource.markAsFailed(canceled, timestamp);
+
+ if (resource === resource.parentFrame.provisionalMainResource)
+ resource.parentFrame.clearProvisionalLoad();
+
+ delete this._resourceRequestIdentifierMap[requestIdentifier];
+ },
+
+ executionContextCreated: function(contextPayload)
+ {
+ // Called from WebInspector.RuntimeObserver.
+
+ var frame = this.frameForIdentifier(contextPayload.frameId);
+ console.assert(frame);
+ if (!frame)
+ return;
+
+ var displayName = contextPayload.name || frame.mainResource.displayName;
+ var executionContext = new WebInspector.ExecutionContext(contextPayload.id, displayName, contextPayload.isPageContext, frame);
+ frame.addExecutionContext(executionContext);
+ },
+
+ resourceForURL: function(url)
+ {
+ if (!this._mainFrame)
+ return null;
+
+ if (this._mainFrame.mainResource.url === url)
+ return this._mainFrame.mainResource;
+
+ return this._mainFrame.resourceForURL(url, true);
+ },
+
+ // Private
+
+ _addNewResourceToFrame: function(requestIdentifier, frameIdentifier, loaderIdentifier, url, type, requestMethod, requestHeaders, requestData, timestamp, frameName, frameSecurityOrigin, initiatorSourceCodeLocation)
+ {
+ console.assert(!this._waitingForMainFrameResourceTreePayload);
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ var resource = null;
+
+ var frame = this.frameForIdentifier(frameIdentifier);
+ if (frame) {
+ // This is a new request for an existing frame, which might be the main resource or a new resource.
+ if (frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier)
+ resource = frame.mainResource;
+ else if (frame.provisionalMainResource && frame.provisionalMainResource.url === url && frame.provisionalLoaderIdentifier === loaderIdentifier)
+ resource = frame.provisionalMainResource;
+ else {
+ resource = new WebInspector.Resource(url, null, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, timestamp, initiatorSourceCodeLocation);
+ this._addResourceToFrame(frame, resource);
+ }
+ } else {
+ // This is a new request for a new frame, which is always the main resource.
+ resource = new WebInspector.Resource(url, null, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, timestamp, initiatorSourceCodeLocation);
+ frame = new WebInspector.Frame(frameIdentifier, frameName, frameSecurityOrigin, loaderIdentifier, resource);
+ this._frameIdentifierMap[frame.id] = frame;
+
+ // If we don't have a main frame, assume this is it. This can change later in
+ // frameDidNavigate when the parent frame is known.
+ if (!this._mainFrame) {
+ this._mainFrame = frame;
+ this._mainFrameDidChange(null);
+ }
+
+ this._dispatchFrameWasAddedEvent(frame);
+ }
+
+ console.assert(resource);
+
+ return resource;
+ },
+
+ _addResourceToFrame: function(frame, resource)
+ {
+ console.assert(!this._waitingForMainFrameResourceTreePayload);
+ if (this._waitingForMainFrameResourceTreePayload)
+ return;
+
+ console.assert(frame);
+ console.assert(resource);
+
+ if (resource.loaderIdentifier !== frame.loaderIdentifier && !frame.provisionalLoaderIdentifier) {
+ // This is the start of a provisional load which happens before frameDidNavigate is called.
+ // This resource will be the new mainResource if frameDidNavigate is called.
+ frame.startProvisionalLoad(resource);
+ return;
+ }
+
+ // This is just another resource, either for the main loader or the provisional loader.
+ console.assert(resource.loaderIdentifier === frame.loaderIdentifier || resource.loaderIdentifier === frame.provisionalLoaderIdentifier);
+ frame.addResource(resource);
+ },
+
+ _initiatorSourceCodeLocationFromPayload: function(initiatorPayload)
+ {
+ if (!initiatorPayload)
+ return null;
+
+ var url = null;
+ var lineNumber = NaN;
+ var columnNumber = 0;
+
+ if (initiatorPayload.stackTrace && initiatorPayload.stackTrace.length) {
+ var stackTracePayload = initiatorPayload.stackTrace;
+ for (var i = 0; i < stackTracePayload.length; ++i) {
+ var callFramePayload = stackTracePayload[i];
+ if (!callFramePayload.url || callFramePayload.url === "[native code]")
+ continue;
+
+ url = callFramePayload.url;
+
+ // The lineNumber is 1-based, but we expect 0-based.
+ lineNumber = callFramePayload.lineNumber - 1;
+
+ columnNumber = callFramePayload.columnNumber;
+
+ break;
+ }
+ } else if (initiatorPayload.url) {
+ url = initiatorPayload.url;
+
+ // The lineNumber is 1-based, but we expect 0-based.
+ lineNumber = initiatorPayload.lineNumber - 1;
+ }
+
+ if (!url || isNaN(lineNumber) || lineNumber < 0)
+ return null;
+
+ var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
+ if (!sourceCode)
+ sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
+
+ if (!sourceCode)
+ return null;
+
+ return sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
+ },
+
+ _processMainFrameResourceTreePayload: function(error, mainFramePayload)
+ {
+ console.assert(this._waitingForMainFrameResourceTreePayload);
+ delete this._waitingForMainFrameResourceTreePayload;
+
+ if (error) {
+ console.error(JSON.stringify(error));
+ return;
+ }
+
+ console.assert(mainFramePayload);
+ console.assert(mainFramePayload.frame);
+
+ this._resourceRequestIdentifierMap = {};
+ this._frameIdentifierMap = {};
+
+ var oldMainFrame = this._mainFrame;
+
+ this._mainFrame = this._addFrameTreeFromFrameResourceTreePayload(mainFramePayload, true);
+
+ if (this._mainFrame !== oldMainFrame)
+ this._mainFrameDidChange(oldMainFrame);
+ },
+
+ _createFrame: function(payload)
+ {
+ // If payload.url is missing or empty then this page is likely the special empty page. In that case
+ // we will just say it is "about:blank" so we have a URL, which is required for resources.
+ var mainResource = new WebInspector.Resource(payload.url || "about:blank", payload.mimeType, null, payload.loaderId);
+ var frame = new WebInspector.Frame(payload.id, payload.name, payload.securityOrigin, payload.loaderId, mainResource);
+
+ this._frameIdentifierMap[frame.id] = frame;
+
+ mainResource.markAsFinished();
+
+ return frame;
+ },
+
+ _createResource: function(payload, framePayload)
+ {
+ var resource = new WebInspector.Resource(payload.url, payload.mimeType, payload.type, framePayload.loaderId);
+
+ if (payload.sourceMapURL)
+ WebInspector.sourceMapManager.downloadSourceMap(payload.sourceMapURL, resource.url, resource);
+
+ return resource;
+ },
+
+ _addFrameTreeFromFrameResourceTreePayload: function(payload, isMainFrame)
+ {
+ var frame = this._createFrame(payload.frame);
+ if (isMainFrame)
+ frame.markAsMainFrame();
+
+ for (var i = 0; payload.childFrames && i < payload.childFrames.length; ++i)
+ frame.addChildFrame(this._addFrameTreeFromFrameResourceTreePayload(payload.childFrames[i], false));
+
+ for (var i = 0; payload.resources && i < payload.resources.length; ++i) {
+ var resourcePayload = payload.resources[i];
+
+ // The main resource is included as a resource. We can skip it since we already created
+ // a main resource when we created the Frame. The resource payload does not include anything
+ // didn't already get from the frame payload.
+ if (resourcePayload.type === "Document" && resourcePayload.url === payload.frame.url)
+ continue;
+
+ var resource = this._createResource(resourcePayload, payload);
+ frame.addResource(resource);
+
+ if (resourcePayload.failed || resourcePayload.canceled)
+ resource.markAsFailed(resourcePayload.canceled);
+ else
+ resource.markAsFinished();
+ }
+
+ this._dispatchFrameWasAddedEvent(frame);
+
+ return frame;
+ },
+
+ _dispatchFrameWasAddedEvent: function(frame)
+ {
+ this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.FrameWasAdded, {frame: frame});
+ },
+
+ _mainFrameDidChange: function(oldMainFrame)
+ {
+ if (oldMainFrame)
+ oldMainFrame.unmarkAsMainFrame();
+ if (this._mainFrame)
+ this._mainFrame.markAsMainFrame();
+ this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.MainFrameDidChange, {oldMainFrame: oldMainFrame});
+ }
+};
+
+WebInspector.FrameResourceManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersIssueManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIssueManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/IssueManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IssueManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/IssueManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/IssueManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IssueManager = function()
+{
+ WebInspector.Object.call(this);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._activeLogCleared, this);
+
+ this.initialize();
+}
+
+WebInspector.IssueManager.Event = {
+ IssueWasAdded: "issue-manager-issue-was-added",
+ Cleared: "issue-manager-cleared"
+};
+
+WebInspector.IssueManager.prototype = {
+ constructor: WebInspector.IssueManager,
+
+ // Public
+
+ initialize: function()
+ {
+ this._issues = [];
+
+ this.dispatchEventToListeners(WebInspector.IssueManager.Event.Cleared);
+ },
+
+ issueWasAdded: function(source, level, text, url, lineNumber, parameters)
+ {
+ var modifiedLineNumber;
+ if (lineNumber) {
+ console.assert(typeof lineNumber === "number");
+ modifiedLineNumber = lineNumber - 1;
+ }
+
+ var issue = new WebInspector.IssueMessage(source, level, text, url, modifiedLineNumber, parameters);
+ this._issues.push(issue);
+
+ this.dispatchEventToListeners(WebInspector.IssueManager.Event.IssueWasAdded, {issue: issue});
+ },
+
+ issuesForSourceCode: function(sourceCode)
+ {
+ var issues = [];
+
+ for (var i = 0; i < this._issues.length; ++i) {
+ // FIXME: Support issues based on Script identifiers too.
+ var issue = this._issues[i];
+ if (issue.url === sourceCode.url)
+ issues.push(issue);
+ }
+
+ return issues;
+ },
+
+ // Private
+
+ _activeLogCleared: function(event)
+ {
+ this.initialize();
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ this.initialize();
+ }
+};
+
+WebInspector.IssueManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptLogViewControllerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceJavaScriptLogViewControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/JavaScriptLogViewController.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,292 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.JavaScriptLogViewController = function(element, scrollElement, textPrompt, delegate, historySettingIdentifier)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(textPrompt instanceof WebInspector.ConsolePrompt);
+ console.assert(historySettingIdentifier);
+
+ this._element = element;
+ this._scrollElement = scrollElement;
+
+ this._promptHistorySetting = new WebInspector.Setting(historySettingIdentifier, null);
+
+ this._prompt = textPrompt;
+ this._prompt.delegate = this;
+ this._prompt.history = this._promptHistorySetting.value;
+
+ this.delegate = delegate;
+
+ this._cleared = true;
+ this._previousMessage = null;
+ this._repeatCountWasInterrupted = false;
+
+ this._topConsoleGroups = [];
+
+ this.messagesClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "K", this._handleClearShortcut.bind(this));
+ this.messagesAlternateClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "L", this._handleClearShortcut.bind(this), this._element);
+
+ this._messagesFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._handleFindShortcut.bind(this), this._element);
+ this._messagesFindNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._handleFindNextShortcut.bind(this), this._element);
+ this._messagesFindPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "G", this._handleFindPreviousShortcut.bind(this), this._element);
+
+ this._promptAlternateClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "L", this._handleClearShortcut.bind(this), this._prompt.element);
+ this._promptFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._handleFindShortcut.bind(this), this._prompt.element);
+ this._promptFindNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._handleFindNextShortcut.bind(this), this._prompt.element);
+ this._promptFindPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "G", this._handleFindPreviousShortcut.bind(this), this._prompt.element);
+
+ this.startNewSession();
+};
+
+WebInspector.JavaScriptLogViewController.CachedPropertiesDuration = 30000;
+
+WebInspector.JavaScriptLogViewController.prototype = {
+ constructor: WebInspector.JavaScriptLogViewController,
+
+ // Public
+
+ get prompt()
+ {
+ return this._prompt;
+ },
+
+ get topConsoleGroup()
+ {
+ return this._topConsoleGroup;
+ },
+
+ get currentConsoleGroup()
+ {
+ return this._currentConsoleGroup;
+ },
+
+ clear: function()
+ {
+ this._cleared = true;
+
+ this.startNewSession(true);
+
+ this.prompt.focus();
+
+ if (this.delegate && typeof this.delegate.didClearMessages === "function")
+ this.delegate.didClearMessages();
+ },
+
+ startNewSession: function(clearPreviousSessions)
+ {
+ if (this._topConsoleGroups.length && clearPreviousSessions) {
+ for (var i = 0; i < this._topConsoleGroups.length; ++i)
+ this._element.removeChild(this._topConsoleGroups[i].element);
+
+ this._topConsoleGroups = [];
+ this._topConsoleGroup = null;
+ this._currentConsoleGroup = null;
+ }
+
+ // Reuse the top group if it has no messages.
+ if (this._topConsoleGroup && !this._topConsoleGroup.hasMessages()) {
+ // Make sure the session is visible.
+ this._topConsoleGroup.element.scrollIntoView();
+ return;
+ }
+
+ var hasPreviousSession = !!this._topConsoleGroup;
+ var consoleGroup = new WebInspector.ConsoleGroup(null, hasPreviousSession);
+
+ this._previousMessage = null;
+ this._repeatCountWasInterrupted = false;
+
+ this._topConsoleGroups.push(consoleGroup);
+ this._topConsoleGroup = consoleGroup;
+ this._currentConsoleGroup = consoleGroup;
+
+ this._element.appendChild(consoleGroup.element);
+
+ // Make sure the new session is visible.
+ consoleGroup.element.scrollIntoView();
+ },
+
+ appendConsoleMessage: function(consoleMessage)
+ {
+ // Clone the message since there might be multiple clients using the message,
+ // and since the message has a DOM element it can't be two places at once.
+ var messageClone = consoleMessage.clone();
+
+ this._appendConsoleMessage(messageClone);
+
+ return messageClone;
+ },
+
+ updatePreviousMessageRepeatCount: function(count)
+ {
+ console.assert(this._previousMessage);
+ if (!this._previousMessage)
+ return;
+
+ if (!this._repeatCountWasInterrupted) {
+ this._previousMessage.repeatCount = count - (this._previousMessage.ignoredCount || 0);
+ this._previousMessage.updateRepeatCount();
+ } else {
+ var newMessage = this._previousMessage.clone();
+
+ // If this message is repeated after being cloned, messageRepeatCountUpdated will be called with a
+ // count that includes the count of this message before cloning. We should ignore instances of this
+ // log that occurred before we cloned, so set a property on the message with the number of previous
+ // instances of this log that we should ignore.
+ newMessage.ignoredCount = newMessage.repeatCount + (this._previousMessage.ignoredCount || 0);
+ newMessage.repeatCount = 1;
+
+ this._appendConsoleMessage(newMessage);
+ }
+ },
+
+ isScrolledToBottom: function()
+ {
+ // Lie about being scrolled to the bottom if we have a pending request to scroll to the bottom soon.
+ return this._scrollToBottomTimeout || this._scrollElement.isScrolledToBottom();
+ },
+
+ scrollToBottom: function()
+ {
+ if (this._scrollToBottomTimeout)
+ return;
+
+ function delayedWork()
+ {
+ this._scrollToBottomTimeout = null;
+ this._scrollElement.scrollTop = this._scrollElement.scrollHeight;
+ }
+
+ // Don't scroll immediately so we are not causing excessive layouts when there
+ // are many messages being added at once.
+ this._scrollToBottomTimeout = setTimeout(delayedWork.bind(this), 0);
+ },
+
+ // Protected
+
+ consolePromptHistoryDidChange: function(prompt)
+ {
+ this._promptHistorySetting.value = this.prompt.history;
+ },
+
+ consolePromptShouldCommitText: function(prompt, text, cursorIsAtLastPosition, handler)
+ {
+ // Always commit the text if we are not at the last position.
+ if (!cursorIsAtLastPosition) {
+ handler(true);
+ return;
+ }
+
+ // COMPATIBILITY (iOS 6): RuntimeAgent.parse did not exist in iOS 6. Always commit.
+ if (!RuntimeAgent.parse) {
+ handler(true);
+ return;
+ }
+
+ function parseFinished(error, result, message, range)
+ {
+ handler(result !== RuntimeAgent.SyntaxErrorType.Recoverable);
+ }
+
+ RuntimeAgent.parse(text, parseFinished.bind(this));
+ },
+
+ consolePromptTextCommitted: function(prompt, text)
+ {
+ console.assert(text);
+
+ var commandMessage = new WebInspector.ConsoleCommand(text);
+ this._appendConsoleMessage(commandMessage, true);
+
+ function printResult(result, wasThrown)
+ {
+ if (!result || this._cleared)
+ return;
+
+ this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage), true);
+ }
+
+ text += "\n//# sourceURL=__WebInspectorConsole__\n";
+
+ WebInspector.runtimeManager.evaluateInInspectedWindow(text, "console", true, false, false, printResult.bind(this));
+ },
+
+ // Private
+
+ _handleClearShortcut: function()
+ {
+ this.clear();
+ },
+
+ _handleFindShortcut: function()
+ {
+ this.delegate.focusSearchBar();
+ },
+
+ _handleFindNextShortcut: function()
+ {
+ this.delegate.highlightNextSearchMatch();
+ },
+
+ _handleFindPreviousShortcut: function()
+ {
+ this.delegate.highlightPreviousSearchMatch();
+ },
+
+ _appendConsoleMessage: function(msg, repeatCountWasInterrupted)
+ {
+ var wasScrolledToBottom = this.isScrolledToBottom();
+
+ this._cleared = false;
+ this._repeatCountWasInterrupted = repeatCountWasInterrupted || false;
+
+ if (!repeatCountWasInterrupted)
+ this._previousMessage = msg;
+
+ if (msg.type === WebInspector.ConsoleMessage.MessageType.EndGroup) {
+ var parentGroup = this._currentConsoleGroup.parentGroup;
+ if (parentGroup)
+ this._currentConsoleGroup = parentGroup;
+ } else {
+ if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
+ var group = new WebInspector.ConsoleGroup(this._currentConsoleGroup);
+ this._currentConsoleGroup.messagesElement.appendChild(group.element);
+ this._currentConsoleGroup = group;
+ }
+
+ this._currentConsoleGroup.addMessage(msg);
+ }
+
+ if (msg.type === WebInspector.ConsoleMessage.MessageType.Result || wasScrolledToBottom)
+ this.scrollToBottom();
+
+ if (this.delegate && typeof this.delegate.didAppendConsoleMessage === "function")
+ this.delegate.didAppendConsoleMessage(msg);
+ }
+};
+
+WebInspector.JavaScriptLogViewController.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersJavaScriptRuntimeCompletionProviderjsfromrev164541trunkSourceWebInspectorUIUserInterfaceJavaScriptRuntimeCompletionProviderjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/JavaScriptRuntimeCompletionProvider.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.JavaScriptRuntimeCompletionProvider = function()
+{
+ WebInspector.Object.call(this);
+
+ console.assert(!WebInspector.JavaScriptRuntimeCompletionProvider._instance);
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._clearLastProperties, this);
+};
+
+Object.defineProperty(WebInspector, "javaScriptRuntimeCompletionProvider",
+{
+ get: function()
+ {
+ if (!WebInspector.JavaScriptRuntimeCompletionProvider._instance)
+ WebInspector.JavaScriptRuntimeCompletionProvider._instance = new WebInspector.JavaScriptRuntimeCompletionProvider;
+ return WebInspector.JavaScriptRuntimeCompletionProvider._instance;
+ }
+});
+
+WebInspector.JavaScriptRuntimeCompletionProvider.prototype = {
+ constructor: WebInspector.JavaScriptRuntimeCompletionProvider,
+
+ // Protected
+
+ completionControllerCompletionsNeeded: function(completionController, defaultCompletions, base, prefix, suffix, forced)
+ {
+ // Don't allow non-forced empty prefix completions unless the base is that start of property access.
+ if (!forced && !prefix && !/[.[]$/.test(base)) {
+ completionController.updateCompletions(null);
+ return;
+ }
+
+ // If the base ends with an open parentheses or open curly bracket then treat it like there is
+ // no base so we get global object completions.
+ if (/[({]$/.test(base))
+ base = "";
+
+ var lastBaseIndex = base.length - 1;
+ var dotNotation = base[lastBaseIndex] === ".";
+ var bracketNotation = base[lastBaseIndex] === "[";
+
+ if (dotNotation || bracketNotation) {
+ base = base.substring(0, lastBaseIndex);
+
+ // Don't suggest anything for an empty base that is using dot notation.
+ // Bracket notation with an empty base will be treated as an array.
+ if (!base && dotNotation) {
+ completionController.updateCompletions(defaultCompletions);
+ return;
+ }
+
+ // Don't allow non-forced empty prefix completions if the user is entering a number, since it might be a float.
+ // But allow number completions if the base already has a decimal, so "10.0." will suggest Number properties.
+ if (!forced && !prefix && dotNotation && base.indexOf(".") === -1 && parseInt(base, 10) == base) {
+ completionController.updateCompletions(null);
+ return;
+ }
+
+ // An empty base with bracket notation is not property access, it is an array.
+ // Clear the bracketNotation flag so completions are not quoted.
+ if (!base && bracketNotation)
+ bracketNotation = false;
+ }
+
+ // If the base is the same as the last time, we can reuse the property names we have already gathered.
+ // Doing this eliminates delay caused by the async nature of the code below and it only calls getters
+ // and functions once instead of repetitively. Sure, there can be difference each time the base is evaluated,
+ // but this optimization gives us more of a win. We clear the cache after 30 seconds or when stepping in the
+ // debugger to make sure we don't use stale properties in most cases.
+ if (this._lastBase === base && this._lastPropertyNames) {
+ receivedPropertyNames.call(this, this._lastPropertyNames);
+ return;
+ }
+
+ this._lastBase = base;
+ this._lastPropertyNames = null;
+
+ var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
+ if (!base && activeCallFrame && !this._alwaysEvaluateInWindowContext)
+ activeCallFrame.collectScopeChainVariableNames(receivedPropertyNames.bind(this));
+ else
+ WebInspector.runtimeManager.evaluateInInspectedWindow(base, "completion", true, true, false, evaluated.bind(this));
+
+ function updateLastPropertyNames(propertyNames)
+ {
+ if (this._clearLastPropertiesTimeout)
+ clearTimeout(this._clearLastPropertiesTimeout);
+ this._clearLastPropertiesTimeout = setTimeout(this._clearLastProperties.bind(this), WebInspector.JavaScriptLogViewController.CachedPropertiesDuration);
+
+ this._lastPropertyNames = propertyNames || {};
+ }
+
+ function evaluated(result, wasThrown)
+ {
+ if (wasThrown || !result || result.type === "undefined" || (result.type === "object" && result.subtype === "null")) {
+ RuntimeAgent.releaseObjectGroup("completion");
+
+ updateLastPropertyNames.call(this, {});
+ completionController.updateCompletions(defaultCompletions);
+
+ return;
+ }
+
+ function getCompletions(primitiveType)
+ {
+ var object;
+ if (primitiveType === "string")
+ object = new String("");
+ else if (primitiveType === "number")
+ object = new Number(0);
+ else if (primitiveType === "boolean")
+ object = new Boolean(false);
+ else
+ object = this;
+
+ var resultSet = {};
+ for (var o = object; o; o = o.__proto__) {
+ try {
+ var names = Object.getOwnPropertyNames(o);
+ for (var i = 0; i < names.length; ++i)
+ resultSet[names[i]] = true;
+ } catch (e) {
+ // Ignore
+ }
+ }
+
+ return resultSet;
+ }
+
+ if (result.type === "object" || result.type === "function")
+ result.callFunctionJSON(getCompletions, undefined, receivedPropertyNames.bind(this));
+ else if (result.type === "string" || result.type === "number" || result.type === "boolean")
+ WebInspector.runtimeManager.evaluateInInspectedWindow("(" + getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, receivedPropertyNamesFromEvaluate.bind(this));
+ else
+ console.error("Unknown result type: " + result.type);
+ }
+
+ function receivedPropertyNamesFromEvaluate(object, wasThrown, result)
+ {
+ receivedPropertyNames.call(this, result && !wasThrown ? result.value : null);
+ }
+
+ function receivedPropertyNames(propertyNames)
+ {
+ propertyNames = propertyNames || {};
+
+ updateLastPropertyNames.call(this, propertyNames);
+
+ RuntimeAgent.releaseObjectGroup("completion");
+
+ if (!base) {
+ const commandLineAPI = ["$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile", "profileEnd", "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEventListeners", "$0", "$1", "$2", "$3", "$4", "$_"];
+ for (var i = 0; i < commandLineAPI.length; ++i)
+ propertyNames[commandLineAPI[i]] = true;
+ }
+
+ propertyNames = Object.keys(propertyNames);
+
+ var implicitSuffix = "";
+ if (bracketNotation) {
+ var quoteUsed = prefix[0] === "'" ? "'" : "\"";
+ if (suffix !== "]" && suffix !== quoteUsed)
+ implicitSuffix = "]";
+ }
+
+ var completions = defaultCompletions;
+ var knownCompletions = completions.keySet();
+
+ for (var i = 0; i < propertyNames.length; ++i) {
+ var property = propertyNames[i];
+
+ if (dotNotation && !/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(property))
+ continue;
+
+ if (bracketNotation) {
+ if (parseInt(property) != property)
+ property = quoteUsed + property.escapeCharacters(quoteUsed + "\\") + (suffix !== quoteUsed ? quoteUsed : "");
+ }
+
+ if (!property.startsWith(prefix) || property in knownCompletions)
+ continue;
+
+ completions.push(property);
+ knownCompletions[property] = true;
+ }
+
+ function compare(a, b)
+ {
+ // Try to sort in numerical order first.
+ var numericCompareResult = a - b;
+ if (!isNaN(numericCompareResult))
+ return numericCompareResult;
+
+ // Not numbers, sort as strings.
+ return a.localeCompare(b);
+ }
+
+ completions.sort(compare);
+
+ completionController.updateCompletions(completions, implicitSuffix);
+ }
+ },
+
+ // Private
+
+ _clearLastProperties: function()
+ {
+ if (this._clearLastPropertiesTimeout) {
+ clearTimeout(this._clearLastPropertiesTimeout);
+ delete this._clearLastPropertiesTimeout;
+ }
+
+ // Clear the cache of property names so any changes while stepping or sitting idle get picked up if the same
+ // expression is evaluated again.
+ this._lastPropertyNames = null;
+ }
+};
+
+WebInspector.JavaScriptRuntimeCompletionProvider.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersLayerTreeManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,160 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeManager = function() {
+ WebInspector.Object.call(this);
+
+ this._supported = !!window.LayerTreeAgent;
+
+ if (this._supported)
+ LayerTreeAgent.enable();
+};
+
+WebInspector.LayerTreeManager.Event = {
+ LayerTreeDidChange: "layer-tree-did-change"
+};
+
+WebInspector.LayerTreeManager.prototype = {
+ constructor: WebInspector.LayerTreeManager,
+
+ // Public
+
+ get supported()
+ {
+ return this._supported;
+ },
+
+ layerTreeMutations: function(previousLayers, newLayers)
+ {
+ console.assert(this.supported);
+
+ if (isEmptyObject(previousLayers)) {
+ return {
+ preserved: [],
+ additions: newLayers,
+ removals: []
+ };
+ }
+
+ function nodeIdForLayer(layer)
+ {
+ return layer.isGeneratedContent ? layer.pseudoElementId : layer.nodeId;
+ }
+
+ var layerIdsInPreviousLayers = [];
+ var nodeIdsInPreviousLayers = [];
+ var nodeIdsForReflectionsInPreviousLayers = [];
+
+ previousLayers.forEach(function(layer) {
+ layerIdsInPreviousLayers.push(layer.layerId);
+
+ var nodeId = nodeIdForLayer(layer);
+ if (!nodeId)
+ return;
+
+ if (layer.isReflection)
+ nodeIdsForReflectionsInPreviousLayers.push(nodeId);
+ else
+ nodeIdsInPreviousLayers.push(nodeId);
+ });
+
+ var preserved = [];
+ var additions = [];
+
+ var layerIdsInNewLayers = [];
+ var nodeIdsInNewLayers = [];
+ var nodeIdsForReflectionsInNewLayers = [];
+
+ newLayers.forEach(function(layer) {
+ layerIdsInNewLayers.push(layer.layerId);
+
+ var existed = layerIdsInPreviousLayers.contains(layer.layerId);
+
+ var nodeId = nodeIdForLayer(layer);
+ if (!nodeId)
+ return;
+
+ if (layer.isReflection) {
+ nodeIdsForReflectionsInNewLayers.push(nodeId);
+ existed = existed || nodeIdsForReflectionsInPreviousLayers.contains(nodeId);
+ } else {
+ nodeIdsInNewLayers.push(nodeId);
+ existed = existed || nodeIdsInPreviousLayers.contains(nodeId);
+ }
+
+ if (existed)
+ preserved.push(layer);
+ else
+ additions.push(layer);
+ });
+
+ var removals = previousLayers.filter(function(layer) {
+ var nodeId = nodeIdForLayer(layer);
+
+ if (layer.isReflection)
+ return !nodeIdsForReflectionsInNewLayers.contains(nodeId);
+ else
+ return !nodeIdsInNewLayers.contains(nodeId) && !layerIdsInNewLayers.contains(layer.layerId);
+ });
+
+ return {
+ preserved: preserved,
+ additions: additions,
+ removals: removals
+ };
+ },
+
+ layersForNode: function(node, callback)
+ {
+ console.assert(this.supported);
+
+ LayerTreeAgent.layersForNode(node.id, function(error, layers) {
+ if (error || isEmptyObject(layers)) {
+ callback(null, []);
+ return;
+ }
+
+ var firstLayer = layers[0];
+ var layerForNode = firstLayer.nodeId === node.id && !firstLayer.isGeneratedContent ? layers.shift() : null;
+ callback(layerForNode, layers);
+ }.bind(this));
+ },
+
+ reasonsForCompositingLayer: function(layer, callback)
+ {
+ console.assert(this.supported);
+
+ LayerTreeAgent.reasonsForCompositingLayer(layer.layerId, function(error, reasons) {
+ callback(error ? 0 : reasons);
+ });
+ },
+
+ layerTreeDidChange: function()
+ {
+ this.dispatchEventToListeners(WebInspector.LayerTreeManager.Event.LayerTreeDidChange);
+ }
+};
+
+WebInspector.LayerTreeManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersLegacyProfileManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/LegacyProfileManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/LegacyProfileManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/LegacyProfileManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,182 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileManager = function()
+{
+ WebInspector.Object.call(this);
+
+ this._javaScriptProfileType = new WebInspector.LegacyJavaScriptProfileType;
+
+ if (window.ProfilerAgent) {
+ ProfilerAgent.enable();
+ ProfilerAgent.getProfileHeaders();
+ }
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ this.initialize();
+};
+
+WebInspector.LegacyProfileManager.Event = {
+ ProfileWasAdded: "profile-manager-profile-was-added",
+ ProfileWasUpdated: "profile-manager-profile-was-updated",
+ ProfilingStarted: "profile-manager-profiling-started",
+ ProfilingEnded: "profile-manager-profiling-ended",
+ ProfilingInterrupted: "profile-manager-profiling-interrupted",
+ Cleared: "profile-manager-cleared"
+};
+
+WebInspector.LegacyProfileManager.UserInitiatedProfileName = "org.webkit.profiles.user-initiated";
+
+WebInspector.LegacyProfileManager.prototype = {
+ constructor: WebInspector.LegacyProfileManager,
+
+ // Public
+
+ initialize: function()
+ {
+ this._checkForInterruptions();
+
+ this._recordingJavaScriptProfile = null;
+
+ this._isProfiling = false;
+
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.Cleared);
+ },
+
+ isProfilingJavaScript: function()
+ {
+ return this._javaScriptProfileType.isRecordingProfile();
+ },
+
+ startProfilingJavaScript: function()
+ {
+ this._javaScriptProfileType.startRecordingProfile();
+ },
+
+ stopProfilingJavaScript: function()
+ {
+ this._javaScriptProfileType.stopRecordingProfile();
+ },
+
+ profileWasStartedFromConsole: function(title)
+ {
+ this.setRecordingJavaScriptProfile(true, true);
+
+ if (title.indexOf(WebInspector.LegacyProfileManager.UserInitiatedProfileName) === -1) {
+ this._recordingJavaScriptProfile.title = title;
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
+ }
+ },
+
+ profileWasEndedFromConsole: function()
+ {
+ this.setRecordingJavaScriptProfile(false, true);
+ },
+
+ addJavaScriptProfile: function(profile)
+ {
+ console.assert(this._recordingJavaScriptProfile);
+ if (!this._recordingJavaScriptProfile)
+ return;
+
+ this._recordingJavaScriptProfile.type = profile.typeId;
+ this._recordingJavaScriptProfile.title = profile.title;
+ this._recordingJavaScriptProfile.id = profile.uid;
+ this._recordingJavaScriptProfile.recording = false;
+
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
+
+ // We want to reset _recordingJavaScriptProfile so that we can identify
+ // interruptions, but we also want to keep track of the last profile
+ // we've recorded so that we can provide it as data to the ProfilingEnded event
+ // we'll dispatch in setRecordingJavaScriptProfile().
+ this._lastJavaScriptProfileAdded = this._recordingJavaScriptProfile;
+ this._recordingJavaScriptProfile = null;
+ },
+
+ setRecordingJavaScriptProfile: function(isProfiling, fromConsole)
+ {
+ if (this._isProfiling === isProfiling)
+ return;
+
+ this._isProfiling = isProfiling;
+
+ // We've interrupted the current JS profile due to a page reload. Return
+ // now and _attemptToResumeProfiling will pick things up after the reload.
+ if (!isProfiling && !!this._recordingJavaScriptProfile)
+ return;
+
+ if (isProfiling && !this._recordingJavaScriptProfile)
+ this._recordingJavaScriptProfile = new WebInspector.LegacyJavaScriptProfileObject(WebInspector.LegacyProfileManager.UserInitiatedProfileName, -1, true);
+
+ if (isProfiling) {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasAdded, {profile: this._recordingJavaScriptProfile});
+ if (!fromConsole)
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingStarted);
+ } else {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingEnded, {
+ profile: this._lastJavaScriptProfileAdded,
+ fromConsole: fromConsole
+ });
+ this._lastJavaScriptProfileAdded = null;
+ }
+ },
+
+ // Private
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ var oldMainResource = event.data.oldMainResource;
+ var newMainResource = event.target.mainResource;
+ if (oldMainResource.url !== newMainResource.url)
+ this.initialize();
+ else
+ this._attemptToResumeProfiling();
+ },
+
+ _checkForInterruptions: function()
+ {
+ if (this._recordingJavaScriptProfile) {
+ this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
+ this._javaScriptProfileType.setRecordingProfile(false);
+ }
+ },
+
+ _attemptToResumeProfiling: function()
+ {
+ this._checkForInterruptions();
+
+ if (this._recordingJavaScriptProfile)
+ this.startProfilingJavaScript();
+ }
+};
+
+WebInspector.LegacyProfileManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersLogManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLogManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogManager = function()
+{
+ WebInspector.Object.call(this);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+}
+
+WebInspector.LogManager.Event = {
+ SessionStarted: "log-manager-session-was-started",
+ Cleared: "log-manager-cleared",
+ MessageAdded: "log-manager-message-added",
+ ActiveLogCleared: "log-manager-current-log-cleared",
+ PreviousMessageRepeatCountUpdated: "log-manager-previous-message-repeat-count-updated"
+};
+
+WebInspector.LogManager.prototype = {
+ constructor: WebInspector.LogManager,
+
+ // Public
+
+ messageWasAdded: function(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, requestId)
+ {
+ // Called from WebInspector.ConsoleObserver.
+
+ // FIXME: Pass a request. We need a way to get it from the request ID.
+ var consoleMessage = WebInspector.ConsoleMessage.create(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, null);
+
+ this.dispatchEventToListeners(WebInspector.LogManager.Event.MessageAdded, {message: consoleMessage});
+
+ console.assert(!consoleMessage._element || !consoleMessage._element.parentNode, "This console message shouldn't be added to a view. To add it you need to use clone().");
+ },
+
+ messagesCleared: function()
+ {
+ // Called from WebInspector.ConsoleObserver.
+
+ // We don't want to clear messages on reloads. We can't determine that easily right now.
+ // FIXME: <rdar://problem/13767079> Console.messagesCleared should include a reason
+ this._shouldClearMessages = true;
+ setTimeout(function() {
+ if (this._shouldClearMessages)
+ this.dispatchEventToListeners(WebInspector.LogManager.Event.ActiveLogCleared);
+ delete this._shouldClearMessages;
+ }.bind(this), 0);
+ },
+
+ messageRepeatCountUpdated: function(count)
+ {
+ // Called from WebInspector.ConsoleObserver.
+
+ this.dispatchEventToListeners(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, {count: count});
+ },
+
+ requestClearMessages: function()
+ {
+ ConsoleAgent.clearMessages();
+ },
+
+ // Private
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (!event.target.isMainFrame())
+ return;
+
+ var oldMainResource = event.data.oldMainResource;
+ var newMainResource = event.target.mainResource;
+ if (oldMainResource.url !== newMainResource.url)
+ this.dispatchEventToListeners(WebInspector.LogManager.Event.Cleared);
+ else
+ this.dispatchEventToListeners(WebInspector.LogManager.Event.SessionStarted);
+
+ delete this._shouldClearMessages;
+ }
+};
+
+WebInspector.LogManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersProbeManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/ProbeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,176 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeManager = function()
+{
+ WebInspector.Object.call(this);
+
+ // Used to detect deleted probe actions.
+ this._knownProbeIdentifiersForBreakpoint = new Map;
+
+ // Main lookup tables for probes and probe sets.
+ this._probesByIdentifier = new Map;
+ this._probeSetsByBreakpoint = new Map;
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointActionsChanged, this);
+
+ // Saved breakpoints should not be restored on the first event loop turn, because it
+ // makes manager initialization order very fragile. No breakpoints should be available.
+ console.assert(!WebInspector.debuggerManager.breakpoints.length, "No breakpoints should exist before all the managers are constructed.");
+}
+
+WebInspector.ProbeManager.Event = {
+ ProbeSetAdded: "probe-manager-probe-set-added",
+ ProbeSetRemoved: "probe-manager-probe-set-removed",
+};
+
+WebInspector.ProbeManager.prototype = {
+ constructor: WebInspector.ProbeManager,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get probeSets()
+ {
+ var sets = [];
+ for (var set of this._probeSetsByBreakpoint.values())
+ sets.push(set);
+
+ return sets;
+ },
+
+ // Protected (called by WebInspector.DebuggerObserver)
+
+ didSampleProbe: function(sample)
+ {
+ console.assert(this._probesByIdentifier.has(sample.probeId), "Unknown probe identifier specified for sample: ", sample);
+ var probe = this._probesByIdentifier.get(sample.probeId);
+ probe.addSample(new WebInspector.ProbeSample(sample.sampleId, sample.batchId, sample.timestamp, sample.payload));
+ },
+
+ // Private
+
+ _breakpointAdded: function(breakpointOrEvent)
+ {
+ var breakpoint;
+ if (breakpointOrEvent instanceof WebInspector.Breakpoint)
+ breakpoint = breakpointOrEvent;
+ else
+ breakpoint = breakpointOrEvent.data.breakpoint;
+
+ console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown object passed as breakpoint: ", breakpoint);
+
+ if (this._knownProbeIdentifiersForBreakpoint.has(breakpoint))
+ return;
+
+ this._knownProbeIdentifiersForBreakpoint.set(breakpoint, new Set);
+
+ this._breakpointActionsChanged(breakpoint);
+ },
+
+ _breakpointRemoved: function(event)
+ {
+ var breakpoint = event.data.breakpoint;
+ console.assert(this._knownProbeIdentifiersForBreakpoint.has(breakpoint));
+
+ this._breakpointActionsChanged(breakpoint);
+ this._knownProbeIdentifiersForBreakpoint.delete(breakpoint);
+ },
+
+ _breakpointActionsChanged: function(breakpointOrEvent)
+ {
+ var breakpoint;
+ if (breakpointOrEvent instanceof WebInspector.Breakpoint)
+ breakpoint = breakpointOrEvent;
+ else
+ breakpoint = breakpointOrEvent.target;
+
+ console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown object passed as breakpoint: ", breakpoint);
+
+ // Sometimes actions change before the added breakpoint is fully dispatched.
+ if (!this._knownProbeIdentifiersForBreakpoint.has(breakpoint)) {
+ this._breakpointAdded(breakpoint);
+ return;
+ }
+
+ var knownProbeIdentifiers = this._knownProbeIdentifiersForBreakpoint.get(breakpoint);
+ var seenProbeIdentifiers = new Set;
+
+ breakpoint.probeActions.forEach(function(probeAction) {
+ var probeIdentifier = probeAction.id;
+ console.assert(probeIdentifier, "Probe added without breakpoint action identifier: ", breakpoint);
+
+ seenProbeIdentifiers.add(probeIdentifier);
+ if (!knownProbeIdentifiers.has(probeIdentifier)) {
+ // New probe; find or create relevant probe set.
+ knownProbeIdentifiers.add(probeIdentifier);
+ var probeSet = this._probeSetForBreakpoint(breakpoint);
+ var newProbe = new WebInspector.Probe(probeIdentifier, breakpoint, probeAction.data);
+ this._probesByIdentifier.set(probeIdentifier, newProbe);
+ probeSet.addProbe(newProbe);
+ return;
+ }
+
+ var probe = this._probesByIdentifier.get(probeIdentifier);
+ console.assert(probe, "Probe known but couldn't be found by identifier: ", probeIdentifier);
+ // Update probe expression; if it differed, change events will fire.
+ probe.expression = probeAction.data;
+ }, this);
+
+ // Look for missing probes based on what we saw last.
+ knownProbeIdentifiers.forEach(function(probeIdentifier) {
+ if (seenProbeIdentifiers.has(probeIdentifier))
+ return;
+
+ // The probe has gone missing, remove it.
+ var probeSet = this._probeSetForBreakpoint(breakpoint);
+ var probe = this._probesByIdentifier.get(probeIdentifier);
+ this._probesByIdentifier.delete(probeIdentifier);
+ knownProbeIdentifiers.delete(probeIdentifier);
+ probeSet.removeProbe(probe);
+
+ // Remove the probe set if it has become empty.
+ if (!probeSet.probes.length) {
+ this._probeSetsByBreakpoint.delete(probeSet.breakpoint);
+ probeSet.willRemove();
+ this.dispatchEventToListeners(WebInspector.ProbeManager.Event.ProbeSetRemoved, {probeSet: probeSet});
+ }
+ }, this);
+ },
+
+ _probeSetForBreakpoint: function(breakpoint)
+ {
+ if (this._probeSetsByBreakpoint.has(breakpoint))
+ return this._probeSetsByBreakpoint.get(breakpoint);
+
+ var newProbeSet = new WebInspector.ProbeSet(breakpoint);
+ this._probeSetsByBreakpoint.set(breakpoint, newProbeSet);
+ this.dispatchEventToListeners(WebInspector.ProbeManager.Event.ProbeSetAdded, {probeSet: newProbeSet});
+ return newProbeSet;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersRuntimeManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceRuntimeManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RuntimeManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RuntimeManager = function()
+{
+ WebInspector.Object.call(this);
+
+ // Enable the RuntimeAgent to receive notification of execution contexts.
+ if (RuntimeAgent.enable)
+ RuntimeAgent.enable();
+};
+
+WebInspector.RuntimeManager.Event = {
+ DidEvaluate: "runtime-manager-did-evaluate"
+};
+
+WebInspector.RuntimeManager.prototype = {
+ constructor: WebInspector.RuntimeManager,
+
+ // Public
+
+ evaluateInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, callback)
+ {
+ if (!expression) {
+ // There is no expression, so the completion should happen against global properties.
+ expression = "this";
+ }
+
+ function evalCallback(error, result, wasThrown)
+ {
+ this.dispatchEventToListeners(WebInspector.RuntimeManager.Event.DidEvaluate);
+
+ if (error) {
+ console.error(error);
+ callback(null, false);
+ return;
+ }
+
+ if (returnByValue)
+ callback(null, wasThrown, wasThrown ? null : result);
+ else
+ callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
+ }
+
+ if (WebInspector.debuggerManager.activeCallFrame) {
+ DebuggerAgent.evaluateOnCallFrame(WebInspector.debuggerManager.activeCallFrame.id, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, evalCallback.bind(this));
+ return;
+ }
+
+ // COMPATIBILITY (iOS 6): Execution context identifiers (contextId) did not exist
+ // in iOS 6. Fallback to including the frame identifier (frameId).
+ var contextId = WebInspector.quickConsole.executionContextIdentifier;
+ RuntimeAgent.evaluate.invoke({expression: expression, objectGroup: objectGroup, includeCommandLineAPI: includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole: doNotPauseOnExceptionsAndMuteConsole, contextId: contextId, frameId: contextId, returnByValue: returnByValue}, evalCallback.bind(this));
+ },
+
+ getPropertiesForRemoteObject: function(objectId, callback)
+ {
+ RuntimeAgent.getProperties(objectId, function(error, result) {
+ if (error) {
+ callback(error);
+ return;
+ }
+
+ var properties = new Map;
+ for (var property of result)
+ properties.set(property.name, property);
+
+ callback(null, properties);
+ });
+ }
+};
+
+WebInspector.RuntimeManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersSourceMapManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceMapManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceMapManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapManager = function()
+{
+ WebInspector.Object.call(this);
+
+ this._sourceMapURLMap = {};
+ this._downloadingSourceMaps = {};
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+};
+
+WebInspector.SourceMapManager.prototype = {
+ constructor: WebInspector.SourceMapManager,
+
+ // Public
+
+ sourceMapForURL: function(sourceMapURL)
+ {
+ return this._sourceMapURLMap[sourceMapURL];
+ },
+
+ downloadSourceMap: function(sourceMapURL, baseURL, originalSourceCode)
+ {
+ sourceMapURL = absoluteURL(sourceMapURL, baseURL);
+ if (!sourceMapURL)
+ return;
+
+ console.assert(originalSourceCode.url);
+ if (!originalSourceCode.url)
+ return;
+
+ // FIXME: <rdar://problem/13265694> Source Maps: Better handle when multiple resources reference the same SourceMap
+
+ if (sourceMapURL in this._sourceMapURLMap)
+ return;
+
+ if (sourceMapURL in this._downloadingSourceMaps)
+ return;
+
+ this._loadAndParseSourceMap(sourceMapURL, baseURL, originalSourceCode);
+ },
+
+ // Private
+
+ _loadAndParseSourceMap: function(sourceMapURL, baseURL, originalSourceCode)
+ {
+ this._downloadingSourceMaps[sourceMapURL] = true;
+
+ // FIXME: <rdar://problem/13238886> Source Maps: Frontend needs asynchronous resource loading of content + mime type
+ var response = InspectorFrontendHost.loadResourceSynchronously(sourceMapURL);
+ if (response === undefined) {
+ this._loadAndParseFailed(sourceMapURL);
+ return;
+ }
+
+ if (response.slice(0, 3) === ")]}") {
+ var firstNewlineIndex = response.indexOf("\n");
+ if (firstNewlineIndex === -1) {
+ this._loadAndParseFailed(sourceMapURL);
+ return;
+ }
+ response = response.substring(firstNewlineIndex);
+ }
+
+ try {
+ var payload = JSON.parse(response);
+ var baseURL = sourceMapURL.startsWith("data:") ? originalSourceCode.url : sourceMapURL;
+ var sourceMap = new WebInspector.SourceMap(baseURL, payload, originalSourceCode);
+ this._loadAndParseSucceeded(sourceMapURL, sourceMap);
+ } catch(e) {
+ console.error(e.message);
+ this._loadAndParseFailed(sourceMapURL);
+ }
+ },
+
+ _loadAndParseFailed: function(sourceMapURL)
+ {
+ delete this._downloadingSourceMaps[sourceMapURL];
+ },
+
+ _loadAndParseSucceeded: function(sourceMapURL, sourceMap)
+ {
+ if (!(sourceMapURL in this._downloadingSourceMaps))
+ return;
+
+ delete this._downloadingSourceMaps[sourceMapURL];
+
+ this._sourceMapURLMap[sourceMapURL] = sourceMap;
+
+ var sources = sourceMap.sources();
+ for (var i = 0; i < sources.length; ++i) {
+ var sourceMapResource = new WebInspector.SourceMapResource(sources[i], sourceMap);
+ sourceMap.addResource(sourceMapResource);
+ }
+
+ // Associate the SourceMap with the originalSourceCode.
+ sourceMap.originalSourceCode.addSourceMap(sourceMap);
+
+ // If the originalSourceCode was not a Resource, be sure to also associate with the Resource if one exists.
+ // FIXME: We should try to use the right frame instead of a global lookup by URL.
+ if (!(sourceMap.originalSourceCode instanceof WebInspector.Resource)) {
+ console.assert(sourceMap.originalSourceCode instanceof WebInspector.Script);
+ var resource = sourceMap.originalSourceCode.resource;
+ if (resource)
+ resource.addSourceMap(sourceMap);
+ }
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ if (!event.target.isMainFrame())
+ return;
+
+ this._sourceMapURLMap = {};
+ this._downloadingSourceMaps = {};
+ }
+};
+
+WebInspector.SourceMapManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersStorageManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceStorageManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/StorageManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,308 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StorageManager = function()
+{
+ WebInspector.Object.call(this);
+
+ if (window.DOMStorageAgent)
+ DOMStorageAgent.enable();
+ if (window.DatabaseAgent)
+ DatabaseAgent.enable();
+ if (window.IndexedDBAgent)
+ IndexedDBAgent.enable();
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ // COMPATIBILITY (iOS 6): DOMStorage was discovered via a DOMStorageObserver event. Now DOM Storage
+ // is added whenever a new securityOrigin is discovered. Check for DOMStorageAgent.getDOMStorageItems,
+ // which was renamed at the same time the change to start using securityOrigin was made.
+ if (window.DOMStorageAgent && DOMStorageAgent.getDOMStorageItems)
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.SecurityOriginDidChange, this._securityOriginDidChange, this);
+
+ this.initialize();
+};
+
+WebInspector.StorageManager.Event = {
+ CookieStorageObjectWasAdded: "storage-manager-cookie-storage-object-was-added",
+ DOMStorageObjectWasAdded: "storage-manager-dom-storage-object-was-added",
+ DOMStorageObjectWasInspected: "storage-dom-object-was-inspected",
+ DatabaseWasAdded: "storage-manager-database-was-added",
+ DatabaseWasInspected: "storage-object-was-inspected",
+ IndexedDatabaseWasAdded: "storage-manager-indexed-database-was-added",
+ Cleared: "storage-manager-cleared"
+};
+
+WebInspector.StorageManager.prototype = {
+ constructor: WebInspector.StorageManager,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ initialize: function()
+ {
+ this._domStorageObjects = [];
+ this._databaseObjects = [];
+ this._indexedDatabases = [];
+ this._cookieStorageObjects = {};
+ },
+
+ domStorageWasAdded: function(id, host, isLocalStorage)
+ {
+ var domStorage = new WebInspector.DOMStorageObject(id, host, isLocalStorage);
+
+ this._domStorageObjects.push(domStorage);
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, {domStorage: domStorage});
+ },
+
+ databaseWasAdded: function(id, host, name, version)
+ {
+ var database = new WebInspector.DatabaseObject(id, host, name, version);
+
+ this._databaseObjects.push(database);
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.DatabaseWasAdded, {database: database});
+ },
+
+ domStorageWasUpdated: function(id)
+ {
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageWasUpdated, id);
+ },
+
+ itemsCleared: function(storageId)
+ {
+ this._domStorageForIdentifier(storageId).itemsCleared(storageId);
+ },
+
+ itemRemoved: function(storageId, key)
+ {
+ this._domStorageForIdentifier(storageId).itemRemoved(key);
+ },
+
+ itemAdded: function(storageId, key, value)
+ {
+ this._domStorageForIdentifier(storageId).itemAdded(key, value);
+ },
+
+ itemUpdated: function(storageId, key, oldValue, value)
+ {
+ this._domStorageForIdentifier(storageId).itemUpdated(key, oldValue, value);
+ },
+
+ inspectDatabase: function(id)
+ {
+ var database = this._databaseForIdentifier(id);
+ console.assert(database);
+ if (!database)
+ return;
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.DatabaseWasInspected, {database: database});
+ },
+
+ inspectDOMStorage: function(id)
+ {
+ var domStorage = this._domStorageForIdentifier(id);
+ console.assert(domStorage);
+ if (!domStorage)
+ return;
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageObjectWasInspected, {domStorage: domStorage});
+ },
+
+ // Protected
+
+ requestIndexedDatabaseData: function(objectStore, objectStoreIndex, startEntryIndex, maximumEntryCount, callback)
+ {
+ console.assert(window.IndexedDBAgent);
+ console.assert(objectStore);
+ console.assert(callback);
+
+ function processData(error, entryPayloads, moreAvailable)
+ {
+ if (error) {
+ callback(null, false);
+ return;
+ }
+
+ var entries = [];
+
+ for (var entryPayload of entryPayloads) {
+ var entry = {};
+ entry.primaryKey = new WebInspector.RemoteObject.fromPayload(entryPayload.primaryKey);
+ entry.key = new WebInspector.RemoteObject.fromPayload(entryPayload.key);
+ entry.value = new WebInspector.RemoteObject.fromPayload(entryPayload.value);
+ entries.push(entry);
+ }
+
+ callback(entries, moreAvailable);
+ }
+
+ var requestArguments = {
+ securityOrigin: objectStore.parentDatabase.securityOrigin,
+ databaseName: objectStore.parentDatabase.name,
+ objectStoreName: objectStore.name,
+ indexName: objectStoreIndex && objectStoreIndex.name || "",
+ skipCount: startEntryIndex || 0,
+ pageSize: maximumEntryCount || 100
+ };
+
+ IndexedDBAgent.requestData.invoke(requestArguments, processData);
+ },
+
+ // Private
+
+ _domStorageForIdentifier: function(id)
+ {
+ for (var storageObject of this._domStorageObjects) {
+ // The id is an object, so we need to compare the properties using Object.shallowEqual.
+ // COMPATIBILITY (iOS 6): The id was a string. Object.shallowEqual works for both.
+ if (Object.shallowEqual(storageObject.id, id))
+ return storageObject;
+ }
+
+ return null;
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ if (event.target.isMainFrame()) {
+ // If we are dealing with the main frame, we want to clear our list of objects, because we are navigating to a new page.
+ this.initialize();
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.Cleared);
+
+ this._addDOMStorageIfNeeded(event.target);
+ this._addIndexedDBDatabasesIfNeeded(event.target);
+ }
+
+ // Add the host of the frame that changed the main resource to the list of hosts there could be cookies for.
+ var host = parseURL(event.target.url).host;
+ if (!host)
+ return;
+
+ if (this._cookieStorageObjects[host])
+ return;
+
+ this._cookieStorageObjects[host] = new WebInspector.CookieStorageObject(host);
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, {cookieStorage: this._cookieStorageObjects[host]});
+ },
+
+ _addDOMStorageIfNeeded: function(frame)
+ {
+ // Don't show storage if we don't have a security origin (about:blank).
+ if (!frame.securityOrigin || frame.securityOrigin === "://")
+ return;
+
+ // FIXME: Consider passing the other parts of the origin along to domStorageWasAdded.
+
+ var localStorageIdentifier = {securityOrigin: frame.securityOrigin, isLocalStorage: true};
+ if (!this._domStorageForIdentifier(localStorageIdentifier))
+ this.domStorageWasAdded(localStorageIdentifier, frame.mainResource.urlComponents.host, true);
+
+ var sessionStorageIdentifier = {securityOrigin: frame.securityOrigin, isLocalStorage: false};
+ if (!this._domStorageForIdentifier(sessionStorageIdentifier))
+ this.domStorageWasAdded(sessionStorageIdentifier, frame.mainResource.urlComponents.host, false);
+ },
+
+ _addIndexedDBDatabasesIfNeeded: function(frame)
+ {
+ if (!window.IndexedDBAgent)
+ return;
+
+ var securityOrigin = frame.securityOrigin;
+
+ // Don't show storage if we don't have a security origin (about:blank).
+ if (!securityOrigin || securityOrigin === "://")
+ return;
+
+ function processDatabaseNames(error, names)
+ {
+ if (error || !names)
+ return;
+
+ for (var name of names)
+ IndexedDBAgent.requestDatabase(securityOrigin, name, processDatabase.bind(this));
+ }
+
+ function processDatabase(error, databasePayload)
+ {
+ if (error || !databasePayload)
+ return;
+
+ var objectStores = databasePayload.objectStores.map(processObjectStore);
+ var indexedDatabase = new WebInspector.IndexedDatabase(databasePayload.name, securityOrigin, databasePayload.version, objectStores);
+
+ this._indexedDatabases.push(indexedDatabase);
+ this.dispatchEventToListeners(WebInspector.StorageManager.Event.IndexedDatabaseWasAdded, {indexedDatabase: indexedDatabase});
+ }
+
+ function processKeyPath(keyPathPayload)
+ {
+ switch (keyPathPayload.type) {
+ case "null":
+ return null;
+ case "string":
+ return keyPathPayload.string;
+ case "array":
+ return keyPathPayload.array;
+ default:
+ console.error("Unknown KeyPath type:", keyPathPayload.type);
+ return null;
+ }
+ }
+
+ function processObjectStore(objectStorePayload)
+ {
+ var keyPath = processKeyPath(objectStorePayload.keyPath);
+ var indexes = objectStorePayload.indexes.map(processObjectStoreIndex);
+ return new WebInspector.IndexedDatabaseObjectStore(objectStorePayload.name, keyPath, objectStorePayload.autoIncrement, indexes);
+ }
+
+ function processObjectStoreIndex(objectStoreIndexPayload)
+ {
+ var keyPath = processKeyPath(objectStoreIndexPayload.keyPath);
+ return new WebInspector.IndexedDatabaseObjectStoreIndex(objectStoreIndexPayload.name, keyPath, objectStoreIndexPayload.unique, objectStoreIndexPayload.multiEntry);
+ }
+
+ IndexedDBAgent.requestDatabaseNames(securityOrigin, processDatabaseNames.bind(this));
+ },
+
+ _securityOriginDidChange: function(event)
+ {
+ console.assert(event.target instanceof WebInspector.Frame);
+
+ this._addDOMStorageIfNeeded(event.target);
+ this._addIndexedDBDatabasesIfNeeded(event.target);
+ },
+
+ _databaseForIdentifier: function(id)
+ {
+ for (var i = 0; i < this._databaseObjects.length; ++i) {
+ if (this._databaseObjects[i].id === id)
+ return this._databaseObjects[i];
+ }
+
+ return null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineManager.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,521 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineManager = function()
+{
+ WebInspector.Object.call(this);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._startAutoRecording, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
+
+ this._recording = new WebInspector.TimelineRecording;
+ this._recordingEnabled = false;
+};
+
+WebInspector.TimelineManager.Event = {
+ RecordingStarted: "timeline-manager-recording-started",
+ RecordingStopped: "timeline-manager-recording-stopped"
+};
+
+WebInspector.TimelineManager.MaximumAutoRecordDuration = 90000; // 90 seconds
+WebInspector.TimelineManager.MaximumAutoRecordDurationAfterLoadEvent = 10000; // 10 seconds
+WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly = 2000; // 2 seconds
+
+WebInspector.TimelineManager.prototype = {
+ constructor: WebInspector.TimelineManager,
+
+ // Public
+
+ get recording()
+ {
+ return this._recording;
+ },
+
+ get recordingEnabled()
+ {
+ return this._recordingEnabled;
+ },
+
+ startRecording: function()
+ {
+ if (this._recordingEnabled)
+ return;
+
+ this._recordingEnabled = true;
+
+ TimelineAgent.start();
+
+ this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingStarted);
+ },
+
+ stopRecording: function()
+ {
+ if (!this._recordingEnabled)
+ return;
+
+ if (this._stopRecordingTimeout) {
+ clearTimeout(this._stopRecordingTimeout);
+ delete this._stopRecordingTimeout;
+ }
+
+ if (this._deadTimeTimeout) {
+ clearTimeout(this._deadTimeTimeout);
+ delete this._deadTimeTimeout;
+ }
+
+ TimelineAgent.stop();
+
+ this._recordingEnabled = false;
+ this._autoRecordingMainResource = null;
+
+ this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingStopped);
+ },
+
+ eventRecorded: function(originalRecordPayload)
+ {
+ // Called from WebInspector.TimelineObserver.
+
+ if (!this._recordingEnabled)
+ return;
+
+ function processRecord(recordPayload, parentRecordPayload)
+ {
+ // Convert the timestamps to seconds to match the resource timestamps.
+ var startTime = recordPayload.startTime / 1000;
+ var endTime = recordPayload.endTime / 1000;
+
+ var callFrames = this._callFramesFromPayload(recordPayload.stackTrace);
+
+ var significantCallFrame = null;
+ if (callFrames) {
+ for (var i = 0; i < callFrames.length; ++i) {
+ if (callFrames[i].nativeCode)
+ continue;
+ significantCallFrame = callFrames[i];
+ break;
+ }
+ }
+
+ var sourceCodeLocation = significantCallFrame && significantCallFrame.sourceCodeLocation;
+
+ switch (recordPayload.type) {
+ case TimelineAgent.EventType.MarkLoad:
+ console.assert(isNaN(endTime));
+
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(recordPayload.frameId);
+ console.assert(frame);
+ if (!frame)
+ break;
+
+ frame.markLoadEvent(startTime);
+
+ if (!frame.isMainFrame())
+ break;
+
+ var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.LoadEvent);
+ this._recording.addEventMarker(eventMarker);
+
+ this._stopAutoRecordingSoon();
+ break;
+
+ case TimelineAgent.EventType.MarkDOMContent:
+ console.assert(isNaN(endTime));
+
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(recordPayload.frameId);
+ console.assert(frame);
+ if (!frame)
+ break;
+
+ frame.markDOMContentReadyEvent(startTime);
+
+ if (!frame.isMainFrame())
+ break;
+
+ var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.DOMContentEvent);
+ this._recording.addEventMarker(eventMarker);
+ break;
+
+ case TimelineAgent.EventType.ScheduleStyleRecalculation:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles, startTime, startTime, callFrames, sourceCodeLocation));
+ break;
+
+ case TimelineAgent.EventType.RecalculateStyles:
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles, startTime, endTime, callFrames, sourceCodeLocation));
+ break;
+
+ case TimelineAgent.EventType.InvalidateLayout:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout, startTime, startTime, callFrames, sourceCodeLocation));
+ break;
+
+ case TimelineAgent.EventType.Layout:
+ // COMPATIBILITY (iOS 6): Layout records did not contain area properties. This is not exposed via a quad "root".
+ var quad = recordPayload.data.root ? new WebInspector.Quad(recordPayload.data.root) : null;
+ if (quad)
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Layout, startTime, endTime, callFrames, sourceCodeLocation, quad.points[0].x, quad.points[0].y, quad.width, quad.height, quad));
+ else
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Layout, startTime, endTime, callFrames, sourceCodeLocation));
+ break;
+
+ case TimelineAgent.EventType.Paint:
+ // COMPATIBILITY (iOS 6): Paint records data contained x, y, width, height properties. This became a quad "clip".
+ var quad = recordPayload.data.clip ? new WebInspector.Quad(recordPayload.data.clip) : null;
+ if (quad)
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad));
+ else
+ this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.x, recordPayload.data.y, recordPayload.data.width, recordPayload.data.height));
+ break;
+
+ case TimelineAgent.EventType.EvaluateScript:
+ if (!sourceCodeLocation) {
+ var mainFrame = WebInspector.frameResourceManager.mainFrame;
+ var scriptResource = mainFrame.url === recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.url, true);
+ if (scriptResource) {
+ // The lineNumber is 1-based, but we expect 0-based.
+ var lineNumber = recordPayload.data.lineNumber - 1;
+
+ // FIXME: No column number is provided.
+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
+ }
+ }
+
+ var profile = null;
+ if (recordPayload.data.profile)
+ profile = this._profileFromPayload(recordPayload.data.profile);
+
+ switch (parentRecordPayload && parentRecordPayload.type) {
+ case TimelineAgent.EventType.TimerFire:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profile));
+ break;
+ default:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, null, profile));
+ break;
+ }
+
+ break;
+
+ case TimelineAgent.EventType.TimeStamp:
+ var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.TimeStamp);
+ this._recording.addEventMarker(eventMarker);
+ break;
+
+ case TimelineAgent.EventType.FunctionCall:
+ // FunctionCall always happens as a child of another record, and since the FunctionCall record
+ // has useful info we just make the timeline record here (combining the data from both records).
+ if (!parentRecordPayload)
+ break;
+
+ var profile = null;
+ if (recordPayload.data.profile)
+ profile = this._profileFromPayload(recordPayload.data.profile);
+
+ if (!sourceCodeLocation) {
+ var mainFrame = WebInspector.frameResourceManager.mainFrame;
+ var scriptResource = mainFrame.url === recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.scriptName, true);
+ if (scriptResource) {
+ // The lineNumber is 1-based, but we expect 0-based.
+ var lineNumber = recordPayload.data.scriptLine - 1;
+
+ // FIXME: No column number is provided.
+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
+ }
+ }
+
+ switch (parentRecordPayload.type) {
+ case TimelineAgent.EventType.TimerFire:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profile));
+ break;
+ case TimelineAgent.EventType.EventDispatch:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profile));
+ break;
+ case TimelineAgent.EventType.XHRLoad:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "load", profile));
+ break;
+ case TimelineAgent.EventType.XHRReadyStateChange:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "readystatechange", profile));
+ break;
+ case TimelineAgent.EventType.FireAnimationFrame:
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profile));
+ break;
+ }
+
+ break;
+
+ case TimelineAgent.EventType.TimerInstall:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerInstalled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
+ break;
+
+ case TimelineAgent.EventType.TimerRemove:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerRemoved, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
+ break;
+
+ case TimelineAgent.EventType.RequestAnimationFrame:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
+ break;
+
+ case TimelineAgent.EventType.CancelAnimationFrame:
+ console.assert(isNaN(endTime));
+
+ // Pass the startTime as the endTime since this record type has no duration.
+ this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
+ break;
+ }
+ }
+
+ // Iterate over the records tree using a stack. Doing this recursively has
+ // been known to cause a call stack overflow. https://webkit.org/b/79106
+ var stack = [{array: [originalRecordPayload], parent: null, index: 0}];
+ while (stack.length) {
+ var entry = stack.lastValue;
+ var recordPayloads = entry.array;
+ var parentRecordPayload = entry.parent;
+
+ if (entry.index < recordPayloads.length) {
+ var recordPayload = recordPayloads[entry.index];
+
+ processRecord.call(this, recordPayload, parentRecordPayload);
+
+ if (recordPayload.children)
+ stack.push({array: recordPayload.children, parent: recordPayload, index: 0});
+ ++entry.index;
+ } else
+ stack.pop();
+ }
+ },
+
+ pageDidLoad: function(timestamp)
+ {
+ if (isNaN(WebInspector.frameResourceManager.mainFrame.loadEventTimestamp))
+ WebInspector.frameResourceManager.mainFrame.markLoadEvent(timestamp);
+ },
+
+ // Private
+
+ _profileFromPayload: function(payload)
+ {
+ if (!payload)
+ return null;
+
+ console.assert(payload.rootNodes instanceof Array);
+
+ function profileNodeFromPayload(nodePayload)
+ {
+ console.assert("id" in nodePayload);
+ console.assert(nodePayload.calls instanceof Array);
+
+ if (nodePayload.url) {
+ var sourceCode = WebInspector.frameResourceManager.resourceForURL(nodePayload.url);
+ if (!sourceCode)
+ sourceCode = WebInspector.debuggerManager.scriptsForURL(nodePayload.url)[0];
+
+ // The lineNumber is 1-based, but we expect 0-based.
+ var lineNumber = nodePayload.lineNumber - 1;
+
+ var sourceCodeLocation = sourceCode ? sourceCode.createSourceCodeLocation(lineNumber, nodePayload.columnNumber) : null;
+ }
+
+ var isProgramCode = nodePayload.functionName === "(program)";
+ var isAnonymousFunction = nodePayload.functionName === "(anonymous function)";
+
+ var type = isProgramCode ? WebInspector.ProfileNode.Type.Program : WebInspector.ProfileNode.Type.Function;
+ var functionName = !isProgramCode && !isAnonymousFunction && nodePayload.functionName !== "(unknown)" ? nodePayload.functionName : null;
+ var calls = nodePayload.calls.map(profileNodeCallFromPayload);
+
+ return new WebInspector.ProfileNode(nodePayload.id, type, functionName, sourceCodeLocation, calls, nodePayload.children);
+ }
+
+ function profileNodeCallFromPayload(nodeCallPayload)
+ {
+ console.assert("startTime" in nodeCallPayload);
+ console.assert("totalTime" in nodeCallPayload);
+
+ return new WebInspector.ProfileNodeCall(nodeCallPayload.startTime, nodeCallPayload.totalTime);
+ }
+
+ var rootNodes = payload.rootNodes;
+
+ // Iterate over the node tree using a stack. Doing this recursively can easily cause a stack overflow.
+ // We traverse the profile in post-order and convert the payloads in place until we get back to the root.
+ var stack = [{parent: {children: rootNodes}, index: 0, root: true}];
+ while (stack.length) {
+ var entry = stack.lastValue;
+
+ if (entry.index < entry.parent.children.length) {
+ var childNodePayload = entry.parent.children[entry.index];
+ if (childNodePayload.children && childNodePayload.children.length)
+ stack.push({parent: childNodePayload, index: 0});
+
+ ++entry.index;
+ } else {
+ if (!entry.root)
+ entry.parent.children = entry.parent.children.map(profileNodeFromPayload);
+ else
+ rootNodes = rootNodes.map(profileNodeFromPayload);
+
+ stack.pop();
+ }
+ }
+
+ return new WebInspector.Profile(rootNodes, payload.idleTime);
+ },
+
+ _callFramesFromPayload: function(payload)
+ {
+ if (!payload)
+ return null;
+
+ function createCallFrame(payload)
+ {
+ var url = payload.url;
+ var nativeCode = false;
+
+ if (url === "[native code]") {
+ nativeCode = true;
+ url = null;
+ }
+
+ var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
+ if (!sourceCode)
+ sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
+
+ // The lineNumber is 1-based, but we expect 0-based.
+ var lineNumber = payload.lineNumber - 1;
+
+ var sourceCodeLocation = sourceCode ? sourceCode.createSourceCodeLocation(lineNumber, payload.columnNumber) : null;
+ var functionName = payload.functionName !== "global code" ? payload.functionName : null;
+
+ return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode);
+ }
+
+ return payload.map(createCallFrame);
+ },
+
+ _addRecord: function(record)
+ {
+ this._recording.addRecord(record);
+
+ // Only worry about dead time after the load event.
+ if (!isNaN(WebInspector.frameResourceManager.mainFrame.loadEventTimestamp))
+ this._resetAutoRecordingDeadTimeTimeout();
+ },
+
+ _startAutoRecording: function(event)
+ {
+ if (!event.target.isMainFrame() || (this._recordingEnabled && !this._autoRecordingMainResource))
+ return false;
+
+ var mainResource = event.target.provisionalMainResource || event.target.mainResource;
+ if (mainResource === this._autoRecordingMainResource)
+ return false;
+
+ this.stopRecording();
+
+ this._autoRecordingMainResource = mainResource;
+
+ this._recording.reset();
+
+ this.startRecording();
+
+ this._addRecord(new WebInspector.ResourceTimelineRecord(mainResource));
+
+ if (this._stopRecordingTimeout)
+ clearTimeout(this._stopRecordingTimeout);
+ this._stopRecordingTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.MaximumAutoRecordDuration);
+
+ return true;
+ },
+
+ _stopAutoRecordingSoon: function()
+ {
+ // Only auto stop when auto recording.
+ if (!this._recordingEnabled || !this._autoRecordingMainResource)
+ return;
+
+ if (this._stopRecordingTimeout)
+ clearTimeout(this._stopRecordingTimeout);
+ this._stopRecordingTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.MaximumAutoRecordDurationAfterLoadEvent);
+ },
+
+ _resetAutoRecordingDeadTimeTimeout: function()
+ {
+ // Only monitor dead time when auto recording.
+ if (!this._recordingEnabled || !this._autoRecordingMainResource)
+ return;
+
+ if (this._deadTimeTimeout)
+ clearTimeout(this._deadTimeTimeout);
+ this._deadTimeTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly);
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ // Ignore resource events when there isn't a main frame yet. Those events are triggered by
+ // loading the cached resources when the inspector opens, and they do not have timing information.
+ if (!WebInspector.frameResourceManager.mainFrame)
+ return;
+
+ if (this._startAutoRecording(event))
+ return;
+
+ if (!this._recordingEnabled)
+ return;
+
+ var mainResource = event.target.mainResource;
+ if (mainResource === this._autoRecordingMainResource)
+ return;
+
+ this._addRecord(new WebInspector.ResourceTimelineRecord(mainResource));
+ },
+
+ _resourceWasAdded: function(event)
+ {
+ // Ignore resource events when there isn't a main frame yet. Those events are triggered by
+ // loading the cached resources when the inspector opens, and they do not have timing information.
+ if (!WebInspector.frameResourceManager.mainFrame)
+ return;
+
+ if (!this._recordingEnabled)
+ return;
+
+ this._addRecord(new WebInspector.ResourceTimelineRecord(event.data.resource));
+ }
+};
+
+WebInspector.TimelineManager.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCookieIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CookieIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CookieIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CookieIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.cookie-icon .icon {
- content: -webkit-image-set(url(Images/Cookie.png) 1x, url(Images/Cookie@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.cookie-storage > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,262 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this.element.classList.add(WebInspector.CookieStorageContentView.StyleClassName);
-
- this.update();
-};
-
-WebInspector.CookieStorageContentView.StyleClassName = "cookie-storage";
-
-WebInspector.CookieStorageContentView.prototype = {
- constructor: WebInspector.CookieStorageContentView,
-
- // Public
-
- update: function()
- {
- function callback(error, cookies)
- {
- if (error)
- return;
-
- this._cookies = this._filterCookies(cookies);
- this._rebuildTable();
- }
-
- PageAgent.getCookies(callback.bind(this));
- },
-
- updateLayout: function()
- {
- if (this._dataGrid)
- this._dataGrid.updateLayout();
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.CookieStorage;
- cookie.host = this.representedObject.host;
- },
-
- get scrollableElements()
- {
- if (!this._dataGrid)
- return [];
- return [this._dataGrid.scrollContainer];
- },
-
- // Private
-
- _rebuildTable: function()
- {
- // FIXME: If there are no cookies, do we want to show an empty datagrid, or do something like the old
- // inspector and show some text saying there are no cookies?
- if (!this._dataGrid) {
- var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
- columns[0].title = WebInspector.UIString("Name");
- columns[0].sortable = true;
- columns[0].width = "24%";
- columns[1].title = WebInspector.UIString("Value");
- columns[1].sortable = true;
- columns[1].width = "34%";
- columns[2].title = WebInspector.UIString("Domain");
- columns[2].sortable = true;
- columns[2].width = "7%";
- columns[3].title = WebInspector.UIString("Path");
- columns[3].sortable = true;
- columns[3].width = "7%";
- columns[4].title = WebInspector.UIString("Expires");
- columns[4].sortable = true;
- columns[4].width = "7%";
- columns[5].title = WebInspector.UIString("Size");
- columns[5].aligned = "right";
- columns[5].sortable = true;
- columns[5].width = "7%";
- columns[6].title = WebInspector.UIString("HTTP");
- columns[6].aligned = "centered";
- columns[6].sortable = true;
- columns[6].width = "7%";
- columns[7].title = WebInspector.UIString("Secure");
- columns[7].aligned = "centered";
- columns[7].sortable = true;
- columns[7].width = "7%";
-
- this._dataGrid = new WebInspector.DataGrid(columns, null, this._deleteCallback.bind(this));
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._rebuildTable, this);
-
- this.element.appendChild(this._dataGrid.element);
- this._dataGrid.updateLayout();
- }
-
- console.assert(this._dataGrid);
- this._dataGrid.removeChildren();
-
- this._sortCookies(this._cookies);
-
- for (var i = 0; i < this._cookies.length; ++i) {
- const cookie = this._cookies[i];
-
- var data = {};
- data[0] = cookie.name;
- data[1] = cookie.value;
- data[2] = cookie.domain || "";
- data[3] = cookie.path || "";
-
- if (cookie.type === WebInspector.CookieType.Request)
- data[4] = "";
- else
- data[4] = cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toLocaleString();
-
- data[5] = Number.bytesToString(cookie.size);
- const checkmark = "\u2713";
- data[6] = cookie.httpOnly ? checkmark : "";
- data[7] = cookie.secure ? checkmark : "";
-
- var node = new WebInspector.DataGridNode(data);
- node.cookie = cookie;
- node.selectable = true;
-
- this._dataGrid.appendChild(node);
- }
- },
-
- _filterCookies: function(cookies)
- {
- var filteredCookies = [];
- var resourcesForDomain = [];
-
- var frames = WebInspector.frameResourceManager.frames;
- for (var i = 0; i < frames.length; ++i) {
- var resources = frames[i].resources;
- for (var j = 0; j < resources.length; ++j) {
- var urlComponents = resources[j].urlComponents;
- if (urlComponents && urlComponents.host && urlComponents.host === this.representedObject.host)
- resourcesForDomain.push(resources[j].url);
- }
-
- // The main resource isn't always in the list of resources, make sure to add it to the list of resources
- // we get the URLs from.
- var mainResourceURLComponents = frames[i].mainResource.urlComponents;
- if (mainResourceURLComponents && mainResourceURLComponents.host && mainResourceURLComponents.host == this.representedObject.host)
- resourcesForDomain.push(frames[i].mainResource.url);
- }
-
- for (var i = 0; i < cookies.length; ++i) {
- for (var j = 0; j < resourcesForDomain.length; ++j) {
- if (WebInspector.cookieMatchesResourceURL(cookies[i], resourcesForDomain[j])) {
- filteredCookies.push(cookies[i]);
- break;
- }
- }
- }
-
- return filteredCookies;
- },
-
- _sortCookies: function(cookies)
- {
- var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function localeCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
- }
-
- function numberCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] - cookie2[field]);
- }
-
- function expiresCompare(cookie1, cookie2)
- {
- if (cookie1.session !== cookie2.session)
- return sortDirection * (cookie1.session ? 1 : -1);
-
- if (cookie1.session)
- return 0;
-
- return sortDirection * (cookie1.expires - cookie2.expires);
- }
-
- var comparator;
- switch (parseInt(this._dataGrid.sortColumnIdentifier, 10)) {
- case 0: comparator = localeCompare.bind(this, "name"); break;
- case 1: comparator = localeCompare.bind(this, "value"); break;
- case 2: comparator = localeCompare.bind(this, "domain"); break;
- case 3: comparator = localeCompare.bind(this, "path"); break;
- case 4: comparator = expiresCompare; break;
- case 5: comparator = numberCompare.bind(this, "size"); break;
- case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
- case 7: comparator = localeCompare.bind(this, "secure"); break;
- default: localeCompare.bind(this, "name");
- }
-
- cookies.sort(comparator);
- },
-
- _deleteCallback: function(node)
- {
- if (!node || !node.cookie)
- return;
-
- var cookie = node.cookie;
- var cookieURL = (cookie.secure ? "https://" : "http://") + cookie.domain + cookie.path;
-
- // COMPATIBILITY (iOS 6): PageAgent.deleteCookie used to take 'domain', now takes 'url'. Send both.
- PageAgent.deleteCookie.invoke({cookieName: cookie.name, domain: cookie.domain, url: cookieURL});
-
- this.update();
- }
-};
-
-WebInspector.CookieStorageContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
-
-WebInspector.cookieMatchesResourceURL = function(cookie, resourceURL)
-{
- var parsedURL = parseURL(resourceURL);
- if (!parsedURL || !WebInspector.cookieDomainMatchesResourceDomain(cookie.domain, parsedURL.host))
- return false;
-
- return (parsedURL.path.startsWith(cookie.path)
- && (!cookie.port || parsedURL.port == cookie.port)
- && (!cookie.secure || parsedURL.scheme === "https"));
-}
-
-WebInspector.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain)
-{
- if (cookieDomain.charAt(0) !== '.')
- return resourceDomain === cookieDomain;
- return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)?" + cookieDomain.substring(1).escapeForRegExp() + "$"), "i");
-}
-
-WebInspector.CookieType = {
- Request: 0,
- Response: 1
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCookieStorageObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CookieStorageObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CookieStorageObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CookieStorageObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageObject = function(host)
-{
- this._host = host;
-};
-
-WebInspector.CookieStorageObject.TypeIdentifier = "cookie-storage";
-WebInspector.CookieStorageObject.CookieHostCookieKey = "cookie-storage-host";
-
-WebInspector.CookieStorageObject.prototype = {
- constructor: WebInspector.CookieStorageObject,
-
- get host()
- {
- return this._host;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.CookieStorageObject.CookieHostCookieKey] = this.host;
- }
- // FIXME: This class will need to look up cookies that are set for this host.
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCookieStorageTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CookieStorageTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CookieStorageTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/CookieStorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.CookieStorageObject);
-
- WebInspector.StorageTreeElement.call(this, WebInspector.CookieStorageTreeElement.CookieIconStyleClassName, WebInspector.displayNameForHost(representedObject.host), representedObject);
-};
-
-WebInspector.CookieStorageTreeElement.CookieIconStyleClassName = "cookie-icon";
-
-WebInspector.CookieStorageTreeElement.prototype = {
- constructor: WebInspector.CookieStorageTreeElement,
-
- // Public
-
- get name()
- {
- return this.representedObject.host;
- },
-
- get categoryName()
- {
- return WebInspector.UIString("Cookies");
- }
-};
-
-WebInspector.CookieStorageTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,114 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMDetailsSidebarPanel = function(identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element) {
- WebInspector.DetailsSidebarPanel.call(this, identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element);
-
- this.element.addEventListener("click", this._mouseWasClicked.bind(this), true);
-
- this._domNode = null;
-};
-
-WebInspector.DOMDetailsSidebarPanel.prototype = {
- constructor: WebInspector.DOMDetailsSidebarPanel,
-
- // Public
-
- inspect: function(objects)
- {
- // Convert to a single item array if needed.
- if (!(objects instanceof Array))
- objects = [objects];
-
- var nodeToInspect = null;
-
- // Iterate over the objects to find a WebInspector.DOMNode to inspect.
- for (var i = 0; i < objects.length; ++i) {
- if (objects[i] instanceof WebInspector.DOMNode) {
- nodeToInspect = objects[i];
- break;
- }
- }
-
- if (nodeToInspect && !this.supportsDOMNode(nodeToInspect))
- nodeToInspect = null;
-
- this.domNode = nodeToInspect;
-
- return !!this._domNode;
- },
-
- get domNode()
- {
- return this._domNode;
- },
-
- set domNode(domNode)
- {
- if (domNode === this._domNode)
- return;
-
- if (this._domNode)
- this.removeEventListeners();
-
- this._domNode = domNode;
-
- if (this._domNode)
- this.addEventListeners();
-
- this.needsRefresh();
- },
-
- supportsDOMNode: function(nodeToInspect)
- {
- // Implemented by subclasses.
- return true;
- },
-
- addEventListeners: function()
- {
- // Implemented by subclasses.
- },
-
- removeEventListeners: function()
- {
- // Implemented by subclasses.
- },
-
- // Private
-
- _mouseWasClicked: function(event)
- {
- if (this._domNode && this._domNode.ownerDocument) {
- var mainResource = WebInspector.frameResourceManager.resourceForURL(this._domNode.ownerDocument.documentURL);
- if (mainResource)
- var parentFrame = mainResource.parentFrame;
- }
-
- WebInspector.handlePossibleLinkClick(event, parentFrame);
- }
-};
-
-WebInspector.DOMDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,710 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @constructor
- * @param {WebInspector.DOMAgent} domAgent
- * @param {?WebInspector.DOMNode} doc
- * @param {boolean} isInShadowTree
- * @param {DOMAgent.Node} payload
- */
-WebInspector.DOMNode = function(domAgent, doc, isInShadowTree, payload) {
- WebInspector.Object.call(this);
-
- this._domAgent = domAgent;
- this._isInShadowTree = isInShadowTree;
-
- this.id = payload.nodeId;
- domAgent._idToDOMNode[this.id] = this;
-
- this._nodeType = payload.nodeType;
- this._nodeName = payload.nodeName;
- this._localName = payload.localName;
- this._nodeValue = payload.nodeValue;
-
- if (this._nodeType === Node.DOCUMENT_NODE)
- this.ownerDocument = this;
- else
- this.ownerDocument = doc;
-
- this._attributes = [];
- this._attributesMap = {};
- if (payload.attributes)
- this._setAttributesPayload(payload.attributes);
-
- this._childNodeCount = payload.childNodeCount;
- this._children = null;
- this._filteredChildren = null;
- this._filteredChildrenNeedsUpdating = true;
-
- this._nextSibling = null;
- this._previousSibling = null;
- this.parentNode = null;
-
- this._enabledPseudoClasses = [];
-
- this._shadowRoots = [];
- if (payload.shadowRoots) {
- for (var i = 0; i < payload.shadowRoots.length; ++i) {
- var root = payload.shadowRoots[i];
- var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, true, root);
- this._shadowRoots.push(node);
- }
- }
-
- if (payload.children)
- this._setChildrenPayload(payload.children);
-
- if (payload.contentDocument) {
- this._contentDocument = new WebInspector.DOMNode(domAgent, null, false, payload.contentDocument);
- this._children = [this._contentDocument];
- this._renumber();
- }
-
- if (this._nodeType === Node.ELEMENT_NODE) {
- // HTML and BODY from internal iframes should not overwrite top-level ones.
- if (this.ownerDocument && !this.ownerDocument.documentElement && this._nodeName === "HTML")
- this.ownerDocument.documentElement = this;
- if (this.ownerDocument && !this.ownerDocument.body && this._nodeName === "BODY")
- this.ownerDocument.body = this;
- if (payload.documentURL)
- this.documentURL = payload.documentURL;
- } else if (this._nodeType === Node.DOCUMENT_TYPE_NODE) {
- this.publicId = payload.publicId;
- this.systemId = payload.systemId;
- this.internalSubset = payload.internalSubset;
- } else if (this._nodeType === Node.DOCUMENT_NODE) {
- this.documentURL = payload.documentURL;
- this.xmlVersion = payload.xmlVersion;
- } else if (this._nodeType === Node.ATTRIBUTE_NODE) {
- this.name = payload.name;
- this.value = payload.value;
- }
-}
-
-WebInspector.Object.addConstructorFunctions(WebInspector.DOMNode);
-
-WebInspector.DOMNode.Event = {
- EnabledPseudoClassesChanged: "dom-node-enabled-pseudo-classes-did-change",
- AttributeModified: "dom-node-attribute-modified",
- AttributeRemoved: "dom-node-attribute-removed"
-};
-
-WebInspector.DOMNode.prototype = {
- constructor: WebInspector.DOMNode,
-
- get children()
- {
- if (!this._children)
- return null;
-
- if (WebInspector.showShadowDOMSetting.value)
- return this._children;
-
- if (this._filteredChildrenNeedsUpdating) {
- this._filteredChildrenNeedsUpdating = false;
- this._filteredChildren = this._children.filter(function(node) {
- return !node._isInShadowTree;
- });
- }
-
- return this._filteredChildren;
- },
-
- get firstChild()
- {
- var children = this.children;
-
- if (children && children.length > 0)
- return children[0];
-
- return null;
- },
-
- get lastChild()
- {
- var children = this.children;
-
- if (children && children.length > 0)
- return children.lastValue;
-
- return null;
- },
-
- get nextSibling()
- {
- if (WebInspector.showShadowDOMSetting.value)
- return this._nextSibling;
-
- var node = this._nextSibling;
- while (node) {
- if (!node._isInShadowTree)
- return node;
- node = node._nextSibling;
- }
- return null;
- },
-
- get previousSibling()
- {
- if (WebInspector.showShadowDOMSetting.value)
- return this._previousSibling;
-
- var node = this._previousSibling;
- while (node) {
- if (!node._isInShadowTree)
- return node;
- node = node._previousSibling;
- }
- return null;
- },
-
- get childNodeCount()
- {
- var children = this.children;
- if (children)
- return children.length;
-
- if (WebInspector.showShadowDOMSetting.value)
- return this._childNodeCount + this._shadowRoots.length;
-
- return this._childNodeCount;
- },
-
- set childNodeCount(count)
- {
- this._childNodeCount = count;
- },
-
- /**
- * @return {boolean}
- */
- hasAttributes: function()
- {
- return this._attributes.length > 0;
- },
-
- /**
- * @return {boolean}
- */
- hasChildNodes: function()
- {
- return this.childNodeCount > 0;
- },
-
- /**
- * @return {boolean}
- */
- hasShadowRoots: function()
- {
- return !!this._shadowRoots.length;
- },
-
- /**
- * @return {boolean}
- */
- isInShadowTree: function()
- {
- return this._isInShadowTree;
- },
-
- /**
- * @return {number}
- */
- nodeType: function()
- {
- return this._nodeType;
- },
-
- /**
- * @return {string}
- */
- nodeName: function()
- {
- return this._nodeName;
- },
-
- /**
- * @return {string}
- */
- nodeNameInCorrectCase: function()
- {
- return this.isXMLNode() ? this.nodeName() : this.nodeName().toLowerCase();
- },
-
- /**
- * @param {string} name
- * @param {function()=} callback
- */
- setNodeName: function(name, callback)
- {
- DOMAgent.setNodeName(this.id, name, this._makeUndoableCallback(callback));
- },
-
- /**
- * @return {string}
- */
- localName: function()
- {
- return this._localName;
- },
-
- /**
- * @return {string}
- */
- nodeValue: function()
- {
- return this._nodeValue;
- },
-
- /**
- * @param {string} value
- * @param {function(?Protocol.Error)=} callback
- */
- setNodeValue: function(value, callback)
- {
- DOMAgent.setNodeValue(this.id, value, this._makeUndoableCallback(callback));
- },
-
- /**
- * @param {string} name
- * @return {string}
- */
- getAttribute: function(name)
- {
- var attr = this._attributesMap[name];
- return attr ? attr.value : undefined;
- },
-
- /**
- * @param {string} name
- * @param {string} text
- * @param {function()=} callback
- */
- setAttribute: function(name, text, callback)
- {
- DOMAgent.setAttributesAsText(this.id, text, name, this._makeUndoableCallback(callback));
- },
-
- /**
- * @param {string} name
- * @param {string} value
- * @param {function()=} callback
- */
- setAttributeValue: function(name, value, callback)
- {
- DOMAgent.setAttributeValue(this.id, name, value, this._makeUndoableCallback(callback));
- },
-
- /**
- * @return {Object}
- */
- attributes: function()
- {
- return this._attributes;
- },
-
- /**
- * @param {string} name
- * @param {function()=} callback
- */
- removeAttribute: function(name, callback)
- {
- function mycallback(error, success)
- {
- if (!error) {
- delete this._attributesMap[name];
- for (var i = 0; i < this._attributes.length; ++i) {
- if (this._attributes[i].name === name) {
- this._attributes.splice(i, 1);
- break;
- }
- }
- }
-
- this._makeUndoableCallback(callback)(error);
- }
- DOMAgent.removeAttribute(this.id, name, mycallback.bind(this));
- },
-
- /**
- * @param {function(Array.<WebInspector.DOMNode>)=} callback
- */
- getChildNodes: function(callback)
- {
- if (this.children) {
- if (callback)
- callback(this.children);
- return;
- }
-
- /**
- * @this {WebInspector.DOMNode}
- * @param {?Protocol.Error} error
- */
- function mycallback(error) {
- if (!error && callback)
- callback(this.children);
- }
-
- DOMAgent.requestChildNodes(this.id, mycallback.bind(this));
- },
-
- /**
- * @param {number} depth
- * @param {function(Array.<WebInspector.DOMNode>)=} callback
- */
- getSubtree: function(depth, callback)
- {
- /**
- * @this {WebInspector.DOMNode}
- * @param {?Protocol.Error} error
- */
- function mycallback(error)
- {
- if (callback)
- callback(error ? null : this.children);
- }
-
- DOMAgent.requestChildNodes(this.id, depth, mycallback.bind(this));
- },
-
- /**
- * @param {function(?Protocol.Error)=} callback
- */
- getOuterHTML: function(callback)
- {
- DOMAgent.getOuterHTML(this.id, callback);
- },
-
- /**
- * @param {string} html
- * @param {function(?Protocol.Error)=} callback
- */
- setOuterHTML: function(html, callback)
- {
- DOMAgent.setOuterHTML(this.id, html, this._makeUndoableCallback(callback));
- },
-
- /**
- * @param {function(?Protocol.Error)=} callback
- */
- removeNode: function(callback)
- {
- DOMAgent.removeNode(this.id, this._makeUndoableCallback(callback));
- },
-
- copyNode: function()
- {
- function copy(error, text)
- {
- if (!error)
- InspectorFrontendHost.copyText(text);
- }
- DOMAgent.getOuterHTML(this.id, copy);
- },
-
- /**
- * @param {function(?Protocol.Error)=} callback
- */
- eventListeners: function(callback)
- {
- DOMAgent.getEventListenersForNode(this.id, callback);
- },
-
- accessibilityProperties: function(callback)
- {
- function accessibilityPropertiesCallback(error, accessibilityProperties)
- {
- if (!error && callback && accessibilityProperties) {
- callback({
- exists: accessibilityProperties.exists,
- ignored: accessibilityProperties.ignored,
- ignoredByDefault: accessibilityProperties.ignoredByDefault,
- invalid: accessibilityProperties.invalid,
- hidden: accessibilityProperties.hidden,
- label: accessibilityProperties.label,
- required: accessibilityProperties.required,
- role: accessibilityProperties.role
- });
- }
- }
- DOMAgent.getAccessibilityPropertiesForNode(this.id, accessibilityPropertiesCallback.bind(this));
- },
-
- /**
- * @return {string}
- */
- path: function()
- {
- var path = [];
- var node = this;
- while (node && "index" in node && node._nodeName.length) {
- path.push([node.index, node._nodeName]);
- node = node.parentNode;
- }
- path.reverse();
- return path.join(",");
- },
-
- /**
- * @param {boolean} justSelector
- * @return {string}
- */
- appropriateSelectorFor: function(justSelector)
- {
- var lowerCaseName = this.localName() || this.nodeName().toLowerCase();
-
- var id = this.getAttribute("id");
- if (id) {
- if (/[\s'"]/.test(id)) {
- id = id.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");
- selector = lowerCaseName + "[id=\"" + id + "\"]";
- } else
- selector = "#" + id;
- return (justSelector ? selector : lowerCaseName + selector);
- }
-
- var className = this.getAttribute("class");
- if (className) {
- var selector = "." + className.trim().replace(/\s+/, ".");
- return (justSelector ? selector : lowerCaseName + selector);
- }
-
- if (lowerCaseName === "input" && this.getAttribute("type"))
- return lowerCaseName + "[type=\"" + this.getAttribute("type") + "\"]";
-
- return lowerCaseName;
- },
-
- /**
- * @param {WebInspector.DOMNode} node
- * @return {boolean}
- */
- isAncestor: function(node)
- {
- if (!node)
- return false;
-
- var currentNode = node.parentNode;
- while (currentNode) {
- if (this === currentNode)
- return true;
- currentNode = currentNode.parentNode;
- }
- return false;
- },
-
- /**
- * @param {WebInspector.DOMNode} descendant
- * @return {boolean}
- */
- isDescendant: function(descendant)
- {
- return descendant !== null && descendant.isAncestor(this);
- },
-
- /**
- * @param {Array.<string>} attrs
- */
- _setAttributesPayload: function(attrs)
- {
- this._attributes = [];
- this._attributesMap = {};
- for (var i = 0; i < attrs.length; i += 2)
- this._addAttribute(attrs[i], attrs[i + 1]);
- },
-
- /**
- * @param {WebInspector.DOMNode} prev
- * @param {DOMAgent.Node} payload
- * @return {WebInspector.DOMNode}
- */
- _insertChild: function(prev, payload)
- {
- var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, this._isInShadowTree, payload);
- if (!prev) {
- if (!this._children) {
- // First node
- this._children = this._shadowRoots.concat([node]);
- } else
- this._children.unshift(node);
- } else
- this._children.splice(this._children.indexOf(prev) + 1, 0, node);
- this._renumber();
- return node;
- },
-
- /**
- * @param {WebInspector.DOMNode} node
- */
- _removeChild: function(node)
- {
- this._children.splice(this._children.indexOf(node), 1);
- node.parentNode = null;
- this._renumber();
- },
-
- /**
- * @param {Array.<DOMAgent.Node>} payloads
- */
- _setChildrenPayload: function(payloads)
- {
- // We set children in the constructor.
- if (this._contentDocument)
- return;
-
- this._children = this._shadowRoots.slice();
- for (var i = 0; i < payloads.length; ++i) {
- var payload = payloads[i];
- var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, this._isInShadowTree, payload);
- this._children.push(node);
- }
- this._renumber();
- },
-
- _renumber: function()
- {
- this._filteredChildrenNeedsUpdating = true;
-
- var childNodeCount = this._children.length;
- if (childNodeCount === 0)
- return;
-
- for (var i = 0; i < childNodeCount; ++i) {
- var child = this._children[i];
- child.index = i;
- child._nextSibling = i + 1 < childNodeCount ? this._children[i + 1] : null;
- child._previousSibling = i - 1 >= 0 ? this._children[i - 1] : null;
- child.parentNode = this;
- }
- },
-
- /**
- * @param {string} name
- * @param {string} value
- */
- _addAttribute: function(name, value)
- {
- var attr = {
- name: name,
- value: value,
- _node: this
- };
- this._attributesMap[name] = attr;
- this._attributes.push(attr);
- },
-
- /**
- * @param {string} name
- * @param {string} value
- */
- _setAttribute: function(name, value)
- {
- var attr = this._attributesMap[name];
- if (attr)
- attr.value = value;
- else
- this._addAttribute(name, value);
- },
-
- /**
- * @param {string} name
- */
- _removeAttribute: function(name)
- {
- var attr = this._attributesMap[name];
- if (attr) {
- this._attributes.remove(attr);
- delete this._attributesMap[name];
- }
- },
-
- /**
- * @param {WebInspector.DOMNode} targetNode
- * @param {?WebInspector.DOMNode} anchorNode
- * @param {function(?Protocol.Error)=} callback
- */
- moveTo: function(targetNode, anchorNode, callback)
- {
- DOMAgent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._makeUndoableCallback(callback));
- },
-
- /**
- * @return {boolean}
- */
- isXMLNode: function()
- {
- return !!this.ownerDocument && !!this.ownerDocument.xmlVersion;
- },
-
- get enabledPseudoClasses()
- {
- return this._enabledPseudoClasses;
- },
-
- setPseudoClassEnabled: function(pseudoClass, enabled)
- {
- var pseudoClasses = this._enabledPseudoClasses;
- if (enabled) {
- if (pseudoClasses.contains(pseudoClass))
- return;
- pseudoClasses.push(pseudoClass);
- } else {
- if (!pseudoClasses.contains(pseudoClass))
- return;
- pseudoClasses.remove(pseudoClass);
- }
-
- function changed(error)
- {
- if (!error)
- this.dispatchEventToListeners(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged);
- }
-
- CSSAgent.forcePseudoState(this.id, pseudoClasses, changed.bind(this));
- },
-
- _makeUndoableCallback: function(callback)
- {
- return function(error)
- {
- if (!error)
- DOMAgent.markUndoableState();
-
- if (callback)
- callback.apply(null, arguments);
- };
- }
-}
-
-WebInspector.DOMNode.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMNodeDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,365 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMNodeDetailsSidebarPanel = function() {
- WebInspector.DOMDetailsSidebarPanel.call(this, "dom-node-details", WebInspector.UIString("Node"), WebInspector.UIString("Node"), "Images/NavigationItemAngleBrackets.svg", "2");
-
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._attributesChanged, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._attributesChanged, this);
-
- this.element.classList.add(WebInspector.DOMNodeDetailsSidebarPanel.StyleClassName);
-
- this._identityNodeTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type"));
- this._identityNodeNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name"));
- this._identityNodeValueRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Value"));
-
- var identityGroup = new WebInspector.DetailsSectionGroup([this._identityNodeTypeRow, this._identityNodeNameRow, this._identityNodeValueRow]);
- var identitySection = new WebInspector.DetailsSection("dom-node-identity", WebInspector.UIString("Identity"), [identityGroup]);
-
- this._attributesDataGridRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Attributes"));
-
- var attributesGroup = new WebInspector.DetailsSectionGroup([this._attributesDataGridRow]);
- var attributesSection = new WebInspector.DetailsSection("dom-node-attributes", WebInspector.UIString("Attributes"), [attributesGroup]);
-
- this._propertiesRow = new WebInspector.DetailsSectionRow;
-
- var propertiesGroup = new WebInspector.DetailsSectionGroup([this._propertiesRow]);
- var propertiesSection = new WebInspector.DetailsSection("dom-node-properties", WebInspector.UIString("Properties"), [propertiesGroup]);
-
- this._eventListenersSectionGroup = new WebInspector.DetailsSectionGroup;
- var eventListenersSection = new WebInspector.DetailsSection("dom-node-event-listeners", WebInspector.UIString("Event Listeners"), [this._eventListenersSectionGroup]);
-
- this._accessibilityEmptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Accessibility Information"));
- this._accessibilityNodeIgnoredRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Ignored"));
- this._accessibilityNodeInvalidRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Invalid"));
- this._accessibilityNodeLabelRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Label"));
- this._accessibilityNodeRequiredRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Required"));
- this._accessibilityNodeRoleRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Role"));
-
- this._accessibilityGroup = new WebInspector.DetailsSectionGroup([this._accessibilityEmptyRow]);
- var accessibilitySection = new WebInspector.DetailsSection("dom-node-accessibility", WebInspector.UIString("Accessibility"), [this._accessibilityGroup]);
-
- this.element.appendChild(identitySection.element);
- this.element.appendChild(attributesSection.element);
- this.element.appendChild(propertiesSection.element);
- this.element.appendChild(eventListenersSection.element);
- this.element.appendChild(accessibilitySection.element);
-};
-
-WebInspector.DOMNodeDetailsSidebarPanel.StyleClassName = "dom-node";
-WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName = "dom-node-details-sidebar-properties-object-group";
-
-WebInspector.DOMNodeDetailsSidebarPanel.prototype = {
- constructor: WebInspector.DOMNodeDetailsSidebarPanel,
-
- // Public
-
- refresh: function()
- {
- var domNode = this.domNode;
- if (!domNode)
- return;
-
- this._identityNodeTypeRow.value = this._nodeTypeDisplayName();
- this._identityNodeNameRow.value = domNode.nodeNameInCorrectCase();
- this._identityNodeValueRow.value = domNode.nodeValue();
-
- this._refreshAttributes();
- this._refreshProperties();
- this._refreshEventListeners();
- this._refreshAccessibility();
- },
-
- // Private
-
- _refreshAttributes: function()
- {
- this._attributesDataGridRow.dataGrid = this._createAttributesDataGrid();
- },
-
- _refreshProperties: function()
- {
- var domNode = this.domNode;
- if (!domNode)
- return;
-
- RuntimeAgent.releaseObjectGroup(WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName);
- WebInspector.RemoteObject.resolveNode(domNode, WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName, nodeResolved.bind(this));
-
- function nodeResolved(object)
- {
- if (!object)
- return;
-
- // Bail if the DOM node changed while we were waiting for the async response.
- if (this.domNode !== domNode)
- return;
-
- function collectPrototypes()
- {
- // This builds an object with numeric properties. This is easier than dealing with arrays
- // with the way RemoteObject works. Start at 1 since we use parseInt later and parseInt
- // returns 0 for non-numeric strings make it ambiguous.
- var prototype = this;
- var result = [];
- var counter = 1;
-
- while (prototype) {
- result[counter++] = prototype;
- prototype = prototype.__proto__;
- }
-
- return result;
- }
-
- object.callFunction(collectPrototypes, undefined, nodePrototypesReady.bind(this));
- object.release();
- }
-
- function nodePrototypesReady(object)
- {
- if (!object)
- return;
-
- // Bail if the DOM node changed while we were waiting for the async response.
- if (this.domNode !== domNode)
- return;
-
- object.getOwnProperties(fillSection.bind(this));
- }
-
- function fillSection(prototypes)
- {
- if (!prototypes)
- return;
-
- // Bail if the DOM node changed while we were waiting for the async response.
- if (this.domNode !== domNode)
- return;
-
- var element = this._propertiesRow.element;
- element.removeChildren();
-
- // Get array of prototype user-friendly names.
- for (var i = 0; i < prototypes.length; ++i) {
- // The only values we care about are numeric, as assigned in collectPrototypes.
- if (!parseInt(prototypes[i].name, 10))
- continue;
-
- var prototype = prototypes[i].value;
- var title = prototype.description;
- if (title.match(/Prototype$/))
- title = title.replace(/Prototype$/, WebInspector.UIString(" (Prototype)"));
- else if (title === "Object")
- title = title + WebInspector.UIString(" (Prototype)");
-
- var propertiesSection = new WebInspector.ObjectPropertiesSection(prototype);
-
- var detailsSection = new WebInspector.DetailsSection(prototype.description.hash + "-prototype-properties", title, null, null, true);
- detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(propertiesSection)];
-
- element.appendChild(detailsSection.element);
- }
- }
- },
-
- _refreshEventListeners: function()
- {
- var domNode = this.domNode;
- if (!domNode)
- return;
-
- domNode.eventListeners(eventListenersCallback.bind(this));
-
- function eventListenersCallback(error, eventListeners)
- {
- if (error)
- return;
-
- // Bail if the DOM node changed while we were waiting for the async response.
- if (this.domNode !== domNode)
- return;
-
- var eventListenerTypes = [];
- var eventListenerSections = {};
- for (var i = 0; i < eventListeners.length; ++i) {
- var eventListener = eventListeners[i];
- eventListener.node = WebInspector.domTreeManager.nodeForId(eventListener.nodeId);
-
- var type = eventListener.type;
- var section = eventListenerSections[type];
- if (!section) {
- section = new WebInspector.EventListenerSection(type, domNode.id);
- eventListenerSections[type] = section;
- eventListenerTypes.push(type);
- }
-
- section.addListener(eventListener);
- }
-
- if (!eventListenerTypes.length) {
- var emptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Event Listeners"));
- emptyRow.showEmptyMessage();
- this._eventListenersSectionGroup.rows = [emptyRow];
- return;
- }
-
- eventListenerTypes.sort();
-
- var rows = [];
- for (var i = 0; i < eventListenerTypes.length; ++i)
- rows.push(eventListenerSections[eventListenerTypes[i]]);
- this._eventListenersSectionGroup.rows = rows;
- }
- },
-
- _refreshAccessibility: function()
- {
- var domNode = this.domNode;
- if (!domNode)
- return;
-
- function accessibilityPropertiesCallback(accessibilityProperties)
- {
- if (this.domNode !== domNode)
- return;
-
- if (accessibilityProperties && accessibilityProperties.exists) {
-
- var ignored = "";
- if (accessibilityProperties.ignored) {
- ignored = WebInspector.UIString("Yes");
- if (accessibilityProperties.hidden)
- ignored = WebInspector.UIString("%s (hidden)").format(ignored);
- else if (accessibilityProperties.ignoredByDefault)
- ignored = WebInspector.UIString("%s (default)").format(ignored);
- }
-
- var invalid = accessibilityProperties.invalid ? accessibilityProperties.invalid : "";
-
- // FIXME: label will always come back as empty. Blocked by http://webkit.org/b/121134
- var label = accessibilityProperties.label;
- if (label && label !== domNode.getAttribute("aria-label"))
- label = WebInspector.UIString("%s (computed)").format(label);
-
- var required = "";
- if (accessibilityProperties.required !== undefined) {
- if (accessibilityProperties.required)
- required = WebInspector.UIString("Yes");
- else
- required = WebInspector.UIString("No");
- }
-
- var role = accessibilityProperties.role;
- if (role === "" || role === "unknown")
- role = WebInspector.UIString("No exact ARIA role match.");
- else if (role) {
- if (!domNode.getAttribute("role"))
- role = WebInspector.UIString("%s (default)").format(role);
- else if (domNode.getAttribute("role") !== role)
- role = WebInspector.UIString("%s (computed)").format(role);
- }
-
- this._accessibilityNodeIgnoredRow.value = ignored;
- this._accessibilityNodeInvalidRow.value = invalid;
- this._accessibilityNodeLabelRow.value = label;
- this._accessibilityNodeRequiredRow.value = required;
- this._accessibilityNodeRoleRow.value = role;
-
- this._accessibilityGroup.rows = [
- this._accessibilityNodeIgnoredRow,
- this._accessibilityNodeRoleRow,
- this._accessibilityNodeLabelRow,
- this._accessibilityNodeRequiredRow,
- this._accessibilityNodeInvalidRow
- ];
-
- this._accessibilityEmptyRow.hideEmptyMessage();
-
- } else {
- this._accessibilityGroup.rows = [this._accessibilityEmptyRow];
- this._accessibilityEmptyRow.showEmptyMessage();
- }
- }
- domNode.accessibilityProperties(accessibilityPropertiesCallback.bind(this));
- },
-
- _attributesChanged: function(event)
- {
- if (event.data.node !== this.domNode)
- return;
- this._refreshAttributes();
- this._refreshAccessibility();
- },
-
- _nodeTypeDisplayName: function()
- {
- switch (this.domNode.nodeType()) {
- case Node.ELEMENT_NODE:
- return WebInspector.UIString("Element");
- case Node.TEXT_NODE:
- return WebInspector.UIString("Text Node");
- case Node.COMMENT_NODE:
- return WebInspector.UIString("Comment");
- case Node.DOCUMENT_NODE:
- return WebInspector.UIString("Document");
- case Node.DOCUMENT_TYPE_NODE:
- return WebInspector.UIString("Document Type");
- case Node.DOCUMENT_FRAGMENT_NODE:
- return WebInspector.UIString("Document Fragment");
- case Node.CDATA_SECTION_NODE:
- return WebInspector.UIString("Character Data");
- case Node.PROCESSING_INSTRUCTION_NODE:
- return WebInspector.UIString("Processing Instruction");
- default:
- console.error("Unknown DOM node type: ", this.domNode.nodeType());
- return this.domNode.nodeType();
- }
- },
-
- _createAttributesDataGrid: function()
- {
- var domNode = this.domNode;
- if (!domNode || !domNode.hasAttributes())
- return null;
-
- var columns = {name: {title: WebInspector.UIString("Name"), width: "30%"}, value: {title: WebInspector.UIString("Value")}};
- var dataGrid = new WebInspector.DataGrid(columns);
-
- var attributes = domNode.attributes();
- for (var i = 0; i < attributes.length; ++i) {
- var attribute = attributes[i];
-
- var node = new WebInspector.DataGridNode({name: attribute.name, value: attribute.value || ""}, false);
- node.selectable = true;
-
- dataGrid.appendChild(node);
- }
-
- return dataGrid;
- }
-};
-
-WebInspector.DOMNodeDetailsSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMNodeStylesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMNodeStyles.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMNodeStyles.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMNodeStyles.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1050 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMNodeStyles = function(node)
-{
- WebInspector.Object.call(this);
-
- console.assert(node);
- this._node = node || null;
-
- this._rulesMap = {};
- this._styleDeclarationsMap = {};
-
- this._matchedRules = [];
- this._inheritedRules = [];
- this._pseudoElements = {};
- this._inlineStyle = null;
- this._attributesStyle = null;
- this._computedStyle = null;
- this._orderedStyles = [];
- this._stylesNeedingTextCommited = [];
-
- this._propertyNameToEffectivePropertyMap = {};
-
- this.refresh();
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.DOMNodeStyles);
-
-WebInspector.DOMNodeStyles.Event = {
- NeedsRefresh: "dom-node-styles-needs-refresh",
- Refreshed: "dom-node-styles-refreshed"
-};
-
-WebInspector.DOMNodeStyles.prototype = {
- constructor: WebInspector.DOMNodeStyles,
-
- // Public
-
- get node()
- {
- return this._node;
- },
-
- get needsRefresh()
- {
- return this._refreshPending || this._needsRefresh;
- },
-
- refreshIfNeeded: function()
- {
- if (!this._needsRefresh)
- return;
- this.refresh();
- },
-
- refresh: function()
- {
- if (this._refreshPending)
- return;
-
- this._needsRefresh = false;
- this._refreshPending = true;
-
- function parseRuleMatchArrayPayload(matchArray, node, inherited)
- {
- var result = [];
-
- var ruleOccurrences = {};
-
- // Iterate in reverse order to match the cascade order.
- for (var i = matchArray.length - 1; i >= 0; --i) {
- // COMPATIBILITY (iOS 6): This was just an array of rules, now it is an array of matches that have
- // a 'rule' property. Support both here. And 'matchingSelectors' does not exist on iOS 6.
- var matchedSelectorIndices = matchArray[i].matchingSelectors || [];
- var rule = this._parseRulePayload(matchArray[i].rule || matchArray[i], matchedSelectorIndices, node, inherited, ruleOccurrences);
- if (!rule)
- continue;
- result.push(rule);
- }
-
- return result;
- }
-
- function fetchedMatchedStyles(error, matchedRulesPayload, pseudoElementRulesPayload, inheritedRulesPayload)
- {
- matchedRulesPayload = matchedRulesPayload || [];
- pseudoElementRulesPayload = pseudoElementRulesPayload || [];
- inheritedRulesPayload = inheritedRulesPayload || [];
-
- // Move the current maps to previous.
- this._previousRulesMap = this._rulesMap;
- this._previousStyleDeclarationsMap = this._styleDeclarationsMap;
-
- // Clear the current maps.
- this._rulesMap = {};
- this._styleDeclarationsMap = {};
-
- this._matchedRules = parseRuleMatchArrayPayload.call(this, matchedRulesPayload, this._node);
-
- this._pseudoElements = {};
- for (var i = 0; i < pseudoElementRulesPayload.length; ++i) {
- var pseudoElementRulePayload = pseudoElementRulesPayload[i];
-
- // COMPATIBILITY (iOS 6): The entry payload had a 'rules' property, now it has a 'matches' property. Support both here.
- var pseudoElementRules = parseRuleMatchArrayPayload.call(this, pseudoElementRulePayload.matches || pseudoElementRulePayload.rules, this._node);
- this._pseudoElements[pseudoElementRulePayload.pseudoId] = {matchedRules: pseudoElementRules};
- }
-
- this._inheritedRules = [];
-
- var i = 0;
- var currentNode = this._node.parentNode;
- while (currentNode && i < inheritedRulesPayload.length) {
- var inheritedRulePayload = inheritedRulesPayload[i];
-
- var inheritedRuleInfo = {node: currentNode};
- inheritedRuleInfo.inlineStyle = inheritedRulePayload.inlineStyle ? this._parseStyleDeclarationPayload(inheritedRulePayload.inlineStyle, currentNode, true, WebInspector.CSSStyleDeclaration.Type.Inline) : null;
- inheritedRuleInfo.matchedRules = inheritedRulePayload.matchedCSSRules ? parseRuleMatchArrayPayload.call(this, inheritedRulePayload.matchedCSSRules, currentNode, true) : [];
-
- if (inheritedRuleInfo.inlineStyle || inheritedRuleInfo.matchedRules.length)
- this._inheritedRules.push(inheritedRuleInfo);
-
- currentNode = currentNode.parentNode;
- ++i;
- }
- }
-
- function fetchedInlineStyles(error, inlineStylePayload, attributesStylePayload)
- {
- this._inlineStyle = inlineStylePayload ? this._parseStyleDeclarationPayload(inlineStylePayload, this._node, false, WebInspector.CSSStyleDeclaration.Type.Inline) : null;
- this._attributesStyle = attributesStylePayload ? this._parseStyleDeclarationPayload(attributesStylePayload, this._node, false, WebInspector.CSSStyleDeclaration.Type.Attribute) : null;
-
- this._updateStyleCascade();
- }
-
- function fetchedComputedStyle(error, computedPropertiesPayload)
- {
- var properties = [];
- for (var i = 0; computedPropertiesPayload && i < computedPropertiesPayload.length; ++i) {
- var propertyPayload = computedPropertiesPayload[i];
-
- var canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(propertyPayload.name);
- propertyPayload.implicit = !this._propertyNameToEffectivePropertyMap[canonicalName];
-
- var property = this._parseStylePropertyPayload(propertyPayload, NaN, this._computedStyle);
- properties.push(property);
- }
-
- if (this._computedStyle)
- this._computedStyle.update(null, properties);
- else
- this._computedStyle = new WebInspector.CSSStyleDeclaration(this, null, null, WebInspector.CSSStyleDeclaration.Type.Computed, this._node, false, null, properties);
-
- this._refreshPending = false;
-
- var significantChange = this._previousSignificantChange || false;
- if (!significantChange) {
- for (var key in this._styleDeclarationsMap) {
- // Check if the same key exists in the previous map and has the same style objects.
- if (key in this._previousStyleDeclarationsMap && Object.shallowEqual(this._styleDeclarationsMap[key], this._previousStyleDeclarationsMap[key]))
- continue;
-
- if (!this._includeUserAgentRulesOnNextRefresh) {
- // We can assume all the styles with the same key are from the same stylesheet and rule, so we only check the first.
- var firstStyle = this._styleDeclarationsMap[key][0];
- if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent) {
- // User Agent styles get different identifiers after some edits. This would cause us to fire a significant refreshed
- // event more than it is helpful. And since the user agent stylesheet is static it shouldn't match differently
- // between refreshes for the same node. This issue is tracked by: https://webkit.org/b/110055
- continue;
- }
- }
-
- // This key is new or has different style objects than before. This is a significant change.
- significantChange = true;
- break;
- }
- }
-
- if (!significantChange) {
- for (var key in this._previousStyleDeclarationsMap) {
- // Check if the same key exists in current map. If it does exist it was already checked for equality above.
- if (key in this._styleDeclarationsMap)
- continue;
-
- if (!this._includeUserAgentRulesOnNextRefresh) {
- // See above for why we skip user agent style rules.
- var firstStyle = this._previousStyleDeclarationsMap[key][0];
- if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
- continue;
- }
-
- // This key no longer exists. This is a significant change.
- significantChange = true;
- break;
- }
- }
-
- delete this._includeUserAgentRulesOnNextRefresh;
-
- // Delete the previous maps now that any reused rules and style have been moved over.
- delete this._previousRulesMap;
- delete this._previousStyleDeclarationsMap;
-
- var styleToCommit = this._stylesNeedingTextCommited.shift();
- if (styleToCommit) {
- // Remember the significant change flag so we can pass it along when the pending style
- // changes trigger a refresh. If we wait to scan later we might not find a significant change
- // and fail to tell listeners about it.
- this._previousSignificantChange = significantChange;
-
- this.changeStyleText(styleToCommit, styleToCommit.__pendingText);
-
- return;
- }
-
- // Delete the previous saved significant change flag so we rescan for a significant change next time.
- delete this._previousSignificantChange;
-
- this.dispatchEventToListeners(WebInspector.DOMNodeStyles.Event.Refreshed, {significantChange: significantChange});
- }
-
- CSSAgent.getMatchedStylesForNode.invoke({nodeId: this._node.id, includePseudo: true, includeInherited: true}, fetchedMatchedStyles.bind(this));
- CSSAgent.getInlineStylesForNode.invoke({nodeId: this._node.id}, fetchedInlineStyles.bind(this));
- CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, fetchedComputedStyle.bind(this));
- },
-
- addRule: function(selector)
- {
- function addedRule(error, rulePayload)
- {
- if (error)
- return;
-
- DOMAgent.markUndoableState();
-
- this.refresh();
- }
-
- selector = selector || this._node.appropriateSelectorFor(true);
-
- CSSAgent.addRule.invoke({contextNodeId: this._node.id, selector: selector}, addedRule.bind(this));
- },
-
- get matchedRules()
- {
- return this._matchedRules;
- },
-
- get inheritedRules()
- {
- return this._inheritedRules;
- },
-
- get inlineStyle()
- {
- return this._inlineStyle;
- },
-
- get attributesStyle()
- {
- return this._attributesStyle;
- },
-
- get pseudoElements()
- {
- return this._pseudoElements;
- },
-
- get computedStyle()
- {
- return this._computedStyle;
- },
-
- get orderedStyles()
- {
- return this._orderedStyles;
- },
-
- effectivePropertyForName: function(name)
- {
- var canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(name);
- return this._propertyNameToEffectivePropertyMap[canonicalName] || null;
- },
-
- // Protected
-
- mediaQueryResultDidChange: function()
- {
- this._markAsNeedsRefresh();
- },
-
- pseudoClassesDidChange: function(node)
- {
- this._includeUserAgentRulesOnNextRefresh = true;
- this._markAsNeedsRefresh();
- },
-
- attributeDidChange: function(node, attributeName)
- {
- // Ignore the attribute we know we just changed and handled above.
- if (this._ignoreNextStyleAttributeDidChangeEvent && node === this._node && attributeName === "style") {
- delete this._ignoreNextStyleAttributeDidChangeEvent;
- return;
- }
-
- this._markAsNeedsRefresh();
- },
-
- changeRuleSelector: function(rule, selector)
- {
- selector = selector || "";
-
- function ruleSelectorChanged(error, rulePayload)
- {
- DOMAgent.markUndoableState();
-
- // Do a full refresh incase the rule no longer matches the node or the
- // matched selector indices changed.
- this.refresh();
- }
-
- this._needsRefresh = true;
- this._ignoreNextContentDidChangeForStyleSheet = rule.ownerStyleSheet;
-
- CSSAgent.setRuleSelector(rule.id, selector, ruleSelectorChanged.bind(this));
- },
-
- changeStyleText: function(style, text)
- {
- if (!style.ownerStyleSheet || !style.styleSheetTextRange)
- return;
-
- text = text || "";
-
- if (CSSAgent.setStyleText) {
- function styleChanged(error, stylePayload)
- {
- if (error)
- return;
- this.refresh();
- }
-
- CSSAgent.setStyleText(style.id, text, styleChanged.bind(this));
- return;
- }
-
- // COMPATIBILITY (iOS 6): CSSAgent.setStyleText was not available in iOS 6.
-
- // Setting the text on CSSStyleSheet for inline styles causes a crash. https://webkit.org/b/110359
- // So we just set the style attribute to get the same affect. This also avoids SourceCodeRevisions.
- if (style.type === WebInspector.CSSStyleDeclaration.Type.Inline) {
- text = text.trim();
-
- function attributeChanged(error)
- {
- if (error)
- return;
- this.refresh();
- }
-
- this._ignoreNextStyleAttributeDidChangeEvent = true;
-
- if (text)
- style.node.setAttributeValue("style", text, attributeChanged.bind(this));
- else
- style.node.removeAttribute("style", attributeChanged.bind(this));
-
- return;
- }
-
- if (this._needsRefresh || this._refreshPending) {
- // If we need refreshed then it is not safe to use the styleSheetTextRange since the range likely has
- // changed and we need updated ranges. Store the text and remember the style so we can commit it after
- // the next refresh.
-
- style.__pendingText = text;
-
- if (!this._stylesNeedingTextCommited.contains(style))
- this._stylesNeedingTextCommited.push(style);
-
- return;
- }
-
- function fetchedStyleSheetContent(styleSheet, content)
- {
- console.assert(style.styleSheetTextRange);
- if (!style.styleSheetTextRange)
- return;
-
- var startOffset = style.styleSheetTextRange.startOffset;
- var endOffset = style.styleSheetTextRange.endOffset;
-
- if (isNaN(startOffset) || isNaN(endOffset)) {
- style.styleSheetTextRange.resolveOffsets(content);
-
- startOffset = style.styleSheetTextRange.startOffset;
- endOffset = style.styleSheetTextRange.endOffset;
- }
-
- console.assert(!isNaN(startOffset));
- console.assert(!isNaN(endOffset));
- if (isNaN(startOffset) || isNaN(endOffset))
- return;
-
- function contentDidChange()
- {
- style.ownerStyleSheet.removeEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, contentDidChange, this);
-
- this.refresh();
- }
-
- style.ownerStyleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, contentDidChange, this);
-
- var newContent = content.substring(0, startOffset) + text + content.substring(endOffset);
-
- WebInspector.branchManager.currentBranch.revisionForRepresentedObject(style.ownerStyleSheet).content = newContent;
- }
-
- this._stylesNeedingTextCommited.remove(style);
- delete style.__pendingText;
-
- this._needsRefresh = true;
- this._ignoreNextContentDidChangeForStyleSheet = style.ownerStyleSheet;
-
- style.ownerStyleSheet.requestContent(fetchedStyleSheetContent.bind(this));
- },
-
- changeProperty: function(property, name, value, priority)
- {
- var text = name ? name + ": " + value + (priority ? " !" + priority : "") + ";" : "";
- this.changePropertyText(property, text);
- },
-
- changePropertyText: function(property, text)
- {
- text = text || "";
-
- var index = property.index;
- var newProperty = isNaN(index);
- var overwrite = true;
-
- // If this is a new property, then give it an index at the end of the current properties.
- // Also don't overwrite, which will cause the property to be added at that index.
- if (newProperty) {
- index = property.ownerStyle.properties.length;
- overwrite = false;
- }
-
- if (text && text.charAt(text.length - 1) !== ";")
- text += ";";
-
- this._needsRefresh = true;
- this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
-
- CSSAgent.setPropertyText(property.ownerStyle.id, index, text, overwrite, this._handlePropertyChange.bind(this, property));
- },
-
- changePropertyEnabledState: function(property, enabled)
- {
- enabled = !!enabled;
-
- // Can't change a pending property with a NaN index.
- if (isNaN(property.index))
- return;
-
- this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
-
- CSSAgent.toggleProperty(property.ownerStyle.id, property.index, !enabled, this._handlePropertyChange.bind(this, property));
- },
-
- addProperty: function(property)
- {
- // Can't add a property unless it has a NaN index.
- if (!isNaN(property.index))
- return;
-
- // Adding is done by setting the text.
- this.changePropertyText(property, property.text);
- },
-
- removeProperty: function(property)
- {
- // Can't remove a pending property with a NaN index.
- if (isNaN(property.index))
- return;
-
- // Removing is done by setting text to an empty string.
- this.changePropertyText(property, "");
- },
-
- // Private
-
- _handlePropertyChange: function(property, error, stylePayload)
- {
- if (error)
- return;
-
- DOMAgent.markUndoableState();
-
- // Do a refresh instead of handling stylePayload so computed style is updated and we get valid
- // styleSheetTextRange values for all the rules after this change.
- this.refresh();
- },
-
- _createSourceCodeLocation: function(sourceURL, sourceLine, sourceColumn)
- {
- if (!sourceURL)
- return null;
-
- var sourceCode;
-
- // Try to use the node to find the frame which has the correct resource first.
- if (this._node.ownerDocument) {
- var mainResource = WebInspector.frameResourceManager.resourceForURL(this._node.ownerDocument.documentURL);
- if (mainResource) {
- var parentFrame = mainResource.parentFrame;
- sourceCode = parentFrame.resourceForURL(sourceURL);
- }
- }
-
- // If that didn't find the resource, then search all frames.
- if (!sourceCode)
- sourceCode = WebInspector.frameResourceManager.resourceForURL(sourceURL);
-
- if (!sourceCode)
- return null;
-
- return sourceCode.createSourceCodeLocation(sourceLine || 0, sourceColumn || 0);
- },
-
- _parseSourceRangePayload: function(payload, text)
- {
- if (!payload)
- return null;
-
- // COMPATIBILITY (iOS 6): The range use to only contain start and end offsets. Now it
- // has line and column for the start and end position. Support both here.
- if ("start" in payload && "end" in payload) {
- var textRange = new WebInspector.TextRange(payload.start, payload.end);
- if (typeof text === "string")
- textRange.resolveLinesAndColumns(text);
- return textRange;
- }
-
- return new WebInspector.TextRange(payload.startLine, payload.startColumn, payload.endLine, payload.endColumn);
- },
-
- _parseStylePropertyPayload: function(payload, index, styleDeclaration, styleText)
- {
- var text = payload.text || "";
- var name = payload.name;
- var value = (payload.value || "").replace(/\s*!important\s*$/, "");
- var priority = payload.priority || "";
-
- var enabled = true;
- var overridden = false;
- var implicit = payload.implicit || false;
- var anonymous = false;
- var valid = "parsedOk" in payload ? payload.parsedOk : true;
-
- switch (payload.status || "style") {
- case "active":
- enabled = true;
- break;
- case "inactive":
- overridden = true;
- enabled = true;
- break;
- case "disabled":
- enabled = false;
- break;
- case "style":
- anonymous = true;
- break;
- }
-
- var styleSheetTextRange = null;
- var styleDeclarationTextRange = null;
-
- // COMPATIBILITY (iOS 6): The range is in the style text, not the whole stylesheet.
- // Later the range was changed to be in the whole stylesheet.
- if (payload.range && "start" in payload.range && "end" in payload.range)
- styleDeclarationTextRange = this._parseSourceRangePayload(payload.range, styleText);
- else
- styleSheetTextRange = this._parseSourceRangePayload(payload.range);
-
- if (styleDeclaration) {
- // Use propertyForName when the index is NaN since propertyForName is fast in that case.
- var property = isNaN(index) ? styleDeclaration.propertyForName(name, true) : styleDeclaration.properties[index];
-
- // Reuse a property if the index and name matches. Otherwise it is a different property
- // and should be created from scratch. This works in the simple cases where only existing
- // properties change in place and no properties are inserted or deleted at the beginning.
- // FIXME: This could be smarter by ignoring index and just go by name. However, that gets
- // tricky for rules that have more than one property with the same name.
- if (property && property.name === name && (property.index === index || (isNaN(property.index) && isNaN(index)))) {
- property.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
- return property;
- }
-
- // Reuse a pending property with the same name. These properties are pending being committed,
- // so if we find a match that likely means it got committed and we should use it.
- var pendingProperties = styleDeclaration.pendingProperties;
- for (var i = 0; i < pendingProperties.length; ++i) {
- var pendingProperty = pendingProperties[i];
- if (pendingProperty.name === name && isNaN(pendingProperty.index)) {
- pendingProperty.index = index;
- pendingProperty.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
- return pendingProperty;
- }
- }
- }
-
- return new WebInspector.CSSProperty(index, text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
- },
-
- _parseStyleDeclarationPayload: function(payload, node, inherited, type, rule, updateAllStyles)
- {
- if (!payload)
- return null;
-
- rule = rule || null;
- inherited = inherited || false;
-
- var id = payload.styleId;
- var mapKey = id ? id.styleSheetId + ":" + id.ordinal : null;
-
- var styleDeclaration = rule ? rule.style : null;
- var styleDeclarations = [];
-
- // Look for existing styles in the previous map if there is one, otherwise use the current map.
- var previousStyleDeclarationsMap = this._previousStyleDeclarationsMap || this._styleDeclarationsMap;
- if (mapKey && mapKey in previousStyleDeclarationsMap) {
- styleDeclarations = previousStyleDeclarationsMap[mapKey];
-
- // If we need to update all styles, then stop here and call _parseStyleDeclarationPayload for each style.
- // We need to parse multiple times so we reuse the right properties from each style.
- if (updateAllStyles && styleDeclarations.length) {
- for (var i = 0; i < styleDeclarations.length; ++i) {
- var styleDeclaration = styleDeclarations[i];
- this._parseStyleDeclarationPayload(payload, styleDeclaration.node, styleDeclaration.inherited, styleDeclaration.type, styleDeclaration.ownerRule);
- }
-
- return;
- }
-
- if (!styleDeclaration) {
- var filteredStyleDeclarations = styleDeclarations.filter(function(styleDeclaration) {
- // This case only applies for styles that are not part of a rule.
- if (styleDeclaration.ownerRule) {
- console.assert(!rule);
- return false;
- }
-
- if (styleDeclaration.node !== node)
- return false;
-
- if (styleDeclaration.inherited !== inherited)
- return false;
-
- return true;
- });
-
- console.assert(filteredStyleDeclarations.length <= 1);
- styleDeclaration = filteredStyleDeclarations[0] || null;
- }
- }
-
- if (previousStyleDeclarationsMap !== this._styleDeclarationsMap) {
- // If the previous and current maps differ then make sure the found styleDeclaration is added to the current map.
- styleDeclarations = mapKey && mapKey in this._styleDeclarationsMap ? this._styleDeclarationsMap[mapKey] : [] ;
-
- if (styleDeclaration && !styleDeclarations.contains(styleDeclaration)) {
- styleDeclarations.push(styleDeclaration);
- this._styleDeclarationsMap[mapKey] = styleDeclarations;
- }
- }
-
- var shorthands = {};
- for (var i = 0; payload.shorthandEntries && i < payload.shorthandEntries.length; ++i) {
- var shorthand = payload.shorthandEntries[i];
- shorthands[shorthand.name] = shorthand.value;
- }
-
- var text = payload.cssText;
-
- var inheritedPropertyCount = 0;
-
- var properties = [];
- for (var i = 0; payload.cssProperties && i < payload.cssProperties.length; ++i) {
- var propertyPayload = payload.cssProperties[i];
-
- if (inherited && propertyPayload.name in WebInspector.CSSKeywordCompletions.InheritedProperties)
- ++inheritedPropertyCount;
-
- var property = this._parseStylePropertyPayload(propertyPayload, i, styleDeclaration, text);
- properties.push(property);
- }
-
- if (inherited && !inheritedPropertyCount)
- return null;
-
- var styleSheetTextRange = this._parseSourceRangePayload(payload.range);
-
- if (styleDeclaration) {
- styleDeclaration.update(text, properties, styleSheetTextRange);
- return styleDeclaration;
- }
-
- var styleSheet = id ? WebInspector.cssStyleManager.styleSheetForIdentifier(id.styleSheetId) : null;
- if (styleSheet)
- styleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, this._styleSheetContentDidChange, this);
-
- styleDeclaration = new WebInspector.CSSStyleDeclaration(this, styleSheet, id, type, node, inherited, text, properties, styleSheetTextRange);
-
- if (mapKey) {
- styleDeclarations.push(styleDeclaration);
- this._styleDeclarationsMap[mapKey] = styleDeclarations;
- }
-
- return styleDeclaration;
- },
-
- _parseRulePayload: function(payload, matchedSelectorIndices, node, inherited, ruleOccurrences)
- {
- if (!payload)
- return null;
-
- // User and User Agent rules don't have 'ruleId' in the payload. However, their style's have 'styleId' and
- // 'styleId' is the same identifier the backend uses for Author rule identifiers, so do the same here.
- // They are excluded by the backend because they are not editable, however our front-end does not determine
- // editability solely based on the existence of the id like the open source front-end does.
- var id = payload.ruleId || payload.style.styleId;
-
- var mapKey = id ? id.styleSheetId + ":" + id.ordinal + ":" + (inherited ? "I" : "N") + ":" + node.id : null;
-
- // Rules can match multiple times if they have multiple selectors or because of inheritance. We keep a count
- // of occurrences so we have unique rules per occurrence, that way properties will be correctly marked as overridden.
- var occurrence = 0;
- if (mapKey) {
- if (mapKey in ruleOccurrences)
- occurrence = ++ruleOccurrences[mapKey];
- else
- ruleOccurrences[mapKey] = occurrence;
- }
-
- // Append the occurrence number to the map key for lookup in the rules map.
- mapKey += ":" + occurrence;
-
- var rule = null;
-
- // Look for existing rules in the previous map if there is one, otherwise use the current map.
- var previousRulesMap = this._previousRulesMap || this._rulesMap;
- if (mapKey && mapKey in previousRulesMap) {
- rule = previousRulesMap[mapKey];
-
- if (previousRulesMap !== this._rulesMap) {
- // If the previous and current maps differ then make sure the found rule is added to the current map.
- this._rulesMap[mapKey] = rule;
- }
- }
-
- var style = this._parseStyleDeclarationPayload(payload.style, node, inherited, WebInspector.CSSStyleDeclaration.Type.Rule, rule);
- if (!style)
- return null;
-
- // COMPATIBILITY (iOS 6): The payload had 'selectorText' as a property,
- // now it has 'selectorList' with a 'text' property. Support both here.
- var selectorText = payload.selectorList ? payload.selectorList.text : payload.selectorText;
- var selectors = payload.selectorList ? payload.selectorList.selectors : [];
-
- // COMPATIBILITY (iOS 6): The payload did not have 'selectorList'.
- // Fallback to using 'sourceLine' without column information.
- if (payload.selectorList && payload.selectorList.range) {
- var sourceRange = payload.selectorList.range;
- var sourceCodeLocation = this._createSourceCodeLocation(payload.sourceURL, sourceRange.startLine, sourceRange.startColumn);
- } else
- var sourceCodeLocation = this._createSourceCodeLocation(payload.sourceURL, payload.sourceLine);
-
- var type;
- switch (payload.origin) {
- case "regular":
- type = WebInspector.CSSRule.Type.Author;
- break;
- case "user":
- type = WebInspector.CSSRule.Type.User;
- break;
- case "user-agent":
- type = WebInspector.CSSRule.Type.UserAgent;
- break;
- case "inspector":
- type = WebInspector.CSSRule.Type.Inspector;
- break;
- }
-
- var mediaList = [];
- for (var i = 0; payload.media && i < payload.media.length; ++i) {
- var mediaItem = payload.media[i];
-
- var mediaType;
- switch (mediaItem.source) {
- case "mediaRule":
- mediaType = WebInspector.CSSMedia.Type.MediaRule;
- break;
- case "importRule":
- mediaType = WebInspector.CSSMedia.Type.ImportRule;
- break;
- case "linkedSheet":
- mediaType = WebInspector.CSSMedia.Type.LinkedStyleSheet;
- break;
- case "inlineSheet":
- mediaType = WebInspector.CSSMedia.Type.InlineStyleSheet;
- break;
- }
-
- var mediaText = mediaItem.text;
- var mediaSourceCodeLocation = this._createSourceCodeLocation(mediaItem.sourceURL, mediaItem.sourceLine);
-
- mediaList.push(new WebInspector.CSSMedia(mediaType, mediaText, mediaSourceCodeLocation));
- }
-
- if (rule) {
- rule.update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList);
- return rule;
- }
-
- var styleSheet = id ? WebInspector.cssStyleManager.styleSheetForIdentifier(id.styleSheetId) : null;
- if (styleSheet)
- styleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, this._styleSheetContentDidChange, this);
-
- rule = new WebInspector.CSSRule(this, styleSheet, id, type, sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList);
-
- if (mapKey)
- this._rulesMap[mapKey] = rule;
-
- return rule;
- },
-
- _markAsNeedsRefresh: function()
- {
- this._needsRefresh = true;
- this.dispatchEventToListeners(WebInspector.DOMNodeStyles.Event.NeedsRefresh);
- },
-
- _styleSheetContentDidChange: function(event)
- {
- var styleSheet = event.target;
- console.assert(styleSheet);
- if (!styleSheet)
- return;
-
- // Ignore the stylesheet we know we just changed and handled above.
- if (styleSheet === this._ignoreNextContentDidChangeForStyleSheet) {
- delete this._ignoreNextContentDidChangeForStyleSheet;
- return;
- }
-
- this._markAsNeedsRefresh();
- },
-
- _updateStyleCascade: function()
- {
- var cascadeOrderedStyleDeclarations = this._collectStylesInCascadeOrder(this._matchedRules, this._inlineStyle, this._attributesStyle);
-
- for (var i = 0; i < this._inheritedRules.length; ++i) {
- var inheritedStyleInfo = this._inheritedRules[i];
- var inheritedCascadeOrder = this._collectStylesInCascadeOrder(inheritedStyleInfo.matchedRules, inheritedStyleInfo.inlineStyle, null);
- cascadeOrderedStyleDeclarations = cascadeOrderedStyleDeclarations.concat(inheritedCascadeOrder);
- }
-
- this._orderedStyles = cascadeOrderedStyleDeclarations;
-
- this._propertyNameToEffectivePropertyMap = {};
-
- this._markOverriddenProperties(cascadeOrderedStyleDeclarations, this._propertyNameToEffectivePropertyMap);
- this._associateRelatedProperties(cascadeOrderedStyleDeclarations, this._propertyNameToEffectivePropertyMap);
-
- for (var pseudoIdentifier in this._pseudoElements) {
- var pseudoElementInfo = this._pseudoElements[pseudoIdentifier];
- pseudoElementInfo.orderedStyles = this._collectStylesInCascadeOrder(pseudoElementInfo.matchedRules, null, null);
- this._markOverriddenProperties(pseudoElementInfo.orderedStyles);
- this._associateRelatedProperties(pseudoElementInfo.orderedStyles);
- }
- },
-
- _collectStylesInCascadeOrder: function(matchedRules, inlineStyle, attributesStyle)
- {
- var result = [];
-
- // Inline style has the greatest specificity. So it goes first in the cascade order.
- if (inlineStyle)
- result.push(inlineStyle);
-
- var userAndUserAgentStyles = [];
-
- for (var i = 0; i < matchedRules.length; ++i) {
- var rule = matchedRules[i];
-
- // Only append to the result array here for author and inspector rules since attribute
- // styles come between author rules and user/user agent rules.
- switch (rule.type) {
- case WebInspector.CSSRule.Type.Inspector:
- case WebInspector.CSSRule.Type.Author:
- result.push(rule.style);
- break;
-
- case WebInspector.CSSRule.Type.User:
- case WebInspector.CSSRule.Type.UserAgent:
- userAndUserAgentStyles.push(rule.style);
- break;
- }
- }
-
- // Style properties from HTML attributes are next.
- if (attributesStyle)
- result.push(attributesStyle);
-
- // Finally add the user and user stylesheet's matched style rules we collected earlier.
- result = result.concat(userAndUserAgentStyles);
-
- return result;
- },
-
- _markOverriddenProperties: function(styles, propertyNameToEffectiveProperty)
- {
- propertyNameToEffectiveProperty = propertyNameToEffectiveProperty || {};
-
- for (var i = 0; i < styles.length; ++i) {
- var style = styles[i];
- var properties = style.properties;
-
- for (var j = 0; j < properties.length; ++j) {
- var property = properties[j];
- if (!property.enabled || property.anonymous || !property.valid) {
- property.overridden = false;
- continue;
- }
-
- if (style.inherited && !property.inherited) {
- property.overridden = false;
- continue;
- }
-
- var canonicalName = property.canonicalName;
- if (canonicalName in propertyNameToEffectiveProperty) {
- var effectiveProperty = propertyNameToEffectiveProperty[canonicalName];
-
- if (effectiveProperty.ownerStyle === property.ownerStyle) {
- if (effectiveProperty.important && !property.important) {
- property.overridden = true;
- continue;
- }
- } else if (effectiveProperty.important || !property.important || effectiveProperty.ownerStyle.node !== property.ownerStyle.node) {
- property.overridden = true;
- continue;
- }
-
- effectiveProperty.overridden = true;
- }
-
- property.overridden = false;
-
- propertyNameToEffectiveProperty[canonicalName] = property;
- }
- }
- },
-
- _associateRelatedProperties: function(styles, propertyNameToEffectiveProperty)
- {
- for (var i = 0; i < styles.length; ++i) {
- var properties = styles[i].properties;
-
- var knownShorthands = {};
-
- for (var j = 0; j < properties.length; ++j) {
- var property = properties[j];
-
- if (!property.valid)
- continue;
-
- if (!WebInspector.CSSCompletions.cssNameCompletions.isShorthandPropertyName(property.name))
- continue;
-
- if (knownShorthands[property.canonicalName] && !knownShorthands[property.canonicalName].overridden) {
- console.assert(property.overridden);
- continue;
- }
-
- knownShorthands[property.canonicalName] = property;
- }
-
- for (var j = 0; j < properties.length; ++j) {
- var property = properties[j];
-
- if (!property.valid)
- continue;
-
- var shorthandProperty = null;
-
- if (!isEmptyObject(knownShorthands)) {
- var possibleShorthands = WebInspector.CSSCompletions.cssNameCompletions.shorthandsForLonghand(property.canonicalName);
- for (var k = 0; k < possibleShorthands.length; ++k) {
- if (possibleShorthands[k] in knownShorthands) {
- shorthandProperty = knownShorthands[possibleShorthands[k]];
- break;
- }
- }
- }
-
- if (!shorthandProperty || shorthandProperty.overridden !== property.overridden) {
- property.relatedShorthandProperty = null;
- property.clearRelatedLonghandProperties();
- continue;
- }
-
- shorthandProperty.addRelatedLonghandProperty(property);
- property.relatedShorthandProperty = shorthandProperty;
-
- if (propertyNameToEffectiveProperty && propertyNameToEffectiveProperty[shorthandProperty.canonicalName] === shorthandProperty)
- propertyNameToEffectiveProperty[property.canonicalName] = property;
- }
- }
- }
-};
-
-WebInspector.DOMNodeStyles.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.DOMObserver.prototype = {
- constructor: WebInspector.DOMObserver,
-
- // Events defined by the "DOM" domain.
-
- documentUpdated: function()
- {
- WebInspector.domTreeManager._documentUpdated();
- },
-
- setChildNodes: function(parentId, payloads)
- {
- WebInspector.domTreeManager._setChildNodes(parentId, payloads);
- },
-
- attributeModified: function(nodeId, name, value)
- {
- WebInspector.domTreeManager._attributeModified(nodeId, name, value);
- },
-
- attributeRemoved: function(nodeId, name)
- {
- WebInspector.domTreeManager._attributeRemoved(nodeId, name);
- },
-
- inlineStyleInvalidated: function(nodeIds)
- {
- WebInspector.domTreeManager._inlineStyleInvalidated(nodeIds);
- },
-
- characterDataModified: function(nodeId, characterData)
- {
- WebInspector.domTreeManager._characterDataModified(nodeId, characterData);
- },
-
- childNodeCountUpdated: function(nodeId, childNodeCount)
- {
- WebInspector.domTreeManager._childNodeCountUpdated(nodeId, childNodeCount);
- },
-
- childNodeInserted: function(parentNodeId, previousNodeId, payload)
- {
- WebInspector.domTreeManager._childNodeInserted(parentNodeId, previousNodeId, payload);
- },
-
- childNodeRemoved: function(parentNodeId, nodeId)
- {
- WebInspector.domTreeManager._childNodeRemoved(parentNodeId, nodeId);
- },
-
- shadowRootPushed: function(parentNodeId, nodeId)
- {
- WebInspector.domTreeManager._childNodeInserted(parentNodeId, 0, nodeId);
- },
-
- shadowRootPopped: function(parentNodeId, nodeId)
- {
- WebInspector.domTreeManager._childNodeRemoved(parentNodeId, nodeId);
- }
-};
-
-WebInspector.DOMObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMSearchMatchObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMSearchMatchObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMSearchMatchObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMSearchMatchObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,150 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMSearchMatchObject = function(resource, domNode, title, searchTerm, textRange)
-{
- console.assert(resource instanceof WebInspector.Resource);
- console.assert(domNode instanceof WebInspector.DOMNode);
-
- WebInspector.Object.call(this);
-
- this._resource = resource;
- this._domNode = domNode;
- this._title = title;
- this._searchTerm = searchTerm;
- this._sourceCodeTextRange = resource.createSourceCodeTextRange(textRange);
-};
-
-WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName = "dom-match-element-icon";
-WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName = "dom-match-text-node-icon";
-WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName = "dom-match-comment-icon";
-WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName = "dom-match-document-type-icon";
-WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName = "dom-match-character-data-icon";
-WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName = "dom-match-node-icon";
-
-WebInspector.DOMSearchMatchObject.prototype = {
- constructor: WebInspector.DOMSearchMatchObject,
-
- // Public
-
- get domNode()
- {
- return this._domNode;
- },
-
- get title()
- {
- return this._title;
- },
-
- get className()
- {
- if (!this._className)
- this._className = this._generateClassName();
-
- return this._className;
- },
-
- get searchTerm()
- {
- return this._searchTerm;
- },
-
- get sourceCodeTextRange()
- {
- return this._sourceCodeTextRange;
- },
-
- // Private
-
- _generateClassName: function()
- {
- switch (this._domNode.nodeType()) {
- case Node.ELEMENT_NODE:
- return WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName;
-
- case Node.TEXT_NODE:
- return WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName;
-
- case Node.COMMENT_NODE:
- return WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName;
-
- case Node.DOCUMENT_TYPE_NODE:
- return WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName;
-
- case Node.CDATA_SECTION_NODE:
- return WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName;
-
- default:
- console.error("Unknown DOM node type: ", node.nodeType());
- return WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName;
- }
- }
-};
-
-WebInspector.DOMSearchMatchObject.titleForDOMNode = function(domNode)
-{
- switch (domNode.nodeType()) {
- case Node.ELEMENT_NODE:
- var title = "<" + domNode.nodeNameInCorrectCase();
-
- for (var i = 0; i < domNode.attributes().length; ++i) {
- title += " " + domNode.attributes()[i].name;
- if (domNode.attributes()[i].value.length)
- title += "=\"" + domNode.attributes()[i].value + "\"";
- }
-
- return title + ">";
-
- case Node.TEXT_NODE:
- return "\"" + domNode.nodeValue() + "\"";
-
- case Node.COMMENT_NODE:
- return "<!--" + domNode.nodeValue() + "-->";
-
- case Node.DOCUMENT_TYPE_NODE:
- var title = "<!DOCTYPE " + domNode.nodeName();
- if (domNode.publicId) {
- title += " PUBLIC \"" + domNode.publicId + "\"";
- if (node.systemId)
- title += " \"" + domNode.systemId + "\"";
- } else if (domNode.systemId)
- title += " SYSTEM \"" + domNode.systemId + "\"";
-
- if (domNode.internalSubset)
- title += " [" + domNode.internalSubset + "]";
-
- return title + ">";
-
- case Node.CDATA_SECTION_NODE:
- return "<![CDATA[" + domNode + "]]>";
-
- default:
- console.error("Unknown DOM node type: ", domNode.nodeType());
- return domNode.nodeNameInCorrectCase();
- }
-}
-
-WebInspector.DOMSearchMatchObject.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.dom-storage > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- outline: none;
- border: none;
-}
-
-.content-view.dom-storage > .data-grid tr.duplicate-key td.key-column,
-.content-view.dom-storage > .data-grid tr.missing-key td.key-column,
-.content-view.dom-storage > .data-grid tr.missing-value td.value-column {
- background-color: #fee;
-}
-
-.content-view.dom-storage > .data-grid:focus tr.selected.duplicate-key td.key-column,
-.content-view.dom-storage > .data-grid:focus tr.selected.missing-key td.key-column,
-.content-view.dom-storage > .data-grid:focus tr.selected.missing-value td.value-column {
- background-color: #daa;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,242 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this.element.classList.add(WebInspector.DOMStorageContentView.StyleClassName);
-
- representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemsCleared, this.itemsCleared, this);
- representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemAdded, this.itemAdded, this);
- representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemRemoved, this.itemRemoved, this);
- representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemUpdated, this.itemUpdated, this);
-
- this.reset();
-};
-
-WebInspector.DOMStorageContentView.StyleClassName = "dom-storage";
-WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName = "duplicate-key";
-WebInspector.DOMStorageContentView.MissingKeyStyleClassName = "missing-key";
-WebInspector.DOMStorageContentView.MissingValueStyleClassName = "missing-value";
-
-
-WebInspector.DOMStorageContentView.prototype = {
- constructor: WebInspector.DOMStorageContentView,
- __proto__: WebInspector.ContentView.prototype,
-
- // Public
-
- reset: function()
- {
- this.representedObject.getEntries(function(error, entries) {
- if (error)
- return;
-
- if (!this._dataGrid) {
- var columns = {};
- columns.key = {title: WebInspector.UIString("Key"), sortable: true};
- columns.value = {title: WebInspector.UIString("Value"), sortable: true};
-
- this._dataGrid = new WebInspector.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this));
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
-
- this.element.appendChild(this._dataGrid.element);
- }
-
- console.assert(this._dataGrid);
-
- var nodes = [];
- for (var entry of entries) {
- if (!entry[0] || !entry[1])
- continue;
- var data = {key: entry[0], value: entry[1]};
- var node = new WebInspector.DataGridNode(data, false);
- node.selectable = true;
- this._dataGrid.appendChild(node);
- }
-
- this._sortDataGrid();
- this._dataGrid.addPlaceholderNode();
- this._dataGrid.updateLayout();
- }.bind(this));
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.DOMStorage;
- cookie.isLocalStorage = this.representedObject.isLocalStorage();
- cookie.host = this.representedObject.host;
- },
-
- itemsCleared: function(event)
- {
- this._dataGrid.removeChildren();
- this._dataGrid.addPlaceholderNode();
- },
-
- itemRemoved: function(event)
- {
- for (var node of this._dataGrid.children) {
- if (node.data.key === event.data.key)
- return this._dataGrid.removeChild(node);
- }
- },
-
- itemAdded: function(event)
- {
- var key = event.data.key;
- var value = event.data.value;
-
- // Enforce key uniqueness.
- for (var node of this._dataGrid.children) {
- if (node.data.key === key)
- return;
- }
-
- var data = {key: key, value: value};
- this._dataGrid.appendChild(new WebInspector.DataGridNode(data, false));
- this._sortDataGrid();
- },
-
- itemUpdated: function(event)
- {
- var key = event.data.key;
- var value = event.data.value;
-
- var keyFound = false;
- for (var childNode of this._dataGrid.children) {
- if (childNode.data.key === key) {
- // Remove any rows that are now duplicates.
- if (keyFound) {
- this._dataGrid.removeChild(childNode);
- continue;
- }
-
- keyFound = true;
- childNode.data.value = value;
- childNode.refresh();
- }
- }
- this._sortDataGrid();
- },
-
- updateLayout: function()
- {
- if (this._dataGrid)
- this._dataGrid.updateLayout();
- },
-
- get scrollableElements()
- {
- if (!this._dataGrid)
- return [];
- return [this._dataGrid.scrollContainer];
- },
-
- // Private
-
- _sortDataGrid: function()
- {
- if (!this._dataGrid.sortOrder)
- return;
-
- var sortColumnIdentifier = this._dataGrid.sortColumnIdentifier || "key";
-
- function comparator(a, b)
- {
- return b.data[sortColumnIdentifier].localeCompare(a.data[sortColumnIdentifier]);
- }
-
- this._dataGrid.sortNodes(comparator, this._dataGrid.sortOrder);
- },
-
- _deleteCallback: function(node)
- {
- if (!node || node.isPlaceholderNode)
- return;
-
- this._dataGrid.removeChild(node);
- this.representedObject.removeItem(node.data["key"]);
- },
-
- _editingCallback: function(editingNode, columnIdentifier, oldText, newText, moveDirection)
- {
- var key = editingNode.data["key"].trim();
- var value = editingNode.data["value"].trim();
- var previousValue = oldText.trim();
- var enteredValue = newText.trim();
- var columnIndex = this._dataGrid.orderedColumns.indexOf(columnIdentifier);
- var mayMoveToNextRow = moveDirection === "forward" && columnIndex == this._dataGrid.orderedColumns.length - 1;
- var mayMoveToPreviousRow = moveDirection === "backward" && columnIndex == 0;
- var willMoveRow = mayMoveToNextRow || mayMoveToPreviousRow;
- var shouldCommitRow = willMoveRow && key.length && value.length;
-
- // Remove the row if its values are newly cleared, and it's not a placeholder.
- if (!key.length && !value.length && willMoveRow) {
- if (previousValue.length && !editingNode.isPlaceholderNode)
- this._dataGrid.removeChild(editingNode);
- return;
- }
-
- // If the key field was deleted, restore it when committing the row.
- if (key === enteredValue && !key.length) {
- if (willMoveRow && !editingNode.isPlaceholderNode) {
- editingNode.data.key = previousValue;
- editingNode.refresh();
- } else
- editingNode.element.classList.add(WebInspector.DOMStorageContentView.MissingKeyStyleClassName);
- } else if (key.length) {
- editingNode.element.classList.remove(WebInspector.DOMStorageContentView.MissingKeyStyleClassName);
- editingNode.__previousKeyValue = previousValue;
- }
-
- if (value === enteredValue && !value.length)
- editingNode.element.classList.add(WebInspector.DOMStorageContentView.MissingValueStyleClassName);
- else
- editingNode.element.classList.remove(WebInspector.DOMStorageContentView.MissingValueStyleClassName);
-
- if (editingNode.isPlaceholderNode && previousValue !== enteredValue)
- this._dataGrid.addPlaceholderNode();
-
- if (!shouldCommitRow)
- return; // One of the inputs is missing, or we aren't moving between rows.
-
- var domStorage = this.representedObject;
- if (domStorage.entries.has(key)) {
- editingNode.element.classList.add(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName);
- return;
- }
-
- editingNode.element.classList.remove(WebInspector.DOMStorageContentView.DuplicateKeySyleClassName);
-
- if (editingNode.__previousKeyValue != key)
- domStorage.removeItem(editingNode.__previousKeyValue);
-
- domStorage.setItem(key, value);
- // The table will be re-sorted when the backend fires the itemUpdated event.
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.local-storage-icon .icon {
- content: -webkit-image-set(url(Images/LocalStorage.png) 1x, url(Images/LocalStorage@2x.png) 2x);
-}
-
-.session-storage-icon .icon {
- content: -webkit-image-set(url(Images/SessionStorage.png) 1x, url(Images/SessionStorage@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,118 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageObject = function(id, host, isLocalStorage)
-{
- this._id = id;
- this._host = host;
- this._isLocalStorage = isLocalStorage;
- this._entries = new Map;
-};
-
-WebInspector.DOMStorageObject.TypeIdentifier = "dom-storage";
-WebInspector.DOMStorageObject.HostCookieKey = "dom-storage-object-host";
-WebInspector.DOMStorageObject.LocalStorageCookieKey = "dom-storage-object-local-storage";
-
-WebInspector.DOMStorageObject.Event = {
- ItemsCleared: "dom-storage-object-items-cleared",
- ItemAdded: "dom-storage-object-item-added",
- ItemRemoved: "dom-storage-object-item-removed",
- ItemUpdated: "dom-storage-object-updated",
-};
-
-WebInspector.DOMStorageObject.prototype = {
- constructor: WebInspector.DOMStorageObject,
- __proto__: WebInspector.Object.prototype,
-
- get id()
- {
- return this._id;
- },
-
- get host()
- {
- return this._host;
- },
-
- get entries()
- {
- return this._entries;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.DOMStorageObject.HostCookieKey] = this.host;
- cookie[WebInspector.DOMStorageObject.LocalStorageCookieKey] = this.isLocalStorage();
- },
-
- isLocalStorage: function()
- {
- return this._isLocalStorage;
- },
-
- getEntries: function(callback)
- {
- // COMPATIBILITY (iOS 6): The getDOMStorageItems function was later renamed to getDOMStorageItems.
- if (DOMStorageAgent.getDOMStorageEntries)
- DOMStorageAgent.getDOMStorageEntries(this._id, callback);
- else
- DOMStorageAgent.getDOMStorageItems(this._id, callback);
- },
-
- removeItem: function(key)
- {
- DOMStorageAgent.removeDOMStorageItem(this._id, key);
- },
-
- setItem: function(key, value)
- {
- DOMStorageAgent.setDOMStorageItem(this._id, key, value);
- },
-
- itemsCleared: function()
- {
- this._entries.clear();
- this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemsCleared);
- },
-
- itemRemoved: function(key)
- {
- this._entries.delete(key);
- this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemRemoved, {key: key});
- },
-
- itemAdded: function(key, value)
- {
- this._entries.set(key, value);
- this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemAdded, {key: key, value: value});
- },
-
- itemUpdated: function(key, oldValue, value)
- {
- this._entries.set(key, value);
- var data = {key: key, oldValue: oldValue, value: value};
- this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemUpdated, data);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.DOMStorageObserver.prototype = {
- constructor: WebInspector.DOMStorageObserver,
- __proto__: WebInspector.Object.prototype,
-
- // Events defined by the "DOMStorage" domain.
-
- // COMPATIBILITY (iOS 6): This event no longer exists. It is still needed and called on iOS 6.
- addDOMStorage: function(storage)
- {
- WebInspector.storageManager.domStorageWasAdded(storage.id, storage.host, storage.isLocalStorage);
- },
-
- // COMPATIBILITY (iOS 6): This event was split into the granular events below.
- updateDOMStorage: function(storageId)
- {
- WebInspector.storageManager.domStorageWasUpdated(storageId);
- },
-
- domStorageItemsCleared: function(storageId)
- {
- WebInspector.storageManager.itemsCleared(storageId);
- },
-
- domStorageItemRemoved: function(storageId, key)
- {
- WebInspector.storageManager.itemRemoved(storageId, key);
- },
-
- domStorageItemAdded: function(storageId, key, value)
- {
- WebInspector.storageManager.itemAdded(storageId, key, value);
- },
-
- domStorageItemUpdated: function(storageId, key, oldValue, value)
- {
- WebInspector.storageManager.itemUpdated(storageId, key, oldValue, value);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMStorageTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMStorageTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMStorageTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMStorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.DOMStorageObject);
-
- if (representedObject.isLocalStorage())
- var className = WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName;
- else
- var className = WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName;
-
- WebInspector.StorageTreeElement.call(this, className, WebInspector.displayNameForHost(representedObject.host), representedObject);
-};
-
-WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName = "local-storage-icon";
-WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName = "session-storage-icon";
-
-WebInspector.DOMStorageTreeElement.prototype = {
- constructor: WebInspector.DOMStorageTreeElement,
-
- // Public
-
- get name()
- {
- return WebInspector.displayNameForHost(this.representedObject.host);
- },
-
- get categoryName()
- {
- if (this.representedObject.isLocalStorage())
- return WebInspector.UIString("Local Storage");
- return WebInspector.UIString("Session Storage");
- }
-};
-
-WebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTree.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTree.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,334 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTree = function(frame)
-{
- WebInspector.Object.call(this);
-
- this._frame = frame;
-
- this._rootDOMNode = null;
- this._requestIdentifier = 0;
- this._flowMap = {};
-
- this._frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextChanged, this);
-
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._documentUpdated, this);
-
- // Only add extra event listeners when not the main frame. Since DocumentUpdated is enough for the main frame.
- if (!this._frame.isMainFrame()) {
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
- this._frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._frameMainResourceDidChange, this);
- }
-
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowListWasUpdated, this._contentFlowListWasUpdated, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasAdded, this._contentFlowWasAdded, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasRemoved, this._contentFlowWasRemoved, this);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.DOMTree);
-
-WebInspector.DOMTree.Event = {
- RootDOMNodeInvalidated: "dom-tree-root-dom-node-invalidated",
- ContentFlowWasAdded: "dom-tree-content-flow-was-added",
- ContentFlowWasRemoved: "dom-tree-content-flow-was-removed"
-};
-
-WebInspector.DOMTree.prototype = {
- constructor: WebInspector.DOMTree,
-
- // Public
-
- get frame()
- {
- return this._frame;
- },
-
- get flowMap()
- {
- return this._flowMap;
- },
-
- get flowsCount()
- {
- return Object.keys(this._flowMap).length;
- },
-
- invalidate: function()
- {
- // Set to null so it is fetched again next time requestRootDOMNode is called.
- this._rootDOMNode = null;
-
- // Clear the pending callbacks. It is the responsibility of the client to listen for
- // the RootDOMNodeInvalidated event and request the root DOM node again.
- delete this._pendingRootDOMNodeRequests;
-
- if (this._invalidateTimeoutIdentifier)
- return;
-
- function performInvalidate()
- {
- delete this._invalidateTimeoutIdentifier;
-
- this.dispatchEventToListeners(WebInspector.DOMTree.Event.RootDOMNodeInvalidated);
- }
-
- // Delay the invalidation on a timeout to coalesce multiple calls to invalidate.
- this._invalidateTimeoutIdentifier = setTimeout(performInvalidate.bind(this), 0);
- },
-
- requestRootDOMNode: function(callback)
- {
- console.assert(typeof callback === "function");
- if (typeof callback !== "function")
- return;
-
- if (this._rootDOMNode) {
- callback(this._rootDOMNode);
- return;
- }
-
- if (!this._frame.isMainFrame() && WebInspector.ExecutionContext.supported() && !this._frame.pageExecutionContext) {
- this._rootDOMNodeRequestWaitingForExecutionContext = true;
- if (!this._pendingRootDOMNodeRequests)
- this._pendingRootDOMNodeRequests = [];
- this._pendingRootDOMNodeRequests.push(callback);
- return;
- }
-
- if (this._pendingRootDOMNodeRequests) {
- this._pendingRootDOMNodeRequests.push(callback);
- return;
- }
-
- this._pendingRootDOMNodeRequests = [callback];
- this._requestRootDOMNode();
- },
-
- // Private
-
- _requestRootDOMNode: function()
- {
- console.assert(this._frame.isMainFrame() || !WebInspector.ExecutionContext.supported() || this._frame.pageExecutionContext);
- console.assert(this._pendingRootDOMNodeRequests.length);
-
- // Bump the request identifier. This prevents pending callbacks for previous requests from completing.
- var requestIdentifier = ++this._requestIdentifier;
-
- function rootObjectAvailable(error, result)
- {
- // Check to see if we have been invalidated (if the callbacks were cleared).
- if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
- return;
-
- if (error) {
- console.error(JSON.stringify(error));
-
- this._rootDOMNode = null;
- dispatchCallbacks.call(this);
- return;
- }
-
- // Convert the RemoteObject to a DOMNode by asking the backend to push it to us.
- var remoteObject = WebInspector.RemoteObject.fromPayload(result);
- remoteObject.pushNodeToFrontend(rootDOMNodeAvailable.bind(this, remoteObject));
- }
-
- function rootDOMNodeAvailable(remoteObject, nodeId)
- {
- remoteObject.release();
-
- // Check to see if we have been invalidated (if the callbacks were cleared).
- if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
- return;
-
- if (!nodeId) {
- this._rootDOMNode = null;
- dispatchCallbacks.call(this);
- return;
- }
-
- this._rootDOMNode = WebInspector.domTreeManager.nodeForId(nodeId);
-
- console.assert(this._rootDOMNode);
- if (!this._rootDOMNode) {
- dispatchCallbacks.call(this);
- return;
- }
-
- // Request the child nodes since the root node is often not shown in the UI,
- // and the child nodes will be needed immediately.
- this._rootDOMNode.getChildNodes(dispatchCallbacks.bind(this));
- }
-
- function mainDocumentAvailable(document)
- {
- this._rootDOMNode = document;
-
- dispatchCallbacks.call(this);
- }
-
- function dispatchCallbacks()
- {
- // Check to see if we have been invalidated (if the callbacks were cleared).
- if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
- return;
-
- for (var i = 0; i < this._pendingRootDOMNodeRequests.length; ++i)
- this._pendingRootDOMNodeRequests[i](this._rootDOMNode);
- delete this._pendingRootDOMNodeRequests;
- }
-
- // For the main frame we can use the more straight forward requestDocument function. For
- // child frames we need to do a more roundabout approach since the protocol does not include
- // a specific way to request a document given a frame identifier. The child frame approach
- // involves evaluating the JavaScript "document" and resolving that into a DOMNode.
- if (this._frame.isMainFrame())
- WebInspector.domTreeManager.requestDocument(mainDocumentAvailable.bind(this));
- else {
- // COMPATIBILITY (iOS 6): Execution context identifiers (contextId) did not exist
- // in iOS 6. Fallback to including the frame identifier (frameId).
- var contextId = this._frame.pageExecutionContext ? this._frame.pageExecutionContext.id : undefined;
- RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "", includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, contextId: contextId, frameId: this._frame.id, returnByValue: false, generatePreview: false}, rootObjectAvailable.bind(this));
- }
- },
-
- _nodeRemoved: function(event)
- {
- console.assert(!this._frame.isMainFrame());
-
- if (event.data.node !== this._rootDOMNode)
- return;
-
- this.invalidate();
- },
-
- _documentUpdated: function(event)
- {
- this.invalidate();
- },
-
- _frameMainResourceDidChange: function(event)
- {
- console.assert(!this._frame.isMainFrame());
-
- this.invalidate();
- },
-
- _framePageExecutionContextChanged: function(event)
- {
- if (this._rootDOMNodeRequestWaitingForExecutionContext) {
- console.assert(this._frame.pageExecutionContext);
- console.assert(this._pendingRootDOMNodeRequests && this._pendingRootDOMNodeRequests.length);
-
- delete this._rootDOMNodeRequestWaitingForExecutionContext;
-
- this._requestRootDOMNode();
- }
- },
-
- requestContentFlowList: function()
- {
- this.requestRootDOMNode(function(rootNode) {
- // Let the backend know we are interested about the named flow events for this document.
- WebInspector.domTreeManager.getNamedFlowCollection(rootNode.id);
- });
- },
-
- _isContentFlowInCurrentDocument: function(flow)
- {
- return this._rootDOMNode && this._rootDOMNode.id === flow.documentNodeIdentifier;
- },
-
- _contentFlowListWasUpdated: function(event)
- {
- if (!this._rootDOMNode || this._rootDOMNode.id !== event.data.documentNodeIdentifier)
- return;
-
- // Assume that all the flows have been removed.
- var deletedFlows = {};
- for (var flowId in this._flowMap)
- deletedFlows[flowId] = this._flowMap[flowId];
-
- var newFlows = [];
-
- var flows = event.data.flows;
- for (var i = 0; i < flows.length; ++i) {
- var flow = flows[i];
- // All the flows received from WebKit are part of the same document.
- console.assert(this._isContentFlowInCurrentDocument(flow));
-
- var flowId = flow.id;
- if (this._flowMap.hasOwnProperty(flowId)) {
- // Remove the flow name from the deleted list.
- console.assert(deletedFlows.hasOwnProperty(flowId));
- delete deletedFlows[flowId];
- } else {
- this._flowMap[flowId] = flow;
- newFlows.push(flow);
- }
- }
-
- for (var flowId in deletedFlows) {
- delete this._flowMap[flowId];
- }
-
- // Send update events to listeners.
-
- for (var flowId in deletedFlows)
- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: deletedFlows[flowId]});
-
- for (var i = 0; i < newFlows.length; ++i)
- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: newFlows[i]});
- },
-
- _contentFlowWasAdded: function(event)
- {
- var flow = event.data.flow;
- if (!this._isContentFlowInCurrentDocument(flow))
- return;
-
- var flowId = flow.id;
- console.assert(!this._flowMap.hasOwnProperty(flowId));
- this._flowMap[flowId] = flow;
-
- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: flow});
- },
-
- _contentFlowWasRemoved: function(event)
- {
- var flow = event.data.flow;
- if (!this._isContentFlowInCurrentDocument(flow))
- return;
-
- var flowId = flow.id;
- console.assert(this._flowMap.hasOwnProperty(flowId));
- delete this._flowMap[flowId];
-
- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: flow});
- }
-};
-
-WebInspector.DOMTree.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.dom-tree {
- overflow: auto;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,426 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeContentView = function(representedObject)
-{
- console.assert(representedObject);
-
- WebInspector.ContentView.call(this, representedObject);
-
- this._compositingBordersButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("layer-borders", WebInspector.UIString("Show compositing borders"), WebInspector.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 16, 16);
- this._compositingBordersButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this);
- this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible;
-
- WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
- this._showsShadowDOMButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("shows-shadow-DOM", WebInspector.UIString("Show shadow DOM nodes"), WebInspector.UIString("Hide shadow DOM nodes"), "Images/ShadowDOM.svg", 16, 16);
- this._showsShadowDOMButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleShowsShadowDOMSetting, this);
- this._showShadowDOMSettingChanged();
-
- this.element.classList.add(WebInspector.DOMTreeContentView.StyleClassName);
- this.element.addEventListener("click", this._mouseWasClicked.bind(this), false);
-
- this._domTreeOutline = new WebInspector.DOMTreeOutline(true, true, false);
- this._domTreeOutline.addEventListener(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged, this._selectedNodeDidChange, this);
- this._domTreeOutline.wireToDomAgent();
- this.element.appendChild(this._domTreeOutline.element);
-
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._domNodeChanged, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._domNodeChanged, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified, this._domNodeChanged, this);
-
- this._lastSelectedNodePathSetting = new WebInspector.Setting("last-selected-node-path", null);
-
- this._numberOfSearchResults = null;
-};
-
-WebInspector.DOMTreeContentView.StyleClassName = "dom-tree";
-
-WebInspector.DOMTreeContentView.prototype = {
- constructor: WebInspector.DOMTreeContentView,
- __proto__: WebInspector.ContentView.prototype,
-
- // Public
-
- get navigationItems()
- {
- return [this._showsShadowDOMButtonNavigationItem, this._compositingBordersButtonNavigationItem];
- },
-
- get domTreeOutline()
- {
- return this._domTreeOutline;
- },
-
- get scrollableElements()
- {
- return [this.element];
- },
-
- updateLayout: function()
- {
- this._domTreeOutline.updateSelection();
- },
-
- shown: function()
- {
- this._domTreeOutline.setVisible(true, WebInspector.isConsoleFocused());
- this._updateCompositingBordersButtonToMatchPageSettings();
- },
-
- hidden: function()
- {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- this._domTreeOutline.setVisible(false);
- },
-
- closed: function()
- {
- WebInspector.domTreeManager.removeEventListener(null, null, this);
-
- this._domTreeOutline.close();
- },
-
- get selectionPathComponents()
- {
- var treeElement = this._domTreeOutline.selectedTreeElement;
- var pathComponents = [];
-
- while (treeElement && !treeElement.root) {
- // The close tag is contained within the element it closes. So skip it since we don't want to
- // show the same node twice in the hierarchy.
- if (treeElement.isCloseTag()) {
- treeElement = treeElement.parent;
- continue;
- }
-
- var pathComponent = new WebInspector.DOMTreeElementPathComponent(treeElement, treeElement.representedObject);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- pathComponents.unshift(pathComponent);
- treeElement = treeElement.parent;
- }
-
- return pathComponents;
- },
-
- selectAndRevealDOMNode: function(domNode, preventFocusChange)
- {
- this._domTreeOutline.selectDOMNode(domNode, !preventFocusChange);
- },
-
- handleCopyEvent: function(event)
- {
- var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
- if (!selectedDOMNode)
- return;
-
- event.clipboardData.clearData();
- event.preventDefault();
-
- selectedDOMNode.copyNode();
- },
-
- get supportsSave()
- {
- return WebInspector.canArchiveMainFrame();
- },
-
- get saveData()
- {
- function saveHandler(forceSaveAs)
- {
- WebInspector.archiveMainFrame();
- }
-
- return { customSaveHandler: saveHandler };
- },
-
- get supportsSearch()
- {
- return true;
- },
-
- get numberOfSearchResults()
- {
- return this._numberOfSearchResults;
- },
-
- get hasPerformedSearch()
- {
- return this._numberOfSearchResults !== null;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- this._automaticallyRevealFirstSearchResult = reveal;
-
- // If we haven't shown a search result yet, reveal one now.
- if (this._automaticallyRevealFirstSearchResult && this._numberOfSearchResults > 0) {
- if (this._currentSearchResultIndex === -1)
- this.revealNextSearchResult();
- }
- },
-
- performSearch: function(query)
- {
- if (this._searchQuery === query)
- return;
-
- if (this._searchIdentifier)
- DOMAgent.discardSearchResults(this._searchIdentifier);
-
- this._searchQuery = query;
- this._searchIdentifier = null;
- this._numberOfSearchResults = null;
- this._currentSearchResultIndex = -1;
-
- function searchResultsReady(error, searchIdentifier, resultsCount)
- {
- if (error)
- return;
-
- this._searchIdentifier = searchIdentifier;
- this._numberOfSearchResults = resultsCount;
-
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
-
- if (this._automaticallyRevealFirstSearchResult)
- this.revealNextSearchResult();
- }
-
- function contextNodesReady(nodeIds)
- {
- DOMAgent.performSearch(query, nodeIds, searchResultsReady.bind(this));
- }
-
- this.getSearchContextNodes(contextNodesReady.bind(this));
- },
-
- getSearchContextNodes: function(callback)
- {
- // Overwrite this to limit the search to just a subtree.
- // Passing undefined will make DOMAgent.performSearch search through all the documents.
- callback(undefined);
- },
-
- searchCleared: function()
- {
- if (this._searchIdentifier)
- DOMAgent.discardSearchResults(this._searchIdentifier);
-
- this._searchQuery = null;
- this._searchIdentifier = null;
- this._numberOfSearchResults = null;
- this._currentSearchResultIndex = -1;
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- if (!this._numberOfSearchResults)
- return;
-
- if (this._currentSearchResultIndex > 0)
- --this._currentSearchResultIndex;
- else
- this._currentSearchResultIndex = this._numberOfSearchResults - 1;
-
- this._revealSearchResult(this._currentSearchResultIndex, changeFocus);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- if (!this._numberOfSearchResults)
- return;
-
- if (this._currentSearchResultIndex + 1 < this._numberOfSearchResults)
- ++this._currentSearchResultIndex;
- else
- this._currentSearchResultIndex = 0;
-
- this._revealSearchResult(this._currentSearchResultIndex, changeFocus);
- },
-
- // Private
-
- _revealSearchResult: function(index, changeFocus)
- {
- console.assert(this._searchIdentifier);
-
- var searchIdentifier = this._searchIdentifier;
-
- function revealResult(error, nodeIdentifiers)
- {
- if (error)
- return;
-
- // Bail if the searchIdentifier changed since we started.
- if (this._searchIdentifier !== searchIdentifier)
- return;
-
- console.assert(nodeIdentifiers.length === 1);
-
- var domNode = WebInspector.domTreeManager.nodeForId(nodeIdentifiers[0]);
- console.assert(domNode);
- if (!domNode)
- return;
-
- this._domTreeOutline.selectDOMNode(domNode, changeFocus);
- }
-
- DOMAgent.getSearchResults(this._searchIdentifier, index, index + 1, revealResult.bind(this));
- },
-
- _restoreSelectedNodeAfterUpdate: function(documentURL, defaultNode)
- {
- function selectNode(lastSelectedNode)
- {
- var nodeToFocus = lastSelectedNode;
- if (!nodeToFocus)
- nodeToFocus = defaultNode;
-
- if (!nodeToFocus)
- return;
-
- this._dontSetLastSelectedNodePath = true;
- this.selectAndRevealDOMNode(nodeToFocus, WebInspector.isConsoleFocused());
- this._dontSetLastSelectedNodePath = false;
-
- // If this wasn't the last selected node, then expand it.
- if (!lastSelectedNode && this._domTreeOutline.selectedTreeElement)
- this._domTreeOutline.selectedTreeElement.expand();
- }
-
- function selectLastSelectedNode(nodeId)
- {
- selectNode.call(this, WebInspector.domTreeManager.nodeForId(nodeId));
- }
-
- if (documentURL && this._lastSelectedNodePathSetting.value && this._lastSelectedNodePathSetting.value.path && this._lastSelectedNodePathSetting.value.url === documentURL.hash)
- WebInspector.domTreeManager.pushNodeByPathToFrontend(this._lastSelectedNodePathSetting.value.path, selectLastSelectedNode.bind(this));
- else
- selectNode.call(this);
- },
-
- _selectedNodeDidChange: function(event)
- {
- var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
- if (selectedDOMNode && !this._dontSetLastSelectedNodePath)
- this._lastSelectedNodePathSetting.value = {url: selectedDOMNode.ownerDocument.documentURL.hash, path: selectedDOMNode.path()};
-
- if (selectedDOMNode)
- ConsoleAgent.addInspectedNode(selectedDOMNode.id);
-
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- },
-
- _pathComponentSelected: function(event)
- {
- console.assert(event.data.pathComponent instanceof WebInspector.DOMTreeElementPathComponent);
- console.assert(event.data.pathComponent.domTreeElement instanceof WebInspector.DOMTreeElement);
-
- this._domTreeOutline.selectDOMNode(event.data.pathComponent.domTreeElement.representedObject, true);
- },
-
- _domNodeChanged: function(event)
- {
- var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
- if (selectedDOMNode !== event.data.node)
- return;
-
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- },
-
- _mouseWasClicked: function(event)
- {
- var anchorElement = event.target.enclosingNodeOrSelfWithNodeName("a");
- if (!anchorElement || !anchorElement.href)
- return;
-
- // Prevent the link from navigating, since we don't do any navigation by following links normally.
- event.preventDefault();
- event.stopPropagation();
-
- if (WebInspector.isBeingEdited(anchorElement)) {
- // Don't follow the link when it is being edited.
- return;
- }
-
- // Cancel any pending link navigation.
- if (this._followLinkTimeoutIdentifier) {
- clearTimeout(this._followLinkTimeoutIdentifier);
- delete this._followLinkTimeoutIdentifier;
- }
-
- // If this is a double-click (or multiple-click), return early.
- if (event.detail > 1)
- return;
-
- function followLink()
- {
- // Since followLink is delayed, the call to WebInspector.openURL can't look at window.event
- // to see if the command key is down like it normally would. So we need to do that check
- // before calling WebInspector.openURL.
- var alwaysOpenExternally = event ? event.metaKey : false;
- WebInspector.openURL(anchorElement.href, this._frame, alwaysOpenExternally, anchorElement.lineNumber);
- }
-
- // Start a timeout since this is a single click, if the timeout is canceled before it fires,
- // then a double-click happened or another link was clicked.
- // FIXME: The duration might be longer or shorter than the user's configured double click speed.
- this._followLinkTimeoutIdentifier = setTimeout(followLink.bind(this), 333);
- },
-
- _toggleCompositingBorders: function(event)
- {
- console.assert(PageAgent.setCompositingBordersVisible);
-
- var activated = !this._compositingBordersButtonNavigationItem.activated;
- this._compositingBordersButtonNavigationItem.activated = activated;
- PageAgent.setCompositingBordersVisible(activated);
- },
-
- _updateCompositingBordersButtonToMatchPageSettings: function()
- {
- if (!PageAgent.getCompositingBordersVisible)
- return;
-
- var button = this._compositingBordersButtonNavigationItem;
-
- // We need to sync with the page settings since these can be controlled
- // in a different way than just using the navigation bar button.
- PageAgent.getCompositingBordersVisible(function(error, compositingBordersVisible) {
- button.activated = error ? false : compositingBordersVisible;
- });
- },
-
- _showShadowDOMSettingChanged: function(event)
- {
- this._showsShadowDOMButtonNavigationItem.activated = WebInspector.showShadowDOMSetting.value;
- },
-
- _toggleShowsShadowDOMSetting: function(event)
- {
- WebInspector.showShadowDOMSetting.value = !WebInspector.showShadowDOMSetting.value;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,101 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
- .dom-tree-data-grid .data-grid {
- position: relative;
- top: 0;
- width: 100%;
- height: 100%;
- /* Turn off the default borders, we want to snap to edges. */
- border: none;
-}
-
-.dom-tree-data-grid .data-grid table.data {
- background-size: 100% 44px;
-}
-
-.dom-tree-data-grid .data-container {
- position: absolute;
- /* Leave room for the data grid header. */
- top: 16px;
- /* Use all remaining vertical space in the container. */
- bottom: 0;
- /* Let the inline table content scroll, independently of the header. */
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-.dom-tree-data-grid .data-container tr {
- height: 22px;
-}
-
-.dom-tree-data-grid .data-container td > div {
- display: -webkit-flex;
- width: 100%;
- height: 100%;
- -webkit-align-items: center;
- -webkit-justify-content: flex-end;
-}
-
-.dom-tree-data-grid .data-container .name-column {
- padding-right: 0;
-}
-
-.dom-tree-data-grid .data-container .name-column .icon {
- vertical-align: top;
- width: 16px;
- height: 16px;
- /* FIXME: There can be multiple types of DOM nodes that we might need to support in the future. */
- content: url(Images/DOMElement.svg);
-}
-
-.dom-tree-data-grid .data-container .name-column .label {
- -webkit-flex: 1;
- padding: 0 4px;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.dom-tree-data-grid .data-container tr:hover .name-column .label {
- padding-right: 0;
-}
-
-.dom-tree-data-grid .data-container .go-to-arrow {
- display: none;
-}
-
-.dom-tree-data-grid .data-container tr:hover .go-to-arrow {
- display: block;
-}
-
-.dom-tree-data-grid .data-container tbody > tr:nth-child(2n) {
- background-color: white;
-}
-
-.dom-tree-data-grid .data-container tbody > tr:nth-child(2n+1) {
- background-color: rgb(243, 246, 250);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeDataGrid = function() {
- WebInspector.DataGrid.call(this, {
- name: { title: WebInspector.UIString("Node"), sortable: false }
- });
-
- this._previousHoveredElement = null;
-
- this.element.classList.add("dom-tree-data-grid");
-
- this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
- this.element.addEventListener("mouseout", this._onmouseout.bind(this), false);
-};
-
-WebInspector.DOMTreeDataGrid.prototype = {
- constructor: WebInspector.DOMTreeDataGrid,
- __proto__: WebInspector.DataGrid.prototype,
-
- _onmousemove: function(event)
- {
- var gridNode = this.dataGridNodeFromNode(event.target);
- if (!gridNode || this._previousHoveredElement === gridNode.domNode)
- return;
- this._previousHoveredElement = gridNode.domNode;
- WebInspector.domTreeManager.highlightDOMNode(gridNode.domNode.id);
- },
-
- _onmouseout: function(event) {
- if (!this._previousHoveredElement)
- return;
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- this._previousHoveredElement = null;
- }
-};
-
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,89 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeDataGridNode = function(domNode)
-{
- WebInspector.DataGridNode.call(this);
-
- this._nameLabel = null;
- this._domNode = domNode;
- this._updateNodeName();
-};
-
-WebInspector.DOMTreeDataGridNode.prototype = {
- constructor: WebInspector.DOMTreeDataGridNode,
- __proto__: WebInspector.DataGridNode.prototype,
-
- get domNode()
- {
- return this._domNode;
- },
-
- // DataGridNode Overrides.
-
- createCellContent: function(columnIdentifier, cell)
- {
- if (columnIdentifier !== "name")
- return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
-
- var cell = this._makeNameCell();
- this._updateNameCellData();
- return cell;
- },
-
- // Private
-
- _updateNodeName: function()
- {
- this.data = {name: WebInspector.displayNameForNode(this._domNode)};
- },
-
- _makeNameCell: function()
- {
- var fragment = document.createDocumentFragment();
-
- fragment.appendChild(document.createElement("img")).className = "icon";
-
- this._nameLabel = document.createElement("div");
- this._nameLabel.className = "label";
- fragment.appendChild(this._nameLabel);
-
- var goToButton = fragment.appendChild(WebInspector.createGoToArrowButton());
- goToButton.addEventListener("click", this._goToArrowWasClicked.bind(this), false);
-
- return fragment;
- },
-
- _updateNameCellData: function()
- {
- this._nameLabel.textContent = this.data.name;
- },
-
- _goToArrowWasClicked: function()
- {
- WebInspector.resourceSidebarPanel.showMainFrameDOMTree(this._domNode, true);
- }
-};
-
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1319 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-/**
- * @constructor
- * @extends {TreeElement}
- * @param {boolean=} elementCloseTag
- */
-WebInspector.DOMTreeElement = function(node, elementCloseTag)
-{
- this._elementCloseTag = elementCloseTag;
- var hasChildrenOverride = !elementCloseTag && node.hasChildNodes() && !this._showInlineText(node);
-
- // The title will be updated in onattach.
- TreeElement.call(this, "", node, hasChildrenOverride);
-
- if (this.representedObject.nodeType() == Node.ELEMENT_NODE && !elementCloseTag)
- this._canAddAttributes = true;
- this._searchQuery = null;
- this._expandedChildrenLimit = WebInspector.DOMTreeElement.InitialChildrenLimit;
-}
-
-WebInspector.DOMTreeElement.InitialChildrenLimit = 500;
-WebInspector.DOMTreeElement.MaximumInlineTextChildLength = 80;
-
-// A union of HTML4 and HTML5-Draft elements that explicitly
-// or implicitly (for HTML5) forbid the closing tag.
-// FIXME: Revise once HTML5 Final is published.
-WebInspector.DOMTreeElement.ForbiddenClosingTagElements = [
- "area", "base", "basefont", "br", "canvas", "col", "command", "embed", "frame",
- "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source"
-].keySet();
-
-// These tags we do not allow editing their tag name.
-WebInspector.DOMTreeElement.EditTagBlacklist = [
- "html", "head", "body"
-].keySet();
-
-WebInspector.DOMTreeElement.prototype = {
- isCloseTag: function()
- {
- return this._elementCloseTag;
- },
-
- highlightSearchResults: function(searchQuery)
- {
- if (this._searchQuery !== searchQuery) {
- this._updateSearchHighlight(false);
- delete this._highlightResult; // A new search query.
- }
-
- this._searchQuery = searchQuery;
- this._searchHighlightsVisible = true;
- this.updateTitle(true);
- },
-
- hideSearchHighlights: function()
- {
- delete this._searchHighlightsVisible;
- this._updateSearchHighlight(false);
- },
-
- _updateSearchHighlight: function(show)
- {
- if (!this._highlightResult)
- return;
-
- function updateEntryShow(entry)
- {
- switch (entry.type) {
- case "added":
- entry.parent.insertBefore(entry.node, entry.nextSibling);
- break;
- case "changed":
- entry.node.textContent = entry.newText;
- break;
- }
- }
-
- function updateEntryHide(entry)
- {
- switch (entry.type) {
- case "added":
- if (entry.node.parentElement)
- entry.node.parentElement.removeChild(entry.node);
- break;
- case "changed":
- entry.node.textContent = entry.oldText;
- break;
- }
- }
-
- var updater = show ? updateEntryShow : updateEntryHide;
-
- for (var i = 0, size = this._highlightResult.length; i < size; ++i)
- updater(this._highlightResult[i]);
- },
-
- get hovered()
- {
- return this._hovered;
- },
-
- set hovered(x)
- {
- if (this._hovered === x)
- return;
-
- this._hovered = x;
-
- if (this.listItemElement) {
- if (x) {
- this.updateSelection();
- this.listItemElement.classList.add("hovered");
- } else {
- this.listItemElement.classList.remove("hovered");
- }
- }
- },
-
- get expandedChildrenLimit()
- {
- return this._expandedChildrenLimit;
- },
-
- set expandedChildrenLimit(x)
- {
- if (this._expandedChildrenLimit === x)
- return;
-
- this._expandedChildrenLimit = x;
- if (this.treeOutline && !this._updateChildrenInProgress)
- this._updateChildren(true);
- },
-
- get expandedChildCount()
- {
- var count = this.children.length;
- if (count && this.children[count - 1]._elementCloseTag)
- count--;
- if (count && this.children[count - 1].expandAllButton)
- count--;
- return count;
- },
-
- showChild: function(index)
- {
- if (this._elementCloseTag)
- return;
-
- if (index >= this.expandedChildrenLimit) {
- this._expandedChildrenLimit = index + 1;
- this._updateChildren(true);
- }
-
- // Whether index-th child is visible in the children tree
- return this.expandedChildCount > index;
- },
-
- _createTooltipForNode: function()
- {
- var node = /** @type {WebInspector.DOMNode} */ this.representedObject;
- if (!node.nodeName() || node.nodeName().toLowerCase() !== "img")
- return;
-
- function setTooltip(result)
- {
- if (!result || result.type !== "string")
- return;
-
- try {
- var properties = JSON.parse(result.description);
- var offsetWidth = properties[0];
- var offsetHeight = properties[1];
- var naturalWidth = properties[2];
- var naturalHeight = properties[3];
- if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
- this.tooltip = WebInspector.UIString("%d \xd7 %d pixels").format(offsetWidth, offsetHeight);
- else
- this.tooltip = WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)").format(offsetWidth, offsetHeight, naturalWidth, naturalHeight);
- } catch (e) {
- console.error(e);
- }
- }
-
- function resolvedNode(object)
- {
- if (!object)
- return;
-
- function dimensions()
- {
- return "[" + this.offsetWidth + "," + this.offsetHeight + "," + this.naturalWidth + "," + this.naturalHeight + "]";
- }
-
- object.callFunction(dimensions, undefined, setTooltip.bind(this));
- object.release();
- }
- WebInspector.RemoteObject.resolveNode(node, "", resolvedNode.bind(this));
- },
-
- updateSelection: function()
- {
- var listItemElement = this.listItemElement;
- if (!listItemElement)
- return;
-
- if (document.body.offsetWidth <= 0) {
- // The stylesheet hasn't loaded yet or the window is closed,
- // so we can't calculate what is need. Return early.
- return;
- }
-
- if (!this.selectionElement) {
- this.selectionElement = document.createElement("div");
- this.selectionElement.className = "selection selected";
- listItemElement.insertBefore(this.selectionElement, listItemElement.firstChild);
- }
-
- this.selectionElement.style.height = listItemElement.offsetHeight + "px";
- },
-
- onattach: function()
- {
- if (this._hovered) {
- this.updateSelection();
- this.listItemElement.classList.add("hovered");
- }
-
- this.updateTitle();
- this.listItemElement.draggable = true;
- this.listItemElement.addEventListener("dragstart", this);
- },
-
- onpopulate: function()
- {
- if (this.children.length || this._showInlineText(this.representedObject) || this._elementCloseTag)
- return;
-
- this.updateChildren();
- },
-
- expandRecursively: function()
- {
- function callback()
- {
- TreeElement.prototype.expandRecursively.call(this, Number.MAX_VALUE);
- }
-
- this.representedObject.getSubtree(-1, callback.bind(this));
- },
-
- /**
- * @param {boolean=} fullRefresh
- */
- updateChildren: function(fullRefresh)
- {
- if (this._elementCloseTag)
- return;
- this.representedObject.getChildNodes(this._updateChildren.bind(this, fullRefresh));
- },
-
- /**
- * @param {boolean=} closingTag
- */
- insertChildElement: function(child, index, closingTag)
- {
- var newElement = new WebInspector.DOMTreeElement(child, closingTag);
- newElement.selectable = this.treeOutline._selectEnabled;
- this.insertChild(newElement, index);
- return newElement;
- },
-
- moveChild: function(child, targetIndex)
- {
- var wasSelected = child.selected;
- this.removeChild(child);
- this.insertChild(child, targetIndex);
- if (wasSelected)
- child.select();
- },
-
- /**
- * @param {boolean=} fullRefresh
- */
- _updateChildren: function(fullRefresh)
- {
- if (this._updateChildrenInProgress || !this.treeOutline._visible)
- return;
-
- this._updateChildrenInProgress = true;
- var selectedNode = this.treeOutline.selectedDOMNode();
- var originalScrollTop = 0;
- if (fullRefresh) {
- var treeOutlineContainerElement = this.treeOutline.element.parentNode;
- originalScrollTop = treeOutlineContainerElement.scrollTop;
- var selectedTreeElement = this.treeOutline.selectedTreeElement;
- if (selectedTreeElement && selectedTreeElement.hasAncestor(this))
- this.select();
- this.removeChildren();
- }
-
- var treeElement = this;
- var treeChildIndex = 0;
- var elementToSelect;
-
- function updateChildrenOfNode(node)
- {
- var treeOutline = treeElement.treeOutline;
- var child = node.firstChild;
- while (child) {
- var currentTreeElement = treeElement.children[treeChildIndex];
- if (!currentTreeElement || currentTreeElement.representedObject !== child) {
- // Find any existing element that is later in the children list.
- var existingTreeElement = null;
- for (var i = (treeChildIndex + 1), size = treeElement.expandedChildCount; i < size; ++i) {
- if (treeElement.children[i].representedObject === child) {
- existingTreeElement = treeElement.children[i];
- break;
- }
- }
-
- if (existingTreeElement && existingTreeElement.parent === treeElement) {
- // If an existing element was found and it has the same parent, just move it.
- treeElement.moveChild(existingTreeElement, treeChildIndex);
- } else {
- // No existing element found, insert a new element.
- if (treeChildIndex < treeElement.expandedChildrenLimit) {
- var newElement = treeElement.insertChildElement(child, treeChildIndex);
- if (child === selectedNode)
- elementToSelect = newElement;
- if (treeElement.expandedChildCount > treeElement.expandedChildrenLimit)
- treeElement.expandedChildrenLimit++;
- }
- }
- }
-
- child = child.nextSibling;
- ++treeChildIndex;
- }
- }
-
- // Remove any tree elements that no longer have this node (or this node's contentDocument) as their parent.
- for (var i = (this.children.length - 1); i >= 0; --i) {
- var currentChild = this.children[i];
- var currentNode = currentChild.representedObject;
- var currentParentNode = currentNode.parentNode;
-
- if (currentParentNode === this.representedObject)
- continue;
-
- var selectedTreeElement = this.treeOutline.selectedTreeElement;
- if (selectedTreeElement && (selectedTreeElement === currentChild || selectedTreeElement.hasAncestor(currentChild)))
- this.select();
-
- this.removeChildAtIndex(i);
- }
-
- updateChildrenOfNode(this.representedObject);
- this.adjustCollapsedRange();
-
- var lastChild = this.children.lastValue;
- if (this.representedObject.nodeType() == Node.ELEMENT_NODE && (!lastChild || !lastChild._elementCloseTag))
- this.insertChildElement(this.representedObject, this.children.length, true);
-
- // We want to restore the original selection and tree scroll position after a full refresh, if possible.
- if (fullRefresh && elementToSelect) {
- elementToSelect.select();
- if (treeOutlineContainerElement && originalScrollTop <= treeOutlineContainerElement.scrollHeight)
- treeOutlineContainerElement.scrollTop = originalScrollTop;
- }
-
- delete this._updateChildrenInProgress;
- },
-
- adjustCollapsedRange: function()
- {
- // Ensure precondition: only the tree elements for node children are found in the tree
- // (not the Expand All button or the closing tag).
- if (this.expandAllButtonElement && this.expandAllButtonElement.__treeElement.parent)
- this.removeChild(this.expandAllButtonElement.__treeElement);
-
- const node = this.representedObject;
- if (!node.children)
- return;
- const childNodeCount = node.children.length;
-
- // In case some nodes from the expanded range were removed, pull some nodes from the collapsed range into the expanded range at the bottom.
- for (var i = this.expandedChildCount, limit = Math.min(this.expandedChildrenLimit, childNodeCount); i < limit; ++i)
- this.insertChildElement(node.children[i], i);
-
- const expandedChildCount = this.expandedChildCount;
- if (childNodeCount > this.expandedChildCount) {
- var targetButtonIndex = expandedChildCount;
- if (!this.expandAllButtonElement) {
- var button = document.createElement("button");
- button.className = "show-all-nodes";
- button.value = "";
- var item = new TreeElement(button, null, false);
- item.selectable = false;
- item.expandAllButton = true;
- this.insertChild(item, targetButtonIndex);
- this.expandAllButtonElement = item.listItemElement.firstChild;
- this.expandAllButtonElement.__treeElement = item;
- this.expandAllButtonElement.addEventListener("click", this.handleLoadAllChildren.bind(this), false);
- } else if (!this.expandAllButtonElement.__treeElement.parent)
- this.insertChild(this.expandAllButtonElement.__treeElement, targetButtonIndex);
- this.expandAllButtonElement.textContent = WebInspector.UIString("Show All Nodes (%d More)").format(childNodeCount - expandedChildCount);
- } else if (this.expandAllButtonElement)
- delete this.expandAllButtonElement;
- },
-
- handleLoadAllChildren: function()
- {
- this.expandedChildrenLimit = Math.max(this.representedObject.childNodeCount, this.expandedChildrenLimit + WebInspector.DOMTreeElement.InitialChildrenLimit);
- },
-
- onexpand: function()
- {
- if (this._elementCloseTag)
- return;
-
- this.updateTitle();
- this.treeOutline.updateSelection();
- },
-
- oncollapse: function()
- {
- if (this._elementCloseTag)
- return;
-
- this.updateTitle();
- this.treeOutline.updateSelection();
- },
-
- onreveal: function()
- {
- if (this.listItemElement) {
- var tagSpans = this.listItemElement.getElementsByClassName("html-tag-name");
- if (tagSpans.length)
- tagSpans[0].scrollIntoViewIfNeeded(false);
- else
- this.listItemElement.scrollIntoViewIfNeeded(false);
- }
- },
-
- onselect: function(treeElement, selectedByUser)
- {
- this.treeOutline.suppressRevealAndSelect = true;
- this.treeOutline.selectDOMNode(this.representedObject, selectedByUser);
- if (selectedByUser)
- WebInspector.domTreeManager.highlightDOMNode(this.representedObject.id);
- this.updateSelection();
- this.treeOutline.suppressRevealAndSelect = false;
- },
-
- ondeselect: function(treeElement)
- {
- this.treeOutline.selectDOMNode(null);
- },
-
- ondelete: function()
- {
- var startTagTreeElement = this.treeOutline.findTreeElement(this.representedObject);
- startTagTreeElement ? startTagTreeElement.remove() : this.remove();
- return true;
- },
-
- onenter: function()
- {
- // On Enter or Return start editing the first attribute
- // or create a new attribute on the selected element.
- if (this.treeOutline.editing)
- return false;
-
- this._startEditing();
-
- // prevent a newline from being immediately inserted
- return true;
- },
-
- selectOnMouseDown: function(event)
- {
- TreeElement.prototype.selectOnMouseDown.call(this, event);
-
- if (this._editing)
- return;
-
- // Prevent selecting the nearest word on double click.
- if (event.detail >= 2)
- event.preventDefault();
- },
-
- ondblclick: function(event)
- {
- if (this._editing || this._elementCloseTag)
- return;
-
- if (this._startEditingTarget(event.target))
- return;
-
- if (this.hasChildren && !this.expanded)
- this.expand();
- },
-
- _insertInLastAttributePosition: function(tag, node)
- {
- if (tag.getElementsByClassName("html-attribute").length > 0)
- tag.insertBefore(node, tag.lastChild);
- else {
- var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];
- tag.textContent = '';
- tag.appendChild(document.createTextNode('<'+nodeName));
- tag.appendChild(node);
- tag.appendChild(document.createTextNode('>'));
- }
-
- this.updateSelection();
- },
-
- _startEditingTarget: function(eventTarget)
- {
- if (this.treeOutline.selectedDOMNode() != this.representedObject)
- return;
-
- if (this.representedObject.nodeType() != Node.ELEMENT_NODE && this.representedObject.nodeType() != Node.TEXT_NODE)
- return false;
-
- var textNode = eventTarget.enclosingNodeOrSelfWithClass("html-text-node");
- if (textNode)
- return this._startEditingTextNode(textNode);
-
- var attribute = eventTarget.enclosingNodeOrSelfWithClass("html-attribute");
- if (attribute)
- return this._startEditingAttribute(attribute, eventTarget);
-
- var tagName = eventTarget.enclosingNodeOrSelfWithClass("html-tag-name");
- if (tagName)
- return this._startEditingTagName(tagName);
-
- var newAttribute = eventTarget.enclosingNodeOrSelfWithClass("add-attribute");
- if (newAttribute)
- return this._addNewAttribute();
-
- return false;
- },
-
- _populateTagContextMenu: function(contextMenu, event)
- {
- var attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
- var newAttribute = event.target.enclosingNodeOrSelfWithClass("add-attribute");
-
- // Add attribute-related actions.
- contextMenu.appendItem(WebInspector.UIString("Add Attribute"), this._addNewAttribute.bind(this));
- if (attribute && !newAttribute)
- contextMenu.appendItem(WebInspector.UIString("Edit Attribute"), this._startEditingAttribute.bind(this, attribute, event.target));
- contextMenu.appendSeparator();
-
- if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
- var pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
- this._populateForcedPseudoStateItems(pseudoSubMenu);
- contextMenu.appendSeparator();
- }
-
- this._populateNodeContextMenu(contextMenu);
- this.treeOutline._populateContextMenu(contextMenu, this.representedObject);
- },
-
- _populateForcedPseudoStateItems: function(subMenu)
- {
- var node = this.representedObject;
- var enabledPseudoClasses = node.enabledPseudoClasses;
- // These strings don't need to be localized as they are CSS pseudo-classes.
- WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(pseudoClass) {
- var label = pseudoClass.capitalize();
- var enabled = enabledPseudoClasses.contains(pseudoClass);
- subMenu.appendCheckboxItem(label, function() {
- node.setPseudoClassEnabled(pseudoClass, !enabled);
- }, enabled, false);
- });
- },
-
- _populateTextContextMenu: function(contextMenu, textNode)
- {
- contextMenu.appendItem(WebInspector.UIString("Edit Text"), this._startEditingTextNode.bind(this, textNode));
- this._populateNodeContextMenu(contextMenu);
- },
-
- _populateNodeContextMenu: function(contextMenu)
- {
- // Add free-form node-related actions.
- contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this));
- contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
- contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
- },
-
- _startEditing: function()
- {
- if (this.treeOutline.selectedDOMNode() !== this.representedObject)
- return;
-
- var listItem = this._listItemNode;
-
- if (this._canAddAttributes) {
- var attribute = listItem.getElementsByClassName("html-attribute")[0];
- if (attribute)
- return this._startEditingAttribute(attribute, attribute.getElementsByClassName("html-attribute-value")[0]);
-
- return this._addNewAttribute();
- }
-
- if (this.representedObject.nodeType() === Node.TEXT_NODE) {
- var textNode = listItem.getElementsByClassName("html-text-node")[0];
- if (textNode)
- return this._startEditingTextNode(textNode);
- return;
- }
- },
-
- _addNewAttribute: function()
- {
- // Cannot just convert the textual html into an element without
- // a parent node. Use a temporary span container for the HTML.
- var container = document.createElement("span");
- this._buildAttributeDOM(container, " ", "");
- var attr = container.firstChild;
- attr.style.marginLeft = "2px"; // overrides the .editing margin rule
- attr.style.marginRight = "2px"; // overrides the .editing margin rule
-
- var tag = this.listItemElement.getElementsByClassName("html-tag")[0];
- this._insertInLastAttributePosition(tag, attr);
- return this._startEditingAttribute(attr, attr);
- },
-
- _triggerEditAttribute: function(attributeName)
- {
- var attributeElements = this.listItemElement.getElementsByClassName("html-attribute-name");
- for (var i = 0, len = attributeElements.length; i < len; ++i) {
- if (attributeElements[i].textContent === attributeName) {
- for (var elem = attributeElements[i].nextSibling; elem; elem = elem.nextSibling) {
- if (elem.nodeType !== Node.ELEMENT_NODE)
- continue;
-
- if (elem.classList.contains("html-attribute-value"))
- return this._startEditingAttribute(elem.parentNode, elem);
- }
- }
- }
- },
-
- _startEditingAttribute: function(attribute, elementForSelection)
- {
- if (WebInspector.isBeingEdited(attribute))
- return true;
-
- var attributeNameElement = attribute.getElementsByClassName("html-attribute-name")[0];
- if (!attributeNameElement)
- return false;
-
- var attributeName = attributeNameElement.textContent;
-
- function removeZeroWidthSpaceRecursive(node)
- {
- if (node.nodeType === Node.TEXT_NODE) {
- node.nodeValue = node.nodeValue.replace(/\u200B/g, "");
- return;
- }
-
- if (node.nodeType !== Node.ELEMENT_NODE)
- return;
-
- for (var child = node.firstChild; child; child = child.nextSibling)
- removeZeroWidthSpaceRecursive(child);
- }
-
- // Remove zero-width spaces that were added by nodeTitleInfo.
- removeZeroWidthSpaceRecursive(attribute);
-
- var config = new WebInspector.EditingConfig(this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
- this._editing = WebInspector.startEditing(attribute, config);
-
- window.getSelection().setBaseAndExtent(elementForSelection, 0, elementForSelection, 1);
-
- return true;
- },
-
- _startEditingTextNode: function(textNode)
- {
- if (WebInspector.isBeingEdited(textNode))
- return true;
-
- var config = new WebInspector.EditingConfig(this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this));
- config.spellcheck = true;
- this._editing = WebInspector.startEditing(textNode, config);
- window.getSelection().setBaseAndExtent(textNode, 0, textNode, 1);
-
- return true;
- },
-
- _startEditingTagName: function(tagNameElement)
- {
- if (!tagNameElement) {
- tagNameElement = this.listItemElement.getElementsByClassName("html-tag-name")[0];
- if (!tagNameElement)
- return false;
- }
-
- var tagName = tagNameElement.textContent;
- if (WebInspector.DOMTreeElement.EditTagBlacklist[tagName.toLowerCase()])
- return false;
-
- if (WebInspector.isBeingEdited(tagNameElement))
- return true;
-
- var closingTagElement = this._distinctClosingTagElement();
-
- function keyupListener(event)
- {
- if (closingTagElement)
- closingTagElement.textContent = "</" + tagNameElement.textContent + ">";
- }
-
- function editingComitted(element, newTagName)
- {
- tagNameElement.removeEventListener('keyup', keyupListener, false);
- this._tagNameEditingCommitted.apply(this, arguments);
- }
-
- function editingCancelled()
- {
- tagNameElement.removeEventListener('keyup', keyupListener, false);
- this._editingCancelled.apply(this, arguments);
- }
-
- tagNameElement.addEventListener('keyup', keyupListener, false);
-
- var config = new WebInspector.EditingConfig(editingComitted.bind(this), editingCancelled.bind(this), tagName);
- this._editing = WebInspector.startEditing(tagNameElement, config);
- window.getSelection().setBaseAndExtent(tagNameElement, 0, tagNameElement, 1);
- return true;
- },
-
- _startEditingAsHTML: function(commitCallback, error, initialValue)
- {
- if (error)
- return;
- if (this._htmlEditElement && WebInspector.isBeingEdited(this._htmlEditElement))
- return;
-
- this._htmlEditElement = document.createElement("div");
- this._htmlEditElement.className = "source-code elements-tree-editor";
- this._htmlEditElement.textContent = initialValue;
-
- // Hide header items.
- var child = this.listItemElement.firstChild;
- while (child) {
- child.style.display = "none";
- child = child.nextSibling;
- }
- // Hide children item.
- if (this._childrenListNode)
- this._childrenListNode.style.display = "none";
- // Append editor.
- this.listItemElement.appendChild(this._htmlEditElement);
-
- this.updateSelection();
-
- function commit()
- {
- commitCallback(this._htmlEditElement.textContent);
- dispose.call(this);
- }
-
- function dispose()
- {
- this._editing = false;
-
- // Remove editor.
- this.listItemElement.removeChild(this._htmlEditElement);
- delete this._htmlEditElement;
- // Unhide children item.
- if (this._childrenListNode)
- this._childrenListNode.style.removeProperty("display");
- // Unhide header items.
- var child = this.listItemElement.firstChild;
- while (child) {
- child.style.removeProperty("display");
- child = child.nextSibling;
- }
-
- this.updateSelection();
- }
-
- var config = new WebInspector.EditingConfig(commit.bind(this), dispose.bind(this));
- config.setMultiline(true);
- this._editing = WebInspector.startEditing(this._htmlEditElement, config);
- },
-
- _attributeEditingCommitted: function(element, newText, oldText, attributeName, moveDirection)
- {
- this._editing = false;
-
- var treeOutline = this.treeOutline;
- function moveToNextAttributeIfNeeded(error)
- {
- if (error)
- this._editingCancelled(element, attributeName);
-
- if (!moveDirection)
- return;
-
- treeOutline._updateModifiedNodes();
-
- // Search for the attribute's position, and then decide where to move to.
- var attributes = this.representedObject.attributes();
- for (var i = 0; i < attributes.length; ++i) {
- if (attributes[i].name !== attributeName)
- continue;
-
- if (moveDirection === "backward") {
- if (i === 0)
- this._startEditingTagName();
- else
- this._triggerEditAttribute(attributes[i - 1].name);
- } else {
- if (i === attributes.length - 1)
- this._addNewAttribute();
- else
- this._triggerEditAttribute(attributes[i + 1].name);
- }
- return;
- }
-
- // Moving From the "New Attribute" position.
- if (moveDirection === "backward") {
- if (newText === " ") {
- // Moving from "New Attribute" that was not edited
- if (attributes.length)
- this._triggerEditAttribute(attributes.lastValue.name);
- } else {
- // Moving from "New Attribute" that holds new value
- if (attributes.length > 1)
- this._triggerEditAttribute(attributes[attributes.length - 2].name);
- }
- } else if (moveDirection === "forward") {
- if (!/^\s*$/.test(newText))
- this._addNewAttribute();
- else
- this._startEditingTagName();
- }
- }
-
- this.representedObject.setAttribute(attributeName, newText, moveToNextAttributeIfNeeded.bind(this));
- },
-
- _tagNameEditingCommitted: function(element, newText, oldText, tagName, moveDirection)
- {
- this._editing = false;
- var self = this;
-
- function cancel()
- {
- var closingTagElement = self._distinctClosingTagElement();
- if (closingTagElement)
- closingTagElement.textContent = "</" + tagName + ">";
-
- self._editingCancelled(element, tagName);
- moveToNextAttributeIfNeeded.call(self);
- }
-
- function moveToNextAttributeIfNeeded()
- {
- if (moveDirection !== "forward") {
- this._addNewAttribute();
- return;
- }
-
- var attributes = this.representedObject.attributes();
- if (attributes.length > 0)
- this._triggerEditAttribute(attributes[0].name);
- else
- this._addNewAttribute();
- }
-
- newText = newText.trim();
- if (newText === oldText) {
- cancel();
- return;
- }
-
- var treeOutline = this.treeOutline;
- var wasExpanded = this.expanded;
-
- function changeTagNameCallback(error, nodeId)
- {
- if (error || !nodeId) {
- cancel();
- return;
- }
-
- var node = WebInspector.domTreeManager.nodeForId(nodeId);
-
- // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.
- treeOutline._updateModifiedNodes();
- treeOutline.selectDOMNode(node, true);
-
- var newTreeItem = treeOutline.findTreeElement(node);
- if (wasExpanded)
- newTreeItem.expand();
-
- moveToNextAttributeIfNeeded.call(newTreeItem);
- }
-
- this.representedObject.setNodeName(newText, changeTagNameCallback);
- },
-
- _textNodeEditingCommitted: function(element, newText)
- {
- this._editing = false;
-
- var textNode;
- if (this.representedObject.nodeType() === Node.ELEMENT_NODE) {
- // We only show text nodes inline in elements if the element only
- // has a single child, and that child is a text node.
- textNode = this.representedObject.firstChild;
- } else if (this.representedObject.nodeType() == Node.TEXT_NODE)
- textNode = this.representedObject;
-
- textNode.setNodeValue(newText, this.updateTitle.bind(this));
- },
-
- _editingCancelled: function(element, context)
- {
- this._editing = false;
-
- // Need to restore attributes structure.
- this.updateTitle();
- },
-
- _distinctClosingTagElement: function()
- {
- // FIXME: Improve the Tree Element / Outline Abstraction to prevent crawling the DOM
-
- // For an expanded element, it will be the last element with class "close"
- // in the child element list.
- if (this.expanded) {
- var closers = this._childrenListNode.querySelectorAll(".close");
- return closers[closers.length-1];
- }
-
- // Remaining cases are single line non-expanded elements with a closing
- // tag, or HTML elements without a closing tag (such as <br>). Return
- // null in the case where there isn't a closing tag.
- var tags = this.listItemElement.getElementsByClassName("html-tag");
- return (tags.length === 1 ? null : tags[tags.length-1]);
- },
-
- /**
- * @param {boolean=} onlySearchQueryChanged
- */
- updateTitle: function(onlySearchQueryChanged)
- {
- // If we are editing, return early to prevent canceling the edit.
- // After editing is committed updateTitle will be called.
- if (this._editing)
- return;
-
- if (onlySearchQueryChanged) {
- if (this._highlightResult)
- this._updateSearchHighlight(false);
- } else {
- var highlightElement = document.createElement("span");
- highlightElement.className = "highlight";
- highlightElement.appendChild(this._nodeTitleInfo().titleDOM);
- this.title = highlightElement;
- delete this._highlightResult;
- }
-
- delete this.selectionElement;
- this.updateSelection();
- this._highlightSearchResults();
- },
-
- /**
- * @param {WebInspector.DOMNode=} node
- */
- _buildAttributeDOM: function(parentElement, name, value, node)
- {
- var hasText = (value.length > 0);
- var attrSpanElement = parentElement.createChild("span", "html-attribute");
- var attrNameElement = attrSpanElement.createChild("span", "html-attribute-name");
- attrNameElement.textContent = name;
-
- if (hasText)
- attrSpanElement.appendChild(document.createTextNode("=\u200B\""));
-
- if (name === "src" || name === "href") {
- var baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
- var rewrittenURL = absoluteURL(value, baseURL);
-
- value = value.insertWordBreakCharacters();
-
- if (!rewrittenURL) {
- var attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
- attrValueElement.textContent = value;
- } else {
- if (value.startsWith("data:"))
- value = value.trimMiddle(60);
-
- var linkElement = document.createElement("a");
- linkElement.href = rewrittenURL;
- linkElement.textContent = value;
-
- attrSpanElement.appendChild(linkElement);
- }
- } else {
- value = value.insertWordBreakCharacters();
- var attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
- attrValueElement.textContent = value;
- }
-
- if (hasText)
- attrSpanElement.appendChild(document.createTextNode("\""));
- },
-
- _buildTagDOM: function(parentElement, tagName, isClosingTag, isDistinctTreeElement)
- {
- var node = /** @type WebInspector.DOMNode */ this.representedObject;
- var classes = [ "html-tag" ];
- if (isClosingTag && isDistinctTreeElement)
- classes.push("close");
- if (node.isInShadowTree())
- classes.push("shadow");
- var tagElement = parentElement.createChild("span", classes.join(" "));
- tagElement.appendChild(document.createTextNode("<"));
- var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "html-tag-name");
- tagNameElement.textContent = (isClosingTag ? "/" : "") + tagName;
- if (!isClosingTag && node.hasAttributes()) {
- var attributes = node.attributes();
- for (var i = 0; i < attributes.length; ++i) {
- var attr = attributes[i];
- tagElement.appendChild(document.createTextNode(" "));
- this._buildAttributeDOM(tagElement, attr.name, attr.value, node);
- }
- }
- tagElement.appendChild(document.createTextNode(">"));
- parentElement.appendChild(document.createTextNode("\u200B"));
- },
-
- _nodeTitleInfo: function()
- {
- var node = this.representedObject;
- var info = {titleDOM: document.createDocumentFragment(), hasChildren: this.hasChildren};
-
- switch (node.nodeType()) {
- case Node.DOCUMENT_FRAGMENT_NODE:
- var fragmentElement = info.titleDOM.createChild("span", "webkit-html-fragment");
- if (node.isInShadowTree()) {
- fragmentElement.textContent = WebInspector.UIString("Shadow Content");
- fragmentElement.classList.add("shadow");
- } else
- fragmentElement.textContent = WebInspector.UIString("Document Fragment");
- break;
-
- case Node.ATTRIBUTE_NODE:
- var value = node.value || "\u200B"; // Zero width space to force showing an empty value.
- this._buildAttributeDOM(info.titleDOM, node.name, value);
- break;
-
- case Node.ELEMENT_NODE:
- var tagName = node.nodeNameInCorrectCase();
- if (this._elementCloseTag) {
- this._buildTagDOM(info.titleDOM, tagName, true, true);
- info.hasChildren = false;
- break;
- }
-
- this._buildTagDOM(info.titleDOM, tagName, false, false);
-
- var textChild = this._singleTextChild(node);
- var showInlineText = textChild && textChild.nodeValue().length < WebInspector.DOMTreeElement.MaximumInlineTextChildLength;
-
- if (!this.expanded && (!showInlineText && (this.treeOutline.isXMLMimeType || !WebInspector.DOMTreeElement.ForbiddenClosingTagElements[tagName]))) {
- if (this.hasChildren) {
- var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
- textNodeElement.textContent = "\u2026";
- info.titleDOM.appendChild(document.createTextNode("\u200B"));
- }
- this._buildTagDOM(info.titleDOM, tagName, true, false);
- }
-
- // If this element only has a single child that is a text node,
- // just show that text and the closing tag inline rather than
- // create a subtree for them
- if (showInlineText) {
- var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
- var nodeNameLowerCase = node.nodeName().toLowerCase();
-
- if (nodeNameLowerCase === "script")
- textNodeElement.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(textChild.nodeValue().trim(), "text/javascript"));
- else if (nodeNameLowerCase === "style")
- textNodeElement.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(textChild.nodeValue().trim(), "text/css"));
- else
- textNodeElement.textContent = textChild.nodeValue();
-
- info.titleDOM.appendChild(document.createTextNode("\u200B"));
-
- this._buildTagDOM(info.titleDOM, tagName, true, false);
- info.hasChildren = false;
- }
- break;
-
- case Node.TEXT_NODE:
- function trimedNodeValue()
- {
- // Trim empty lines from the beginning and extra space at the end since most style and script tags begin with a newline
- // and end with a newline and indentation for the end tag.
- return node.nodeValue().replace(/^[\n\r]*/, "").replace(/\s*$/, "");
- }
-
- if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "script") {
- var newNode = info.titleDOM.createChild("span", "html-text-node large");
- newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/javascript"));
- } else if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "style") {
- var newNode = info.titleDOM.createChild("span", "html-text-node large");
- newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/css"));
- } else {
- info.titleDOM.appendChild(document.createTextNode("\""));
- var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
- textNodeElement.textContent = node.nodeValue();
- info.titleDOM.appendChild(document.createTextNode("\""));
- }
- break;
-
- case Node.COMMENT_NODE:
- var commentElement = info.titleDOM.createChild("span", "html-comment");
- commentElement.appendChild(document.createTextNode("<!--" + node.nodeValue() + "-->"));
- break;
-
- case Node.DOCUMENT_TYPE_NODE:
- var docTypeElement = info.titleDOM.createChild("span", "html-doctype");
- docTypeElement.appendChild(document.createTextNode("<!DOCTYPE " + node.nodeName()));
- if (node.publicId) {
- docTypeElement.appendChild(document.createTextNode(" PUBLIC \"" + node.publicId + "\""));
- if (node.systemId)
- docTypeElement.appendChild(document.createTextNode(" \"" + node.systemId + "\""));
- } else if (node.systemId)
- docTypeElement.appendChild(document.createTextNode(" SYSTEM \"" + node.systemId + "\""));
-
- if (node.internalSubset)
- docTypeElement.appendChild(document.createTextNode(" [" + node.internalSubset + "]"));
-
- docTypeElement.appendChild(document.createTextNode(">"));
- break;
-
- case Node.CDATA_SECTION_NODE:
- var cdataElement = info.titleDOM.createChild("span", "html-text-node");
- cdataElement.appendChild(document.createTextNode("<![CDATA[" + node.nodeValue() + "]]>"));
- break;
- default:
- var defaultElement = info.titleDOM.appendChild(document.createTextNode(node.nodeNameInCorrectCase().collapseWhitespace()));
- }
-
- return info;
- },
-
- _singleTextChild: function(node)
- {
- if (!node)
- return null;
-
- var firstChild = node.firstChild;
- if (!firstChild || firstChild.nodeType() !== Node.TEXT_NODE)
- return null;
-
- if (node.hasShadowRoots())
- return null;
-
- var sibling = firstChild.nextSibling;
- return sibling ? null : firstChild;
- },
-
- _showInlineText: function(node)
- {
- if (node.nodeType() === Node.ELEMENT_NODE) {
- var textChild = this._singleTextChild(node);
- if (textChild && textChild.nodeValue().length < WebInspector.DOMTreeElement.MaximumInlineTextChildLength)
- return true;
- }
- return false;
- },
-
- remove: function()
- {
- var parentElement = this.parent;
- if (!parentElement)
- return;
-
- var self = this;
- function removeNodeCallback(error, removedNodeId)
- {
- if (error)
- return;
-
- if (!self.parent)
- return;
-
- parentElement.removeChild(self);
- parentElement.adjustCollapsedRange();
- }
-
- this.representedObject.removeNode(removeNodeCallback);
- },
-
- _editAsHTML: function()
- {
- var treeOutline = this.treeOutline;
- var node = this.representedObject;
- var parentNode = node.parentNode;
- var index = node.index;
- var wasExpanded = this.expanded;
-
- function selectNode(error, nodeId)
- {
- if (error)
- return;
-
- // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.
- treeOutline._updateModifiedNodes();
-
- var newNode = parentNode ? parentNode.children[index] || parentNode : null;
- if (!newNode)
- return;
-
- treeOutline.selectDOMNode(newNode, true);
-
- if (wasExpanded) {
- var newTreeItem = treeOutline.findTreeElement(newNode);
- if (newTreeItem)
- newTreeItem.expand();
- }
- }
-
- function commitChange(value)
- {
- node.setOuterHTML(value, selectNode);
- }
-
- node.getOuterHTML(this._startEditingAsHTML.bind(this, commitChange));
- },
-
- _copyHTML: function()
- {
- this.representedObject.copyNode();
- },
-
- _highlightSearchResults: function()
- {
- if (!this._searchQuery || !this._searchHighlightsVisible)
- return;
- if (this._highlightResult) {
- this._updateSearchHighlight(true);
- return;
- }
-
- var text = this.listItemElement.textContent;
- var regexObject = createPlainTextSearchRegex(this._searchQuery, "gi");
-
- var offset = 0;
- var match = regexObject.exec(text);
- var matchRanges = [];
- while (match) {
- matchRanges.push({ offset: match.index, length: match[0].length });
- match = regexObject.exec(text);
- }
-
- // Fall back for XPath, etc. matches.
- if (!matchRanges.length)
- matchRanges.push({ offset: 0, length: text.length });
-
- this._highlightResult = [];
- highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult);
- },
-
- handleEvent: function(event)
- {
- if (event.type === "dragstart" && this._editing)
- event.preventDefault();
- }
-}
-
-WebInspector.DOMTreeElement.prototype.__proto__ = TreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeElementPathComponentjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeElementPathComponent.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeElementPathComponent.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeElementPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,132 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeElementPathComponent = function(domTreeElement, representedObject) {
- var node = domTreeElement.representedObject;
-
- var title = null;
- var className = null;
-
- switch (node.nodeType()) {
- case Node.ELEMENT_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
- title = WebInspector.displayNameForNode(node);
- break;
-
- case Node.TEXT_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName;
- title = "\"" + node.nodeValue().trimEnd(32) + "\"";
- break;
-
- case Node.COMMENT_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName;
- title = "<!--" + node.nodeValue().trimEnd(32) + "-->";
- break;
-
- case Node.DOCUMENT_TYPE_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
- title = "<!DOCTYPE>";
- break;
-
- case Node.DOCUMENT_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName;
- title = node.nodeNameInCorrectCase();
- break;
-
- case Node.CDATA_SECTION_NODE:
- className = WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName;
- title = "<![CDATA[" + node.trimEnd(32) + "]]>";
- break;
-
- case Node.DOCUMENT_FRAGMENT_NODE:
- // FIXME: At some point we might want a different icon for this.
- // <rdar://problem/12800950> Need icon for DOCUMENT_FRAGMENT_NODE
- className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
- if (node.isInShadowTree())
- title = WebInspector.UIString("Shadow Content");
- else
- title = WebInspector.displayNameForNode(node);
- break;
-
- default:
- console.error("Unknown DOM node type: ", node.nodeType());
- className = WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName;
- title = node.nodeNameInCorrectCase();
- }
-
- WebInspector.HierarchicalPathComponent.call(this, title, className, representedObject || domTreeElement.representedObject);
-
- this._domTreeElement = domTreeElement;
-};
-
-WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName = "dom-element-icon";
-WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName = "dom-text-node-icon";
-WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName = "dom-comment-icon";
-WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName = "dom-document-type-icon";
-WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName = "dom-document-icon";
-WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName = "dom-character-data-icon";
-WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName = "dom-node-icon";
-
-WebInspector.DOMTreeElementPathComponent.prototype = {
- constructor: WebInspector.DOMTreeElementPathComponent,
-
- // Public
-
- get domTreeElement()
- {
- return this._domTreeElement;
- },
-
- get previousSibling()
- {
- if (!this._domTreeElement.previousSibling)
- return null;
- return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.previousSibling);
- },
-
- get nextSibling()
- {
- if (!this._domTreeElement.nextSibling)
- return null;
- if (this._domTreeElement.nextSibling.isCloseTag())
- return null;
- return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.nextSibling);
- },
-
- // Protected
-
- mouseOver: function()
- {
- var nodeId = this._domTreeElement.representedObject.id;
- WebInspector.domTreeManager.highlightDOMNode(nodeId);
- },
-
- mouseOut: function()
- {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- }
-};
-
-WebInspector.DOMTreeElementPathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,833 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @extends {WebInspector.Object}
- * @constructor
- */
-WebInspector.DOMTreeManager = function() {
- /** @type {Object|undefined} */
- this._idToDOMNode = {};
- this._document = null;
- this._attributeLoadNodeIds = {};
- this._flows = new Map;
- this._contentNodesToFlowsMap = new Map;
-}
-
-WebInspector.Object.addConstructorFunctions(WebInspector.DOMTreeManager);
-
-WebInspector.DOMTreeManager.Event = {
- AttributeModified: "dom-tree-manager-attribute-modified",
- AttributeRemoved: "dom-tree-manager-attribute-removed",
- CharacterDataModified: "dom-tree-manager-character-data-modified",
- NodeInserted: "dom-tree-manager-node-inserted",
- NodeRemoved: "dom-tree-manager-node-removed",
- DocumentUpdated: "dom-tree-manager-document-updated",
- ChildNodeCountUpdated: "dom-tree-manager-child-node-count-updated",
- DOMNodeWasInspected: "dom-tree-manager-dom-node-was-inspected",
- InspectModeStateChanged: "dom-tree-manager-inspect-mode-state-changed",
- ContentFlowListWasUpdated: "dom-tree-manager-content-flow-list-was-updated",
- ContentFlowWasAdded: "dom-tree-manager-content-flow-was-added",
- ContentFlowWasRemoved: "dom-tree-manager-content-flow-was-removed",
- RegionLayoutUpdated: "dom-tree-manager-region-layout-updated",
- RegionOversetChanged: "dom-tree-manager-region-overset-changed"
-};
-
-WebInspector.DOMTreeManager._flowPayloadHashKey = function(flowPayload)
-{
- // Use the flow node id, to avoid collisions when we change main document id.
- return flowPayload.documentNodeId + ":" + flowPayload.name;
-};
-
-WebInspector.DOMTreeManager.prototype = {
- /**
- * @param {function(WebInspector.DOMDocument)=} callback
- */
- requestDocument: function(callback)
- {
- if (this._document) {
- if (callback)
- callback(this._document);
- return;
- }
-
- if (this._pendingDocumentRequestCallbacks) {
- this._pendingDocumentRequestCallbacks.push(callback);
- return;
- }
-
- this._pendingDocumentRequestCallbacks = [callback];
-
- /**
- * @this {WebInspector.DOMTreeManager}
- * @param {?Protocol.Error} error
- * @param {DOMAgent.Node} root
- */
- function onDocumentAvailable(error, root)
- {
- if (!error)
- this._setDocument(root);
-
- for (var i = 0; i < this._pendingDocumentRequestCallbacks.length; ++i) {
- var callback = this._pendingDocumentRequestCallbacks[i];
- if (callback)
- callback(this._document);
- }
- delete this._pendingDocumentRequestCallbacks;
- }
-
- DOMAgent.getDocument(onDocumentAvailable.bind(this));
- },
-
- /**
- * @param {RuntimeAgent.RemoteObjectId} objectId
- * @param {function()=} callback
- */
- pushNodeToFrontend: function(objectId, callback)
- {
- this._dispatchWhenDocumentAvailable(DOMAgent.requestNode.bind(DOMAgent, objectId), callback);
- },
-
- /**
- * @param {string} path
- * @param {function(?WebInspector.DOMNode)=} callback
- */
- pushNodeByPathToFrontend: function(path, callback)
- {
- var callbackCast = /** @type {function(*)} */ callback;
- this._dispatchWhenDocumentAvailable(DOMAgent.pushNodeByPathToFrontend.bind(DOMAgent, path), callbackCast);
- },
-
- /**
- * @param {function(*)=} callback
- * @return {function(?Protocol.Error,*=)|undefined}
- */
- _wrapClientCallback: function(callback)
- {
- if (!callback)
- return;
- return function(error, result) {
- if (error)
- console.error("Error during DOMAgent operation: " + error);
- callback(error ? null : result);
- };
- },
-
- /**
- * @param {function(function()=)} func
- * @param {function(*)=} callback
- */
- _dispatchWhenDocumentAvailable: function(func, callback)
- {
- var callbackWrapper = /** @type {function(?Protocol.Error, *=)} */ this._wrapClientCallback(callback);
-
- function onDocumentAvailable()
- {
- if (this._document)
- func(callbackWrapper);
- else {
- if (callbackWrapper)
- callbackWrapper("No document");
- }
- }
- this.requestDocument(onDocumentAvailable.bind(this));
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {string} name
- * @param {string} value
- */
- _attributeModified: function(nodeId, name, value)
- {
- var node = this._idToDOMNode[nodeId];
- if (!node)
- return;
- node._setAttribute(name, value);
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, { node: node, name: name });
- node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeModified, {name: name});
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {string} name
- */
- _attributeRemoved: function(nodeId, name)
- {
- var node = this._idToDOMNode[nodeId];
- if (!node)
- return;
- node._removeAttribute(name);
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeRemoved, { node: node, name: name });
- node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeRemoved, {name: name});
- },
-
- /**
- * @param {Array.<DOMAgent.NodeId>} nodeIds
- */
- _inlineStyleInvalidated: function(nodeIds)
- {
- for (var i = 0; i < nodeIds.length; ++i)
- this._attributeLoadNodeIds[nodeIds[i]] = true;
- if ("_loadNodeAttributesTimeout" in this)
- return;
- this._loadNodeAttributesTimeout = setTimeout(this._loadNodeAttributes.bind(this), 0);
- },
-
- _loadNodeAttributes: function()
- {
- /**
- * @this {WebInspector.DOMTreeManager}
- * @param {DOMAgent.NodeId} nodeId
- * @param {?Protocol.Error} error
- * @param {Array.<string>} attributes
- */
- function callback(nodeId, error, attributes)
- {
- if (error) {
- console.error("Error during DOMAgent operation: " + error);
- return;
- }
- var node = this._idToDOMNode[nodeId];
- if (node) {
- node._setAttributesPayload(attributes);
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, { node: node, name: "style" });
- node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeModified, {name: "style"});
- }
- }
-
- delete this._loadNodeAttributesTimeout;
-
- for (var nodeId in this._attributeLoadNodeIds) {
- var nodeIdAsNumber = parseInt(nodeId, 10);
- DOMAgent.getAttributes(nodeIdAsNumber, callback.bind(this, nodeIdAsNumber));
- }
- this._attributeLoadNodeIds = {};
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {string} newValue
- */
- _characterDataModified: function(nodeId, newValue)
- {
- var node = this._idToDOMNode[nodeId];
- node._nodeValue = newValue;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.CharacterDataModified, {node: node});
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @return {WebInspector.DOMNode|undefined}
- */
- nodeForId: function(nodeId)
- {
- return this._idToDOMNode[nodeId];
- },
-
- _documentUpdated: function()
- {
- this._setDocument(null);
- },
-
- /**
- * @param {DOMAgent.Node} payload
- */
- _setDocument: function(payload)
- {
- this._idToDOMNode = {};
- if (payload && "nodeId" in payload)
- this._document = new WebInspector.DOMNode(this, null, false, payload);
- else
- this._document = null;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._document);
- },
-
- /**
- * @param {DOMAgent.Node} payload
- */
- _setDetachedRoot: function(payload)
- {
- new WebInspector.DOMNode(this, null, false, payload);
- },
-
- /**
- * @param {DOMAgent.NodeId} parentId
- * @param {Array.<DOMAgent.Node>} payloads
- */
- _setChildNodes: function(parentId, payloads)
- {
- if (!parentId && payloads.length) {
- this._setDetachedRoot(payloads[0]);
- return;
- }
-
- var parent = this._idToDOMNode[parentId];
- parent._setChildrenPayload(payloads);
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {number} newValue
- */
- _childNodeCountUpdated: function(nodeId, newValue)
- {
- var node = this._idToDOMNode[nodeId];
- node.childNodeCount = newValue;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ChildNodeCountUpdated, node);
- },
-
- /**
- * @param {DOMAgent.NodeId} parentId
- * @param {DOMAgent.NodeId} prevId
- * @param {DOMAgent.Node} payload
- */
- _childNodeInserted: function(parentId, prevId, payload)
- {
- var parent = this._idToDOMNode[parentId];
- var prev = this._idToDOMNode[prevId];
- var node = parent._insertChild(prev, payload);
- this._idToDOMNode[node.id] = node;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.NodeInserted, {node: node, parent: parent});
- },
-
- /**
- * @param {DOMAgent.NodeId} parentId
- * @param {DOMAgent.NodeId} nodeId
- */
- _childNodeRemoved: function(parentId, nodeId)
- {
- var parent = this._idToDOMNode[parentId];
- var node = this._idToDOMNode[nodeId];
- parent._removeChild(node);
- this._unbind(node);
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.NodeRemoved, {node:node, parent: parent});
- },
-
- /**
- * @param {DOMAgent.Node} node
- */
- _unbind: function(node)
- {
- this._removeContentNodeFromFlowIfNeeded(node);
-
- delete this._idToDOMNode[node.id];
- for (var i = 0; node.children && i < node.children.length; ++i)
- this._unbind(node.children[i]);
- },
-
- /**
- * @param {number} nodeId
- */
- inspectElement: function(nodeId)
- {
- var node = this._idToDOMNode[nodeId];
- if (node)
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, {node: node});
-
- this._inspectModeEnabled = false;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.InspectModeStateChanged);
- },
-
- inspectNodeObject: function(remoteObject)
- {
- function nodeAvailable(nodeId)
- {
- remoteObject.release();
-
- console.assert(nodeId);
- if (!nodeId)
- return;
-
- this.inspectElement(nodeId);
- }
-
- remoteObject.pushNodeToFrontend(nodeAvailable.bind(this));
- },
-
- /**
- * @param {string} query
- * @param {function(number)} searchCallback
- */
- performSearch: function(query, searchCallback)
- {
- this.cancelSearch();
-
- /**
- * @param {?Protocol.Error} error
- * @param {string} searchId
- * @param {number} resultsCount
- */
- function callback(error, searchId, resultsCount)
- {
- this._searchId = searchId;
- searchCallback(resultsCount);
- }
- DOMAgent.performSearch(query, callback.bind(this));
- },
-
- /**
- * @param {number} index
- * @param {?function(DOMAgent.Node)} callback
- */
- searchResult: function(index, callback)
- {
- if (this._searchId) {
- /**
- * @param {?Protocol.Error} error
- * @param {Array.<number>} nodeIds
- */
- function mycallback(error, nodeIds)
- {
- if (error) {
- console.error(error);
- callback(null);
- return;
- }
- if (nodeIds.length != 1)
- return;
-
- callback(this._idToDOMNode[nodeIds[0]]);
- }
- DOMAgent.getSearchResults(this._searchId, index, index + 1, mycallback.bind(this));
- } else
- callback(null);
- },
-
- cancelSearch: function()
- {
- if (this._searchId) {
- DOMAgent.discardSearchResults(this._searchId);
- delete this._searchId;
- }
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {string} selectors
- * @param {function(?DOMAgent.NodeId)=} callback
- */
- querySelector: function(nodeId, selectors, callback)
- {
- var callbackCast = /** @type {function(*)|undefined} */callback;
- DOMAgent.querySelector(nodeId, selectors, this._wrapClientCallback(callbackCast));
- },
-
- /**
- * @param {DOMAgent.NodeId} nodeId
- * @param {string} selectors
- * @param {function(?Array.<DOMAgent.NodeId>)=} callback
- */
- querySelectorAll: function(nodeId, selectors, callback)
- {
- var callbackCast = /** @type {function(*)|undefined} */callback;
- DOMAgent.querySelectorAll(nodeId, selectors, this._wrapClientCallback(callbackCast));
- },
-
- /**
- * @param {?number} nodeId
- * @param {string=} mode
- */
- highlightDOMNode: function(nodeId, mode)
- {
- if (this._hideDOMNodeHighlightTimeout) {
- clearTimeout(this._hideDOMNodeHighlightTimeout);
- delete this._hideDOMNodeHighlightTimeout;
- }
-
- this._highlightedDOMNodeId = nodeId;
- if (nodeId)
- DOMAgent.highlightNode.invoke({nodeId: nodeId, highlightConfig: this._buildHighlightConfig(mode)});
- else
- DOMAgent.hideHighlight();
- },
-
- highlightRect: function(rect, usePageCoordinates)
- {
- DOMAgent.highlightRect.invoke({
- x: rect.x,
- y: rect.y,
- width: rect.width,
- height: rect.height,
- color: {r: 111, g: 168, b: 220, a: 0.66},
- outlineColor: {r: 255, g: 229, b: 153, a: 0.66},
- usePageCoordinates: usePageCoordinates
- });
- },
-
- hideDOMNodeHighlight: function()
- {
- this.highlightDOMNode(0);
- },
-
- /**
- * @param {?DOMAgent.NodeId} nodeId
- */
- highlightDOMNodeForTwoSeconds: function(nodeId)
- {
- this.highlightDOMNode(nodeId);
- this._hideDOMNodeHighlightTimeout = setTimeout(this.hideDOMNodeHighlight.bind(this), 2000);
- },
-
- get inspectModeEnabled()
- {
- return this._inspectModeEnabled;
- },
-
- set inspectModeEnabled(enabled)
- {
- function callback(error)
- {
- this._inspectModeEnabled = error ? false : enabled;
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.InspectModeStateChanged);
- }
-
- DOMAgent.setInspectModeEnabled(enabled, this._buildHighlightConfig(), callback.bind(this));
- },
-
- /**
- * @param {string=} mode
- */
- _buildHighlightConfig: function(mode)
- {
- mode = mode || "all";
- var highlightConfig = { showInfo: mode === "all" };
- if (mode === "all" || mode === "content")
- highlightConfig.contentColor = {r: 111, g: 168, b: 220, a: 0.66};
-
- if (mode === "all" || mode === "padding")
- highlightConfig.paddingColor = {r: 147, g: 196, b: 125, a: 0.66};
-
- if (mode === "all" || mode === "border")
- highlightConfig.borderColor = {r: 255, g: 229, b: 153, a: 0.66};
-
- if (mode === "all" || mode === "margin")
- highlightConfig.marginColor = {r: 246, g: 178, b: 107, a: 0.66};
-
- return highlightConfig;
- },
-
- _createContentFlowFromPayload: function(flowPayload)
- {
- // FIXME: Collect the regions from the payload.
- var flow = new WebInspector.ContentFlow(flowPayload.documentNodeId, flowPayload.name, flowPayload.overset, flowPayload.content.map(this.nodeForId.bind(this)));
-
- for (var contentNode of flow.contentNodes) {
- console.assert(!this._contentNodesToFlowsMap.has(contentNode.id));
- this._contentNodesToFlowsMap.set(contentNode.id, flow);
- }
-
- return flow;
- },
-
- _updateContentFlowFromPayload: function(contentFlow, flowPayload)
- {
- console.assert(contentFlow.contentNodes.length === flowPayload.content.length);
- for (var i = 0; i < contentFlow.contentNodes.length; ++i)
- console.assert(contentFlow.contentNodes[i].id === flowPayload.content[i]);
-
- // FIXME: Collect the regions from the payload.
- contentFlow.overset = flowPayload.overset;
- },
-
- getNamedFlowCollection: function(documentNodeIdentifier)
- {
- function onNamedFlowCollectionAvailable(error, flows)
- {
- if (error) {
- console.error("Error while getting the named flows for document " + documentNodeIdentifier + ": " + error);
- return;
- }
- this._contentNodesToFlowsMap.clear();
- var contentFlows = [];
- for (var i = 0; i < flows.length; ++i) {
- var flowPayload = flows[i];
- var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
- var contentFlow = this._flows.get(flowKey);
- if (contentFlow)
- this._updateContentFlowFromPayload(contentFlow, flowPayload);
- else {
- contentFlow = this._createContentFlowFromPayload(flowPayload);
- this._flows.set(flowKey, contentFlow);
- }
- contentFlows.push(contentFlow);
- }
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowListWasUpdated, {documentNodeIdentifier: documentNodeIdentifier, flows: contentFlows});
- }
- CSSAgent.getNamedFlowCollection(documentNodeIdentifier, onNamedFlowCollectionAvailable.bind(this));
- },
-
- namedFlowCreated: function(flowPayload)
- {
- var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
- console.assert(!this._flows.has(flowKey));
- var contentFlow = this._createContentFlowFromPayload(flowPayload);
- this._flows.set(flowKey, contentFlow);
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowWasAdded, {flow: contentFlow});
- },
-
- namedFlowRemoved: function(documentNodeIdentifier, flowName)
- {
- var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName});
- var contentFlow = this._flows.get(flowKey);
- console.assert(contentFlow);
- this._flows.delete(flowKey);
-
- // Remove any back links to this flow from the content nodes.
- for (var contentNode of contentFlow.contentNodes)
- this._contentNodesToFlowsMap.delete(contentNode.id);
-
- this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.ContentFlowWasRemoved, {flow: contentFlow});
- },
-
- _sendNamedFlowUpdateEvents: function(flowPayload)
- {
- var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey(flowPayload);
- console.assert(this._flows.has(flowKey));
- this._updateContentFlowFromPayload(this._flows.get(flowKey), flowPayload);
- },
-
- regionLayoutUpdated: function(flowPayload)
- {
- this._sendNamedFlowUpdateEvents(flowPayload);
- },
-
- regionOversetChanged: function(flowPayload)
- {
- this._sendNamedFlowUpdateEvents(flowPayload);
- },
-
- registeredNamedFlowContentElement: function(documentNodeIdentifier, flowName, contentNodeId, nextContentElementNodeId)
- {
- var flowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName});
- console.assert(this._flows.has(flowKey));
- console.assert(!this._contentNodesToFlowsMap.has(contentNodeId));
-
- var flow = this._flows.get(flowKey);
- var contentNode = this.nodeForId(contentNodeId);
-
- this._contentNodesToFlowsMap.set(contentNode.id, flow);
-
- if (nextContentElementNodeId)
- flow.insertContentNodeBefore(contentNode, this.nodeForId(nextContentElementNodeId));
- else
- flow.appendContentNode(contentNode);
- },
-
- _removeContentNodeFromFlowIfNeeded: function(node)
- {
- if (!this._contentNodesToFlowsMap.has(node.id))
- return;
- var flow = this._contentNodesToFlowsMap.get(node.id);
- this._contentNodesToFlowsMap.delete(node.id);
- flow.removeContentNode(node);
- },
-
- unregisteredNamedFlowContentElement: function(documentNodeIdentifier, flowName, contentNodeId)
- {
- console.assert(this._contentNodesToFlowsMap.has(contentNodeId));
-
- var flow = this._contentNodesToFlowsMap.get(contentNodeId);
- console.assert(flow.id === WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: documentNodeIdentifier, name: flowName}));
-
- this._contentNodesToFlowsMap.delete(contentNodeId);
- flow.removeContentNode(this.nodeForId(contentNodeId));
- },
-
- _coerceRemoteArrayOfDOMNodes: function(objectId, callback)
- {
- var length, nodes, received = 0, lastError = null, domTreeManager = this;
-
- function nodeRequested(index, error, nodeId)
- {
- if (error)
- lastError = error;
- else
- nodes[index] = domTreeManager._idToDOMNode[nodeId];
- if (++received === length)
- callback(lastError, nodes);
- }
-
- WebInspector.runtimeManager.getPropertiesForRemoteObject(objectId, function(error, properties) {
- if (error) {
- callback(error);
- return;
- }
-
- var lengthProperty = properties.get("length");
- if (!lengthProperty || lengthProperty.value.type !== "number") {
- callback(null);
- return;
- }
-
- length = lengthProperty.value.value;
- if (!length) {
- callback(null, []);
- return;
- }
-
- nodes = new Array(length);
- for (var i = 0; i < length; ++i) {
- var nodeProperty = properties.get(String(i));
- console.assert(nodeProperty.value.type === "object");
- DOMAgent.requestNode(nodeProperty.value.objectId, nodeRequested.bind(null, i));
- }
- });
- },
-
- getNodeContentFlowInfo: function(domNode, resultReadyCallback)
- {
- DOMAgent.resolveNode(domNode.id, domNodeResolved.bind(this));
-
- function domNodeResolved(error, remoteObject)
- {
- if (error) {
- resultReadyCallback(error);
- return;
- }
- // Serialize "backendFunction" and execute it in the context of the page
- // passing the DOMNode as the "this" reference.
- var evalParameters = {
- objectId: remoteObject.objectId,
- functionDeclaration: backendFunction.toString(),
- doNotPauseOnExceptionsAndMuteConsole: true,
- returnByValue: false,
- generatePreview: false
- };
- RuntimeAgent.callFunctionOn.invoke(evalParameters, regionNodesAvailable.bind(this));
- }
-
- function regionNodesAvailable(error, remoteObject, wasThrown)
- {
- if (error) {
- resultReadyCallback(error);
- return;
- }
-
- if (wasThrown) {
- // We should never get here, but having the error is useful for debugging.
- console.error("Error while executing backend function:", JSON.stringify(remoteObject));
- resultReadyCallback(null);
- return;
- }
-
- // The backend function can never return null.
- console.assert(remoteObject.type === "object");
- console.assert(remoteObject.objectId);
- WebInspector.runtimeManager.getPropertiesForRemoteObject(remoteObject.objectId, remoteObjectPropertiesAvailable.bind(this));
- }
-
- function remoteObjectPropertiesAvailable(error, properties) {
- if (error) {
- resultReadyCallback(error);
- return;
- }
-
- var result = {
- regionFlow: null,
- contentFlow: null,
- regions: null
- };
-
- var regionFlowNameProperty = properties.get("regionFlowName");
- if (regionFlowNameProperty && regionFlowNameProperty.value && regionFlowNameProperty.value.value) {
- console.assert(regionFlowNameProperty.value.type === "string");
- var regionFlowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: domNode.ownerDocument.id, name: regionFlowNameProperty.value.value});
- result.regionFlow = this._flows.get(regionFlowKey);
- }
-
- var contentFlowNameProperty = properties.get("contentFlowName");
- if (contentFlowNameProperty && contentFlowNameProperty.value && contentFlowNameProperty.value.value) {
- console.assert(contentFlowNameProperty.value.type === "string");
- var contentFlowKey = WebInspector.DOMTreeManager._flowPayloadHashKey({documentNodeId: domNode.ownerDocument.id, name: contentFlowNameProperty.value.value});
- result.contentFlow = this._flows.get(contentFlowKey);
- }
-
- var regionsProperty = properties.get("regions");
- if (!regionsProperty || !regionsProperty.value.objectId) {
- // The list of regions is null.
- resultReadyCallback(null, result);
- return;
- }
-
- console.assert(regionsProperty.value.type === "object");
- console.assert(regionsProperty.value.subtype === "array");
- this._coerceRemoteArrayOfDOMNodes(regionsProperty.value.objectId, function(error, nodes) {
- result.regions = nodes;
- resultReadyCallback(error, result);
- });
- }
-
- // Note that "backendFunction" is serialized and executed in the context of the page.
- function backendFunction()
- {
- function getComputedProperty(node, propertyName)
- {
- if (!node.ownerDocument || !node.ownerDocument.defaultView)
- return null;
- var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
- return computedStyle ? computedStyle[propertyName] : null;
- }
-
- function getContentFlowName(node)
- {
- for (; node; node = node.parentNode) {
- var flowName = getComputedProperty(node, "webkitFlowInto");
- if (flowName && flowName !== "none")
- return flowName;
- }
- return null;
- }
-
- var node = this;
-
- // Even detached nodes have an ownerDocument.
- console.assert(node.ownerDocument);
-
- var result = {
- regionFlowName: getComputedProperty(node, "webkitFlowFrom"),
- contentFlowName: getContentFlowName(node),
- regions: null
- };
-
- if (result.contentFlowName) {
- var flowThread = node.ownerDocument.webkitGetNamedFlows().namedItem(result.contentFlowName);
- if (flowThread)
- result.regions = flowThread.getRegionsByContent(node);
- }
-
- return result;
- }
- }
-}
-
-WebInspector.DOMTreeManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinecss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,148 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.dom-tree-outline {
- position: relative;
-
- padding: 0 6px;
- margin: 0;
- min-width: 100%;
-
- outline: none;
-
- list-style-type: none;
-
- /* Needed to make the negative z-index on .selection works. Otherwise the background-color from .syntax-highlighted hides the selection. */
- background-color: transparent !important;
- color: black;
-}
-
-.dom-tree-outline li.hovered:not(.selected) .selection {
- display: block;
- left: 3px;
- right: 3px;
-
- background-color: rgba(56, 121, 217, 0.1);
- border-radius: 5px;
-}
-
-.dom-tree-outline li .selection {
- display: none;
- position: absolute;
- left: 0;
- right: 0;
- height: 15px;
- z-index: -1;
-}
-
-.dom-tree-outline li.selected .selection {
- display: block;
- background-color: rgb(212, 212, 212);
-}
-
-.dom-tree-outline li.elements-drag-over .selection {
- display: block;
- margin-top: -2px;
- border-top: 2px solid rgb(56, 121, 217);
-}
-
-.dom-tree-outline:focus li.selected .selection {
- background-color: rgb(56, 121, 217);
-}
-
-.dom-tree-outline ol {
- list-style-type: none;
- padding-left: 14px;
- margin: 0;
-}
-
-.dom-tree-outline ol.children {
- display: none;
-}
-
-.dom-tree-outline ol.children.expanded {
- display: block;
-}
-
-.dom-tree-outline li {
- padding: 0 0 0 12px;
- word-wrap: break-word;
-}
-
-.dom-tree-outline:focus li.selected {
- color: white;
-}
-
-.dom-tree-outline:focus li.selected * {
- color: inherit;
-}
-
-.dom-tree-outline li.parent {
- margin-left: -10px;
-}
-
-.dom-tree-outline li .html-tag.close {
- margin-left: -14px;
-}
-
-.dom-tree-outline li.parent::before {
- float: left;
-
- content: "";
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- width: 8px;
- height: 8px;
-
- margin-top: 2px;
- padding-right: 2px;
-}
-
-.dom-tree-outline:focus li.parent.selected::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
-}
-
-.dom-tree-outline li.parent.expanded::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.dom-tree-outline:focus li.parent.expanded.selected::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
-}
-
-.dom-tree-outline .add-attribute {
- margin-left: 1px;
- margin-right: 1px;
- white-space: nowrap;
-}
-
-.dom-tree-outline .html-text-node.large {
- display: inline-block;
- min-width: 100%;
- white-space: pre-wrap;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,588 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-/**
- * @constructor
- * @extends {TreeOutline}
- * @param {boolean=} omitRootDOMNode
- * @param {boolean=} selectEnabled
- */
-WebInspector.DOMTreeOutline = function(omitRootDOMNode, selectEnabled, showInElementsPanelEnabled)
-{
- this.element = document.createElement("ol");
- this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
- this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
- this.element.addEventListener("mouseout", this._onmouseout.bind(this), false);
- this.element.addEventListener("dragstart", this._ondragstart.bind(this), false);
- this.element.addEventListener("dragover", this._ondragover.bind(this), false);
- this.element.addEventListener("dragleave", this._ondragleave.bind(this), false);
- this.element.addEventListener("drop", this._ondrop.bind(this), false);
- this.element.addEventListener("dragend", this._ondragend.bind(this), false);
-
- this.element.classList.add(WebInspector.DOMTreeOutline.StyleClassName);
- this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- TreeOutline.call(this, this.element);
-
- this._includeRootDOMNode = !omitRootDOMNode;
- this._selectEnabled = selectEnabled;
- this._showInElementsPanelEnabled = showInElementsPanelEnabled;
- this._rootDOMNode = null;
- this._selectedDOMNode = null;
- this._eventSupport = new WebInspector.Object();
- this._editing = false;
-
- this._visible = false;
-
- this.element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
-
- this._hideElementKeyboardShortcut = new WebInspector.KeyboardShortcut(null, "H", this._hideElement.bind(this), this.element);
- this._hideElementKeyboardShortcut.implicitlyPreventsDefault = false;
-
- WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
-}
-
-WebInspector.Object.addConstructorFunctions(WebInspector.DOMTreeOutline);
-
-WebInspector.DOMTreeOutline.StyleClassName = "dom-tree-outline";
-
-WebInspector.DOMTreeOutline.Event = {
- SelectedNodeChanged: "dom-tree-outline-selected-node-changed"
-}
-
-WebInspector.DOMTreeOutline.prototype = {
- constructor: WebInspector.DOMTreeOutline,
-
- wireToDomAgent: function()
- {
- this._elementsTreeUpdater = new WebInspector.DOMTreeUpdater(this);
- },
-
- close: function()
- {
- if (this._elementsTreeUpdater) {
- this._elementsTreeUpdater.close();
- this._elementsTreeUpdater = null;
- }
- },
-
- setVisible: function(visible, omitFocus)
- {
- this._visible = visible;
- if (!this._visible)
- return;
-
- this._updateModifiedNodes();
- if (this._selectedDOMNode)
- this._revealAndSelectNode(this._selectedDOMNode, omitFocus);
- },
-
- addEventListener: function(eventType, listener, thisObject)
- {
- this._eventSupport.addEventListener(eventType, listener, thisObject);
- },
-
- removeEventListener: function(eventType, listener, thisObject)
- {
- this._eventSupport.removeEventListener(eventType, listener, thisObject);
- },
-
- get rootDOMNode()
- {
- return this._rootDOMNode;
- },
-
- set rootDOMNode(x)
- {
- if (this._rootDOMNode === x)
- return;
-
- this._rootDOMNode = x;
-
- this._isXMLMimeType = x && x.isXMLNode();
-
- this.update();
- },
-
- get isXMLMimeType()
- {
- return this._isXMLMimeType;
- },
-
- selectedDOMNode: function()
- {
- return this._selectedDOMNode;
- },
-
- selectDOMNode: function(node, focus)
- {
- if (this._selectedDOMNode === node) {
- this._revealAndSelectNode(node, !focus);
- return;
- }
-
- this._selectedDOMNode = node;
- this._revealAndSelectNode(node, !focus);
-
- // The _revealAndSelectNode() method might find a different element if there is inlined text,
- // and the select() call would change the selectedDOMNode and reenter this setter. So to
- // avoid calling _selectedNodeChanged() twice, first check if _selectedDOMNode is the same
- // node as the one passed in.
- // Note that _revealAndSelectNode will not do anything for a null node.
- if (!node || this._selectedDOMNode === node)
- this._selectedNodeChanged();
- },
-
- get editing()
- {
- return this._editing;
- },
-
- update: function()
- {
- var selectedNode = this.selectedTreeElement ? this.selectedTreeElement.representedObject : null;
-
- this.removeChildren();
-
- if (!this.rootDOMNode)
- return;
-
- var treeElement;
- if (this._includeRootDOMNode) {
- treeElement = new WebInspector.DOMTreeElement(this.rootDOMNode);
- treeElement.selectable = this._selectEnabled;
- this.appendChild(treeElement);
- } else {
- // FIXME: this could use findTreeElement to reuse a tree element if it already exists
- var node = this.rootDOMNode.firstChild;
- while (node) {
- treeElement = new WebInspector.DOMTreeElement(node);
- treeElement.selectable = this._selectEnabled;
- this.appendChild(treeElement);
- node = node.nextSibling;
- }
- }
-
- if (selectedNode)
- this._revealAndSelectNode(selectedNode, true);
- },
-
- updateSelection: function()
- {
- if (!this.selectedTreeElement)
- return;
- var element = this.treeOutline.selectedTreeElement;
- element.updateSelection();
- },
-
- _selectedNodeChanged: function()
- {
- this._eventSupport.dispatchEventToListeners(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged);
- },
-
- findTreeElement: function(node)
- {
- function isAncestorNode(ancestor, node)
- {
- return ancestor.isAncestor(node);
- }
-
- function parentNode(node)
- {
- return node.parentNode;
- }
-
- var treeElement = TreeOutline.prototype.findTreeElement.call(this, node, isAncestorNode, parentNode);
- if (!treeElement && node.nodeType() === Node.TEXT_NODE) {
- // The text node might have been inlined if it was short, so try to find the parent element.
- treeElement = TreeOutline.prototype.findTreeElement.call(this, node.parentNode, isAncestorNode, parentNode);
- }
-
- return treeElement;
- },
-
- createTreeElementFor: function(node)
- {
- var treeElement = this.findTreeElement(node);
- if (treeElement)
- return treeElement;
- if (!node.parentNode)
- return null;
-
- treeElement = this.createTreeElementFor(node.parentNode);
- if (treeElement && treeElement.showChild(node.index))
- return treeElement.children[node.index];
-
- return null;
- },
-
- set suppressRevealAndSelect(x)
- {
- if (this._suppressRevealAndSelect === x)
- return;
- this._suppressRevealAndSelect = x;
- },
-
- _revealAndSelectNode: function(node, omitFocus)
- {
- if (!node || this._suppressRevealAndSelect)
- return;
-
- var treeElement = this.createTreeElementFor(node);
- if (!treeElement)
- return;
-
- treeElement.revealAndSelect(omitFocus);
- },
-
- _treeElementFromEvent: function(event)
- {
- var scrollContainer = this.element.parentElement;
-
- // We choose this X coordinate based on the knowledge that our list
- // items extend at least to the right edge of the outer <ol> container.
- // In the no-word-wrap mode the outer <ol> may be wider than the tree container
- // (and partially hidden), in which case we are left to use only its right boundary.
- var x = scrollContainer.totalOffsetLeft + scrollContainer.offsetWidth - 36;
-
- var y = event.pageY;
-
- // Our list items have 1-pixel cracks between them vertically. We avoid
- // the cracks by checking slightly above and slightly below the mouse
- // and seeing if we hit the same element each time.
- var elementUnderMouse = this.treeElementFromPoint(x, y);
- var elementAboveMouse = this.treeElementFromPoint(x, y - 2);
- var element;
- if (elementUnderMouse === elementAboveMouse)
- element = elementUnderMouse;
- else
- element = this.treeElementFromPoint(x, y + 2);
-
- return element;
- },
-
- _onmousedown: function(event)
- {
- var element = this._treeElementFromEvent(event);
- if (!element || element.isEventWithinDisclosureTriangle(event)) {
- event.preventDefault();
- return;
- }
-
- element.select();
- },
-
- _onmousemove: function(event)
- {
- var element = this._treeElementFromEvent(event);
- if (element && this._previousHoveredElement === element)
- return;
-
- if (this._previousHoveredElement) {
- this._previousHoveredElement.hovered = false;
- delete this._previousHoveredElement;
- }
-
- if (element) {
- element.hovered = true;
- this._previousHoveredElement = element;
-
- // Lazily compute tag-specific tooltips.
- if (element.representedObject && !element.tooltip)
- element._createTooltipForNode();
- }
-
- WebInspector.domTreeManager.highlightDOMNode(element ? element.representedObject.id : 0);
- },
-
- _onmouseout: function(event)
- {
- var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);
- if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.element))
- return;
-
- if (this._previousHoveredElement) {
- this._previousHoveredElement.hovered = false;
- delete this._previousHoveredElement;
- }
-
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- },
-
- _ondragstart: function(event)
- {
- var treeElement = this._treeElementFromEvent(event);
- if (!treeElement)
- return false;
-
- if (!this._isValidDragSourceOrTarget(treeElement))
- return false;
-
- if (treeElement.representedObject.nodeName() === "BODY" || treeElement.representedObject.nodeName() === "HEAD")
- return false;
-
- event.dataTransfer.setData("text/plain", treeElement.listItemElement.textContent);
- event.dataTransfer.effectAllowed = "copyMove";
- this._nodeBeingDragged = treeElement.representedObject;
-
- WebInspector.domTreeManager.hideDOMNodeHighlight();
-
- return true;
- },
-
- _ondragover: function(event)
- {
- if (!this._nodeBeingDragged)
- return false;
-
- var treeElement = this._treeElementFromEvent(event);
- if (!this._isValidDragSourceOrTarget(treeElement))
- return false;
-
- var node = treeElement.representedObject;
- while (node) {
- if (node === this._nodeBeingDragged)
- return false;
- node = node.parentNode;
- }
-
- treeElement.updateSelection();
- treeElement.listItemElement.classList.add("elements-drag-over");
- this._dragOverTreeElement = treeElement;
- event.preventDefault();
- event.dataTransfer.dropEffect = 'move';
- return false;
- },
-
- _ondragleave: function(event)
- {
- this._clearDragOverTreeElementMarker();
- event.preventDefault();
- return false;
- },
-
- _isValidDragSourceOrTarget: function(treeElement)
- {
- if (!treeElement)
- return false;
-
- var node = treeElement.representedObject;
- if (!(node instanceof WebInspector.DOMNode))
- return false;
-
- if (!node.parentNode || node.parentNode.nodeType() !== Node.ELEMENT_NODE)
- return false;
-
- return true;
- },
-
- _ondrop: function(event)
- {
- event.preventDefault();
- var treeElement = this._treeElementFromEvent(event);
- if (this._nodeBeingDragged && treeElement) {
- var parentNode;
- var anchorNode;
-
- if (treeElement._elementCloseTag) {
- // Drop onto closing tag -> insert as last child.
- parentNode = treeElement.representedObject;
- } else {
- var dragTargetNode = treeElement.representedObject;
- parentNode = dragTargetNode.parentNode;
- anchorNode = dragTargetNode;
- }
-
- function callback(error, newNodeId)
- {
- if (error)
- return;
-
- this._updateModifiedNodes();
- var newNode = WebInspector.domTreeManager.nodeForId(newNodeId);
- if (newNode)
- this.selectDOMNode(newNode, true);
- }
- this._nodeBeingDragged.moveTo(parentNode, anchorNode, callback.bind(this));
- }
-
- delete this._nodeBeingDragged;
- },
-
- _ondragend: function(event)
- {
- event.preventDefault();
- this._clearDragOverTreeElementMarker();
- delete this._nodeBeingDragged;
- },
-
- _clearDragOverTreeElementMarker: function()
- {
- if (this._dragOverTreeElement) {
- this._dragOverTreeElement.updateSelection();
- this._dragOverTreeElement.listItemElement.classList.remove("elements-drag-over");
- delete this._dragOverTreeElement;
- }
- },
-
- _contextMenuEventFired: function(event)
- {
- var treeElement = this._treeElementFromEvent(event);
- if (!treeElement)
- return;
-
- var contextMenu = new WebInspector.ContextMenu(event);
- this.populateContextMenu(contextMenu, event);
- contextMenu.show();
- },
-
- populateContextMenu: function(contextMenu, event)
- {
- var treeElement = this._treeElementFromEvent(event);
- if (!treeElement)
- return false;
-
- var tag = event.target.enclosingNodeOrSelfWithClass("html-tag");
- var textNode = event.target.enclosingNodeOrSelfWithClass("html-text-node");
- var commentNode = event.target.enclosingNodeOrSelfWithClass("html-comment");
- var populated = false;
- if (tag && treeElement._populateTagContextMenu) {
- if (populated)
- contextMenu.appendSeparator();
- treeElement._populateTagContextMenu(contextMenu, event);
- populated = true;
- } else if (textNode && treeElement._populateTextContextMenu) {
- if (populated)
- contextMenu.appendSeparator();
- treeElement._populateTextContextMenu(contextMenu, textNode);
- populated = true;
- } else if (commentNode && treeElement._populateNodeContextMenu) {
- if (populated)
- contextMenu.appendSeparator();
- treeElement._populateNodeContextMenu(contextMenu, textNode);
- populated = true;
- }
-
- return populated;
- },
-
- adjustCollapsedRange: function()
- {
- },
-
- _updateModifiedNodes: function()
- {
- if (this._elementsTreeUpdater)
- this._elementsTreeUpdater._updateModifiedNodes();
- },
-
- _populateContextMenu: function(contextMenu, domNode)
- {
- if (!this._showInElementsPanelEnabled)
- return;
-
- function revealElement()
- {
- WebInspector.domTreeManager.inspectElement(domNode.id);
- }
-
- contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), revealElement);
- },
-
- _showShadowDOMSettingChanged: function(event)
- {
- var nodeToSelect = this.selectedTreeElement ? this.selectedTreeElement.representedObject : null;
- while (nodeToSelect) {
- if (!nodeToSelect.isInShadowTree())
- break;
- nodeToSelect = nodeToSelect.parentNode;
- }
-
- this.children.forEach(function(child) {
- child.updateChildren(true);
- });
-
- if (nodeToSelect)
- this.selectDOMNode(nodeToSelect);
- },
-
- _hideElement: function(event, keyboardShortcut)
- {
- if (!this.selectedTreeElement || WebInspector.isEditingAnyField())
- return;
-
- event.preventDefault();
-
- var selectedNode = this.selectedTreeElement.representedObject;
- console.assert(selectedNode);
- if (!selectedNode)
- return;
-
- if (selectedNode.nodeType() !== Node.ELEMENT_NODE)
- return;
-
- if (this._togglePending)
- return;
- this._togglePending = true;
-
- function toggleProperties()
- {
- nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, toggleProperties, this);
-
- var opacityProperty = nodeStyles.inlineStyle.propertyForName("opacity");
- opacityProperty.value = "0";
- opacityProperty.important = true;
-
- var pointerEventsProperty = nodeStyles.inlineStyle.propertyForName("pointer-events");
- pointerEventsProperty.value = "none";
- pointerEventsProperty.important = true;
-
- if (opacityProperty.enabled && pointerEventsProperty.enabled) {
- opacityProperty.remove();
- pointerEventsProperty.remove();
- } else {
- opacityProperty.add();
- pointerEventsProperty.add();
- }
-
- delete this._togglePending;
- }
-
- var nodeStyles = WebInspector.cssStyleManager.stylesForNode(selectedNode);
- if (nodeStyles.needsRefresh) {
- nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, toggleProperties, this);
- nodeStyles.refresh();
- } else
- toggleProperties.call(this);
- }
-}
-
-WebInspector.DOMTreeOutline.prototype.__proto__ = TreeOutline.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMTreeUpdaterjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMTreeUpdater.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMTreeUpdater.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMTreeUpdater.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,143 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-/**
- * @constructor
- */
-WebInspector.DOMTreeUpdater = function(treeOutline)
-{
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeInserted, this._nodeInserted, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._attributesUpdated, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._attributesUpdated, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified, this._characterDataModified, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._documentUpdated, this);
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ChildNodeCountUpdated, this._childNodeCountUpdated, this);
-
- this._treeOutline = treeOutline;
- this._recentlyModifiedNodes = [];
-}
-
-WebInspector.DOMTreeUpdater.prototype = {
- close: function()
- {
- WebInspector.domTreeManager.removeEventListener(null, null, this);
- },
-
- _documentUpdated: function(event)
- {
- this._reset();
- },
-
- _attributesUpdated: function(event)
- {
- this._recentlyModifiedNodes.push({node: event.data.node, updated: true});
- if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
- },
-
- _characterDataModified: function(event)
- {
- this._recentlyModifiedNodes.push({node: event.data.node, updated: true});
- if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
- },
-
- _nodeInserted: function(event)
- {
- this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, inserted: true});
- if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
- },
-
- _nodeRemoved: function(event)
- {
- this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, removed: true});
- if (this._treeOutline._visible)
- this._updateModifiedNodesSoon();
- },
-
- _childNodeCountUpdated: function(event)
- {
- var treeElement = this._treeOutline.findTreeElement(event.data);
- if (treeElement)
- treeElement.hasChildren = event.data.hasChildNodes();
- },
-
- _updateModifiedNodesSoon: function()
- {
- if (this._updateModifiedNodesTimeout)
- return;
- this._updateModifiedNodesTimeout = setTimeout(this._updateModifiedNodes.bind(this), 0);
- },
-
- _updateModifiedNodes: function()
- {
- if (this._updateModifiedNodesTimeout) {
- clearTimeout(this._updateModifiedNodesTimeout);
- delete this._updateModifiedNodesTimeout;
- }
-
- var updatedParentTreeElements = [];
-
- for (var i = 0; i < this._recentlyModifiedNodes.length; ++i) {
- var parent = this._recentlyModifiedNodes[i].parent;
- var node = this._recentlyModifiedNodes[i].node;
-
- if (this._recentlyModifiedNodes[i].updated) {
- var nodeItem = this._treeOutline.findTreeElement(node);
- if (nodeItem)
- nodeItem.updateTitle();
- continue;
- }
-
- if (!parent)
- continue;
-
- var parentNodeItem = this._treeOutline.findTreeElement(parent);
- if (parentNodeItem && !parentNodeItem.alreadyUpdatedChildren) {
- parentNodeItem.updateChildren();
- parentNodeItem.alreadyUpdatedChildren = true;
- updatedParentTreeElements.push(parentNodeItem);
- }
- }
-
- for (var i = 0; i < updatedParentTreeElements.length; ++i)
- delete updatedParentTreeElements[i].alreadyUpdatedChildren;
-
- this._recentlyModifiedNodes = [];
- },
-
- _reset: function()
- {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- this._recentlyModifiedNodes = [];
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDOMUtilitiesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DOMUtilities.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DOMUtilities.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DOMUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.displayNameForNode = function(node)
-{
- var title = node.nodeNameInCorrectCase();
-
- var idAttribute = node.getAttribute("id");
- if (idAttribute) {
- if (/[\s'"]/.test(idAttribute)) {
- idAttribute = idAttribute.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");
- title += "[id=\"" + idAttribute + "\"]";
- } else
- title += "#" + idAttribute;
- }
-
- var classAttribute = node.getAttribute("class");
- if (classAttribute) {
- var classes = classAttribute.trim().split(/\s+/);
- var foundClasses = {};
-
- for (var i = 0; i < classes.length; ++i) {
- var className = classes[i];
- if (className && !(className in foundClasses)) {
- title += "." + className;
- foundClasses[className] = true;
- }
- }
- }
-
- return title;
-}
-
-WebInspector.linkifyNodeReference = function(node)
-{
- var displayName = WebInspector.displayNameForNode(node);
-
- var link = document.createElement("span");
- link.appendChild(document.createTextNode(displayName));
- link.className = "node-link";
- link.title = displayName;
-
- link.addEventListener("click", WebInspector.domTreeManager.inspectElement.bind(WebInspector.domTreeManager, node.id));
- link.addEventListener("mouseover", WebInspector.domTreeManager.highlightDOMNode.bind(WebInspector.domTreeManager, node.id, ""));
- link.addEventListener("mouseout", WebInspector.domTreeManager.hideDOMNodeHighlight.bind(WebInspector.domTreeManager));
-
- return link;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDashboardManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DashboardManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DashboardManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DashboardManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,187 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DashboardManager = function() {
- WebInspector.Object.call(this);
-
- this.toolbarItem = new WebInspector.NavigationItem("dashboard", "group", WebInspector.UIString("Activity Viewer"));
- this._view = new WebInspector.DashboardView(this.toolbarItem.element);
-
- this._waitingForFirstMainResourceToStartTrackingSize = true;
-
- // Necessary event required to track page load time and resource sizes.
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
-
- // Necessary events required to track load of resources.
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
- WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
-
- // Necessary events required to track console messages.
- var logManager = WebInspector.logManager;
- logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._consoleWasCleared, this);
- logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._consoleWasCleared, this);
- logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, this._consoleMessageAdded, this);
- logManager.addEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, this._consoleMessageWasRepeated, this);
-};
-
-WebInspector.DashboardManager.prototype = {
- constructor: WebInspector.DashboardManager,
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- this._view.resourcesCount = 1;
- this._view.resourcesSize = WebInspector.frameResourceManager.mainFrame.mainResource.size || 0;
-
- // Only update the time if we are recording the timeline.
- if (!WebInspector.timelineManager.recordingEnabled) {
- this._view.time = 0;
- return;
- }
-
- // We should only track resource sizes on fresh loads.
- if (this._waitingForFirstMainResourceToStartTrackingSize) {
- delete this._waitingForFirstMainResourceToStartTrackingSize;
- WebInspector.Resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._resourceSizeDidChange, this);
- }
-
- this._startUpdatingTime();
- },
-
- _recordingStopped: function(event)
- {
- // If recording stops, we should stop the timer if it hasn't stopped already.
- this._stopUpdatingTime();
- },
-
- _resourceWasAdded: function(event)
- {
- ++this._view.resourcesCount;
- },
-
- _frameWasAdded: function(event)
- {
- ++this._view.resourcesCount;
- },
-
- _resourceSizeDidChange: function(event)
- {
- this._view.resourcesSize += event.target.size - event.data.previousSize;
- },
-
- _startUpdatingTime: function()
- {
- this._stopUpdatingTime();
-
- this._view.time = 0;
-
- this._timelineBaseTime = Date.now();
- this._timeIntervalDelay = 50;
- this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
- },
-
- _stopUpdatingTime: function()
- {
- if (!this._timeIntervalIdentifier)
- return;
-
- clearInterval(this._timeIntervalIdentifier);
- delete this._timeIntervalIdentifier;
- },
-
- _updateTime: function()
- {
- var duration = Date.now() - this._timelineBaseTime;
-
- var timeIntervalDelay = this._timeIntervalDelay;
- if (duration >= 1000) // 1 second
- timeIntervalDelay = 100;
- else if (duration >= 60000) // 60 seconds
- timeIntervalDelay = 1000;
- else if (duration >= 3600000) // 1 minute
- timeIntervalDelay = 10000;
-
- if (timeIntervalDelay !== this._timeIntervalDelay) {
- this._timeIntervalDelay = timeIntervalDelay;
-
- clearInterval(this._timeIntervalIdentifier);
- this._timeIntervalIdentifier = setInterval(this._updateTime.bind(this), this._timeIntervalDelay);
- }
-
- var mainFrame = WebInspector.frameResourceManager.mainFrame;
- var mainFrameStartTime = mainFrame.mainResource.firstTimestamp;
- var mainFrameLoadEventTime = mainFrame.loadEventTimestamp;
-
- if (isNaN(mainFrameStartTime) || isNaN(mainFrameLoadEventTime)) {
- this._view.time = duration / 1000;
- return;
- }
-
- this._view.time = mainFrameLoadEventTime - mainFrameStartTime;
-
- this._stopUpdatingTime();
- },
-
- _consoleMessageAdded: function(event)
- {
- var message = event.data.message;
- this._lastConsoleMessageType = message.level;
- this._incrementConsoleMessageType(message.level, message.totalRepeatCount);
- },
-
- _consoleMessageWasRepeated: function(event)
- {
- this._incrementConsoleMessageType(this._lastConsoleMessageType, 1);
- },
-
- _incrementConsoleMessageType: function(type, increment)
- {
- switch (type) {
- case "log":
- this._view.logs += increment;
- break;
- case "warning":
- this._view.issues += increment;
- break;
- case "error":
- this._view.errors += increment;
- break;
- }
- },
-
- _consoleWasCleared: function(event)
- {
- this._view.logs = 0;
- this._view.issues = 0;
- this._view.errors = 0;
- }
-};
-
-WebInspector.DashboardManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDashboardViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DashboardView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DashboardView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DashboardView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,243 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.toolbar .dashboard {
- display: -webkit-flex;
- -webkit-flex-flow: row nowrap;
-
- -webkit-justify-content: space-between;
-
- margin: 4px 10px;
- padding: 0 5px;
-
- width: 375px;
-
- background-image: -webkit-linear-gradient(bottom, rgba(0, 128, 255, 0.075), rgba(0, 128, 255, 0)),
- -webkit-linear-gradient(left, rgba(0, 0, 0, 0.09), transparent, rgba(0, 0, 0, 0.09)),
- -webkit-linear-gradient(top, rgb(240, 244, 251), rgb(250, 253, 255));
- background-size: 100% 6px, auto, auto;
- background-position: bottom, center, center;
- background-repeat: no-repeat;
-
- border: 1px solid rgb(163, 163, 163);
- border-radius: 4px;
-
- box-shadow: rgba(255, 255, 255, 0.45) 0 1px 0;
-}
-
-body.window-inactive .toolbar .dashboard {
- border-color: rgb(196, 196, 196);
- background-image: none;
- background-color: rgb(239, 239, 239);
-}
-
-.toolbar.collapsed .dashboard,
-body.javascript .toolbar .dashboard {
- width: 175px;
-}
-
-body.web .toolbar.collapsed .dashboard > .time,
-body.web .toolbar.collapsed .dashboard > .resourcesSize,
-body.web .toolbar.collapsed .dashboard > .logs {
- display: none;
-}
-
-body.javascript .toolbar .dashboard > .time,
-body.javascript .toolbar .dashboard > .resourcesSize,
-body.javascript .toolbar .dashboard > .resourcesCount {
- display: none;
-}
-
-.toolbar .dashboard > .item {
- font-family: Helvetica, sans-serif;
- font-weight: bold;
- font-size: 11px;
- line-height: 12px;
-
- padding: 0 5px;
-
- display: -webkit-flex;
-
- min-width: 45px;
-
- -webkit-justify-content: center;
- -webkit-align-items: center;
-
- border-radius: 4px;
- border: 1px solid transparent;
-}
-
-.toolbar .dashboard > .time,
-.toolbar .dashboard > .resourcesSize {
- min-width: 70px;
-}
-
-.toolbar .dashboard > .item.enabled:hover {
- border: 1px solid rgba(0, 0, 0, 0.1);
-}
-
-.toolbar .dashboard > .item.enabled:active {
- border: 1px solid rgba(0, 0, 0, 0.2);
-}
-
-.toolbar .dashboard > .item > * {
- display: -webkit-flex;
- -webkit-align-items: center;
-}
-
-.toolbar .dashboard > .item > img {
- opacity: 0.2;
- width: 16px;
- height: 16px;
- pointer-events: none;
-}
-
-.toolbar .dashboard > .item.enabled > img {
- opacity: 0.5;
-}
-
-.toolbar .dashboard > .item.enabled:hover > img {
- opacity: 0.65;
-}
-
-.toolbar .dashboard > .item > div {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- color: rgba(0, 0, 0, 0.2);
- padding-left: 2px;
-}
-
-.toolbar .dashboard > .item.enabled > div {
- color: rgba(0, 0, 0, 0.7);
-}
-
-.toolbar .dashboard > .item.enabled:hover > div {
- color: rgba(0, 0, 0, 0.85);
-}
-
-.toolbar .dashboard > .resourcesCount > img {
- content: url(Images/Resources.svg);
-}
-
-.toolbar .dashboard > .time > img {
- content: url(Images/Time.svg);
-}
-
-.toolbar .dashboard > .logs > img {
- content: url(Images/Logs.svg);
-}
-
-.toolbar .dashboard > .resourcesSize > img {
- content: url(Images/Weight.svg);
-}
-
-.toolbar .dashboard > .errors > img {
- content: url(Images/Errors.svg);
-}
-
-.toolbar .dashboard > .errors.enabled > img {
- content: url(Images/ErrorsEnabled.svg);
- opacity: 0.9;
-}
-
-.toolbar .dashboard > .errors.enabled:hover > img {
- opacity: 1;
-}
-
-.toolbar .dashboard > .errors.enabled > div {
- color: rgba(201, 55, 57, 0.9);
-}
-
-.toolbar .dashboard > .errors.enabled:hover > div {
- color: rgb(201, 55, 57);
-}
-
-.toolbar .dashboard > .issues > img {
- content: url(Images/Issues.svg);
-}
-
-.toolbar .dashboard > .issues.enabled > img {
- content: url(Images/IssuesEnabled.svg);
- opacity: 0.9;
-}
-
-.toolbar .dashboard > .issues.enabled:hover > img {
- opacity: 1;
-}
-
-.toolbar .dashboard > .issues.enabled > div {
- color: rgba(224, 164, 4, 0.9);
-}
-
-.toolbar .dashboard > .issues.enabled:hover > div {
- color: rgb(224, 164, 4);
-}
-
-.toolbar.small-size.icon-and-label-vertical .dashboard,
-.toolbar.normal-size.icon-and-label-vertical .dashboard {
- margin-top: 6px;
-}
-
-/* Styles for the extra short style, one row with quite a small y-margin */
-
-.toolbar.label-only .dashboard,
-.toolbar.small-size.icon-only .dashboard,
-.toolbar.small-size.icon-and-label-vertical .dashboard,
-.toolbar.small-size.icon-and-label-horizontal .dashboard {
- height: 22px;
-}
-
-.toolbar.label-only .dashboard > .item,
-.toolbar.small-size.icon-only .dashboard > .item,
-.toolbar.small-size.icon-and-label-vertical .dashboard > .item,
-.toolbar.small-size.icon-and-label-horizontal .dashboard > .item {
- margin: 1px 0;
-}
-
-/* Styles for the fairly short style, one row with quite a bit of y-margin */
-
-.toolbar.normal-size.icon-only .dashboard,
-.toolbar.normal-size.icon-and-label-vertical .dashboard,
-.toolbar.normal-size.icon-and-label-horizontal .dashboard {
- height: 30px;
-}
-
-.toolbar.normal-size.icon-only .dashboard > .item,
-.toolbar.normal-size.icon-and-label-vertical .dashboard > .item,
-.toolbar.normal-size.icon-and-label-horizontal .dashboard > .item {
- margin: 4px 0;
-}
-
-/* Styles for the pulsing animated state of console items */
-
-.toolbar .dashboard > .item.pulsing {
- -webkit-animation-name: console-item-pulse;
- -webkit-animation-duration: 0.75s;
-}
-
-@-webkit-keyframes console-item-pulse {
- 50% { opacity: 0.6; }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDashboardViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DashboardView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DashboardView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DashboardView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,245 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DashboardView = function(element)
-{
- WebInspector.Object.call(this);
-
- this._element = element;
-
- this._items = {
- resourcesCount: {
- tooltip: WebInspector.UIString("Total number of resources, click to show the Resources navigation sidebar"),
- handler: this._resourcesWasClicked
- },
- resourcesSize: {
- tooltip: WebInspector.UIString("Total size of all resources, click to show the Network Requests timeline"),
- handler: this._networkItemWasClicked
- },
- time: {
- tooltip: WebInspector.UIString("Time until the load event fired, click to show the Network Requests timeline"),
- handler: this._networkItemWasClicked
- },
- logs: {
- tooltip: WebInspector.UIString("Console logs, click to show the Console"),
- handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Logs)
- },
- errors: {
- tooltip: WebInspector.UIString("Console errors, click to show the Console"),
- handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Errors)
- },
- issues: {
- tooltip: WebInspector.UIString("Console warnings, click to show the Console"),
- handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Warnings)
- }
- };
-
- for (var name in this._items)
- this._appendElementForNamedItem(name);
-
- this.resourcesCount = 0;
- this.resourcesSize = 0;
- this.time = 0;
- this.logs = 0;
- this.errors = 0;
- this.issues = 0;
-};
-
-WebInspector.DashboardView.EnabledStyleClassName = "enabled";
-
-WebInspector.DashboardView.prototype = {
- constructor: WebInspector.DashboardView,
-
- // Public
-
- get logs()
- {
- return this._logs;
- },
-
- set logs(logs)
- {
- this._setConsoleItemValue("logs", logs);
- },
-
- get issues()
- {
- return this._issues;
- },
-
- set issues(issues)
- {
- this._setConsoleItemValue("issues", issues);
- },
-
- get errors()
- {
- return this._errors;
- },
-
- set errors(errors)
- {
- this._setConsoleItemValue("errors", errors);
- },
-
- set time(time)
- {
- var item = this._items.time;
- item.text = time ? Number.secondsToString(time) : "\u2014";
- this._setItemEnabled(item, time > 0);
- },
-
- get resourcesCount()
- {
- return this._resourcesCount;
- },
-
- set resourcesCount(resourcesCount)
- {
- this._resourcesCount = resourcesCount;
-
- var item = this._items.resourcesCount;
- item.text = this._formatPossibleLargeNumber(resourcesCount);
- this._setItemEnabled(item, resourcesCount > 0);
- },
-
- get resourcesSize()
- {
- return this._resourcesSize;
- },
-
- set resourcesSize(resourcesSize)
- {
- this._resourcesSize = resourcesSize;
-
- var item = this._items.resourcesSize;
- item.text = resourcesSize ? Number.bytesToString(resourcesSize, false) : "\u2014";
- this._setItemEnabled(item, resourcesSize > 0);
- },
-
- // Private
-
- _formatPossibleLargeNumber: function(number)
- {
- return number > 999 ? WebInspector.UIString("999+") : number;
- },
-
- _appendElementForNamedItem: function(name)
- {
- var item = this._items[name];
-
- item.container = this._element.appendChild(document.createElement("div"));
- item.container.className = "item " + name;
- item.container.title = item.tooltip;
-
- item.container.appendChild(document.createElement("img"));
-
- item.outlet = item.container.appendChild(document.createElement("div"));
-
- Object.defineProperty(item, "text",
- {
- set: function(newText)
- {
- if (newText === item.outlet.textContent)
- return;
- item.outlet.textContent = newText;
- }
- });
-
- item.container.addEventListener("click", function(event) {
- this._itemWasClicked(name);
- }.bind(this));
- },
-
- _itemWasClicked: function(name)
- {
- var item = this._items[name];
- if (!item.container.classList.contains(WebInspector.DashboardView.EnabledStyleClassName))
- return;
-
- if (item.handler)
- item.handler.call(this);
- },
-
- _resourcesWasClicked: function()
- {
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
- WebInspector.navigationSidebar.collapsed = false;
- },
-
- _networkItemWasClicked: function()
- {
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.timelineSidebarPanel;
- },
-
- _consoleItemWasClicked: function(scope)
- {
- WebInspector.showConsoleView(scope);
- },
-
- _setConsoleItemValue: function(itemName, newValue)
- {
- var iVarName = "_" + itemName;
- var previousValue = this[iVarName];
- this[iVarName] = newValue;
-
- var item = this._items[itemName];
- item.text = this._formatPossibleLargeNumber(newValue);
- this._setItemEnabled(item, newValue > 0);
-
- if (newValue <= previousValue)
- return;
-
- var container = item.container;
-
- function animationEnded(event)
- {
- if (event.target === container) {
- container.classList.remove("pulsing");
- container.removeEventListener("webkitAnimationEnd", animationEnded);
- }
- }
-
- // We need to force a style invalidation in the case where we already
- // were animating this item after we've removed the pulsing CSS class.
- if (container.classList.contains("pulsing")) {
- container.classList.remove("pulsing");
- container.recalculateStyles();
- } else
- container.addEventListener("webkitAnimationEnd", animationEnded);
-
- container.classList.add("pulsing");
- },
-
- _setItemEnabled: function(item, enabled)
- {
- if (enabled)
- item.container.classList.add(WebInspector.DashboardView.EnabledStyleClassName);
- else
- item.container.classList.remove(WebInspector.DashboardView.EnabledStyleClassName);
- }
-};
-
-WebInspector.DashboardView.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDataGridcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DataGrid.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DataGrid.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,337 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.data-grid {
- position: relative;
- border: 1px solid #aaa;
- outline: none;
-}
-
-.data-grid .highlight {
- background-color: rgb(255, 230, 179);
-}
-
-.data-grid tr.selected .highlight {
- background-color: transparent;
-}
-
-.data-grid table {
- table-layout: fixed;
- border-spacing: 0;
- border-collapse: collapse;
- width: 100%;
- font-size: 10px;
- font-family: Lucida Grande, sans-serif;
-}
-
-.data-grid .data-container {
- position: absolute;
- top: 16px;
- bottom: 0;
- left: 0;
- right: 0;
- overflow-x: hidden;
- overflow-y: overlay;
-}
-
-.data-grid.inline .data-container {
- position: static;
-}
-
-.data-grid.inline {
- border: 1px solid rgb(181, 181, 181);
-}
-
-.data-grid.no-header > table.header {
- display: none;
-}
-
-.data-grid.no-header .data-container {
- top: 0;
-}
-
-.data-grid th {
- text-align: left;
- vertical-align: middle;
-
- background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), -webkit-linear-gradient(top, transparent, transparent),
- -webkit-linear-gradient(top, white, white 25%, rgb(244, 244, 244) 50%, rgb(236, 236, 236) 50%, rgb(237, 237, 237));
- background-size: 1px 11px, 0 0, 100% 100%;
- background-position: left 2px, right 2px, center;
- background-repeat: no-repeat;
-
- box-shadow: inset rgba(255, 255, 255, 0.3) 0 -1px 0;
- border-bottom: 1px solid rgb(182, 182, 182);
-
- height: 15px;
- font-weight: normal;
- padding: 0 4px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.data-grid th:first-child {
- background-position: -1px 2px, right 2px, center;
-}
-
-.data-grid th:active:first-child {
- background-position: -1px 2px, right top, center;
-}
-
-.data-grid th:last-child {
- background-position: left 2px, -1px 2px, center;
-}
-
-.data-grid th:active:last-child {
- background-position: left top, -1px top, center;
-}
-
-.data-grid tr.filler {
- display: table-row !important;
- height: auto !important;
-}
-
-.data-grid tr.filler td {
- height: auto !important;
- padding: 0 !important;
-}
-
-.data-grid table.data {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- height: 100%;
- border-top: 0 none transparent;
- background-image: -webkit-linear-gradient(top, white, white 50%, rgb(243, 246, 250) 50%, rgb(243, 246, 250));
- background-size: 100% 32px;
- table-layout: fixed;
-}
-
-.data-grid.inline table.data {
- position: static;
-}
-
-.data-grid table.data tr {
- display: none;
-}
-
-.data-grid table.data tr.revealed {
- display: table-row;
-}
-
-.data-grid td {
- vertical-align: top;
- height: 12px;
- line-height: 12px;
- padding: 2px 4px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.data-grid td:last-child {
- padding-right: 16px;
-}
-
-.data-grid td > div, .data-grid th > div {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-.data-grid .centered div {
- text-align: center;
-}
-
-.data-grid .right div {
- text-align: right;
-}
-
-.data-grid th.sortable div {
- position: relative;
-}
-
-.data-grid th.sortable:not(.mouse-over-collapser):active {
- background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
- -webkit-linear-gradient(top, rgb(224, 224, 224), rgb(224, 224, 224) 25%, rgb(214, 214, 214) 50%, rgb(207, 207, 207) 50%, rgb(208, 208, 208));
- background-size: 1px 15px, 1px 15px, 100% 100%;
- background-position: left top, right top, center;
-
- box-shadow: inset rgba(255, 255, 255, 0.1) 0 -1px 0;
- border-bottom: 1px solid rgb(160, 160, 160);
-}
-
-.data-grid th.sort-ascending, .data-grid th.sort-descending {
- background-image: -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)), -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)),
- -webkit-linear-gradient(top, rgb(199, 226, 246), rgb(169, 209, 239) 25%, rgb(158, 204, 239) 50%, rgb(142, 196, 237) 50%, rgb(187, 230, 245));
- background-size: 1px 15px, 1px 15px, 100% 100%;
- background-position: left top, right top, center;
-
- box-shadow: inset rgba(255, 255, 255, 0.1) 0 -1px 0;
- border-bottom: 1px solid rgb(130, 179, 210);
-}
-
-.data-grid th.sortable.sort-ascending:not(.mouse-over-collapser):active, .data-grid th.sortable.sort-descending:not(.mouse-over-collapser):active {
- background-image: -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)), -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)),
- -webkit-linear-gradient(top, rgb(144, 180, 227), rgb(109, 160, 220) 25%, rgb(96, 155, 221) 50%, rgb(77, 146, 219) 50%, rgb(130, 186, 227));
- background-size: 1px 15px, 1px 15px, 100% 100%;
- background-position: left top, right top, center;
-
- border-bottom: 1px solid rgb(63, 125, 192);
-}
-
-.data-grid th:active + th,
-.data-grid th.sort-ascending + th,
-.data-grid th.sort-descending + th {
- background-position: -1px 2px, -1px 2px, center;
-}
-
-.data-grid th:active + th.sort-ascending,
-.data-grid th:active + th.sort-descending,
-.data-grid th.sort-ascending + th:active,
-.data-grid th.sort-descending + th:active {
- background-position: -1px top, right top, center;
-}
-
-.data-grid th:first-child:active,
-.data-grid th.sort-ascending:first-child,
-.data-grid th.sort-descending:first-child {
- background-position: -1px top, right top, center !important;
-}
-
-.data-grid th:last-child:active,
-.data-grid th.sort-ascending:last-child,
-.data-grid th.sort-descending:last-child {
- background-position: left top, -1px top, center !important;
-}
-
-.data-grid th.sort-ascending > div:first-child,
-.data-grid th.sort-descending > div:first-child {
- padding-right: 10px;
-}
-
-.data-grid th.sort-ascending > div:first-child::after {
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
-
- margin-bottom: auto;
- margin-top: auto;
-
- width: 9px;
- height: 8px;
-
- content: "";
-
- background-image: -webkit-canvas(data-grid-sort-indicator-up-arrow);
- background-size: 9px 8px;
- background-repeat: no-repeat;
-}
-
-.data-grid th.sort-descending > div:first-child::after {
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
-
- margin-bottom: auto;
- margin-top: auto;
-
- width: 9px;
- height: 8px;
-
- content: "";
-
- background-image: -webkit-canvas(data-grid-sort-indicator-down-arrow);
- background-size: 9px 8px;
- background-repeat: no-repeat;
-}
-
-.data-grid button {
- line-height: 19px;
-}
-
-body.window-inactive .data-grid th.sort-ascending,
-body.window-inactive .data-grid th.sort-descending {
- background-image: -webkit-linear-gradient(top, white, white 25%, rgb(244, 244, 244) 50%, rgb(236, 236, 236) 50%, rgb(237, 237, 237)),
- -webkit-linear-gradient(top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
- background-size: 100% 100%, 1px 11px;
- background-position: center, right center;
- background-repeat: no-repeat;
- border-bottom: 1px solid rgb(182, 182, 182);
-}
-
-.data-grid tr.parent td.disclosure::before {
- float: left;
-
- content: "";
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- width: 8px;
- height: 8px;
-
- margin-top: 2px;
- margin-right: 2px;
-}
-
-.data-grid tr.parent.expanded td.disclosure::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.data-grid:focus tr.parent.selected td.disclosure::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
-}
-
-.data-grid:focus tr.parent.expanded.selected td.disclosure::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
-}
-
-.data-grid tr.selected {
- background-color: rgb(212, 212, 212) !important;
- color: inherit !important;
-}
-
-.data-grid:focus tr.selected {
- background-color: rgb(56, 121, 217) !important;
- color: white !important;
-}
-
-.data-grid tr:not(.parent) td.disclosure {
- text-indent: 10px;
-}
-
-.data-grid-resizer {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 5px;
- z-index: 500;
- cursor: col-resize;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1872 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013, 2014 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.DataGrid = function(columnsData, editCallback, deleteCallback)
-{
- this.columns = new Map;
- this.orderedColumns = [];
-
- this.children = [];
- this.selectedNode = null;
- this.expandNodesWhenArrowing = false;
- this.root = true;
- this.hasChildren = false;
- this.expanded = true;
- this.revealed = true;
- this.selected = false;
- this.dataGrid = this;
- this.indentWidth = 15;
- this.resizerElements = [];
- this._columnWidthsInitialized = false;
-
- this.element = document.createElement("div");
- this.element.className = "data-grid";
- this.element.tabIndex = 0;
- this.element.addEventListener("keydown", this._keyDown.bind(this), false);
- this.element.copyHandler = this;
-
- this._headerTableElement = document.createElement("table");
- this._headerTableElement.className = "header";
- this._headerTableColumnGroupElement = this._headerTableElement.createChild("colgroup");
- this._headerTableBodyElement = this._headerTableElement.createChild("tbody");
- this._headerTableRowElement = this._headerTableBodyElement.createChild("tr");
- this._headerTableCellElements = new Map;
-
- this._scrollContainerElement = document.createElement("div");
- this._scrollContainerElement.className = "data-container";
-
- this._dataTableElement = this._scrollContainerElement.createChild("table");
- this._dataTableElement.className = "data";
-
- this._dataTableElement.addEventListener("mousedown", this._mouseDownInDataTable.bind(this));
- this._dataTableElement.addEventListener("click", this._clickInDataTable.bind(this));
- this._dataTableElement.addEventListener("contextmenu", this._contextMenuInDataTable.bind(this), true);
-
- // FIXME: Add a createCallback which is different from editCallback and has different
- // behavior when creating a new node.
- if (editCallback) {
- this._dataTableElement.addEventListener("dblclick", this._ondblclick.bind(this), false);
- this._editCallback = editCallback;
- }
- if (deleteCallback)
- this._deleteCallback = deleteCallback;
-
- this._dataTableColumnGroupElement = this._headerTableColumnGroupElement.cloneNode(true);
- this._dataTableElement.appendChild(this._dataTableColumnGroupElement);
-
- // This element is used by DataGridNodes to manipulate table rows and cells.
- this.dataTableBodyElement = this._dataTableElement.createChild("tbody");
- this._fillerRowElement = this.dataTableBodyElement.createChild("tr");
- this._fillerRowElement.className = "filler";
-
- this.element.appendChild(this._headerTableElement);
- this.element.appendChild(this._scrollContainerElement);
-
- for (var columnIdentifier in columnsData)
- this.insertColumn(columnIdentifier, columnsData[columnIdentifier]);
-
- this._generateSortIndicatorImagesIfNeeded();
-}
-
-WebInspector.DataGrid.Event = {
- DidLayout: "datagrid-did-layout",
- SortChanged: "datagrid-sort-changed",
- SelectedNodeChanged: "datagrid-selected-node-changed",
- ExpandedNode: "datagrid-expanded-node",
- CollapsedNode: "datagrid-collapsed-node"
-};
-
-/**
- * @param {Array.<string>} columnNames
- * @param {Array.<string>} values
- */
-WebInspector.DataGrid.createSortableDataGrid = function(columnNames, values)
-{
- var numColumns = columnNames.length;
- if (!numColumns)
- return null;
-
- var columnsData = {};
-
- for (var columnName of columnNames) {
- var column = {};
- column.width = columnName.length;
- column.title = columnName;
- column.sortable = true;
-
- columnsData[columnName] = column;
- }
-
- var dataGrid = new WebInspector.DataGrid(columnsData);
- for (var i = 0; i < values.length / numColumns; ++i) {
- var data = {};
- for (var j = 0; j < columnNames.length; ++j)
- data[columnNames[j]] = values[numColumns * i + j];
-
- var node = new WebInspector.DataGridNode(data, false);
- node.selectable = false;
- dataGrid.appendChild(node);
- }
-
- function sortDataGrid()
- {
- var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
- var sortAscending = dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- for (var node of dataGrid.children) {
- if (isNaN(Number(node.data[sortColumnIdentifier] || "")))
- columnIsNumeric = false;
- }
-
- function comparator(dataGridNode1, dataGridNode2)
- {
- var item1 = dataGridNode1.data[sortColumnIdentifier] || "";
- var item2 = dataGridNode2.data[sortColumnIdentifier] || "";
-
- var comparison;
- if (columnIsNumeric) {
- // Sort numbers based on comparing their values rather than a lexicographical comparison.
- var number1 = parseFloat(item1);
- var number2 = parseFloat(item2);
- comparison = number1 < number2 ? -1 : (number1 > number2 ? 1 : 0);
- } else
- comparison = item1 < item2 ? -1 : (item1 > item2 ? 1 : 0);
-
- return sortDirection * comparison;
- }
-
- dataGrid.sortNodes(comparator);
- }
-
- dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, sortDataGrid, this);
- return dataGrid;
-}
-
-WebInspector.DataGrid.prototype = {
- get refreshCallback()
- {
- return this._refreshCallback;
- },
-
- set refreshCallback(refreshCallback)
- {
- this._refreshCallback = refreshCallback;
- },
-
- _ondblclick: function(event)
- {
- if (this._editing || this._editingNode)
- return;
-
- this._startEditing(event.target);
- },
-
- _startEditingNodeAtColumnIndex: function(node, columnIndex)
- {
- console.assert(node, "Invalid argument: must provide DataGridNode to edit.");
-
- this._editing = true;
- this._editingNode = node;
- this._editingNode.select();
-
- var element = this._editingNode._element.children[columnIndex];
- WebInspector.startEditing(element, this._startEditingConfig(element));
- window.getSelection().setBaseAndExtent(element, 0, element, 1);
- },
-
- _startEditing: function(target)
- {
- var element = target.enclosingNodeOrSelfWithNodeName("td");
- if (!element)
- return;
-
- this._editingNode = this.dataGridNodeFromNode(target);
- if (!this._editingNode) {
- if (!this.placeholderNode)
- return;
- this._editingNode = this.placeholderNode;
- }
-
- // Force editing the 1st column when editing the placeholder node
- if (this._editingNode.isPlaceholderNode)
- return this._startEditingNodeAtColumnIndex(this._editingNode, 0);
-
- this._editing = true;
- WebInspector.startEditing(element, this._startEditingConfig(element));
-
- window.getSelection().setBaseAndExtent(element, 0, element, 1);
- },
-
- _startEditingConfig: function(element)
- {
- return new WebInspector.EditingConfig(this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent);
- },
-
- _editingCommitted: function(element, newText, oldText, context, moveDirection)
- {
- var columnIdentifier = element.__columnIdentifier;
- var columnIndex = this.orderedColumns.indexOf(columnIdentifier);
-
- var textBeforeEditing = this._editingNode.data[columnIdentifier] || "";
- var currentEditingNode = this._editingNode;
-
- // Returns an object with the next node and column index to edit, and whether it
- // is an appropriate time to re-sort the table rows. When editing, we want to
- // postpone sorting until we switch rows or wrap around a row.
- function determineNextCell(valueDidChange) {
- if (moveDirection === "forward") {
- if (columnIndex < this.orderedColumns.length - 1)
- return {shouldSort: false, editingNode: currentEditingNode, columnIndex: columnIndex + 1};
-
- // Continue by editing the first column of the next row if it exists.
- var nextDataGridNode = currentEditingNode.traverseNextNode(true, null, true);
- return {shouldSort: true, editingNode: nextDataGridNode || currentEditingNode, columnIndex: 0};
- }
-
- if (moveDirection === "backward") {
- if (columnIndex > 0)
- return {shouldSort: false, editingNode: currentEditingNode, columnIndex: columnIndex - 1};
-
- var previousDataGridNode = currentEditingNode.traversePreviousNode(true, null, true);
- return {shouldSort: true, editingNode: previousDataGridNode || currentEditingNode, columnIndex: this.orderedColumns.length - 1};
- }
-
- // If we are not moving in any direction, then sort but don't move.
- return {shouldSort: true, editingNode: currentEditingNode, columnIndex: columnIndex};
- }
-
- function moveToNextCell(valueDidChange) {
- var moveCommand = determineNextCell.call(this, valueDidChange);
- if (moveCommand.shouldSort && this._sortAfterEditingCallback) {
- this._sortAfterEditingCallback();
- delete this._sortAfterEditingCallback;
- }
- this._startEditingNodeAtColumnIndex(moveCommand.editingNode, moveCommand.columnIndex);
- }
-
- this._editingCancelled(element);
-
- // Update table's data model, and delegate to the callback to update other models.
- currentEditingNode.data[columnIdentifier] = newText.trim();
- this._editCallback(currentEditingNode, columnIdentifier, textBeforeEditing, newText, moveDirection);
-
- var textDidChange = textBeforeEditing.trim() !== newText.trim();
- moveToNextCell.call(this, textDidChange);
- },
-
- _editingCancelled: function(element)
- {
- console.assert(this._editingNode.element === element.enclosingNodeOrSelfWithNodeName("tr"));
- delete this._editing;
- this._editingNode = null;
- },
-
- get sortColumnIdentifier()
- {
- return this._sortColumnCell ? this._sortColumnCell.columnIdentifier : null;
- },
-
- get sortOrder()
- {
- if (!this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending"))
- return "ascending";
- if (this._sortColumnCell.classList.contains("sort-descending"))
- return "descending";
- return null;
- },
-
- autoSizeColumns: function(minPercent, maxPercent, maxDescentLevel)
- {
- if (minPercent)
- minPercent = Math.min(minPercent, Math.floor(100 / this.orderedColumns.length));
- var widths = {};
- // For the first width approximation, use the character length of column titles.
- for (var [identifier, column] of this.columns)
- widths[identifier] = column.get("title", "").length;
-
- // Now approximate the width of each column as max(title, cells).
- var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel + 1) : this.children;
- for (var node of children) {
- for (var identifier of this.columns.keys()) {
- var text = node.data[identifier] || "";
- if (text.length > widths[identifier])
- widths[identifier] = text.length;
- }
- }
-
- var totalColumnWidths = 0;
- for (var identifier of this.columns.keys())
- totalColumnWidths += widths[identifier];
-
- // Compute percentages and clamp desired widths to min and max widths.
- var recoupPercent = 0;
- for (var identifier of this.columns.keys()) {
- var width = Math.round(100 * widths[identifier] / totalColumnWidths);
- if (minPercent && width < minPercent) {
- recoupPercent += (minPercent - width);
- width = minPercent;
- } else if (maxPercent && width > maxPercent) {
- recoupPercent -= (width - maxPercent);
- width = maxPercent;
- }
- widths[identifier] = width;
- }
-
- // If we assigned too much width due to the above, reduce column widths.
- while (minPercent && recoupPercent > 0) {
- for (var identifier of this.columns.keys()) {
- if (widths[identifier] > minPercent) {
- --widths[identifier];
- --recoupPercent;
- if (!recoupPercent)
- break;
- }
- }
- }
-
- // If extra width remains after clamping widths, expand column widths.
- while (maxPercent && recoupPercent < 0) {
- for (var identifier of this.columns.keys()) {
- if (widths[identifier] < maxPercent) {
- ++widths[identifier];
- ++recoupPercent;
- if (!recoupPercent)
- break;
- }
- }
- }
-
- for (var [identifier, column] of this.columns)
- column.get("element").style.width = widths[identifier] + "%";
- this._columnWidthsInitialized = false;
- this.updateLayout();
- },
-
- insertColumn: function(columnIdentifier, columnData, insertionIndex) {
- if (typeof insertionIndex === "undefined")
- insertionIndex = this.orderedColumns.length;
- insertionIndex = Number.constrain(insertionIndex, 0, this.orderedColumns.length);
-
- var listeners = new WebInspector.EventListenerSet(this, "DataGrid column DOM listeners");
-
- // Copy configuration properties instead of keeping a reference to the passed-in object.
- var column = new Map;
- for (var propertyName in columnData)
- column.set(propertyName, columnData[propertyName]);
-
- column.set("listeners", listeners);
- column.set("ordinal", insertionIndex);
- column.set("columnIdentifier", columnIdentifier);
- this.orderedColumns.splice(insertionIndex, 0, columnIdentifier);
-
- for (var [identifier, existingColumn] of this.columns) {
- var ordinal = existingColumn.get("ordinal");
- if (ordinal >= insertionIndex) // Also adjust the "old" column at insertion index.
- existingColumn.set("ordinal", ordinal + 1);
- }
- this.columns.set(columnIdentifier, column);
-
- if (column.has("disclosure"))
- this.disclosureColumnIdentifier = columnIdentifier;
-
- var headerColumnElement = document.createElement("col");
- if (column.has("width"))
- headerColumnElement.style.width = column.get("width");
- column.set("element", headerColumnElement);
- var referenceElement = this._headerTableColumnGroupElement.children[insertionIndex];
- this._headerTableColumnGroupElement.insertBefore(headerColumnElement, referenceElement);
-
- var headerCellElement = document.createElement("th");
- headerCellElement.className = columnIdentifier + "-column";
- headerCellElement.columnIdentifier = columnIdentifier;
- if (column.has("aligned"))
- headerCellElement.classList.add(column.get("aligned"));
- this._headerTableCellElements.set(columnIdentifier, headerCellElement);
- var referenceElement = this._headerTableRowElement.children[insertionIndex];
- this._headerTableRowElement.insertBefore(headerCellElement, referenceElement);
-
- var div = headerCellElement.createChild("div");
- if (column.has("titleDOMFragment"))
- div.appendChild(column.get("titleDOMFragment"));
- else
- div.textContent = column.get("title", "");
-
- if (column.has("sort")) {
- headerCellElement.classList.add("sort-" + column.get("sort"));
- this._sortColumnCell = headerCellElement;
- }
-
- if (column.has("sortable")) {
- listeners.register(headerCellElement, "click", this._clickInHeaderCell, false);
- headerCellElement.classList.add("sortable");
- }
-
- if (column.has("group"))
- headerCellElement.classList.add("column-group-" + column.get("group"));
-
- if (column.has("collapsesGroup")) {
- console.assert(column.get("group") !== column.get("collapsesGroup"));
-
- var dividerElement = headerCellElement.createChild("div");
- dividerElement.className = "divider";
-
- var collapseDiv = headerCellElement.createChild("div");
- collapseDiv.className = "collapser-button";
- collapseDiv.title = this._collapserButtonCollapseColumnsToolTip();
- listeners.register(collapseDiv, "mouseover", this._mouseoverColumnCollapser);
- listeners.register(collapseDiv, "mouseout", this._mouseoutColumnCollapser);
- listeners.register(collapseDiv, "click", this._clickInColumnCollapser);
-
- headerCellElement.collapsesGroup = column.get("collapsesGroup");
- headerCellElement.classList.add("collapser");
- }
-
- this._headerTableColumnGroupElement.span = this.orderedColumns.length;
-
- var dataColumnElement = headerColumnElement.cloneNode();
- var referenceElement = this._dataTableColumnGroupElement.children[insertionIndex];
- this._dataTableColumnGroupElement.insertBefore(dataColumnElement, referenceElement);
- column.set("bodyElement", dataColumnElement);
-
- var fillerCellElement = document.createElement("td");
- fillerCellElement.className = columnIdentifier + "-column";
- fillerCellElement.__columnIdentifier = columnIdentifier;
- if (column.has("group"))
- fillerCellElement.classList.add("column-group-" + column.get("group"));
- var referenceElement = this._fillerRowElement.children[insertionIndex];
- this._fillerRowElement.insertBefore(fillerCellElement, referenceElement);
-
- listeners.install();
-
- if (column.has("hidden"))
- this._hideColumn(columnIdentifier);
- },
-
- removeColumn: function(columnIdentifier)
- {
- console.assert(this.columns.has(columnIdentifier));
- var removedColumn = this.columns.get(columnIdentifier);
- this.columns.delete(columnIdentifier);
- this.orderedColumns.splice(this.orderedColumns.indexOf(columnIdentifier), 1);
-
- var removedOrdinal = removedColumn.get("ordinal");
- for (var [identifier, column] of this.columns) {
- var ordinal = column.get("ordinal");
- if (ordinal > removedOrdinal)
- column.set("ordinal", ordinal - 1);
- }
-
- removedColumn.get("listeners").uninstall(true);
-
- if (removedColumn.has("disclosure"))
- delete this.disclosureColumnIdentifier;
-
- if (removedColumn.has("sort"))
- delete this._sortColumnCell;
-
- this._headerTableCellElements.delete(columnIdentifier);
- this._headerTableRowElement.children[removedOrdinal].remove();
- this._headerTableColumnGroupElement.children[removedOrdinal].remove();
- this._dataTableColumnGroupElement.children[removedOrdinal].remove();
- this._fillerRowElement.children[removedOrdinal].remove();
-
- this._headerTableColumnGroupElement.span = this.orderedColumns.length;
-
- for (var child of this.children)
- child.refresh();
- },
-
- _enumerateChildren: function(rootNode, result, maxLevel)
- {
- if (!rootNode.root)
- result.push(rootNode);
- if (!maxLevel)
- return;
- for (var i = 0; i < rootNode.children.length; ++i)
- this._enumerateChildren(rootNode.children[i], result, maxLevel - 1);
- return result;
- },
-
- // Updates the widths of the table, including the positions of the column
- // resizers.
- //
- // IMPORTANT: This function MUST be called once after the element of the
- // DataGrid is attached to its parent element and every subsequent time the
- // width of the parent element is changed in order to make it possible to
- // resize the columns.
- //
- // If this function is not called after the DataGrid is attached to its
- // parent element, then the DataGrid's columns will not be resizable.
- updateLayout: function()
- {
- // Do not attempt to use offsetes if we're not attached to the document tree yet.
- if (!this._columnWidthsInitialized && this.element.offsetWidth) {
- // Give all the columns initial widths now so that during a resize,
- // when the two columns that get resized get a percent value for
- // their widths, all the other columns already have percent values
- // for their widths.
- var headerTableColumnElements = this._headerTableColumnGroupElement.children;
- var tableWidth = this._dataTableElement.offsetWidth;
- var numColumns = headerTableColumnElements.length;
- for (var i = 0; i < numColumns; i++) {
- var headerCellElement = this._headerTableBodyElement.rows[0].cells[i]
- if (this._isColumnVisible(headerCellElement.columnIdentifier)) {
- var columnWidth = headerCellElement.offsetWidth;
- var percentWidth = ((columnWidth / tableWidth) * 100) + "%";
- this._headerTableColumnGroupElement.children[i].style.width = percentWidth;
- this._dataTableColumnGroupElement.children[i].style.width = percentWidth;
- } else {
- this._headerTableColumnGroupElement.children[i].style.width = 0;
- this._dataTableColumnGroupElement.children[i].style.width = 0;
- }
- }
-
- this._columnWidthsInitialized = true;
- }
-
- this._positionResizerElements();
- this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
- },
-
- columnWidthsMap: function()
- {
- var result = {};
- for (var [identifier, column] of this.columns) {
- var width = this._headerTableColumnGroupElement.children[column.get("ordinal")].style.width;
- result[columnIdentifier] = parseFloat(width);
- }
- return result;
- },
-
- applyColumnWidthsMap: function(columnWidthsMap)
- {
- for (var [identifier, column] of this.columns) {
- var width = (columnWidthsMap[identifier] || 0) + "%";
- var ordinal = column.get("ordinal");
- this._headerTableColumnGroupElement.children[ordinal].style.width = width;
- this._dataTableColumnGroupElement.children[ordinal].style.width = width;
- }
-
- this.updateLayout();
- },
-
- _isColumnVisible: function(columnIdentifier)
- {
- return !this.columns.get(columnIdentifier).has("hidden");
- },
-
- _showColumn: function(columnIdentifier)
- {
- this.columns.get(columnIdentifier).delete("hidden");
- },
-
- _hideColumn: function(columnIdentifier)
- {
- var column = this.columns.get(columnIdentifier);
- column.set("hidden", true);
-
- var columnElement = column.get("element");
- columnElement.style.width = 0;
-
- this._columnWidthsInitialized = false;
- },
-
- get scrollContainer()
- {
- return this._scrollContainerElement;
- },
-
- isScrolledToLastRow: function()
- {
- return this._scrollContainerElement.isScrolledToBottom();
- },
-
- scrollToLastRow: function()
- {
- this._scrollContainerElement.scrollTop = this._scrollContainerElement.scrollHeight - this._scrollContainerElement.offsetHeight;
- },
-
- _positionResizerElements: function()
- {
- var left = 0;
- var previousResizerElement = null;
-
- // Make n - 1 resizers for n columns.
- for (var i = 0; i < this.orderedColumns.length - 1; ++i) {
- var resizerElement = this.resizerElements[i];
-
- if (!resizerElement) {
- // This is the first call to updateWidth, so the resizers need
- // to be created.
- resizerElement = document.createElement("div");
- resizerElement.classList.add("data-grid-resizer");
- // This resizer is associated with the column to its right.
- resizerElement.addEventListener("mousedown", this._startResizerDragging.bind(this), false);
- this.element.appendChild(resizerElement);
- this.resizerElements[i] = resizerElement;
- }
-
- // Get the width of the cell in the first (and only) row of the
- // header table in order to determine the width of the column, since
- // it is not possible to query a column for its width.
- left += this._headerTableBodyElement.rows[0].cells[i].offsetWidth;
-
- if (this._isColumnVisible(this.orderedColumns[i])) {
- resizerElement.style.removeProperty("display");
- resizerElement.style.left = left + "px";
- resizerElement.leftNeighboringColumnID = i;
- if (previousResizerElement)
- previousResizerElement.rightNeighboringColumnID = i;
- previousResizerElement = resizerElement;
- } else {
- resizerElement.style.setProperty("display", "none");
- resizerElement.leftNeighboringColumnID = 0;
- resizerElement.rightNeighboringColumnID = 0;
- }
- }
- if (previousResizerElement)
- previousResizerElement.rightNeighboringColumnID = this.orderedColumns.length - 1;
- },
-
- addPlaceholderNode: function()
- {
- if (this.placeholderNode)
- this.placeholderNode.makeNormal();
-
- var emptyData = {};
- for (var identifier of this.columns.keys())
- emptyData[identifier] = '';
- this.placeholderNode = new WebInspector.PlaceholderDataGridNode(emptyData);
- this.appendChild(this.placeholderNode);
- },
-
- appendChild: function(child)
- {
- this.insertChild(child, this.children.length);
- },
-
- insertChild: function(child, index)
- {
- if (!child)
- throw("insertChild: Node can't be undefined or null.");
- if (child.parent === this)
- throw("insertChild: Node is already a child of this node.");
-
- if (child.parent)
- child.parent.removeChild(child);
-
- this.children.splice(index, 0, child);
- this.hasChildren = true;
-
- child.parent = this;
- child.dataGrid = this.dataGrid;
- child._recalculateSiblings(index);
-
- delete child._depth;
- delete child._revealed;
- delete child._attached;
- child._shouldRefreshChildren = true;
-
- var current = child.children[0];
- while (current) {
- current.dataGrid = this.dataGrid;
- delete current._depth;
- delete current._revealed;
- delete current._attached;
- current._shouldRefreshChildren = true;
- current = current.traverseNextNode(false, child, true);
- }
-
- if (this.expanded)
- child._attach();
- },
-
- removeChild: function(child)
- {
- if (!child)
- throw("removeChild: Node can't be undefined or null.");
- if (child.parent !== this)
- throw("removeChild: Node is not a child of this node.");
-
- child.deselect();
- child._detach();
-
- this.children.remove(child, true);
-
- if (child.previousSibling)
- child.previousSibling.nextSibling = child.nextSibling;
- if (child.nextSibling)
- child.nextSibling.previousSibling = child.previousSibling;
-
- child.dataGrid = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
-
- if (this.children.length <= 0)
- this.hasChildren = false;
-
- console.assert(!child.isPlaceholderNode, "Shouldn't delete the placeholder node.")
- },
-
- removeChildren: function()
- {
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i];
- child.deselect();
- child._detach();
-
- child.dataGrid = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
- }
-
- this.children = [];
- this.hasChildren = false;
- },
-
- removeChildrenRecursive: function()
- {
- var childrenToRemove = this.children;
-
- var child = this.children[0];
- while (child) {
- if (child.children.length)
- childrenToRemove = childrenToRemove.concat(child.children);
- child = child.traverseNextNode(false, this, true);
- }
-
- for (var i = 0; i < childrenToRemove.length; ++i) {
- child = childrenToRemove[i];
- child.deselect();
- child._detach();
-
- child.children = [];
- child.dataGrid = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
- }
-
- this.children = [];
- },
-
- sortNodes: function(comparator)
- {
- function comparatorWrapper(aRow, bRow)
- {
- var reverseFactor = this.sortOrder !== "asceding" ? -1 : 1;
- var aNode = aRow._dataGridNode;
- var bNode = bRow._dataGridNode;
- if (aNode._data.summaryRow || aNode.isPlaceholderNode)
- return 1;
- if (bNode._data.summaryRow || bNode.isPlaceholderNode)
- return -1;
-
- return reverseFactor * comparator(aNode, bNode);
- }
-
- if (this._editing) {
- this._sortAfterEditingCallback = this.sortNodes.bind(this, comparator);
- return;
- }
-
- var tbody = this.dataTableBodyElement;
- var childNodes = tbody.childNodes;
- var fillerRowElement = tbody.lastChild;
-
- var sortedRowElements = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1);
- sortedRowElements.sort(comparatorWrapper);
-
- tbody.removeChildren();
-
- var previousSiblingNode = null;
- for (var rowElement of sortedRowElements) {
- var node = rowElement._dataGridNode;
- node.previousSibling = previousSiblingNode;
- if (previousSiblingNode)
- previousSiblingNode.nextSibling = node;
- tbody.appendChild(rowElement);
- previousSiblingNode = node;
- }
-
- if (previousSiblingNode)
- previousSiblingNode.nextSibling = null;
-
- tbody.appendChild(fillerRowElement); // We expect to find a filler row when attaching nodes.
- },
-
- _keyDown: function(event)
- {
- if (!this.selectedNode || event.shiftKey || event.metaKey || event.ctrlKey || this._editing)
- return;
-
- var handled = false;
- var nextSelectedNode;
- if (event.keyIdentifier === "Up" && !event.altKey) {
- nextSelectedNode = this.selectedNode.traversePreviousNode(true);
- while (nextSelectedNode && !nextSelectedNode.selectable)
- nextSelectedNode = nextSelectedNode.traversePreviousNode(true);
- handled = nextSelectedNode ? true : false;
- } else if (event.keyIdentifier === "Down" && !event.altKey) {
- nextSelectedNode = this.selectedNode.traverseNextNode(true);
- while (nextSelectedNode && !nextSelectedNode.selectable)
- nextSelectedNode = nextSelectedNode.traverseNextNode(true);
- handled = nextSelectedNode ? true : false;
- } else if (event.keyIdentifier === "Left") {
- if (this.selectedNode.expanded) {
- if (event.altKey)
- this.selectedNode.collapseRecursively();
- else
- this.selectedNode.collapse();
- handled = true;
- } else if (this.selectedNode.parent && !this.selectedNode.parent.root) {
- handled = true;
- if (this.selectedNode.parent.selectable) {
- nextSelectedNode = this.selectedNode.parent;
- handled = nextSelectedNode ? true : false;
- } else if (this.selectedNode.parent)
- this.selectedNode.parent.collapse();
- }
- } else if (event.keyIdentifier === "Right") {
- if (!this.selectedNode.revealed) {
- this.selectedNode.reveal();
- handled = true;
- } else if (this.selectedNode.hasChildren) {
- handled = true;
- if (this.selectedNode.expanded) {
- nextSelectedNode = this.selectedNode.children[0];
- handled = nextSelectedNode ? true : false;
- } else {
- if (event.altKey)
- this.selectedNode.expandRecursively();
- else
- this.selectedNode.expand();
- }
- }
- } else if (event.keyCode === 8 || event.keyCode === 46) {
- if (this._deleteCallback) {
- handled = true;
- this._deleteCallback(this.selectedNode);
- }
- } else if (isEnterKey(event)) {
- if (this._editCallback) {
- handled = true;
- this._startEditing(this.selectedNode._element.children[0]);
- }
- }
-
- if (nextSelectedNode) {
- nextSelectedNode.reveal();
- nextSelectedNode.select();
- }
-
- if (handled) {
- event.preventDefault();
- event.stopPropagation();
- }
- },
-
- expand: function()
- {
- // This is the root, do nothing.
- },
-
- collapse: function()
- {
- // This is the root, do nothing.
- },
-
- reveal: function()
- {
- // This is the root, do nothing.
- },
-
- revealAndSelect: function()
- {
- // This is the root, do nothing.
- },
-
- dataGridNodeFromNode: function(target)
- {
- var rowElement = target.enclosingNodeOrSelfWithNodeName("tr");
- return rowElement && rowElement._dataGridNode;
- },
-
- dataGridNodeFromPoint: function(x, y)
- {
- var node = this._dataTableElement.ownerDocument.elementFromPoint(x, y);
- var rowElement = node.enclosingNodeOrSelfWithNodeName("tr");
- return rowElement && rowElement._dataGridNode;
- },
-
- _clickInHeaderCell: function(event)
- {
- var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
- if (!cell || !cell.columnIdentifier || !cell.classList.contains("sortable"))
- return;
-
- var sortOrder = this.sortOrder;
-
- if (this._sortColumnCell)
- this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
-
- if (cell == this._sortColumnCell) {
- if (sortOrder === "ascending")
- sortOrder = "descending";
- else
- sortOrder = "ascending";
- }
-
- this._sortColumnCell = cell;
-
- cell.classList.add("sort-" + sortOrder);
-
- this.dispatchEventToListeners(WebInspector.DataGrid.Event.SortChanged);
- },
-
- _mouseoverColumnCollapser: function(event)
- {
- var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
- if (!cell || !cell.collapsesGroup)
- return;
-
- cell.classList.add("mouse-over-collapser");
- },
-
- _mouseoutColumnCollapser: function(event)
- {
- var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
- if (!cell || !cell.collapsesGroup)
- return;
-
- cell.classList.remove("mouse-over-collapser");
- },
-
- _clickInColumnCollapser: function(event)
- {
- var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
- if (!cell || !cell.collapsesGroup)
- return;
-
- this._collapseColumnGroupWithCell(cell);
-
- event.stopPropagation();
- event.preventDefault();
- },
-
- collapseColumnGroup: function(columnGroup)
- {
- var collapserColumnIdentifier = null;
- for (var [identifier, column] of this.columns) {
- if (column.get("collapsesGroup") == columnGroup) {
- collapserColumnIdentifier = identifier;
- break;
- }
- }
-
- console.assert(collapserColumnIdentifier);
- if (!collapserColumnIdentifier)
- return;
-
- var cell = this._headerTableCellElements.get(collapserColumnIdentifier);
- this._collapseColumnGroupWithCell(cell);
- },
-
- _collapseColumnGroupWithCell: function(cell)
- {
- var columnsWillCollapse = cell.classList.toggle("collapsed");
-
- this.willToggleColumnGroup(cell.collapsesGroup, columnsWillCollapse);
-
- var showOrHide = columnsWillCollapse ? this._hideColumn : this._showColumn;
- for (var [identifier, column] of this.columns) {
- if (column.get("group") === cell.collapsesGroup)
- showOrHide.call(this, identifier);
- }
-
- var collapserButton = cell.querySelector(".collapser-button");
- if (collapserButton)
- collapserButton.title = columnsWillCollapse ? this._collapserButtonExpandColumnsToolTip() : this._collapserButtonCollapseColumnsToolTip();
-
- this.didToggleColumnGroup(cell.collapsesGroup, columnsWillCollapse);
- },
-
- _collapserButtonCollapseColumnsToolTip: function()
- {
- return WebInspector.UIString("Collapse columns");
- },
-
- _collapserButtonExpandColumnsToolTip: function()
- {
- return WebInspector.UIString("Expand columns");
- },
-
- willToggleColumnGroup: function(columnGroup, willCollapse)
- {
- // Implemented by subclasses if needed.
- },
-
- didToggleColumnGroup: function(columnGroup, didCollapse)
- {
- // Implemented by subclasses if needed.
- },
-
- isColumnSortColumn: function(columnIdentifier)
- {
- return this._sortColumnCell === this._headerTableCellElements.get(columnIdentifier);
- },
-
- markColumnAsSortedBy: function(columnIdentifier, sortOrder)
- {
- if (this._sortColumnCell)
- this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
- this._sortColumnCell = this._headerTableCellElements.get(columnIdentifier);
- this._sortColumnCell.classList.add("sort-" + sortOrder);
- },
-
- headerTableHeader: function(columnIdentifier)
- {
- return this._headerTableCellElements.get(columnIdentifier);
- },
-
- _generateSortIndicatorImagesIfNeeded: function()
- {
- if (WebInspector.DataGrid._generatedSortIndicatorImages)
- return;
-
- WebInspector.DataGrid._generatedSortIndicatorImages = true;
-
- var specifications = {};
- specifications["arrow"] = {
- fillColor: [81, 81, 81],
- shadowColor: [255, 255, 255, 0.5],
- shadowOffsetX: 0,
- shadowOffsetY: 1,
- shadowBlur: 0
- };
-
- generateColoredImagesForCSS("Images/SortIndicatorDownArrow.svg", specifications, 9, 8, "data-grid-sort-indicator-down-");
- generateColoredImagesForCSS("Images/SortIndicatorUpArrow.svg", specifications, 9, 8, "data-grid-sort-indicator-up-");
- },
-
- _mouseDownInDataTable: function(event)
- {
- var gridNode = this.dataGridNodeFromNode(event.target);
- if (!gridNode || !gridNode.selectable)
- return;
-
- if (gridNode.isEventWithinDisclosureTriangle(event))
- return;
-
- if (event.metaKey) {
- if (gridNode.selected)
- gridNode.deselect();
- else
- gridNode.select();
- } else
- gridNode.select();
- },
-
- _contextMenuInDataTable: function(event)
- {
- var contextMenu = new WebInspector.ContextMenu(event);
-
- var gridNode = this.dataGridNodeFromNode(event.target);
- if (this.dataGrid._refreshCallback && (!gridNode || gridNode !== this.placeholderNode))
- contextMenu.appendItem(WebInspector.UIString("Refresh"), this._refreshCallback.bind(this));
-
- if (gridNode && gridNode.selectable && !gridNode.isEventWithinDisclosureTriangle(event)) {
- contextMenu.appendItem(WebInspector.UIString("Copy Row"), this._copyRow.bind(this, event.target));
-
- if (this.dataGrid._editCallback) {
- if (gridNode === this.placeholderNode)
- contextMenu.appendItem(WebInspector.UIString("Add New"), this._startEditing.bind(this, event.target));
- else {
- var element = event.target.enclosingNodeOrSelfWithNodeName("td");
- var columnIdentifier = element.__columnIdentifier;
- var columnTitle = this.dataGrid.columns.get(columnIdentifier).get('title');
- contextMenu.appendItem(WebInspector.UIString("Edit “%s”").format(columnTitle), this._startEditing.bind(this, event.target));
- }
- }
- if (this.dataGrid._deleteCallback && gridNode !== this.placeholderNode)
- contextMenu.appendItem(WebInspector.UIString("Delete"), this._deleteCallback.bind(this, gridNode));
- }
-
- contextMenu.show();
- },
-
- _clickInDataTable: function(event)
- {
- var gridNode = this.dataGridNodeFromNode(event.target);
- if (!gridNode || !gridNode.hasChildren)
- return;
-
- if (!gridNode.isEventWithinDisclosureTriangle(event))
- return;
-
- if (gridNode.expanded) {
- if (event.altKey)
- gridNode.collapseRecursively();
- else
- gridNode.collapse();
- } else {
- if (event.altKey)
- gridNode.expandRecursively();
- else
- gridNode.expand();
- }
- },
-
- _copyTextForDataGridNode: function(node)
- {
- var fields = [];
- for (var identifier of node.dataGrid.orderedColumns)
- fields.push(node.data[identifier] || "");
-
- var tabSeparatedValues = fields.join("\t");
- return tabSeparatedValues;
- },
-
- handleBeforeCopyEvent: function(event)
- {
- if (this.selectedNode && window.getSelection().isCollapsed)
- event.preventDefault();
- },
-
- handleCopyEvent: function(event)
- {
- if (!this.selectedNode || !window.getSelection().isCollapsed)
- return;
-
- var copyText = this._copyTextForDataGridNode(this.selectedNode);
- event.clipboardData.setData("text/plain", copyText);
- event.stopPropagation();
- event.preventDefault();
- },
-
- _copyRow: function(target)
- {
- var gridNode = this.dataGridNodeFromNode(target);
- if (!gridNode)
- return;
-
- var copyText = this._copyTextForDataGridNode(gridNode);
- InspectorFrontendHost.copyText(copyText);
- },
-
- get resizeMethod()
- {
- if (typeof this._resizeMethod === "undefined")
- return WebInspector.DataGrid.ResizeMethod.Nearest;
- return this._resizeMethod;
- },
-
- set resizeMethod(method)
- {
- this._resizeMethod = method;
- },
-
- _startResizerDragging: function(event)
- {
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- this._currentResizer = event.target;
- if (!this._currentResizer.rightNeighboringColumnID)
- return;
-
- WebInspector.elementDragStart(this._currentResizer, this._resizerDragging.bind(this),
- this._endResizerDragging.bind(this), event, "col-resize");
- },
-
- _resizerDragging: function(event)
- {
- if (event.button !== 0)
- return;
-
- var resizer = this._currentResizer;
- if (!resizer)
- return;
-
- // Constrain the dragpoint to be within the containing div of the
- // datagrid.
- var dragPoint = event.clientX - this.element.totalOffsetLeft;
- // Constrain the dragpoint to be within the space made up by the
- // column directly to the left and the column directly to the right.
- var leftCellIndex = resizer.leftNeighboringColumnID;
- var rightCellIndex = resizer.rightNeighboringColumnID;
- var firstRowCells = this._headerTableBodyElement.rows[0].cells;
- var leftEdgeOfPreviousColumn = 0;
- for (var i = 0; i < leftCellIndex; i++)
- leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;
-
- // Differences for other resize methods
- if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.Last) {
- rightCellIndex = this.resizerElements.length;
- } else if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.First) {
- leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth;
- leftCellIndex = 0;
- }
-
- var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth;
-
- // Give each column some padding so that they don't disappear.
- var leftMinimum = leftEdgeOfPreviousColumn + this.ColumnResizePadding;
- var rightMaximum = rightEdgeOfNextColumn - this.ColumnResizePadding;
-
- dragPoint = Number.constrain(dragPoint, leftMinimum, rightMaximum);
-
- resizer.style.left = (dragPoint - this.CenterResizerOverBorderAdjustment) + "px";
-
- var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTableElement.offsetWidth) * 100) + "%";
- this._headerTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
- this._dataTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
-
- var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTableElement.offsetWidth) * 100) + "%";
- this._headerTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
- this._dataTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
-
- this._positionResizerElements();
- event.preventDefault();
- this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
- },
-
- _endResizerDragging: function(event)
- {
- if (event.button !== 0)
- return;
-
- WebInspector.elementDragEnd(event);
- this._currentResizer = null;
- this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
- },
-
- ColumnResizePadding: 10,
-
- CenterResizerOverBorderAdjustment: 3,
-}
-
-WebInspector.DataGrid.ResizeMethod = {
- Nearest: "nearest",
- First: "first",
- Last: "last"
-};
-
-WebInspector.DataGrid.prototype.__proto__ = WebInspector.Object.prototype;
-
-/**
- * @constructor
- * @extends {WebInspector.Object}
- * @param {boolean=} hasChildren
- */
-WebInspector.DataGridNode = function(data, hasChildren)
-{
- this._expanded = false;
- this._selected = false;
- this._shouldRefreshChildren = true;
- this._data = data || {};
- this.hasChildren = hasChildren || false;
- this.children = [];
- this.dataGrid = null;
- this.parent = null;
- this.previousSibling = null;
- this.nextSibling = null;
- this.disclosureToggleWidth = 10;
-}
-
-WebInspector.DataGridNode.prototype = {
- get selectable()
- {
- return !this._element || !this._element.classList.contains("hidden");
- },
-
- get element()
- {
- if (this._element)
- return this._element;
-
- if (!this.dataGrid)
- return null;
-
- this._element = document.createElement("tr");
- this._element._dataGridNode = this;
-
- if (this.hasChildren)
- this._element.classList.add("parent");
- if (this.expanded)
- this._element.classList.add("expanded");
- if (this.selected)
- this._element.classList.add("selected");
- if (this.revealed)
- this._element.classList.add("revealed");
-
- this.createCells();
- return this._element;
- },
-
- createCells: function()
- {
- for (var columnIdentifier of this.dataGrid.orderedColumns)
- this._element.appendChild(this.createCell(columnIdentifier));
- },
-
- refreshIfNeeded: function()
- {
- if (!this._needsRefresh)
- return;
-
- delete this._needsRefresh;
-
- this.refresh();
- },
-
- needsRefresh: function()
- {
- this._needsRefresh = true;
-
- if (!this._revealed)
- return;
-
- if (this._scheduledRefreshIdentifier)
- return;
-
- this._scheduledRefreshIdentifier = requestAnimationFrame(this.refresh.bind(this));
- },
-
- get data()
- {
- return this._data;
- },
-
- set data(x)
- {
- this._data = x || {};
- this.needsRefresh();
- },
-
- get revealed()
- {
- if ("_revealed" in this)
- return this._revealed;
-
- var currentAncestor = this.parent;
- while (currentAncestor && !currentAncestor.root) {
- if (!currentAncestor.expanded) {
- this._revealed = false;
- return false;
- }
-
- currentAncestor = currentAncestor.parent;
- }
-
- this._revealed = true;
- return true;
- },
-
- set hasChildren(x)
- {
- if (this._hasChildren === x)
- return;
-
- this._hasChildren = x;
-
- if (!this._element)
- return;
-
- if (this._hasChildren)
- {
- this._element.classList.add("parent");
- if (this.expanded)
- this._element.classList.add("expanded");
- }
- else
- {
- this._element.classList.remove("parent");
- this._element.classList.remove("expanded");
- }
- },
-
- get hasChildren()
- {
- return this._hasChildren;
- },
-
- set revealed(x)
- {
- if (this._revealed === x)
- return;
-
- this._revealed = x;
-
- if (this._element) {
- if (this._revealed)
- this._element.classList.add("revealed");
- else
- this._element.classList.remove("revealed");
- }
-
- this.refreshIfNeeded();
-
- for (var i = 0; i < this.children.length; ++i)
- this.children[i].revealed = x && this.expanded;
- },
-
- get depth()
- {
- if ("_depth" in this)
- return this._depth;
- if (this.parent && !this.parent.root)
- this._depth = this.parent.depth + 1;
- else
- this._depth = 0;
- return this._depth;
- },
-
- get leftPadding()
- {
- if (typeof(this._leftPadding) === "number")
- return this._leftPadding;
-
- this._leftPadding = this.depth * this.dataGrid.indentWidth;
- return this._leftPadding;
- },
-
- get shouldRefreshChildren()
- {
- return this._shouldRefreshChildren;
- },
-
- set shouldRefreshChildren(x)
- {
- this._shouldRefreshChildren = x;
- if (x && this.expanded)
- this.expand();
- },
-
- get selected()
- {
- return this._selected;
- },
-
- set selected(x)
- {
- if (x)
- this.select();
- else
- this.deselect();
- },
-
- get expanded()
- {
- return this._expanded;
- },
-
- set expanded(x)
- {
- if (x)
- this.expand();
- else
- this.collapse();
- },
-
- refresh: function()
- {
- if (!this._element || !this.dataGrid)
- return;
-
- if (this._scheduledRefreshIdentifier) {
- cancelAnimationFrame(this._scheduledRefreshIdentifier);
- delete this._scheduledRefreshIdentifier;
- }
-
- delete this._needsRefresh;
-
- this._element.removeChildren();
- this.createCells();
- },
-
- updateLayout: function()
- {
- // Implemented by subclasses if needed.
- },
-
- createCell: function(columnIdentifier)
- {
- var cellElement = document.createElement("td");
- cellElement.className = columnIdentifier + "-column";
- cellElement.__columnIdentifier = columnIdentifier;
-
- var column = this.dataGrid.columns.get(columnIdentifier);
-
- if (column.has("aligned"))
- cellElement.classList.add(column.get("aligned"));
-
- if (column.has("group"))
- cellElement.classList.add("column-group-" + column.get("group"));
-
- var div = cellElement.createChild("div");
- var content = this.createCellContent(columnIdentifier, cellElement);
- div.appendChild(content instanceof Node ? content : document.createTextNode(content));
-
- if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {
- cellElement.classList.add("disclosure");
- if (this.leftPadding)
- cellElement.style.setProperty("padding-left", this.leftPadding + "px");
- }
-
- return cellElement;
- },
-
- createCellContent: function(columnIdentifier)
- {
- return this.data[columnIdentifier] || "\u200b"; // Zero width space to keep the cell from collapsing.
- },
-
- elementWithColumnIdentifier: function(columnIdentifier)
- {
- var index = this.dataGrid.orderedColumns.indexOf(columnIdentifier);
- if (index === -1)
- return null;
-
- return this._element.children[index];
- },
-
- // Share these functions with DataGrid. They are written to work with a DataGridNode this object.
- appendChild: WebInspector.DataGrid.prototype.appendChild,
- insertChild: WebInspector.DataGrid.prototype.insertChild,
- removeChild: WebInspector.DataGrid.prototype.removeChild,
- removeChildren: WebInspector.DataGrid.prototype.removeChildren,
- removeChildrenRecursive: WebInspector.DataGrid.prototype.removeChildrenRecursive,
-
- _recalculateSiblings: function(myIndex)
- {
- if (!this.parent)
- return;
-
- var previousChild = (myIndex > 0 ? this.parent.children[myIndex - 1] : null);
-
- if (previousChild) {
- previousChild.nextSibling = this;
- this.previousSibling = previousChild;
- } else
- this.previousSibling = null;
-
- var nextChild = this.parent.children[myIndex + 1];
-
- if (nextChild) {
- nextChild.previousSibling = this;
- this.nextSibling = nextChild;
- } else
- this.nextSibling = null;
- },
-
- collapse: function()
- {
- if (this._element)
- this._element.classList.remove("expanded");
-
- this._expanded = false;
-
- for (var i = 0; i < this.children.length; ++i)
- this.children[i].revealed = false;
-
- this.dispatchEventToListeners("collapsed");
-
- if (this.dataGrid)
- this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.CollapsedNode, {dataGridNode: this});
- },
-
- collapseRecursively: function()
- {
- var item = this;
- while (item) {
- if (item.expanded)
- item.collapse();
- item = item.traverseNextNode(false, this, true);
- }
- },
-
- expand: function()
- {
- if (!this.hasChildren || this.expanded)
- return;
-
- if (this.revealed && !this._shouldRefreshChildren)
- for (var i = 0; i < this.children.length; ++i)
- this.children[i].revealed = true;
-
- if (this._shouldRefreshChildren) {
- for (var i = 0; i < this.children.length; ++i)
- this.children[i]._detach();
-
- this.dispatchEventToListeners("populate");
-
- if (this._attached) {
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i];
- if (this.revealed)
- child.revealed = true;
- child._attach();
- }
- }
-
- delete this._shouldRefreshChildren;
- }
-
- if (this._element)
- this._element.classList.add("expanded");
-
- this._expanded = true;
-
- this.dispatchEventToListeners("expanded");
-
- if (this.dataGrid)
- this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.ExpandedNode, {dataGridNode: this});
- },
-
- expandRecursively: function()
- {
- var item = this;
- while (item) {
- item.expand();
- item = item.traverseNextNode(false, this);
- }
- },
-
- reveal: function()
- {
- var currentAncestor = this.parent;
- while (currentAncestor && !currentAncestor.root) {
- if (!currentAncestor.expanded)
- currentAncestor.expand();
- currentAncestor = currentAncestor.parent;
- }
-
- this.element.scrollIntoViewIfNeeded(false);
-
- this.dispatchEventToListeners("revealed");
- },
-
- /**
- * @param {boolean=} supressSelectedEvent
- */
- select: function(supressSelectedEvent)
- {
- if (!this.dataGrid || !this.selectable || this.selected)
- return;
-
- if (this.dataGrid.selectedNode)
- this.dataGrid.selectedNode.deselect();
-
- this._selected = true;
- this.dataGrid.selectedNode = this;
-
- if (this._element)
- this._element.classList.add("selected");
-
- if (!supressSelectedEvent)
- this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.SelectedNodeChanged);
- },
-
- revealAndSelect: function()
- {
- this.reveal();
- this.select();
- },
-
- /**
- * @param {boolean=} supressDeselectedEvent
- */
- deselect: function(supressDeselectedEvent)
- {
- if (!this.dataGrid || this.dataGrid.selectedNode !== this || !this.selected)
- return;
-
- this._selected = false;
- this.dataGrid.selectedNode = null;
-
- if (this._element)
- this._element.classList.remove("selected");
-
- if (!supressDeselectedEvent)
- this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.SelectedNodeChanged);
- },
-
- traverseNextNode: function(skipHidden, stayWithin, dontPopulate, info)
- {
- if (!dontPopulate && this.hasChildren)
- this.dispatchEventToListeners("populate");
-
- if (info)
- info.depthChange = 0;
-
- var node = (!skipHidden || this.revealed) ? this.children[0] : null;
- if (node && (!skipHidden || this.expanded)) {
- if (info)
- info.depthChange = 1;
- return node;
- }
-
- if (this === stayWithin)
- return null;
-
- node = (!skipHidden || this.revealed) ? this.nextSibling : null;
- if (node)
- return node;
-
- node = this;
- while (node && !node.root && !((!skipHidden || node.revealed) ? node.nextSibling : null) && node.parent !== stayWithin) {
- if (info)
- info.depthChange -= 1;
- node = node.parent;
- }
-
- if (!node)
- return null;
-
- return (!skipHidden || node.revealed) ? node.nextSibling : null;
- },
-
- traversePreviousNode: function(skipHidden, dontPopulate)
- {
- var node = (!skipHidden || this.revealed) ? this.previousSibling : null;
- if (!dontPopulate && node && node.hasChildren)
- node.dispatchEventToListeners("populate");
-
- while (node && ((!skipHidden || (node.revealed && node.expanded)) ? node.children.lastValue : null)) {
- if (!dontPopulate && node.hasChildren)
- node.dispatchEventToListeners("populate");
- node = ((!skipHidden || (node.revealed && node.expanded)) ? node.children.lastValue : null);
- }
-
- if (node)
- return node;
-
- if (!this.parent || this.parent.root)
- return null;
-
- return this.parent;
- },
-
- isEventWithinDisclosureTriangle: function(event)
- {
- if (!this.hasChildren)
- return false;
- var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
- if (!cell.classList.contains("disclosure"))
- return false;
-
- var left = cell.totalOffsetLeft + this.leftPadding;
- return event.pageX >= left && event.pageX <= left + this.disclosureToggleWidth;
- },
-
- _attach: function()
- {
- if (!this.dataGrid || this._attached)
- return;
-
- this._attached = true;
-
- var nextElement = null;
-
- var previousGridNode = this.traversePreviousNode(true, true);
- if (previousGridNode && previousGridNode.element.parentNode)
- nextElement = previousGridNode.element.nextSibling;
- else if (!previousGridNode)
- nextElement = this.dataGrid.dataTableBodyElement.firstChild;
-
- // If there is no next grid node, then append before the last child since the last child is the filler row.
- console.assert(this.dataGrid.dataTableBodyElement.lastChild.classList.contains("filler"));
-
- if (!nextElement)
- nextElement = this.dataGrid.dataTableBodyElement.lastChild;
-
- this.dataGrid.dataTableBodyElement.insertBefore(this.element, nextElement);
-
- if (this.expanded)
- for (var i = 0; i < this.children.length; ++i)
- this.children[i]._attach();
- },
-
- _detach: function()
- {
- if (!this._attached)
- return;
-
- this._attached = false;
-
- if (this._element && this._element.parentNode)
- this._element.parentNode.removeChild(this._element);
-
- for (var i = 0; i < this.children.length; ++i)
- this.children[i]._detach();
- },
-
- savePosition: function()
- {
- if (this._savedPosition)
- return;
-
- if (!this.parent)
- throw("savePosition: Node must have a parent.");
- this._savedPosition = {
- parent: this.parent,
- index: this.parent.children.indexOf(this)
- };
- },
-
- restorePosition: function()
- {
- if (!this._savedPosition)
- return;
-
- if (this.parent !== this._savedPosition.parent)
- this._savedPosition.parent.insertChild(this, this._savedPosition.index);
-
- delete this._savedPosition;
- }
-}
-
-WebInspector.DataGridNode.prototype.__proto__ = WebInspector.Object.prototype;
-
-// Used to create a new table row when entering new data by editing cells.
-WebInspector.PlaceholderDataGridNode = function(data)
-{
- WebInspector.DataGridNode.call(this, data, false);
- this.isPlaceholderNode = true;
-}
-
-WebInspector.PlaceholderDataGridNode.prototype = {
- constructor: WebInspector.PlaceholderDataGridNode,
- __proto__: WebInspector.DataGridNode.prototype,
-
- makeNormal: function()
- {
- delete this.isPlaceholderNode;
- delete this.makeNormal;
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.storage-view {
- /* Added so fonts look good */
- font-family: Menlo, monospace;
- font-size: 11px;
-}
-
-.storage-view .data-grid {
- border: none;
- height: 100%;
-}
-
-.storage-view .storage-table-error {
- color: rgb(66%, 33%, 33%);
-}
-
-.storage-view.query {
- padding: 2px 0;
- overflow-y: overlay;
- overflow-x: hidden;
- -webkit-text-size-adjust: auto;
-}
-
-.database-query-prompt {
- position: relative;
- padding: 4px 22px 4px 11px;
- min-height: 16px;
- white-space: pre-wrap;
- -webkit-user-modify: read-write-plaintext-only;
- -webkit-user-select: text;
-
- /* Added to remove outline */
- outline: none;
-}
-
-.database-user-query::before, .database-query-prompt::before, .database-query-result::before {
- position: absolute;
- display: block;
- z-index: 1;
- content: "";
- left: 4px;
- top: 10px;
- width: 10px;
- height: 10px;
- margin-top: -5px;
- -webkit-user-select: none;
-}
-
-.database-query-prompt::before {
- background-image: url(Images/UserInputPrompt.svg);
-}
-
-.database-user-query {
- position: relative;
- border-bottom: 1px solid rgb(245, 245, 245);
- padding: 4px 22px 4px 18px;
- min-height: 16px;
-}
-
-.database-user-query::before {
- background-image: url(Images/UserInputPromptPrevious.svg);
-}
-
-.database-query-text {
- color: rgb(0, 128, 255);
- -webkit-user-select: text;
-}
-
-.database-query-result {
- position: relative;
- padding: 4px 0 1px 18px;
- min-height: 16px;
- margin-left: -18px;
-}
-
-.database-query-result.error {
- color: red;
- -webkit-user-select: text;
-}
-
-.database-query-result.error::before {
- background-image: url(Images/Error.svg);
- background-size: 10px 10px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,190 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this.database = representedObject;
-
- this.element.classList.add("storage-view");
- this.element.classList.add("query");
- this.element.classList.add("monospace");
-
- this._promptElement = document.createElement("div");
- this._promptElement.className = "database-query-prompt";
- this.element.appendChild(this._promptElement);
-
- this.prompt = new WebInspector.ConsolePrompt(this, "text/x-sql");
- this._promptElement.appendChild(this.prompt.element);
-
- this.element.addEventListener("click", this._messagesClicked.bind(this), true);
-}
-
-WebInspector.DatabaseContentView.Event = {
- SchemaUpdated: "SchemaUpdated"
-};
-
-WebInspector.DatabaseContentView.prototype = {
- constructor: WebInspector.DatabaseContentView,
-
- // Public
-
- shown: function()
- {
- this.prompt.shown();
- },
-
- updateLayout: function()
- {
- this.prompt.updateLayout();
-
- var results = this.element.querySelectorAll(".database-query-result");
- for (var i = 0; i < results.length; ++i) {
- var resultElement = results[i];
- if (resultElement.dataGrid)
- resultElement.dataGrid.updateLayout();
- }
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.Database;
- cookie.host = this.representedObject.host;
- cookie.name = this.representedObject.name;
- },
-
- consolePromptCompletionsNeeded: function(prompt, defaultCompletions, base, prefix, suffix)
- {
- var results = [];
-
- prefix = prefix.toLowerCase();
-
- function accumulateMatches(textArray)
- {
- for (var i = 0; i < textArray.length; ++i) {
- var lowerCaseText = textArray[i].toLowerCase();
- if (lowerCaseText.startsWith(prefix))
- results.push(textArray[i]);
- }
- }
-
- function tableNamesCallback(tableNames)
- {
- accumulateMatches(tableNames);
- accumulateMatches(["SELECT", "FROM", "WHERE", "LIMIT", "DELETE FROM", "CREATE", "DROP", "TABLE", "INDEX", "UPDATE", "INSERT INTO", "VALUES"]);
-
- this.prompt.updateCompletions(results, " ");
- }
-
- this.database.getTableNames(tableNamesCallback.bind(this));
- },
-
- consolePromptTextCommitted: function(prompt, query)
- {
- this.database.executeSQL(query, this._queryFinished.bind(this, query), this._queryError.bind(this, query));
- },
-
- // Private
-
- _messagesClicked: function()
- {
- this.prompt.focus();
- },
-
- _queryFinished: function(query, columnNames, values)
- {
- var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
- var trimmedQuery = query.trim();
-
- if (dataGrid) {
- dataGrid.element.classList.add("inline");
- this._appendViewQueryResult(trimmedQuery, dataGrid);
- dataGrid.autoSizeColumns(5);
- }
-
- if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i))
- this.dispatchEventToListeners(WebInspector.DatabaseContentView.Event.SchemaUpdated, this.database);
- },
-
- _queryError: function(query, error)
- {
- if (error.message)
- var message = error.message;
- else if (error.code == 2)
- var message = WebInspector.UIString("Database no longer has expected version.");
- else
- var message = WebInspector.UIString("An unexpected error %s occurred.").format(error.code);
-
- this._appendErrorQueryResult(query, message);
- },
-
- /**
- * @param {string} query
- * @param {WebInspector.View} view
- */
- _appendViewQueryResult: function(query, view)
- {
- var resultElement = this._appendQueryResult(query);
-
- // Add our DataGrid with the results to the database query result div.
- resultElement.dataGrid = view;
- resultElement.appendChild(view.element);
-
- this._promptElement.scrollIntoView(false);
- },
-
- /**
- * @param {string} query
- * @param {string} errorText
- */
- _appendErrorQueryResult: function(query, errorText)
- {
- var resultElement = this._appendQueryResult(query);
- resultElement.classList.add("error");
- resultElement.textContent = errorText;
-
- this._promptElement.scrollIntoView(false);
- },
-
- _appendQueryResult: function(query)
- {
- var element = document.createElement("div");
- element.className = "database-user-query";
- this.element.insertBefore(element, this._promptElement);
-
- var commandTextElement = document.createElement("span");
- commandTextElement.className = "database-query-text";
- commandTextElement.textContent = query;
- element.appendChild(commandTextElement);
-
- var resultElement = document.createElement("div");
- resultElement.className = "database-query-result";
- element.appendChild(resultElement);
- return resultElement;
- }
-}
-
-WebInspector.DatabaseContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseHostTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseHostTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseHostTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseHostTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseHostTreeElement = function(host)
-{
- WebInspector.StorageTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, WebInspector.displayNameForHost(host), null);
-
- this._host = host;
-
- this.hasChildren = true;
-};
-
-WebInspector.DatabaseHostTreeElement.prototype = {
- constructor: WebInspector.DatabaseHostTreeElement,
-
- // Public
-
- get name()
- {
- return WebInspector.displayNameForHost(this._host);
- },
-
- get categoryName()
- {
- return WebInspector.UIString("Databases");
- }
-};
-
-WebInspector.DatabaseHostTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.database-icon .icon {
- content: -webkit-image-set(url(Images/Database.png) 1x, url(Images/Database@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,135 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseObject = function(id, host, name, version)
-{
- this._id = id;
- this._host = host ? host : WebInspector.UIString("Local File");
- this._name = name;
- this._version = version;
-};
-
-WebInspector.DatabaseObject.TypeIdentifier = "database";
-WebInspector.DatabaseObject.HostCookieKey = "database-object-host";
-WebInspector.DatabaseObject.NameCookieKey = "database-object-name";
-
-WebInspector.DatabaseObject.prototype = {
- constructor: WebInspector.DatabaseObject,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get host()
- {
- return this._host;
- },
-
- get name()
- {
- return this._name;
- },
-
- get version()
- {
- return this._version;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.DatabaseObject.HostCookieKey] = this.host;
- cookie[WebInspector.DatabaseObject.NameCookieKey] = this.name;
- },
-
- getTableNames: function(callback)
- {
- function sortingCallback(error, names)
- {
- if (!error)
- callback(names.sort());
- }
-
- DatabaseAgent.getDatabaseTableNames(this._id, sortingCallback);
- },
-
- executeSQL: function(query, successCallback, errorCallback)
- {
- function queryCallback(columnNames, values, sqlError)
- {
- if (sqlError) {
- var message;
-
- switch (sqlError.code) {
- case SQLException.VERSION_ERR:
- message = WebInspector.UIString("Database no longer has expected version.");
- break;
- case SQLException.TOO_LARGE_ERR:
- message = WebInspector.UIString("Data returned from the database is too large.");
- break;
- default:
- message = WebInspector.UIString("An unexpected error occurred.");
- break;
- }
-
- errorCallback(message);
- return;
- }
-
- successCallback(columnNames, values);
- }
-
- function callback(error, result)
- {
- if (error) {
- errorCallback(WebInspector.UIString("An unexpected error occurred."));
- return;
- }
-
- // COMPATIBILITY (iOS 6): Newer versions of DatabaseAgent.executeSQL can delay before
- // sending the results. The version on iOS 6 instead returned a transactionId that
- // would be used later in the sqlTransactionSucceeded or sqlTransactionFailed events.
- if ("transactionId" in result) {
- if (!result.success) {
- errorCallback(WebInspector.UIString("An unexpected error occurred."));
- return;
- }
-
- WebInspector.DatabaseObserver._callbacks[result.transactionId] = queryCallback;
- return;
- }
-
- queryCallback(result.columnNames, result.values, result.sqlError);
- }
-
- // COMPATIBILITY (iOS 6): Since the parameters of the DatabaseAgent.executeSQL callback differ
- // we need the result object to lookup parameters by name.
- callback.expectsResultObject = true;
-
- DatabaseAgent.executeSQL(this._id, query, callback);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.DatabaseObserver._callbacks = {};
-
-WebInspector.DatabaseObserver.prototype = {
- constructor: WebInspector.DatabaseObserver,
-
- // Events defined by the "Database" domain.
-
- addDatabase: function(database)
- {
- WebInspector.storageManager.databaseWasAdded(database.id, database.domain, database.name, database.version);
- },
-
- // COMPATIBILITY (iOS 6): This event was removed in favor of a more async DatabaseAgent.executeSQL.
- sqlTransactionSucceeded: function(transactionId, columnNames, values)
- {
- if (!WebInspector.DatabaseObserver._callbacks[transactionId])
- return;
-
- var callback = WebInspector.DatabaseObserver._callbacks[transactionId];
- delete WebInspector.DatabaseObserver._callbacks[transactionId];
-
- if (callback)
- callback(columnNames, values, null);
- },
-
- // COMPATIBILITY (iOS 6): This event was removed in favor of a more async DatabaseAgent.executeSQL.
- sqlTransactionFailed: function(transactionId, sqlError)
- {
- if (!WebInspector.DatabaseObserver._callbacks[transactionId])
- return;
-
- var callback = WebInspector.DatabaseObserver._callbacks[transactionId];
- delete WebInspector.DatabaseObserver._callbacks[transactionId];
-
- if (callback)
- callback(null, null, sqlError);
- }
-};
-
-WebInspector.DatabaseObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.database-table > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this.element.classList.add(WebInspector.DatabaseTableContentView.StyleClassName);
-
- this.update();
-};
-
-WebInspector.DatabaseTableContentView.StyleClassName = "database-table";
-
-WebInspector.DatabaseTableContentView.prototype = {
- constructor: WebInspector.DatabaseTableContentView,
-
- // Public
-
- update: function()
- {
- this.representedObject.database.executeSQL("SELECT * FROM \"" + this._escapeTableName(this.representedObject.name) + "\"", this._queryFinished.bind(this), this._queryError.bind(this));
- },
-
- updateLayout: function()
- {
- if (this._dataGrid)
- this._dataGrid.updateLayout();
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.DatabaseTable;
- cookie.host = this.representedObject.host;
- cookie.name = this.representedObject.name;
- cookie.database = this.representedObject.database.name;
- },
-
- get scrollableElements()
- {
- if (!this._dataGrid)
- return [];
- return [this._dataGrid.scrollContainer];
- },
-
- // Private
-
- _escapeTableName: function(name)
- {
- return name.replace(/\"/g, "\"\"");
- },
-
- _queryFinished: function(columnNames, values)
- {
- // It would be nice to do better than creating a new data grid each time the table is updated, but the table updating
- // doesn't happen very frequently. Additionally, using DataGrid's createSortableDataGrid makes our code much cleaner and it knows
- // how to sort arbitrary columns.
- this.element.removeChildren();
-
- this._dataGrid = new WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
- if (!this._dataGrid || !this._dataGrid.element) {
- // If the DataGrid is empty, then we were returned a table with no columns. This can happen when a table has
- // no data, the SELECT query only returns column names when there is data.
- this.element.removeChildren();
- this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("The “%s”\ntable is empty.").format(this.representedObject.name), false));
- return;
- }
-
- this.element.appendChild(this._dataGrid.element);
- this._dataGrid.updateLayout();
- },
-
- _queryError: function(error)
- {
- this.element.removeChildren();
- this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("An error occured trying to\nread the “%s” table.").format(this.representedObject.name), true));
- }
-};
-
-WebInspector.DatabaseTableContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTableIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTableIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTableIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTableIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.database-table-icon .icon {
- content: -webkit-image-set(url(Images/DatabaseTable.png) 1x, url(Images/DatabaseTable@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTableObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTableObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTableObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTableObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableObject = function(name, database)
-{
- console.assert(database instanceof WebInspector.DatabaseObject);
-
- this._name = name;
- this._database = database;
-};
-
-WebInspector.DatabaseTableObject.TypeIdentifier = "database-table";
-WebInspector.DatabaseTableObject.NameCookieKey = "database-table-object-name";
-
-WebInspector.DatabaseTableObject.prototype = {
- constructor: WebInspector.DatabaseTableObject,
-
- get name()
- {
- return this._name;
- },
-
- get database()
- {
- return this._database;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.DatabaseTableObject.NameCookieKey] = this.name;
- },
-};
-
-WebInspector.DatabaseTableObject.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTableTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTableTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTableTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTableTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.DatabaseTableObject);
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.DatabaseTableTreeElement.DatabaseTableIconStyleClassName, representedObject.name, null, representedObject, false);
-
- this.small = true;
-};
-
-WebInspector.DatabaseTableTreeElement.DatabaseTableIconStyleClassName = "database-table-icon";
-
-WebInspector.DatabaseTableTreeElement.prototype = {
- constructor: WebInspector.DatabaseTableTreeElement
-};
-
-WebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDatabaseTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DatabaseTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DatabaseTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DatabaseTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.DatabaseObject);
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.DatabaseTreeElement.DatabaseIconStyleClassName, representedObject.name, null, representedObject, true);
-
- this.small = true;
- this.hasChildren = false;
-
- // Since we are initially telling the tree element we don't have any children, make sure that we try to populate
- // the tree element (which will get a list of tables) when the element is created.
- this.onpopulate();
-};
-
-WebInspector.DatabaseTreeElement.DatabaseIconStyleClassName = "database-icon";
-
-WebInspector.DatabaseTreeElement.prototype = {
- constructor: WebInspector.DatabaseTreeElement,
-
- // Overrides from TreeElement (Private)
-
- oncollapse: function()
- {
- this.shouldRefreshChildren = true;
- },
-
- onpopulate: function()
- {
- if (this.children.length && !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
-
- function tableNamesCallback(tableNames)
- {
- for (var i = 0; i < tableNames.length; ++i) {
- var databaseTable = new WebInspector.DatabaseTableObject(tableNames[i], this.representedObject);
- this.appendChild(new WebInspector.DatabaseTableTreeElement(databaseTable));
- }
-
- this.hasChildren = tableNames.length;
- }
-
- this.representedObject.getTableNames(tableNamesCallback.bind(this));
- }
-};
-
-WebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDebuggerManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DebuggerManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DebuggerManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DebuggerManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,721 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerManager = function()
-{
- WebInspector.Object.call(this);
-
- if (window.DebuggerAgent)
- DebuggerAgent.enable();
-
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._breakpointDisabledStateDidChange, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ConditionDidChange, this._breakpointEditablePropertyDidChange, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._breakpointEditablePropertyDidChange, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointEditablePropertyDidChange, this);
-
- window.addEventListener("pagehide", this._inspectorClosing.bind(this));
-
- this._allExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-exceptions", false);
- this._allUncaughtExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-uncaught-exceptions", false);
-
- var specialBreakpointLocation = new WebInspector.SourceCodeLocation(null, Infinity, Infinity);
-
- this._allExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allExceptionsBreakpointEnabledSetting.value);
- this._allExceptionsBreakpoint.resolved = true;
-
- this._allUncaughtExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allUncaughtExceptionsBreakpointEnabledSetting.value);
-
- this._breakpoints = [];
- this._breakpointURLMap = {};
- this._breakpointScriptIdentifierMap = {};
- this._breakpointIdMap = {};
-
- this._nextBreakpointActionIdentifier = 1;
-
- this._scriptIdMap = {};
- this._scriptURLMap = {};
-
- this._breakpointsSetting = new WebInspector.Setting("breakpoints", []);
- this._breakpointsEnabledSetting = new WebInspector.Setting("breakpoints-enabled", true);
-
- if (window.DebuggerAgent)
- DebuggerAgent.setBreakpointsActive(this._breakpointsEnabledSetting.value);
-
- this._updateBreakOnExceptionsState();
-
- function restoreBreakpointsSoon() {
- for (cookie of this._breakpointsSetting.value)
- this.addBreakpoint(new WebInspector.Breakpoint(cookie));
- }
-
- // Ensure that all managers learn about restored breakpoints,
- // regardless of their initialization order.
- setTimeout(restoreBreakpointsSoon.bind(this), 0);
-};
-
-WebInspector.DebuggerManager.Event = {
- BreakpointAdded: "debugger-manager-breakpoint-added",
- BreakpointRemoved: "debugger-manager-breakpoint-removed",
- BreakpointMoved: "debugger-manager-breakpoint-moved",
- Paused: "debugger-manager-paused",
- Resumed: "debugger-manager-resumed",
- CallFramesDidChange: "debugger-manager-call-frames-did-change",
- ActiveCallFrameDidChange: "debugger-manager-active-call-frame-did-change",
- ScriptAdded: "debugger-manager-script-added",
- ScriptsCleared: "debugger-manager-scripts-cleared"
-};
-
-WebInspector.DebuggerManager.prototype = {
- constructor: WebInspector.DebuggerManager,
-
- // Public
-
- get breakpointsEnabled()
- {
- return this._breakpointsEnabledSetting.value;
- },
-
- set breakpointsEnabled(enabled)
- {
- if (this._breakpointsEnabled === enabled)
- return;
-
- this._breakpointsEnabledSetting.value = enabled;
-
- this._allExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
- this._allUncaughtExceptionsBreakpoint.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
-
- for (var i = 0; i < this._breakpoints.length; ++i)
- this._breakpoints[i].dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
-
- DebuggerAgent.setBreakpointsActive(enabled);
-
- this._updateBreakOnExceptionsState();
- },
-
- get paused()
- {
- return this._paused;
- },
-
- get callFrames()
- {
- return this._callFrames;
- },
-
- get activeCallFrame()
- {
- return this._activeCallFrame;
- },
-
- set activeCallFrame(callFrame)
- {
- if (callFrame === this._activeCallFrame)
- return;
-
- this._activeCallFrame = callFrame || null;
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
- },
-
- pause: function()
- {
- DebuggerAgent.pause();
- },
-
- resume: function()
- {
- DebuggerAgent.resume();
- },
-
- stepOver: function()
- {
- DebuggerAgent.stepOver();
- },
-
- stepInto: function()
- {
- DebuggerAgent.stepInto();
- },
-
- stepOut: function()
- {
- DebuggerAgent.stepOut();
- },
-
- get allExceptionsBreakpoint()
- {
- return this._allExceptionsBreakpoint;
- },
-
- get allUncaughtExceptionsBreakpoint()
- {
- return this._allUncaughtExceptionsBreakpoint;
- },
-
- get breakpoints()
- {
- return this._breakpoints;
- },
-
- breakpointsForSourceCode: function(sourceCode)
- {
- console.assert(sourceCode instanceof WebInspector.Resource || sourceCode instanceof WebInspector.Script);
-
- if (sourceCode instanceof WebInspector.SourceMapResource) {
- var mappedResourceBreakpoints = [];
- var originalSourceCodeBreakpoints = this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode);
- return originalSourceCodeBreakpoints.filter(function(breakpoint) {
- return breakpoint.sourceCodeLocation.displaySourceCode === sourceCode;
- });
- }
-
- if (sourceCode.url in this._breakpointURLMap) {
- var urlBreakpoint = this._breakpointURLMap[sourceCode.url] || [];
- this._associateBreakpointsWithSourceCode(urlBreakpoint, sourceCode);
- return urlBreakpoint;
- }
-
- if (sourceCode instanceof WebInspector.Script && sourceCode.id in this._breakpointScriptIdentifierMap) {
- var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[sourceCode.id] || [];
- this._associateBreakpointsWithSourceCode(scriptIdentifierBreakpoints, sourceCode);
- return scriptIdentifierBreakpoints;
- }
-
- return [];
- },
-
- scriptForIdentifier: function(id)
- {
- return this._scriptIdMap[id] || null;
- },
-
- scriptsForURL: function(url)
- {
- // FIXME: This may not be safe. A Resource's URL may differ from a Script's URL.
- return this._scriptURLMap[url] || [];
- },
-
- continueToLocation: function(scriptIdentifier, lineNumber, columnNumber)
- {
- DebuggerAgent.continueToLocation({scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber});
- },
-
- addBreakpoint: function(breakpoint, skipEventDispatch)
- {
- console.assert(breakpoint instanceof WebInspector.Breakpoint, "Bad argument to DebuggerManger.addBreakpoint: ", breakpoint);
- if (!breakpoint)
- return;
-
- if (breakpoint.url) {
- var urlBreakpoints = this._breakpointURLMap[breakpoint.url];
- if (!urlBreakpoints)
- urlBreakpoints = this._breakpointURLMap[breakpoint.url] = [];
- urlBreakpoints.push(breakpoint);
- }
-
- if (breakpoint.scriptIdentifier) {
- var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
- if (!scriptIdentifierBreakpoints)
- scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier] = [];
- scriptIdentifierBreakpoints.push(breakpoint);
- }
-
- this._breakpoints.push(breakpoint);
-
- if (!breakpoint.disabled)
- this._setBreakpoint(breakpoint);
-
- if (!skipEventDispatch)
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointAdded, {breakpoint: breakpoint});
- },
-
- removeBreakpoint: function(breakpoint)
- {
- console.assert(breakpoint);
- if (!breakpoint)
- return;
-
- console.assert(this.isBreakpointRemovable(breakpoint));
- if (!this.isBreakpointRemovable(breakpoint))
- return;
-
- this._breakpoints.remove(breakpoint);
-
- if (breakpoint.identifier)
- this._removeBreakpoint(breakpoint);
-
- if (breakpoint.url) {
- var urlBreakpoints = this._breakpointURLMap[breakpoint.url];
- if (urlBreakpoints) {
- urlBreakpoints.remove(breakpoint);
- if (!urlBreakpoints.length)
- delete this._breakpointURLMap[breakpoint.url];
- }
- }
-
- if (breakpoint.scriptIdentifier) {
- var scriptIdentifierBreakpoints = this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
- if (scriptIdentifierBreakpoints) {
- scriptIdentifierBreakpoints.remove(breakpoint);
- if (!scriptIdentifierBreakpoints.length)
- delete this._breakpointScriptIdentifierMap[breakpoint.scriptIdentifier];
- }
- }
-
- // Disable the breakpoint first, so removing actions doesn't re-add the breakpoint.
- breakpoint.disabled = true;
- breakpoint.clearActions();
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointRemoved, {breakpoint: breakpoint});
- },
-
- breakpointResolved: function(breakpointIdentifier, location)
- {
- // Called from WebInspector.DebuggerObserver.
-
- var breakpoint = this._breakpointIdMap[breakpointIdentifier];
- console.assert(breakpoint);
- if (!breakpoint)
- return;
-
- console.assert(breakpoint.id === breakpointIdentifier);
-
- breakpoint.resolved = true;
- },
-
- reset: function()
- {
- // Called from WebInspector.DebuggerObserver.
-
- var wasPaused = this._paused;
-
- WebInspector.Script.resetUniqueDisplayNameNumbers();
-
- this._paused = false;
- this._scriptIdMap = {};
- this._scriptURLMap = {};
-
- this._ignoreBreakpointDisplayLocationDidChangeEvent = true;
-
- // Mark all the breakpoints as unresolved. They will be reported as resolved when
- // breakpointResolved is called as the page loads.
- for (var i = 0; i < this._breakpoints.length; ++i) {
- var breakpoint = this._breakpoints[i];
- breakpoint.resolved = false;
- if (breakpoint.sourceCodeLocation.sourceCode)
- breakpoint.sourceCodeLocation.sourceCode = null;
- }
-
- delete this._ignoreBreakpointDisplayLocationDidChangeEvent;
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ScriptsCleared);
-
- if (wasPaused)
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Resumed);
- },
-
- debuggerDidPause: function(callFramesPayload)
- {
- // Called from WebInspector.DebuggerObserver.
-
- if (this._delayedResumeTimeout) {
- clearTimeout(this._delayedResumeTimeout);
- delete this._delayedResumeTimeout;
- }
-
- var wasStillPaused = this._paused;
-
- this._paused = true;
- this._callFrames = [];
-
- for (var i = 0; i < callFramesPayload.length; ++i) {
- var callFramePayload = callFramesPayload[i];
- var sourceCodeLocation = this._sourceCodeLocationFromPayload(callFramePayload.location);
- // Exclude the case where the call frame is in the inspector code.
- if (!sourceCodeLocation || !sourceCodeLocation._sourceCode || !sourceCodeLocation._sourceCode._url || sourceCodeLocation._sourceCode._url.indexOf("__WebInspector") === 0)
- continue;
- var thisObject = WebInspector.RemoteObject.fromPayload(callFramePayload.this);
- var scopeChain = this._scopeChainFromPayload(callFramePayload.scopeChain);
- var callFrame = new WebInspector.CallFrame(callFramePayload.callFrameId, sourceCodeLocation, callFramePayload.functionName, thisObject, scopeChain);
- this._callFrames.push(callFrame);
- }
-
- if (!this._callFrames.length) {
- this.resume();
- return;
- }
-
- this._activeCallFrame = this._callFrames[0];
-
- if (!wasStillPaused)
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Paused);
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.CallFramesDidChange);
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
- },
-
- debuggerDidResume: function()
- {
- // Called from WebInspector.DebuggerObserver.
-
- function delayedWork()
- {
- delete this._delayedResumeTimeout;
-
- this._paused = false;
- this._callFrames = null;
- this._activeCallFrame = null;
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.Resumed);
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.CallFramesDidChange);
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange);
- }
-
- // We delay clearing the state and firing events so the user interface does not flash
- // between brief steps or successive breakpoints.
- this._delayedResumeTimeout = setTimeout(delayedWork.bind(this), 50);
- },
-
- playBreakpointActionSound: function(breakpointActionIdentifier)
- {
- InspectorFrontendHost.beep();
- },
-
- scriptDidParse: function(scriptIdentifier, url, isContentScript, startLine, startColumn, endLine, endColumn, sourceMapURL)
- {
- // Don't add the script again if it is already known.
- if (this._scriptIdMap[scriptIdentifier]) {
- console.assert(this._scriptIdMap[scriptIdentifier].url === url);
- console.assert(this._scriptIdMap[scriptIdentifier].range.startLine === startLine);
- console.assert(this._scriptIdMap[scriptIdentifier].range.startColumn === startColumn);
- console.assert(this._scriptIdMap[scriptIdentifier].range.endLine === endLine);
- console.assert(this._scriptIdMap[scriptIdentifier].range.endColumn === endColumn);
- return;
- }
-
- var script = new WebInspector.Script(scriptIdentifier, new WebInspector.TextRange(startLine, startColumn, endLine, endColumn), url, isContentScript, sourceMapURL);
-
- this._scriptIdMap[scriptIdentifier] = script;
-
- if (script.url) {
- var scripts = this._scriptURLMap[script.url];
- if (!scripts)
- scripts = this._scriptURLMap[script.url] = [];
- scripts.push(script);
- }
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.ScriptAdded, {script: script});
- },
-
- isBreakpointRemovable: function(breakpoint)
- {
- return breakpoint !== this._allExceptionsBreakpoint && breakpoint !== this._allUncaughtExceptionsBreakpoint;
- },
-
- isBreakpointEditable: function(breakpoint)
- {
- return this.isBreakpointRemovable(breakpoint);
- },
-
- get nextBreakpointActionIdentifier()
- {
- return this._nextBreakpointActionIdentifier++;
- },
-
- // Private
-
- _sourceCodeLocationFromPayload: function(payload)
- {
- var script = this._scriptIdMap[payload.scriptId];
- console.assert(script);
- if (!script)
- return null;
-
- return script.createSourceCodeLocation(payload.lineNumber, payload.columnNumber);
- },
-
- _scopeChainFromPayload: function(payload)
- {
- var scopeChain = [];
- for (var i = 0; i < payload.length; ++i)
- scopeChain.push(this._scopeChainNodeFromPayload(payload[i]));
- return scopeChain;
- },
-
- _scopeChainNodeFromPayload: function(payload)
- {
- var type = null;
- switch (payload.type) {
- case "local":
- type = WebInspector.ScopeChainNode.Type.Local;
- break;
- case "global":
- type = WebInspector.ScopeChainNode.Type.Global;
- break;
- case "with":
- type = WebInspector.ScopeChainNode.Type.With;
- break;
- case "closure":
- type = WebInspector.ScopeChainNode.Type.Closure;
- break;
- case "catch":
- type = WebInspector.ScopeChainNode.Type.Catch;
- break;
- default:
- console.error("Unknown type: " + payload.type);
- }
-
- var object = WebInspector.RemoteObject.fromPayload(payload.object);
- return new WebInspector.ScopeChainNode(type, object);
- },
-
- _debuggerBreakpointActionType: function(type)
- {
- switch (type) {
- case WebInspector.BreakpointAction.Type.Log:
- return DebuggerAgent.BreakpointActionType.Log;
- case WebInspector.BreakpointAction.Type.Evaluate:
- return DebuggerAgent.BreakpointActionType.Evaluate;
- case WebInspector.BreakpointAction.Type.Sound:
- return DebuggerAgent.BreakpointActionType.Sound;
- case WebInspector.BreakpointAction.Type.Probe:
- return DebuggerAgent.BreakpointActionType.Probe;
- default:
- console.assert(false);
- return DebuggerAgent.BreakpointActionType.Log;
- }
- },
-
- _setBreakpoint: function(breakpoint, callback)
- {
- console.assert(!breakpoint.identifier);
- console.assert(!breakpoint.disabled);
-
- if (breakpoint.identifier || breakpoint.disabled)
- return;
-
- function didSetBreakpoint(error, breakpointIdentifier)
- {
- if (error)
- return;
-
- this._breakpointIdMap[breakpointIdentifier] = breakpoint;
-
- breakpoint.identifier = breakpointIdentifier;
- breakpoint.resolved = true;
-
- if (typeof callback === "function")
- callback();
- }
-
- // The breakpoint will be resolved again by calling DebuggerAgent, so mark it as unresolved.
- // If something goes wrong it will stay unresolved and show up as such in the user interface.
- breakpoint.resolved = false;
-
- // Convert BreakpointAction types to DebuggerAgent protocol types.
- // NOTE: Breakpoint.options returns new objects each time, so it is safe to modify.
- var options;
- if (DebuggerAgent.BreakpointActionType) {
- options = breakpoint.options;
- if (options.actions.length) {
- for (var i = 0; i < options.actions.length; ++i)
- options.actions[i].type = this._debuggerBreakpointActionType(options.actions[i].type);
- }
- }
-
- // COMPATIBILITY (iOS 7): iOS 7 and earlier, DebuggerAgent.setBreakpoint* took a "condition" string argument.
- // This has been replaced with an "options" BreakpointOptions object.
- if (breakpoint.url) {
- DebuggerAgent.setBreakpointByUrl.invoke({
- lineNumber: breakpoint.sourceCodeLocation.lineNumber,
- url: breakpoint.url,
- urlRegex: undefined,
- columnNumber: breakpoint.sourceCodeLocation.columnNumber,
- condition: breakpoint.condition,
- options: options
- }, didSetBreakpoint.bind(this));
- } else if (breakpoint.scriptIdentifier) {
- DebuggerAgent.setBreakpoint.invoke({
- location: {scriptId: breakpoint.scriptIdentifier, lineNumber: breakpoint.sourceCodeLocation.lineNumber, columnNumber: breakpoint.sourceCodeLocation.columnNumber},
- condition: breakpoint.condition,
- options: options
- }, didSetBreakpoint.bind(this));
- }
- },
-
- _removeBreakpoint: function(breakpoint, callback)
- {
- if (!breakpoint.identifier)
- return;
-
- function didRemoveBreakpoint(error)
- {
- if (error)
- console.error(error);
-
- delete this._breakpointIdMap[breakpoint.identifier];
-
- breakpoint.identifier = null;
-
- // Don't reset resolved here since we want to keep disabled breakpoints looking like they
- // are resolved in the user interface. They will get marked as unresolved in reset.
-
- if (typeof callback === "function")
- callback();
- }
-
- DebuggerAgent.removeBreakpoint(breakpoint.identifier, didRemoveBreakpoint.bind(this));
- },
-
- _breakpointDisplayLocationDidChange: function(event)
- {
- if (this._ignoreBreakpointDisplayLocationDidChangeEvent)
- return;
-
- var breakpoint = event.target;
- if (!breakpoint.identifier || breakpoint.disabled)
- return;
-
- // Remove the breakpoint with its old id.
- this._removeBreakpoint(breakpoint, breakpointRemoved.bind(this));
-
- function breakpointRemoved()
- {
- // Add the breakpoint at its new lineNumber and get a new id.
- this._setBreakpoint(breakpoint);
-
- this.dispatchEventToListeners(WebInspector.DebuggerManager.Event.BreakpointMoved, {breakpoint: breakpoint});
- }
- },
-
- _breakpointDisabledStateDidChange: function(event)
- {
- var breakpoint = event.target;
-
- if (breakpoint === this._allExceptionsBreakpoint) {
- this._allExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled;
- this._updateBreakOnExceptionsState();
- return;
- }
-
- if (breakpoint === this._allUncaughtExceptionsBreakpoint) {
- this._allUncaughtExceptionsBreakpointEnabledSetting.value = !breakpoint.disabled;
- this._updateBreakOnExceptionsState();
- return;
- }
-
- if (breakpoint.disabled)
- this._removeBreakpoint(breakpoint);
- else
- this._setBreakpoint(breakpoint);
- },
-
- _breakpointEditablePropertyDidChange: function(event)
- {
- var breakpoint = event.target;
- if (breakpoint.disabled)
- return;
-
- console.assert(this.isBreakpointEditable(breakpoint));
- if (!this.isBreakpointEditable(breakpoint))
- return;
-
- // Remove the breakpoint with its old id.
- this._removeBreakpoint(breakpoint, breakpointRemoved.bind(this));
-
- function breakpointRemoved()
- {
- // Add the breakpoint with its new condition and get a new id.
- this._setBreakpoint(breakpoint);
- }
- },
-
- _updateBreakOnExceptionsState: function()
- {
- var state = "none";
-
- if (this._breakpointsEnabledSetting.value) {
- if (!this._allExceptionsBreakpoint.disabled)
- state = "all";
- else if (!this._allUncaughtExceptionsBreakpoint.disabled)
- state = "uncaught";
- }
-
- switch (state) {
- case "all":
- // Mark the uncaught breakpoint as unresolved since "all" includes "uncaught".
- // That way it is clear in the user interface that the breakpoint is ignored.
- this._allUncaughtExceptionsBreakpoint.resolved = false;
- break;
- case "uncaught":
- case "none":
- // Mark the uncaught breakpoint as resolved again.
- this._allUncaughtExceptionsBreakpoint.resolved = true;
- break;
- }
-
- DebuggerAgent.setPauseOnExceptions(state);
- },
-
- _inspectorClosing: function(event)
- {
- this._saveBreakpoints();
- },
-
- _saveBreakpoints: function()
- {
- var savedBreakpoints = [];
-
- for (var i = 0; i < this._breakpoints.length; ++i) {
- var breakpoint = this._breakpoints[i];
-
- // Only breakpoints with URLs can be saved. Breakpoints for transient scripts can't.
- if (!breakpoint.url)
- continue;
-
- savedBreakpoints.push(breakpoint.info);
- }
-
- this._breakpointsSetting.value = savedBreakpoints;
- },
-
- _associateBreakpointsWithSourceCode: function(breakpoints, sourceCode)
- {
- this._ignoreBreakpointDisplayLocationDidChangeEvent = true;
-
- for (var i = 0; i < breakpoints.length; ++i) {
- var breakpoint = breakpoints[i];
- if (breakpoint.sourceCodeLocation.sourceCode === null)
- breakpoint.sourceCodeLocation.sourceCode = sourceCode;
- // SourceCodes can be unequal if the SourceCodeLocation is associated with a Script and we are looking at the Resource.
- console.assert(breakpoint.sourceCodeLocation.sourceCode === sourceCode || breakpoint.sourceCodeLocation.sourceCode.url === sourceCode.url);
- }
-
- delete this._ignoreBreakpointDisplayLocationDidChangeEvent;
- }
-};
-
-WebInspector.DebuggerManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDebuggerObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DebuggerObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DebuggerObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DebuggerObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.DebuggerObserver.prototype = {
- constructor: WebInspector.DebuggerObserver,
-
- // Events defined by the "Debugger" domain.
-
- globalObjectCleared: function()
- {
- WebInspector.debuggerManager.reset();
- },
-
- scriptParsed: function(scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL, hasSourceURL)
- {
- WebInspector.debuggerManager.scriptDidParse(scriptId, url, isContentScript, startLine, startColumn, endLine, endColumn, sourceMapURL);
- },
-
- scriptFailedToParse: function(url, scriptSource, startLine, errorLine, errorMessage)
- {
- // FIXME: Not implemented.
- },
-
- breakpointResolved: function(breakpointId, location)
- {
- WebInspector.debuggerManager.breakpointResolved(breakpointId, location);
- },
-
- paused: function(callFrames, reason, data)
- {
- WebInspector.debuggerManager.debuggerDidPause(callFrames);
- },
-
- resumed: function()
- {
- WebInspector.debuggerManager.debuggerDidResume();
- },
-
- playBreakpointActionSound: function(breakpointActionIdentifier)
- {
- WebInspector.debuggerManager.playBreakpointActionSound(breakpointActionIdentifier);
- },
-
- didSampleProbe: function(sample)
- {
- WebInspector.probeManager.didSampleProbe(sample);
- }
-};
-
-WebInspector.DebuggerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.debugger > .content {
- top: 22px;
-}
-
-.sidebar > .panel.debugger > .navigation-bar {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,558 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerSidebarPanel = function()
-{
- WebInspector.NavigationSidebarPanel.call(this, "debugger", WebInspector.UIString("Debugger"), "Images/NavigationItemBug.svg", "3", true);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceAdded, this);
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, this._debuggerCallFramesDidChange, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptAdded, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._debuggerActiveCallFrameDidChange, this);
-
- this._pauseOrResumeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "Y", this._debuggerPauseResumeButtonClicked.bind(this));
- this._stepOverKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F6, this._debuggerStepOverButtonClicked.bind(this));
- this._stepIntoKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F7, this._debuggerStepIntoButtonClicked.bind(this));
- this._stepOutKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F8, this._debuggerStepOutButtonClicked.bind(this));
-
- this._pauseOrResumeAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Slash, this._debuggerPauseResumeButtonClicked.bind(this));
- this._stepOverAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.SingleQuote, this._debuggerStepOverButtonClicked.bind(this));
- this._stepIntoAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Semicolon, this._debuggerStepIntoButtonClicked.bind(this));
- this._stepOutAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Semicolon, this._debuggerStepOutButtonClicked.bind(this));
-
- this._navigationBar = new WebInspector.NavigationBar;
- this.element.appendChild(this._navigationBar.element);
-
- var toolTip = WebInspector.UIString("Enable all breakpoints");
- var altToolTip = WebInspector.UIString("Disable all breakpoints");
-
- this._debuggerBreakpointsButtonItem = new WebInspector.ActivateButtonNavigationItem("debugger-breakpoints", toolTip, altToolTip, "Images/Breakpoints.svg", 16, 16);
- this._debuggerBreakpointsButtonItem.activated = WebInspector.debuggerManager.breakpointsEnabled;
- this._debuggerBreakpointsButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._breakpointsToggleButtonClicked, this);
- this._navigationBar.addNavigationItem(this._debuggerBreakpointsButtonItem);
-
- toolTip = WebInspector.UIString("Pause script execution (%s or %s)").format(this._pauseOrResumeKeyboardShortcut.displayName, this._pauseOrResumeAlternateKeyboardShortcut.displayName);
- altToolTip = WebInspector.UIString("Continue script execution (%s or %s)").format(this._pauseOrResumeKeyboardShortcut.displayName, this._pauseOrResumeAlternateKeyboardShortcut.displayName);
-
- this._debuggerPauseResumeButtonItem = new WebInspector.ToggleButtonNavigationItem("debugger-pause-resume", toolTip, altToolTip, "Images/Pause.svg", "Images/Resume.svg", 16, 16);
- this._debuggerPauseResumeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerPauseResumeButtonClicked, this);
- this._navigationBar.addNavigationItem(this._debuggerPauseResumeButtonItem);
-
- this._debuggerStepOverButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-over", WebInspector.UIString("Step over (%s or %s)").format(this._stepOverKeyboardShortcut.displayName, this._stepOverAlternateKeyboardShortcut.displayName), "Images/StepOver.svg", 16, 16);
- this._debuggerStepOverButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepOverButtonClicked, this);
- this._debuggerStepOverButtonItem.enabled = false;
- this._navigationBar.addNavigationItem(this._debuggerStepOverButtonItem);
-
- this._debuggerStepIntoButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-into", WebInspector.UIString("Step into (%s or %s)").format(this._stepIntoKeyboardShortcut.displayName, this._stepIntoAlternateKeyboardShortcut.displayName), "Images/StepInto.svg", 16, 16);
- this._debuggerStepIntoButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepIntoButtonClicked, this);
- this._debuggerStepIntoButtonItem.enabled = false;
- this._navigationBar.addNavigationItem(this._debuggerStepIntoButtonItem);
-
- this._debuggerStepOutButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-out", WebInspector.UIString("Step out (%s or %s)").format(this._stepOutKeyboardShortcut.displayName, this._stepOutAlternateKeyboardShortcut.displayName), "Images/StepOut.svg", 16, 16);
- this._debuggerStepOutButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepOutButtonClicked, this);
- this._debuggerStepOutButtonItem.enabled = false;
- this._navigationBar.addNavigationItem(this._debuggerStepOutButtonItem);
-
- // Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
- this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName);
-
- this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions"));
- this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions"));
-
- this.filterBar.placeholder = WebInspector.UIString("Filter Breakpoint List");
-
- this._breakpointsContentTreeOutline = this.contentTreeOutline;
- this._breakpointsContentTreeOutline.onselect = this._treeElementSelected.bind(this);
- this._breakpointsContentTreeOutline.ondelete = this._breakpointTreeOutlineDeleteTreeElement.bind(this);
- this._breakpointsContentTreeOutline.oncontextmenu = this._breakpointTreeOutlineContextMenuTreeElement.bind(this);
-
- this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement);
- this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
-
- var breakpointsRow = new WebInspector.DetailsSectionRow;
- breakpointsRow.element.appendChild(this._breakpointsContentTreeOutline.element);
-
- var breakpointsGroup = new WebInspector.DetailsSectionGroup([breakpointsRow]);
- var breakpointsSection = new WebInspector.DetailsSection("breakpoints", WebInspector.UIString("Breakpoints"), [breakpointsGroup]);
- this.contentElement.appendChild(breakpointsSection.element);
-
- this._callStackContentTreeOutline = this.createContentTreeOutline(true);
- this._callStackContentTreeOutline.onselect = this._treeElementSelected.bind(this);
-
- this._callStackRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Call Frames"));
- this._callStackRow.showEmptyMessage();
-
- var callStackGroup = new WebInspector.DetailsSectionGroup([this._callStackRow]);
- this._callStackSection = new WebInspector.DetailsSection("call-stack", WebInspector.UIString("Call Stack"), [callStackGroup]);
-
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
-};
-
-WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName = "offset-sections";
-WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon";
-
-WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
-WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint";
-
-WebInspector.DebuggerSidebarPanel.prototype = {
- constructor: WebInspector.DebuggerSidebarPanel,
-
- // Public
-
- treeElementForRepresentedObject: function(representedObject)
- {
- // The main resource is used as the representedObject instead of Frame in our tree.
- if (representedObject instanceof WebInspector.Frame)
- representedObject = representedObject.mainResource;
-
- return this.contentTreeOutline.getCachedTreeElement(representedObject);
- },
-
- // Protected
-
- saveStateToCookie: function(cookie)
- {
- console.assert(cookie);
-
- var selectedTreeElement = this._breakpointsContentTreeOutline.selectedTreeElement;
- if (!selectedTreeElement)
- return;
-
- var representedObject = selectedTreeElement.representedObject;
-
- if (representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint)
- cookie[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey] = true;
-
- if (representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint)
- cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey] = true;
-
- WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie.call(this, cookie);
- },
-
- restoreStateFromCookie: function(cookie, relaxedMatchDelay)
- {
- console.assert(cookie);
-
- // Eagerly resolve the special breakpoints; otherwise, use the default behavior.
- if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey])
- this._allExceptionsBreakpointTreeElement.revealAndSelect();
- else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey])
- this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect();
- else
- WebInspector.NavigationSidebarPanel.prototype.restoreStateFromCookie.call(this, cookie, relaxedMatchDelay);
- },
-
- // Private
-
- _debuggerPauseResumeButtonClicked: function(event)
- {
- if (WebInspector.debuggerManager.paused)
- WebInspector.debuggerManager.resume();
- else {
- this._debuggerPauseResumeButtonItem.enabled = false;
- WebInspector.debuggerManager.pause();
- }
- },
-
- _debuggerStepOverButtonClicked: function(event)
- {
- WebInspector.debuggerManager.stepOver();
- },
-
- _debuggerStepIntoButtonClicked: function(event)
- {
- WebInspector.debuggerManager.stepInto();
- },
-
- _debuggerStepOutButtonClicked: function(event)
- {
- WebInspector.debuggerManager.stepOut();
- },
-
- _debuggerDidPause: function(event)
- {
- this.contentElement.insertBefore(this._callStackSection.element, this.contentElement.firstChild);
-
- this._debuggerPauseResumeButtonItem.enabled = true;
- this._debuggerPauseResumeButtonItem.toggled = true;
- this._debuggerStepOverButtonItem.enabled = true;
- this._debuggerStepIntoButtonItem.enabled = true;
- },
-
- _debuggerDidResume: function(event)
- {
- this._callStackSection.element.remove();
-
- this._debuggerPauseResumeButtonItem.enabled = true;
- this._debuggerPauseResumeButtonItem.toggled = false;
- this._debuggerStepOverButtonItem.enabled = false;
- this._debuggerStepIntoButtonItem.enabled = false;
- this._debuggerStepOutButtonItem.enabled = false;
- },
-
- _breakpointsToggleButtonClicked: function(event)
- {
- this._debuggerBreakpointsButtonItem.activated = !this._debuggerBreakpointsButtonItem.activated;
- WebInspector.debuggerManager.breakpointsEnabled = this._debuggerBreakpointsButtonItem.activated;
- },
-
- _addBreakpoint: function(breakpoint, sourceCode)
- {
- var sourceCode = breakpoint.sourceCodeLocation.displaySourceCode;
- if (!sourceCode)
- return null;
-
- var parentTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(sourceCode);
- if (!parentTreeElement) {
- if (sourceCode instanceof WebInspector.SourceMapResource)
- parentTreeElement = new WebInspector.SourceMapResourceTreeElement(sourceCode);
- else if (sourceCode instanceof WebInspector.Resource)
- parentTreeElement = new WebInspector.ResourceTreeElement(sourceCode);
- else if (sourceCode instanceof WebInspector.Script)
- parentTreeElement = new WebInspector.ScriptTreeElement(sourceCode);
- }
-
- if (!parentTreeElement.parent) {
- parentTreeElement.hasChildren = true;
- parentTreeElement.expand();
-
- this._breakpointsContentTreeOutline.insertChild(parentTreeElement, insertionIndexForObjectInListSortedByFunction(parentTreeElement, this._breakpointsContentTreeOutline.children, this._compareTopLevelTreeElements.bind(this)));
- }
-
- // Mark disabled breakpoints as resolved if there is source code loaded with that URL.
- // This gives the illusion the breakpoint was resolved, but since we don't send disabled
- // breakpoints to the backend we don't know for sure. If the user enables the breakpoint
- // it will be resolved properly.
- if (breakpoint.disabled)
- breakpoint.resolved = true;
-
- var breakpointTreeElement = new WebInspector.BreakpointTreeElement(breakpoint);
- parentTreeElement.insertChild(breakpointTreeElement, insertionIndexForObjectInListSortedByFunction(breakpointTreeElement, parentTreeElement.children, this._compareBreakpointTreeElements));
- return breakpointTreeElement;
- },
-
- _addBreakpointsForSourceCode: function(sourceCode)
- {
- var breakpoints = WebInspector.debuggerManager.breakpointsForSourceCode(sourceCode);
- for (var i = 0; i < breakpoints.length; ++i)
- this._addBreakpoint(breakpoints[i], sourceCode);
- },
-
- _resourceAdded: function(event)
- {
- var resource = event.data.resource;
- this._addBreakpointsForSourceCode(resource);
- },
-
- _mainResourceChanged: function(event)
- {
- var resource = event.target.mainResource;
- this._addBreakpointsForSourceCode(resource);
- },
-
- _scriptAdded: function(event)
- {
- var script = event.data.script;
-
- // Don't add breakpoints if the script is represented by a Resource. They were
- // already added by _resourceAdded.
- if (script.resource)
- return;
-
- this._addBreakpointsForSourceCode(script);
- },
-
- _scriptsCleared: function(event)
- {
- for (var i = this._breakpointsContentTreeOutline.children.length - 1; i >= 0; --i) {
- var treeElement = this._breakpointsContentTreeOutline.children[i];
- if (!(treeElement instanceof WebInspector.ScriptTreeElement))
- continue;
-
- this._breakpointsContentTreeOutline.removeChildAtIndex(i, true, true);
- }
- },
-
- _breakpointAdded: function(event)
- {
- var breakpoint = event.data.breakpoint;
- this._addBreakpoint(breakpoint);
- },
-
- _breakpointRemoved: function(event)
- {
- var breakpoint = event.data.breakpoint;
-
- var breakpointTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(breakpoint);
- console.assert(breakpointTreeElement);
- if (!breakpointTreeElement)
- return;
-
- this._removeBreakpointTreeElement(breakpointTreeElement);
- },
-
- _breakpointDisplayLocationDidChange: function(event)
- {
- var breakpoint = event.target;
- if (event.data.oldDisplaySourceCode === breakpoint.displaySourceCode)
- return;
-
- var breakpointTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(breakpoint);
- if (!breakpointTreeElement)
- return;
-
- // A known breakpoint moved between resources, remove the old tree element
- // and create a new tree element with the updated file.
-
- var wasSelected = breakpointTreeElement.selected;
-
- this._removeBreakpointTreeElement(breakpointTreeElement);
- var newBreakpointTreeElement = this._addBreakpoint(breakpoint);
-
- if (newBreakpointTreeElement && wasSelected)
- newBreakpointTreeElement.revealAndSelect(true, false, true, true);
- },
-
- _removeBreakpointTreeElement: function(breakpointTreeElement)
- {
- var parentTreeElement = breakpointTreeElement.parent;
- parentTreeElement.removeChild(breakpointTreeElement);
-
- console.assert(parentTreeElement.parent === this._breakpointsContentTreeOutline);
-
- if (!parentTreeElement.children.length)
- this._breakpointsContentTreeOutline.removeChild(parentTreeElement);
- },
-
- _debuggerCallFramesDidChange: function()
- {
- this._callStackContentTreeOutline.removeChildren();
-
- var callFrames = WebInspector.debuggerManager.callFrames;
- if (!callFrames || !callFrames.length) {
- this._callStackRow.showEmptyMessage();
- return;
- }
-
- this._callStackRow.hideEmptyMessage();
- this._callStackRow.element.appendChild(this._callStackContentTreeOutline.element);
-
- var treeElementToSelect = null;
-
- var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
- for (var i = 0; i < callFrames.length; ++i) {
- var callFrameTreeElement = new WebInspector.CallFrameTreeElement(callFrames[i]);
- if (callFrames[i] === activeCallFrame)
- treeElementToSelect = callFrameTreeElement;
- this._callStackContentTreeOutline.appendChild(callFrameTreeElement);
- }
-
- if (treeElementToSelect)
- treeElementToSelect.select(true, true);
- },
-
- _debuggerActiveCallFrameDidChange: function()
- {
- var callFrames = WebInspector.debuggerManager.callFrames;
- if (!callFrames)
- return;
-
- var indexOfActiveCallFrame = callFrames.indexOf(WebInspector.debuggerManager.activeCallFrame);
- // It is useful to turn off the step out button when there is no call frame to go through
- // since there might be call frames in the backend that were removed when processing the call
- // frame payload.
- this._debuggerStepOutButtonItem.enabled = indexOfActiveCallFrame < callFrames.length - 1;
- },
-
- _breakpointsBeneathTreeElement: function(treeElement)
- {
- console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
- if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
- return [];
-
- var breakpoints = [];
- var breakpointTreeElements = treeElement.children;
- for (var i = 0; i < breakpointTreeElements.length; ++i) {
- console.assert(breakpointTreeElements[i] instanceof WebInspector.BreakpointTreeElement);
- console.assert(breakpointTreeElements[i].breakpoint);
- var breakpoint = breakpointTreeElements[i].breakpoint;
- if (breakpoint)
- breakpoints.push(breakpoint);
- }
-
- return breakpoints;
- },
-
- _removeAllBreakpoints: function(breakpoints)
- {
- for (var i = 0; i < breakpoints.length; ++i) {
- var breakpoint = breakpoints[i];
- if (WebInspector.debuggerManager.isBreakpointRemovable(breakpoint))
- WebInspector.debuggerManager.removeBreakpoint(breakpoint);
- }
- },
-
- _toggleAllBreakpoints: function(breakpoints, disabled)
- {
- for (var i = 0; i < breakpoints.length; ++i)
- breakpoints[i].disabled = disabled;
- },
-
- _breakpointTreeOutlineDeleteTreeElement: function(treeElement)
- {
- console.assert(treeElement.selected);
- console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
- if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
- return false;
-
- var wasTopResourceTreeElement = treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement;
- var nextSibling = treeElement.nextSibling;
-
- var breakpoints = this._breakpointsBeneathTreeElement(treeElement);
- this._removeAllBreakpoints(breakpoints);
-
- if (wasTopResourceTreeElement && nextSibling)
- nextSibling.select(true, true);
-
- return true;
- },
-
- _breakpointTreeOutlineContextMenuTreeElement: function(event, treeElement)
- {
- console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
- if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
- return;
-
- var breakpoints = this._breakpointsBeneathTreeElement(treeElement);
- var shouldDisable = false;
- for (var i = 0; i < breakpoints.length; ++i) {
- if (!breakpoints[i].disabled) {
- shouldDisable = true;
- break;
- }
- }
-
- function removeAllResourceBreakpoints()
- {
- this._removeAllBreakpoints(breakpoints);
- }
-
- function toggleAllResourceBreakpoints()
- {
- this._toggleAllBreakpoints(breakpoints, shouldDisable);
- }
-
- var contextMenu = new WebInspector.ContextMenu(event);
- if (shouldDisable)
- contextMenu.appendItem(WebInspector.UIString("Disable Breakpoints"), toggleAllResourceBreakpoints.bind(this));
- else
- contextMenu.appendItem(WebInspector.UIString("Enable Breakpoints"), toggleAllResourceBreakpoints.bind(this));
- contextMenu.appendItem(WebInspector.UIString("Delete Breakpoints"), removeAllResourceBreakpoints.bind(this));
- contextMenu.show();
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- function deselectCallStackContentTreeElements()
- {
- // Deselect any tree element in the call stack content tree outline to prevent two selections in the sidebar.
- var selectedTreeElement = this._callStackContentTreeOutline.selectedTreeElement;
- if (selectedTreeElement)
- selectedTreeElement.deselect();
- }
-
- if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
- // If the resource is being selected when it has no children it is in the process of being deleted, don't do anything.
- if (!treeElement.children.length)
- return;
- deselectCallStackContentTreeElements.call(this);
- WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
- return;
- }
-
- if (treeElement instanceof WebInspector.CallFrameTreeElement) {
- // Deselect any tree element in the breakpoints content tree outline to prevent two selections in the sidebar.
- var selectedTreeElement = this._breakpointsContentTreeOutline.selectedTreeElement;
- if (selectedTreeElement)
- selectedTreeElement.deselect();
-
- var callFrame = treeElement.callFrame;
- WebInspector.debuggerManager.activeCallFrame = callFrame;
- WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
- return;
- }
-
- if (!(treeElement instanceof WebInspector.BreakpointTreeElement))
- return;
-
- deselectCallStackContentTreeElements.call(this);
-
- if (!treeElement.parent.representedObject)
- return;
-
- console.assert(treeElement.parent.representedObject instanceof WebInspector.SourceCode);
- if (!(treeElement.parent.representedObject instanceof WebInspector.SourceCode))
- return;
-
- var breakpoint = treeElement.breakpoint;
- WebInspector.resourceSidebarPanel.showSourceCodeLocation(breakpoint.sourceCodeLocation);
- },
-
- _compareTopLevelTreeElements: function(a, b)
- {
- if (a === this._allExceptionsBreakpointTreeElement)
- return -1;
- if (b === this._allExceptionsBreakpointTreeElement)
- return 1;
-
- if (a === this._allUncaughtExceptionsBreakpointTreeElement)
- return -1;
- if (b === this._allUncaughtExceptionsBreakpointTreeElement)
- return 1;
-
- return a.mainTitle.localeCompare(b.mainTitle);
- },
-
- _compareBreakpointTreeElements: function(a, b)
- {
- var aLocation = a.breakpoint.sourceCodeLocation;
- var bLocation = b.breakpoint.sourceCodeLocation;
-
- var comparisonResult = aLocation.displayLineNumber - bLocation.displayLineNumber;
- if (comparisonResult !== 0)
- return comparisonResult;
-
- return aLocation.displayColumnNumber - bLocation.displayColumnNumber;
- }
-};
-
-WebInspector.DebuggerSidebarPanel.prototype.__proto__ = WebInspector.NavigationSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectioncss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,259 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.details-section {
- margin-top: -1px;
- margin-bottom: -1px;
-
- font-family: "Lucida Grande", sans-serif;
- font-size: 10px;
-}
-
-.details-section > .header {
- position: -webkit-sticky;
- top: -1px;
- height: 23px;
-
- border-top: 1px solid rgb(153, 153, 153);
- border-bottom: 1px solid rgb(153, 153, 153);
- box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
- background-image: -webkit-linear-gradient(top, rgb(238, 240, 244), rgb(224, 226, 230));
-
- color: rgb(57, 57, 57);
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- font-size: 11px;
- font-weight: bold;
-
- padding: 4px 5px 4px 0;
-
- /* Ensure the headers are displayed above scrollbars. */
- z-index: 200;
-}
-
-.details-section .details-section > .header {
- background-image: -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(240, 240, 240));
-
- top: 21px;
-
- /* Ensure these headers are displayed below the parent header but above scrollbars. */
- z-index: 100;
-}
-
-.details-section > .header::before {
- display: block;
- float: left;
-
- width: 21px;
- height: 100%;
-
- background-image: -webkit-canvas(details-section-disclosure-triangle-open-normal);
- background-repeat: no-repeat;
- background-position: center;
- background-size: 13px 13px;
-
- content: "";
-}
-
-.details-section > .header:not(.mouse-over-options-element):active::before {
- background-image: -webkit-canvas(details-section-disclosure-triangle-open-active);
-}
-
-.details-section.collapsed > .header::before {
- background-image: -webkit-canvas(details-section-disclosure-triangle-closed-normal);
-}
-
-.details-section.collapsed > .header:not(.mouse-over-options-element):active::before {
- background-image: -webkit-canvas(details-section-disclosure-triangle-closed-active);
-}
-
-.details-section > .header > label {
- float: right;
- font-size: 10px;
- color: rgba(0, 0, 0, 0.6);
- text-align: right;
-}
-
-.details-section.collapsed > .header > label {
- display: none;
-}
-
-.details-section > .header > label > input[type="checkbox"] {
- margin: 0 0 0 5px;
- vertical-align: 1px;
- font-size: 10px;
-}
-
-.details-section > .header > .node-link,
-.details-section > .header > .go-to-arrow {
- float: right;
-}
-
-.details-section > .header .go-to-arrow {
- width: 10px;
- height: 12px;
- margin-left: 3px;
-}
-
-.details-section > .content {
- display: table;
- width: 100%;
- border-spacing: 0;
- border-collapse: collapse;
-}
-
-.details-section.collapsed > .content {
- display: none;
-}
-
-.details-section > .content > .group {
- display: table-row-group;
-}
-
-.details-section > .content > .group:nth-child(even) {
- background-color: rgb(222, 222, 222);
-}
-
-.details-section > .content > .group:nth-child(even) > .row:not(.simple):first-child,
-.details-section > .content > .group:nth-child(even) > .row.simple:first-child > * {
- border-top: 1px solid rgb(153, 153, 153);
-}
-
-.details-section > .content > .group:nth-child(even) > .row:not(.simple):last-child,
-.details-section > .content > .group:last-child > .row:not(.simple):last-child,
-.details-section > .content > .group:nth-child(even) > .row.simple:last-child > *,
-.details-section > .content > .group:last-child > .row.simple:last-child > * {
- border-bottom: 1px solid rgb(153, 153, 153);
-}
-
-.details-section > .content > .group > .row.simple {
- display: table-row;
-}
-
-.details-section > .content > .group > .row.simple:last-child > * {
- padding-bottom: 5px !important;
-}
-
-.details-section > .content > .group > .row.simple.empty {
- display: none;
-}
-
-.details-section > .content > .group > .row.empty.syntax-highlighted {
- font-family: "Lucida Grande", sans-serif;
- font-size: 10px;
-}
-
-.details-section > .content > .group > .row.simple.empty:last-child {
- display: table-row;
-}
-
-.details-section > .content > .group > .row.simple.empty:last-child > * {
- display: table-cell;
- height: 1px;
- font-size: 0;
- color: transparent;
- padding-top: 0;
- padding-bottom: 3px !important;
-}
-
-.details-section > .content > .group > .row.simple.empty:last-child > * > * {
- display: none;
-}
-
-.details-section > .content > .group > .row.simple > * {
- display: table-cell;
- vertical-align: top;
- padding: 5px 4px 2px;
-}
-
-.details-section > .content > .group > .row.simple > .label {
- color: rgb(51, 51, 51);
-
- text-align: right;
-
- padding-left: 6px;
-
- width: 85px;
-}
-
-.details-section > .content > .group > .row.simple > .value {
- word-wrap: break-word;
-
- padding-right: 6px;
-
- -webkit-user-select: text;
- cursor: text;
-}
-
-.details-section > .content > .group > .row.simple > .value .go-to-arrow {
- width: 10px;
- height: 12px;
- margin-left: 5px;
-}
-
-.details-section > .content > .group > .row.simple.data > .value {
- word-break: break-all;
-}
-
-.details-section > .content > .group > .row.empty {
- padding: 6px;
- text-align: center;
- color: gray;
-}
-
-.details-section > .content > .group > .row.properties:not(.empty) {
- padding: 4px 6px;
-}
-
-.details-section > .content .data-grid {
- border: none;
-}
-
-.details-section > .content .data-grid table.data {
- background-image: none;
-}
-
-.details-section > .content .data-grid tr:nth-child(even) {
- background-color: white;
-}
-
-.details-section > .content .data-grid tr:nth-child(odd) {
- background-color: rgb(243, 246, 250);
-}
-
-.details-section > .content .data-grid td.value-column {
- height: auto;
- line-height: initial;
- white-space: normal;
-}
-
-.details-section > .content .data-grid td.value-column > div {
- white-space: normal;
- word-break: break-all;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,175 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSection = function(identifier, title, groups, optionsElement, defaultCollapsedSettingValue) {
- WebInspector.Object.call(this);
-
- console.assert(identifier);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.DetailsSection.StyleClassName;
- this._element.classList.add(identifier);
-
- this._headerElement = document.createElement("div");
- this._headerElement.addEventListener("click", this._headerElementClicked.bind(this));
- this._headerElement.className = WebInspector.DetailsSection.HeaderElementStyleClassName;
- this._element.appendChild(this._headerElement);
-
- if (optionsElement instanceof HTMLElement) {
- this._optionsElement = optionsElement;
- this._optionsElement.addEventListener("mousedown", this._optionsElementMouseDown.bind(this));
- this._optionsElement.addEventListener("mouseup", this._optionsElementMouseUp.bind(this));
- this._headerElement.appendChild(this._optionsElement);
- }
-
- this._titleElement = document.createElement("span");
- this._headerElement.appendChild(this._titleElement);
-
- this._contentElement = document.createElement("div");
- this._contentElement.className = WebInspector.DetailsSection.ContentElementStyleClassName;
- this._element.appendChild(this._contentElement);
-
- this._generateDisclosureTrianglesIfNeeded();
-
- this._identifier = identifier;
- this.title = title;
- this.groups = groups || [new WebInspector.DetailsSectionGroup];
-
- this._collapsedSetting = new WebInspector.Setting(identifier + "-details-section-collapsed", !!defaultCollapsedSettingValue);
- this.collapsed = this._collapsedSetting.value;
-};
-
-WebInspector.DetailsSection.StyleClassName = "details-section";
-WebInspector.DetailsSection.HeaderElementStyleClassName = "header";
-WebInspector.DetailsSection.TitleElementStyleClassName = "title";
-WebInspector.DetailsSection.ContentElementStyleClassName = "content";
-WebInspector.DetailsSection.CollapsedStyleClassName = "collapsed";
-WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName = "mouse-over-options-element";
-WebInspector.DetailsSection.DisclosureTriangleOpenCanvasIdentifier = "details-section-disclosure-triangle-open";
-WebInspector.DetailsSection.DisclosureTriangleClosedCanvasIdentifier = "details-section-disclosure-triangle-closed";
-WebInspector.DetailsSection.DisclosureTriangleNormalCanvasIdentifierSuffix = "-normal";
-WebInspector.DetailsSection.DisclosureTriangleActiveCanvasIdentifierSuffix = "-active";
-
-WebInspector.DetailsSection.prototype = {
- constructor: WebInspector.DetailsSection,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get identifier()
- {
- return this._identifier;
- },
-
- get title()
- {
- return this._titleElement.textContent;
- },
-
- set title(title)
- {
- this._titleElement.textContent = title;
- },
-
- get collapsed()
- {
- return this._element.classList.contains(WebInspector.DetailsSection.CollapsedStyleClassName);
- },
-
- set collapsed(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.DetailsSection.CollapsedStyleClassName);
- else
- this._element.classList.remove(WebInspector.DetailsSection.CollapsedStyleClassName);
-
- this._collapsedSetting.value = flag || false;
- },
-
- get groups()
- {
- return this._groups;
- },
-
- set groups(groups)
- {
- this._contentElement.removeChildren();
-
- this._groups = groups || [];
-
- for (var i = 0; i < this._groups.length; ++i)
- this._contentElement.appendChild(this._groups[i].element);
- },
-
- // Private
-
- _headerElementClicked: function(event)
- {
- if (event.target.isSelfOrDescendant(this._optionsElement))
- return;
-
- this.collapsed = !this.collapsed;
-
- this._element.scrollIntoViewIfNeeded(false);
- },
-
- _optionsElementMouseDown: function(event)
- {
- this._headerElement.classList.add(WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName);
- },
-
- _optionsElementMouseUp: function(event)
- {
- this._headerElement.classList.remove(WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName);
- },
-
- _generateDisclosureTrianglesIfNeeded: function()
- {
- if (WebInspector.DetailsSection._generatedDisclosureTriangles)
- return;
-
- // Set this early instead of in _generateDisclosureTriangle because we don't want multiple sections that are
- // created at the same time to duplicate the work (even though it would be harmless.)
- WebInspector.DetailsSection._generatedDisclosureTriangles = true;
-
- var specifications = {};
- specifications[WebInspector.DetailsSection.DisclosureTriangleNormalCanvasIdentifierSuffix] = {
- fillColor: [134, 134, 134]
- };
-
- specifications[WebInspector.DetailsSection.DisclosureTriangleActiveCanvasIdentifierSuffix] = {
- fillColor: [57, 57, 57]
- };
-
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, WebInspector.DetailsSection.DisclosureTriangleOpenCanvasIdentifier);
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, WebInspector.DetailsSection.DisclosureTriangleClosedCanvasIdentifier);
- }
-};
-
-WebInspector.DetailsSection.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionDataGridRowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSectionDataGridRow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSectionDataGridRow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSectionDataGridRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionDataGridRow = function(dataGrid, emptyMessage) {
- WebInspector.DetailsSectionRow.call(this, emptyMessage);
-
- this.element.classList.add(WebInspector.DetailsSectionDataGridRow.StyleClassName);
-
- this.dataGrid = dataGrid;
-};
-
-WebInspector.DetailsSectionDataGridRow.StyleClassName = "data-grid";
-
-WebInspector.DetailsSectionDataGridRow.prototype = {
- constructor: WebInspector.DetailsSectionDataGridRow,
-
- // Public
-
- get dataGrid()
- {
- return this._dataGrid;
- },
-
- set dataGrid(dataGrid)
- {
- if (this._dataGrid === dataGrid)
- return;
-
- this._dataGrid = dataGrid || null;
-
- if (dataGrid) {
- dataGrid.element.classList.add("inline");
-
- this.hideEmptyMessage();
- this.element.appendChild(dataGrid.element);
- } else
- this.showEmptyMessage();
- }
-};
-
-WebInspector.DetailsSectionDataGridRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionGroupjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSectionGroup.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSectionGroup.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSectionGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionGroup = function(rows) {
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.DetailsSectionGroup.StyleClassName;
-
- this.rows = rows;
-};
-
-WebInspector.DetailsSectionGroup.StyleClassName = "group";
-
-WebInspector.DetailsSectionGroup.prototype = {
- constructor: WebInspector.DetailsSectionGroup,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get rows()
- {
- return this._rows;
- },
-
- set rows(rows)
- {
- this._element.removeChildren();
-
- this._rows = rows || [];
-
- for (var i = 0; i < this._rows.length; ++i)
- this._element.appendChild(this._rows[i].element);
- }
-};
-
-WebInspector.DetailsSectionGroup.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionPropertiesRowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSectionPropertiesRow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSectionPropertiesRow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSectionPropertiesRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionPropertiesRow = function(propertiesSection, emptyMessage) {
- WebInspector.DetailsSectionRow.call(this, emptyMessage);
-
- this.element.classList.add(WebInspector.DetailsSectionPropertiesRow.StyleClassName);
- this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- this.propertiesSection = propertiesSection;
-};
-
-WebInspector.DetailsSectionPropertiesRow.StyleClassName = "properties";
-
-WebInspector.DetailsSectionPropertiesRow.prototype = {
- constructor: WebInspector.DetailsSectionPropertiesRow,
-
- // Public
-
- get propertiesSection()
- {
- return this._propertiesSection;
- },
-
- set propertiesSection(propertiesSection)
- {
- this._propertiesSection = propertiesSection || null;
-
- if (propertiesSection) {
- // Call expand to cause the section to populate.
- propertiesSection.expand();
-
- this.hideEmptyMessage();
- this.element.appendChild(propertiesSection.element);
- } else
- this.showEmptyMessage();
- }
-};
-
-WebInspector.DetailsSectionPropertiesRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionRowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSectionRow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSectionRow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSectionRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionRow = function(emptyMessage) {
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.DetailsSectionRow.StyleClassName;
-
- this._emptyMessage = emptyMessage || "";
-};
-
-WebInspector.DetailsSectionRow.StyleClassName = "row";
-WebInspector.DetailsSectionRow.EmptyStyleClassName = "empty";
-
-WebInspector.DetailsSectionRow.prototype = {
- constructor: WebInspector.DetailsSectionRow,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get emptyMessage()
- {
- return this._emptyMessage;
- },
-
- set emptyMessage(emptyMessage)
- {
- this._emptyMessage = emptyMessage || "";
-
- if (!this.childNodes.length)
- this.showEmptyMessage();
- },
-
- showEmptyMessage: function()
- {
- this.element.classList.add(WebInspector.DetailsSectionRow.EmptyStyleClassName);
-
- if (this._emptyMessage instanceof Node) {
- this.element.removeChildren();
- this.element.appendChild(this._emptyMessage);
- } else
- this.element.textContent = this._emptyMessage;
- },
-
- hideEmptyMessage: function()
- {
- this.element.classList.remove(WebInspector.DetailsSectionRow.EmptyStyleClassName);
- this.element.removeChildren();
- }
-};
-
-WebInspector.DetailsSectionRow.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSectionSimpleRowjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSectionSimpleRow.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSectionSimpleRow.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSectionSimpleRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionSimpleRow = function(label, value) {
- WebInspector.DetailsSectionRow.call(this);
-
- this.element.classList.add(WebInspector.DetailsSectionSimpleRow.StyleClassName);
-
- this._labelElement = document.createElement("div");
- this._labelElement.className = WebInspector.DetailsSectionSimpleRow.LabelElementStyleClassName;
- this.element.appendChild(this._labelElement);
-
- this._valueElement = document.createElement("div");
- this._valueElement.className = WebInspector.DetailsSectionSimpleRow.ValueElementStyleClassName;
- this.element.appendChild(this._valueElement);
-
- // Workaround for <rdar://problem/12668870> Triple-clicking text within a
- // <div> set to "display: table-cell" selects text outside the cell.
- //
- // On triple-click, adjust the selection range to include only the value
- // element if the selection extends beyond it.
- var valueElementClicked = function(event) {
- event.stopPropagation();
-
- if (event.detail < 3)
- return;
-
- var currentSelection = window.getSelection();
- if (!currentSelection)
- return;
-
- var currentRange = currentSelection.getRangeAt(0);
- if (!currentRange || currentRange.startContainer == currentRange.endContainer)
- return;
-
- var correctedRange = document.createRange();
- correctedRange.selectNodeContents(event.currentTarget);
- currentSelection.removeAllRanges();
- currentSelection.addRange(correctedRange);
- };
- this._valueElement.addEventListener("click", valueElementClicked);
-
- this.label = label;
- this.value = value;
-};
-
-WebInspector.DetailsSectionSimpleRow.StyleClassName = "simple";
-WebInspector.DetailsSectionSimpleRow.DataStyleClassName = "data";
-WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName = "empty";
-WebInspector.DetailsSectionSimpleRow.LabelElementStyleClassName = "label";
-WebInspector.DetailsSectionSimpleRow.ValueElementStyleClassName = "value";
-
-WebInspector.DetailsSectionSimpleRow.prototype = {
- constructor: WebInspector.DetailsSectionSimpleRow,
-
- // Public
-
- get label()
- {
- return this._labelElement.textContent;
- },
-
- set label(label)
- {
- this._labelElement.textContent = label;
- },
-
- get value()
- {
- return this._value;
- },
-
- set value(value)
- {
- this._value = value || "";
-
- if (this._value) {
- this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName);
-
- // If the value has space characters that cause word wrapping then we don't need the data class.
- if (/[\s\u200b]/.test(this._value))
- this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
- else
- this.element.classList.add(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
- } else {
- this.element.classList.add(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName);
- this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
- }
-
- if (value instanceof Node) {
- this._valueElement.removeChildren();
- this._valueElement.appendChild(this._value);
- } else
- this._valueElement.textContent = this._value;
- }
-};
-
-WebInspector.DetailsSectionSimpleRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.details {
- overflow-x: hidden;
- overflow-y: auto;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,80 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSidebarPanel = function(identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element) {
- if (keyboardShortcutKey)
- this._keyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control | WebInspector.KeyboardShortcut.Modifier.Shift, keyboardShortcutKey, this.toggle.bind(this));
-
- if (this._keyboardShortcut) {
- var showToolTip = WebInspector.UIString("Show the %s details sidebar (%s)").format(singularDisplayName, this._keyboardShortcut.displayName);
- var hideToolTip = WebInspector.UIString("Hide the %s details sidebar (%s)").format(singularDisplayName, this._keyboardShortcut.displayName);
- } else {
- var showToolTip = WebInspector.UIString("Show the %s details sidebar").format(singularDisplayName);
- var hideToolTip = WebInspector.UIString("Hide the %s details sidebar").format(singularDisplayName);
- }
-
- WebInspector.SidebarPanel.call(this, identifier, displayName, showToolTip, hideToolTip, image, element);
-
- this.element.classList.add(WebInspector.DetailsSidebarPanel.StyleClassName);
-};
-
-WebInspector.DetailsSidebarPanel.StyleClassName = "details";
-
-WebInspector.DetailsSidebarPanel.prototype = {
- constructor: WebInspector.DetailsSidebarPanel,
-
- // Public
-
- inspect: function(objects)
- {
- // Implemented by subclasses.
- return false;
- },
-
- shown: function()
- {
- if (this._needsRefresh) {
- delete this._needsRefresh;
- this.refresh();
- }
- },
-
- needsRefresh: function()
- {
- if (!this.selected) {
- this._needsRefresh = true;
- return;
- }
-
- this.refresh();
- },
-
- refresh: function()
- {
- // Implemented by subclasses.
- }
-};
-
-WebInspector.DetailsSidebarPanel.prototype.__proto__ = WebInspector.SidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.navigation-bar .item.divider {
- width: 1px;
-
- background-image: -webkit-linear-gradient(rgb(190, 190, 190), rgb(190, 190, 190));
- background-size: 100% 13px;
- background-repeat: no-repeat;
- background-position: center;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DividerNavigationItem = function(identifier) {
- WebInspector.NavigationItem.call(this, identifier);
-};
-
-WebInspector.DividerNavigationItem.StyleClassName = "divider";
-
-WebInspector.DividerNavigationItem.prototype = {
- constructor: WebInspector.DividerNavigationItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.DividerNavigationItem.StyleClassName],
-};
-
-WebInspector.DividerNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDragToAdjustControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,234 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Antoine Quint
- *
- * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DragToAdjustController = function(delegate)
-{
- this._delegate = delegate;
-
- this._element = null;
- this._active = false;
- this._enabled = false;
- this._dragging = false;
- this._tracksMouseClickAndDrag = false;
-};
-
-WebInspector.DragToAdjustController.StyleClassName = "drag-to-adjust";
-
-WebInspector.DragToAdjustController.prototype = {
- constructor: WebInspector.DragToAdjustController,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- set element(element)
- {
- this._element = element;
- },
-
- set enabled(enabled)
- {
- if (this._enabled === enabled)
- return;
-
- if (enabled) {
- this._element.addEventListener("mouseenter", this);
- this._element.addEventListener("mouseleave", this);
- } else {
- this._element.removeEventListener("mouseenter", this);
- this._element.removeEventListener("mouseleave", this);
- }
- },
-
- get active()
- {
- return this._active;
- },
-
- set active(active)
- {
- if (!this._element)
- return;
-
- if (this._active === active)
- return;
-
- if (active) {
- WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
- this._element.addEventListener("mousemove", this);
- } else {
- WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
- this._element.removeEventListener("mousemove", this);
- this._setTracksMouseClickAndDrag(false);
- }
-
- this._active = active;
-
- if (this._delegate && typeof this._delegate.dragToAdjustControllerActiveStateChanged === "function")
- this._delegate.dragToAdjustControllerActiveStateChanged(this);
- },
-
- reset: function()
- {
- this._setTracksMouseClickAndDrag(false);
- this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
-
- if (this._delegate && typeof this._delegate.dragToAdjustControllerDidReset === "function")
- this._delegate.dragToAdjustControllerDidReset(this);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch(event.type) {
- case "mouseenter":
- if (!this._dragging) {
- if (this._delegate && typeof this._delegate.dragToAdjustControllerCanBeActivated === "function")
- this.active = this._delegate.dragToAdjustControllerCanBeActivated(this);
- else
- this.active = true;
- }
- break;
- case "mouseleave":
- if (!this._dragging)
- this.active = false;
- break;
- case "mousemove":
- if (this._dragging)
- this._mouseWasDragged(event);
- else
- this._mouseMoved(event);
- break;
- case "mousedown":
- this._mouseWasPressed(event);
- break;
- case "mouseup":
- this._mouseWasReleased(event);
- break;
- case "contextmenu":
- event.preventDefault();
- break;
- }
- },
-
- // Private
-
- _setDragging: function(dragging)
- {
- if (this._dragging === dragging)
- return;
-
- console.assert(window.event);
- if (dragging)
- WebInspector.elementDragStart(this._element, this, this, window.event, "col-resize", window);
- else
- WebInspector.elementDragEnd(window.event);
-
- this._dragging = dragging;
- },
-
- _setTracksMouseClickAndDrag: function(tracksMouseClickAndDrag)
- {
- if (this._tracksMouseClickAndDrag === tracksMouseClickAndDrag)
- return;
-
- if (tracksMouseClickAndDrag) {
- this._element.classList.add(WebInspector.DragToAdjustController.StyleClassName);
- window.addEventListener("mousedown", this, true);
- window.addEventListener("contextmenu", this, true);
- } else {
- this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
- window.removeEventListener("mousedown", this, true);
- window.removeEventListener("contextmenu", this, true);
- this._setDragging(false);
- }
-
- this._tracksMouseClickAndDrag = tracksMouseClickAndDrag;
- },
-
- _modifiersDidChange: function(event)
- {
- var canBeAdjusted = WebInspector.modifierKeys.altKey;
- if (canBeAdjusted && this._delegate && typeof this._delegate.dragToAdjustControllerCanBeAdjusted === "function")
- canBeAdjusted = this._delegate.dragToAdjustControllerCanBeAdjusted(this);
-
- this._setTracksMouseClickAndDrag(canBeAdjusted);
- },
-
- _mouseMoved: function(event)
- {
- var canBeAdjusted = event.altKey;
- if (canBeAdjusted && this._delegate && typeof this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint === "function")
- canBeAdjusted = this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint(this, WebInspector.Point.fromEvent(event));
-
- this._setTracksMouseClickAndDrag(canBeAdjusted);
- },
-
- _mouseWasPressed: function(event)
- {
- this._lastX = event.screenX;
-
- this._setDragging(true);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _mouseWasDragged: function(event)
- {
- var x = event.screenX;
- var amount = x - this._lastX;
-
- if (Math.abs(amount) < 1)
- return;
-
- this._lastX = x;
-
- if (event.ctrlKey)
- amount /= 10;
- else if (event.shiftKey)
- amount *= 10;
-
- if (this._delegate && typeof this._delegate.dragToAdjustControllerWasAdjustedByAmount === "function")
- this._delegate.dragToAdjustControllerWasAdjustedByAmount(this, amount);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _mouseWasReleased: function(event)
- {
- this._setDragging(false);
-
- event.preventDefault();
- event.stopPropagation();
-
- this.reset();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEditingcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Editing.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Editing.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Editing.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.editing {
- -webkit-user-select: text;
- box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;
- outline: 1px solid rgb(66%, 66%, 66%) !important;
- background-color: white;
- -webkit-user-modify: read-write-plaintext-only;
- text-overflow: clip !important;
- padding-left: 2px;
- margin-left: -2px;
- padding-right: 2px;
- margin-right: -2px;
- margin-bottom: -1px;
- padding-bottom: 1px;
- opacity: 1.0 !important;
-}
-
-.editing.multiline {
- white-space: pre-wrap;
-}
-
-.editing, .editing * {
- color: black !important;
- text-decoration: none !important;
-}
-
-.editing br {
- display: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEditingSupportjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EditingSupport.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EditingSupport.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EditingSupport.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,271 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.isBeingEdited = function(element)
-{
- while (element) {
- if (element.__editing)
- return true;
- element = element.parentNode;
- }
-
- return false;
-}
-
-WebInspector.markBeingEdited = function(element, value)
-{
- if (value) {
- if (element.__editing)
- return false;
- element.__editing = true;
- WebInspector.__editingCount = (WebInspector.__editingCount || 0) + 1;
- } else {
- if (!element.__editing)
- return false;
- delete element.__editing;
- --WebInspector.__editingCount;
- }
- return true;
-}
-
-WebInspector.isEditingAnyField = function()
-{
- return !!WebInspector.__editingCount;
-}
-
-WebInspector.isEventTargetAnEditableField = function(event)
-{
- const textInputTypes = {"text": true, "search": true, "tel": true, "url": true, "email": true, "password": true};
- if (event.target instanceof HTMLInputElement)
- return event.target.type in textInputTypes;
-
- var codeMirrorEditorElement = event.target.enclosingNodeOrSelfWithClass("CodeMirror");
- if (codeMirrorEditorElement && codeMirrorEditorElement.CodeMirror)
- return !codeMirrorEditorElement.CodeMirror.getOption("readOnly");
-
- if (event.target instanceof HTMLTextAreaElement)
- return true;
-
- if (event.target.enclosingNodeOrSelfWithClass("text-prompt"))
- return true;
-
- return false;
-}
-
-/**
- * @constructor
- * @param {function(Element,string,string,*,string)} commitHandler
- * @param {function(Element,*)} cancelHandler
- * @param {*=} context
- */
-WebInspector.EditingConfig = function(commitHandler, cancelHandler, context)
-{
- this.commitHandler = commitHandler;
- this.cancelHandler = cancelHandler;
- this.context = context;
-
- /**
- * Handles the "paste" event, return values are the same as those for customFinishHandler
- * @type {function(Element)|undefined}
- */
- this.pasteHandler;
-
- /**
- * Whether the edited element is multiline
- * @type {boolean|undefined}
- */
- this.multiline;
-
- /**
- * Custom finish handler for the editing session (invoked on keydown)
- * @type {function(Element,*)|undefined}
- */
- this.customFinishHandler;
-
- /**
- * Whether or not spellcheck is enabled.
- * @type {boolean}
- */
- this.spellcheck = false;
-}
-
-WebInspector.EditingConfig.prototype = {
- setPasteHandler: function(pasteHandler)
- {
- this.pasteHandler = pasteHandler;
- },
-
- setMultiline: function(multiline)
- {
- this.multiline = multiline;
- },
-
- setCustomFinishHandler: function(customFinishHandler)
- {
- this.customFinishHandler = customFinishHandler;
- }
-}
-
-/**
- * @param {Element} element
- * @param {WebInspector.EditingConfig=} config
- */
-WebInspector.startEditing = function(element, config)
-{
- if (!WebInspector.markBeingEdited(element, true))
- return;
-
- config = config || new WebInspector.EditingConfig(function() {}, function() {});
- var committedCallback = config.commitHandler;
- var cancelledCallback = config.cancelHandler;
- var pasteCallback = config.pasteHandler;
- var context = config.context;
- var oldText = getContent(element);
- var moveDirection = "";
-
- element.classList.add("editing");
-
- var oldSpellCheck = element.hasAttribute("spellcheck") ? element.spellcheck : undefined;
- element.spellcheck = config.spellcheck;
-
- if (config.multiline)
- element.classList.add("multiline");
-
- var oldTabIndex = element.tabIndex;
- if (element.tabIndex < 0)
- element.tabIndex = 0;
-
- function blurEventListener() {
- editingCommitted.call(element);
- }
-
- function getContent(element) {
- if (element.tagName === "INPUT" && element.type === "text")
- return element.value;
- else
- return element.textContent;
- }
-
- /** @this {Element} */
- function cleanUpAfterEditing()
- {
- WebInspector.markBeingEdited(element, false);
-
- this.classList.remove("editing");
- this.scrollTop = 0;
- this.scrollLeft = 0;
-
- if (oldSpellCheck === undefined)
- element.removeAttribute("spellcheck");
- else
- element.spellcheck = oldSpellCheck;
-
- if (oldTabIndex === -1)
- this.removeAttribute("tabindex");
- else
- this.tabIndex = oldTabIndex;
-
- element.removeEventListener("blur", blurEventListener, false);
- element.removeEventListener("keydown", keyDownEventListener, true);
- if (pasteCallback)
- element.removeEventListener("paste", pasteEventListener, true);
-
- WebInspector.restoreFocusFromElement(element);
- }
-
- /** @this {Element} */
- function editingCancelled()
- {
- if (this.tagName === "INPUT" && this.type === "text")
- this.value = oldText;
- else
- this.textContent = oldText;
-
- cleanUpAfterEditing.call(this);
-
- cancelledCallback(this, context);
- }
-
- /** @this {Element} */
- function editingCommitted()
- {
- cleanUpAfterEditing.call(this);
-
- committedCallback(this, getContent(this), oldText, context, moveDirection);
- }
-
- function defaultFinishHandler(event)
- {
- var hasOnlyMetaModifierKey = event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey;
- if (isEnterKey(event) && (!config.multiline || hasOnlyMetaModifierKey))
- return "commit";
- else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Escape.keyCode || event.keyIdentifier === "U+001B")
- return "cancel";
- else if (event.keyIdentifier === "U+0009") // Tab key
- return "move-" + (event.shiftKey ? "backward" : "forward");
- }
-
- function handleEditingResult(result, event)
- {
- if (result === "commit") {
- editingCommitted.call(element);
- event.preventDefault();
- event.stopPropagation();
- } else if (result === "cancel") {
- editingCancelled.call(element);
- event.preventDefault();
- event.stopPropagation();
- } else if (result && result.startsWith("move-")) {
- moveDirection = result.substring(5);
- if (event.keyIdentifier !== "U+0009")
- blurEventListener();
- }
- }
-
- function pasteEventListener(event)
- {
- var result = pasteCallback(event);
- handleEditingResult(result, event);
- }
-
- function keyDownEventListener(event)
- {
- var handler = config.customFinishHandler || defaultFinishHandler;
- var result = handler(event);
- handleEditingResult(result, event);
- }
-
- element.addEventListener("blur", blurEventListener, false);
- element.addEventListener("keydown", keyDownEventListener, true);
- if (pasteCallback)
- element.addEventListener("paste", pasteEventListener, true);
-
- element.focus();
-
- return {
- cancel: editingCancelled.bind(element),
- commit: editingCommitted.bind(element)
- };
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEventHandlerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EventHandler.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EventHandler.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EventHandler.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventHandler = function(delegate, eventHandlers)
-{
- this._delegate = delegate;
- this._eventHandlers = eventHandlers;
-
- this._tracking = false;
- this._target = null;
-};
-
-WebInspector.EventHandler.prototype = {
- constructor: WebInspector.EventHandler,
-
- // Public
-
- trackEvents: function(target)
- {
- if (this._tracking && target === this._target)
- return;
-
- if (this._tracking && this._target)
- this.stopTrackingEvents();
-
- Object.getOwnPropertyNames(this._eventHandlers).forEach(function(eventName) {
- target.addEventListener(eventName, this);
- }, this);
-
- this._target = target;
- this._tracking = true;
- },
-
- stopTrackingEvents: function()
- {
- if (!this._tracking)
- return;
-
- Object.getOwnPropertyNames(this._eventHandlers).forEach(function(eventType) {
- this._target.removeEventListener(eventType, this);
- }, this);
-
- this._tracking = false;
- },
-
- handleEvent: function(event)
- {
- if (event.currentTarget !== this._target)
- return;
-
- var handler = this._eventHandlers[event.type];
- if (handler)
- handler.call(this._delegate, event);
- }
-}
-
-WebInspector.EventHandler.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEventListenerSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EventListenerSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EventListenerSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EventListenerSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventListenerSection = function(type, nodeId)
-{
- WebInspector.DetailsSection.call(this, type + "-event-listener-section", type, [], null, true);
-
- this.element.classList.add("event-listener-section");
-
- this._nodeId = nodeId;
-}
-
-WebInspector.EventListenerSection.prototype = {
- constructor: WebInspector.EventListenerSection,
-
- addListener: function(eventListener)
- {
- var groups = this.groups;
- groups.push(new WebInspector.EventListenerSectionGroup(eventListener, this._nodeId));
- this.groups = groups;
- }
-}
-
-WebInspector.EventListenerSection.prototype.__proto__ = WebInspector.DetailsSection.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.event-listener-section > .content > .group > .row.simple > .value {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,101 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventListenerSectionGroup = function(eventListener, nodeId)
-{
- this._eventListener = eventListener;
- this._nodeId = nodeId;
-
- var rows = [];
- rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Node"), this._nodeTextOrLink()));
- rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Function"), this._functionTextOrLink()));
- rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type"), this._type()));
-
- WebInspector.DetailsSectionGroup.call(this, rows);
-}
-
-WebInspector.EventListenerSectionGroup.prototype = {
- constructor: WebInspector.EventListenerSectionGroup,
-
- _nodeTextOrLink: function()
- {
- var node = this._eventListener.node;
- if (!node)
- return;
-
- if (node.nodeType() === Node.DOCUMENT_NODE)
- return "document";
-
- return WebInspector.linkifyNodeReference(node);
- },
-
- _type: function()
- {
- if (this._eventListener.useCapture)
- return WebInspector.UIString("Capturing");
-
- if (this._eventListener.isAttribute)
- return WebInspector.UIString("Attribute");
-
- return WebInspector.UIString("Bubbling");
- },
-
- _functionTextOrLink: function()
- {
- var match = this._eventListener.handlerBody.match(/function ([^\(]+?)\(/);
- if (match) {
- var anonymous = false;
- var functionName = match[1];
- } else {
- var anonymous = true;
- var functionName = WebInspector.UIString("(anonymous function)");
- }
-
- if (!this._eventListener.location)
- return functionName;
-
- // COMPATIBILITY (iOS 6): In the past scriptId could be a URL. Now it is always a script identifier.
- // So try looking up the resource by URL if a script can't be found directly.
- var scriptIdentifierOrURL = this._eventListener.location.scriptId;
- var sourceCode = WebInspector.debuggerManager.scriptForIdentifier(scriptIdentifierOrURL);
- if (!sourceCode)
- sourceCode = WebInspector.frameResourceManager.resourceForURL(scriptIdentifierOrURL);
-
- if (!sourceCode)
- return functionName;
-
- var sourceCodeLocation = sourceCode.createSourceCodeLocation(this._eventListener.location.lineNumber, this._eventListener.location.columnNumber || 0);
- var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, anonymous);
- if (anonymous)
- return linkElement;
-
- var fragment = document.createDocumentFragment();
- fragment.appendChild(linkElement);
- fragment.appendChild(document.createTextNode(functionName));
- return fragment;
- }
-}
-
-WebInspector.EventListenerSectionGroup.prototype.__proto__ = WebInspector.DetailsSectionGroup.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceEventListenerSetjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/EventListenerSet.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/EventListenerSet.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/EventListenerSet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.
- */
-
-// This class supports adding and removing many listeners at once.
-// Add DOM or Inspector event listeners to the set using `register()`.
-// Use `install()` and `uninstall()` to enable or disable all listeners
-// in the set at once.
-WebInspector.EventListenerSet = function(defaultThisObject, name)
-{
- this.name = name;
- this._defaultThisObject = defaultThisObject;
-
- this._listeners = [];
- this._installed = false;
-}
-
-WebInspector.EventListenerSet.prototype = {
- register: function(emitter, type, listener, thisObject, useCapture)
- {
- console.assert(listener, "Missing listener for event: " + type);
- console.assert(emitter, "Missing event emitter for event: " + type);
- console.assert(emitter instanceof WebInspector.Object || emitter instanceof Node || (typeof emitter.addEventListener === "function"), "Event emitter", emitter, " (type:" + type + ") does not implement Node or WebInspector.Object!");
-
- if (emitter instanceof Node)
- listener = listener.bind(thisObject || this._defaultThisObject);
-
- this._listeners.push({emitter: emitter, type: type, listener: listener, thisObject: thisObject, useCapture: useCapture});
- },
-
- unregister: function()
- {
- if (this._installed)
- this.uninstall();
- this._listeners = [];
- },
-
- install: function()
- {
- console.assert(!this._installed, "Already installed listener group: " + this.name);
-
- this._installed = true;
-
- for (var listenerData of this._listeners) {
- if (listenerData.emitter instanceof Node)
- listenerData.emitter.addEventListener(listenerData.type, listenerData.listener, listenerData.useCapture);
- else
- listenerData.emitter.addEventListener(listenerData.type, listenerData.listener, listenerData.thisObject || this._defaultThisObject);
- }
- },
-
- uninstall: function(unregisterListeners)
- {
- console.assert(this._installed, "Trying to uninstall listener group " + this.name + ", but it isn't installed.");
-
- this._installed = false;
-
- for (var listenerData of this._listeners) {
- if (listenerData.emitter instanceof Node)
- listenerData.emitter.removeEventListener(listenerData.type, listenerData.listener, listenerData.useCapture);
- else
- listenerData.emitter.removeEventListener(listenerData.type, listenerData.listener, listenerData.thisObject || this._defaultThisObject);
- }
-
- if (unregisterListeners) {
- this._listeners = [];
- delete this._defaultThisObject;
- }
- },
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceExecutionContextjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ExecutionContext.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ExecutionContext.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ExecutionContext.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,73 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ExecutionContext = function(id, name, isPageContext, frame)
-{
- WebInspector.Object.call(this);
-
- console.assert(typeof id === "number" || id === WebInspector.QuickConsole.MainFrameContextExecutionIdentifier);
- console.assert(typeof name === "string");
-
- this._id = id;
- this._name = name;
- this._isPageContext = isPageContext || false;
- this._frame = frame || null;
-};
-
-WebInspector.ExecutionContext.supported = function()
-{
- // Execution contexts were added to the Inspector protocol alongside RuntimeAgent.enable and
- // disable methods, which turn on and off sending Runtime agent execution context created events.
- // So we can feature detect support for execution contexts with these RuntimeAgent functions.
- return typeof RuntimeAgent.enable === "function";
-}
-
-WebInspector.ExecutionContext.prototype = {
- constructor: WebInspector.ExecutionContext,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get name()
- {
- return this._name;
- },
-
- get isPageContext()
- {
- return this._isPageContext;
- },
-
- get frame()
- {
- return this._frame;
- }
-};
-
-WebInspector.ExecutionContext.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceExecutionContextListjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ExecutionContextList.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ExecutionContextList.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ExecutionContextList.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ExecutionContextList = function()
-{
- WebInspector.Object.call(this);
-
- this._contexts = [];
- this._pageExecutionContext = null;
-};
-
-WebInspector.ExecutionContextList.prototype = {
- constructor: WebInspector.ExecutionContextList,
-
- // Public
-
- get pageExecutionContext()
- {
- return this._pageExecutionContext;
- },
-
- get contexts()
- {
- return this._contexts;
- },
-
- add: function(context)
- {
- // FIXME: The backend sends duplicate page context execution contexts with the same id. Why?
- if (context.isPageContext && this._pageExecutionContext) {
- console.assert(context.id === this._pageExecutionContext.id);
- return false;
- }
-
- this._contexts.push(context);
-
- if (context.isPageContext) {
- console.assert(!this._pageExecutionContext);
- this._pageExecutionContext = context;
- return true;
- }
-
- return false;
- },
-
- clear: function()
- {
- this._contexts = [];
- this._pageExecutionContext = null;
- }
-};
-
-WebInspector.ExecutionContextList.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFilterBarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FilterBar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FilterBar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FilterBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.filter-bar {
- display: -webkit-flex;
-
- height: 21px;
-
- white-space: nowrap;
- overflow: hidden;
-}
-
-.filter-bar > input[type="search"] {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- margin: 1px 6px;
-
- outline: none;
-
- -webkit-appearance: none;
-
- border: 1px solid rgba(0, 0, 0, 0.35);
- border-radius: 10px;
- background-color: rgba(255, 255, 255, 0.2);
- box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
- background-clip: padding-box;
-
- height: 19px;
-
- transition: background-color 200ms ease-in-out;
-}
-
-.filter-bar > input[type="search"]::-webkit-input-placeholder {
- color: rgba(0, 0, 0, 0.35);
-}
-
-.filter-bar > input[type="search"]:focus { background-color: white; }
-.filter-bar > input[type="search"]:not(:placeholder-shown) { background-color: white; } /* Needs to be a separate rule. See http://webkit.org/b/118162 */
-
-.filter-bar > input[type="search"]::-webkit-search-decoration {
- width: 13px;
- height: 13px;
-
- margin-left: 1px;
- margin-right: 3px;
-
- vertical-align: bottom;
-
- background-image: url(Images/FilterFieldGlyph.svg);
-
- -webkit-appearance: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFilterBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FilterBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FilterBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FilterBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FilterBar = function(element) {
- WebInspector.Object.call(this);
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.FilterBar.StyleClassName);
-
- this._inputField = document.createElement("input");
- this._inputField.type = "search";
- this._inputField.spellcheck = false;
- this._inputField.incremental = true;
- this._inputField.addEventListener("search", this._inputFieldChanged.bind(this), false);
- this._element.appendChild(this._inputField);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.FilterBar);
-
-WebInspector.FilterBar.StyleClassName = "filter-bar";
-
-WebInspector.FilterBar.Event = {
- TextFilterDidChange: "filter-bar-text-filter-did-change"
-};
-
-WebInspector.FilterBar.prototype = {
- constructor: WebInspector.FilterBar,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get placeholder()
- {
- return this._inputField.getAttribute("placeholder");
- },
-
- set placeholder(text)
- {
- this._inputField.setAttribute("placeholder", text);
- },
-
- get inputField()
- {
- return this._inputField;
- },
-
- get filters()
- {
- return {text: this._inputField.value};
- },
-
- set filters(filters)
- {
- filters = filters || {};
-
- var oldTextValue = this._inputField.value;
- this._inputField.value = filters.text || "";
- if (oldTextValue !== this._inputField.value)
- this._inputFieldChanged();
- },
-
- hasActiveFilters: function()
- {
- if (this._inputField.value)
- return true;
- return false;
- },
-
- // Private
-
- _inputFieldChanged: function(event)
- {
- this.dispatchEventToListeners(WebInspector.FilterBar.Event.TextFilterDidChange);
- }
-};
-
-WebInspector.FilterBar.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFindBannercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FindBanner.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FindBanner.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FindBanner.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,196 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.find-banner {
- border-bottom: 1px solid rgb(153, 153, 153);
-
- font-family: "Lucida Grande", sans-serif;
- font-size: 11px;
-
- position: absolute;
- top: -22px;
- left: 0;
- right: 0;
- height: 22px;
-
- text-align: right;
-
- white-space: nowrap;
- overflow: hidden;
-
- transition-property: top;
- transition-duration: 200ms;
- transition-timing-function: ease-in;
-
- z-index: 500;
-}
-
-.find-banner.showing {
- top: 0;
- transition-timing-function: ease-out;
-}
-
-.find-banner.no-find-banner-transition,
-.supports-find-banner.no-find-banner-transition {
- transition-duration: 0 !important;
-}
-
-.supports-find-banner {
- transition-property: top;
- transition-duration: 200ms;
- transition-timing-function: ease-in;
-}
-
-.supports-find-banner.showing-find-banner {
- top: 22px !important;
- transition-timing-function: ease-out;
-}
-
-.find-banner > :first-child {
- margin-left: 8px !important;
-}
-
-.find-banner > :last-child {
- margin-right: 8px !important;
-}
-
-.find-banner > input[type="search"] {
- margin: 1px 4px;
-
- width: 143px;
- height: 19px;
-
- vertical-align: top;
-
- -webkit-appearance: none;
-
- outline: none;
-
- border: 1px solid rgb(146, 146, 146);
- border-radius: 4px;
- background-color: white;
- box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
-}
-
-.find-banner > button {
- margin: 1px 4px;
-
- padding-left: 6px;
- padding-right: 6px;
-
- -webkit-appearance: none;
-
- border-radius: 4px;
- border: 1px solid rgb(146, 146, 146);
-
- background-color: white;
- background-image: none;
- box-shadow: none;
-
- line-height: 11px;
-
- height: 19px;
-
- text-align: center;
- vertical-align: top;
-
- outline-offset: -2px;
-}
-
-.find-banner > button > .glyph {
- display: inline-block;
-
- width: 7px;
- height: 7px;
-}
-
-.find-banner > button:disabled > .glyph {
- opacity: 0.65;
-}
-
-.find-banner > button:active:not(:disabled) {
- border: 1px solid rgb(141, 141, 141);
- background-image: -webkit-linear-gradient(top, rgb(200, 200, 200), rgb(218, 218, 218));
- box-shadow: rgba(255, 255, 255, 0.33) 0 1px 0, inset rgb(165, 165, 165) 0 1px 1px;
-}
-
-.find-banner > button:disabled {
- border: 1px solid rgb(195, 195, 195);
- background-image: none;
-}
-
-.find-banner > button.segmented.left {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-
- margin-right: 0;
-
- padding-left: 6px;
- padding-right: 6px;
-}
-
-.find-banner > button.segmented.left > .glyph {
- background-image: -webkit-canvas(find-banner-previous-arrow-normal);
- background-size: 7px 7px;
- background-repeat: no-repeat;
-}
-
-.find-banner > button.segmented.left:active:not(:disabled) > .glyph {
- background-image: -webkit-canvas(find-banner-previous-arrow-normal-active);
-}
-
-.find-banner > button.segmented.right {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-
- margin-left: -1px;
-
- padding-left: 5px;
- padding-right: 7px;
-}
-
-.find-banner > button.segmented.right > .glyph {
- background-image: -webkit-canvas(find-banner-next-arrow-normal);
- background-size: 7px 7px;
- background-repeat: no-repeat;
-}
-
-.find-banner > button.segmented.right:active:not(:disabled) > .glyph {
- background-image: -webkit-canvas(find-banner-next-arrow-normal-active);
-}
-
-.find-banner > button.segmented {
- min-width: 22px;
-}
-
-.find-banner > button.segmented:active {
- z-index: 100;
- position: relative;
-}
-
-.find-banner > label {
- margin: 0 6px;
- line-height: 21px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFindBannerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FindBanner.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FindBanner.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FindBanner.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,334 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FindBanner = function(delegate, element) {
- WebInspector.Object.call(this);
-
- this._delegate = delegate || null;
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.FindBanner.StyleClassName);
-
- this._resultCountLabel = document.createElement("label");
- this._element.appendChild(this._resultCountLabel);
-
- this._previousResultButton = document.createElement("button");
- this._previousResultButton.classList.add(WebInspector.FindBanner.SegmentedButtonStyleClassName);
- this._previousResultButton.classList.add(WebInspector.FindBanner.LeftSegmentButtonStyleClassName);
- this._previousResultButton.disabled = true;
- this._previousResultButton.addEventListener("click", this._previousResultButtonClicked.bind(this));
- this._element.appendChild(this._previousResultButton);
-
- var previousResultButtonGlyphElement = document.createElement("div");
- previousResultButtonGlyphElement.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName);
- this._previousResultButton.appendChild(previousResultButtonGlyphElement);
-
- this._nextResultButton = document.createElement("button");
- this._nextResultButton.classList.add(WebInspector.FindBanner.SegmentedButtonStyleClassName);
- this._nextResultButton.classList.add(WebInspector.FindBanner.RightSegmentButtonStyleClassName);
- this._nextResultButton.disabled = true;
- this._nextResultButton.addEventListener("click", this._nextResultButtonClicked.bind(this));
- this._element.appendChild(this._nextResultButton);
-
- var nextResultButtonGlyphElement = document.createElement("div");
- nextResultButtonGlyphElement.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName);
- this._nextResultButton.appendChild(nextResultButtonGlyphElement);
-
- this._inputField = document.createElement("input");
- this._inputField.type = "search";
- this._inputField.spellcheck = false;
- this._inputField.incremental = true;
- this._inputField.setAttribute("results", 5);
- this._inputField.setAttribute("autosave", "inspector-search");
- this._inputField.addEventListener("keydown", this._inputFieldKeyDown.bind(this), false);
- this._inputField.addEventListener("keyup", this._inputFieldKeyUp.bind(this), false);
- this._inputField.addEventListener("search", this._inputFieldSearch.bind(this), false);
- this._element.appendChild(this._inputField);
-
- this._doneButton = document.createElement("button");
- this._doneButton.textContent = WebInspector.UIString("Done");
- this._doneButton.addEventListener("click", this._doneButtonClicked.bind(this));
- this._element.appendChild(this._doneButton);
-
- this._numberOfResults = null;
- this._searchBackwards = false;
- this._searchKeyPressed = false;
- this._previousSearchValue = "";
-
- this._hideKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape, this.hide.bind(this), this._element);
- this._populateFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "E", this._populateSearchQueryFromSelection.bind(this));
- this._populateFindKeyboardShortcut.implicitlyPreventsDefault = false;
- this._findNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._nextResultButtonClicked.bind(this));
- this._findPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._previousResultButtonClicked.bind(this));
-
- this._generateButtonsGlyphsIfNeeded();
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.FindBanner);
-
-WebInspector.FindBanner.StyleClassName = "find-banner";
-WebInspector.FindBanner.SupportsFindBannerStyleClassName = "supports-find-banner";
-WebInspector.FindBanner.ShowingFindBannerStyleClassName = "showing-find-banner";
-WebInspector.FindBanner.NoTransitionStyleClassName = "no-find-banner-transition";
-WebInspector.FindBanner.ShowingStyleClassName = "showing";
-WebInspector.FindBanner.SegmentedButtonStyleClassName = "segmented";
-WebInspector.FindBanner.LeftSegmentButtonStyleClassName = "left";
-WebInspector.FindBanner.RightSegmentButtonStyleClassName = "right";
-WebInspector.FindBanner.SegmentGlyphStyleClassName = "glyph";
-
-WebInspector.FindBanner.Event = {
- DidShow: "find-banner-did-show",
- DidHide: "find-banner-did-hide"
-}
-
-WebInspector.FindBanner.prototype = {
- constructor: WebInspector.FindBanner,
-
- // Public
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(newDelegate)
- {
- this._delegate = newDelegate || null;
- },
-
- get element()
- {
- return this._element;
- },
-
- get inputField()
- {
- return this._inputField;
- },
-
- get searchQuery()
- {
- return this._inputField.value || "";
- },
-
- set searchQuery(query)
- {
- this._inputField.value = query || "";
- },
-
- get numberOfResults()
- {
- return this._numberOfResults;
- },
-
- set numberOfResults(numberOfResults)
- {
- if (numberOfResults === undefined || isNaN(numberOfResults))
- numberOfResults = null;
-
- this._numberOfResults = numberOfResults;
-
- this._previousResultButton.disabled = this._nextResultButton.disabled = (numberOfResults <= 0);
-
- if (numberOfResults === null)
- this._resultCountLabel.textContent = "";
- else if (numberOfResults <= 0)
- this._resultCountLabel.textContent = WebInspector.UIString("Not found");
- else if (numberOfResults === 1)
- this._resultCountLabel.textContent = WebInspector.UIString("1 match");
- else if (numberOfResults > 1)
- this._resultCountLabel.textContent = WebInspector.UIString("%d matches").format(numberOfResults);
- },
-
- get targetElement()
- {
- return this._targetElement;
- },
-
- set targetElement(element)
- {
- if (this._targetElement) {
- var oldTargetElement = this._targetElement;
-
- this._targetElement.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName);
- this._targetElement.classList.remove(WebInspector.FindBanner.SupportsFindBannerStyleClassName);
- this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
-
- this._element.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName);
- this._element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName);
-
- function delayedWork()
- {
- oldTargetElement.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName);
- this._element.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName);
- }
-
- // Delay so we can remove the no transition style class after the other style changes are committed.
- setTimeout(delayedWork.bind(this), 0);
- }
-
- this._targetElement = element || null;
-
- if (this._targetElement)
- this._targetElement.classList.add(WebInspector.FindBanner.SupportsFindBannerStyleClassName);
- },
-
- get showing()
- {
- return this._element.classList.contains(WebInspector.FindBanner.ShowingStyleClassName);
- },
-
- show: function()
- {
- console.assert(this._targetElement);
- if (!this._targetElement)
- return;
-
- console.assert(this._targetElement.parentNode);
- if (!this._targetElement.parentNode)
- return;
-
- if (this._element.parentNode !== this._targetElement.parentNode)
- this._targetElement.parentNode.insertBefore(this._element, this._targetElement);
-
- function delayedWork()
- {
- this._targetElement.classList.add(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
- this._element.classList.add(WebInspector.FindBanner.ShowingStyleClassName);
-
- this._inputField.select();
- }
-
- // Delay adding the classes in case the target element and/or the find banner were just added to
- // the document. Adding the class right away will prevent the animation from working the firs time.
- setTimeout(delayedWork.bind(this), 0);
-
- this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidShow);
- },
-
- hide: function()
- {
- console.assert(this._targetElement);
- if (!this._targetElement)
- return;
-
- this._inputField.blur();
-
- this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
- this._element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName);
-
- this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidHide);
- },
-
- // Private
-
- _inputFieldKeyDown: function(event)
- {
- if (event.keyIdentifier === "Shift")
- this._searchBackwards = true;
- else if (event.keyIdentifier === "Enter")
- this._searchKeyPressed = true;
- },
-
- _inputFieldKeyUp: function(event)
- {
- if (event.keyIdentifier === "Shift")
- this._searchBackwards = false;
- else if (event.keyIdentifier === "Enter")
- this._searchKeyPressed = false;
- },
-
- _inputFieldSearch: function(event)
- {
- if (this._inputField.value) {
- if (this._previousSearchValue !== this.searchQuery) {
- if (this._delegate && typeof this._delegate.findBannerPerformSearch === "function")
- this._delegate.findBannerPerformSearch(this, this.searchQuery);
- } else if (this._searchKeyPressed && this._numberOfResults > 0) {
- if (this._searchBackwards) {
- if (this._delegate && typeof this._delegate.findBannerRevealPreviousResult === "function")
- this._delegate.findBannerRevealPreviousResult(this);
- } else {
- if (this._delegate && typeof this._delegate.findBannerRevealNextResult === "function")
- this._delegate.findBannerRevealNextResult(this);
- }
- }
- } else {
- this.numberOfResults = null;
-
- if (this._delegate && typeof this._delegate.findBannerSearchCleared === "function")
- this._delegate.findBannerSearchCleared(this);
- }
-
- this._previousSearchValue = this.searchQuery;
- },
-
- _populateSearchQueryFromSelection: function(event)
- {
- if (this._delegate && typeof this._delegate.findBannerSearchQueryForSelection === "function") {
- var query = this._delegate.findBannerSearchQueryForSelection(this);
- if (query) {
- this.searchQuery = query;
-
- if (this._delegate && typeof this._delegate.findBannerPerformSearch === "function")
- this._delegate.findBannerPerformSearch(this, this.searchQuery);
- }
- }
- },
-
- _previousResultButtonClicked: function(event)
- {
- if (this._delegate && typeof this._delegate.findBannerRevealPreviousResult === "function")
- this._delegate.findBannerRevealPreviousResult(this);
- },
-
- _nextResultButtonClicked: function(event)
- {
- if (this._delegate && typeof this._delegate.findBannerRevealNextResult === "function")
- this._delegate.findBannerRevealNextResult(this);
- },
-
- _doneButtonClicked: function(event)
- {
- this.hide();
- },
-
- _generateButtonsGlyphsIfNeeded: function()
- {
- if (WebInspector.FindBanner._generatedButtonsGlyphs)
- return;
-
- WebInspector.FindBanner._generatedButtonsGlyphs = true;
-
- var specifications = {};
- specifications["normal"] = {fillColor: [81, 81, 81]};
- specifications["normal-active"] = {fillColor: [37, 37, 37]};
-
- generateColoredImagesForCSS("Images/BackArrow.svg", specifications, 7, 7, "find-banner-previous-arrow-");
- generateColoredImagesForCSS("Images/ForwardArrow.svg", specifications, 7, 7, "find-banner-next-arrow-");
- }
-};
-
-WebInspector.FindBanner.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.navigation-bar .item.flexible-space,
-.toolbar .item.flexible-space {
- -webkit-flex: 1;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FlexibleSpaceNavigationItem = function(identifier) {
- WebInspector.NavigationItem.call(this, identifier);
-};
-
-WebInspector.FlexibleSpaceNavigationItem.StyleClassName = "flexible-space";
-
-WebInspector.FlexibleSpaceNavigationItem.prototype = {
- constructor: WebInspector.FlexibleSpaceNavigationItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.FlexibleSpaceNavigationItem.StyleClassName],
-};
-
-WebInspector.FlexibleSpaceNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFolderIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FolderIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FolderIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FolderIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.folder-icon .icon {
- content: -webkit-image-set(url(Images/FolderGeneric.png) 1x, url(Images/FolderGeneric@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFolderTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FolderTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FolderTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FolderTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FolderTreeElement = function(title, subtitle, representedObject)
-{
- WebInspector.GeneralTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, title, subtitle, representedObject, true);
-
- this.small = true;
-};
-
-WebInspector.FolderTreeElement.FolderIconStyleClassName = "folder-icon";
-
-WebInspector.FolderTreeElement.prototype = {
- constructor: WebInspector.FolderTreeElement,
-
- // No Methods or Properties
-};
-
-WebInspector.FolderTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,100 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.resource.font {
- display: -webkit-flex;
-
- -webkit-justify-content: center;
-
- overflow-x: hidden;
- overflow-y: auto;
-}
-
-.content-view.resource.font .preview {
- font-size: 72px;
- font-family: serif;
-
- white-space: nowrap;
-
- /* A border is used instead of padding or margin so when there is scrolling
- overflow there will be space on all sides. It also avoids having to account
- for the padding/margin in FontResourceContentView.siteToFit. */
- border: 15px solid transparent;
-
- margin: auto 0;
-}
-
-.content-view.resource.font .preview > .line {
- border-left: 1px solid lightgrey;
- border-right: 1px solid lightgrey;
-
- margin-top: -1px; /* Causes adjacent .line elements to share one border instead of doubling up. */
-}
-
-.content-view.resource.font .preview > .line > .content {
- display: inline-block;
-
- width: 100%;
-
- text-align: center;
- text-rendering: optimizeLegibility;
-
- -webkit-user-select: text;
- cursor: text;
-}
-
-.content-view.resource.font .preview > .line > .metric {
- display: inline-block;
-
- width: 100%;
- height: 1px;
-
- margin-right: -100%; /* Causes this element to be zero width and draw behind the text. */
-}
-
-.content-view.resource.font .metric.top {
- vertical-align: top;
- background-color: lightgrey;
-}
-
-.content-view.resource.font .metric.baseline {
- vertical-align: baseline;
- background-color: lightblue;
-}
-
-.content-view.resource.font .metric.middle {
- vertical-align: middle;
- background-color: lightgreen;
-}
-
-.content-view.resource.font .metric.xheight {
- vertical-align: 1ex;
- background-color: pink;
-}
-
-.content-view.resource.font .metric.bottom {
- vertical-align: bottom;
- background-color: lightgrey;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,151 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FontResourceContentView = function(resource)
-{
- WebInspector.ResourceContentView.call(this, resource, WebInspector.FontResourceContentView.StyleClassName);
-
- this._styleElement = null;
- this._previewElement = null;
-};
-
-WebInspector.FontResourceContentView._uniqueFontIdentifier = 0;
-
-WebInspector.FontResourceContentView.StyleClassName = "font";
-WebInspector.FontResourceContentView.PreviewElementStyleClassName = "preview";
-WebInspector.FontResourceContentView.LineElementStyleClassName = "line";
-WebInspector.FontResourceContentView.ContentElementStyleClassName = "content";
-WebInspector.FontResourceContentView.MetricElementStyleClassName = "metric";
-WebInspector.FontResourceContentView.TopMetricElementStyleClassName = "top";
-WebInspector.FontResourceContentView.XHeightMetricElementStyleClassName = "xheight";
-WebInspector.FontResourceContentView.MiddleMetricElementStyleClassName = "middle";
-WebInspector.FontResourceContentView.BaselineMetricElementStyleClassName = "baseline";
-WebInspector.FontResourceContentView.BottomMetricElementStyleClassName = "bottom";
-WebInspector.FontResourceContentView.PreviewLines = ["ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "abcdefghijklm", "nopqrstuvwxyz", "1234567890"];
-
-WebInspector.FontResourceContentView.MaximumFontSize = 72;
-WebInspector.FontResourceContentView.MinimumFontSize = 12;
-
-WebInspector.FontResourceContentView.prototype = {
- constructor: WebInspector.FontResourceContentView,
-
- // Public
-
- get previewElement()
- {
- return this._previewElement;
- },
-
- sizeToFit: function()
- {
- if (!this._previewElement)
- return;
-
- // Start at the maximum size and try progressively smaller font sizes until minimum is reached or the preview element is not as wide as the main element.
- for (var fontSize = WebInspector.FontResourceContentView.MaximumFontSize; fontSize >= WebInspector.FontResourceContentView.MinimumFontSize; fontSize -= 5) {
- this._previewElement.style.fontSize = fontSize + "px";
- if (this._previewElement.offsetWidth <= this.element.offsetWidth)
- break;
- }
- },
-
- contentAvailable: function(content, base64Encoded)
- {
- this.element.removeChildren();
-
- const uniqueFontName = "WebInspectorFontPreview" + (++WebInspector.FontResourceContentView._uniqueFontIdentifier);
-
- var format = "";
-
- // We need to specify a format when loading SVG fonts to make them work.
- if (this.resource.mimeTypeComponents.type === "image/svg+xml")
- format = " format(\"svg\")";
-
- if (this._styleElement && this._styleElement.parentNode)
- this._styleElement.parentNode.removeChild(this._styleElement);
-
- this._styleElement = document.createElement("style");
- this._styleElement.textContent = "@font-face { font-family: \"" + uniqueFontName + "\"; src: url(" + this.resource.contentURL + ")" + format + "; }";
-
- // The style element will be added when shown later if we are not visible now.
- if (this.visible)
- document.head.appendChild(this._styleElement);
-
- this._previewElement = document.createElement("div");
- this._previewElement.className = WebInspector.FontResourceContentView.PreviewElementStyleClassName;
- this._previewElement.style.fontFamily = uniqueFontName;
-
- function createMetricElement(className)
- {
- var metricElement = document.createElement("div");
- metricElement.className = WebInspector.FontResourceContentView.MetricElementStyleClassName + " " + className;
- return metricElement;
- }
-
- var lines = WebInspector.FontResourceContentView.PreviewLines;
- for (var i = 0; i < lines.length; ++i) {
- var lineElement = document.createElement("div");
- lineElement.className = WebInspector.FontResourceContentView.LineElementStyleClassName;
-
- lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.TopMetricElementStyleClassName));
- lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.XHeightMetricElementStyleClassName));
- lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.MiddleMetricElementStyleClassName));
- lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.BaselineMetricElementStyleClassName));
- lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.BottomMetricElementStyleClassName));
-
- var contentElement = document.createElement("div");
- contentElement.className = WebInspector.FontResourceContentView.ContentElementStyleClassName;
- contentElement.textContent = lines[i];
- lineElement.appendChild(contentElement);
-
- this._previewElement.appendChild(lineElement);
- }
-
- this.element.appendChild(this._previewElement);
-
- this.sizeToFit();
- },
-
- updateLayout: function()
- {
- this.sizeToFit();
- },
-
- shown: function()
- {
- // Add the style element since it is removed when hidden.
- if (this._styleElement)
- document.head.appendChild(this._styleElement);
- },
-
- hidden: function()
- {
- // Remove the style element so it will not stick around when this content view is destroyed.
- if (this._styleElement && this._styleElement.parentNode)
- this._styleElement.parentNode.removeChild(this._styleElement);
- }
-};
-
-WebInspector.FontResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFormatterjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Formatter.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Formatter.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Formatter.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,164 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-function Formatter(codeMirror, builder)
-{
- console.assert(codeMirror);
- console.assert(builder);
-
- this._codeMirror = codeMirror;
- this._builder = builder;
-
- this._lastToken = null;
- this._lastContent = "";
-};
-
-Formatter.prototype = {
- constructor: Formatter,
-
- // Public
-
- format: function(from, to)
- {
- console.assert(this._builder.originalContent === null);
- if (this._builder.originalContent !== null)
- return;
-
- var outerMode = this._codeMirror.getMode();
- var content = this._codeMirror.getRange(from, to);
- var state = CodeMirror.copyState(outerMode, this._codeMirror.getTokenAt(from).state);
- this._builder.setOriginalContent(content);
-
- var lineOffset = 0;
- var lines = content.split("\n");
- for (var i = 0; i < lines.length; ++i) {
- var line = lines[i];
- var startOfNewLine = true;
- var firstTokenOnLine = true;
- var stream = new CodeMirror.StringStream(line);
- while (!stream.eol()) {
- var innerMode = CodeMirror.innerMode(outerMode, state);
- var token = outerMode.token(stream, state);
- var isWhiteSpace = token === null && /^\s*$/.test(stream.current());
- this._handleToken(innerMode.mode, token, state, stream, lineOffset + stream.start, isWhiteSpace, startOfNewLine, firstTokenOnLine);
- stream.start = stream.pos;
- startOfNewLine = false;
- if (firstTokenOnLine && !isWhiteSpace)
- firstTokenOnLine = false;
- }
-
- if (firstTokenOnLine)
- this._handleEmptyLine();
-
- lineOffset += line.length + 1; // +1 for the "\n" removed in split.
- this._handleLineEnding(lineOffset - 1); // -1 for the index of the "\n".
- }
-
- this._builder.finish();
- },
-
- // Private
-
- _handleToken: function(mode, token, state, stream, originalPosition, isWhiteSpace, startOfNewLine, firstTokenOnLine)
- {
- // String content of the token.
- var content = stream.current();
-
- // Start of a new line. Insert a newline to be safe if code was not-ASI safe. These are collapsed.
- if (startOfNewLine)
- this._builder.appendNewline();
-
- // Whitespace. Collapse to a single space.
- if (isWhiteSpace) {
- this._builder.appendSpace();
- return;
- }
-
- // Avoid some hooks for content in comments.
- var isComment = token && /\bcomment\b/.test(token);
-
- if (mode.modifyStateForTokenPre)
- mode.modifyStateForTokenPre(this._lastToken, this._lastContent, token, state, content, isComment);
-
- // Should we remove the last newline?
- if (this._builder.lastTokenWasNewline && mode.removeLastNewline(this._lastToken, this._lastContent, token, state, content, isComment, firstTokenOnLine))
- this._builder.removeLastNewline();
-
- // Add whitespace after the last token?
- if (!this._builder.lastTokenWasWhitespace && mode.shouldHaveSpaceAfterLastToken(this._lastToken, this._lastContent, token, state, content, isComment))
- this._builder.appendSpace();
-
- // Add whitespace before this token?
- if (!this._builder.lastTokenWasWhitespace && mode.shouldHaveSpaceBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
- this._builder.appendSpace();
-
- // Should we dedent before this token?
- var dedents = mode.dedentsBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment);
- while (dedents-- > 0)
- this._builder.dedent();
-
- // Should we add a newline before this token?
- if (mode.newlineBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
- this._builder.appendNewline();
-
- // Should we indent before this token?
- if (mode.indentBeforeToken(this._lastToken, this._lastContent, token, state, content, isComment))
- this._builder.indent();
-
- // Append token.
- this._builder.appendToken(content, originalPosition);
-
- // Let the pretty printer update any state it keeps track of.
- if (mode.modifyStateForTokenPost)
- mode.modifyStateForTokenPost(this._lastToken, this._lastContent, token, state, content, isComment);
-
- // Should we indent or dedent after this token?
- if (!isComment && mode.indentAfterToken(this._lastToken, this._lastContent, token, state, content, isComment))
- this._builder.indent();
-
- // Should we add newlines after this token?
- var newlines = mode.newlinesAfterToken(this._lastToken, this._lastContent, token, state, content, isComment);
- if (newlines)
- this._builder.appendMultipleNewlines(newlines);
-
- // Record this token as the last token.
- this._lastToken = token;
- this._lastContent = content;
- },
-
- _handleEmptyLine: function()
- {
- // Preserve original whitespace only lines by adding a newline.
- // However, don't do this if the builder just added multiple newlines.
- if (!(this._builder.lastTokenWasNewline && this._builder.lastNewlineAppendWasMultiple))
- this._builder.appendNewline(true);
- },
-
- _handleLineEnding: function(originalNewLinePosition)
- {
- // Record the original line ending.
- this._builder.addOriginalLineEnding(originalNewLinePosition);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFormatterContentBuilderjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FormatterContentBuilder.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FormatterContentBuilder.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FormatterContentBuilder.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,229 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-function FormatterContentBuilder(mapping, originalLineEndings, formattedLineEndings, originalOffset, formattedOffset, indentString)
-{
- this._originalContent = null;
- this._formattedContent = [];
- this._formattedContentLength = 0;
-
- this._startOfLine = true;
- this.lastTokenWasNewline = false;
- this.lastTokenWasWhitespace = false;
- this.lastNewlineAppendWasMultiple = false;
-
- this._indent = 0;
- this._indentString = indentString;
- this._indentCache = ["", this._indentString];
-
- this._mapping = mapping;
- this._originalLineEndings = originalLineEndings || [];
- this._formattedLineEndings = formattedLineEndings || [];
- this._originalOffset = originalOffset || 0;
- this._formattedOffset = formattedOffset || 0;
-
- this._lastOriginalPosition = 0;
- this._lastFormattedPosition = 0;
-}
-
-FormatterContentBuilder.prototype = {
- constructor: FormatterContentBuilder,
-
- // Public
-
- get originalContent()
- {
- return this._originalContent;
- },
-
- get formattedContent()
- {
- var formatted = this._formattedContent.join("");
- console.assert(formatted.length === this._formattedContentLength);
- return formatted;
- },
-
- get mapping()
- {
- return this._mapping;
- },
-
- get originalLineEndings()
- {
- return this._originalLineEndings;
- },
-
- get formattedLineEndings()
- {
- return this._formattedLineEndings;
- },
-
- setOriginalContent: function(originalContent)
- {
- console.assert(!this._originalContent);
- this._originalContent = originalContent;
- },
-
- appendToken: function(string, originalPosition)
- {
- if (this._startOfLine)
- this._appendIndent();
-
- this._addMappingIfNeeded(originalPosition);
-
- this._append(string);
- this._startOfLine = false;
- this.lastTokenWasNewline = false;
- this.lastTokenWasWhitespace = false;
- },
-
- appendSpace: function()
- {
- if (!this._startOfLine) {
- this._append(" ");
- this.lastTokenWasNewline = false;
- this.lastTokenWasWhitespace = true;
- }
- },
-
- appendNewline: function(force)
- {
- if ((!this.lastTokenWasNewline && !this._startOfLine) || force) {
- this._append("\n");
- this._addFormattedLineEnding();
- this._startOfLine = true;
- this.lastTokenWasNewline = true;
- this.lastTokenWasWhitespace = false;
- this.lastNewlineAppendWasMultiple = false;
- }
- },
-
- appendMultipleNewlines: function(newlines)
- {
- console.assert(newlines > 0);
-
- var wasMultiple = newlines > 1;
-
- while (newlines-- > 0)
- this.appendNewline(true);
-
- if (wasMultiple)
- this.lastNewlineAppendWasMultiple = true;
- },
-
- removeLastNewline: function()
- {
- console.assert(this.lastTokenWasNewline);
- console.assert(this._formattedContent.lastValue === "\n");
- if (this.lastTokenWasNewline) {
- this._popNewLine();
- this._startOfLine = false;
- this.lastTokenWasNewline = false;
- this.lastTokenWasWhitespace = false;
- }
- },
-
- indent: function()
- {
- ++this._indent;
- },
-
- dedent: function()
- {
- --this._indent;
-
- console.assert(this._indent >= 0);
- if (this._indent < 0)
- this._indent = 0;
- },
-
- addOriginalLineEnding: function(originalPosition)
- {
- this._originalLineEndings.push(originalPosition);
- },
-
- finish: function()
- {
- this.appendNewline();
- },
-
- // Private
-
- _popNewLine: function()
- {
- var removed = this._formattedContent.pop();
- this._formattedContentLength -= removed.length;
- this._formattedLineEndings.pop();
- },
-
- _append: function(str)
- {
- this._formattedContent.push(str);
- this._formattedContentLength += str.length;
- },
-
- _appendIndent: function()
- {
- // Indent is already in the cache.
- if (this._indent < this._indentCache.length) {
- this._append(this._indentCache[this._indent]);
- return;
- }
-
- // Indent was not in the cache, fill up the cache up with what was needed.
- const maxCacheIndent = 20;
- var max = Math.min(this._indent, maxCacheIndent);
- for (var i = this._indentCache.length; i <= max; ++i)
- this._indentCache[i] = this._indentCache[i-1] + this._indentString;
-
- // Append indents as needed.
- var indent = this._indent;
- do {
- if (indent >= maxCacheIndent)
- this._append(this._indentCache[maxCacheIndent]);
- else
- this._append(this._indentCache[indent]);
- indent -= maxCacheIndent;
- } while (indent > 0);
- },
-
- _addMappingIfNeeded: function(originalPosition)
- {
- if (originalPosition - this._lastOriginalPosition === this._formattedContentLength - this._lastFormattedPosition)
- return;
-
- this._mapping.original.push(this._originalOffset + originalPosition);
- this._mapping.formatted.push(this._formattedOffset + this._formattedContentLength);
-
- this._lastOriginalPosition = originalPosition;
- this._lastFormattedPosition = this._formattedContentLength;
- },
-
- _addFormattedLineEnding: function()
- {
- console.assert(this._formattedContent.lastValue === "\n");
- this._formattedLineEndings.push(this._formattedContentLength - 1);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFormatterSourceMapjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FormatterSourceMap.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FormatterSourceMap.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FormatterSourceMap.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FormatterSourceMap = function(originalLineEndings, formattedLineEndings, mapping)
-{
- WebInspector.Object.call(this);
-
- this._originalLineEndings = originalLineEndings;
- this._formattedLineEndings = formattedLineEndings;
- this._mapping = mapping;
-};
-
-WebInspector.FormatterSourceMap.fromBuilder = function(builder)
-{
- return new WebInspector.FormatterSourceMap(builder.originalLineEndings, builder.formattedLineEndings, builder.mapping);
-}
-
-WebInspector.FormatterSourceMap.prototype = {
- constructor: WebInspector.FormatterSourceMap,
-
- // Public
-
- originalToFormatted: function(lineNumber, columnNumber)
- {
- var originalPosition = this._locationToPosition(this._originalLineEndings, lineNumber || 0, columnNumber || 0);
- var formattedPosition = this._convertPosition(this._mapping.original, this._mapping.formatted, originalPosition);
- return this._positionToLocation(this._formattedLineEndings, formattedPosition);
- },
-
- formattedToOriginal: function(lineNumber, columnNumber)
- {
- var formattedPosition = this._locationToPosition(this._formattedLineEndings, lineNumber || 0, columnNumber || 0);
- var originalPosition = this._convertPosition(this._mapping.formatted, this._mapping.original, formattedPosition);
- return this._positionToLocation(this._originalLineEndings, originalPosition);
- },
-
- // Private
-
- _locationToPosition: function(lineEndings, lineNumber, columnNumber)
- {
- var lineOffset = lineNumber ? lineEndings[lineNumber - 1] + 1 : 0;
- return lineOffset + columnNumber;
- },
-
- _positionToLocation: function(lineEndings, position)
- {
- var lineNumber = lineEndings.upperBound(position - 1);
- if (!lineNumber)
- var columnNumber = position;
- else
- var columnNumber = position - lineEndings[lineNumber - 1] - 1;
- return {lineNumber: lineNumber, columnNumber: columnNumber};
- },
-
- _convertPosition: function(positions1, positions2, positionInPosition1)
- {
- var index = positions1.upperBound(positionInPosition1) - 1;
- var convertedPosition = positions2[index] + positionInPosition1 - positions1[index];
- if (index < positions2.length - 1 && convertedPosition > positions2[index + 1])
- convertedPosition = positions2[index + 1];
- return convertedPosition;
- }
-};
-
-WebInspector.FormatterSourceMap.__proto__ = WebInspector.Object;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFramejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Frame.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Frame.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Frame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,501 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Frame = function(id, name, securityOrigin, loaderIdentifier, mainResource)
-{
- WebInspector.Object.call(this);
-
- console.assert(id);
-
- this._id = id;
-
- this._name = null;
- this._securityOrigin = null;
-
- this._resourceCollection = new WebInspector.ResourceCollection;
- this._provisionalResourceCollection = new WebInspector.ResourceCollection;
-
- this._childFrames = [];
- this._childFrameIdentifierMap = {};
-
- this._parentFrame = null;
- this._isMainFrame = false;
-
- this._domContentReadyEventTimestamp = NaN;
- this._loadEventTimestamp = NaN;
-
- this._executionContextList = new WebInspector.ExecutionContextList;
-
- this.initialize(name, securityOrigin, loaderIdentifier, mainResource);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Frame);
-
-WebInspector.Frame.Event = {
- NameDidChange: "frame-name-did-change",
- SecurityOriginDidChange: "frame-security-origin-did-change",
- MainResourceDidChange: "frame-main-resource-did-change",
- ProvisionalLoadStarted: "frame-provisional-load-started",
- ProvisionalLoadCommitted: "frame-provisional-load-committed",
- ProvisionalLoadCleared: "frame-provisional-load-cleared",
- ProvisionalResourceWasAdded: "frame-provisional-resource-was-added",
- ResourceWasAdded: "frame-resource-was-added",
- ResourceWasRemoved: "frame-resource-was-removed",
- AllResourcesRemoved: "frame-all-resources-removed",
- ChildFrameWasAdded: "frame-child-frame-was-added",
- ChildFrameWasRemoved: "frame-child-frame-was-removed",
- AllChildFramesRemoved: "frame-all-child-frames-removed",
- PageExecutionContextChanged: "frame-page-execution-context-changed",
- ExecutionContextsCleared: "frame-execution-contexts-cleared"
-};
-
-WebInspector.Frame.TypeIdentifier = "Frame";
-WebInspector.Frame.MainResourceURLCookieKey = "frame-main-resource-url";
-
-WebInspector.Frame.prototype = {
- constructor: WebInspector.Frame,
-
- // Public
-
- initialize: function(name, securityOrigin, loaderIdentifier, mainResource)
- {
- console.assert(loaderIdentifier);
- console.assert(mainResource);
-
- var oldName = this._name;
- var oldSecurityOrigin = this._securityOrigin;
- var oldMainResource = this._mainResource;
-
- this._name = name || null;
- this._securityOrigin = securityOrigin || null;
- this._loaderIdentifier = loaderIdentifier || null;
-
- this._mainResource = mainResource;
- this._mainResource._parentFrame = this;
-
- if (oldMainResource && this._mainResource !== oldMainResource)
- this._disassociateWithResource(oldMainResource);
-
- this.removeAllResources();
- this.removeAllChildFrames();
- this.clearExecutionContexts();
- this.clearProvisionalLoad();
-
- if (this._mainResource !== oldMainResource)
- this._dispatchMainResourceDidChangeEvent(oldMainResource);
-
- if (this._securityOrigin !== oldSecurityOrigin)
- this.dispatchEventToListeners(WebInspector.Frame.Event.SecurityOriginDidChange, {oldSecurityOrigin: oldSecurityOrigin});
-
- if (this._name !== oldName)
- this.dispatchEventToListeners(WebInspector.Frame.Event.NameDidChange, {oldName: oldName});
- },
-
- startProvisionalLoad: function(provisionalMainResource)
- {
- console.assert(provisionalMainResource);
-
- this._provisionalMainResource = provisionalMainResource;
- this._provisionalMainResource._parentFrame = this;
-
- this._provisionalLoaderIdentifier = provisionalMainResource.loaderIdentifier;
-
- this._provisionalResourceCollection.removeAllResources();
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadStarted);
- },
-
- commitProvisionalLoad: function(securityOrigin)
- {
- console.assert(this._provisionalMainResource);
- console.assert(this._provisionalLoaderIdentifier);
- if (!this._provisionalLoaderIdentifier)
- return;
-
- var oldSecurityOrigin = this._securityOrigin;
- var oldMainResource = this._mainResource;
-
- this._securityOrigin = securityOrigin || null;
- this._loaderIdentifier = this._provisionalLoaderIdentifier;
- this._mainResource = this._provisionalMainResource;
-
- this._domContentReadyEventTimestamp = NaN;
- this._loadEventTimestamp = NaN;
-
- if (oldMainResource && this._mainResource !== oldMainResource)
- this._disassociateWithResource(oldMainResource);
-
- this.removeAllResources();
-
- this._resourceCollection = this._provisionalResourceCollection;
- this._provisionalResourceCollection = new WebInspector.ResourceCollection;
-
- this.clearExecutionContexts(true);
- this.clearProvisionalLoad(true);
- this.removeAllChildFrames();
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadCommitted);
-
- if (this._mainResource !== oldMainResource)
- this._dispatchMainResourceDidChangeEvent(oldMainResource);
-
- if (this._securityOrigin !== oldSecurityOrigin)
- this.dispatchEventToListeners(WebInspector.Frame.Event.SecurityOriginDidChange, {oldSecurityOrigin: oldSecurityOrigin});
- },
-
- clearProvisionalLoad: function(skipProvisionalLoadClearedEvent)
- {
- if (!this._provisionalLoaderIdentifier)
- return;
-
- this._provisionalLoaderIdentifier = null;
- this._provisionalMainResource = null;
- this._provisionalResourceCollection.removeAllResources();
-
- if (!skipProvisionalLoadClearedEvent)
- this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadCleared);
- },
-
- get id()
- {
- return this._id;
- },
-
- get loaderIdentifier()
- {
- return this._loaderIdentifier;
- },
-
- get provisionalLoaderIdentifier()
- {
- return this._provisionalLoaderIdentifier;
- },
-
- get name()
- {
- return this._name;
- },
-
- get securityOrigin()
- {
- return this._securityOrigin;
- },
-
- get url()
- {
- return this._mainResource._url;
- },
-
- get domTree()
- {
- if (!this._domTree)
- this._domTree = new WebInspector.DOMTree(this);
- return this._domTree;
- },
-
- get pageExecutionContext()
- {
- return this._executionContextList.pageExecutionContext;
- },
-
- get executionContextList()
- {
- return this._executionContextList;
- },
-
- clearExecutionContexts: function(committingProvisionalLoad)
- {
- if (this._executionContextList.contexts.length) {
- this._executionContextList.clear();
- this.dispatchEventToListeners(WebInspector.Frame.Event.ExecutionContextsCleared, {committingProvisionalLoad:!!committingProvisionalLoad});
- }
- },
-
- addExecutionContext: function(context)
- {
- var changedPageContext = this._executionContextList.add(context);
-
- if (changedPageContext)
- this.dispatchEventToListeners(WebInspector.Frame.Event.PageExecutionContextChanged);
- },
-
- get mainResource()
- {
- return this._mainResource;
- },
-
- get provisionalMainResource()
- {
- return this._provisionalMainResource;
- },
-
- get parentFrame()
- {
- return this._parentFrame;
- },
-
- get childFrames()
- {
- return this._childFrames;
- },
-
- get domContentReadyEventTimestamp()
- {
- return this._domContentReadyEventTimestamp;
- },
-
- get loadEventTimestamp()
- {
- return this._loadEventTimestamp;
- },
-
- isMainFrame: function()
- {
- return this._isMainFrame;
- },
-
- markAsMainFrame: function()
- {
- this._isMainFrame = true;
- },
-
- unmarkAsMainFrame: function()
- {
- this._isMainFrame = false;
- },
-
- markDOMContentReadyEvent: function(timestamp)
- {
- this._domContentReadyEventTimestamp = timestamp || NaN;
- },
-
- markLoadEvent: function(timestamp)
- {
- this._loadEventTimestamp = timestamp || NaN;
- },
-
- isDetached: function()
- {
- var frame = this;
- while (frame) {
- if (frame.isMainFrame())
- return false;
- frame = frame.parentFrame;
- }
-
- return true;
- },
-
- childFrameForIdentifier: function(frameId)
- {
- return this._childFrameIdentifierMap[frameId] || null;
- },
-
- addChildFrame: function(frame)
- {
- console.assert(frame instanceof WebInspector.Frame);
- if (!(frame instanceof WebInspector.Frame))
- return;
-
- if (frame._parentFrame === this)
- return;
-
- if (frame._parentFrame)
- frame._parentFrame.removeChildFrame(frame);
-
- this._childFrames.push(frame);
- this._childFrameIdentifierMap[frame._id] = frame;
-
- frame._parentFrame = this;
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.ChildFrameWasAdded, {childFrame: frame});
- },
-
- removeChildFrame: function(frameOrFrameId)
- {
- console.assert(frameOrFrameId);
-
- if (frameOrFrameId instanceof WebInspector.Frame)
- var childFrameId = frameOrFrameId._id;
- else
- var childFrameId = frameOrFrameId;
-
- // Fetch the frame by id even if we were passed a WebInspector.Frame.
- // We do this incase the WebInspector.Frame is a new object that isn't in _childFrames,
- // but the id is a valid child frame.
- var childFrame = this.childFrameForIdentifier(childFrameId);
- console.assert(childFrame instanceof WebInspector.Frame);
- if (!(childFrame instanceof WebInspector.Frame))
- return;
-
- console.assert(childFrame.parentFrame === this);
-
- this._childFrames.remove(childFrame);
- delete this._childFrameIdentifierMap[childFrame._id];
-
- childFrame._parentFrame = null;
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.ChildFrameWasRemoved, {childFrame: childFrame});
- },
-
- removeAllChildFrames: function()
- {
- if (!this._childFrames.length)
- return;
-
- for (var i = 0; i < this._childFrames.length; ++i)
- this._childFrames[i]._parentFrame = null;
-
- this._childFrames = [];
- this._childFrameIdentifierMap = {};
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.AllChildFramesRemoved);
- },
-
- get resources()
- {
- return this._resourceCollection.resources;
- },
-
- resourceForURL: function(url, recursivelySearchChildFrames)
- {
- var resource = this._resourceCollection.resourceForURL(url);
- if (resource)
- return resource;
-
- // Check the main resources of the child frames for the requested URL.
- for (var i = 0; i < this._childFrames.length; ++i) {
- resource = this._childFrames[i].mainResource;
- if (resource.url === url)
- return resource;
- }
-
- if (!recursivelySearchChildFrames)
- return null;
-
- // Recursively search resources of child frames.
- for (var i = 0; i < this._childFrames.length; ++i) {
- resource = this._childFrames[i].resourceForURL(url, true);
- if (resource)
- return resource;
- }
-
- return null;
- },
-
- resourcesWithType: function(type)
- {
- return this._resourceCollection.resourcesWithType(type);
- },
-
- addResource: function(resource)
- {
- console.assert(resource instanceof WebInspector.Resource);
- if (!(resource instanceof WebInspector.Resource))
- return;
-
- if (resource.parentFrame === this)
- return;
-
- if (resource.parentFrame)
- resource.parentFrame.removeResource(resource);
-
- this._associateWithResource(resource);
-
- if (this._isProvisionalResource(resource)) {
- this._provisionalResourceCollection.addResource(resource);
- this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalResourceWasAdded, {resource: resource});
- } else {
- this._resourceCollection.addResource(resource);
- this.dispatchEventToListeners(WebInspector.Frame.Event.ResourceWasAdded, {resource: resource});
- }
- },
-
- removeResource: function(resourceOrURL)
- {
- // This does not remove provisional resources.
-
- var resource = this._resourceCollection.removeResource(resourceOrURL);
- if (!resource)
- return;
-
- this._disassociateWithResource(resource);
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.ResourceWasRemoved, {resource: resource});
- },
-
- removeAllResources: function()
- {
- // This does not remove provisional resources, use clearProvisionalLoad for that.
-
- var resources = this.resources;
- if (!resources.length)
- return;
-
- for (var i = 0; i < resources.length; ++i)
- this._disassociateWithResource(resources[i]);
-
- this._resourceCollection.removeAllResources();
-
- this.dispatchEventToListeners(WebInspector.Frame.Event.AllResourcesRemoved);
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.Frame.MainResourceURLCookieKey] = this.mainResource.url;
- },
-
- // Private
-
- _isProvisionalResource: function(resource)
- {
- return (resource.loaderIdentifier && this._provisionalLoaderIdentifier && resource.loaderIdentifier === this._provisionalLoaderIdentifier);
- },
-
- _associateWithResource: function(resource)
- {
- console.assert(!resource._parentFrame);
- if (resource._parentFrame)
- return;
-
- resource._parentFrame = this;
- },
-
- _disassociateWithResource: function(resource)
- {
- console.assert(resource.parentFrame === this);
- if (resource.parentFrame !== this)
- return;
-
- resource._parentFrame = null;
- },
-
- _dispatchMainResourceDidChangeEvent: function(oldMainResource)
- {
- this.dispatchEventToListeners(WebInspector.Frame.Event.MainResourceDidChange, {oldMainResource: oldMainResource});
- }
-};
-
-WebInspector.Frame.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFrameContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FrameContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FrameContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FrameContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,195 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameContentView = function(frame)
-{
- WebInspector.ClusterContentView.call(this, frame);
-
- this._frame = frame;
-
- function createPathComponent(displayName, className, identifier)
- {
- var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- return pathComponent;
- }
-
- this._sourceCodePathComponent = createPathComponent.call(this, WebInspector.UIString("Source Code"), WebInspector.FrameContentView.SourceCodeIconStyleClassName, WebInspector.FrameContentView.SourceCodeIdentifier);
- this._domTreePathComponent = createPathComponent.call(this, WebInspector.UIString("DOM Tree"), WebInspector.FrameContentView.DOMTreeIconStyleClassName, WebInspector.FrameContentView.DOMTreeIdentifier);
-
- this._sourceCodePathComponent.nextSibling = this._domTreePathComponent;
- this._domTreePathComponent.previousSibling = this._sourceCodePathComponent;
-
- this.element.classList.add(WebInspector.FrameContentView.StyleClassName);
-
- this._currentContentViewSetting = new WebInspector.Setting("frame-current-view-" + this._frame.url.hash, WebInspector.FrameContentView.DOMTreeIdentifier);
-};
-
-WebInspector.FrameContentView.StyleClassName = "frame";
-WebInspector.FrameContentView.SourceCodeIconStyleClassName = "source-code-icon";
-WebInspector.FrameContentView.SourceCodeIdentifier = "source-code";
-WebInspector.FrameContentView.DOMTreeIconStyleClassName = "dom-tree-icon";
-WebInspector.FrameContentView.DOMTreeIdentifier = "dom-tree";
-
-WebInspector.FrameContentView.prototype = {
- constructor: WebInspector.FrameContentView,
-
- // Public
-
- get frame()
- {
- return this._frame;
- },
-
- get selectionPathComponents()
- {
- if (!this._contentViewContainer.currentContentView)
- return [];
-
- // Append the current view's path components to the path component representing the current view.
- var components = [this._pathComponentForContentView(this._contentViewContainer.currentContentView)];
- return components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
- },
-
- shown: function()
- {
- WebInspector.ClusterContentView.prototype.shown.call(this);
-
- if (this._shownInitialContent)
- return;
-
- this._showContentViewForIdentifier(this._currentContentViewSetting.value);
- },
-
- closed: function()
- {
- WebInspector.ClusterContentView.prototype.closed.call(this);
-
- this._shownInitialContent = false;
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.Resource;
- cookie.subview = this._currentContentViewSetting.value;
- if (!this.representedObject.isMainFrame())
- cookie.url = this.representedObject.url;
- },
-
- restoreFromCookie: function(cookie)
- {
- var shownView = this._showContentViewForIdentifier(cookie.subview);
- if ("lineNumber" in cookie && "columnNumber" in cookie)
- this.showSourceCode(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
- },
-
- showResource: function()
- {
- this._shownInitialContent = true;
-
- return this._showContentViewForIdentifier(WebInspector.FrameContentView.SourceCodeIdentifier);
- },
-
- showSourceCode: function(positionToReveal, textRangeToSelect, forceUnformatted)
- {
- var resourceContentView = this.showResource();
- console.assert(resourceContentView instanceof WebInspector.ResourceClusterContentView);
- if (!resourceContentView)
- return null;
-
- return resourceContentView.showResponse(positionToReveal, textRangeToSelect, forceUnformatted);
- },
-
- showDOMTree: function(domNodeToSelect, preventFocusChange)
- {
- this._shownInitialContent = true;
-
- var domTreeContentView = this._showContentViewForIdentifier(WebInspector.FrameContentView.DOMTreeIdentifier);
- console.assert(domTreeContentView);
- if (!domTreeContentView || !domNodeToSelect)
- return null;
-
- domTreeContentView.selectAndRevealDOMNode(domNodeToSelect, preventFocusChange);
-
- return domTreeContentView;
- },
-
- // Private
-
- _pathComponentForContentView: function(contentView)
- {
- console.assert(contentView);
- if (!contentView)
- return null;
- if (contentView.representedObject instanceof WebInspector.Resource)
- return this._sourceCodePathComponent;
- if (contentView.representedObject instanceof WebInspector.DOMTree)
- return this._domTreePathComponent;
- console.error("Unknown contentView.");
- return null;
- },
-
- _identifierForContentView: function(contentView)
- {
- console.assert(contentView);
- if (!contentView)
- return null;
- if (contentView.representedObject instanceof WebInspector.Resource)
- return WebInspector.FrameContentView.SourceCodeIdentifier;
- if (contentView.representedObject instanceof WebInspector.DOMTree)
- return WebInspector.FrameContentView.DOMTreeIdentifier;
- console.error("Unknown contentView.");
- return null;
- },
-
- _showContentViewForIdentifier: function(identifier)
- {
- var representedObjectToShow = null;
-
- switch (identifier) {
- case WebInspector.FrameContentView.SourceCodeIdentifier:
- representedObjectToShow = this._frame.mainResource;
- break;
- case WebInspector.FrameContentView.DOMTreeIdentifier:
- representedObjectToShow = this._frame.domTree;
- break;
- }
-
- console.assert(representedObjectToShow);
- if (!representedObjectToShow)
- return;
-
- this._currentContentViewSetting.value = identifier;
-
- return this.contentViewContainer.showContentViewForRepresentedObject(representedObjectToShow);
- },
-
- _pathComponentSelected: function(event)
- {
- this._showContentViewForIdentifier(event.data.pathComponent.representedObject);
- }
-};
-
-WebInspector.FrameContentView.prototype.__proto__ = WebInspector.ClusterContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFrameDOMTreeContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FrameDOMTreeContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FrameDOMTreeContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FrameDOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameDOMTreeContentView = function(domTree)
-{
- console.assert(domTree);
-
- WebInspector.DOMTreeContentView.call(this, domTree);
-
- this._domTree = domTree;
- this._domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, this._rootDOMNodeInvalidated, this);
-
- this._requestRootDOMNode();
-};
-
-
-WebInspector.FrameDOMTreeContentView.prototype = {
- constructor: WebInspector.FrameDOMTreeContentView,
- __proto__: WebInspector.DOMTreeContentView.prototype,
-
- // Public
-
- get domTree()
- {
- return this._domTree;
- },
-
- closed: function()
- {
- this._domTree.removeEventListener(null, null, this);
- WebInspector.DOMTreeContentView.prototype.closed.call(this);
- },
-
- getSearchContextNodes: function(callback)
- {
- this._domTree.requestRootDOMNode(function(rootDOMNode) {
- callback([rootDOMNode.id]);
- });
- },
-
- // Private
-
- _rootDOMNodeAvailable: function(rootDOMNode)
- {
- this.domTreeOutline.rootDOMNode = rootDOMNode;
-
- if (!rootDOMNode) {
- this.domTreeOutline.selectDOMNode(null, false);
- return;
- }
-
- this._restoreSelectedNodeAfterUpdate(this._domTree.frame.url, rootDOMNode.body || rootDOMNode.documentElement);
- },
-
- _rootDOMNodeInvalidated: function(event)
- {
- this._requestRootDOMNode();
- },
-
- _requestRootDOMNode: function()
- {
- this._domTree.requestRootDOMNode(this._rootDOMNodeAvailable.bind(this));
- }
-
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFrameResourceManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FrameResourceManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FrameResourceManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FrameResourceManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,586 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameResourceManager = function()
-{
- WebInspector.Object.call(this);
-
- if (window.PageAgent)
- PageAgent.enable();
- if (window.NetworkAgent)
- NetworkAgent.enable();
-
- this.initialize();
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.FrameResourceManager);
-
-WebInspector.FrameResourceManager.Event = {
- FrameWasAdded: "frame-resource-manager-frame-was-added",
- FrameWasRemoved: "frame-resource-manager-frame-was-removed",
- MainFrameDidChange: "frame-resource-manager-main-frame-did-change"
-};
-
-WebInspector.FrameResourceManager.prototype = {
- constructor: WebInspector.FrameResourceManager,
-
- // Public
-
- initialize: function()
- {
- var oldMainFrame = this._mainFrame;
-
- this._frameIdentifierMap = {};
- this._mainFrame = null;
- this._resourceRequestIdentifierMap = {};
-
- if (this._mainFrame !== oldMainFrame)
- this._mainFrameDidChange(oldMainFrame);
-
- this._waitingForMainFrameResourceTreePayload = true;
- if (window.PageAgent)
- PageAgent.getResourceTree(this._processMainFrameResourceTreePayload.bind(this));
- },
-
- get mainFrame()
- {
- return this._mainFrame;
- },
-
- get frames()
- {
- var frames = [];
- for (var key in this._frameIdentifierMap)
- frames.push(this._frameIdentifierMap[key]);
-
- return frames;
- },
-
- frameForIdentifier: function(frameId)
- {
- return this._frameIdentifierMap[frameId] || null;
- },
-
- frameDidNavigate: function(framePayload)
- {
- // Called from WebInspector.PageObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var frameWasLoadedInstantly = false;
-
- var frame = this.frameForIdentifier(framePayload.id);
- if (!frame) {
- // If the frame wasn't known before now, then the main resource was loaded instantly (about:blank, etc.)
- // Make a new resource (which will make the frame). Mark will mark it as loaded at the end too since we
- // don't expect any more events about the load finishing for these frames.
- var frameResource = this._addNewResourceToFrame(null, framePayload.id, framePayload.loaderId, framePayload.url, null, null, null, null, null, framePayload.name, framePayload.securityOrigin);
- frame = frameResource.parentFrame;
- frameWasLoadedInstantly = true;
-
- console.assert(frame);
- if (!frame)
- return;
- }
-
- if (framePayload.loaderId === frame.provisionalLoaderIdentifier) {
- // There was a provisional load in progress, commit it.
- frame.commitProvisionalLoad(framePayload.securityOrigin);
- } else {
- if (frame.mainResource.url !== framePayload.url || frame.loaderIdentifier !== framePayload.loaderId) {
- // Navigations like back/forward do not have provisional loads, so create a new main resource here.
- var mainResource = new WebInspector.Resource(framePayload.url, framePayload.mimeType, null, framePayload.loaderId);
- } else {
- // The main resource is already correct, so reuse it.
- var mainResource = frame.mainResource;
- }
-
- frame.initialize(framePayload.name, framePayload.securityOrigin, framePayload.loaderId, mainResource);
- }
-
- var oldMainFrame = this._mainFrame;
-
- if (framePayload.parentId) {
- var parentFrame = this.frameForIdentifier(framePayload.parentId);
- console.assert(parentFrame);
-
- if (frame === this._mainFrame)
- this._mainFrame = null;
-
- if (frame.parentFrame !== parentFrame)
- parentFrame.addChildFrame(frame);
- } else {
- if (frame.parentFrame)
- frame.parentFrame.removeChildFrame(frame);
- this._mainFrame = frame;
- }
-
- if (this._mainFrame !== oldMainFrame)
- this._mainFrameDidChange(oldMainFrame);
-
- if (frameWasLoadedInstantly)
- frame.mainResource.markAsFinished();
- },
-
- frameDidDetach: function(frameId)
- {
- // Called from WebInspector.PageObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var frame = this.frameForIdentifier(frameId);
- if (!frame)
- return;
-
- if (frame.parentFrame)
- frame.parentFrame.removeChildFrame(frame);
-
- delete this._frameIdentifierMap[frame.id];
-
- var oldMainFrame = this._mainFrame;
-
- if (frame === this._mainFrame)
- this._mainFrame = null;
-
- frame.clearExecutionContexts();
-
- this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.FrameWasRemoved, {frame: frame});
-
- if (this._mainFrame !== oldMainFrame)
- this._mainFrameDidChange(oldMainFrame);
- },
-
- resourceRequestWillBeSent: function(requestIdentifier, frameIdentifier, loaderIdentifier, request, type, redirectResponse, timestamp, initiator)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
- if (resource) {
- // This is an existing request which is being redirected, update the resource.
- console.assert(redirectResponse);
- resource.updateForRedirectResponse(request.url, request.headers, timestamp);
- return;
- }
-
- var initiatorSourceCodeLocation = this._initiatorSourceCodeLocationFromPayload(initiator);
-
- // This is a new request, make a new resource and add it to the right frame.
- resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, request.url, type, request.method, request.headers, request.postData, timestamp, null, null, initiatorSourceCodeLocation);
-
- // Associate the resource with the requestIdentifier so it can be found in future loading events.
- this._resourceRequestIdentifierMap[requestIdentifier] = resource;
- },
-
- markResourceRequestAsServedFromMemoryCache: function(requestIdentifier)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
-
- // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
- // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
- // just doesn't have a requestIdentifier for us to look it up.
- if (!resource)
- return;
-
- resource.markAsCached();
- },
-
- resourceRequestWasServedFromMemoryCache: function(requestIdentifier, frameIdentifier, loaderIdentifier, cachedResourcePayload, timestamp, initiator)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- console.assert(!(requestIdentifier in this._resourceRequestIdentifierMap));
-
- var initiatorSourceCodeLocation = this._initiatorSourceCodeLocationFromPayload(initiator);
-
- var response = cachedResourcePayload.response;
- var resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, cachedResourcePayload.url, cachedResourcePayload.type, null, null, timestamp, null, null, initiatorSourceCodeLocation);
- resource.markAsCached();
- resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, timestamp);
- resource.markAsFinished(timestamp);
-
- if (cachedResourcePayload.sourceMapURL)
- WebInspector.sourceMapManager.downloadSourceMap(cachedResourcePayload.sourceMapURL, resource.url, resource);
-
- // No need to associate the resource with the requestIdentifier, since this is the only event
- // sent for memory cache resource loads.
- },
-
- resourceRequestDidReceiveResponse: function(requestIdentifier, frameIdentifier, loaderIdentifier, type, response, timestamp)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
-
- // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
- // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
- // just doesn't have a requestIdentifier for us to look it up, but we can try to look it up by its URL.
- if (!resource) {
- var frame = this.frameForIdentifier(frameIdentifier);
- if (frame)
- resource = frame.resourceForURL(response.url);
-
- // If we find the resource this way we had marked it earlier as finished via PageAgent.getResourceTree.
- // Associate the resource with the requestIdentifier so it can be found in future loading events.
- // and roll it back to an unfinished state, we know now it is still loading.
- if (resource) {
- this._resourceRequestIdentifierMap[requestIdentifier] = resource;
- resource.revertMarkAsFinished();
- }
- }
-
- // If we haven't found an existing Resource by now, then it is a resource that was loading when the inspector
- // opened and we just missed the resourceRequestWillBeSent for it. So make a new resource and add it.
- if (!resource) {
- resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, response.url, type, null, response.requestHeaders, timestamp, null, null);
-
- // Associate the resource with the requestIdentifier so it can be found in future loading events.
- this._resourceRequestIdentifierMap[requestIdentifier] = resource;
- }
-
- if (response.fromDiskCache)
- resource.markAsCached();
-
- resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, timestamp);
- },
-
- resourceRequestDidReceiveData: function(requestIdentifier, dataLength, encodedDataLength, timestamp)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
-
- // We might not have a resource if the inspector was opened during the page load (after resourceRequestWillBeSent is called).
- // We don't want to assert in this case since we do likely have the resource, via PageAgent.getResourceTree. The Resource
- // just doesn't have a requestIdentifier for us to look it up.
- if (!resource)
- return;
-
- resource.increaseSize(dataLength, timestamp);
-
- if (encodedDataLength !== -1)
- resource.increaseTransferSize(encodedDataLength);
- },
-
- resourceRequestDidFinishLoading: function(requestIdentifier, timestamp, sourceMapURL)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- // By now we should always have the Resource. Either it was fetched when the inspector first opened with
- // PageAgent.getResourceTree, or it was a currently loading resource that we learned about in resourceRequestDidReceiveResponse.
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
- console.assert(resource);
- if (!resource)
- return;
-
- resource.markAsFinished(timestamp);
-
- if (sourceMapURL)
- WebInspector.sourceMapManager.downloadSourceMap(sourceMapURL, resource.url, resource);
-
- delete this._resourceRequestIdentifierMap[requestIdentifier];
- },
-
- resourceRequestDidFailLoading: function(requestIdentifier, canceled, timestamp)
- {
- // Called from WebInspector.NetworkObserver.
-
- // Ignore this while waiting for the whole frame/resource tree.
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- // By now we should always have the Resource. Either it was fetched when the inspector first opened with
- // PageAgent.getResourceTree, or it was a currently loading resource that we learned about in resourceRequestDidReceiveResponse.
- var resource = this._resourceRequestIdentifierMap[requestIdentifier];
- console.assert(resource);
- if (!resource)
- return;
-
- resource.markAsFailed(canceled, timestamp);
-
- if (resource === resource.parentFrame.provisionalMainResource)
- resource.parentFrame.clearProvisionalLoad();
-
- delete this._resourceRequestIdentifierMap[requestIdentifier];
- },
-
- executionContextCreated: function(contextPayload)
- {
- // Called from WebInspector.RuntimeObserver.
-
- var frame = this.frameForIdentifier(contextPayload.frameId);
- console.assert(frame);
- if (!frame)
- return;
-
- var displayName = contextPayload.name || frame.mainResource.displayName;
- var executionContext = new WebInspector.ExecutionContext(contextPayload.id, displayName, contextPayload.isPageContext, frame);
- frame.addExecutionContext(executionContext);
- },
-
- resourceForURL: function(url)
- {
- if (!this._mainFrame)
- return null;
-
- if (this._mainFrame.mainResource.url === url)
- return this._mainFrame.mainResource;
-
- return this._mainFrame.resourceForURL(url, true);
- },
-
- // Private
-
- _addNewResourceToFrame: function(requestIdentifier, frameIdentifier, loaderIdentifier, url, type, requestMethod, requestHeaders, requestData, timestamp, frameName, frameSecurityOrigin, initiatorSourceCodeLocation)
- {
- console.assert(!this._waitingForMainFrameResourceTreePayload);
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- var resource = null;
-
- var frame = this.frameForIdentifier(frameIdentifier);
- if (frame) {
- // This is a new request for an existing frame, which might be the main resource or a new resource.
- if (frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier)
- resource = frame.mainResource;
- else if (frame.provisionalMainResource && frame.provisionalMainResource.url === url && frame.provisionalLoaderIdentifier === loaderIdentifier)
- resource = frame.provisionalMainResource;
- else {
- resource = new WebInspector.Resource(url, null, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, timestamp, initiatorSourceCodeLocation);
- this._addResourceToFrame(frame, resource);
- }
- } else {
- // This is a new request for a new frame, which is always the main resource.
- resource = new WebInspector.Resource(url, null, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, timestamp, initiatorSourceCodeLocation);
- frame = new WebInspector.Frame(frameIdentifier, frameName, frameSecurityOrigin, loaderIdentifier, resource);
- this._frameIdentifierMap[frame.id] = frame;
-
- // If we don't have a main frame, assume this is it. This can change later in
- // frameDidNavigate when the parent frame is known.
- if (!this._mainFrame) {
- this._mainFrame = frame;
- this._mainFrameDidChange(null);
- }
-
- this._dispatchFrameWasAddedEvent(frame);
- }
-
- console.assert(resource);
-
- return resource;
- },
-
- _addResourceToFrame: function(frame, resource)
- {
- console.assert(!this._waitingForMainFrameResourceTreePayload);
- if (this._waitingForMainFrameResourceTreePayload)
- return;
-
- console.assert(frame);
- console.assert(resource);
-
- if (resource.loaderIdentifier !== frame.loaderIdentifier && !frame.provisionalLoaderIdentifier) {
- // This is the start of a provisional load which happens before frameDidNavigate is called.
- // This resource will be the new mainResource if frameDidNavigate is called.
- frame.startProvisionalLoad(resource);
- return;
- }
-
- // This is just another resource, either for the main loader or the provisional loader.
- console.assert(resource.loaderIdentifier === frame.loaderIdentifier || resource.loaderIdentifier === frame.provisionalLoaderIdentifier);
- frame.addResource(resource);
- },
-
- _initiatorSourceCodeLocationFromPayload: function(initiatorPayload)
- {
- if (!initiatorPayload)
- return null;
-
- var url = null;
- var lineNumber = NaN;
- var columnNumber = 0;
-
- if (initiatorPayload.stackTrace && initiatorPayload.stackTrace.length) {
- var stackTracePayload = initiatorPayload.stackTrace;
- for (var i = 0; i < stackTracePayload.length; ++i) {
- var callFramePayload = stackTracePayload[i];
- if (!callFramePayload.url || callFramePayload.url === "[native code]")
- continue;
-
- url = callFramePayload.url;
-
- // The lineNumber is 1-based, but we expect 0-based.
- lineNumber = callFramePayload.lineNumber - 1;
-
- columnNumber = callFramePayload.columnNumber;
-
- break;
- }
- } else if (initiatorPayload.url) {
- url = initiatorPayload.url;
-
- // The lineNumber is 1-based, but we expect 0-based.
- lineNumber = initiatorPayload.lineNumber - 1;
- }
-
- if (!url || isNaN(lineNumber) || lineNumber < 0)
- return null;
-
- var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
- if (!sourceCode)
- sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
-
- if (!sourceCode)
- return null;
-
- return sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
- },
-
- _processMainFrameResourceTreePayload: function(error, mainFramePayload)
- {
- console.assert(this._waitingForMainFrameResourceTreePayload);
- delete this._waitingForMainFrameResourceTreePayload;
-
- if (error) {
- console.error(JSON.stringify(error));
- return;
- }
-
- console.assert(mainFramePayload);
- console.assert(mainFramePayload.frame);
-
- this._resourceRequestIdentifierMap = {};
- this._frameIdentifierMap = {};
-
- var oldMainFrame = this._mainFrame;
-
- this._mainFrame = this._addFrameTreeFromFrameResourceTreePayload(mainFramePayload, true);
-
- if (this._mainFrame !== oldMainFrame)
- this._mainFrameDidChange(oldMainFrame);
- },
-
- _createFrame: function(payload)
- {
- // If payload.url is missing or empty then this page is likely the special empty page. In that case
- // we will just say it is "about:blank" so we have a URL, which is required for resources.
- var mainResource = new WebInspector.Resource(payload.url || "about:blank", payload.mimeType, null, payload.loaderId);
- var frame = new WebInspector.Frame(payload.id, payload.name, payload.securityOrigin, payload.loaderId, mainResource);
-
- this._frameIdentifierMap[frame.id] = frame;
-
- mainResource.markAsFinished();
-
- return frame;
- },
-
- _createResource: function(payload, framePayload)
- {
- var resource = new WebInspector.Resource(payload.url, payload.mimeType, payload.type, framePayload.loaderId);
-
- if (payload.sourceMapURL)
- WebInspector.sourceMapManager.downloadSourceMap(payload.sourceMapURL, resource.url, resource);
-
- return resource;
- },
-
- _addFrameTreeFromFrameResourceTreePayload: function(payload, isMainFrame)
- {
- var frame = this._createFrame(payload.frame);
- if (isMainFrame)
- frame.markAsMainFrame();
-
- for (var i = 0; payload.childFrames && i < payload.childFrames.length; ++i)
- frame.addChildFrame(this._addFrameTreeFromFrameResourceTreePayload(payload.childFrames[i], false));
-
- for (var i = 0; payload.resources && i < payload.resources.length; ++i) {
- var resourcePayload = payload.resources[i];
-
- // The main resource is included as a resource. We can skip it since we already created
- // a main resource when we created the Frame. The resource payload does not include anything
- // didn't already get from the frame payload.
- if (resourcePayload.type === "Document" && resourcePayload.url === payload.frame.url)
- continue;
-
- var resource = this._createResource(resourcePayload, payload);
- frame.addResource(resource);
-
- if (resourcePayload.failed || resourcePayload.canceled)
- resource.markAsFailed(resourcePayload.canceled);
- else
- resource.markAsFinished();
- }
-
- this._dispatchFrameWasAddedEvent(frame);
-
- return frame;
- },
-
- _dispatchFrameWasAddedEvent: function(frame)
- {
- this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.FrameWasAdded, {frame: frame});
- },
-
- _mainFrameDidChange: function(oldMainFrame)
- {
- if (oldMainFrame)
- oldMainFrame.unmarkAsMainFrame();
- if (this._mainFrame)
- this._mainFrame.markAsMainFrame();
- this.dispatchEventToListeners(WebInspector.FrameResourceManager.Event.MainFrameDidChange, {oldMainFrame: oldMainFrame});
- }
-};
-
-WebInspector.FrameResourceManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceFrameTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/FrameTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/FrameTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/FrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,631 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameTreeElement = function(frame, representedObject)
-{
- console.assert(frame instanceof WebInspector.Frame);
-
- WebInspector.ResourceTreeElement.call(this, frame.mainResource, representedObject || frame);
-
- this._frame = frame;
- this._newChildQueue = [];
-
- this._updateExpandedSetting();
-
- frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
- frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved, this._resourceWasRemoved, this);
- frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasAdded, this._childFrameWasAdded, this);
- frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._childFrameWasRemoved, this);
-
- frame.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, this._childContentFlowWasAdded, this);
- frame.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, this._childContentFlowWasRemoved, this);
- frame.domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, this._rootDOMNodeInvalidated, this);
-
- if (this._frame.isMainFrame()) {
- this._downloadingPage = false;
- WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveStarted, this._pageArchiveStarted, this);
- WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveEnded, this._pageArchiveEnded, this);
- }
-
- this._updateParentStatus();
- this.shouldRefreshChildren = true;
-};
-
-WebInspector.FrameTreeElement.MediumChildCountThreshold = 5;
-WebInspector.FrameTreeElement.LargeChildCountThreshold = 15;
-WebInspector.FrameTreeElement.NumberOfMediumCategoriesThreshold = 2;
-WebInspector.FrameTreeElement.NewChildQueueUpdateInterval = 500;
-
-WebInspector.FrameTreeElement.prototype = {
- constructor: WebInspector.FrameTreeElement,
-
- // Public
-
- get frame()
- {
- return this._frame;
- },
-
- descendantResourceTreeElementTypeDidChange: function(resourceTreeElement, oldType)
- {
- // Called by descendant ResourceTreeElements.
-
- // Add the tree element again, which will move it to the new location
- // based on sorting and possible folder changes.
- this._addTreeElement(resourceTreeElement);
- },
-
- descendantResourceTreeElementMainTitleDidChange: function(resourceTreeElement, oldMainTitle)
- {
- // Called by descendant ResourceTreeElements.
-
- // Add the tree element again, which will move it to the new location
- // based on sorting and possible folder changes.
- this._addTreeElement(resourceTreeElement);
- },
-
- // Overrides from SourceCodeTreeElement.
-
- updateSourceMapResources: function()
- {
- // Frames handle their own SourceMapResources.
-
- if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
- return;
-
- if (!this._frame)
- return;
-
- this._updateParentStatus();
-
- if (this.resource && this.resource.sourceMaps.length)
- this.shouldRefreshChildren = true;
- },
-
- onattach: function()
- {
- // Frames handle their own SourceMapResources.
-
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
- },
-
- // Called from ResourceTreeElement.
-
- updateStatusForMainFrame: function()
- {
- function loadedImages()
- {
- if (!this._reloadButton || !this._downloadButton)
- return;
-
- var fragment = document.createDocumentFragment("div");
- fragment.appendChild(this._downloadButton.element);
- fragment.appendChild(this._reloadButton.element);
- this.status = fragment;
-
- delete this._loadingMainFrameButtons;
- }
-
- if (this._reloadButton && this._downloadButton) {
- loadedImages.call(this);
- return;
- }
-
- if (!this._loadingMainFrameButtons) {
- this._loadingMainFrameButtons = true;
-
- var tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName);
- wrappedSVGDocument("Images/Reload.svg", null, tooltip, function(element) {
- this._reloadButton = new WebInspector.TreeElementStatusButton(element);
- this._reloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._reloadPageClicked, this);
- loadedImages.call(this);
- }.bind(this));
-
- wrappedSVGDocument("Images/DownloadArrow.svg", null, WebInspector.UIString("Download Web Archive"), function(element) {
- this._downloadButton = new WebInspector.TreeElementStatusButton(element);
- this._downloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._downloadButtonClicked, this);
- this._updateDownloadButton();
- loadedImages.call(this);
- }.bind(this));
- }
- },
-
- // Overrides from TreeElement (Private).
-
- onpopulate: function()
- {
- if (this.children.length && !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
- this._clearNewChildQueue();
-
- if (this._shouldGroupIntoFolders() && !this._groupedIntoFolders)
- this._groupedIntoFolders = true;
-
- for (var i = 0; i < this._frame.childFrames.length; ++i)
- this._addTreeElementForRepresentedObject(this._frame.childFrames[i]);
-
- for (var i = 0; i < this._frame.resources.length; ++i)
- this._addTreeElementForRepresentedObject(this._frame.resources[i]);
-
- var sourceMaps = this.resource && this.resource.sourceMaps;
- for (var i = 0; i < sourceMaps.length; ++i) {
- var sourceMap = sourceMaps[i];
- for (var j = 0; j < sourceMap.resources.length; ++j)
- this._addTreeElementForRepresentedObject(sourceMap.resources[j]);
- }
-
- var flowMap = this._frame.domTree.flowMap;
- for (var flowKey in flowMap)
- this._addTreeElementForRepresentedObject(flowMap[flowKey]);
- },
-
- onexpand: function()
- {
- this._expandedSetting.value = true;
- this._frame.domTree.requestContentFlowList();
- },
-
- oncollapse: function()
- {
- // Only store the setting if we have children, since setting hasChildren to false will cause a collapse,
- // and we only care about user triggered collapses.
- if (this.hasChildren)
- this._expandedSetting.value = false;
- },
-
- removeChildren: function()
- {
- TreeElement.prototype.removeChildren.call(this);
-
- if (this._framesFolderTreeElement)
- this._framesFolderTreeElement.removeChildren();
-
- for (var type in this._resourceFoldersTypeMap)
- this._resourceFoldersTypeMap[type].removeChildren();
-
- delete this._resourceFoldersTypeMap;
- delete this._framesFolderTreeElement;
- },
-
- // Private
-
- _updateExpandedSetting: function()
- {
- this._expandedSetting = new WebInspector.Setting("frame-expanded-" + this._frame.url.hash, this._frame.isMainFrame() ? true : false);
- if (this._expandedSetting.value)
- this.expand();
- else
- this.collapse();
- },
-
- _updateParentStatus: function()
- {
- this.hasChildren = (this._frame.resources.length || this._frame.childFrames.length || (this.resource && this.resource.sourceMaps.length));
- if (!this.hasChildren)
- this.removeChildren();
- },
-
- _mainResourceDidChange: function(event)
- {
- this._updateResource(this._frame.mainResource);
- this._updateParentStatus();
-
- this._groupedIntoFolders = false;
-
- this._clearNewChildQueue();
-
- this.removeChildren();
-
- // Change the expanded setting since the frame URL has changed. Do this before setting shouldRefreshChildren, since
- // shouldRefreshChildren will call onpopulate if expanded is true.
- this._updateExpandedSetting();
-
- if (this._frame.isMainFrame())
- this._updateDownloadButton();
-
- this.shouldRefreshChildren = true;
- },
-
- _resourceWasAdded: function(event)
- {
- this._addRepresentedObjectToNewChildQueue(event.data.resource);
- },
-
- _resourceWasRemoved: function(event)
- {
- this._removeChildForRepresentedObject(event.data.resource);
- },
-
- _childFrameWasAdded: function(event)
- {
- this._addRepresentedObjectToNewChildQueue(event.data.childFrame);
- },
-
- _childFrameWasRemoved: function(event)
- {
- this._removeChildForRepresentedObject(event.data.childFrame);
- },
-
- _childContentFlowWasAdded: function(event)
- {
- this._addRepresentedObjectToNewChildQueue(event.data.flow);
- },
-
- _childContentFlowWasRemoved: function(event)
- {
- this._removeChildForRepresentedObject(event.data.flow);
- },
-
- _rootDOMNodeInvalidated: function() {
- if (this.expanded)
- this._frame.domTree.requestContentFlowList();
- },
-
- _addRepresentedObjectToNewChildQueue: function(representedObject)
- {
- // This queue reduces flashing as resources load and change folders when their type becomes known.
-
- this._newChildQueue.push(representedObject);
- if (!this._newChildQueueTimeoutIdentifier)
- this._newChildQueueTimeoutIdentifier = setTimeout(this._populateFromNewChildQueue.bind(this), WebInspector.FrameTreeElement.NewChildQueueUpdateInterval);
- },
-
- _removeRepresentedObjectFromNewChildQueue: function(representedObject)
- {
- this._newChildQueue.remove(representedObject);
- },
-
- _populateFromNewChildQueue: function()
- {
- for (var i = 0; i < this._newChildQueue.length; ++i)
- this._addChildForRepresentedObject(this._newChildQueue[i]);
-
- this._newChildQueue = [];
- this._newChildQueueTimeoutIdentifier = null;
- },
-
- _clearNewChildQueue: function()
- {
- this._newChildQueue = [];
- if (this._newChildQueueTimeoutIdentifier) {
- clearTimeout(this._newChildQueueTimeoutIdentifier);
- this._newChildQueueTimeoutIdentifier = null;
- }
- },
-
- _addChildForRepresentedObject: function(representedObject)
- {
- console.assert(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow);
- if (!(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow))
- return;
-
- this._updateParentStatus();
-
- if (!this.treeOutline) {
- // Just mark as needing to update to avoid doing work that might not be needed.
- this.shouldRefreshChildren = true;
- return;
- }
-
- if (this._shouldGroupIntoFolders() && !this._groupedIntoFolders) {
- // Mark as needing a refresh to rebuild the tree into folders.
- this._groupedIntoFolders = true;
- this.shouldRefreshChildren = true;
- return;
- }
-
- this._addTreeElementForRepresentedObject(representedObject);
- },
-
- _removeChildForRepresentedObject: function(representedObject)
- {
- console.assert(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow);
- if (!(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow))
- return;
-
- this._removeRepresentedObjectFromNewChildQueue(representedObject);
-
- this._updateParentStatus();
-
- if (!this.treeOutline) {
- // Just mark as needing to update to avoid doing work that might not be needed.
- this.shouldRefreshChildren = true;
- return;
- }
-
- // Find the tree element for the frame by using getCachedTreeElement
- // to only get the item if it has been created already.
- var childTreeElement = this.treeOutline.getCachedTreeElement(representedObject);
- if (!childTreeElement || !childTreeElement.parent)
- return;
-
- this._removeTreeElement(childTreeElement);
- },
-
- _addTreeElementForRepresentedObject: function(representedObject)
- {
- var childTreeElement = this.treeOutline.getCachedTreeElement(representedObject);
- if (!childTreeElement) {
- if (representedObject instanceof WebInspector.SourceMapResource)
- childTreeElement = new WebInspector.SourceMapResourceTreeElement(representedObject);
- else if (representedObject instanceof WebInspector.Resource)
- childTreeElement = new WebInspector.ResourceTreeElement(representedObject);
- else if (representedObject instanceof WebInspector.Frame)
- childTreeElement = new WebInspector.FrameTreeElement(representedObject);
- else if (representedObject instanceof WebInspector.ContentFlow)
- childTreeElement = new WebInspector.ContentFlowTreeElement(representedObject);
- }
-
- this._addTreeElement(childTreeElement);
- },
-
- _addTreeElement: function(childTreeElement)
- {
- console.assert(childTreeElement);
- if (!childTreeElement)
- return;
-
- var wasSelected = childTreeElement.selected;
-
- this._removeTreeElement(childTreeElement, true, true);
-
- var parentTreeElement = this._parentTreeElementForRepresentedObject(childTreeElement.representedObject);
- if (parentTreeElement !== this && !parentTreeElement.parent)
- this._insertFolderTreeElement(parentTreeElement);
-
- this._insertResourceTreeElement(parentTreeElement, childTreeElement);
-
- if (wasSelected)
- childTreeElement.revealAndSelect(true, false, true, true);
- },
-
- _compareTreeElementsByMainTitle: function(a, b)
- {
- return a.mainTitle.localeCompare(b.mainTitle);
- },
-
- _insertFolderTreeElement: function(folderTreeElement)
- {
- console.assert(this._groupedIntoFolders);
- console.assert(!folderTreeElement.parent);
- this.insertChild(folderTreeElement, insertionIndexForObjectInListSortedByFunction(folderTreeElement, this.children, this._compareTreeElementsByMainTitle));
- },
-
- _compareResourceTreeElements: function(a, b)
- {
- if (a === b)
- return 0;
-
- var aIsResource = a instanceof WebInspector.ResourceTreeElement;
- var bIsResource = b instanceof WebInspector.ResourceTreeElement;
-
- if (aIsResource && bIsResource)
- return WebInspector.ResourceTreeElement.compareResourceTreeElements(a, b);
-
- if (!aIsResource && !bIsResource) {
- // When both components are not resources then just compare the titles.
- return a.mainTitle.localeCompare(b.mainTitle);
- }
-
- // Non-resources should appear before the resources.
- // FIXME: There should be a better way to group the elements by their type.
- return aIsResource ? 1 : -1;
- },
-
- _insertResourceTreeElement: function(parentTreeElement, childTreeElement)
- {
- console.assert(!childTreeElement.parent);
- parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, this._compareResourceTreeElements));
- },
-
- _removeTreeElement: function(childTreeElement, suppressOnDeselect, suppressSelectSibling)
- {
- var oldParent = childTreeElement.parent;
- if (!oldParent)
- return;
-
- oldParent.removeChild(childTreeElement, suppressOnDeselect, suppressSelectSibling);
-
- if (oldParent === this)
- return;
-
- console.assert(oldParent instanceof WebInspector.FolderTreeElement);
- if (!(oldParent instanceof WebInspector.FolderTreeElement))
- return;
-
- // Remove the old parent folder if it is now empty.
- if (!oldParent.children.length)
- oldParent.parent.removeChild(oldParent);
- },
-
- _folderNameForResourceType: function(type)
- {
- return WebInspector.Resource.Type.displayName(type, true);
- },
-
- _parentTreeElementForRepresentedObject: function(representedObject)
- {
- if (!this._groupedIntoFolders)
- return this;
-
- function createFolderTreeElement(type, displayName)
- {
- var folderTreeElement = new WebInspector.FolderTreeElement(displayName);
- folderTreeElement._expandedSetting = new WebInspector.Setting(type + "-folder-expanded-" + this._frame.url.hash, false);
- if (folderTreeElement._expandedSetting.value)
- folderTreeElement.expand();
- folderTreeElement.onexpand = this._folderTreeElementExpandedStateChange.bind(this);
- folderTreeElement.oncollapse = this._folderTreeElementExpandedStateChange.bind(this);
- return folderTreeElement;
- }
-
- if (representedObject instanceof WebInspector.Frame) {
- if (!this._framesFolderTreeElement)
- this._framesFolderTreeElement = createFolderTreeElement.call(this, "frames", WebInspector.UIString("Frames"));
- return this._framesFolderTreeElement;
- }
-
- if (representedObject instanceof WebInspector.ContentFlow) {
- if (!this._flowsFolderTreeElement)
- this._flowsFolderTreeElement = createFolderTreeElement.call(this, "flows", WebInspector.UIString("Flows"));
- return this._flowsFolderTreeElement;
- }
-
- if (representedObject instanceof WebInspector.Resource) {
- var folderName = this._folderNameForResourceType(representedObject.type);
- if (!folderName)
- return this;
-
- if (!this._resourceFoldersTypeMap)
- this._resourceFoldersTypeMap = {};
- if (!this._resourceFoldersTypeMap[representedObject.type])
- this._resourceFoldersTypeMap[representedObject.type] = createFolderTreeElement.call(this, representedObject.type, folderName);
- return this._resourceFoldersTypeMap[representedObject.type];
- }
-
- console.error("Unknown representedObject: ", representedObject);
- return this;
- },
-
- _folderTreeElementExpandedStateChange: function(folderTreeElement)
- {
- console.assert(folderTreeElement._expandedSetting);
- folderTreeElement._expandedSetting.value = folderTreeElement.expanded;
- },
-
- _shouldGroupIntoFolders: function()
- {
- // Already grouped into folders, keep it that way.
- if (this._groupedIntoFolders)
- return true;
-
- // Resources and Frames are grouped into folders if one of two thresholds are met:
- // 1) Once the number of medium categories passes NumberOfMediumCategoriesThreshold.
- // 2) When there is a category that passes LargeChildCountThreshold and there are
- // any resources in another category.
-
- // Folders are avoided when there is only one category or most categories are small.
-
- var numberOfSmallCategories = 0;
- var numberOfMediumCategories = 0;
- var foundLargeCategory = false;
- var frame = this._frame;
-
- function pushResourceType(type) {
- // There are some other properties on WebInspector.Resource.Type that we need to skip, like private data and functions
- if (type.charAt(0) === "_")
- return false;
-
- // Only care about the values that are strings, not functions, etc.
- var typeValue = WebInspector.Resource.Type[type];
- if (typeof typeValue !== "string")
- return false;
-
- return pushCategory(frame.resourcesWithType(typeValue).length);
- }
-
- function pushCategory(resourceCount)
- {
- if (!resourceCount)
- return false;
-
- // If this type has any resources and there is a known large category, make folders.
- if (foundLargeCategory)
- return true;
-
- // If there are lots of this resource type, then count it as a large category.
- if (resourceCount >= WebInspector.FrameTreeElement.LargeChildCountThreshold) {
- // If we already have other resources in other small or medium categories, make folders.
- if (numberOfSmallCategories || numberOfMediumCategories)
- return true;
-
- foundLargeCategory = true;
- return false;
- }
-
- // Check if this is a medium category.
- if (resourceCount >= WebInspector.FrameTreeElement.MediumChildCountThreshold) {
- // If this is the medium category that puts us over the maximum allowed, make folders.
- return ++numberOfMediumCategories >= WebInspector.FrameTreeElement.NumberOfMediumCategoriesThreshold;
- }
-
- // This is a small category.
- ++numberOfSmallCategories;
- return false;
- }
-
- // Iterate over all the available resource types.
- return pushCategory(frame.childFrames.length) || pushCategory(frame.domTree.flowsCount) || Object.keys(WebInspector.Resource.Type).some(pushResourceType);
- },
-
- _reloadPageClicked: function(event)
- {
- // Ignore cache when the shift key is pressed.
- PageAgent.reload(event.data.shiftKey);
- },
-
- _downloadButtonClicked: function(event)
- {
- WebInspector.archiveMainFrame();
- },
-
- _updateDownloadButton: function()
- {
- console.assert(this._frame.isMainFrame());
- if (!this._downloadButton)
- return;
-
- if (!PageAgent.archive) {
- this._downloadButton.hidden = true;
- return;
- }
-
- if (this._downloadingPage) {
- this._downloadButton.enabled = false;
- return;
- }
-
- this._downloadButton.enabled = WebInspector.canArchiveMainFrame();
- },
-
- _pageArchiveStarted: function(event)
- {
- this._downloadingPage = true;
- this._updateDownloadButton();
- },
-
- _pageArchiveEnded: function(event)
- {
- this._downloadingPage = false;
- this._updateDownloadButton();
- }
-};
-
-WebInspector.FrameTreeElement.prototype.__proto__ = WebInspector.ResourceTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,395 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GeneralTreeElement = function(classNames, title, subtitle, representedObject, hasChildren)
-{
- TreeElement.call(this, "", representedObject, hasChildren);
-
- this.classNames = classNames;
-
- this._tooltipHandledSeparately = false;
- this._mainTitle = title || "";
- this._subtitle = subtitle || "";
- this._status = "";
-}
-
-WebInspector.GeneralTreeElement.StyleClassName = "item";
-WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName = "disclosure-button";
-WebInspector.GeneralTreeElement.IconElementStyleClassName = "icon";
-WebInspector.GeneralTreeElement.StatusElementStyleClassName = "status";
-WebInspector.GeneralTreeElement.TitlesElementStyleClassName = "titles";
-WebInspector.GeneralTreeElement.MainTitleElementStyleClassName = "title";
-WebInspector.GeneralTreeElement.SubtitleElementStyleClassName = "subtitle";
-WebInspector.GeneralTreeElement.NoSubtitleStyleClassName = "no-subtitle";
-WebInspector.GeneralTreeElement.SmallStyleClassName = "small";
-WebInspector.GeneralTreeElement.TwoLineStyleClassName = "two-line";
-
-WebInspector.GeneralTreeElement.Event = {
- MainTitleDidChange: "general-tree-element-main-title-did-change"
-};
-
-WebInspector.GeneralTreeElement.prototype = {
- constructor: WebInspector.GeneralTreeElement,
-
- // Public
-
- get element()
- {
- return this._listItemNode;
- },
-
- get disclosureButton()
- {
- this._createElementsIfNeeded();
- return this._disclosureButton;
- },
-
- get iconElement()
- {
- this._createElementsIfNeeded();
- return this._iconElement;
- },
-
- get titlesElement()
- {
- this._createElementsIfNeeded();
- return this._titlesElement;
- },
-
- get mainTitleElement()
- {
- this._createElementsIfNeeded();
- return this._mainTitleElement;
- },
-
- get subtitleElement()
- {
- this._createElementsIfNeeded();
- this._createSubtitleElementIfNeeded();
- return this._subtitleElement;
- },
-
- get classNames()
- {
- return this._classNames;
- },
-
- set classNames(x)
- {
- if (this._listItemNode && this._classNames) {
- for (var i = 0; i < this._classNames.length; ++i)
- this._listItemNode.classList.remove(this._classNames[i]);
- }
-
- if (typeof x === "string")
- x = [x];
-
- this._classNames = x || [];
-
- if (this._listItemNode) {
- for (var i = 0; i < this._classNames.length; ++i)
- this._listItemNode.classList.add(this._classNames[i]);
- }
- },
-
- addClassName: function(className)
- {
- if (this._classNames.contains(className))
- return;
-
- this._classNames.push(className);
-
- if (this._listItemNode)
- this._listItemNode.classList.add(className);
- },
-
- removeClassName: function(className)
- {
- if (!this._classNames.contains(className))
- return;
-
- this._classNames.remove(className);
-
- if (this._listItemNode)
- this._listItemNode.classList.remove(className);
- },
-
- get small()
- {
- return this._small;
- },
-
- set small(x)
- {
- this._small = x;
-
- if (this._listItemNode) {
- if (this._small)
- this._listItemNode.classList.add(WebInspector.GeneralTreeElement.SmallStyleClassName);
- else
- this._listItemNode.classList.remove(WebInspector.GeneralTreeElement.SmallStyleClassName);
- }
- },
-
- get twoLine()
- {
- return this._twoLine;
- },
-
- set twoLine(x)
- {
- this._twoLine = x;
-
- if (this._listItemNode) {
- if (this._twoLine)
- this._listItemNode.classList.add(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
- else
- this._listItemNode.classList.remove(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
- }
- },
-
- get mainTitle()
- {
- return this._mainTitle;
- },
-
- set mainTitle(x)
- {
- this._mainTitle = x || "";
- this._updateTitleElements();
- this.didChange();
- this.dispatchEventToListeners(WebInspector.GeneralTreeElement.Event.MainTitleDidChange);
- },
-
- get subtitle()
- {
- return this._subtitle;
- },
-
- set subtitle(x)
- {
- this._subtitle = x || "";
- this._updateTitleElements();
- this.didChange();
- },
-
- get status()
- {
- return this._status;
- },
-
- set status(x)
- {
- this._status = x || "";
- this._updateStatusElement();
- },
-
- get filterableData()
- {
- return {text: [this.mainTitle, this.subtitle]};
- },
-
- get tooltipHandledSeparately()
- {
- return this._tooltipHandledSeparately;
- },
-
- set tooltipHandledSeparately(x)
- {
- this._tooltipHandledSeparately = x || false;
- },
-
- // Overrides from TreeElement (Private)
-
- isEventWithinDisclosureTriangle: function(event)
- {
- return event.target === this._disclosureButton;
- },
-
- onattach: function()
- {
- this._createElementsIfNeeded();
- this._updateTitleElements();
- this._updateStatusElement();
-
- this._listItemNode.classList.add(WebInspector.GeneralTreeElement.StyleClassName);
-
- if (this._classNames) {
- for (var i = 0; i < this._classNames.length; ++i)
- this._listItemNode.classList.add(this._classNames[i]);
- }
-
- if (this._small)
- this._listItemNode.classList.add(WebInspector.GeneralTreeElement.SmallStyleClassName);
-
- if (this._twoLine)
- this._listItemNode.classList.add(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
-
- this._listItemNode.appendChild(this._disclosureButton);
- this._listItemNode.appendChild(this._iconElement);
- this._listItemNode.appendChild(this._statusElement);
- this._listItemNode.appendChild(this._titlesElement);
-
- if (this.oncontextmenu && typeof this.oncontextmenu === "function") {
- this._boundContextMenuEventHandler = this.oncontextmenu.bind(this);
- this._listItemNode.addEventListener("contextmenu", this._boundContextMenuEventHandler, true);
- }
-
- if (!this._boundContextMenuEventHandler && this.treeOutline.oncontextmenu && typeof this.treeOutline.oncontextmenu === "function") {
- this._boundContextMenuEventHandler = function(event) { this.treeOutline.oncontextmenu(event, this); }.bind(this);
- this._listItemNode.addEventListener("contextmenu", this._boundContextMenuEventHandler, true);
- }
- },
-
- ondetach: function()
- {
- if (this._boundContextMenuEventHandler) {
- this._listItemNode.removeEventListener("contextmenu", this._boundContextMenuEventHandler, true);
- delete this._boundContextMenuEventHandler;
- }
- },
-
- onreveal: function()
- {
- if (this._listItemNode)
- this._listItemNode.scrollIntoViewIfNeeded(false);
- },
-
- // Protected
-
- callFirstAncestorFunction: function(functionName, args)
- {
- // Call the first ancestor that implements a function named functionName (if any).
- var currentNode = this.parent;
- while (currentNode) {
- if (typeof currentNode[functionName] === "function") {
- currentNode[functionName].apply(currentNode, args);
- break;
- }
-
- currentNode = currentNode.parent;
- }
- },
-
- // Private
-
- _createElementsIfNeeded: function()
- {
- if (this._createdElements)
- return;
-
- this._disclosureButton = document.createElement("button");
- this._disclosureButton.className = WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName;
-
- // Don't allow the disclosure button to be keyboard focusable. The TreeOutline is focusable and has
- // its own keybindings for toggling expand and collapse.
- this._disclosureButton.tabIndex = -1;
-
- this._iconElement = document.createElement("img");
- this._iconElement.className = WebInspector.GeneralTreeElement.IconElementStyleClassName;
-
- this._statusElement = document.createElement("div");
- this._statusElement.className = WebInspector.GeneralTreeElement.StatusElementStyleClassName;
-
- this._titlesElement = document.createElement("div");
- this._titlesElement.className = WebInspector.GeneralTreeElement.TitlesElementStyleClassName;
-
- this._mainTitleElement = document.createElement("span");
- this._mainTitleElement.className = WebInspector.GeneralTreeElement.MainTitleElementStyleClassName;
- this._titlesElement.appendChild(this._mainTitleElement);
-
- this._createdElements = true;
- },
-
- _createSubtitleElementIfNeeded: function()
- {
- if (this._subtitleElement)
- return;
-
- this._subtitleElement = document.createElement("span");
- this._subtitleElement.className = WebInspector.GeneralTreeElement.SubtitleElementStyleClassName;
- this._titlesElement.appendChild(this._subtitleElement);
- },
-
- _updateTitleElements: function()
- {
- if (!this._createdElements)
- return;
-
- if (typeof this._mainTitle === "string") {
- if (this._mainTitleElement.textContent !== this._mainTitle)
- this._mainTitleElement.textContent = this._mainTitle;
- } else if (this._mainTitle instanceof Node) {
- this._mainTitleElement.removeChildren();
- this._mainTitleElement.appendChild(this._mainTitle);
- }
-
- if (typeof this._subtitle === "string" && this._subtitle) {
- this._createSubtitleElementIfNeeded();
- if (this._subtitleElement.textContent !== this._subtitle)
- this._subtitleElement.textContent = this._subtitle;
- this._titlesElement.classList.remove(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName);
- } else if (this._subtitle instanceof Node) {
- this._createSubtitleElementIfNeeded();
- this._subtitleElement.removeChildren();
- this._subtitleElement.appendChild(this._subtitle);
- } else {
- if (this._subtitleElement)
- this._subtitleElement.textContent = "";
- this._titlesElement.classList.add(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName);
- }
-
- // Set a default tooltip if there isn't a custom one already assigned.
- if (!this.tooltip && !this._tooltipHandledSeparately) {
- console.assert(this._listItemNode);
-
- // Get the textContent for the elements since they can contain other nodes,
- // and the tool tip only cares about the text.
- var mainTitleText = this._mainTitleElement.textContent;
- var subtitleText = this._subtitleElement ? this._subtitleElement.textContent : "";
-
- if (mainTitleText && subtitleText)
- this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText;
- else if (mainTitleText)
- this._listItemNode.title = mainTitleText;
- else
- this._listItemNode.title = subtitleText;
- }
- },
-
- _updateStatusElement: function()
- {
- if (!this._createdElements)
- return;
-
- if (this._status instanceof Node) {
- this._statusElement.removeChildren();
- this._statusElement.appendChild(this._status);
- } else
- this._statusElement.textContent = this._status;
- }
-}
-
-WebInspector.GeneralTreeElement.prototype.__proto__ = TreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementPathComponentjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElementPathComponent.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElementPathComponent.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElementPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GeneralTreeElementPathComponent = function(generalTreeElement, representedObject) {
- WebInspector.HierarchicalPathComponent.call(this, generalTreeElement.mainTitle, generalTreeElement.classNames, representedObject || generalTreeElement.representedObject);
-
- this._generalTreeElement = generalTreeElement;
- generalTreeElement.addEventListener(WebInspector.GeneralTreeElement.Event.MainTitleDidChange, this._mainTitleDidChange, this);
-};
-
-WebInspector.GeneralTreeElementPathComponent.prototype = {
- constructor: WebInspector.GeneralTreeElementPathComponent,
-
- // Public
-
- get generalTreeElement()
- {
- return this._generalTreeElement;
- },
-
- get previousSibling()
- {
- var previousSibling = this._generalTreeElement.previousSibling;
- while (previousSibling && previousSibling.hidden)
- previousSibling = previousSibling.previousSibling;
-
- if (!previousSibling)
- return null;
-
- return new WebInspector.GeneralTreeElementPathComponent(previousSibling);
- },
-
- get nextSibling()
- {
- var nextSibling = this._generalTreeElement.nextSibling;
- while (nextSibling && nextSibling.hidden)
- nextSibling = nextSibling.nextSibling;
-
- if (!nextSibling)
- return null;
-
- return new WebInspector.GeneralTreeElementPathComponent(nextSibling);
- },
-
- // Private
-
- _mainTitleDidChange: function(event)
- {
- this.displayName = this._generalTreeElement.mainTitle;
- }
-};
-
-WebInspector.GeneralTreeElementPathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGenericResourceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GenericResourceContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GenericResourceContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GenericResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GenericResourceContentView = function(resource)
-{
- WebInspector.ResourceContentView.call(this, resource, WebInspector.GenericResourceContentView.StyleClassName);
-};
-
-WebInspector.GenericResourceContentView.StyleClassName = "generic";
-
-WebInspector.GenericResourceContentView.prototype = {
- constructor: WebInspector.GenericResourceContentView
-};
-
-WebInspector.GenericResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGeometryjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Geometry.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Geometry.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Geometry.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,306 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Point = function(x, y)
-{
- this.x = x || 0;
- this.y = y || 0;
-};
-
-WebInspector.Point.fromEvent = function(event)
-{
- return new WebInspector.Point(event.pageX, event.pageY);
-};
-
-WebInspector.Point.fromEventInElement = function(event, element)
-{
- var wkPoint = window.webkitConvertPointFromPageToNode(element, new WebKitPoint(event.pageX, event.pageY));
- return new WebInspector.Point(wkPoint.x, wkPoint.y);
-};
-
-WebInspector.Point.prototype = {
- constructor: WebInspector.Point,
-
- toString : function()
- {
- return "WebInspector.Point[" + this.x + "," + this.y + "]";
- },
-
- copy: function()
- {
- return new WebInspector.Point(this.x, this.y);
- },
-
- equals: function(anotherPoint)
- {
- return (this.x === anotherPoint.x && this.y === anotherPoint.y);
- }
-};
-
-WebInspector.Size = function(width, height)
-{
- this.width = width || 0;
- this.height = height || 0;
-};
-
-WebInspector.Size.prototype = {
- constructor: WebInspector.Size,
-
- toString: function()
- {
- return "WebInspector.Size[" + this.width + "," + this.height + "]";
- },
-
- copy: function()
- {
- return new WebInspector.Size(this.width, this.height);
- },
-
- equals: function(anotherSize)
- {
- return (this.width === anotherSize.width && this.height === anotherSize.height);
- }
-};
-
-WebInspector.Size.ZERO_SIZE = new WebInspector.Size(0, 0);
-
-
-WebInspector.Rect = function(x, y, width, height)
-{
- this.origin = new WebInspector.Point(x || 0, y || 0);
- this.size = new WebInspector.Size(width || 0, height || 0);
-};
-
-WebInspector.Rect.rectFromClientRect = function(clientRect)
-{
- return new WebInspector.Rect(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
-};
-
-WebInspector.Rect.unionOfRects = function(rects)
-{
- var union = rects[0];
- for (var i = 1; i < rects.length; ++i)
- union = union.unionWithRect(rects[i]);
- return union;
-};
-
-WebInspector.Rect.prototype = {
- constructor: WebInspector.Rect,
-
- toString: function()
- {
- return "WebInspector.Rect[" + [this.origin.x, this.origin.y, this.size.width, this.size.height].join(", ") + "]";
- },
-
- copy: function()
- {
- return new WebInspector.Rect(this.origin.x, this.origin.y, this.size.width, this.size.height);
- },
-
- equals: function(anotherRect)
- {
- return (this.origin.equals(anotherRect.origin) && this.size.equals(anotherRect.size));
- },
-
- inset: function(insets)
- {
- return new WebInspector.Rect(
- this.origin.x + insets.left,
- this.origin.y + insets.top,
- this.size.width - insets.left - insets.right,
- this.size.height - insets.top - insets.bottom
- );
- },
-
- pad: function(padding)
- {
- return new WebInspector.Rect(
- this.origin.x - padding,
- this.origin.y - padding,
- this.size.width + padding * 2,
- this.size.height + padding * 2
- );
- },
-
- minX: function()
- {
- return this.origin.x;
- },
-
- minY: function()
- {
- return this.origin.y;
- },
-
- midX: function()
- {
- return this.origin.x + (this.size.width / 2);
- },
-
- midY: function()
- {
- return this.origin.y + (this.size.height / 2);
- },
-
- maxX: function()
- {
- return this.origin.x + this.size.width;
- },
-
- maxY: function()
- {
- return this.origin.y + this.size.height;
- },
-
- intersectionWithRect: function(rect)
- {
- var x1 = Math.max(this.minX(), rect.minX());
- var x2 = Math.min(this.maxX(), rect.maxX());
- if (x1 > x2)
- return WebInspector.Rect.ZERO_RECT;
- var intersection = new WebInspector.Rect;
- intersection.origin.x = x1;
- intersection.size.width = x2 - x1;
- var y1 = Math.max(this.minY(), rect.minY());
- var y2 = Math.min(this.maxY(), rect.maxY());
- if (y1 > y2)
- return WebInspector.Rect.ZERO_RECT;
- intersection.origin.y = y1;
- intersection.size.height = y2 - y1;
- return intersection;
- },
-
- unionWithRect: function(rect)
- {
- var x = Math.min(this.minX(), rect.minX());
- var y = Math.min(this.minY(), rect.minY());
- var width = Math.max(this.maxX(), rect.maxX()) - x;
- var height = Math.max(this.maxY(), rect.maxY()) - y;
- return new WebInspector.Rect(x, y, width, height);
- },
-
- round: function()
- {
- return new WebInspector.Rect(
- Math.floor(this.origin.x),
- Math.floor(this.origin.y),
- Math.ceil(this.size.width),
- Math.ceil(this.size.height)
- );
- }
-};
-
-WebInspector.Rect.ZERO_RECT = new WebInspector.Rect(0, 0, 0, 0);
-
-
-WebInspector.EdgeInsets = function(top, right, bottom, left)
-{
- console.assert(arguments.length === 1 || arguments.length === 4);
-
- if (arguments.length === 1) {
- this.top = top;
- this.right = top;
- this.bottom = top;
- this.left = top;
- } else if (arguments.length === 4) {
- this.top = top;
- this.right = right;
- this.bottom = bottom;
- this.left = left;
- }
-};
-
-WebInspector.EdgeInsets.prototype = {
- constructor: WebInspector.EdgeInsets,
-
- equals: function(anotherInset)
- {
- return (this.top === anotherInset.top && this.right === anotherInset.right &&
- this.bottom === anotherInset.bottom && this.left === anotherInset.left);
- },
-
- copy: function()
- {
- return new WebInspector.EdgeInsets(this.top, this.right, this.bottom, this.left);
- }
-};
-
-WebInspector.RectEdge = {
- MIN_X : 0,
- MIN_Y : 1,
- MAX_X : 2,
- MAX_Y : 3
-};
-
-WebInspector.Quad = function(quad)
-{
- this.points = [
- new WebInspector.Point(quad[0], quad[1]), // top left
- new WebInspector.Point(quad[2], quad[3]), // top right
- new WebInspector.Point(quad[4], quad[5]), // bottom right
- new WebInspector.Point(quad[6], quad[7]) // bottom left
- ];
-
- this.width = Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));
- this.height = Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));
-};
-
-WebInspector.Quad.prototype = {
- constructor: WebInspector.Quad,
-
- toProtocol: function()
- {
- return [
- this.points[0].x, this.points[0].y,
- this.points[1].x, this.points[1].y,
- this.points[2].x, this.points[2].y,
- this.points[3].x, this.points[3].y
- ];
- }
-};
-
-WebInspector.Polygon = function(points)
-{
- this.points = points;
-}
-
-WebInspector.Polygon.prototype = {
- constructor: WebInspector.Polygon,
-
- bounds: function()
- {
- var minX = Number.MAX_VALUE;
- var minY = Number.MAX_VALUE;
- var maxX = -Number.MAX_VALUE;
- var maxY = -Number.MAX_VALUE;
- for (var point of this.points) {
- minX = Math.min(minX, point.x);
- maxX = Math.max(maxX, point.x);
- minY = Math.min(minY, point.y);
- maxY = Math.max(maxY, point.y);
- }
- return new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGoToLineDialogcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.go-to-line-dialog {
- position: relative;
- left: 50%;
- top: 50px;
- width: calc(100% - 40px);
- max-width: 452px;
- height: 38px;
- -webkit-transform: translate(-50%, -50%);
- padding: 3px;
- border-radius: 5px;
- background-color: rgba(232, 232, 232, 0.95);
- border: 1px rgb(218, 218, 218) solid;
- box-shadow: 1px 5px 20px 3px rgba(0, 0, 0, 0.33);
-}
-
-.go-to-line-dialog > div {
- width: 100%;
- height: 100%;
- border-radius: 4px;
- background-color: white;
- border: 1px rgb(206, 206, 206) solid;
-}
-
-.go-to-line-dialog > div > input {
- position: absolute;
- left: 2px;
- right: 36px;
- border: none;
- background-color: transparent;
- font-family: "Lucida Grande", sans-serif;
- font-size: 20px;
- color: rgb(12, 12, 12);
- padding: 0 0 1px 5px;
- outline: none;
-}
-
-.go-to-line-dialog > div > input::-webkit-input-placeholder {
- color: rgb(133, 133, 133);
-}
-
-.go-to-line-dialog > div > img {
- position: absolute;
- top: 9px;
- right: 12px;
- padding: 2px;
- border-radius: 9px;
- width: 18px;
- height: 18px;
- background-color: rgb(188, 188, 188);
- display: none;
- content: url(Images/CloseWhite.svg);
-}
-
-.go-to-line-dialog > div > img:active {
- background-color: rgb(140, 140, 140);
-}
-
-.go-to-line-dialog.non-empty > div > img {
- display: block;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGoToLineDialogjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,159 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GoToLineDialog = function()
-{
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.GoToLineDialog.StyleClassName;
-
- var field = this._element.appendChild(document.createElement("div"));
-
- this._input = field.appendChild(document.createElement("input"));
- this._input.type = "text";
- this._input.placeholder = WebInspector.UIString("Line Number");
- this._input.spellcheck = false;
-
- this._clearIcon = field.appendChild(document.createElement("img"));
-
- this._input.addEventListener("input", this);
- this._input.addEventListener("keydown", this);
- this._input.addEventListener("blur", this);
- this._clearIcon.addEventListener("mousedown", this);
- this._clearIcon.addEventListener("click", this);
-}
-
-WebInspector.GoToLineDialog.StyleClassName = "go-to-line-dialog";
-WebInspector.GoToLineDialog.NonEmptyClassName = "non-empty";
-
-WebInspector.GoToLineDialog.prototype = {
- constructor: WebInspector.GoToLineDialog,
-
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- present: function(parent)
- {
- parent.appendChild(this._element);
- this._input.focus();
- this._clear();
- },
-
- dismiss: function()
- {
- var parent = this._element.parentNode;
- if (!parent)
- return;
-
- parent.removeChild(this._element);
-
- if (this.delegate && typeof this.delegate.goToLineDialogWasDismissed === "function")
- this.delegate.goToLineDialogWasDismissed(this);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "input":
- this._handleInputEvent(event);
- break;
- case "keydown":
- this._handleKeydownEvent(event);
- break;
- case "blur":
- this._handleBlurEvent(event);
- break;
- case "mousedown":
- this._handleMousedownEvent(event);
- break;
- case "click":
- this._handleClickEvent(event);
- break;
- }
- },
-
- // Private
-
- _handleInputEvent: function(event)
- {
- if (this._input.value === "")
- this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
- else
- this._element.classList.add(WebInspector.GoToLineDialog.NonEmptyClassName);
- },
-
- _handleKeydownEvent: function(event)
- {
- if (event.keyCode === WebInspector.KeyboardShortcut.Key.Escape.keyCode) {
- if (this._input.value === "")
- this.dismiss();
- else
- this._clear();
- } else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Enter.keyCode) {
- var value = parseInt(this._input.value, 10);
-
- var valueIsValid = false;
- if (this.delegate && typeof this.delegate.isGoToLineDialogValueValid === "function")
- valueIsValid = this.delegate.isGoToLineDialogValueValid(this, value);
-
- if (valueIsValid && this.delegate && typeof this.delegate.goToLineDialogValueWasValidated === "function") {
- this.delegate.goToLineDialogValueWasValidated(this, value);
- this.dismiss();
- return;
- }
-
- this._input.select();
- InspectorFrontendHost.beep();
- }
- },
-
- _handleBlurEvent: function(event)
- {
- this.dismiss();
- },
-
- _handleMousedownEvent: function(event)
- {
- this._input.select();
- // This ensures we don't get a "blur" event triggered for the text field
- // which would end up dimissing the dialog, which is not the intent.
- event.preventDefault();
- },
-
- _handleClickEvent: function(event)
- {
- this._clear();
- },
-
- _clear: function()
- {
- this._input.value = "";
- this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGradientjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Gradient.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Gradient.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Gradient.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,269 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Gradient = {
- Types : {
- Linear: "linear-gradient",
- Radial: "radial-gradient"
- },
-
- fromString: function(cssString)
- {
- var type;
- var openingParenthesisIndex = cssString.indexOf("(");
- var typeString = cssString.substring(0, openingParenthesisIndex);
- if (typeString.indexOf(WebInspector.Gradient.Types.Linear) !== -1)
- type = WebInspector.Gradient.Types.Linear;
- else if (typeString.indexOf(WebInspector.Gradient.Types.Radial) !== -1)
- type = WebInspector.Gradient.Types.Radial;
- else {
- console.error("Couldn't parse angle \"" + typeString + "\"");
- return null;
- }
-
- var components = [];
- var currentParams = [];
- var currentParam = "";
- var openParentheses = 0;
- var ch = openingParenthesisIndex + 1;
- while (c = cssString[ch]) {
- if (c === "(")
- openParentheses++;
- if (c === ")")
- openParentheses--;
-
- var isComma = c === ",";
- var isSpace = /\s/.test(c);
-
- if (openParentheses === 0) {
- if (isSpace) {
- if (currentParam !== "")
- currentParams.push(currentParam);
- currentParam = "";
- } else if (isComma) {
- currentParams.push(currentParam);
- components.push(currentParams);
- currentParams = [];
- currentParam = "";
- }
- }
-
- if (openParentheses === -1) {
- currentParams.push(currentParam);
- components.push(currentParams);
- break;
- }
-
- if (openParentheses > 0 || (!isComma && !isSpace))
- currentParam += c;
-
- ch++;
- }
-
- var gradient;
- if (type === WebInspector.Gradient.Types.Linear)
- gradient = WebInspector.LinearGradient.linearGradientWithComponents(components);
- else
- gradient = WebInspector.RadialGradient.radialGradientWithComponents(components);
-
- if (gradient)
- gradient.repeats = typeString.indexOf("repeating") === 0;
-
- return gradient;
- },
-
- stopsWithComponents: function(components)
- {
- // FIXME: handle lengths.
- var stops = components.map(function(component) {
- while (component.length) {
- var color = WebInspector.Color.fromString(component.shift());
- if (!color)
- continue;
-
- var stop = {color: color};
- if (component.length && component[0].substr(-1) === "%")
- stop.offset = parseFloat(component.shift()) / 100;
- return stop;
- }
- });
-
- if (!stops.length) {
- console.error("Couldn't parse any stops");
- return null;
- }
-
- for (var i = 0, count = stops.length; i < count; ++i) {
- var stop = stops[i];
- if (!stop.offset)
- stop.offset = i / (count - 1);
- }
-
- return stops;
- },
-
- stringFromStops: function(stops)
- {
- var count = stops.length - 1;
- return stops.map(function(stop, index) {
- var str = stop.color;
- if (stop.offset !== index / count)
- str += " " + Math.round(stop.offset * 10000) / 100 + "%";
- return str;
- }).join(", ");
- }
-};
-
-WebInspector.LinearGradient = function(angle, stops)
-{
- this.type = WebInspector.Gradient.Types.Linear;
- this.angle = angle;
- this.stops = stops;
-}
-
-WebInspector.LinearGradient.linearGradientWithComponents = function(components)
-{
- var angle = 180;
-
- if (components[0].length === 1 && components[0][0].substr(-3) === "deg") {
- angle = (parseFloat(components[0][0]) % 360 + 360) % 360;
- components.shift();
- } else if (components[0][0] === "to") {
- components[0].shift();
- switch (components[0].sort().join(" ")) {
- case "top":
- angle = 0;
- break;
- case "right top":
- angle = 45;
- break;
- case "right":
- angle = 90;
- break;
- case "bottom right":
- angle = 135;
- break;
- case "bottom":
- angle = 180;
- break;
- case "bottom left":
- angle = 225;
- break;
- case "left":
- angle = 270;
- break;
- case "left top":
- angle = 315;
- break;
- default:
- console.error("Couldn't parse angle \"to " + components[0].join(" ") + "\"");
- return null;
- }
- components.shift();
- }
-
- var stops = WebInspector.Gradient.stopsWithComponents(components);
- if (!stops)
- return null;
-
- return new WebInspector.LinearGradient(angle, stops);
-}
-
-WebInspector.LinearGradient.prototype = {
- constructor: WebInspector.LinearGradient,
-
- copy: function()
- {
- return new WebInspector.LinearGradient(this.angle, this.stops.concat());
- },
-
- toString: function()
- {
- var str = "";
-
- if (this.angle === 0)
- str += "to top";
- else if (this.angle === 45)
- str += "to top right";
- else if (this.angle === 90)
- str += "to right";
- else if (this.angle === 135)
- str += "to bottom right";
- else if (this.angle === 225)
- str += "to bottom left";
- else if (this.angle === 270)
- str += "to left";
- else if (this.angle === 315)
- str += "to top left";
- else if (this.angle !== 180)
- str += this.angle + "deg";
-
- if (str !== "")
- str += ", ";
-
- str += WebInspector.Gradient.stringFromStops(this.stops);
-
- return (this.repeats ? "repeating-" : "") + this.type + "(" + str + ")";
- }
-}
-
-WebInspector.RadialGradient = function(sizing, stops)
-{
- this.type = WebInspector.Gradient.Types.Radial;
- this.sizing = sizing;
- this.stops = stops;
-}
-
-WebInspector.RadialGradient.radialGradientWithComponents = function(components)
-{
- var sizing = !WebInspector.Color.fromString(components[0].join(" ")) ? components.shift().join(" ") : "";
-
- var stops = WebInspector.Gradient.stopsWithComponents(components);
- if (!stops)
- return null;
-
- return new WebInspector.RadialGradient(sizing, stops);
-}
-
-WebInspector.RadialGradient.prototype = {
- constructor: WebInspector.RadialGradient,
-
- copy: function()
- {
- return new WebInspector.RadialGradient(this.sizing, this.stops.concat());
- },
-
- toString: function()
- {
- var str = this.sizing;
-
- if (str !== "")
- str += ", ";
-
- str += WebInspector.Gradient.stringFromStops(this.stops);
-
- return (this.repeats ? "repeating-" : "") + this.type + "(" + str + ")";
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGradientSlidercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GradientSlider.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GradientSlider.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GradientSlider.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,106 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-.gradient-slider {
- position: absolute;
-
- left: 26px;
- width: 238px;
- height: 21px;
-
- border: 1px solid rgb(146, 146, 146);
-}
-
-.gradient-slider > canvas {
- position: absolute;
- width: 100%;
- height: 100%;
-
- background-image: url(Images/Checkers.svg);
- background-size: 6px 6px;
-}
-
-.gradient-slider > .add-area {
- position: absolute;
-
- top: 14px;
- left: 0;
- height: 20px;
- width: 100%;
-}
-
-.gradient-slider-knob {
- position: absolute;
-
- left: -11px;
- top: 10px;
- width: 20px;
- height: 26px;
-
- background-image: -webkit-image-set(url(Images/GradientStop.png) 1x, url(Images/GradientStop@2x.png) 2x);
-
- transition: opacity 350ms;
-}
-
-.gradient-slider-knob.shadow {
- opacity: 0.5;
- pointer-events: none;
-}
-
-.gradient-slider-knob.selected {
- background-image: -webkit-image-set(url(Images/GradientStopSelected.png) 1x, url(Images/GradientStopSelected@2x.png) 2x);
-}
-
-.gradient-slider-knob.detaching {
- opacity: 0.75;
-}
-
-.gradient-slider-knob.fade-out {
- transition: opacity 0.35s;
- opacity: 0;
-}
-
-.gradient-slider-knob > img,
-.gradient-slider-knob > div {
- position: absolute;
-
- left: 5px;
- top: 12px;
- width: 10px;
- height: 10px;
-}
-
-.gradient-slider-knob > img {
- content: url(Images/Checkers.svg);
-}
-
-.gradient-slider-knob > div {
- border: 1px solid rgba(0, 0, 0, 0.25);
-
- background-color: white;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceGradientSliderjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/GradientSlider.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/GradientSlider.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/GradientSlider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,450 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.GradientSlider = function(delegate)
-{
- this.delegate = delegate;
-
- this._element = null;
- this._stops = [];
- this._knobs = [];
-
- this._selectedKnob = null;
- this._canvas = document.createElement("canvas");
-
- this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
-}
-
-WebInspector.GradientSlider.Width = 238;
-WebInspector.GradientSlider.Height = 19;
-
-WebInspector.GradientSlider.StyleClassName = "gradient-slider";
-WebInspector.GradientSlider.AddAreaClassName = "add-area";
-WebInspector.GradientSlider.DetachingClassName = "detaching";
-WebInspector.GradientSlider.ShadowClassName = "shadow";
-
-WebInspector.GradientSlider.prototype = {
- constructor: WebInspector.GradientSlider,
-
- // Public
-
- get element()
- {
- if (!this._element) {
- this._element = document.createElement("div");
- this._element.className = WebInspector.GradientSlider.StyleClassName;
- this._element.appendChild(this._canvas);
-
- this._addArea = this._element.appendChild(document.createElement("div"));
- this._addArea.addEventListener("mouseover", this);
- this._addArea.addEventListener("mousemove", this);
- this._addArea.addEventListener("mouseout", this);
- this._addArea.addEventListener("click", this);
- this._addArea.className = WebInspector.GradientSlider.AddAreaClassName;
- }
- return this._element;
- },
-
- get stops()
- {
- return this._stops;
- },
-
- set stops(stops)
- {
- this._stops = stops;
-
- this._updateStops();
- },
-
- get selectedStop()
- {
- return this._selectedKnob ? this._selectedKnob.stop : null;
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mouseover":
- this._handleMouseover(event);
- break;
- case "mousemove":
- this._handleMousemove(event);
- break;
- case "mouseout":
- this._handleMouseout(event);
- break;
- case "click":
- this._handleClick(event);
- break;
- }
- },
-
- handleKeydownEvent: function(event)
- {
- if (!this._keyboardShortcutEsc.matchesEvent(event) || !this._selectedKnob || !this._selectedKnob.selected)
- return false;
-
- this._selectedKnob.selected = false;
-
- return true;
- },
-
- knobXDidChange: function(knob)
- {
- knob.stop.offset = knob.x / WebInspector.GradientSlider.Width;
- this._sortStops();
- this._updateCanvas();
- },
-
- knobCanDetach: function(knob)
- {
- return this._knobs.length > 2;
- },
-
- knobWillDetach: function(knob)
- {
- knob.element.classList.add(WebInspector.GradientSlider.DetachingClassName);
-
- this._stops.remove(knob.stop);
- this._knobs.remove(knob);
- this._sortStops();
- this._updateCanvas();
- },
-
- knobSelectionChanged: function(knob)
- {
- if (this._selectedKnob && this._selectedKnob !== knob && knob.selected)
- this._selectedKnob.selected = false;
-
- this._selectedKnob = knob.selected ? knob : null;
-
- if (this.delegate && typeof this.delegate.gradientSliderStopWasSelected === "function")
- this.delegate.gradientSliderStopWasSelected(this, knob.stop);
-
- if (this._selectedKnob)
- WebInspector.addWindowKeydownListener(this);
- else
- WebInspector.removeWindowKeydownListener(this);
- },
-
- // Private
-
- _handleMouseover: function(event)
- {
- this._updateShadowKnob(event);
- },
-
- _handleMousemove: function(event)
- {
- this._updateShadowKnob(event);
- },
-
- _handleMouseout: function(event)
- {
- if (!this._shadowKnob)
- return;
-
- this._shadowKnob.element.remove();
- delete this._shadowKnob;
- },
-
- _handleClick: function(event)
- {
- this._updateShadowKnob(event);
-
- this._knobs.push(this._shadowKnob);
-
- this._shadowKnob.element.classList.remove(WebInspector.GradientSlider.ShadowClassName);
-
- var stop = {offset: this._shadowKnob.x / WebInspector.GradientSlider.Width, color: this._shadowKnob.wellColor};
- this._stops.push(stop);
- this._sortStops();
- this._updateStops();
-
- this._knobs[this._stops.indexOf(stop)].selected = true;
-
- delete this._shadowKnob;
- },
-
- _updateShadowKnob: function(event)
- {
- if (!this._shadowKnob) {
- this._shadowKnob = new WebInspector.GradientSliderKnob(this);
- this._shadowKnob.element.classList.add(WebInspector.GradientSlider.ShadowClassName);
- this.element.appendChild(this._shadowKnob.element);
- }
-
- this._shadowKnob.x = window.webkitConvertPointFromPageToNode(this.element, new WebKitPoint(event.pageX, event.pageY)).x;
-
- var colorData = this._canvas.getContext("2d").getImageData(this._shadowKnob.x - 1, 0, 1, 1).data;
- this._shadowKnob.wellColor = new WebInspector.Color(WebInspector.Color.Format.RGB, [colorData[0], colorData[1], colorData[2], colorData[3] / 255]);
- },
-
- _sortStops: function()
- {
- this._stops.sort(function(a, b) {
- return a.offset - b.offset;
- });
- },
-
- _updateStops: function()
- {
- this._updateCanvas();
- this._updateKnobs();
- },
-
- _updateCanvas: function()
- {
- var w = WebInspector.GradientSlider.Width;
- var h = WebInspector.GradientSlider.Height;
-
- this._canvas.width = w;
- this._canvas.height = h;
-
- var ctx = this._canvas.getContext("2d");
- var gradient = ctx.createLinearGradient(0, 0, w, 0);
- for (var stop of this._stops)
- gradient.addColorStop(stop.offset, stop.color);
-
- ctx.clearRect(0, 0, w, h);
- ctx.fillStyle = gradient;
- ctx.fillRect(0, 0, w, h);
-
- if (this.delegate && typeof this.delegate.gradientSliderStopsDidChange === "function")
- this.delegate.gradientSliderStopsDidChange(this);
- },
-
- _updateKnobs: function()
- {
- var selectedStop = this._selectedKnob ? this._selectedKnob.stop : null;
-
- while (this._knobs.length > this._stops.length)
- this._knobs.pop().element.remove();
-
- while (this._knobs.length < this._stops.length) {
- var knob = new WebInspector.GradientSliderKnob(this);
- this.element.appendChild(knob.element);
- this._knobs.push(knob);
- }
-
- for (var i = 0; i < this._stops.length; ++i) {
- var stop = this._stops[i];
- var knob = this._knobs[i];
-
- knob.stop = stop;
- knob.x = Math.round(stop.offset * WebInspector.GradientSlider.Width);
- knob.selected = stop === selectedStop;
- }
- }
-}
-
-WebInspector.GradientSliderKnob = function(delegate)
-{
- this._x = 0;
- this._y = 0;
- this._stop = null;
-
- this.delegate = delegate;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.GradientSliderKnob.StyleClassName;
-
- // Checkers pattern.
- this._element.appendChild(document.createElement("img"));
-
- this._well = this._element.appendChild(document.createElement("div"));
-
- this._element.addEventListener("mousedown", this);
-};
-
-WebInspector.GradientSliderKnob.StyleClassName = "gradient-slider-knob";
-WebInspector.GradientSliderKnob.SelectedClassName = "selected";
-WebInspector.GradientSliderKnob.FadeOutClassName = "fade-out";
-
-WebInspector.GradientSliderKnob.prototype = {
- constructor: WebInspector.GradientSliderKnob,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get stop()
- {
- return this._stop;
- },
-
- set stop(stop)
- {
- this.wellColor = stop.color;
- this._stop = stop;
- },
-
- get x()
- {
- return this._x;
- },
-
- set x(x) {
- this._x = x;
- this._updateTransform();
- },
-
- get y()
- {
- return this._x;
- },
-
- set y(y) {
- this._y = y;
- this._updateTransform();
- },
-
- get wellColor(color)
- {
- return this._wellColor;
- },
-
- set wellColor(color)
- {
- this._wellColor = color;
- this._well.style.backgroundColor = color;
- },
-
- get selected()
- {
- return this._element.classList.contains(WebInspector.GradientSliderKnob.SelectedClassName);
- },
-
- set selected(selected)
- {
- if (this.selected === selected)
- return;
-
- this._element.classList.toggle(WebInspector.GradientSliderKnob.SelectedClassName, selected);
-
- if (this.delegate && typeof this.delegate.knobSelectionChanged === "function")
- this.delegate.knobSelectionChanged(this);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- event.preventDefault();
- event.stopPropagation();
-
- switch (event.type) {
- case "mousedown":
- this._handleMousedown(event);
- break;
- case "mousemove":
- this._handleMousemove(event);
- break;
- case "mouseup":
- this._handleMouseup(event);
- break;
- case "transitionend":
- this._handleTransitionEnd(event);
- break;
- }
- },
-
- // Private
-
- _handleMousedown: function(event)
- {
- this._moved = false;
- this._detaching = false;
-
- window.addEventListener("mousemove", this, true);
- window.addEventListener("mouseup", this, true);
-
- this._startX = this.x;
- this._startMouseX = event.pageX;
- this._startMouseY = event.pageY;
- },
-
- _handleMousemove: function(event)
- {
- var w = WebInspector.GradientSlider.Width;
-
- this._moved = true;
-
- if (!this._detaching && Math.abs(event.pageY - this._startMouseY) > 50) {
- this._detaching = this.delegate && typeof this.delegate.knobCanDetach === "function" && this.delegate.knobCanDetach(this);
- if (this._detaching && this.delegate && typeof this.delegate.knobWillDetach === "function") {
- var translationFromParentToBody = window.webkitConvertPointFromNodeToPage(this.element.parentNode, new WebKitPoint(0, 0));
- this._startMouseX -= translationFromParentToBody.x;
- this._startMouseY -= translationFromParentToBody.y;
- document.body.appendChild(this.element);
- this.delegate.knobWillDetach(this);
- }
- }
-
- var x = this._startX + event.pageX - this._startMouseX;
- if (!this._detaching)
- x = Math.min(Math.max(0, x), w);
- this.x = x;
-
- if (this._detaching)
- this.y = event.pageY - this._startMouseY;
- else if (this.delegate && typeof this.delegate.knobXDidChange === "function")
- this.delegate.knobXDidChange(this);
- },
-
- _handleMouseup: function(event)
- {
- window.removeEventListener("mousemove", this, true);
- window.removeEventListener("mouseup", this, true);
-
- if (this._detaching) {
- this.element.addEventListener("transitionend", this);
- this.element.classList.add(WebInspector.GradientSliderKnob.FadeOutClassName);
- this.selected = false;
- } else if (!this._moved)
- this.selected = !this.selected;
- },
-
- _handleTransitionEnd: function(event)
- {
- this.element.removeEventListener("transitionend", this);
- this.element.classList.remove(WebInspector.GradientSliderKnob.FadeOutClassName);
- this.element.remove();
- },
-
- _updateTransform: function()
- {
- this.element.style.webkitTransform = "translate3d(" + this._x + "px, " + this._y + "px, 0)";
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,132 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.hierarchical-path-component {
- display: -webkit-flex;
- position: relative;
- height: 20px;
- min-width: 32px;
-}
-
-.hierarchical-path-component.show-selector-arrows {
- min-width: 44px;
-}
-
-.hierarchical-path-component.collapsed {
- min-width: 24px;
-}
-
-.hierarchical-path-component.collapsed > .icon {
- display: none;
-}
-
-.hierarchical-path-component.collapsed > .title {
- margin-left: 3px;
-}
-
-.hierarchical-path-component.collapsed > select {
- display: none;
-}
-
-.hierarchical-path-component > .icon {
- vertical-align: top;
- margin: 2px 3px 2px 4px;
- width: 16px;
- height: 16px;
-}
-
-.hierarchical-path-component > .selector-arrows {
- vertical-align: top;
- margin: 2px 3px 2px 4px;
- width: 5px;
- height: 16px;
- opacity: 0.6;
- content: url(Images/UpDownArrows.svg);
-}
-
-.hierarchical-path-component > .title {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- vertical-align: top;
-
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
- font-family: "Lucida Grande", sans-serif;
- font-size: 11px;
- line-height: 20px;
- height: 20px;
-
- min-width: 0;
- max-width: 400px;
-}
-
-.hierarchical-path-component > .title > .content {
- min-width: 0;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.hierarchical-path-component > select {
- opacity: 0;
-
- /* Positioned so the text in the menu aligns with the text in .title. */
- position: absolute;
- top: -1px;
- left: 10px;
- right: 0;
- bottom: 0;
-}
-
-.hierarchical-path:not(.always-show-last-path-component-separator) > .hierarchical-path-component:last-child > .separator {
- visibility: hidden;
-}
-
-.hierarchical-path-component > .separator {
- display: inline-block;
- vertical-align: top;
-
- background-image: url(Images/HierarchicalNavigationItemChevron.svg);
- background-repeat: no-repeat;
- background-position-y: center;
-
- opacity: 0.75;
-
- width: 7px;
- height: 20px;
-
- margin-left: 2px;
-}
-
-.hierarchical-path-component.text-only {
- padding-left: 5px;
- padding-right: 1px;
-}
-
-.hierarchical-path-component.text-only > select {
- /* Positions so the text in the menu aligns with the text in .title for text only path components. */
- left: -8px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,339 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HierarchicalPathComponent = function(displayName, styleClassNames, representedObject, textOnly, showSelectorArrows)
-{
- WebInspector.Object.call(this);
-
- console.assert(displayName);
- console.assert(styleClassNames);
-
- this._representedObject = representedObject || null;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.HierarchicalPathComponent.StyleClassName;
-
- if (!(styleClassNames instanceof Array))
- styleClassNames = [styleClassNames];
-
- for (var i = 0; i < styleClassNames.length; ++i) {
- if (!styleClassNames[i])
- continue;
- this._element.classList.add(styleClassNames[i]);
- }
-
- if (!textOnly) {
- this._iconElement = document.createElement("img");
- this._iconElement.className = WebInspector.HierarchicalPathComponent.IconElementStyleClassName;
- this._element.appendChild(this._iconElement);
- } else
- this._element.classList.add(WebInspector.HierarchicalPathComponent.TextOnlyStyleClassName);
-
- this._titleElement = document.createElement("div");
- this._titleElement.className = WebInspector.HierarchicalPathComponent.TitleElementStyleClassName;
- this._element.appendChild(this._titleElement);
-
- this._titleContentElement = document.createElement("div");
- this._titleContentElement.className = WebInspector.HierarchicalPathComponent.TitleContentElementStyleClassName;
- this._titleElement.appendChild(this._titleContentElement);
-
- this._separatorElement = document.createElement("div");
- this._separatorElement.className = WebInspector.HierarchicalPathComponent.SeparatorElementStyleClassName;
- this._element.appendChild(this._separatorElement);
-
- this._selectElement = document.createElement("select");
- this._selectElement.addEventListener("mouseover", this._selectElementMouseOver.bind(this));
- this._selectElement.addEventListener("mouseout", this._selectElementMouseOut.bind(this));
- this._selectElement.addEventListener("mousedown", this._selectElementMouseDown.bind(this));
- this._selectElement.addEventListener("mouseup", this._selectElementMouseUp.bind(this));
- this._selectElement.addEventListener("change", this._selectElementSelectionChanged.bind(this));
- this._element.appendChild(this._selectElement);
-
- this._previousSibling = null;
- this._nextSibling = null;
-
- this._truncatedDisplayNameLength = 0;
-
- this.selectorArrows = showSelectorArrows;
- this.displayName = displayName;
-};
-
-WebInspector.HierarchicalPathComponent.StyleClassName = "hierarchical-path-component";
-WebInspector.HierarchicalPathComponent.HiddenStyleClassName = "hidden";
-WebInspector.HierarchicalPathComponent.CollapsedStyleClassName = "collapsed";
-WebInspector.HierarchicalPathComponent.IconElementStyleClassName = "icon";
-WebInspector.HierarchicalPathComponent.TextOnlyStyleClassName = "text-only";
-WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName = "show-selector-arrows";
-WebInspector.HierarchicalPathComponent.TitleElementStyleClassName = "title";
-WebInspector.HierarchicalPathComponent.TitleContentElementStyleClassName = "content";
-WebInspector.HierarchicalPathComponent.SelectorArrowsElementStyleClassName = "selector-arrows";
-WebInspector.HierarchicalPathComponent.SeparatorElementStyleClassName = "separator";
-
-WebInspector.HierarchicalPathComponent.MinimumWidth = 32;
-WebInspector.HierarchicalPathComponent.MinimumWidthCollapsed = 24;
-WebInspector.HierarchicalPathComponent.MinimumWidthForOneCharacterTruncatedTitle = 54;
-WebInspector.HierarchicalPathComponent.SelectorArrowsWidth = 12;
-
-WebInspector.HierarchicalPathComponent.Event = {
- SiblingWasSelected: "hierarchical-path-component-sibling-was-selected",
- Clicked: "hierarchical-path-component-clicked"
-};
-
-WebInspector.HierarchicalPathComponent.prototype = {
- constructor: WebInspector.HierarchicalPathComponent,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get representedObject()
- {
- return this._representedObject;
- },
-
- get displayName()
- {
- return this._displayName;
- },
-
- set displayName(newDisplayName)
- {
- console.assert(newDisplayName);
- if (newDisplayName === this._displayName)
- return;
-
- this._displayName = newDisplayName;
-
- this._updateElementTitleAndText();
- },
-
- get truncatedDisplayNameLength()
- {
- return this._truncatedDisplayNameLength;
- },
-
- set truncatedDisplayNameLength(truncatedDisplayNameLength)
- {
- truncatedDisplayNameLength = truncatedDisplayNameLength || 0;
-
- if (truncatedDisplayNameLength === this._truncatedDisplayNameLength)
- return;
-
- this._truncatedDisplayNameLength = truncatedDisplayNameLength;
-
- this._updateElementTitleAndText();
- },
-
- get minimumWidth()
- {
- if (this.collapsed)
- return WebInspector.HierarchicalPathComponent.MinimumWidthCollapsed;
- if (this.selectorArrows)
- return WebInspector.HierarchicalPathComponent.MinimumWidth + WebInspector.HierarchicalPathComponent.SelectorArrowsWidth;
- return WebInspector.HierarchicalPathComponent.MinimumWidth;
- },
-
- get forcedWidth()
- {
- var maxWidth = this._element.style.getProperty("width");
- if (typeof maxWidth === "string")
- return parseInt(maxWidth);
- return null;
- },
-
- set forcedWidth(width)
- {
- if (typeof width === "number") {
- var minimumWidthForOneCharacterTruncatedTitle = WebInspector.HierarchicalPathComponent.MinimumWidthForOneCharacterTruncatedTitle;
- if (this.selectorArrows)
- minimumWidthForOneCharacterTruncatedTitle += WebInspector.HierarchicalPathComponent.SelectorArrowsWidth;
-
- // If the width is less than the minimum width required to show a single character and ellipsis, then
- // just collapse down to the bare minimum to show only the icon.
- if (width < minimumWidthForOneCharacterTruncatedTitle)
- width = 0;
-
- // Ensure the width does not go less than 1px. If the width is 0 the layout gets funky. There is a min-width
- // in the CSS too, so as long the width is less than min-width we get the desired effect of only showing the icon.
- this._element.style.setProperty("width", Math.max(1, width) + "px");
- } else
- this._element.style.removeProperty("width");
- },
-
- get hidden()
- {
- return this._element.classList.contains(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
- },
-
- set hidden(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
- else
- this._element.classList.remove(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
- },
-
- get collapsed()
- {
- return this._element.classList.contains(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
- },
-
- set collapsed(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
- else
- this._element.classList.remove(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
- },
-
- get selectorArrows()
- {
- return this._element.classList.contains(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
- },
-
- set selectorArrows(flag)
- {
- if (flag) {
- this._selectorArrowsElement = document.createElement("img");
- this._selectorArrowsElement.className = WebInspector.HierarchicalPathComponent.SelectorArrowsElementStyleClassName;
- this._element.insertBefore(this._selectorArrowsElement, this._separatorElement);
-
- this._element.classList.add(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
- } else {
- if (this._selectorArrowsElement) {
- this._selectorArrowsElement.remove();
- delete this._selectorArrowsElement;
- }
-
- this._element.classList.remove(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
- }
- },
-
- get previousSibling()
- {
- return this._previousSibling;
- },
-
- set previousSibling(newSlibling)
- {
- this._previousSibling = newSlibling || null;
- },
-
- get nextSibling()
- {
- return this._nextSibling;
- },
-
- set nextSibling(newSlibling)
- {
- this._nextSibling = newSlibling || null;
- },
-
- // Private
-
- _updateElementTitleAndText: function()
- {
- var truncatedDisplayName = this._displayName;
- if (this._truncatedDisplayNameLength && truncatedDisplayName.length > this._truncatedDisplayNameLength)
- truncatedDisplayName = truncatedDisplayName.substring(0, this._truncatedDisplayNameLength) + "\u2026";
-
- this._element.title = this._displayName;
- this._titleContentElement.textContent = truncatedDisplayName;
- },
-
- _updateSelectElement: function()
- {
- this._selectElement.removeChildren();
-
- function createOption(component)
- {
- var optionElement = document.createElement("option");
- const maxPopupMenuLength = 130; // <rdar://problem/13445374> <select> with very long option has clipped text and popup menu is still very wide
- optionElement.textContent = component.displayName.length <= maxPopupMenuLength ? component.displayName : component.displayName.substring(0, maxPopupMenuLength) + "\u2026";
- optionElement._pathComponent = component;
- return optionElement;
- }
-
- var previousSiblingCount = 0;
- var sibling = this.previousSibling;
- while (sibling) {
- this._selectElement.insertBefore(createOption(sibling), this._selectElement.firstChild);
- sibling = sibling.previousSibling;
- ++previousSiblingCount;
- }
-
- this._selectElement.appendChild(createOption(this));
-
- sibling = this.nextSibling;
- while (sibling) {
- this._selectElement.appendChild(createOption(sibling));
- sibling = sibling.nextSibling;
- }
-
- // Since the change event only fires when the selection actually changes we are
- // stuck with either not showing the current selection in the menu or accepting that
- // the user can't select what is already selected again. Selecting the same item
- // again can be desired (for selecting the main resource while looking at an image).
- // So if there is only one option, don't make it be selected by default. This lets
- // you select the top level item which usually has no siblings to go back.
- // FIXME: Make this work when there are multiple options with a selectedIndex.
- if (this._selectElement.options.length === 1)
- this._selectElement.selectedIndex = -1;
- else
- this._selectElement.selectedIndex = previousSiblingCount;
- },
-
- _selectElementMouseOver: function(event)
- {
- if (typeof this.mouseOver === "function")
- this.mouseOver();
- },
-
- _selectElementMouseOut: function(event)
- {
- if (typeof this.mouseOut === "function")
- this.mouseOut();
- },
-
- _selectElementMouseDown: function(event)
- {
- this._updateSelectElement();
- },
-
- _selectElementMouseUp: function(event)
- {
- this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.Clicked);
- },
-
- _selectElementSelectionChanged: function(event)
- {
- this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, {pathComponent: this._selectElement[this._selectElement.selectedIndex]._pathComponent});
- }
-};
-
-WebInspector.HierarchicalPathComponent.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceHierarchicalPathNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,237 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HierarchicalPathNavigationItem = function(identifier, components) {
- WebInspector.NavigationItem.call(this, identifier);
-
- this.components = components;
-};
-
-WebInspector.HierarchicalPathNavigationItem.StyleClassName = "hierarchical-path";
-WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName = "always-show-last-path-component-separator";
-
-WebInspector.HierarchicalPathNavigationItem.Event = {
- PathComponentWasSelected: "hierarchical-path-navigation-item-path-component-was-selected"
-};
-
-WebInspector.HierarchicalPathNavigationItem.prototype = {
- constructor: WebInspector.HierarchicalPathNavigationItem,
-
- // Public
-
- get components()
- {
- return this._components;
- },
-
- set components(newComponents)
- {
- if (!newComponents)
- newComponents = [];
-
- for (var i = 0; this._components && i < this._components.length; ++i)
- this._components[i].removeEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._siblingPathComponentWasSelected, this);
-
- // Make a shallow copy of the newComponents array using slice.
- this._components = newComponents.slice(0);
-
- for (var i = 0; i < this._components.length; ++i)
- this._components[i].addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._siblingPathComponentWasSelected, this);
-
- this.element.removeChildren();
- delete this._collapsedComponent;
-
- for (var i = 0; i < newComponents.length; ++i)
- this.element.appendChild(newComponents[i].element);
-
- // Update layout for the so other items can adjust to the extra space (or lack thereof) too.
- if (this.parentNavigationBar)
- this.parentNavigationBar.updateLayoutSoon();
- },
-
- get lastComponent()
- {
- return this._components.lastValue || null;
- },
-
- get alwaysShowLastPathComponentSeparator()
- {
- return this.element.classList.contains(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
- },
-
- set alwaysShowLastPathComponentSeparator(flag)
- {
- if (flag)
- this.element.classList.add(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
- else
- this.element.classList.remove(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
- },
-
- updateLayout: function(expandOnly)
- {
- var navigationBar = this.parentNavigationBar;
- if (!navigationBar)
- return;
-
- if (this._collapsedComponent) {
- this.element.removeChild(this._collapsedComponent.element);
- delete this._collapsedComponent;
- }
-
- // Expand our components to full width to test if the items can fit at full width.
- for (var i = 0; i < this._components.length; ++i) {
- this._components[i].hidden = false;
- this._components[i].forcedWidth = null;
- }
-
- if (expandOnly)
- return;
-
- if (navigationBar.sizesToFit)
- return;
-
- // Iterate over all the other navigation items in the bar and calculate their width.
- var totalOtherItemsWidth = 0;
- for (var i = 0; i < navigationBar.navigationItems.length; ++i) {
- // Skip ourself.
- if (navigationBar.navigationItems[i] === this)
- continue;
-
- // Skip flexible space items since they can take up no space at the minimum width.
- if (navigationBar.navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
- continue;
-
- totalOtherItemsWidth += navigationBar.navigationItems[i].element.offsetWidth;
- }
-
- // Calculate the width for all the components.
- var thisItemWidth = 0;
- var componentWidths = [];
- for (var i = 0; i < this._components.length; ++i) {
- var componentWidth = this._components[i].element.offsetWidth;
- componentWidths.push(componentWidth);
- thisItemWidth += componentWidth;
- }
-
- // If all our components fit with the other navigation items in the width of the bar,
- // then we don't need to collapse any components.
- var barWidth = navigationBar.element.offsetWidth;
- if (totalOtherItemsWidth + thisItemWidth <= barWidth)
- return;
-
- // Calculate the width we need to remove from our components, then iterate over them
- // and force their width to be smaller.
- var widthToRemove = totalOtherItemsWidth + thisItemWidth - barWidth;
- for (var i = 0; i < this._components.length; ++i) {
- var componentWidth = componentWidths[i];
-
- // Try to take the whole width we need to remove from each component.
- var forcedWidth = componentWidth - widthToRemove;
- this._components[i].forcedWidth = forcedWidth;
-
- // Since components have a minimum width, we need to see how much was actually
- // removed and subtract that from what remans to be removed.
- componentWidths[i] = Math.max(this._components[i].minimumWidth, forcedWidth);
- widthToRemove -= (componentWidth - componentWidths[i]);
-
- // If there is nothing else to remove, then we can stop.
- if (widthToRemove <= 0)
- break;
- }
-
- // If there is nothing else to remove, then we can stop.
- if (widthToRemove <= 0)
- return;
-
- // If there are 3 or fewer components, then we can stop. Collapsing the middle of 3 components
- // does not save more than a few pixels over just the icon, so it isn't worth it unless there
- // are 4 or more components.
- if (this._components.length <= 3)
- return;
-
- // We want to collapse the middle components, so find the nearest middle index.
- var middle = this._components.length >> 1;
- var distance = -1;
- var i = middle;
-
- // Create a component that will represent the hidden components with a ellipse as the display name.
- this._collapsedComponent = new WebInspector.HierarchicalPathComponent("\u2026", []);
- this._collapsedComponent.collapsed = true;
-
- // Insert it in the middle, it doesn't matter exactly where since the elements around it will be hidden soon.
- this.element.insertBefore(this._collapsedComponent.element, this._components[middle].element);
-
- // Add the width of the collapsed component to the width we need to remove.
- widthToRemove += this._collapsedComponent.minimumWidth;
-
- var hiddenDisplayNames = [];
-
- // Loop through the components starting at the middle and fanning out in each direction.
- while (i >= 0 && i <= this._components.length - 1) {
- // Only hide components in the middle and never the ends.
- if (i > 0 && i < this._components.length - 1) {
- var component = this._components[i];
- component.hidden = true;
-
- // Remember the displayName so it can be put in the tool tip of the collapsed component.
- if (distance > 0)
- hiddenDisplayNames.unshift(component.displayName);
- else
- hiddenDisplayNames.push(component.displayName);
-
- // Fully subtract the hidden component's width.
- widthToRemove -= componentWidths[i];
-
- // If there is nothing else to remove, then we can stop.
- if (widthToRemove <= 0)
- break;
- }
-
- // Calculate the next index.
- i = middle + distance;
-
- // Increment the distance when it is in the positive direction.
- if (distance > 0)
- ++distance;
-
- // Flip the direction of the distance.
- distance *= -1;
- }
-
- // Set the tool tip of the collapsed component.
- this._collapsedComponent.element.title = hiddenDisplayNames.join("\n");
- },
-
- // Private
-
- _additionalClassNames: [WebInspector.HierarchicalPathNavigationItem.StyleClassName],
-
- _siblingPathComponentWasSelected: function(event)
- {
- this.dispatchEventToListeners(WebInspector.HierarchicalPathNavigationItem.Event.PathComponentWasSelected, event.data);
- }
-};
-
-WebInspector.HierarchicalPathNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceHoverMenucss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/HoverMenu.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/HoverMenu.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/HoverMenu.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.hover-menu {
- position: absolute;
-
- -webkit-transform: translate(-1px, -1px);
-
- pointer-events: none;
- opacity: 0;
-
- transition: opacity 350ms;
-}
-
-.hover-menu.visible {
- opacity: 1;
-}
-
-.hover-menu > svg {
- position: absolute;
- top: 0;
- left: 0;
-}
-
-.hover-menu > svg > path,
-.hover-menu > svg > rect {
- stroke: rgba(0, 0, 0, 0.22);
- stroke-width: 2px;
- fill: none;
-}
-
-.hover-menu > img {
- position: absolute;
-
- left: 0;
- top: 0;
- width: 15px;
- height: 13px;
-
- content: -webkit-image-set(url(Images/HoverMenuButton.png) 1x, url(Images/HoverMenuButton@2x.png) 2x);
-}
-
-.hover-menu.visible > img {
- pointer-events: all;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceHoverMenujs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/HoverMenu.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/HoverMenu.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/HoverMenu.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,276 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HoverMenu = function(delegate)
-{
- WebInspector.Object.call(this);
-
- this.delegate = delegate;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.HoverMenu.StyleClassName;
- this._element.addEventListener("transitionend", this, true);
-
- this._outlineElement = this._element.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
-
- this._button = this._element.appendChild(document.createElement("img"));
- this._button.addEventListener("click", this);
-}
-
-WebInspector.HoverMenu.StyleClassName = "hover-menu";
-WebInspector.HoverMenu.VisibleClassName = "visible";
-
-WebInspector.HoverMenu.prototype = {
- constructor: WebInspector.HoverMenu,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- present: function(rects)
- {
- this._outlineElement.textContent = "";
-
- document.body.appendChild(this._element);
- this._drawOutline(rects);
- this._element.classList.add(WebInspector.HoverMenu.VisibleClassName);
-
- window.addEventListener("scroll", this, true);
- },
-
- dismiss: function(discrete)
- {
- if (this._element.parentNode !== document.body)
- return;
-
- if (discrete)
- this._element.remove();
-
- this._element.classList.remove(WebInspector.HoverMenu.VisibleClassName);
-
- window.removeEventListener("scroll", this, true);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "scroll":
- if (!this._element.contains(event.target))
- this.dismiss(true);
- break;
- case "click":
- this._handleClickEvent(event);
- break;
- case "transitionend":
- if (!this._element.classList.contains(WebInspector.HoverMenu.VisibleClassName))
- this._element.remove();
- break;
- }
- },
-
- // Private
-
- _handleClickEvent: function(event)
- {
- if (this.delegate && typeof this.delegate.hoverMenuButtonWasPressed === "function")
- this.delegate.hoverMenuButtonWasPressed(this);
- },
-
- _drawOutline: function(rects)
- {
- var buttonWidth = this._button.width;
- var buttonHeight = this._button.height;
-
- // Add room for the button on the last line.
- var lastRect = rects.pop();
- lastRect.size.width += buttonWidth;
- rects.push(lastRect);
-
- if (rects.length === 1)
- this._drawSingleLine(rects[0]);
- else if (rects.length === 2 && rects[0].minX() >= rects[1].maxX())
- this._drawTwoNonOverlappingLines(rects);
- else
- this._drawOverlappingLines(rects);
-
- var bounds = WebInspector.Rect.unionOfRects(rects).pad(3); // padding + 1/2 stroke-width
-
- var style = this._element.style;
- style.left = bounds.minX() + "px";
- style.top = bounds.minY() + "px";
- style.width = bounds.size.width + "px";
- style.height = bounds.size.height + "px";
-
- this._outlineElement.style.width = bounds.size.width + "px";
- this._outlineElement.style.height = bounds.size.height + "px";
-
- this._button.style.left = (lastRect.maxX() - bounds.minX() - buttonWidth) + "px";
- this._button.style.top = (lastRect.maxY() - bounds.minY() - buttonHeight) + "px";
- },
-
- _addRect: function(rect)
- {
- const r = 4;
-
- var svgRect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
- svgRect.setAttribute("x", 1);
- svgRect.setAttribute("y", 1);
- svgRect.setAttribute("width", rect.size.width);
- svgRect.setAttribute("height", rect.size.height);
- svgRect.setAttribute("rx", r);
- svgRect.setAttribute("ry", r);
- return this._outlineElement.appendChild(svgRect);
- },
-
- _addPath: function(commands, tx, ty)
- {
- var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
- path.setAttribute("d", commands.join(" "));
- path.setAttribute("transform", "translate(" + (tx + 1) + "," + (ty + 1) + ")");
- return this._outlineElement.appendChild(path);
- },
-
- _drawSingleLine: function(rect)
- {
- this._addRect(rect.pad(2));
- },
-
- _drawTwoNonOverlappingLines: function(rects)
- {
- const r = 4;
-
- var firstRect = rects[0].pad(2);
- var secondRect = rects[1].pad(2);
-
- var tx = -secondRect.minX();
- var ty = -firstRect.minY();
-
- var rect = firstRect;
- this._addPath([
- "M", rect.maxX(), rect.minY(),
- "H", rect.minX() + r,
- "q", -r, 0, -r, r,
- "V", rect.maxY() - r,
- "q", 0, r, r, r,
- "H", rect.maxX()
- ], tx, ty);
-
- rect = secondRect;
- this._addPath([
- "M", rect.minX(), rect.minY(),
- "H", rect.maxX() - r,
- "q", r, 0, r, r,
- "V", rect.maxY() - r,
- "q", 0, r, -r, r,
- "H", rect.minX()
- ], tx, ty);
- },
-
- _drawOverlappingLines: function(rects)
- {
- const PADDING = 2;
- const r = 4;
-
- var minX = Number.MAX_VALUE;
- var maxX = -Number.MAX_VALUE;
- for (var rect of rects) {
- var minX = Math.min(rect.minX(), minX);
- var maxX = Math.max(rect.maxX(), maxX);
- }
-
- minX -= PADDING;
- maxX += PADDING;
-
- var minY = rects[0].minY() - PADDING;
- var maxY = rects.lastValue.maxY() + PADDING;
- var firstLineMinX = rects[0].minX() - PADDING;
- var lastLineMaxX = rects.lastValue.maxX() + PADDING;
-
- if (firstLineMinX === minX && lastLineMaxX === maxX)
- return this._addRect(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
-
- var lastLineMinY = rects.lastValue.minY() + PADDING;
- if (rects[0].minX() === minX + PADDING)
- return this._addPath([
- "M", minX + r, minY,
- "H", maxX - r,
- "q", r, 0, r, r,
- "V", lastLineMinY - r,
- "q", 0, r, -r, r,
- "H", lastLineMaxX + r,
- "q", -r, 0, -r, r,
- "V", maxY - r,
- "q", 0, r, -r, r,
- "H", minX + r,
- "q", -r, 0, -r, -r,
- "V", minY + r,
- "q", 0, -r, r, -r
- ], -minX, -minY);
-
- var firstLineMaxY = rects[0].maxY() - PADDING;
- if (rects.lastValue.maxX() === maxX - PADDING)
- return this._addPath([
- "M", firstLineMinX + r, minY,
- "H", maxX - r,
- "q", r, 0, r, r,
- "V", maxY - r,
- "q", 0, r, -r, r,
- "H", minX + r,
- "q", -r, 0, -r, -r,
- "V", firstLineMaxY + r,
- "q", 0, -r, r, -r,
- "H", firstLineMinX - r,
- "q", r, 0, r, -r,
- "V", minY + r,
- "q", 0, -r, r, -r
- ], -minX, -minY);
-
- return this._addPath([
- "M", firstLineMinX + r, minY,
- "H", maxX - r,
- "q", r, 0, r, r,
- "V", lastLineMinY - r,
- "q", 0, r, -r, r,
- "H", lastLineMaxX + r,
- "q", -r, 0, -r, r,
- "V", maxY - r,
- "q", 0, r, -r, r,
- "H", minX + r,
- "q", -r, 0, -r, -r,
- "V", firstLineMaxY + r,
- "q", 0, -r, r, -r,
- "H", firstLineMinX - r,
- "q", r, 0, r, -r,
- "V", minY + r,
- "q", 0, -r, r, -r
- ], -minX, -minY);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.resource.image {
- background-color: rgb(231, 231, 231);
-
- overflow-x: hidden;
- overflow-y: auto;
-
- display: -webkit-flex;
-
- -webkit-justify-content: center;
-}
-
-.content-view.resource.image img {
- min-width: 0;
- max-width: 100%;
-
- -webkit-user-select: text;
- -webkit-user-drag: auto;
-
- /* A border is used instead of padding or margin so when there is overflow
- there will be space on all sides. */
- border: 15px solid transparent;
-
- margin: auto 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ImageResourceContentView = function(resource)
-{
- WebInspector.ResourceContentView.call(this, resource, WebInspector.ImageResourceContentView.StyleClassName);
-
- this._imageElement = null;
-};
-
-WebInspector.ImageResourceContentView.StyleClassName = "image";
-
-WebInspector.ImageResourceContentView.prototype = {
- constructor: WebInspector.ImageResourceContentView,
-
- // Public
-
- get imageElement()
- {
- return this._imageElement;
- },
-
- contentAvailable: function(content, base64Encoded)
- {
- this.element.removeChildren();
-
- this._imageElement = document.createElement("img");
- this._imageElement.src = this.resource.contentURL;
-
- this.element.appendChild(this._imageElement);
- }
-};
-
-WebInspector.ImageResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImageUtilitiesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ImageUtilities.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ImageUtilities.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ImageUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,730 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-// Bump this version when making changes that affect the storage format.
-const _imageStorageFormatVersion = 1;
-
-try {
- var _generatedImageCacheDatabase = openDatabase("com.apple.WebInspector", 1, "Web Inspector Storage Database", 5 * 1024 * 1024);
-} catch (e) {
- // If we can't open the database it isn't the end of the world, we just will always generate
- // the images and not cache them for better load times.
- console.warn("Can't open database due to: " + e + ". Images will be generated instead of loaded from cache.");
-}
-
-var _initialPrefetchComplete = false;
-var _fetchedCachedImages = {};
-
-var _generatedImageUpdateFunctions = [];
-
-_prefetchCachedImagesAndUpdate();
-
-// Updates each image when the device pixel ratio changes to redraw at the new resolution.
-window.matchMedia("(-webkit-device-pixel-ratio: 1)").addListener(_devicePixelRatioChanged);
-
-// Delete old cached images from localStorage to free up space.
-// FIXME: Remove this once it has been in the builds for a while.
-try {
- const processedFlagKey = "com.apple.WebInspector.deleted-generated-images";
-
- if (!window.localStorage[processedFlagKey]) {
- for (var key in window.localStorage) {
- if (/^com\.apple\.WebInspector\.generated-(?:colored|embossed)-image-/.test(key))
- delete window.localStorage[key];
- }
-
- window.localStorage[processedFlagKey] = true;
- }
-} catch (e) {
- // Ignore.
-}
-
-function _devicePixelRatioChanged()
-{
- _prefetchCachedImagesAndUpdate();
-}
-
-function _registerGeneratedImageUpdateFunction(update)
-{
- console.assert(typeof update === "function");
-
- _generatedImageUpdateFunctions.push(update);
-
- if (_initialPrefetchComplete)
- update();
-}
-
-function _logSQLError(tx, error)
-{
- console.error(error.code, error.message);
-}
-
-function _logSQLTransactionError(error)
-{
- console.error(error.code, error.message);
-}
-
-function _prefetchCachedImagesAndUpdate()
-{
- _fetchedCachedImages = {};
-
- function complete()
- {
- _initialPrefetchComplete = true;
-
- for (var i = 0; i < _generatedImageUpdateFunctions.length; ++i)
- _generatedImageUpdateFunctions[i]();
- }
-
- if (!_generatedImageCacheDatabase) {
- complete();
- return;
- }
-
- _generatedImageCacheDatabase.transaction(function(tx) {
- tx.executeSql("SELECT key, imageVersion, data FROM CachedImages WHERE pixelRatio = ? AND formatVersion = ?", [window.devicePixelRatio, _imageStorageFormatVersion], function(tx, result) {
- for (var i = 0; i < result.rows.length; ++i) {
- var row = result.rows.item(i);
- _fetchedCachedImages[row.key] = {data: row.data, imageVersion: row.imageVersion};
- }
-
- complete();
- }, function(tx, error) {
- // The select failed. That could be because the schema changed or this is the first time.
- // Drop the table and recreate it fresh.
-
- tx.executeSql("DROP TABLE IF EXISTS CachedImages");
- tx.executeSql("CREATE TABLE CachedImages (key TEXT, pixelRatio INTEGER, formatVersion NUMERIC, imageVersion NUMERIC, data BLOB, UNIQUE(key, pixelRatio))", [], null, _logSQLError);
-
- complete();
- });
- }, _logSQLTransactionError);
-}
-
-function saveImageToStorage(storageKey, context, width, height, imageVersion)
-{
- console.assert(storageKey);
- console.assert(context);
- console.assert(typeof width === "number");
- console.assert(typeof height === "number");
- console.assert(typeof imageVersion === "number");
-
- if (!_generatedImageCacheDatabase)
- return;
-
- var imageData = context.getImageData(0, 0, width, height);
- var imageDataPixels = new Uint32Array(imageData.data.buffer);
-
- var imageDataString = "";
- for (var i = 0; i < imageDataPixels.length; ++i)
- imageDataString += (i ? ":" : "") + (imageDataPixels[i] ? imageDataPixels[i].toString(36) : "");
-
- _generatedImageCacheDatabase.transaction(function(tx) {
- tx.executeSql("INSERT OR REPLACE INTO CachedImages (key, pixelRatio, imageVersion, formatVersion, data) VALUES (?, ?, ?, ?, ?)", [storageKey, window.devicePixelRatio, imageVersion, _imageStorageFormatVersion, imageDataString], null, _logSQLError);
- }, _logSQLTransactionError);
-}
-
-function restoreImageFromStorage(storageKey, context, width, height, imageVersion, generateCallback)
-{
- console.assert(storageKey);
- console.assert(context);
- console.assert(typeof width === "number");
- console.assert(typeof height === "number");
- console.assert(typeof imageVersion === "number");
- console.assert(typeof generateCallback === "function");
-
- if (!_generatedImageCacheDatabase) {
- generateCallback();
- return;
- }
-
- var imageInfo = _fetchedCachedImages[storageKey];
-
- if (imageInfo) {
- // We only want to keep the data around for the first use. These images
- // are typically only used in one place. This keeps performance good
- // during page load and frees memory that typically won't be reused.
- delete _fetchedCachedImages[storageKey];
- }
-
- if (imageInfo && (!imageInfo.data || imageInfo.imageVersion !== imageVersion)) {
- generateCallback();
- return;
- }
-
- if (imageInfo) {
- // Restore the image from the memory cache.
- restoreImageData(imageInfo.data);
- } else {
- // Try fetching the image data from the database.
- _generatedImageCacheDatabase.readTransaction(function(tx) {
- tx.executeSql("SELECT data FROM CachedImages WHERE key = ? AND pixelRatio = ? AND imageVersion = ? AND formatVersion = ?", [storageKey, window.devicePixelRatio, imageVersion, _imageStorageFormatVersion], function(tx, result) {
- if (!result.rows.length) {
- generateCallback();
- return;
- }
-
- console.assert(result.rows.length === 1);
-
- restoreImageData(result.rows.item(0).data);
- }, function(tx, error) {
- _logSQLError(tx, error);
-
- generateCallback();
- });
- }, _logSQLTransactionError);
- }
-
- function restoreImageData(imageDataString)
- {
- var imageData = context.createImageData(width, height);
- var imageDataPixels = new Uint32Array(imageData.data.buffer);
-
- var imageDataArray = imageDataString.split(":");
- if (imageDataArray.length !== imageDataPixels.length) {
- generateCallback();
- return;
- }
-
- for (var i = 0; i < imageDataArray.length; ++i) {
- var pixelString = imageDataArray[i];
- imageDataPixels[i] = pixelString ? parseInt(pixelString, 36) : 0;
- }
-
- context.putImageData(imageData, 0, 0);
- }
-}
-
-function generateColoredImage(inputImage, red, green, blue, alpha, width, height)
-{
- console.assert(inputImage);
-
- if (alpha === undefined)
- alpha = 1;
-
- if (width === undefined)
- width = inputImage.width;
-
- if (height === undefined)
- height = inputImage.height;
-
- if (inputImage instanceof HTMLCanvasElement) {
- // The input is already a canvas, so we can use its context directly.
- var inputContext = inputImage.getContext("2d");
- } else {
- console.assert(inputImage instanceof HTMLImageElement || inputImage instanceof HTMLVideoElement);
-
- // The input is an image/video element, so we need to draw it into
- // a canvas to get the pixel data.
- var inputCanvas = document.createElement("canvas");
- inputCanvas.width = width;
- inputCanvas.height = height;
-
- var inputContext = inputCanvas.getContext("2d");
- inputContext.drawImage(inputImage, 0, 0, width, height);
- }
-
- var imageData = inputContext.getImageData(0, 0, width, height);
- var imageDataPixels = new Uint32Array(imageData.data.buffer);
-
- var isLittleEndian = Uint32Array.isLittleEndian();
-
- // Loop over the image data and set the color channels while preserving the alpha.
- for (var i = 0; i < imageDataPixels.length; ++i) {
- if (isLittleEndian) {
- var existingAlpha = 0xff & (imageDataPixels[i] >> 24);
- imageDataPixels[i] = red | green << 8 | blue << 16 | (existingAlpha * alpha) << 24;
- } else {
- var existingAlpha = 0xff & imageDataPixels[i];
- imageDataPixels[i] = red << 24 | green << 16 | blue << 8 | existingAlpha * alpha;
- }
- }
-
- // Make a canvas that will be returned as the result.
- var resultCanvas = document.createElement("canvas");
- resultCanvas.width = width;
- resultCanvas.height = height;
-
- var resultContext = resultCanvas.getContext("2d");
-
- resultContext.putImageData(imageData, 0, 0);
-
- return resultCanvas;
-}
-
-function generateColoredImagesForCSS(imagePath, specifications, width, height, canvasIdentifierPrefix)
-{
- console.assert(imagePath);
- console.assert(specifications);
- console.assert(typeof width === "number");
- console.assert(typeof height === "number");
-
- var scaleFactor = window.devicePixelRatio;
- var scaledWidth = width * scaleFactor;
- var scaledHeight = height * scaleFactor;
-
- canvasIdentifierPrefix = canvasIdentifierPrefix || "";
-
- const storageKeyPrefix = "generated-colored-image-";
-
- var imageElement = null;
- var pendingImageLoadCallbacks = [];
-
- _registerGeneratedImageUpdateFunction(update);
-
- function imageLoaded()
- {
- console.assert(imageElement);
- console.assert(imageElement.complete);
- for (var i = 0; i < pendingImageLoadCallbacks.length; ++i)
- pendingImageLoadCallbacks[i]();
- pendingImageLoadCallbacks = null;
- }
-
- function ensureImageIsLoaded(callback)
- {
- if (imageElement && imageElement.complete) {
- callback();
- return;
- }
-
- console.assert(pendingImageLoadCallbacks);
- pendingImageLoadCallbacks.push(callback);
-
- if (imageElement)
- return;
-
- imageElement = document.createElement("img");
- imageElement.addEventListener("load", imageLoaded);
- imageElement.width = width;
- imageElement.height = height;
- imageElement.src = imagePath;
- }
-
- function restoreImages()
- {
- for (var canvasIdentifier in specifications) {
- // Don't restore active images yet.
- if (canvasIdentifier.indexOf("active") !== -1)
- continue;
-
- var specification = specifications[canvasIdentifier];
- restoreImage(canvasIdentifier, specification);
- }
-
- function restoreActiveImages()
- {
- for (var canvasIdentifier in specifications) {
- // Only restore active images here.
- if (canvasIdentifier.indexOf("active") === -1)
- continue;
-
- var specification = specifications[canvasIdentifier];
- restoreImage(canvasIdentifier, specification);
- }
- }
-
- // Delay restoring the active states until later to improve the initial page load time.
- setTimeout(restoreActiveImages, 500);
- }
-
- function restoreImage(canvasIdentifier, specification)
- {
- const storageKey = storageKeyPrefix + canvasIdentifierPrefix + canvasIdentifier;
- const context = document.getCSSCanvasContext("2d", canvasIdentifierPrefix + canvasIdentifier, scaledWidth, scaledHeight);
- restoreImageFromStorage(storageKey, context, scaledWidth, scaledHeight, specification.imageVersion || 0, function() {
- ensureImageIsLoaded(generateImage.bind(null, canvasIdentifier, specification));
- });
- }
-
- function update()
- {
- restoreImages();
- }
-
- function generateImage(canvasIdentifier, specification)
- {
- console.assert(specification.fillColor instanceof Array);
- console.assert(specification.fillColor.length === 3 || specification.fillColor.length === 4);
-
- const context = document.getCSSCanvasContext("2d", canvasIdentifierPrefix + canvasIdentifier, scaledWidth, scaledHeight);
- context.save();
- context.scale(scaleFactor, scaleFactor);
-
- if (specification.shadowColor) {
- context.shadowOffsetX = specification.shadowOffsetX || 0;
- context.shadowOffsetY = specification.shadowOffsetY || 0;
- context.shadowBlur = specification.shadowBlur || 0;
-
- if (specification.shadowColor instanceof Array) {
- if (specification.shadowColor.length === 3)
- context.shadowColor = "rgb(" + specification.shadowColor.join(", ") + ")";
- else if (specification.shadowColor.length === 4)
- context.shadowColor = "rgba(" + specification.shadowColor.join(", ") + ")";
- } else
- context.shadowColor = specification.shadowColor;
- }
-
- var coloredImage = generateColoredImage(imageElement, specification.fillColor[0], specification.fillColor[1], specification.fillColor[2], specification.fillColor[3], scaledWidth, scaledHeight);
- context.drawImage(coloredImage, 0, 0, width, height);
-
- const storageKey = storageKeyPrefix + canvasIdentifierPrefix + canvasIdentifier;
- saveImageToStorage(storageKey, context, scaledWidth, scaledHeight, specification.imageVersion || 0);
- context.restore();
- }
-}
-
-function generateEmbossedImages(src, width, height, states, canvasIdentifierCallback, ignoreCache)
-{
- console.assert(src);
- console.assert(typeof width === "number");
- console.assert(typeof height === "number");
- console.assert(states);
- console.assert(states.Normal);
- console.assert(states.Active);
- console.assert(typeof canvasIdentifierCallback === "function");
-
- var scaleFactor = window.devicePixelRatio;
- var scaledWidth = width * scaleFactor;
- var scaledHeight = height * scaleFactor;
-
- // Bump this version when making changes that affect the result image.
- const imageVersion = 2;
-
- const storageKeyPrefix = "generated-embossed-image-";
-
- var image = null;
- var pendingImageLoadCallbacks = [];
-
- _registerGeneratedImageUpdateFunction(update);
-
- function imageLoaded()
- {
- console.assert(image);
- console.assert(image.complete);
- for (var i = 0; i < pendingImageLoadCallbacks.length; ++i)
- pendingImageLoadCallbacks[i]();
- pendingImageLoadCallbacks = null;
- }
-
- function ensureImageIsLoaded(callback)
- {
- if (image && image.complete) {
- callback();
- return;
- }
-
- console.assert(pendingImageLoadCallbacks);
- pendingImageLoadCallbacks.push(callback);
-
- if (image)
- return;
-
- image = document.createElement("img");
- image.addEventListener("load", imageLoaded);
- image.width = width;
- image.height = height;
- image.src = src;
- }
-
- function restoreImages()
- {
- restoreImage(states.Normal);
- if (states.Focus)
- restoreImage(states.Focus);
-
- function restoreActiveImages()
- {
- restoreImage(states.Active);
- if (states.ActiveFocus)
- restoreImage(states.ActiveFocus);
- }
-
- // Delay restoring the active states until later to improve the initial page load time.
- setTimeout(restoreActiveImages, 500);
- }
-
- function restoreImage(state)
- {
- const storageKey = storageKeyPrefix + canvasIdentifierCallback(state);
- const context = document.getCSSCanvasContext("2d", canvasIdentifierCallback(state), scaledWidth, scaledHeight);
- restoreImageFromStorage(storageKey, context, scaledWidth, scaledHeight, imageVersion, function() {
- ensureImageIsLoaded(generateImage.bind(null, state));
- });
- }
-
- function update()
- {
- if (ignoreCache)
- generateImages();
- else
- restoreImages();
- }
-
- function generateImages()
- {
- ensureImageIsLoaded(generateImage.bind(null, states.Normal));
-
- if (states.Focus)
- ensureImageIsLoaded(generateImage.bind(null, states.Focus));
-
- function generateActiveImages()
- {
- ensureImageIsLoaded(generateImage.bind(null, states.Active));
-
- if (states.ActiveFocus)
- ensureImageIsLoaded(generateImage.bind(null, states.ActiveFocus));
- }
-
- // Delay generating the active states until later to improve the initial page load time.
- setTimeout(generateActiveImages, 500);
- }
-
- function generateImage(state)
- {
- const depth = 1 * scaleFactor;
- const shadowDepth = depth;
- const shadowBlur = depth - 1;
- const glowBlur = 2;
-
- const context = document.getCSSCanvasContext("2d", canvasIdentifierCallback(state), scaledWidth, scaledHeight);
- context.save();
- context.scale(scaleFactor, scaleFactor);
-
- context.clearRect(0, 0, width, height);
-
- if (depth > 0) {
- // Use scratch canvas so we can apply the draw the white drop shadow
- // to the whole glyph at the end.
-
- var scratchCanvas = document.createElement("canvas");
- scratchCanvas.width = scaledWidth;
- scratchCanvas.height = scaledHeight;
-
- var scratchContext = scratchCanvas.getContext("2d");
- scratchContext.scale(scaleFactor, scaleFactor);
- } else
- var scratchContext = context;
-
- var gradient = scratchContext.createLinearGradient(0, 0, 0, height);
- if (state === states.Active) {
- gradient.addColorStop(0, "rgb(60, 60, 60)");
- gradient.addColorStop(1, "rgb(100, 100, 100)");
- } else if (state === states.Focus) {
- gradient.addColorStop(0, "rgb(50, 135, 200)");
- gradient.addColorStop(1, "rgb(60, 155, 225)");
- } else if (state === states.ActiveFocus) {
- gradient.addColorStop(0, "rgb(30, 115, 185)");
- gradient.addColorStop(1, "rgb(40, 135, 200)");
- } else {
- gradient.addColorStop(0, "rgb(90, 90, 90)");
- gradient.addColorStop(1, "rgb(145, 145, 145)");
- }
-
- scratchContext.fillStyle = gradient;
- scratchContext.fillRect(0, 0, width, height);
-
- if (depth > 0) {
- // Invert the image to use as a reverse image mask for the inner shadows.
- // Pass in the color to use for the opaque areas to prevent "black halos"
- // later when applying the final image mask.
-
- if (state === states.Active)
- var invertedImage = _invertMaskImage(image, 60, 60, 60);
- else if (state === states.Focus)
- var invertedImage = _invertMaskImage(image, 45, 145, 210);
- else if (state === states.ActiveFocus)
- var invertedImage = _invertMaskImage(image, 35, 125, 195);
- else
- var invertedImage = _invertMaskImage(image, 90, 90, 90);
-
- if (state === states.Focus) {
- // Double draw the blurry inner shadow to get the right effect.
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(10, 95, 150)", invertedImage);
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(10, 95, 150)", invertedImage);
-
- // Draw the inner shadow.
- _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgb(0, 80, 170)", invertedImage);
- } else if (state === states.ActiveFocus) {
- // Double draw the blurry inner shadow to get the right effect.
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(0, 80, 100)", invertedImage);
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgb(0, 80, 100)", invertedImage);
-
- // Draw the inner shadow.
- _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgb(0, 65, 150)", invertedImage);
- } else {
- // Double draw the blurry inner shadow to get the right effect.
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgba(0, 0, 0, 1)", invertedImage);
- _drawImageShadow(scratchContext, 0, 0, shadowDepth, "rgba(0, 0, 0, 1)", invertedImage);
-
- // Draw the inner shadow.
- _drawImageShadow(scratchContext, 0, shadowDepth, shadowBlur, "rgba(0, 0, 0, 0.6)", invertedImage);
- }
- }
-
- // Apply the mask to keep just the inner shape of the glyph.
- _applyImageMask(scratchContext, image);
-
- // Draw the white drop shadow.
- if (depth > 0)
- _drawImageShadow(context, 0, shadowDepth, shadowBlur, "rgba(255, 255, 255, 0.6)", scratchCanvas);
-
- // Draw a subtle glow for the focus states.
- if (state === states.Focus || state === states.ActiveFocus)
- _drawImageShadow(context, 0, 0, glowBlur, "rgba(20, 100, 220, 0.4)", scratchCanvas);
-
- if (!ignoreCache) {
- const storageKey = storageKeyPrefix + canvasIdentifierCallback(state);
- saveImageToStorage(storageKey, context, scaledWidth, scaledHeight, imageVersion);
- }
-
- context.restore();
- }
-
- function _drawImageShadow(context, xOffset, yOffset, blur, color, image) {
- context.save();
-
- context.shadowOffsetX = xOffset || 0;
- context.shadowOffsetY = yOffset || 0;
- context.shadowBlur = blur || 0;
- context.shadowColor = color || "black";
-
- context.drawImage(image, 0, 0, width, height);
-
- context.restore();
- }
-
- function _invertMaskImage(image, red, green, blue) {
- var bufferCanvas = document.createElement("canvas");
- bufferCanvas.width = scaledWidth;
- bufferCanvas.height = scaledHeight;
-
- var buffer = bufferCanvas.getContext("2d");
- buffer.scale(scaleFactor, scaleFactor);
- buffer.drawImage(image, 0, 0, width, height);
-
- var imageData = buffer.getImageData(0, 0, scaledWidth, scaledHeight);
- var imageDataPixels = new Uint32Array(imageData.data.buffer);
-
- red = red || 0;
- green = green || 0;
- blue = blue || 0;
-
- var isLittleEndian = Uint32Array.isLittleEndian();
-
- for (var i = 0; i < imageDataPixels.length; ++i) {
- if (isLittleEndian) {
- var existingAlpha = 0xff & (imageDataPixels[i] >> 24);
- imageDataPixels[i] = red | green << 8 | blue << 16 | (255 - existingAlpha) << 24;
- } else {
- var existingAlpha = 0xff & imageDataPixels[i];
- imageDataPixels[i] = red << 24 | green << 16 | blue << 8 | 255 - existingAlpha;
- }
- }
-
- buffer.putImageData(imageData, 0, 0);
-
- return bufferCanvas;
- }
-
- function _applyImageMask(context, image) {
- var maskCanvas = document.createElement("canvas");
- maskCanvas.width = scaledWidth;
- maskCanvas.height = scaledHeight;
-
- var mask = maskCanvas.getContext("2d");
- mask.scale(scaleFactor, scaleFactor);
- mask.drawImage(image, 0, 0, width, height);
-
- var imageData = context.getImageData(0, 0, scaledWidth, scaledHeight);
- var imageDataPixels = imageData.data;
-
- var maskImageDataPixels = mask.getImageData(0, 0, scaledWidth, scaledHeight).data;
-
- for (var i = 3; i < imageDataPixels.length; i += 4)
- imageDataPixels[i] = maskImageDataPixels[i] * (imageDataPixels[i] / 255);
-
- context.putImageData(imageData, 0, 0);
- }
-}
-
-
-var svgImageCache = {};
-
-function loadSVGImageDocumentElement(url, callback)
-{
- function invokeCallbackWithDocument(svgText) {
- var parser = new DOMParser;
- var doc = parser.parseFromString(svgText, "image/svg+xml");
- callback(doc.documentElement);
- }
-
- function imageLoad(event) {
- if (xhr.status === 0 || xhr.status === 200) {
- var svgText = xhr.responseText;
- svgImageCache[url] = svgText;
- invokeCallbackWithDocument(svgText);
- } else {
- console.error("Unexpected XHR status (" + xhr.status + ") loading SVG image: " + url);
- callback(null);
- }
- }
-
- function imageError(event) {
- console.error("Unexpected failure loading SVG image: " + url);
- callback(null);
- }
-
- var cachedSVGText = svgImageCache[url];
- if (cachedSVGText) {
- invokeCallbackWithDocument(cachedSVGText);
- return;
- }
-
- var xhr = new XMLHttpRequest;
- xhr.open("GET", url, true);
- xhr.addEventListener("load", imageLoad);
- xhr.addEventListener("error", imageError);
- xhr.send();
-}
-
-function wrappedSVGDocument(url, className, title, callback)
-{
- loadSVGImageDocumentElement(url, function(svgDocument) {
- if (!svgDocument) {
- callback(null);
- return;
- }
-
- var wrapper = document.createElement("div");
- if (className)
- wrapper.className = className;
- if (title)
- wrapper.title = title;
- wrapper.appendChild(svgDocument);
-
- callback(wrapper);
- });
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarBluepng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR
- \xF4\x96\xD2 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 \xF1IDAT(}\x92\xCFkQ\xC7g\xDF\xFEJ\x93J\x9B6l\xA5O*\x81\xB6D
-=\xF4"x\xB3ы [<\xF4\xE2ٿ\xC1\xA3B\x8F^\xA9xP\xF0P*\x88\x87\x82\xA8Z\xA8\xC5li+&\xEB&\xDBM\xD2\xDD\xF7ә\xADE\xE9\xC0\xEC>f>߷\xEF;\xFB\xAC\\xF92P\\xBD\xFF\xD2\xEB$ja0g\xDF:3\xC0f\xBF\xB7\x84w\xAE\xE8\xF2\xF8X\xAFc}\xEB\xCBo\xCEsb-M.\xBCwm\xEB\xD5͙\xE1\xA9+\xF201\xEA\x82c[ \x95\x81\xBD\x9F>\xD4{\xF0\xFC}{C(s\xFD\xE3\xF2\x8Dk\xE6\xC1\xB6\x97
-]\x9B\xBB8X\xB9w\xAD\x87-[        \xEC\x87Ώ\xB8pi<cE\xAF\xF0\xEEKg\xD3wY\xD5A\xC1\xE2Dɫ\xE4}k\x9Bq\xD3(H\xD8S\x9F\xB8\xBD\x80/2.՝\xA1\xBCM\x85\xBF'\xB2\x93'        \xA9O\xF1\xCC(9=\xE01\xD0\xDA\xFC\xC9\xFD\xB3\xA6>q\xC43c\x94K2|Z|k\xF2lc\xE2\x822\x95\xD0\xDBi\xC0\xC9q`\xF41\xD3I\xB4MK\x84\xC9F\xFC?%\x8D\x9E\xFA\xE4M\xA7q\x9D\x89N\xE3u\xE3HB\xAB+\xA1\xC7u\xB6#\xD9\xEB'}\x81\xEA\xD4b        \xC4ۚ\xC7;~\xB92ߖ\x85"\xFEk<\xF7o\xBE        nw4\xDE\xF9\xC1!i\xED׃\xF5GK\xB6\xE5\xF8G\xAA~\xB5\xE5و;ŰǠ\x93h        \xC6\xEC\x9Aai\xB8[oz\xB6\x944\xB6j\xD95B\xBE\x9D\xAA\x8ET\xEF\xDEv
-g\xE7\x98\xEBO%\xC0\xB2]\xD0"\xFD,\xBB\x8D\xB7a\xED\xC9S\x95D5dӾ\x88\xFC\xD3$\xC70K\x98Ø\xFD\x88p\xD1\xC4<\xC4\xCCF\xFC\xA2!\xACN\x9D`, IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarBlue2xpng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue@2x.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue@2x.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarBlue@2x.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR \xAF\xD3 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 &IDATH
-\xADVkoU~ϙ\x9D\xEE\xA5۴\xBA\xDDPRD\xAC\x895\xDE4\x925xK\xE4\x8Bb\xBF\x9A\xE8 \x89?@>\x8D\x91x\x89        T"J\xE2\x85Ĉ
-"6\xD4V\x85\xD0R\xD8Bo\xDBٙ\x9D\x993>\xCFٝZ@hxӳ\xA7g\xE6\xBC\xCF\xF3\xDE\xCE{F=\xBAmP\x96-\xC8\xCAڥ\x89\xE3Dv\x9A\x90\xB3V"&\x91\xEE\xD8$D\xE4i\xADT\xD9$\xC9\xFC\xEF`Pb<;\x8Ag\xFC\xBF\xCF\xD1\xEA\xCB?>\xD80l\xDF\xFCϏ\xDA\xF4\xFE)Ysk^G\xC9o'<9v\xBAF\xC2.\xAC\xB7\xB9\x8E\xEA\xA1\xA3\xF1\xF3\xF2\xFDR\x99\x8E\xC4\x8C\x85)d\xB5\x94\xDB2\xB2\x86X\x84\xBF~\xDD-;^\xBD\x9CKm\xDE9"\xFA\xAB'$\x8C        B\xB3J\xBB\xB2\xAE*\xDE/\xD7\xDEV\x90B\x8B\x96\x9EE9\xE9\xF0\\xF1\xF13\xBExu#\x87Oz\xD6\xD0 L\xAA\xB0\xEB%\x90ퟻ7sn2\xB2\xA1jZ\xFA&^\xBE\xEBf\x94,)\xB7\xC8돗da\x87+\x93^,\xFDþ\xEC=<)3M\x8FZ\xE1QOwN\xEEF4\xDA\x8E\x9DI|\xE2|\xBD\xAF\xBE[\xF9\xDA\xEE\xB7@\xF6^J\xA6\xDE:h-\xAA\xD5ͳ\xAD\xF6\xE4[\xB4s{WV\x9E\xBC\xABMr\xAE\x92\x81\xB3\xC1,x\xAAt\xF9Lҕ\xB3⇉|\xFF\xE7\xB4\xFC=\xF0\xE2\xC8$ϟ\xFC\xF4Žܯia=J\xBA\x95R\x9F\xC0\x87\x9E\xAC[}\xED$!
-\xA2a\xD4%\xB1\x88\xB9\xFC\xD5\xDDݖ(@^\xC2\xC0{\xDB\xD5\xD2~K\xA9\xE5\xBA<!@*s\xC9
-b\x93\xD8ܣM\xE8/\xC6\xDC\xCBE{^\xDB\xC4^C\xB8\xB8\xFFr!uY<\xC4jJ\xEF\x92W>_\x9C\xE5ltܜÄfaB\xFF\x88oc\xCDs4\xA9\x82\x8C\xC4"fh
-\x8E\x89:1\xE1SYTY        \xA5{S\xABc\xE3=_F]zF,bOhTW\xF1\xC0\xB1r\xD8!n\x94\x8B\x98\xF60\xD5;\xE9Q\xA9\xC5\xA8\xDC(I\xB1\x88Mf\xCCML\xA3\xADL\xD7\xF3\x8D`K\xB1\x9A\xD8\xC8XS\xD0<ٯ\xAC\xA4s\xFA\xEEz\xE6T\x9731S!Q\xC4;\xB6%\x83S\x8C\xEB|\xC5\xE6\xC4"fS"-I2\x81 \xA2\x9F[-h\xFB\xC2\xD7\xF3\xE1\xA2NC7\xB1X\xC4$69\xB4\xA9WO\x9Bp\xC66ΆW\xF4\xA8\xE1\xD5\xF5\x90q\xEF\xDE4"\xC4fLlp\xE9\xC8?\x94ġu\x93Mׄu\xDBZ\xEDk!KI\xA8Ð\x83X4\x9C\xD8\xE0\xF8U\xD7F~\xFF\xEEϛ\x91\xF1j$Ӿ\xDB\xFF\xD0\xE3f\xAC#(X0"5%]\xF3\xC1\xB9\xD7\xDEg\xD0#\xB1\x88Ilr8p+\xC8w\xAD^!\xA2V\xAA\x88p*\xC1\xCDjO8\xBAo\xB61#}\xB3\x84\xFC߮Sc0\xFB\xF0d
-Gdt"\x94\xCAT]©\xB3#\xFB.\xF9l\x87\x93)\x96\x83\xD8\xF7\xB2\xA5e\xCF$\xA1\xE7\xBA͒\xE1{`\x96\x84¼\xA5\xC0\x8D\xA2\q\xCEq\xE7 D\xC2\xFBǒ\x9C\x9F\x8A,I}|H\xE2`\xBA6\xD9\xF7Ֆh\xA6r\xD4Y\xD6\xFBmt\xE1\x97\xE3L\xA14\x96i-\xAFKL$5\x93\x95\x9E\xA5dd\xA5\xA6G\x80\xE1\xC2vI^\xE9        I.LUω        f\xC4?{lk\xF5\xE4\x81`-\xD2\xF2S}{fZK\xDBE\xBD\x91D\xBE\x8C'݈u\xCE\xF6\xABb\xAEq}\xE0\xF6\x95\xD4QzG/\xF8\xBDPEN\xD8H\xA3\xBA\x8FP
-\xA3\xD2jN\x9E\xD9NLb\x93@ݷy \x80\xB1\xE0\xCA\xED\xC4zu{\xCFs"g\x9Bu\xB6\x98\xD7-\xAD\xB8E\xB2\xA2ݜ\xD0 v\xE2\xB9¢\x89\x83*\x80}TW\x802F)\xD5Zm\xB4\xEF\x9D\xC9\xE3_\xFF\x84\xBD}c\xD4Q\xF1\x9B\xD6\xD4j\xBE}\xB1q\x9E-ϕWu\x97>\xB6\xC9)ܼ^\xBB\xAD[
- \xCB\xDBReh\xAD\xA2\xE6U\xE6Z\xEBM\xDD\xC3\xEC\x99ػ\xB8\xBFz\xE2Ǐ\xFD\xCA_\xFF\xE3\x8C\xC5H[\x96\xB3\x9E݁wN\xAE\xBC\xB23\xDF}\xCF#\x99\xD6\xCE\x94\xD2\xA24\xAAs\x8E$f0I\xCCD43\xF6sm\xF8\xC8A\xBF2@^\xFD֓t\xB7%\xE2\x82\xE7\x82ɞ\xAAY2^LK0\xBA0.\x8D\E\x80 \xFCp¸\xE2\xBEQ\xB9=x~U!!sW\xC2p1\xDA0\xE6\xCA4!\xC6zp\x9EY\xF9)cʦ\xD7\xC0 IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGraypng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR
- \xF4\x96\xD2 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 \xB3IDAT(m\x92=k\xC2P\x86OnbTL\xA0\x88\xB48\xB88        \xB6\xE8R\xB0\xFF\xA0ݺ:W'\x87\xCE\xD2?Хc\xC1\xB9 tQ\x88\xB4K\xB1\xE8 -h\xC5o\x8Dƨ=o@\x9Ao\xB8\x9C\xF3\x9C{\xBE"\xC5\xE3q\xC2)
-\xAAeY\xAA\xAA\xDE\xFA|\xBE\xCB\xF1x\xAC\x86B!k\xB9\\xBE\xB1\xFD\x99\xED\x8F\xC5b\xD1+!(\x97˝ɲ\xFC\x92L&ϣ\xD1(\xE9\xBAN\x92$\xD1n\xB7\xA3\xE1pH\x9DN\x87\x8D\x86\xB1\xD9l\xAE\xCB\xE5\xF2\xB7T*\x95T۶\xEB\xB1X,\x91\xC9d\x883P\xAF\xD7s`\x87\xC3a\xE2\x8CT\xADV\xA9\xDDn(\x8A\x92R8 \xABiZ\xC2\xEB\xF5R\xB3\xD9t`\x94\x80\x83,\x82\xE17\x8D\xB2b\xBD^\xDF\xFB\xFD~\xC7\xC0\xED\xEC\xC1\x81\\xF7\x85\xC7\xE3\xA1\xEDv\xEB\xC6l\xF0\x83/\xB89\xE6\xB4\xC0\xED\x82l\xE0\xC0\xB8-7\xF6`cxϘ\x82\xF7\xF09\x99LP\xAB\xF3ҁ:\xBA \xFC\x98,\xF3-1\x9B\xCD*\xD3\xE9\x94L\xD3$^\xE2\xBF\xDE\xD0\xEC\xF03Ud~\xF0+\x89\xDCpz\x8F\xC2\xCB\xD01\xDC\xEF\xF71\xFE\xEF+/\x81\xC9b\xB1h\x83\xC1K.A_\xADV<\x9F\xCF        \xC2 \xA0\xC1`\xD02#\xDF\xEDv\xEB\xCEo\xC4        \xBC\xBC\x83T:\x9D\xBE\xE3\xE0+\xDEz\x85\x98\xD6;\x97\xFFZ\xAB՞\xB8\xC4:\xB3\xAB}*\xC3$OY',\x8D\xB5?c\xBE\xFC\xB2~X\xCE2\xFF h\xD8\xA7Z[\ IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGray2xpng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray@2x.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray@2x.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGray@2x.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR \xAF\xD3 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 TIDATH
-\xAD\x96\xDBK\xA5U\xC6\xD7\xF7}nh\x9Ax@\xD9:\xC1\xD6ȋ\xBC\x8B\xA0
-\xA5\xA0\xA0\x9B\xC1+\xE76\xA9\xBF \xA7\xFF e.\xBCp@\xE6B\x84\xA0 ;\H0!\x90\xD2R\x99<\xE7\xF9\xB8=\xED\xAD=\xBF5\xBE\x9B\x8D\x9D\xC7\xDEo\x9D\x9F\xE7=\xACo\xADtuu\xB9\xF2\xF2rW[[\xEB\xCE\xCE\xCE\xDC\xE8\xE8\xA8K\xA7\xD3.w~~\x97\xBE\xE7\x9CkQ\xBBB\xF5WT\x8F\xA4HZ}\xA3\xEA[S\xFD\xA1\xEA_vww/\xFA\x91\xF8}}}.\x8F\xBB0\xDD\xDCܜ[^^\x86\xB0J\xEDO\xA5w\xA4\xB8\xB1\xB1\xD1\xB8\xE3\xE3c\x93\x97\x97\xE7
-\xDD\xC8ȈokMZz_\xDA\xD1\xD3ӳr\x99+p\xD3\xD3\xD3\xDE<\x91\xBE-+?\xCF\xC9\xC9)\xC2˚\x9A\x8B\xC5\uu\xB5\xCE\x80\xC3NOO\xDD\xC2\x9B\x9F\x9Fw\xA9Tj_\xDE} \xB2o\xB3\xE7\xFD\xFD\xFDnee\xC5O\xC1G\xFC\xEF\xCA\xCA\xCA\SS\x93+..v\x87\x87\x87nuu\xD5\xCF\xCB\x{1A8AAA}\xCAUVV\xBA\x82\x82\xB7\xBB\xBB\xEB\xDD\xC6Ɔ7Z8\x8B\xAC\xD3Ȃ\xCE\xCENOrrr\xF2nE_\xC8\xFA\x88\x9C\xD5\xD5\xD59y\xE5\xD6\xD6\xD62\xE1\xB2E\x97K\xC2XQQ\x817njjʭ\xAF\xAF\x83\xA9\xE0\xA4\xDF\xEF\xED\xED\xFD\x8A\xF9\xA1\x98\x97\xBBD\x95\x96\x96\xBAD"qe@\xF0\x830\x8C\xB5`\x80f[[[\xDCa\x85\xC8>Q        \xEA\xEB럊$\x9B\x8C\xB2\xB0\xE5\xE2-\xE5\xE6\x8D\xFC\xFC|\x9F\xF8\xAB\x84\x8B\xF9\x97\xC5\xC8\xD8<`!`\xB7\xB6\xB6\xDE\xCAQ\xE2o\xE3&\xB8N\xD2\xD9E\xD7RX`*O\x91\xF4v\xA8\xCF[t\xF2O0`\xBB\xEA\xBAD\xAC,0\xC1Ǜl\x86zsss\xFD        A\xFD&\x84\x9D&"\x8E\x97\xF1\xA8w\x91\xCD\xCDM_\xDE\xC4ǰ\xC0\x86#\xD4\x8C)a\xFB&\xC2fF\xD8p\x846\xA03\x8Ab\xCDg.\xC1\xD3$TG\x8A\x9DF\xF6,\x84\xAC5#\x82#Tc\x9B\x81\xA3\xA3#\xBF\xAD\x8D\xCC,y\xDA\xD2H\xF8E8#/\xDA\xDB\xFC\xB0s$\x8CNN        L\xAFCbk\xC1\xC2x\xB0\xC5\xF18\xD4Q\xFF\x93v;\xC3+\xCC+]U\x8C\x80\xB5`\xA58~\xBF֤\xB3d2\x99\xB9\xD8l"\x8B\x8C\xF4\xDF!\xB0y\x80\xB2\x96\xC7]&\xD8pp\xC2\xEBRK\xA8L\xE8$\xF2a\xA3Tۮ\xF3\x87Y}\xB94"#\xE1n\xDA\xDF\xDF\xF7w\xD4\xCE\xCE\xCE\xC3\xE1\xE1\xE1\xDEHܱ\xF2\x93ԟ\xFC\x8Eb\xE3\xD2C(!C.[\xDB\xCCr\xB2\xB7\xB7\xE7ukk\xCF'&&:D:\xB5\xB7\xB7\xA7\x86\x86\x86\xD2:\x97\x8A\x8AްP\x99\x81R\x98
-N/\xD8a\x84\xCBH\xF0\x86M\xB0\xB4\xB4twff\xE6\xD9\xFAg\xB7\xA3\xE4\x8F\xF1\xF1\xF1G"\xBBWRR\xF2!\x8B\xC6B\xC6Q\x8E~\xC8l/\xB3I \x82P\xA1\xF2$*\xEF\x81        6QKK\x8BkhhH뙕\xD4cC\xF7\xFF\xEF:y_#\x8Cf)[!&\xC1\xA6\x96K<\xA5\xE6\xEA\xC1rWy\xF9^\xF8\xBFH\xF7<Qss3%dɱ\xB1\xB1\x94\xEE\xCD?\xF8N\x84E
-͋
-W`9 \xD8H(\xF1\xF2δ        \xBE\x99\x9C\x9C옝\x9D\x9D\xE4\xB44\xF3\xEC
-x@&\xE1\xBE\xE5\x9A\xF0\x924\xD2\xA7\ϭ\xD7\xD2W\xB2\xE7\xA5        \xF5gD\xEB~\x93n˰\x8DG2r]\x83i\xE9\xAFR\xEA\xF1D\xB4 \xC3r\xAC\x89{AZ%}\xB2\xF5T\xF9\xE1\xEFƃ\xC7\xD2'\xAFLUL^-\xFF!\xE2a\x994&}N\x9A-ğ{C\x8A#P\x9F\x97\xBF \x9C\xFF\xB9iHЏ\xAC IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGreenpng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR
- \xF4\x96\xD2 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 \xFEIDAT(}R;oA\x9Eۋώ\x82\x8D0\x88$(\x84G\x94"
-\xA2K\xE8         \x84\x94\x8E\x94
-
-)\xA0\xA2 !QQDD \xF3\x88N\xC1ۉ}>{\xB7{\xB7\xBB̜\x88ʬ\xBE\x9D\xDDo\xBEy\xDCÂ?v\xF5\xF5\x8C#y|\xCB\xC9g\xAE\xE4\xED\xE1Y\xCF\xEF:\x85\x91\xA2\xE4*x\x85\xFCc\xE4\xEF?:\xBF"In\xD16\xFF|강\xB1\x96/\x9D;{z\xCF\x94\xB3\xE3\xC0,\xB4Q\xD0\xDF`\xB5\xBF/jOޚ\xD8\xCC/_z\xF7Ú{6\xE5(\xA1+''NM\xDE(߁
-\xF1\\xFE        }f\x8F\xC0D\xFE\xFA1xظU\xF7\xE3{;˦\xEDc\xD7J\xB7\xF7\x8E
-/\x94\x9CCЍ\xB7\xA0\xBC\x81@\xF94@\xEA둛\xF2\x91!\xF4\x84\xD1f\xD8\xE5\xE6\xC8@ʹ\xF1\xB4z\xAAޱQW\x8A\x93\x8E\xF4\xCC(s.\xCBr8\xBF\xDE!\xFD\xF7Jqґ\x93 C=\xF0n\xD6\xEBia\xD23\xA3M"t\xCA$\xBB\xE5`\\xE9\xB0SȤ\xAF>o\xF16D\x9A\x83\xF5\xDFD\xE2)\xBE\xB4@\xF6\x95\xCB¦|\x8A /\xEE@\xA88$&\xC6俋\xEE\xC4S<j\xE3\xF5v\xDFk\xFB&\x87.' \x8B\xF1ǚ\xD4\xCD\xE0\xD28N~\xE2A'nA\xA7փ\xA0&\xDCw.\xDA\xD2O\xFCh3\xFE\x9Auf\x93P\xB9\xE0\xF0|\xE8\xC5]\xE8q\xBC
-\xFA\xF5\x82u\xE1\xAE-\xB5\xBD*\xAF\xA4\xBF\x96\xCE:\x85\x81\xE9\xE3\xA3\xD7K\x99v\x8E\x9Dѱ\x96\xB1@K\xB3ʛ\xF2\xE5\x97\xCD%\xE9%Ԋ\xED$zQF\xECG\xDB\xD6\xC3C\xD1@\xA4\xF37\xE8\xEA-\x81J.\xB8 IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesNetworkBarGreen2xpng"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen@2x.png (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen@2x.png        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/NetworkBarGreen@2x.png        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-\x89PNG
-
-
-IHDR \xAF\xD3 \x99iTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:rights>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">Copyright © 2013 Apple Inc. All rights reserved.</rdf:li>
- </rdf:Alt>
- </dc:rights>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/">
- <xmp:CreatorTool>Adobe ImageReady</xmp:CreatorTool>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-Yp\xC5 <IDATH
-\xADV]hU>\xF7\xCE\xFEd\xBBI\x9BMR\xED\x8FVB\xFA\x93Ж\xE2\x83E\xB0\x95j\xD4D\xE8\x9BD\xA1\xA0\xAF\x82\xD8
-\x82\xAF
-}Q\xC5>\xF8 \xB4*-ԟBkE*\x8AI\xDAB\x93\xB4
-\xE9\xD2l\xB3\xD9\xFFٙ\xB9\xE3\xF7\xDD\xD9        m\xB5\xB4)\x9E\xE5\xEC\xCC\xDC9\xE7\xFB\xEE9\xF7̹W\xBDxv\xAB<\x92[#\x9BڷI\xFAr\xEA\xCAq        \xBDPD\x8B\x88\x91U&\xF7\xE2n\x8F\xD2jeh\xB8w\xA0\x94 c\xE71v\xF7'\xB4\xA3\x8E\xDF\xF9}\xF3\xEA\x8D\xD1aY\x9F\xDD,\x8EJ\xC8h\xF9w\xB9:sE\x8C\xF6\xE9\xA4zO'\xD4 ʎG\x9F\x97\xA2W\x90\xBA\xA9Z\x98\x8C\xCEJg\xB2[NMcb3?\xFC\xBEO\x8F^\xBF\x93K]\xFE̟̜4\xCCn}\xA5S\xAA\xBD\xF5\x80u<!i\x9D\x91\x81쐬Ht\xDF\xE6\xBF\xE0d\xBC:*\xAE\xA9\xDBIN\\xD3+0zd'o5V\xC6^\x92\xA9\xFCe\xF1kF$\x947\xF1\xF2CD#]}9ym\xCD\xDBғꓲ_\x94\xC9\xFA\xDF2Q\x93\xAA_\xB6\xFE\xD9D\x87\xF4/\x94u\x99\xF5ґ蔹\xE6u\xF9\xE4\xEAr\xF3\xFA\xBC\x9D0\x8C\xDE\xD9G1\x99>\xB3E\x82\xBA!\xD1 8\xEA\xB4i\xA7\xB7\xB7W\x9E\xCA\xEDB$m\x96 \x8F\x9D\x94\x84\xAEi\xC8\xCF\xF3\xDFI>\x9Fgfdh\xDF\xF7\xFBƾ\xA5\xBD\xF6\xABH\xAEkV)-_\x80\xC8\xE9~\xA8K\xB6瞻o\x82p"\x8C\x98\xA3/1\x88E\xCC]\xDF\xAE\xB2D\xA6\x89h\xAA\xE6]\xAFX\xDE\xDBE\xA2\xEE/IJH_f\x83X\xC4$6m\xB4_7kq\xE1\xC3\xF2D\xCE.<gw\xAFt\xD1\xFENY$C\xF1\xAB%#;\xBEܸ6\x81\xDE\xCF0ӝ        I\xE9\x94L\xD6.\xA1\x84k\xA8j~HK\x97j\x804\x83X\xC4\x83\xD0\xC1Z\xED\xD7X\x9F]:\xA5%۞\x95\xA7Sh\xF8\xA0$\x9C}\x89A,b;Y\xF8\xC1e\x9C\xAC\xAC\xCD\xF4/=\x84\xBBx\x8B\x98\xC4Ǡ<ӍR\xB4\xE63\x8Dɻ\xB8-}8\xC6"69\xB8I|\xA8V\xF2\xFF%\x8BXvrq\xC5M\x80/5h\*\xB1/\xB1\x88\x89|>x\xA1\x87\xEE\x93\xB5B\x8C\xAD\x96t%z&\xB0\x88\xD9_c\xAC\xC8\xAByi\xA0\xACM\x889Q *\xEB\xD5\xF2'1mg\x87\xF6*\xC1\xAF\x88[\xF4\xA5i\v{;#vإ\x90E\xB6Q4\xC4 1\x89
-\x8E)\xED\xFC_\xB9=P\xD9i\xC0
-\x90Q\xDD/YLB\xFAZ`-\xE2\xFC\xDFt\xE1|\xE5x\xF7\xA6'\xF5J]*A        \xB9m\x8A\xDFZ3.(ghӂ\xFFX\xE2g\xFB6\\xFAЗ\xC4"&\xB1\xC9\xE1\x94.7ܮ\xA1\xEC\x80h5\x80&(&\xE9\x89Jb\xBFV\x8E(\xA5b\\x9D\xAD\xA4e\x94\xA4(\xBD6\xD4#)\xB2P*J-ߔ\xDA,t\xC6=1~$\xFF9\xF7\xB7Yj\xCBoF\x83M\xA2\xEFY2Ir\xF6 R CJق]\x8Cq
-
-\xA9\x81H\xA4T.Y\x92\xF2TC\xBCRP\x9F\xFE\xBAp\xB0~\xC3;\xEF<{d\x83\xE1\xE3٠\xAD;9\xB7\xAC7\xB5\x83y\xA5\xF8
-a\xA7Q\x8C\x80L\x8D\xFD\xD94\x9Ci2M\xA4
-\x8B\xD4m+͗\xA5qóDvl\xA4\xEC\xD0\xECO\xA7\x97O$;\xEC\xA1fz\xF2\xE8\xDCY\x90ήI`\xDB0~S\x92J\xB6*\xB4I\xA5\xD2vcS\x8C\xC2\xD4\xD9\xE2i\xBAQeU\xC0\xAB3nt\xBD\xEA&&L\xA7i\xAF\xF6\xFC\xB0\xD9b\xCB\xED\xC1\xF3к\xBD=\xDBs\x83\xD9w \x9EIdqJkI\xB4iK\xC6N|\xABp\xD3d\xF9\xFA\xECg\xAE\xDD@\xF9\\x9F\xAB\xBE?yl\xEE؎B\xE7裆Oo\xB13\xF0ʾ\xFC\xF8\xCA\xC5\xD5\xEB\xCFm\xCA\xF6<\xFC̊Wӹ\xC4\xEEd\xBB\xA3\x9DLD\x86\xE3"\x8DR\x8B}L\xA8\x96g|+Ɲ\xF7OΞY\xF8l\xFEB\x95\xE0\xD0kP+\x8A\xC8\xF8\xA8\xC5ٵ"ۈ\xB7N\xE7\x86e==\xDBڟn[\x99|RkՉ\xAC
-\xB4\xFC\xA2K(\xE3ƄE\xAC˹\xB9?*g\x8B\x97j$`\x83\xBB\xB5\x91D\x86\x88\x88D8\xD8j\xB3d\xC9\xD2z\xDA\x8D7\xF7\x86ʃ\xE3ԅ\xDE&\xF7!!'G|]\xD2\xBDU\xB8\xAF\xB0s\xA0\x8C\xE0_\xB3\xF2._]\xFAo&\xB7\xAA IEND\xAEB`\x82
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,93 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-/* These keyframes try to reproduce the 12 discrete steps seen in a standard system progress indicator. */
-@-webkit-keyframes discrete-spinner {
- 0% {
- background-image: url(Images/IndeterminateProgressSpinner1.svg);
- }
-
- 8.333% {
- background-image: url(Images/IndeterminateProgressSpinner2.svg);
- }
-
- 16.666% {
- background-image: url(Images/IndeterminateProgressSpinner3.svg);
- }
-
- 25.000% {
- background-image: url(Images/IndeterminateProgressSpinner4.svg);
- }
-
- 33.333% {
- background-image: url(Images/IndeterminateProgressSpinner5.svg);
- }
-
- 41.666% {
- background-image: url(Images/IndeterminateProgressSpinner6.svg);
- }
-
- 50.000% {
- background-image: url(Images/IndeterminateProgressSpinner7.svg);
- }
-
- 58.333% {
- background-image: url(Images/IndeterminateProgressSpinner8.svg);
- }
-
- 66.666% {
- background-image: url(Images/IndeterminateProgressSpinner9.svg);
- }
-
- 75.000% {
- background-image: url(Images/IndeterminateProgressSpinner10.svg);
- }
-
- 83.333% {
- background-image: url(Images/IndeterminateProgressSpinner11.svg);
- }
-
- 91.666% {
- background-image: url(Images/IndeterminateProgressSpinner12.svg);
- }
-
- 100% {
- background-image: url(Images/IndeterminateProgressSpinner1.svg);
- }
-}
-
-.indeterminate-progress-spinner {
- background-image: url(Images/IndeterminateProgressSpinner1.svg);
- background-repeat: no-repeat;
- background-size: 100% 100%;
-
- width: 16px;
- height: 16px;
-
- -webkit-animation-name: discrete-spinner;
- -webkit-animation-duration: 1s;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-timing-function: step-start;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndeterminateProgressSpinner = function()
-{
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.IndeterminateProgressSpinner.StyleClassName;
-}
-
-WebInspector.IndeterminateProgressSpinner.StyleClassName = "indeterminate-progress-spinner";
-
-WebInspector.IndeterminateProgressSpinner.prototype = {
- constructor: WebInspector.IndeterminateProgressSpinner,
-
- // Public
-
- get element()
- {
- return this._element;
- }
-}
-
-WebInspector.IndeterminateProgressSpinner.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabasejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabase.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabase.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabase.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,80 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabase = function(name, securityOrigin, version, objectStores)
-{
- WebInspector.Object.call(this);
-
- this._name = name;
- this._securityOrigin = securityOrigin;
- this._host = parseSecurityOrigin(securityOrigin).host;
- this._version = version;
- this._objectStores = objectStores || [];
-
- for (var objectStore of this._objectStores)
- objectStore.establishRelationship(this);
-};
-
-WebInspector.IndexedDatabase.TypeIdentifier = "indexed-database";
-WebInspector.IndexedDatabase.NameCookieKey = "indexed-database-name";
-WebInspector.IndexedDatabase.HostCookieKey = "indexed-database-host";
-
-WebInspector.IndexedDatabase.prototype = {
- constructor: WebInspector.IndexedDatabase,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get name()
- {
- return this._name;
- },
-
- get securityOrigin()
- {
- return this._securityOrigin;
- },
-
- get host()
- {
- return this._host;
- },
-
- get version()
- {
- return this._version;
- },
-
- get objectStores()
- {
- return this._objectStores;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.IndexedDatabase.NameCookieKey] = this._name;
- cookie[WebInspector.IndexedDatabase.HostCookieKey] = this._host;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseEntryDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseEntryDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseEntryDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseEntryDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseEntryDataGridNode = function(entry)
-{
- WebInspector.DataGridNode.call(this, entry);
-
- this._entry = entry;
-};
-
-WebInspector.IndexedDatabaseEntryDataGridNode.prototype = {
- constructor: WebInspector.IndexedDatabaseEntryDataGridNode,
- __proto__: WebInspector.DataGridNode.prototype,
-
- // Public
-
- get entry()
- {
- return this._entry;
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- var value = this._entry[columnIdentifier];
-
- if (value instanceof WebInspector.RemoteObject) {
- switch (value.type) {
- case "object":
- case "array":
- var propertiesSection = new WebInspector.ObjectPropertiesSection(value, value.description);
- propertiesSection.editable = false;
- return propertiesSection.element;
-
- case "string":
- return "\"" + value.description + "\"";
-
- default:
- return value.description;
- }
- }
-
- return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseHostTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseHostTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseHostTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseHostTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseHostTreeElement = function(host)
-{
- WebInspector.StorageTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, WebInspector.displayNameForHost(host), null);
-
- this._host = host;
-
- this.hasChildren = true;
-};
-
-WebInspector.IndexedDatabaseHostTreeElement.prototype = {
- constructor: WebInspector.IndexedDatabaseHostTreeElement,
- __proto__: WebInspector.StorageTreeElement.prototype,
-
- // Public
-
- get name()
- {
- return WebInspector.displayNameForHost(this._host);
- },
-
- get categoryName()
- {
- return WebInspector.UIString("Indexed Databases");
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStorejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStore.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStore.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStore.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStore = function(name, keyPath, autoIncrement, indexes)
-{
- WebInspector.Object.call(this);
-
- this._name = name;
- this._keyPath = keyPath;
- this._autoIncrement = autoIncrement || false;
- this._indexes = indexes || [];
- this._parentDatabase = null;
-
- for (var index of this._indexes)
- index.establishRelationship(this);
-};
-
-WebInspector.IndexedDatabaseObjectStore.TypeIdentifier = "indexed-database-object-store";
-WebInspector.IndexedDatabaseObjectStore.NameCookieKey = "indexed-database-object-store-name";
-WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey = "indexed-database-object-store-key-path";
-
-WebInspector.IndexedDatabaseObjectStore.prototype = {
- constructor: WebInspector.IndexedDatabaseObjectStore,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get name()
- {
- return this._name;
- },
-
- get keyPath()
- {
- return this._keyPath;
- },
-
- get autoIncrement()
- {
- return this._autoIncrement;
- },
-
- get parentDatabase()
- {
- return this._parentDatabase;
- },
-
- get indexes()
- {
- return this._indexes;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.IndexedDatabaseObjectStore.NameCookieKey] = this._name;
- cookie[WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey] = this._keyPath;
- },
-
- // Protected
-
- establishRelationship: function(parentDatabase)
- {
- this._parentDatabase = parentDatabase || null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.indexed-database-object-store > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
-
-.content-view.indexed-database-object-store > .data-grid td .section .header {
- padding: 0 0 0 18px;
- min-height: initial;
- color: inherit;
-}
-
-.content-view.indexed-database-object-store > .data-grid td .section .header::before {
- top: 2px;
-}
-
-.content-view.indexed-database-object-store > .data-grid td .section .header .title {
- line-height: initial;
-}
-
-.content-view.indexed-database-object-store > .data-grid table.data {
- background-image: none;
-}
-
-.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(even) {
- background-color: white;
-}
-
-.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(odd) {
- background-color: rgb(243, 246, 250);
-}
-
-.content-view.indexed-database-object-store > .data-grid table.data tr.filler {
- /* FIXME: This should show an alternating stripe, but I couldn't make it work. */
- background-color: white;
-}
-
-.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .section .header::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
-}
-
-.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .section.expanded .header::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
-}
-
-.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li.parent::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
-}
-
-.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li.parent.expanded::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
-}
-
-.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li * {
- color: inherit;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,152 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreContentView = function(objectStoreOrIndex)
-{
- WebInspector.ContentView.call(this, objectStoreOrIndex);
-
- this.element.classList.add(WebInspector.IndexedDatabaseObjectStoreContentView.StyleClassName);
-
- if (objectStoreOrIndex instanceof WebInspector.IndexedDatabaseObjectStore) {
- this._objectStore = objectStoreOrIndex;
- this._objectStoreIndex = null;
- } else if (objectStoreOrIndex instanceof WebInspector.IndexedDatabaseObjectStoreIndex) {
- this._objectStore = objectStoreOrIndex.parentObjectStore;
- this._objectStoreIndex = objectStoreOrIndex;
- }
-
- function displayKeyPath(keyPath)
- {
- if (!keyPath)
- return "";
- if (keyPath instanceof Array)
- return keyPath.join(WebInspector.UIString(", "));
- console.assert(keyPath instanceof String || typeof keyPath === "string");
- return keyPath;
- }
-
- var displayPrimaryKeyPath = displayKeyPath(this._objectStore.keyPath);
-
- var columnInfo = {
- primaryKey: {title: displayPrimaryKeyPath ? WebInspector.UIString("Primary Key \u2014 %s").format(displayPrimaryKeyPath) : WebInspector.UIString("Primary Key")},
- key: {},
- value: {title: WebInspector.UIString("Value")}
- };
-
- if (this._objectStoreIndex) {
- // When there is an index, show the key path in the Key column.
- var displayIndexKeyPath = displayKeyPath(this._objectStoreIndex.keyPath);
- columnInfo.key.title = WebInspector.UIString("Index Key \u2014 %s").format(displayIndexKeyPath);
- } else {
- // Only need to show Key for indexes -- it is the same as Primary Key
- // when there is no index being used.
- delete columnInfo.key;
- }
-
- this._dataGrid = new WebInspector.DataGrid(columnInfo);
- this.element.appendChild(this._dataGrid.element);
-
- this._dataGrid.scrollContainer.addEventListener("scroll", this._dataGridScrolled.bind(this));
-
- this._entries = [];
-
- this._fetchMoreData();
-};
-
-WebInspector.IndexedDatabaseObjectStoreContentView.StyleClassName = "indexed-database-object-store";
-
-WebInspector.IndexedDatabaseObjectStoreContentView.prototype = {
- constructor: WebInspector.IndexedDatabaseObjectStoreContentView,
- __proto__: WebInspector.ContentView.prototype,
-
- // Public
-
- closed: function()
- {
- this._reset();
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.IndexedDatabaseObjectStore;
- cookie.securityOrigin = this._objectStore.parentDatabase.securityOrigin;
- cookie.databaseName = this._objectStore.parentDatabase.name;
- cookie.objectStoreName = this._objectStore.name;
- cookie.objectStoreIndexName = this._objectStoreIndex && this._objectStoreIndex.name;
- },
-
- updateLayout: function()
- {
- this._dataGrid.updateLayout();
- },
-
- // Private
-
- _reset: function()
- {
- for (var entry of this._entries) {
- entry.primaryKey.release();
- entry.key.release();
- entry.value.release();
- }
-
- this._entries = [];
- this._dataGrid.removeChildren();
- },
-
- _dataGridScrolled: function()
- {
- if (!this._moreEntriesAvailable || !this._dataGrid.isScrolledToLastRow())
- return;
-
- this._fetchMoreData();
- },
-
- _fetchMoreData: function()
- {
- if (this._fetchingMoreData)
- return;
-
- function processEntries(entries, moreAvailable)
- {
- this._entries = this._entries.concat(entries);
- this._moreEntriesAvailable = moreAvailable;
-
- for (var entry of entries) {
- var dataGridNode = new WebInspector.IndexedDatabaseEntryDataGridNode(entry);
- this._dataGrid.appendChild(dataGridNode);
- }
-
- delete this._fetchingMoreData;
-
- if (moreAvailable && this._dataGrid.isScrolledToLastRow())
- this._fetchMoreData();
- }
-
- this._fetchingMoreData = true;
-
- WebInspector.storageManager.requestIndexedDatabaseData(this._objectStore, this._objectStoreIndex, this._entries.length, 25, processEntries.bind(this));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndex.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndex.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndex.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreIndex = function(name, keyPath, unique, multiEntry)
-{
- WebInspector.Object.call(this);
-
- this._name = name;
- this._keyPath = keyPath;
- this._unique = unique || false;
- this._multiEntry = multiEntry || false;
- this._parentObjectStore = null;
-};
-
-WebInspector.IndexedDatabaseObjectStoreIndex.TypeIdentifier = "indexed-database-object-store-index";
-WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey = "indexed-database-object-store-index-name";
-WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey = "indexed-database-object-store-index-key-path";
-
-WebInspector.IndexedDatabaseObjectStoreIndex.prototype = {
- constructor: WebInspector.IndexedDatabaseObjectStoreIndex,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get name()
- {
- return this._name;
- },
-
- get keyPath()
- {
- return this._keyPath;
- },
-
- get unique()
- {
- return this._unique;
- },
-
- get multiEntry()
- {
- return this._multiEntry;
- },
-
- get parentObjectStore()
- {
- return this._parentObjectStore;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey] = this._name;
- cookie[WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey] = this._keyPath;
- },
-
- // Protected
-
- establishRelationship: function(parentObjectStore)
- {
- this._parentObjectStore = parentObjectStore || null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndexTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndexTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndexTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreIndexTreeElement = function(objectStoreIndex)
-{
- console.assert(objectStoreIndex instanceof WebInspector.IndexedDatabaseObjectStoreIndex);
-
- this._objectStoreIndex = objectStoreIndex;
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName, objectStoreIndex.name, null, objectStoreIndex, false);
-
- this.small = true;
-};
-
-WebInspector.IndexedDatabaseObjectStoreIndexTreeElement.IconStyleClassName = "database-table-icon";
-
-WebInspector.IndexedDatabaseObjectStoreIndexTreeElement.prototype = {
- constructor: WebInspector.IndexedDatabaseObjectStoreIndexTreeElement,
- __proto__: WebInspector.GeneralTreeElement.prototype,
-
- // Public
-
- get objectStoreIndex()
- {
- return this._objectStoreIndex;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreTreeElement = function(objectStore)
-{
- console.assert(objectStore instanceof WebInspector.IndexedDatabaseObjectStore);
-
- this._objectStore = objectStore;
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName, objectStore.name, null, objectStore, !!this._objectStore.indexes.length);
-
- this.small = true;
-};
-
-WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName = "database-table-icon";
-
-WebInspector.IndexedDatabaseObjectStoreTreeElement.prototype = {
- constructor: WebInspector.IndexedDatabaseObjectStoreTreeElement,
- __proto__: WebInspector.GeneralTreeElement.prototype,
-
- // Public
-
- get objectStore()
- {
- return this._objectStore;
- },
-
- // Overrides from TreeElement (Protected)
-
- oncollapse: function()
- {
- this.shouldRefreshChildren = true;
- },
-
- onpopulate: function()
- {
- if (this.children.length && !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
-
- for (var objectStoreIndex of this._objectStore.indexes)
- this.appendChild(new WebInspector.IndexedDatabaseObjectStoreIndexTreeElement(objectStoreIndex));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseTreeElement = function(indexedDatabase)
-{
- console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
-
- this._indexedDatabase = indexedDatabase;
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseTreeElement.IconStyleClassName, indexedDatabase.name, null, indexedDatabase, !!this._indexedDatabase.objectStores.length);
-
- this.small = true;
-};
-
-WebInspector.IndexedDatabaseTreeElement.IconStyleClassName = "database-icon";
-
-WebInspector.IndexedDatabaseTreeElement.prototype = {
- constructor: WebInspector.IndexedDatabaseTreeElement,
-
- // Public
-
- get indexedDatabase()
- {
- return this._indexedDatabase;
- },
-
- // Overrides from TreeElement (Protected)
-
- oncollapse: function()
- {
- this.shouldRefreshChildren = true;
- },
-
- onpopulate: function()
- {
- if (this.children.length && !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
-
- for (var objectStore of this._indexedDatabase.objectStores)
- this.appendChild(new WebInspector.IndexedDatabaseObjectStoreTreeElement(objectStore));
- }
-};
-
-WebInspector.IndexedDatabaseTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorBackendjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorBackend.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorBackend.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorBackend.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,287 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @constructor
- */
-function InspectorBackendClass()
-{
- this._lastCallbackId = 1;
- this._pendingResponsesCount = 0;
- this._callbacks = {};
- this._domainDispatchers = {};
- this._eventArgs = {};
- this._replyArgs = {};
-
- this.dumpInspectorTimeStats = false;
- this.dumpInspectorProtocolMessages = false;
-}
-
-InspectorBackendClass.prototype = {
- _wrap: function(callback, method)
- {
- var callbackId = this._lastCallbackId++;
- if (!callback)
- callback = function() {};
-
- this._callbacks[callbackId] = callback;
- callback.methodName = method;
- if (this.dumpInspectorTimeStats)
- callback.sendRequestTime = Date.now();
-
- return callbackId;
- },
-
- _getAgent: function(domain)
- {
- var agentName = domain + "Agent";
- if (!window[agentName])
- window[agentName] = {};
- return window[agentName];
- },
-
- registerCommand: function(method, signature, replyArgs)
- {
- var domainAndMethod = method.split(".");
- var agent = this._getAgent(domainAndMethod[0]);
-
- agent[domainAndMethod[1]] = this._sendMessageToBackend.bind(this, method, signature);
- agent[domainAndMethod[1]]["invoke"] = this._invoke.bind(this, method, signature);
- agent[domainAndMethod[1]]["supports"] = this._supports.bind(this, method, signature);
- this._replyArgs[method] = replyArgs;
- },
-
- registerEnum: function(type, values)
- {
- var domainAndMethod = type.split(".");
- var agent = this._getAgent(domainAndMethod[0]);
-
- agent[domainAndMethod[1]] = values;
- },
-
- registerEvent: function(eventName, params)
- {
- this._eventArgs[eventName] = params;
- },
-
- _invoke: function(method, signature, args, callback)
- {
- this._wrapCallbackAndSendMessageObject(method, args, callback);
- },
-
- _supports: function(method, signature, paramName)
- {
- for (var i = 0; i < signature.length; ++i) {
- if (signature[i]["name"] === paramName)
- return true;
- }
-
- return false;
- },
-
- _sendMessageToBackend: function(method, signature, vararg)
- {
- var args = Array.prototype.slice.call(arguments, 2);
- var callback = typeof args.lastValue === "function" ? args.pop() : null;
-
- var params = {};
- var hasParams = false;
- for (var i = 0; i < signature.length; ++i) {
- var param = signature[i];
- var paramName = param["name"];
- var typeName = param["type"];
- var optionalFlag = param["optional"];
-
- if (!args.length && !optionalFlag) {
- console.error("Protocol Error: Invalid number of arguments for method '" + method + "' call. It must have the following arguments '" + JSON.stringify(signature) + "'.");
- return;
- }
-
- var value = args.shift();
- if (optionalFlag && typeof value === "undefined") {
- continue;
- }
-
- if (typeof value !== typeName) {
- console.error("Protocol Error: Invalid type of argument '" + paramName + "' for method '" + method + "' call. It must be '" + typeName + "' but it is '" + typeof value + "'.");
- return;
- }
-
- params[paramName] = value;
- hasParams = true;
- }
-
- if (args.length === 1 && !callback) {
- if (typeof args[0] !== "undefined") {
- console.error("Protocol Error: Optional callback argument for method '" + method + "' call must be a function but its type is '" + typeof args[0] + "'.");
- return;
- }
- }
-
- this._wrapCallbackAndSendMessageObject(method, hasParams ? params : null, callback);
- },
-
- _wrapCallbackAndSendMessageObject: function(method, params, callback)
- {
- var messageObject = {};
- messageObject.method = method;
- if (params)
- messageObject.params = params;
- messageObject.id = this._wrap(callback, method);
-
- if (this.dumpInspectorProtocolMessages)
- console.log("frontend: " + JSON.stringify(messageObject));
-
- ++this._pendingResponsesCount;
- this.sendMessageObjectToBackend(messageObject);
- },
-
- sendMessageObjectToBackend: function(messageObject)
- {
- var message = JSON.stringify(messageObject);
- InspectorFrontendHost.sendMessageToBackend(message);
- },
-
- registerDomainDispatcher: function(domain, dispatcher)
- {
- this._domainDispatchers[domain] = dispatcher;
- },
-
- dispatch: function(message)
- {
- if (this.dumpInspectorProtocolMessages)
- console.log("backend: " + ((typeof message === "string") ? message : JSON.stringify(message)));
-
- var messageObject = (typeof message === "string") ? JSON.parse(message) : message;
-
- if ("id" in messageObject) { // just a response for some request
- if (messageObject.error) {
- if (messageObject.error.code !== -32000)
- this.reportProtocolError(messageObject);
- }
-
- var callback = this._callbacks[messageObject.id];
- if (callback) {
- var argumentsArray = [];
- if (messageObject.result) {
- if (callback.expectsResultObject) {
- // The callback expects results as an object with properties, this is useful
- // for backwards compatibility with renamed or different parameters.
- argumentsArray.push(messageObject.result);
- } else {
- var paramNames = this._replyArgs[callback.methodName];
- if (paramNames) {
- for (var i = 0; i < paramNames.length; ++i)
- argumentsArray.push(messageObject.result[paramNames[i]]);
- }
- }
- }
-
- var processingStartTime;
- if (this.dumpInspectorTimeStats && callback.methodName)
- processingStartTime = Date.now();
-
- argumentsArray.unshift(messageObject.error ? messageObject.error.message : null);
- callback.apply(null, argumentsArray);
- --this._pendingResponsesCount;
- delete this._callbacks[messageObject.id];
-
- if (this.dumpInspectorTimeStats && callback.methodName)
- console.log("time-stats: " + callback.methodName + " = " + (processingStartTime - callback.sendRequestTime) + " + " + (Date.now() - processingStartTime));
- }
-
- if (this._scripts && !this._pendingResponsesCount)
- this.runAfterPendingDispatches();
-
- return;
- } else {
- var method = messageObject.method.split(".");
- var domainName = method[0];
- var functionName = method[1];
- if (!(domainName in this._domainDispatchers)) {
- console.error("Protocol Error: the message is for non-existing domain '" + domainName + "'");
- return;
- }
- var dispatcher = this._domainDispatchers[domainName];
- if (!(functionName in dispatcher)) {
- console.error("Protocol Error: Attempted to dispatch an unimplemented method '" + messageObject.method + "'");
- return;
- }
-
- if (!this._eventArgs[messageObject.method]) {
- console.error("Protocol Error: Attempted to dispatch an unspecified method '" + messageObject.method + "'");
- return;
- }
-
- var params = [];
- if (messageObject.params) {
- var paramNames = this._eventArgs[messageObject.method];
- for (var i = 0; i < paramNames.length; ++i)
- params.push(messageObject.params[paramNames[i]]);
- }
-
- var processingStartTime;
- if (this.dumpInspectorTimeStats)
- processingStartTime = Date.now();
-
- dispatcher[functionName].apply(dispatcher, params);
-
- if (this.dumpInspectorTimeStats)
- console.log("time-stats: " + messageObject.method + " = " + (Date.now() - processingStartTime));
- }
- },
-
- reportProtocolError: function(messageObject)
- {
- console.error("Request with id = " + messageObject.id + " failed. " + JSON.stringify(messageObject.error));
- },
-
- /**
- * @param {string=} script
- */
- runAfterPendingDispatches: function(script)
- {
- if (!this._scripts)
- this._scripts = [];
-
- if (script)
- this._scripts.push(script);
-
- if (!this._pendingResponsesCount) {
- var scripts = this._scripts;
- this._scripts = [];
- for (var id = 0; id < scripts.length; ++id)
- scripts[id].call(this);
- }
- }
-}
-
-InspectorBackend = new InspectorBackendClass();
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorFrontendAPIjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,168 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-InspectorFrontendAPI = {
- _loaded: false,
-
- _pendingCommands: [],
-
- savedURL: function(url)
- {
- // FIXME: Not implemented.
- },
-
- appendedToURL: function(url)
- {
- // FIXME: Not implemented.
- },
-
- isDebuggingEnabled: function()
- {
- // FIXME: Not implemented.
- return false;
- },
-
- setDebuggingEnabled: function(enabled)
- {
- // FIXME: Not implemented.
- },
-
- isTimelineProfilingEnabled: function()
- {
- return WebInspector.timelineManager.recordingEnabled;
- },
-
- setTimelineProfilingEnabled: function(enabled)
- {
- if (enabled) {
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.timelineSidebarPanel;
- WebInspector.timelineManager.startRecording();
- } else {
- WebInspector.timelineManager.stopRecording();
- }
- },
-
- isProfilingJavaScript: function()
- {
- return WebInspector.legacyProfileManager.isProfilingJavaScript();
- },
-
- startProfilingJavaScript: function()
- {
- WebInspector.legacyProfileManager.startProfilingJavaScript();
- },
-
- stopProfilingJavaScript: function()
- {
- WebInspector.timelineSidebarPanel.show();
- WebInspector.legacyProfileManager.stopProfilingJavaScript();
- },
-
- setDockSide: function(side)
- {
- WebInspector.updateDockedState(side);
- },
-
- showConsole: function()
- {
- WebInspector.showConsoleView();
-
- WebInspector.quickConsole.prompt.focus();
-
- // If the page is still loading, focus the quick console again after tabindex autofocus.
- if (document.readyState !== "complete")
- document.addEventListener("readystatechange", this);
- },
-
- handleEvent: function(event)
- {
- console.assert(event.type === "readystatechange");
-
- if (document.readyState === "complete") {
- WebInspector.quickConsole.prompt.focus();
- document.removeEventListener("readystatechange", this);
- }
- },
-
- showResources: function()
- {
- WebInspector.ignoreLastContentCookie = true;
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
- WebInspector.navigationSidebar.collapsed = false;
- },
-
- showMainResourceForFrame: function(frameIdentifier)
- {
- WebInspector.ignoreLastContentCookie = true;
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
- WebInspector.resourceSidebarPanel.showSourceCodeForFrame(frameIdentifier, true);
- },
-
- setDockingUnavailable: function(unavailable)
- {
- // Not used.
- },
-
- contextMenuItemSelected: function(id)
- {
- WebInspector.contextMenuItemSelected(id);
- },
-
- contextMenuCleared: function()
- {
- WebInspector.contextMenuCleared();
- },
-
- dispatchMessageAsync: function(messageObject)
- {
- WebInspector.dispatchMessageFromBackend(messageObject);
- },
-
- dispatchMessage: function(messageObject)
- {
- InspectorBackend.dispatch(messageObject);
- },
-
- dispatch: function(signature)
- {
- if (!InspectorFrontendAPI._loaded) {
- InspectorFrontendAPI._pendingCommands.push(signature);
- return null;
- }
-
- var methodName = signature.shift();
- return InspectorFrontendAPI[methodName].apply(InspectorFrontendAPI, signature);
- },
-
- loadCompleted: function()
- {
- InspectorFrontendAPI._loaded = true;
-
- for (var i = 0; i < InspectorFrontendAPI._pendingCommands.length; ++i)
- InspectorFrontendAPI.dispatch(InspectorFrontendAPI._pendingCommands[i]);
-
- InspectorFrontendAPI._pendingCommands = [];
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorFrontendHostStubjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,174 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2013 Seokju Kwon (seokju.kwon@gmail.com)
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-if (!window.InspectorFrontendHost) {
- WebInspector.InspectorFrontendHostStub = function()
- {
- }
-
- WebInspector.InspectorFrontendHostStub.prototype = {
- // Public
-
- initializeWebSocket: function(url)
- {
- var socket = new WebSocket(url);
- socket.addEventListener("open", socketReady.bind(this));
-
- function socketReady()
- {
- this._socket = socket;
-
- this._socket.addEventListener("message", function(message) { InspectorBackend.dispatch(message.data); });
- this._socket.addEventListener("error", function(error) { console.error(error); });
-
- this._sendPendingMessagesToBackendIfNeeded();
- }
- },
-
- bringToFront: function()
- {
- this._windowVisible = true;
- },
-
- closeWindow: function()
- {
- this._windowVisible = false;
- },
-
- requestSetDockSide: function(side)
- {
- InspectorFrontendAPI.setDockSide(side);
- },
-
- setAttachedWindowHeight: function(height)
- {
- },
-
- setAttachedWindowWidth: function(width)
- {
- },
-
- setToolbarHeight: function(width)
- {
- },
-
- moveWindowBy: function(x, y)
- {
- },
-
- loaded: function()
- {
- },
-
- localizedStringsURL: function()
- {
- return undefined;
- },
-
- debuggableType: function()
- {
- return "web";
- },
-
- inspectedURLChanged: function(title)
- {
- document.title = title;
- },
-
- copyText: function(text)
- {
- this._textToCopy = text;
- if (!document.execCommand("copy"))
- console.error("Clipboard access is denied");
- },
-
- openInNewTab: function(url)
- {
- window.open(url, "_blank");
- },
-
- save: function(url, content, base64Encoded, forceSaveAs)
- {
- },
-
- sendMessageToBackend: function(message)
- {
- if (!this._socket) {
- if (!this._pendingMessages)
- this._pendingMessages = [];
- this._pendingMessages.push(message);
- return;
- }
-
- this._sendPendingMessagesToBackendIfNeeded();
-
- this._socket.send(message);
- },
-
- loadResourceSynchronously: function(url)
- {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", url, false);
- xhr.send(null);
-
- if (xhr.status === 200)
- return xhr.responseText;
- return null;
- },
-
- platform: function()
- {
- return (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
- },
-
- beep: function()
- {
- },
-
- // Private
-
- _sendPendingMessagesToBackendIfNeeded: function()
- {
- if (!this._pendingMessages)
- return;
-
- for (var i = 0; i < this._pendingMessages.length; ++i)
- this._socket.send(this._pendingMessages[i]);
-
- delete this._pendingMessages;
- }
- }
-
- InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
-
- WebInspector.dontLocalizeUserInterface = true;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorJSBackendCommandsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorJSBackendCommands.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorJSBackendCommands.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorJSBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,80 +0,0 @@
</span><del>-// File is generated by JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py
-
-// Copyright (c) 2013 Apple Inc. All Rights Reserved.
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-// Console.
-InspectorBackend.registerConsoleDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Console");
-InspectorBackend.registerEnum("Console.ConsoleMessageSource", {XML: "xml", Javascript: "javascript", Network: "network", ConsoleAPI: "console-api", Storage: "storage", Appcache: "appcache", Rendering: "rendering", CSS: "css", Security: "security", Other: "other"});
-InspectorBackend.registerEnum("Console.ConsoleMessageLevel", {Log: "log", Warning: "warning", Error: "error", Debug: "debug"});
-InspectorBackend.registerEnum("Console.ConsoleMessageType", {Log: "log", Dir: "dir", DirXML: "dirxml", Table: "table", Trace: "trace", Clear: "clear", StartGroup: "startGroup", StartGroupCollapsed: "startGroupCollapsed", EndGroup: "endGroup", Assert: "assert", Timing: "timing", Profile: "profile", ProfileEnd: "profileEnd"});
-InspectorBackend.registerEvent("Console.messageAdded", ["message"]);
-InspectorBackend.registerEvent("Console.messageRepeatCountUpdated", ["count"]);
-InspectorBackend.registerEvent("Console.messagesCleared", []);
-InspectorBackend.registerCommand("Console.enable", [], []);
-InspectorBackend.registerCommand("Console.disable", [], []);
-InspectorBackend.registerCommand("Console.clearMessages", [], []);
-InspectorBackend.registerCommand("Console.setMonitoringXHREnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Console.addInspectedNode", [{"name": "nodeId", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("Console.addInspectedHeapObject", [{"name": "heapObjectId", "type": "number", "optional": false}], []);
-
-// Debugger.
-InspectorBackend.registerDebuggerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Debugger");
-InspectorBackend.registerEnum("Debugger.BreakpointActionType", {Log: "log", Evaluate: "evaluate", Sound: "sound", Probe: "probe"});
-InspectorBackend.registerEnum("Debugger.ScopeType", {Global: "global", Local: "local", With: "with", Closure: "closure", Catch: "catch"});
-InspectorBackend.registerEvent("Debugger.globalObjectCleared", []);
-InspectorBackend.registerEvent("Debugger.scriptParsed", ["scriptId", "url", "startLine", "startColumn", "endLine", "endColumn", "isContentScript", "sourceMapURL", "hasSourceURL"]);
-InspectorBackend.registerEvent("Debugger.scriptFailedToParse", ["url", "scriptSource", "startLine", "errorLine", "errorMessage"]);
-InspectorBackend.registerEvent("Debugger.breakpointResolved", ["breakpointId", "location"]);
-InspectorBackend.registerEvent("Debugger.paused", ["callFrames", "reason", "data"]);
-InspectorBackend.registerEvent("Debugger.resumed", []);
-InspectorBackend.registerEvent("Debugger.didSampleProbe", ["sample"]);
-InspectorBackend.registerEvent("Debugger.playBreakpointActionSound", ["breakpointActionId"]);
-InspectorBackend.registerCommand("Debugger.enable", [], []);
-InspectorBackend.registerCommand("Debugger.disable", [], []);
-InspectorBackend.registerCommand("Debugger.setBreakpointsActive", [{"name": "active", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Debugger.setBreakpointByUrl", [{"name": "lineNumber", "type": "number", "optional": false}, {"name": "url", "type": "string", "optional": true}, {"name": "urlRegex", "type": "string", "optional": true}, {"name": "columnNumber", "type": "number", "optional": true}, {"name": "options", "type": "object", "optional": true}], ["breakpointId", "locations"]);
-InspectorBackend.registerCommand("Debugger.setBreakpoint", [{"name": "location", "type": "object", "optional": false}, {"name": "options", "type": "object", "optional": true}], ["breakpointId", "actualLocation"]);
-InspectorBackend.registerCommand("Debugger.removeBreakpoint", [{"name": "breakpointId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Debugger.continueToLocation", [{"name": "location", "type": "object", "optional": false}], []);
-InspectorBackend.registerCommand("Debugger.stepOver", [], []);
-InspectorBackend.registerCommand("Debugger.stepInto", [], []);
-InspectorBackend.registerCommand("Debugger.stepOut", [], []);
-InspectorBackend.registerCommand("Debugger.pause", [], []);
-InspectorBackend.registerCommand("Debugger.resume", [], []);
-InspectorBackend.registerCommand("Debugger.searchInContent", [{"name": "scriptId", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
-InspectorBackend.registerCommand("Debugger.getScriptSource", [{"name": "scriptId", "type": "string", "optional": false}], ["scriptSource"]);
-InspectorBackend.registerCommand("Debugger.getFunctionDetails", [{"name": "functionId", "type": "string", "optional": false}], ["details"]);
-InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
-InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
-
-// Inspector.
-InspectorBackend.registerInspectorDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Inspector");
-InspectorBackend.registerEvent("Inspector.evaluateForTestInFrontend", ["testCallId", "script"]);
-InspectorBackend.registerEvent("Inspector.inspect", ["object", "hints"]);
-InspectorBackend.registerEvent("Inspector.detached", ["reason"]);
-InspectorBackend.registerEvent("Inspector.targetCrashed", []);
-InspectorBackend.registerCommand("Inspector.enable", [], []);
-InspectorBackend.registerCommand("Inspector.disable", [], []);
-
-// Runtime.
-InspectorBackend.registerRuntimeDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Runtime");
-InspectorBackend.registerEnum("Runtime.RemoteObjectType", {Object: "object", Function: "function", Undefined: "undefined", String: "string", Number: "number", Boolean: "boolean"});
-InspectorBackend.registerEnum("Runtime.RemoteObjectSubtype", {Array: "array", Null: "null", Node: "node", Regexp: "regexp", Date: "date"});
-InspectorBackend.registerEnum("Runtime.PropertyPreviewType", {Object: "object", Function: "function", Undefined: "undefined", String: "string", Number: "number", Boolean: "boolean"});
-InspectorBackend.registerEnum("Runtime.PropertyPreviewSubtype", {Array: "array", Null: "null", Node: "node", Regexp: "regexp", Date: "date"});
-InspectorBackend.registerEnum("Runtime.SyntaxErrorType", {None: "none", Irrecoverable: "irrecoverable", UnterminatedLiteral: "unterminated-literal", Recoverable: "recoverable"});
-InspectorBackend.registerEvent("Runtime.executionContextCreated", ["context"]);
-InspectorBackend.registerCommand("Runtime.parse", [{"name": "source", "type": "string", "optional": false}], ["result", "message", "range"]);
-InspectorBackend.registerCommand("Runtime.evaluate", [{"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "contextId", "type": "number", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
-InspectorBackend.registerCommand("Runtime.callFunctionOn", [{"name": "objectId", "type": "string", "optional": false}, {"name": "functionDeclaration", "type": "string", "optional": false}, {"name": "arguments", "type": "object", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
-InspectorBackend.registerCommand("Runtime.getProperties", [{"name": "objectId", "type": "string", "optional": false}, {"name": "ownProperties", "type": "boolean", "optional": true}], ["result", "internalProperties"]);
-InspectorBackend.registerCommand("Runtime.releaseObject", [{"name": "objectId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Runtime.releaseObjectGroup", [{"name": "objectGroup", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Runtime.run", [], []);
-InspectorBackend.registerCommand("Runtime.enable", [], []);
-InspectorBackend.registerCommand("Runtime.disable", [], []);
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.InspectorObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.InspectorObserver.prototype = {
- constructor: WebInspector.InspectorObserver,
-
- // Events defined by the "Inspector" domain.
-
- evaluateForTestInFrontend: function(testCallId, script)
- {
- // FIXME: Not implemented.
- },
-
- inspect: function(payload, hints)
- {
- var remoteObject = WebInspector.RemoteObject.fromPayload(payload);
- if (remoteObject.subtype === "node") {
- WebInspector.domTreeManager.inspectNodeObject(remoteObject);
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
- return;
- }
-
- if (hints.databaseId)
- WebInspector.storageManager.inspectDatabase(hints.databaseId);
- else if (hints.domStorageId)
- WebInspector.storageManager.inspectDOMStorage(hints.domStorageId);
-
- WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
-
- remoteObject.release();
- },
-
- detached: function(reason)
- {
- // FIXME: Not implemented.
- }
-};
-
-WebInspector.InspectorObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceInspectorWebBackendCommandsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,310 +0,0 @@
</span><del>-// File is generated by JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py
-
-// Copyright (c) 2013 Apple Inc. All Rights Reserved.
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-
-// ApplicationCache.
-InspectorBackend.registerApplicationCacheDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "ApplicationCache");
-InspectorBackend.registerEvent("ApplicationCache.applicationCacheStatusUpdated", ["frameId", "manifestURL", "status"]);
-InspectorBackend.registerEvent("ApplicationCache.networkStateUpdated", ["isNowOnline"]);
-InspectorBackend.registerCommand("ApplicationCache.getFramesWithManifests", [], ["frameIds"]);
-InspectorBackend.registerCommand("ApplicationCache.enable", [], []);
-InspectorBackend.registerCommand("ApplicationCache.getManifestForFrame", [{"name": "frameId", "type": "string", "optional": false}], ["manifestURL"]);
-InspectorBackend.registerCommand("ApplicationCache.getApplicationCacheForFrame", [{"name": "frameId", "type": "string", "optional": false}], ["applicationCache"]);
-
-// CSS.
-InspectorBackend.registerCSSDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "CSS");
-InspectorBackend.registerEnum("CSS.StyleSheetOrigin", {User: "user", UserAgent: "user-agent", Inspector: "inspector", Regular: "regular"});
-InspectorBackend.registerEnum("CSS.CSSPropertyStatus", {Active: "active", Inactive: "inactive", Disabled: "disabled", Style: "style"});
-InspectorBackend.registerEnum("CSS.CSSMediaSource", {MediaRule: "mediaRule", ImportRule: "importRule", LinkedSheet: "linkedSheet", InlineSheet: "inlineSheet"});
-InspectorBackend.registerEnum("CSS.RegionRegionOverset", {Overset: "overset", Fit: "fit", Empty: "empty"});
-InspectorBackend.registerEvent("CSS.mediaQueryResultChanged", []);
-InspectorBackend.registerEvent("CSS.styleSheetChanged", ["styleSheetId"]);
-InspectorBackend.registerEvent("CSS.namedFlowCreated", ["namedFlow"]);
-InspectorBackend.registerEvent("CSS.namedFlowRemoved", ["documentNodeId", "flowName"]);
-InspectorBackend.registerEvent("CSS.regionLayoutUpdated", ["namedFlow"]);
-InspectorBackend.registerEvent("CSS.regionOversetChanged", ["namedFlow"]);
-InspectorBackend.registerEvent("CSS.registeredNamedFlowContentElement", ["documentNodeId", "flowName", "contentNodeId", "nextContentNodeId"]);
-InspectorBackend.registerEvent("CSS.unregisteredNamedFlowContentElement", ["documentNodeId", "flowName", "contentNodeId"]);
-InspectorBackend.registerCommand("CSS.enable", [], []);
-InspectorBackend.registerCommand("CSS.disable", [], []);
-InspectorBackend.registerCommand("CSS.getMatchedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "includePseudo", "type": "boolean", "optional": true}, {"name": "includeInherited", "type": "boolean", "optional": true}], ["matchedCSSRules", "pseudoElements", "inherited"]);
-InspectorBackend.registerCommand("CSS.getInlineStylesForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["inlineStyle", "attributesStyle"]);
-InspectorBackend.registerCommand("CSS.getComputedStyleForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["computedStyle"]);
-InspectorBackend.registerCommand("CSS.getAllStyleSheets", [], ["headers"]);
-InspectorBackend.registerCommand("CSS.getStyleSheet", [{"name": "styleSheetId", "type": "string", "optional": false}], ["styleSheet"]);
-InspectorBackend.registerCommand("CSS.getStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}], ["text"]);
-InspectorBackend.registerCommand("CSS.setStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}, {"name": "text", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("CSS.setStyleText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "text", "type": "string", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.setPropertyText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "overwrite", "type": "boolean", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.toggleProperty", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "disable", "type": "boolean", "optional": false}], ["style"]);
-InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "type": "object", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
-InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
-InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
-InspectorBackend.registerCommand("CSS.forcePseudoState", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "forcedPseudoClasses", "type": "object", "optional": false}], []);
-InspectorBackend.registerCommand("CSS.getNamedFlowCollection", [{"name": "documentNodeId", "type": "number", "optional": false}], ["namedFlows"]);
-
-// Canvas.
-InspectorBackend.registerCanvasDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Canvas");
-InspectorBackend.registerEvent("Canvas.contextCreated", ["frameId"]);
-InspectorBackend.registerEvent("Canvas.traceLogsRemoved", ["frameId", "traceLogId"]);
-InspectorBackend.registerCommand("Canvas.enable", [], []);
-InspectorBackend.registerCommand("Canvas.disable", [], []);
-InspectorBackend.registerCommand("Canvas.dropTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Canvas.hasUninstrumentedCanvases", [], ["result"]);
-InspectorBackend.registerCommand("Canvas.captureFrame", [{"name": "frameId", "type": "string", "optional": true}], ["traceLogId"]);
-InspectorBackend.registerCommand("Canvas.startCapturing", [{"name": "frameId", "type": "string", "optional": true}], ["traceLogId"]);
-InspectorBackend.registerCommand("Canvas.stopCapturing", [{"name": "traceLogId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Canvas.getTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "startOffset", "type": "number", "optional": true}, {"name": "maxLength", "type": "number", "optional": true}], ["traceLog"]);
-InspectorBackend.registerCommand("Canvas.replayTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "stepNo", "type": "number", "optional": false}], ["resourceState"]);
-InspectorBackend.registerCommand("Canvas.getResourceInfo", [{"name": "resourceId", "type": "string", "optional": false}], ["resourceInfo"]);
-InspectorBackend.registerCommand("Canvas.getResourceState", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "resourceId", "type": "string", "optional": false}], ["resourceState"]);
-
-// DOM.
-InspectorBackend.registerDOMDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "DOM");
-InspectorBackend.registerEvent("DOM.documentUpdated", []);
-InspectorBackend.registerEvent("DOM.setChildNodes", ["parentId", "nodes"]);
-InspectorBackend.registerEvent("DOM.attributeModified", ["nodeId", "name", "value"]);
-InspectorBackend.registerEvent("DOM.attributeRemoved", ["nodeId", "name"]);
-InspectorBackend.registerEvent("DOM.inlineStyleInvalidated", ["nodeIds"]);
-InspectorBackend.registerEvent("DOM.characterDataModified", ["nodeId", "characterData"]);
-InspectorBackend.registerEvent("DOM.childNodeCountUpdated", ["nodeId", "childNodeCount"]);
-InspectorBackend.registerEvent("DOM.childNodeInserted", ["parentNodeId", "previousNodeId", "node"]);
-InspectorBackend.registerEvent("DOM.childNodeRemoved", ["parentNodeId", "nodeId"]);
-InspectorBackend.registerEvent("DOM.shadowRootPushed", ["hostId", "root"]);
-InspectorBackend.registerEvent("DOM.shadowRootPopped", ["hostId", "rootId"]);
-InspectorBackend.registerCommand("DOM.getDocument", [], ["root"]);
-InspectorBackend.registerCommand("DOM.requestChildNodes", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "depth", "type": "number", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.querySelector", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.querySelectorAll", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["nodeIds"]);
-InspectorBackend.registerCommand("DOM.setNodeName", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.setNodeValue", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.removeNode", [{"name": "nodeId", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.setAttributeValue", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.setAttributesAsText", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "name", "type": "string", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.removeAttribute", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.getEventListenersForNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["listeners"]);
-InspectorBackend.registerCommand("DOM.getAccessibilityPropertiesForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["properties"]);
-InspectorBackend.registerCommand("DOM.getOuterHTML", [{"name": "nodeId", "type": "number", "optional": false}], ["outerHTML"]);
-InspectorBackend.registerCommand("DOM.setOuterHTML", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "outerHTML", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.performSearch", [{"name": "query", "type": "string", "optional": false}, {"name": "nodeIds", "type": "object", "optional": true}], ["searchId", "resultCount"]);
-InspectorBackend.registerCommand("DOM.getSearchResults", [{"name": "searchId", "type": "string", "optional": false}, {"name": "fromIndex", "type": "number", "optional": false}, {"name": "toIndex", "type": "number", "optional": false}], ["nodeIds"]);
-InspectorBackend.registerCommand("DOM.discardSearchResults", [{"name": "searchId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.requestNode", [{"name": "objectId", "type": "string", "optional": false}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.setInspectModeEnabled", [{"name": "enabled", "type": "boolean", "optional": false}, {"name": "highlightConfig", "type": "object", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.highlightRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "color", "type": "object", "optional": true}, {"name": "outlineColor", "type": "object", "optional": true}, {"name": "usePageCoordinates", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.highlightQuad", [{"name": "quad", "type": "object", "optional": false}, {"name": "color", "type": "object", "optional": true}, {"name": "outlineColor", "type": "object", "optional": true}, {"name": "usePageCoordinates", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.highlightNode", [{"name": "highlightConfig", "type": "object", "optional": false}, {"name": "nodeId", "type": "number", "optional": true}, {"name": "objectId", "type": "string", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.hideHighlight", [], []);
-InspectorBackend.registerCommand("DOM.highlightFrame", [{"name": "frameId", "type": "string", "optional": false}, {"name": "contentColor", "type": "object", "optional": true}, {"name": "contentOutlineColor", "type": "object", "optional": true}], []);
-InspectorBackend.registerCommand("DOM.pushNodeByPathToFrontend", [{"name": "path", "type": "string", "optional": false}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.pushNodeByBackendIdToFrontend", [{"name": "backendNodeId", "type": "number", "optional": false}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.releaseBackendNodeIds", [{"name": "nodeGroup", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.resolveNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["object"]);
-InspectorBackend.registerCommand("DOM.getAttributes", [{"name": "nodeId", "type": "number", "optional": false}], ["attributes"]);
-InspectorBackend.registerCommand("DOM.moveTo", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "targetNodeId", "type": "number", "optional": false}, {"name": "insertBeforeNodeId", "type": "number", "optional": true}], ["nodeId"]);
-InspectorBackend.registerCommand("DOM.undo", [], []);
-InspectorBackend.registerCommand("DOM.redo", [], []);
-InspectorBackend.registerCommand("DOM.markUndoableState", [], []);
-InspectorBackend.registerCommand("DOM.focus", [{"name": "nodeId", "type": "number", "optional": false}], []);
-
-// DOMDebugger.
-InspectorBackend.registerEnum("DOMDebugger.DOMBreakpointType", {SubtreeModified: "subtree-modified", AttributeModified: "attribute-modified", NodeRemoved: "node-removed"});
-InspectorBackend.registerCommand("DOMDebugger.setDOMBreakpoint", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "type", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.removeDOMBreakpoint", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "type", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.setEventListenerBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.removeEventListenerBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.setInstrumentationBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.removeInstrumentationBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.setXHRBreakpoint", [{"name": "url", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMDebugger.removeXHRBreakpoint", [{"name": "url", "type": "string", "optional": false}], []);
-
-// DOMStorage.
-InspectorBackend.registerDOMStorageDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "DOMStorage");
-InspectorBackend.registerEvent("DOMStorage.domStorageItemsCleared", ["storageId"]);
-InspectorBackend.registerEvent("DOMStorage.domStorageItemRemoved", ["storageId", "key"]);
-InspectorBackend.registerEvent("DOMStorage.domStorageItemAdded", ["storageId", "key", "newValue"]);
-InspectorBackend.registerEvent("DOMStorage.domStorageItemUpdated", ["storageId", "key", "oldValue", "newValue"]);
-InspectorBackend.registerCommand("DOMStorage.enable", [], []);
-InspectorBackend.registerCommand("DOMStorage.disable", [], []);
-InspectorBackend.registerCommand("DOMStorage.getDOMStorageItems", [{"name": "storageId", "type": "object", "optional": false}], ["entries"]);
-InspectorBackend.registerCommand("DOMStorage.setDOMStorageItem", [{"name": "storageId", "type": "object", "optional": false}, {"name": "key", "type": "string", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("DOMStorage.removeDOMStorageItem", [{"name": "storageId", "type": "object", "optional": false}, {"name": "key", "type": "string", "optional": false}], []);
-
-// Database.
-InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database");
-InspectorBackend.registerEvent("Database.addDatabase", ["database"]);
-InspectorBackend.registerCommand("Database.enable", [], []);
-InspectorBackend.registerCommand("Database.disable", [], []);
-InspectorBackend.registerCommand("Database.getDatabaseTableNames", [{"name": "databaseId", "type": "string", "optional": false}], ["tableNames"]);
-InspectorBackend.registerCommand("Database.executeSQL", [{"name": "databaseId", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "values", "sqlError"]);
-
-// HeapProfiler.
-InspectorBackend.registerHeapProfilerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "HeapProfiler");
-InspectorBackend.registerEvent("HeapProfiler.addProfileHeader", ["header"]);
-InspectorBackend.registerEvent("HeapProfiler.addHeapSnapshotChunk", ["uid", "chunk"]);
-InspectorBackend.registerEvent("HeapProfiler.finishHeapSnapshot", ["uid"]);
-InspectorBackend.registerEvent("HeapProfiler.resetProfiles", []);
-InspectorBackend.registerEvent("HeapProfiler.reportHeapSnapshotProgress", ["done", "total"]);
-InspectorBackend.registerCommand("HeapProfiler.hasHeapProfiler", [], ["result"]);
-InspectorBackend.registerCommand("HeapProfiler.getProfileHeaders", [], ["headers"]);
-InspectorBackend.registerCommand("HeapProfiler.getHeapSnapshot", [{"name": "uid", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("HeapProfiler.removeProfile", [{"name": "uid", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("HeapProfiler.clearProfiles", [], []);
-InspectorBackend.registerCommand("HeapProfiler.takeHeapSnapshot", [{"name": "reportProgress", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("HeapProfiler.collectGarbage", [], []);
-InspectorBackend.registerCommand("HeapProfiler.getObjectByHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["result"]);
-InspectorBackend.registerCommand("HeapProfiler.getHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}], ["heapSnapshotObjectId"]);
-
-// IndexedDB.
-InspectorBackend.registerIndexedDBDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "IndexedDB");
-InspectorBackend.registerEnum("IndexedDB.KeyType", {Number: "number", String: "string", Date: "date", Array: "array"});
-InspectorBackend.registerEnum("IndexedDB.KeyPathType", {Null: "null", String: "string", Array: "array"});
-InspectorBackend.registerCommand("IndexedDB.enable", [], []);
-InspectorBackend.registerCommand("IndexedDB.disable", [], []);
-InspectorBackend.registerCommand("IndexedDB.requestDatabaseNames", [{"name": "securityOrigin", "type": "string", "optional": false}], ["databaseNames"]);
-InspectorBackend.registerCommand("IndexedDB.requestDatabase", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}], ["databaseWithObjectStores"]);
-InspectorBackend.registerCommand("IndexedDB.requestData", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}, {"name": "objectStoreName", "type": "string", "optional": false}, {"name": "indexName", "type": "string", "optional": false}, {"name": "skipCount", "type": "number", "optional": false}, {"name": "pageSize", "type": "number", "optional": false}, {"name": "keyRange", "type": "object", "optional": true}], ["objectStoreDataEntries", "hasMore"]);
-InspectorBackend.registerCommand("IndexedDB.clearObjectStore", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}, {"name": "objectStoreName", "type": "string", "optional": false}], []);
-
-// Input.
-InspectorBackend.registerInputDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Input");
-InspectorBackend.registerCommand("Input.dispatchKeyEvent", [{"name": "type", "type": "string", "optional": false}, {"name": "modifiers", "type": "number", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "text", "type": "string", "optional": true}, {"name": "unmodifiedText", "type": "string", "optional": true}, {"name": "keyIdentifier", "type": "string", "optional": true}, {"name": "windowsVirtualKeyCode", "type": "number", "optional": true}, {"name": "nativeVirtualKeyCode", "type": "number", "optional": true}, {"name": "macCharCode", "type": "number", "optional": true}, {"name": "autoRepeat", "type": "boolean", "optional": true}, {"name": "isKeypad", "type": "boolean", "optional": true}, {"name": "isSystemKey", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("Input.dispatchMouseEvent", [{"name": "type", "type": "string", "optional": false}, {"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "modifiers", "type": "number", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "button", "type": "string", "optional": true}, {"name": "clickCount", "type": "number", "optional": true}], []);
-
-// LayerTree.
-InspectorBackend.registerLayerTreeDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "LayerTree");
-InspectorBackend.registerEvent("LayerTree.layerTreeDidChange", []);
-InspectorBackend.registerCommand("LayerTree.enable", [], []);
-InspectorBackend.registerCommand("LayerTree.disable", [], []);
-InspectorBackend.registerCommand("LayerTree.layersForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["layers"]);
-InspectorBackend.registerCommand("LayerTree.reasonsForCompositingLayer", [{"name": "layerId", "type": "string", "optional": false}], ["compositingReasons"]);
-
-// Memory.
-InspectorBackend.registerMemoryDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Memory");
-InspectorBackend.registerCommand("Memory.getDOMCounters", [], ["documents", "nodes", "jsEventListeners"]);
-
-// Network.
-InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Network");
-InspectorBackend.registerEnum("Network.InitiatorType", {Parser: "parser", Script: "script", Other: "other"});
-InspectorBackend.registerEvent("Network.requestWillBeSent", ["requestId", "frameId", "loaderId", "documentURL", "request", "timestamp", "initiator", "redirectResponse", "type"]);
-InspectorBackend.registerEvent("Network.requestServedFromCache", ["requestId"]);
-InspectorBackend.registerEvent("Network.responseReceived", ["requestId", "frameId", "loaderId", "timestamp", "type", "response"]);
-InspectorBackend.registerEvent("Network.dataReceived", ["requestId", "timestamp", "dataLength", "encodedDataLength"]);
-InspectorBackend.registerEvent("Network.loadingFinished", ["requestId", "timestamp", "sourceMapURL"]);
-InspectorBackend.registerEvent("Network.loadingFailed", ["requestId", "timestamp", "errorText", "canceled"]);
-InspectorBackend.registerEvent("Network.requestServedFromMemoryCache", ["requestId", "frameId", "loaderId", "documentURL", "timestamp", "initiator", "resource"]);
-InspectorBackend.registerEvent("Network.webSocketWillSendHandshakeRequest", ["requestId", "timestamp", "request"]);
-InspectorBackend.registerEvent("Network.webSocketHandshakeResponseReceived", ["requestId", "timestamp", "response"]);
-InspectorBackend.registerEvent("Network.webSocketCreated", ["requestId", "url"]);
-InspectorBackend.registerEvent("Network.webSocketClosed", ["requestId", "timestamp"]);
-InspectorBackend.registerEvent("Network.webSocketFrameReceived", ["requestId", "timestamp", "response"]);
-InspectorBackend.registerEvent("Network.webSocketFrameError", ["requestId", "timestamp", "errorMessage"]);
-InspectorBackend.registerEvent("Network.webSocketFrameSent", ["requestId", "timestamp", "response"]);
-InspectorBackend.registerCommand("Network.enable", [], []);
-InspectorBackend.registerCommand("Network.disable", [], []);
-InspectorBackend.registerCommand("Network.setExtraHTTPHeaders", [{"name": "headers", "type": "object", "optional": false}], []);
-InspectorBackend.registerCommand("Network.getResponseBody", [{"name": "requestId", "type": "string", "optional": false}], ["body", "base64Encoded"]);
-InspectorBackend.registerCommand("Network.replayXHR", [{"name": "requestId", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Network.canClearBrowserCache", [], ["result"]);
-InspectorBackend.registerCommand("Network.clearBrowserCache", [], []);
-InspectorBackend.registerCommand("Network.canClearBrowserCookies", [], ["result"]);
-InspectorBackend.registerCommand("Network.clearBrowserCookies", [], []);
-InspectorBackend.registerCommand("Network.setCacheDisabled", [{"name": "cacheDisabled", "type": "boolean", "optional": false}], []);
-
-// Page.
-InspectorBackend.registerPageDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Page");
-InspectorBackend.registerEnum("Page.ResourceType", {Document: "Document", Stylesheet: "Stylesheet", Image: "Image", Font: "Font", Script: "Script", XHR: "XHR", WebSocket: "WebSocket", Other: "Other"});
-InspectorBackend.registerEnum("Page.CoordinateSystem", {Viewport: "Viewport", Page: "Page"});
-InspectorBackend.registerEvent("Page.domContentEventFired", ["timestamp"]);
-InspectorBackend.registerEvent("Page.loadEventFired", ["timestamp"]);
-InspectorBackend.registerEvent("Page.frameNavigated", ["frame"]);
-InspectorBackend.registerEvent("Page.frameDetached", ["frameId"]);
-InspectorBackend.registerEvent("Page.frameStartedLoading", ["frameId"]);
-InspectorBackend.registerEvent("Page.frameStoppedLoading", ["frameId"]);
-InspectorBackend.registerEvent("Page.frameScheduledNavigation", ["frameId", "delay"]);
-InspectorBackend.registerEvent("Page.frameClearedScheduledNavigation", ["frameId"]);
-InspectorBackend.registerEvent("Page.javascriptDialogOpening", ["message"]);
-InspectorBackend.registerEvent("Page.javascriptDialogClosed", []);
-InspectorBackend.registerEvent("Page.scriptsEnabled", ["isEnabled"]);
-InspectorBackend.registerCommand("Page.enable", [], []);
-InspectorBackend.registerCommand("Page.disable", [], []);
-InspectorBackend.registerCommand("Page.addScriptToEvaluateOnLoad", [{"name": "scriptSource", "type": "string", "optional": false}], ["identifier"]);
-InspectorBackend.registerCommand("Page.removeScriptToEvaluateOnLoad", [{"name": "identifier", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Page.reload", [{"name": "ignoreCache", "type": "boolean", "optional": true}, {"name": "scriptToEvaluateOnLoad", "type": "string", "optional": true}], []);
-InspectorBackend.registerCommand("Page.navigate", [{"name": "url", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Page.getCookies", [], ["cookies"]);
-InspectorBackend.registerCommand("Page.deleteCookie", [{"name": "cookieName", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Page.getResourceTree", [], ["frameTree"]);
-InspectorBackend.registerCommand("Page.getResourceContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}], ["content", "base64Encoded"]);
-InspectorBackend.registerCommand("Page.searchInResource", [{"name": "frameId", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
-InspectorBackend.registerCommand("Page.searchInResources", [{"name": "text", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
-InspectorBackend.registerCommand("Page.setDocumentContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "html", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Page.setShowPaintRects", [{"name": "result", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.canShowDebugBorders", [], ["show"]);
-InspectorBackend.registerCommand("Page.setShowDebugBorders", [{"name": "show", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.canShowFPSCounter", [], ["show"]);
-InspectorBackend.registerCommand("Page.setShowFPSCounter", [{"name": "show", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.canContinuouslyPaint", [], ["value"]);
-InspectorBackend.registerCommand("Page.setContinuousPaintingEnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.getScriptExecutionStatus", [], ["result"]);
-InspectorBackend.registerCommand("Page.setScriptExecutionDisabled", [{"name": "value", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.setTouchEmulationEnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.setEmulatedMedia", [{"name": "media", "type": "string", "optional": false}], []);
-InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["result"]);
-InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
-InspectorBackend.registerCommand("Page.archive", [], ["data"]);
-
-// Profiler.
-InspectorBackend.registerProfilerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Profiler");
-InspectorBackend.registerEnum("Profiler.ProfileHeaderTypeId", {CPU: "CPU", HEAP: "HEAP"});
-InspectorBackend.registerEvent("Profiler.addProfileHeader", ["header"]);
-InspectorBackend.registerEvent("Profiler.addHeapSnapshotChunk", ["uid", "chunk"]);
-InspectorBackend.registerEvent("Profiler.finishHeapSnapshot", ["uid"]);
-InspectorBackend.registerEvent("Profiler.setRecordingProfile", ["isProfiling"]);
-InspectorBackend.registerEvent("Profiler.resetProfiles", []);
-InspectorBackend.registerEvent("Profiler.reportHeapSnapshotProgress", ["done", "total"]);
-InspectorBackend.registerCommand("Profiler.isSampling", [], ["result"]);
-InspectorBackend.registerCommand("Profiler.hasHeapProfiler", [], ["result"]);
-InspectorBackend.registerCommand("Profiler.enable", [], []);
-InspectorBackend.registerCommand("Profiler.disable", [], []);
-InspectorBackend.registerCommand("Profiler.start", [], []);
-InspectorBackend.registerCommand("Profiler.stop", [], []);
-InspectorBackend.registerCommand("Profiler.getProfileHeaders", [], ["headers"]);
-InspectorBackend.registerCommand("Profiler.getCPUProfile", [{"name": "uid", "type": "number", "optional": false}], ["profile"]);
-InspectorBackend.registerCommand("Profiler.getHeapSnapshot", [{"name": "uid", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("Profiler.removeProfile", [{"name": "type", "type": "string", "optional": false}, {"name": "uid", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("Profiler.clearProfiles", [], []);
-InspectorBackend.registerCommand("Profiler.takeHeapSnapshot", [{"name": "reportProgress", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("Profiler.collectGarbage", [], []);
-InspectorBackend.registerCommand("Profiler.getObjectByHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["result"]);
-InspectorBackend.registerCommand("Profiler.getHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}], ["heapSnapshotObjectId"]);
-
-// Timeline.
-InspectorBackend.registerTimelineDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Timeline");
-InspectorBackend.registerEnum("Timeline.EventType", {EventDispatch: "EventDispatch", BeginFrame: "BeginFrame", ScheduleStyleRecalculation: "ScheduleStyleRecalculation", RecalculateStyles: "RecalculateStyles", InvalidateLayout: "InvalidateLayout", Layout: "Layout", Paint: "Paint", ScrollLayer: "ScrollLayer", ResizeImage: "ResizeImage", CompositeLayers: "CompositeLayers", ParseHTML: "ParseHTML", TimerInstall: "TimerInstall", TimerRemove: "TimerRemove", TimerFire: "TimerFire", EvaluateScript: "EvaluateScript", MarkLoad: "MarkLoad", MarkDOMContent: "MarkDOMContent", TimeStamp: "TimeStamp", Time: "Time", TimeEnd: "TimeEnd", ScheduleResourceRequest: "ScheduleResourceRequest", ResourceSendRequest: "ResourceSendRequest", ResourceReceiveResponse: "ResourceReceiveResponse", ResourceReceivedData: "ResourceReceivedData", ResourceFinish: "ResourceFinish", XHRReadyStateChange: "XHRReadyStateChange", XHRLoad: "XHRLoad", FunctionCall: "FunctionCall", GCEvent: "GCEvent", RequestAnimationFrame: "RequestAnimationFrame", CancelAnimationFrame: "CancelAnimationFrame", FireAnimationFrame: "FireAnimationFrame", WebSocketCreate: "WebSocketCreate", WebSocketSendHandshakeRequest: "WebSocketSendHandshakeRequest", WebSocketReceiveHandshakeResponse: "WebSocketReceiveHandshakeResponse", WebSocketDestroy: "WebSocketDestroy"});
-InspectorBackend.registerEvent("Timeline.eventRecorded", ["record"]);
-InspectorBackend.registerCommand("Timeline.start", [{"name": "maxCallStackDepth", "type": "number", "optional": true}, {"name": "includeDomCounters", "type": "boolean", "optional": true}], []);
-InspectorBackend.registerCommand("Timeline.stop", [], []);
-InspectorBackend.registerCommand("Timeline.supportsFrameInstrumentation", [], ["result"]);
-InspectorBackend.registerCommand("Timeline.canMonitorMainThread", [], ["result"]);
-
-// Worker.
-InspectorBackend.registerWorkerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Worker");
-InspectorBackend.registerEvent("Worker.workerCreated", ["workerId", "url", "inspectorConnected"]);
-InspectorBackend.registerEvent("Worker.workerTerminated", ["workerId"]);
-InspectorBackend.registerEvent("Worker.dispatchMessageFromWorker", ["workerId", "message"]);
-InspectorBackend.registerEvent("Worker.disconnectedFromWorker", []);
-InspectorBackend.registerCommand("Worker.enable", [], []);
-InspectorBackend.registerCommand("Worker.disable", [], []);
-InspectorBackend.registerCommand("Worker.sendMessageToWorker", [{"name": "workerId", "type": "number", "optional": false}, {"name": "message", "type": "object", "optional": false}], []);
-InspectorBackend.registerCommand("Worker.canInspectWorkers", [], ["result"]);
-InspectorBackend.registerCommand("Worker.connectToWorker", [{"name": "workerId", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("Worker.disconnectFromWorker", [{"name": "workerId", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("Worker.setAutoconnectToWorkers", [{"name": "value", "type": "boolean", "optional": false}], []);
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIssueManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IssueManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IssueManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IssueManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IssueManager = function()
-{
- WebInspector.Object.call(this);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._activeLogCleared, this);
-
- this.initialize();
-}
-
-WebInspector.IssueManager.Event = {
- IssueWasAdded: "issue-manager-issue-was-added",
- Cleared: "issue-manager-cleared"
-};
-
-WebInspector.IssueManager.prototype = {
- constructor: WebInspector.IssueManager,
-
- // Public
-
- initialize: function()
- {
- this._issues = [];
-
- this.dispatchEventToListeners(WebInspector.IssueManager.Event.Cleared);
- },
-
- issueWasAdded: function(source, level, text, url, lineNumber, parameters)
- {
- var modifiedLineNumber;
- if (lineNumber) {
- console.assert(typeof lineNumber === "number");
- modifiedLineNumber = lineNumber - 1;
- }
-
- var issue = new WebInspector.IssueMessage(source, level, text, url, modifiedLineNumber, parameters);
- this._issues.push(issue);
-
- this.dispatchEventToListeners(WebInspector.IssueManager.Event.IssueWasAdded, {issue: issue});
- },
-
- issuesForSourceCode: function(sourceCode)
- {
- var issues = [];
-
- for (var i = 0; i < this._issues.length; ++i) {
- // FIXME: Support issues based on Script identifiers too.
- var issue = this._issues[i];
- if (issue.url === sourceCode.url)
- issues.push(issue);
- }
-
- return issues;
- },
-
- // Private
-
- _activeLogCleared: function(event)
- {
- this.initialize();
- },
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- this.initialize();
- }
-};
-
-WebInspector.IssueManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceIssueMessagejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/IssueMessage.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/IssueMessage.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/IssueMessage.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,242 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IssueMessage = function(source, level, text, url, lineNumber, parameters)
-{
- WebInspector.Object.call(this);
-
- this._level = level;
- this._text = text;
-
- // FIXME <http://webkit.org/b/76404>: Remove the string equality checks for undefined
- // once we don't get that value anymore from WebCore.
-
- // FIXME: If the URL is undefined, get the URL from the stacktrace.
- if (url && url !== "undefined")
- this._url = url;
-
- if (typeof lineNumber === "number" && lineNumber >= 0)
- this._lineNumber = lineNumber;
-
- if (parameters && parameters !== "undefined") {
- this._parameters = [];
- for (var i = 0; i < parameters.length; ++i) {
- if (parameters[i] instanceof WebInspector.RemoteObject) {
- this._parameters.push(parameters[i]);
- continue;
- }
-
- if (typeof parameters[i] === "object")
- this._parameters.push(WebInspector.RemoteObject.fromPayload(parameters[i]));
- else
- this._parameters.push(WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]));
- }
- }
-
- this._formatTextIfNecessary();
-
- switch (source) {
- case "javascript":
- // FIXME: It would be nice if we had this information (the specific type of JavaScript error)
- // as part of the data passed from WebCore, instead of having to determine it ourselves.
- var prefixRegex = /^([^:]+): (?:DOM Exception \d+: )?/;
- var match = prefixRegex.exec(this._text);
- if (match && match[1] in WebInspector.IssueMessage.Type._prefixTypeMap) {
- this._type = WebInspector.IssueMessage.Type._prefixTypeMap[match[1]];
- this._text = this._text.substring(match[0].length);
- } else
- this._type = WebInspector.IssueMessage.Type.OtherIssue;
- break;
-
- case "html":
- case "css":
- case "wml":
- case "xml":
- this._type = WebInspector.IssueMessage.Type.PageIssue;
- break;
-
- case "network":
- this._type = WebInspector.IssueMessage.Type.NetworkIssue;
- break;
-
- case "console-api":
- case "other":
- this._type = WebInspector.IssueMessage.Type.OtherIssue;
- break;
-
- default:
- console.error("Unknown issue source:", source);
- this._type = WebInspector.IssueMessage.Type.OtherIssue;
- }
-}
-
-WebInspector.IssueMessage.Level = {
- Error: "error",
- Warning: "warning"
-};
-
-WebInspector.IssueMessage.Type = {
- SemanticIssue: "issue-message-type-semantic-issue",
- RangeIssue: "issue-message-type-range-issue",
- ReferenceIssue: "issue-message-type-reference-issue",
- TypeIssue: "issue-message-type-type-issue",
- PageIssue: "issue-message-type-page-issue",
- NetworkIssue: "issue-message-type-network-issue",
- SecurityIssue: "issue-message-type-security-issue",
- OtherIssue: "issue-message-type-other-issue"
-};
-
-WebInspector.IssueMessage.Type._prefixTypeMap = {
- "SyntaxError": WebInspector.IssueMessage.Type.SemanticIssue,
- "URIError": WebInspector.IssueMessage.Type.SemanticIssue,
- "EvalError": WebInspector.IssueMessage.Type.SemanticIssue,
- "INVALID_CHARACTER_ERR": WebInspector.IssueMessage.Type.SemanticIssue,
- "SYNTAX_ERR": WebInspector.IssueMessage.Type.SemanticIssue,
-
- "RangeError": WebInspector.IssueMessage.Type.RangeIssue,
- "INDEX_SIZE_ERR": WebInspector.IssueMessage.Type.RangeIssue,
- "DOMSTRING_SIZE_ERR": WebInspector.IssueMessage.Type.RangeIssue,
-
- "ReferenceError": WebInspector.IssueMessage.Type.ReferenceIssue,
- "HIERARCHY_REQUEST_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
- "INVALID_STATE_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
- "NOT_FOUND_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
- "WRONG_DOCUMENT_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
-
- "TypeError": WebInspector.IssueMessage.Type.TypeIssue,
- "INVALID_NODE_TYPE_ERR": WebInspector.IssueMessage.Type.TypeIssue,
- "TYPE_MISMATCH_ERR": WebInspector.IssueMessage.Type.TypeIssue,
-
- "SECURITY_ERR": WebInspector.IssueMessage.Type.SecurityIssue,
-
- "NETWORK_ERR": WebInspector.IssueMessage.Type.NetworkIssue,
-
- "ABORT_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "DATA_CLONE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "INUSE_ATTRIBUTE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "INVALID_ACCESS_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "INVALID_MODIFICATION_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "NAMESPACE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "NOT_SUPPORTED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "NO_DATA_ALLOWED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "NO_MODIFICATION_ALLOWED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "QUOTA_EXCEEDED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "TIMEOUT_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "URL_MISMATCH_ERR": WebInspector.IssueMessage.Type.OtherIssue,
- "VALIDATION_ERR": WebInspector.IssueMessage.Type.OtherIssue
-};
-
-WebInspector.IssueMessage.Type.displayName = function(type)
-{
- switch(type) {
- case WebInspector.IssueMessage.Type.SemanticIssue:
- return WebInspector.UIString("Semantic Issue");
- case WebInspector.IssueMessage.Type.RangeIssue:
- return WebInspector.UIString("Range Issue");
- case WebInspector.IssueMessage.Type.ReferenceIssue:
- return WebInspector.UIString("Reference Issue");
- case WebInspector.IssueMessage.Type.TypeIssue:
- return WebInspector.UIString("Type Issue");
- case WebInspector.IssueMessage.Type.PageIssue:
- return WebInspector.UIString("Page Issue");
- case WebInspector.IssueMessage.Type.NetworkIssue:
- return WebInspector.UIString("Network Issue");
- case WebInspector.IssueMessage.Type.SecurityIssue:
- return WebInspector.UIString("Security Issue");
- case WebInspector.IssueMessage.Type.OtherIssue:
- return WebInspector.UIString("Other Issue");
- default:
- console.error("Unknown issue message type:", type);
- return WebInspector.UIString("Other Issue");
- }
-};
-
-WebInspector.IssueMessage.prototype = {
- constructor: WebInspector.IssueMessage,
-
- get type()
- {
- return this._type;
- },
-
- get level()
- {
- return this._level;
- },
-
- get text()
- {
- return this._text;
- },
-
- get url()
- {
- return this._url;
- },
-
- get lineNumber()
- {
- return this._lineNumber;
- },
-
- // Private
-
- _formatTextIfNecessary: function()
- {
- if (!this._parameters)
- return;
-
- if (WebInspector.RemoteObject.type(this._parameters[0]) !== "string")
- return;
-
- function valueFormatter(obj)
- {
- return obj.description;
- }
-
- var formatters = {};
- formatters.o = valueFormatter;
- formatters.s = valueFormatter;
- formatters.f = valueFormatter;
- formatters.i = valueFormatter;
- formatters.d = valueFormatter;
-
- function append(a, b)
- {
- a += b;
- return a;
- }
-
- var result = String.format(this._parameters[0].description, this._parameters.slice(1), formatters, "", append);
- var resultText = result.formattedResult;
-
- for (var i = 0; i < result.unusedSubstitutions.length; ++i)
- resultText += " " + result.unusedSubstitutions[i].description;
-
- this._text = resultText;
- }
-};
-
-WebInspector.IssueMessage.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptLogViewControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptLogViewController.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptLogViewController.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptLogViewController.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,292 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.JavaScriptLogViewController = function(element, scrollElement, textPrompt, delegate, historySettingIdentifier)
-{
- WebInspector.Object.call(this);
-
- console.assert(textPrompt instanceof WebInspector.ConsolePrompt);
- console.assert(historySettingIdentifier);
-
- this._element = element;
- this._scrollElement = scrollElement;
-
- this._promptHistorySetting = new WebInspector.Setting(historySettingIdentifier, null);
-
- this._prompt = textPrompt;
- this._prompt.delegate = this;
- this._prompt.history = this._promptHistorySetting.value;
-
- this.delegate = delegate;
-
- this._cleared = true;
- this._previousMessage = null;
- this._repeatCountWasInterrupted = false;
-
- this._topConsoleGroups = [];
-
- this.messagesClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "K", this._handleClearShortcut.bind(this));
- this.messagesAlternateClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "L", this._handleClearShortcut.bind(this), this._element);
-
- this._messagesFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._handleFindShortcut.bind(this), this._element);
- this._messagesFindNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._handleFindNextShortcut.bind(this), this._element);
- this._messagesFindPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "G", this._handleFindPreviousShortcut.bind(this), this._element);
-
- this._promptAlternateClearKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "L", this._handleClearShortcut.bind(this), this._prompt.element);
- this._promptFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._handleFindShortcut.bind(this), this._prompt.element);
- this._promptFindNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._handleFindNextShortcut.bind(this), this._prompt.element);
- this._promptFindPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "G", this._handleFindPreviousShortcut.bind(this), this._prompt.element);
-
- this.startNewSession();
-};
-
-WebInspector.JavaScriptLogViewController.CachedPropertiesDuration = 30000;
-
-WebInspector.JavaScriptLogViewController.prototype = {
- constructor: WebInspector.JavaScriptLogViewController,
-
- // Public
-
- get prompt()
- {
- return this._prompt;
- },
-
- get topConsoleGroup()
- {
- return this._topConsoleGroup;
- },
-
- get currentConsoleGroup()
- {
- return this._currentConsoleGroup;
- },
-
- clear: function()
- {
- this._cleared = true;
-
- this.startNewSession(true);
-
- this.prompt.focus();
-
- if (this.delegate && typeof this.delegate.didClearMessages === "function")
- this.delegate.didClearMessages();
- },
-
- startNewSession: function(clearPreviousSessions)
- {
- if (this._topConsoleGroups.length && clearPreviousSessions) {
- for (var i = 0; i < this._topConsoleGroups.length; ++i)
- this._element.removeChild(this._topConsoleGroups[i].element);
-
- this._topConsoleGroups = [];
- this._topConsoleGroup = null;
- this._currentConsoleGroup = null;
- }
-
- // Reuse the top group if it has no messages.
- if (this._topConsoleGroup && !this._topConsoleGroup.hasMessages()) {
- // Make sure the session is visible.
- this._topConsoleGroup.element.scrollIntoView();
- return;
- }
-
- var hasPreviousSession = !!this._topConsoleGroup;
- var consoleGroup = new WebInspector.ConsoleGroup(null, hasPreviousSession);
-
- this._previousMessage = null;
- this._repeatCountWasInterrupted = false;
-
- this._topConsoleGroups.push(consoleGroup);
- this._topConsoleGroup = consoleGroup;
- this._currentConsoleGroup = consoleGroup;
-
- this._element.appendChild(consoleGroup.element);
-
- // Make sure the new session is visible.
- consoleGroup.element.scrollIntoView();
- },
-
- appendConsoleMessage: function(consoleMessage)
- {
- // Clone the message since there might be multiple clients using the message,
- // and since the message has a DOM element it can't be two places at once.
- var messageClone = consoleMessage.clone();
-
- this._appendConsoleMessage(messageClone);
-
- return messageClone;
- },
-
- updatePreviousMessageRepeatCount: function(count)
- {
- console.assert(this._previousMessage);
- if (!this._previousMessage)
- return;
-
- if (!this._repeatCountWasInterrupted) {
- this._previousMessage.repeatCount = count - (this._previousMessage.ignoredCount || 0);
- this._previousMessage.updateRepeatCount();
- } else {
- var newMessage = this._previousMessage.clone();
-
- // If this message is repeated after being cloned, messageRepeatCountUpdated will be called with a
- // count that includes the count of this message before cloning. We should ignore instances of this
- // log that occurred before we cloned, so set a property on the message with the number of previous
- // instances of this log that we should ignore.
- newMessage.ignoredCount = newMessage.repeatCount + (this._previousMessage.ignoredCount || 0);
- newMessage.repeatCount = 1;
-
- this._appendConsoleMessage(newMessage);
- }
- },
-
- isScrolledToBottom: function()
- {
- // Lie about being scrolled to the bottom if we have a pending request to scroll to the bottom soon.
- return this._scrollToBottomTimeout || this._scrollElement.isScrolledToBottom();
- },
-
- scrollToBottom: function()
- {
- if (this._scrollToBottomTimeout)
- return;
-
- function delayedWork()
- {
- this._scrollToBottomTimeout = null;
- this._scrollElement.scrollTop = this._scrollElement.scrollHeight;
- }
-
- // Don't scroll immediately so we are not causing excessive layouts when there
- // are many messages being added at once.
- this._scrollToBottomTimeout = setTimeout(delayedWork.bind(this), 0);
- },
-
- // Protected
-
- consolePromptHistoryDidChange: function(prompt)
- {
- this._promptHistorySetting.value = this.prompt.history;
- },
-
- consolePromptShouldCommitText: function(prompt, text, cursorIsAtLastPosition, handler)
- {
- // Always commit the text if we are not at the last position.
- if (!cursorIsAtLastPosition) {
- handler(true);
- return;
- }
-
- // COMPATIBILITY (iOS 6): RuntimeAgent.parse did not exist in iOS 6. Always commit.
- if (!RuntimeAgent.parse) {
- handler(true);
- return;
- }
-
- function parseFinished(error, result, message, range)
- {
- handler(result !== RuntimeAgent.SyntaxErrorType.Recoverable);
- }
-
- RuntimeAgent.parse(text, parseFinished.bind(this));
- },
-
- consolePromptTextCommitted: function(prompt, text)
- {
- console.assert(text);
-
- var commandMessage = new WebInspector.ConsoleCommand(text);
- this._appendConsoleMessage(commandMessage, true);
-
- function printResult(result, wasThrown)
- {
- if (!result || this._cleared)
- return;
-
- this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage), true);
- }
-
- text += "\n//# sourceURL=__WebInspectorConsole__\n";
-
- WebInspector.runtimeManager.evaluateInInspectedWindow(text, "console", true, false, false, printResult.bind(this));
- },
-
- // Private
-
- _handleClearShortcut: function()
- {
- this.clear();
- },
-
- _handleFindShortcut: function()
- {
- this.delegate.focusSearchBar();
- },
-
- _handleFindNextShortcut: function()
- {
- this.delegate.highlightNextSearchMatch();
- },
-
- _handleFindPreviousShortcut: function()
- {
- this.delegate.highlightPreviousSearchMatch();
- },
-
- _appendConsoleMessage: function(msg, repeatCountWasInterrupted)
- {
- var wasScrolledToBottom = this.isScrolledToBottom();
-
- this._cleared = false;
- this._repeatCountWasInterrupted = repeatCountWasInterrupted || false;
-
- if (!repeatCountWasInterrupted)
- this._previousMessage = msg;
-
- if (msg.type === WebInspector.ConsoleMessage.MessageType.EndGroup) {
- var parentGroup = this._currentConsoleGroup.parentGroup;
- if (parentGroup)
- this._currentConsoleGroup = parentGroup;
- } else {
- if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
- var group = new WebInspector.ConsoleGroup(this._currentConsoleGroup);
- this._currentConsoleGroup.messagesElement.appendChild(group.element);
- this._currentConsoleGroup = group;
- }
-
- this._currentConsoleGroup.addMessage(msg);
- }
-
- if (msg.type === WebInspector.ConsoleMessage.MessageType.Result || wasScrolledToBottom)
- this.scrollToBottom();
-
- if (this.delegate && typeof this.delegate.didAppendConsoleMessage === "function")
- this.delegate.didAppendConsoleMessage(msg);
- }
-};
-
-WebInspector.JavaScriptLogViewController.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceJavaScriptRuntimeCompletionProviderjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/JavaScriptRuntimeCompletionProvider.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/JavaScriptRuntimeCompletionProvider.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/JavaScriptRuntimeCompletionProvider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,244 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.JavaScriptRuntimeCompletionProvider = function()
-{
- WebInspector.Object.call(this);
-
- console.assert(!WebInspector.JavaScriptRuntimeCompletionProvider._instance);
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._clearLastProperties, this);
-};
-
-Object.defineProperty(WebInspector, "javaScriptRuntimeCompletionProvider",
-{
- get: function()
- {
- if (!WebInspector.JavaScriptRuntimeCompletionProvider._instance)
- WebInspector.JavaScriptRuntimeCompletionProvider._instance = new WebInspector.JavaScriptRuntimeCompletionProvider;
- return WebInspector.JavaScriptRuntimeCompletionProvider._instance;
- }
-});
-
-WebInspector.JavaScriptRuntimeCompletionProvider.prototype = {
- constructor: WebInspector.JavaScriptRuntimeCompletionProvider,
-
- // Protected
-
- completionControllerCompletionsNeeded: function(completionController, defaultCompletions, base, prefix, suffix, forced)
- {
- // Don't allow non-forced empty prefix completions unless the base is that start of property access.
- if (!forced && !prefix && !/[.[]$/.test(base)) {
- completionController.updateCompletions(null);
- return;
- }
-
- // If the base ends with an open parentheses or open curly bracket then treat it like there is
- // no base so we get global object completions.
- if (/[({]$/.test(base))
- base = "";
-
- var lastBaseIndex = base.length - 1;
- var dotNotation = base[lastBaseIndex] === ".";
- var bracketNotation = base[lastBaseIndex] === "[";
-
- if (dotNotation || bracketNotation) {
- base = base.substring(0, lastBaseIndex);
-
- // Don't suggest anything for an empty base that is using dot notation.
- // Bracket notation with an empty base will be treated as an array.
- if (!base && dotNotation) {
- completionController.updateCompletions(defaultCompletions);
- return;
- }
-
- // Don't allow non-forced empty prefix completions if the user is entering a number, since it might be a float.
- // But allow number completions if the base already has a decimal, so "10.0." will suggest Number properties.
- if (!forced && !prefix && dotNotation && base.indexOf(".") === -1 && parseInt(base, 10) == base) {
- completionController.updateCompletions(null);
- return;
- }
-
- // An empty base with bracket notation is not property access, it is an array.
- // Clear the bracketNotation flag so completions are not quoted.
- if (!base && bracketNotation)
- bracketNotation = false;
- }
-
- // If the base is the same as the last time, we can reuse the property names we have already gathered.
- // Doing this eliminates delay caused by the async nature of the code below and it only calls getters
- // and functions once instead of repetitively. Sure, there can be difference each time the base is evaluated,
- // but this optimization gives us more of a win. We clear the cache after 30 seconds or when stepping in the
- // debugger to make sure we don't use stale properties in most cases.
- if (this._lastBase === base && this._lastPropertyNames) {
- receivedPropertyNames.call(this, this._lastPropertyNames);
- return;
- }
-
- this._lastBase = base;
- this._lastPropertyNames = null;
-
- var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
- if (!base && activeCallFrame && !this._alwaysEvaluateInWindowContext)
- activeCallFrame.collectScopeChainVariableNames(receivedPropertyNames.bind(this));
- else
- WebInspector.runtimeManager.evaluateInInspectedWindow(base, "completion", true, true, false, evaluated.bind(this));
-
- function updateLastPropertyNames(propertyNames)
- {
- if (this._clearLastPropertiesTimeout)
- clearTimeout(this._clearLastPropertiesTimeout);
- this._clearLastPropertiesTimeout = setTimeout(this._clearLastProperties.bind(this), WebInspector.JavaScriptLogViewController.CachedPropertiesDuration);
-
- this._lastPropertyNames = propertyNames || {};
- }
-
- function evaluated(result, wasThrown)
- {
- if (wasThrown || !result || result.type === "undefined" || (result.type === "object" && result.subtype === "null")) {
- RuntimeAgent.releaseObjectGroup("completion");
-
- updateLastPropertyNames.call(this, {});
- completionController.updateCompletions(defaultCompletions);
-
- return;
- }
-
- function getCompletions(primitiveType)
- {
- var object;
- if (primitiveType === "string")
- object = new String("");
- else if (primitiveType === "number")
- object = new Number(0);
- else if (primitiveType === "boolean")
- object = new Boolean(false);
- else
- object = this;
-
- var resultSet = {};
- for (var o = object; o; o = o.__proto__) {
- try {
- var names = Object.getOwnPropertyNames(o);
- for (var i = 0; i < names.length; ++i)
- resultSet[names[i]] = true;
- } catch (e) {
- // Ignore
- }
- }
-
- return resultSet;
- }
-
- if (result.type === "object" || result.type === "function")
- result.callFunctionJSON(getCompletions, undefined, receivedPropertyNames.bind(this));
- else if (result.type === "string" || result.type === "number" || result.type === "boolean")
- WebInspector.runtimeManager.evaluateInInspectedWindow("(" + getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, receivedPropertyNamesFromEvaluate.bind(this));
- else
- console.error("Unknown result type: " + result.type);
- }
-
- function receivedPropertyNamesFromEvaluate(object, wasThrown, result)
- {
- receivedPropertyNames.call(this, result && !wasThrown ? result.value : null);
- }
-
- function receivedPropertyNames(propertyNames)
- {
- propertyNames = propertyNames || {};
-
- updateLastPropertyNames.call(this, propertyNames);
-
- RuntimeAgent.releaseObjectGroup("completion");
-
- if (!base) {
- const commandLineAPI = ["$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile", "profileEnd", "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEventListeners", "$0", "$1", "$2", "$3", "$4", "$_"];
- for (var i = 0; i < commandLineAPI.length; ++i)
- propertyNames[commandLineAPI[i]] = true;
- }
-
- propertyNames = Object.keys(propertyNames);
-
- var implicitSuffix = "";
- if (bracketNotation) {
- var quoteUsed = prefix[0] === "'" ? "'" : "\"";
- if (suffix !== "]" && suffix !== quoteUsed)
- implicitSuffix = "]";
- }
-
- var completions = defaultCompletions;
- var knownCompletions = completions.keySet();
-
- for (var i = 0; i < propertyNames.length; ++i) {
- var property = propertyNames[i];
-
- if (dotNotation && !/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(property))
- continue;
-
- if (bracketNotation) {
- if (parseInt(property) != property)
- property = quoteUsed + property.escapeCharacters(quoteUsed + "\\") + (suffix !== quoteUsed ? quoteUsed : "");
- }
-
- if (!property.startsWith(prefix) || property in knownCompletions)
- continue;
-
- completions.push(property);
- knownCompletions[property] = true;
- }
-
- function compare(a, b)
- {
- // Try to sort in numerical order first.
- var numericCompareResult = a - b;
- if (!isNaN(numericCompareResult))
- return numericCompareResult;
-
- // Not numbers, sort as strings.
- return a.localeCompare(b);
- }
-
- completions.sort(compare);
-
- completionController.updateCompletions(completions, implicitSuffix);
- }
- },
-
- // Private
-
- _clearLastProperties: function()
- {
- if (this._clearLastPropertiesTimeout) {
- clearTimeout(this._clearLastPropertiesTimeout);
- delete this._clearLastPropertiesTimeout;
- }
-
- // Clear the cache of property names so any changes while stepping or sitting idle get picked up if the same
- // expression is evaluated again.
- this._lastPropertyNames = null;
- }
-};
-
-WebInspector.JavaScriptRuntimeCompletionProvider.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceKeyboardShortcutjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/KeyboardShortcut.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/KeyboardShortcut.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/KeyboardShortcut.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,254 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.KeyboardShortcut = function(modifiers, key, callback, targetElement)
-{
- WebInspector.Object.call(this);
-
- console.assert(key);
- console.assert(!callback || typeof callback === "function");
- console.assert(!targetElement || targetElement instanceof Element);
-
- if (typeof key === "string") {
- key = key[0].toUpperCase();
- key = new WebInspector.Key(key.charCodeAt(0), key);
- }
-
- if (callback && !targetElement)
- targetElement = document;
-
- this._modifiers = modifiers || WebInspector.KeyboardShortcut.Modifier.None;
- this._key = key;
- this._targetElement = targetElement;
- this._callback = callback;
- this._disabled = false;
- this._implicitlyPreventsDefault = true;
-
- if (targetElement) {
- var targetKeyboardShortcuts = targetElement._keyboardShortcuts;
- if (!targetKeyboardShortcuts)
- targetKeyboardShortcuts = targetElement._keyboardShortcuts = [];
-
- targetKeyboardShortcuts.push(this);
-
- if (!WebInspector.KeyboardShortcut._registeredKeyDownListener) {
- WebInspector.KeyboardShortcut._registeredKeyDownListener = true;
- window.addEventListener("keydown", WebInspector.KeyboardShortcut._handleKeyDown);
- }
- }
-};
-
-WebInspector.KeyboardShortcut._handleKeyDown = function(event)
-{
- if (event.defaultPrevented)
- return;
-
- for (var targetElement = event.target; targetElement; targetElement = targetElement.parentNode) {
- if (!targetElement._keyboardShortcuts)
- continue;
-
- for (var i = 0; i < targetElement._keyboardShortcuts.length; ++i) {
- var keyboardShortcut = targetElement._keyboardShortcuts[i];
- if (!keyboardShortcut.matchesEvent(event))
- continue;
-
- keyboardShortcut.callback(event, keyboardShortcut);
-
- if (keyboardShortcut.implicitlyPreventsDefault)
- event.preventDefault();
-
- return;
- }
- }
-};
-
-WebInspector.KeyboardShortcut.Modifier = {
- None: 0,
- Shift: 1,
- Control: 2,
- Option: 4,
- Command: 8,
-
- get CommandOrControl()
- {
- return InspectorFrontendHost.platform() === "mac" ? this.Command : this.Control;
- }
-};
-
-WebInspector.Key = function(keyCode, displayName)
-{
- this._keyCode = keyCode;
- this._displayName = displayName;
-};
-
-WebInspector.Key.prototype = {
- get keyCode()
- {
- return this._keyCode;
- },
-
- get displayName()
- {
- return this._displayName;
- },
-
- toString: function()
- {
- return this._displayName;
- }
-};
-
-WebInspector.KeyboardShortcut.Key = {
- Backspace: new WebInspector.Key(8, "\u232b"),
- Tab: new WebInspector.Key(9, "\u21e5"),
- Enter: new WebInspector.Key(13, "\u21a9"),
- Escape: new WebInspector.Key(27, "\u238b"),
- Space: new WebInspector.Key(32, "Space"),
- PageUp: new WebInspector.Key(33, "\u21de"),
- PageDown: new WebInspector.Key(34, "\u21df"),
- End: new WebInspector.Key(35, "\u2198"),
- Home: new WebInspector.Key(36, "\u2196"),
- Left: new WebInspector.Key(37, "\u2190"),
- Up: new WebInspector.Key(38, "\u2191"),
- Right: new WebInspector.Key(39, "\u2192"),
- Down: new WebInspector.Key(40, "\u2193"),
- Delete: new WebInspector.Key(46, "\u2326"),
- Zero: new WebInspector.Key(48, "0"),
- F1: new WebInspector.Key(112, "F1"),
- F2: new WebInspector.Key(113, "F2"),
- F3: new WebInspector.Key(114, "F3"),
- F4: new WebInspector.Key(115, "F4"),
- F5: new WebInspector.Key(116, "F5"),
- F6: new WebInspector.Key(117, "F6"),
- F7: new WebInspector.Key(118, "F7"),
- F8: new WebInspector.Key(119, "F8"),
- F9: new WebInspector.Key(120, "F9"),
- F10: new WebInspector.Key(121, "F10"),
- F11: new WebInspector.Key(122, "F11"),
- F12: new WebInspector.Key(123, "F12"),
- Semicolon: new WebInspector.Key(186, ";"),
- Plus: new WebInspector.Key(187, "+"),
- Comma: new WebInspector.Key(188, ","),
- Minus: new WebInspector.Key(189, "-"),
- Period: new WebInspector.Key(190, "."),
- Slash: new WebInspector.Key(191, "/"),
- Apostrophe: new WebInspector.Key(192, "`"),
- SingleQuote: new WebInspector.Key(222, "\'")
-};
-
-WebInspector.KeyboardShortcut.prototype = {
- constructor: WebInspector.KeyboardShortcut,
-
- // Public
-
- get modifiers()
- {
- return this._modifiers;
- },
-
- get key()
- {
- return this._key;
- },
-
- get displayName()
- {
- var result = "";
-
- if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Control)
- result += "\u2303";
- if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Option)
- result += InspectorFrontendHost.platform() === "mac" ? "\u2325" : "\u2387";
- if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Shift)
- result += "\u21e7";
- if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Command)
- result += "\u2318";
-
- result += this._key.toString();
-
- return result;
- },
-
- get callback()
- {
- return this._callback;
- },
-
- get disabled()
- {
- return this._disabled;
- },
-
- set disabled(disabled)
- {
- this._disabled = disabled || false;
- },
-
- get implicitlyPreventsDefault()
- {
- return this._implicitlyPreventsDefault;
- },
-
- set implicitlyPreventsDefault(implicitly)
- {
- this._implicitlyPreventsDefault = implicitly;
- },
-
- unbind: function()
- {
- this._disabled = true;
-
- if (!this._targetElement)
- return;
-
- var targetKeyboardShortcuts = this._targetElement._keyboardShortcuts;
- if (!targetKeyboardShortcuts)
- return;
-
- targetKeyboardShortcuts.remove(this);
- },
-
- matchesEvent: function(event)
- {
- if (this._disabled)
- return false;
-
- if (this._key.keyCode !== event.keyCode)
- return false;
-
- var eventModifiers = WebInspector.KeyboardShortcut.Modifier.None;
- if (event.shiftKey)
- eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Shift;
- if (event.ctrlKey)
- eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Control;
- if (event.altKey)
- eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Option;
- if (event.metaKey)
- eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Command;
- return this._modifiers === eventModifiers;
- }
-};
-
-WebInspector.KeyboardShortcut.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeDataGrid = function() {
- WebInspector.DataGrid.call(this, {
- name: { title: WebInspector.UIString("Node"), sortable: false },
- paintCount: { title: WebInspector.UIString("Paints"), sortable: true, aligned: "right", width: "50px" },
- memory: { title: WebInspector.UIString("Memory"), sortable: true, sort: "descending", aligned: "right", width: "70px" }
- });
-};
-
-WebInspector.LayerTreeDataGrid.prototype = {
- constructor: WebInspector.LayerTreeDataGrid,
-
- insertChild: function(child)
- {
- WebInspector.DataGrid.prototype.insertChild.call(this, child);
-
- this._updateChildren();
- },
-
- removeChild: function(child)
- {
- WebInspector.DataGrid.prototype.removeChild.call(this, child);
-
- this._updateChildren();
- },
-
- setChildren: function(children)
- {
- this._suspendLayout = true;
-
- var removedChildren = this.children.filter(function(child) {
- return !children.contains(child);
- });
-
- while (removedChildren.length)
- this.removeChild(removedChildren.pop());
-
- children.forEach(function(child) {
- if (child.parent !== this)
- this.appendChild(child);
- }.bind(this));
-
- this._suspendLayout = false;
-
- this.children = children;
- this._updateChildren();
- },
-
- _updateChildren: function()
- {
- if (this._suspendLayout)
- return;
-
- // Iterate through nodes by DOM order first so we can establish
- // the DOM index.
- var elements = this.dataTableBodyElement.rows;
- for (var i = 0, count = elements.length - 1; i < count; ++i)
- elements[i]._dataGridNode._domIndex = i;
-
- // Now iterate through children to set up their sibling relationship
- // and update the element style to offset the position of the node
- // to match its position in the children list vs. DOM order.
- var children = this.children;
- for (var i = 0, count = children.length; i < count; ++i) {
- var child = children[i];
- child.previousSibling = i > 0 ? children[i - 1] : null;
- child.nextSibling = i + 1 < count ? children[i + 1] : null;
-
- var ty = (i - child._domIndex) * 100;
- child.element.style.webkitTransform = "translateY(" + ty + "%)";
-
- // Since the DOM order won't necessarily match the visual order of the
- // children in the data grid we manually set "even" and "odd" and CSS
- // class names on the data grid nodes so that they may be styled with
- // a different mechanism than the built-in CSS pseudo-classes.
- var classList = child.element.classList;
- if (i % 2) {
- classList.remove("odd");
- classList.add("even");
- } else {
- classList.remove("even");
- classList.add("odd");
- }
- }
-
- this.hasChildren = this.children.length > 0;
- },
-
- _recalculateSiblings: function(myIndex)
- {
- // Overriding default implementation to do nothing at all
- // since we're setting sibling relationship in _updateChildren.
- }
-};
-
-WebInspector.LayerTreeDataGrid.prototype.__proto__ = WebInspector.DataGrid.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,168 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeDataGridNode = function(layer)
-{
- WebInspector.DataGridNode.call(this);
-
- this._outlets = {};
-
- this.layer = layer;
-};
-
-WebInspector.LayerTreeDataGridNode.prototype = {
- constructor: WebInspector.DataGridNode,
-
- // DataGridNode Overrides.
-
- createCells: function()
- {
- WebInspector.DataGridNode.prototype.createCells.call(this);
-
- this._cellsWereCreated = true;
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- var cell = columnIdentifier === "name" ? this._makeNameCell() : this._makeOutlet(columnIdentifier, document.createTextNode());
- this._updateCell(columnIdentifier);
- return cell;
- },
-
- // Public
-
- get layer()
- {
- return this._layer;
- },
-
- set layer(layer)
- {
- this._layer = layer;
-
- var domNode = WebInspector.domTreeManager.nodeForId(layer.nodeId);
-
- this.data = {
- name: domNode ? WebInspector.displayNameForNode(domNode) : WebInspector.UIString("Unknown node"),
- paintCount: layer.paintCount || "\u2014",
- memory: Number.bytesToString(layer.memory || 0)
- };
- },
-
- get data()
- {
- return this._data;
- },
-
- set data(data)
- {
- Object.keys(data).forEach(function(columnIdentifier) {
- if (this._data[columnIdentifier] === data[columnIdentifier])
- return;
-
- this._data[columnIdentifier] = data[columnIdentifier];
- if (this._cellsWereCreated)
- this._updateCell(columnIdentifier);
- }, this);
- },
-
- // Private
-
- _makeOutlet: function(name, element)
- {
- return this._outlets[name] = element;
- },
-
- _makeNameCell: function()
- {
- var fragment = document.createDocumentFragment();
-
- fragment.appendChild(document.createElement("img")).className = "icon";
-
- var label = this._makeOutlet("label", fragment.appendChild(document.createElement("div")));
- label.className = "label";
-
- var nameLabel = this._makeOutlet("nameLabel", label.appendChild(document.createElement("span")));
- nameLabel.className = "name";
-
- var pseudoLabel = this._makeOutlet("pseudoLabel", document.createElement("span"));
- pseudoLabel.className = "pseudo-element";
-
- var reflectionLabel = this._makeOutlet("reflectionLabel", document.createElement("span"));
- reflectionLabel.className = "reflection";
- reflectionLabel.textContent = " \u2014 " + WebInspector.UIString("Reflection");
-
- var goToButton = this._makeOutlet("goToButton", fragment.appendChild(WebInspector.createGoToArrowButton()));
- goToButton.addEventListener("click", this._goToArrowWasClicked.bind(this), false);
-
- return fragment;
- },
-
- _updateCell: function(columnIdentifier)
- {
- var data = this._data[columnIdentifier];
- if (columnIdentifier === "name")
- this._updateNameCellData(data);
- else
- this._outlets[columnIdentifier].textContent = data;
- },
-
- _updateNameCellData: function(data)
- {
- var layer = this._layer;
- var label = this._outlets.label;
-
- this._outlets.nameLabel.textContent = data;
-
- if (layer.pseudoElement)
- label.appendChild(this._outlets.pseudoLabel).textContent = "::" + layer.pseudoElement;
- else if (this._outlets.pseudoLabel.parentNode)
- label.removeChild(this._outlets.pseudoLabel);
-
- if (layer.isReflection)
- label.appendChild(this._outlets.reflectionLabel);
- else if (this._outlets.reflectionLabel.parentNode)
- label.removeChild(this._outlets.reflectionLabel);
-
- if (WebInspector.domTreeManager.nodeForId(layer.nodeId))
- label.parentNode.appendChild(this._outlets.goToButton);
- else if (this._outlets.goToButton.parentNode)
- label.parentNode.removeChild(this._outlets.goToButton);
-
- var element = this.element;
- if (layer.isReflection)
- element.classList.add("reflection");
- else if (layer.pseudoElement)
- element.classList.add("pseudo-element");
- },
-
- _goToArrowWasClicked: function()
- {
- var domNode = WebInspector.domTreeManager.nodeForId(this._layer.nodeId);
- WebInspector.resourceSidebarPanel.showMainFrameDOMTree(domNode, true);
- }
-};
-
-WebInspector.LayerTreeDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,160 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeManager = function() {
- WebInspector.Object.call(this);
-
- this._supported = !!window.LayerTreeAgent;
-
- if (this._supported)
- LayerTreeAgent.enable();
-};
-
-WebInspector.LayerTreeManager.Event = {
- LayerTreeDidChange: "layer-tree-did-change"
-};
-
-WebInspector.LayerTreeManager.prototype = {
- constructor: WebInspector.LayerTreeManager,
-
- // Public
-
- get supported()
- {
- return this._supported;
- },
-
- layerTreeMutations: function(previousLayers, newLayers)
- {
- console.assert(this.supported);
-
- if (isEmptyObject(previousLayers)) {
- return {
- preserved: [],
- additions: newLayers,
- removals: []
- };
- }
-
- function nodeIdForLayer(layer)
- {
- return layer.isGeneratedContent ? layer.pseudoElementId : layer.nodeId;
- }
-
- var layerIdsInPreviousLayers = [];
- var nodeIdsInPreviousLayers = [];
- var nodeIdsForReflectionsInPreviousLayers = [];
-
- previousLayers.forEach(function(layer) {
- layerIdsInPreviousLayers.push(layer.layerId);
-
- var nodeId = nodeIdForLayer(layer);
- if (!nodeId)
- return;
-
- if (layer.isReflection)
- nodeIdsForReflectionsInPreviousLayers.push(nodeId);
- else
- nodeIdsInPreviousLayers.push(nodeId);
- });
-
- var preserved = [];
- var additions = [];
-
- var layerIdsInNewLayers = [];
- var nodeIdsInNewLayers = [];
- var nodeIdsForReflectionsInNewLayers = [];
-
- newLayers.forEach(function(layer) {
- layerIdsInNewLayers.push(layer.layerId);
-
- var existed = layerIdsInPreviousLayers.contains(layer.layerId);
-
- var nodeId = nodeIdForLayer(layer);
- if (!nodeId)
- return;
-
- if (layer.isReflection) {
- nodeIdsForReflectionsInNewLayers.push(nodeId);
- existed = existed || nodeIdsForReflectionsInPreviousLayers.contains(nodeId);
- } else {
- nodeIdsInNewLayers.push(nodeId);
- existed = existed || nodeIdsInPreviousLayers.contains(nodeId);
- }
-
- if (existed)
- preserved.push(layer);
- else
- additions.push(layer);
- });
-
- var removals = previousLayers.filter(function(layer) {
- var nodeId = nodeIdForLayer(layer);
-
- if (layer.isReflection)
- return !nodeIdsForReflectionsInNewLayers.contains(nodeId);
- else
- return !nodeIdsInNewLayers.contains(nodeId) && !layerIdsInNewLayers.contains(layer.layerId);
- });
-
- return {
- preserved: preserved,
- additions: additions,
- removals: removals
- };
- },
-
- layersForNode: function(node, callback)
- {
- console.assert(this.supported);
-
- LayerTreeAgent.layersForNode(node.id, function(error, layers) {
- if (error || isEmptyObject(layers)) {
- callback(null, []);
- return;
- }
-
- var firstLayer = layers[0];
- var layerForNode = firstLayer.nodeId === node.id && !firstLayer.isGeneratedContent ? layers.shift() : null;
- callback(layerForNode, layers);
- }.bind(this));
- },
-
- reasonsForCompositingLayer: function(layer, callback)
- {
- console.assert(this.supported);
-
- LayerTreeAgent.reasonsForCompositingLayer(layer.layerId, function(error, reasons) {
- callback(error ? 0 : reasons);
- });
- },
-
- layerTreeDidChange: function()
- {
- this.dispatchEventToListeners(WebInspector.LayerTreeManager.Event.LayerTreeDidChange);
- }
-};
-
-WebInspector.LayerTreeManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.LayerTreeObserver.prototype = {
- constructor: WebInspector.LayerTreeObserver,
-
- // Events defined by the "LayerTree" domain.
-
- layerTreeDidChange: function()
- {
- if (WebInspector.layerTreeManager.supported)
- WebInspector.layerTreeManager.layerTreeDidChange();
- }
-};
-
-WebInspector.LayerTreeObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,230 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-
-/* We use an internal container to act as a vertical stack. */
-
-.layer-tree.panel .box-container {
- height: 100%;
- /* Let it stack its content as vertical boxes. */
- display: -webkit-flex;
- -webkit-flex-direction: column;
-}
-
-/* Hide the collapsed arrow from sections. */
-
-.layer-tree.panel .details-section > .header::before {
- /* Don't show the collpased arrow. */
- display: none;
-}
-
-.layer-tree.panel .details-section > .header {
- /* Add a little padding since there's no arrow to show. */
- padding-left: 4px;
- /* Turn off mouse events so we can't click to toggle section. */
- pointer-events: none;
-}
-
-.layer-tree.panel .details-section > .header > label {
- /* Always show the options box. */
- display: block !important;
- /* Turn on events just for the <label> and <input>. */
- pointer-events: all;
-}
-
-/* Customizing the DataGrid. */
-
-.layer-tree.panel .details-section.layer-children {
- position: relative;
- /* Use all available vertical space. */
- -webkit-flex: 1;
- /* Let children stack vertically. */
- display: -webkit-flex;
- -webkit-flex-direction: column;
-}
-
-.layer-tree.panel .details-section.layer-children > .content {
- position: relative;
- display: block;
- /* Use all available vertical space. */
- -webkit-flex: 1;
-}
-
-.layer-tree.panel .details-section.layer-children .group {
- position: absolute;
- width: 100%;
- height: 100%;
-}
-
-.layer-tree.panel .data-grid {
- position: relative;
- top: 0;
- width: 100%;
- height: 100%;
- /* Turn off the default borders, we want to snap to edges. */
- border: none;
-}
-
-.layer-tree.panel .data-grid table.data {
- background-size: 100% 44px;
-}
-
-.layer-tree.panel .data-container {
- position: absolute;
- /* Leave room for the data grid header. */
- top: 16px;
- /* Use all remaining vertical space in the container. */
- bottom: 0;
- /* Let the inline table content scroll, independently of the header. */
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-.layer-tree.panel .data-container tr {
- height: 22px;
-}
-
-.layer-tree.panel .data-container td > div {
- display: -webkit-flex;
- width: 100%;
- height: 100%;
- -webkit-align-items: center;
- -webkit-justify-content: flex-end;
-}
-
-/* Customizing the DataGrid "node" cell. */
-
-.layer-tree.panel .data-container .name-column {
- padding-right: 0;
-}
-
-.layer-tree.panel .data-container .name-column .icon {
- vertical-align: top;
- width: 16px;
- height: 16px;
- content: url(Images/DOMElement.svg);
-}
-
-.layer-tree.panel .data-container tr.reflection .name-column .icon {
- content: url(Images/Reflection.svg);
-}
-
-.layer-tree.panel .data-container tr.pseudo-element .name-column .icon {
- content: url(Images/PseudoElement.svg);
-}
-
-.layer-tree.panel .data-container .name-column .label {
- -webkit-flex: 1;
- padding: 0 4px;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.layer-tree.panel .data-container tr:hover .name-column .label {
- padding-right: 0;
-}
-
-.layer-tree.panel .data-container .name-column .pseudo-element,
-.layer-tree.panel .data-container .name-column .reflection {
- color: rgb(128, 128, 128);
-}
-
-.layer-tree.panel .data-container tr.selected .name-column .pseudo-element,
-.layer-tree.panel .data-container tr.selected .name-column .reflection {
- color: rgba(255, 255, 255, 0.75);
-}
-
-.layer-tree.panel .data-container .go-to-arrow {
- display: none;
-}
-
-.layer-tree.panel .data-container tr:hover .go-to-arrow {
- display: block;
-}
-
-.layer-tree.panel .data-container tbody > tr.even {
- background-color: white;
-}
-
-.layer-tree.panel .data-container tbody > tr.odd {
- background-color: rgb(243, 246, 250);
-}
-
-/* Bottom bar */
-
-.layer-tree.panel .bottom-bar {
- position: relative;
- height: 22px;
- /* Let it stack its content as horizontal boxes. */
- display: -webkit-flex;
-}
-
-.layer-tree.panel .bottom-bar > div {
- padding: 4px;
- box-sizing: border-box;
-
- font-family: 'Lucida Grande', sans-serif;
- font-size: 11px;
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
-
- /* Ensure any overflowing text is trimmed. */
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- /* Let all boxes have the same width. */
- display: -webkit-flex;
- -webkit-flex: 1;
-}
-
-.layer-tree.panel .layers-memory-label {
- -webkit-justify-content: flex-end;
-}
-
-/* popover */
-
-.layer-tree-popover {
- font-family: 'Lucida Grande', sans-serif;
- font-size: 11px;
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
-
- padding: 5px;
-}
-
-.layer-tree-popover p {
- margin: 0;
-}
-
-.layer-tree-popover ul {
- list-style-type: none;
- margin: 10px 0 0 0;
- padding-left: 10px;
-}
-
-.layer-tree-popover li {
- line-height: 1.3em;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,436 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeSidebarPanel = function() {
- WebInspector.DOMDetailsSidebarPanel.call(this, "layer-tree", WebInspector.UIString("Layers"), WebInspector.UIString("Layer"), "Images/NavigationItemLayers.svg", "3");
-
- this._dataGridNodesByLayerId = {};
-
- this.element.classList.add(WebInspector.LayerTreeSidebarPanel.StyleClassName);
-
- WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
-
- window.addEventListener("resize", this._windowResized.bind(this));
-
- // Add a container that will host all sections as a vertical stack.
- this._container = this.element.appendChild(document.createElement("div"));
- this._container.className = "box-container";
-
- this._buildLayerInfoSection();
- this._buildDataGridSection();
- this._buildBottomBar();
-};
-
-WebInspector.LayerTreeSidebarPanel.StyleClassName = "layer-tree";
-
-WebInspector.LayerTreeSidebarPanel.prototype = {
- constructor: WebInspector.LayerTreeSidebarPanel,
-
- // DetailsSidebarPanel Overrides.
-
- shown: function()
- {
- WebInspector.layerTreeManager.addEventListener(WebInspector.LayerTreeManager.Event.LayerTreeDidChange, this._layerTreeDidChange, this);
-
- console.assert(this.parentSidebar);
-
- this.needsRefresh();
-
- WebInspector.DOMDetailsSidebarPanel.prototype.shown.call(this);
- },
-
- hidden: function()
- {
- WebInspector.layerTreeManager.removeEventListener(WebInspector.LayerTreeManager.Event.LayerTreeDidChange, this._layerTreeDidChange, this);
-
- WebInspector.DOMDetailsSidebarPanel.prototype.hidden.call(this);
- },
-
- refresh: function()
- {
- if (!this.domNode)
- return;
-
- WebInspector.layerTreeManager.layersForNode(this.domNode, function(layerForNode, childLayers) {
- this._unfilteredChildLayers = childLayers;
- this._updateDisplayWithLayers(layerForNode, childLayers);
- }.bind(this));
- },
-
- // DOMDetailsSidebarPanel Overrides
-
- supportsDOMNode: function(nodeToInspect)
- {
- return WebInspector.layerTreeManager.supported && nodeToInspect.nodeType() === Node.ELEMENT_NODE;
- },
-
- // Private
-
- _layerTreeDidChange: function(event)
- {
- this.needsRefresh();
- },
-
- _showShadowDOMSettingChanged: function(event)
- {
- if (this.selected)
- this._updateDisplayWithLayers(this._layerForNode, this._unfilteredChildLayers);
- },
-
- _windowResized: function(event)
- {
- if (this._popover && this._popover.visible)
- this._updatePopoverForSelectedNode();
- },
-
- _buildLayerInfoSection: function()
- {
- var rows = this._layerInfoRows = {};
- var rowsArray = [];
-
- rowsArray.push(rows["Width"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width")));
- rowsArray.push(rows["Height"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height")));
- rowsArray.push(rows["Paints"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Paints")));
- rowsArray.push(rows["Memory"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Memory")));
-
- this._layerInfoGroup = new WebInspector.DetailsSectionGroup(rowsArray);
-
- var emptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Layer Available"));
- emptyRow.showEmptyMessage();
- this._noLayerInformationGroup = new WebInspector.DetailsSectionGroup([emptyRow]);
-
- this._layerInfoSection = new WebInspector.DetailsSection("layer-info", WebInspector.UIString("Layer Info"), [this._noLayerInformationGroup]);
-
- this._container.appendChild(this._layerInfoSection.element);
- },
-
- _buildDataGridSection: function()
- {
- this._dataGrid = new WebInspector.LayerTreeDataGrid;
-
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._selectedDataGridNodeChanged, this);
-
- var element = this._dataGrid.element;
- element.addEventListener("focus", this._dataGridGainedFocus.bind(this), false);
- element.addEventListener("blur", this._dataGridLostFocus.bind(this), false);
- element.addEventListener("click", this._dataGridWasClicked.bind(this), false);
-
- this._childLayersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Child Layers"));
- var group = new WebInspector.DetailsSectionGroup([this._childLayersRow]);
- var section = new WebInspector.DetailsSection("layer-children", WebInspector.UIString("Child Layers"), [group], null, true);
-
- // Display it in the container with a class name so we can easily style it differently to other sections,
- // this specific section is meant to scale to fill the space available vertically.
- var element = this._container.appendChild(section.element);
- element.classList.add(section.identifier);
- },
-
- _buildBottomBar: function()
- {
- var bottomBar = this._container.appendChild(document.createElement("div"));
- bottomBar.className = "bottom-bar";
-
- this._layersCountLabel = bottomBar.appendChild(document.createElement("div"));
- this._layersCountLabel.className = "layers-count-label";
-
- this._layersMemoryLabel = bottomBar.appendChild(document.createElement("div"));
- this._layersMemoryLabel.className = "layers-memory-label";
- },
-
- _sortDataGrid: function()
- {
- var dataGrid = this._dataGrid;
-
- var nodes = dataGrid.children.slice();
- var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
- var sortDirection = dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function comparator(a, b)
- {
- var item1 = a.layer[sortColumnIdentifier] || 0;
- var item2 = b.layer[sortColumnIdentifier] || 0;
- return sortDirection * (item1 - item2);
- };
-
- nodes.sort(comparator);
-
- dataGrid.setChildren(nodes);
-
- this._updatePopoverForSelectedNode();
- },
-
- _selectedDataGridNodeChanged: function()
- {
- if (this._dataGrid.selectedNode) {
- this._highlightSelectedNode();
- this._showPopoverForSelectedNode();
- } else {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- this._hidePopover();
- }
- },
-
- _dataGridGainedFocus: function(event)
- {
- this._highlightSelectedNode();
- this._showPopoverForSelectedNode();
- },
-
- _dataGridLostFocus: function(event)
- {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- this._hidePopover();
- },
-
- _dataGridWasClicked: function(event)
- {
- if (this._dataGrid.selectedNode && event.target.parentNode.classList.contains("filler"))
- this._dataGrid.selectedNode.deselect();
- },
-
- _highlightSelectedNode: function()
- {
- var dataGridNode = this._dataGrid.selectedNode;
- if (!dataGridNode)
- return;
-
- var layer = dataGridNode.layer;
- if (layer.isGeneratedContent || layer.isReflection || layer.isAnonymous)
- WebInspector.domTreeManager.highlightRect(layer.bounds, true);
- else
- WebInspector.domTreeManager.highlightDOMNode(layer.nodeId);
- },
-
- _updateDisplayWithLayers: function(layerForNode, childLayers)
- {
- if (!WebInspector.showShadowDOMSetting.value) {
- childLayers = childLayers.filter(function(layer) {
- return !layer.isInShadowTree;
- });
- }
-
- this._updateLayerInfoSection(layerForNode);
- this._updateDataGrid(layerForNode, childLayers);
- this._updateMetrics(layerForNode, childLayers);
-
- this._layerForNode = layerForNode;
- this._childLayers = childLayers;
- },
-
- _updateLayerInfoSection: function(layer)
- {
- const emDash = "\u2014";
-
- this._layerInfoSection.groups = layer ? [this._layerInfoGroup] : [this._noLayerInformationGroup];
-
- if (!layer)
- return;
-
- this._layerInfoRows["Memory"].value = Number.bytesToString(layer.memory);
- this._layerInfoRows["Width"].value = layer.compositedBounds.width + "px";
- this._layerInfoRows["Height"].value = layer.compositedBounds.height + "px";
- this._layerInfoRows["Paints"].value = layer.paintCount + "";
- },
-
- _updateDataGrid: function(layerForNode, childLayers)
- {
- var dataGrid = this._dataGrid;
-
- var mutations = WebInspector.layerTreeManager.layerTreeMutations(this._childLayers, childLayers);
-
- mutations.removals.forEach(function(layer) {
- var node = this._dataGridNodesByLayerId[layer.layerId];
- if (node) {
- dataGrid.removeChild(node);
- delete this._dataGridNodesByLayerId[layer.layerId];
- }
- }.bind(this));
-
- mutations.additions.forEach(function(layer) {
- var node = this._dataGridNodeForLayer(layer);
- if (node)
- dataGrid.appendChild(node);
- }.bind(this));
-
- mutations.preserved.forEach(function(layer) {
- var node = this._dataGridNodesByLayerId[layer.layerId];
- if (node)
- node.layer = layer;
- }.bind(this));
-
- this._sortDataGrid();
-
- this._childLayersRow.dataGrid = !isEmptyObject(childLayers) ? this._dataGrid : null;
- },
-
- _dataGridNodeForLayer: function(layer)
- {
- var node = new WebInspector.LayerTreeDataGridNode(layer);
-
- this._dataGridNodesByLayerId[layer.layerId] = node;
-
- return node;
- },
-
- _updateMetrics: function(layerForNode, childLayers)
- {
- var layerCount = 0;
- var totalMemory = 0;
-
- if (layerForNode) {
- layerCount++;
- totalMemory += layerForNode.memory || 0;
- }
-
- childLayers.forEach(function(layer) {
- layerCount++;
- totalMemory += layer.memory || 0;
- });
-
- this._layersCountLabel.textContent = WebInspector.UIString("Layer count: %d").format(layerCount);
- this._layersMemoryLabel.textContent = WebInspector.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
- },
-
- _showPopoverForSelectedNode: function()
- {
- var dataGridNode = this._dataGrid.selectedNode;
- if (!dataGridNode)
- return;
-
- this._contentForPopover(dataGridNode.layer, function(content) {
- if (dataGridNode === this._dataGrid.selectedNode)
- this._updatePopoverForSelectedNode(content);
- }.bind(this));
- },
-
- _updatePopoverForSelectedNode: function(content)
- {
- var dataGridNode = this._dataGrid.selectedNode;
- if (!dataGridNode)
- return;
-
- var popover = this._popover;
- if (!popover)
- popover = this._popover = new WebInspector.Popover;
-
- var targetFrame = WebInspector.Rect.rectFromClientRect(dataGridNode.element.getBoundingClientRect());
-
- if (content)
- popover.content = content;
-
- popover.present(targetFrame.pad(2), [WebInspector.RectEdge.MIN_X]);
- },
-
- _hidePopover: function()
- {
- if (this._popover)
- this._popover.dismiss();
- },
-
- _contentForPopover: function(layer, callback)
- {
- var content = document.createElement("div");
- content.className = "layer-tree-popover";
-
- content.appendChild(document.createElement("p")).textContent = WebInspector.UIString("Reasons for compositing:");
-
- var list = content.appendChild(document.createElement("ul"));
-
- WebInspector.layerTreeManager.reasonsForCompositingLayer(layer, function(compositingReasons) {
- if (isEmptyObject(compositingReasons)) {
- callback(content);
- return;
- }
-
- this._populateListOfCompositingReasons(list, compositingReasons);
-
- callback(content);
- }.bind(this));
-
- return content;
- },
-
- _populateListOfCompositingReasons: function(list, compositingReasons)
- {
- function addReason(reason)
- {
- list.appendChild(document.createElement("li")).textContent = reason;
- }
-
- if (compositingReasons.transform3D)
- addReason(WebInspector.UIString("Element has a 3D transform"));
- if (compositingReasons.video)
- addReason(WebInspector.UIString("Element is <video>"));
- if (compositingReasons.canvas)
- addReason(WebInspector.UIString("Element is <canvas>"));
- if (compositingReasons.plugin)
- addReason(WebInspector.UIString("Element is a plug-in"));
- if (compositingReasons.iFrame)
- addReason(WebInspector.UIString("Element is <iframe>"));
- if (compositingReasons.backfaceVisibilityHidden)
- addReason(WebInspector.UIString("Element has “backface-visibility: hidden” style"));
- if (compositingReasons.clipsCompositingDescendants)
- addReason(WebInspector.UIString("Element clips compositing descendants"));
- if (compositingReasons.animation)
- addReason(WebInspector.UIString("Element is animated"));
- if (compositingReasons.filters)
- addReason(WebInspector.UIString("Element has CSS filters applied"));
- if (compositingReasons.positionFixed)
- addReason(WebInspector.UIString("Element has “position: fixed” style"));
- if (compositingReasons.positionSticky)
- addReason(WebInspector.UIString("Element has “position: sticky” style"));
- if (compositingReasons.overflowScrollingTouch)
- addReason(WebInspector.UIString("Element has “-webkit-overflow-scrolling: touch” style"));
- if (compositingReasons.stacking)
- addReason(WebInspector.UIString("Element establishes a stacking context"));
- if (compositingReasons.overlap)
- addReason(WebInspector.UIString("Element overlaps other compositing element"));
- if (compositingReasons.negativeZIndexChildren)
- addReason(WebInspector.UIString("Element has children with a negative z-index"));
- if (compositingReasons.transformWithCompositedDescendants)
- addReason(WebInspector.UIString("Element has a 2D transform and composited descendants"));
- if (compositingReasons.opacityWithCompositedDescendants)
- addReason(WebInspector.UIString("Element has opacity applied and composited descendants"));
- if (compositingReasons.maskWithCompositedDescendants)
- addReason(WebInspector.UIString("Element is masked and composited descendants"));
- if (compositingReasons.reflectionWithCompositedDescendants)
- addReason(WebInspector.UIString("Element has a reflection and composited descendants"));
- if (compositingReasons.filterWithCompositedDescendants)
- addReason(WebInspector.UIString("Element has CSS filters applied and composited descendants"));
- if (compositingReasons.blendingWithCompositedDescendants)
- addReason(WebInspector.UIString("Element has CSS blending applied and composited descendants"));
- if (compositingReasons.perspective)
- addReason(WebInspector.UIString("Element has perspective applied"));
- if (compositingReasons.preserve3D)
- addReason(WebInspector.UIString("Element has “transform-style: preserve-3d” style"));
- if (compositingReasons.root)
- addReason(WebInspector.UIString("Element is the root element"));
- if (compositingReasons.blending)
- addReason(WebInspector.UIString("Element has “blend-mode” style"));
- }
-};
-
-WebInspector.LayerTreeSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
-{
- WebInspector.TimelineDataGrid.call(this, treeOutline, columns, delegate, editCallback, deleteCallback);
-
- this._showingHighlight = false;
-
- this.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._layoutDataGridSelectedNodeChanged, this);
-}
-
-WebInspector.LayoutTimelineDataGrid.prototype = {
- constructor: WebInspector.LayoutTimelineDataGrid,
-
- // Protected
-
- reset: function()
- {
- WebInspector.TimelineDataGrid.prototype.reset.call(this);
-
- this._hideHighlightIfNeeded();
- },
-
- callFramePopoverAnchorElement: function()
- {
- return this.selectedNode.elementWithColumnIdentifier("initiatorCallFrame");
- },
-
- hidden: function()
- {
- WebInspector.TimelineDataGrid.prototype.hidden.call(this);
-
- this._hideHighlightIfNeeded();
- },
-
- // Private
-
- _layoutDataGridSelectedNodeChanged: function(event)
- {
- if (!this.selectedNode) {
- this._hideHighlightIfNeeded();
- return;
- }
-
- var record = this.selectedNode.record;
- const contentColor = {r: 111, g: 168, b: 220, a: 0.66};
- const outlineColor = {r: 255, g: 229, b: 153, a: 0.66};
-
- var quad = record.quad;
- if (quad && DOMAgent.highlightQuad) {
- DOMAgent.highlightQuad(quad.toProtocol(), contentColor, outlineColor);
- this._showingHighlight = true;
- return;
- }
-
- // COMPATIBILITY (iOS 6): iOS 6 included Rect information instead of Quad information. Fallback to highlighting the rect.
- var rect = record.rect;
- if (rect) {
- DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, contentColor, outlineColor);
- this._showingHighlight = true;
- return;
- }
- },
-
- _hideHighlightIfNeeded: function()
- {
- if (this._showingHighlight) {
- DOMAgent.hideHighlight();
- this._showingHighlight = false;
- }
- }
-}
-
-WebInspector.LayoutTimelineDataGrid.prototype.__proto__ = WebInspector.TimelineDataGrid.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineDataGridNode = function(layoutTimelineRecord, baseStartTime)
-{
- WebInspector.TimelineDataGridNode.call(this, false, null);
-
- this._record = layoutTimelineRecord;
- this._baseStartTime = baseStartTime || 0;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.LayoutTimelineDataGridNode);
-
-WebInspector.LayoutTimelineDataGridNode.IconStyleClassName = "icon";
-WebInspector.LayoutTimelineDataGridNode.SubtitleStyleClassName = "subtitle";
-
-WebInspector.LayoutTimelineDataGridNode.prototype = {
- constructor: WebInspector.LayoutTimelineDataGridNode,
- __proto__: WebInspector.TimelineDataGridNode.prototype,
-
- // Public
-
- get record()
- {
- return this._record;
- },
-
- get records()
- {
- return [this._record];
- },
-
- get data()
- {
- return this._record;
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- const emptyValuePlaceholderString = "\u2014";
- var value = this.data[columnIdentifier];
-
- switch (columnIdentifier) {
- case "eventType":
- return WebInspector.LayoutTimelineRecord.EventType.displayName(value);
-
- case "width":
- case "height":
- return isNaN(value) ? emptyValuePlaceholderString : WebInspector.UIString("%fpx").format(value);
-
- case "area":
- return isNaN(value) ? emptyValuePlaceholderString : WebInspector.UIString("%fpx²").format(value);
-
- case "startTime":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
-
- case "duration":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
- }
-
- return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-overview-graph.layout > .timeline-record-bar {
- margin-top: 8px;
- height: 20px;
-}
-
-.timeline-overview-graph.layout > .timeline-record-bar > .segment {
- border-radius: 2px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,94 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineOverviewGraph = function(recording)
-{
- WebInspector.TimelineOverviewGraph.call(this, recording);
-
- this.element.classList.add(WebInspector.LayoutTimelineOverviewGraph.StyleClassName);
-
- this._layoutTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Layout);
- this._layoutTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._layoutTimelineRecordAdded, this);
-
- this._timelineRecordBars = [];
-
- this.reset();
-};
-
-WebInspector.LayoutTimelineOverviewGraph.StyleClassName = "layout";
-
-WebInspector.LayoutTimelineOverviewGraph.prototype = {
- constructor: WebInspector.LayoutTimelineOverviewGraph,
- __proto__: WebInspector.TimelineOverviewGraph.prototype,
-
- // Public
-
- reset: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
-
- this._timelineRecordBarMap = new Map;
-
- this.element.removeChildren();
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
-
- var visibleWidth = this.element.offsetWidth;
- var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
-
- var recordBarIndex = 0;
-
- function createBar(records, renderMode)
- {
- var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
- if (!timelineRecordBar)
- timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
- timelineRecordBar.renderMode = renderMode;
- timelineRecordBar.records = records;
- timelineRecordBar.refresh(this);
- if (!timelineRecordBar.element.parentNode)
- this.element.appendChild(timelineRecordBar.element);
- ++recordBarIndex;
- }
-
- WebInspector.TimelineRecordBar.createCombinedBars(this._layoutTimeline.records, secondsPerPixel, this, createBar.bind(this));
-
- // Remove the remaining unused TimelineRecordBars.
- for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
- this._timelineRecordBars[recordBarIndex].records = null;
- this._timelineRecordBars[recordBarIndex].element.remove();
- }
- },
-
- // Private
-
- _layoutTimelineRecordAdded: function(event)
- {
- this.needsLayout();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineRecordjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineRecord.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineRecord.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,125 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineRecord = function(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad)
-{
- WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Layout, startTime, endTime, callFrames, sourceCodeLocation);
-
- console.assert(eventType);
-
- if (eventType in WebInspector.LayoutTimelineRecord.EventType)
- eventType = WebInspector.LayoutTimelineRecord.EventType[eventType];
-
- this._eventType = eventType;
- this._x = typeof x === "number" ? x : NaN;
- this._y = typeof y === "number" ? y : NaN;
- this._width = typeof width === "number" ? width : NaN;
- this._height = typeof height === "number" ? height : NaN;
- this._quad = quad instanceof WebInspector.Quad ? quad : null;
-};
-
-WebInspector.LayoutTimelineRecord.EventType = {
- InvalidateStyles: "layout-timeline-record-invalidate-styles",
- RecalculateStyles: "layout-timeline-record-recalculate-styles",
- InvalidateLayout: "layout-timeline-record-invalidate-layout",
- Layout: "layout-timeline-record-layout",
- Paint: "layout-timeline-record-paint"
-};
-
-WebInspector.LayoutTimelineRecord.EventType.displayName = function(eventType)
-{
- switch(eventType) {
- case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
- return WebInspector.UIString("Styles Invalidated");
- case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
- return WebInspector.UIString("Styles Recalculated");
- case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
- return WebInspector.UIString("Layout Invalidated");
- case WebInspector.LayoutTimelineRecord.EventType.Layout:
- return WebInspector.UIString("Layout");
- case WebInspector.LayoutTimelineRecord.EventType.Paint:
- return WebInspector.UIString("Paint");
- }
-};
-
-WebInspector.LayoutTimelineRecord.TypeIdentifier = "layout-timeline-record";
-WebInspector.LayoutTimelineRecord.EventTypeCookieKey = "layout-timeline-record-event-type";
-
-WebInspector.LayoutTimelineRecord.prototype = {
- constructor: WebInspector.LayoutTimelineRecord,
-
- // Public
-
- get eventType()
- {
- return this._eventType;
- },
-
- 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 rect()
- {
- if (!isNaN(this._x) && !isNaN(this._y))
- return new WebInspector.Rect(this._x, this._y, this._width, this._height);
- return null;
- },
-
- get quad()
- {
- return this._quad;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- WebInspector.TimelineRecord.prototype.saveIdentityToCookie.call(this, cookie);
-
- cookie[WebInspector.LayoutTimelineRecord.EventTypeCookieKey] = this._eventType;
- }
-};
-
-WebInspector.LayoutTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-view.layout > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
-.timeline-view.layout > .data-grid .eventType-column {
- border-right: none;
-}
-
-.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.layout .item .subtitle {
- display: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,194 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineView = function(recording)
-{
- WebInspector.TimelineView.call(this);
-
- this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.LayoutTimelineView.TreeOutlineStyleClassName);
-
- var columns = {eventType: {}, initiatorCallFrame: {}, width: {}, height: {}, startTime: {}, duration: {}};
-
- columns.eventType.title = WebInspector.UIString("Type");
- columns.eventType.width = "15%";
- columns.eventType.scopeBar = WebInspector.TimelineDataGrid.createColumnScopeBar("layout", WebInspector.LayoutTimelineRecord.EventType);
- columns.eventType.hidden = true;
-
- columns.initiatorCallFrame.title = WebInspector.UIString("Initiator");
- columns.initiatorCallFrame.width = "25%";
-
- columns.width.title = WebInspector.UIString("Width");
- columns.width.width = "8%";
-
- columns.height.title = WebInspector.UIString("Height");
- columns.height.width = "8%";
-
- columns.startTime.title = WebInspector.UIString("Start Time");
- columns.startTime.width = "8%";
- columns.startTime.aligned = "right";
- columns.startTime.sort = "ascending";
-
- columns.duration.title = WebInspector.UIString("Duration");
- columns.duration.width = "8%";
- columns.duration.aligned = "right";
-
- for (var column in columns)
- columns[column].sortable = true;
-
- this._dataGrid = new WebInspector.LayoutTimelineDataGrid(this.navigationSidebarTreeOutline, columns);
- this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
- this.element.classList.add(WebInspector.LayoutTimelineView.StyleClassName);
- this.element.appendChild(this._dataGrid.element);
-
- var layoutTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Layout);
- layoutTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._layoutTimelineRecordAdded, this);
-
- this._pendingRecords = [];
-};
-
-WebInspector.LayoutTimelineView.StyleClassName = "layout";
-WebInspector.LayoutTimelineView.TreeOutlineStyleClassName = "layout";
-
-WebInspector.LayoutTimelineView.prototype = {
- constructor: WebInspector.LayoutTimelineView,
- __proto__: WebInspector.TimelineView.prototype,
-
- // Public
-
- get navigationSidebarTreeOutlineLabel()
- {
- return WebInspector.UIString("Records");
- },
-
- shown: function()
- {
- WebInspector.TimelineView.prototype.shown.call(this);
-
- this._dataGrid.shown();
- },
-
- hidden: function()
- {
- this._dataGrid.hidden();
-
- WebInspector.TimelineView.prototype.hidden.call(this);
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineView.prototype.updateLayout.call(this);
-
- this._dataGrid.updateLayout();
-
- this._processPendingRecords();
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
- },
-
- reset: function()
- {
- WebInspector.TimelineView.prototype.reset.call(this);
-
- this._dataGrid.reset();
- },
-
- // Protected
-
- treeElementPathComponentSelected: function(event)
- {
- var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
- if (!dataGridNode)
- return;
- dataGridNode.revealAndSelect();
- },
-
- // Private
-
- _processPendingRecords: function()
- {
- if (!this._pendingRecords.length)
- return;
-
- for (var layoutTimelineRecord of this._pendingRecords) {
- var treeElement = new WebInspector.TimelineRecordTreeElement(layoutTimelineRecord, WebInspector.SourceCodeLocation.NameStyle.Short);
- var dataGridNode = new WebInspector.LayoutTimelineDataGridNode(layoutTimelineRecord, this.zeroTime);
-
- this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
- }
-
- this._pendingRecords = [];
- },
-
- _layoutTimelineRecordAdded: function(event)
- {
- var layoutTimelineRecord = event.data.record;
- console.assert(layoutTimelineRecord instanceof WebInspector.LayoutTimelineRecord);
-
- this._pendingRecords.push(layoutTimelineRecord);
-
- this.needsLayout();
- },
-
- _dataGridFiltersDidChange: function(event)
- {
- WebInspector.timelineSidebarPanel.updateFilter();
- },
-
- _dataGridNodeSelected: function(event)
- {
- this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (this._dataGrid.shouldIgnoreSelectionEvent())
- return;
-
- if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
- return;
-
- if (treeElement instanceof WebInspector.FolderTreeElement)
- return;
-
- if (!(treeElement instanceof WebInspector.TimelineRecordTreeElement)) {
- console.error("Unknown tree element selected.");
- return;
- }
-
- if (!treeElement.record.sourceCodeLocation) {
- WebInspector.timelineSidebarPanel.showTimelineView(WebInspector.TimelineRecord.Type.Layout);
- return;
- }
-
- WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.record.sourceCodeLocation);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyBottomUpProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,265 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North Inc. All Rights Reserved.
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.
- */
-
-// Bottom Up Profiling shows the entire callstack backwards:
-// The root node is a representation of each individual function called, and each child of that node represents
-// a reverse-callstack showing how many of those calls came from it. So, unlike top-down, the statistics in
-// each child still represent the root node. We have to be particularly careful of recursion with this mode
-// because a root node can represent itself AND an ancestor.
-
-WebInspector.LegacyBottomUpProfileDataGridNode = function(profileNode, owningTree)
-{
- WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, this._willHaveChildren(profileNode));
-
- this._remainingNodeInfos = [];
-}
-
-WebInspector.LegacyBottomUpProfileDataGridNode.prototype = {
- _takePropertiesFromProfileDataGridNode: function(profileDataGridNode)
- {
- this._save();
-
- this.selfTime = profileDataGridNode.selfTime;
- this.totalTime = profileDataGridNode.totalTime;
- this.numberOfCalls = profileDataGridNode.numberOfCalls;
- },
-
- // When focusing, we keep just the members of the callstack.
- _keepOnlyChild: function(child)
- {
- this._save();
-
- this.removeChildren();
- this.appendChild(child);
- },
-
- _exclude: function(aCallUID)
- {
- if (this._remainingNodeInfos)
- this._populate();
-
- this._save();
-
- var children = this.children;
- var index = this.children.length;
-
- while (index--)
- children[index]._exclude(aCallUID);
-
- var child = this.childrenByCallUID[aCallUID];
-
- if (child)
- this._merge(child, true);
- },
-
- _restore: function()
- {
- WebInspector.LegacyProfileDataGridNode.prototype._restore();
-
- if (!this.children.length)
- this.hasChildren = this._willHaveChildren();
- },
-
- _merge: function(child, shouldAbsorb)
- {
- this.selfTime -= child.selfTime;
-
- WebInspector.LegacyProfileDataGridNode.prototype._merge.call(this, child, shouldAbsorb);
- },
-
- _sharedPopulate: function()
- {
- var remainingNodeInfos = this._remainingNodeInfos;
- var count = remainingNodeInfos.length;
-
- for (var index = 0; index < count; ++index) {
- var nodeInfo = remainingNodeInfos[index];
- var ancestor = nodeInfo.ancestor;
- var focusNode = nodeInfo.focusNode;
- var child = this.findChild(ancestor);
-
- // If we already have this child, then merge the data together.
- if (child) {
- var totalTimeAccountedFor = nodeInfo.totalTimeAccountedFor;
-
- child.selfTime += focusNode.selfTime;
- child.numberOfCalls += focusNode.numberOfCalls;
-
- if (!totalTimeAccountedFor)
- child.totalTime += focusNode.totalTime;
- } else {
- // If not, add it as a true ancestor.
- // In heavy mode, we take our visual identity from ancestor node...
- child = new WebInspector.LegacyBottomUpProfileDataGridNode(ancestor, this.tree, false, this.showTimeAsPercent);
-
- if (ancestor !== focusNode) {
- // but the actual statistics from the "root" node (bottom of the callstack).
- child.selfTime = focusNode.selfTime;
- child.totalTime = focusNode.totalTime;
- child.numberOfCalls = focusNode.numberOfCalls;
- }
-
- this.appendChild(child);
- }
-
- var parent = ancestor.parent;
- if (parent && parent.parent) {
- nodeInfo.ancestor = parent;
- child._remainingNodeInfos.push(nodeInfo);
- }
- }
-
- delete this._remainingNodeInfos;
- },
-
- _willHaveChildren: function(profileNode)
- {
- profileNode = profileNode || this.profileNode;
- // In bottom up mode, our parents are our children since we display an inverted tree.
- // However, we don't want to show the very top parent since it is redundant.
- return !!(profileNode.parent && profileNode.parent.parent);
- }
-}
-
-WebInspector.LegacyBottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
-
-WebInspector.LegacyBottomUpProfileDataGridTree = function(profileNode)
-{
- WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
-
- // Iterate each node in pre-order.
- var profileNodeUIDs = 0;
- var profileNodeGroups = [[], [profileNode]];
- var visitedProfileNodesForCallUID = {};
-
- this._remainingNodeInfos = [];
-
- for (var profileNodeGroupIndex = 0; profileNodeGroupIndex < profileNodeGroups.length; ++profileNodeGroupIndex) {
- var parentProfileNodes = profileNodeGroups[profileNodeGroupIndex];
- var profileNodes = profileNodeGroups[++profileNodeGroupIndex];
- var count = profileNodes.length;
-
- for (var index = 0; index < count; ++index) {
- var profileNode = profileNodes[index];
-
- if (!profileNode.UID)
- profileNode.UID = ++profileNodeUIDs;
-
- if (profileNode.head && profileNode !== profileNode.head) {
- // The total time of this ancestor is accounted for if we're in any form of recursive cycle.
- var visitedNodes = visitedProfileNodesForCallUID[profileNode.callUID];
- var totalTimeAccountedFor = false;
-
- if (!visitedNodes) {
- visitedNodes = {};
- visitedProfileNodesForCallUID[profileNode.callUID] = visitedNodes;
- } else {
- // The total time for this node has already been accounted for iff one of it's parents has already been visited.
- // We can do this check in this style because we are traversing the tree in pre-order.
- var parentCount = parentProfileNodes.length;
- for (var parentIndex = 0; parentIndex < parentCount; ++parentIndex) {
- if (visitedNodes[parentProfileNodes[parentIndex].UID]) {
- totalTimeAccountedFor = true;
- break;
- }
- }
- }
-
- visitedNodes[profileNode.UID] = true;
-
- this._remainingNodeInfos.push({ ancestor:profileNode, focusNode:profileNode, totalTimeAccountedFor:totalTimeAccountedFor });
- }
-
- var children = profileNode.children;
- if (children.length) {
- profileNodeGroups.push(parentProfileNodes.concat([profileNode]));
- profileNodeGroups.push(children);
- }
- }
- }
-
- // Populate the top level nodes.
- WebInspector.LegacyBottomUpProfileDataGridNode.prototype._populate.call(this);
-
- return this;
-}
-
-WebInspector.LegacyBottomUpProfileDataGridTree.prototype = {
- // When focusing, we keep the entire callstack up to this ancestor.
- focus: function(profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this._save();
-
- var currentNode = profileDataGridNode;
- var focusNode = profileDataGridNode;
-
- while (currentNode.parent && (currentNode instanceof WebInspector.LegacyProfileDataGridNode)) {
- currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode);
-
- focusNode = currentNode;
- currentNode = currentNode.parent;
-
- if (currentNode instanceof WebInspector.LegacyProfileDataGridNode)
- currentNode._keepOnlyChild(focusNode);
- }
-
- this.children = [focusNode];
- this.totalTime = profileDataGridNode.totalTime;
- },
-
- exclude: function(profileDataGridNode)
- {
- if (!profileDataGridNode)
- return;
-
- this._save();
-
- var excludedCallUID = profileDataGridNode.callUID;
- var excludedTopLevelChild = this.childrenByCallUID[excludedCallUID];
-
- // If we have a top level node that is excluded, get rid of it completely (not keeping children),
- // since bottom up data relies entirely on the root node.
- if (excludedTopLevelChild)
- this.children.remove(excludedTopLevelChild);
-
- var children = this.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- children[index]._exclude(excludedCallUID);
-
- if (this.lastComparator)
- this.sort(this.lastComparator, true);
- },
-
- _sharedPopulate: WebInspector.LegacyBottomUpProfileDataGridNode.prototype._sharedPopulate
-}
-
-WebInspector.LegacyBottomUpProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
-
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyJavaScriptProfileObject = function(title, id, recording)
-{
- WebInspector.LegacyProfileObject.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, title, id, recording);
-};
-
-WebInspector.LegacyJavaScriptProfileObject.prototype = {
- constructor: WebInspector.LegacyJavaScriptProfileObject
-};
-
-WebInspector.LegacyJavaScriptProfileObject.prototype.__proto__ = WebInspector.LegacyProfileObject.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileTypejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyJavaScriptProfileType = function()
-{
- WebInspector.LegacyProfileType.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, WebInspector.UIString("Collect JavaScript Profile"));
- this._recording = false;
- WebInspector.LegacyJavaScriptProfileType.instance = this;
-}
-
-WebInspector.LegacyJavaScriptProfileType.TypeId = "CPU";
-
-WebInspector.LegacyJavaScriptProfileType.prototype = {
- get buttonTooltip()
- {
- return this._recording ? WebInspector.UIString("Stop JavaScript profiling.") : WebInspector.UIString("Start JavaScript profiling.");
- },
-
- buttonClicked: function()
- {
- if (this._recording) {
- this.stopRecordingProfile();
- WebInspector.networkManager.enableResourceTracking();
- } else {
- WebInspector.networkManager.disableResourceTracking();
- this.startRecordingProfile();
- }
- },
-
- get treeItemTitle()
- {
- return WebInspector.UIString("JAVASCRIPT PROFILES");
- },
-
- get description()
- {
- return WebInspector.UIString("JavaScript profiles show where the execution time is spent in your page's JavaScript functions.");
- },
-
- isRecordingProfile: function()
- {
- return this._recording;
- },
-
- startRecordingProfile: function()
- {
- this._recording = true;
- ProfilerAgent.start();
- },
-
- stopRecordingProfile: function()
- {
- this._recording = false;
- ProfilerAgent.stop();
- },
-
- setRecordingProfile: function(isProfiling)
- {
- this._recording = isProfiling;
- },
-
- createSidebarTreeElementForProfile: function(profile)
- {
- return new WebInspector.LegacyProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
- },
-
- createView: function(profile)
- {
- return new WebInspector.LegacyJavaScriptProfileView(profile);
- }
-}
-
-WebInspector.LegacyJavaScriptProfileType.prototype.__proto__ = WebInspector.LegacyProfileType.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.profile-view > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- outline: none;
- border: none;
-}
-
-.profile-view .data-grid th.average-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.average-column {
- text-align: right;
-}
-
-.profile-view .data-grid th.self-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.self-column {
- text-align: right;
-}
-
-.profile-view .data-grid th.total-column {
- text-align: center;
-}
-
-.profile-view .data-grid td.total-column {
- text-align: right;
-}
-
-.profile-view .data-grid .calls-column {
- text-align: center;
-}
-
-.profile-node-file {
- float: right;
- color: gray;
- margin-top: -1px;
-}
-
-.data-grid tr.selected .profile-node-file {
- color: rgb(33%, 33%, 33%);
-}
-
-.data-grid:focus tr.selected .profile-node-file {
- color: white;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,458 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyJavaScriptProfileView = function(profile)
-{
- console.assert(profile instanceof WebInspector.LegacyJavaScriptProfileObject);
-
- WebInspector.LegacyProfileView.call(this, profile, "javascript-profiler-show-time-as-percent");
-
- this._showTreeBottomUpSetting = new WebInspector.Setting("javascript-profiler-show-tree-bottom-up", true);
-
- this._showTreeBottomUpNavigationItem = new WebInspector.ActivateButtonNavigationItem("show-tree-bottom-up-navigation-item", WebInspector.UIString("Invert call tree"), WebInspector.UIString("Normal call tree"), "Images/BottomUpTree.svg", 16, 16);
- this._showTreeBottomUpNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleBottomUpView, this);
- this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
-
- this._viewType = new WebInspector.Setting("javascript-profiler-view", WebInspector.LegacyJavaScriptProfileView._TypeHeavy);
-}
-
-WebInspector.LegacyJavaScriptProfileView._TypeTree = "Tree";
-WebInspector.LegacyJavaScriptProfileView._TypeHeavy = "Heavy";
-
-WebInspector.LegacyJavaScriptProfileView.prototype = {
- constructor: WebInspector.LegacyJavaScriptProfileView,
-
- updateLayout: function()
- {
- if (this.dataGrid)
- this.dataGrid.updateLayout();
- },
-
- get recordingTitle()
- {
- return WebInspector.UIString("Recording JavaScript Profile\u2026");
- },
-
- displayProfile: function()
- {
- var columns = { "self": { title: WebInspector.UIString("Self"), width: "72px", sort: "descending", sortable: true },
- "total": { title: WebInspector.UIString("Total"), width: "72px", sortable: true },
- "average": { title: WebInspector.UIString("Average"), width: "72px", sortable: true },
- "calls": { title: WebInspector.UIString("Calls"), width: "54px", sortable: true },
- "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } };
-
- this.dataGrid = new WebInspector.DataGrid(columns);
- this.dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortData, this);
-
- this.element.appendChild(this.dataGrid.element);
- this.dataGrid.updateLayout();
-
- function profileCallback(error, profile)
- {
- if (error)
- return;
-
- if (!profile.head) {
- // Profiling was tentatively terminated with the "Clear all profiles." button.
- return;
- }
- this.profile.head = profile.head;
- this._assignParentsInProfile();
- this._changeView();
- }
-
- // COMPATIBILITY (iOS 6): getCPUProfile use to be called getProfile.
- if (ProfilerAgent.getProfile)
- ProfilerAgent.getProfile(this.profile.type, this.profile.id, profileCallback.bind(this));
- else
- ProfilerAgent.getCPUProfile(this.profile.id, profileCallback.bind(this));
- },
-
- get navigationItems()
- {
- return [this._showTreeBottomUpNavigationItem, this.showTimeAsPercentNavigationItem];
- },
-
- get bottomUpProfileDataGridTree()
- {
- if (!this._bottomUpProfileDataGridTree)
- this._bottomUpProfileDataGridTree = new WebInspector.LegacyBottomUpProfileDataGridTree(this.profile.head);
- return this._bottomUpProfileDataGridTree;
- },
-
- get topDownProfileDataGridTree()
- {
- if (!this._topDownProfileDataGridTree)
- this._topDownProfileDataGridTree = new WebInspector.LegacyTopDownProfileDataGridTree(this.profile.head);
- return this._topDownProfileDataGridTree;
- },
-
- willHide: function()
- {
- this._currentSearchResultIndex = -1;
- },
-
- refresh: function()
- {
- var selectedProfileNode = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.profileNode : null;
-
- this.dataGrid.removeChildren();
-
- var children = this.profileDataGridTree.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- this.dataGrid.appendChild(children[index]);
-
- if (selectedProfileNode)
- selectedProfileNode.selected = true;
- },
-
- refreshVisibleData: function()
- {
- var child = this.dataGrid.children[0];
- while (child) {
- child.refresh(this.showTimeAsPercent.value);
- child = child.traverseNextNode(false, null, true);
- }
- },
-
- searchCanceled: function()
- {
- if (this._searchResults) {
- for (var i = 0; i < this._searchResults.length; ++i) {
- var profileNode = this._searchResults[i].profileNode;
-
- delete profileNode._searchMatchedSelfColumn;
- delete profileNode._searchMatchedTotalColumn;
- delete profileNode._searchMatchedCallsColumn;
- delete profileNode._searchMatchedFunctionColumn;
-
- profileNode.refresh();
- }
- }
-
- delete this._searchFinishedCallback;
- this._currentSearchResultIndex = -1;
- this._searchResults = [];
- },
-
- performSearch: function(query, finishedCallback)
- {
- // Call searchCanceled since it will reset everything we need before doing a new search.
- this.searchCanceled();
-
- query = query.trim();
-
- if (!query.length)
- return;
-
- this._searchFinishedCallback = finishedCallback;
-
- var greaterThan = query.charAt(0) === ">";
- var lessThan = query.charAt(0) === "<";
- var equalTo = (query.charAt(0) === "=" || ((greaterThan || lessThan) && query.charAt(1) === "="));
- var percentUnits = (query.lastIndexOf("%") === (query.length - 1));
- var millisecondsUnits = (query.length > 2 && query.lastIndexOf("ms") === (query.length - 2));
- var secondsUnits = (!millisecondsUnits && query.lastIndexOf("s") === (query.length - 1));
-
- var queryNumber = parseFloat(query);
- if (greaterThan || lessThan || equalTo) {
- if (equalTo && (greaterThan || lessThan))
- queryNumber = parseFloat(query.substring(2));
- else
- queryNumber = parseFloat(query.substring(1));
- }
-
- var queryNumberMilliseconds = (secondsUnits ? (queryNumber * 1000) : queryNumber);
-
- // Make equalTo implicitly true if it wasn't specified there is no other operator.
- if (!isNaN(queryNumber) && !(greaterThan || lessThan))
- equalTo = true;
-
- function matchesQuery(/*ProfileDataGridNode*/ profileDataGridNode)
- {
- delete profileDataGridNode._searchMatchedSelfColumn;
- delete profileDataGridNode._searchMatchedTotalColumn;
- delete profileDataGridNode._searchMatchedAverageColumn;
- delete profileDataGridNode._searchMatchedCallsColumn;
- delete profileDataGridNode._searchMatchedFunctionColumn;
-
- if (percentUnits) {
- if (lessThan) {
- if (profileDataGridNode.selfPercent < queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent < queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- } else if (greaterThan) {
- if (profileDataGridNode.selfPercent > queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent > queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
-
- if (equalTo) {
- if (profileDataGridNode.selfPercent == queryNumber)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalPercent == queryNumber)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
- } else if (millisecondsUnits || secondsUnits) {
- if (lessThan) {
- if (profileDataGridNode.selfTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime < queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- } else if (greaterThan) {
- if (profileDataGridNode.selfTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime > queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
-
- if (equalTo) {
- if (profileDataGridNode.selfTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedSelfColumn = true;
- if (profileDataGridNode.totalTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedTotalColumn = true;
- if (profileDataGridNode.averageTime == queryNumberMilliseconds)
- profileDataGridNode._searchMatchedAverageColumn = true;
- }
- } else {
- if (equalTo && profileDataGridNode.numberOfCalls == queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- if (greaterThan && profileDataGridNode.numberOfCalls > queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- if (lessThan && profileDataGridNode.numberOfCalls < queryNumber)
- profileDataGridNode._searchMatchedCallsColumn = true;
- }
-
- if (profileDataGridNode.functionName.hasSubstring(query, true) || profileDataGridNode.url.hasSubstring(query, true))
- profileDataGridNode._searchMatchedFunctionColumn = true;
-
- if (profileDataGridNode._searchMatchedSelfColumn ||
- profileDataGridNode._searchMatchedTotalColumn ||
- profileDataGridNode._searchMatchedAverageColumn ||
- profileDataGridNode._searchMatchedCallsColumn ||
- profileDataGridNode._searchMatchedFunctionColumn)
- {
- profileDataGridNode.refresh();
- return true;
- }
-
- return false;
- }
-
- var current = this.profileDataGridTree.children[0];
-
- while (current) {
- if (matchesQuery(current)) {
- this._searchResults.push({ profileNode: current });
- }
-
- current = current.traverseNextNode(false, null, false);
- }
-
- finishedCallback(this, this._searchResults.length);
- },
-
- jumpToFirstSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- this._currentSearchResultIndex = 0;
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToLastSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- this._currentSearchResultIndex = (this._searchResults.length - 1);
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToNextSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- if (++this._currentSearchResultIndex >= this._searchResults.length)
- this._currentSearchResultIndex = 0;
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- jumpToPreviousSearchResult: function()
- {
- if (!this._searchResults || !this._searchResults.length)
- return;
- if (--this._currentSearchResultIndex < 0)
- this._currentSearchResultIndex = (this._searchResults.length - 1);
- this._jumpToSearchResult(this._currentSearchResultIndex);
- },
-
- showingFirstSearchResult: function()
- {
- return (this._currentSearchResultIndex === 0);
- },
-
- showingLastSearchResult: function()
- {
- return (this._searchResults && this._currentSearchResultIndex === (this._searchResults.length - 1));
- },
-
- _jumpToSearchResult: function(index)
- {
- var searchResult = this._searchResults[index];
- if (!searchResult)
- return;
-
- var profileNode = searchResult.profileNode;
- profileNode.revealAndSelect();
- },
-
- _toggleBottomUpView: function(event)
- {
- this._showTreeBottomUpSetting.value = !this._showTreeBottomUpSetting.value;
- this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
- this._changeView();
- },
-
- _changeView: function()
- {
- if (!this.profile)
- return;
-
- if (!this._showTreeBottomUpSetting.value) {
- this.profileDataGridTree = this.topDownProfileDataGridTree;
- this._sortProfile();
- this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeTree;
- } else {
- this.profileDataGridTree = this.bottomUpProfileDataGridTree;
- this._sortProfile();
- this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeHeavy;
- }
-
- if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
- return;
-
- // The current search needs to be performed again. First negate out previous match
- // count by calling the search finished callback with a negative number of matches.
- // Then perform the search again the with same query and callback.
- this._searchFinishedCallback(this, -this._searchResults.length);
- this.performSearch(this.currentQuery, this._searchFinishedCallback);
- },
-
- toggleTimeDisplay: function(event)
- {
- WebInspector.LegacyProfileView.prototype.toggleTimeDisplay.call(this, event);
- this.showTimeAsPercent.value = !this.showTimeAsPercent.value;
- this.refreshVisibleData();
- },
-
- _focusClicked: function(event)
- {
- if (!this.dataGrid.selectedNode)
- return;
-
- this.profileDataGridTree.focus(this.dataGrid.selectedNode);
- this.refresh();
- this.refreshVisibleData();
- },
-
- _excludeClicked: function(event)
- {
- var selectedNode = this.dataGrid.selectedNode;
-
- if (!selectedNode)
- return;
-
- selectedNode.deselect();
-
- this.profileDataGridTree.exclude(selectedNode);
- this.refresh();
- this.refreshVisibleData();
- },
-
- _resetClicked: function(event)
- {
- this.profileDataGridTree.restore();
- this.refresh();
- this.refreshVisibleData();
- },
-
- _sortData: function(event)
- {
- this._sortProfile(this.profile);
- },
-
- _sortProfile: function()
- {
- var sortAscending = this.dataGrid.sortOrder === "ascending";
- var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
- var sortProperty = {
- "average": "averageTime",
- "self": "selfTime",
- "total": "totalTime",
- "calls": "numberOfCalls",
- "function": "functionName"
- }[sortColumnIdentifier];
-
- this.profileDataGridTree.sort(WebInspector.LegacyProfileDataGridTree.propertyComparator(sortProperty, sortAscending));
-
- this.refresh();
- },
-
- _assignParentsInProfile: function()
- {
- var head = this.profile.head;
- head.parent = null;
- head.head = null;
- var nodesToTraverse = [ { parent: head, children: head.children } ];
- while (nodesToTraverse.length > 0) {
- var pair = nodesToTraverse.shift();
- var parent = pair.parent;
- var children = pair.children;
- var length = children.length;
- for (var i = 0; i < length; ++i) {
- children[i].head = head;
- children[i].parent = parent;
- if (children[i].children.length > 0)
- nodesToTraverse.push({ parent: children[i], children: children[i].children });
- }
- }
- }
-}
-
-WebInspector.LegacyJavaScriptProfileView.prototype.__proto__ = WebInspector.LegacyProfileView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,399 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyProfileDataGridNode = function(profileNode, owningTree, hasChildren, showTimeAsPercent)
-{
- this.profileNode = profileNode;
-
- WebInspector.DataGridNode.call(this, null, hasChildren);
-
- this.addEventListener("populate", this._populate, this);
-
- this.tree = owningTree;
-
- this.childrenByCallUID = {};
- this.lastComparator = null;
-
- this.callUID = profileNode.callUID;
- this.selfTime = profileNode.selfTime;
- this.totalTime = profileNode.totalTime;
- this.functionName = profileNode.functionName;
- this.numberOfCalls = profileNode.numberOfCalls;
- this.url = profileNode.url;
-
- this._showTimeAsPercent = showTimeAsPercent || false;
-}
-
-WebInspector.LegacyProfileDataGridNode.prototype = {
- get data()
- {
- function formatMilliseconds(time)
- {
- return Number.secondsToString(time / 1000, true);
- }
-
- var data = {};
-
- data["function"] = this.functionName;
- data["calls"] = this.numberOfCalls;
-
- if (this._showTimeAsPercent) {
- data["self"] = WebInspector.UIString("%.2f %%").format(this.selfPercent);
- data["total"] = WebInspector.UIString("%.2f %%").format(this.totalPercent);
- data["average"] = WebInspector.UIString("%.2f %%").format(this.averagePercent);
- } else {
- data["self"] = formatMilliseconds(this.selfTime);
- data["total"] = formatMilliseconds(this.totalTime);
- data["average"] = formatMilliseconds(this.averageTime);
- }
-
- return data;
- },
-
- get showTimeAsPercent()
- {
- return this._showTimeAsPercent;
- },
-
- refresh: function(showTimeAsPercent)
- {
- this._showTimeAsPercent = showTimeAsPercent;
-
- WebInspector.DataGridNode.prototype.refresh.call(this);
- },
-
- createCell: function(columnIdentifier)
- {
- var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
-
- if (columnIdentifier === "self" && this._searchMatchedSelfColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "total" && this._searchMatchedTotalColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "average" && this._searchMatchedAverageColumn)
- cell.classList.add("highlight");
- else if (columnIdentifier === "calls" && this._searchMatchedCallsColumn)
- cell.classList.add("highlight");
-
- if (columnIdentifier !== "function")
- return cell;
-
- if (this.profileNode._searchMatchedFunctionColumn)
- cell.classList.add("highlight");
-
- if (this.profileNode.url) {
- // FIXME(62725): profileNode should reference a debugger location.
- var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
- var urlElement = this._linkifyLocation(this.profileNode.url, lineNumber, "profile-node-file");
- urlElement.style.maxWidth = "75%";
- cell.insertBefore(urlElement, cell.firstChild);
- }
-
- return cell;
- },
-
- sort: function(comparator, force)
- {
- var gridNodeGroups = [[this]];
-
- for (var gridNodeGroupIndex = 0; gridNodeGroupIndex < gridNodeGroups.length; ++gridNodeGroupIndex) {
- var gridNodes = gridNodeGroups[gridNodeGroupIndex];
- var count = gridNodes.length;
-
- for (var index = 0; index < count; ++index) {
- var gridNode = gridNodes[index];
-
- // If the grid node is collapsed, then don't sort children (save operation for later).
- // If the grid node has the same sorting as previously, then there is no point in sorting it again.
- if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {
- if (gridNode.children.length)
- gridNode.shouldRefreshChildren = true;
- continue;
- }
-
- gridNode.lastComparator = comparator;
-
- var children = gridNode.children;
- var childCount = children.length;
-
- if (childCount) {
- children.sort(comparator);
-
- for (var childIndex = 0; childIndex < childCount; ++childIndex)
- children[childIndex]._recalculateSiblings(childIndex);
-
- gridNodeGroups.push(children);
- }
- }
- }
- },
-
- insertChild: function(profileDataGridNode, index)
- {
- WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
-
- this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;
- },
-
- removeChild: function(profileDataGridNode)
- {
- WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
-
- delete this.childrenByCallUID[profileDataGridNode.callUID];
- },
-
- removeChildren: function(profileDataGridNode)
- {
- WebInspector.DataGridNode.prototype.removeChildren.call(this);
-
- this.childrenByCallUID = {};
- },
-
- findChild: function(node)
- {
- if (!node)
- return null;
- return this.childrenByCallUID[node.callUID];
- },
-
- get averageTime()
- {
- return this.selfTime / Math.max(1, this.numberOfCalls);
- },
-
- get averagePercent()
- {
- return this.averageTime / this.tree.totalTime * 100.0;
- },
-
- get selfPercent()
- {
- return this.selfTime / this.tree.totalTime * 100.0;
- },
-
- get totalPercent()
- {
- return this.totalTime / this.tree.totalTime * 100.0;
- },
-
- get _parent()
- {
- return this.parent !== this.dataGrid ? this.parent : this.tree;
- },
-
- _populate: function(event)
- {
- this._sharedPopulate();
-
- if (this._parent) {
- var currentComparator = this._parent.lastComparator;
-
- if (currentComparator)
- this.sort(currentComparator, true);
- }
-
- if (this.removeEventListener)
- this.removeEventListener("populate", this._populate, this);
- },
-
- // When focusing and collapsing we modify lots of nodes in the tree.
- // This allows us to restore them all to their original state when we revert.
- _save: function()
- {
- if (this._savedChildren)
- return;
-
- this._savedSelfTime = this.selfTime;
- this._savedTotalTime = this.totalTime;
- this._savedNumberOfCalls = this.numberOfCalls;
-
- this._savedChildren = this.children.slice();
- },
-
- // When focusing and collapsing we modify lots of nodes in the tree.
- // This allows us to restore them all to their original state when we revert.
- _restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.selfTime = this._savedSelfTime;
- this.totalTime = this._savedTotalTime;
- this.numberOfCalls = this._savedNumberOfCalls;
-
- this.removeChildren();
-
- var children = this._savedChildren;
- var count = children.length;
-
- for (var index = 0; index < count; ++index) {
- children[index]._restore();
- this.appendChild(children[index]);
- }
- },
-
- _merge: function(child, shouldAbsorb)
- {
- this.selfTime += child.selfTime;
-
- if (!shouldAbsorb) {
- this.totalTime += child.totalTime;
- this.numberOfCalls += child.numberOfCalls;
- }
-
- var children = this.children.slice();
-
- this.removeChildren();
-
- var count = children.length;
-
- for (var index = 0; index < count; ++index) {
- if (!shouldAbsorb || children[index] !== child)
- this.appendChild(children[index]);
- }
-
- children = child.children.slice();
- count = children.length;
-
- for (var index = 0; index < count; ++index) {
- var orphanedChild = children[index],
- existingChild = this.childrenByCallUID[orphanedChild.callUID];
-
- if (existingChild)
- existingChild._merge(orphanedChild, false);
- else
- this.appendChild(orphanedChild);
- }
- },
-
- _linkifyLocation: function(url, lineNumber, className)
- {
- // FIXME: CPUProfileNode's need columnNumbers.
- return WebInspector.linkifyLocation(url, lineNumber, 0, className);
- }
-}
-
-WebInspector.LegacyProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
-
-WebInspector.LegacyProfileDataGridTree = function(profileNode)
-{
- this.tree = this;
- this.children = [];
-
- this.totalTime = profileNode.totalTime;
- this.lastComparator = null;
-
- this.childrenByCallUID = {};
-}
-
-WebInspector.LegacyProfileDataGridTree.prototype = {
- get expanded()
- {
- return true;
- },
-
- appendChild: function(child)
- {
- this.insertChild(child, this.children.length);
- },
-
- insertChild: function(child, index)
- {
- this.children.splice(index, 0, child);
- this.childrenByCallUID[child.callUID] = child;
- },
-
- removeChildren: function()
- {
- this.children = [];
- this.childrenByCallUID = {};
- },
-
- findChild: WebInspector.LegacyProfileDataGridNode.prototype.findChild,
- sort: WebInspector.LegacyProfileDataGridNode.prototype.sort,
-
- _save: function()
- {
- if (this._savedChildren)
- return;
-
- this._savedTotalTime = this.totalTime;
- this._savedChildren = this.children.slice();
- },
-
- restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.children = this._savedChildren;
- this.totalTime = this._savedTotalTime;
-
- var children = this.children;
- var count = children.length;
-
- for (var index = 0; index < count; ++index)
- children[index]._restore();
-
- this._savedChildren = null;
- }
-}
-
-WebInspector.LegacyProfileDataGridTree.propertyComparators = [{}, {}];
-
-WebInspector.LegacyProfileDataGridTree.propertyComparator = function(property, isAscending)
-{
- var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
-
- if (!comparator) {
- if (isAscending) {
- comparator = function(lhs, rhs)
- {
- if (lhs[property] < rhs[property])
- return -1;
-
- if (lhs[property] > rhs[property])
- return 1;
-
- return 0;
- };
- } else {
- comparator = function(lhs, rhs)
- {
- if (lhs[property] > rhs[property])
- return -1;
-
- if (lhs[property] < rhs[property])
- return 1;
-
- return 0;
- };
- }
-
- this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
- }
-
- return comparator;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,182 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileManager = function()
-{
- WebInspector.Object.call(this);
-
- this._javaScriptProfileType = new WebInspector.LegacyJavaScriptProfileType;
-
- if (window.ProfilerAgent) {
- ProfilerAgent.enable();
- ProfilerAgent.getProfileHeaders();
- }
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
- this.initialize();
-};
-
-WebInspector.LegacyProfileManager.Event = {
- ProfileWasAdded: "profile-manager-profile-was-added",
- ProfileWasUpdated: "profile-manager-profile-was-updated",
- ProfilingStarted: "profile-manager-profiling-started",
- ProfilingEnded: "profile-manager-profiling-ended",
- ProfilingInterrupted: "profile-manager-profiling-interrupted",
- Cleared: "profile-manager-cleared"
-};
-
-WebInspector.LegacyProfileManager.UserInitiatedProfileName = "org.webkit.profiles.user-initiated";
-
-WebInspector.LegacyProfileManager.prototype = {
- constructor: WebInspector.LegacyProfileManager,
-
- // Public
-
- initialize: function()
- {
- this._checkForInterruptions();
-
- this._recordingJavaScriptProfile = null;
-
- this._isProfiling = false;
-
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.Cleared);
- },
-
- isProfilingJavaScript: function()
- {
- return this._javaScriptProfileType.isRecordingProfile();
- },
-
- startProfilingJavaScript: function()
- {
- this._javaScriptProfileType.startRecordingProfile();
- },
-
- stopProfilingJavaScript: function()
- {
- this._javaScriptProfileType.stopRecordingProfile();
- },
-
- profileWasStartedFromConsole: function(title)
- {
- this.setRecordingJavaScriptProfile(true, true);
-
- if (title.indexOf(WebInspector.LegacyProfileManager.UserInitiatedProfileName) === -1) {
- this._recordingJavaScriptProfile.title = title;
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
- }
- },
-
- profileWasEndedFromConsole: function()
- {
- this.setRecordingJavaScriptProfile(false, true);
- },
-
- addJavaScriptProfile: function(profile)
- {
- console.assert(this._recordingJavaScriptProfile);
- if (!this._recordingJavaScriptProfile)
- return;
-
- this._recordingJavaScriptProfile.type = profile.typeId;
- this._recordingJavaScriptProfile.title = profile.title;
- this._recordingJavaScriptProfile.id = profile.uid;
- this._recordingJavaScriptProfile.recording = false;
-
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasUpdated, {profile: this._recordingJavaScriptProfile});
-
- // We want to reset _recordingJavaScriptProfile so that we can identify
- // interruptions, but we also want to keep track of the last profile
- // we've recorded so that we can provide it as data to the ProfilingEnded event
- // we'll dispatch in setRecordingJavaScriptProfile().
- this._lastJavaScriptProfileAdded = this._recordingJavaScriptProfile;
- this._recordingJavaScriptProfile = null;
- },
-
- setRecordingJavaScriptProfile: function(isProfiling, fromConsole)
- {
- if (this._isProfiling === isProfiling)
- return;
-
- this._isProfiling = isProfiling;
-
- // We've interrupted the current JS profile due to a page reload. Return
- // now and _attemptToResumeProfiling will pick things up after the reload.
- if (!isProfiling && !!this._recordingJavaScriptProfile)
- return;
-
- if (isProfiling && !this._recordingJavaScriptProfile)
- this._recordingJavaScriptProfile = new WebInspector.LegacyJavaScriptProfileObject(WebInspector.LegacyProfileManager.UserInitiatedProfileName, -1, true);
-
- if (isProfiling) {
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfileWasAdded, {profile: this._recordingJavaScriptProfile});
- if (!fromConsole)
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingStarted);
- } else {
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingEnded, {
- profile: this._lastJavaScriptProfileAdded,
- fromConsole: fromConsole
- });
- this._lastJavaScriptProfileAdded = null;
- }
- },
-
- // Private
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- var oldMainResource = event.data.oldMainResource;
- var newMainResource = event.target.mainResource;
- if (oldMainResource.url !== newMainResource.url)
- this.initialize();
- else
- this._attemptToResumeProfiling();
- },
-
- _checkForInterruptions: function()
- {
- if (this._recordingJavaScriptProfile) {
- this.dispatchEventToListeners(WebInspector.LegacyProfileManager.Event.ProfilingInterrupted, {profile: this._recordingJavaScriptProfile});
- this._javaScriptProfileType.setRecordingProfile(false);
- }
- },
-
- _attemptToResumeProfiling: function()
- {
- this._checkForInterruptions();
-
- if (this._recordingJavaScriptProfile)
- this.startProfilingJavaScript();
- }
-};
-
-WebInspector.LegacyProfileManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,93 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileObject = function(type, title, id, isRecording)
-{
- WebInspector.Object.call(this);
-
- console.assert(type);
- console.assert(title);
- console.assert(id);
-
- this._type = type;
- this._title = title;
- this._id = id;
- this._isRecording = isRecording || false;
-};
-
-WebInspector.LegacyProfileObject.Event = {
- FinshedRecording: "profile-object-finished-recording"
-};
-
-WebInspector.LegacyProfileObject.prototype = {
- constructor: WebInspector.LegacyProfileObject,
-
- get type()
- {
- return this._type;
- },
-
- set type(type)
- {
- this._type = type;
- },
-
- get title()
- {
- return this._title;
- },
-
- set title(title)
- {
- this._title = title;
- },
-
- get id()
- {
- return this._id;
- },
-
- set id(id)
- {
- this._id = id;
- },
-
- get recording()
- {
- return this._isRecording;
- },
-
- set recording(flag)
- {
- if (this._isRecording === flag)
- return;
-
- this._isRecording = flag;
- if (!flag)
- this.dispatchEventToListeners(WebInspector.LegacyProfileObject.Event.FinshedRecording);
- }
-};
-
-WebInspector.LegacyProfileObject.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileTypejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyProfileType = function(id, name)
-{
- this._id = id;
- this._name = name;
-}
-
-WebInspector.LegacyProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
-WebInspector.LegacyProfileType.ProfileScheme = "webkit-profile";
-
-WebInspector.LegacyProfileType.prototype = {
- get buttonTooltip()
- {
- return "";
- },
-
- get id()
- {
- return this._id;
- },
-
- get treeItemTitle()
- {
- return this._name;
- },
-
- get name()
- {
- return this._name;
- },
-
- buttonClicked: function()
- {
- },
-
- viewForProfile: function(profile)
- {
- if (!profile._profileView)
- profile._profileView = this.createView(profile);
- return profile._profileView;
- },
-
- reset: function()
- {
- },
-
- get description()
- {
- return "";
- },
-
- // Must be implemented by subclasses.
- createView: function(profile)
- {
- throw new Error("Needs implemented.");
- },
-
- // Must be implemented by subclasses.
- createSidebarTreeElementForProfile: function(profile)
- {
- throw new Error("Needs implemented.");
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.recording-profile-view {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-
- display: -webkit-flex;
- -webkit-flex-flow: row nowrap;
- -webkit-justify-content: center;
- -webkit-align-content: center;
- -webkit-align-items: center;
-
- background-color: rgb(232, 232, 232);
-}
-
-.recording-profile-view > .indeterminate-progress-spinner {
- position: static;
- margin: 0;
-}
-
-.recording-profile-view > span {
- font-family: 'Lucida Grande', Helvetica, sans-serif;
- font-size: 14px;
-
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
- color: rgb(60, 60, 60);
-
- padding-left: 10px;
-
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,109 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileView = function(profile, settingId)
-{
- WebInspector.ContentView.call(this, profile);
-
- this._profile = profile;
-
- this.element.classList.add("profile-view");
-
- this.showTimeAsPercent = new WebInspector.Setting(settingId, true);
- this.showTimeAsPercentNavigationItem = new WebInspector.ActivateButtonNavigationItem("selector-profiler-show-time-as-percent-navigation-item", WebInspector.UIString("Show times as percentages"), WebInspector.UIString("Show times as absolute times"), "Images/Percent.svg", 16, 16);
- this.showTimeAsPercentNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleTimeDisplay, this);
- this.showTimeAsPercentNavigationItem.activated = this.showTimeAsPercent.value;
-
- if (profile.recording) {
- this._showRecordingMessage();
- profile.addEventListener(WebInspector.LegacyProfileObject.Event.FinshedRecording, this._profileFinishedRecording, this);
- } else
- this.displayProfile();
-};
-
-WebInspector.LegacyProfileView.prototype = {
- constructor: WebInspector.LegacyProfileView,
-
- // Public
-
- get navigationItems()
- {
- return [this.showTimeAsPercentNavigationItem];
- },
-
- get allowedNavigationSidebarPanels()
- {
- return ["instrument"];
- },
-
- get profile()
- {
- return this._profile;
- },
-
- set profile(profile)
- {
- this._profile = profile;
- },
-
- toggleTimeDisplay: function(event)
- {
- this.showTimeAsPercentNavigationItem.activated = !this.showTimeAsPercentNavigationItem.activated;
- },
-
- displayProfile: function()
- {
- // Implemented by subclasses.
- },
-
- get recordingTitle()
- {
- return WebInspector.UIString("Recording\u2026");
- },
-
- // Private
-
- _profileFinishedRecording: function()
- {
- this._hideRecordingMessage();
- this.displayProfile();
- },
-
- _showRecordingMessage: function()
- {
- this._recordingMessageContainer = this.element.appendChild(document.createElement("div"));
- this._recordingMessageContainer.className = "recording-profile-view";
- this._recordingMessageContainer.appendChild(new WebInspector.IndeterminateProgressSpinner().element);
- this._recordingMessageContainer.appendChild(document.createElement("span")).textContent = this.recordingTitle;
- },
-
- _hideRecordingMessage: function()
- {
- if (this._recordingMessageContainer)
- this._recordingMessageContainer.remove();
- }
-};
-
-WebInspector.LegacyProfileView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyProfilerObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfilerObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.LegacyProfilerObserver.prototype = {
- constructor: WebInspector.LegacyProfilerObserver,
-
- // Events defined by the "Profiler" domain.
-
- resetProfiles: function()
- {
- // FIXME: Implement this.
- },
-
- addProfileHeader: function(profile)
- {
- WebInspector.legacyProfileManager.addJavaScriptProfile(profile);
- },
-
- addHeapSnapshotChunk: function(uid, chunk)
- {
- // FIXME: Implement this (we need heap snapshots).
- },
-
- finishHeapSnapshot: function(uid)
- {
- // FIXME: Implement this (we need heap snapshots).
- },
-
- setRecordingProfile: function(isProfiling)
- {
- WebInspector.legacyProfileManager.setRecordingJavaScriptProfile(isProfiling);
- },
-
- reportHeapSnapshotProgress: function(done, total)
- {
- // FIXME: Implement this (we need heap snapshots).
- }
-
-};
-
-WebInspector.LegacyProfilerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLegacyTopDownProfileDataGridTreejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,121 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 280 North Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyTopDownProfileDataGridNode = function(profileNode, owningTree)
-{
- var hasChildren = (profileNode.children && profileNode.children.length);
-
- WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, hasChildren);
-
- this._remainingChildren = profileNode.children;
-}
-
-WebInspector.LegacyTopDownProfileDataGridNode.prototype = {
- _sharedPopulate: function()
- {
- var children = this._remainingChildren;
- var childrenLength = children.length;
-
- for (var i = 0; i < childrenLength; ++i)
- this.appendChild(new WebInspector.LegacyTopDownProfileDataGridNode(children[i], this.tree, false, this.showTimeAsPercent));
-
- this._remainingChildren = null;
- },
-
- _exclude: function(aCallUID)
- {
- if (this._remainingChildren)
- this._populate();
-
- this._save();
-
- var children = this.children;
- var index = this.children.length;
-
- while (index--)
- children[index]._exclude(aCallUID);
-
- var child = this.childrenByCallUID[aCallUID];
-
- if (child)
- this._merge(child, true);
- }
-}
-
-WebInspector.LegacyTopDownProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
-
-WebInspector.LegacyTopDownProfileDataGridTree = function(profileNode)
-{
- WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
-
- this._remainingChildren = profileNode.children;
-
- WebInspector.LegacyTopDownProfileDataGridNode.prototype._populate.call(this);
-}
-
-WebInspector.LegacyTopDownProfileDataGridTree.prototype = {
- focus: function(profileDataGrideNode)
- {
- if (!profileDataGrideNode)
- return;
-
- this._save();
- profileDataGrideNode.savePosition();
-
- this.children = [profileDataGrideNode];
- this.totalTime = profileDataGrideNode.totalTime;
- },
-
- exclude: function(profileDataGrideNode)
- {
- if (!profileDataGrideNode)
- return;
-
- this._save();
-
- var excludedCallUID = profileDataGrideNode.callUID;
-
- WebInspector.LegacyTopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);
-
- if (this.lastComparator)
- this.sort(this.lastComparator, true);
- },
-
- restore: function()
- {
- if (!this._savedChildren)
- return;
-
- this.children[0].restorePosition();
-
- WebInspector.LegacyProfileDataGridTree.prototype.restore.call(this);
- },
-
- _merge: WebInspector.LegacyTopDownProfileDataGridNode.prototype._merge,
-
- _sharedPopulate: WebInspector.LegacyTopDownProfileDataGridNode.prototype._sharedPopulate
-}
-
-WebInspector.LegacyTopDownProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLoadInspectorBackendCommandsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LoadInspectorBackendCommands.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LoadInspectorBackendCommands.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LoadInspectorBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-(function() {
- var backendURLs;
- if (InspectorFrontendHost.inspectorBackendCommandsURLs) {
- var suggestedBackendCommandsURLs = InspectorFrontendHost.inspectorBackendCommandsURLs();
- if (suggestedBackendCommandsURLs)
- backendURLs = suggestedBackendCommandsURLs;
- }
-
- if (!backendURLs) {
- backendURLs = ["InspectorJSBackendCommands.js"];
- if (InspectorFrontendHost.debuggableType() === "web")
- backendURLs.push("InspectorWebBackendCommands.js");
- }
-
- console.assert(backendURLs.length);
- for (var backendCommandsURL of backendURLs)
- document.write("<script src=\"" + backendCommandsURL + "\"></script>");
-})();
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLoadLocalizedStringsjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LoadLocalizedStrings.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LoadLocalizedStrings.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LoadLocalizedStrings.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-(function() {
- if (WebInspector.dontLocalizeUserInterface)
- return;
-
- var localizedStringsURL = InspectorFrontendHost.localizedStringsURL();
- console.assert(localizedStringsURL);
- if (localizedStringsURL)
- document.write("<script src=\"" + localizedStringsURL + "\"></script>");
-})();
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,435 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.log {
- overflow-y: overlay;
- overflow-x: hidden;
-}
-
-.console-messages {
- display: -webkit-flex;
- -webkit-flex-direction: column;
-
- word-wrap: break-word;
-
- font-family: Menlo, monospace;
- font-size: 11px;
-
- min-height: 100%;
-}
-
-.console-messages > :first-child {
- margin-top: auto;
-}
-
-.console-item {
- border-top: 1px solid rgb(240, 240, 240);
-}
-
-.console-group.new-session .console-group-messages .console-item:first-child {
- border-top: none;
-}
-
-.console-item.selected {
- background-color: rgb(212, 212, 212);
-}
-
-.console-messages:focus .console-item.selected {
- background-color: highlight;
-}
-
-.console-user-command-result.console-log-level::before {
- background-image: url(Images/UserInputResult.svg);
-}
-
-.console-message, .console-user-command {
- position: relative;
- padding: 2px 12px 2px 18px;
- min-height: 16px;
-}
-
-.console-message::before, .console-user-command::before, .javascript-prompt::before, .console-group-title::before {
- position: absolute;
- display: block;
- content: "";
- left: 4px;
- top: 8px;
- width: 10px;
- height: 10px;
- margin-top: -5px;
-}
-
-.console-message .bubble {
- display: inline-block;
- height: 14px;
- background-color: rgb(128, 151, 189);
- vertical-align: middle;
- white-space: nowrap;
- padding: 1px 4px;
- margin-top: -2px;
- margin-right: 4px;
- margin-left: -18px;
- text-align: left;
- font-size: 11px;
- line-height: normal;
- font-family: Helvetica, Arial, sans-serif;
- font-weight: bold;
- text-shadow: none;
- color: white;
- border-radius: 7px;
-
- float: left;
- margin-top: 0;
- margin-left: 2px;
-}
-
-.console-message-text {
- white-space: pre-wrap;
-}
-
-.console-message-text > span {
- -webkit-user-select: text;
-}
-
-.console-group-title {
- font-weight: bold;
-}
-
-.console-group-title::before {
- background-image: -webkit-canvas(disclosure-triangle-small-open-normal);
- background-size: 13px 13px;
- top: 6px;
- width: 13px;
- height: 13px;
- left: 3px;
-}
-
-.console-group.collapsed .console-group-title::before {
- background-image: -webkit-canvas(disclosure-triangle-small-closed-normal);
-}
-
-.console-group.collapsed > .console-group-messages {
- display: none;
-}
-
-.console-group {
- position: relative;
-}
-
-.console-group.new-session {
- border-top: 3px dashed rgb(240, 240, 240);
-}
-
-.console-error-level .console-message-text, .console-error-level .section .header .title {
- color: red !important;
-}
-
-.console-debug-level .console-message-text {
- color: blue;
-}
-
-.console-debug-level::before {
- background-color: blue;
-}
-
-.console-error-level::before {
- background-image: url(Images/Error.svg);
- background-size: 10px 10px;
-}
-
-.console-warning-level::before {
- background-image: url(Images/Warning.svg);
- background-size: 10px 10px;
-}
-
-.console-user-command .console-message {
- margin-left: -24px;
- padding-right: 0;
-}
-
-.console-user-command::before {
- background-image: url(Images/UserInputPromptPrevious.svg);
-}
-
-.console-user-command > .console-message-text {
- color: rgb(0, 128, 255);
-}
-
-.console-messages a {
- color: rgb(33%, 33%, 33%);
- cursor: pointer;
-}
-
-.console-messages a:hover {
- color: rgb(15%, 15%, 15%);
-}
-
-.console-message-url {
- float: right;
- margin-left: 4px;
- font-weight: normal;
-}
-
-.console-group-messages .section {
- margin: 0 0 0 12px !important;
-}
-
-.console-group-messages .section .header {
- padding: 0 8px 0 0;
- background-image: none;
- border: none;
- min-height: 0;
-}
-
-.console-group-messages .section .header::before {
- top: 2px;
- left: 1px;
-}
-
-.console-group-messages .section .header .title {
- color: black;
- font-weight: normal;
- line-height: normal;
-}
-
-.console-group-messages .section .properties li .info {
- padding-top: 0;
- padding-bottom: 0;
- color: rgb(60%, 60%, 60%);
-}
-
-.console-group-messages .outline-disclosure {
- outline: none;
- padding-left: 0;
-}
-
-.console-group-messages .outline-disclosure > ol {
- padding: 0 0 0 12px !important;
-}
-
-.console-group-messages .outline-disclosure, .console-group-messages .outline-disclosure ol {
- font-size: inherit;
- line-height: 12px;
-}
-
-.console-group-messages .outline-disclosure.single-node li {
- padding-left: 2px;
-}
-
-.console-group-messages .outline-disclosure li .selection {
- margin-left: -6px;
- margin-right: -6px;
-}
-
-.console-group-messages .add-attribute {
- display: none;
-}
-
-.console-formatted-object, .console-formatted-node {
- position: relative;
- display: inline-block;
- vertical-align: top;
- color: black;
-}
-
-.console-formatted-object .section, .console-formatted-node .section {
- position: static;
-}
-
-.console-formatted-object .properties, .console-formatted-node .properties {
- padding-left: 0 !important;
-}
-
-.console-formatted-number {
- color: rgb(28, 0, 207);
-}
-
-.console-formatted-string, .console-formatted-regexp {
- color: rgb(196, 26, 22);
- white-space: pre;
-}
-
-.console-formatted-null, .console-formatted-undefined {
- color: rgb(128, 128, 128);
-}
-
-.error-message {
- color: red;
-}
-
-.auto-complete-text, .editing .auto-complete-text {
- color: rgb(128, 128, 128) !important;
- -webkit-user-modify: read-only;
-}
-
-.outline-disclosure li.hovered:not(.selected) .selection {
- display: block;
- left: 3px;
- right: 3px;
- background-color: rgba(56, 121, 217, 0.1);
- border-radius: 5px;
-}
-
-.outline-disclosure li.highlighted .highlight {
- background-color: rgb(255, 230, 179);
- border-radius: 4px;
- padding-bottom: 2px;
- margin-bottom: -2px;
-}
-
-.outline-disclosure li.selected.highlighted .highlight {
- background-color: transparent;
- padding-bottom: 0;
- margin-bottom: 0;
-}
-
-.outline-disclosure li .selection {
- display: none;
- position: absolute;
- left: 0;
- right: 0;
- height: 15px;
- z-index: -1;
-}
-
-.outline-disclosure li.selected .selection {
- display: block;
- background-color: rgb(212, 212, 212);
-}
-
-.outline-disclosure li.elements-drag-over .selection {
- display: block;
- margin-top: -2px;
- border-top: 2px solid rgb(56, 121, 217);
-}
-
-.outline-disclosure ol:focus li.selected .selection {
- background-color: rgb(56, 121, 217);
-}
-
-.outline-disclosure ol.search-match-not-found li.selected .selection {
- border: 1px solid rgb(56, 121, 217);
- background-color: white;
-}
-
-.outline-disclosure {
- font-size: 11px;
-}
-
-.outline-disclosure > ol {
- position: relative;
- padding: 2px 6px !important;
- margin: 0;
- color: black;
- cursor: default;
- min-width: 100%;
-}
-
-.outline-disclosure, .outline-disclosure ol {
- list-style-type: none;
- -webkit-padding-start: 12px;
- margin: 0;
-}
-
-.outline-disclosure li {
- padding: 0 0 0 14px;
- margin-top: 1px;
- margin-bottom: 1px;
- margin-left: -2px;
- word-wrap: break-word;
-}
-
-.outline-disclosure li.parent {
- margin-left: -12px
-}
-
-.outline-disclosure li .webkit-html-tag.close {
- margin-left: -12px;
-}
-
-.outline-disclosure li.parent::before {
- float: left;
-
- content: "";
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- width: 8px;
- height: 8px;
-
- margin-top: 2px;
- padding-right: 2px;
-}
-
-.outline-disclosure li.parent.expanded::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.outline-disclosure ol.children {
- display: none;
-}
-
-.outline-disclosure ol.children.expanded {
- display: block;
-}
-
-.webkit-html-fragment.shadow {
- opacity: 0.6;
-}
-
-.console-item.filtered-out {
- display: none;
-}
-
-.log-search-bar > input {
- width: 150px;
-}
-
-.search-in-progress .console-item.filtered-out-by-search {
- display: none;
-}
-
-.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted {
- color: black;
- background-color: rgba(235, 215, 38, 0.2);
- border-bottom: 1px solid rgb(237, 202, 71);
-}
-
-.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted.selected {
- background-color: rgba(235, 215, 38, 0.75);
-}
-
-/* @media reader currently blocked by: http://webkit.org/b/118096 */
-@media reader {
- .console-user-command::before,
- .console-messages:focus .console-item.selected .console-user-command::before,
- .console-user-command-result.console-log-level::before,
- .console-messages:focus .console-item.selected .console-user-command-result.console-log-level::before {
- /* accessible label alternative for icon indicating console input/output/warning/error, etc. */
- content: attr(data-labelprefix);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,947 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogContentView = function(representedObject)
-{
- WebInspector.ContentView.call(this, representedObject);
-
- this._nestingLevel = 0;
- this._selectedMessages = [];
-
- this.element.classList.add(WebInspector.LogContentView.StyleClassName);
-
- this.messagesElement = document.createElement("div");
- this.messagesElement.className = "console-messages";
- this.messagesElement.tabIndex = 0;
- this.messagesElement.setAttribute("role", "log");
- this.messagesElement.addEventListener("mousedown", this._mousedown.bind(this));
- this.messagesElement.addEventListener("focus", this._didFocus.bind(this));
- this.messagesElement.addEventListener("blur", this._didBlur.bind(this));
- this.messagesElement.addEventListener("keydown", this._keyDown.bind(this));
- this.messagesElement.addEventListener("click", this._click.bind(this), true);
- this.messagesElement.addEventListener("dragstart", this._ondragstart.bind(this), true);
- this.element.appendChild(this.messagesElement);
-
- this.prompt = WebInspector.quickConsole.prompt;
-
- this._keyboardShortcutCommandA = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "A");
- this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
-
- this._logViewController = new WebInspector.JavaScriptLogViewController(this.messagesElement, this.element, this.prompt, this, "console-prompt-history");
-
- this._searchBar = new WebInspector.SearchBar("log-search-bar", WebInspector.UIString("Filter Console Log"), this);
- this._searchBar.addEventListener(WebInspector.SearchBar.Event.TextChanged, this._searchTextDidChange, this);
-
- var scopeBarItems = [
- new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.All, WebInspector.UIString("All"), true),
- new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Errors, WebInspector.UIString("Errors")),
- new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Warnings, WebInspector.UIString("Warnings")),
- new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Logs, WebInspector.UIString("Logs"))
- ];
-
- this._scopeBar = new WebInspector.ScopeBar("log-scope-bar", scopeBarItems, scopeBarItems[0]);
- this._scopeBar.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged, this._scopeBarSelectionDidChange, this);
-
- this._clearLogNavigationItem = new WebInspector.ButtonNavigationItem("clear-log", WebInspector.UIString("Clear log (%s or %s)").format(this._logViewController.messagesClearKeyboardShortcut.displayName, this._logViewController.messagesAlternateClearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 16, 16);
- this._clearLogNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearLog, this);
-
- var toolTip = WebInspector.UIString("Show split console");
- var altToolTip = WebInspector.UIString("Show full-height console");
-
- this._toggleSplitNavigationItem = new WebInspector.ToggleButtonNavigationItem("split-toggle", toolTip, altToolTip, "Images/SplitToggleDown.svg", "Images/SplitToggleUp.svg", 16, 16);
- this._toggleSplitNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleSplit, this);
- this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole();
-
- this.messagesElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false);
-
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._sessionsCleared, this);
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.SessionStarted, this._sessionStarted, this);
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, this._messageAdded, this);
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, this._previousMessageRepeatCountUpdated, this);
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._activeLogCleared, this);
-}
-
-WebInspector.LogContentView.Scopes = {
- All: "log-all",
- Errors: "log-errors",
- Warnings: "log-warnings",
- Logs: "log-logs"
-};
-
-WebInspector.LogContentView.StyleClassName = "log";
-WebInspector.LogContentView.ItemWrapperStyleClassName = "console-item";
-WebInspector.LogContentView.FilteredOutStyleClassName = "filtered-out";
-WebInspector.LogContentView.SelectedStyleClassName = "selected";
-WebInspector.LogContentView.SearchInProgressStyleClassName = "search-in-progress";
-WebInspector.LogContentView.FilteredOutBySearchStyleClassName = "filtered-out-by-search";
-WebInspector.LogContentView.HighlightedStyleClassName = "highlighted";
-
-WebInspector.LogContentView.prototype = {
- constructor: WebInspector.LogContentView,
-
- // Public
-
- get navigationItems()
- {
- return [this._searchBar, this._scopeBar, this._clearLogNavigationItem, this._toggleSplitNavigationItem];
- },
-
- get scopeBar()
- {
- return this._scopeBar;
- },
-
- updateLayout: function()
- {
- WebInspector.ContentView.prototype.updateLayout.call(this);
-
- this._scrollElementHeight = this.messagesElement.getBoundingClientRect().height;
- },
-
- shown: function()
- {
- this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole();
-
- this.prompt.focus();
- },
-
- get scrollableElements()
- {
- return [this.element];
- },
-
- get shouldKeepElementsScrolledToBottom()
- {
- return true;
- },
-
- get searchInProgress()
- {
- return this.messagesElement.classList.contains(WebInspector.LogContentView.SearchInProgressStyleClassName);
- },
-
- didClearMessages: function()
- {
- if (this._ignoreDidClearMessages)
- return;
- WebInspector.logManager.requestClearMessages();
- },
-
- didAppendConsoleMessage: function(message)
- {
- WebInspector.quickConsole.updateLayout();
-
- // Nest the message.
- if (message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup) {
- var x = 16 * this._nestingLevel;
- var messageElement = message.toMessageElement();
- messageElement.style.left = x + "px";
- messageElement.style.width = "calc(100% - " + x + "px)";
- }
-
- // Update the nesting level.
- switch (message.type) {
- case WebInspector.ConsoleMessage.MessageType.StartGroup:
- case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
- ++this._nestingLevel;
- break;
- case WebInspector.ConsoleMessage.MessageType.EndGroup:
- --this._nestingLevel;
- break;
- }
-
- this._clearFocusableChildren();
-
- // Some results don't populate until further backend dispatches occur (like the DOM tree).
- // We want to remove focusable children after those pending dispatches too.
- InspectorBackend.runAfterPendingDispatches(this._clearFocusableChildren.bind(this));
-
- // We only auto show the console if the message is a result.
- // This is when the user evaluated something directly in the prompt.
- if (message.type !== WebInspector.ConsoleMessage.MessageType.Result)
- return;
-
- if (!WebInspector.isShowingConsoleView())
- WebInspector.showSplitConsole();
-
- this._logViewController.scrollToBottom();
- },
-
- promptDidChangeHeight: function()
- {
- WebInspector.quickConsole.updateLayout();
- },
-
- get supportsSave()
- {
- return true;
- },
-
- get saveData()
- {
- return {url: "web-inspector:///Console.txt", content: this._formatMessagesAsData(false), forceSaveAs: true};
- },
-
- handleCopyEvent: function(event)
- {
- if (!this._selectedMessages.length)
- return;
-
- event.clipboardData.setData("text/plain", this._formatMessagesAsData(true));
- event.stopPropagation();
- event.preventDefault();
- },
-
- focusSearchBar: function()
- {
- this._searchBar.focus();
- },
-
- highlightPreviousSearchMatch: function()
- {
- if (!this.searchInProgress || isEmptyObject(this._searchMatches))
- return;
-
- var index = this._selectedSearchMatch ? this._searchMatches.indexOf(this._selectedSearchMatch) : this._searchMatches.length;
- this._highlightSearchMatchAtIndex(index - 1);
- },
-
- highlightNextSearchMatch: function()
- {
- if (!this.searchInProgress || isEmptyObject(this._searchMatches))
- return;
-
- var index = this._selectedSearchMatch ? this._searchMatches.indexOf(this._selectedSearchMatch) + 1 : 0;
- this._highlightSearchMatchAtIndex(index);
- },
-
- searchBarWantsToLoseFocus: function(searchBar)
- {
- if (this._selectedMessages.length)
- this.messagesElement.focus();
- else
- this.prompt.focus();
- },
-
- searchBarDidActivate: function(searchBar)
- {
- if (!isEmptyObject(this._searchMatches))
- this._highlightSearchMatchAtIndex(0);
- this.prompt.focus();
- },
-
- // Private
-
- _formatMessagesAsData: function(onlySelected)
- {
- var messages = this._allMessages();
-
- if (onlySelected) {
- messages = this._allMessages().filter(function(message) {
- return message.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName);
- });
- }
-
- var data = "";
-
- var isPrefixOptional = messages.length <= 1 && onlySelected;
- messages.forEach(function (messageElement, index) {
- var messageObject = messageElement.message;
- if (!messageObject)
- messageObject = messageElement.command;
- if (!messageObject)
- return;
-
- if (index > 0)
- data += "\n";
- data += messageObject.toClipboardString(isPrefixOptional);
- });
-
- return data;
- },
-
- _sessionsCleared: function(event)
- {
- this._ignoreDidClearMessages = true;
- this._logViewController.clear();
- this._ignoreDidClearMessages = false;
- },
-
- _sessionStarted: function(event)
- {
- this._logViewController.startNewSession();
- },
-
- _messageAdded: function(event)
- {
- var message = this._logViewController.appendConsoleMessage(event.data.message);
- if (message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup)
- this._filterMessages([message.toMessageElement()]);
- },
-
- _previousMessageRepeatCountUpdated: function(event)
- {
- this._logViewController.updatePreviousMessageRepeatCount(event.data.count);
- },
-
- _handleContextMenuEvent: function(event)
- {
- if (!window.getSelection().isCollapsed) {
- // If there is a selection, we want to show our normal context menu
- // (with Copy, etc.), and not Clear Log.
- return;
- }
-
- // We don't want to show the custom menu for links in the console.
- if (event.target.enclosingNodeOrSelfWithNodeName("a"))
- return;
-
- var contextMenu = new WebInspector.ContextMenu(event);
- contextMenu.appendItem(WebInspector.UIString("Clear Log"), this._clearLog.bind(this));
- contextMenu.show();
- },
-
- _mousedown: function(event)
- {
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- if (event.defaultPrevented) {
- // Default was prevented on the event, so this means something deeper (like a disclosure triangle)
- // handled the mouse down. In this case we want to clear the selection and don't make a new selection.
- this._clearMessagesSelection();
- return;
- }
-
- if (!this._focused) {
- this.messagesElement.focus();
- if (this._selectedMessages.length)
- return;
- }
-
- this._mouseDownWrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
- this._mouseDownShiftKey = event.shiftKey;
- this._mouseDownCommandKey = event.metaKey;
- this._mouseMoveIsRowSelection = false;
-
- window.addEventListener("mousemove", this);
- window.addEventListener("mouseup", this);
- },
-
- _targetInMessageCanBeSelected: function(target, message)
- {
- if (target.enclosingNodeOrSelfWithNodeName("a"))
- return false;
- return true;
- },
-
- _mousemove: function(event)
- {
- var selection = window.getSelection();
- var wrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
-
- if (!wrapper) {
- // No wrapper under the mouse, so look at the selection to try and find one.
- if (!selection.isCollapsed) {
- wrapper = selection.focusNode.parentNode.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
- selection.removeAllRanges();
- }
-
- if (!wrapper)
- return;
- }
-
- if (!selection.isCollapsed)
- this._clearMessagesSelection();
-
- if (wrapper === this._mouseDownWrapper && !this._mouseMoveIsRowSelection)
- return;
-
- selection.removeAllRanges();
-
- if (!this._mouseMoveIsRowSelection)
- this._updateMessagesSelection(this._mouseDownWrapper.messageElement, this._mouseDownCommandKey, this._mouseDownShiftKey);
- this._updateMessagesSelection(wrapper.messageElement, false, true);
-
- this._mouseMoveIsRowSelection = true;
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _mouseup: function(event)
- {
- window.removeEventListener("mousemove", this);
- window.removeEventListener("mouseup", this);
-
- var selection = window.getSelection();
- var wrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
-
- if (wrapper && (selection.isCollapsed || event.shiftKey)) {
- selection.removeAllRanges();
-
- var message = wrapper.messageElement;
- if (this._targetInMessageCanBeSelected(event.target, message)) {
- var sameWrapper = wrapper === this._mouseDownWrapper;
- this._mouseInteractionShouldPreventClickPropagation = !this._isMessageSelected(message);
- this._updateMessagesSelection(message, sameWrapper ? this._mouseDownCommandKey : false, sameWrapper ? this._mouseDownShiftKey : true);
- }
- } else if (!selection.isCollapsed) {
- // There is a text selection, clear the row selection.
- this._clearMessagesSelection();
- } else if (!this._mouseDownWrapper) {
- // The mouse didn't hit a console item, so clear the row selection.
- this._clearMessagesSelection();
-
- // Focus the prompt. Focusing the prompt needs to happen after the click to work.
- setTimeout(function () { this.prompt.focus() }.bind(this), 0);
- }
-
- delete this._mouseMoveIsRowSelection;
- delete this._mouseDownWrapper;
- delete this._mouseDownShiftKey;
- delete this._mouseDownCommandKey;
- },
-
- _click: function(event)
- {
- if (!this._mouseInteractionShouldPreventClickPropagation)
- return;
-
- event.stopPropagation();
- delete this._mouseInteractionShouldPreventClickPropagation;
- },
-
- _ondragstart: function(event)
- {
- if (event.target.enclosingNodeOrSelfWithClass(WebInspector.DOMTreeOutline.StyleClassName)) {
- event.stopPropagation();
- event.preventDefault();
- }
- },
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mousemove":
- this._mousemove(event);
- break;
- case "mouseup":
- this._mouseup(event);
- break;
- }
- },
-
- _updateMessagesSelection: function(message, multipleSelection, rangeSelection)
- {
- var alreadySelectedMessage = this._selectedMessages.contains(message);
- if (alreadySelectedMessage && this._selectedMessages.length && multipleSelection) {
- message.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
- this._selectedMessages.remove(message);
- return;
- }
-
- if (!multipleSelection && !rangeSelection)
- this._clearMessagesSelection();
-
- if (rangeSelection) {
- var messages = this._visibleMessages();
-
- var refIndex = this._referenceMessageForRangeSelection ? messages.indexOf(this._referenceMessageForRangeSelection) : 0;
- var targetIndex = messages.indexOf(message);
-
- var newRange = [Math.min(refIndex, targetIndex), Math.max(refIndex, targetIndex)];
-
- if (this._selectionRange && this._selectionRange[0] === newRange[0] && this._selectionRange[1] === newRange[1])
- return;
-
- var startIndex = this._selectionRange ? Math.min(this._selectionRange[0], newRange[0]) : newRange[0];
- var endIndex = this._selectionRange ? Math.max(this._selectionRange[1], newRange[1]) : newRange[1];
-
- for (var i = startIndex; i <= endIndex; ++i) {
- var messageInRange = messages[i];
- if (i >= newRange[0] && i <= newRange[1] && !messageInRange.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName)) {
- messageInRange.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
- this._selectedMessages.push(messageInRange);
- } else if (i < newRange[0] || i > newRange[1] && messageInRange.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName)) {
- messageInRange.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
- this._selectedMessages.remove(messageInRange);
- }
- }
-
- this._selectionRange = newRange;
- } else {
- message.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
- this._selectedMessages.push(message);
- }
-
- if (!rangeSelection)
- this._referenceMessageForRangeSelection = message;
-
- if (!alreadySelectedMessage)
- this._ensureMessageIsVisible(this._selectedMessages.lastValue);
- },
-
- _ensureMessageIsVisible: function(message)
- {
- if (!message)
- return;
-
- var y = this._positionForMessage(message).y;
- if (y < 0) {
- this.element.scrollTop += y;
- return;
- }
-
- var nextMessage = this._nextMessage(message);
- if (nextMessage) {
- y = this._positionForMessage(nextMessage).y;
- if (y > this._scrollElementHeight)
- this.element.scrollTop += y - this._scrollElementHeight;
- } else {
- y += message.getBoundingClientRect().height;
- if (y > this._scrollElementHeight)
- this.element.scrollTop += y - this._scrollElementHeight;
- }
- },
-
- _positionForMessage: function(message)
- {
- var pagePoint = window.webkitConvertPointFromNodeToPage(message, new WebKitPoint(0, 0));
- return window.webkitConvertPointFromPageToNode(this.element, pagePoint);
- },
-
- _isMessageVisible: function(message)
- {
- var node = message.parentNode;
-
- if (node.classList.contains(WebInspector.LogContentView.FilteredOutStyleClassName))
- return false;
-
- if (this.searchInProgress && node.classList.contains(WebInspector.LogContentView.FilteredOutBySearchStyleClassName))
- return false;
-
- if (message.classList.contains("console-group-title"))
- node = node.parentNode.parentNode;
-
- while (node && node !== this.messagesElement) {
- if (node.classList.contains("collapsed"))
- return false;
- node = node.parentNode;
- }
-
- return true;
- },
-
- _isMessageSelected: function(message)
- {
- return message.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName);
- },
-
- _clearMessagesSelection: function()
- {
- this._selectedMessages.forEach(function(message) {
- message.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
- });
- this._selectedMessages = [];
- delete this._referenceMessageForRangeSelection;
- },
-
- _selectAllMessages: function()
- {
- this._clearMessagesSelection();
-
- var messages = this._visibleMessages();
- for (var i = 0; i < messages.length; ++i) {
- var message = messages[i];
- message.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
- this._selectedMessages.push(message);
- }
- },
-
- _allMessages: function()
- {
- return Array.prototype.slice.call(this.messagesElement.querySelectorAll(".console-message, .console-user-command"));
- },
-
- _unfilteredMessages: function()
- {
- return this._allMessages().filter(function(message) {
- return !message.parentNode.classList.contains(WebInspector.LogContentView.FilteredOutStyleClassName);
- });
- },
-
- _visibleMessages: function()
- {
- var unfilteredMessages = this._unfilteredMessages();
-
- if (!this.searchInProgress)
- return unfilteredMessages;
-
- return unfilteredMessages.filter(function(message) {
- return !message.parentNode.classList.contains(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
- });
- },
-
- _activeLogCleared: function(event)
- {
- this._ignoreDidClearMessages = true;
- this._logViewController.clear();
- this._ignoreDidClearMessages = false;
- },
-
- _toggleSplit: function()
- {
- if (WebInspector.isShowingSplitConsole())
- WebInspector.showFullHeightConsole();
- else
- WebInspector.showSplitConsole();
- },
-
- _clearLog: function()
- {
- this._logViewController.clear();
- },
-
- _scopeBarSelectionDidChange: function(event)
- {
- this._filterMessages(this._allMessages());
- },
-
- _filterMessages: function(messages)
- {
- var showsAll = this._scopeBar.item(WebInspector.LogContentView.Scopes.All).selected;
- var showsErrors = this._scopeBar.item(WebInspector.LogContentView.Scopes.Errors).selected;
- var showsWarnings = this._scopeBar.item(WebInspector.LogContentView.Scopes.Warnings).selected;
- var showsLogs = this._scopeBar.item(WebInspector.LogContentView.Scopes.Logs).selected;
-
- messages.forEach(function(message) {
- var visible = showsAll || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult;
- if (!visible) {
- switch(message.message.level) {
- case WebInspector.ConsoleMessage.MessageLevel.Warning:
- visible = showsWarnings;
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Error:
- visible = showsErrors;
- break;
- case WebInspector.ConsoleMessage.MessageLevel.Log:
- visible = showsLogs;
- break;
- }
- }
-
- var classList = message.parentNode.classList;
- if (visible)
- classList.remove(WebInspector.LogContentView.FilteredOutStyleClassName);
- else {
- this._selectedMessages.remove(message);
- classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
- classList.add(WebInspector.LogContentView.FilteredOutStyleClassName);
- }
- }.bind(this));
-
- this._performSearch();
- },
-
- _didFocus: function(event)
- {
- this._focused = true;
- },
-
- _didBlur: function(event)
- {
- this._focused = false;
- },
-
- _keyDown: function(event)
- {
- if (this._keyboardShortcutCommandA.matchesEvent(event))
- this._commandAWasPressed(event);
- else if (this._keyboardShortcutEsc.matchesEvent(event))
- this._escapeWasPressed(event);
- else if (event.keyIdentifier === "Up")
- this._upArrowWasPressed(event);
- else if (event.keyIdentifier === "Down")
- this._downArrowWasPressed(event);
- else if (event.keyIdentifier === "Left")
- this._leftArrowWasPressed(event);
- else if (event.keyIdentifier === "Right")
- this._rightArrowWasPressed(event);
- },
-
- _commandAWasPressed: function(event)
- {
- this._selectAllMessages();
- event.preventDefault();
- },
-
- _escapeWasPressed: function(event)
- {
- if (this._selectedMessages.length)
- this._clearMessagesSelection();
- else
- this.prompt.focus();
-
- event.preventDefault();
- },
-
- _upArrowWasPressed: function(event)
- {
- var messages = this._visibleMessages();
-
- if (!this._selectedMessages.length) {
- if (messages.length)
- this._updateMessagesSelection(messages.lastValue, false, false);
- return;
- }
-
- var lastMessage = this._selectedMessages.lastValue;
- var previousMessage = this._previousMessage(lastMessage);
- if (previousMessage)
- this._updateMessagesSelection(previousMessage, false, event.shiftKey);
- else if (!event.shiftKey) {
- this._clearMessagesSelection();
- this._updateMessagesSelection(messages[0], false, false);
- }
-
- event.preventDefault();
- },
-
- _downArrowWasPressed: function(event)
- {
- var messages = this._visibleMessages();
-
- if (!this._selectedMessages.length) {
- if (messages.length)
- this._updateMessagesSelection(messages[0], false, false);
- return;
- }
-
- var lastMessage = this._selectedMessages.lastValue;
- var nextMessage = this._nextMessage(lastMessage);
- if (nextMessage)
- this._updateMessagesSelection(nextMessage, false, event.shiftKey);
- else if (!event.shiftKey) {
- this._clearMessagesSelection();
- this._updateMessagesSelection(messages.lastValue, false, false);
- }
-
- event.preventDefault();
- },
-
- _leftArrowWasPressed: function(event)
- {
- if (this._selectedMessages.length !== 1)
- return;
-
- var currentMessage = this._selectedMessages[0];
- if (currentMessage.classList.contains("console-group-title"))
- currentMessage.parentNode.parentNode.classList.add("collapsed");
- else {
- var outlineTitle = currentMessage.querySelector("ol.outline-disclosure > li.parent");
- if (outlineTitle) {
- if (event.altKey)
- outlineTitle.treeElement.collapseRecursively();
- else
- outlineTitle.treeElement.collapse();
- } else {
- var outlineSection = currentMessage.querySelector(".console-formatted-object > .section");
- if (outlineSection)
- outlineSection._section.collapse();
- }
- }
- },
-
- _rightArrowWasPressed: function(event)
- {
- if (this._selectedMessages.length !== 1)
- return;
-
- var currentMessage = this._selectedMessages[0];
- if (currentMessage.classList.contains("console-group-title"))
- currentMessage.parentNode.parentNode.classList.remove("collapsed");
- else {
- var outlineTitle = currentMessage.querySelector("ol.outline-disclosure > li.parent");
- if (outlineTitle) {
- outlineTitle.treeElement.onexpand = function() {
- setTimeout(function () {
- this._ensureMessageIsVisible(currentMessage);
- this._clearFocusableChildren();
- delete outlineTitle.treeElement.onexpand;
- }.bind(this));
- }.bind(this);
-
- if (event.altKey)
- outlineTitle.treeElement.expandRecursively();
- else
- outlineTitle.treeElement.expand();
- } else {
- var outlineSection = currentMessage.querySelector(".console-formatted-object > .section");
- if (outlineSection) {
- outlineSection._section.addEventListener(WebInspector.Section.Event.VisibleContentDidChange, this._propertiesSectionDidUpdateContent, this);
- outlineSection._section.expand();
- }
- }
- }
- },
-
- _propertiesSectionDidUpdateContent: function(event)
- {
- var section = event.target;
- section.removeEventListener(WebInspector.Section.Event.VisibleContentDidChange, this._propertiesSectionDidUpdateContent, this);
-
- var message = section.element.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName).messageElement;
- if (!this._isMessageSelected(message))
- return;
-
- setTimeout(function () {
- this._ensureMessageIsVisible(message);
- this._clearFocusableChildren();
- }.bind(this));
- },
-
- _previousMessage: function(message)
- {
- var messages = this._visibleMessages();
- for (var i = messages.indexOf(message) - 1; i >= 0; --i) {
- if (this._isMessageVisible(messages[i]))
- return messages[i];
- }
- },
-
- _nextMessage: function(message)
- {
- var messages = this._visibleMessages();
- for (var i = messages.indexOf(message) + 1; i < messages.length; ++i) {
- if (this._isMessageVisible(messages[i]))
- return messages[i];
- }
- },
-
- _clearFocusableChildren: function()
- {
- var focusableElements = this.messagesElement.querySelectorAll("[tabindex]");
- for (var i = 0, count = focusableElements.length; i < count; ++i)
- focusableElements[i].removeAttribute("tabindex");
- },
-
- _searchTextDidChange: function(event)
- {
- this._performSearch();
- },
-
- _performSearch: function()
- {
- if (!isEmptyObject(this._searchHighlightDOMChanges))
- WebInspector.revertDomChanges(this._searchHighlightDOMChanges);
-
- var searchTerms = this._searchBar.text;
-
- if (searchTerms === "") {
- delete this._selectedSearchMatch;
- this._matchingSearchElements = [];
- this.messagesElement.classList.remove(WebInspector.LogContentView.SearchInProgressStyleClassName);
- return;
- }
-
- this.messagesElement.classList.add(WebInspector.LogContentView.SearchInProgressStyleClassName);
-
- this._searchHighlightDOMChanges = [];
- this._searchMatches = [];
- this._selectedSearchMathIsValid = false;
-
- var searchRegex = new RegExp(searchTerms.escapeForRegExp(), "gi");
- this._unfilteredMessages().forEach(function(message) {
- var matchRanges = [];
- var text = message.textContent;
- var match = searchRegex.exec(text);
- while (match) {
- matchRanges.push({ offset: match.index, length: match[0].length });
- match = searchRegex.exec(text);
- }
-
- if (!isEmptyObject(matchRanges))
- this._highlightRanges(message, matchRanges);
-
- var classList = message.parentNode.classList;
- if (!isEmptyObject(matchRanges) || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult)
- classList.remove(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
- else
- classList.add(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
- }, this);
-
- if (!this._selectedSearchMathIsValid && this._selectedSearchMatch) {
- this._selectedSearchMatch.highlight.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
- delete this._selectedSearchMatch;
- }
- },
-
- _highlightRanges: function(message, matchRanges)
- {
- var highlightedElements = WebInspector.highlightRangesWithStyleClass(message, matchRanges, WebInspector.LogContentView.HighlightedStyleClassName, this._searchHighlightDOMChanges);
-
- console.assert(highlightedElements.length === matchRanges.length);
-
- matchRanges.forEach(function (range, index) {
- this._searchMatches.push({
- message: message,
- range: range,
- highlight: highlightedElements[index]
- });
-
- if (this._selectedSearchMatch && !this._selectedSearchMathIsValid && this._selectedSearchMatch.message === message) {
- this._selectedSearchMathIsValid = this._rangesOverlap(this._selectedSearchMatch.range, range);
- if (this._selectedSearchMathIsValid) {
- delete this._selectedSearchMatch;
- this._highlightSearchMatchAtIndex(this._searchMatches.length - 1);
- }
- }
- }, this);
- },
-
- _rangesOverlap: function(range1, range2)
- {
- return range1.offset <= range2.offset + range2.length && range2.offset <= range1.offset + range1.length;
- },
-
- _highlightSearchMatchAtIndex: function(index)
- {
- if (index >= this._searchMatches.length)
- index = 0;
- else if (index < 0)
- index = this._searchMatches.length - 1;
-
- if (this._selectedSearchMatch)
- this._selectedSearchMatch.highlight.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
-
- this._selectedSearchMatch = this._searchMatches[index];
- this._selectedSearchMatch.highlight.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
-
- this._ensureMessageIsVisible(this._selectedSearchMatch.message);
- }
-}
-
-WebInspector.LogContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogIconcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogIcon.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogIcon.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.log-icon .icon {
- content: -webkit-image-set(url(Images/Log.png) 1x, url(Images/Log@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,104 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogManager = function()
-{
- WebInspector.Object.call(this);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-}
-
-WebInspector.LogManager.Event = {
- SessionStarted: "log-manager-session-was-started",
- Cleared: "log-manager-cleared",
- MessageAdded: "log-manager-message-added",
- ActiveLogCleared: "log-manager-current-log-cleared",
- PreviousMessageRepeatCountUpdated: "log-manager-previous-message-repeat-count-updated"
-};
-
-WebInspector.LogManager.prototype = {
- constructor: WebInspector.LogManager,
-
- // Public
-
- messageWasAdded: function(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, requestId)
- {
- // Called from WebInspector.ConsoleObserver.
-
- // FIXME: Pass a request. We need a way to get it from the request ID.
- var consoleMessage = WebInspector.ConsoleMessage.create(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, null);
-
- this.dispatchEventToListeners(WebInspector.LogManager.Event.MessageAdded, {message: consoleMessage});
-
- console.assert(!consoleMessage._element || !consoleMessage._element.parentNode, "This console message shouldn't be added to a view. To add it you need to use clone().");
- },
-
- messagesCleared: function()
- {
- // Called from WebInspector.ConsoleObserver.
-
- // We don't want to clear messages on reloads. We can't determine that easily right now.
- // FIXME: <rdar://problem/13767079> Console.messagesCleared should include a reason
- this._shouldClearMessages = true;
- setTimeout(function() {
- if (this._shouldClearMessages)
- this.dispatchEventToListeners(WebInspector.LogManager.Event.ActiveLogCleared);
- delete this._shouldClearMessages;
- }.bind(this), 0);
- },
-
- messageRepeatCountUpdated: function(count)
- {
- // Called from WebInspector.ConsoleObserver.
-
- this.dispatchEventToListeners(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, {count: count});
- },
-
- requestClearMessages: function()
- {
- ConsoleAgent.clearMessages();
- },
-
- // Private
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (!event.target.isMainFrame())
- return;
-
- var oldMainResource = event.data.oldMainResource;
- var newMainResource = event.target.mainResource;
- if (oldMainResource.url !== newMainResource.url)
- this.dispatchEventToListeners(WebInspector.LogManager.Event.Cleared);
- else
- this.dispatchEventToListeners(WebInspector.LogManager.Event.SessionStarted);
-
- delete this._shouldClearMessages;
- }
-};
-
-WebInspector.LogManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogObject = function()
-{
- WebInspector.Object.call(this);
-
- this._startDate = new Date();
-};
-
-WebInspector.LogObject.prototype = {
- constructor: WebInspector.LogObject,
-
- // Public
-
- get startDate()
- {
- return this._startDate;
- }
-};
-
-WebInspector.LogManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceLogTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/LogTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/LogTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/LogTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.LogObject);
-
- WebInspector.GeneralTreeElement.call(this, WebInspector.LogTreeElement.StyleClassName, WebInspector.UIString("Console"), representedObject.startDate.toLocaleTimeString(), representedObject, false);
-
- this._logObject = representedObject;
-
- this.small = true;
-};
-
-WebInspector.LogTreeElement.StyleClassName = "log-icon";
-
-WebInspector.LogTreeElement.prototype = {
- constructor: WebInspector.LogTreeElement,
-
- // Public
-
- get logObject()
- {
- return this._logObject;
- }
-};
-
-WebInspector.LogTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMIMETypeUtilitiesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/MIMETypeUtilities.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/MIMETypeUtilities.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/MIMETypeUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,80 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.fileExtensionForURL = function(url)
-{
- var lastPathComponent = parseURL(url).lastPathComponent;
- if (!lastPathComponent)
- return "";
-
- var index = lastPathComponent.indexOf(".");
- if (index === -1)
- return "";
-
- return lastPathComponent.substr(index + 1);
-};
-
-WebInspector.mimeTypeForFileExtension = function(extension)
-{
- const extensionToMIMEType = {
- // Document types.
- "html": "text/html",
- "xhtml": "application/xhtml+xml",
- "xml": "text/xml",
-
- // Script types.
- "js": "text/javascript",
- "json": "application/json",
- "clj": "text/x-clojure",
- "coffee": "text/x-coffeescript",
- "ls": "text/x-livescript",
- "ts": "text/typescript",
-
- // Stylesheet types.
- "css": "text/css",
- "less": "text/x-less",
- "sass": "text/x-sass",
- "scss": "text/x-scss",
-
- // Image types.
- "bmp": "image/bmp",
- "gif": "image/gif",
- "jpeg": "image/jpeg",
- "jpg": "image/jpeg",
- "pdf": "application/pdf",
- "png": "image/png",
- "tif": "image/tiff",
- "tiff": "image/tiff",
-
- // Font types and Media types are ignored for now.
-
- // Miscellaneous types.
- "svg": "image/svg+xml",
- "txt": "text/plain",
- "xsl": "text/xsl"
- };
-
- return extensionToMIMEType[extension] || null;
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMaincss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Main.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,257 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-* {
- box-sizing: border-box;
-}
-
-body {
- display: -webkit-flex;
- -webkit-flex-direction: column;
-
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- padding: 0;
- margin: 0;
-
- overflow: hidden;
-
- -webkit-user-select: none;
- -webkit-user-drag: none;
-
- cursor: default;
-
- -webkit-font-smoothing: subpixel-antialiased;
-
- tab-size: 4; /* FIXME: This should be controlled by a setting. <rdar://problem/10593948> */
-}
-
-body.docked {
- background-color: white;
-}
-
-body.docked.bottom {
- border-top: 1px solid rgb(85, 85, 85);
-}
-
-body.docked.right {
- border-left: 1px solid rgb(85, 85, 85);
-}
-
-#docked-resizer {
- display: none;
-
- z-index: 100;
-}
-
-body.docked #docked-resizer {
- display: block;
-}
-
-body.docked.bottom #docked-resizer {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 3px;
-
- cursor: row-resize;
-}
-
-body.docked.right #docked-resizer {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 3px;
-
- cursor: col-resize;
-}
-
-body.docked.bottom #toolbar {
- cursor: row-resize;
-}
-
-body.docked.bottom #toolbar .item:not(.flexible-space) {
- cursor: default;
-}
-
-#main {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- background-color: white;
-
- /* The position and z-index are needed to make negative z-index work in the DOM tree. */
- position: relative;
- z-index: 0;
-}
-
-#navigation-sidebar {
- width: 300px;
-}
-
-body.docked.right #navigation-sidebar.collapsed > .resizer {
- pointer-events: none;
-}
-
-#content {
- display: -webkit-flex;
- -webkit-flex-direction: column;
- -webkit-flex: 1;
-}
-
-#content-browser {
- -webkit-flex: 1;
-}
-
-#split-content-browser {
- border-top: 1px solid rgb(153, 153, 153);
-}
-
-#split-content-browser > .navigation-bar {
- cursor: row-resize;
-
- background-image: -webkit-linear-gradient(top, rgb(248, 248, 248), rgb(226, 226, 226));
-}
-
-#split-content-browser > .navigation-bar .item:not(.flexible-space) {
- cursor: default;
-}
-
-#details-sidebar {
- width: 300px;
-}
-
-.message-text-view {
- display: -webkit-flex;
- z-index: 1000;
-
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- padding-left: 20%;
- padding-right: 20%;
-
- -webkit-justify-content: center;
- -webkit-align-items: center;
-
- line-height: 20px;
- white-space: pre-wrap;
- text-align: center;
-
- font-size: 18px;
- font-weight: bold;
- font-family: Lucida Grande, sans-serif;
-
- color: rgb(75%, 75%, 75%);
- background-color: white;
-}
-
-.message-text-view.error {
- color: rgb(224, 16, 16);
-}
-
-.message-text-view.error::before {
- display: inline-block;
-
- width: 20px;
- height: 20px;
- margin-right: 4px;
- vertical-align: bottom;
-
- background-image: url(Images/Error.svg);
- background-size: 100% 100%;
- content: "";
-}
-
-.go-to-link {
- color: rgb(85, 85, 85) !important;
- text-decoration: underline !important;
- cursor: pointer;
-}
-
-.go-to-link:not(.dont-float) {
- float: right;
- margin-left: 5px;
- max-width: 100%;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.go-to-arrow {
- -webkit-appearance: none;
-
- padding: 0;
- margin: 0;
- border: none;
-
- background-color: transparent;
- background-image: -webkit-canvas(go-to-arrow-normal);
- background-repeat: no-repeat;
- background-position: center;
- background-size: 10px 10px;
-
- width: 16px;
- height: 16px;
-
- /* Workaround: for text boxes overlapping float:right. Give go-to arrows a z-index to ensure they are clickable.
- <rdar://problem/11536832> Cannot access content view from Instruments navigator if name of file is truncated */
- position: relative;
- z-index: 1;
-}
-
-.go-to-arrow:active {
- background-image: -webkit-canvas(go-to-arrow-normal-active);
-}
-
-:focus .selected .go-to-arrow {
- background-image: -webkit-canvas(go-to-arrow-selected);
-}
-
-:focus .selected .go-to-arrow:active {
- background-image: -webkit-canvas(go-to-arrow-selected-active);
-}
-
-.display-location {
- font-style: italic !important;
-}
-
-.hidden {
- display: none !important;
-}
-
-.node-link {
- text-decoration: underline;
- cursor: pointer;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> <!--
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,439 +30,455 @@
</span><span class="cx">
</span><span class="cx"> <link rel="stylesheet" href="External/CodeMirror/codemirror.css">
</span><span class="cx">
</span><del>- <link rel="stylesheet" href="Main.css">
- <link rel="stylesheet" href="NavigationBar.css">
- <link rel="stylesheet" href="FlexibleSpaceNavigationItem.css">
- <link rel="stylesheet" href="DividerNavigationItem.css">
- <link rel="stylesheet" href="ButtonNavigationItem.css">
- <link rel="stylesheet" href="RadioButtonNavigationItem.css">
- <link rel="stylesheet" href="HierarchicalPathComponent.css">
- <link rel="stylesheet" href="FilterBar.css">
- <link rel="stylesheet" href="ScopeBar.css">
- <link rel="stylesheet" href="SearchBar.css">
- <link rel="stylesheet" href="Sidebar.css">
- <link rel="stylesheet" href="ContentBrowser.css">
- <link rel="stylesheet" href="NavigationSidebarPanel.css">
- <link rel="stylesheet" href="ResourceIcons.css">
- <link rel="stylesheet" href="ContentFlowIcon.css">
- <link rel="stylesheet" href="FolderIcon.css">
- <link rel="stylesheet" href="ContentViewContainer.css">
- <link rel="stylesheet" href="ClusterContentView.css">
- <link rel="stylesheet" href="ContentView.css">
- <link rel="stylesheet" href="ImageResourceContentView.css">
- <link rel="stylesheet" href="FontResourceContentView.css">
- <link rel="stylesheet" href="Popover.css">
- <link rel="stylesheet" href="TextEditor.css">
- <link rel="stylesheet" href="SyntaxHighlightingDefaultTheme.css">
- <link rel="stylesheet" href="TextResourceContentView.css">
- <link rel="stylesheet" href="DOMStorageContentView.css">
- <link rel="stylesheet" href="CookieStorageContentView.css">
- <link rel="stylesheet" href="DatabaseTableContentView.css">
- <link rel="stylesheet" href="DatabaseContentView.css">
- <link rel="stylesheet" href="TextContentView.css">
- <link rel="stylesheet" href="CookieIcon.css">
- <link rel="stylesheet" href="DatabaseIcon.css">
- <link rel="stylesheet" href="DatabaseTableIcon.css">
- <link rel="stylesheet" href="DOMStorageIcons.css">
- <link rel="stylesheet" href="DOMTreeOutline.css">
- <link rel="stylesheet" href="PathComponentIcons.css">
- <link rel="stylesheet" href="DataGrid.css">
- <link rel="stylesheet" href="Editing.css">
- <link rel="stylesheet" href="DOMTreeContentView.css">
- <link rel="stylesheet" href="SearchIcons.css">
- <link rel="stylesheet" href="LogContentView.css">
- <link rel="stylesheet" href="Section.css">
- <link rel="stylesheet" href="DetailsSidebarPanel.css">
- <link rel="stylesheet" href="DetailsSection.css">
- <link rel="stylesheet" href="LogIcon.css">
- <link rel="stylesheet" href="BoxModelDetailsSectionRow.css">
- <link rel="stylesheet" href="IndeterminateProgressSpinner.css">
- <link rel="stylesheet" href="ApplicationCacheFrameContentView.css">
- <link rel="stylesheet" href="ApplicationCacheIcons.css">
- <link rel="stylesheet" href="ResourceTreeElement.css">
- <link rel="stylesheet" href="TreeElementStatusButton.css">
- <link rel="stylesheet" href="TimelineSidebarPanel.css">
- <link rel="stylesheet" href="TimelineContentView.css">
- <link rel="stylesheet" href="OverviewTimelineView.css">
- <link rel="stylesheet" href="NetworkTimelineView.css">
- <link rel="stylesheet" href="LayoutTimelineView.css">
- <link rel="stylesheet" href="ScriptTimelineView.css">
- <link rel="stylesheet" href="TimelineIcons.css">
- <link rel="stylesheet" href="TimelineRuler.css">
- <link rel="stylesheet" href="TimelineDataGrid.css">
- <link rel="stylesheet" href="TimelineRecordBar.css">
- <link rel="stylesheet" href="TimelineOverview.css">
- <link rel="stylesheet" href="NetworkTimelineOverviewGraph.css">
- <link rel="stylesheet" href="LayoutTimelineOverviewGraph.css">
- <link rel="stylesheet" href="ScriptTimelineOverviewGraph.css">
- <link rel="stylesheet" href="LegacyProfileView.css">
- <link rel="stylesheet" href="LegacyJavaScriptProfileView.css">
- <link rel="stylesheet" href="CSSStyleDetailsSidebarPanel.css">
- <link rel="stylesheet" href="DOMTreeDataGrid.css">
- <link rel="stylesheet" href="LayerTreeSidebarPanel.css">
- <link rel="stylesheet" href="EventListenerSectionGroup.css">
- <link rel="stylesheet" href="Breakpoint.css">
- <link rel="stylesheet" href="BreakpointActionView.css">
- <link rel="stylesheet" href="BreakpointTreeElement.css">
- <link rel="stylesheet" href="QuickConsole.css">
- <link rel="stylesheet" href="CallFrameIcons.css">
- <link rel="stylesheet" href="SourceCodeTextEditor.css">
- <link rel="stylesheet" href="ScriptContentView.css">
- <link rel="stylesheet" href="FindBanner.css">
- <link rel="stylesheet" href="Toolbar.css">
- <link rel="stylesheet" href="ButtonToolbarItem.css">
- <link rel="stylesheet" href="ControlToolbarItem.css">
- <link rel="stylesheet" href="ResourceSidebarPanel.css">
- <link rel="stylesheet" href="DebuggerSidebarPanel.css">
- <link rel="stylesheet" href="DashboardView.css">
- <link rel="stylesheet" href="CSSStyleDeclarationTextEditor.css">
- <link rel="stylesheet" href="CSSStyleDeclarationSection.css">
- <link rel="stylesheet" href="RulesStyleDetailsPanel.css">
- <link rel="stylesheet" href="StyleRuleIcons.css">
- <link rel="stylesheet" href="CodeMirrorCompletionController.css">
- <link rel="stylesheet" href="CodeMirrorTokenTrackingController.css">
- <link rel="stylesheet" href="CompletionSuggestionsView.css">
- <link rel="stylesheet" href="CodeMirrorOverrides.css">
- <link rel="stylesheet" href="ConsolePrompt.css">
- <link rel="stylesheet" href="Slider.css">
- <link rel="stylesheet" href="ColorWheel.css">
- <link rel="stylesheet" href="ColorPicker.css">
- <link rel="stylesheet" href="GradientSlider.css">
- <link rel="stylesheet" href="CodeMirrorGradientEditingController.css">
- <link rel="stylesheet" href="CodeMirrorDragToAdjustNumberController.css">
- <link rel="stylesheet" href="GoToLineDialog.css">
- <link rel="stylesheet" href="HoverMenu.css">
- <link rel="stylesheet" href="ComputedStyleDetailsPanel.css">
- <link rel="stylesheet" href="ProbeDetailsSidebarPanel.css">
- <link rel="stylesheet" href="ProbeSetDataGrid.css">
- <link rel="stylesheet" href="IndexedDatabaseObjectStoreContentView.css">
</del><ins>+ <link rel="stylesheet" href="Views/ApplicationCacheFrameContentView.css">
+ <link rel="stylesheet" href="Views/ApplicationCacheIcons.css">
+ <link rel="stylesheet" href="Views/BoxModelDetailsSectionRow.css">
+ <link rel="stylesheet" href="Views/Breakpoint.css">
+ <link rel="stylesheet" href="Views/BreakpointActionView.css">
+ <link rel="stylesheet" href="Views/BreakpointIcons.css">
+ <link rel="stylesheet" href="Views/BreakpointTreeElement.css">
+ <link rel="stylesheet" href="Views/ButtonNavigationItem.css">
+ <link rel="stylesheet" href="Views/ButtonToolbarItem.css">
+ <link rel="stylesheet" href="Views/CSSStyleDeclarationSection.css">
+ <link rel="stylesheet" href="Views/CSSStyleDeclarationTextEditor.css">
+ <link rel="stylesheet" href="Views/CSSStyleDetailsSidebarPanel.css">
+ <link rel="stylesheet" href="Views/CallFrameIcons.css">
+ <link rel="stylesheet" href="Views/ClusterContentView.css">
+ <link rel="stylesheet" href="Views/CodeMirrorOverrides.css">
+ <link rel="stylesheet" href="Views/ColorPicker.css">
+ <link rel="stylesheet" href="Views/ColorWheel.css">
+ <link rel="stylesheet" href="Views/CompletionSuggestionsView.css">
+ <link rel="stylesheet" href="Views/ComputedStyleDetailsPanel.css">
+ <link rel="stylesheet" href="Views/ConsolePrompt.css">
+ <link rel="stylesheet" href="Views/ContentBrowser.css">
+ <link rel="stylesheet" href="Views/ContentFlowIcon.css">
+ <link rel="stylesheet" href="Views/ContentView.css">
+ <link rel="stylesheet" href="Views/ContentViewContainer.css">
+ <link rel="stylesheet" href="Views/ControlToolbarItem.css">
+ <link rel="stylesheet" href="Views/CookieIcon.css">
+ <link rel="stylesheet" href="Views/CookieStorageContentView.css">
+ <link rel="stylesheet" href="Views/DOMStorageContentView.css">
+ <link rel="stylesheet" href="Views/DOMStorageIcons.css">
+ <link rel="stylesheet" href="Views/DOMTreeContentView.css">
+ <link rel="stylesheet" href="Views/DOMTreeDataGrid.css">
+ <link rel="stylesheet" href="Views/DOMTreeOutline.css">
+ <link rel="stylesheet" href="Views/DashboardView.css">
+ <link rel="stylesheet" href="Views/DataGrid.css">
+ <link rel="stylesheet" href="Views/DatabaseContentView.css">
+ <link rel="stylesheet" href="Views/DatabaseIcon.css">
+ <link rel="stylesheet" href="Views/DatabaseTableContentView.css">
+ <link rel="stylesheet" href="Views/DatabaseTableIcon.css">
+ <link rel="stylesheet" href="Views/DebuggerSidebarPanel.css">
+ <link rel="stylesheet" href="Views/DetailsSection.css">
+ <link rel="stylesheet" href="Views/DetailsSidebarPanel.css">
+ <link rel="stylesheet" href="Views/DividerNavigationItem.css">
+ <link rel="stylesheet" href="Views/Editing.css">
+ <link rel="stylesheet" href="Views/EventListenerSectionGroup.css">
+ <link rel="stylesheet" href="Views/FilterBar.css">
+ <link rel="stylesheet" href="Views/FindBanner.css">
+ <link rel="stylesheet" href="Views/FlexibleSpaceNavigationItem.css">
+ <link rel="stylesheet" href="Views/FolderIcon.css">
+ <link rel="stylesheet" href="Views/FontResourceContentView.css">
+ <link rel="stylesheet" href="Views/GoToLineDialog.css">
+ <link rel="stylesheet" href="Views/GradientSlider.css">
+ <link rel="stylesheet" href="Views/HierarchicalPathComponent.css">
+ <link rel="stylesheet" href="Views/HoverMenu.css">
+ <link rel="stylesheet" href="Views/ImageResourceContentView.css">
+ <link rel="stylesheet" href="Views/IndeterminateProgressSpinner.css">
+ <link rel="stylesheet" href="Views/IndexedDatabaseObjectStoreContentView.css">
+ <link rel="stylesheet" href="Views/LayerTreeSidebarPanel.css">
+ <link rel="stylesheet" href="Views/LayoutTimelineOverviewGraph.css">
+ <link rel="stylesheet" href="Views/LayoutTimelineView.css">
+ <link rel="stylesheet" href="Views/LegacyJavaScriptProfileView.css">
+ <link rel="stylesheet" href="Views/LegacyProfileView.css">
+ <link rel="stylesheet" href="Views/LogContentView.css">
+ <link rel="stylesheet" href="Views/LogIcon.css">
+ <link rel="stylesheet" href="Views/Main.css">
+ <link rel="stylesheet" href="Views/NavigationBar.css">
+ <link rel="stylesheet" href="Views/NavigationSidebarPanel.css">
+ <link rel="stylesheet" href="Views/NetworkTimelineOverviewGraph.css">
+ <link rel="stylesheet" href="Views/NetworkTimelineView.css">
+ <link rel="stylesheet" href="Views/OverviewTimelineView.css">
+ <link rel="stylesheet" href="Views/PathComponentIcons.css">
+ <link rel="stylesheet" href="Views/Popover.css">
+ <link rel="stylesheet" href="Views/ProbeDetailsSidebarPanel.css">
+ <link rel="stylesheet" href="Views/ProbeSetDataGrid.css">
+ <link rel="stylesheet" href="Views/QuickConsole.css">
+ <link rel="stylesheet" href="Views/RadioButtonNavigationItem.css">
+ <link rel="stylesheet" href="Views/ResourceIcons.css">
+ <link rel="stylesheet" href="Views/ResourceSidebarPanel.css">
+ <link rel="stylesheet" href="Views/ResourceTreeElement.css">
+ <link rel="stylesheet" href="Views/RulesStyleDetailsPanel.css">
+ <link rel="stylesheet" href="Views/ScopeBar.css">
+ <link rel="stylesheet" href="Views/ScriptContentView.css">
+ <link rel="stylesheet" href="Views/ScriptTimelineOverviewGraph.css">
+ <link rel="stylesheet" href="Views/ScriptTimelineView.css">
+ <link rel="stylesheet" href="Views/SearchBar.css">
+ <link rel="stylesheet" href="Views/SearchIcons.css">
+ <link rel="stylesheet" href="Views/Section.css">
+ <link rel="stylesheet" href="Views/Sidebar.css">
+ <link rel="stylesheet" href="Views/Slider.css">
+ <link rel="stylesheet" href="Views/SourceCodeTextEditor.css">
+ <link rel="stylesheet" href="Views/StyleRuleIcons.css">
+ <link rel="stylesheet" href="Views/SyntaxHighlightingDefaultTheme.css">
+ <link rel="stylesheet" href="Views/TextContentView.css">
+ <link rel="stylesheet" href="Views/TextEditor.css">
+ <link rel="stylesheet" href="Views/TextResourceContentView.css">
+ <link rel="stylesheet" href="Views/TimelineContentView.css">
+ <link rel="stylesheet" href="Views/TimelineDataGrid.css">
+ <link rel="stylesheet" href="Views/TimelineIcons.css">
+ <link rel="stylesheet" href="Views/TimelineOverview.css">
+ <link rel="stylesheet" href="Views/TimelineRecordBar.css">
+ <link rel="stylesheet" href="Views/TimelineRuler.css">
+ <link rel="stylesheet" href="Views/TimelineSidebarPanel.css">
+ <link rel="stylesheet" href="Views/TimelineView.css">
+ <link rel="stylesheet" href="Views/Toolbar.css">
+ <link rel="stylesheet" href="Views/TreeElementStatusButton.css">
</ins><span class="cx">
</span><ins>+ <link rel="stylesheet" href="Controllers/CodeMirrorCompletionController.css">
+ <link rel="stylesheet" href="Controllers/CodeMirrorDragToAdjustNumberController.css">
+ <link rel="stylesheet" href="Controllers/CodeMirrorGradientEditingController.css">
+ <link rel="stylesheet" href="Controllers/CodeMirrorTokenTrackingController.css">
+
</ins><span class="cx"> <script src="External/CodeMirror/codemirror.js"></script>
</span><ins>+
+ <script src="External/CodeMirror/clojure.js"></script>
+ <script src="External/CodeMirror/closebrackets.js"></script>
+ <script src="External/CodeMirror/coffeescript.js"></script>
</ins><span class="cx"> <script src="External/CodeMirror/comment.js"></script>
</span><del>- <script src="External/CodeMirror/matchbrackets.js"></script>
- <script src="External/CodeMirror/closebrackets.js"></script>
- <script src="External/CodeMirror/runmode.js"></script>
- <script src="External/CodeMirror/searchcursor.js"></script>
- <script src="External/CodeMirror/placeholder.js"></script>
- <script src="External/CodeMirror/overlay.js"></script>
- <script src="External/CodeMirror/xml.js"></script>
</del><ins>+ <script src="External/CodeMirror/css.js"></script>
</ins><span class="cx"> <script src="External/CodeMirror/htmlmixed.js"></script>
</span><del>- <script src="External/CodeMirror/css.js"></script>
</del><span class="cx"> <script src="External/CodeMirror/javascript.js"></script>
</span><del>- <script src="External/CodeMirror/clojure.js"></script>
- <script src="External/CodeMirror/coffeescript.js"></script>
</del><ins>+ <script src="External/CodeMirror/less.js"></script>
</ins><span class="cx"> <script src="External/CodeMirror/livescript.js"></script>
</span><ins>+ <script src="External/CodeMirror/matchbrackets.js"></script>
+ <script src="External/CodeMirror/overlay.js"></script>
+ <script src="External/CodeMirror/placeholder.js"></script>
+ <script src="External/CodeMirror/runmode.js"></script>
</ins><span class="cx"> <script src="External/CodeMirror/sass.js"></script>
</span><del>- <script src="External/CodeMirror/less.js"></script>
</del><ins>+ <script src="External/CodeMirror/searchcursor.js"></script>
</ins><span class="cx"> <script src="External/CodeMirror/sql.js"></script>
</span><ins>+ <script src="External/CodeMirror/xml.js"></script>
</ins><span class="cx">
</span><del>- <script src="Utilities.js"></script>
- <script src="WebInspector.js"></script>
- <script src="URLUtilities.js"></script>
- <script src="MessageDispatcher.js"></script>
- <script src="Object.js"></script>
- <script src="DragToAdjustController.js"></script>
- <script src="CodeMirrorDragToAdjustNumberController.js"></script>
- <script src="CodeMirrorAdditions.js"></script>
- <script src="Setting.js"></script>
- <script src="InspectorBackend.js"></script>
- <script src="InspectorFrontendHostStub.js"></script>
- <script src="LoadInspectorBackendCommands.js"></script>
- <script src="InspectorFrontendAPI.js"></script>
- <script src="ContextMenu.js"></script>
- <script src="RemoteObject.js"></script>
- <script src="InspectorObserver.js"></script>
- <script src="PageObserver.js"></script>
- <script src="ConsoleObserver.js"></script>
- <script src="NetworkObserver.js"></script>
- <script src="CSSObserver.js"></script>
- <script src="DOMObserver.js"></script>
- <script src="DebuggerObserver.js"></script>
- <script src="DatabaseObserver.js"></script>
- <script src="LegacyProfilerObserver.js"></script>
- <script src="LayerTreeObserver.js"></script>
- <script src="RuntimeObserver.js"></script>
- <script src="EventListenerSet.js"></script>
- <script src="ImageUtilities.js"></script>
- <script src="DataGrid.js"></script>
- <script src="LegacyProfileDataGridTree.js"></script>
- <script src="LegacyBottomUpProfileDataGridTree.js"></script>
- <script src="LegacyTopDownProfileDataGridTree.js"></script>
- <script src="CookieStorageObject.js"></script>
- <script src="DatabaseObject.js"></script>
- <script src="DatabaseTableObject.js"></script>
- <script src="DOMStorageObject.js"></script>
- <script src="DOMStorageObserver.js"></script>
- <script src="IndexedDatabase.js"></script>
- <script src="IndexedDatabaseObjectStore.js"></script>
- <script src="IndexedDatabaseObjectStoreIndex.js"></script>
- <script src="StorageManager.js"></script>
- <script src="ApplicationCacheFrame.js"></script>
- <script src="ApplicationCacheManifest.js"></script>
- <script src="ApplicationCacheManager.js"></script>
- <script src="ApplicationCacheObserver.js"></script>
- <script src="TimelineObserver.js"></script>
- <script src="TimelineManager.js"></script>
- <script src="TimelineRecording.js"></script>
- <script src="Timeline.js"></script>
- <script src="NetworkTimeline.js"></script>
- <script src="SourceCodeTimeline.js"></script>
- <script src="TimelineRecord.js"></script>
- <script src="TimelineMarker.js"></script>
- <script src="ResourceTimelineRecord.js"></script>
- <script src="Profile.js"></script>
- <script src="ProfileNode.js"></script>
- <script src="ProfileNodeCall.js"></script>
- <script src="FrameResourceManager.js"></script>
- <script src="IssueManager.js"></script>
- <script src="RuntimeManager.js"></script>
- <script src="Frame.js"></script>
- <script src="SourceCode.js"></script>
- <script src="Resource.js"></script>
- <script src="ResourceCollection.js"></script>
- <script src="EditingSupport.js"></script>
- <script src="KeyboardShortcut.js"></script>
- <script src="NavigationBar.js"></script>
- <script src="NavigationItem.js"></script>
- <script src="FlexibleSpaceNavigationItem.js"></script>
- <script src="DividerNavigationItem.js"></script>
- <script src="ButtonNavigationItem.js"></script>
- <script src="RadioButtonNavigationItem.js"></script>
- <script src="ToggleButtonNavigationItem.js"></script>
- <script src="ActivateButtonNavigationItem.js"></script>
- <script src="HierarchicalPathNavigationItem.js"></script>
- <script src="HierarchicalPathComponent.js"></script>
- <script src="GeneralTreeElementPathComponent.js"></script>
- <script src="ScopeBarItem.js"></script>
- <script src="ScopeBar.js"></script>
- <script src="SearchBar.js"></script>
- <script src="FilterBar.js"></script>
- <script src="Sidebar.js"></script>
- <script src="SidebarPanel.js"></script>
- <script src="TreeOutline.js"></script>
- <script src="NavigationSidebarPanel.js"></script>
- <script src="DetailsSidebarPanel.js"></script>
- <script src="GeneralTreeElement.js"></script>
- <script src="SourceCodeTreeElement.js"></script>
- <script src="FolderTreeElement.js"></script>
- <script src="ResourceSidebarPanel.js"></script>
- <script src="ResourceDetailsSidebarPanel.js"></script>
- <script src="ResourceTreeElement.js"></script>
- <script src="SourceMapResourceTreeElement.js"></script>
- <script src="StorageTreeElement.js"></script>
- <script src="CookieStorageTreeElement.js"></script>
- <script src="DatabaseHostTreeElement.js"></script>
- <script src="DatabaseTreeElement.js"></script>
- <script src="DatabaseTableTreeElement.js"></script>
- <script src="DOMStorageTreeElement.js"></script>
- <script src="IndexedDatabaseHostTreeElement.js"></script>
- <script src="IndexedDatabaseTreeElement.js"></script>
- <script src="IndexedDatabaseObjectStoreTreeElement.js"></script>
- <script src="IndexedDatabaseObjectStoreIndexTreeElement.js"></script>
- <script src="ApplicationCacheFrameTreeElement.js"></script>
- <script src="ApplicationCacheManifestTreeElement.js"></script>
- <script src="TreeElementStatusButton.js"></script>
- <script src="IssueMessage.js"></script>
- <script src="ContentFlowTreeElement.js"></script>
- <script src="FrameTreeElement.js"></script>
- <script src="CSSCompletions.js"></script>
- <script src="CSSKeywordCompletions.js"></script>
- <script src="SyntaxHighlightingSupport.js"></script>
- <script src="Geometry.js"></script>
- <script src="UnitBezier.js"></script>
- <script src="Popover.js"></script>
- <script src="TextEditor.js"></script>
- <script src="EventHandler.js"></script>
- <script src="SourceCodeTextEditor.js"></script>
- <script src="BackForwardEntry.js"></script>
- <script src="ContentViewContainer.js"></script>
- <script src="ContentView.js"></script>
- <script src="ClusterContentView.js"></script>
- <script src="QuickConsoleNavigationBar.js"></script>
- <script src="QuickConsole.js"></script>
- <script src="ContentBrowser.js"></script>
- <script src="FrameContentView.js"></script>
- <script src="ResourceClusterContentView.js"></script>
- <script src="ResourceContentView.js"></script>
- <script src="GenericResourceContentView.js"></script>
- <script src="TextResourceContentView.js"></script>
- <script src="ImageResourceContentView.js"></script>
- <script src="FontResourceContentView.js"></script>
- <script src="DOMStorageContentView.js"></script>
- <script src="CookieStorageContentView.js"></script>
- <script src="DatabaseTableContentView.js"></script>
- <script src="DatabaseContentView.js"></script>
- <script src="IndexedDatabaseObjectStoreContentView.js"></script>
- <script src="IndexedDatabaseEntryDataGridNode.js"></script>
- <script src="ApplicationCacheFrameContentView.js"></script>
- <script src="TextContentView.js"></script>
- <script src="TimelineContentView.js"></script>
- <script src="TimelineView.js"></script>
- <script src="OverviewTimelineView.js"></script>
- <script src="NetworkTimelineView.js"></script>
- <script src="LayoutTimelineView.js"></script>
- <script src="ScriptTimelineView.js"></script>
- <script src="ApplicationCacheDetailsSidebarPanel.js"></script>
- <script src="DOMTreeManager.js"></script>
- <script src="DOMNode.js"></script>
- <script src="DOMUtilities.js"></script>
- <script src="ContentFlow.js"></script>
- <script src="DOMTree.js"></script>
- <script src="DOMTreeOutline.js"></script>
- <script src="DOMTreeUpdater.js"></script>
- <script src="DOMTreeElement.js"></script>
- <script src="DOMTreeElementPathComponent.js"></script>
- <script src="DOMTreeContentView.js"></script>
- <script src="FrameDOMTreeContentView.js"></script>
- <script src="LayerTreeManager.js"></script>
- <script src="DOMSearchMatchObject.js"></script>
- <script src="ResourceSearchMatchObject.js"></script>
- <script src="SearchResultTreeElement.js"></script>
- <script src="TextRange.js"></script>
- <script src="TextMarker.js"></script>
- <script src="ConsoleMessage.js"></script>
- <script src="ConsoleMessageImpl.js"></script>
- <script src="ConsoleGroup.js"></script>
- <script src="ConsoleCommand.js"></script>
- <script src="ConsoleCommandResult.js"></script>
- <script src="JavaScriptLogViewController.js"></script>
- <script src="LogContentView.js"></script>
- <script src="Section.js"></script>
- <script src="PropertiesSection.js"></script>
- <script src="ObjectPropertiesSection.js"></script>
- <script src="LogManager.js"></script>
- <script src="LogObject.js"></script>
- <script src="DetailsSection.js"></script>
- <script src="DetailsSectionGroup.js"></script>
- <script src="DetailsSectionRow.js"></script>
- <script src="DetailsSectionSimpleRow.js"></script>
- <script src="DetailsSectionDataGridRow.js"></script>
- <script src="DetailsSectionPropertiesRow.js"></script>
- <script src="DOMDetailsSidebarPanel.js"></script>
- <script src="EventListenerSectionGroup.js"></script>
- <script src="EventListenerSection.js"></script>
- <script src="DOMNodeDetailsSidebarPanel.js"></script>
- <script src="DOMTreeDataGrid.js"></script>
- <script src="DOMTreeDataGridNode.js"></script>
- <script src="LayerTreeDataGridNode.js"></script>
- <script src="LayerTreeDataGrid.js"></script>
- <script src="LayerTreeSidebarPanel.js"></script>
- <script src="LogTreeElement.js"></script>
- <script src="CSSStyleManager.js"></script>
- <script src="CSSStyleSheet.js"></script>
- <script src="CSSMedia.js"></script>
- <script src="CSSRule.js"></script>
- <script src="CSSStyleDeclaration.js"></script>
- <script src="CSSProperty.js"></script>
- <script src="DOMNodeStyles.js"></script>
- <script src="Color.js"></script>
- <script src="CSSStyleDetailsSidebarPanel.js"></script>
- <script src="BoxModelDetailsSectionRow.js"></script>
- <script src="StyleDetailsPanel.js"></script>
- <script src="ComputedStyleDetailsPanel.js"></script>
- <script src="RulesStyleDetailsPanel.js"></script>
- <script src="MetricsStyleDetailsPanel.js"></script>
- <script src="Slider.js"></script>
- <script src="ColorWheel.js"></script>
- <script src="ColorPicker.js"></script>
- <script src="CSSStyleDeclarationTextEditor.js"></script>
- <script src="CSSStyleDeclarationSection.js"></script>
- <script src="IndeterminateProgressSpinner.js"></script>
- <script src="TimelineSidebarPanel.js"></script>
- <script src="TimelineRecordTreeElement.js"></script>
- <script src="SourceCodeTimelineTreeElement.js"></script>
- <script src="TimelineRuler.js"></script>
- <script src="TimelineDataGrid.js"></script>
- <script src="LayoutTimelineDataGrid.js"></script>
- <script src="ScriptTimelineDataGrid.js"></script>
- <script src="TimelineRecordBar.js"></script>
- <script src="TimelineDataGridNode.js"></script>
- <script src="ResourceTimelineDataGridNode.js"></script>
- <script src="ResourceTimelineDataGridNodePathComponent.js"></script>
- <script src="LayoutTimelineRecord.js"></script>
- <script src="LayoutTimelineDataGridNode.js"></script>
- <script src="ScriptTimelineRecord.js"></script>
- <script src="ScriptTimelineDataGridNode.js"></script>
- <script src="SourceCodeTimelineTimelineDataGridNode.js"></script>
- <script src="ProfileNodeTreeElement.js"></script>
- <script src="ProfileNodeDataGridNode.js"></script>
- <script src="TreeOutlineDataGridSynchronizer.js"></script>
- <script src="TimelineOverview.js"></script>
- <script src="TimelineOverviewGraph.js"></script>
- <script src="NetworkTimelineOverviewGraph.js"></script>
- <script src="LayoutTimelineOverviewGraph.js"></script>
- <script src="ScriptTimelineOverviewGraph.js"></script>
- <script src="LegacyProfileManager.js"></script>
- <script src="LegacyProfileType.js"></script>
- <script src="LegacyProfileView.js"></script>
- <script src="LegacyJavaScriptProfileType.js"></script>
- <script src="LegacyJavaScriptProfileView.js"></script>
- <script src="LegacyProfileObject.js"></script>
- <script src="LegacyJavaScriptProfileObject.js"></script>
- <script src="DebuggerSidebarPanel.js"></script>
- <script src="BreakpointTreeElement.js"></script>
- <script src="BreakpointAction.js"></script>
- <script src="BreakpointActionView.js"></script>
- <script src="Breakpoint.js"></script>
- <script src="DebuggerManager.js"></script>
- <script src="ProbeManager.js"></script>
- <script src="Probe.js"></script>
- <script src="ProbeSet.js"></script>
- <script src="ProbeSetDataFrame.js"></script>
- <script src="ProbeSetDataTable.js"></script>
- <script src="ProbeSetDataGrid.js"></script>
- <script src="ProbeSetDataGridNode.js"></script>
- <script src="ProbeSetDetailsSection.js"></script>
- <script src="ProbeDetailsSidebarPanel.js"></script>
- <script src="SourceMapManager.js"></script>
- <script src="Script.js"></script>
- <script src="SourceMap.js"></script>
- <script src="SourceMapResource.js"></script>
- <script src="SourceCodePosition.js"></script>
- <script src="SourceCodeLocation.js"></script>
- <script src="SourceCodeTextRange.js"></script>
- <script src="CallFrame.js"></script>
- <script src="ScopeChainNode.js"></script>
- <script src="CallFrameTreeElement.js"></script>
- <script src="ScopeChainDetailsSidebarPanel.js"></script>
- <script src="ScopeVariableTreeElement.js"></script>
- <script src="ScriptContentView.js"></script>
- <script src="ScriptTreeElement.js"></script>
- <script src="FindBanner.js"></script>
- <script src="Toolbar.js"></script>
- <script src="ButtonToolbarItem.js"></script>
- <script src="ActivateButtonToolbarItem.js"></script>
- <script src="ControlToolbarItem.js"></script>
- <script src="ToggleControlToolbarItem.js"></script>
- <script src="Branch.js"></script>
- <script src="Revision.js"></script>
- <script src="SourceCodeRevision.js"></script>
- <script src="BranchManager.js"></script>
- <script src="DashboardView.js"></script>
- <script src="DashboardManager.js"></script>
- <script src="FormatterContentBuilder.js"></script>
- <script src="CodeMirrorFormatters.js"></script>
- <script src="Formatter.js"></script>
- <script src="FormatterSourceMap.js"></script>
- <script src="CodeMirrorCompletionController.js"></script>
- <script src="CodeMirrorTokenTrackingController.js"></script>
- <script src="JavaScriptRuntimeCompletionProvider.js"></script>
- <script src="CompletionSuggestionsView.js"></script>
- <script src="ExecutionContext.js"></script>
- <script src="ExecutionContextList.js"></script>
- <script src="ConsolePrompt.js"></script>
- <script src="MIMETypeUtilities.js"></script>
- <script src="LoadLocalizedStrings.js"></script>
- <script src="GoToLineDialog.js"></script>
- <script src="ContentFlowDOMTreeContentView.js"></script>
- <script src="HoverMenu.js"></script>
- <script src="CodeMirrorEditingController.js"></script>
- <script src="CodeMirrorColorEditingController.js"></script>
- <script src="Gradient.js"></script>
- <script src="GradientSlider.js"></script>
- <script src="Main.js"></script>
- <script src="CodeMirrorGradientEditingController.js"></script>
</del><ins>+ <script src="Base/WebInspector.js"></script>
+ <script src="Base/Object.js"></script>
</ins><span class="cx">
</span><ins>+ <script src="Base/DOMUtilities.js"></script>
+ <script src="Base/EventHandler.js"></script>
+ <script src="Base/EventListenerSet.js"></script>
+ <script src="Base/ImageUtilities.js"></script>
+ <script src="Base/LoadLocalizedStrings.js"></script>
+ <script src="Base/MIMETypeUtilities.js"></script>
+ <script src="Base/URLUtilities.js"></script>
+ <script src="Base/Utilities.js"></script>
+
+ <script src="Protocol/ApplicationCacheObserver.js"></script>
+ <script src="Protocol/CSSObserver.js"></script>
+ <script src="Protocol/ConsoleObserver.js"></script>
+ <script src="Protocol/DOMObserver.js"></script>
+ <script src="Protocol/DOMStorageObserver.js"></script>
+ <script src="Protocol/DatabaseObserver.js"></script>
+ <script src="Protocol/DebuggerObserver.js"></script>
+ <script src="Protocol/InspectorBackend.js"></script>
+ <script src="Protocol/InspectorFrontendAPI.js"></script>
+ <script src="Protocol/InspectorFrontendHostStub.js"></script>
+ <script src="Protocol/InspectorObserver.js"></script>
+ <script src="Protocol/LayerTreeObserver.js"></script>
+ <script src="Protocol/LegacyProfilerObserver.js"></script>
+ <script src="Protocol/LoadInspectorBackendCommands.js"></script>
+ <script src="Protocol/MessageDispatcher.js"></script>
+ <script src="Protocol/NetworkObserver.js"></script>
+ <script src="Protocol/PageObserver.js"></script>
+ <script src="Protocol/RemoteObject.js"></script>
+ <script src="Protocol/RuntimeObserver.js"></script>
+ <script src="Protocol/TimelineObserver.js"></script>
+
+ <script src="Models/BreakpointAction.js"></script>
+ <script src="Models/SourceCode.js"></script>
+ <script src="Models/Timeline.js"></script>
+ <script src="Models/TimelineRecord.js"></script>
+
+ <script src="Models/ApplicationCacheFrame.js"></script>
+ <script src="Models/ApplicationCacheManifest.js"></script>
+ <script src="Models/BackForwardEntry.js"></script>
+ <script src="Models/Branch.js"></script>
+ <script src="Models/Breakpoint.js"></script>
+ <script src="Models/CSSCompletions.js"></script>
+ <script src="Models/CSSKeywordCompletions.js"></script>
+ <script src="Models/CSSMedia.js"></script>
+ <script src="Models/CSSProperty.js"></script>
+ <script src="Models/CSSRule.js"></script>
+ <script src="Models/CSSStyleDeclaration.js"></script>
+ <script src="Models/CSSStyleSheet.js"></script>
+ <script src="Models/CallFrame.js"></script>
+ <script src="Models/Color.js"></script>
+ <script src="Models/ContentFlow.js"></script>
+ <script src="Models/CookieStorageObject.js"></script>
+ <script src="Models/DOMNode.js"></script>
+ <script src="Models/DOMNodeStyles.js"></script>
+ <script src="Models/DOMSearchMatchObject.js"></script>
+ <script src="Models/DOMStorageObject.js"></script>
+ <script src="Models/DOMTree.js"></script>
+ <script src="Models/DatabaseObject.js"></script>
+ <script src="Models/DatabaseTableObject.js"></script>
+ <script src="Models/ExecutionContext.js"></script>
+ <script src="Models/ExecutionContextList.js"></script>
+ <script src="Models/Frame.js"></script>
+ <script src="Models/Geometry.js"></script>
+ <script src="Models/Gradient.js"></script>
+ <script src="Models/IndexedDatabase.js"></script>
+ <script src="Models/IndexedDatabaseObjectStore.js"></script>
+ <script src="Models/IndexedDatabaseObjectStoreIndex.js"></script>
+ <script src="Models/IssueMessage.js"></script>
+ <script src="Models/KeyboardShortcut.js"></script>
+ <script src="Models/LayoutTimelineRecord.js"></script>
+ <script src="Models/LogObject.js"></script>
+ <script src="Models/NetworkTimeline.js"></script>
+ <script src="Models/Probe.js"></script>
+ <script src="Models/ProbeSet.js"></script>
+ <script src="Models/ProbeSetDataFrame.js"></script>
+ <script src="Models/ProbeSetDataTable.js"></script>
+ <script src="Models/Profile.js"></script>
+ <script src="Models/ProfileNode.js"></script>
+ <script src="Models/ProfileNodeCall.js"></script>
+ <script src="Models/Resource.js"></script>
+ <script src="Models/ResourceCollection.js"></script>
+ <script src="Models/ResourceSearchMatchObject.js"></script>
+ <script src="Models/ResourceTimelineRecord.js"></script>
+ <script src="Models/Revision.js"></script>
+ <script src="Models/ScopeChainNode.js"></script>
+ <script src="Models/Script.js"></script>
+ <script src="Models/ScriptTimelineRecord.js"></script>
+ <script src="Models/Setting.js"></script>
+ <script src="Models/SourceCodeLocation.js"></script>
+ <script src="Models/SourceCodePosition.js"></script>
+ <script src="Models/SourceCodeRevision.js"></script>
+ <script src="Models/SourceCodeTextRange.js"></script>
+ <script src="Models/SourceCodeTimeline.js"></script>
+ <script src="Models/SourceMap.js"></script>
+ <script src="Models/SourceMapResource.js"></script>
+ <script src="Models/TextMarker.js"></script>
+ <script src="Models/TextRange.js"></script>
+ <script src="Models/TimelineMarker.js"></script>
+ <script src="Models/TimelineRecording.js"></script>
+ <script src="Models/UnitBezier.js"></script>
+
+ <script src="Views/ConsoleMessage.js"></script>
+ <script src="Views/ContentView.js"></script>
+ <script src="Views/DataGrid.js"></script>
+ <script src="Views/DetailsSectionRow.js"></script>
+ <script src="Views/HierarchicalPathComponent.js"></script>
+ <script src="Views/LegacyProfileDataGridTree.js"></script>
+ <script src="Views/LegacyProfileObject.js"></script>
+ <script src="Views/LegacyProfileType.js"></script>
+ <script src="Views/LegacyProfileView.js"></script>
+ <script src="Views/NavigationItem.js"></script>
+ <script src="Views/Section.js"></script>
+ <script src="Views/SidebarPanel.js"></script>
+ <script src="Views/StyleDetailsPanel.js"></script>
+ <script src="Views/TextEditor.js"></script>
+ <script src="Views/TimelineOverviewGraph.js"></script>
+ <script src="Views/TimelineView.js"></script>
+ <script src="Views/TreeOutline.js"></script>
+
+ <script src="Views/ButtonNavigationItem.js"></script>
+ <script src="Views/ConsoleMessageImpl.js"></script>
+ <script src="Views/DOMTreeContentView.js"></script>
+ <script src="Views/DetailsSidebarPanel.js"></script>
+ <script src="Views/GeneralTreeElement.js"></script>
+ <script src="Views/NavigationSidebarPanel.js"></script>
+ <script src="Views/PropertiesSection.js"></script>
+ <script src="Views/ResourceContentView.js"></script>
+ <script src="Views/TimelineDataGrid.js"></script>
+ <script src="Views/TimelineDataGridNode.js"></script>
+
+ <script src="Views/DOMDetailsSidebarPanel.js"></script>
+ <script src="Views/SourceCodeTreeElement.js"></script>
+ <script src="Views/StorageTreeElement.js"></script>
+ <script src="Views/TimelineRecordTreeElement.js"></script>
+
+ <script src="Views/ResourceTreeElement.js"></script>
+
+ <script src="Views/ActivateButtonNavigationItem.js"></script>
+ <script src="Views/ActivateButtonToolbarItem.js"></script>
+ <script src="Views/ApplicationCacheDetailsSidebarPanel.js"></script>
+ <script src="Views/ApplicationCacheFrameContentView.js"></script>
+ <script src="Views/ApplicationCacheFrameTreeElement.js"></script>
+ <script src="Views/ApplicationCacheManifestTreeElement.js"></script>
+ <script src="Views/BoxModelDetailsSectionRow.js"></script>
+ <script src="Views/BreakpointActionView.js"></script>
+ <script src="Views/BreakpointTreeElement.js"></script>
+ <script src="Views/ButtonToolbarItem.js"></script>
+ <script src="Views/CSSStyleDeclarationSection.js"></script>
+ <script src="Views/CSSStyleDeclarationTextEditor.js"></script>
+ <script src="Views/CSSStyleDetailsSidebarPanel.js"></script>
+ <script src="Views/CallFrameTreeElement.js"></script>
+ <script src="Views/ClusterContentView.js"></script>
+ <script src="Views/CodeMirrorAdditions.js"></script>
+ <script src="Views/CodeMirrorFormatters.js"></script>
+ <script src="Views/ColorPicker.js"></script>
+ <script src="Views/ColorWheel.js"></script>
+ <script src="Views/CompletionSuggestionsView.js"></script>
+ <script src="Views/ComputedStyleDetailsPanel.js"></script>
+ <script src="Views/ConsoleCommand.js"></script>
+ <script src="Views/ConsoleCommandResult.js"></script>
+ <script src="Views/ConsoleGroup.js"></script>
+ <script src="Views/ConsolePrompt.js"></script>
+ <script src="Views/ContentBrowser.js"></script>
+ <script src="Views/ContentFlowDOMTreeContentView.js"></script>
+ <script src="Views/ContentFlowTreeElement.js"></script>
+ <script src="Views/ContentViewContainer.js"></script>
+ <script src="Views/ContextMenu.js"></script>
+ <script src="Views/ControlToolbarItem.js"></script>
+ <script src="Views/CookieStorageContentView.js"></script>
+ <script src="Views/CookieStorageTreeElement.js"></script>
+ <script src="Views/DOMNodeDetailsSidebarPanel.js"></script>
+ <script src="Views/DOMStorageContentView.js"></script>
+ <script src="Views/DOMStorageTreeElement.js"></script>
+ <script src="Views/DOMTreeDataGrid.js"></script>
+ <script src="Views/DOMTreeDataGridNode.js"></script>
+ <script src="Views/DOMTreeElement.js"></script>
+ <script src="Views/DOMTreeElementPathComponent.js"></script>
+ <script src="Views/DOMTreeOutline.js"></script>
+ <script src="Views/DOMTreeUpdater.js"></script>
+ <script src="Views/DashboardView.js"></script>
+ <script src="Views/DatabaseContentView.js"></script>
+ <script src="Views/DatabaseHostTreeElement.js"></script>
+ <script src="Views/DatabaseTableContentView.js"></script>
+ <script src="Views/DatabaseTableTreeElement.js"></script>
+ <script src="Views/DatabaseTreeElement.js"></script>
+ <script src="Views/DebuggerSidebarPanel.js"></script>
+ <script src="Views/DetailsSection.js"></script>
+ <script src="Views/DetailsSectionDataGridRow.js"></script>
+ <script src="Views/DetailsSectionGroup.js"></script>
+ <script src="Views/DetailsSectionPropertiesRow.js"></script>
+ <script src="Views/DetailsSectionSimpleRow.js"></script>
+ <script src="Views/DividerNavigationItem.js"></script>
+ <script src="Views/EditingSupport.js"></script>
+ <script src="Views/EventListenerSection.js"></script>
+ <script src="Views/EventListenerSectionGroup.js"></script>
+ <script src="Views/FilterBar.js"></script>
+ <script src="Views/FindBanner.js"></script>
+ <script src="Views/FlexibleSpaceNavigationItem.js"></script>
+ <script src="Views/FolderTreeElement.js"></script>
+ <script src="Views/FontResourceContentView.js"></script>
+ <script src="Views/FrameContentView.js"></script>
+ <script src="Views/FrameDOMTreeContentView.js"></script>
+ <script src="Views/FrameTreeElement.js"></script>
+ <script src="Views/GeneralTreeElementPathComponent.js"></script>
+ <script src="Views/GenericResourceContentView.js"></script>
+ <script src="Views/GoToLineDialog.js"></script>
+ <script src="Views/GradientSlider.js"></script>
+ <script src="Views/HierarchicalPathNavigationItem.js"></script>
+ <script src="Views/HoverMenu.js"></script>
+ <script src="Views/ImageResourceContentView.js"></script>
+ <script src="Views/IndeterminateProgressSpinner.js"></script>
+ <script src="Views/IndexedDatabaseEntryDataGridNode.js"></script>
+ <script src="Views/IndexedDatabaseHostTreeElement.js"></script>
+ <script src="Views/IndexedDatabaseObjectStoreContentView.js"></script>
+ <script src="Views/IndexedDatabaseObjectStoreIndexTreeElement.js"></script>
+ <script src="Views/IndexedDatabaseObjectStoreTreeElement.js"></script>
+ <script src="Views/IndexedDatabaseTreeElement.js"></script>
+ <script src="Views/LayerTreeDataGrid.js"></script>
+ <script src="Views/LayerTreeDataGridNode.js"></script>
+ <script src="Views/LayerTreeSidebarPanel.js"></script>
+ <script src="Views/LayoutTimelineDataGrid.js"></script>
+ <script src="Views/LayoutTimelineDataGridNode.js"></script>
+ <script src="Views/LayoutTimelineOverviewGraph.js"></script>
+ <script src="Views/LayoutTimelineView.js"></script>
+ <script src="Views/LegacyBottomUpProfileDataGridTree.js"></script>
+ <script src="Views/LegacyJavaScriptProfileObject.js"></script>
+ <script src="Views/LegacyJavaScriptProfileType.js"></script>
+ <script src="Views/LegacyJavaScriptProfileView.js"></script>
+ <script src="Views/LegacyTopDownProfileDataGridTree.js"></script>
+ <script src="Views/LogContentView.js"></script>
+ <script src="Views/LogTreeElement.js"></script>
+ <script src="Views/MetricsStyleDetailsPanel.js"></script>
+ <script src="Views/NavigationBar.js"></script>
+ <script src="Views/NetworkTimelineOverviewGraph.js"></script>
+ <script src="Views/NetworkTimelineView.js"></script>
+ <script src="Views/ObjectPropertiesSection.js"></script>
+ <script src="Views/OverviewTimelineView.js"></script>
+ <script src="Views/Popover.js"></script>
+ <script src="Views/ProbeDetailsSidebarPanel.js"></script>
+ <script src="Views/ProbeSetDataGrid.js"></script>
+ <script src="Views/ProbeSetDataGridNode.js"></script>
+ <script src="Views/ProbeSetDetailsSection.js"></script>
+ <script src="Views/ProfileNodeDataGridNode.js"></script>
+ <script src="Views/ProfileNodeTreeElement.js"></script>
+ <script src="Views/QuickConsole.js"></script>
+ <script src="Views/QuickConsoleNavigationBar.js"></script>
+ <script src="Views/RadioButtonNavigationItem.js"></script>
+ <script src="Views/ResourceClusterContentView.js"></script>
+ <script src="Views/ResourceDetailsSidebarPanel.js"></script>
+ <script src="Views/ResourceSidebarPanel.js"></script>
+ <script src="Views/ResourceTimelineDataGridNode.js"></script>
+ <script src="Views/ResourceTimelineDataGridNodePathComponent.js"></script>
+ <script src="Views/RulesStyleDetailsPanel.js"></script>
+ <script src="Views/ScopeBar.js"></script>
+ <script src="Views/ScopeBarItem.js"></script>
+ <script src="Views/ScopeChainDetailsSidebarPanel.js"></script>
+ <script src="Views/ScopeVariableTreeElement.js"></script>
+ <script src="Views/ScriptContentView.js"></script>
+ <script src="Views/ScriptTimelineDataGrid.js"></script>
+ <script src="Views/ScriptTimelineDataGridNode.js"></script>
+ <script src="Views/ScriptTimelineOverviewGraph.js"></script>
+ <script src="Views/ScriptTimelineView.js"></script>
+ <script src="Views/ScriptTreeElement.js"></script>
+ <script src="Views/SearchBar.js"></script>
+ <script src="Views/SearchResultTreeElement.js"></script>
+ <script src="Views/Sidebar.js"></script>
+ <script src="Views/Slider.js"></script>
+ <script src="Views/SourceCodeTextEditor.js"></script>
+ <script src="Views/SourceCodeTimelineTimelineDataGridNode.js"></script>
+ <script src="Views/SourceCodeTimelineTreeElement.js"></script>
+ <script src="Views/SourceMapResourceTreeElement.js"></script>
+ <script src="Views/SyntaxHighlightingSupport.js"></script>
+ <script src="Views/TextContentView.js"></script>
+ <script src="Views/TextResourceContentView.js"></script>
+ <script src="Views/TimelineContentView.js"></script>
+ <script src="Views/TimelineOverview.js"></script>
+ <script src="Views/TimelineRecordBar.js"></script>
+ <script src="Views/TimelineRuler.js"></script>
+ <script src="Views/TimelineSidebarPanel.js"></script>
+ <script src="Views/ToggleButtonNavigationItem.js"></script>
+ <script src="Views/ToggleControlToolbarItem.js"></script>
+ <script src="Views/Toolbar.js"></script>
+ <script src="Views/TreeElementStatusButton.js"></script>
+ <script src="Views/TreeOutlineDataGridSynchronizer.js"></script>
+
+ <script src="Controllers/CodeMirrorEditingController.js"></script>
+
+ <script src="Controllers/ApplicationCacheManager.js"></script>
+ <script src="Controllers/BranchManager.js"></script>
+ <script src="Controllers/CSSStyleManager.js"></script>
+ <script src="Controllers/CodeMirrorColorEditingController.js"></script>
+ <script src="Controllers/CodeMirrorCompletionController.js"></script>
+ <script src="Controllers/CodeMirrorDragToAdjustNumberController.js"></script>
+ <script src="Controllers/CodeMirrorGradientEditingController.js"></script>
+ <script src="Controllers/CodeMirrorTokenTrackingController.js"></script>
+ <script src="Controllers/DOMTreeManager.js"></script>
+ <script src="Controllers/DashboardManager.js"></script>
+ <script src="Controllers/DebuggerManager.js"></script>
+ <script src="Controllers/DragToAdjustController.js"></script>
+ <script src="Controllers/Formatter.js"></script>
+ <script src="Controllers/FormatterContentBuilder.js"></script>
+ <script src="Controllers/FormatterSourceMap.js"></script>
+ <script src="Controllers/FrameResourceManager.js"></script>
+ <script src="Controllers/IssueManager.js"></script>
+ <script src="Controllers/JavaScriptLogViewController.js"></script>
+ <script src="Controllers/JavaScriptRuntimeCompletionProvider.js"></script>
+ <script src="Controllers/LayerTreeManager.js"></script>
+ <script src="Controllers/LegacyProfileManager.js"></script>
+ <script src="Controllers/LogManager.js"></script>
+ <script src="Controllers/ProbeManager.js"></script>
+ <script src="Controllers/RuntimeManager.js"></script>
+ <script src="Controllers/SourceMapManager.js"></script>
+ <script src="Controllers/StorageManager.js"></script>
+ <script src="Controllers/TimelineManager.js"></script>
+
+ <script src="Base/Main.js"></script>
+
</ins><span class="cx"> <script>
</span><span class="cx"> WebInspector.loaded();
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Main.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1826 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Notification = {
- GlobalModifierKeysDidChange: "global-modifiers-did-change",
- PageArchiveStarted: "page-archive-started",
- PageArchiveEnded: "page-archive-ended"
-};
-
-WebInspector.ContentViewCookieType = {
- ApplicationCache: "application-cache",
- CookieStorage: "cookie-storage",
- Database: "database",
- DatabaseTable: "database-table",
- DOMStorage: "dom-storage",
- Resource: "resource", // includes Frame too.
- Timelines: "timelines",
-};
-
-WebInspector.DebuggableType = {
- Web: "web",
- JavaScript: "javascript"
-};
-
-WebInspector.SelectedSidebarPanelCookieKey = "selected-sidebar-panel";
-WebInspector.TypeIdentifierCookieKey = "represented-object-type";
-
-WebInspector.loaded = function()
-{
- // Tell the InspectorFrontendHost we loaded first to establish communication with InspectorBackend.
- InspectorFrontendHost.loaded();
-
- // Initialize WebSocket to communication
- this._initializeWebSocketIfNeeded();
-
- // Register observers for events from the InspectorBackend.
- if (InspectorBackend.registerInspectorDispatcher)
- InspectorBackend.registerInspectorDispatcher(new WebInspector.InspectorObserver);
- if (InspectorBackend.registerPageDispatcher)
- InspectorBackend.registerPageDispatcher(new WebInspector.PageObserver);
- if (InspectorBackend.registerConsoleDispatcher)
- InspectorBackend.registerConsoleDispatcher(new WebInspector.ConsoleObserver);
- if (InspectorBackend.registerNetworkDispatcher)
- InspectorBackend.registerNetworkDispatcher(new WebInspector.NetworkObserver);
- if (InspectorBackend.registerDOMDispatcher)
- InspectorBackend.registerDOMDispatcher(new WebInspector.DOMObserver);
- if (InspectorBackend.registerDebuggerDispatcher)
- InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerObserver);
- if (InspectorBackend.registerDatabaseDispatcher)
- InspectorBackend.registerDatabaseDispatcher(new WebInspector.DatabaseObserver);
- if (InspectorBackend.registerDOMStorageDispatcher)
- InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageObserver);
- if (InspectorBackend.registerApplicationCacheDispatcher)
- InspectorBackend.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheObserver);
- if (InspectorBackend.registerTimelineDispatcher)
- InspectorBackend.registerTimelineDispatcher(new WebInspector.TimelineObserver);
- if (InspectorBackend.registerProfilerDispatcher)
- InspectorBackend.registerProfilerDispatcher(new WebInspector.LegacyProfilerObserver);
- if (InspectorBackend.registerCSSDispatcher)
- InspectorBackend.registerCSSDispatcher(new WebInspector.CSSObserver);
- if (InspectorBackend.registerLayerTreeDispatcher)
- InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeObserver);
- if (InspectorBackend.registerRuntimeDispatcher)
- InspectorBackend.registerRuntimeDispatcher(new WebInspector.RuntimeObserver);
-
- // Enable agents.
- if (window.InspectorAgent)
- InspectorAgent.enable();
-
- // Perform one-time tasks.
- WebInspector.CSSCompletions.requestCSSNameCompletions();
- this._generateDisclosureTriangleImages();
-
- // Listen for the ProvisionalLoadStarted event before registering for events so our code gets called before any managers or sidebars.
- // This lets us save a state cookie before any managers or sidebars do any resets that would affect state (namely TimelineManager).
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._provisionalLoadStarted, this);
-
- // Create the singleton managers next, before the user interface elements, so the user interface can register
- // as event listeners on these managers.
- this.branchManager = new WebInspector.BranchManager;
- this.frameResourceManager = new WebInspector.FrameResourceManager;
- this.storageManager = new WebInspector.StorageManager;
- this.domTreeManager = new WebInspector.DOMTreeManager;
- this.cssStyleManager = new WebInspector.CSSStyleManager;
- this.logManager = new WebInspector.LogManager;
- this.issueManager = new WebInspector.IssueManager;
- this.runtimeManager = new WebInspector.RuntimeManager;
- this.applicationCacheManager = new WebInspector.ApplicationCacheManager;
- this.timelineManager = new WebInspector.TimelineManager;
- this.legacyProfileManager = new WebInspector.LegacyProfileManager;
- this.debuggerManager = new WebInspector.DebuggerManager;
- this.sourceMapManager = new WebInspector.SourceMapManager;
- this.layerTreeManager = new WebInspector.LayerTreeManager;
- this.dashboardManager = new WebInspector.DashboardManager;
- this.probeManager = new WebInspector.ProbeManager;
-
- // Enable the Console Agent after creating the singleton managers.
- if (window.ConsoleAgent)
- ConsoleAgent.enable();
-
- // Register for events.
- this.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
- this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.InspectModeStateChanged, this._inspectModeStateChanged, this);
- this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
- this.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
- document.addEventListener("DOMContentLoaded", this.contentLoaded.bind(this));
-
- document.addEventListener("beforecopy", this._beforecopy.bind(this));
- document.addEventListener("copy", this._copy.bind(this));
-
- document.addEventListener("click", this._mouseWasClicked.bind(this));
- document.addEventListener("dragover", this._dragOver.bind(this));
- document.addEventListener("focus", WebInspector._focusChanged.bind(this), true);
-
- window.addEventListener("focus", this._windowFocused.bind(this));
- window.addEventListener("blur", this._windowBlurred.bind(this));
- window.addEventListener("resize", this._windowResized.bind(this));
- window.addEventListener("keydown", this._windowKeyDown.bind(this));
- window.addEventListener("keyup", this._windowKeyUp.bind(this));
- window.addEventListener("mousemove", this._mouseMoved.bind(this), true);
- window.addEventListener("pagehide", this._pageHidden.bind(this));
-
- // Create settings.
- this._lastInspectorViewStateCookieSetting = new WebInspector.Setting("last-content-view-state-cookie", {});
-
- this._navigationSidebarCollapsedSetting = new WebInspector.Setting("navigation-sidebar-collapsed", false);
- this._navigationSidebarWidthSetting = new WebInspector.Setting("navigation-sidebar-width", null);
-
- this._lastSelectedDetailsSidebarPanelSetting = new WebInspector.Setting("last-selected-details-sidebar-panel", null);
- this._detailsSidebarCollapsedSetting = new WebInspector.Setting("details-sidebar-collapsed", true);
- this._detailsSidebarWidthSetting = new WebInspector.Setting("details-sidebar-width", null);
-
- this._toolbarDockedRightDisplayModeSetting = new WebInspector.Setting("toolbar-docked-right-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
- this._toolbarDockedRightSizeModeSetting = new WebInspector.Setting("toolbar-docked-right-size-mode",WebInspector.Toolbar.SizeMode.Normal);
-
- this._toolbarDockedBottomDisplayModeSetting = new WebInspector.Setting("toolbar-docked-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
- this._toolbarDockedBottomSizeModeSetting = new WebInspector.Setting("toolbar-docked-size-mode",WebInspector.Toolbar.SizeMode.Small);
-
- this._toolbarUndockedDisplayModeSetting = new WebInspector.Setting("toolbar-undocked-display-mode", WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
- this._toolbarUndockedSizeModeSetting = new WebInspector.Setting("toolbar-undocked-size-mode",WebInspector.Toolbar.SizeMode.Normal);
-
- this._showingSplitConsoleSetting = new WebInspector.Setting("showing-split-console", false);
- this._splitConsoleHeightSetting = new WebInspector.Setting("split-console-height", 150);
-
- this._dockButtonToggledSetting = new WebInspector.Setting("dock-button-toggled", false);
-
- this.showShadowDOMSetting = new WebInspector.Setting("show-shadow-dom", false);
-
- this.mouseCoords = {
- x: 0,
- y: 0
- };
-
- this._windowKeydownListeners = [];
-}
-
-WebInspector.contentLoaded = function()
-{
- // Check for a nightly build by looking for a plus in the version number and a small number of stylesheets (indicating combined resources).
- var versionMatch = / AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);
- if (versionMatch && versionMatch[1].indexOf("+") !== -1 && document.styleSheets.length < 10)
- document.body.classList.add("nightly-build");
-
- this.debuggableType = InspectorFrontendHost.debuggableType() === "web" ? WebInspector.DebuggableType.Web : WebInspector.DebuggableType.JavaScript;
- document.body.classList.add(this.debuggableType);
-
- // Create the user interface elements.
- this.toolbar = new WebInspector.Toolbar(document.getElementById("toolbar"));
- this.toolbar.addEventListener(WebInspector.Toolbar.Event.DisplayModeDidChange, this._toolbarDisplayModeDidChange, this);
- this.toolbar.addEventListener(WebInspector.Toolbar.Event.SizeModeDidChange, this._toolbarSizeModeDidChange, this);
-
- var contentElement = document.getElementById("content");
- contentElement.setAttribute("role", "main");
- contentElement.setAttribute("aria-label", WebInspector.UIString("Content"));
-
- this.contentBrowser = new WebInspector.ContentBrowser(document.getElementById("content-browser"), this);
- this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this._contentBrowserRepresentedObjectsDidChange, this);
- this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
-
- this.splitContentBrowser = new WebInspector.ContentBrowser(document.getElementById("split-content-browser"), this, true);
- this.splitContentBrowser.navigationBar.element.addEventListener("mousedown", this._consoleResizerMouseDown.bind(this));
-
- this.quickConsole = new WebInspector.QuickConsole(document.getElementById("quick-console"));
- this.quickConsole.addEventListener(WebInspector.QuickConsole.Event.DidResize, this._quickConsoleDidResize, this);
-
- this._consoleRepresentedObject = new WebInspector.LogObject;
- this._consoleTreeElement = new WebInspector.LogTreeElement(this._consoleRepresentedObject);
- this.consoleContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(this._consoleRepresentedObject);
-
- // FIXME: The sidebars should be flipped in RTL languages.
- this.leftSidebar = this.navigationSidebar = new WebInspector.Sidebar(document.getElementById("navigation-sidebar"), WebInspector.Sidebar.Sides.Left);
- this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._sidebarCollapsedStateDidChange, this);
- this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
- this.navigationSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected, this._navigationSidebarPanelSelected, this);
-
- this.rightSidebar = this.detailsSidebar = new WebInspector.Sidebar(document.getElementById("details-sidebar"), WebInspector.Sidebar.Sides.Right, null, null, WebInspector.UIString("Details"));
- this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.CollapsedStateDidChange, this._sidebarCollapsedStateDidChange, this);
- this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.WidthDidChange, this._sidebarWidthDidChange, this);
- this.detailsSidebar.addEventListener(WebInspector.Sidebar.Event.SidebarPanelSelected, this._detailsSidebarPanelSelected, this);
-
- this._reloadPageKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "R", this._reloadPage.bind(this));
- this._reloadPageIgnoringCacheKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "R", this._reloadPageIgnoringCache.bind(this));
-
- this._consoleKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Option | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "C", this.toggleConsoleView.bind(this));
-
- this._inspectModeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "C", this._toggleInspectMode.bind(this));
-
- this._undoKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "Z", this._undoKeyboardShortcut.bind(this));
- this._redoKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "Z", this._redoKeyboardShortcut.bind(this));
- this._undoKeyboardShortcut.implicitlyPreventsDefault = this._redoKeyboardShortcut.implicitlyPreventsDefault = false;
-
- this.undockButtonNavigationItem = new WebInspector.ToggleControlToolbarItem("undock", WebInspector.UIString("Detach into separate window"), "", "Images/Undock.svg", "", 16, 14);
- this.undockButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._undock, this);
-
- this.closeButtonNavigationItem = new WebInspector.ControlToolbarItem("dock-close", WebInspector.UIString("Close"), "Images/Close.svg", 16, 14);
- this.closeButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.close, this);
-
- this.toolbar.addToolbarItem(this.closeButtonNavigationItem, WebInspector.Toolbar.Section.Control);
- this.toolbar.addToolbarItem(this.undockButtonNavigationItem, WebInspector.Toolbar.Section.Control);
-
- this.resourceSidebarPanel = new WebInspector.ResourceSidebarPanel;
- this.timelineSidebarPanel = new WebInspector.TimelineSidebarPanel;
- this.debuggerSidebarPanel = new WebInspector.DebuggerSidebarPanel;
-
- this.navigationSidebar.addSidebarPanel(this.resourceSidebarPanel);
- // FIXME: Enable timelines panel for JavaScript inspection.
- if (this.debuggableType !== WebInspector.DebuggableType.JavaScript)
- this.navigationSidebar.addSidebarPanel(this.timelineSidebarPanel);
- this.navigationSidebar.addSidebarPanel(this.debuggerSidebarPanel);
-
- this.toolbar.addToolbarItem(this.resourceSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
- // FIXME: Enable timelines panel for JavaScript inspection.
- if (this.debuggableType !== WebInspector.DebuggableType.JavaScript)
- this.toolbar.addToolbarItem(this.timelineSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
- this.toolbar.addToolbarItem(this.debuggerSidebarPanel.toolbarItem, WebInspector.Toolbar.Section.Left);
-
- // The toolbar button for the console.
- var toolTip = WebInspector.UIString("Show console (%s)").format(WebInspector._consoleKeyboardShortcut.displayName);
- var activatedToolTip = WebInspector.UIString("Hide console (%s)").format(WebInspector._consoleKeyboardShortcut.displayName);
- this._consoleToolbarButton = new WebInspector.ActivateButtonToolbarItem("console", toolTip, activatedToolTip, WebInspector.UIString("Console"), "Images/NavigationItemLog.svg");
- this._consoleToolbarButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleConsoleView, this);
- this.toolbar.addToolbarItem(this._consoleToolbarButton, WebInspector.Toolbar.Section.Center);
-
- this.toolbar.addToolbarItem(this.dashboardManager.toolbarItem, WebInspector.Toolbar.Section.Center);
-
- // The toolbar button for node inspection.
- if (this.debuggableType === WebInspector.DebuggableType.Web) {
- var toolTip = WebInspector.UIString("Enable point to inspect mode (%s)").format(WebInspector._inspectModeKeyboardShortcut.displayName);
- var activatedToolTip = WebInspector.UIString("Disable point to inspect mode (%s)").format(WebInspector._inspectModeKeyboardShortcut.displayName);
- this._inspectModeToolbarButton = new WebInspector.ActivateButtonToolbarItem("inspect", toolTip, activatedToolTip, WebInspector.UIString("Inspect"), "Images/Crosshair.svg");
- this._inspectModeToolbarButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleInspectMode, this);
- this.toolbar.addToolbarItem(this._inspectModeToolbarButton, WebInspector.Toolbar.Section.Center);
- }
-
- this.resourceDetailsSidebarPanel = new WebInspector.ResourceDetailsSidebarPanel;
- this.domNodeDetailsSidebarPanel = new WebInspector.DOMNodeDetailsSidebarPanel;
- this.cssStyleDetailsSidebarPanel = new WebInspector.CSSStyleDetailsSidebarPanel;
- this.applicationCacheDetailsSidebarPanel = new WebInspector.ApplicationCacheDetailsSidebarPanel;
- this.scopeChainDetailsSidebarPanel = new WebInspector.ScopeChainDetailsSidebarPanel;
- this.probeDetailsSidebarPanel = new WebInspector.ProbeDetailsSidebarPanel;
-
- this.detailsSidebarPanels = [this.resourceDetailsSidebarPanel, this.applicationCacheDetailsSidebarPanel, this.scopeChainDetailsSidebarPanel,
- this.domNodeDetailsSidebarPanel, this.cssStyleDetailsSidebarPanel, this.probeDetailsSidebarPanel];
-
- if (window.LayerTreeAgent) {
- this.layerTreeSidebarPanel = new WebInspector.LayerTreeSidebarPanel;
- this.detailsSidebarPanels.splice(this.detailsSidebarPanels.length - 1, 0, this.layerTreeSidebarPanel);
- }
-
- this.modifierKeys = {altKey: false, metaKey: false, shiftKey: false};
-
- // Add the items in reverse order since the last items appear and disappear the least. So they
- // will not cause the other buttons to visually shift around, keeping things more stable.
- for (var i = this.detailsSidebarPanels.length - 1; i >= 0; --i) {
- var toolbarItem = this.detailsSidebarPanels[i].toolbarItem;
- toolbarItem.hidden = true;
- this.toolbar.addToolbarItem(toolbarItem, WebInspector.Toolbar.Section.Right);
- }
-
- this.toolbar.element.addEventListener("mousedown", this._toolbarMouseDown.bind(this));
- document.getElementById("docked-resizer").addEventListener("mousedown", this._dockedResizerMouseDown.bind(this));
-
- this._updateToolbarHeight();
-
- if (this._navigationSidebarWidthSetting.value)
- this.navigationSidebar.width = this._navigationSidebarWidthSetting.value;
-
- if (this._detailsSidebarWidthSetting.value)
- this.detailsSidebar.width = this._detailsSidebarWidthSetting.value;
-
- // Update the docked state based on the query string passed when the Web Inspector was loaded.
- this.updateDockedState(parseLocationQueryParameters().dockSide || "undocked");
-
- // Tell the frontend API we are loaded so any pending frontend commands can be dispatched.
- InspectorFrontendAPI.loadCompleted();
-
- // Set collapsed after loading the pending frontend commands are dispatched so only the final
- // selected sidebar panel gets shown and has a say in what content view gets shown.
- this.navigationSidebar.collapsed = this._navigationSidebarCollapsedSetting.value;
-
- // If InspectorFrontendAPI didn't show a content view, then try to restore the last saved view state.
- if (!this.contentBrowser.currentContentView && !this.ignoreLastContentCookie)
- this._restoreInspectorViewStateFromCookie(this._lastInspectorViewStateCookieSetting.value);
-
- this._updateSplitConsoleHeight(this._splitConsoleHeightSetting.value);
-
- if (this._showingSplitConsoleSetting.value)
- this.showSplitConsole();
-}
-
-WebInspector.sidebarPanelForCurrentContentView = function()
-{
- var currentContentView = this.contentBrowser.currentContentView;
- if (!currentContentView)
- return null;
- return this.sidebarPanelForRepresentedObject(currentContentView.representedObject);
-}
-
-WebInspector.sidebarPanelForRepresentedObject = function(representedObject)
-{
- if (representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource ||
- representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.ContentFlow)
- return this.resourceSidebarPanel;
-
- if (representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
- representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
- representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
- representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
- return this.resourceSidebarPanel;
-
- if (representedObject instanceof WebInspector.TimelineRecording)
- return this.timelineSidebarPanel;
-
- // The console does not have a sidebar.
- if (representedObject instanceof WebInspector.LogObject)
- return null;
-
- console.error("Unknown representedObject: ", representedObject);
- return null;
-}
-
-WebInspector.contentBrowserTreeElementForRepresentedObject = function(contentBrowser, representedObject)
-{
- // The console does not have a sidebar, so return a tree element here so something is shown.
- if (representedObject instanceof WebInspector.LogObject)
- return this._consoleTreeElement;
-
- var sidebarPanel = this.sidebarPanelForRepresentedObject(representedObject);
- if (sidebarPanel)
- return sidebarPanel.treeElementForRepresentedObject(representedObject);
- return null;
-}
-
-WebInspector.updateWindowTitle = function()
-{
- var mainFrame = this.frameResourceManager.mainFrame;
- console.assert(mainFrame);
-
- var urlComponents = mainFrame.mainResource.urlComponents;
-
- var lastPathComponent;
- try {
- lastPathComponent = decodeURIComponent(urlComponents.lastPathComponent || "");
- } catch (e) {
- lastPathComponent = urlComponents.lastPathComponent;
- }
-
- // Build a title based on the URL components.
- if (urlComponents.host && lastPathComponent)
- var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + lastPathComponent;
- else if (urlComponents.host)
- var title = this.displayNameForHost(urlComponents.host);
- else if (lastPathComponent)
- var title = lastPathComponent;
- else
- var title = mainFrame.url;
-
- // The name "inspectedURLChanged" sounds like the whole URL is required, however this is only
- // used for updating the window title and it can be any string.
- InspectorFrontendHost.inspectedURLChanged(title);
-}
-
-WebInspector.updateDockedState = function(side)
-{
- if (this._dockSide === side)
- return;
-
- this._dockSide = side;
-
- this.docked = side !== "undocked";
-
- this._ignoreToolbarModeDidChangeEvents = true;
-
- if (side === "bottom") {
- document.body.classList.add("docked");
- document.body.classList.add("bottom");
-
- document.body.classList.remove("window-inactive");
- document.body.classList.remove("right");
-
- this.toolbar.displayMode = this._toolbarDockedBottomDisplayModeSetting.value;
- this.toolbar.sizeMode = this._toolbarDockedBottomSizeModeSetting.value;
- } else if (side === "right") {
- document.body.classList.add("docked");
- document.body.classList.add("right");
-
- document.body.classList.remove("window-inactive");
- document.body.classList.remove("bottom");
-
- this.toolbar.displayMode = this._toolbarDockedRightDisplayModeSetting.value;
- this.toolbar.sizeMode = this._toolbarDockedRightSizeModeSetting.value;
- } else {
- document.body.classList.remove("docked");
- document.body.classList.remove("right");
- document.body.classList.remove("bottom");
-
- this.toolbar.displayMode = this._toolbarUndockedDisplayModeSetting.value;
- this.toolbar.sizeMode = this._toolbarUndockedSizeModeSetting.value;
- }
-
- this._ignoreToolbarModeDidChangeEvents = false;
-
- this._updateDockNavigationItems();
- this._updateToolbarHeight();
-}
-
-WebInspector.handlePossibleLinkClick = function(event, frame, alwaysOpenExternally)
-{
- var anchorElement = event.target.enclosingNodeOrSelfWithNodeName("a");
- if (!anchorElement || !anchorElement.href)
- return false;
-
- if (WebInspector.isBeingEdited(anchorElement)) {
- // Don't follow the link when it is being edited.
- return false;
- }
-
- // Prevent the link from navigating, since we don't do any navigation by following links normally.
- event.preventDefault();
- event.stopPropagation();
-
- this.openURL(anchorElement.href, frame, false, anchorElement.lineNumber);
-
- return true;
-}
-
-WebInspector.openURL = function(url, frame, alwaysOpenExternally, lineNumber)
-{
- console.assert(url);
- if (!url)
- return;
-
- // If alwaysOpenExternally is not defined, base it off the command/meta key for the current event.
- if (alwaysOpenExternally === undefined || alwaysOpenExternally === null)
- alwaysOpenExternally = window.event ? window.event.metaKey : false;
-
- if (alwaysOpenExternally) {
- InspectorFrontendHost.openInNewTab(url);
- return;
- }
-
- var parsedURL = parseURL(url);
- if (parsedURL.scheme === WebInspector.LegacyProfileType.ProfileScheme) {
- var profileType = parsedURL.host.toUpperCase();
- var profileTitle = parsedURL.path;
-
- // The path of of the profile URL starts with a slash, remove it, so
- // we can get the actual title.
- console.assert(profileTitle[0] === '/');
- profileTitle = profileTitle.substring(1);
-
- this.timelineSidebarPanel.showProfile(profileType, profileTitle);
- return;
- }
-
- var searchChildFrames = false;
- if (!frame) {
- frame = this.frameResourceManager.mainFrame;
- searchChildFrames = true;
- }
-
- console.assert(frame);
-
- // WebInspector.Frame.resourceForURL does not check the main resource, only sub-resources. So check both.
- var resource = frame.url === url ? frame.mainResource : frame.resourceForURL(url, searchChildFrames);
- if (resource) {
- var position = new WebInspector.SourceCodePosition(lineNumber, 0);
- this.resourceSidebarPanel.showSourceCode(resource, position);
- return;
- }
-
- InspectorFrontendHost.openInNewTab(url);
-}
-
-WebInspector.close = function()
-{
- if (this._isClosing)
- return;
-
- this._isClosing = true;
-
- InspectorFrontendHost.closeWindow();
-}
-
-WebInspector.isConsoleFocused = function()
-{
- return this.quickConsole.prompt.focused;
-}
-
-WebInspector.isShowingSplitConsole = function()
-{
- return !this.splitContentBrowser.element.classList.contains("hidden");
-}
-
-WebInspector.currentViewSupportsSplitContentBrowser = function()
-{
- var currentContentView = this.contentBrowser.currentContentView;
- return !currentContentView || currentContentView.supportsSplitContentBrowser;
-}
-
-WebInspector.toggleSplitConsole = function()
-{
- if (!this.currentViewSupportsSplitContentBrowser()) {
- this.toggleConsoleView();
- return;
- }
-
- if (this.isShowingSplitConsole())
- this.hideSplitConsole();
- else
- this.showSplitConsole();
-}
-
-WebInspector.showSplitConsole = function()
-{
- if (!this.currentViewSupportsSplitContentBrowser()) {
- this.showFullHeightConsole();
- return;
- }
-
- this.splitContentBrowser.element.classList.remove("hidden");
-
- this._showingSplitConsoleSetting.value = true;
-
- if (this.splitContentBrowser.currentContentView !== this.consoleContentView) {
- // Be sure to close any existing log view in the main content browser before showing it in the
- // split content browser. We can only show a content view in one browser at a time.
- this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
- this.splitContentBrowser.showContentView(this.consoleContentView);
- } else {
- // This causes the view to know it was shown and focus the prompt.
- this.splitContentBrowser.contentViewContainer.shown();
- }
-
- if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
- this.navigationSidebar.collapsed = false;
-
- this.quickConsole.consoleLogVisibilityChanged(true);
-}
-
-WebInspector.hideSplitConsole = function()
-{
- this.splitContentBrowser.element.classList.add("hidden");
-
- this._showingSplitConsoleSetting.value = false;
-
- // This causes the view to know it was hidden.
- this.splitContentBrowser.contentViewContainer.hidden();
-
- this.quickConsole.consoleLogVisibilityChanged(false);
-}
-
-WebInspector.showFullHeightConsole = function(scope)
-{
- this.splitContentBrowser.element.classList.add("hidden");
-
- this._showingSplitConsoleSetting.value = false;
-
- scope = scope || WebInspector.LogContentView.Scopes.All;
-
- // If the requested scope is already selected and the console is showing, then switch back to All.
- if (this.isShowingConsoleView() && this.consoleContentView.scopeBar.item(scope).selected)
- scope = WebInspector.LogContentView.Scopes.All;
-
- this.consoleContentView.scopeBar.item(scope).selected = true;
-
- if (this.contentBrowser.currentContentView !== this.consoleContentView) {
- this._wasShowingNavigationSidebarBeforeFullHeightConsole = !this.navigationSidebar.collapsed;
-
- // Collapse the sidebar before showing the console view, so the check for the collapsed state in
- // _revealAndSelectRepresentedObjectInNavigationSidebar returns early and does not deselect any
- // tree elements in the current sidebar.
- this.navigationSidebar.collapsed = true;
-
- // Be sure to close any existing log view in the split content browser before showing it in the
- // main content browser. We can only show a content view in one browser at a time.
- this.splitContentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.LogContentView);
- this.contentBrowser.showContentView(this.consoleContentView);
- }
-
- console.assert(this.isShowingConsoleView());
- console.assert(this._consoleToolbarButton.activated);
-
- this.quickConsole.consoleLogVisibilityChanged(true);
-}
-
-WebInspector.isShowingConsoleView = function()
-{
- return this.contentBrowser.currentContentView instanceof WebInspector.LogContentView;
-}
-
-WebInspector.showConsoleView = function(scope)
-{
- this.showFullHeightConsole(scope);
-}
-
-WebInspector.toggleConsoleView = function()
-{
- if (this.isShowingConsoleView()) {
- if (this.contentBrowser.canGoBack())
- this.contentBrowser.goBack();
- else
- this.resourceSidebarPanel.showMainFrameSourceCode();
-
- if (this._wasShowingNavigationSidebarBeforeFullHeightConsole)
- this.navigationSidebar.collapsed = false;
- } else
- this.showFullHeightConsole();
-}
-
-WebInspector.UIString = function(string, vararg)
-{
- if (WebInspector.dontLocalizeUserInterface)
- return string;
-
- if (window.localizedStrings && string in window.localizedStrings)
- return window.localizedStrings[string];
-
- if (!this._missingLocalizedStrings)
- this._missingLocalizedStrings = {};
-
- if (!(string in this._missingLocalizedStrings)) {
- console.error("Localized string \"" + string + "\" was not found.");
- this._missingLocalizedStrings[string] = true;
- }
-
- return "LOCALIZED STRING NOT FOUND";
-}
-
-WebInspector.restoreFocusFromElement = function(element)
-{
- if (element && element.isSelfOrAncestor(this.currentFocusElement))
- this.previousFocusElement.focus();
-}
-
-WebInspector._focusChanged = function(event)
-{
- // Make a caret selection inside the focused element if there isn't a range selection and there isn't already
- // a caret selection inside. This is needed (at least) to remove caret from console when focus is moved.
- // The selection change should not apply to text fields and text areas either.
-
- if (WebInspector.isEventTargetAnEditableField(event))
- return;
-
- var selection = window.getSelection();
- if (!selection.isCollapsed)
- return;
-
- var element = event.target;
-
- if (element !== this.currentFocusElement) {
- this.previousFocusElement = this.currentFocusElement;
- this.currentFocusElement = element;
- }
-
- if (element.isInsertionCaretInside())
- return;
-
- var selectionRange = element.ownerDocument.createRange();
- selectionRange.setStart(element, 0);
- selectionRange.setEnd(element, 0);
-
- selection.removeAllRanges();
- selection.addRange(selectionRange);
-}
-
-WebInspector._mouseWasClicked = function(event)
-{
- this.handlePossibleLinkClick(event);
-}
-
-WebInspector._dragOver = function(event)
-{
- // Do nothing if another event listener handled the event already.
- if (event.defaultPrevented)
- return;
-
- // Allow dropping into editable areas.
- if (WebInspector.isEventTargetAnEditableField(event))
- return;
-
- // Prevent the drop from being accepted.
- event.dataTransfer.dropEffect = "none";
- event.preventDefault();
-}
-
-WebInspector._debuggerDidPause = function(event)
-{
- this.debuggerSidebarPanel.show();
-
- // Since the Scope Chain details sidebar panel might not be in the sidebar yet,
- // set a flag to select and show it when it does become available.
- this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable = true;
-
- InspectorFrontendHost.bringToFront();
-}
-
-WebInspector._mainFrameDidChange = function(event)
-{
- this.updateWindowTitle();
-}
-
-WebInspector._mainResourceDidChange = function(event)
-{
- if (!event.target.isMainFrame())
- return;
-
- this._restoreInspectorViewStateFromCookie(this._lastInspectorViewStateCookieSetting.value, true);
-
- this.updateWindowTitle();
-}
-
-WebInspector._provisionalLoadStarted = function(event)
-{
- if (!event.target.isMainFrame())
- return;
-
- this._updateCookieForInspectorViewState();
-}
-
-WebInspector._windowFocused = function(event)
-{
- if (event.target.document.nodeType !== Node.DOCUMENT_NODE || this.docked)
- return;
-
- // FIXME: We should use the :window-inactive pseudo class once https://webkit.org/b/38927 is fixed.
- document.body.classList.remove("window-inactive");
-}
-
-WebInspector._windowBlurred = function(event)
-{
- if (event.target.document.nodeType !== Node.DOCUMENT_NODE || this.docked)
- return;
-
- // FIXME: We should use the :window-inactive pseudo class once https://webkit.org/b/38927 is fixed.
- document.body.classList.add("window-inactive");
-}
-
-WebInspector._windowResized = function(event)
-{
- this.toolbar.updateLayout();
-
- this._contentBrowserSizeDidChange(event);
-}
-
-WebInspector._updateModifierKeys = function(event)
-{
- var didChange = this.modifierKeys.altKey !== event.altKey || this.modifierKeys.metaKey !== event.metaKey || this.modifierKeys.shiftKey !== event.shiftKey;
-
- this.modifierKeys = {altKey: event.altKey, metaKey: event.metaKey, shiftKey: event.shiftKey};
-
- if (didChange)
- this.notifications.dispatchEventToListeners(WebInspector.Notification.GlobalModifierKeysDidChange, event);
-}
-
-WebInspector._windowKeyDown = function(event)
-{
- this._updateModifierKeys(event);
-
- var opposite = !this._dockButtonToggledSetting.value;
- this.undockButtonNavigationItem.toggled = (event.altKey && !event.metaKey && !event.shiftKey) ? opposite : !opposite;
-}
-
-WebInspector._windowKeyUp = function(event)
-{
- this._updateModifierKeys(event);
-
- var opposite = !this._dockButtonToggledSetting.value;
- this.undockButtonNavigationItem.toggled = (event.altKey && !event.metaKey && !event.shiftKey) ? opposite : !opposite;
-}
-
-WebInspector._mouseMoved = function(event)
-{
- this._updateModifierKeys(event);
- this.mouseCoords = {
- x: event.pageX,
- y: event.pageY
- };
-}
-
-WebInspector._pageHidden = function(event)
-{
- this._updateCookieForInspectorViewState();
-}
-
-WebInspector._undock = function(event)
-{
- this._dockButtonToggledSetting.value = this.undockButtonNavigationItem.toggled;
-
- if (this.undockButtonNavigationItem.toggled)
- InspectorFrontendHost.requestSetDockSide(this._dockSide === "bottom" ? "right" : "bottom");
- else
- InspectorFrontendHost.requestSetDockSide("undocked");
-}
-
-WebInspector._updateDockNavigationItems = function()
-{
- // The close and undock buttons are only available when docked.
- var docked = this.docked;
- this.closeButtonNavigationItem.hidden = !docked;
- this.undockButtonNavigationItem.hidden = !docked;
-
- if (docked) {
- this.undockButtonNavigationItem.alternateImage = this._dockSide === "bottom" ? "Images/DockRight.svg" : "Images/DockBottom.svg";
- this.undockButtonNavigationItem.alternateToolTip = this._dockSide === "bottom" ? WebInspector.UIString("Dock to right of window") : WebInspector.UIString("Dock to bottom of window");
- }
-
- this.undockButtonNavigationItem.toggled = this._dockButtonToggledSetting.value;
-}
-
-WebInspector._sidebarCollapsedStateDidChange = function(event)
-{
- if (event.target === this.navigationSidebar) {
- this._navigationSidebarCollapsedSetting.value = this.navigationSidebar.collapsed;
- this._updateNavigationSidebarForCurrentContentView();
- } else if (event.target === this.detailsSidebar) {
- if (!this._ignoreDetailsSidebarPanelCollapsedEvent)
- this._detailsSidebarCollapsedSetting.value = this.detailsSidebar.collapsed;
- }
-}
-
-WebInspector._detailsSidebarPanelSelected = function(event)
-{
- if (!this.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
- return;
-
- this._lastSelectedDetailsSidebarPanelSetting.value = this.detailsSidebar.selectedSidebarPanel.identifier;
-}
-
-WebInspector._revealAndSelectRepresentedObjectInNavigationSidebar = function(representedObject)
-{
- if (this.navigationSidebar.collapsed)
- return;
-
- var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
- if (!selectedSidebarPanel)
- return;
-
- // If the tree outline is processing a selection currently then we can assume the selection does not
- // need to be changed. This is needed to allow breakpoints tree elements to be selected without jumping
- // back to selecting the resource tree element.
- if (selectedSidebarPanel.contentTreeOutline.processingSelectionChange)
- return;
-
- var treeElement = selectedSidebarPanel.treeElementForRepresentedObject(representedObject);
- if (treeElement)
- treeElement.revealAndSelect(true, false, true, true);
- else if (selectedSidebarPanel.contentTreeOutline.selectedTreeElement)
- selectedSidebarPanel.contentTreeOutline.selectedTreeElement.deselect(true);
-
- if (!selectedSidebarPanel.contentTreeOutline.selectedTreeElement)
- selectedSidebarPanel.showDefaultContentView();
-}
-
-WebInspector._updateNavigationSidebarForCurrentContentView = function()
-{
- if (this.navigationSidebar.collapsed)
- return;
-
- var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
- if (!selectedSidebarPanel)
- return;
-
- var currentContentView = this.contentBrowser.currentContentView;
- if (!currentContentView)
- return;
-
- // Ensure the navigation sidebar panel is allowed by the current content view, if not ask the sidebar panel
- // to show the content view for the current selection.
- var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
- if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier)) {
- selectedSidebarPanel.showContentViewForCurrentSelection();
-
- // Fetch the current content view again, since it likely changed.
- currentContentView = this.contentBrowser.currentContentView;
- }
-
- if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanel.identifier))
- currentContentView.__lastNavigationSidebarPanelIdentifer = selectedSidebarPanel.identifier;
-
- this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
-}
-
-WebInspector._navigationSidebarPanelSelected = function(event)
-{
- var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
- if (!selectedSidebarPanel)
- return;
-
- this._updateNavigationSidebarForCurrentContentView();
-}
-
-WebInspector._domNodeWasInspected = function(event)
-{
- WebInspector.domTreeManager.highlightDOMNodeForTwoSeconds(event.data.node.id);
-
- // Select the Style details sidebar panel if one of the DOM details sidebar panels isn't already selected.
- if (!(this.detailsSidebar.selectedSidebarPanel instanceof WebInspector.DOMDetailsSidebarPanel))
- this.detailsSidebar.selectedSidebarPanel = this.cssStyleDetailsSidebarPanel;
-
- InspectorFrontendHost.bringToFront();
-}
-
-WebInspector._contentBrowserSizeDidChange = function(event)
-{
- this.contentBrowser.updateLayout();
- this.splitContentBrowser.updateLayout();
- this.quickConsole.updateLayout();
-}
-
-WebInspector._quickConsoleDidResize = function(event)
-{
- this.contentBrowser.updateLayout();
-}
-
-WebInspector._sidebarWidthDidChange = function(event)
-{
- if (!event.target.collapsed) {
- if (event.target === this.navigationSidebar)
- this._navigationSidebarWidthSetting.value = this.navigationSidebar.width;
- else if (event.target === this.detailsSidebar)
- this._detailsSidebarWidthSetting.value = this.detailsSidebar.width;
- }
-
- this._contentBrowserSizeDidChange(event);
-}
-
-WebInspector._updateToolbarHeight = function()
-{
- InspectorFrontendHost.setToolbarHeight(this.toolbar.element.offsetHeight);
-}
-
-WebInspector._toolbarDisplayModeDidChange = function(event)
-{
- if (this._ignoreToolbarModeDidChangeEvents)
- return;
-
- if (this._dockSide === "bottom")
- this._toolbarDockedBottomDisplayModeSetting.value = this.toolbar.displayMode;
- else if (this._dockSide === "right")
- this._toolbarDockedRightDisplayModeSetting.value = this.toolbar.displayMode;
- else
- this._toolbarUndockedDisplayModeSetting.value = this.toolbar.displayMode;
-
- this._updateToolbarHeight();
-}
-
-WebInspector._toolbarSizeModeDidChange = function(event)
-{
- if (this._ignoreToolbarModeDidChangeEvents)
- return;
-
- if (this._dockSide === "bottom")
- this._toolbarDockedBottomSizeModeSetting.value = this.toolbar.sizeMode;
- else if (this._dockSide === "right")
- this._toolbarDockedRightSizeModeSetting.value = this.toolbar.sizeMode;
- else
- this._toolbarUndockedSizeModeSetting.value = this.toolbar.sizeMode;
-
- this._updateToolbarHeight();
-}
-
-WebInspector._updateCookieForInspectorViewState = function()
-{
- var cookie = {};
- var currentContentView = this.contentBrowser.currentContentView;
-
- // The console does not have a sidebar, so create a cookie here.
- if (currentContentView && currentContentView.representedObject instanceof WebInspector.LogObject) {
- cookie[WebInspector.SelectedSidebarPanelCookieKey] = "console";
- this._lastInspectorViewStateCookieSetting.value = cookie;
- return;
- }
-
- var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
- if (!selectedSidebarPanel)
- return;
-
- // Restoring view state after inspector re-open or page reload is delegated to navigation sidebars.
- // This is because some navigation sidebar state (such as breakpoint selections) cannot be inferred
- // solely based on which content view is visible, or multiple navigation sidebars could be shown.
- cookie[WebInspector.SelectedSidebarPanelCookieKey] = selectedSidebarPanel.identifier;
- selectedSidebarPanel.saveStateToCookie(cookie);
- this._lastInspectorViewStateCookieSetting.value = cookie;
-}
-
-WebInspector._contentBrowserCurrentContentViewDidChange = function(event)
-{
- var consoleViewShowing = this.isShowingConsoleView();
- this._consoleToolbarButton.activated = consoleViewShowing;
-
- if (!this.isShowingSplitConsole())
- this.quickConsole.consoleLogVisibilityChanged(consoleViewShowing);
-
- if (!this.currentViewSupportsSplitContentBrowser())
- this.hideSplitConsole();
-
- var currentContentView = this.contentBrowser.currentContentView;
- if (!currentContentView)
- return;
-
- var selectedSidebarPanel = this.navigationSidebar.selectedSidebarPanel;
- if (!selectedSidebarPanel)
- return;
-
- // Ensure the navigation sidebar panel is allowed by the current content view, if not change the navigation sidebar panel
- // to the last navigation sidebar panel used with the content view or the first one allowed.
- var selectedSidebarPanelIdentifier = selectedSidebarPanel.identifier;
-
- var allowedNavigationSidebarPanels = currentContentView.allowedNavigationSidebarPanels;
- if (allowedNavigationSidebarPanels.length && !allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier)) {
- console.assert(!currentContentView.__lastNavigationSidebarPanelIdentifer || allowedNavigationSidebarPanels.contains(currentContentView.__lastNavigationSidebarPanelIdentifer));
- this.navigationSidebar.selectedSidebarPanel = currentContentView.__lastNavigationSidebarPanelIdentifer || allowedNavigationSidebarPanels[0];
- }
-
- if (!allowedNavigationSidebarPanels.length || allowedNavigationSidebarPanels.contains(selectedSidebarPanelIdentifier))
- currentContentView.__lastNavigationSidebarPanelIdentifer = selectedSidebarPanelIdentifier;
-
- this._revealAndSelectRepresentedObjectInNavigationSidebar(currentContentView.representedObject);
-}
-
-WebInspector._contentBrowserRepresentedObjectsDidChange = function(event)
-{
- var currentRepresentedObjects = this.contentBrowser.currentRepresentedObjects;
- var currentSidebarPanels = this.detailsSidebar.sidebarPanels;
- var wasSidebarEmpty = !currentSidebarPanels.length;
-
- // Ignore any changes to the selected sidebar panel during this function so only user initiated
- // changes are recorded in _lastSelectedDetailsSidebarPanelSetting.
- this._ignoreDetailsSidebarPanelSelectedEvent = true;
-
- for (var i = 0; i < this.detailsSidebarPanels.length; ++i) {
- var sidebarPanel = this.detailsSidebarPanels[i];
- if (sidebarPanel.inspect(currentRepresentedObjects)) {
- var currentSidebarPanelIndex = currentSidebarPanels.indexOf(sidebarPanel);
- if (currentSidebarPanelIndex !== -1) {
- // Already showing the panel.
- continue;
- }
-
- // The sidebar panel was not previously showing, so add the panel and show the toolbar item.
- this.detailsSidebar.addSidebarPanel(sidebarPanel);
- sidebarPanel.toolbarItem.hidden = false;
-
- if (this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable && sidebarPanel === this.scopeChainDetailsSidebarPanel) {
- // Select the scope chain sidebar panel since it needs to be shown after pausing in the debugger.
- delete this._selectAndShowScopeChainDetailsSidebarPanelWhenAvailable;
- this.detailsSidebar.selectedSidebarPanel = this.scopeChainDetailsSidebarPanel;
-
- this._ignoreDetailsSidebarPanelCollapsedEvent = true;
- this.detailsSidebar.collapsed = false;
- delete this._ignoreDetailsSidebarPanelCollapsedEvent;
- } else if (this._lastSelectedDetailsSidebarPanelSetting.value === sidebarPanel.identifier) {
- // Restore the sidebar panel selection if this sidebar panel was the last one selected by the user.
- this.detailsSidebar.selectedSidebarPanel = sidebarPanel;
- }
- } else {
- // The sidebar panel can't inspect the current represented objects, so remove the panel and hide the toolbar item.
- this.detailsSidebar.removeSidebarPanel(sidebarPanel);
- sidebarPanel.toolbarItem.hidden = true;
- }
- }
-
- if (!this.detailsSidebar.selectedSidebarPanel && currentSidebarPanels.length)
- this.detailsSidebar.selectedSidebarPanel = currentSidebarPanels[0];
-
- this._ignoreDetailsSidebarPanelCollapsedEvent = true;
-
- if (!this.detailsSidebar.sidebarPanels.length)
- this.detailsSidebar.collapsed = true;
- else if (wasSidebarEmpty)
- this.detailsSidebar.collapsed = this._detailsSidebarCollapsedSetting.value;
-
- delete this._ignoreDetailsSidebarPanelCollapsedEvent;
-
- // Stop ignoring the sidebar panel selected event.
- delete this._ignoreDetailsSidebarPanelSelectedEvent;
-}
-
-WebInspector._restoreInspectorViewStateFromCookie = function(cookie, causedByReload)
-{
- if (!cookie)
- return;
-
- // The console does not have a sidebar, so handle its special cookie here.
- if (cookie[WebInspector.SelectedSidebarPanelCookieKey] === "console") {
- this.showFullHeightConsole();
- return;
- }
-
- const matchTypeOnlyDelayForReload = 2000;
- const matchTypeOnlyDelayForReopen = 1000;
- var sidebarPanelIdentifier = cookie[WebInspector.SelectedSidebarPanelCookieKey];
- var sidebarPanel = WebInspector.navigationSidebar.findSidebarPanel(sidebarPanelIdentifier);
- if (!sidebarPanel)
- return;
-
- WebInspector.navigationSidebar.selectedSidebarPanel = sidebarPanel;
-
- var relaxMatchDelay = causedByReload ? matchTypeOnlyDelayForReload : matchTypeOnlyDelayForReopen;
- sidebarPanel.restoreStateFromCookie(cookie, relaxMatchDelay);
-}
-
-WebInspector._initializeWebSocketIfNeeded = function()
-{
- if (!InspectorFrontendHost.initializeWebSocket)
- return;
-
- var queryParams = parseLocationQueryParameters();
-
- if ("ws" in queryParams)
- var url = "ws://" + queryParams.ws;
- else if ("page" in queryParams) {
- var page = queryParams.page;
- var host = "host" in queryParams ? queryParams.host : window.location.host;
- var url = "ws://" + host + "/devtools/page/" + page;
- }
-
- if (!url)
- return;
-
- InspectorFrontendHost.initializeWebSocket(url);
-}
-
-WebInspector._updateSplitConsoleHeight = function(height)
-{
- const minimumHeight = 64;
- const maximumHeight = window.innerHeight * 0.55;
-
- height = Math.max(minimumHeight, Math.min(height, maximumHeight));
-
- this.splitContentBrowser.element.style.height = height + "px";
-}
-
-WebInspector._consoleResizerMouseDown = function(event)
-{
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- // Only start dragging if the target is one of the elements that we expect.
- if (!event.target.classList.contains("navigation-bar") && !event.target.classList.contains("flexible-space"))
- return;
-
- var resizerElement = event.target;
- var mouseOffset = resizerElement.offsetHeight - (event.pageY - resizerElement.totalOffsetTop);
-
- function dockedResizerDrag(event)
- {
- if (event.button !== 0)
- return;
-
- var height = window.innerHeight - event.pageY - mouseOffset;
-
- this._splitConsoleHeightSetting.value = height;
-
- this._updateSplitConsoleHeight(height);
- }
-
- function dockedResizerDragEnd(event)
- {
- if (event.button !== 0)
- return;
-
- this.elementDragEnd(event);
- }
-
- this.elementDragStart(resizerElement, dockedResizerDrag.bind(this), dockedResizerDragEnd.bind(this), event, "row-resize");
-}
-
-WebInspector._toolbarMouseDown = function(event)
-{
- if (event.ctrlKey)
- return;
-
- if (this._dockSide === "right")
- return;
-
- if (this.docked)
- this._dockedResizerMouseDown(event);
- else
- this._moveWindowMouseDown(event);
-}
-
-WebInspector._dockedResizerMouseDown = function(event)
-{
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- if (!this.docked)
- return;
-
- // Only start dragging if the target is one of the elements that we expect.
- if (event.target.id !== "docked-resizer" && !event.target.classList.contains("toolbar") &&
- !event.target.classList.contains("flexible-space") && !event.target.classList.contains("item-section"))
- return;
-
- var windowProperty = this._dockSide === "bottom" ? "innerHeight" : "innerWidth";
- var eventProperty = this._dockSide === "bottom" ? "screenY" : "screenX";
-
- var resizerElement = event.target;
- var lastScreenPosition = event[eventProperty];
-
- function dockedResizerDrag(event)
- {
- if (event.button !== 0)
- return;
-
- var position = event[eventProperty];
- var dimension = window[windowProperty] - (position - lastScreenPosition);
-
- if (this._dockSide === "bottom")
- InspectorFrontendHost.setAttachedWindowHeight(dimension);
- else
- InspectorFrontendHost.setAttachedWindowWidth(dimension);
-
- lastScreenPosition = position;
- }
-
- function dockedResizerDragEnd(event)
- {
- if (event.button !== 0)
- return;
-
- WebInspector.elementDragEnd(event);
- }
-
- WebInspector.elementDragStart(resizerElement, dockedResizerDrag.bind(this), dockedResizerDragEnd.bind(this), event, this._dockSide === "bottom" ? "row-resize" : "col-resize");
-}
-
-WebInspector._moveWindowMouseDown = function(event)
-{
- console.assert(!this.docked);
-
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- // Only start dragging if the target is one of the elements that we expect.
- if (!event.target.classList.contains("toolbar") && !event.target.classList.contains("flexible-space") &&
- !event.target.classList.contains("item-section"))
- return;
-
- var lastScreenX = event.screenX;
- var lastScreenY = event.screenY;
-
- function toolbarDrag(event)
- {
- if (event.button !== 0)
- return;
-
- var x = event.screenX - lastScreenX;
- var y = event.screenY - lastScreenY;
-
- InspectorFrontendHost.moveWindowBy(x, y);
-
- lastScreenX = event.screenX;
- lastScreenY = event.screenY;
- }
-
- function toolbarDragEnd(event)
- {
- if (event.button !== 0)
- return;
-
- WebInspector.elementDragEnd(event);
- }
-
- WebInspector.elementDragStart(event.target, toolbarDrag, toolbarDragEnd, event, "default");
-}
-
-WebInspector._inspectModeStateChanged = function(event)
-{
- this._inspectModeToolbarButton.activated = WebInspector.domTreeManager.inspectModeEnabled;
-}
-
-WebInspector._toggleInspectMode = function(event)
-{
- WebInspector.domTreeManager.inspectModeEnabled = !WebInspector.domTreeManager.inspectModeEnabled;
-}
-
-WebInspector._reloadPage = function(event)
-{
- PageAgent.reload();
-}
-
-WebInspector._reloadPageIgnoringCache = function(event)
-{
- PageAgent.reload(true);
-}
-
-WebInspector._toggleInspectMode = function(event)
-{
- this.domTreeManager.inspectModeEnabled = !this.domTreeManager.inspectModeEnabled;
-}
-
-WebInspector._focusedContentView = function()
-{
- if (this.contentBrowser.element.isSelfOrAncestor(this.currentFocusElement))
- return this.contentBrowser.currentContentView;
- if (this.splitContentBrowser.element.isSelfOrAncestor(this.currentFocusElement))
- return this.splitContentBrowser.currentContentView;
- return null;
-}
-
-WebInspector._beforecopy = function(event)
-{
- var selection = window.getSelection();
-
- // If there is no selection, see if the focused element or focused ContentView can handle the copy event.
- if (selection.isCollapsed && !WebInspector.isEventTargetAnEditableField(event)) {
- var focusedCopyHandler = this.currentFocusElement && this.currentFocusElement.copyHandler;
- if (focusedCopyHandler && typeof focusedCopyHandler.handleBeforeCopyEvent === "function") {
- focusedCopyHandler.handleBeforeCopyEvent(event);
- if (event.defaultPrevented)
- return;
- }
-
- var focusedContentView = this._focusedContentView();
- if (focusedContentView && typeof focusedContentView.handleCopyEvent === "function") {
- event.preventDefault();
- return;
- }
-
- return;
- }
-
- if (selection.isCollapsed)
- return;
-
- // Say we can handle it (by preventing default) to remove word break characters.
- event.preventDefault();
-}
-
-WebInspector._copy = function(event)
-{
- var selection = window.getSelection();
-
- // If there is no selection, pass the copy event on to the focused element or focused ContentView.
- if (selection.isCollapsed && !WebInspector.isEventTargetAnEditableField(event)) {
- var focusedCopyHandler = this.currentFocusElement && this.currentFocusElement.copyHandler;
- if (focusedCopyHandler && typeof focusedCopyHandler.handleCopyEvent === "function") {
- focusedCopyHandler.handleCopyEvent(event);
- if (event.defaultPrevented)
- return;
- }
-
- var focusedContentView = this._focusedContentView();
- if (focusedContentView && typeof focusedContentView.handleCopyEvent === "function") {
- focusedContentView.handleCopyEvent(event);
- return;
- }
-
- return;
- }
-
- if (selection.isCollapsed)
- return;
-
- // Remove word break characters from the selection before putting it on the pasteboard.
- var selectionString = selection.toString().removeWordBreakCharacters();
- event.clipboardData.setData("text/plain", selectionString);
- event.preventDefault();
-}
-
-WebInspector._generateDisclosureTriangleImages = function()
-{
- var specifications = {};
- specifications["normal"] = {fillColor: [0, 0, 0, 0.5]};
- specifications["normal-active"] = {fillColor: [0, 0, 0, 0.7]};
-
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, "disclosure-triangle-small-open-");
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, "disclosure-triangle-small-closed-");
-
- specifications["selected"] = {fillColor: [255, 255, 255, 0.8]};
-
- generateColoredImagesForCSS("Images/DisclosureTriangleTinyOpen.svg", specifications, 8, 8, "disclosure-triangle-tiny-open-");
- generateColoredImagesForCSS("Images/DisclosureTriangleTinyClosed.svg", specifications, 8, 8, "disclosure-triangle-tiny-closed-");
-}
-
-WebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor, eventTarget)
-{
- if (WebInspector._elementDraggingEventListener || WebInspector._elementEndDraggingEventListener)
- WebInspector.elementDragEnd(event);
-
- if (element) {
- // Install glass pane
- if (WebInspector._elementDraggingGlassPane)
- WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
-
- var glassPane = document.createElement("div");
- glassPane.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;z-index:1";
- glassPane.id = "glass-pane-for-drag";
- element.ownerDocument.body.appendChild(glassPane);
- WebInspector._elementDraggingGlassPane = glassPane;
- }
-
- WebInspector._elementDraggingEventListener = dividerDrag;
- WebInspector._elementEndDraggingEventListener = elementDragEnd;
-
- var targetDocument = event.target.ownerDocument;
-
- WebInspector._elementDraggingEventTarget = eventTarget || targetDocument;
- WebInspector._elementDraggingEventTarget.addEventListener("mousemove", dividerDrag, true);
- WebInspector._elementDraggingEventTarget.addEventListener("mouseup", elementDragEnd, true);
-
- targetDocument.body.style.cursor = cursor;
-
- event.preventDefault();
-}
-
-WebInspector.elementDragEnd = function(event)
-{
- WebInspector._elementDraggingEventTarget.removeEventListener("mousemove", WebInspector._elementDraggingEventListener, true);
- WebInspector._elementDraggingEventTarget.removeEventListener("mouseup", WebInspector._elementEndDraggingEventListener, true);
-
- event.target.ownerDocument.body.style.removeProperty("cursor");
-
- if (WebInspector._elementDraggingGlassPane)
- WebInspector._elementDraggingGlassPane.parentElement.removeChild(WebInspector._elementDraggingGlassPane);
-
- delete WebInspector._elementDraggingGlassPane;
- delete WebInspector._elementDraggingEventTarget;
- delete WebInspector._elementDraggingEventListener;
- delete WebInspector._elementEndDraggingEventListener;
-
- event.preventDefault();
-}
-
-WebInspector.createMessageTextView = function(message, isError)
-{
- var messageElement = document.createElement("div");
- messageElement.className = "message-text-view";
- if (isError)
- messageElement.classList.add("error");
-
- messageElement.textContent = message;
-
- return messageElement;
-}
-
-WebInspector.createGoToArrowButton = function()
-{
- if (!WebInspector._generatedGoToArrowButtonImages) {
- WebInspector._generatedGoToArrowButtonImages = true;
-
- var specifications = {};
- specifications["go-to-arrow-normal"] = {fillColor: [0, 0, 0, 0.5]};
- specifications["go-to-arrow-normal-active"] = {fillColor: [0, 0, 0, 0.7]};
- specifications["go-to-arrow-selected"] = {fillColor: [255, 255, 255, 0.8]};
- specifications["go-to-arrow-selected-active"] = {fillColor: [255, 255, 255, 1]};
-
- generateColoredImagesForCSS("Images/GoToArrow.svg", specifications, 10, 10);
- }
-
- function stopPropagation(event)
- {
- event.stopPropagation()
- }
-
- var button = document.createElement("button");
- button.addEventListener("mousedown", stopPropagation, true);
- button.className = "go-to-arrow";
- button.tabIndex = -1;
- return button;
-}
-
-WebInspector.createSourceCodeLocationLink = function(sourceCodeLocation, dontFloat, useGoToArrowButton)
-{
- console.assert(sourceCodeLocation);
- if (!sourceCodeLocation)
- return null;
-
- function showSourceCodeLocation(event)
- {
- event.stopPropagation();
- event.preventDefault();
-
- if (event.metaKey)
- this.resourceSidebarPanel.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation);
- else
- this.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
- }
-
- var linkElement = document.createElement("a");
- linkElement.className = "go-to-link";
- linkElement.addEventListener("click", showSourceCodeLocation.bind(this));
- sourceCodeLocation.populateLiveDisplayLocationTooltip(linkElement);
-
- if (useGoToArrowButton)
- linkElement.appendChild(WebInspector.createGoToArrowButton());
- else
- sourceCodeLocation.populateLiveDisplayLocationString(linkElement, "textContent");
-
- if (dontFloat)
- linkElement.classList.add("dont-float");
-
- return linkElement;
-}
-
-WebInspector.linkifyLocation = function(url, lineNumber, columnNumber, className)
-{
- var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
- if (!sourceCode) {
- sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
- if (sourceCode)
- sourceCode = sourceCode.resource || sourceCode;
- }
-
- if (!sourceCode) {
- var anchor = document.createElement("a");
- anchor.href = url;
- anchor.lineNumber = lineNumber;
- if (className)
- anchor.className = className;
- anchor.appendChild(document.createTextNode(WebInspector.displayNameForURL(url) + ":" + lineNumber));
- return anchor;
- }
-
- var sourceCodeLocation = sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
- var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, true);
- if (className)
- linkElement.classList.add(className);
- return linkElement;
-}
-
-WebInspector.linkifyURLAsNode = function(url, linkText, classes, tooltipText)
-{
- if (!linkText)
- linkText = url;
-
- classes = (classes ? classes + " " : "");
-
- var a = document.createElement("a");
- a.href = url;
- a.className = classes;
-
- if (typeof tooltipText === "undefined")
- a.title = url;
- else if (typeof tooltipText !== "string" || tooltipText.length)
- a.title = tooltipText;
-
- a.textContent = linkText;
- a.style.maxWidth = "100%";
-
- return a;
-}
-
-WebInspector.linkifyStringAsFragmentWithCustomLinkifier = function(string, linkifier)
-{
- var container = document.createDocumentFragment();
- var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|www\.)[\w$\-_+*'=\|\/\\(){}[\]%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({%@&#~]/;
- var lineColumnRegEx = /:(\d+)(:(\d+))?$/;
-
- while (string) {
- var linkString = linkStringRegEx.exec(string);
- if (!linkString)
- break;
-
- linkString = linkString[0];
- var linkIndex = string.indexOf(linkString);
- var nonLink = string.substring(0, linkIndex);
- container.appendChild(document.createTextNode(nonLink));
-
- var title = linkString;
- var realURL = (linkString.startsWith("www.") ? "http://" + linkString : linkString);
- var lineColumnMatch = lineColumnRegEx.exec(realURL);
- if (lineColumnMatch)
- realURL = realURL.substring(0, realURL.length - lineColumnMatch[0].length);
-
- var linkNode = linkifier(title, realURL, lineColumnMatch ? lineColumnMatch[1] : undefined);
- container.appendChild(linkNode);
- string = string.substring(linkIndex + linkString.length, string.length);
- }
-
- if (string)
- container.appendChild(document.createTextNode(string));
-
- return container;
-}
-
-WebInspector.linkifyStringAsFragment = function(string)
-{
- function linkifier(title, url, lineNumber)
- {
- var urlNode = WebInspector.linkifyURLAsNode(url, title, undefined);
- if (typeof(lineNumber) !== "undefined")
- urlNode.lineNumber = lineNumber;
-
- return urlNode;
- }
-
- return WebInspector.linkifyStringAsFragmentWithCustomLinkifier(string, linkifier);
-}
-
-WebInspector._undoKeyboardShortcut = function(event)
-{
- if (!this.isEditingAnyField() && !this.isEventTargetAnEditableField(event)) {
- this.undo();
- event.preventDefault();
- }
-}
-
-WebInspector._redoKeyboardShortcut = function(event)
-{
- if (!this.isEditingAnyField() && !this.isEventTargetAnEditableField(event)) {
- this.redo();
- event.preventDefault();
- }
-}
-
-WebInspector.undo = function()
-{
- DOMAgent.undo();
-}
-
-WebInspector.redo = function()
-{
- DOMAgent.redo();
-}
-
-/**
- * @param {Element} element
- * @param {Array.<Object>} resultRanges
- * @param {string} styleClass
- * @param {Array.<Object>=} changes
- */
-WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, styleClass, changes)
-{
- changes = changes || [];
- var highlightNodes = [];
- var lineText = element.textContent;
- var ownerDocument = element.ownerDocument;
- var textNodeSnapshot = ownerDocument.evaluate(".//text()", element, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
-
- var snapshotLength = textNodeSnapshot.snapshotLength;
- if (snapshotLength === 0)
- return highlightNodes;
-
- var nodeRanges = [];
- var rangeEndOffset = 0;
- for (var i = 0; i < snapshotLength; ++i) {
- var range = {};
- range.offset = rangeEndOffset;
- range.length = textNodeSnapshot.snapshotItem(i).textContent.length;
- rangeEndOffset = range.offset + range.length;
- nodeRanges.push(range);
- }
-
- var startIndex = 0;
- for (var i = 0; i < resultRanges.length; ++i) {
- var startOffset = resultRanges[i].offset;
- var endOffset = startOffset + resultRanges[i].length;
-
- while (startIndex < snapshotLength && nodeRanges[startIndex].offset + nodeRanges[startIndex].length <= startOffset)
- startIndex++;
- var endIndex = startIndex;
- while (endIndex < snapshotLength && nodeRanges[endIndex].offset + nodeRanges[endIndex].length < endOffset)
- endIndex++;
- if (endIndex === snapshotLength)
- break;
-
- var highlightNode = ownerDocument.createElement("span");
- highlightNode.className = styleClass;
- highlightNode.textContent = lineText.substring(startOffset, endOffset);
-
- var lastTextNode = textNodeSnapshot.snapshotItem(endIndex);
- var lastText = lastTextNode.textContent;
- lastTextNode.textContent = lastText.substring(endOffset - nodeRanges[endIndex].offset);
- changes.push({ node: lastTextNode, type: "changed", oldText: lastText, newText: lastTextNode.textContent });
-
- if (startIndex === endIndex) {
- lastTextNode.parentElement.insertBefore(highlightNode, lastTextNode);
- changes.push({ node: highlightNode, type: "added", nextSibling: lastTextNode, parent: lastTextNode.parentElement });
- highlightNodes.push(highlightNode);
-
- var prefixNode = ownerDocument.createTextNode(lastText.substring(0, startOffset - nodeRanges[startIndex].offset));
- lastTextNode.parentElement.insertBefore(prefixNode, highlightNode);
- changes.push({ node: prefixNode, type: "added", nextSibling: highlightNode, parent: lastTextNode.parentElement });
- } else {
- var firstTextNode = textNodeSnapshot.snapshotItem(startIndex);
- var firstText = firstTextNode.textContent;
- var anchorElement = firstTextNode.nextSibling;
-
- firstTextNode.parentElement.insertBefore(highlightNode, anchorElement);
- changes.push({ node: highlightNode, type: "added", nextSibling: anchorElement, parent: firstTextNode.parentElement });
- highlightNodes.push(highlightNode);
-
- firstTextNode.textContent = firstText.substring(0, startOffset - nodeRanges[startIndex].offset);
- changes.push({ node: firstTextNode, type: "changed", oldText: firstText, newText: firstTextNode.textContent });
-
- for (var j = startIndex + 1; j < endIndex; j++) {
- var textNode = textNodeSnapshot.snapshotItem(j);
- var text = textNode.textContent;
- textNode.textContent = "";
- changes.push({ node: textNode, type: "changed", oldText: text, newText: textNode.textContent });
- }
- }
- startIndex = endIndex;
- nodeRanges[startIndex].offset = endOffset;
- nodeRanges[startIndex].length = lastTextNode.textContent.length;
-
- }
- return highlightNodes;
-}
-
-WebInspector.revertDomChanges = function(domChanges)
-{
- for (var i = domChanges.length - 1; i >= 0; --i) {
- var entry = domChanges[i];
- switch (entry.type) {
- case "added":
- if (entry.node.parentElement)
- entry.node.parentElement.removeChild(entry.node);
- break;
- case "changed":
- entry.node.textContent = entry.oldText;
- break;
- }
- }
-}
-
-WebInspector.archiveMainFrame = function()
-{
- this.notifications.dispatchEventToListeners(WebInspector.Notification.PageArchiveStarted, event);
-
- setTimeout(function() {
- PageAgent.archive(function(error, data) {
- this.notifications.dispatchEventToListeners(WebInspector.Notification.PageArchiveEnded, event);
- if (error)
- return;
-
- var mainFrame = WebInspector.frameResourceManager.mainFrame;
- var archiveName = mainFrame.mainResource.urlComponents.host || mainFrame.mainResource.displayName || "Archive";
- var url = "web-inspector:///" + encodeURI(archiveName) + ".webarchive";
- InspectorFrontendHost.save(url, data, true, true);
- }.bind(this));
- }.bind(this), 3000);
-}
-
-WebInspector.canArchiveMainFrame = function()
-{
- if (!PageAgent.archive)
- return false;
-
- return WebInspector.Resource.Type.fromMIMEType(WebInspector.frameResourceManager.mainFrame.mainResource.mimeType) === WebInspector.Resource.Type.Document;
-}
-
-WebInspector.addWindowKeydownListener = function(listener)
-{
- if (typeof listener.handleKeydownEvent !== "function")
- return;
-
- this._windowKeydownListeners.push(listener);
-
- this._updateWindowKeydownListener();
-};
-
-WebInspector.removeWindowKeydownListener = function(listener)
-{
- this._windowKeydownListeners.remove(listener);
-
- this._updateWindowKeydownListener();
-};
-
-WebInspector._updateWindowKeydownListener = function()
-{
- if (this._windowKeydownListeners.length > 0)
- window.addEventListener("keydown", WebInspector._sharedWindowKeydownListener, true);
- else
- window.removeEventListener("keydown", WebInspector._sharedWindowKeydownListener, true);
-}
-
-WebInspector._sharedWindowKeydownListener = function(event)
-{
- for (var i = WebInspector._windowKeydownListeners.length - 1; i >= 0; --i) {
- if (WebInspector._windowKeydownListeners[i].handleKeydownEvent(event)) {
- event.stopImmediatePropagation();
- event.preventDefault();
- break;
- }
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMessageDispatcherjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/MessageDispatcher.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/MessageDispatcher.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/MessageDispatcher.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.messagesToDispatch = [];
-
-WebInspector.dispatchNextQueuedMessageFromBackend = function()
-{
- for (var i = 0; i < this.messagesToDispatch.length; ++i)
- InspectorBackend.dispatch(this.messagesToDispatch[i]);
-
- this.messagesToDispatch = [];
-
- this._dispatchTimeout = null;
-}
-
-WebInspector.dispatchMessageFromBackend = function(message)
-{
- // Enforce asynchronous interaction between the backend and the frontend by queueing messages.
- // The messages are dequeued on a zero delay timeout.
-
- this.messagesToDispatch.push(message);
-
- if (this._dispatchTimeout)
- return;
-
- this._dispatchTimeout = setTimeout(this.dispatchNextQueuedMessageFromBackend.bind(this), 0);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMetricsStyleDetailsPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/MetricsStyleDetailsPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/MetricsStyleDetailsPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/MetricsStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.MetricsStyleDetailsPanel = function()
-{
- WebInspector.StyleDetailsPanel.call(this, WebInspector.MetricsStyleDetailsPanel.StyleClassName, "metrics", WebInspector.UIString("Metrics"));
-
- this._boxModelDiagramRow = new WebInspector.BoxModelDetailsSectionRow;
-
- var boxModelGroup = new WebInspector.DetailsSectionGroup([this._boxModelDiagramRow]);
- var boxModelSection = new WebInspector.DetailsSection("style-box-model", WebInspector.UIString("Box Model"), [boxModelGroup]);
-
- this.element.appendChild(boxModelSection.element);
-};
-
-WebInspector.MetricsStyleDetailsPanel.StyleClassName = "metrics";
-
-WebInspector.MetricsStyleDetailsPanel.prototype = {
- constructor: WebInspector.MetricsStyleDetailsPanel,
-
- // Public
-
- refresh: function()
- {
- this._boxModelDiagramRow.nodeStyles = this.nodeStyles;
- }
-};
-
-WebInspector.MetricsStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsApplicationCacheFramejsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheFramejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheFrame.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrame.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheFrame.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheFrame = function(frame, manifest, status)
+{
+ console.assert(frame instanceof WebInspector.Frame);
+ console.assert(manifest instanceof WebInspector.ApplicationCacheManifest);
+
+ WebInspector.Object.call(this);
+
+ this._frame = frame;
+ this._manifest = manifest;
+ this._status = status;
+};
+
+WebInspector.ApplicationCacheFrame.TypeIdentifier = "application-cache-frame";
+WebInspector.ApplicationCacheFrame.FrameURLCookieKey = "application-cache-frame-url";
+WebInspector.ApplicationCacheFrame.ManifestURLCookieKey = "application-cache-frame-manifest-url";
+
+WebInspector.ApplicationCacheFrame.prototype = {
+ constructor: WebInspector.ApplicationCacheFrame,
+
+ // Public
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ get manifest()
+ {
+ return this._manifest;
+ },
+
+ get status()
+ {
+ return this._status;
+ },
+
+ set status(status)
+ {
+ this._status = status;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.ApplicationCacheFrame.FrameURLCookieKey] = this.frame.url;
+ cookie[WebInspector.ApplicationCacheFrame.ManifestURLCookieKey] = this.manifest.manifestURL;
+ }
+};
+
+WebInspector.ApplicationCacheFrame.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsApplicationCacheManifestjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheManifest.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifest.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheManifest.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ApplicationCacheManifest.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManifest = function(manifestURL)
+{
+ WebInspector.Object.call(this);
+
+ this._manifestURL = manifestURL;
+};
+
+WebInspector.ApplicationCacheManifest.prototype = {
+ constructor: WebInspector.ApplicationCacheManifest,
+
+ get manifestURL()
+ {
+ return this._manifestURL;
+ }
+};
+
+WebInspector.ApplicationCacheManifest.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsBackForwardEntryjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBackForwardEntryjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BackForwardEntry.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * 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.BackForwardEntry = function(contentView, cookie)
+{
+ WebInspector.Object.call(this);
+ this._contentView = contentView;
+ // Cookies are compared with Object.shallowEqual, so should not store objects or arrays.
+ this._cookie = cookie || {};
+ this._scrollPositions = [];
+
+ contentView.saveToCookie(this._cookie);
+};
+
+WebInspector.BackForwardEntry.prototype = {
+ constructor: WebInspector.BackForwardEntry,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get contentView()
+ {
+ return this._contentView;
+ },
+
+ get cookie()
+ {
+ // Cookies are immutable; they represent a specific navigation action.
+ return Object.shallowCopy(this._cookie);
+ },
+
+ prepareToShow: function()
+ {
+ this._restoreFromCookie();
+
+ this.contentView.visible = true;
+ this.contentView.shown();
+ this.contentView.updateLayout();
+ },
+
+ prepareToHide: function()
+ {
+ this.contentView.visible = false;
+ this.contentView.hidden();
+
+ this._saveScrollPositions();
+ },
+
+ // Private
+
+ _restoreFromCookie: function()
+ {
+ this._restoreScrollPositions();
+ this.contentView.restoreFromCookie(this.cookie);
+ },
+
+ _restoreScrollPositions: function()
+ {
+ // If no scroll positions are saved, do nothing.
+ if (!this._scrollPositions.length)
+ return;
+
+ var scrollableElements = this.contentView.scrollableElements || [];
+ console.assert(this._scrollPositions.length === scrollableElements.length);
+
+ for (var i = 0; i < scrollableElements.length; ++i) {
+ var position = this._scrollPositions[i];
+ var element = scrollableElements[i];
+ if (!element)
+ continue;
+
+ // Restore the top scroll position by either scrolling to the bottom or to the saved position.
+ element.scrollTop = position.isScrolledToBottom ? element.scrollHeight : position.scrollTop;
+
+ // Don't restore the left scroll position when scrolled to the bottom. This way the when content changes
+ // the user won't be left in a weird horizontal position.
+ element.scrollLeft = position.isScrolledToBottom ? 0 : position.scrollLeft;
+ }
+ },
+
+ _saveScrollPositions: function()
+ {
+ var scrollableElements = this.contentView.scrollableElements || [];
+ var scrollPositions = [];
+ for (var i = 0; i < scrollableElements.length; ++i) {
+ var element = scrollableElements[i];
+ if (!element)
+ continue;
+
+ var position = { scrollTop: element.scrollTop, scrollLeft: element.scrollLeft };
+ if (this.contentView.shouldKeepElementsScrolledToBottom)
+ position.isScrolledToBottom = element.isScrolledToBottom();
+
+ scrollPositions.push(position);
+ }
+
+ this._scrollPositions = scrollPositions;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsBranchjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBranchjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Branch.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Branch.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Branch.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Branch.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Branch = function(displayName, revisions, locked)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(displayName);
+
+ this._displayName = displayName;
+ this._revisions = revisions instanceof Array ? revisions.slice() : [];
+ this._locked = locked || false;
+};
+
+WebInspector.Branch.prototype = {
+ constructor: WebInspector.Branch,
+
+ // Public
+
+ get displayName()
+ {
+ return this._displayName;
+ },
+
+ set displayName(displayName)
+ {
+ console.assert(displayName);
+ if (!displayName)
+ return;
+
+ this._displayName = displayName;
+ },
+
+ get revisions()
+ {
+ return this._revisions;
+ },
+
+ get locked()
+ {
+ return this._locked;
+ },
+
+ revisionForRepresentedObject: function(representedObject, doNotCreateIfNeeded)
+ {
+ for (var i = 0; i < this._revisions.length; ++i) {
+ var revision = this._revisions[i];
+ if (revision instanceof WebInspector.SourceCodeRevision && revision.sourceCode === representedObject)
+ return revision;
+ }
+
+ if (doNotCreateIfNeeded)
+ return null;
+
+ if (representedObject instanceof WebInspector.SourceCode) {
+ var revision = representedObject.originalRevision.copy();
+ representedObject.currentRevision = revision;
+ this.addRevision(revision);
+ return revision;
+ }
+
+ return null;
+ },
+
+ addRevision: function(revision)
+ {
+ console.assert(revision instanceof WebInspector.Revision);
+
+ if (this._locked)
+ return;
+
+ if (this._revisions.contains(revision))
+ return;
+
+ this._revisions.push(revision);
+ },
+
+ removeRevision: function(revision)
+ {
+ console.assert(revision instanceof WebInspector.Revision);
+
+ if (this._locked)
+ return;
+
+ this._revisions.remove(revision);
+ },
+
+ reset: function()
+ {
+ if (this._locked)
+ return;
+
+ this._revisions = [];
+ },
+
+ fork: function(displayName)
+ {
+ var copiedRevisions = this._revisions.map(function(revision) { return revision.copy(); });
+ return new WebInspector.Branch(displayName, copiedRevisions);
+ },
+
+ apply: function()
+ {
+ for (var i = 0; i < this._revisions.length; ++i)
+ this._revisions[i].apply();
+ },
+
+ revert: function()
+ {
+ for (var i = this._revisions.length - 1; i >= 0; --i)
+ this._revisions[i].revert();
+ },
+
+ lock: function()
+ {
+ console.assert(!this._locked);
+ this._locked = true;
+ },
+
+ unlock: function()
+ {
+ console.assert(this._locked);
+ this._locked = false;
+ }
+};
+
+WebInspector.Branch.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsBreakpointjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Breakpoint.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,583 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Breakpoint = function(sourceCodeLocationOrInfo, disabled, condition)
+{
+ WebInspector.Object.call(this);
+
+ if (sourceCodeLocationOrInfo instanceof WebInspector.SourceCodeLocation) {
+ var sourceCode = sourceCodeLocationOrInfo.sourceCode;
+ var url = sourceCode ? sourceCode.url : null;
+ var scriptIdentifier = sourceCode instanceof WebInspector.Script ? sourceCode.id : null;
+ var location = sourceCodeLocationOrInfo;
+ } else if (sourceCodeLocationOrInfo && typeof sourceCodeLocationOrInfo === "object") {
+ var url = sourceCodeLocationOrInfo.url;
+ var lineNumber = sourceCodeLocationOrInfo.lineNumber || 0;
+ var columnNumber = sourceCodeLocationOrInfo.columnNumber || 0;
+ var location = new WebInspector.SourceCodeLocation(null, lineNumber, columnNumber);
+ var autoContinue = sourceCodeLocationOrInfo.autoContinue || false;
+ var actions = sourceCodeLocationOrInfo.actions || [];
+ for (var i = 0; i < actions.length; ++i)
+ actions[i] = new WebInspector.BreakpointAction(this, actions[i]);
+ disabled = sourceCodeLocationOrInfo.disabled;
+ condition = sourceCodeLocationOrInfo.condition;
+ } else
+ console.error("Unexpected type passed to WebInspector.Breakpoint", sourceCodeLocationOrInfo);
+
+ this._id = null;
+ this._url = url || null;
+ this._scriptIdentifier = scriptIdentifier || null;
+ this._disabled = disabled || false;
+ this._condition = condition || "";
+ this._autoContinue = autoContinue || false;
+ this._actions = actions || [];
+ this._resolved = false;
+
+ this._sourceCodeLocation = location;
+ this._sourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationLocationChanged, this);
+ this._sourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, this._sourceCodeLocationDisplayLocationChanged, this);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Breakpoint);
+
+WebInspector.Breakpoint.PopoverClassName = "edit-breakpoint-popover-content";
+WebInspector.Breakpoint.WidePopoverClassName = "wide";
+WebInspector.Breakpoint.PopoverConditionInputId = "edit-breakpoint-popover-condition";
+WebInspector.Breakpoint.PopoverOptionsAutoContinueInputId = "edit-breakpoint-popoover-auto-continue";
+WebInspector.Breakpoint.HiddenStyleClassName = "hidden";
+
+WebInspector.Breakpoint.DefaultBreakpointActionType = WebInspector.BreakpointAction.Type.Log;
+
+WebInspector.Breakpoint.TypeIdentifier = "breakpoint";
+WebInspector.Breakpoint.URLCookieKey = "breakpoint-url";
+WebInspector.Breakpoint.LineNumberCookieKey = "breakpoint-line-number";
+WebInspector.Breakpoint.ColumnNumberCookieKey = "breakpoint-column-number";
+
+WebInspector.Breakpoint.Event = {
+ DisabledStateDidChange: "breakpoint-disabled-state-did-change",
+ ResolvedStateDidChange: "breakpoint-resolved-state-did-change",
+ ConditionDidChange: "breakpoint-condition-did-change",
+ ActionsDidChange: "breakpoint-actions-did-change",
+ AutoContinueDidChange: "breakpoint-auto-continue-did-change",
+ LocationDidChange: "breakpoint-location-did-change",
+ DisplayLocationDidChange: "breakpoint-display-location-did-change",
+};
+
+WebInspector.Breakpoint.prototype = {
+ constructor: WebInspector.Breakpoint,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ set id(id)
+ {
+ this._id = id || null;
+ },
+
+ get url()
+ {
+ return this._url;
+ },
+
+ get scriptIdentifier()
+ {
+ return this._scriptIdentifier;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ get resolved()
+ {
+ return this._resolved && WebInspector.debuggerManager.breakpointsEnabled;
+ },
+
+ set resolved(resolved)
+ {
+ if (this._resolved === resolved)
+ return;
+
+ this._resolved = resolved || false;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ResolvedStateDidChange);
+ },
+
+ get disabled()
+ {
+ return this._disabled;
+ },
+
+ set disabled(disabled)
+ {
+ if (this._disabled === disabled)
+ return;
+
+ this._disabled = disabled || false;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.DisabledStateDidChange);
+ },
+
+ get condition()
+ {
+ return this._condition;
+ },
+
+ set condition(condition)
+ {
+ if (this._condition === condition)
+ return;
+
+ this._condition = condition;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ConditionDidChange);
+ },
+
+ get autoContinue()
+ {
+ return this._autoContinue;
+ },
+
+ set autoContinue(cont)
+ {
+ if (this._autoContinue === cont)
+ return;
+
+ this._autoContinue = cont;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.AutoContinueDidChange);
+ },
+
+ get actions()
+ {
+ return this._actions;
+ },
+
+ get options()
+ {
+ return {
+ condition: this._condition,
+ actions: this._serializableActions(),
+ autoContinue: this._autoContinue
+ };
+ },
+
+ get info()
+ {
+ // The id, scriptIdentifier and resolved state are tied to the current session, so don't include them for serialization.
+ return {
+ url: this._url,
+ lineNumber: this._sourceCodeLocation.lineNumber,
+ columnNumber: this._sourceCodeLocation.columnNumber,
+ disabled: this._disabled,
+ condition: this._condition,
+ actions: this._serializableActions(),
+ autoContinue: this._autoContinue
+ };
+ },
+
+ get probeActions()
+ {
+ return this._actions.filter(function(action) {
+ return action.type === WebInspector.BreakpointAction.Type.Probe;
+ });
+ },
+
+ cycleToNextMode: function()
+ {
+ if (this.disabled) {
+ // When cycling, clear auto-continue when going from disabled to enabled.
+ this.autoContinue = false;
+ this.disabled = false;
+ return;
+ }
+
+ if (this.autoContinue) {
+ this.disabled = true;
+ return;
+ }
+
+ if (this.actions.length) {
+ this.autoContinue = true;
+ return;
+ }
+
+ this.disabled = true;
+ },
+
+ appendContextMenuItems: function(contextMenu, breakpointDisplayElement)
+ {
+ console.assert(document.body.contains(breakpointDisplayElement), "breakpoint popover display element must be in the DOM");
+
+ var boundingClientRect = breakpointDisplayElement.getBoundingClientRect();
+
+ function editBreakpoint()
+ {
+ this._showEditBreakpointPopover(boundingClientRect);
+ }
+
+ function removeBreakpoint()
+ {
+ WebInspector.debuggerManager.removeBreakpoint(this);
+ }
+
+ function toggleBreakpoint()
+ {
+ this.disabled = !this.disabled;
+ }
+
+ function toggleAutoContinue()
+ {
+ this.autoContinue = !this.autoContinue;
+ }
+
+ function revealOriginalSourceCodeLocation()
+ {
+ WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(this._sourceCodeLocation);
+ }
+
+ if (WebInspector.debuggerManager.isBreakpointEditable(this))
+ contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint…"), editBreakpoint.bind(this));
+
+ if (this.autoContinue && !this.disabled) {
+ contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), toggleBreakpoint.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Cancel Automatic Continue"), toggleAutoContinue.bind(this));
+ } else if (!this.disabled)
+ contextMenu.appendItem(WebInspector.UIString("Disable Breakpoint"), toggleBreakpoint.bind(this));
+ else
+ contextMenu.appendItem(WebInspector.UIString("Enable Breakpoint"), toggleBreakpoint.bind(this));
+
+ if (!this.autoContinue && !this.disabled && this.actions.length)
+ contextMenu.appendItem(WebInspector.UIString("Set to Automatically Continue"), toggleAutoContinue.bind(this));
+
+ if (WebInspector.debuggerManager.isBreakpointRemovable(this)) {
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Delete Breakpoint"), removeBreakpoint.bind(this));
+ }
+
+ if (this._sourceCodeLocation.hasMappedLocation()) {
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Reveal in Original Resource"), revealOriginalSourceCodeLocation.bind(this));
+ }
+ },
+
+ createAction: function(type, precedingAction, data)
+ {
+ var newAction = new WebInspector.BreakpointAction(this, type, data || null);
+
+ if (!precedingAction)
+ this._actions.push(newAction);
+ else {
+ var index = this._actions.indexOf(precedingAction);
+ console.assert(index !== -1);
+ if (index === -1)
+ this._actions.push(newAction);
+ else
+ this._actions.splice(index + 1, 0, newAction);
+ }
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
+
+ return newAction;
+ },
+
+ recreateAction: function(type, actionToReplace)
+ {
+ var newAction = new WebInspector.BreakpointAction(this, type, null);
+
+ var index = this._actions.indexOf(actionToReplace);
+ console.assert(index !== -1);
+ if (index === -1)
+ return null;
+
+ this._actions[index] = newAction;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
+
+ return newAction;
+ },
+
+ removeAction: function(action)
+ {
+ var index = this._actions.indexOf(action);
+ console.assert(index !== -1);
+ if (index === -1)
+ return;
+
+ this._actions.splice(index, 1);
+
+ if (!this._actions.length)
+ this.autoContinue = false;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
+ },
+
+ clearActions: function(type)
+ {
+ if (!type)
+ this._actions = [];
+ else
+ this._actions = this._actions.filter(function(action) { action.type != type; });
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.Breakpoint.URLCookieKey] = this.url;
+ cookie[WebInspector.Breakpoint.LineNumberCookieKey] = this.sourceCodeLocation.lineNumber;
+ cookie[WebInspector.Breakpoint.ColumnNumberCookieKey] = this.sourceCodeLocation.columnNumber;
+ },
+
+ // Protected (Called by BreakpointAction)
+
+ breakpointActionDidChange: function(action)
+ {
+ var index = this._actions.indexOf(action);
+ console.assert(index !== -1);
+ if (index === -1)
+ return;
+
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.ActionsDidChange);
+ },
+
+ // Private
+
+ _serializableActions: function()
+ {
+ var actions = [];
+ for (var i = 0; i < this._actions.length; ++i)
+ actions.push(this._actions[i].info);
+ return actions;
+ },
+
+ _popoverToggleEnabledCheckboxChanged: function(event)
+ {
+ this.disabled = !event.target.checked;
+ },
+
+ _popoverConditionInputChanged: function(event)
+ {
+ this.condition = event.target.value;
+ },
+
+ _popoverToggleAutoContinueCheckboxChanged: function(event)
+ {
+ this.autoContinue = event.target.checked;
+ },
+
+ _popoverConditionInputKeyDown: function(event)
+ {
+ if (this._keyboardShortcutEsc.matchesEvent(event) || this._keyboardShortcutEnter.matchesEvent(event)) {
+ this._popover.dismiss();
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ },
+
+ _editBreakpointPopoverContentElement: function()
+ {
+ var content = this._popoverContentElement = document.createElement("div");
+ content.className = WebInspector.Breakpoint.PopoverClassName;
+
+ var checkboxElement = document.createElement("input");
+ checkboxElement.type = "checkbox";
+ checkboxElement.checked = !this._disabled;
+ checkboxElement.addEventListener("change", this._popoverToggleEnabledCheckboxChanged.bind(this));
+
+ var checkboxLabel = document.createElement("label");
+ checkboxLabel.className = "toggle";
+ checkboxLabel.appendChild(checkboxElement);
+ checkboxLabel.appendChild(document.createTextNode(this._sourceCodeLocation.displayLocationString()));
+
+ var table = document.createElement("table");
+
+ var conditionRow = table.appendChild(document.createElement("tr"));
+ var conditionHeader = conditionRow.appendChild(document.createElement("th"));
+ var conditionData = conditionRow.appendChild(document.createElement("td"));
+ var conditionLabel = conditionHeader.appendChild(document.createElement("label"));
+ var conditionInput = conditionData.appendChild(document.createElement("input"));
+ conditionInput.id = WebInspector.Breakpoint.PopoverConditionInputId;
+ conditionInput.value = this._condition || "";
+ conditionInput.spellcheck = false;
+ conditionInput.addEventListener("change", this._popoverConditionInputChanged.bind(this));
+ conditionInput.addEventListener("keydown", this._popoverConditionInputKeyDown.bind(this));
+ conditionInput.placeholder = WebInspector.UIString("Conditional expression");
+ conditionLabel.setAttribute("for", conditionInput.id);
+ conditionLabel.textContent = WebInspector.UIString("Condition");
+
+ if (DebuggerAgent.setBreakpoint.supports("options")) {
+ var actionRow = table.appendChild(document.createElement("tr"));
+ var actionHeader = actionRow.appendChild(document.createElement("th"));
+ var actionData = this._actionsContainer = actionRow.appendChild(document.createElement("td"));
+ var actionLabel = actionHeader.appendChild(document.createElement("label"));
+ actionLabel.textContent = WebInspector.UIString("Action");
+
+ if (!this._actions.length)
+ this._popoverActionsCreateAddActionButton();
+ else {
+ this._popoverContentElement.classList.add(WebInspector.Breakpoint.WidePopoverClassName);
+ for (var i = 0; i < this._actions.length; ++i) {
+ var breakpointActionView = new WebInspector.BreakpointActionView(this._actions[i], this, true);
+ this._popoverActionsInsertBreakpointActionView(breakpointActionView, i);
+ }
+ }
+
+ var optionsRow = this._popoverOptionsRowElement = table.appendChild(document.createElement("tr"));
+ if (!this._actions.length)
+ optionsRow.classList.add(WebInspector.Breakpoint.HiddenStyleClassName);
+ var optionsHeader = optionsRow.appendChild(document.createElement("th"));
+ var optionsData = optionsRow.appendChild(document.createElement("td"));
+ var optionsLabel = optionsHeader.appendChild(document.createElement("label"));
+ var optionsCheckbox = this._popoverOptionsCheckboxElement = optionsData.appendChild(document.createElement("input"));
+ var optionsCheckboxLabel = optionsData.appendChild(document.createElement("label"));
+ optionsCheckbox.id = WebInspector.Breakpoint.PopoverOptionsAutoContinueInputId;
+ optionsCheckbox.type = "checkbox";
+ optionsCheckbox.checked = this._autoContinue;
+ optionsCheckbox.addEventListener("change", this._popoverToggleAutoContinueCheckboxChanged.bind(this));
+ optionsLabel.textContent = WebInspector.UIString("Options");
+ optionsCheckboxLabel.setAttribute("for", optionsCheckbox.id);
+ optionsCheckboxLabel.textContent = WebInspector.UIString("Automatically continue after evaluating");
+ }
+
+ content.appendChild(checkboxLabel);
+ content.appendChild(table);
+
+ return content;
+ },
+
+ _popoverActionsCreateAddActionButton: function()
+ {
+ this._popoverContentElement.classList.remove(WebInspector.Breakpoint.WidePopoverClassName);
+ this._actionsContainer.removeChildren();
+
+ var addActionButton = this._actionsContainer.appendChild(document.createElement("button"));
+ addActionButton.textContent = WebInspector.UIString("Add Action");
+ addActionButton.addEventListener("click", this._popoverActionsAddActionButtonClicked.bind(this));
+ },
+
+ _popoverActionsAddActionButtonClicked: function(event)
+ {
+ this._popoverContentElement.classList.add(WebInspector.Breakpoint.WidePopoverClassName);
+ this._actionsContainer.removeChildren();
+
+ var newAction = this.createAction(WebInspector.Breakpoint.DefaultBreakpointActionType);
+ var newBreakpointActionView = new WebInspector.BreakpointActionView(newAction, this);
+ this._popoverActionsInsertBreakpointActionView(newBreakpointActionView, -1);
+ this._popoverOptionsRowElement.classList.remove(WebInspector.Breakpoint.HiddenStyleClassName);
+ this._popover.update();
+ },
+
+ _popoverActionsInsertBreakpointActionView: function(breakpointActionView, index)
+ {
+ if (index === -1)
+ this._actionsContainer.appendChild(breakpointActionView.element);
+ else {
+ var nextElement = this._actionsContainer.children[index + 1] || null;
+ this._actionsContainer.insertBefore(breakpointActionView.element, nextElement);
+ }
+ },
+
+ breakpointActionViewAppendActionView: function(breakpointActionView, newAction)
+ {
+ var newBreakpointActionView = new WebInspector.BreakpointActionView(newAction, this);
+
+ var index = 0;
+ var children = this._actionsContainer.children;
+ for (var i = 0; children.length; ++i) {
+ if (children[i] === breakpointActionView.element) {
+ index = i;
+ break;
+ }
+ }
+
+ this._popoverActionsInsertBreakpointActionView(newBreakpointActionView, index);
+ this._popoverOptionsRowElement.classList.remove(WebInspector.Breakpoint.HiddenStyleClassName);
+
+ this._popover.update();
+ },
+
+ breakpointActionViewRemoveActionView: function(breakpointActionView)
+ {
+ breakpointActionView.element.remove();
+
+ if (!this._actionsContainer.children.length) {
+ this._popoverActionsCreateAddActionButton();
+ this._popoverOptionsRowElement.classList.add(WebInspector.Breakpoint.HiddenStyleClassName);
+ this._popoverOptionsCheckboxElement.checked = false;
+ }
+
+ this._popover.update();
+ },
+
+ breakpointActionViewResized: function(breakpointActionView)
+ {
+ this._popover.update();
+ },
+
+ willDismissPopover: function(popover)
+ {
+ console.assert(this._popover === popover);
+ delete this._popoverContentElement;
+ delete this._popoverOptionsRowElement;
+ delete this._popoverOptionsCheckboxElement;
+ delete this._actionsContainer;
+ delete this._popover;
+ },
+
+ _showEditBreakpointPopover: function(boundingClientRect)
+ {
+ var bounds = WebInspector.Rect.rectFromClientRect(boundingClientRect);
+ bounds.origin.x -= 1; // Move the anchor left one pixel so it looks more centered.
+
+ this._popover = this._popover || new WebInspector.Popover(this);
+ this._popover.content = this._editBreakpointPopoverContentElement();
+ this._popover.present(bounds.pad(2), [WebInspector.RectEdge.MAX_Y]);
+
+ if (!this._keyboardShortcutEsc) {
+ this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
+ this._keyboardShortcutEnter = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter);
+ }
+
+ document.getElementById(WebInspector.Breakpoint.PopoverConditionInputId).select();
+ },
+
+ _sourceCodeLocationLocationChanged: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.LocationDidChange, event.data);
+ },
+
+ _sourceCodeLocationDisplayLocationChanged: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.Breakpoint.Event.DisplayLocationDidChange, event.data);
+ }
+};
+
+WebInspector.Breakpoint.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsBreakpointActionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointActionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BreakpointAction.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointAction = function(breakpoint, typeOrInfo, data)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(breakpoint);
+ console.assert(typeOrInfo);
+
+ this._breakpoint = breakpoint;
+
+ if (typeof typeOrInfo === "string") {
+ this._type = typeOrInfo;
+ this._data = data || null;
+ } else if (typeof typeOrInfo === "object") {
+ this._type = typeOrInfo.type;
+ this._data = typeOrInfo.data || null;
+ } else
+ console.error("Unexpected type passed to WebInspector.BreakpointAction");
+
+ console.assert(typeof this._type === "string");
+ this._id = WebInspector.debuggerManager.nextBreakpointActionIdentifier;
+};
+
+WebInspector.BreakpointAction.Type = {
+ Log: "log",
+ Evaluate: "evaluate",
+ Sound: "sound",
+ Probe: "probe"
+}
+
+WebInspector.BreakpointAction.prototype = {
+ constructor: WebInspector.BreakpointAction,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get breakpoint()
+ {
+ return this._breakpoint;
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get data()
+ {
+ return this._data;
+ },
+
+ set data(data)
+ {
+ if (this._data === data)
+ return;
+
+ this._data = data;
+
+ this._breakpoint.breakpointActionDidChange(this);
+ },
+
+ get info()
+ {
+ var obj = {type: this._type, id: this._id};
+ if (this._data)
+ obj.data = this._data;
+ return obj;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSCompletionsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSCompletionsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSCompletions.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,272 @@
</span><ins>+/*
+ * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
+ * Copyright (C) 2010 Joseph Pecoraro. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @constructor
+ */
+WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix)
+{
+ this._values = [];
+ this._longhands = {};
+ this._shorthands = {};
+
+ for (var i = 0; i < properties.length; ++i) {
+ // COMPATIBILITY (iOS 6): This used to be an array of strings,
+ // now it contains objects with a 'name' property. Support both here.
+ var property = properties[i];
+ if (typeof property === "string") {
+ this._values.push(property);
+ continue;
+ }
+
+ var propertyName = property.name;
+ this._values.push(propertyName);
+
+ var longhands = property.longhands;
+ if (longhands) {
+ this._longhands[propertyName] = longhands;
+
+ for (var j = 0; j < longhands.length; ++j) {
+ var longhandName = longhands[j];
+
+ var shorthands = this._shorthands[longhandName];
+ if (!shorthands) {
+ shorthands = [];
+ this._shorthands[longhandName] = shorthands;
+ }
+
+ shorthands.push(propertyName);
+ }
+ }
+ }
+
+ this._values.sort();
+
+ this._acceptEmptyPrefix = acceptEmptyPrefix;
+}
+
+
+/**
+ * @type {WebInspector.CSSCompletions}
+ */
+WebInspector.CSSCompletions.cssNameCompletions = null;
+
+WebInspector.CSSCompletions.requestCSSNameCompletions = function()
+{
+ function propertyNamesCallback(error, names)
+ {
+ if (error)
+ return;
+
+ WebInspector.CSSCompletions.cssNameCompletions = new WebInspector.CSSCompletions(names, false);
+
+ var propertyNamesForCodeMirror = {};
+ var valueKeywordsForCodeMirror = {"inherit": true, "initial": true};
+ var colorKeywordsForCodeMirror = {};
+
+ function nameForCodeMirror(name)
+ {
+ // CodeMirror parses the vendor prefix separate from the property or keyword name,
+ // so we need to strip vendor prefixes from our names. Also strip function parenthesis.
+ return name.replace(/^-[^-]+-/, "").replace(/\(\)$/, "");
+ }
+
+ function collectPropertyNameForCodeMirror(propertyName)
+ {
+ // Properties can also be value keywords, like when used in a transition.
+ // So we add them to both lists.
+ var codeMirrorPropertyName = nameForCodeMirror(propertyName);
+ propertyNamesForCodeMirror[codeMirrorPropertyName] = true;
+ valueKeywordsForCodeMirror[codeMirrorPropertyName] = true;
+ }
+
+ for (var i = 0; i < names.length; ++i) {
+ // COMPATIBILITY (iOS 6): This used to be an array of strings,
+ // now it contains objects with a 'name' property. Support both here.
+ var property = names[i];
+ if (typeof property === "string")
+ collectPropertyNameForCodeMirror(property);
+ else
+ collectPropertyNameForCodeMirror(property.name);
+ }
+
+ for (var propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap) {
+ var keywords = WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName];
+ for (var i = 0; i < keywords.length; ++i) {
+ // Skip numbers, like the ones defined for font-weight.
+ if (!isNaN(Number(keywords[i])))
+ continue;
+ valueKeywordsForCodeMirror[nameForCodeMirror(keywords[i])] = true;
+ }
+ }
+
+ WebInspector.CSSKeywordCompletions._colors.forEach(function(colorName) {
+ colorKeywordsForCodeMirror[nameForCodeMirror(colorName)] = true;
+ });
+
+ function updateCodeMirrorCSSMode(mimeType)
+ {
+ var modeSpec = CodeMirror.resolveMode(mimeType);
+
+ console.assert(modeSpec.propertyKeywords);
+ console.assert(modeSpec.valueKeywords);
+ console.assert(modeSpec.colorKeywords);
+
+ modeSpec.propertyKeywords = propertyNamesForCodeMirror;
+ modeSpec.valueKeywords = valueKeywordsForCodeMirror;
+ modeSpec.colorKeywords = colorKeywordsForCodeMirror;
+
+ CodeMirror.defineMIME(mimeType, modeSpec);
+ }
+
+ updateCodeMirrorCSSMode("text/css");
+ updateCodeMirrorCSSMode("text/x-scss");
+ }
+
+ if (window.CSSAgent)
+ CSSAgent.getSupportedCSSProperties(propertyNamesCallback);
+}
+
+WebInspector.CSSCompletions.prototype = {
+ get values()
+ {
+ return this._values;
+ },
+
+ startsWith: function(prefix)
+ {
+ var firstIndex = this._firstIndexOfPrefix(prefix);
+ if (firstIndex === -1)
+ return [];
+
+ var results = [];
+ while (firstIndex < this._values.length && this._values[firstIndex].startsWith(prefix))
+ results.push(this._values[firstIndex++]);
+ return results;
+ },
+
+ firstStartsWith: function(prefix)
+ {
+ var foundIndex = this._firstIndexOfPrefix(prefix);
+ return (foundIndex === -1 ? "" : this._values[foundIndex]);
+ },
+
+ _firstIndexOfPrefix: function(prefix)
+ {
+ if (!this._values.length)
+ return -1;
+ if (!prefix)
+ return this._acceptEmptyPrefix ? 0 : -1;
+
+ var maxIndex = this._values.length - 1;
+ var minIndex = 0;
+ var foundIndex;
+
+ do {
+ var middleIndex = (maxIndex + minIndex) >> 1;
+ if (this._values[middleIndex].startsWith(prefix)) {
+ foundIndex = middleIndex;
+ break;
+ }
+ if (this._values[middleIndex] < prefix)
+ minIndex = middleIndex + 1;
+ else
+ maxIndex = middleIndex - 1;
+ } while (minIndex <= maxIndex);
+
+ if (foundIndex === undefined)
+ return -1;
+
+ while (foundIndex && this._values[foundIndex - 1].startsWith(prefix))
+ foundIndex--;
+
+ return foundIndex;
+ },
+
+ keySet: function()
+ {
+ if (!this._keySet)
+ this._keySet = this._values.keySet();
+ return this._keySet;
+ },
+
+ next: function(str, prefix)
+ {
+ return this._closest(str, prefix, 1);
+ },
+
+ previous: function(str, prefix)
+ {
+ return this._closest(str, prefix, -1);
+ },
+
+ _closest: function(str, prefix, shift)
+ {
+ if (!str)
+ return "";
+
+ var index = this._values.indexOf(str);
+ if (index === -1)
+ return "";
+
+ if (!prefix) {
+ index = (index + this._values.length + shift) % this._values.length;
+ return this._values[index];
+ }
+
+ var propertiesWithPrefix = this.startsWith(prefix);
+ var j = propertiesWithPrefix.indexOf(str);
+ j = (j + propertiesWithPrefix.length + shift) % propertiesWithPrefix.length;
+ return propertiesWithPrefix[j];
+ },
+
+ isShorthandPropertyName: function(shorthand)
+ {
+ return shorthand in this._longhands;
+ },
+
+ isLonghandPropertyName: function(longhand)
+ {
+ return longhand in this._shorthands;
+ },
+
+ longhandsForShorthand: function(shorthand)
+ {
+ return this._longhands[shorthand] || [];
+ },
+
+ shorthandsForLonghand: function(longhand)
+ {
+ return this._shorthands[longhand] || [];
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSKeywordCompletionsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSKeywordCompletionsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSKeywordCompletions.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,899 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.CSSKeywordCompletions = {};
+
+WebInspector.CSSKeywordCompletions.forProperty = function(propertyName)
+{
+ var acceptedKeywords = ["initial"];
+ var isNotPrefixed = propertyName.charAt(0) !== "-";
+
+ if (propertyName in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
+ acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap[propertyName]);
+ else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions._propertyKeywordMap)
+ acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._propertyKeywordMap["-webkit-" + propertyName]);
+
+ if (propertyName in WebInspector.CSSKeywordCompletions._colorAwareProperties)
+ acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
+ else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions._colorAwareProperties)
+ acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors);
+
+ // Only suggest "inherit" on inheritable properties even though it is valid on all properties.
+ if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties)
+ acceptedKeywords.push("inherit");
+ else if (isNotPrefixed && ("-webkit-" + propertyName) in WebInspector.CSSKeywordCompletions.InheritedProperties)
+ acceptedKeywords.push("inherit");
+
+ if (acceptedKeywords.contains(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder)) {
+ acceptedKeywords.remove(WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder);
+ acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSCompletions.cssNameCompletions.values);
+ }
+
+ return new WebInspector.CSSCompletions(acceptedKeywords, true);
+}
+
+WebInspector.CSSKeywordCompletions.isColorAwareProperty = function(propertyName)
+{
+ return WebInspector.CSSKeywordCompletions._colorAwareProperties[propertyName] === true;
+}
+
+WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder = "__all-properties__";
+
+WebInspector.CSSKeywordCompletions.InheritedProperties = [
+ "azimuth", "border-collapse", "border-spacing", "caption-side", "clip-rule", "color", "color-interpolation",
+ "color-interpolation-filters", "color-rendering", "cursor", "direction", "elevation", "empty-cells", "fill",
+ "fill-opacity", "fill-rule", "font", "font-family", "font-size", "font-style", "font-variant", "font-weight",
+ "glyph-orientation-horizontal", "glyph-orientation-vertical", "image-rendering", "kerning", "letter-spacing",
+ "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "marker", "marker-end",
+ "marker-mid", "marker-start", "orphans", "pitch", "pitch-range", "pointer-events", "quotes", "resize", "richness",
+ "shape-rendering", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "stroke",
+ "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity",
+ "stroke-width", "tab-size", "text-align", "text-anchor", "text-decoration", "text-indent", "text-rendering",
+ "text-shadow", "text-transform", "visibility", "voice-family", "volume", "white-space", "widows", "word-break",
+ "word-spacing", "word-wrap", "writing-mode", "-webkit-aspect-ratio", "-webkit-border-horizontal-spacing",
+ "-webkit-border-vertical-spacing", "-webkit-box-direction", "-webkit-color-correction", "-webkit-font-feature-settings",
+ "-webkit-font-kerning", "-webkit-font-smoothing", "-webkit-font-variant-ligatures",
+ "-webkit-hyphenate-character", "-webkit-hyphenate-limit-after", "-webkit-hyphenate-limit-before",
+ "-webkit-hyphenate-limit-lines", "-webkit-hyphens", "-webkit-line-align", "-webkit-line-box-contain",
+ "-webkit-line-break", "-webkit-line-grid", "-webkit-line-snap", "-webkit-locale", "-webkit-nbsp-mode",
+ "-webkit-print-color-adjust", "-webkit-rtl-ordering", "-webkit-text-combine", "-webkit-text-decorations-in-effect",
+ "-webkit-text-emphasis", "-webkit-text-emphasis-color", "-webkit-text-emphasis-position", "-webkit-text-emphasis-style",
+ "-webkit-text-fill-color", "-webkit-text-orientation", "-webkit-text-security", "-webkit-text-size-adjust",
+ "-webkit-text-stroke", "-webkit-text-stroke-color", "-webkit-text-stroke-width", "-webkit-user-modify",
+ "-webkit-user-select", "-webkit-writing-mode", "-webkit-cursor-visibility", "image-orientation", "image-resolution",
+ "overflow-wrap", "-webkit-text-align-last", "-webkit-text-justify", "-webkit-ruby-position", "-webkit-text-decoration-line",
+
+ // iOS Properties
+ "-webkit-overflow-scrolling", "-webkit-touch-callout", "-webkit-tap-highlight-color"
+].keySet();
+
+WebInspector.CSSKeywordCompletions._colors = [
+ "aqua", "black", "blue", "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", "orange", "purple", "red",
+ "silver", "teal", "white", "yellow", "transparent", "currentcolor", "grey", "aliceblue", "antiquewhite",
+ "aquamarine", "azure", "beige", "bisque", "blanchedalmond", "blueviolet", "brown", "burlywood", "cadetblue",
+ "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan",
+ "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange",
+ "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey",
+ "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
+ "floralwhite", "forestgreen", "gainsboro", "ghostwhite", "gold", "goldenrod", "greenyellow", "honeydew", "hotpink",
+ "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
+ "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow",
+ "limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen",
+ "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
+ "mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen",
+ "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown",
+ "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue",
+ "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistle", "tomato", "turquoise", "violet",
+ "wheat", "whitesmoke", "yellowgreen", "rgb()", "rgba()", "hsl()", "hsla()"
+];
+
+WebInspector.CSSKeywordCompletions._colorAwareProperties = [
+ "background", "background-color", "background-image", "border", "border-color", "border-top", "border-right", "border-bottom",
+ "border-left", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", "box-shadow", "color",
+ "fill", "outline", "outline-color", "stroke", "text-line-through", "text-line-through-color", "text-overline", "text-overline-color",
+ "text-shadow", "text-underline", "text-underline-color", "-webkit-box-shadow", "-webkit-column-rule", "-webkit-column-rule-color",
+ "-webkit-text-emphasis", "-webkit-text-emphasis-color", "-webkit-text-fill-color", "-webkit-text-stroke", "-webkit-text-stroke-color",
+ "-webkit-text-decoration-color",
+
+ // iOS Properties
+ "-webkit-tap-highlight-color"
+].keySet();
+
+WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
+ "table-layout": [
+ "auto", "fixed"
+ ],
+ "visibility": [
+ "hidden", "visible", "collapse"
+ ],
+ "background-repeat": [
+ "repeat", "repeat-x", "repeat-y", "no-repeat", "space", "round"
+ ],
+ "background-blend-mode": [
+ "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
+ ],
+ "text-underline": [
+ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
+ ],
+ "content": [
+ "list-item", "close-quote", "no-close-quote", "no-open-quote", "open-quote", "attr()", "counter()", "counters()", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
+ ],
+ "list-style-image": [
+ "none", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
+ ],
+ "clear": [
+ "none", "left", "right", "both"
+ ],
+ "stroke-linejoin": [
+ "round", "miter", "bevel"
+ ],
+ "baseline-shift": [
+ "baseline", "sub", "super"
+ ],
+ "border-bottom-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "margin-top-collapse": [
+ "collapse", "separate", "discard"
+ ],
+ "-webkit-box-orient": [
+ "horizontal", "vertical", "inline-axis", "block-axis"
+ ],
+ "font-stretch": [
+ "normal", "wider", "narrower", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
+ "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
+ ],
+ "-webkit-color-correction": [
+ "default", "srgb"
+ ],
+ "border-left-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-writing-mode": [
+ "lr", "rl", "tb", "lr-tb", "rl-tb", "tb-rl", "horizontal-tb", "vertical-rl", "vertical-lr", "horizontal-bt"
+ ],
+ "text-line-through-mode": [
+ "continuous", "skip-white-space"
+ ],
+ "text-overline-mode": [
+ "continuous", "skip-white-space"
+ ],
+ "text-underline-mode": [
+ "continuous", "skip-white-space"
+ ],
+ "text-line-through-style": [
+ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
+ ],
+ "text-overline-style": [
+ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
+ ],
+ "text-underline-style": [
+ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave"
+ ],
+ "border-collapse": [
+ "collapse", "separate"
+ ],
+ "border-top-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "outline-color": [
+ "invert", "-webkit-focus-ring-color"
+ ],
+ "outline-style": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double", "auto"
+ ],
+ "cursor": [
+ "none", "copy", "auto", "crosshair", "default", "pointer", "move", "vertical-text", "cell", "context-menu",
+ "alias", "progress", "no-drop", "not-allowed", "-webkit-zoom-in", "-webkit-zoom-out", "e-resize", "ne-resize",
+ "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "ew-resize", "ns-resize",
+ "nesw-resize", "nwse-resize", "col-resize", "row-resize", "text", "wait", "help", "all-scroll", "-webkit-grab",
+ "-webkit-grabbing", "url()", "-webkit-image-set()"
+ ],
+ "border-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "size": [
+ "a3", "a4", "a5", "b4", "b5", "landscape", "ledger", "legal", "letter", "portrait"
+ ],
+ "background-image": [
+ "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
+ ],
+ "background-size": [
+ "contain", "cover"
+ ],
+ "direction": [
+ "ltr", "rtl"
+ ],
+ "enable-background": [
+ "accumulate", "new"
+ ],
+ "float": [
+ "none", "left", "right"
+ ],
+ "overflow-x": [
+ "hidden", "auto", "visible", "overlay", "scroll", "marquee"
+ ],
+ "overflow-y": [
+ "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
+ ],
+ "overflow": [
+ "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
+ ],
+ "margin-bottom-collapse": [
+ "collapse", "separate", "discard"
+ ],
+ "-webkit-box-reflect": [
+ "none", "left", "right", "above", "below"
+ ],
+ "text-rendering": [
+ "auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"
+ ],
+ "text-align": [
+ "-webkit-auto", "left", "right", "center", "justify", "-webkit-left", "-webkit-right", "-webkit-center", "-webkit-match-parent", "start", "end"
+ ],
+ "list-style-position": [
+ "outside", "inside"
+ ],
+ "margin-bottom": [
+ "auto"
+ ],
+ "color-interpolation": [
+ "linearrgb"
+ ],
+ "background-origin": [
+ "border-box", "content-box", "padding-box"
+ ],
+ "word-wrap": [
+ "normal", "break-word"
+ ],
+ "font-weight": [
+ "normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"
+ ],
+ "margin-before-collapse": [
+ "collapse", "separate", "discard"
+ ],
+ "text-overline-width": [
+ "normal", "medium", "auto", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "text-transform": [
+ "none", "capitalize", "uppercase", "lowercase"
+ ],
+ "border-right-style": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "border-left-style": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "font-style": [
+ "italic", "oblique", "normal"
+ ],
+ "speak": [
+ "none", "normal", "spell-out", "digits", "literal-punctuation", "no-punctuation"
+ ],
+ "text-line-through": [
+ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave", "continuous",
+ "skip-white-space"
+ ],
+ "color-rendering": [
+ "auto", "optimizeSpeed", "optimizeQuality"
+ ],
+ "list-style-type": [
+ "none", "disc", "circle", "square", "decimal", "decimal-leading-zero", "arabic-indic", "binary", "bengali",
+ "cambodian", "khmer", "devanagari", "gujarati", "gurmukhi", "kannada", "lower-hexadecimal", "lao", "malayalam",
+ "mongolian", "myanmar", "octal", "oriya", "persian", "urdu", "telugu", "tibetan", "thai", "upper-hexadecimal",
+ "lower-roman", "upper-roman", "lower-greek", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "afar",
+ "ethiopic-halehame-aa-et", "ethiopic-halehame-aa-er", "amharic", "ethiopic-halehame-am-et", "amharic-abegede",
+ "ethiopic-abegede-am-et", "cjk-earthly-branch", "cjk-heavenly-stem", "ethiopic", "ethiopic-halehame-gez",
+ "ethiopic-abegede", "ethiopic-abegede-gez", "hangul-consonant", "hangul", "lower-norwegian", "oromo",
+ "ethiopic-halehame-om-et", "sidama", "ethiopic-halehame-sid-et", "somali", "ethiopic-halehame-so-et", "tigre",
+ "ethiopic-halehame-tig", "tigrinya-er", "ethiopic-halehame-ti-er", "tigrinya-er-abegede",
+ "ethiopic-abegede-ti-er", "tigrinya-et", "ethiopic-halehame-ti-et", "tigrinya-et-abegede",
+ "ethiopic-abegede-ti-et", "upper-greek", "upper-norwegian", "asterisks", "footnotes", "hebrew", "armenian",
+ "lower-armenian", "upper-armenian", "georgian", "cjk-ideographic", "hiragana", "katakana", "hiragana-iroha",
+ "katakana-iroha"
+ ],
+ "-webkit-text-combine": [
+ "none", "horizontal"
+ ],
+ "outline": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "font": [
+ "caption", "icon", "menu", "message-box", "small-caption", "-webkit-mini-control", "-webkit-small-control",
+ "-webkit-control", "status-bar", "italic", "oblique", "small-caps", "normal", "bold", "bolder", "lighter",
+ "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium",
+ "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller", "larger", "serif", "sans-serif", "cursive",
+ "fantasy", "monospace", "-webkit-body", "-webkit-pictograph", "-webkit-system-font", "-apple-system-headline",
+ "-apple-system-body", "-apple-system-subheadline", "-apple-system-footnote", "-apple-system-caption1",
+ "-apple-system-caption2", "-apple-system-short-headline", "-apple-system-short-body",
+ "-apple-system-short-subheadline", "-apple-system-short-footnote", "-apple-system-short-caption1",
+ "-apple-system-tall-body"
+ ],
+ "dominant-baseline": [
+ "middle", "auto", "central", "text-before-edge", "text-after-edge", "ideographic", "alphabetic", "hanging",
+ "mathematical", "use-script", "no-change", "reset-size"
+ ],
+ "display": [
+ "none", "inline", "block", "list-item", "compact", "inline-block", "table", "inline-table",
+ "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group",
+ "table-column", "table-cell", "table-caption", "-webkit-box", "-webkit-inline-box", "-wap-marquee",
+ "-webkit-flex", "-webkit-inline-flex", "-webkit-grid", "-webkit-inline-grid"
+ ],
+ "image-rendering": [
+ "auto", "optimizeSpeed", "optimizeQuality", "-webkit-crisp-edges", "-webkit-optimize-contrast"
+ ],
+ "alignment-baseline": [
+ "baseline", "middle", "auto", "before-edge", "after-edge", "central", "text-before-edge", "text-after-edge",
+ "ideographic", "alphabetic", "hanging", "mathematical"
+ ],
+ "outline-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "text-line-through-width": [
+ "normal", "medium", "auto", "thick", "thin"
+ ],
+ "box-align": [
+ "baseline", "center", "stretch", "start", "end"
+ ],
+ "box-shadow": [
+ "none"
+ ],
+ "text-shadow": [
+ "none"
+ ],
+ "-webkit-box-shadow": [
+ "none"
+ ],
+ "border-right-width": [
+ "medium", "thick", "thin"
+ ],
+ "border-top-style": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "line-height": [
+ "normal"
+ ],
+ "counter-increment": [
+ "none"
+ ],
+ "counter-reset": [
+ "none"
+ ],
+ "text-overflow": [
+ "clip", "ellipsis"
+ ],
+ "-webkit-box-direction": [
+ "normal", "reverse"
+ ],
+ "margin-after-collapse": [
+ "collapse", "separate", "discard"
+ ],
+ "page-break-after": [
+ "left", "right", "auto", "always", "avoid"
+ ],
+ "page-break-before": [
+ "left", "right", "auto", "always", "avoid"
+ ],
+ "page-break-inside": [
+ "auto", "avoid"
+ ],
+ "-webkit-column-break-after": [
+ "left", "right", "auto", "always", "avoid"
+ ],
+ "-webkit-column-break-before": [
+ "left", "right", "auto", "always", "avoid"
+ ],
+ "-webkit-column-break-inside": [
+ "auto", "avoid"
+ ],
+ "-webkit-hyphens": [
+ "none", "auto", "manual"
+ ],
+ "border-image": [
+ "repeat", "stretch", "url()", "linear-gradient()", "radial-gradient()", "repeating-linear-gradient()", "repeating-radial-gradient()", "-webkit-canvas()", "-webkit-cross-fade()", "-webkit-image-set()"
+ ],
+ "border-image-repeat": [
+ "repeat", "stretch", "space", "round"
+ ],
+ "-webkit-mask-box-image-repeat": [
+ "repeat", "stretch", "space", "round"
+ ],
+ "position": [
+ "absolute", "fixed", "relative", "static", "-webkit-sticky"
+ ],
+ "font-family": [
+ "serif", "sans-serif", "cursive", "fantasy", "monospace", "-webkit-body", "-webkit-pictograph", "-webkit-system-font"
+ ],
+ "text-overflow-mode": [
+ "clip", "ellipsis"
+ ],
+ "border-bottom-style": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "unicode-bidi": [
+ "normal", "bidi-override", "embed", "-webkit-plaintext", "-webkit-isolate", "-webkit-isolate-override"
+ ],
+ "clip-rule": [
+ "nonzero", "evenodd"
+ ],
+ "margin-left": [
+ "auto"
+ ],
+ "margin-top": [
+ "auto"
+ ],
+ "zoom": [
+ "normal", "document", "reset"
+ ],
+ "z-index": [
+ "auto"
+ ],
+ "width": [
+ "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "height": [
+ "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "max-width": [
+ "none", "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "min-width": [
+ "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "max-height": [
+ "none", "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "min-height": [
+ "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-logical-width": [
+ "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-logical-height": [
+ "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-max-logical-width": [
+ "none", "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-min-logical-width": [
+ "intrinsic", "min-intrinsic", "-webkit-min-content", "-webkit-max-content", "-webkit-fill-available", "-webkit-fit-content", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-max-logical-height": [
+ "none", "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-min-logical-height": [
+ "intrinsic", "min-intrinsic", "calc()", "-webkit-calc()"
+ ],
+ "empty-cells": [
+ "hide", "show"
+ ],
+ "pointer-events": [
+ "none", "all", "auto", "visible", "visiblepainted", "visiblefill", "visiblestroke", "painted", "fill", "stroke"
+ ],
+ "letter-spacing": [
+ "normal", "calc()", "-webkit-calc()"
+ ],
+ "word-spacing": [
+ "normal", "calc()", "-webkit-calc()"
+ ],
+ "background-clip": [
+ "border-box", "content-box", "padding-box"
+ ],
+ "-webkit-font-kerning": [
+ "auto", "normal", "none"
+ ],
+ "-webkit-font-smoothing": [
+ "none", "auto", "antialiased", "subpixel-antialiased"
+ ],
+ "border": [
+ "none", "hidden", "inset", "groove", "ridge", "outset", "dotted", "dashed", "solid", "double"
+ ],
+ "font-size": [
+ "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller",
+ "larger"
+ ],
+ "font-variant": [
+ "small-caps", "normal"
+ ],
+ "vertical-align": [
+ "baseline", "middle", "sub", "super", "text-top", "text-bottom", "top", "bottom", "-webkit-baseline-middle"
+ ],
+ "white-space": [
+ "normal", "nowrap", "pre", "pre-line", "pre-wrap"
+ ],
+ "word-break": [
+ "normal", "break-all", "break-word"
+ ],
+ "text-underline-width": [
+ "normal", "medium", "auto", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "text-indent": [
+ "-webkit-each-line", "-webkit-hanging"
+ ],
+ "-webkit-box-lines": [
+ "single", "multiple"
+ ],
+ "clip": [
+ "auto", "rect()"
+ ],
+ "clip-path": [
+ "none", "url()", "rectangle()", "circle()", "ellipse()", "polygon()", "inset-rectangle()"
+ ],
+ "orphans": [
+ "auto"
+ ],
+ "widows": [
+ "auto"
+ ],
+ "margin": [
+ "auto"
+ ],
+ "page": [
+ "auto"
+ ],
+ "-webkit-marquee-increment": [
+ "small", "large", "medium"
+ ],
+ "-webkit-marquee-direction": [
+ "left", "right", "auto", "reverse", "forwards", "backwards", "ahead", "up", "down"
+ ],
+ "-webkit-marquee-style": [
+ "none", "scroll", "slide", "alternate"
+ ],
+ "-webkit-marquee-repetition": [
+ "infinite"
+ ],
+ "-webkit-marquee-speed": [
+ "normal", "slow", "fast"
+ ],
+ "margin-right": [
+ "auto"
+ ],
+ "marquee-speed": [
+ "normal", "slow", "fast"
+ ],
+ "-webkit-text-emphasis": [
+ "circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
+ ],
+ "-webkit-text-emphasis-style": [
+ "circle", "filled", "open", "dot", "double-circle", "triangle", "sesame"
+ ],
+ "-webkit-text-emphasis-position": [
+ "over", "under"
+ ],
+ "-webkit-transform": [
+ "none",
+ "scale()", "scaleX()", "scaleY()", "scale3d()", "rotate()", "rotateX()", "rotateY()", "rotateZ()", "rotate3d()", "skew()", "skewX()", "skewY()",
+ "translate()", "translateX()", "translateY()", "translateZ()", "translate3d()", "matrix()", "matrix3d()", "perspective()"
+ ],
+ "-webkit-cursor-visibility": [
+ "auto", "auto-hide"
+ ],
+ "text-decoration": [
+ "none", "underline", "overline", "line-through", "blink"
+ ],
+ "-webkit-text-decorations-in-effect": [
+ "none", "underline", "overline", "line-through", "blink",
+ ],
+ "-webkit-text-decoration-line": [
+ "none", "underline", "overline", "line-through", "blink",
+ ],
+ "-webkit-text-decoration-style": [
+ "solid", "double", "dotted", "dashed", "wavy"
+ ],
+ "-webkit-text-underline-position": [
+ "auto", "alphabetic", "under"
+ ],
+ "image-resolution": [
+ "from-image", "snap"
+ ],
+ "-webkit-blend-mode": [
+ "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
+ ],
+ "mix": [
+ "auto",
+ "normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity",
+ "clear", "copy", "destination", "source-over", "destination-over", "source-in", "destination-in", "source-out", "destination-out", "source-atop", "destination-atop", "xor"
+ ],
+ "geometry": [
+ "detached", "attached", "grid()"
+ ],
+ "overflow-wrap": [
+ "normal", "break-word"
+ ],
+ "transition": [
+ "none", "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()", "all", WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder
+ ],
+ "transition-timing-function": [
+ "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()"
+ ],
+ "transition-property": [
+ "all", "none", WebInspector.CSSKeywordCompletions.AllPropertyNamesPlaceholder
+ ],
+ "-webkit-column-progression": [
+ "normal", "reverse"
+ ],
+ "-webkit-box-decoration-break": [
+ "slice", "clone"
+ ],
+ "-webkit-align-content": [
+ "flex-start", "flex-end", "center", "space-between", "space-around", "stretch"
+ ],
+ "-webkit-align-items": [
+ "flex-start", "flex-end", "center", "baseline", "stretch"
+ ],
+ "-webkit-align-self": [
+ "auto", "flex-start", "flex-end", "center", "baseline", "stretch"
+ ],
+ "-webkit-justify-content": [
+ "flex-start", "flex-end", "center", "space-between", "space-around"
+ ],
+ "-webkit-flex-direction": [
+ "row", "row-reverse", "column", "column-reverse"
+ ],
+ "-webkit-flex-wrap": [
+ "nowrap", "wrap", "wrap-reverse"
+ ],
+ "-webkit-flex-flow": [
+ "row", "row-reverse", "column", "column-reverse",
+ "nowrap", "wrap", "wrap-reverse"
+ ],
+ "-webkit-flex": [
+ "none"
+ ],
+ "-webkit-flex-basis": [
+ "auto"
+ ],
+ "-webkit-grid-after": [
+ "auto"
+ ],
+ "-webkit-grid-before": [
+ "auto"
+ ],
+ "-webkit-grid-end": [
+ "auto"
+ ],
+ "-webkit-grid-start": [
+ "auto"
+ ],
+ "-webkit-grid-auto-flow": [
+ "none", "rows", "columns"
+ ],
+ "-webkit-grid-column": [
+ "auto"
+ ],
+ "-webkit-grid-row": [
+ "auto"
+ ],
+ "-webkit-grid-columns": [
+ "auto", "-webkit-max-content", "-webkit-min-content"
+ ],
+ "-webkit-grid-rows": [
+ "auto", "-webkit-max-content", "-webkit-min-content"
+ ],
+ "-webkit-ruby-position": [
+ "after", "before"
+ ],
+ "-webkit-text-align-last": [
+ "auto", "start", "end", "left", "right", "center", "justify"
+ ],
+ "-webkit-text-justify": [
+ "auto", "none", "inter-word", "inter-ideograph", "inter-cluster", "distribute", "kashida"
+ ],
+ "max-zoom": [
+ "auto"
+ ],
+ "min-zoom": [
+ "auto"
+ ],
+ "orientation": [
+ "auto", "portait", "landscape"
+ ],
+ "user-zoom": [
+ "zoom", "fixed"
+ ],
+ "-webkit-app-region": [
+ "drag", "no-drag"
+ ],
+ "-webkit-line-break": [
+ "auto", "loose", "normal", "strict", "after-white-space"
+ ],
+ "-webkit-background-composite": [
+ "clear", "copy", "source-over", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "xor", "plus-darker", "plus-lighter"
+ ],
+ "-webkit-mask-composite": [
+ "clear", "copy", "source-over", "source-in", "source-out", "source-atop", "destination-over", "destination-in", "destination-out", "destination-atop", "xor", "plus-darker", "plus-lighter"
+ ],
+ "-webkit-animation-direction": [
+ "normal", "alternate", "reverse", "alternate-reverse"
+ ],
+ "-webkit-animation-fill-mode": [
+ "none", "forwards", "backwards", "both"
+ ],
+ "-webkit-animation-iteration-count": [
+ "infinite"
+ ],
+ "-webkit-animation-play-state": [
+ "paused", "running"
+ ],
+ "-webkit-animation-timing-function": [
+ "ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end", "steps()", "cubic-bezier()"
+ ],
+ "-webkit-column-span": [
+ "all", "none", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-region-break-after": [
+ "auto", "always", "avoid", "left", "right"
+ ],
+ "-webkit-region-break-before": [
+ "auto", "always", "avoid", "left", "right"
+ ],
+ "-webkit-region-break-inside": [
+ "auto", "avoid"
+ ],
+ "-webkit-region-overflow": [
+ "auto", "break"
+ ],
+ "-webkit-wrap-flow": [
+ "auto", "both", "start", "end", "maximum", "clear"
+ ],
+ "-webkit-wrap-through": [
+ "wrap", "none"
+ ],
+ "-webkit-backface-visibility": [
+ "visible", "hidden"
+ ],
+ "resize": [
+ "none", "both", "horizontal", "vertical", "auto"
+ ],
+ "caption-side": [
+ "top", "bottom", "left", "right"
+ ],
+ "box-sizing": [
+ "border-box", "content-box"
+ ],
+ "-webkit-border-fit": [
+ "border", "lines"
+ ],
+ "-webkit-line-align": [
+ "none", "edges"
+ ],
+ "-webkit-line-snap": [
+ "none", "baseline", "contain"
+ ],
+ "-webkit-nbsp-mode": [
+ "normal", "space"
+ ],
+ "-webkit-print-color-adjust": [
+ "exact", "economy"
+ ],
+ "-webkit-rtl-ordering": [
+ "logical", "visual"
+ ],
+ "-webkit-text-security": [
+ "disc", "circle", "square", "none"
+ ],
+ "-webkit-transform-style": [
+ "flat", "preserve-3d"
+ ],
+ "-webkit-user-drag": [
+ "auto", "none", "element"
+ ],
+ "-webkit-user-modify": [
+ "read-only", "read-write", "read-write-plaintext-only"
+ ],
+ "-webkit-text-stroke-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-border-start-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-border-end-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-border-before-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-border-after-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-column-rule-width": [
+ "medium", "thick", "thin", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-aspect-ratio": [
+ "none"
+ ],
+ "-webkit-filter": [
+ "none", "grayscale()", "sepia()", "saturate()", "hue-rotate()", "invert()", "opacity()", "brightness()", "contrast()", "blur()", "drop-shadow()", "custom()"
+ ],
+ "-webkit-perspective": [
+ "none"
+ ],
+ "-webkit-column-count": [
+ "auto", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-column-gap": [
+ "normal", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-column-axis": [
+ "horizontal", "vertical", "auto"
+ ],
+ "-webkit-column-width": [
+ "auto", "calc()", "-webkit-calc()"
+ ],
+ "-webkit-hyphenate-character": [
+ "none"
+ ],
+ "-webkit-hyphenate-limit-after": [
+ "auto"
+ ],
+ "-webkit-hyphenate-limit-before": [
+ "auto"
+ ],
+ "-webkit-hyphenate-limit-lines": [
+ "no-limit"
+ ],
+ "-webkit-line-grid": [
+ "none"
+ ],
+ "-webkit-locale": [
+ "auto"
+ ],
+ "-webkit-text-orientation": [
+ "sideways", "sideways-right", "vertical-right", "upright"
+ ],
+ "-webkit-line-box-contain": [
+ "block", "inline", "font", "glyphs", "replaced", "inline-box", "none", "initial"
+ ],
+ "-webkit-font-feature-settings": [
+ "normal"
+ ],
+ "-webkit-font-variant-ligatures": [
+ "normal", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures"
+ ],
+ /*
+ "-webkit-appearance": [
+ "none", "checkbox", "radio", "push-button", "square-button", "button", "button-bevel", "default-button", "inner-spin-button", "-webkit-input-speech-button", "listbox", "listitem", "media-enter-fullscreen-button", "media-exit-fullscreen-button", "media-fullscreen-volume-slider", "media-fullscreen-volume-slider-thumb", "media-mute-button", "media-play-button", "media-overlay-play-button", "media-seek-back-button", "media-seek-forward-button", "media-rewind-button", "media-return-to-realtime-button", "media-toggle-closed-captions-button", "media-slider", "media-sliderthumb", "media-volume-slider-container", "media-volume-slider", "media-volume-sliderthumb", "media-volume-slider-mute-button", "media-controls-background", "media-controls-fullscreen-background", "media-current-time-display", "media-time-remaining-display", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "meter", "progress-bar", "progress-bar-value", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "caret", "searchfield", "searchfield-decoration", "searchfield-results-decoration", "searchfield-results-button", "searchfield-cancel-button", "snapshotted-plugin-overlay", "textfield", "relevancy-level-indicator", "continuous-capacity-level-indicator", "discrete-capacity-level-indicator", "rating-level-indicator", "textarea"
+ ],
+ */
+
+ // iOS Properties
+ "-webkit-text-size-adjust": [
+ "none", "auto"
+ ],
+ "-webkit-touch-callout": [
+ "default", "none"
+ ],
+ "-webkit-overflow-scrolling": [
+ "auto", "touch"
+ ]
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSMediajsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSMediajs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSMedia.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSMedia.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSMedia.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSMedia.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSMedia = function(type, text, sourceCodeLocation)
+{
+ WebInspector.Object.call(this);
+
+ this._type = type || null;
+ this._text = text || "";
+ this._sourceCodeLocation = sourceCodeLocation || null;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSMedia);
+
+WebInspector.CSSMedia.Type = {
+ MediaRule: "css-media-type-media-rule",
+ ImportRule: "css-media-type-import-rule",
+ LinkedStyleSheet: "css-media-type-linked-stylesheet",
+ InlineStyleSheet: "css-media-type-inline-stylesheet"
+};
+
+WebInspector.CSSMedia.prototype = {
+ constructor: WebInspector.CSSMedia,
+
+ // Public
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get text()
+ {
+ return this._text;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ }
+};
+
+WebInspector.CSSMedia.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSPropertyjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSPropertyjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSProperty.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,454 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSProperty = function(index, text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange)
+{
+ WebInspector.Object.call(this);
+
+ this._ownerStyle = null;
+ this._index = index;
+
+ this.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange, true);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSProperty);
+
+WebInspector.CSSProperty.Event = {
+ Changed: "css-property-changed",
+ OverriddenStatusChanged: "css-property-overridden-status-changed"
+};
+
+WebInspector.CSSProperty.prototype = {
+ constructor: WebInspector.CSSProperty,
+
+ // Public
+
+ get ownerStyle()
+ {
+ return this._ownerStyle;
+ },
+
+ set ownerStyle(ownerStyle)
+ {
+ this._ownerStyle = ownerStyle || null;
+ },
+
+ get index()
+ {
+ return this._index;
+ },
+
+ set index(index)
+ {
+ this._index = index;
+ },
+
+ update: function(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange, dontFireEvents)
+ {
+ text = text || "";
+ name = name || "";
+ value = value || "";
+ priority = priority || "";
+ enabled = enabled || false;
+ overridden = overridden || false;
+ implicit = implicit || false;
+ anonymous = anonymous || false;
+ valid = valid || false;
+
+ var changed = false;
+
+ if (!dontFireEvents) {
+ changed = this._name !== name || this._value !== value || this._priority !== priority ||
+ this._enabled !== enabled || this._implicit !== implicit || this._anonymous !== anonymous || this._valid !== valid;
+ }
+
+ // Use the setter for overridden if we want to fire events since the
+ // OverriddenStatusChanged event coalesces changes before it fires.
+ if (!dontFireEvents)
+ this.overridden = overridden;
+ else
+ this._overridden = overridden;
+
+ this._text = text;
+ this._name = name;
+ this._value = value;
+ this._priority = priority;
+ this._enabled = enabled;
+ this._implicit = implicit;
+ this._anonymous = anonymous;
+ this._inherited = name in WebInspector.CSSKeywordCompletions.InheritedProperties;
+ this._valid = valid;
+ this._styleSheetTextRange = styleSheetTextRange || null;
+
+ if (styleDeclarationTextRange)
+ this._styleDeclarationTextRange = styleDeclarationTextRange;
+ else
+ delete this._styleDeclarationTextRange;
+
+ this._relatedShorthandProperty = null;
+ this._relatedLonghandProperties = [];
+
+ delete this._canonicalName;
+ delete this._hasOtherVendorNameOrKeyword;
+
+ if (!this._updatePropertySoonTimeout) {
+ delete this._pendingName;
+ delete this._pendingValue;
+ delete this._pendingPriority;
+ }
+
+ if (changed)
+ this.dispatchEventToListeners(WebInspector.CSSProperty.Event.Changed);
+ },
+
+ get synthesizedText()
+ {
+ var name = this.name;
+ if (!name)
+ return "";
+
+ var priority = this.priority;
+ return name + ": " + this.value.trim() + (priority ? " !" + priority : "") + ";";
+ },
+
+ get text()
+ {
+ return this._text || this.synthesizedText;
+ },
+
+ set text(text)
+ {
+ if (!this._ownerStyle || !this._ownerStyle.editable)
+ return;
+
+ if (this._text === text)
+ return;
+
+ if (isNaN(this._index)) {
+ this._text = text || "";
+
+ // Clear the name, value and priority since they might not match the text now.
+ this._name = "";
+ this._value = "";
+ this._priority = "";
+
+ // Ditto for the canonical and pending properties.
+ delete this._canonicalName;
+ delete this._pendingName;
+ delete this._pendingValue;
+ delete this._pendingPriority;
+
+ return;
+ }
+
+ this._cancelPendingUpdate();
+ this._ownerStyle.nodeStyles.changePropertyText(this, text);
+ },
+
+ get name()
+ {
+ if (isNaN(this._index))
+ return this._pendingName || this._name;
+ return this._name;
+ },
+
+ set name(name)
+ {
+ if (!this._ownerStyle || !this._ownerStyle.editable)
+ return;
+
+ if (this._name === name)
+ return;
+
+ if (isNaN(this._index)) {
+ this._name = name;
+ this._text = "";
+
+ delete this._canonicalName;
+ } else {
+ this._pendingName = name;
+ this._updatePropertySoon();
+ }
+ },
+
+ get canonicalName()
+ {
+ if (this._canonicalName)
+ return this._canonicalName;
+
+ this._canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(this.name);
+
+ return this._canonicalName;
+ },
+
+ get value()
+ {
+ if (isNaN(this._index))
+ return this._pendingValue || this._value;
+ return this._value;
+ },
+
+ set value(value)
+ {
+ if (!this._ownerStyle || !this._ownerStyle.editable)
+ return;
+
+ if (this._value === value)
+ return;
+
+ if (isNaN(this._index)) {
+ this._value = value;
+ this._text = "";
+ } else {
+ this._pendingValue = value;
+ this._updatePropertySoon();
+ }
+ },
+
+ get important()
+ {
+ return this.priority === "important";
+ },
+
+ set important(important)
+ {
+ this.priority = important ? "important" : "";
+ },
+
+ get priority()
+ {
+ if (isNaN(this._index))
+ return this._pendingPriority || this._priority;
+ return this._priority;
+ },
+
+ set priority(priority)
+ {
+ if (!this._ownerStyle || !this._ownerStyle.editable)
+ return;
+
+ if (this._priority === priority)
+ return;
+
+ if (isNaN(this._index)) {
+ this._priority = priority;
+ this._text = "";
+ } else {
+ this._pendingPriority = priority;
+ this._updatePropertySoon();
+ }
+ },
+
+ get enabled()
+ {
+ return this._enabled && this._ownerStyle && (!isNaN(this._index) || this._ownerStyle.type === WebInspector.CSSStyleDeclaration.Type.Computed);
+ },
+
+ set enabled(enabled)
+ {
+ if (!this._ownerStyle || !this._ownerStyle.editable)
+ return;
+
+ this._ownerStyle.nodeStyles.changePropertyEnabledState(this, enabled);
+ },
+
+ get overridden()
+ {
+ return this._overridden;
+ },
+
+ set overridden(overridden)
+ {
+ overridden = overridden || false;
+
+ if (this._overridden === overridden)
+ return;
+
+ var previousOverridden = this._overridden;
+
+ this._overridden = overridden;
+
+ if (this._overriddenStatusChangedTimeout)
+ return;
+
+ function delayed()
+ {
+ delete this._overriddenStatusChangedTimeout;
+
+ if (this._overridden === previousOverridden)
+ return;
+
+ this.dispatchEventToListeners(WebInspector.CSSProperty.Event.OverriddenStatusChanged);
+ }
+
+ this._overriddenStatusChangedTimeout = setTimeout(delayed.bind(this), 0);
+ },
+
+ get implicit()
+ {
+ return this._implicit;
+ },
+
+ get anonymous()
+ {
+ return this._anonymous;
+ },
+
+ get inherited()
+ {
+ return this._inherited;
+ },
+
+ get valid()
+ {
+ return this._valid;
+ },
+
+ get styleSheetTextRange()
+ {
+ return this._styleSheetTextRange;
+ },
+
+ get styleDeclarationTextRange()
+ {
+ if ("_styleDeclarationTextRange" in this)
+ return this._styleDeclarationTextRange;
+
+ if (!this._ownerStyle || !this._styleSheetTextRange)
+ return null;
+
+ var styleTextRange = this._ownerStyle.styleSheetTextRange;
+ if (!styleTextRange)
+ return null;
+
+ var startLine = this._styleSheetTextRange.startLine - styleTextRange.startLine;
+ var endLine = this._styleSheetTextRange.endLine - styleTextRange.startLine;
+
+ var startColumn = this._styleSheetTextRange.startColumn;
+ if (!startLine)
+ startColumn -= styleTextRange.startColumn;
+
+ var endColumn = this._styleSheetTextRange.endColumn;
+ if (!endLine)
+ endColumn -= styleTextRange.startColumn;
+
+ this._styleDeclarationTextRange = new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
+
+ return this._styleDeclarationTextRange;
+ },
+
+ get relatedShorthandProperty()
+ {
+ return this._relatedShorthandProperty;
+ },
+
+ set relatedShorthandProperty(property)
+ {
+ this._relatedShorthandProperty = property || null;
+ },
+
+ get relatedLonghandProperties()
+ {
+ return this._relatedLonghandProperties;
+ },
+
+ addRelatedLonghandProperty: function(property)
+ {
+ this._relatedLonghandProperties.push(property);
+ },
+
+ clearRelatedLonghandProperties: function(property)
+ {
+ this._relatedLonghandProperties = [];
+ },
+
+ hasOtherVendorNameOrKeyword: function()
+ {
+ if ("_hasOtherVendorNameOrKeyword" in this)
+ return this._hasOtherVendorNameOrKeyword;
+
+ this._hasOtherVendorNameOrKeyword = WebInspector.cssStyleManager.propertyNameHasOtherVendorPrefix(this.name) || WebInspector.cssStyleManager.propertyValueHasOtherVendorKeyword(this.value);
+
+ return this._hasOtherVendorNameOrKeyword;
+ },
+
+ add: function()
+ {
+ // We can only add if the index is NaN. Return early otherwise.
+ if (!this._ownerStyle || !this._ownerStyle.editable || !isNaN(this._index))
+ return;
+
+ this._cancelPendingUpdate();
+ this._ownerStyle.addProperty(this);
+ },
+
+ remove: function()
+ {
+ // We can only remove if the index is not NaN. Return early otherwise.
+ if (!this._ownerStyle || !this._ownerStyle.editable || isNaN(this._index))
+ return;
+
+ this._cancelPendingUpdate();
+ this._ownerStyle.removeProperty(this);
+ },
+
+ // Private
+
+ _updatePropertySoon: function()
+ {
+ if (!this._ownerStyle || isNaN(this._index) || this._updatePropertySoonTimeout)
+ return;
+
+ function performUpdate()
+ {
+ delete this._updatePropertySoonTimeout;
+
+ if (!this._ownerStyle || isNaN(this._index))
+ return;
+
+ var name = "_pendingName" in this ? this._pendingName : this._name;
+ var value = "_pendingValue" in this ? this._pendingValue : this._value;
+ var priority = "_pendingPriority" in this ? this._pendingPriority : this._priority;
+
+ delete this._pendingName;
+ delete this._pendingValue;
+ delete this._pendingPriority;
+
+ this._ownerStyle.nodeStyles.changeProperty(this, name, value, priority);
+ }
+
+ this._updatePropertySoonTimeout = setTimeout(performUpdate.bind(this), 0);
+ },
+
+ _cancelPendingUpdate: function()
+ {
+ if (!this._updatePropertySoonTimeout)
+ return;
+ clearTimeout(this._updatePropertySoonTimeout);
+ delete this._updatePropertySoonTimeout;
+ }
+};
+
+WebInspector.CSSProperty.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSRulejsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSRulejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSRule.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,204 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSRule = function(nodeStyles, ownerStyleSheet, id, type, sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(nodeStyles);
+ this._nodeStyles = nodeStyles;
+
+ this._ownerStyleSheet = ownerStyleSheet || null;
+ this._id = id || null;
+ this._type = type || null;
+
+ this.update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, true);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSRule);
+
+WebInspector.CSSRule.Event = {
+ Changed: "css-rule-changed"
+};
+
+WebInspector.CSSRule.Type = {
+ Author: "css-rule-type-author",
+ User: "css-rule-type-user",
+ UserAgent: "css-rule-type-user-agent",
+ Inspector: "css-rule-type-inspector"
+};
+
+WebInspector.CSSRule.prototype = {
+ constructor: WebInspector.CSSRule,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get ownerStyleSheet()
+ {
+ return this._ownerStyleSheet;
+ },
+
+ get editable()
+ {
+ return !!this._id && (this._type === WebInspector.CSSRule.Type.Author || this._type === WebInspector.CSSRule.Type.Inspector);
+ },
+
+ update: function(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, dontFireEvents)
+ {
+ sourceCodeLocation = sourceCodeLocation || null;
+ selectorText = selectorText || "";
+ selectors = selectors || [];
+ matchedSelectorIndices = matchedSelectorIndices || [];
+ style = style || null;
+ mediaList = mediaList || [];
+
+ var changed = false;
+ if (!dontFireEvents) {
+ changed = this._selectorText !== selectorText || !Object.shallowEqual(this._selectors, selectors) ||
+ !Object.shallowEqual(this._matchedSelectorIndices, matchedSelectorIndices) || this._style !== style ||
+ !!this._sourceCodeLocation !== !!sourceCodeLocation || this._mediaList.length !== mediaList.length;
+ // FIXME: Look for differences in the media list arrays.
+ }
+
+ if (this._style)
+ this._style.ownerRule = null;
+
+ this._sourceCodeLocation = sourceCodeLocation;
+ this._selectorText = selectorText;
+ this._selectors = selectors;
+ this._matchedSelectorIndices = matchedSelectorIndices;
+ this._style = style;
+ this._mediaList = mediaList;
+
+ delete this._matchedSelectors;
+ delete this._matchedSelectorText;
+
+ if (this._style)
+ this._style.ownerRule = this;
+
+ if (changed)
+ this.dispatchEventToListeners(WebInspector.CSSRule.Event.Changed);
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ get selectorText()
+ {
+ return this._selectorText;
+ },
+
+ set selectorText(selectorText)
+ {
+ console.assert(this.editable);
+ if (!this.editable)
+ return;
+
+ if (this._selectorText === selectorText)
+ return;
+
+ this._nodeStyles.changeRuleSelector(this, selectorText);
+ },
+
+ get selectors()
+ {
+ return this._selectors;
+ },
+
+ set selectors(selectors)
+ {
+ this.selectorText = (selectors || []).join(", ");
+ },
+
+ get matchedSelectorIndices()
+ {
+ return this._matchedSelectorIndices;
+ },
+
+ get matchedSelectors()
+ {
+ // COMPATIBILITY (iOS 6): The selectors array is always empty, so just return an empty array.
+ if (!this._selectors.length) {
+ console.assert(!this._matchedSelectorIndices.length);
+ return [];
+ }
+
+ if (this._matchedSelectors)
+ return this._matchedSelectors;
+
+ this._matchedSelectors = this._selectors.filter(function(element, index) {
+ return this._matchedSelectorIndices.contains(index);
+ }, this);
+
+ return this._matchedSelectors;
+ },
+
+ get matchedSelectorText()
+ {
+ // COMPATIBILITY (iOS 6): The selectors array is always empty, so just return the whole selector.
+ if (!this._selectors.length) {
+ console.assert(!this._matchedSelectorIndices.length);
+ return this._selectorText;
+ }
+
+ if ("_matchedSelectorText" in this)
+ return this._matchedSelectorText;
+
+ this._matchedSelectorText = this.matchedSelectors.join(", ");
+
+ return this._matchedSelectorText;
+ },
+
+ get style()
+ {
+ return this._style;
+ },
+
+ get mediaList()
+ {
+ return this._mediaList;
+ },
+
+ // Protected
+
+ get nodeStyles()
+ {
+ return this._nodeStyles;
+ }
+};
+
+WebInspector.CSSRule.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclaration.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,310 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclaration = function(nodeStyles, ownerStyleSheet, id, type, node, inherited, text, properties, styleSheetTextRange)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(nodeStyles);
+ this._nodeStyles = nodeStyles;
+
+ this._ownerRule = null;
+
+ this._ownerStyleSheet = ownerStyleSheet || null;
+ this._id = id || null;
+ this._type = type || null;
+ this._node = node || null;
+ this._inherited = inherited || false;
+
+ this._pendingProperties = [];
+ this._propertyNameMap = {};
+
+ this.update(text, properties, styleSheetTextRange, true);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleDeclaration);
+
+WebInspector.CSSStyleDeclaration.Event = {
+ PropertiesChanged: "css-style-declaration-properties-changed"
+};
+
+WebInspector.CSSStyleDeclaration.Type = {
+ Rule: "css-style-declaration-type-rule",
+ Inline: "css-style-declaration-type-inline",
+ Attribute: "css-style-declaration-type-attribute",
+ Computed: "css-style-declaration-type-computed"
+};
+
+WebInspector.CSSStyleDeclaration.prototype = {
+ constructor: WebInspector.CSSStyleDeclaration,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get ownerStyleSheet()
+ {
+ return this._ownerStyleSheet;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get inherited()
+ {
+ return this._inherited;
+ },
+
+ get node()
+ {
+ return this._node;
+ },
+
+ get editable()
+ {
+ return !!this._id && ((this._type === WebInspector.CSSStyleDeclaration.Type.Rule && this._ownerRule && this._ownerRule.editable) || this._type === WebInspector.CSSStyleDeclaration.Type.Inline);
+ },
+
+ update: function(text, properties, styleSheetTextRange, dontFireEvents)
+ {
+ text = text || "";
+ properties = properties || [];
+
+ var oldProperties = this._properties || [];
+ var oldText = this._text;
+
+ this._text = text;
+ this._properties = properties;
+ this._styleSheetTextRange = styleSheetTextRange;
+ this._propertyNameMap = {};
+
+ delete this._visibleProperties;
+
+ var editable = this.editable;
+
+ for (var i = 0; i < this._properties.length; ++i) {
+ var property = this._properties[i];
+ property.ownerStyle = this;
+
+ // Store the property in a map if we arn't editable. This
+ // allows for quick lookup for computed style. Editable
+ // styles don't use the map since they need to account for
+ // overridden properties.
+ if (!editable)
+ this._propertyNameMap[property.name] = property;
+ else {
+ // Remove from pendingProperties (if it was pending).
+ this._pendingProperties.remove(property);
+ }
+ }
+
+ var removedProperties = [];
+ for (var i = 0; i < oldProperties.length; ++i) {
+ var oldProperty = oldProperties[i];
+
+ if (!this._properties.contains(oldProperty)) {
+ // Clear the index, since it is no longer valid.
+ oldProperty.index = NaN;
+
+ removedProperties.push(oldProperty);
+
+ // Keep around old properties in pending in case they
+ // are needed again during editing.
+ if (editable)
+ this._pendingProperties.push(oldProperty);
+ }
+ }
+
+ if (dontFireEvents)
+ return;
+
+ var addedProperties = [];
+ for (var i = 0; i < this._properties.length; ++i) {
+ if (!oldProperties.contains(this._properties[i]))
+ addedProperties.push(this._properties[i]);
+ }
+
+ // Don't fire the event if there is text and it hasn't changed.
+ if (oldText && this._text && oldText === this._text) {
+ // We shouldn't have any added or removed properties in this case.
+ console.assert(!addedProperties.length && !removedProperties.length);
+ if (!addedProperties.length && !removedProperties.length)
+ return;
+ }
+
+ function delayed()
+ {
+ this.dispatchEventToListeners(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, {addedProperties: addedProperties, removedProperties: removedProperties});
+ }
+
+ // Delay firing the PropertiesChanged event so DOMNodeStyles has a chance to mark overridden and associated properties.
+ setTimeout(delayed.bind(this), 0);
+ },
+
+ get ownerRule()
+ {
+ return this._ownerRule;
+ },
+
+ set ownerRule(rule)
+ {
+ this._ownerRule = rule || null;
+ },
+
+ get text()
+ {
+ return this._text;
+ },
+
+ set text(text)
+ {
+ if (this._text === text)
+ return;
+
+ this._nodeStyles.changeStyleText(this, text);
+ },
+
+ get properties()
+ {
+ return this._properties;
+ },
+
+ get visibleProperties()
+ {
+ if (this._visibleProperties)
+ return this._visibleProperties;
+
+ this._visibleProperties = this._properties.filter(function(property) {
+ return !!property.styleDeclarationTextRange;
+ });
+
+ return this._visibleProperties;
+ },
+
+ get pendingProperties()
+ {
+ return this._pendingProperties;
+ },
+
+ get styleSheetTextRange()
+ {
+ return this._styleSheetTextRange;
+ },
+
+ propertyForName: function(name, dontCreateIfMissing)
+ {
+ console.assert(name);
+ if (!name)
+ return null;
+
+ if (!this.editable)
+ return this._propertyNameMap[name] || null;
+
+ // Editable styles don't use the map since they need to
+ // account for overridden properties.
+
+ function findMatch(properties)
+ {
+ for (var i = 0; i < properties.length; ++i) {
+ var property = properties[i];
+ if (property.canonicalName !== name && property.name !== name)
+ continue;
+ if (bestMatchProperty && !bestMatchProperty.overridden && property.overridden)
+ continue;
+ bestMatchProperty = property;
+ }
+ }
+
+ var bestMatchProperty = null;
+
+ findMatch(this._properties);
+
+ if (bestMatchProperty)
+ return bestMatchProperty;
+
+ if (dontCreateIfMissing || !this.editable)
+ return null;
+
+ findMatch(this._pendingProperties, true);
+
+ if (bestMatchProperty)
+ return bestMatchProperty;
+
+ var newProperty = new WebInspector.CSSProperty(NaN, null, name);
+ newProperty.ownerStyle = this;
+
+ this._pendingProperties.push(newProperty);
+
+ return newProperty;
+ },
+
+ addProperty: function(property)
+ {
+ console.assert(property);
+ if (!property)
+ return;
+
+ console.assert(property.ownerStyle === this);
+ if (property.ownerStyle !== this)
+ return;
+
+ console.assert(this.editable);
+ if (!this.editable)
+ return;
+
+ this._nodeStyles.addProperty(property);
+ },
+
+ removeProperty: function(property)
+ {
+ console.assert(property);
+ if (!property)
+ return;
+
+ console.assert(property.ownerStyle === this);
+ if (property.ownerStyle !== this)
+ return;
+
+ console.assert(this.editable);
+ if (!this.editable)
+ return;
+
+ this._nodeStyles.removeProperty(property);
+ },
+
+ // Protected
+
+ get nodeStyles()
+ {
+ return this._nodeStyles;
+ }
+};
+
+WebInspector.CSSStyleDeclaration.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleSheetjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleSheetjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleSheet.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleSheet = function(id, url, parentFrame)
+{
+ WebInspector.SourceCode.call(this);
+
+ console.assert(id);
+
+ this._id = id || null;
+
+ this.updateInfo(url, parentFrame);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleSheet);
+
+WebInspector.CSSStyleSheet.resetUniqueDisplayNameNumbers = function()
+{
+ WebInspector.CSSStyleSheet._nextUniqueDisplayNameNumber = 1;
+}
+
+WebInspector.CSSStyleSheet._nextUniqueDisplayNameNumber = 1;
+
+WebInspector.CSSStyleSheet.Event = {
+ ContentDidChange: "stylesheet-content-did-change"
+};
+
+WebInspector.CSSStyleSheet.prototype = {
+ constructor: WebInspector.CSSStyleSheet,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get parentFrame()
+ {
+ return this._parentFrame;
+ },
+
+ get url()
+ {
+ return this._url;
+ },
+
+ get urlComponents()
+ {
+ if (!this._urlComponents)
+ this._urlComponents = parseURL(this._url);
+ return this._urlComponents;
+ },
+
+ get displayName()
+ {
+ if (this._url)
+ return WebInspector.displayNameForURL(this._url, this.urlComponents);
+
+ // Assign a unique number to the StyleSheet object so it will stay the same.
+ if (!this._uniqueDisplayNameNumber)
+ this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
+
+ return WebInspector.UIString("Anonymous StyleSheet %d").format(this._uniqueDisplayNameNumber);
+ },
+
+ // Protected
+
+ updateInfo: function(url, parentFrame)
+ {
+ this._url = url || null;
+ delete this._urlComponents;
+
+ this._parentFrame = parentFrame || null;
+ },
+
+ get revisionForRequestedContent()
+ {
+ return this.currentRevision;
+ },
+
+ handleCurrentRevisionContentChange: function()
+ {
+ if (!this._id)
+ return;
+
+ function contentDidChange(error)
+ {
+ if (error)
+ return;
+
+ DOMAgent.markUndoableState();
+
+ this.dispatchEventToListeners(WebInspector.CSSStyleSheet.Event.ContentDidChange);
+ }
+
+ this._ignoreNextContentDidChangeNotification = true;
+
+ CSSAgent.setStyleSheetText(this._id, this.currentRevision.content, contentDidChange.bind(this));
+ },
+
+ canRequestContentFromBackend: function()
+ {
+ // We can request content if we have an id.
+ return !!this._id;
+ },
+
+ requestContentFromBackend: function(callback)
+ {
+ if (!this._id) {
+ // There is no identifier to request content with. Return false to cause the
+ // pending callbacks to get null content.
+ return false;
+ }
+
+ CSSAgent.getStyleSheetText(this._id, callback);
+ return true;
+ },
+
+ noteContentDidChange: function()
+ {
+ if (this._ignoreNextContentDidChangeNotification) {
+ delete this._ignoreNextContentDidChangeNotification;
+ return false;
+ }
+
+ this.markContentAsStale();
+ this.dispatchEventToListeners(WebInspector.CSSStyleSheet.Event.ContentDidChange);
+ return true;
+ }
+};
+
+WebInspector.CSSStyleSheet.prototype.__proto__ = WebInspector.SourceCode.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCallFramejsfromrev164541trunkSourceWebInspectorUIUserInterfaceCallFramejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CallFrame.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CallFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CallFrame = function(id, sourceCodeLocation, functionName, thisObject, scopeChain, nativeCode)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(!sourceCodeLocation || sourceCodeLocation instanceof WebInspector.SourceCodeLocation);
+ console.assert(!thisObject || thisObject instanceof WebInspector.RemoteObject);
+ console.assert(!scopeChain || scopeChain instanceof Array);
+
+ this._id = id || null;
+ this._sourceCodeLocation = sourceCodeLocation || null;
+ this._functionName = functionName || null;
+ this._thisObject = thisObject || null;
+ this._scopeChain = scopeChain || [];
+ this._nativeCode = nativeCode || false;
+};
+
+WebInspector.CallFrame.prototype = {
+ constructor: WebInspector.CallFrame,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ get functionName()
+ {
+ return this._functionName;
+ },
+
+ get nativeCode()
+ {
+ return this._nativeCode;
+ },
+
+ get thisObject()
+ {
+ return this._thisObject;
+ },
+
+ get scopeChain()
+ {
+ return this._scopeChain;
+ },
+
+ saveIdentityToCookie: function()
+ {
+ // Do nothing. The call frame is torn down when the inspector closes, and
+ // we shouldn't restore call frame content views across debugger pauses.
+ },
+
+ collectScopeChainVariableNames: function(callback)
+ {
+ var result = {this: true};
+
+ var pendingRequests = this._scopeChain.length;
+
+ function propertiesCollected(properties)
+ {
+ for (var i = 0; properties && i < properties.length; ++i)
+ result[properties[i].name] = true;
+
+ if (--pendingRequests)
+ return;
+
+ callback(result);
+ }
+
+ for (var i = 0; i < this._scopeChain.length; ++i)
+ this._scopeChain[i].object.getAllProperties(propertiesCollected);
+ }
+};
+
+WebInspector.CallFrame.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsColorjsfromrev164541trunkSourceWebInspectorUIUserInterfaceColorjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Color.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Color.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Color.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Color.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,665 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.Color = function(format, components)
+{
+ this.format = format;
+ if (format === WebInspector.Color.Format.HSL || format === WebInspector.Color.Format.HSLA)
+ this._hsla = components;
+ else
+ this._rgba = components;
+
+ this.valid = !components.some(function(component) {
+ return isNaN(component);
+ });
+}
+
+WebInspector.Color.Format = {
+ Original: "color-format-original",
+ Nickname: "color-format-nickname",
+ HEX: "color-format-hex",
+ ShortHEX: "color-format-short-hex",
+ RGB: "color-format-rgb",
+ RGBA: "color-format-rgba",
+ HSL: "color-format-hsl",
+ HSLA: "color-format-hsla"
+};
+
+WebInspector.Color.fromString = function(colorString)
+{
+ var value = colorString.toLowerCase().replace(/%|\s+/g, "");
+ const transparentNicknames = ["transparent", "rgba(0,0,0,0)", "hsla(0,0,0,0)"];
+ if (transparentNicknames.contains(value)) {
+ var color = new WebInspector.Color(WebInspector.Color.Format.Nickname, [0, 0, 0, 0]);
+ color.nickname = "transparent";
+ color.original = colorString;
+ return color;
+ }
+
+ // Simple - #hex, rgb(), nickname, hsl()
+ var simple = /^(?:#([0-9a-f]{3,6})|rgb\(([^)]+)\)|(\w+)|hsl\(([^)]+)\))$/i;
+ var match = colorString.match(simple);
+ if (match) {
+ if (match[1]) { // hex
+ var hex = match[1].toUpperCase();
+ if (hex.length === 3) {
+ return new WebInspector.Color(WebInspector.Color.Format.ShortHEX, [
+ parseInt(hex.charAt(0) + hex.charAt(0), 16),
+ parseInt(hex.charAt(1) + hex.charAt(1), 16),
+ parseInt(hex.charAt(2) + hex.charAt(2), 16),
+ 1
+ ]);
+ } else {
+ return new WebInspector.Color(WebInspector.Color.Format.HEX, [
+ parseInt(hex.substring(0, 2), 16),
+ parseInt(hex.substring(2, 4), 16),
+ parseInt(hex.substring(4, 6), 16),
+ 1
+ ]);
+ }
+ } else if (match[2]) { // rgb
+ var rgb = match[2].split(/\s*,\s*/);
+ return new WebInspector.Color(WebInspector.Color.Format.RGB, [
+ parseInt(rgb[0]),
+ parseInt(rgb[1]),
+ parseInt(rgb[2]),
+ 1
+ ]);
+ } else if (match[3]) { // nickname
+ var nickname = match[3].toLowerCase();
+ if (WebInspector.Color.Nicknames.hasOwnProperty(nickname)) {
+ var color = new WebInspector.Color(WebInspector.Color.Format.Nickname, WebInspector.Color.Nicknames[nickname].concat(1));
+ color.nickname = nickname;
+ color.original = colorString;
+ return color;
+ } else
+ return null;
+ } else if (match[4]) { // hsl
+ var hsl = match[4].replace(/%/g, "").split(/\s*,\s*/);
+ return new WebInspector.Color(WebInspector.Color.Format.HSL, [
+ parseInt(hsl[0]),
+ parseInt(hsl[1]),
+ parseInt(hsl[2]),
+ 1
+ ]);
+ }
+ }
+
+ // Advanced - rgba(), hsla()
+ var advanced = /^(?:rgba\(([^)]+)\)|hsla\(([^)]+)\))$/;
+ match = colorString.match(advanced);
+ if (match) {
+ if (match[1]) { // rgba
+ var rgba = match[1].split(/\s*,\s*/);
+ return new WebInspector.Color(WebInspector.Color.Format.RGBA, [
+ parseInt(rgba[0]),
+ parseInt(rgba[1]),
+ parseInt(rgba[2]),
+ Number.constrain(parseFloat(rgba[3]), 0, 1)
+ ]);
+ } else if (match[2]) { // hsla
+ var hsla = match[2].replace(/%/g, "").split(/\s*,\s*/);
+ return new WebInspector.Color(WebInspector.Color.Format.HSLA, [
+ parseInt(hsla[0]),
+ parseInt(hsla[1]),
+ parseInt(hsla[2]),
+ Number.constrain(parseFloat(hsla[3]), 0, 1)
+ ]);
+ }
+ }
+
+ return null;
+}
+
+WebInspector.Color.prototype = {
+ nextFormat: function(format)
+ {
+ format = format || this.format;
+
+ switch (format) {
+ case WebInspector.Color.Format.Original:
+ return this.simple ? WebInspector.Color.Format.RGB : WebInspector.Color.Format.RGBA;
+
+ case WebInspector.Color.Format.RGB:
+ case WebInspector.Color.Format.RGBA:
+ return this.simple ? WebInspector.Color.Format.HSL : WebInspector.Color.Format.HSLA;
+
+ case WebInspector.Color.Format.HSL:
+ case WebInspector.Color.Format.HSLA:
+ if (this.nickname)
+ return WebInspector.Color.Format.Nickname;
+ if (this.simple)
+ return this._canBeSerializedAsShortHEX() ? WebInspector.Color.Format.ShortHEX : WebInspector.Color.Format.HEX;
+ else
+ return WebInspector.Color.Format.Original;
+
+ case WebInspector.Color.Format.ShortHEX:
+ return WebInspector.Color.Format.HEX;
+
+ case WebInspector.Color.Format.HEX:
+ return WebInspector.Color.Format.Original;
+
+ case WebInspector.Color.Format.Nickname:
+ if (this.simple)
+ return this._canBeSerializedAsShortHEX() ? WebInspector.Color.Format.ShortHEX : WebInspector.Color.Format.HEX;
+ else
+ return WebInspector.Color.Format.Original;
+
+ default:
+ console.error("Unknown color format.");
+ return null;
+ }
+ },
+
+ get alpha()
+ {
+ return this._rgba ? this._rgba[3] : this._hsla[3];
+ },
+
+ get simple()
+ {
+ return this.alpha === 1;
+ },
+
+ get rgb()
+ {
+ var rgb = this.rgba.slice();
+ rgb.pop();
+ return rgb;
+ },
+
+ get hsl()
+ {
+ var hsl = this.hsla.slice();
+ hsl.pop();
+ return hsl;
+ },
+
+ get rgba()
+ {
+ if (!this._rgba)
+ this._rgba = this._hslaToRGBA(this._hsla);
+ return this._rgba;
+ },
+
+ get hsla()
+ {
+ if (!this._hsla)
+ this._hsla = this._rgbaToHSLA(this.rgba);
+ return this._hsla;
+ },
+
+ copy: function()
+ {
+ switch (this.format) {
+ case WebInspector.Color.Format.RGB:
+ case WebInspector.Color.Format.HEX:
+ case WebInspector.Color.Format.ShortHEX:
+ case WebInspector.Color.Format.Nickname:
+ case WebInspector.Color.Format.RGBA:
+ return new WebInspector.Color(this.format, this.rgba);
+ case WebInspector.Color.Format.HSL:
+ case WebInspector.Color.Format.HSLA:
+ return new WebInspector.Color(this.format, this.hsla);
+ }
+ },
+
+ toString: function(format)
+ {
+ if (!format)
+ format = this.format;
+
+ switch (format) {
+ case WebInspector.Color.Format.Original:
+ return this._toOriginalString();
+ case WebInspector.Color.Format.RGB:
+ return this._toRGBString();
+ case WebInspector.Color.Format.RGBA:
+ return this._toRGBAString();
+ case WebInspector.Color.Format.HSL:
+ return this._toHSLString();
+ case WebInspector.Color.Format.HSLA:
+ return this._toHSLAString();
+ case WebInspector.Color.Format.HEX:
+ return this._toHEXString();
+ case WebInspector.Color.Format.ShortHEX:
+ return this._toShortHEXString();
+ case WebInspector.Color.Format.Nickname:
+ return this._toNicknameString();
+ }
+
+ throw "invalid color format";
+ },
+
+ _toOriginalString: function()
+ {
+ return this.original || this._toNicknameString();
+ },
+
+ _toNicknameString: function()
+ {
+ if (this.nickname)
+ return this.nickname;
+
+ var rgba = this.rgba;
+ if (!this.simple) {
+ if (rgba[0] === 0 && rgba[1] === 0 && rgba[2] === 0 && rgba[3] === 0)
+ return "transparent";
+ return this._toRGBAString();
+ }
+
+ var nicknames = WebInspector.Color.Nicknames;
+ for (var nickname in nicknames) {
+ if (!nicknames.hasOwnProperty(nickname))
+ continue;
+
+ var nicknameRGB = nicknames[nickname];
+ if (nicknameRGB[0] === rgba[0] && nicknameRGB[1] === rgba[1] && nicknameRGB[2] === rgba[2])
+ return nickname;
+ }
+
+ return this._toRGBString();
+ },
+
+ _toShortHEXString: function()
+ {
+ if (!this.simple)
+ return this._toRGBAString();
+
+ var rgba = this.rgba;
+ var r = this._componentToHexValue(rgba[0]);
+ var g = this._componentToHexValue(rgba[1]);
+ var b = this._componentToHexValue(rgba[2]);
+
+ if (r[0] === r[1] && g[0] === g[1] && b[0] === b[1])
+ return "#" + r[0] + g[0] + b[0];
+ else
+ return "#" + r + g + b;
+ },
+
+ _toHEXString: function()
+ {
+ if (!this.simple)
+ return this._toRGBAString();
+
+ var rgba = this.rgba;
+ var r = this._componentToHexValue(rgba[0]);
+ var g = this._componentToHexValue(rgba[1]);
+ var b = this._componentToHexValue(rgba[2]);
+
+ return "#" + r + g + b;
+ },
+
+ _toRGBString: function()
+ {
+ if (!this.simple)
+ return this._toRGBAString();
+
+ var rgba = this.rgba;
+ return "rgb(" + [rgba[0], rgba[1], rgba[2]].join(", ") + ")";
+ },
+
+ _toRGBAString: function()
+ {
+ return "rgba(" + this.rgba.join(", ") + ")";
+ },
+
+ _toHSLString: function()
+ {
+ if (!this.simple)
+ return this._toHSLAString();
+
+ var hsla = this.hsla;
+ return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
+ },
+
+ _toHSLAString: function()
+ {
+ var hsla = this.hsla;
+ return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
+ },
+
+ _canBeSerializedAsShortHEX: function()
+ {
+ var rgba = this.rgba;
+
+ var r = this._componentToHexValue(rgba[0]);
+ if (r[0] !== r[1])
+ return false;
+
+ var g = this._componentToHexValue(rgba[1]);
+ if (g[0] !== g[1])
+ return false;
+
+ var b = this._componentToHexValue(rgba[2]);
+ if (b[0] !== b[1])
+ return false;
+
+ return true;
+ },
+
+ _componentToNumber: function(value)
+ {
+ return Number.constrain(value, 0, 255);
+ },
+
+ _componentToHexValue: function(value)
+ {
+ var hex = this._componentToNumber(value).toString(16);
+ if (hex.length === 1)
+ hex = "0" + hex;
+ return hex;
+ },
+
+ _rgbToHSL: function(rgb)
+ {
+ var r = this._componentToNumber(rgb[0]) / 255;
+ var g = this._componentToNumber(rgb[1]) / 255;
+ var b = this._componentToNumber(rgb[2]) / 255;
+ var max = Math.max(r, g, b);
+ var min = Math.min(r, g, b);
+ var diff = max - min;
+ var add = max + min;
+
+ if (min === max)
+ var h = 0;
+ else if (r === max)
+ var h = ((60 * (g - b) / diff) + 360) % 360;
+ else if (g === max)
+ var h = (60 * (b - r) / diff) + 120;
+ else
+ var h = (60 * (r - g) / diff) + 240;
+
+ var l = 0.5 * add;
+
+ if (l === 0)
+ var s = 0;
+ else if (l === 1)
+ var s = 1;
+ else if (l <= 0.5)
+ var s = diff / add;
+ else
+ var s = diff / (2 - add);
+
+ h = Math.round(h);
+ s = Math.round(s * 100);
+ l = Math.round(l * 100);
+
+ return [h, s, l];
+ },
+
+ _hslToRGB: function(hsl)
+ {
+ var h = parseFloat(hsl[0]) / 360;
+ var s = parseFloat(hsl[1]) / 100;
+ var l = parseFloat(hsl[2]) / 100;
+
+ h *= 6;
+ var sArray = [
+ l += s *= l < .5 ? l : 1 - l,
+ l - h % 1 * s * 2,
+ l -= s *= 2,
+ l,
+ l + h % 1 * s,
+ l + s
+ ];
+ return [
+ Math.round(sArray[ ~~h % 6 ] * 255),
+ Math.round(sArray[ (h|16) % 6 ] * 255),
+ Math.round(sArray[ (h|8) % 6 ] * 255)
+ ];
+ },
+
+ _rgbaToHSLA: function(rgba)
+ {
+ var hsl = this._rgbToHSL(rgba);
+ hsl.push(rgba[3]);
+ return hsl;
+ },
+
+ _hslaToRGBA: function(hsla)
+ {
+ var rgba = this._hslToRGB(hsla);
+ rgba.push(hsla[3]);
+ return rgba;
+ }
+}
+
+WebInspector.Color.Nicknames = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [237, 164, 61],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
+
+WebInspector.Color.rgb2hsv = function(r, g, b)
+{
+ r /= 255;
+ g /= 255;
+ b /= 255;
+
+ var min = Math.min(Math.min(r, g), b);
+ var max = Math.max(Math.max(r, g), b);
+ var delta = max - min;
+
+ var v = max;
+ var s, h;
+
+ if (max === min)
+ h = 0;
+ else if (max === r)
+ h = (60 * ((g - b) / delta)) % 360;
+ else if (max === g)
+ h = 60 * ((b - r) / delta) + 120;
+ else if (max === b)
+ h = 60 * ((r - g) / delta) + 240;
+
+ if (h < 0)
+ h += 360;
+
+ // Saturation
+ if (max === 0)
+ s = 0;
+ else
+ s = 1 - (min/max);
+
+ return [h, s, v];
+}
+
+WebInspector.Color.hsv2rgb = function(h, s, v)
+{
+ if (s === 0)
+ return [v, v, v];
+
+ h /= 60;
+ var i = Math.floor(h);
+ var data = [
+ v * (1 - s),
+ v * (1 - s * (h - i)),
+ v * (1 - s * (1 - (h - i)))
+ ];
+ var rgb;
+
+ switch (i) {
+ case 0:
+ rgb = [v, data[2], data[0]];
+ break;
+ case 1:
+ rgb = [data[1], v, data[0]];
+ break;
+ case 2:
+ rgb = [data[0], v, data[2]];
+ break;
+ case 3:
+ rgb = [data[0], data[1], v];
+ break;
+ case 4:
+ rgb = [data[2], data[0], v];
+ break;
+ default:
+ rgb = [v, data[0], data[1]];
+ break;
+ }
+
+ return rgb;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsContentFlowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentFlowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ContentFlow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ContentFlow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ContentFlow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlow = function(documentNodeIdentifier, name, overset, contentNodes)
+{
+ WebInspector.Object.call(this);
+
+ this._documentNodeIdentifier = documentNodeIdentifier;
+ this._name = name;
+ this._overset = overset;
+ this._contentNodes = contentNodes;
+};
+
+WebInspector.ContentFlow.Event = {
+ OversetWasChanged: "content-flow-overset-was-changed",
+ ContentNodeWasAdded: "content-flow-content-node-was-added",
+ ContentNodeWasRemoved: "content-flow-content-node-was-removed"
+};
+
+WebInspector.ContentFlow.prototype = {
+
+ constructor: WebInspector.ContentFlow,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get id()
+ {
+ // Use the flow node id, to avoid collisions when we change main document id.
+ return this._documentNodeIdentifier + ":" + this._name;
+ },
+
+ get documentNodeIdentifier()
+ {
+ return this._documentNodeIdentifier;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get overset()
+ {
+ return this._overset;
+ },
+
+ set overset(overset)
+ {
+ if (this._overset === overset)
+ return;
+ this._overset = overset;
+ this.dispatchEventToListeners(WebInspector.ContentFlow.Event.FlowOversetWasChanged);
+ },
+
+ get contentNodes()
+ {
+ return this._contentNodes;
+ },
+
+ insertContentNodeBefore: function(contentNode, referenceNode)
+ {
+ var index = this._contentNodes.indexOf(referenceNode);
+ console.assert(index !== -1);
+ this._contentNodes.splice(index, 0, contentNode);
+ this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded, {node: contentNode, before: referenceNode});
+ },
+
+ appendContentNode: function(contentNode)
+ {
+ this._contentNodes.push(contentNode);
+ this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasAdded, {node: contentNode});
+ },
+
+ removeContentNode: function(contentNode)
+ {
+ var index = this._contentNodes.indexOf(contentNode);
+ console.assert(index !== -1);
+ this._contentNodes.splice(index, 1);
+ this.dispatchEventToListeners(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, {node: contentNode});
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCookieStorageObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCookieStorageObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CookieStorageObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CookieStorageObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageObject = function(host)
+{
+ this._host = host;
+};
+
+WebInspector.CookieStorageObject.TypeIdentifier = "cookie-storage";
+WebInspector.CookieStorageObject.CookieHostCookieKey = "cookie-storage-host";
+
+WebInspector.CookieStorageObject.prototype = {
+ constructor: WebInspector.CookieStorageObject,
+
+ get host()
+ {
+ return this._host;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.CookieStorageObject.CookieHostCookieKey] = this.host;
+ }
+ // FIXME: This class will need to look up cookies that are set for this host.
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,710 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @constructor
+ * @param {WebInspector.DOMAgent} domAgent
+ * @param {?WebInspector.DOMNode} doc
+ * @param {boolean} isInShadowTree
+ * @param {DOMAgent.Node} payload
+ */
+WebInspector.DOMNode = function(domAgent, doc, isInShadowTree, payload) {
+ WebInspector.Object.call(this);
+
+ this._domAgent = domAgent;
+ this._isInShadowTree = isInShadowTree;
+
+ this.id = payload.nodeId;
+ domAgent._idToDOMNode[this.id] = this;
+
+ this._nodeType = payload.nodeType;
+ this._nodeName = payload.nodeName;
+ this._localName = payload.localName;
+ this._nodeValue = payload.nodeValue;
+
+ if (this._nodeType === Node.DOCUMENT_NODE)
+ this.ownerDocument = this;
+ else
+ this.ownerDocument = doc;
+
+ this._attributes = [];
+ this._attributesMap = {};
+ if (payload.attributes)
+ this._setAttributesPayload(payload.attributes);
+
+ this._childNodeCount = payload.childNodeCount;
+ this._children = null;
+ this._filteredChildren = null;
+ this._filteredChildrenNeedsUpdating = true;
+
+ this._nextSibling = null;
+ this._previousSibling = null;
+ this.parentNode = null;
+
+ this._enabledPseudoClasses = [];
+
+ this._shadowRoots = [];
+ if (payload.shadowRoots) {
+ for (var i = 0; i < payload.shadowRoots.length; ++i) {
+ var root = payload.shadowRoots[i];
+ var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, true, root);
+ this._shadowRoots.push(node);
+ }
+ }
+
+ if (payload.children)
+ this._setChildrenPayload(payload.children);
+
+ if (payload.contentDocument) {
+ this._contentDocument = new WebInspector.DOMNode(domAgent, null, false, payload.contentDocument);
+ this._children = [this._contentDocument];
+ this._renumber();
+ }
+
+ if (this._nodeType === Node.ELEMENT_NODE) {
+ // HTML and BODY from internal iframes should not overwrite top-level ones.
+ if (this.ownerDocument && !this.ownerDocument.documentElement && this._nodeName === "HTML")
+ this.ownerDocument.documentElement = this;
+ if (this.ownerDocument && !this.ownerDocument.body && this._nodeName === "BODY")
+ this.ownerDocument.body = this;
+ if (payload.documentURL)
+ this.documentURL = payload.documentURL;
+ } else if (this._nodeType === Node.DOCUMENT_TYPE_NODE) {
+ this.publicId = payload.publicId;
+ this.systemId = payload.systemId;
+ this.internalSubset = payload.internalSubset;
+ } else if (this._nodeType === Node.DOCUMENT_NODE) {
+ this.documentURL = payload.documentURL;
+ this.xmlVersion = payload.xmlVersion;
+ } else if (this._nodeType === Node.ATTRIBUTE_NODE) {
+ this.name = payload.name;
+ this.value = payload.value;
+ }
+}
+
+WebInspector.Object.addConstructorFunctions(WebInspector.DOMNode);
+
+WebInspector.DOMNode.Event = {
+ EnabledPseudoClassesChanged: "dom-node-enabled-pseudo-classes-did-change",
+ AttributeModified: "dom-node-attribute-modified",
+ AttributeRemoved: "dom-node-attribute-removed"
+};
+
+WebInspector.DOMNode.prototype = {
+ constructor: WebInspector.DOMNode,
+
+ get children()
+ {
+ if (!this._children)
+ return null;
+
+ if (WebInspector.showShadowDOMSetting.value)
+ return this._children;
+
+ if (this._filteredChildrenNeedsUpdating) {
+ this._filteredChildrenNeedsUpdating = false;
+ this._filteredChildren = this._children.filter(function(node) {
+ return !node._isInShadowTree;
+ });
+ }
+
+ return this._filteredChildren;
+ },
+
+ get firstChild()
+ {
+ var children = this.children;
+
+ if (children && children.length > 0)
+ return children[0];
+
+ return null;
+ },
+
+ get lastChild()
+ {
+ var children = this.children;
+
+ if (children && children.length > 0)
+ return children.lastValue;
+
+ return null;
+ },
+
+ get nextSibling()
+ {
+ if (WebInspector.showShadowDOMSetting.value)
+ return this._nextSibling;
+
+ var node = this._nextSibling;
+ while (node) {
+ if (!node._isInShadowTree)
+ return node;
+ node = node._nextSibling;
+ }
+ return null;
+ },
+
+ get previousSibling()
+ {
+ if (WebInspector.showShadowDOMSetting.value)
+ return this._previousSibling;
+
+ var node = this._previousSibling;
+ while (node) {
+ if (!node._isInShadowTree)
+ return node;
+ node = node._previousSibling;
+ }
+ return null;
+ },
+
+ get childNodeCount()
+ {
+ var children = this.children;
+ if (children)
+ return children.length;
+
+ if (WebInspector.showShadowDOMSetting.value)
+ return this._childNodeCount + this._shadowRoots.length;
+
+ return this._childNodeCount;
+ },
+
+ set childNodeCount(count)
+ {
+ this._childNodeCount = count;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ hasAttributes: function()
+ {
+ return this._attributes.length > 0;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ hasChildNodes: function()
+ {
+ return this.childNodeCount > 0;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ hasShadowRoots: function()
+ {
+ return !!this._shadowRoots.length;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isInShadowTree: function()
+ {
+ return this._isInShadowTree;
+ },
+
+ /**
+ * @return {number}
+ */
+ nodeType: function()
+ {
+ return this._nodeType;
+ },
+
+ /**
+ * @return {string}
+ */
+ nodeName: function()
+ {
+ return this._nodeName;
+ },
+
+ /**
+ * @return {string}
+ */
+ nodeNameInCorrectCase: function()
+ {
+ return this.isXMLNode() ? this.nodeName() : this.nodeName().toLowerCase();
+ },
+
+ /**
+ * @param {string} name
+ * @param {function()=} callback
+ */
+ setNodeName: function(name, callback)
+ {
+ DOMAgent.setNodeName(this.id, name, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @return {string}
+ */
+ localName: function()
+ {
+ return this._localName;
+ },
+
+ /**
+ * @return {string}
+ */
+ nodeValue: function()
+ {
+ return this._nodeValue;
+ },
+
+ /**
+ * @param {string} value
+ * @param {function(?Protocol.Error)=} callback
+ */
+ setNodeValue: function(value, callback)
+ {
+ DOMAgent.setNodeValue(this.id, value, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @param {string} name
+ * @return {string}
+ */
+ getAttribute: function(name)
+ {
+ var attr = this._attributesMap[name];
+ return attr ? attr.value : undefined;
+ },
+
+ /**
+ * @param {string} name
+ * @param {string} text
+ * @param {function()=} callback
+ */
+ setAttribute: function(name, text, callback)
+ {
+ DOMAgent.setAttributesAsText(this.id, text, name, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @param {string} name
+ * @param {string} value
+ * @param {function()=} callback
+ */
+ setAttributeValue: function(name, value, callback)
+ {
+ DOMAgent.setAttributeValue(this.id, name, value, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @return {Object}
+ */
+ attributes: function()
+ {
+ return this._attributes;
+ },
+
+ /**
+ * @param {string} name
+ * @param {function()=} callback
+ */
+ removeAttribute: function(name, callback)
+ {
+ function mycallback(error, success)
+ {
+ if (!error) {
+ delete this._attributesMap[name];
+ for (var i = 0; i < this._attributes.length; ++i) {
+ if (this._attributes[i].name === name) {
+ this._attributes.splice(i, 1);
+ break;
+ }
+ }
+ }
+
+ this._makeUndoableCallback(callback)(error);
+ }
+ DOMAgent.removeAttribute(this.id, name, mycallback.bind(this));
+ },
+
+ /**
+ * @param {function(Array.<WebInspector.DOMNode>)=} callback
+ */
+ getChildNodes: function(callback)
+ {
+ if (this.children) {
+ if (callback)
+ callback(this.children);
+ return;
+ }
+
+ /**
+ * @this {WebInspector.DOMNode}
+ * @param {?Protocol.Error} error
+ */
+ function mycallback(error) {
+ if (!error && callback)
+ callback(this.children);
+ }
+
+ DOMAgent.requestChildNodes(this.id, mycallback.bind(this));
+ },
+
+ /**
+ * @param {number} depth
+ * @param {function(Array.<WebInspector.DOMNode>)=} callback
+ */
+ getSubtree: function(depth, callback)
+ {
+ /**
+ * @this {WebInspector.DOMNode}
+ * @param {?Protocol.Error} error
+ */
+ function mycallback(error)
+ {
+ if (callback)
+ callback(error ? null : this.children);
+ }
+
+ DOMAgent.requestChildNodes(this.id, depth, mycallback.bind(this));
+ },
+
+ /**
+ * @param {function(?Protocol.Error)=} callback
+ */
+ getOuterHTML: function(callback)
+ {
+ DOMAgent.getOuterHTML(this.id, callback);
+ },
+
+ /**
+ * @param {string} html
+ * @param {function(?Protocol.Error)=} callback
+ */
+ setOuterHTML: function(html, callback)
+ {
+ DOMAgent.setOuterHTML(this.id, html, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @param {function(?Protocol.Error)=} callback
+ */
+ removeNode: function(callback)
+ {
+ DOMAgent.removeNode(this.id, this._makeUndoableCallback(callback));
+ },
+
+ copyNode: function()
+ {
+ function copy(error, text)
+ {
+ if (!error)
+ InspectorFrontendHost.copyText(text);
+ }
+ DOMAgent.getOuterHTML(this.id, copy);
+ },
+
+ /**
+ * @param {function(?Protocol.Error)=} callback
+ */
+ eventListeners: function(callback)
+ {
+ DOMAgent.getEventListenersForNode(this.id, callback);
+ },
+
+ accessibilityProperties: function(callback)
+ {
+ function accessibilityPropertiesCallback(error, accessibilityProperties)
+ {
+ if (!error && callback && accessibilityProperties) {
+ callback({
+ exists: accessibilityProperties.exists,
+ ignored: accessibilityProperties.ignored,
+ ignoredByDefault: accessibilityProperties.ignoredByDefault,
+ invalid: accessibilityProperties.invalid,
+ hidden: accessibilityProperties.hidden,
+ label: accessibilityProperties.label,
+ required: accessibilityProperties.required,
+ role: accessibilityProperties.role
+ });
+ }
+ }
+ DOMAgent.getAccessibilityPropertiesForNode(this.id, accessibilityPropertiesCallback.bind(this));
+ },
+
+ /**
+ * @return {string}
+ */
+ path: function()
+ {
+ var path = [];
+ var node = this;
+ while (node && "index" in node && node._nodeName.length) {
+ path.push([node.index, node._nodeName]);
+ node = node.parentNode;
+ }
+ path.reverse();
+ return path.join(",");
+ },
+
+ /**
+ * @param {boolean} justSelector
+ * @return {string}
+ */
+ appropriateSelectorFor: function(justSelector)
+ {
+ var lowerCaseName = this.localName() || this.nodeName().toLowerCase();
+
+ var id = this.getAttribute("id");
+ if (id) {
+ if (/[\s'"]/.test(id)) {
+ id = id.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");
+ selector = lowerCaseName + "[id=\"" + id + "\"]";
+ } else
+ selector = "#" + id;
+ return (justSelector ? selector : lowerCaseName + selector);
+ }
+
+ var className = this.getAttribute("class");
+ if (className) {
+ var selector = "." + className.trim().replace(/\s+/, ".");
+ return (justSelector ? selector : lowerCaseName + selector);
+ }
+
+ if (lowerCaseName === "input" && this.getAttribute("type"))
+ return lowerCaseName + "[type=\"" + this.getAttribute("type") + "\"]";
+
+ return lowerCaseName;
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} node
+ * @return {boolean}
+ */
+ isAncestor: function(node)
+ {
+ if (!node)
+ return false;
+
+ var currentNode = node.parentNode;
+ while (currentNode) {
+ if (this === currentNode)
+ return true;
+ currentNode = currentNode.parentNode;
+ }
+ return false;
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} descendant
+ * @return {boolean}
+ */
+ isDescendant: function(descendant)
+ {
+ return descendant !== null && descendant.isAncestor(this);
+ },
+
+ /**
+ * @param {Array.<string>} attrs
+ */
+ _setAttributesPayload: function(attrs)
+ {
+ this._attributes = [];
+ this._attributesMap = {};
+ for (var i = 0; i < attrs.length; i += 2)
+ this._addAttribute(attrs[i], attrs[i + 1]);
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} prev
+ * @param {DOMAgent.Node} payload
+ * @return {WebInspector.DOMNode}
+ */
+ _insertChild: function(prev, payload)
+ {
+ var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, this._isInShadowTree, payload);
+ if (!prev) {
+ if (!this._children) {
+ // First node
+ this._children = this._shadowRoots.concat([node]);
+ } else
+ this._children.unshift(node);
+ } else
+ this._children.splice(this._children.indexOf(prev) + 1, 0, node);
+ this._renumber();
+ return node;
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} node
+ */
+ _removeChild: function(node)
+ {
+ this._children.splice(this._children.indexOf(node), 1);
+ node.parentNode = null;
+ this._renumber();
+ },
+
+ /**
+ * @param {Array.<DOMAgent.Node>} payloads
+ */
+ _setChildrenPayload: function(payloads)
+ {
+ // We set children in the constructor.
+ if (this._contentDocument)
+ return;
+
+ this._children = this._shadowRoots.slice();
+ for (var i = 0; i < payloads.length; ++i) {
+ var payload = payloads[i];
+ var node = new WebInspector.DOMNode(this._domAgent, this.ownerDocument, this._isInShadowTree, payload);
+ this._children.push(node);
+ }
+ this._renumber();
+ },
+
+ _renumber: function()
+ {
+ this._filteredChildrenNeedsUpdating = true;
+
+ var childNodeCount = this._children.length;
+ if (childNodeCount === 0)
+ return;
+
+ for (var i = 0; i < childNodeCount; ++i) {
+ var child = this._children[i];
+ child.index = i;
+ child._nextSibling = i + 1 < childNodeCount ? this._children[i + 1] : null;
+ child._previousSibling = i - 1 >= 0 ? this._children[i - 1] : null;
+ child.parentNode = this;
+ }
+ },
+
+ /**
+ * @param {string} name
+ * @param {string} value
+ */
+ _addAttribute: function(name, value)
+ {
+ var attr = {
+ name: name,
+ value: value,
+ _node: this
+ };
+ this._attributesMap[name] = attr;
+ this._attributes.push(attr);
+ },
+
+ /**
+ * @param {string} name
+ * @param {string} value
+ */
+ _setAttribute: function(name, value)
+ {
+ var attr = this._attributesMap[name];
+ if (attr)
+ attr.value = value;
+ else
+ this._addAttribute(name, value);
+ },
+
+ /**
+ * @param {string} name
+ */
+ _removeAttribute: function(name)
+ {
+ var attr = this._attributesMap[name];
+ if (attr) {
+ this._attributes.remove(attr);
+ delete this._attributesMap[name];
+ }
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} targetNode
+ * @param {?WebInspector.DOMNode} anchorNode
+ * @param {function(?Protocol.Error)=} callback
+ */
+ moveTo: function(targetNode, anchorNode, callback)
+ {
+ DOMAgent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._makeUndoableCallback(callback));
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isXMLNode: function()
+ {
+ return !!this.ownerDocument && !!this.ownerDocument.xmlVersion;
+ },
+
+ get enabledPseudoClasses()
+ {
+ return this._enabledPseudoClasses;
+ },
+
+ setPseudoClassEnabled: function(pseudoClass, enabled)
+ {
+ var pseudoClasses = this._enabledPseudoClasses;
+ if (enabled) {
+ if (pseudoClasses.contains(pseudoClass))
+ return;
+ pseudoClasses.push(pseudoClass);
+ } else {
+ if (!pseudoClasses.contains(pseudoClass))
+ return;
+ pseudoClasses.remove(pseudoClass);
+ }
+
+ function changed(error)
+ {
+ if (!error)
+ this.dispatchEventToListeners(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged);
+ }
+
+ CSSAgent.forcePseudoState(this.id, pseudoClasses, changed.bind(this));
+ },
+
+ _makeUndoableCallback: function(callback)
+ {
+ return function(error)
+ {
+ if (!error)
+ DOMAgent.markUndoableState();
+
+ if (callback)
+ callback.apply(null, arguments);
+ };
+ }
+}
+
+WebInspector.DOMNode.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMNodeStylesjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMNodeStyles.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1050 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMNodeStyles = function(node)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(node);
+ this._node = node || null;
+
+ this._rulesMap = {};
+ this._styleDeclarationsMap = {};
+
+ this._matchedRules = [];
+ this._inheritedRules = [];
+ this._pseudoElements = {};
+ this._inlineStyle = null;
+ this._attributesStyle = null;
+ this._computedStyle = null;
+ this._orderedStyles = [];
+ this._stylesNeedingTextCommited = [];
+
+ this._propertyNameToEffectivePropertyMap = {};
+
+ this.refresh();
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.DOMNodeStyles);
+
+WebInspector.DOMNodeStyles.Event = {
+ NeedsRefresh: "dom-node-styles-needs-refresh",
+ Refreshed: "dom-node-styles-refreshed"
+};
+
+WebInspector.DOMNodeStyles.prototype = {
+ constructor: WebInspector.DOMNodeStyles,
+
+ // Public
+
+ get node()
+ {
+ return this._node;
+ },
+
+ get needsRefresh()
+ {
+ return this._refreshPending || this._needsRefresh;
+ },
+
+ refreshIfNeeded: function()
+ {
+ if (!this._needsRefresh)
+ return;
+ this.refresh();
+ },
+
+ refresh: function()
+ {
+ if (this._refreshPending)
+ return;
+
+ this._needsRefresh = false;
+ this._refreshPending = true;
+
+ function parseRuleMatchArrayPayload(matchArray, node, inherited)
+ {
+ var result = [];
+
+ var ruleOccurrences = {};
+
+ // Iterate in reverse order to match the cascade order.
+ for (var i = matchArray.length - 1; i >= 0; --i) {
+ // COMPATIBILITY (iOS 6): This was just an array of rules, now it is an array of matches that have
+ // a 'rule' property. Support both here. And 'matchingSelectors' does not exist on iOS 6.
+ var matchedSelectorIndices = matchArray[i].matchingSelectors || [];
+ var rule = this._parseRulePayload(matchArray[i].rule || matchArray[i], matchedSelectorIndices, node, inherited, ruleOccurrences);
+ if (!rule)
+ continue;
+ result.push(rule);
+ }
+
+ return result;
+ }
+
+ function fetchedMatchedStyles(error, matchedRulesPayload, pseudoElementRulesPayload, inheritedRulesPayload)
+ {
+ matchedRulesPayload = matchedRulesPayload || [];
+ pseudoElementRulesPayload = pseudoElementRulesPayload || [];
+ inheritedRulesPayload = inheritedRulesPayload || [];
+
+ // Move the current maps to previous.
+ this._previousRulesMap = this._rulesMap;
+ this._previousStyleDeclarationsMap = this._styleDeclarationsMap;
+
+ // Clear the current maps.
+ this._rulesMap = {};
+ this._styleDeclarationsMap = {};
+
+ this._matchedRules = parseRuleMatchArrayPayload.call(this, matchedRulesPayload, this._node);
+
+ this._pseudoElements = {};
+ for (var i = 0; i < pseudoElementRulesPayload.length; ++i) {
+ var pseudoElementRulePayload = pseudoElementRulesPayload[i];
+
+ // COMPATIBILITY (iOS 6): The entry payload had a 'rules' property, now it has a 'matches' property. Support both here.
+ var pseudoElementRules = parseRuleMatchArrayPayload.call(this, pseudoElementRulePayload.matches || pseudoElementRulePayload.rules, this._node);
+ this._pseudoElements[pseudoElementRulePayload.pseudoId] = {matchedRules: pseudoElementRules};
+ }
+
+ this._inheritedRules = [];
+
+ var i = 0;
+ var currentNode = this._node.parentNode;
+ while (currentNode && i < inheritedRulesPayload.length) {
+ var inheritedRulePayload = inheritedRulesPayload[i];
+
+ var inheritedRuleInfo = {node: currentNode};
+ inheritedRuleInfo.inlineStyle = inheritedRulePayload.inlineStyle ? this._parseStyleDeclarationPayload(inheritedRulePayload.inlineStyle, currentNode, true, WebInspector.CSSStyleDeclaration.Type.Inline) : null;
+ inheritedRuleInfo.matchedRules = inheritedRulePayload.matchedCSSRules ? parseRuleMatchArrayPayload.call(this, inheritedRulePayload.matchedCSSRules, currentNode, true) : [];
+
+ if (inheritedRuleInfo.inlineStyle || inheritedRuleInfo.matchedRules.length)
+ this._inheritedRules.push(inheritedRuleInfo);
+
+ currentNode = currentNode.parentNode;
+ ++i;
+ }
+ }
+
+ function fetchedInlineStyles(error, inlineStylePayload, attributesStylePayload)
+ {
+ this._inlineStyle = inlineStylePayload ? this._parseStyleDeclarationPayload(inlineStylePayload, this._node, false, WebInspector.CSSStyleDeclaration.Type.Inline) : null;
+ this._attributesStyle = attributesStylePayload ? this._parseStyleDeclarationPayload(attributesStylePayload, this._node, false, WebInspector.CSSStyleDeclaration.Type.Attribute) : null;
+
+ this._updateStyleCascade();
+ }
+
+ function fetchedComputedStyle(error, computedPropertiesPayload)
+ {
+ var properties = [];
+ for (var i = 0; computedPropertiesPayload && i < computedPropertiesPayload.length; ++i) {
+ var propertyPayload = computedPropertiesPayload[i];
+
+ var canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(propertyPayload.name);
+ propertyPayload.implicit = !this._propertyNameToEffectivePropertyMap[canonicalName];
+
+ var property = this._parseStylePropertyPayload(propertyPayload, NaN, this._computedStyle);
+ properties.push(property);
+ }
+
+ if (this._computedStyle)
+ this._computedStyle.update(null, properties);
+ else
+ this._computedStyle = new WebInspector.CSSStyleDeclaration(this, null, null, WebInspector.CSSStyleDeclaration.Type.Computed, this._node, false, null, properties);
+
+ this._refreshPending = false;
+
+ var significantChange = this._previousSignificantChange || false;
+ if (!significantChange) {
+ for (var key in this._styleDeclarationsMap) {
+ // Check if the same key exists in the previous map and has the same style objects.
+ if (key in this._previousStyleDeclarationsMap && Object.shallowEqual(this._styleDeclarationsMap[key], this._previousStyleDeclarationsMap[key]))
+ continue;
+
+ if (!this._includeUserAgentRulesOnNextRefresh) {
+ // We can assume all the styles with the same key are from the same stylesheet and rule, so we only check the first.
+ var firstStyle = this._styleDeclarationsMap[key][0];
+ if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent) {
+ // User Agent styles get different identifiers after some edits. This would cause us to fire a significant refreshed
+ // event more than it is helpful. And since the user agent stylesheet is static it shouldn't match differently
+ // between refreshes for the same node. This issue is tracked by: https://webkit.org/b/110055
+ continue;
+ }
+ }
+
+ // This key is new or has different style objects than before. This is a significant change.
+ significantChange = true;
+ break;
+ }
+ }
+
+ if (!significantChange) {
+ for (var key in this._previousStyleDeclarationsMap) {
+ // Check if the same key exists in current map. If it does exist it was already checked for equality above.
+ if (key in this._styleDeclarationsMap)
+ continue;
+
+ if (!this._includeUserAgentRulesOnNextRefresh) {
+ // See above for why we skip user agent style rules.
+ var firstStyle = this._previousStyleDeclarationsMap[key][0];
+ if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
+ continue;
+ }
+
+ // This key no longer exists. This is a significant change.
+ significantChange = true;
+ break;
+ }
+ }
+
+ delete this._includeUserAgentRulesOnNextRefresh;
+
+ // Delete the previous maps now that any reused rules and style have been moved over.
+ delete this._previousRulesMap;
+ delete this._previousStyleDeclarationsMap;
+
+ var styleToCommit = this._stylesNeedingTextCommited.shift();
+ if (styleToCommit) {
+ // Remember the significant change flag so we can pass it along when the pending style
+ // changes trigger a refresh. If we wait to scan later we might not find a significant change
+ // and fail to tell listeners about it.
+ this._previousSignificantChange = significantChange;
+
+ this.changeStyleText(styleToCommit, styleToCommit.__pendingText);
+
+ return;
+ }
+
+ // Delete the previous saved significant change flag so we rescan for a significant change next time.
+ delete this._previousSignificantChange;
+
+ this.dispatchEventToListeners(WebInspector.DOMNodeStyles.Event.Refreshed, {significantChange: significantChange});
+ }
+
+ CSSAgent.getMatchedStylesForNode.invoke({nodeId: this._node.id, includePseudo: true, includeInherited: true}, fetchedMatchedStyles.bind(this));
+ CSSAgent.getInlineStylesForNode.invoke({nodeId: this._node.id}, fetchedInlineStyles.bind(this));
+ CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, fetchedComputedStyle.bind(this));
+ },
+
+ addRule: function(selector)
+ {
+ function addedRule(error, rulePayload)
+ {
+ if (error)
+ return;
+
+ DOMAgent.markUndoableState();
+
+ this.refresh();
+ }
+
+ selector = selector || this._node.appropriateSelectorFor(true);
+
+ CSSAgent.addRule.invoke({contextNodeId: this._node.id, selector: selector}, addedRule.bind(this));
+ },
+
+ get matchedRules()
+ {
+ return this._matchedRules;
+ },
+
+ get inheritedRules()
+ {
+ return this._inheritedRules;
+ },
+
+ get inlineStyle()
+ {
+ return this._inlineStyle;
+ },
+
+ get attributesStyle()
+ {
+ return this._attributesStyle;
+ },
+
+ get pseudoElements()
+ {
+ return this._pseudoElements;
+ },
+
+ get computedStyle()
+ {
+ return this._computedStyle;
+ },
+
+ get orderedStyles()
+ {
+ return this._orderedStyles;
+ },
+
+ effectivePropertyForName: function(name)
+ {
+ var canonicalName = WebInspector.cssStyleManager.canonicalNameForPropertyName(name);
+ return this._propertyNameToEffectivePropertyMap[canonicalName] || null;
+ },
+
+ // Protected
+
+ mediaQueryResultDidChange: function()
+ {
+ this._markAsNeedsRefresh();
+ },
+
+ pseudoClassesDidChange: function(node)
+ {
+ this._includeUserAgentRulesOnNextRefresh = true;
+ this._markAsNeedsRefresh();
+ },
+
+ attributeDidChange: function(node, attributeName)
+ {
+ // Ignore the attribute we know we just changed and handled above.
+ if (this._ignoreNextStyleAttributeDidChangeEvent && node === this._node && attributeName === "style") {
+ delete this._ignoreNextStyleAttributeDidChangeEvent;
+ return;
+ }
+
+ this._markAsNeedsRefresh();
+ },
+
+ changeRuleSelector: function(rule, selector)
+ {
+ selector = selector || "";
+
+ function ruleSelectorChanged(error, rulePayload)
+ {
+ DOMAgent.markUndoableState();
+
+ // Do a full refresh incase the rule no longer matches the node or the
+ // matched selector indices changed.
+ this.refresh();
+ }
+
+ this._needsRefresh = true;
+ this._ignoreNextContentDidChangeForStyleSheet = rule.ownerStyleSheet;
+
+ CSSAgent.setRuleSelector(rule.id, selector, ruleSelectorChanged.bind(this));
+ },
+
+ changeStyleText: function(style, text)
+ {
+ if (!style.ownerStyleSheet || !style.styleSheetTextRange)
+ return;
+
+ text = text || "";
+
+ if (CSSAgent.setStyleText) {
+ function styleChanged(error, stylePayload)
+ {
+ if (error)
+ return;
+ this.refresh();
+ }
+
+ CSSAgent.setStyleText(style.id, text, styleChanged.bind(this));
+ return;
+ }
+
+ // COMPATIBILITY (iOS 6): CSSAgent.setStyleText was not available in iOS 6.
+
+ // Setting the text on CSSStyleSheet for inline styles causes a crash. https://webkit.org/b/110359
+ // So we just set the style attribute to get the same affect. This also avoids SourceCodeRevisions.
+ if (style.type === WebInspector.CSSStyleDeclaration.Type.Inline) {
+ text = text.trim();
+
+ function attributeChanged(error)
+ {
+ if (error)
+ return;
+ this.refresh();
+ }
+
+ this._ignoreNextStyleAttributeDidChangeEvent = true;
+
+ if (text)
+ style.node.setAttributeValue("style", text, attributeChanged.bind(this));
+ else
+ style.node.removeAttribute("style", attributeChanged.bind(this));
+
+ return;
+ }
+
+ if (this._needsRefresh || this._refreshPending) {
+ // If we need refreshed then it is not safe to use the styleSheetTextRange since the range likely has
+ // changed and we need updated ranges. Store the text and remember the style so we can commit it after
+ // the next refresh.
+
+ style.__pendingText = text;
+
+ if (!this._stylesNeedingTextCommited.contains(style))
+ this._stylesNeedingTextCommited.push(style);
+
+ return;
+ }
+
+ function fetchedStyleSheetContent(styleSheet, content)
+ {
+ console.assert(style.styleSheetTextRange);
+ if (!style.styleSheetTextRange)
+ return;
+
+ var startOffset = style.styleSheetTextRange.startOffset;
+ var endOffset = style.styleSheetTextRange.endOffset;
+
+ if (isNaN(startOffset) || isNaN(endOffset)) {
+ style.styleSheetTextRange.resolveOffsets(content);
+
+ startOffset = style.styleSheetTextRange.startOffset;
+ endOffset = style.styleSheetTextRange.endOffset;
+ }
+
+ console.assert(!isNaN(startOffset));
+ console.assert(!isNaN(endOffset));
+ if (isNaN(startOffset) || isNaN(endOffset))
+ return;
+
+ function contentDidChange()
+ {
+ style.ownerStyleSheet.removeEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, contentDidChange, this);
+
+ this.refresh();
+ }
+
+ style.ownerStyleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, contentDidChange, this);
+
+ var newContent = content.substring(0, startOffset) + text + content.substring(endOffset);
+
+ WebInspector.branchManager.currentBranch.revisionForRepresentedObject(style.ownerStyleSheet).content = newContent;
+ }
+
+ this._stylesNeedingTextCommited.remove(style);
+ delete style.__pendingText;
+
+ this._needsRefresh = true;
+ this._ignoreNextContentDidChangeForStyleSheet = style.ownerStyleSheet;
+
+ style.ownerStyleSheet.requestContent(fetchedStyleSheetContent.bind(this));
+ },
+
+ changeProperty: function(property, name, value, priority)
+ {
+ var text = name ? name + ": " + value + (priority ? " !" + priority : "") + ";" : "";
+ this.changePropertyText(property, text);
+ },
+
+ changePropertyText: function(property, text)
+ {
+ text = text || "";
+
+ var index = property.index;
+ var newProperty = isNaN(index);
+ var overwrite = true;
+
+ // If this is a new property, then give it an index at the end of the current properties.
+ // Also don't overwrite, which will cause the property to be added at that index.
+ if (newProperty) {
+ index = property.ownerStyle.properties.length;
+ overwrite = false;
+ }
+
+ if (text && text.charAt(text.length - 1) !== ";")
+ text += ";";
+
+ this._needsRefresh = true;
+ this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
+
+ CSSAgent.setPropertyText(property.ownerStyle.id, index, text, overwrite, this._handlePropertyChange.bind(this, property));
+ },
+
+ changePropertyEnabledState: function(property, enabled)
+ {
+ enabled = !!enabled;
+
+ // Can't change a pending property with a NaN index.
+ if (isNaN(property.index))
+ return;
+
+ this._ignoreNextContentDidChangeForStyleSheet = property.ownerStyle.ownerStyleSheet;
+
+ CSSAgent.toggleProperty(property.ownerStyle.id, property.index, !enabled, this._handlePropertyChange.bind(this, property));
+ },
+
+ addProperty: function(property)
+ {
+ // Can't add a property unless it has a NaN index.
+ if (!isNaN(property.index))
+ return;
+
+ // Adding is done by setting the text.
+ this.changePropertyText(property, property.text);
+ },
+
+ removeProperty: function(property)
+ {
+ // Can't remove a pending property with a NaN index.
+ if (isNaN(property.index))
+ return;
+
+ // Removing is done by setting text to an empty string.
+ this.changePropertyText(property, "");
+ },
+
+ // Private
+
+ _handlePropertyChange: function(property, error, stylePayload)
+ {
+ if (error)
+ return;
+
+ DOMAgent.markUndoableState();
+
+ // Do a refresh instead of handling stylePayload so computed style is updated and we get valid
+ // styleSheetTextRange values for all the rules after this change.
+ this.refresh();
+ },
+
+ _createSourceCodeLocation: function(sourceURL, sourceLine, sourceColumn)
+ {
+ if (!sourceURL)
+ return null;
+
+ var sourceCode;
+
+ // Try to use the node to find the frame which has the correct resource first.
+ if (this._node.ownerDocument) {
+ var mainResource = WebInspector.frameResourceManager.resourceForURL(this._node.ownerDocument.documentURL);
+ if (mainResource) {
+ var parentFrame = mainResource.parentFrame;
+ sourceCode = parentFrame.resourceForURL(sourceURL);
+ }
+ }
+
+ // If that didn't find the resource, then search all frames.
+ if (!sourceCode)
+ sourceCode = WebInspector.frameResourceManager.resourceForURL(sourceURL);
+
+ if (!sourceCode)
+ return null;
+
+ return sourceCode.createSourceCodeLocation(sourceLine || 0, sourceColumn || 0);
+ },
+
+ _parseSourceRangePayload: function(payload, text)
+ {
+ if (!payload)
+ return null;
+
+ // COMPATIBILITY (iOS 6): The range use to only contain start and end offsets. Now it
+ // has line and column for the start and end position. Support both here.
+ if ("start" in payload && "end" in payload) {
+ var textRange = new WebInspector.TextRange(payload.start, payload.end);
+ if (typeof text === "string")
+ textRange.resolveLinesAndColumns(text);
+ return textRange;
+ }
+
+ return new WebInspector.TextRange(payload.startLine, payload.startColumn, payload.endLine, payload.endColumn);
+ },
+
+ _parseStylePropertyPayload: function(payload, index, styleDeclaration, styleText)
+ {
+ var text = payload.text || "";
+ var name = payload.name;
+ var value = (payload.value || "").replace(/\s*!important\s*$/, "");
+ var priority = payload.priority || "";
+
+ var enabled = true;
+ var overridden = false;
+ var implicit = payload.implicit || false;
+ var anonymous = false;
+ var valid = "parsedOk" in payload ? payload.parsedOk : true;
+
+ switch (payload.status || "style") {
+ case "active":
+ enabled = true;
+ break;
+ case "inactive":
+ overridden = true;
+ enabled = true;
+ break;
+ case "disabled":
+ enabled = false;
+ break;
+ case "style":
+ anonymous = true;
+ break;
+ }
+
+ var styleSheetTextRange = null;
+ var styleDeclarationTextRange = null;
+
+ // COMPATIBILITY (iOS 6): The range is in the style text, not the whole stylesheet.
+ // Later the range was changed to be in the whole stylesheet.
+ if (payload.range && "start" in payload.range && "end" in payload.range)
+ styleDeclarationTextRange = this._parseSourceRangePayload(payload.range, styleText);
+ else
+ styleSheetTextRange = this._parseSourceRangePayload(payload.range);
+
+ if (styleDeclaration) {
+ // Use propertyForName when the index is NaN since propertyForName is fast in that case.
+ var property = isNaN(index) ? styleDeclaration.propertyForName(name, true) : styleDeclaration.properties[index];
+
+ // Reuse a property if the index and name matches. Otherwise it is a different property
+ // and should be created from scratch. This works in the simple cases where only existing
+ // properties change in place and no properties are inserted or deleted at the beginning.
+ // FIXME: This could be smarter by ignoring index and just go by name. However, that gets
+ // tricky for rules that have more than one property with the same name.
+ if (property && property.name === name && (property.index === index || (isNaN(property.index) && isNaN(index)))) {
+ property.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
+ return property;
+ }
+
+ // Reuse a pending property with the same name. These properties are pending being committed,
+ // so if we find a match that likely means it got committed and we should use it.
+ var pendingProperties = styleDeclaration.pendingProperties;
+ for (var i = 0; i < pendingProperties.length; ++i) {
+ var pendingProperty = pendingProperties[i];
+ if (pendingProperty.name === name && isNaN(pendingProperty.index)) {
+ pendingProperty.index = index;
+ pendingProperty.update(text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
+ return pendingProperty;
+ }
+ }
+ }
+
+ return new WebInspector.CSSProperty(index, text, name, value, priority, enabled, overridden, implicit, anonymous, valid, styleSheetTextRange, styleDeclarationTextRange);
+ },
+
+ _parseStyleDeclarationPayload: function(payload, node, inherited, type, rule, updateAllStyles)
+ {
+ if (!payload)
+ return null;
+
+ rule = rule || null;
+ inherited = inherited || false;
+
+ var id = payload.styleId;
+ var mapKey = id ? id.styleSheetId + ":" + id.ordinal : null;
+
+ var styleDeclaration = rule ? rule.style : null;
+ var styleDeclarations = [];
+
+ // Look for existing styles in the previous map if there is one, otherwise use the current map.
+ var previousStyleDeclarationsMap = this._previousStyleDeclarationsMap || this._styleDeclarationsMap;
+ if (mapKey && mapKey in previousStyleDeclarationsMap) {
+ styleDeclarations = previousStyleDeclarationsMap[mapKey];
+
+ // If we need to update all styles, then stop here and call _parseStyleDeclarationPayload for each style.
+ // We need to parse multiple times so we reuse the right properties from each style.
+ if (updateAllStyles && styleDeclarations.length) {
+ for (var i = 0; i < styleDeclarations.length; ++i) {
+ var styleDeclaration = styleDeclarations[i];
+ this._parseStyleDeclarationPayload(payload, styleDeclaration.node, styleDeclaration.inherited, styleDeclaration.type, styleDeclaration.ownerRule);
+ }
+
+ return;
+ }
+
+ if (!styleDeclaration) {
+ var filteredStyleDeclarations = styleDeclarations.filter(function(styleDeclaration) {
+ // This case only applies for styles that are not part of a rule.
+ if (styleDeclaration.ownerRule) {
+ console.assert(!rule);
+ return false;
+ }
+
+ if (styleDeclaration.node !== node)
+ return false;
+
+ if (styleDeclaration.inherited !== inherited)
+ return false;
+
+ return true;
+ });
+
+ console.assert(filteredStyleDeclarations.length <= 1);
+ styleDeclaration = filteredStyleDeclarations[0] || null;
+ }
+ }
+
+ if (previousStyleDeclarationsMap !== this._styleDeclarationsMap) {
+ // If the previous and current maps differ then make sure the found styleDeclaration is added to the current map.
+ styleDeclarations = mapKey && mapKey in this._styleDeclarationsMap ? this._styleDeclarationsMap[mapKey] : [] ;
+
+ if (styleDeclaration && !styleDeclarations.contains(styleDeclaration)) {
+ styleDeclarations.push(styleDeclaration);
+ this._styleDeclarationsMap[mapKey] = styleDeclarations;
+ }
+ }
+
+ var shorthands = {};
+ for (var i = 0; payload.shorthandEntries && i < payload.shorthandEntries.length; ++i) {
+ var shorthand = payload.shorthandEntries[i];
+ shorthands[shorthand.name] = shorthand.value;
+ }
+
+ var text = payload.cssText;
+
+ var inheritedPropertyCount = 0;
+
+ var properties = [];
+ for (var i = 0; payload.cssProperties && i < payload.cssProperties.length; ++i) {
+ var propertyPayload = payload.cssProperties[i];
+
+ if (inherited && propertyPayload.name in WebInspector.CSSKeywordCompletions.InheritedProperties)
+ ++inheritedPropertyCount;
+
+ var property = this._parseStylePropertyPayload(propertyPayload, i, styleDeclaration, text);
+ properties.push(property);
+ }
+
+ if (inherited && !inheritedPropertyCount)
+ return null;
+
+ var styleSheetTextRange = this._parseSourceRangePayload(payload.range);
+
+ if (styleDeclaration) {
+ styleDeclaration.update(text, properties, styleSheetTextRange);
+ return styleDeclaration;
+ }
+
+ var styleSheet = id ? WebInspector.cssStyleManager.styleSheetForIdentifier(id.styleSheetId) : null;
+ if (styleSheet)
+ styleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, this._styleSheetContentDidChange, this);
+
+ styleDeclaration = new WebInspector.CSSStyleDeclaration(this, styleSheet, id, type, node, inherited, text, properties, styleSheetTextRange);
+
+ if (mapKey) {
+ styleDeclarations.push(styleDeclaration);
+ this._styleDeclarationsMap[mapKey] = styleDeclarations;
+ }
+
+ return styleDeclaration;
+ },
+
+ _parseRulePayload: function(payload, matchedSelectorIndices, node, inherited, ruleOccurrences)
+ {
+ if (!payload)
+ return null;
+
+ // User and User Agent rules don't have 'ruleId' in the payload. However, their style's have 'styleId' and
+ // 'styleId' is the same identifier the backend uses for Author rule identifiers, so do the same here.
+ // They are excluded by the backend because they are not editable, however our front-end does not determine
+ // editability solely based on the existence of the id like the open source front-end does.
+ var id = payload.ruleId || payload.style.styleId;
+
+ var mapKey = id ? id.styleSheetId + ":" + id.ordinal + ":" + (inherited ? "I" : "N") + ":" + node.id : null;
+
+ // Rules can match multiple times if they have multiple selectors or because of inheritance. We keep a count
+ // of occurrences so we have unique rules per occurrence, that way properties will be correctly marked as overridden.
+ var occurrence = 0;
+ if (mapKey) {
+ if (mapKey in ruleOccurrences)
+ occurrence = ++ruleOccurrences[mapKey];
+ else
+ ruleOccurrences[mapKey] = occurrence;
+ }
+
+ // Append the occurrence number to the map key for lookup in the rules map.
+ mapKey += ":" + occurrence;
+
+ var rule = null;
+
+ // Look for existing rules in the previous map if there is one, otherwise use the current map.
+ var previousRulesMap = this._previousRulesMap || this._rulesMap;
+ if (mapKey && mapKey in previousRulesMap) {
+ rule = previousRulesMap[mapKey];
+
+ if (previousRulesMap !== this._rulesMap) {
+ // If the previous and current maps differ then make sure the found rule is added to the current map.
+ this._rulesMap[mapKey] = rule;
+ }
+ }
+
+ var style = this._parseStyleDeclarationPayload(payload.style, node, inherited, WebInspector.CSSStyleDeclaration.Type.Rule, rule);
+ if (!style)
+ return null;
+
+ // COMPATIBILITY (iOS 6): The payload had 'selectorText' as a property,
+ // now it has 'selectorList' with a 'text' property. Support both here.
+ var selectorText = payload.selectorList ? payload.selectorList.text : payload.selectorText;
+ var selectors = payload.selectorList ? payload.selectorList.selectors : [];
+
+ // COMPATIBILITY (iOS 6): The payload did not have 'selectorList'.
+ // Fallback to using 'sourceLine' without column information.
+ if (payload.selectorList && payload.selectorList.range) {
+ var sourceRange = payload.selectorList.range;
+ var sourceCodeLocation = this._createSourceCodeLocation(payload.sourceURL, sourceRange.startLine, sourceRange.startColumn);
+ } else
+ var sourceCodeLocation = this._createSourceCodeLocation(payload.sourceURL, payload.sourceLine);
+
+ var type;
+ switch (payload.origin) {
+ case "regular":
+ type = WebInspector.CSSRule.Type.Author;
+ break;
+ case "user":
+ type = WebInspector.CSSRule.Type.User;
+ break;
+ case "user-agent":
+ type = WebInspector.CSSRule.Type.UserAgent;
+ break;
+ case "inspector":
+ type = WebInspector.CSSRule.Type.Inspector;
+ break;
+ }
+
+ var mediaList = [];
+ for (var i = 0; payload.media && i < payload.media.length; ++i) {
+ var mediaItem = payload.media[i];
+
+ var mediaType;
+ switch (mediaItem.source) {
+ case "mediaRule":
+ mediaType = WebInspector.CSSMedia.Type.MediaRule;
+ break;
+ case "importRule":
+ mediaType = WebInspector.CSSMedia.Type.ImportRule;
+ break;
+ case "linkedSheet":
+ mediaType = WebInspector.CSSMedia.Type.LinkedStyleSheet;
+ break;
+ case "inlineSheet":
+ mediaType = WebInspector.CSSMedia.Type.InlineStyleSheet;
+ break;
+ }
+
+ var mediaText = mediaItem.text;
+ var mediaSourceCodeLocation = this._createSourceCodeLocation(mediaItem.sourceURL, mediaItem.sourceLine);
+
+ mediaList.push(new WebInspector.CSSMedia(mediaType, mediaText, mediaSourceCodeLocation));
+ }
+
+ if (rule) {
+ rule.update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList);
+ return rule;
+ }
+
+ var styleSheet = id ? WebInspector.cssStyleManager.styleSheetForIdentifier(id.styleSheetId) : null;
+ if (styleSheet)
+ styleSheet.addEventListener(WebInspector.CSSStyleSheet.Event.ContentDidChange, this._styleSheetContentDidChange, this);
+
+ rule = new WebInspector.CSSRule(this, styleSheet, id, type, sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList);
+
+ if (mapKey)
+ this._rulesMap[mapKey] = rule;
+
+ return rule;
+ },
+
+ _markAsNeedsRefresh: function()
+ {
+ this._needsRefresh = true;
+ this.dispatchEventToListeners(WebInspector.DOMNodeStyles.Event.NeedsRefresh);
+ },
+
+ _styleSheetContentDidChange: function(event)
+ {
+ var styleSheet = event.target;
+ console.assert(styleSheet);
+ if (!styleSheet)
+ return;
+
+ // Ignore the stylesheet we know we just changed and handled above.
+ if (styleSheet === this._ignoreNextContentDidChangeForStyleSheet) {
+ delete this._ignoreNextContentDidChangeForStyleSheet;
+ return;
+ }
+
+ this._markAsNeedsRefresh();
+ },
+
+ _updateStyleCascade: function()
+ {
+ var cascadeOrderedStyleDeclarations = this._collectStylesInCascadeOrder(this._matchedRules, this._inlineStyle, this._attributesStyle);
+
+ for (var i = 0; i < this._inheritedRules.length; ++i) {
+ var inheritedStyleInfo = this._inheritedRules[i];
+ var inheritedCascadeOrder = this._collectStylesInCascadeOrder(inheritedStyleInfo.matchedRules, inheritedStyleInfo.inlineStyle, null);
+ cascadeOrderedStyleDeclarations = cascadeOrderedStyleDeclarations.concat(inheritedCascadeOrder);
+ }
+
+ this._orderedStyles = cascadeOrderedStyleDeclarations;
+
+ this._propertyNameToEffectivePropertyMap = {};
+
+ this._markOverriddenProperties(cascadeOrderedStyleDeclarations, this._propertyNameToEffectivePropertyMap);
+ this._associateRelatedProperties(cascadeOrderedStyleDeclarations, this._propertyNameToEffectivePropertyMap);
+
+ for (var pseudoIdentifier in this._pseudoElements) {
+ var pseudoElementInfo = this._pseudoElements[pseudoIdentifier];
+ pseudoElementInfo.orderedStyles = this._collectStylesInCascadeOrder(pseudoElementInfo.matchedRules, null, null);
+ this._markOverriddenProperties(pseudoElementInfo.orderedStyles);
+ this._associateRelatedProperties(pseudoElementInfo.orderedStyles);
+ }
+ },
+
+ _collectStylesInCascadeOrder: function(matchedRules, inlineStyle, attributesStyle)
+ {
+ var result = [];
+
+ // Inline style has the greatest specificity. So it goes first in the cascade order.
+ if (inlineStyle)
+ result.push(inlineStyle);
+
+ var userAndUserAgentStyles = [];
+
+ for (var i = 0; i < matchedRules.length; ++i) {
+ var rule = matchedRules[i];
+
+ // Only append to the result array here for author and inspector rules since attribute
+ // styles come between author rules and user/user agent rules.
+ switch (rule.type) {
+ case WebInspector.CSSRule.Type.Inspector:
+ case WebInspector.CSSRule.Type.Author:
+ result.push(rule.style);
+ break;
+
+ case WebInspector.CSSRule.Type.User:
+ case WebInspector.CSSRule.Type.UserAgent:
+ userAndUserAgentStyles.push(rule.style);
+ break;
+ }
+ }
+
+ // Style properties from HTML attributes are next.
+ if (attributesStyle)
+ result.push(attributesStyle);
+
+ // Finally add the user and user stylesheet's matched style rules we collected earlier.
+ result = result.concat(userAndUserAgentStyles);
+
+ return result;
+ },
+
+ _markOverriddenProperties: function(styles, propertyNameToEffectiveProperty)
+ {
+ propertyNameToEffectiveProperty = propertyNameToEffectiveProperty || {};
+
+ for (var i = 0; i < styles.length; ++i) {
+ var style = styles[i];
+ var properties = style.properties;
+
+ for (var j = 0; j < properties.length; ++j) {
+ var property = properties[j];
+ if (!property.enabled || property.anonymous || !property.valid) {
+ property.overridden = false;
+ continue;
+ }
+
+ if (style.inherited && !property.inherited) {
+ property.overridden = false;
+ continue;
+ }
+
+ var canonicalName = property.canonicalName;
+ if (canonicalName in propertyNameToEffectiveProperty) {
+ var effectiveProperty = propertyNameToEffectiveProperty[canonicalName];
+
+ if (effectiveProperty.ownerStyle === property.ownerStyle) {
+ if (effectiveProperty.important && !property.important) {
+ property.overridden = true;
+ continue;
+ }
+ } else if (effectiveProperty.important || !property.important || effectiveProperty.ownerStyle.node !== property.ownerStyle.node) {
+ property.overridden = true;
+ continue;
+ }
+
+ effectiveProperty.overridden = true;
+ }
+
+ property.overridden = false;
+
+ propertyNameToEffectiveProperty[canonicalName] = property;
+ }
+ }
+ },
+
+ _associateRelatedProperties: function(styles, propertyNameToEffectiveProperty)
+ {
+ for (var i = 0; i < styles.length; ++i) {
+ var properties = styles[i].properties;
+
+ var knownShorthands = {};
+
+ for (var j = 0; j < properties.length; ++j) {
+ var property = properties[j];
+
+ if (!property.valid)
+ continue;
+
+ if (!WebInspector.CSSCompletions.cssNameCompletions.isShorthandPropertyName(property.name))
+ continue;
+
+ if (knownShorthands[property.canonicalName] && !knownShorthands[property.canonicalName].overridden) {
+ console.assert(property.overridden);
+ continue;
+ }
+
+ knownShorthands[property.canonicalName] = property;
+ }
+
+ for (var j = 0; j < properties.length; ++j) {
+ var property = properties[j];
+
+ if (!property.valid)
+ continue;
+
+ var shorthandProperty = null;
+
+ if (!isEmptyObject(knownShorthands)) {
+ var possibleShorthands = WebInspector.CSSCompletions.cssNameCompletions.shorthandsForLonghand(property.canonicalName);
+ for (var k = 0; k < possibleShorthands.length; ++k) {
+ if (possibleShorthands[k] in knownShorthands) {
+ shorthandProperty = knownShorthands[possibleShorthands[k]];
+ break;
+ }
+ }
+ }
+
+ if (!shorthandProperty || shorthandProperty.overridden !== property.overridden) {
+ property.relatedShorthandProperty = null;
+ property.clearRelatedLonghandProperties();
+ continue;
+ }
+
+ shorthandProperty.addRelatedLonghandProperty(property);
+ property.relatedShorthandProperty = shorthandProperty;
+
+ if (propertyNameToEffectiveProperty && propertyNameToEffectiveProperty[shorthandProperty.canonicalName] === shorthandProperty)
+ propertyNameToEffectiveProperty[property.canonicalName] = property;
+ }
+ }
+ }
+};
+
+WebInspector.DOMNodeStyles.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMSearchMatchObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMSearchMatchObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMSearchMatchObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,150 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMSearchMatchObject = function(resource, domNode, title, searchTerm, textRange)
+{
+ console.assert(resource instanceof WebInspector.Resource);
+ console.assert(domNode instanceof WebInspector.DOMNode);
+
+ WebInspector.Object.call(this);
+
+ this._resource = resource;
+ this._domNode = domNode;
+ this._title = title;
+ this._searchTerm = searchTerm;
+ this._sourceCodeTextRange = resource.createSourceCodeTextRange(textRange);
+};
+
+WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName = "dom-match-element-icon";
+WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName = "dom-match-text-node-icon";
+WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName = "dom-match-comment-icon";
+WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName = "dom-match-document-type-icon";
+WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName = "dom-match-character-data-icon";
+WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName = "dom-match-node-icon";
+
+WebInspector.DOMSearchMatchObject.prototype = {
+ constructor: WebInspector.DOMSearchMatchObject,
+
+ // Public
+
+ get domNode()
+ {
+ return this._domNode;
+ },
+
+ get title()
+ {
+ return this._title;
+ },
+
+ get className()
+ {
+ if (!this._className)
+ this._className = this._generateClassName();
+
+ return this._className;
+ },
+
+ get searchTerm()
+ {
+ return this._searchTerm;
+ },
+
+ get sourceCodeTextRange()
+ {
+ return this._sourceCodeTextRange;
+ },
+
+ // Private
+
+ _generateClassName: function()
+ {
+ switch (this._domNode.nodeType()) {
+ case Node.ELEMENT_NODE:
+ return WebInspector.DOMSearchMatchObject.DOMMatchElementIconStyleClassName;
+
+ case Node.TEXT_NODE:
+ return WebInspector.DOMSearchMatchObject.DOMMatchTextNodeIconStyleClassName;
+
+ case Node.COMMENT_NODE:
+ return WebInspector.DOMSearchMatchObject.DOMMatchCommentIconStyleClassName;
+
+ case Node.DOCUMENT_TYPE_NODE:
+ return WebInspector.DOMSearchMatchObject.DOMMatchDocumentTypeIconStyleClassName;
+
+ case Node.CDATA_SECTION_NODE:
+ return WebInspector.DOMSearchMatchObject.DOMMatchCharacterDataIconStyleClassName;
+
+ default:
+ console.error("Unknown DOM node type: ", node.nodeType());
+ return WebInspector.DOMSearchMatchObject.DOMMatchNodeIconStyleClassName;
+ }
+ }
+};
+
+WebInspector.DOMSearchMatchObject.titleForDOMNode = function(domNode)
+{
+ switch (domNode.nodeType()) {
+ case Node.ELEMENT_NODE:
+ var title = "<" + domNode.nodeNameInCorrectCase();
+
+ for (var i = 0; i < domNode.attributes().length; ++i) {
+ title += " " + domNode.attributes()[i].name;
+ if (domNode.attributes()[i].value.length)
+ title += "=\"" + domNode.attributes()[i].value + "\"";
+ }
+
+ return title + ">";
+
+ case Node.TEXT_NODE:
+ return "\"" + domNode.nodeValue() + "\"";
+
+ case Node.COMMENT_NODE:
+ return "<!--" + domNode.nodeValue() + "-->";
+
+ case Node.DOCUMENT_TYPE_NODE:
+ var title = "<!DOCTYPE " + domNode.nodeName();
+ if (domNode.publicId) {
+ title += " PUBLIC \"" + domNode.publicId + "\"";
+ if (node.systemId)
+ title += " \"" + domNode.systemId + "\"";
+ } else if (domNode.systemId)
+ title += " SYSTEM \"" + domNode.systemId + "\"";
+
+ if (domNode.internalSubset)
+ title += " [" + domNode.internalSubset + "]";
+
+ return title + ">";
+
+ case Node.CDATA_SECTION_NODE:
+ return "<![CDATA[" + domNode + "]]>";
+
+ default:
+ console.error("Unknown DOM node type: ", domNode.nodeType());
+ return domNode.nodeNameInCorrectCase();
+ }
+}
+
+WebInspector.DOMSearchMatchObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMStorageObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DOMStorageObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMStorageObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMStorageObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageObject = function(id, host, isLocalStorage)
+{
+ this._id = id;
+ this._host = host;
+ this._isLocalStorage = isLocalStorage;
+ this._entries = new Map;
+};
+
+WebInspector.DOMStorageObject.TypeIdentifier = "dom-storage";
+WebInspector.DOMStorageObject.HostCookieKey = "dom-storage-object-host";
+WebInspector.DOMStorageObject.LocalStorageCookieKey = "dom-storage-object-local-storage";
+
+WebInspector.DOMStorageObject.Event = {
+ ItemsCleared: "dom-storage-object-items-cleared",
+ ItemAdded: "dom-storage-object-item-added",
+ ItemRemoved: "dom-storage-object-item-removed",
+ ItemUpdated: "dom-storage-object-updated",
+};
+
+WebInspector.DOMStorageObject.prototype = {
+ constructor: WebInspector.DOMStorageObject,
+ __proto__: WebInspector.Object.prototype,
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get host()
+ {
+ return this._host;
+ },
+
+ get entries()
+ {
+ return this._entries;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.DOMStorageObject.HostCookieKey] = this.host;
+ cookie[WebInspector.DOMStorageObject.LocalStorageCookieKey] = this.isLocalStorage();
+ },
+
+ isLocalStorage: function()
+ {
+ return this._isLocalStorage;
+ },
+
+ getEntries: function(callback)
+ {
+ // COMPATIBILITY (iOS 6): The getDOMStorageItems function was later renamed to getDOMStorageItems.
+ if (DOMStorageAgent.getDOMStorageEntries)
+ DOMStorageAgent.getDOMStorageEntries(this._id, callback);
+ else
+ DOMStorageAgent.getDOMStorageItems(this._id, callback);
+ },
+
+ removeItem: function(key)
+ {
+ DOMStorageAgent.removeDOMStorageItem(this._id, key);
+ },
+
+ setItem: function(key, value)
+ {
+ DOMStorageAgent.setDOMStorageItem(this._id, key, value);
+ },
+
+ itemsCleared: function()
+ {
+ this._entries.clear();
+ this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemsCleared);
+ },
+
+ itemRemoved: function(key)
+ {
+ this._entries.delete(key);
+ this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemRemoved, {key: key});
+ },
+
+ itemAdded: function(key, value)
+ {
+ this._entries.set(key, value);
+ this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemAdded, {key: key, value: value});
+ },
+
+ itemUpdated: function(key, oldValue, value)
+ {
+ this._entries.set(key, value);
+ var data = {key: key, oldValue: oldValue, value: value};
+ this.dispatchEventToListeners(WebInspector.DOMStorageObject.Event.ItemUpdated, data);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMTreejsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTree.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,334 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTree = function(frame)
+{
+ WebInspector.Object.call(this);
+
+ this._frame = frame;
+
+ this._rootDOMNode = null;
+ this._requestIdentifier = 0;
+ this._flowMap = {};
+
+ this._frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextChanged, this);
+
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._documentUpdated, this);
+
+ // Only add extra event listeners when not the main frame. Since DocumentUpdated is enough for the main frame.
+ if (!this._frame.isMainFrame()) {
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
+ this._frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._frameMainResourceDidChange, this);
+ }
+
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowListWasUpdated, this._contentFlowListWasUpdated, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasAdded, this._contentFlowWasAdded, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ContentFlowWasRemoved, this._contentFlowWasRemoved, this);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.DOMTree);
+
+WebInspector.DOMTree.Event = {
+ RootDOMNodeInvalidated: "dom-tree-root-dom-node-invalidated",
+ ContentFlowWasAdded: "dom-tree-content-flow-was-added",
+ ContentFlowWasRemoved: "dom-tree-content-flow-was-removed"
+};
+
+WebInspector.DOMTree.prototype = {
+ constructor: WebInspector.DOMTree,
+
+ // Public
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ get flowMap()
+ {
+ return this._flowMap;
+ },
+
+ get flowsCount()
+ {
+ return Object.keys(this._flowMap).length;
+ },
+
+ invalidate: function()
+ {
+ // Set to null so it is fetched again next time requestRootDOMNode is called.
+ this._rootDOMNode = null;
+
+ // Clear the pending callbacks. It is the responsibility of the client to listen for
+ // the RootDOMNodeInvalidated event and request the root DOM node again.
+ delete this._pendingRootDOMNodeRequests;
+
+ if (this._invalidateTimeoutIdentifier)
+ return;
+
+ function performInvalidate()
+ {
+ delete this._invalidateTimeoutIdentifier;
+
+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.RootDOMNodeInvalidated);
+ }
+
+ // Delay the invalidation on a timeout to coalesce multiple calls to invalidate.
+ this._invalidateTimeoutIdentifier = setTimeout(performInvalidate.bind(this), 0);
+ },
+
+ requestRootDOMNode: function(callback)
+ {
+ console.assert(typeof callback === "function");
+ if (typeof callback !== "function")
+ return;
+
+ if (this._rootDOMNode) {
+ callback(this._rootDOMNode);
+ return;
+ }
+
+ if (!this._frame.isMainFrame() && WebInspector.ExecutionContext.supported() && !this._frame.pageExecutionContext) {
+ this._rootDOMNodeRequestWaitingForExecutionContext = true;
+ if (!this._pendingRootDOMNodeRequests)
+ this._pendingRootDOMNodeRequests = [];
+ this._pendingRootDOMNodeRequests.push(callback);
+ return;
+ }
+
+ if (this._pendingRootDOMNodeRequests) {
+ this._pendingRootDOMNodeRequests.push(callback);
+ return;
+ }
+
+ this._pendingRootDOMNodeRequests = [callback];
+ this._requestRootDOMNode();
+ },
+
+ // Private
+
+ _requestRootDOMNode: function()
+ {
+ console.assert(this._frame.isMainFrame() || !WebInspector.ExecutionContext.supported() || this._frame.pageExecutionContext);
+ console.assert(this._pendingRootDOMNodeRequests.length);
+
+ // Bump the request identifier. This prevents pending callbacks for previous requests from completing.
+ var requestIdentifier = ++this._requestIdentifier;
+
+ function rootObjectAvailable(error, result)
+ {
+ // Check to see if we have been invalidated (if the callbacks were cleared).
+ if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
+ return;
+
+ if (error) {
+ console.error(JSON.stringify(error));
+
+ this._rootDOMNode = null;
+ dispatchCallbacks.call(this);
+ return;
+ }
+
+ // Convert the RemoteObject to a DOMNode by asking the backend to push it to us.
+ var remoteObject = WebInspector.RemoteObject.fromPayload(result);
+ remoteObject.pushNodeToFrontend(rootDOMNodeAvailable.bind(this, remoteObject));
+ }
+
+ function rootDOMNodeAvailable(remoteObject, nodeId)
+ {
+ remoteObject.release();
+
+ // Check to see if we have been invalidated (if the callbacks were cleared).
+ if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
+ return;
+
+ if (!nodeId) {
+ this._rootDOMNode = null;
+ dispatchCallbacks.call(this);
+ return;
+ }
+
+ this._rootDOMNode = WebInspector.domTreeManager.nodeForId(nodeId);
+
+ console.assert(this._rootDOMNode);
+ if (!this._rootDOMNode) {
+ dispatchCallbacks.call(this);
+ return;
+ }
+
+ // Request the child nodes since the root node is often not shown in the UI,
+ // and the child nodes will be needed immediately.
+ this._rootDOMNode.getChildNodes(dispatchCallbacks.bind(this));
+ }
+
+ function mainDocumentAvailable(document)
+ {
+ this._rootDOMNode = document;
+
+ dispatchCallbacks.call(this);
+ }
+
+ function dispatchCallbacks()
+ {
+ // Check to see if we have been invalidated (if the callbacks were cleared).
+ if (!this._pendingRootDOMNodeRequests || requestIdentifier != this._requestIdentifier)
+ return;
+
+ for (var i = 0; i < this._pendingRootDOMNodeRequests.length; ++i)
+ this._pendingRootDOMNodeRequests[i](this._rootDOMNode);
+ delete this._pendingRootDOMNodeRequests;
+ }
+
+ // For the main frame we can use the more straight forward requestDocument function. For
+ // child frames we need to do a more roundabout approach since the protocol does not include
+ // a specific way to request a document given a frame identifier. The child frame approach
+ // involves evaluating the JavaScript "document" and resolving that into a DOMNode.
+ if (this._frame.isMainFrame())
+ WebInspector.domTreeManager.requestDocument(mainDocumentAvailable.bind(this));
+ else {
+ // COMPATIBILITY (iOS 6): Execution context identifiers (contextId) did not exist
+ // in iOS 6. Fallback to including the frame identifier (frameId).
+ var contextId = this._frame.pageExecutionContext ? this._frame.pageExecutionContext.id : undefined;
+ RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "", includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, contextId: contextId, frameId: this._frame.id, returnByValue: false, generatePreview: false}, rootObjectAvailable.bind(this));
+ }
+ },
+
+ _nodeRemoved: function(event)
+ {
+ console.assert(!this._frame.isMainFrame());
+
+ if (event.data.node !== this._rootDOMNode)
+ return;
+
+ this.invalidate();
+ },
+
+ _documentUpdated: function(event)
+ {
+ this.invalidate();
+ },
+
+ _frameMainResourceDidChange: function(event)
+ {
+ console.assert(!this._frame.isMainFrame());
+
+ this.invalidate();
+ },
+
+ _framePageExecutionContextChanged: function(event)
+ {
+ if (this._rootDOMNodeRequestWaitingForExecutionContext) {
+ console.assert(this._frame.pageExecutionContext);
+ console.assert(this._pendingRootDOMNodeRequests && this._pendingRootDOMNodeRequests.length);
+
+ delete this._rootDOMNodeRequestWaitingForExecutionContext;
+
+ this._requestRootDOMNode();
+ }
+ },
+
+ requestContentFlowList: function()
+ {
+ this.requestRootDOMNode(function(rootNode) {
+ // Let the backend know we are interested about the named flow events for this document.
+ WebInspector.domTreeManager.getNamedFlowCollection(rootNode.id);
+ });
+ },
+
+ _isContentFlowInCurrentDocument: function(flow)
+ {
+ return this._rootDOMNode && this._rootDOMNode.id === flow.documentNodeIdentifier;
+ },
+
+ _contentFlowListWasUpdated: function(event)
+ {
+ if (!this._rootDOMNode || this._rootDOMNode.id !== event.data.documentNodeIdentifier)
+ return;
+
+ // Assume that all the flows have been removed.
+ var deletedFlows = {};
+ for (var flowId in this._flowMap)
+ deletedFlows[flowId] = this._flowMap[flowId];
+
+ var newFlows = [];
+
+ var flows = event.data.flows;
+ for (var i = 0; i < flows.length; ++i) {
+ var flow = flows[i];
+ // All the flows received from WebKit are part of the same document.
+ console.assert(this._isContentFlowInCurrentDocument(flow));
+
+ var flowId = flow.id;
+ if (this._flowMap.hasOwnProperty(flowId)) {
+ // Remove the flow name from the deleted list.
+ console.assert(deletedFlows.hasOwnProperty(flowId));
+ delete deletedFlows[flowId];
+ } else {
+ this._flowMap[flowId] = flow;
+ newFlows.push(flow);
+ }
+ }
+
+ for (var flowId in deletedFlows) {
+ delete this._flowMap[flowId];
+ }
+
+ // Send update events to listeners.
+
+ for (var flowId in deletedFlows)
+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: deletedFlows[flowId]});
+
+ for (var i = 0; i < newFlows.length; ++i)
+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: newFlows[i]});
+ },
+
+ _contentFlowWasAdded: function(event)
+ {
+ var flow = event.data.flow;
+ if (!this._isContentFlowInCurrentDocument(flow))
+ return;
+
+ var flowId = flow.id;
+ console.assert(!this._flowMap.hasOwnProperty(flowId));
+ this._flowMap[flowId] = flow;
+
+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: flow});
+ },
+
+ _contentFlowWasRemoved: function(event)
+ {
+ var flow = event.data.flow;
+ if (!this._isContentFlowInCurrentDocument(flow))
+ return;
+
+ var flowId = flow.id;
+ console.assert(this._flowMap.hasOwnProperty(flowId));
+ delete this._flowMap[flowId];
+
+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: flow});
+ }
+};
+
+WebInspector.DOMTree.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDatabaseObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,135 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseObject = function(id, host, name, version)
+{
+ this._id = id;
+ this._host = host ? host : WebInspector.UIString("Local File");
+ this._name = name;
+ this._version = version;
+};
+
+WebInspector.DatabaseObject.TypeIdentifier = "database";
+WebInspector.DatabaseObject.HostCookieKey = "database-object-host";
+WebInspector.DatabaseObject.NameCookieKey = "database-object-name";
+
+WebInspector.DatabaseObject.prototype = {
+ constructor: WebInspector.DatabaseObject,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get host()
+ {
+ return this._host;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get version()
+ {
+ return this._version;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.DatabaseObject.HostCookieKey] = this.host;
+ cookie[WebInspector.DatabaseObject.NameCookieKey] = this.name;
+ },
+
+ getTableNames: function(callback)
+ {
+ function sortingCallback(error, names)
+ {
+ if (!error)
+ callback(names.sort());
+ }
+
+ DatabaseAgent.getDatabaseTableNames(this._id, sortingCallback);
+ },
+
+ executeSQL: function(query, successCallback, errorCallback)
+ {
+ function queryCallback(columnNames, values, sqlError)
+ {
+ if (sqlError) {
+ var message;
+
+ switch (sqlError.code) {
+ case SQLException.VERSION_ERR:
+ message = WebInspector.UIString("Database no longer has expected version.");
+ break;
+ case SQLException.TOO_LARGE_ERR:
+ message = WebInspector.UIString("Data returned from the database is too large.");
+ break;
+ default:
+ message = WebInspector.UIString("An unexpected error occurred.");
+ break;
+ }
+
+ errorCallback(message);
+ return;
+ }
+
+ successCallback(columnNames, values);
+ }
+
+ function callback(error, result)
+ {
+ if (error) {
+ errorCallback(WebInspector.UIString("An unexpected error occurred."));
+ return;
+ }
+
+ // COMPATIBILITY (iOS 6): Newer versions of DatabaseAgent.executeSQL can delay before
+ // sending the results. The version on iOS 6 instead returned a transactionId that
+ // would be used later in the sqlTransactionSucceeded or sqlTransactionFailed events.
+ if ("transactionId" in result) {
+ if (!result.success) {
+ errorCallback(WebInspector.UIString("An unexpected error occurred."));
+ return;
+ }
+
+ WebInspector.DatabaseObserver._callbacks[result.transactionId] = queryCallback;
+ return;
+ }
+
+ queryCallback(result.columnNames, result.values, result.sqlError);
+ }
+
+ // COMPATIBILITY (iOS 6): Since the parameters of the DatabaseAgent.executeSQL callback differ
+ // we need the result object to lookup parameters by name.
+ callback.expectsResultObject = true;
+
+ DatabaseAgent.executeSQL(this._id, query, callback);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDatabaseTableObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTableObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseTableObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTableObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseTableObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DatabaseTableObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableObject = function(name, database)
+{
+ console.assert(database instanceof WebInspector.DatabaseObject);
+
+ this._name = name;
+ this._database = database;
+};
+
+WebInspector.DatabaseTableObject.TypeIdentifier = "database-table";
+WebInspector.DatabaseTableObject.NameCookieKey = "database-table-object-name";
+
+WebInspector.DatabaseTableObject.prototype = {
+ constructor: WebInspector.DatabaseTableObject,
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get database()
+ {
+ return this._database;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.DatabaseTableObject.NameCookieKey] = this.name;
+ },
+};
+
+WebInspector.DatabaseTableObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextjsfromrev164541trunkSourceWebInspectorUIUserInterfaceExecutionContextjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ExecutionContext.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ExecutionContext = function(id, name, isPageContext, frame)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(typeof id === "number" || id === WebInspector.QuickConsole.MainFrameContextExecutionIdentifier);
+ console.assert(typeof name === "string");
+
+ this._id = id;
+ this._name = name;
+ this._isPageContext = isPageContext || false;
+ this._frame = frame || null;
+};
+
+WebInspector.ExecutionContext.supported = function()
+{
+ // Execution contexts were added to the Inspector protocol alongside RuntimeAgent.enable and
+ // disable methods, which turn on and off sending Runtime agent execution context created events.
+ // So we can feature detect support for execution contexts with these RuntimeAgent functions.
+ return typeof RuntimeAgent.enable === "function";
+}
+
+WebInspector.ExecutionContext.prototype = {
+ constructor: WebInspector.ExecutionContext,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get isPageContext()
+ {
+ return this._isPageContext;
+ },
+
+ get frame()
+ {
+ return this._frame;
+ }
+};
+
+WebInspector.ExecutionContext.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextListjsfromrev164541trunkSourceWebInspectorUIUserInterfaceExecutionContextListjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ExecutionContextList.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ExecutionContextList = function()
+{
+ WebInspector.Object.call(this);
+
+ this._contexts = [];
+ this._pageExecutionContext = null;
+};
+
+WebInspector.ExecutionContextList.prototype = {
+ constructor: WebInspector.ExecutionContextList,
+
+ // Public
+
+ get pageExecutionContext()
+ {
+ return this._pageExecutionContext;
+ },
+
+ get contexts()
+ {
+ return this._contexts;
+ },
+
+ add: function(context)
+ {
+ // FIXME: The backend sends duplicate page context execution contexts with the same id. Why?
+ if (context.isPageContext && this._pageExecutionContext) {
+ console.assert(context.id === this._pageExecutionContext.id);
+ return false;
+ }
+
+ this._contexts.push(context);
+
+ if (context.isPageContext) {
+ console.assert(!this._pageExecutionContext);
+ this._pageExecutionContext = context;
+ return true;
+ }
+
+ return false;
+ },
+
+ clear: function()
+ {
+ this._contexts = [];
+ this._pageExecutionContext = null;
+ }
+};
+
+WebInspector.ExecutionContextList.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsFramejsfromrev164541trunkSourceWebInspectorUIUserInterfaceFramejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Frame.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Frame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,501 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Frame = function(id, name, securityOrigin, loaderIdentifier, mainResource)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(id);
+
+ this._id = id;
+
+ this._name = null;
+ this._securityOrigin = null;
+
+ this._resourceCollection = new WebInspector.ResourceCollection;
+ this._provisionalResourceCollection = new WebInspector.ResourceCollection;
+
+ this._childFrames = [];
+ this._childFrameIdentifierMap = {};
+
+ this._parentFrame = null;
+ this._isMainFrame = false;
+
+ this._domContentReadyEventTimestamp = NaN;
+ this._loadEventTimestamp = NaN;
+
+ this._executionContextList = new WebInspector.ExecutionContextList;
+
+ this.initialize(name, securityOrigin, loaderIdentifier, mainResource);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Frame);
+
+WebInspector.Frame.Event = {
+ NameDidChange: "frame-name-did-change",
+ SecurityOriginDidChange: "frame-security-origin-did-change",
+ MainResourceDidChange: "frame-main-resource-did-change",
+ ProvisionalLoadStarted: "frame-provisional-load-started",
+ ProvisionalLoadCommitted: "frame-provisional-load-committed",
+ ProvisionalLoadCleared: "frame-provisional-load-cleared",
+ ProvisionalResourceWasAdded: "frame-provisional-resource-was-added",
+ ResourceWasAdded: "frame-resource-was-added",
+ ResourceWasRemoved: "frame-resource-was-removed",
+ AllResourcesRemoved: "frame-all-resources-removed",
+ ChildFrameWasAdded: "frame-child-frame-was-added",
+ ChildFrameWasRemoved: "frame-child-frame-was-removed",
+ AllChildFramesRemoved: "frame-all-child-frames-removed",
+ PageExecutionContextChanged: "frame-page-execution-context-changed",
+ ExecutionContextsCleared: "frame-execution-contexts-cleared"
+};
+
+WebInspector.Frame.TypeIdentifier = "Frame";
+WebInspector.Frame.MainResourceURLCookieKey = "frame-main-resource-url";
+
+WebInspector.Frame.prototype = {
+ constructor: WebInspector.Frame,
+
+ // Public
+
+ initialize: function(name, securityOrigin, loaderIdentifier, mainResource)
+ {
+ console.assert(loaderIdentifier);
+ console.assert(mainResource);
+
+ var oldName = this._name;
+ var oldSecurityOrigin = this._securityOrigin;
+ var oldMainResource = this._mainResource;
+
+ this._name = name || null;
+ this._securityOrigin = securityOrigin || null;
+ this._loaderIdentifier = loaderIdentifier || null;
+
+ this._mainResource = mainResource;
+ this._mainResource._parentFrame = this;
+
+ if (oldMainResource && this._mainResource !== oldMainResource)
+ this._disassociateWithResource(oldMainResource);
+
+ this.removeAllResources();
+ this.removeAllChildFrames();
+ this.clearExecutionContexts();
+ this.clearProvisionalLoad();
+
+ if (this._mainResource !== oldMainResource)
+ this._dispatchMainResourceDidChangeEvent(oldMainResource);
+
+ if (this._securityOrigin !== oldSecurityOrigin)
+ this.dispatchEventToListeners(WebInspector.Frame.Event.SecurityOriginDidChange, {oldSecurityOrigin: oldSecurityOrigin});
+
+ if (this._name !== oldName)
+ this.dispatchEventToListeners(WebInspector.Frame.Event.NameDidChange, {oldName: oldName});
+ },
+
+ startProvisionalLoad: function(provisionalMainResource)
+ {
+ console.assert(provisionalMainResource);
+
+ this._provisionalMainResource = provisionalMainResource;
+ this._provisionalMainResource._parentFrame = this;
+
+ this._provisionalLoaderIdentifier = provisionalMainResource.loaderIdentifier;
+
+ this._provisionalResourceCollection.removeAllResources();
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadStarted);
+ },
+
+ commitProvisionalLoad: function(securityOrigin)
+ {
+ console.assert(this._provisionalMainResource);
+ console.assert(this._provisionalLoaderIdentifier);
+ if (!this._provisionalLoaderIdentifier)
+ return;
+
+ var oldSecurityOrigin = this._securityOrigin;
+ var oldMainResource = this._mainResource;
+
+ this._securityOrigin = securityOrigin || null;
+ this._loaderIdentifier = this._provisionalLoaderIdentifier;
+ this._mainResource = this._provisionalMainResource;
+
+ this._domContentReadyEventTimestamp = NaN;
+ this._loadEventTimestamp = NaN;
+
+ if (oldMainResource && this._mainResource !== oldMainResource)
+ this._disassociateWithResource(oldMainResource);
+
+ this.removeAllResources();
+
+ this._resourceCollection = this._provisionalResourceCollection;
+ this._provisionalResourceCollection = new WebInspector.ResourceCollection;
+
+ this.clearExecutionContexts(true);
+ this.clearProvisionalLoad(true);
+ this.removeAllChildFrames();
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadCommitted);
+
+ if (this._mainResource !== oldMainResource)
+ this._dispatchMainResourceDidChangeEvent(oldMainResource);
+
+ if (this._securityOrigin !== oldSecurityOrigin)
+ this.dispatchEventToListeners(WebInspector.Frame.Event.SecurityOriginDidChange, {oldSecurityOrigin: oldSecurityOrigin});
+ },
+
+ clearProvisionalLoad: function(skipProvisionalLoadClearedEvent)
+ {
+ if (!this._provisionalLoaderIdentifier)
+ return;
+
+ this._provisionalLoaderIdentifier = null;
+ this._provisionalMainResource = null;
+ this._provisionalResourceCollection.removeAllResources();
+
+ if (!skipProvisionalLoadClearedEvent)
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalLoadCleared);
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get loaderIdentifier()
+ {
+ return this._loaderIdentifier;
+ },
+
+ get provisionalLoaderIdentifier()
+ {
+ return this._provisionalLoaderIdentifier;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get securityOrigin()
+ {
+ return this._securityOrigin;
+ },
+
+ get url()
+ {
+ return this._mainResource._url;
+ },
+
+ get domTree()
+ {
+ if (!this._domTree)
+ this._domTree = new WebInspector.DOMTree(this);
+ return this._domTree;
+ },
+
+ get pageExecutionContext()
+ {
+ return this._executionContextList.pageExecutionContext;
+ },
+
+ get executionContextList()
+ {
+ return this._executionContextList;
+ },
+
+ clearExecutionContexts: function(committingProvisionalLoad)
+ {
+ if (this._executionContextList.contexts.length) {
+ this._executionContextList.clear();
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ExecutionContextsCleared, {committingProvisionalLoad:!!committingProvisionalLoad});
+ }
+ },
+
+ addExecutionContext: function(context)
+ {
+ var changedPageContext = this._executionContextList.add(context);
+
+ if (changedPageContext)
+ this.dispatchEventToListeners(WebInspector.Frame.Event.PageExecutionContextChanged);
+ },
+
+ get mainResource()
+ {
+ return this._mainResource;
+ },
+
+ get provisionalMainResource()
+ {
+ return this._provisionalMainResource;
+ },
+
+ get parentFrame()
+ {
+ return this._parentFrame;
+ },
+
+ get childFrames()
+ {
+ return this._childFrames;
+ },
+
+ get domContentReadyEventTimestamp()
+ {
+ return this._domContentReadyEventTimestamp;
+ },
+
+ get loadEventTimestamp()
+ {
+ return this._loadEventTimestamp;
+ },
+
+ isMainFrame: function()
+ {
+ return this._isMainFrame;
+ },
+
+ markAsMainFrame: function()
+ {
+ this._isMainFrame = true;
+ },
+
+ unmarkAsMainFrame: function()
+ {
+ this._isMainFrame = false;
+ },
+
+ markDOMContentReadyEvent: function(timestamp)
+ {
+ this._domContentReadyEventTimestamp = timestamp || NaN;
+ },
+
+ markLoadEvent: function(timestamp)
+ {
+ this._loadEventTimestamp = timestamp || NaN;
+ },
+
+ isDetached: function()
+ {
+ var frame = this;
+ while (frame) {
+ if (frame.isMainFrame())
+ return false;
+ frame = frame.parentFrame;
+ }
+
+ return true;
+ },
+
+ childFrameForIdentifier: function(frameId)
+ {
+ return this._childFrameIdentifierMap[frameId] || null;
+ },
+
+ addChildFrame: function(frame)
+ {
+ console.assert(frame instanceof WebInspector.Frame);
+ if (!(frame instanceof WebInspector.Frame))
+ return;
+
+ if (frame._parentFrame === this)
+ return;
+
+ if (frame._parentFrame)
+ frame._parentFrame.removeChildFrame(frame);
+
+ this._childFrames.push(frame);
+ this._childFrameIdentifierMap[frame._id] = frame;
+
+ frame._parentFrame = this;
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ChildFrameWasAdded, {childFrame: frame});
+ },
+
+ removeChildFrame: function(frameOrFrameId)
+ {
+ console.assert(frameOrFrameId);
+
+ if (frameOrFrameId instanceof WebInspector.Frame)
+ var childFrameId = frameOrFrameId._id;
+ else
+ var childFrameId = frameOrFrameId;
+
+ // Fetch the frame by id even if we were passed a WebInspector.Frame.
+ // We do this incase the WebInspector.Frame is a new object that isn't in _childFrames,
+ // but the id is a valid child frame.
+ var childFrame = this.childFrameForIdentifier(childFrameId);
+ console.assert(childFrame instanceof WebInspector.Frame);
+ if (!(childFrame instanceof WebInspector.Frame))
+ return;
+
+ console.assert(childFrame.parentFrame === this);
+
+ this._childFrames.remove(childFrame);
+ delete this._childFrameIdentifierMap[childFrame._id];
+
+ childFrame._parentFrame = null;
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ChildFrameWasRemoved, {childFrame: childFrame});
+ },
+
+ removeAllChildFrames: function()
+ {
+ if (!this._childFrames.length)
+ return;
+
+ for (var i = 0; i < this._childFrames.length; ++i)
+ this._childFrames[i]._parentFrame = null;
+
+ this._childFrames = [];
+ this._childFrameIdentifierMap = {};
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.AllChildFramesRemoved);
+ },
+
+ get resources()
+ {
+ return this._resourceCollection.resources;
+ },
+
+ resourceForURL: function(url, recursivelySearchChildFrames)
+ {
+ var resource = this._resourceCollection.resourceForURL(url);
+ if (resource)
+ return resource;
+
+ // Check the main resources of the child frames for the requested URL.
+ for (var i = 0; i < this._childFrames.length; ++i) {
+ resource = this._childFrames[i].mainResource;
+ if (resource.url === url)
+ return resource;
+ }
+
+ if (!recursivelySearchChildFrames)
+ return null;
+
+ // Recursively search resources of child frames.
+ for (var i = 0; i < this._childFrames.length; ++i) {
+ resource = this._childFrames[i].resourceForURL(url, true);
+ if (resource)
+ return resource;
+ }
+
+ return null;
+ },
+
+ resourcesWithType: function(type)
+ {
+ return this._resourceCollection.resourcesWithType(type);
+ },
+
+ addResource: function(resource)
+ {
+ console.assert(resource instanceof WebInspector.Resource);
+ if (!(resource instanceof WebInspector.Resource))
+ return;
+
+ if (resource.parentFrame === this)
+ return;
+
+ if (resource.parentFrame)
+ resource.parentFrame.removeResource(resource);
+
+ this._associateWithResource(resource);
+
+ if (this._isProvisionalResource(resource)) {
+ this._provisionalResourceCollection.addResource(resource);
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ProvisionalResourceWasAdded, {resource: resource});
+ } else {
+ this._resourceCollection.addResource(resource);
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ResourceWasAdded, {resource: resource});
+ }
+ },
+
+ removeResource: function(resourceOrURL)
+ {
+ // This does not remove provisional resources.
+
+ var resource = this._resourceCollection.removeResource(resourceOrURL);
+ if (!resource)
+ return;
+
+ this._disassociateWithResource(resource);
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.ResourceWasRemoved, {resource: resource});
+ },
+
+ removeAllResources: function()
+ {
+ // This does not remove provisional resources, use clearProvisionalLoad for that.
+
+ var resources = this.resources;
+ if (!resources.length)
+ return;
+
+ for (var i = 0; i < resources.length; ++i)
+ this._disassociateWithResource(resources[i]);
+
+ this._resourceCollection.removeAllResources();
+
+ this.dispatchEventToListeners(WebInspector.Frame.Event.AllResourcesRemoved);
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.Frame.MainResourceURLCookieKey] = this.mainResource.url;
+ },
+
+ // Private
+
+ _isProvisionalResource: function(resource)
+ {
+ return (resource.loaderIdentifier && this._provisionalLoaderIdentifier && resource.loaderIdentifier === this._provisionalLoaderIdentifier);
+ },
+
+ _associateWithResource: function(resource)
+ {
+ console.assert(!resource._parentFrame);
+ if (resource._parentFrame)
+ return;
+
+ resource._parentFrame = this;
+ },
+
+ _disassociateWithResource: function(resource)
+ {
+ console.assert(resource.parentFrame === this);
+ if (resource.parentFrame !== this)
+ return;
+
+ resource._parentFrame = null;
+ },
+
+ _dispatchMainResourceDidChangeEvent: function(oldMainResource)
+ {
+ this.dispatchEventToListeners(WebInspector.Frame.Event.MainResourceDidChange, {oldMainResource: oldMainResource});
+ }
+};
+
+WebInspector.Frame.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsGeometryjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGeometryjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Geometry.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Geometry.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Geometry.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Geometry.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,306 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Point = function(x, y)
+{
+ this.x = x || 0;
+ this.y = y || 0;
+};
+
+WebInspector.Point.fromEvent = function(event)
+{
+ return new WebInspector.Point(event.pageX, event.pageY);
+};
+
+WebInspector.Point.fromEventInElement = function(event, element)
+{
+ var wkPoint = window.webkitConvertPointFromPageToNode(element, new WebKitPoint(event.pageX, event.pageY));
+ return new WebInspector.Point(wkPoint.x, wkPoint.y);
+};
+
+WebInspector.Point.prototype = {
+ constructor: WebInspector.Point,
+
+ toString : function()
+ {
+ return "WebInspector.Point[" + this.x + "," + this.y + "]";
+ },
+
+ copy: function()
+ {
+ return new WebInspector.Point(this.x, this.y);
+ },
+
+ equals: function(anotherPoint)
+ {
+ return (this.x === anotherPoint.x && this.y === anotherPoint.y);
+ }
+};
+
+WebInspector.Size = function(width, height)
+{
+ this.width = width || 0;
+ this.height = height || 0;
+};
+
+WebInspector.Size.prototype = {
+ constructor: WebInspector.Size,
+
+ toString: function()
+ {
+ return "WebInspector.Size[" + this.width + "," + this.height + "]";
+ },
+
+ copy: function()
+ {
+ return new WebInspector.Size(this.width, this.height);
+ },
+
+ equals: function(anotherSize)
+ {
+ return (this.width === anotherSize.width && this.height === anotherSize.height);
+ }
+};
+
+WebInspector.Size.ZERO_SIZE = new WebInspector.Size(0, 0);
+
+
+WebInspector.Rect = function(x, y, width, height)
+{
+ this.origin = new WebInspector.Point(x || 0, y || 0);
+ this.size = new WebInspector.Size(width || 0, height || 0);
+};
+
+WebInspector.Rect.rectFromClientRect = function(clientRect)
+{
+ return new WebInspector.Rect(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
+};
+
+WebInspector.Rect.unionOfRects = function(rects)
+{
+ var union = rects[0];
+ for (var i = 1; i < rects.length; ++i)
+ union = union.unionWithRect(rects[i]);
+ return union;
+};
+
+WebInspector.Rect.prototype = {
+ constructor: WebInspector.Rect,
+
+ toString: function()
+ {
+ return "WebInspector.Rect[" + [this.origin.x, this.origin.y, this.size.width, this.size.height].join(", ") + "]";
+ },
+
+ copy: function()
+ {
+ return new WebInspector.Rect(this.origin.x, this.origin.y, this.size.width, this.size.height);
+ },
+
+ equals: function(anotherRect)
+ {
+ return (this.origin.equals(anotherRect.origin) && this.size.equals(anotherRect.size));
+ },
+
+ inset: function(insets)
+ {
+ return new WebInspector.Rect(
+ this.origin.x + insets.left,
+ this.origin.y + insets.top,
+ this.size.width - insets.left - insets.right,
+ this.size.height - insets.top - insets.bottom
+ );
+ },
+
+ pad: function(padding)
+ {
+ return new WebInspector.Rect(
+ this.origin.x - padding,
+ this.origin.y - padding,
+ this.size.width + padding * 2,
+ this.size.height + padding * 2
+ );
+ },
+
+ minX: function()
+ {
+ return this.origin.x;
+ },
+
+ minY: function()
+ {
+ return this.origin.y;
+ },
+
+ midX: function()
+ {
+ return this.origin.x + (this.size.width / 2);
+ },
+
+ midY: function()
+ {
+ return this.origin.y + (this.size.height / 2);
+ },
+
+ maxX: function()
+ {
+ return this.origin.x + this.size.width;
+ },
+
+ maxY: function()
+ {
+ return this.origin.y + this.size.height;
+ },
+
+ intersectionWithRect: function(rect)
+ {
+ var x1 = Math.max(this.minX(), rect.minX());
+ var x2 = Math.min(this.maxX(), rect.maxX());
+ if (x1 > x2)
+ return WebInspector.Rect.ZERO_RECT;
+ var intersection = new WebInspector.Rect;
+ intersection.origin.x = x1;
+ intersection.size.width = x2 - x1;
+ var y1 = Math.max(this.minY(), rect.minY());
+ var y2 = Math.min(this.maxY(), rect.maxY());
+ if (y1 > y2)
+ return WebInspector.Rect.ZERO_RECT;
+ intersection.origin.y = y1;
+ intersection.size.height = y2 - y1;
+ return intersection;
+ },
+
+ unionWithRect: function(rect)
+ {
+ var x = Math.min(this.minX(), rect.minX());
+ var y = Math.min(this.minY(), rect.minY());
+ var width = Math.max(this.maxX(), rect.maxX()) - x;
+ var height = Math.max(this.maxY(), rect.maxY()) - y;
+ return new WebInspector.Rect(x, y, width, height);
+ },
+
+ round: function()
+ {
+ return new WebInspector.Rect(
+ Math.floor(this.origin.x),
+ Math.floor(this.origin.y),
+ Math.ceil(this.size.width),
+ Math.ceil(this.size.height)
+ );
+ }
+};
+
+WebInspector.Rect.ZERO_RECT = new WebInspector.Rect(0, 0, 0, 0);
+
+
+WebInspector.EdgeInsets = function(top, right, bottom, left)
+{
+ console.assert(arguments.length === 1 || arguments.length === 4);
+
+ if (arguments.length === 1) {
+ this.top = top;
+ this.right = top;
+ this.bottom = top;
+ this.left = top;
+ } else if (arguments.length === 4) {
+ this.top = top;
+ this.right = right;
+ this.bottom = bottom;
+ this.left = left;
+ }
+};
+
+WebInspector.EdgeInsets.prototype = {
+ constructor: WebInspector.EdgeInsets,
+
+ equals: function(anotherInset)
+ {
+ return (this.top === anotherInset.top && this.right === anotherInset.right &&
+ this.bottom === anotherInset.bottom && this.left === anotherInset.left);
+ },
+
+ copy: function()
+ {
+ return new WebInspector.EdgeInsets(this.top, this.right, this.bottom, this.left);
+ }
+};
+
+WebInspector.RectEdge = {
+ MIN_X : 0,
+ MIN_Y : 1,
+ MAX_X : 2,
+ MAX_Y : 3
+};
+
+WebInspector.Quad = function(quad)
+{
+ this.points = [
+ new WebInspector.Point(quad[0], quad[1]), // top left
+ new WebInspector.Point(quad[2], quad[3]), // top right
+ new WebInspector.Point(quad[4], quad[5]), // bottom right
+ new WebInspector.Point(quad[6], quad[7]) // bottom left
+ ];
+
+ this.width = Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));
+ this.height = Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));
+};
+
+WebInspector.Quad.prototype = {
+ constructor: WebInspector.Quad,
+
+ toProtocol: function()
+ {
+ return [
+ this.points[0].x, this.points[0].y,
+ this.points[1].x, this.points[1].y,
+ this.points[2].x, this.points[2].y,
+ this.points[3].x, this.points[3].y
+ ];
+ }
+};
+
+WebInspector.Polygon = function(points)
+{
+ this.points = points;
+}
+
+WebInspector.Polygon.prototype = {
+ constructor: WebInspector.Polygon,
+
+ bounds: function()
+ {
+ var minX = Number.MAX_VALUE;
+ var minY = Number.MAX_VALUE;
+ var maxX = -Number.MAX_VALUE;
+ var maxY = -Number.MAX_VALUE;
+ for (var point of this.points) {
+ minX = Math.min(minX, point.x);
+ maxX = Math.max(maxX, point.x);
+ minY = Math.min(minY, point.y);
+ maxY = Math.max(maxY, point.y);
+ }
+ return new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsGradientjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGradientjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Gradient.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Gradient.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Gradient.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Gradient.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,269 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Gradient = {
+ Types : {
+ Linear: "linear-gradient",
+ Radial: "radial-gradient"
+ },
+
+ fromString: function(cssString)
+ {
+ var type;
+ var openingParenthesisIndex = cssString.indexOf("(");
+ var typeString = cssString.substring(0, openingParenthesisIndex);
+ if (typeString.indexOf(WebInspector.Gradient.Types.Linear) !== -1)
+ type = WebInspector.Gradient.Types.Linear;
+ else if (typeString.indexOf(WebInspector.Gradient.Types.Radial) !== -1)
+ type = WebInspector.Gradient.Types.Radial;
+ else {
+ console.error("Couldn't parse angle \"" + typeString + "\"");
+ return null;
+ }
+
+ var components = [];
+ var currentParams = [];
+ var currentParam = "";
+ var openParentheses = 0;
+ var ch = openingParenthesisIndex + 1;
+ while (c = cssString[ch]) {
+ if (c === "(")
+ openParentheses++;
+ if (c === ")")
+ openParentheses--;
+
+ var isComma = c === ",";
+ var isSpace = /\s/.test(c);
+
+ if (openParentheses === 0) {
+ if (isSpace) {
+ if (currentParam !== "")
+ currentParams.push(currentParam);
+ currentParam = "";
+ } else if (isComma) {
+ currentParams.push(currentParam);
+ components.push(currentParams);
+ currentParams = [];
+ currentParam = "";
+ }
+ }
+
+ if (openParentheses === -1) {
+ currentParams.push(currentParam);
+ components.push(currentParams);
+ break;
+ }
+
+ if (openParentheses > 0 || (!isComma && !isSpace))
+ currentParam += c;
+
+ ch++;
+ }
+
+ var gradient;
+ if (type === WebInspector.Gradient.Types.Linear)
+ gradient = WebInspector.LinearGradient.linearGradientWithComponents(components);
+ else
+ gradient = WebInspector.RadialGradient.radialGradientWithComponents(components);
+
+ if (gradient)
+ gradient.repeats = typeString.indexOf("repeating") === 0;
+
+ return gradient;
+ },
+
+ stopsWithComponents: function(components)
+ {
+ // FIXME: handle lengths.
+ var stops = components.map(function(component) {
+ while (component.length) {
+ var color = WebInspector.Color.fromString(component.shift());
+ if (!color)
+ continue;
+
+ var stop = {color: color};
+ if (component.length && component[0].substr(-1) === "%")
+ stop.offset = parseFloat(component.shift()) / 100;
+ return stop;
+ }
+ });
+
+ if (!stops.length) {
+ console.error("Couldn't parse any stops");
+ return null;
+ }
+
+ for (var i = 0, count = stops.length; i < count; ++i) {
+ var stop = stops[i];
+ if (!stop.offset)
+ stop.offset = i / (count - 1);
+ }
+
+ return stops;
+ },
+
+ stringFromStops: function(stops)
+ {
+ var count = stops.length - 1;
+ return stops.map(function(stop, index) {
+ var str = stop.color;
+ if (stop.offset !== index / count)
+ str += " " + Math.round(stop.offset * 10000) / 100 + "%";
+ return str;
+ }).join(", ");
+ }
+};
+
+WebInspector.LinearGradient = function(angle, stops)
+{
+ this.type = WebInspector.Gradient.Types.Linear;
+ this.angle = angle;
+ this.stops = stops;
+}
+
+WebInspector.LinearGradient.linearGradientWithComponents = function(components)
+{
+ var angle = 180;
+
+ if (components[0].length === 1 && components[0][0].substr(-3) === "deg") {
+ angle = (parseFloat(components[0][0]) % 360 + 360) % 360;
+ components.shift();
+ } else if (components[0][0] === "to") {
+ components[0].shift();
+ switch (components[0].sort().join(" ")) {
+ case "top":
+ angle = 0;
+ break;
+ case "right top":
+ angle = 45;
+ break;
+ case "right":
+ angle = 90;
+ break;
+ case "bottom right":
+ angle = 135;
+ break;
+ case "bottom":
+ angle = 180;
+ break;
+ case "bottom left":
+ angle = 225;
+ break;
+ case "left":
+ angle = 270;
+ break;
+ case "left top":
+ angle = 315;
+ break;
+ default:
+ console.error("Couldn't parse angle \"to " + components[0].join(" ") + "\"");
+ return null;
+ }
+ components.shift();
+ }
+
+ var stops = WebInspector.Gradient.stopsWithComponents(components);
+ if (!stops)
+ return null;
+
+ return new WebInspector.LinearGradient(angle, stops);
+}
+
+WebInspector.LinearGradient.prototype = {
+ constructor: WebInspector.LinearGradient,
+
+ copy: function()
+ {
+ return new WebInspector.LinearGradient(this.angle, this.stops.concat());
+ },
+
+ toString: function()
+ {
+ var str = "";
+
+ if (this.angle === 0)
+ str += "to top";
+ else if (this.angle === 45)
+ str += "to top right";
+ else if (this.angle === 90)
+ str += "to right";
+ else if (this.angle === 135)
+ str += "to bottom right";
+ else if (this.angle === 225)
+ str += "to bottom left";
+ else if (this.angle === 270)
+ str += "to left";
+ else if (this.angle === 315)
+ str += "to top left";
+ else if (this.angle !== 180)
+ str += this.angle + "deg";
+
+ if (str !== "")
+ str += ", ";
+
+ str += WebInspector.Gradient.stringFromStops(this.stops);
+
+ return (this.repeats ? "repeating-" : "") + this.type + "(" + str + ")";
+ }
+}
+
+WebInspector.RadialGradient = function(sizing, stops)
+{
+ this.type = WebInspector.Gradient.Types.Radial;
+ this.sizing = sizing;
+ this.stops = stops;
+}
+
+WebInspector.RadialGradient.radialGradientWithComponents = function(components)
+{
+ var sizing = !WebInspector.Color.fromString(components[0].join(" ")) ? components.shift().join(" ") : "";
+
+ var stops = WebInspector.Gradient.stopsWithComponents(components);
+ if (!stops)
+ return null;
+
+ return new WebInspector.RadialGradient(sizing, stops);
+}
+
+WebInspector.RadialGradient.prototype = {
+ constructor: WebInspector.RadialGradient,
+
+ copy: function()
+ {
+ return new WebInspector.RadialGradient(this.sizing, this.stops.concat());
+ },
+
+ toString: function()
+ {
+ var str = this.sizing;
+
+ if (str !== "")
+ str += ", ";
+
+ str += WebInspector.Gradient.stringFromStops(this.stops);
+
+ return (this.repeats ? "repeating-" : "") + this.type + "(" + str + ")";
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabasejsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabasejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabase.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabase.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabase.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabase.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabase = function(name, securityOrigin, version, objectStores)
+{
+ WebInspector.Object.call(this);
+
+ this._name = name;
+ this._securityOrigin = securityOrigin;
+ this._host = parseSecurityOrigin(securityOrigin).host;
+ this._version = version;
+ this._objectStores = objectStores || [];
+
+ for (var objectStore of this._objectStores)
+ objectStore.establishRelationship(this);
+};
+
+WebInspector.IndexedDatabase.TypeIdentifier = "indexed-database";
+WebInspector.IndexedDatabase.NameCookieKey = "indexed-database-name";
+WebInspector.IndexedDatabase.HostCookieKey = "indexed-database-host";
+
+WebInspector.IndexedDatabase.prototype = {
+ constructor: WebInspector.IndexedDatabase,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get securityOrigin()
+ {
+ return this._securityOrigin;
+ },
+
+ get host()
+ {
+ return this._host;
+ },
+
+ get version()
+ {
+ return this._version;
+ },
+
+ get objectStores()
+ {
+ return this._objectStores;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.IndexedDatabase.NameCookieKey] = this._name;
+ cookie[WebInspector.IndexedDatabase.HostCookieKey] = this._host;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabaseObjectStorejsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStorejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStore.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStore.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStore.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStore.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStore = function(name, keyPath, autoIncrement, indexes)
+{
+ WebInspector.Object.call(this);
+
+ this._name = name;
+ this._keyPath = keyPath;
+ this._autoIncrement = autoIncrement || false;
+ this._indexes = indexes || [];
+ this._parentDatabase = null;
+
+ for (var index of this._indexes)
+ index.establishRelationship(this);
+};
+
+WebInspector.IndexedDatabaseObjectStore.TypeIdentifier = "indexed-database-object-store";
+WebInspector.IndexedDatabaseObjectStore.NameCookieKey = "indexed-database-object-store-name";
+WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey = "indexed-database-object-store-key-path";
+
+WebInspector.IndexedDatabaseObjectStore.prototype = {
+ constructor: WebInspector.IndexedDatabaseObjectStore,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get keyPath()
+ {
+ return this._keyPath;
+ },
+
+ get autoIncrement()
+ {
+ return this._autoIncrement;
+ },
+
+ get parentDatabase()
+ {
+ return this._parentDatabase;
+ },
+
+ get indexes()
+ {
+ return this._indexes;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.IndexedDatabaseObjectStore.NameCookieKey] = this._name;
+ cookie[WebInspector.IndexedDatabaseObjectStore.KeyPathCookieKey] = this._keyPath;
+ },
+
+ // Protected
+
+ establishRelationship: function(parentDatabase)
+ {
+ this._parentDatabase = parentDatabase || null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsIndexedDatabaseObjectStoreIndexjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStoreIndex.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndex.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStoreIndex.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/IndexedDatabaseObjectStoreIndex.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreIndex = function(name, keyPath, unique, multiEntry)
+{
+ WebInspector.Object.call(this);
+
+ this._name = name;
+ this._keyPath = keyPath;
+ this._unique = unique || false;
+ this._multiEntry = multiEntry || false;
+ this._parentObjectStore = null;
+};
+
+WebInspector.IndexedDatabaseObjectStoreIndex.TypeIdentifier = "indexed-database-object-store-index";
+WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey = "indexed-database-object-store-index-name";
+WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey = "indexed-database-object-store-index-key-path";
+
+WebInspector.IndexedDatabaseObjectStoreIndex.prototype = {
+ constructor: WebInspector.IndexedDatabaseObjectStoreIndex,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get keyPath()
+ {
+ return this._keyPath;
+ },
+
+ get unique()
+ {
+ return this._unique;
+ },
+
+ get multiEntry()
+ {
+ return this._multiEntry;
+ },
+
+ get parentObjectStore()
+ {
+ return this._parentObjectStore;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.IndexedDatabaseObjectStoreIndex.NameCookieKey] = this._name;
+ cookie[WebInspector.IndexedDatabaseObjectStoreIndex.KeyPathCookieKey] = this._keyPath;
+ },
+
+ // Protected
+
+ establishRelationship: function(parentObjectStore)
+ {
+ this._parentObjectStore = parentObjectStore || null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsIssueMessagejsfromrev164541trunkSourceWebInspectorUIUserInterfaceIssueMessagejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IssueMessage.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,242 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IssueMessage = function(source, level, text, url, lineNumber, parameters)
+{
+ WebInspector.Object.call(this);
+
+ this._level = level;
+ this._text = text;
+
+ // FIXME <http://webkit.org/b/76404>: Remove the string equality checks for undefined
+ // once we don't get that value anymore from WebCore.
+
+ // FIXME: If the URL is undefined, get the URL from the stacktrace.
+ if (url && url !== "undefined")
+ this._url = url;
+
+ if (typeof lineNumber === "number" && lineNumber >= 0)
+ this._lineNumber = lineNumber;
+
+ if (parameters && parameters !== "undefined") {
+ this._parameters = [];
+ for (var i = 0; i < parameters.length; ++i) {
+ if (parameters[i] instanceof WebInspector.RemoteObject) {
+ this._parameters.push(parameters[i]);
+ continue;
+ }
+
+ if (typeof parameters[i] === "object")
+ this._parameters.push(WebInspector.RemoteObject.fromPayload(parameters[i]));
+ else
+ this._parameters.push(WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]));
+ }
+ }
+
+ this._formatTextIfNecessary();
+
+ switch (source) {
+ case "javascript":
+ // FIXME: It would be nice if we had this information (the specific type of JavaScript error)
+ // as part of the data passed from WebCore, instead of having to determine it ourselves.
+ var prefixRegex = /^([^:]+): (?:DOM Exception \d+: )?/;
+ var match = prefixRegex.exec(this._text);
+ if (match && match[1] in WebInspector.IssueMessage.Type._prefixTypeMap) {
+ this._type = WebInspector.IssueMessage.Type._prefixTypeMap[match[1]];
+ this._text = this._text.substring(match[0].length);
+ } else
+ this._type = WebInspector.IssueMessage.Type.OtherIssue;
+ break;
+
+ case "html":
+ case "css":
+ case "wml":
+ case "xml":
+ this._type = WebInspector.IssueMessage.Type.PageIssue;
+ break;
+
+ case "network":
+ this._type = WebInspector.IssueMessage.Type.NetworkIssue;
+ break;
+
+ case "console-api":
+ case "other":
+ this._type = WebInspector.IssueMessage.Type.OtherIssue;
+ break;
+
+ default:
+ console.error("Unknown issue source:", source);
+ this._type = WebInspector.IssueMessage.Type.OtherIssue;
+ }
+}
+
+WebInspector.IssueMessage.Level = {
+ Error: "error",
+ Warning: "warning"
+};
+
+WebInspector.IssueMessage.Type = {
+ SemanticIssue: "issue-message-type-semantic-issue",
+ RangeIssue: "issue-message-type-range-issue",
+ ReferenceIssue: "issue-message-type-reference-issue",
+ TypeIssue: "issue-message-type-type-issue",
+ PageIssue: "issue-message-type-page-issue",
+ NetworkIssue: "issue-message-type-network-issue",
+ SecurityIssue: "issue-message-type-security-issue",
+ OtherIssue: "issue-message-type-other-issue"
+};
+
+WebInspector.IssueMessage.Type._prefixTypeMap = {
+ "SyntaxError": WebInspector.IssueMessage.Type.SemanticIssue,
+ "URIError": WebInspector.IssueMessage.Type.SemanticIssue,
+ "EvalError": WebInspector.IssueMessage.Type.SemanticIssue,
+ "INVALID_CHARACTER_ERR": WebInspector.IssueMessage.Type.SemanticIssue,
+ "SYNTAX_ERR": WebInspector.IssueMessage.Type.SemanticIssue,
+
+ "RangeError": WebInspector.IssueMessage.Type.RangeIssue,
+ "INDEX_SIZE_ERR": WebInspector.IssueMessage.Type.RangeIssue,
+ "DOMSTRING_SIZE_ERR": WebInspector.IssueMessage.Type.RangeIssue,
+
+ "ReferenceError": WebInspector.IssueMessage.Type.ReferenceIssue,
+ "HIERARCHY_REQUEST_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
+ "INVALID_STATE_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
+ "NOT_FOUND_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
+ "WRONG_DOCUMENT_ERR": WebInspector.IssueMessage.Type.ReferenceIssue,
+
+ "TypeError": WebInspector.IssueMessage.Type.TypeIssue,
+ "INVALID_NODE_TYPE_ERR": WebInspector.IssueMessage.Type.TypeIssue,
+ "TYPE_MISMATCH_ERR": WebInspector.IssueMessage.Type.TypeIssue,
+
+ "SECURITY_ERR": WebInspector.IssueMessage.Type.SecurityIssue,
+
+ "NETWORK_ERR": WebInspector.IssueMessage.Type.NetworkIssue,
+
+ "ABORT_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "DATA_CLONE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "INUSE_ATTRIBUTE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "INVALID_ACCESS_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "INVALID_MODIFICATION_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "NAMESPACE_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "NOT_SUPPORTED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "NO_DATA_ALLOWED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "NO_MODIFICATION_ALLOWED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "QUOTA_EXCEEDED_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "TIMEOUT_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "URL_MISMATCH_ERR": WebInspector.IssueMessage.Type.OtherIssue,
+ "VALIDATION_ERR": WebInspector.IssueMessage.Type.OtherIssue
+};
+
+WebInspector.IssueMessage.Type.displayName = function(type)
+{
+ switch(type) {
+ case WebInspector.IssueMessage.Type.SemanticIssue:
+ return WebInspector.UIString("Semantic Issue");
+ case WebInspector.IssueMessage.Type.RangeIssue:
+ return WebInspector.UIString("Range Issue");
+ case WebInspector.IssueMessage.Type.ReferenceIssue:
+ return WebInspector.UIString("Reference Issue");
+ case WebInspector.IssueMessage.Type.TypeIssue:
+ return WebInspector.UIString("Type Issue");
+ case WebInspector.IssueMessage.Type.PageIssue:
+ return WebInspector.UIString("Page Issue");
+ case WebInspector.IssueMessage.Type.NetworkIssue:
+ return WebInspector.UIString("Network Issue");
+ case WebInspector.IssueMessage.Type.SecurityIssue:
+ return WebInspector.UIString("Security Issue");
+ case WebInspector.IssueMessage.Type.OtherIssue:
+ return WebInspector.UIString("Other Issue");
+ default:
+ console.error("Unknown issue message type:", type);
+ return WebInspector.UIString("Other Issue");
+ }
+};
+
+WebInspector.IssueMessage.prototype = {
+ constructor: WebInspector.IssueMessage,
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get level()
+ {
+ return this._level;
+ },
+
+ get text()
+ {
+ return this._text;
+ },
+
+ get url()
+ {
+ return this._url;
+ },
+
+ get lineNumber()
+ {
+ return this._lineNumber;
+ },
+
+ // Private
+
+ _formatTextIfNecessary: function()
+ {
+ if (!this._parameters)
+ return;
+
+ if (WebInspector.RemoteObject.type(this._parameters[0]) !== "string")
+ return;
+
+ function valueFormatter(obj)
+ {
+ return obj.description;
+ }
+
+ var formatters = {};
+ formatters.o = valueFormatter;
+ formatters.s = valueFormatter;
+ formatters.f = valueFormatter;
+ formatters.i = valueFormatter;
+ formatters.d = valueFormatter;
+
+ function append(a, b)
+ {
+ a += b;
+ return a;
+ }
+
+ var result = String.format(this._parameters[0].description, this._parameters.slice(1), formatters, "", append);
+ var resultText = result.formattedResult;
+
+ for (var i = 0; i < result.unusedSubstitutions.length; ++i)
+ resultText += " " + result.unusedSubstitutions[i].description;
+
+ this._text = resultText;
+ }
+};
+
+WebInspector.IssueMessage.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsKeyboardShortcutjsfromrev164541trunkSourceWebInspectorUIUserInterfaceKeyboardShortcutjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/KeyboardShortcut.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,254 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.KeyboardShortcut = function(modifiers, key, callback, targetElement)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(key);
+ console.assert(!callback || typeof callback === "function");
+ console.assert(!targetElement || targetElement instanceof Element);
+
+ if (typeof key === "string") {
+ key = key[0].toUpperCase();
+ key = new WebInspector.Key(key.charCodeAt(0), key);
+ }
+
+ if (callback && !targetElement)
+ targetElement = document;
+
+ this._modifiers = modifiers || WebInspector.KeyboardShortcut.Modifier.None;
+ this._key = key;
+ this._targetElement = targetElement;
+ this._callback = callback;
+ this._disabled = false;
+ this._implicitlyPreventsDefault = true;
+
+ if (targetElement) {
+ var targetKeyboardShortcuts = targetElement._keyboardShortcuts;
+ if (!targetKeyboardShortcuts)
+ targetKeyboardShortcuts = targetElement._keyboardShortcuts = [];
+
+ targetKeyboardShortcuts.push(this);
+
+ if (!WebInspector.KeyboardShortcut._registeredKeyDownListener) {
+ WebInspector.KeyboardShortcut._registeredKeyDownListener = true;
+ window.addEventListener("keydown", WebInspector.KeyboardShortcut._handleKeyDown);
+ }
+ }
+};
+
+WebInspector.KeyboardShortcut._handleKeyDown = function(event)
+{
+ if (event.defaultPrevented)
+ return;
+
+ for (var targetElement = event.target; targetElement; targetElement = targetElement.parentNode) {
+ if (!targetElement._keyboardShortcuts)
+ continue;
+
+ for (var i = 0; i < targetElement._keyboardShortcuts.length; ++i) {
+ var keyboardShortcut = targetElement._keyboardShortcuts[i];
+ if (!keyboardShortcut.matchesEvent(event))
+ continue;
+
+ keyboardShortcut.callback(event, keyboardShortcut);
+
+ if (keyboardShortcut.implicitlyPreventsDefault)
+ event.preventDefault();
+
+ return;
+ }
+ }
+};
+
+WebInspector.KeyboardShortcut.Modifier = {
+ None: 0,
+ Shift: 1,
+ Control: 2,
+ Option: 4,
+ Command: 8,
+
+ get CommandOrControl()
+ {
+ return InspectorFrontendHost.platform() === "mac" ? this.Command : this.Control;
+ }
+};
+
+WebInspector.Key = function(keyCode, displayName)
+{
+ this._keyCode = keyCode;
+ this._displayName = displayName;
+};
+
+WebInspector.Key.prototype = {
+ get keyCode()
+ {
+ return this._keyCode;
+ },
+
+ get displayName()
+ {
+ return this._displayName;
+ },
+
+ toString: function()
+ {
+ return this._displayName;
+ }
+};
+
+WebInspector.KeyboardShortcut.Key = {
+ Backspace: new WebInspector.Key(8, "\u232b"),
+ Tab: new WebInspector.Key(9, "\u21e5"),
+ Enter: new WebInspector.Key(13, "\u21a9"),
+ Escape: new WebInspector.Key(27, "\u238b"),
+ Space: new WebInspector.Key(32, "Space"),
+ PageUp: new WebInspector.Key(33, "\u21de"),
+ PageDown: new WebInspector.Key(34, "\u21df"),
+ End: new WebInspector.Key(35, "\u2198"),
+ Home: new WebInspector.Key(36, "\u2196"),
+ Left: new WebInspector.Key(37, "\u2190"),
+ Up: new WebInspector.Key(38, "\u2191"),
+ Right: new WebInspector.Key(39, "\u2192"),
+ Down: new WebInspector.Key(40, "\u2193"),
+ Delete: new WebInspector.Key(46, "\u2326"),
+ Zero: new WebInspector.Key(48, "0"),
+ F1: new WebInspector.Key(112, "F1"),
+ F2: new WebInspector.Key(113, "F2"),
+ F3: new WebInspector.Key(114, "F3"),
+ F4: new WebInspector.Key(115, "F4"),
+ F5: new WebInspector.Key(116, "F5"),
+ F6: new WebInspector.Key(117, "F6"),
+ F7: new WebInspector.Key(118, "F7"),
+ F8: new WebInspector.Key(119, "F8"),
+ F9: new WebInspector.Key(120, "F9"),
+ F10: new WebInspector.Key(121, "F10"),
+ F11: new WebInspector.Key(122, "F11"),
+ F12: new WebInspector.Key(123, "F12"),
+ Semicolon: new WebInspector.Key(186, ";"),
+ Plus: new WebInspector.Key(187, "+"),
+ Comma: new WebInspector.Key(188, ","),
+ Minus: new WebInspector.Key(189, "-"),
+ Period: new WebInspector.Key(190, "."),
+ Slash: new WebInspector.Key(191, "/"),
+ Apostrophe: new WebInspector.Key(192, "`"),
+ SingleQuote: new WebInspector.Key(222, "\'")
+};
+
+WebInspector.KeyboardShortcut.prototype = {
+ constructor: WebInspector.KeyboardShortcut,
+
+ // Public
+
+ get modifiers()
+ {
+ return this._modifiers;
+ },
+
+ get key()
+ {
+ return this._key;
+ },
+
+ get displayName()
+ {
+ var result = "";
+
+ if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Control)
+ result += "\u2303";
+ if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Option)
+ result += InspectorFrontendHost.platform() === "mac" ? "\u2325" : "\u2387";
+ if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Shift)
+ result += "\u21e7";
+ if (this._modifiers & WebInspector.KeyboardShortcut.Modifier.Command)
+ result += "\u2318";
+
+ result += this._key.toString();
+
+ return result;
+ },
+
+ get callback()
+ {
+ return this._callback;
+ },
+
+ get disabled()
+ {
+ return this._disabled;
+ },
+
+ set disabled(disabled)
+ {
+ this._disabled = disabled || false;
+ },
+
+ get implicitlyPreventsDefault()
+ {
+ return this._implicitlyPreventsDefault;
+ },
+
+ set implicitlyPreventsDefault(implicitly)
+ {
+ this._implicitlyPreventsDefault = implicitly;
+ },
+
+ unbind: function()
+ {
+ this._disabled = true;
+
+ if (!this._targetElement)
+ return;
+
+ var targetKeyboardShortcuts = this._targetElement._keyboardShortcuts;
+ if (!targetKeyboardShortcuts)
+ return;
+
+ targetKeyboardShortcuts.remove(this);
+ },
+
+ matchesEvent: function(event)
+ {
+ if (this._disabled)
+ return false;
+
+ if (this._key.keyCode !== event.keyCode)
+ return false;
+
+ var eventModifiers = WebInspector.KeyboardShortcut.Modifier.None;
+ if (event.shiftKey)
+ eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Shift;
+ if (event.ctrlKey)
+ eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Control;
+ if (event.altKey)
+ eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Option;
+ if (event.metaKey)
+ eventModifiers |= WebInspector.KeyboardShortcut.Modifier.Command;
+ return this._modifiers === eventModifiers;
+ }
+};
+
+WebInspector.KeyboardShortcut.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsLayoutTimelineRecordjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineRecordjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineRecord.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineRecord = function(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad)
+{
+ WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Layout, startTime, endTime, callFrames, sourceCodeLocation);
+
+ console.assert(eventType);
+
+ if (eventType in WebInspector.LayoutTimelineRecord.EventType)
+ eventType = WebInspector.LayoutTimelineRecord.EventType[eventType];
+
+ this._eventType = eventType;
+ this._x = typeof x === "number" ? x : NaN;
+ this._y = typeof y === "number" ? y : NaN;
+ this._width = typeof width === "number" ? width : NaN;
+ this._height = typeof height === "number" ? height : NaN;
+ this._quad = quad instanceof WebInspector.Quad ? quad : null;
+};
+
+WebInspector.LayoutTimelineRecord.EventType = {
+ InvalidateStyles: "layout-timeline-record-invalidate-styles",
+ RecalculateStyles: "layout-timeline-record-recalculate-styles",
+ InvalidateLayout: "layout-timeline-record-invalidate-layout",
+ Layout: "layout-timeline-record-layout",
+ Paint: "layout-timeline-record-paint"
+};
+
+WebInspector.LayoutTimelineRecord.EventType.displayName = function(eventType)
+{
+ switch(eventType) {
+ case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
+ return WebInspector.UIString("Styles Invalidated");
+ case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
+ return WebInspector.UIString("Styles Recalculated");
+ case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
+ return WebInspector.UIString("Layout Invalidated");
+ case WebInspector.LayoutTimelineRecord.EventType.Layout:
+ return WebInspector.UIString("Layout");
+ case WebInspector.LayoutTimelineRecord.EventType.Paint:
+ return WebInspector.UIString("Paint");
+ }
+};
+
+WebInspector.LayoutTimelineRecord.TypeIdentifier = "layout-timeline-record";
+WebInspector.LayoutTimelineRecord.EventTypeCookieKey = "layout-timeline-record-event-type";
+
+WebInspector.LayoutTimelineRecord.prototype = {
+ constructor: WebInspector.LayoutTimelineRecord,
+
+ // Public
+
+ get eventType()
+ {
+ return this._eventType;
+ },
+
+ 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 rect()
+ {
+ if (!isNaN(this._x) && !isNaN(this._y))
+ return new WebInspector.Rect(this._x, this._y, this._width, this._height);
+ return null;
+ },
+
+ get quad()
+ {
+ return this._quad;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ WebInspector.TimelineRecord.prototype.saveIdentityToCookie.call(this, cookie);
+
+ cookie[WebInspector.LayoutTimelineRecord.EventTypeCookieKey] = this._eventType;
+ }
+};
+
+WebInspector.LayoutTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsLogObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLogObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/LogObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/LogObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/LogObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogObject = function()
+{
+ WebInspector.Object.call(this);
+
+ this._startDate = new Date();
+};
+
+WebInspector.LogObject.prototype = {
+ constructor: WebInspector.LogObject,
+
+ // Public
+
+ get startDate()
+ {
+ return this._startDate;
+ }
+};
+
+WebInspector.LogObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsNetworkTimelinejsfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkTimelinejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/NetworkTimeline.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkTimeline.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/NetworkTimeline.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NetworkTimeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimeline = function()
+{
+ WebInspector.Timeline.call(this);
+};
+
+WebInspector.NetworkTimeline.prototype = {
+ constructor: WebInspector.NetworkTimeline,
+ __proto__: WebInspector.Timeline.prototype,
+
+ // Public
+
+ recordForResource: function(resource)
+ {
+ console.assert(resource instanceof WebInspector.Resource);
+
+ return this._resourceRecordMap.get(resource) || null;
+ },
+
+ reset: function(suppressEvents)
+ {
+ this._resourceRecordMap = new Map;
+
+ WebInspector.Timeline.prototype.reset.call(this, suppressEvents);
+ },
+
+ addRecord: function(record)
+ {
+ console.assert(record instanceof WebInspector.ResourceTimelineRecord);
+
+ // Don't allow duplicate records for a resource.
+ if (this._resourceRecordMap.has(record.resource))
+ return;
+
+ this._resourceRecordMap.set(record.resource, record);
+
+ WebInspector.Timeline.prototype.addRecord.call(this, record);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProbejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Probe.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Probe.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Probe.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Probe.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeSample = function(sampleId, batchId, timestamp, payload)
+{
+ this.sampleId = sampleId;
+ this.batchId = batchId;
+ this.timestamp = timestamp;
+ this.object = WebInspector.RemoteObject.fromPayload(payload);
+};
+
+WebInspector.Probe = function(id, breakpoint, expression)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(id);
+ console.assert(breakpoint instanceof WebInspector.Breakpoint);
+
+ this._id = id;
+ this._breakpoint = breakpoint;
+ this._expression = expression;
+ this._samples = [];
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Probe);
+
+WebInspector.Probe.Event = {
+ ExpressionChanged: "probe-object-expression-changed",
+ SampleAdded: "probe-object-sample-added",
+ SamplesCleared: "probe-object-samples-cleared"
+};
+
+WebInspector.Probe.prototype = {
+ constructor: WebInspector.Probe,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get breakpoint()
+ {
+ return this._breakpoint;
+ },
+
+ get expression()
+ {
+ return this._expression;
+ },
+
+ set expression(value)
+ {
+ if (this._expression === value)
+ return;
+
+ var data = {oldValue: this._expression, newValue: value};
+ this._expression = value;
+ this.clearSamples();
+ this.dispatchEventToListeners(WebInspector.Probe.Event.ExpressionChanged, data);
+ },
+
+ get samples()
+ {
+ return this._samples.slice();
+ },
+
+ clearSamples: function()
+ {
+ this._samples = [];
+ this.dispatchEventToListeners(WebInspector.Probe.Event.SamplesCleared);
+ },
+
+ addSample: function(sample)
+ {
+ console.assert(sample instanceof WebInspector.ProbeSample, "Wrong object type passed as probe sample: ", sample);
+ this._samples.push(sample);
+ this.dispatchEventToListeners(WebInspector.Probe.Event.SampleAdded, sample);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProbeSetjsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSet.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.
+ */
+
+// A ProbeSet clusters Probes from the same Breakpoint and their samples.
+
+WebInspector.ProbeSet = function(breakpoint)
+{
+ console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown breakpoint argument: ", breakpoint);
+
+ WebInspector.Object.call(this);
+ this._breakpoint = breakpoint;
+ this._probes = [];
+ this._probesByIdentifier = new Map;
+
+ this._createDataTable();
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
+ WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this);
+}
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ProbeSet);
+
+WebInspector.ProbeSet.Event = {
+ ProbeAdded: "probe-set-probe-added",
+ ProbeRemoved: "probe-set-probe-removed",
+ ResolvedStateDidChange: "probe-set-resolved-state-did-change",
+ SamplesCleared: "probe-set-samples-cleared",
+};
+
+WebInspector.ProbeSet.SampleObjectTitle = "Object";
+
+WebInspector.ProbeSet.prototype = {
+ constructor: WebInspector.ProbeSet,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get breakpoint()
+ {
+ return this._breakpoint;
+ },
+
+ get probes()
+ {
+ return this._probes.slice();
+ },
+
+ get dataTable()
+ {
+ return this._dataTable;
+ },
+
+ clear: function()
+ {
+ this._breakpoint.clearActions(WebInspector.BreakpointAction.Type.Probe);
+ },
+
+ clearSamples: function()
+ {
+ for (var probe of this._probes)
+ probe.clearSamples();
+
+ var oldTable = this._dataTable;
+ this._createDataTable();
+ this.dispatchEventToListeners(WebInspector.ProbeSet.Event.SamplesCleared, {oldTable: oldTable});
+ },
+
+ createProbe: function(expression)
+ {
+ this.breakpoint.createAction(WebInspector.BreakpointAction.Type.Probe, null, expression);
+ },
+
+ addProbe: function(probe)
+ {
+ console.assert(probe instanceof WebInspector.Probe, "Tried to add non-probe ", probe, " to probe group", this);
+ console.assert(probe.breakpoint === this.breakpoint, "Probe and ProbeSet must have same breakpoint.", probe, this);
+
+ this._probes.push(probe);
+ this._probesByIdentifier.set(probe.id, probe);
+
+ this.dataTable.addProbe(probe);
+ this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ProbeAdded, probe);
+ },
+
+ removeProbe: function(probe)
+ {
+ console.assert(probe instanceof WebInspector.Probe, "Tried to remove non-probe ", probe, " to probe group", this);
+ console.assert(this._probes.indexOf(probe) != -1, "Tried to remove probe", probe, " not in group ", this);
+ console.assert(this._probesByIdentifier.has(probe.id), "Tried to remove probe", probe, " not in group ", this);
+
+ this._probes.splice(this._probes.indexOf(probe), 1);
+ this._probesByIdentifier.delete(probe.id);
+ this.dataTable.removeProbe(probe);
+ this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ProbeRemoved, probe);
+ },
+
+ willRemove: function()
+ {
+ console.assert(!this._probes.length, "ProbeSet.willRemove called, but probes still associated with group: ", this._probes);
+
+ WebInspector.Frame.removeEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
+ WebInspector.Probe.removeEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this);
+ WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this);
+ },
+
+ // Private
+
+ _mainResourceChanged: function()
+ {
+ this.dataTable.mainResourceChanged();
+ },
+
+ _createDataTable: function()
+ {
+ if (this.dataTable)
+ this.dataTable.willRemove();
+
+ this._dataTable = new WebInspector.ProbeSetDataTable(this);
+ },
+
+ _sampleCollected: function(event)
+ {
+ var sample = event.data;
+ console.assert(sample instanceof WebInspector.ProbeSample, "Tried to add non-sample to probe group: ", sample);
+
+ var probe = event.target;
+ if (!this._probesByIdentifier.has(probe.id))
+ return;
+
+ console.assert(this.dataTable);
+ this.dataTable.addSampleForProbe(probe, sample);
+ },
+
+ _breakpointResolvedStateDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ResolvedStateDidChange);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProbeSetDataFramejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDataFramejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataFrame.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataFrame = function(index)
+{
+ this._count = 0;
+ this._index = index;
+ this._separator = false;
+};
+
+WebInspector.ProbeSetDataFrame.compare = function(a, b) {
+ console.assert(a instanceof WebInspector.ProbeSetDataFrame, a);
+ console.assert(b instanceof WebInspector.ProbeSetDataFrame, b);
+
+ return a.index - b.index;
+}
+
+WebInspector.ProbeSetDataFrame.MissingValue = "?";
+
+WebInspector.ProbeSetDataFrame.prototype = {
+ constructor: WebInspector.ProbeSetDataFrame,
+
+ // Public
+
+ get key()
+ {
+ return String(this._index);
+ },
+
+ get count()
+ {
+ return this._count;
+ },
+
+ get index()
+ {
+ return this._index;
+ },
+
+ get isSeparator()
+ {
+ return this._separator;
+ },
+
+ // The last data frame before a main frame navigation is marked as a "separator" frame.
+ set isSeparator(value)
+ {
+ this._separator = !!value;
+ },
+
+ addSampleForProbe: function(probe, sample)
+ {
+ this[probe.id] = sample;
+ this._count++;
+ },
+
+ missingKeys: function(probeSet)
+ {
+ return probeSet.probes.filter(function(probe) {
+ return !this.hasOwnProperty(probe.id);
+ }, this);
+ },
+
+ isComplete: function(probeSet)
+ {
+ return !this.missingKeys(probeSet).length;
+ },
+
+ fillMissingValues: function(probeSet)
+ {
+ for (var key of this.missingKeys(probeSet))
+ this[key] = WebInspector.ProbeSetDataFrame.MissingValue;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProbeSetDataTablejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDataTablejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataTable.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataTable = function(probeSet)
+{
+ WebInspector.Object.call(this);
+
+ this._probeSet = probeSet;
+ this._frames = [];
+ this._previousBatchIdentifier = WebInspector.ProbeSetDataTable.SentinelValue;
+};
+
+WebInspector.ProbeSetDataTable.Event = {
+ FrameInserted: "probe-set-data-table-frame-inserted",
+ SeparatorInserted: "probe-set-data-table-separator-inserted",
+ WillRemove: "probe-set-data-table-will-remove"
+};
+
+WebInspector.ProbeSetDataTable.SentinelValue = -1;
+WebInspector.ProbeSetDataTable.UnknownValue = "?";
+
+WebInspector.ProbeSetDataTable.prototype = {
+ constructor: WebInspector.ProbeSetDataTable,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get frames()
+ {
+ return this._frames.slice();
+ },
+
+ get separators()
+ {
+ return this._frames.filter(function(frame) { return frame.isSeparator; });
+ },
+
+ willRemove: function()
+ {
+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.WillRemove);
+ this._frames = [];
+ delete this._probeSet;
+ },
+
+ mainResourceChanged: function()
+ {
+ this.addSeparator();
+ },
+
+ addSampleForProbe: function(probe, sample)
+ {
+ // Eagerly save the frame if the batch identifier differs, or we know the frame is full.
+ // Create a new frame when the batch identifier differs.
+ if (sample.batchId != this._previousBatchIdentifier) {
+ if (this._openFrame) {
+ this._openFrame.fillMissingValues(this._probeSet);
+ this.addFrame(this._openFrame);
+ }
+ this._openFrame = this.createFrame();
+ this._previousBatchIdentifier = sample.batchId;
+ }
+
+ console.assert(this._openFrame, "Should always have an open frame before adding sample.", this, probe, sample);
+ this._openFrame.addSampleForProbe(probe, sample);
+ if (this._openFrame.count == this._probeSet.probes.length) {
+ this.addFrame(this._openFrame);
+ this._openFrame = null;
+ }
+ },
+
+ addProbe: function(probe)
+ {
+ for (var frame of this.frames)
+ if (!frame[probe.id])
+ frame[probe.id] = WebInspector.ProbeSetDataTable.UnknownValue;
+ },
+
+ removeProbe: function(probe)
+ {
+ for (var frame of this.frames)
+ delete frame[probe.id];
+ },
+
+ // Protected - can be overridden by subclasses.
+
+ createFrame: function()
+ {
+ return new WebInspector.ProbeSetDataFrame(this._frames.length);
+ },
+
+ addFrame: function(frame)
+ {
+ this._frames.push(frame);
+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.FrameInserted, frame);
+ },
+
+ addSeparator: function()
+ {
+ // Separators must be associated with a frame.
+ if (!this._frames.length)
+ return;
+
+ var previousFrame = this._frames.lastValue;
+ // Don't send out duplicate events for adjacent separators.
+ if (previousFrame.isSeparator)
+ return;
+
+ previousFrame.isSeparator = true;
+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.SeparatorInserted, previousFrame);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProfilejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProfilejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Profile.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Profile.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Profile.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Profile.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Profile = function(topDownRootNodes, idleTime)
+{
+ WebInspector.Object.call(this);
+
+ topDownRootNodes = topDownRootNodes || [];
+
+ console.assert(topDownRootNodes instanceof Array);
+ console.assert(topDownRootNodes.reduce(function(previousValue, node) { return previousValue && node instanceof WebInspector.ProfileNode; }, true));
+
+ this._topDownRootNodes = topDownRootNodes;
+ this._idleTime = idleTime || 0;
+};
+
+WebInspector.Profile.prototype = {
+ constructor: WebInspector.Profile,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get idleTime()
+ {
+ return this._idleTime;
+ },
+
+ get topDownRootNodes()
+ {
+ return this._topDownRootNodes;
+ },
+
+ get bottomUpRootNodes()
+ {
+ // FIXME: Implement.
+ return [];
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProfileNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProfileNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProfileNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,220 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNode = function(id, type, functionName, sourceCodeLocation, calls, childNodes)
+{
+ WebInspector.Object.call(this);
+
+ childNodes = childNodes || [];
+
+ console.assert(id);
+ console.assert(calls instanceof Array);
+ console.assert(calls.length >= 1);
+ console.assert(calls.reduce(function(previousValue, call) { return previousValue && call instanceof WebInspector.ProfileNodeCall; }, true));
+ console.assert(childNodes instanceof Array);
+ console.assert(childNodes.reduce(function(previousValue, node) { return previousValue && node instanceof WebInspector.ProfileNode; }, true));
+
+ this._id = id;
+ this._type = type || WebInspector.ProfileNode.Type.Function;
+ this._functionName = functionName || null;
+ this._sourceCodeLocation = sourceCodeLocation || null;
+ this._calls = calls;
+ this._childNodes = childNodes;
+ this._parentNode = null;
+ this._previousSibling = null;
+ this._nextSibling = null;
+
+ for (var i = 0; i < this._childNodes.length; ++i)
+ this._childNodes[i].establishRelationships(this, this._childNodes[i - 1], this._childNodes[i + 1]);
+
+ for (var i = 0; i < this._calls.length; ++i)
+ this._calls[i].establishRelationships(this, this._calls[i - 1], this._calls[i + 1]);
+
+ var info = this.computeCallInfoForTimeRange(0, Infinity);
+ this._startTime = info.startTime;
+ this._endTime = info.endTime;
+ this._selfTime = info.selfTime;
+ this._totalTime = info.totalTime;
+};
+
+WebInspector.ProfileNode.Type = {
+ Function: "profile-node-type-function",
+ Program: "profile-node-type-program"
+};
+
+WebInspector.ProfileNode.TypeIdentifier = "profile-node";
+WebInspector.ProfileNode.TypeCookieKey = "profile-node-type";
+WebInspector.ProfileNode.FunctionNameCookieKey = "profile-node-function-name";
+WebInspector.ProfileNode.SourceCodeURLCookieKey = "profile-node-source-code-url";
+WebInspector.ProfileNode.SourceCodeLocationLineCookieKey = "profile-node-source-code-location-line";
+WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey = "profile-node-source-code-location-column";
+
+WebInspector.ProfileNode.prototype = {
+ constructor: WebInspector.ProfileNode,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get functionName()
+ {
+ return this._functionName;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ get selfTime()
+ {
+ return this._selfTime;
+ },
+
+ get totalTime()
+ {
+ return this._totalTime;
+ },
+
+ get calls()
+ {
+ return this._calls;
+ },
+
+ get previousSibling()
+ {
+ return this._previousSibling;
+ },
+
+ get nextSibling()
+ {
+ return this._nextSibling;
+ },
+
+ get parentNode()
+ {
+ return this._parentNode;
+ },
+
+ get childNodes()
+ {
+ return this._childNodes;
+ },
+
+ computeCallInfoForTimeRange: function(rangeStartTime, rangeEndTime)
+ {
+ console.assert(typeof rangeStartTime === "number");
+ console.assert(typeof rangeEndTime === "number");
+
+ var recordCallCount = true;
+ var callCount = 0;
+
+ function totalTimeInRange(previousValue, call)
+ {
+ if (rangeStartTime > call.endTime || rangeEndTime < call.startTime)
+ return previousValue;
+
+ if (recordCallCount)
+ ++callCount;
+
+ return previousValue + Math.min(call.endTime, rangeEndTime) - Math.max(rangeStartTime, call.startTime);
+ }
+
+ var startTime = Math.max(rangeStartTime, this._calls[0].startTime);
+ var endTime = Math.min(this._calls.lastValue.endTime, rangeEndTime);
+ var totalTime = this._calls.reduce(totalTimeInRange, 0);
+
+ recordCallCount = false;
+
+ var childNodesTotalTime = 0;
+ for (var childNode of this._childNodes)
+ childNodesTotalTime += childNode.calls.reduce(totalTimeInRange, 0);
+
+ var selfTime = totalTime - childNodesTotalTime;
+ var averageTime = selfTime / callCount;
+
+ return {startTime: startTime, endTime: endTime, totalTime: totalTime, selfTime: selfTime, callCount: callCount, averageTime: averageTime};
+ },
+
+ traverseNextProfileNode: function(stayWithin)
+ {
+ var profileNode = this._childNodes[0];
+ if (profileNode)
+ return profileNode;
+
+ if (this === stayWithin)
+ return null;
+
+ profileNode = this._nextSibling;
+ if (profileNode)
+ return profileNode;
+
+ profileNode = this;
+ while (profileNode && !profileNode.nextSibling && profileNode.parentNode !== stayWithin)
+ profileNode = profileNode.parentNode;
+
+ if (!profileNode)
+ return null;
+
+ return profileNode.nextSibling;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.ProfileNode.TypeCookieKey] = this._type || null;
+ cookie[WebInspector.ProfileNode.FunctionNameCookieKey] = this._functionName || null;
+ cookie[WebInspector.ProfileNode.SourceCodeURLCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url ? this._sourceCodeLocation.sourceCode.url.hash : null : null;
+ cookie[WebInspector.ProfileNode.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
+ cookie[WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
+ },
+
+ // Protected
+
+ establishRelationships: function(parentNode, previousSibling, nextSibling)
+ {
+ this._parentNode = parentNode || null;
+ this._previousSibling = previousSibling || null;
+ this._nextSibling = nextSibling || null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProfileNodeCalljsfromrev164541trunkSourceWebInspectorUIUserInterfaceProfileNodeCalljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNodeCall.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProfileNodeCall.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNodeCall.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProfileNodeCall.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeCall = function(startTime, totalTime)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(startTime);
+
+ this._startTime = startTime;
+ this._totalTime = totalTime || 0;
+ this._parentNode = null;
+ this._previousSibling = null;
+ this._nextSibling = null;
+};
+
+WebInspector.ProfileNodeCall.prototype = {
+ constructor: WebInspector.ProfileNodeCall,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ get totalTime()
+ {
+ return this._totalTime;
+ },
+
+ get endTime()
+ {
+ return this._startTime + this._totalTime;
+ },
+
+ // Protected
+
+ establishRelationships: function(parentNode, previousSibling, nextSibling)
+ {
+ this._parentNode = parentNode || null;
+ this._previousSibling = previousSibling || null;
+ this._nextSibling = nextSibling || null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsResourcejsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourcejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Resource.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,707 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Resource = function(url, mimeType, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, requestSentTimestamp, initiatorSourceCodeLocation)
+{
+ WebInspector.SourceCode.call(this);
+
+ console.assert(url);
+
+ if (type in WebInspector.Resource.Type)
+ type = WebInspector.Resource.Type[type];
+
+ this._url = url;
+ this._mimeType = mimeType;
+ this._type = type || WebInspector.Resource.Type.fromMIMEType(mimeType);
+ this._loaderIdentifier = loaderIdentifier || null;
+ this._requestIdentifier = requestIdentifier || null;
+ this._requestMethod = requestMethod || null;
+ this._requestData = requestData || null;
+ this._requestHeaders = requestHeaders || {};
+ this._responseHeaders = {};
+ this._parentFrame = null;
+ this._initiatorSourceCodeLocation = initiatorSourceCodeLocation || null;
+ this._requestSentTimestamp = requestSentTimestamp || NaN;
+ this._responseReceivedTimestamp = NaN;
+ this._lastRedirectReceivedTimestamp = NaN;
+ this._lastDataReceivedTimestamp = NaN;
+ this._finishedOrFailedTimestamp = NaN;
+ this._size = NaN;
+ this._transferSize = NaN;
+ this._cached = false;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Resource);
+
+WebInspector.Resource.TypeIdentifier = "resource";
+WebInspector.Resource.URLCookieKey = "resource-url";
+WebInspector.Resource.MainResourceCookieKey = "resource-is-main-resource";
+
+WebInspector.Resource.Event = {
+ URLDidChange: "resource-url-did-change",
+ MIMETypeDidChange: "resource-mime-type-did-change",
+ TypeDidChange: "resource-type-did-change",
+ RequestHeadersDidChange: "resource-request-headers-did-change",
+ ResponseReceived: "resource-response-received",
+ LoadingDidFinish: "resource-loading-did-finish",
+ LoadingDidFail: "resource-loading-did-fail",
+ TimestampsDidChange: "resource-timestamps-did-change",
+ SizeDidChange: "resource-size-did-change",
+ TransferSizeDidChange: "resource-transfer-size-did-change",
+ CacheStatusDidChange: "resource-cached-did-change"
+};
+
+// Keep these in sync with the "ResourceType" enum defined by the "Page" domain.
+WebInspector.Resource.Type = {
+ Document: "resource-type-document",
+ Stylesheet: "resource-type-stylesheet",
+ Image: "resource-type-image",
+ Font: "resource-type-font",
+ Script: "resource-type-script",
+ XHR: "resource-type-xhr",
+ WebSocket: "resource-type-websocket",
+ Other: "resource-type-other"
+};
+
+// This MIME Type map is private, use WebInspector.Resource.Type.fromMIMEType().
+WebInspector.Resource.Type._mimeTypeMap = {
+ "text/html": WebInspector.Resource.Type.Document,
+ "text/xml": WebInspector.Resource.Type.Document,
+ "text/plain": WebInspector.Resource.Type.Document,
+ "application/xhtml+xml": WebInspector.Resource.Type.Document,
+ "image/svg+xml": WebInspector.Resource.Type.Document,
+
+ "text/css": WebInspector.Resource.Type.Stylesheet,
+ "text/xsl": WebInspector.Resource.Type.Stylesheet,
+ "text/x-less": WebInspector.Resource.Type.Stylesheet,
+ "text/x-sass": WebInspector.Resource.Type.Stylesheet,
+ "text/x-scss": WebInspector.Resource.Type.Stylesheet,
+
+ "application/pdf": WebInspector.Resource.Type.Image,
+
+ "application/x-font-type1": WebInspector.Resource.Type.Font,
+ "application/x-font-ttf": WebInspector.Resource.Type.Font,
+ "application/x-font-woff": WebInspector.Resource.Type.Font,
+ "application/x-truetype-font": WebInspector.Resource.Type.Font,
+
+ "text/javascript": WebInspector.Resource.Type.Script,
+ "text/ecmascript": WebInspector.Resource.Type.Script,
+ "application/javascript": WebInspector.Resource.Type.Script,
+ "application/ecmascript": WebInspector.Resource.Type.Script,
+ "application/x-javascript": WebInspector.Resource.Type.Script,
+ "application/json": WebInspector.Resource.Type.Script,
+ "application/x-json": WebInspector.Resource.Type.Script,
+ "text/x-javascript": WebInspector.Resource.Type.Script,
+ "text/x-json": WebInspector.Resource.Type.Script,
+ "text/javascript1.1": WebInspector.Resource.Type.Script,
+ "text/javascript1.2": WebInspector.Resource.Type.Script,
+ "text/javascript1.3": WebInspector.Resource.Type.Script,
+ "text/jscript": WebInspector.Resource.Type.Script,
+ "text/livescript": WebInspector.Resource.Type.Script,
+ "text/x-livescript": WebInspector.Resource.Type.Script,
+ "text/typescript": WebInspector.Resource.Type.Script,
+ "text/x-clojure": WebInspector.Resource.Type.Script,
+ "text/x-coffeescript": WebInspector.Resource.Type.Script
+};
+
+WebInspector.Resource.Type.fromMIMEType = function(mimeType)
+{
+ if (!mimeType)
+ return WebInspector.Resource.Type.Other;
+
+ mimeType = parseMIMEType(mimeType).type;
+
+ if (mimeType in WebInspector.Resource.Type._mimeTypeMap)
+ return WebInspector.Resource.Type._mimeTypeMap[mimeType];
+
+ if (mimeType.startsWith("image/"))
+ return WebInspector.Resource.Type.Image;
+
+ if (mimeType.startsWith("font/"))
+ return WebInspector.Resource.Type.Font;
+
+ return WebInspector.Resource.Type.Other;
+};
+
+WebInspector.Resource.Type.displayName = function(type, plural)
+{
+ switch(type) {
+ case WebInspector.Resource.Type.Document:
+ if (plural)
+ return WebInspector.UIString("Documents");
+ return WebInspector.UIString("Document");
+ case WebInspector.Resource.Type.Stylesheet:
+ if (plural)
+ return WebInspector.UIString("Stylesheets");
+ return WebInspector.UIString("Stylesheet");
+ case WebInspector.Resource.Type.Image:
+ if (plural)
+ return WebInspector.UIString("Images");
+ return WebInspector.UIString("Image");
+ case WebInspector.Resource.Type.Font:
+ if (plural)
+ return WebInspector.UIString("Fonts");
+ return WebInspector.UIString("Font");
+ case WebInspector.Resource.Type.Script:
+ if (plural)
+ return WebInspector.UIString("Scripts");
+ return WebInspector.UIString("Script");
+ case WebInspector.Resource.Type.XHR:
+ if (plural)
+ return WebInspector.UIString("XHRs");
+ return WebInspector.UIString("XHR");
+ case WebInspector.Resource.Type.WebSocket:
+ if (plural)
+ return WebInspector.UIString("Sockets");
+ return WebInspector.UIString("Socket");
+ case WebInspector.Resource.Type.Other:
+ return WebInspector.UIString("Other");
+ default:
+ console.error("Unknown resource type: ", type);
+ return null;
+ }
+};
+
+WebInspector.Resource.prototype = {
+ constructor: WebInspector.Resource,
+
+ // Public
+
+ get url()
+ {
+ return this._url;
+ },
+
+ get urlComponents()
+ {
+ if (!this._urlComponents)
+ this._urlComponents = parseURL(this._url);
+ return this._urlComponents;
+ },
+
+ get displayName()
+ {
+ return WebInspector.displayNameForURL(this._url, this.urlComponents);
+ },
+
+ get initiatorSourceCodeLocation()
+ {
+ return this._initiatorSourceCodeLocation;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get mimeType()
+ {
+ return this._mimeType;
+ },
+
+ get mimeTypeComponents()
+ {
+ if (!this._mimeTypeComponents)
+ this._mimeTypeComponents = parseMIMEType(this._mimeType);
+ return this._mimeTypeComponents;
+ },
+
+ get syntheticMIMEType()
+ {
+ // Resources are often transferred with a MIME-type that doesn't match the purpose the
+ // resource was loaded for, which is what WebInspector.Resource.Type represents.
+ // This getter generates a MIME-type, if needed, that matches the resource type.
+
+ // If the type matches the Resource.Type of the MIME-type, then return the actual MIME-type.
+ if (this._type === WebInspector.Resource.Type.fromMIMEType(this._mimeType))
+ return this._mimeType;
+
+ // Return the default MIME-types for the Resource.Type, since the current MIME-type
+ // does not match what is expected for the Resource.Type.
+ switch (this._type) {
+ case WebInspector.Resource.Type.Document:
+ return "text/html";
+ case WebInspector.Resource.Type.Stylesheet:
+ return "text/css";
+ case WebInspector.Resource.Type.Script:
+ return "text/javascript";
+ }
+
+ // Return the actual MIME-type since we don't have a better synthesized one to return.
+ return this._mimeType;
+ },
+
+ get contentURL()
+ {
+ const maximumDataURLSize = 1024 * 1024; // 1 MiB
+
+ // If content is not available or won't fit a data URL, fallback to using original URL.
+ var content = this.content;
+ if (content === null || content.length > maximumDataURLSize)
+ return this._url;
+
+ return "data:" + this.mimeTypeComponents.type + (this.contentIsBase64Encoded ? ";base64," + content : "," + encodeURIComponent(content));
+ },
+
+ isMainResource: function()
+ {
+ return this._parentFrame ? this._parentFrame.mainResource === this : false;
+ },
+
+ get parentFrame()
+ {
+ return this._parentFrame;
+ },
+
+ get loaderIdentifier()
+ {
+ return this._loaderIdentifier;
+ },
+
+ get requestIdentifier()
+ {
+ return this._requestIdentifier;
+ },
+
+ get finished()
+ {
+ return this._finished;
+ },
+
+ get failed()
+ {
+ return this._failed;
+ },
+
+ get canceled()
+ {
+ return this._canceled;
+ },
+
+ get requestMethod()
+ {
+ return this._requestMethod;
+ },
+
+ get requestData()
+ {
+ return this._requestData;
+ },
+
+ get requestDataContentType()
+ {
+ return this._requestHeaders.valueForCaseInsensitiveKey("Content-Type") || null;
+ },
+
+ get requestHeaders()
+ {
+ return this._requestHeaders;
+ },
+
+ get responseHeaders()
+ {
+ return this._responseHeaders;
+ },
+
+ get requestSentTimestamp()
+ {
+ return this._requestSentTimestamp;
+ },
+
+ get lastRedirectReceivedTimestamp()
+ {
+ return this._lastRedirectReceivedTimestamp;
+ },
+
+ get responseReceivedTimestamp()
+ {
+ return this._responseReceivedTimestamp;
+ },
+
+ get lastDataReceivedTimestamp()
+ {
+ return this._lastDataReceivedTimestamp;
+ },
+
+ get finishedOrFailedTimestamp()
+ {
+ return this._finishedOrFailedTimestamp;
+ },
+
+ get firstTimestamp()
+ {
+ return this.requestSentTimestamp || this.lastRedirectReceivedTimestamp || this.responseReceivedTimestamp || this.lastDataReceivedTimestamp || this.finishedOrFailedTimestamp;
+ },
+
+ get lastTimestamp()
+ {
+ return this.finishedOrFailedTimestamp || this.lastDataReceivedTimestamp || this.responseReceivedTimestamp || this.lastRedirectReceivedTimestamp || this.requestSentTimestamp;
+ },
+
+ get duration()
+ {
+ return this._finishedOrFailedTimestamp - this._requestSentTimestamp;
+ },
+
+ get latency()
+ {
+ return this._responseReceivedTimestamp - this._requestSentTimestamp;
+ },
+
+ get receiveDuration()
+ {
+ return this._finishedOrFailedTimestamp - this._responseReceivedTimestamp;
+ },
+
+ get cached()
+ {
+ return this._cached;
+ },
+
+ get statusCode()
+ {
+ return this._statusCode;
+ },
+
+ get statusText()
+ {
+ return this._statusText;
+ },
+
+ get size()
+ {
+ return this._size;
+ },
+
+ get encodedSize()
+ {
+ if (!isNaN(this._transferSize))
+ return this._transferSize;
+
+ // If we did not receive actual transfer size from network
+ // stack, we prefer using Content-Length over resourceSize as
+ // resourceSize may differ from actual transfer size if platform's
+ // network stack performed decoding (e.g. gzip decompression).
+ // The Content-Length, though, is expected to come from raw
+ // response headers and will reflect actual transfer length.
+ // This won't work for chunked content encoding, so fall back to
+ // resourceSize when we don't have Content-Length. This still won't
+ // work for chunks with non-trivial encodings. We need a way to
+ // get actual transfer size from the network stack.
+
+ return Number(this._responseHeaders.valueForCaseInsensitiveKey("Content-Length") || this._size);
+ },
+
+ get transferSize()
+ {
+ if (this.statusCode === 304) // Not modified
+ return this._responseHeadersSize;
+
+ if (this._cached)
+ return 0;
+
+ return this._responseHeadersSize + this.encodedSize;
+ },
+
+ get compressed()
+ {
+ var contentEncoding = this._responseHeaders.valueForCaseInsensitiveKey("Content-Encoding");
+ return contentEncoding && /\b(?:gzip|deflate)\b/.test(contentEncoding);
+ },
+
+ get scripts()
+ {
+ return this._scripts || [];
+ },
+
+ scriptForLocation: function(sourceCodeLocation)
+ {
+ console.assert(!(this instanceof WebInspector.SourceMapResource));
+ console.assert(sourceCodeLocation.sourceCode === this, "SourceCodeLocation must be in this Resource");
+ if (sourceCodeLocation.sourceCode !== this)
+ return null;
+
+ var lineNumber = sourceCodeLocation.lineNumber;
+ var columnNumber = sourceCodeLocation.columnNumber;
+ for (var i = 0; i < this._scripts.length; ++i) {
+ var script = this._scripts[i];
+ if (script.range.startLine <= lineNumber && script.range.endLine >= lineNumber) {
+ if (script.range.startLine === lineNumber && columnNumber < script.range.startColumn)
+ continue;
+ if (script.range.endLine === lineNumber && columnNumber > script.range.endColumn)
+ continue;
+ return script;
+ }
+ }
+
+ return null;
+ },
+
+ updateForRedirectResponse: function(url, requestHeaders, timestamp)
+ {
+ console.assert(!this._finished);
+ console.assert(!this._failed);
+ console.assert(!this._canceled);
+
+ var oldURL = this._url;
+
+ this._url = url;
+ this._requestHeaders = requestHeaders || {};
+ this._lastRedirectReceivedTimestamp = timestamp || NaN;
+
+ if (oldURL !== url) {
+ // Delete the URL components so the URL is re-parsed the next time it is requested.
+ delete this._urlComponents;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange, {oldURL: oldURL});
+ }
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.RequestHeadersDidChange);
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
+ },
+
+ updateForResponse: function(url, mimeType, type, responseHeaders, statusCode, statusText, timestamp)
+ {
+ console.assert(!this._finished);
+ console.assert(!this._failed);
+ console.assert(!this._canceled);
+
+ var oldURL = this._url;
+ var oldMIMEType = this._mimeType;
+ var oldType = this._type;
+
+ if (type in WebInspector.Resource.Type)
+ type = WebInspector.Resource.Type[type];
+
+ this._url = url;
+ this._mimeType = mimeType;
+ this._type = type || WebInspector.Resource.Type.fromMIMEType(mimeType);
+ this._statusCode = statusCode;
+ this._statusText = statusText;
+ this._responseHeaders = responseHeaders || {};
+ this._responseReceivedTimestamp = timestamp || NaN;
+
+ this._responseHeadersSize = String(this._statusCode).length + this._statusText.length + 12; // Extra length is for "HTTP/1.1 ", " ", and "\r\n".
+ for (var name in this._responseHeaders)
+ this._responseHeadersSize += name.length + this._responseHeaders[name].length + 4; // Extra length is for ": ", and "\r\n".
+
+ if (statusCode === 304 && !this._cached)
+ this.markAsCached();
+
+ if (oldURL !== url) {
+ // Delete the URL components so the URL is re-parsed the next time it is requested.
+ delete this._urlComponents;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange, {oldURL: oldURL});
+ }
+
+ if (oldMIMEType !== mimeType) {
+ // Delete the MIME-type components so the MIME-type is re-parsed the next time it is requested.
+ delete this._mimeTypeComponents;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.MIMETypeDidChange, {oldMIMEType: oldMIMEType});
+ }
+
+ if (oldType !== type)
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
+
+ console.assert(isNaN(this._size));
+ console.assert(isNaN(this._transferSize));
+
+ // The transferSize becomes 0 when status is 304 or Content-Length is available, so
+ // notify listeners of that change.
+ if (statusCode === 304 || this._responseHeaders.valueForCaseInsensitiveKey("Content-Length"))
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.ResponseReceived);
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
+ },
+
+ canRequestContentFromBackend: function()
+ {
+ return this._finished;
+ },
+
+ requestContentFromBackend: function(callback)
+ {
+ // If we have the requestIdentifier we can get the actual response for this specific resource.
+ // Otherwise the content will be cached resource data, which might not exist anymore.
+ if (this._requestIdentifier) {
+ NetworkAgent.getResponseBody(this._requestIdentifier, callback);
+ return true;
+ }
+
+ if (this._parentFrame) {
+ PageAgent.getResourceContent(this._parentFrame.id, this._url, callback);
+ return true;
+ }
+
+ // There is no request identifier or frame to request content from. Return false to cause the
+ // pending callbacks to get null content.
+ return false;
+ },
+
+ increaseSize: function(dataLength, timestamp)
+ {
+ console.assert(dataLength >= 0);
+
+ if (isNaN(this._size))
+ this._size = 0;
+
+ var previousSize = this._size;
+
+ this._size += dataLength;
+
+ this._lastDataReceivedTimestamp = timestamp || NaN;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.SizeDidChange, {previousSize: previousSize});
+
+ // The transferSize is based off of size when status is not 304 or Content-Length is missing.
+ if (isNaN(this._transferSize) && this._statusCode !== 304 && !this._responseHeaders.valueForCaseInsensitiveKey("Content-Length"))
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
+ },
+
+ increaseTransferSize: function(encodedDataLength)
+ {
+ console.assert(encodedDataLength >= 0);
+
+ if (isNaN(this._transferSize))
+ this._transferSize = 0;
+ this._transferSize += encodedDataLength;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
+ },
+
+ markAsCached: function()
+ {
+ this._cached = true;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.CacheStatusDidChange);
+
+ // The transferSize is starts returning 0 when cached is true, unless status is 304.
+ if (this._statusCode !== 304)
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
+ },
+
+ markAsFinished: function(timestamp)
+ {
+ console.assert(!this._failed);
+ console.assert(!this._canceled);
+
+ this._finished = true;
+ this._finishedOrFailedTimestamp = timestamp || NaN;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFinish);
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
+
+ if (this.canRequestContentFromBackend())
+ this.requestContentFromBackendIfNeeded();
+ },
+
+ markAsFailed: function(canceled, timestamp)
+ {
+ console.assert(!this._finished);
+
+ this._failed = true;
+ this._canceled = canceled;
+ this._finishedOrFailedTimestamp = timestamp || NaN;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFail);
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
+
+ // Force the content requests to be serviced. They will get null as the content.
+ this.servicePendingContentRequests(true);
+ },
+
+ revertMarkAsFinished: function(timestamp)
+ {
+ console.assert(!this._failed);
+ console.assert(!this._canceled);
+ console.assert(this._finished);
+
+ this._finished = false;
+ this._finishedOrFailedTimestamp = NaN;
+ },
+
+ getImageSize: function(callback)
+ {
+ // Throw an error in the case this resource is not an image.
+ if (this.type !== WebInspector.Resource.Type.Image)
+ throw "Resource is not an image.";
+
+ // See if we've already computed and cached the image size,
+ // in which case we can provide them directly.
+ if (this._imageSize) {
+ callback(this._imageSize);
+ return;
+ }
+
+ // Event handler for the image "load" event.
+ function imageDidLoad()
+ {
+ // Cache the image metrics.
+ this._imageSize = {
+ width: image.width,
+ height: image.height
+ };
+
+ callback(this._imageSize);
+ };
+
+ // Create an <img> element that we'll use to load the image resource
+ // so that we can query its intrinsic size.
+ var image = new Image;
+ image.addEventListener("load", imageDidLoad.bind(this), false);
+
+ // Set the image source once we've obtained the base64-encoded URL for it.
+ this.requestContent(function() {
+ image.src = this.contentURL;
+ }.bind(this));
+ },
+
+ associateWithScript: function(script)
+ {
+ if (!this._scripts)
+ this._scripts = []
+
+ this._scripts.push(script);
+
+ // COMPATIBILITY (iOS 6): Resources did not know their type until a response
+ // was received. We can set the Resource type to be Script here.
+ if (this._type === WebInspector.Resource.Type.Other) {
+ var oldType = this._type;
+ this._type = WebInspector.Resource.Type.Script;
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
+ }
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.Resource.URLCookieKey] = this.url;
+ cookie[WebInspector.Resource.MainResourceCookieKey] = this.isMainResource();
+ }
+};
+
+WebInspector.Resource.prototype.__proto__ = WebInspector.SourceCode.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsResourceCollectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceCollectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceCollection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,164 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceCollection = function()
+{
+ WebInspector.Object.call(this);
+
+ this._resources = [];
+ this._resourceURLMap = {};
+ this._resourcesTypeMap = {};
+};
+
+WebInspector.ResourceCollection.prototype = {
+ constructor: WebInspector.ResourceCollection,
+
+ // Public
+
+ get resources()
+ {
+ return this._resources;
+ },
+
+ resourceForURL: function(url)
+ {
+ return this._resourceURLMap[url] || null;
+ },
+
+ resourcesWithType: function(type)
+ {
+ return this._resourcesTypeMap[type] || [];
+ },
+
+ addResource: function(resource)
+ {
+ console.assert(resource instanceof WebInspector.Resource);
+ if (!(resource instanceof WebInspector.Resource))
+ return;
+
+ this._associateWithResource(resource);
+ },
+
+ removeResource: function(resourceOrURL)
+ {
+ console.assert(resourceOrURL);
+
+ if (resourceOrURL instanceof WebInspector.Resource)
+ var url = resourceOrURL.url;
+ else
+ var url = resourceOrURL;
+
+ // Fetch the resource by URL even if we were passed a WebInspector.Resource.
+ // We do this incase the WebInspector.Resource is a new object that isn't in _resources,
+ // but the URL is a valid resource.
+ var resource = this.resourceForURL(url);
+ console.assert(resource instanceof WebInspector.Resource);
+ if (!(resource instanceof WebInspector.Resource))
+ return null;
+
+ this._disassociateWithResource(resource);
+
+ return resource;
+ },
+
+ removeAllResources: function()
+ {
+ if (!this._resources.length)
+ return;
+
+ for (var i = 0; i < this._resources.length; ++i)
+ this._disassociateWithResource(this._resources[i], true);
+
+ this._resources = [];
+ this._resourceURLMap = {};
+ this._resourcesTypeMap = {};
+ },
+
+ // Private
+
+ _associateWithResource: function(resource)
+ {
+ this._resources.push(resource);
+ this._resourceURLMap[resource.url] = resource;
+
+ if (!this._resourcesTypeMap[resource.type])
+ this._resourcesTypeMap[resource.type] = [];
+ this._resourcesTypeMap[resource.type].push(resource);
+
+ resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._resourceURLDidChange, this);
+ resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
+ },
+
+ _disassociateWithResource: function(resource, skipRemoval)
+ {
+ if (skipRemoval) {
+ this._resources.remove(resource);
+ if (this._resourcesTypeMap[resource.type])
+ this._resourcesTypeMap[resource.type].remove(resource);
+ delete this._resourceURLMap[resource.url];
+ }
+
+ resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._resourceURLDidChange, this);
+ resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
+ },
+
+ _resourceURLDidChange: function(event)
+ {
+ var resource = event.target;
+ console.assert(resource instanceof WebInspector.Resource);
+ if (!(resource instanceof WebInspector.Resource))
+ return;
+
+ var oldURL = event.data.oldURL;
+ console.assert(oldURL);
+ if (!oldURL)
+ return;
+
+ this._resourceURLMap[resource.url] = resource;
+ delete this._resourceURLMap[oldURL];
+ },
+
+ _resourceTypeDidChange: function(event)
+ {
+ var resource = event.target;
+ console.assert(resource instanceof WebInspector.Resource);
+ if (!(resource instanceof WebInspector.Resource))
+ return;
+
+ var oldType = event.data.oldType;
+ console.assert(oldType);
+ if (!oldType)
+ return;
+
+ if (!this._resourcesTypeMap[resource.type])
+ this._resourcesTypeMap[resource.type] = [];
+ this._resourcesTypeMap[resource.type].push(resource);
+
+ if (this._resourcesTypeMap[oldType])
+ this._resourcesTypeMap[oldType].remove(resource);
+ }
+};
+
+WebInspector.ResourceCollection.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsResourceSearchMatchObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceSearchMatchObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ResourceSearchMatchObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceSearchMatchObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ResourceSearchMatchObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ResourceSearchMatchObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceSearchMatchObject = function(resource, lineText, searchTerm, textRange)
+{
+ console.assert(resource instanceof WebInspector.Resource);
+
+ WebInspector.Object.call(this);
+
+ this._resource = resource;
+ this._lineText = lineText;
+ this._searchTerm = searchTerm;
+ this._sourceCodeTextRange = resource.createSourceCodeTextRange(textRange);
+};
+
+WebInspector.ResourceSearchMatchObject.ResourceMatchIconStyleClassName = "resource-match-icon";
+
+WebInspector.ResourceSearchMatchObject.prototype = {
+ constructor: WebInspector.ResourceSearchMatchObject,
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ get title()
+ {
+ return this._lineText;
+ },
+
+ get className()
+ {
+ return WebInspector.ResourceSearchMatchObject.ResourceMatchIconStyleClassName;
+ },
+
+ get searchTerm()
+ {
+ return this._searchTerm;
+ },
+
+ get sourceCodeTextRange()
+ {
+ return this._sourceCodeTextRange;
+ }
+};
+
+WebInspector.ResourceSearchMatchObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsResourceTimelineRecordjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceTimelineRecordjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineRecord.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineRecord = function(resource)
+{
+ WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Network);
+
+ this._resource = resource;
+ this._resource.addEventListener(WebInspector.Resource.Event.TimestampsDidChange, this._dispatchUpdatedEvent, this);
+};
+
+WebInspector.ResourceTimelineRecord.prototype = {
+ constructor: WebInspector.ResourceTimelineRecord,
+
+ // Public
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ get updatesDynamically()
+ {
+ return true;
+ },
+
+ get usesActiveStartTime()
+ {
+ return true;
+ },
+
+ get startTime()
+ {
+ return this._resource.requestSentTimestamp;
+ },
+
+ get activeStartTime()
+ {
+ return this._resource.responseReceivedTimestamp;
+ },
+
+ get endTime()
+ {
+ return this._resource.finishedOrFailedTimestamp;
+ },
+
+ // Private
+
+ _dispatchUpdatedEvent: function()
+ {
+ this.dispatchEventToListeners(WebInspector.TimelineRecord.Event.Updated);
+ }
+};
+
+WebInspector.ResourceTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsRevisionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceRevisionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Revision.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Revision.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Revision.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Revision.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Revision = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.Revision.prototype = {
+ constructor: WebInspector.Revision,
+
+ // Public
+
+ apply: function()
+ {
+ // Implemented by subclasses.
+ console.error("Needs to be implemented by a subclass.");
+ },
+
+ revert: function()
+ {
+ // Implemented by subclasses.
+ console.error("Needs to be implemented by a subclass.");
+ },
+
+ copy: function()
+ {
+ // Override by subclasses.
+ return this;
+ }
+};
+
+WebInspector.Revision.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScopeChainNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeChainNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeChainNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeChainNode = function(type, object)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(typeof type === "string");
+ console.assert(object instanceof WebInspector.RemoteObject);
+
+ if (type in WebInspector.ScopeChainNode.Type)
+ type = WebInspector.ScopeChainNode.Type[type];
+
+ this._type = type || null;
+ this._object = object || null;
+};
+
+WebInspector.ScopeChainNode.Type = {
+ Local: "scope-chain-type-local",
+ Global: "scope-chain-type-global",
+ With: "scope-chain-type-with",
+ Closure: "scope-chain-type-closure",
+ Catch: "scope-chain-type-catch"
+};
+
+WebInspector.ScopeChainNode.prototype = {
+ constructor: WebInspector.ScopeChainNode,
+
+ // Public
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get object()
+ {
+ return this._object;
+ }
+};
+
+WebInspector.ScopeChainNode.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Script.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Script.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Script.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Script.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,180 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Script = function(id, range, url, injected, sourceMapURL)
+{
+ WebInspector.SourceCode.call(this);
+
+ console.assert(id);
+ console.assert(range instanceof WebInspector.TextRange);
+
+ this._id = id || null;
+ this._range = range || null;
+ this._url = url || null;
+ this._injected = injected || false;
+
+ this._resource = this._resolveResource();
+ if (this._resource)
+ this._resource.associateWithScript(this);
+
+ if (sourceMapURL)
+ WebInspector.sourceMapManager.downloadSourceMap(sourceMapURL, this._url, this);
+};
+
+WebInspector.Script.TypeIdentifier = "script";
+WebInspector.Script.URLCookieKey = "script-url";
+WebInspector.Script.DisplayNameCookieKey = "script-display-name";
+
+WebInspector.Script.resetUniqueDisplayNameNumbers = function()
+{
+ WebInspector.Script._nextUniqueDisplayNameNumber = 1;
+}
+
+WebInspector.Script._nextUniqueDisplayNameNumber = 1;
+
+WebInspector.Script.prototype = {
+ constructor: WebInspector.Script,
+
+ // Public
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get range()
+ {
+ return this._range;
+ },
+
+ get url()
+ {
+ return this._url;
+ },
+
+ get urlComponents()
+ {
+ if (!this._urlComponents)
+ this._urlComponents = parseURL(this._url);
+ return this._urlComponents;
+ },
+
+ get displayName()
+ {
+ if (this._url)
+ return WebInspector.displayNameForURL(this._url, this.urlComponents);
+
+ // Assign a unique number to the script object so it will stay the same.
+ if (!this._uniqueDisplayNameNumber)
+ this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
+
+ return WebInspector.UIString("Anonymous Script %d").format(this._uniqueDisplayNameNumber);
+ },
+
+ get injected()
+ {
+ return this._injected;
+ },
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ canRequestContentFromBackend: function()
+ {
+ // We can request content if we have an id.
+ return !!this._id;
+ },
+
+ requestContentFromBackend: function(callback)
+ {
+ if (!this._id) {
+ // There is no identifier to request content with. Return false to cause the
+ // pending callbacks to get null content.
+ return false;
+ }
+
+ DebuggerAgent.getScriptSource(this._id, callback);
+ return true;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.Script.URLCookieKey] = this.url;
+ cookie[WebInspector.Script.DisplayNameCookieKey] = this.displayName;
+ },
+
+ // Private
+
+ _resolveResource: function()
+ {
+ // FIXME: We should be able to associate a Script with a Resource through identifiers,
+ // we shouldn't need to lookup by URL, which is not safe with frames, where there might
+ // be multiple resources with the same URL.
+ // <rdar://problem/13373951> Scripts should be able to associate directly with a Resource
+
+ // No URL, no resource.
+ if (!this._url)
+ return null;
+
+ try {
+ // Try with the Script's full URL.
+ var resource = WebInspector.frameResourceManager.resourceForURL(this.url);
+ if (resource)
+ return resource;
+
+ // Try with the Script's full decoded URL.
+ var decodedURL = decodeURI(this._url);
+ if (decodedURL !== this._url) {
+ resource = WebInspector.frameResourceManager.resourceForURL(decodedURL);
+ if (resource)
+ return resource;
+ }
+
+ // Next try removing any fragment in the original URL.
+ var urlWithoutFragment = removeURLFragment(this._url);
+ if (urlWithoutFragment !== this._url) {
+ resource = WebInspector.frameResourceManager.resourceForURL(urlWithoutFragment);
+ if (resource)
+ return resource;
+ }
+
+ // Finally try removing any fragment in the decoded URL.
+ var decodedURLWithoutFragment = removeURLFragment(decodedURL);
+ if (decodedURLWithoutFragment !== decodedURL) {
+ resource = WebInspector.frameResourceManager.resourceForURL(decodedURLWithoutFragment);
+ if (resource)
+ return resource;
+ }
+ } catch (e) {
+ // Ignore possible URIErrors.
+ }
+
+ return null;
+ }
+};
+
+WebInspector.Script.prototype.__proto__ = WebInspector.SourceCode.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScriptTimelineRecordjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineRecordjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineRecord.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,270 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineRecord = function(eventType, startTime, endTime, callFrames, sourceCodeLocation, details, profile)
+{
+ WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Script, startTime, endTime, callFrames, sourceCodeLocation);
+
+ console.assert(eventType);
+
+ if (eventType in WebInspector.ScriptTimelineRecord.EventType)
+ eventType = WebInspector.ScriptTimelineRecord.EventType[eventType];
+
+ this._eventType = eventType;
+ this._details = details || "";
+ this._profile = profile || null;
+};
+
+WebInspector.ScriptTimelineRecord.EventType = {
+ ScriptEvaluated: "script-timeline-record-script-evaluated",
+ EventDispatched: "script-timeline-record-event-dispatch",
+ TimerFired: "script-timeline-record-timer-fired",
+ TimerInstalled: "script-timeline-record-timer-installed",
+ TimerRemoved: "script-timeline-record-timer-removed",
+ AnimationFrameFired: "script-timeline-record-animation-frame-fired",
+ AnimationFrameRequested: "script-timeline-record-animation-frame-requested",
+ AnimationFrameCanceled: "script-timeline-record-animation-frame-canceled"
+};
+
+WebInspector.ScriptTimelineRecord.EventType.displayName = function(eventType, details, includeTimerIdentifierInMainTitle)
+{
+ if (details && !WebInspector.ScriptTimelineRecord._eventDisplayNames) {
+ // These display names are not localized because they closely represent
+ // the real API name, just with word spaces and Title Case.
+
+ var nameMap = new Map;
+ nameMap.set("DOMActivate", "DOM Activate");
+ nameMap.set("DOMCharacterDataModified", "DOM Character Data Modified");
+ nameMap.set("DOMContentLoaded", "DOM Content Loaded");
+ nameMap.set("DOMFocusIn", "DOM Focus In");
+ nameMap.set("DOMFocusOut", "DOM Focus Out");
+ nameMap.set("DOMNodeInserted", "DOM Node Inserted");
+ nameMap.set("DOMNodeInsertedIntoDocument", "DOM Node Inserted Into Document");
+ nameMap.set("DOMNodeRemoved", "DOM Node Removed");
+ nameMap.set("DOMNodeRemovedFromDocument", "DOM Node Removed From Document");
+ nameMap.set("DOMSubtreeModified", "DOM Sub-Tree Modified");
+ nameMap.set("addsourcebuffer", "Add Source Buffer");
+ nameMap.set("addstream", "Add Stream");
+ nameMap.set("addtrack", "Add Track");
+ nameMap.set("audioend", "Audio End");
+ nameMap.set("audioprocess", "Audio Process");
+ nameMap.set("audiostart", "Audio Start");
+ nameMap.set("beforecopy", "Before Copy");
+ nameMap.set("beforecut", "Before Cut");
+ nameMap.set("beforeload", "Before Load");
+ nameMap.set("beforepaste", "Before Paste");
+ nameMap.set("beforeunload", "Before Unload");
+ nameMap.set("canplay", "Can Play");
+ nameMap.set("canplaythrough", "Can Play Through");
+ nameMap.set("chargingchange", "Charging Change");
+ nameMap.set("chargingtimechange", "Charging Time Change");
+ nameMap.set("compositionend", "Composition End");
+ nameMap.set("compositionstart", "Composition Start");
+ nameMap.set("compositionupdate", "Composition Update");
+ nameMap.set("contextmenu", "Context Menu");
+ nameMap.set("cuechange", "Cue Change");
+ nameMap.set("datachannel", "Data Channel");
+ nameMap.set("dblclick", "Double Click");
+ nameMap.set("devicemotion", "Device Motion");
+ nameMap.set("deviceorientation", "Device Orientation");
+ nameMap.set("dischargingtimechange", "Discharging Time Change");
+ nameMap.set("dragend", "Drag End");
+ nameMap.set("dragenter", "Drag Enter");
+ nameMap.set("dragleave", "Drag Leave");
+ nameMap.set("dragover", "Drag Over");
+ nameMap.set("dragstart", "Drag Start");
+ nameMap.set("durationchange", "Duration Change");
+ nameMap.set("focusin", "Focus In");
+ nameMap.set("focusout", "Focus Out");
+ nameMap.set("gesturechange", "Gesture Change");
+ nameMap.set("gestureend", "Gesture End");
+ nameMap.set("gesturescrollend", "Gesture Scroll End");
+ nameMap.set("gesturescrollstart", "Gesture Scroll Start");
+ nameMap.set("gesturescrollupdate", "Gesture Scroll Update");
+ nameMap.set("gesturestart", "Gesture Start");
+ nameMap.set("gesturetap", "Gesture Tap");
+ nameMap.set("gesturetapdown", "Gesture Tap Down");
+ nameMap.set("hashchange", "Hash Change");
+ nameMap.set("icecandidate", "ICE Candidate");
+ nameMap.set("iceconnectionstatechange", "ICE Connection State Change");
+ nameMap.set("keydown", "Key Down");
+ nameMap.set("keypress", "Key Press");
+ nameMap.set("keyup", "Key Up");
+ nameMap.set("levelchange", "Level Change");
+ nameMap.set("loadeddata", "Loaded Data");
+ nameMap.set("loadedmetadata", "Loaded Metadata");
+ nameMap.set("loadend", "Load End");
+ nameMap.set("loadingdone", "Loading Done");
+ nameMap.set("loadstart", "Load Start");
+ nameMap.set("mousedown", "Mouse Down");
+ nameMap.set("mouseenter", "Mouse Enter");
+ nameMap.set("mouseleave", "Mouse Leave");
+ nameMap.set("mousemove", "Mouse Move");
+ nameMap.set("mouseout", "Mouse Out");
+ nameMap.set("mouseover", "Mouse Over");
+ nameMap.set("mouseup", "Mouse Up");
+ nameMap.set("mousewheel", "Mouse Wheel");
+ nameMap.set("negotiationneeded", "Negotiation Needed");
+ nameMap.set("nomatch", "No Match");
+ nameMap.set("noupdate", "No Update");
+ nameMap.set("orientationchange", "Orientation Change");
+ nameMap.set("overflowchanged", "Overflow Changed");
+ nameMap.set("pagehide", "Page Hide");
+ nameMap.set("pageshow", "Page Show");
+ nameMap.set("popstate", "Pop State");
+ nameMap.set("ratechange", "Rate Change");
+ nameMap.set("readystatechange", "Ready State Change");
+ nameMap.set("removesourcebuffer", "Remove Source Buffer");
+ nameMap.set("removestream", "Remove Stream");
+ nameMap.set("removetrack", "Remove Track");
+ nameMap.set("securitypolicyviolation", "Security Policy Violation");
+ nameMap.set("selectionchange", "Selection Change");
+ nameMap.set("selectstart", "Select Start");
+ nameMap.set("signalingstatechange", "Signaling State Change");
+ nameMap.set("soundend", "Sound End");
+ nameMap.set("soundstart", "Sound Start");
+ nameMap.set("sourceclose", "Source Close");
+ nameMap.set("sourceended", "Source Ended");
+ nameMap.set("sourceopen", "Source Open");
+ nameMap.set("speechend", "Speech End");
+ nameMap.set("speechstart", "Speech Start");
+ nameMap.set("textInput", "Text Input");
+ nameMap.set("timeupdate", "Time Update");
+ nameMap.set("tonechange", "Tone Change");
+ nameMap.set("touchcancel", "Touch Cancel");
+ nameMap.set("touchend", "Touch End");
+ nameMap.set("touchmove", "Touch Move");
+ nameMap.set("touchstart", "Touch Start");
+ nameMap.set("transitionend", "Transition End");
+ nameMap.set("updateend", "Update End");
+ nameMap.set("updateready", "Update Ready");
+ nameMap.set("updatestart", "Update Start");
+ nameMap.set("upgradeneeded", "Upgrade Needed");
+ nameMap.set("versionchange", "Version Change");
+ nameMap.set("visibilitychange", "Visibility Change");
+ nameMap.set("volumechange", "Volume Change");
+ nameMap.set("webglcontextcreationerror", "WebGL Context Creation Error");
+ nameMap.set("webglcontextlost", "WebGL Context Lost");
+ nameMap.set("webglcontextrestored", "WebGL Context Restored");
+ nameMap.set("webkitAnimationEnd", "Animation End");
+ nameMap.set("webkitAnimationIteration", "Animation Iteration");
+ nameMap.set("webkitAnimationStart", "Animation Start");
+ nameMap.set("webkitBeforeTextInserted", "Before Text Inserted");
+ nameMap.set("webkitEditableContentChanged", "Editable Content Changed");
+ nameMap.set("webkitTransitionEnd", "Transition End");
+ nameMap.set("webkitaddsourcebuffer", "Add Source Buffer");
+ nameMap.set("webkitbeginfullscreen", "Begin Fullscreen");
+ nameMap.set("webkitcurrentplaybacktargetiswirelesschanged", "Current Playback Target Is Wireless Changed");
+ nameMap.set("webkitdeviceproximity", "Device Proximity");
+ nameMap.set("webkitendfullscreen", "End Fullscreen");
+ nameMap.set("webkitfullscreenchange", "Fullscreen Change");
+ nameMap.set("webkitfullscreenerror", "Fullscreen Error");
+ nameMap.set("webkitkeyadded", "Key Added");
+ nameMap.set("webkitkeyerror", "Key Error");
+ nameMap.set("webkitkeymessage", "Key Message");
+ nameMap.set("webkitneedkey", "Need Key");
+ nameMap.set("webkitnetworkinfochange", "Network Info Change");
+ nameMap.set("webkitplaybacktargetavailabilitychanged", "Playback Target Availability Changed");
+ nameMap.set("webkitpointerlockchange", "Pointer Lock Change");
+ nameMap.set("webkitpointerlockerror", "Pointer Lock Error");
+ nameMap.set("webkitregionlayoutupdate", "Region Layout Update");
+ nameMap.set("webkitregionoversetchange", "Region Overset Change");
+ nameMap.set("webkitremovesourcebuffer", "Remove Source Buffer");
+ nameMap.set("webkitresourcetimingbufferfull", "Resource Timing Buffer Full");
+ nameMap.set("webkitsourceclose", "Source Close");
+ nameMap.set("webkitsourceended", "Source Ended");
+ nameMap.set("webkitsourceopen", "Source Open");
+ nameMap.set("webkitspeechchange", "Speech Change");
+ nameMap.set("writeend", "Write End");
+ nameMap.set("writestart", "Write Start");
+
+ WebInspector.ScriptTimelineRecord._eventDisplayNames = nameMap;
+ }
+
+ switch(eventType) {
+ case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
+ return WebInspector.UIString("Script Evaluated");
+ case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
+ if (details && (details instanceof String || typeof details === "string")) {
+ var eventDisplayName = WebInspector.ScriptTimelineRecord._eventDisplayNames.get(details) || details.capitalize();
+ return WebInspector.UIString("%s Event Dispatched").format(eventDisplayName);
+ }
+
+ return WebInspector.UIString("Event Dispatched");
+ case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
+ if (details && includeTimerIdentifierInMainTitle)
+ return WebInspector.UIString("Timer %s Fired").format(details);
+ return WebInspector.UIString("Timer Fired");
+ case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
+ if (details && includeTimerIdentifierInMainTitle)
+ return WebInspector.UIString("Timer %s Installed").format(details);
+ return WebInspector.UIString("Timer Installed");
+ case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
+ if (details && includeTimerIdentifierInMainTitle)
+ return WebInspector.UIString("Timer %s Removed").format(details);
+ return WebInspector.UIString("Timer Removed");
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
+ return WebInspector.UIString("Animation Frame Fired");
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
+ return WebInspector.UIString("Animation Frame Requested");
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
+ return WebInspector.UIString("Animation Frame Canceled");
+ }
+};
+
+WebInspector.ScriptTimelineRecord.TypeIdentifier = "script-timeline-record";
+WebInspector.ScriptTimelineRecord.EventTypeCookieKey = "script-timeline-record-event-type";
+WebInspector.ScriptTimelineRecord.DetailsCookieKey = "script-timeline-record-details";
+
+WebInspector.ScriptTimelineRecord.prototype = {
+ constructor: WebInspector.ScriptTimelineRecord,
+
+ // Public
+
+ get eventType()
+ {
+ return this._eventType;
+ },
+
+ get details()
+ {
+ return this._details;
+ },
+
+ get profile()
+ {
+ return this._profile;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ WebInspector.TimelineRecord.prototype.saveIdentityToCookie.call(this, cookie);
+
+ cookie[WebInspector.ScriptTimelineRecord.EventTypeCookieKey] = this._eventType;
+ cookie[WebInspector.ScriptTimelineRecord.DetailsCookieKey] = this._details;
+ }
+};
+
+WebInspector.ScriptTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSettingjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSettingjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Setting.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Setting.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.Setting = function(name, defaultValue)
+{
+ this._name = name;
+ this._localStorageKey = WebInspector.Setting.LocalStorageKeyPrefix + name;
+ this._defaultValue = defaultValue;
+}
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Setting);
+
+WebInspector.Setting.Event = {
+ Changed: "setting-changed"
+};
+
+WebInspector.Setting.LocalStorageKeyPrefix = "com.apple.WebInspector.";
+
+WebInspector.Setting.prototype = {
+ constructor: WebInspector.Setting,
+
+ // Public
+
+ get name()
+ {
+ return this._name;
+ },
+
+ get value()
+ {
+ if ("_value" in this)
+ return this._value;
+
+ // Make a copy of the default value so changes to object values don't modify the default value.
+ this._value = JSON.parse(JSON.stringify(this._defaultValue));
+
+ if (window.localStorage && this._localStorageKey in window.localStorage) {
+ try {
+ this._value = JSON.parse(window.localStorage[this._localStorageKey]);
+ } catch(e) {
+ delete window.localStorage[this._localStorageKey];
+ }
+ }
+
+ return this._value;
+ },
+
+ set value(value)
+ {
+ this._value = value;
+
+ if (window.localStorage) {
+ try {
+ // Use Object.shallowEqual to properly compare objects.
+ if (Object.shallowEqual(this._value, this._defaultValue))
+ delete window.localStorage[this._localStorageKey];
+ else
+ window.localStorage[this._localStorageKey] = JSON.stringify(this._value);
+ } catch(e) {
+ console.error("Error saving setting with name: " + this._name);
+ }
+ }
+
+ this.dispatchEventToListeners(WebInspector.Setting.Event.Changed, this._value, {name: this._name});
+ }
+}
+
+WebInspector.Setting.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,262 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCode = function()
+{
+ WebInspector.Object.call(this);
+
+ this._pendingContentRequestCallbacks = [];
+
+ this._originalRevision = new WebInspector.SourceCodeRevision(this, null, false);
+ this._currentRevision = this._originalRevision;
+
+ this._sourceMaps = null;
+ this._formatterSourceMap = null;
+};
+
+WebInspector.SourceCode.Event = {
+ ContentDidChange: "source-code-content-did-change",
+ SourceMapAdded: "source-code-source-map-added",
+ FormatterDidChange: "source-code-formatter-did-change"
+};
+
+WebInspector.SourceCode.prototype = {
+ constructor: WebInspector.SourceCode,
+
+ // Public
+
+ get displayName()
+ {
+ // Implemented by subclasses.
+ console.error("Needs to be implemented by a subclass.");
+ return "";
+ },
+
+ get originalRevision()
+ {
+ return this._originalRevision;
+ },
+
+ get currentRevision()
+ {
+ return this._currentRevision;
+ },
+
+ set currentRevision(revision)
+ {
+ console.assert(revision instanceof WebInspector.SourceCodeRevision);
+ if (!(revision instanceof WebInspector.SourceCodeRevision))
+ return;
+
+ console.assert(revision.sourceCode === this);
+ if (revision.sourceCode !== this)
+ return;
+
+ this._currentRevision = revision;
+
+ this.dispatchEventToListeners(WebInspector.SourceCode.Event.ContentDidChange);
+ },
+
+ get content()
+ {
+ return this._currentRevision.content;
+ },
+
+ get contentIsBase64Encoded()
+ {
+ return this._currentRevision.contentIsBase64Encoded;
+ },
+
+ get sourceMaps()
+ {
+ return this._sourceMaps || [];
+ },
+
+ addSourceMap: function(sourceMap)
+ {
+ console.assert(sourceMap instanceof WebInspector.SourceMap);
+
+ if (!this._sourceMaps)
+ this._sourceMaps = [];
+
+ this._sourceMaps.push(sourceMap);
+
+ this.dispatchEventToListeners(WebInspector.SourceCode.Event.SourceMapAdded);
+ },
+
+ get formatterSourceMap()
+ {
+ return this._formatterSourceMap;
+ },
+
+ set formatterSourceMap(formatterSourceMap)
+ {
+ console.assert(this._formatterSourceMap === null || formatterSourceMap === null);
+ console.assert(formatterSourceMap === null || formatterSourceMap instanceof WebInspector.FormatterSourceMap);
+
+ this._formatterSourceMap = formatterSourceMap;
+
+ this.dispatchEventToListeners(WebInspector.SourceCode.Event.FormatterDidChange);
+ },
+
+ requestContent: function(callback)
+ {
+ console.assert(typeof callback === "function");
+ if (typeof callback !== "function")
+ return;
+
+ this._pendingContentRequestCallbacks.push(callback);
+
+ if (this._contentReceived) {
+ // Call _servicePendingContentRequests on a timeout to force callbacks to be asynchronous.
+ if (!this._servicePendingContentRequestsTimeoutIdentifier)
+ this._servicePendingContentRequestsTimeoutIdentifier = setTimeout(this.servicePendingContentRequests.bind(this), 0);
+ } else if (this.canRequestContentFromBackend())
+ this.requestContentFromBackendIfNeeded();
+ },
+
+ createSourceCodeLocation: function(lineNumber, columnNumber)
+ {
+ return new WebInspector.SourceCodeLocation(this, lineNumber, columnNumber);
+ },
+
+ createSourceCodeTextRange: function(textRange)
+ {
+ return new WebInspector.SourceCodeTextRange(this, textRange);
+ },
+
+ // Protected
+
+ revisionContentDidChange: function(revision)
+ {
+ if (this._ignoreRevisionContentDidChangeEvent)
+ return;
+
+ if (revision !== this._currentRevision)
+ return;
+
+ this.handleCurrentRevisionContentChange();
+
+ this.dispatchEventToListeners(WebInspector.SourceCode.Event.ContentDidChange);
+ },
+
+ handleCurrentRevisionContentChange: function()
+ {
+ // Implemented by subclasses if needed.
+ },
+
+ get revisionForRequestedContent()
+ {
+ // Implemented by subclasses if needed.
+ return this._originalRevision;
+ },
+
+ markContentAsStale: function()
+ {
+ this._contentReceived = false;
+ },
+
+ canRequestContentFromBackend: function()
+ {
+ // Implemented by subclasses.
+ console.error("Needs to be implemented by a subclass.");
+ return false;
+ },
+
+ requestContentFromBackend: function(callback)
+ {
+ // Implemented by subclasses.
+ console.error("Needs to be implemented by a subclass.");
+ },
+
+ requestContentFromBackendIfNeeded: function()
+ {
+ console.assert(this.canRequestContentFromBackend());
+ if (!this.canRequestContentFromBackend())
+ return;
+
+ if (!this._pendingContentRequestCallbacks.length)
+ return;
+
+ if (this._contentRequestResponsePending)
+ return;
+
+ this._contentRequestResponsePending = true;
+
+ if (this.requestContentFromBackend(this._processContent.bind(this)))
+ return;
+
+ // Since requestContentFromBackend returned false, just call _processContent,
+ // which will cause the pending callbacks to get null content.
+ this._processContent();
+ },
+
+ servicePendingContentRequests: function(force)
+ {
+ if (this._servicePendingContentRequestsTimeoutIdentifier) {
+ clearTimeout(this._servicePendingContentRequestsTimeoutIdentifier);
+ delete this._servicePendingContentRequestsTimeoutIdentifier;
+ }
+
+ // Force the content requests to be sent. To do this correctly we also force
+ // _contentReceived to be true so future calls to requestContent go through.
+ if (force)
+ this._contentReceived = true;
+
+ console.assert(this._contentReceived);
+ if (!this._contentReceived)
+ return;
+
+ // Move the callbacks into a local and clear _pendingContentRequestCallbacks so
+ // callbacks that might call requestContent again will not modify the array.
+ var callbacks = this._pendingContentRequestCallbacks;
+ this._pendingContentRequestCallbacks = [];
+
+ for (var i = 0; i < callbacks.length; ++i)
+ callbacks[i](this, this.content, this.contentIsBase64Encoded);
+ },
+
+ // Private
+
+ _processContent: function(error, content, base64Encoded)
+ {
+ if (error)
+ console.error(error);
+
+ this._contentRequestResponsePending = false;
+ this._contentReceived = true;
+
+ var revision = this.revisionForRequestedContent;
+
+ this._ignoreRevisionContentDidChangeEvent = true;
+ revision.content = content || null;
+ revision.contentIsBase64Encoded = base64Encoded || false;
+ delete this._ignoreRevisionContentDidChangeEvent;
+
+ this.servicePendingContentRequests();
+ }
+};
+
+WebInspector.SourceCode.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeLocationjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeLocationjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeLocation.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,455 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeLocation = function(sourceCode, lineNumber, columnNumber)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(sourceCode === null || sourceCode instanceof WebInspector.SourceCode);
+ console.assert(!(sourceCode instanceof WebInspector.SourceMapResource));
+ console.assert(typeof lineNumber === "number" && !isNaN(lineNumber) && lineNumber >= 0);
+ console.assert(typeof columnNumber === "number" && !isNaN(columnNumber) && columnNumber >= 0);
+
+ this._sourceCode = sourceCode || null;
+ this._lineNumber = lineNumber;
+ this._columnNumber = columnNumber;
+ this._resolveFormattedLocation();
+
+ if (this._sourceCode) {
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
+ }
+
+ this._resetMappedLocation();
+};
+
+WebInspector.SourceCodeLocation.DisplayLocationClassName = "display-location";
+
+WebInspector.SourceCodeLocation.LargeColumnNumber = 80;
+
+WebInspector.SourceCodeLocation.NameStyle = {
+ None: "none", // File name not included.
+ Short: "short", // Only the file name.
+ Full: "full" // Full URL is used.
+};
+
+WebInspector.SourceCodeLocation.ColumnStyle = {
+ Hidden: "hidden", // column numbers are not included.
+ OnlyIfLarge: "only-if-large", // column numbers greater than 80 are shown.
+ Shown: "shown" // non-zero column numbers are shown.
+};
+
+WebInspector.SourceCodeLocation.Event = {
+ LocationChanged: "source-code-location-location-changed",
+ DisplayLocationChanged: "source-code-location-display-location-changed"
+};
+
+WebInspector.SourceCodeLocation.prototype = {
+ constructor: WebInspector.SourceCodeLocation,
+
+ // Public
+
+ isEqual: function(other)
+ {
+ if (!other)
+ return false;
+ return this._sourceCode === other._sourceCode && this._lineNumber === other._lineNumber && this._columnNumber === other._columnNumber;
+ },
+
+ get sourceCode()
+ {
+ return this._sourceCode;
+ },
+
+ set sourceCode(sourceCode)
+ {
+ console.assert((this._sourceCode === null && sourceCode instanceof WebInspector.SourceCode) || (this._sourceCode instanceof WebInspector.SourceCode && sourceCode === null));
+
+ if (sourceCode === this._sourceCode)
+ return;
+
+ this._makeChangeAndDispatchChangeEventIfNeeded(function() {
+ if (this._sourceCode) {
+ this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+ this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
+ }
+
+ this._sourceCode = sourceCode;
+
+ if (this._sourceCode) {
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
+ }
+ });
+ },
+
+ // Raw line and column in the original source code.
+
+ get lineNumber()
+ {
+ return this._lineNumber;
+ },
+
+ get columnNumber()
+ {
+ return this._columnNumber;
+ },
+
+ position: function()
+ {
+ return new WebInspector.SourceCodePosition(this.lineNumber, this.columnNumber);
+ },
+
+ // Formatted line and column if the original source code is pretty printed.
+ // This is the same as the raw location if there is no formatter.
+
+ get formattedLineNumber()
+ {
+ return this._formattedLineNumber;
+ },
+
+ get formattedColumnNumber()
+ {
+ return this._formattedColumnNumber;
+ },
+
+ formattedPosition: function()
+ {
+ return new WebInspector.SourceCodePosition(this.formattedLineNumber, this.formattedColumnNumber);
+ },
+
+ // Display line and column:
+ // - Mapped line and column if the original source code has a source map.
+ // - Otherwise this is the formatted / raw line and column.
+
+ get displaySourceCode()
+ {
+ this._resolveMappedLocation();
+ return this._mappedResource || this._sourceCode;
+ },
+
+ get displayLineNumber()
+ {
+ this._resolveMappedLocation();
+ return isNaN(this._mappedLineNumber) ? this._formattedLineNumber : this._mappedLineNumber;
+ },
+
+ get displayColumnNumber()
+ {
+ this._resolveMappedLocation();
+ return isNaN(this._mappedColumnNumber) ? this._formattedColumnNumber : this._mappedColumnNumber;
+ },
+
+ displayPosition: function()
+ {
+ return new WebInspector.SourceCodePosition(this.displayLineNumber, this.displayColumnNumber);
+ },
+
+ // User presentable location strings: "file:lineNumber:columnNumber".
+
+ originalLocationString: function(columnStyle, nameStyle, prefix)
+ {
+ return this._locationString(this.sourceCode, this.lineNumber, this.columnNumber, columnStyle, nameStyle, prefix);
+ },
+
+ formattedLocationString: function(columnStyle, nameStyle, prefix)
+ {
+ return this._locationString(this.sourceCode, this.formattedLineNumber, this.formattedColumn, columnStyle, nameStyle, prefix);
+ },
+
+ displayLocationString: function(columnStyle, nameStyle, prefix)
+ {
+ return this._locationString(this.displaySourceCode, this.displayLineNumber, this.displayColumnNumber, columnStyle, nameStyle, prefix);
+ },
+
+ tooltipString: function()
+ {
+ if (!this.hasDifferentDisplayLocation())
+ return this.originalLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full);
+
+ var tooltip = WebInspector.UIString("Located at %s").format(this.displayLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full));
+ tooltip += "\n" + WebInspector.UIString("Originally %s").format(this.originalLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full));
+ return tooltip;
+ },
+
+ hasMappedLocation: function()
+ {
+ this._resolveMappedLocation();
+ return this._mappedResource !== null;
+ },
+
+ hasFormattedLocation: function()
+ {
+ return this._formattedLineNumber !== this._lineNumber || this._formattedColumnNumber !== this._columnNumber;
+ },
+
+ hasDifferentDisplayLocation: function()
+ {
+ return this.hasMappedLocation() || this.hasFormattedLocation();
+ },
+
+ update: function(sourceCode, lineNumber, columnNumber)
+ {
+ console.assert(sourceCode === this._sourceCode || (this._mappedResource && sourceCode === this._mappedResource));
+ console.assert(typeof lineNumber === "number" && !isNaN(lineNumber) && lineNumber >= 0);
+ console.assert(typeof columnNumber === "number" && !isNaN(columnNumber) && columnNumber >= 0);
+
+ if (sourceCode === this._sourceCode && lineNumber === this._lineNumber && columnNumber === this._columnNumber)
+ return;
+ else if (this._mappedResource && sourceCode === this._mappedResource && lineNumber === this._mappedLineNumber && columnNumber === this._mappedColumnNumber)
+ return;
+
+ var newSourceCodeLocation = sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
+ console.assert(newSourceCodeLocation.sourceCode === this._sourceCode);
+
+ this._makeChangeAndDispatchChangeEventIfNeeded(function() {
+ this._lineNumber = newSourceCodeLocation._lineNumber;
+ this._columnNumber = newSourceCodeLocation._columnNumber;
+ if (newSourceCodeLocation._mappedLocationIsResolved) {
+ this._mappedLocationIsResolved = true;
+ this._mappedResource = newSourceCodeLocation._mappedResource;
+ this._mappedLineNumber = newSourceCodeLocation._mappedLineNumber;
+ this._mappedColumnNumber = newSourceCodeLocation._mappedColumnNumber;
+ }
+ });
+ },
+
+ populateLiveDisplayLocationTooltip: function(element, prefix)
+ {
+ prefix = prefix || "";
+
+ element.title = prefix + this.tooltipString();
+
+ this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) {
+ element.title = prefix + this.tooltipString();
+ }, this);
+ },
+
+ populateLiveDisplayLocationString: function(element, propertyName, columnStyle, nameStyle, prefix)
+ {
+ var currentDisplay = undefined;
+
+ function updateDisplayString(showAlternativeLocation, forceUpdate)
+ {
+ if (!forceUpdate && currentDisplay === showAlternativeLocation)
+ return;
+
+ currentDisplay = showAlternativeLocation;
+
+ if (!showAlternativeLocation) {
+ element[propertyName] = this.displayLocationString(columnStyle, nameStyle, prefix);
+ element.classList.toggle(WebInspector.SourceCodeLocation.DisplayLocationClassName, this.hasDifferentDisplayLocation());
+ } else if (this.hasDifferentDisplayLocation()) {
+ element[propertyName] = this.originalLocationString(columnStyle, nameStyle, prefix);
+ element.classList.remove(WebInspector.SourceCodeLocation.DisplayLocationClassName);
+ }
+ }
+
+ function mouseOverOrMove(event)
+ {
+ updateDisplayString.call(this, event.metaKey && !event.altKey && !event.shiftKey);
+ }
+
+ updateDisplayString.call(this, false);
+
+ this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) {
+ updateDisplayString.call(this, currentDisplay, true);
+ }, this);
+
+ var boundMouseOverOrMove = mouseOverOrMove.bind(this);
+ element.addEventListener("mouseover", boundMouseOverOrMove);
+ element.addEventListener("mousemove", boundMouseOverOrMove);
+
+ element.addEventListener("mouseout", function(event) {
+ updateDisplayString.call(this, false);
+ }.bind(this));
+ },
+
+ // Private
+
+ _locationString: function(sourceCode, lineNumber, columnNumber, columnStyle, nameStyle, prefix)
+ {
+ console.assert(sourceCode);
+ if (!sourceCode)
+ return "";
+
+ columnStyle = columnStyle || WebInspector.SourceCodeLocation.ColumnStyle.OnlyIfLarge;
+ nameStyle = nameStyle || WebInspector.SourceCodeLocation.NameStyle.Short;
+ prefix = prefix || "";
+
+ var lineString = lineNumber + 1; // The user visible line number is 1-based.
+ if (columnStyle === WebInspector.SourceCodeLocation.ColumnStyle.Shown && columnNumber > 0)
+ lineString += ":" + (columnNumber + 1); // The user visible column number is 1-based.
+ else if (columnStyle === WebInspector.SourceCodeLocation.ColumnStyle.OnlyIfLarge && columnNumber > WebInspector.SourceCodeLocation.LargeColumnNumber)
+ lineString += ":" + (columnNumber + 1); // The user visible column number is 1-based.
+
+ switch (nameStyle) {
+ case WebInspector.SourceCodeLocation.NameStyle.None:
+ return prefix + lineString;
+
+ case WebInspector.SourceCodeLocation.NameStyle.Short:
+ case WebInspector.SourceCodeLocation.NameStyle.Full:
+ var lineSuffix = sourceCode.url ? ":" + lineString : WebInspector.UIString(" (line %s)").format(lineString);
+ return prefix + (nameStyle === WebInspector.SourceCodeLocation.NameStyle.Full && sourceCode.url ? sourceCode.url : sourceCode.displayName) + lineSuffix;
+
+ default:
+ console.error("Unknown nameStyle: " + nameStyle);
+ return prefix + lineString;
+ }
+ },
+
+ _resetMappedLocation: function()
+ {
+ this._mappedLocationIsResolved = false;
+ this._mappedResource = null;
+ this._mappedLineNumber = NaN;
+ this._mappedColumnNumber = NaN;
+ },
+
+ _setMappedLocation: function(mappedResource, mappedLineNumber, mappedColumnNumber)
+ {
+ // Called by SourceMapResource when it creates a SourceCodeLocation and already knows the resolved location.
+ this._mappedLocationIsResolved = true;
+ this._mappedResource = mappedResource;
+ this._mappedLineNumber = mappedLineNumber;
+ this._mappedColumnNumber = mappedColumnNumber;
+ },
+
+ _resolveMappedLocation: function()
+ {
+ if (this._mappedLocationIsResolved)
+ return;
+
+ console.assert(this._mappedResource === null);
+ console.assert(isNaN(this._mappedLineNumber));
+ console.assert(isNaN(this._mappedColumnNumber));
+
+ this._mappedLocationIsResolved = true;
+
+ if (!this._sourceCode)
+ return;
+
+ var sourceMaps = this._sourceCode.sourceMaps;
+ if (!sourceMaps.length)
+ return;
+
+ for (var i = 0; i < sourceMaps.length; ++i) {
+ var sourceMap = sourceMaps[i];
+ var entry = sourceMap.findEntry(this._lineNumber, this._columnNumber);
+ if (!entry || entry.length === 2)
+ continue;
+ console.assert(entry.length === 5);
+ var url = entry[2];
+ var sourceMapResource = sourceMap.resourceForURL(url);
+ if (!sourceMapResource)
+ return;
+ this._mappedResource = sourceMapResource;
+ this._mappedLineNumber = entry[3];
+ this._mappedColumnNumber = entry[4];
+ return;
+ }
+ },
+
+ _resolveFormattedLocation: function()
+ {
+ if (this._sourceCode && this._sourceCode.formatterSourceMap) {
+ var formattedLocation = this._sourceCode.formatterSourceMap.originalToFormatted(this._lineNumber, this._columnNumber);
+ this._formattedLineNumber = formattedLocation.lineNumber;
+ this._formattedColumnNumber = formattedLocation.columnNumber;
+ } else {
+ this._formattedLineNumber = this._lineNumber;
+ this._formattedColumnNumber = this._columnNumber;
+ }
+ },
+
+ _makeChangeAndDispatchChangeEventIfNeeded: function(changeFunction)
+ {
+ var oldSourceCode = this._sourceCode;
+ var oldLineNumber = this._lineNumber;
+ var oldColumnNumber = this._columnNumber;
+
+ var oldFormattedLineNumber = this._formattedLineNumber;
+ var oldFormattedColumnNumber = this._formattedColumnNumber;
+
+ var oldDisplaySourceCode = this.displaySourceCode;
+ var oldDisplayLineNumber = this.displayLineNumber;
+ var oldDisplayColumnNumber = this.displayColumnNumber;
+
+ this._resetMappedLocation();
+
+ if (changeFunction)
+ changeFunction.call(this);
+
+ this._resolveMappedLocation();
+ this._resolveFormattedLocation();
+
+ // If the display source code is non-null then the addresses are not NaN and can be compared.
+ var displayLocationChanged = false;
+ var newDisplaySourceCode = this.displaySourceCode;
+ if (oldDisplaySourceCode !== newDisplaySourceCode)
+ displayLocationChanged = true;
+ else if (newDisplaySourceCode && (oldDisplayLineNumber !== this.displayLineNumber || oldDisplayColumnNumber !== this.displayColumnNumber))
+ displayLocationChanged = true;
+
+ var anyLocationChanged = false;
+ if (displayLocationChanged)
+ anyLocationChanged = true;
+ else if (oldSourceCode !== this._sourceCode)
+ anyLocationChanged = true;
+ else if (this._sourceCode && (oldLineNumber !== this._lineNumber || oldColumnNumber !== this._columnNumber))
+ anyLocationChanged = true;
+ else if (this._sourceCode && (oldFormattedLineNumber !== this._formattedLineNumber || oldFormattedColumnNumber !== this._formattedColumnNumber))
+ anyLocationChanged = true;
+
+ if (displayLocationChanged || anyLocationChanged) {
+ var oldData = {
+ oldSourceCode: oldSourceCode,
+ oldLineNumber: oldLineNumber,
+ oldColumnNumber: oldColumnNumber,
+ oldFormattedLineNumber: oldFormattedLineNumber,
+ oldFormattedColumnNumber: oldFormattedColumnNumber,
+ oldDisplaySourceCode: oldDisplaySourceCode,
+ oldDisplayLineNumber: oldDisplayLineNumber,
+ oldDisplayColumnNumber: oldDisplayColumnNumber
+ };
+ if (displayLocationChanged)
+ this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, oldData);
+ if (anyLocationChanged)
+ this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.LocationChanged, oldData);
+ }
+ },
+
+ _sourceCodeSourceMapAdded: function()
+ {
+ this._makeChangeAndDispatchChangeEventIfNeeded(null);
+ },
+
+ _sourceCodeFormatterDidChange: function()
+ {
+ this._makeChangeAndDispatchChangeEventIfNeeded(null);
+ }
+};
+
+WebInspector.SourceCodeLocation.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodePositionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodePositionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodePosition.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodePosition.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodePosition.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodePosition.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodePosition = function(lineNumber, columNumber)
+{
+ WebInspector.Object.call(this);
+
+ this._lineNumber = lineNumber || 0;
+ this._columnNumber = columNumber || 0;
+}
+
+WebInspector.SourceCodePosition.prototype = {
+ constructor: WebInspector.SourceCodePosition,
+
+ // Public
+
+ get lineNumber()
+ {
+ return this._lineNumber;
+ },
+
+ get columnNumber()
+ {
+ return this._columnNumber;
+ }
+};
+
+WebInspector.SourceCodePosition.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeRevisionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeRevisionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeRevision.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeRevision.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeRevision.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeRevision.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeRevision = function(sourceCode, content, contentIsBase64Encoded)
+{
+ WebInspector.Revision.call(this);
+
+ console.assert(sourceCode instanceof WebInspector.SourceCode);
+
+ this._sourceCode = sourceCode;
+ this._content = content || "";
+ this._contentIsBase64Encoded = contentIsBase64Encoded || false;
+};
+
+WebInspector.SourceCodeRevision.prototype = {
+ constructor: WebInspector.SourceCodeRevision,
+
+ // Public
+
+ get sourceCode()
+ {
+ return this._sourceCode;
+ },
+
+ get content()
+ {
+ return this._content;
+ },
+
+ set content(content)
+ {
+ content = content || "";
+
+ if (this._content === content)
+ return;
+
+ this._content = content;
+
+ this._sourceCode.revisionContentDidChange(this);
+ },
+
+ get contentIsBase64Encoded()
+ {
+ return this._contentIsBase64Encoded;
+ },
+
+ set contentIsBase64Encoded(encoded)
+ {
+ this._contentIsBase64Encoded = encoded || false;
+ },
+
+ apply: function()
+ {
+ this._sourceCode.currentRevision = this;
+ },
+
+ revert: function()
+ {
+ this._sourceCode.currentRevision = this._sourceCode.originalRevision;
+ },
+
+ copy: function()
+ {
+ return new WebInspector.SourceCodeRevision(this._sourceCode, this._content, this._contentIsBase64Encoded);
+ }
+};
+
+WebInspector.SourceCodeRevision.prototype.__proto__ = WebInspector.Revision.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeTextRangejsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTextRangejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTextRange.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextRange.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTextRange.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTextRange.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTextRange = function(sourceCode) /* textRange || startLocation, endLocation */
+{
+ WebInspector.Object.call(this);
+
+ console.assert(sourceCode instanceof WebInspector.SourceCode);
+ console.assert(arguments.length === 2 || arguments.length === 3);
+
+ this._sourceCode = sourceCode;
+
+ if (arguments.length === 2) {
+ var textRange = arguments[1];
+ console.assert(textRange instanceof WebInspector.TextRange);
+ this._startLocation = sourceCode.createSourceCodeLocation(textRange.startLine, textRange.startColumn);
+ this._endLocation = sourceCode.createSourceCodeLocation(textRange.endLine, textRange.endColumn);
+ } else {
+ console.assert(arguments[1] instanceof WebInspector.SourceCodeLocation);
+ console.assert(arguments[2] instanceof WebInspector.SourceCodeLocation);
+ this._startLocation = arguments[1];
+ this._endLocation = arguments[2];
+ }
+
+ this._startLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationChanged, this);
+ this._endLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationChanged, this);
+};
+
+WebInspector.SourceCodeTextRange.Event = {
+ RangeChanged: "source-code-text-range-range-changed"
+};
+
+WebInspector.SourceCodeTextRange.prototype = {
+ constructor: WebInspector.SourceCodeTextRange,
+
+ // Public
+
+ get sourceCode()
+ {
+ return this._sourceCode;
+ },
+
+ // Raw text range in the original source code.
+
+ get textRange()
+ {
+ var startLine = this._startLocation.lineNumber;
+ var startColumn = this._startLocation.columnNumber;
+ var endLine = this._endLocation.lineNumber;
+ var endColumn = this._endLocation.columnNumber;
+ return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
+ },
+
+ // Formatted text range in the original source code if it is pretty printed.
+ // This is the same as the raw text range if the source code has no formatter.
+
+ get formattedTextRange()
+ {
+ var startLine = this._startLocation.formattedLineNumber;
+ var startColumn = this._startLocation.formattedColumnNumber;
+ var endLine = this._endLocation.formattedLineNumber;
+ var endColumn = this._endLocation.formattedColumnNumber;
+ return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
+ },
+
+ // Display values:
+ // - Mapped resource and text range locations if the original source code has a
+ // source map and both start and end locations are in the same mapped resource.
+ // - Otherwise this is the formatted / raw text range.
+
+ get displaySourceCode()
+ {
+ if (!this._startAndEndLocationsInSameMappedResource())
+ return this._sourceCode;
+
+ return this._startLocation.displaySourceCode;
+ },
+
+ get displayTextRange()
+ {
+ if (!this._startAndEndLocationsInSameMappedResource())
+ return this.formattedTextRange;
+
+ var startLine = this._startLocation.displayLineNumber;
+ var startColumn = this._startLocation.displayColumnNumber;
+ var endLine = this._endLocation.displayLineNumber;
+ var endColumn = this._endLocation.displayColumnNumber;
+ return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
+ },
+
+ // Private
+
+ _startAndEndLocationsInSameMappedResource: function()
+ {
+ return this._startLocation.hasMappedLocation() && this._endLocation.hasMappedLocation() && this._startLocation.displaySourceCode === this._endLocation.displaySourceCode;
+ },
+
+ _sourceCodeLocationChanged: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.RangeChanged);
+ }
+};
+
+WebInspector.SourceCodeTextRange.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceCodeTimelinejsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelinejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTimeline.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimeline.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTimeline.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeTimeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimeline = function(sourceCode, sourceCodeLocation, recordType, recordEventType)
+{
+ WebInspector.Timeline.call(this);
+
+ console.assert(sourceCode);
+ console.assert(!sourceCodeLocation || sourceCodeLocation.sourceCode === sourceCode);
+ console.assert(recordType);
+
+ this._sourceCode = sourceCode;
+ this._sourceCodeLocation = sourceCodeLocation || null;
+ this._recordType = recordType;
+ this._recordEventType = recordEventType || null;
+};
+
+WebInspector.SourceCodeTimeline.TypeIdentifier = "source-code-timeline";
+WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey = "source-code-timeline-source-code-url";
+WebInspector.SourceCodeTimeline.SourceCodeLocationLineCookieKey = "source-code-timeline-source-code-location-line";
+WebInspector.SourceCodeTimeline.SourceCodeLocationColumnCookieKey = "source-code-timeline-source-code-location-column";
+WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey = "source-code-timeline-source-code-url";
+WebInspector.SourceCodeTimeline.RecordTypeCookieKey = "source-code-timeline-record-type";
+WebInspector.SourceCodeTimeline.RecordEventTypeCookieKey = "source-code-timeline-record-event-type";
+
+WebInspector.SourceCodeTimeline.prototype = {
+ constructor: WebInspector.SourceCodeTimeline,
+ __proto__: WebInspector.Timeline.prototype,
+
+ // Public
+
+ get sourceCode()
+ {
+ return this._sourceCode;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ get recordType()
+ {
+ return this._recordType;
+ },
+
+ get recordEventType()
+ {
+ return this._recordEventType;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey] = this._sourceCode.url ? this._sourceCode.url.hash : null;
+ cookie[WebInspector.SourceCodeTimeline.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
+ cookie[WebInspector.SourceCodeTimeline.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
+ cookie[WebInspector.SourceCodeTimeline.RecordTypeCookieKey] = this._recordType || null;
+ cookie[WebInspector.SourceCodeTimeline.RecordEventTypeCookieKey] = this._recordEventType || null;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceMapjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceMapjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceMap.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,333 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+/**
+ * Implements Source Map V3 model. See http://code.google.com/p/closure-compiler/wiki/SourceMaps
+ * for format description.
+ * @constructor
+ * @param {string} sourceMappingURL
+ * @param {SourceMapV3} payload
+ * @param {WebInspector.Resource|WebInspector.Script} originalSourceCode
+ */
+WebInspector.SourceMap = function(sourceMappingURL, payload, originalSourceCode)
+{
+ if (!WebInspector.SourceMap.prototype._base64Map) {
+ const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ WebInspector.SourceMap.prototype._base64Map = {};
+ for (var i = 0; i < base64Digits.length; ++i)
+ WebInspector.SourceMap.prototype._base64Map[base64Digits.charAt(i)] = i;
+ }
+
+ this._originalSourceCode = originalSourceCode || null;
+ this._sourceMapResources = {};
+ this._sourceMapResourcesList = [];
+
+ this._sourceMappingURL = sourceMappingURL;
+ this._reverseMappingsBySourceURL = {};
+ this._mappings = [];
+ this._sources = {};
+ this._sourceRoot = null;
+ this._sourceContentByURL = {};
+ this._parseMappingPayload(payload);
+}
+
+WebInspector.SourceMap.prototype = {
+
+ get originalSourceCode()
+ {
+ return this._originalSourceCode;
+ },
+
+ get sourceMappingBasePathURLComponents()
+ {
+ if (this._sourceMappingURLBasePathComponents)
+ return this._sourceMappingURLBasePathComponents;
+
+ if (this._sourceRoot) {
+ var baseURLPath = absoluteURL(this._sourceRoot, this._sourceMappingURL);
+ console.assert(baseURLPath);
+ if (baseURLPath) {
+ var urlComponents = parseURL(baseURLPath);
+ if (!/\/$/.test(urlComponents.path))
+ urlComponents.path += "/";
+ this._sourceMappingURLBasePathComponents = urlComponents;
+ return this._sourceMappingURLBasePathComponents;
+ }
+ }
+
+ var urlComponents = parseURL(this._sourceMappingURL);
+ urlComponents.path = urlComponents.path.substr(0, urlComponents.path.lastIndexOf(urlComponents.lastPathComponent));
+ urlComponents.lastPathComponent = null;
+ this._sourceMappingURLBasePathComponents = urlComponents;
+ return this._sourceMappingURLBasePathComponents;
+ },
+
+ get resources()
+ {
+ return this._sourceMapResourcesList;
+ },
+
+ addResource: function(resource)
+ {
+ console.assert(!(resource.url in this._sourceMapResources));
+ this._sourceMapResources[resource.url] = resource;
+ this._sourceMapResourcesList.push(resource);
+ },
+
+ resourceForURL: function(url)
+ {
+ return this._sourceMapResources[url];
+ },
+
+ /**
+ * @return {Array.<string>}
+ */
+ sources: function()
+ {
+ return Object.keys(this._sources);
+ },
+
+ /**
+ * @param {string} sourceURL
+ * @return {string|undefined}
+ */
+ sourceContent: function(sourceURL)
+ {
+ return this._sourceContentByURL[sourceURL];
+ },
+
+ /**
+ * @param {SourceMapV3} mappingPayload
+ */
+ _parseMappingPayload: function(mappingPayload)
+ {
+ if (mappingPayload.sections)
+ this._parseSections(mappingPayload.sections);
+ else
+ this._parseMap(mappingPayload, 0, 0);
+ },
+
+ /**
+ * @param {Array.<SourceMapV3.Section>} sections
+ */
+ _parseSections: function(sections)
+ {
+ for (var i = 0; i < sections.length; ++i) {
+ var section = sections[i];
+ this._parseMap(section.map, section.offset.line, section.offset.column);
+ }
+ },
+
+ /**
+ * @param {number} lineNumber in compiled resource
+ * @param {number} columnNumber in compiled resource
+ * @return {?Array}
+ */
+ findEntry: function(lineNumber, columnNumber)
+ {
+ var first = 0;
+ var count = this._mappings.length;
+ while (count > 1) {
+ var step = count >> 1;
+ var middle = first + step;
+ var mapping = this._mappings[middle];
+ if (lineNumber < mapping[0] || (lineNumber === mapping[0] && columnNumber < mapping[1]))
+ count = step;
+ else {
+ first = middle;
+ count -= step;
+ }
+ }
+ var entry = this._mappings[first];
+ if (!first && entry && (lineNumber < entry[0] || (lineNumber === entry[0] && columnNumber < entry[1])))
+ return null;
+ return entry;
+ },
+
+ /**
+ * @param {string} sourceURL of the originating resource
+ * @param {number} lineNumber in the originating resource
+ * @return {Array}
+ */
+ findEntryReversed: function(sourceURL, lineNumber)
+ {
+ var mappings = this._reverseMappingsBySourceURL[sourceURL];
+ for ( ; lineNumber < mappings.length; ++lineNumber) {
+ var mapping = mappings[lineNumber];
+ if (mapping)
+ return mapping;
+ }
+ return this._mappings[0];
+ },
+
+ /**
+ * @param {SourceMapV3} map
+ * @param {number} lineNumber
+ * @param {number} columnNumber
+ */
+ _parseMap: function(map, lineNumber, columnNumber)
+ {
+ var sourceIndex = 0;
+ var sourceLineNumber = 0;
+ var sourceColumnNumber = 0;
+ var nameIndex = 0;
+
+ var sources = [];
+ var originalToCanonicalURLMap = {};
+ for (var i = 0; i < map.sources.length; ++i) {
+ var originalSourceURL = map.sources[i];
+ var href = originalSourceURL;
+ if (map.sourceRoot && href.charAt(0) !== "/")
+ href = map.sourceRoot.replace(/\/+$/, "") + "/" + href;
+ var url = absoluteURL(href, this._sourceMappingURL) || href;
+ originalToCanonicalURLMap[originalSourceURL] = url;
+ sources.push(url);
+ this._sources[url] = true;
+
+ if (map.sourcesContent && map.sourcesContent[i])
+ this._sourceContentByURL[url] = map.sourcesContent[i];
+ }
+
+ this._sourceRoot = map.sourceRoot || null;
+
+ var stringCharIterator = new WebInspector.SourceMap.StringCharIterator(map.mappings);
+ var sourceURL = sources[sourceIndex];
+
+ while (true) {
+ if (stringCharIterator.peek() === ",")
+ stringCharIterator.next();
+ else {
+ while (stringCharIterator.peek() === ";") {
+ lineNumber += 1;
+ columnNumber = 0;
+ stringCharIterator.next();
+ }
+ if (!stringCharIterator.hasNext())
+ break;
+ }
+
+ columnNumber += this._decodeVLQ(stringCharIterator);
+ if (this._isSeparator(stringCharIterator.peek())) {
+ this._mappings.push([lineNumber, columnNumber]);
+ continue;
+ }
+
+ var sourceIndexDelta = this._decodeVLQ(stringCharIterator);
+ if (sourceIndexDelta) {
+ sourceIndex += sourceIndexDelta;
+ sourceURL = sources[sourceIndex];
+ }
+ sourceLineNumber += this._decodeVLQ(stringCharIterator);
+ sourceColumnNumber += this._decodeVLQ(stringCharIterator);
+ if (!this._isSeparator(stringCharIterator.peek()))
+ nameIndex += this._decodeVLQ(stringCharIterator);
+
+ this._mappings.push([lineNumber, columnNumber, sourceURL, sourceLineNumber, sourceColumnNumber]);
+ }
+
+ for (var i = 0; i < this._mappings.length; ++i) {
+ var mapping = this._mappings[i];
+ var url = mapping[2];
+ if (!url)
+ continue;
+ if (!this._reverseMappingsBySourceURL[url])
+ this._reverseMappingsBySourceURL[url] = [];
+ var reverseMappings = this._reverseMappingsBySourceURL[url];
+ var sourceLine = mapping[3];
+ if (!reverseMappings[sourceLine])
+ reverseMappings[sourceLine] = [mapping[0], mapping[1]];
+ }
+ },
+
+ /**
+ * @param {string} char
+ * @return {boolean}
+ */
+ _isSeparator: function(char)
+ {
+ return char === "," || char === ";";
+ },
+
+ /**
+ * @param {WebInspector.SourceMap.StringCharIterator} stringCharIterator
+ * @return {number}
+ */
+ _decodeVLQ: function(stringCharIterator)
+ {
+ // Read unsigned value.
+ var result = 0;
+ var shift = 0;
+ do {
+ var digit = this._base64Map[stringCharIterator.next()];
+ result += (digit & this._VLQ_BASE_MASK) << shift;
+ shift += this._VLQ_BASE_SHIFT;
+ } while (digit & this._VLQ_CONTINUATION_MASK);
+
+ // Fix the sign.
+ var negative = result & 1;
+ result >>= 1;
+ return negative ? -result : result;
+ },
+
+ _VLQ_BASE_SHIFT: 5,
+ _VLQ_BASE_MASK: (1 << 5) - 1,
+ _VLQ_CONTINUATION_MASK: 1 << 5
+}
+
+/**
+ * @constructor
+ * @param {string} string
+ */
+WebInspector.SourceMap.StringCharIterator = function(string)
+{
+ this._string = string;
+ this._position = 0;
+}
+
+WebInspector.SourceMap.StringCharIterator.prototype = {
+ /**
+ * @return {string}
+ */
+ next: function()
+ {
+ return this._string.charAt(this._position++);
+ },
+
+ /**
+ * @return {string}
+ */
+ peek: function()
+ {
+ return this._string.charAt(this._position);
+ },
+
+ /**
+ * @return {boolean}
+ */
+ hasNext: function()
+ {
+ return this._position < this._string.length;
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceMapResourcejsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceMapResourcejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceMapResource.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapResource = function(url, sourceMap)
+{
+ WebInspector.Resource.call(this, url, null);
+
+ console.assert(url);
+ console.assert(sourceMap);
+
+ this._sourceMap = sourceMap;
+};
+
+WebInspector.SourceMapResource.prototype = {
+ constructor: WebInspector.SourceMapResource,
+
+ // Public
+
+ get sourceMap()
+ {
+ return this._sourceMap;
+ },
+
+ get sourceMapDisplaySubpath()
+ {
+ var sourceMappingBasePathURLComponents = this._sourceMap.sourceMappingBasePathURLComponents;
+ var resourceURLComponents = this.urlComponents;
+
+ // Different schemes / hosts. Return the host + path of this resource.
+ if (resourceURLComponents.scheme !== sourceMappingBasePathURLComponents.scheme || resourceURLComponents.host !== sourceMappingBasePathURLComponents.host)
+ return resourceURLComponents.host + (resourceURLComponents.port ? (":" + resourceURLComponents.port) : "") + resourceURLComponents.path;
+
+ // Same host, but not a subpath of the base. This implies a ".." in the relative path.
+ if (!resourceURLComponents.path.startsWith(sourceMappingBasePathURLComponents.path))
+ return relativePath(resourceURLComponents.path, sourceMappingBasePathURLComponents.path);
+
+ // Same host. Just a subpath of the base.
+ return resourceURLComponents.path.substring(sourceMappingBasePathURLComponents.path.length, resourceURLComponents.length);
+ },
+
+ canRequestContentFromBackend: function()
+ {
+ return !this.finished;
+ },
+
+ requestContentFromBackend: function(callback)
+ {
+ function requestAsyncCallback(body, base64encoded, mimeType)
+ {
+ if (body === null) {
+ this.markAsFailed();
+ callback("Failed to load resource", body, base64encoded);
+ return;
+ }
+
+ var oldType = this._type;
+ var oldMIMEType = this._mimeType;
+
+ this._mimeType = mimeType;
+ this._type = WebInspector.Resource.Type.fromMIMEType(this._mimeType);
+
+ if (oldMIMEType !== mimeType) {
+ // Delete the MIME-type components so the MIME-type is re-parsed the next time it is requested.
+ delete this._mimeTypeComponents;
+
+ this.dispatchEventToListeners(WebInspector.Resource.Event.MIMETypeDidChange, {oldMIMEType: oldMIMEType});
+ }
+
+ if (oldType !== this._type)
+ this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
+
+ this.markAsFinished();
+
+ callback(null, body, base64encoded);
+ }
+
+ this._requestResourceAsynchronously(requestAsyncCallback.bind(this));
+ return true;
+ },
+
+ createSourceCodeLocation: function(lineNumber, columnNumber)
+ {
+ // SourceCodeLocations are always constructed with raw resources and raw locations. Lookup the raw location.
+ var entry = this._sourceMap.findEntryReversed(this.url, lineNumber);
+ var rawLineNumber = entry[0];
+ var rawColumnNumber = entry[1];
+
+ // If the raw location is an inline script we need to include that offset.
+ var originalSourceCode = this._sourceMap.originalSourceCode;
+ if (originalSourceCode instanceof WebInspector.Script) {
+ if (rawLineNumber === 0)
+ rawColumnNumber += originalSourceCode.range.startColumn;
+ rawLineNumber += originalSourceCode.range.startLine;
+ }
+
+ // Create the SourceCodeLocation and since we already know the the mapped location set it directly.
+ var location = originalSourceCode.createSourceCodeLocation(rawLineNumber, rawColumnNumber);
+ location._setMappedLocation(this, lineNumber, columnNumber);
+ return location;
+ },
+
+ createSourceCodeTextRange: function(textRange)
+ {
+ // SourceCodeTextRanges are always constructed with raw resources and raw locations.
+ // However, we can provide the most accurate mapped locations in construction.
+ var startSourceCodeLocation = this.createSourceCodeLocation(textRange.startLine, textRange.startColumn);
+ var endSourceCodeLocation = this.createSourceCodeLocation(textRange.endLine, textRange.endColumn);
+ return new WebInspector.SourceCodeTextRange(this._sourceMap.originalSourceCode, startSourceCodeLocation, endSourceCodeLocation);
+ },
+
+ // Private
+
+ _requestResourceAsynchronously: function(callback)
+ {
+ // FIXME: <rdar://problem/13238886> Source Maps: Frontend needs asynchronous resource loading of content + mime type
+
+ function async()
+ {
+ var body = this._sourceMap.sourceContent(this.url) || InspectorFrontendHost.loadResourceSynchronously(this.url);
+ if (body === undefined)
+ body = null;
+ var fileExtension = WebInspector.fileExtensionForURL(this.url);
+ var mimeType = WebInspector.mimeTypeForFileExtension(fileExtension, true) || "text/javascript";
+ callback(body, false, mimeType);
+ }
+
+ setTimeout(async.bind(this), 0);
+ }
+};
+
+WebInspector.SourceMapResource.prototype.__proto__ = WebInspector.Resource.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTextMarkerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTextMarkerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/TextMarker.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextMarker.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TextMarker.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TextMarker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextMarker = function(codeMirrorTextMarker, type)
+{
+ WebInspector.Object.call(this);
+
+ this._codeMirrorTextMarker = codeMirrorTextMarker;
+ codeMirrorTextMarker.__webInspectorTextMarker = this;
+
+ this._type = type || WebInspector.TextMarker.Type.Plain;
+}
+
+WebInspector.TextMarker.Type = {
+ Color: "text-marker-type-color",
+ Gradient: "text-marker-type-gradient",
+ Plain: "text-marker-type-plain"
+};
+
+WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker = function(codeMirrorTextMarker)
+{
+ return codeMirrorTextMarker.__webInspectorTextMarker || new WebInspector.TextMarker(codeMirrorTextMarker);
+};
+
+WebInspector.TextMarker.prototype = {
+ constructor: WebInspector.TextMarker,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get codeMirrorTextMarker()
+ {
+ return this._codeMirrorTextMarker;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get range()
+ {
+ var range = this._codeMirrorTextMarker.find();
+ if (!range)
+ return null;
+ return new WebInspector.TextRange(range.from.line, range.from.ch, range.to.line, range.to.ch);
+ },
+
+ get rects()
+ {
+ var range = this._codeMirrorTextMarker.find();
+ if (!range)
+ return WebInspector.Rect.ZERO_RECT;
+ return this._codeMirrorTextMarker.doc.cm.rectsForRange({
+ start: range.from,
+ end: range.to
+ });
+ },
+
+ clear: function()
+ {
+ this._codeMirrorTextMarker.clear();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTextRangejsfromrev164541trunkSourceWebInspectorUIUserInterfaceTextRangejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/TextRange.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextRange.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TextRange.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TextRange.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,161 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextRange = function(startLineOrStartOffset, startColumnOrEndOffset, endLine, endColumn)
+{
+ WebInspector.Object.call(this);
+
+ if (arguments.length === 4) {
+ console.assert(startLineOrStartOffset <= endLine);
+ console.assert(startLineOrStartOffset !== endLine || startColumnOrEndOffset <= endColumn);
+
+ this._startLine = typeof startLineOrStartOffset === "number" ? startLineOrStartOffset : NaN;
+ this._startColumn = typeof startColumnOrEndOffset === "number" ? startColumnOrEndOffset : NaN;
+ this._endLine = typeof endLine === "number" ? endLine : NaN;
+ this._endColumn = typeof endColumn === "number" ? endColumn : NaN;
+
+ this._startOffset = NaN;
+ this._endOffset = NaN;
+ } else if (arguments.length === 2) {
+ console.assert(startLineOrStartOffset <= startColumnOrEndOffset);
+
+ this._startOffset = typeof startLineOrStartOffset === "number" ? startLineOrStartOffset : NaN;
+ this._endOffset = typeof startColumnOrEndOffset === "number" ? startColumnOrEndOffset : NaN;
+
+ this._startLine = NaN;
+ this._startColumn = NaN;
+ this._endLine = NaN;
+ this._endColumn = NaN;
+ }
+}
+
+WebInspector.TextRange.prototype = {
+ constructor: WebInspector.TextRange,
+
+ // Public
+
+ get startLine()
+ {
+ return this._startLine;
+ },
+
+ get startColumn()
+ {
+ return this._startColumn;
+ },
+
+ get endLine()
+ {
+ return this._endLine;
+ },
+
+ get endColumn()
+ {
+ return this._endColumn;
+ },
+
+ get startOffset()
+ {
+ return this._startOffset;
+ },
+
+ get endOffset()
+ {
+ return this._endOffset;
+ },
+
+ startPosition: function()
+ {
+ return new WebInspector.SourceCodePosition(this._startLine, this._startColumn);
+ },
+
+ endPosition: function()
+ {
+ return new WebInspector.SourceCodePosition(this._endLine, this._endColumn);
+ },
+
+ resolveLinesAndColumns: function(text)
+ {
+ console.assert(typeof text === "string");
+ if (typeof text !== "string")
+ return;
+
+ console.assert(!isNaN(this._startOffset));
+ console.assert(!isNaN(this._endOffset));
+ if (isNaN(this._startOffset) || isNaN(this._endOffset))
+ return;
+
+ function countNewLineCharacters(text)
+ {
+ var matches = text.match(/\n/g);
+ return matches ? matches.length : 0;
+ }
+
+ var startSubstring = text.substring(0, this._startOffset);
+ var rangeSubstring = text.substring(this._startOffset, this._endOffset);
+
+ var startNewLineCount = countNewLineCharacters(startSubstring);
+ var rangeNewLineCount = countNewLineCharacters(rangeSubstring);
+
+ this._startLine = startNewLineCount;
+ this._endLine = startNewLineCount + rangeNewLineCount;
+
+ var lastNewLineOffset = startNewLineCount ? startSubstring.lastIndexOf("\n") + 1 : 0;
+ this._startColumn = startSubstring.length - lastNewLineOffset;
+
+ lastNewLineOffset = rangeNewLineCount ? rangeSubstring.lastIndexOf("\n") + 1 : 0;
+ this._endColumn = rangeSubstring.length - lastNewLineOffset;
+
+ if (this._startLine === this._endLine)
+ this._endColumn += this._startColumn;
+ },
+
+ resolveOffsets: function(text)
+ {
+ console.assert(typeof text === "string");
+ if (typeof text !== "string")
+ return;
+
+ console.assert(!isNaN(this._startLine));
+ console.assert(!isNaN(this._startColumn));
+ console.assert(!isNaN(this._endLine));
+ console.assert(!isNaN(this._endColumn));
+ if (isNaN(this._startLine) || isNaN(this._startColumn) || isNaN(this._endLine) || isNaN(this._endColumn))
+ return;
+
+ var lastNewLineOffset = 0;
+ for (var i = 0; i < this._startLine; ++i)
+ lastNewLineOffset = text.indexOf("\n", lastNewLineOffset) + 1;
+
+ this._startOffset = lastNewLineOffset + this._startColumn;
+
+ for (var i = this._startLine; i < this._endLine; ++i)
+ lastNewLineOffset = text.indexOf("\n", lastNewLineOffset) + 1;
+
+ this._endOffset = lastNewLineOffset + this._endColumn;
+ }
+};
+
+WebInspector.TextRange.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelinejsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelinejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Timeline.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Timeline = function()
+{
+ WebInspector.Object.call(this);
+
+ this.reset(true);
+};
+
+WebInspector.Timeline.Event = {
+ Reset: "timeline-reset",
+ RecordAdded: "timeline-record-added",
+ TimesUpdated: "timeline-times-updated"
+};
+
+WebInspector.Timeline.prototype = {
+ constructor: WebInspector.Timeline,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ get records()
+ {
+ return this._records;
+ },
+
+ reset: function(suppressEvents)
+ {
+ this._records = [];
+ this._startTime = NaN;
+ this._endTime = NaN;
+
+ if (!suppressEvents) {
+ this.dispatchEventToListeners(WebInspector.Timeline.Event.Reset);
+ this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated);
+ }
+ },
+
+ addRecord: function(record)
+ {
+ if (record.updatesDynamically)
+ record.addEventListener(WebInspector.TimelineRecord.Event.Updated, this._recordUpdated, this);
+
+ this._records.push(record);
+
+ this._updateTimesIfNeeded(record);
+
+ this.dispatchEventToListeners(WebInspector.Timeline.Event.RecordAdded, {record: record});
+ },
+
+ // Private
+
+ _updateTimesIfNeeded: function(record)
+ {
+ var changed = false;
+
+ if (isNaN(this._startTime) || record.startTime < this._startTime) {
+ this._startTime = record.startTime;
+ changed = true;
+ }
+
+ if (isNaN(this._endTime) || this._endTime < record.endTime) {
+ this._endTime = record.endTime;
+ changed = true;
+ }
+
+ if (changed)
+ this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated);
+ },
+
+ _recordUpdated: function(event)
+ {
+ this._updateTimesIfNeeded(event.target);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineMarkerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineMarkerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineMarker.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineMarker = function(time, type)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(type);
+
+ this._time = time || 0;
+ this._type = type;
+};
+
+WebInspector.TimelineMarker.Event = {
+ TimeChanged: "timeline-marker-time-changed"
+};
+
+WebInspector.TimelineMarker.Type = {
+ CurrentTime: "current-time",
+ LoadEvent: "load-event",
+ DOMContentEvent: "dom-content-event",
+ TimeStamp: "timestamp"
+};
+
+WebInspector.TimelineMarker.prototype = {
+ constructor: WebInspector.TimelineMarker,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get time()
+ {
+ return this._time;
+ },
+
+ set time(x)
+ {
+ if (this._time === x)
+ return;
+
+ this._time = x || 0;
+
+ this.dispatchEventToListeners(WebInspector.TimelineMarker.Event.TimeChanged);
+ },
+
+ get type()
+ {
+ return this._type;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRecordjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRecord.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,150 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecord = function(type, startTime, endTime, callFrames, sourceCodeLocation)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(type);
+
+ if (type in WebInspector.TimelineRecord.Type)
+ type = WebInspector.TimelineRecord.Type[type];
+
+ this._type = type;
+ this._startTime = startTime || NaN;
+ this._endTime = endTime || NaN;
+ this._callFrames = callFrames || null;
+ this._sourceCodeLocation = sourceCodeLocation || null;
+};
+
+WebInspector.TimelineRecord.Event = {
+ Updated: "timeline-record-updated"
+};
+
+WebInspector.TimelineRecord.Type = {
+ Network: "timeline-record-type-network",
+ Layout: "timeline-record-type-layout",
+ Script: "timeline-record-type-script"
+};
+
+WebInspector.TimelineRecord.TypeIdentifier = "timeline-record";
+WebInspector.TimelineRecord.SourceCodeURLCookieKey = "timeline-record-source-code-url";
+WebInspector.TimelineRecord.SourceCodeLocationLineCookieKey = "timeline-record-source-code-location-line";
+WebInspector.TimelineRecord.SourceCodeLocationColumnCookieKey = "timeline-record-source-code-location-column";
+WebInspector.TimelineRecord.TypeCookieKey = "timeline-record-type";
+
+WebInspector.TimelineRecord.prototype = {
+ constructor: WebInspector.TimelineRecord,
+
+ // Public
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get startTime()
+ {
+ // Implemented by subclasses if needed.
+ return this._startTime;
+ },
+
+ get activeStartTime()
+ {
+ // Implemented by subclasses if needed.
+ return this._startTime;
+ },
+
+ get endTime()
+ {
+ // Implemented by subclasses if needed.
+ return this._endTime;
+ },
+
+ get duration()
+ {
+ // Use the getters instead of the properties so this works for subclasses that override the getters.
+ return this.endTime - this.startTime;
+ },
+
+ get inactiveDuration()
+ {
+ // Use the getters instead of the properties so this works for subclasses that override the getters.
+ return this.activeStartTime - this.startTime;
+ },
+
+ get activeDuration()
+ {
+ // Use the getters instead of the properties so this works for subclasses that override the getters.
+ return this.endTime - this.activeStartTime;
+ },
+
+ get updatesDynamically()
+ {
+ // Implemented by subclasses if needed.
+ return false;
+ },
+
+ get usesActiveStartTime()
+ {
+ // Implemented by subclasses if needed.
+ return false;
+ },
+
+ get callFrames()
+ {
+ return this._callFrames;
+ },
+
+ get initiatorCallFrame()
+ {
+ if (!this._callFrames || !this._callFrames.length)
+ return null;
+
+ // Return the first non-native code call frame as the initiator.
+ for (var i = 0; i < this._callFrames.length; ++i) {
+ if (this._callFrames[i].nativeCode)
+ continue;
+ return this._callFrames[i];
+ }
+
+ return null;
+ },
+
+ get sourceCodeLocation()
+ {
+ return this._sourceCodeLocation;
+ },
+
+ saveIdentityToCookie: function(cookie)
+ {
+ cookie[WebInspector.TimelineRecord.SourceCodeURLCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url ? this._sourceCodeLocation.sourceCode.url.hash : null : null;
+ cookie[WebInspector.TimelineRecord.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
+ cookie[WebInspector.TimelineRecord.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
+ cookie[WebInspector.TimelineRecord.TypeCookieKey] = this._type || null;
+ }
+};
+
+WebInspector.TimelineRecord.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRecordingjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRecording.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecording = function()
+{
+ WebInspector.Object.call(this);
+
+ this._timelines = new Map;
+ this._timelines.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimeline);
+ this._timelines.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.Timeline);
+ this._timelines.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.Timeline);
+
+ for (var timeline of this._timelines.values())
+ timeline.addEventListener(WebInspector.Timeline.Event.TimesUpdated, this._timelineTimesUpdated, this);
+
+ this.reset(true);
+};
+
+WebInspector.TimelineRecording.Event = {
+ Reset: "timeline-recording-reset",
+ SourceCodeTimelineAdded: "timeline-recording-source-code-timeline-added",
+ TimesUpdated: "timeline-recording-times-updated"
+};
+
+WebInspector.TimelineRecording.prototype = {
+ constructor: WebInspector.TimelineRecording,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get timelines()
+ {
+ return this._timelines;
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ reset: function(suppressEvents)
+ {
+ this._sourceCodeTimelinesMap = new Map;
+ this._eventMarkers = [];
+ this._startTime = NaN;
+ this._endTime = NaN;
+
+ for (var timeline of this._timelines.values())
+ timeline.reset(suppressEvents);
+
+ if (!suppressEvents) {
+ this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Reset);
+ this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated);
+ }
+ },
+
+ sourceCodeTimelinesForSourceCode: function(sourceCode)
+ {
+ var timelines = this._sourceCodeTimelinesMap.get(sourceCode);
+ if (!timelines)
+ return [];
+ return timelines.values();
+ },
+
+ addEventMarker: function(eventMarker)
+ {
+ this._eventMarkers.push(eventMarker);
+ },
+
+ addRecord: function(record)
+ {
+ // Add the record to the global timeline by type.
+ this._timelines.get(record.type).addRecord(record);
+
+ // Netowrk records don't have source code timelines.
+ if (record.type === WebInspector.TimelineRecord.Type.Network)
+ return;
+
+ // Add the record to the source code timelines.
+ var activeMainResource = WebInspector.frameResourceManager.mainFrame.provisionalMainResource || WebInspector.frameResourceManager.mainFrame.mainResource;
+ var sourceCode = record.sourceCodeLocation ? record.sourceCodeLocation.sourceCode : activeMainResource;
+
+ var sourceCodeTimelines = this._sourceCodeTimelinesMap.get(sourceCode);
+ if (!sourceCodeTimelines) {
+ sourceCodeTimelines = new Map;
+ this._sourceCodeTimelinesMap.set(sourceCode, sourceCodeTimelines);
+ }
+
+ var newTimeline = false;
+ var key = this._keyForRecord(record);
+ var sourceCodeTimeline = sourceCodeTimelines.get(key);
+ if (!sourceCodeTimeline) {
+ sourceCodeTimeline = new WebInspector.SourceCodeTimeline(sourceCode, record.sourceCodeLocation, record.type, record.eventType);
+ sourceCodeTimelines.set(key, sourceCodeTimeline);
+ newTimeline = true;
+ }
+
+ sourceCodeTimeline.addRecord(record);
+
+ if (newTimeline)
+ this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.SourceCodeTimelineAdded, {sourceCodeTimeline: sourceCodeTimeline});
+ },
+
+ // Private
+
+ _keyForRecord: function(record)
+ {
+ var key = record.type;
+ if (record instanceof WebInspector.ScriptTimelineRecord || record instanceof WebInspector.LayoutTimelineRecord)
+ key += ":" + record.eventType;
+ if (record instanceof WebInspector.ScriptTimelineRecord && record.eventType === WebInspector.ScriptTimelineRecord.EventType.EventDispatched)
+ key += ":" + record.details;
+ if (record.sourceCodeLocation)
+ key += ":" + record.sourceCodeLocation.lineNumber + ":" + record.sourceCodeLocation.columnNumber;
+ return key;
+ },
+
+ _timelineTimesUpdated: function(event)
+ {
+ var timeline = event.target;
+ var changed = false;
+
+ if (isNaN(this._startTime) || timeline.startTime < this._startTime) {
+ this._startTime = timeline.startTime;
+ changed = true;
+ }
+
+ if (isNaN(this._endTime) || this._endTime < timeline.endTime) {
+ this._endTime = timeline.endTime;
+ changed = true;
+ }
+
+ if (changed)
+ this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsUnitBezierjsfromrev164541trunkSourceWebInspectorUIUserInterfaceUnitBezierjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/UnitBezier.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/UnitBezier.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/UnitBezier.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/UnitBezier.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.UnitBezier = function(x1, y1, x2, y2)
+{
+ WebInspector.Object.call(this);
+
+ // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
+ this._cx = 3.0 * x1;
+ this._bx = 3.0 * (x2 - x1) - this._cx;
+ this._ax = 1.0 - this._cx - this._bx;
+
+ this._cy = 3.0 * y1;
+ this._by = 3.0 * (y2 - y1) - this._cy;
+ this._ay = 1.0 - this._cy - this._by;
+};
+
+WebInspector.UnitBezier.prototype = {
+ constructor: WebInspector.UnitBezier,
+
+ // Public
+
+ solve: function(x, epsilon)
+ {
+ return this._sampleCurveY(this._solveCurveX(x, epsilon));
+ },
+
+ // Private
+
+ _sampleCurveX: function(t)
+ {
+ // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
+ return ((this._ax * t + this._bx) * t + this._cx) * t;
+ },
+
+ _sampleCurveY: function(t)
+ {
+ return ((this._ay * t + this._by) * t + this._cy) * t;
+ },
+
+ _sampleCurveDerivativeX: function(t)
+ {
+ return (3.0 * this._ax * t + 2.0 * this._bx) * t + this._cx;
+ },
+
+ // Given an x value, find a parametric value it came from.
+ _solveCurveX: function(x, epsilon)
+ {
+ var t0, t1, t2, x2, d2, i;
+
+ // First try a few iterations of Newton's method -- normally very fast.
+ for (t2 = x, i = 0; i < 8; i++) {
+ x2 = this._sampleCurveX(t2) - x;
+ if (Math.abs(x2) < epsilon)
+ return t2;
+ d2 = this._sampleCurveDerivativeX(t2);
+ if (Math.abs(d2) < 1e-6)
+ break;
+ t2 = t2 - x2 / d2;
+ }
+
+ // Fall back to the bisection method for reliability.
+ t0 = 0.0;
+ t1 = 1.0;
+ t2 = x;
+
+ if (t2 < t0)
+ return t0;
+ if (t2 > t1)
+ return t1;
+
+ while (t0 < t1) {
+ x2 = this._sampleCurveX(t2);
+ if (Math.abs(x2 - x) < epsilon)
+ return t2;
+ if (x > x2)
+ t0 = t2;
+ else
+ t1 = t2;
+ t2 = (t1 - t0) * 0.5 + t0;
+ }
+
+ // Failure.
+ return t2;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNavigationBarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NavigationBar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NavigationBar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NavigationBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.navigation-bar {
- display: -webkit-flex;
- -webkit-justify-content: center;
- -webkit-flex-wrap: wrap;
-
- box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
- border-bottom: 1px solid rgb(179, 179, 179);
-
- height: 22px;
-
- white-space: nowrap;
- overflow: hidden;
-
- outline: none;
-}
-
-.navigation-bar .item {
- display: -webkit-flex;
- -webkit-align-items: center;
- -webkit-flex-wrap: wrap;
-
- height: 21px;
- outline: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNavigationBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NavigationBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NavigationBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NavigationBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,451 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationBar = function(element, navigationItems, role, label) {
- WebInspector.Object.call(this);
-
- this._element = element || document.createElement("div");
- this._element.classList.add(this.constructor.StyleClassName || WebInspector.NavigationBar.StyleClassName);
- this._element.tabIndex = 0;
-
- if (role)
- this._element.setAttribute("role", role);
- if (label)
- this._element.setAttribute("aria-label", label);
-
- this._element.addEventListener("focus", this._focus.bind(this), false);
- this._element.addEventListener("blur", this._blur.bind(this), false);
- this._element.addEventListener("keydown", this._keyDown.bind(this), false);
- this._element.addEventListener("mousedown", this._mouseDown.bind(this), false);
-
- document.addEventListener("load", this.updateLayout.bind(this), false);
-
- this._styleElement = document.createElement("style");
-
- this._navigationItems = [];
-
- if (navigationItems) {
- for (var i = 0; i < navigationItems.length; ++i)
- this.addNavigationItem(navigationItems[i]);
- }
-
- document.head.appendChild(this._styleElement);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.NavigationBar);
-
-WebInspector.NavigationBar.StyleClassName = "navigation-bar";
-WebInspector.NavigationBar.CollapsedStyleClassName = "collapsed";
-
-WebInspector.NavigationBar.Event = {
- NavigationItemSelected: "navigation-bar-navigation-item-selected"
-};
-
-WebInspector.NavigationBar.prototype = {
- constructor: WebInspector.NavigationBar,
-
- // Public
-
- addNavigationItem: function(navigationItem, parentElement)
- {
- return this.insertNavigationItem(navigationItem, this._navigationItems.length, parentElement);
- },
-
- insertNavigationItem: function(navigationItem, index, parentElement)
- {
- console.assert(navigationItem instanceof WebInspector.NavigationItem);
- if (!(navigationItem instanceof WebInspector.NavigationItem))
- return;
-
- if (navigationItem.parentNavigationBar)
- navigationItem.parentNavigationBar.removeNavigationItem(navigationItem);
-
- navigationItem._parentNavigationBar = this;
-
- console.assert(index >= 0 && index <= this._navigationItems.length);
- index = Math.max(0, Math.min(index, this._navigationItems.length));
-
- this._navigationItems.splice(index, 0, navigationItem);
-
- if (!parentElement)
- parentElement = this._element;
-
- var nextSibling = this._navigationItems[index + 1];
- var nextSiblingElement = nextSibling ? nextSibling.element : null;
- if (nextSiblingElement && nextSiblingElement.parentNode !== parentElement)
- nextSiblingElement = null;
-
- parentElement.insertBefore(navigationItem.element, nextSiblingElement);
-
- this._minimumWidthNeedsRecalculation = true;
- this._needsStyleUpdated = true;
-
- this.updateLayoutSoon();
-
- return navigationItem;
- },
-
- removeNavigationItem: function(navigationItemOrIdentifierOrIndex, index)
- {
- var navigationItem = this._findNavigationItem(navigationItemOrIdentifierOrIndex);
- if (!navigationItem)
- return;
-
- navigationItem._parentNavigationBar = null;
-
- if (this._selectedNavigationItem === navigationItem)
- this.selectedNavigationItem = null;
-
- this._navigationItems.remove(navigationItem);
- navigationItem.element.remove();
-
- this._minimumWidthNeedsRecalculation = true;
- this._needsStyleUpdated = true;
-
- this.updateLayoutSoon();
-
- return navigationItem;
- },
-
- updateLayoutSoon: function()
- {
- if (this._updateLayoutTimeout)
- return;
-
- this._needsLayout = true;
-
- function update()
- {
- delete this._updateLayoutTimeout;
-
- if (this._needsLayout || this._needsStyleUpdated)
- this.updateLayout();
- }
-
- this._updateLayoutTimeout = setTimeout(update.bind(this), 0);
- },
-
- updateLayout: function()
- {
- if (this._updateLayoutTimeout) {
- clearTimeout(this._updateLayoutTimeout);
- delete this._updateLayoutTimeout;
- }
-
- if (this._needsStyleUpdated)
- this._updateStyle();
-
- this._needsLayout = false;
-
- if (typeof this.customUpdateLayout === "function") {
- this.customUpdateLayout();
- return;
- }
-
- // Remove the collapsed style class to test if the items can fit at full width.
- this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- // Tell each navigation item to update to full width if needed.
- for (var i = 0; i < this._navigationItems.length; ++i)
- this._navigationItems[i].updateLayout(true);
-
- var totalItemWidth = 0;
- for (var i = 0; i < this._navigationItems.length; ++i) {
- // Skip flexible space items since they can take up no space at the minimum width.
- if (this._navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
- continue;
-
- totalItemWidth += this._navigationItems[i].element.offsetWidth;
- }
-
- var barWidth = this._element.offsetWidth;
-
- // Add the collapsed class back if the items are wider than the bar.
- if (totalItemWidth > barWidth)
- this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- // Give each navigation item the opportunity to collapse further.
- for (var i = 0; i < this._navigationItems.length; ++i)
- this._navigationItems[i].updateLayout();
- },
-
- get selectedNavigationItem()
- {
- return this._selectedNavigationItem || null;
- },
-
- set selectedNavigationItem(navigationItemOrIdentifierOrIndex)
- {
- var navigationItem = this._findNavigationItem(navigationItemOrIdentifierOrIndex);
-
- // Only radio navigation items can be selected.
- if (!(navigationItem instanceof WebInspector.RadioButtonNavigationItem))
- navigationItem = null;
-
- if (this._selectedNavigationItem === navigationItem)
- return;
-
- if (this._selectedNavigationItem)
- this._selectedNavigationItem.selected = false;
-
- this._selectedNavigationItem = navigationItem || null;
-
- if (this._selectedNavigationItem)
- this._selectedNavigationItem.selected = true;
-
- // When the mouse is down don't dispatch the selected event, it will be dispatched on mouse up.
- // This prevents sending the event while the user is scrubbing the bar.
- if (!this._mouseIsDown)
- this.dispatchEventToListeners(WebInspector.NavigationBar.Event.NavigationItemSelected);
- },
-
- get navigationItems()
- {
- return this._navigationItems;
- },
-
- get element()
- {
- return this._element;
- },
-
- get minimumWidth()
- {
- if (typeof this._minimumWidth === "undefined" || this._minimumWidthNeedsRecalculation) {
- this._minimumWidth = this._calculateMinimumWidth();
- delete this._minimumWidthNeedsRecalculation;
- }
-
- return this._minimumWidth;
- },
-
- get sizesToFit()
- {
- // Can be overriden by subclasses.
- return false;
- },
-
- // Private
-
- _findNavigationItem: function(navigationItemOrIdentifierOrIndex)
- {
- var navigationItem = null;
-
- if (navigationItemOrIdentifierOrIndex instanceof WebInspector.NavigationItem) {
- if (this._navigationItems.contains(navigationItemOrIdentifierOrIndex))
- navigationItem = navigationItemOrIdentifierOrIndex;
- } else if (typeof navigationItemOrIdentifierOrIndex === "number") {
- navigationItem = this._navigationItems[navigationItemOrIdentifierOrIndex];
- } else if (typeof navigationItemOrIdentifierOrIndex === "string") {
- for (var i = 0; i < this._navigationItems.length; ++i) {
- if (this._navigationItems[i].identifier === navigationItemOrIdentifierOrIndex) {
- navigationItem = this._navigationItems[i];
- break;
- }
- }
- }
-
- return navigationItem;
- },
-
- _mouseDown: function(event)
- {
- // Only handle left mouse clicks.
- if (event.button !== 0)
- return;
-
- // Remove the tabIndex so clicking the navigation bar does not give it focus.
- // Only keep the tabIndex if already focused from keyboard navigation. This matches Xcode.
- if (!this._focused)
- this._element.removeAttribute("tabindex");
-
- var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
- if (!itemElement || !itemElement.navigationItem)
- return;
-
- this._previousSelectedNavigationItem = this.selectedNavigationItem;
- this.selectedNavigationItem = itemElement.navigationItem;
-
- this._mouseIsDown = true;
-
- this._mouseMovedEventListener = this._mouseMoved.bind(this);
- this._mouseUpEventListener = this._mouseUp.bind(this);
-
- // Register these listeners on the document so we can track the mouse if it leaves the resizer.
- document.addEventListener("mousemove", this._mouseMovedEventListener, false);
- document.addEventListener("mouseup", this._mouseUpEventListener, false);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _mouseMoved: function(event)
- {
- console.assert(event.button === 0);
- console.assert(this._mouseIsDown);
- if (!this._mouseIsDown)
- return;
-
- event.preventDefault();
- event.stopPropagation();
-
- var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
- if (!itemElement || !itemElement.navigationItem) {
- // Find the element that is at the X position of the mouse, even when the mouse is no longer
- // vertically in the navigation bar.
- var element = document.elementFromPoint(event.pageX, this._element.totalOffsetTop);
- if (!element)
- return;
-
- itemElement = element.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
- if (!itemElement || !itemElement.navigationItem)
- return;
- }
-
- if (this.selectedNavigationItem)
- this.selectedNavigationItem.active = false;
-
- this.selectedNavigationItem = itemElement.navigationItem;
-
- this.selectedNavigationItem.active = true;
- },
-
- _mouseUp: function(event)
- {
- console.assert(event.button === 0);
- console.assert(this._mouseIsDown);
- if (!this._mouseIsDown)
- return;
-
- if (this.selectedNavigationItem)
- this.selectedNavigationItem.active = false;
-
- this._mouseIsDown = false;
-
- document.removeEventListener("mousemove", this._mouseMovedEventListener, false);
- document.removeEventListener("mouseup", this._mouseUpEventListener, false);
-
- delete this._mouseMovedEventListener;
- delete this._mouseUpEventListener;
-
- // Restore the tabIndex so the navigation bar can be in the keyboard tab loop.
- this._element.tabIndex = 0;
-
- // Dispatch the selected event here since the selectedNavigationItem setter surpresses it
- // while the mouse is down to prevent sending it while scrubbing the bar.
- if (this._previousSelectedNavigationItem !== this.selectedNavigationItem)
- this.dispatchEventToListeners(WebInspector.NavigationBar.Event.NavigationItemSelected);
-
- delete this._previousSelectedNavigationItem;
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _keyDown: function(event)
- {
- if (!this._focused)
- return;
-
- if (event.keyIdentifier !== "Left" && event.keyIdentifier !== "Right")
- return;
-
- event.preventDefault();
- event.stopPropagation();
-
- var selectedNavigationItemIndex = this._navigationItems.indexOf(this._selectedNavigationItem);
-
- if (event.keyIdentifier === "Left") {
- if (selectedNavigationItemIndex === -1)
- selectedNavigationItemIndex = this._navigationItems.length;
-
- do {
- selectedNavigationItemIndex = Math.max(0, selectedNavigationItemIndex - 1);
- } while (selectedNavigationItemIndex && !(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem));
- } else if (event.keyIdentifier === "Right") {
- do {
- selectedNavigationItemIndex = Math.min(selectedNavigationItemIndex + 1, this._navigationItems.length - 1);
- } while (selectedNavigationItemIndex < this._navigationItems.length - 1 && !(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem));
- }
-
- if (!(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem))
- return;
-
- this.selectedNavigationItem = this._navigationItems[selectedNavigationItemIndex];
- },
-
- _focus: function(event)
- {
- this._focused = true;
- },
-
- _blur: function(event)
- {
- this._focused = false;
- },
-
- _updateStyle: function()
- {
- this._needsStyleUpdated = false;
-
- var parentSelector = "." + (this.constructor.StyleClassName || WebInspector.NavigationBar.StyleClassName);
-
- var styleText = "";
- for (var i = 0; i < this._navigationItems.length; ++i) {
- if (!this._navigationItems[i].generateStyleText)
- continue;
- if (styleText)
- styleText += "\n";
- styleText += this._navigationItems[i].generateStyleText(parentSelector);
- }
-
- this._styleElement.textContent = styleText;
- },
-
- _calculateMinimumWidth: function()
- {
- var wasCollapsed = this._element.classList.contains(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- // Add the collapsed style class to calculate the width of the items when they are collapsed.
- if (!wasCollapsed)
- this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- var totalItemWidth = 0;
- for (var i = 0; i < this._navigationItems.length; ++i) {
- // Skip flexible space items since they can take up no space at the minimum width.
- if (this._navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
- continue;
- totalItemWidth += this._navigationItems[i].element.offsetWidth;
- }
-
- // Remove the collapsed style class if we were not collapsed before.
- if (!wasCollapsed)
- this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- return totalItemWidth;
- }
-};
-
-WebInspector.NavigationBar.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,103 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationItem = function(identifier, role, label) {
- WebInspector.Object.call(this);
-
- this._identifier = identifier || null;
-
- this._element = document.createElement("div");
-
- if (role)
- this._element.setAttribute("role", role);
- if (label)
- this._element.setAttribute("aria-label", label);
-
- var classNames = this._classNames;
- for (var i = 0; i < classNames.length; ++i)
- this._element.classList.add(classNames[i]);
-
- this._element.navigationItem = this;
-};
-
-WebInspector.NavigationItem.StyleClassName = "item";
-WebInspector.NavigationItem.HiddenStyleClassName = "hidden";
-
-
-WebInspector.NavigationItem.prototype = {
- constructor: WebInspector.NavigationItem,
-
- // Public
-
- get identifier()
- {
- return this._identifier;
- },
-
- get element()
- {
- return this._element;
- },
-
- get parentNavigationBar()
- {
- return this._parentNavigationBar;
- },
-
- updateLayout: function(expandOnly)
- {
- // Implemented by subclasses.
- },
-
- get hidden()
- {
- return this._element.classList.contains(WebInspector.NavigationItem.HiddenStyleClassName);
- },
-
- set hidden(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.NavigationItem.HiddenStyleClassName);
- else
- this._element.classList.remove(WebInspector.NavigationItem.HiddenStyleClassName);
-
- if (this._parentNavigationBar)
- this._parentNavigationBar.updateLayoutSoon();
- },
-
- // Private
-
- get _classNames()
- {
- var classNames = [WebInspector.NavigationItem.StyleClassName];
- if (this._identifier)
- classNames.push(this._identifier);
- if (this._additionalClassNames instanceof Array)
- classNames = classNames.concat(this._additionalClassNames);
- return classNames;
- }
-}
-
-WebInspector.NavigationItem.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,357 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.navigation > .content {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 22px;
-
- overflow-x: hidden;
- overflow-y: auto;
-}
-
-.sidebar > .panel.navigation > .filter-bar {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
-}
-
-.sidebar > .panel.navigation > .overflow-shadow {
- position: absolute;
- bottom: 21px;
- left: 0;
- right: 0;
- height: 5px;
-
- pointer-events: none;
-
- background-image: -webkit-radial-gradient(center, ellipse closest-side, rgba(0, 0, 0, 0.2) 25%, transparent),
- -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0125), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.0125));
- background-size: 125% 15px, 100% 1px;
- background-position: top center, bottom center;
- background-repeat: no-repeat;
-
- opacity: 0;
-}
-
-.sidebar > .panel.navigation > .overflow-shadow.top {
- top: 21px;
- bottom: initial;
- background-position: bottom center, top center;
-}
-
-.sidebar > .panel.navigation > .empty-content-placeholder {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 21px;
-
- display: -webkit-flex;
-
- -webkit-justify-content: center;
- -webkit-align-items: center;
-}
-
-.sidebar > .panel.navigation > .empty-content-placeholder > .message {
- display: inline-block;
- white-space: nowrap;
-
- font-family: "Lucida Grande", sans-serif;
- font-size: 13px;
-
- color: white;
- background-color: rgba(0, 0, 0, 0.15);
- text-shadow: rgba(0, 0, 0, 0.2) 0 1px 0;
- box-shadow: inset rgba(0, 0, 0, 0.2) 0 1px 0, rgba(255, 255, 255, 0.4) 0 1px 0;
-
- border-radius: 6px;
- padding: 5px 15px 6px;
-}
-
-.navigation-sidebar-panel-content-tree-outline,
-.navigation-sidebar-panel-content-tree-outline .children {
- position: relative;
-
- padding: 0;
- margin: 0;
-
- outline: none;
-
- list-style: none;
-
- font-family: "Lucida Grande", "Helvetica", sans-serif;
- font-size: 11px;
-}
-
-.navigation-sidebar-panel-content-tree-outline .children {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline .children.expanded {
- display: block;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item {
- position: relative;
-
- height: 36px;
- line-height: 34px;
-
- /* The item depth padding style rules are generated by NavigationSidebarPanel.js.
- Any changes to this padding needs to be changed there too. */
-
- padding: 0 5px;
-
- border-top: 1px solid transparent;
-
- white-space: nowrap;
-}
-
-.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons > .children {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline > .children.hide-disclosure-buttons > .children {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) .icon {
- margin-left: 16px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons .item.small {
- padding-left: 8px;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .disclosure-button {
- display: none;
-
- float: left;
-
- width: 16px;
- height: 100%;
-
- border: 0;
-
- background-color: transparent;
- background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-closed-normal);
- background-repeat: no-repeat;
- background-position: center;
- background-size: 13px 13px;
-
- -webkit-appearance: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons .item .disclosure-button {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.parent .disclosure-button {
- display: block;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.selected .disclosure-button {
- background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-closed-selected) !important;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.expanded .disclosure-button {
- background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-normal);
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.selected.expanded .disclosure-button {
- background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-selected) !important;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .icon {
- float: left;
- position: relative;
-
- width: 32px;
- height: 32px;
-
- margin-top: 1px;
- margin-right: 3px;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .status {
- float: right;
-
- height: 16px;
-
- margin-top: 9px;
- margin-left: 4px;
-
- line-height: 1em;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .status:empty {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.selected {
- color: white;
-
- border-top: 1px solid rgb(162, 177, 201);
-
- background-image: -webkit-linear-gradient(top, rgb(175, 190, 213), rgb(130, 151, 182));
- background-origin: padding;
- background-clip: padding;
-}
-
-.navigation-sidebar-panel-content-tree-outline:focus .item.selected {
- border-top: 1px solid rgb(148, 174, 193);
- background-image: -webkit-linear-gradient(top, rgb(154, 180, 203), rgb(112, 139, 176));
-}
-
-body.window-inactive .navigation-sidebar-panel-content-tree-outline .item.selected {
- border-top: 1px solid rgb(168, 168, 168);
- background-image: -webkit-linear-gradient(top, rgb(194, 194, 194), rgb(158, 158, 158));
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .titles {
- position: relative;
- top: 5px;
-
- line-height: 11px;
-
- padding-bottom: 1px;
-
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .highlighted {
- background-color: rgba(235, 215, 38, 0.2);
- border-bottom: 1px solid rgb(237, 202, 71);
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .titles.no-subtitle {
- top: 10px;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .title::after {
- content: "\A"; /* Newline */
- white-space: pre;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .subtitle {
- font-size: 9px;
- color: rgba(0, 0, 0, 0.7);
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.selected .subtitle {
- color: rgba(255, 255, 255, 0.9);
-}
-
-.navigation-sidebar-panel-content-tree-outline .item .titles.no-subtitle .subtitle,
-.navigation-sidebar-panel-content-tree-outline .item .subtitle:empty {
- display: none;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item,
-.navigation-sidebar-panel-content-tree-outline .children.small .item,
-.navigation-sidebar-panel-content-tree-outline .item.small {
- height: 20px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small.two-line .item,
-.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item,
-.navigation-sidebar-panel-content-tree-outline .item.small.two-line {
- height: 26px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item .icon,
-.navigation-sidebar-panel-content-tree-outline .children.small .item .icon,
-.navigation-sidebar-panel-content-tree-outline .item.small .icon {
- width: 16px;
- height: 16px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item .status,
-.navigation-sidebar-panel-content-tree-outline .children.small .item .status,
-.navigation-sidebar-panel-content-tree-outline .item.small .status {
- margin-top: 1px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item .status .indeterminate-progress-spinner,
-.navigation-sidebar-panel-content-tree-outline .children.small .item .status .indeterminate-progress-spinner,
-.navigation-sidebar-panel-content-tree-outline .item.small .status .indeterminate-progress-spinner {
- margin-top: 1px;
- width: 14px;
- height: 14px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item .titles,
-.navigation-sidebar-panel-content-tree-outline .children.small .item .titles,
-.navigation-sidebar-panel-content-tree-outline .item.small .titles {
- top: 2px;
- line-height: normal;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small.two-line .item .status,
-.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .status,
-.navigation-sidebar-panel-content-tree-outline .item.small.two-line .status {
- margin-top: 4px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small.two-line .item .titles,
-.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .titles,
-.navigation-sidebar-panel-content-tree-outline .item.small.two-line .titles {
- top: 0;
- line-height: 11px;
-}
-
-.navigation-sidebar-panel-content-tree-outline .item.small.two-line .titles.no-subtitle {
- top: 6px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small .item .subtitle,
-.navigation-sidebar-panel-content-tree-outline .children.small .item .subtitle,
-.navigation-sidebar-panel-content-tree-outline .item.small .subtitle {
- font-size: inherit;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small.two-line .item .icon,
-.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .icon,
-.navigation-sidebar-panel-content-tree-outline .item.small.two-line .icon {
- margin-top: 4px;
-}
-
-.navigation-sidebar-panel-content-tree-outline.small:not(.two-line) .item .title::after,
-.navigation-sidebar-panel-content-tree-outline .children.small:not(.two-line) .item .title::after,
-.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .title::after {
- content: "";
-}
-
-.navigation-sidebar-panel-content-tree-outline.small:not(.two-line) .item .subtitle::before,
-.navigation-sidebar-panel-content-tree-outline .children.small:not(.two-line) .item .subtitle::before,
-.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .subtitle::before {
- content: " — ";
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,701 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationSidebarPanel = function(identifier, displayName, image, keyboardShortcutKey, autoPruneOldTopLevelResourceTreeElements, autoHideToolbarItemWhenEmpty, wantsTopOverflowShadow, element, role, label) {
- if (keyboardShortcutKey)
- this._keyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, keyboardShortcutKey, this.toggle.bind(this));
-
- if (this._keyboardShortcut) {
- var showToolTip = WebInspector.UIString("Show the %s navigation sidebar (%s)").format(displayName, this._keyboardShortcut.displayName);
- var hideToolTip = WebInspector.UIString("Hide the %s navigation sidebar (%s)").format(displayName, this._keyboardShortcut.displayName);
- } else {
- var showToolTip = WebInspector.UIString("Show the %s navigation sidebar").format(displayName);
- var hideToolTip = WebInspector.UIString("Hide the %s navigation sidebar").format(displayName);
- }
-
- WebInspector.SidebarPanel.call(this, identifier, displayName, showToolTip, hideToolTip, image, element, role, label || displayName);
-
- this.element.classList.add(WebInspector.NavigationSidebarPanel.StyleClassName);
-
- this._autoHideToolbarItemWhenEmpty = autoHideToolbarItemWhenEmpty || false;
-
- if (autoHideToolbarItemWhenEmpty)
- this.toolbarItem.hidden = true;
-
- this._visibleContentTreeOutlines = new Set;
-
- this._contentElement = document.createElement("div");
- this._contentElement.className = WebInspector.NavigationSidebarPanel.ContentElementStyleClassName;
- this._contentElement.addEventListener("scroll", this._updateContentOverflowShadowVisibility.bind(this));
- this.element.appendChild(this._contentElement);
-
- this._contentTreeOutline = this.createContentTreeOutline(true);
-
- this._filterBar = new WebInspector.FilterBar();
- this._filterBar.addEventListener(WebInspector.FilterBar.Event.TextFilterDidChange, this._textFilterDidChange, this);
- this.element.appendChild(this._filterBar.element);
-
- this._bottomOverflowShadowElement = document.createElement("div");
- this._bottomOverflowShadowElement.className = WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName;
- this.element.appendChild(this._bottomOverflowShadowElement);
-
- if (wantsTopOverflowShadow) {
- this._topOverflowShadowElement = document.createElement("div");
- this._topOverflowShadowElement.classList.add(WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName);
- this._topOverflowShadowElement.classList.add(WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName);
- this.element.appendChild(this._topOverflowShadowElement);
- }
-
- window.addEventListener("resize", this._updateContentOverflowShadowVisibility.bind(this));
-
- this._filtersSetting = new WebInspector.Setting(identifier + "-navigation-sidebar-filters", {});
- this._filterBar.filters = this._filtersSetting.value;
-
- this._emptyContentPlaceholderElement = document.createElement("div");
- this._emptyContentPlaceholderElement.className = WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName;
-
- this._emptyContentPlaceholderMessageElement = document.createElement("div");
- this._emptyContentPlaceholderMessageElement.className = WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName;
- this._emptyContentPlaceholderElement.appendChild(this._emptyContentPlaceholderMessageElement);
-
- this._generateStyleRulesIfNeeded();
- this._generateDisclosureTrianglesIfNeeded();
-
- if (autoPruneOldTopLevelResourceTreeElements) {
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._checkForOldResources, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._checkForOldResources, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved, this._checkForOldResources, this);
- }
-};
-
-WebInspector.NavigationSidebarPanel.StyleClassName = "navigation";
-WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = "overflow-shadow";
-WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName = "top";
-WebInspector.NavigationSidebarPanel.ContentElementStyleClassName = "content";
-WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName = "hidden";
-WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName = "navigation-sidebar-panel-content-tree-outline";
-WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName = "hide-disclosure-buttons";
-WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName = "empty-content-placeholder";
-WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName = "message";
-WebInspector.NavigationSidebarPanel.DisclosureTriangleOpenCanvasIdentifier = "navigation-sidebar-panel-disclosure-triangle-open";
-WebInspector.NavigationSidebarPanel.DisclosureTriangleClosedCanvasIdentifier = "navigation-sidebar-panel-disclosure-triangle-closed";
-WebInspector.NavigationSidebarPanel.DisclosureTriangleNormalCanvasIdentifierSuffix = "-normal";
-WebInspector.NavigationSidebarPanel.DisclosureTriangleSelectedCanvasIdentifierSuffix = "-selected";
-
-WebInspector.NavigationSidebarPanel.prototype = {
- constructor: WebInspector.NavigationSidebarPanel,
-
- // Public
-
- get contentElement()
- {
- return this._contentElement;
- },
-
- get contentTreeOutlineElement()
- {
- return this._contentTreeOutline.element;
- },
-
- get contentTreeOutline()
- {
- return this._contentTreeOutline;
- },
-
- set contentTreeOutline(newTreeOutline)
- {
- console.assert(newTreeOutline);
- if (!newTreeOutline)
- return;
-
- if (this._contentTreeOutline)
- this._contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
-
- this._contentTreeOutline = newTreeOutline;
- this._contentTreeOutline.element.classList.remove(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
-
- this._visibleContentTreeOutlines.delete(this._contentTreeOutline);
- this._visibleContentTreeOutlines.add(newTreeOutline);
-
- this._updateFilter();
- },
-
- get contentTreeOutlineToAutoPrune()
- {
- return this._contentTreeOutline;
- },
-
- get filterBar()
- {
- return this._filterBar;
- },
-
- get restoringState()
- {
- return this._restoringState;
- },
-
- createContentTreeOutline: function(dontHideByDefault, suppressFiltering)
- {
- var contentTreeOutlineElement = document.createElement("ol");
- contentTreeOutlineElement.className = WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName;
- if (!dontHideByDefault)
- contentTreeOutlineElement.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
- this._contentElement.appendChild(contentTreeOutlineElement);
-
- var contentTreeOutline = new TreeOutline(contentTreeOutlineElement);
- contentTreeOutline.allowsRepeatSelection = true;
-
- if (!suppressFiltering) {
- contentTreeOutline.onadd = this._treeElementAddedOrChanged.bind(this);
- contentTreeOutline.onchange = this._treeElementAddedOrChanged.bind(this);
- contentTreeOutline.onexpand = this._treeElementExpandedOrCollapsed.bind(this);
- contentTreeOutline.oncollapse = this._treeElementExpandedOrCollapsed.bind(this);
- }
-
- if (dontHideByDefault)
- this._visibleContentTreeOutlines.add(contentTreeOutline);
-
- return contentTreeOutline;
- },
-
- treeElementForRepresentedObject: function(representedObject)
- {
- return this._contentTreeOutline.getCachedTreeElement(representedObject);
- },
-
- showDefaultContentView: function()
- {
- // Implemneted by subclasses if needed to show a content view when no existing tree element is selected.
- },
-
- showContentViewForCurrentSelection: function()
- {
- // Reselect the selected tree element to cause the content view to be shown as well. <rdar://problem/10854727>
- var selectedTreeElement = this._contentTreeOutline.selectedTreeElement;
- if (selectedTreeElement)
- selectedTreeElement.select();
- },
-
- saveStateToCookie: function(cookie)
- {
- console.assert(cookie);
-
- // This does not save folder selections, which lack a represented object and content view.
- var selectedTreeElement = null;
- this._visibleContentTreeOutlines.forEach(function(outline) {
- if (outline.selectedTreeElement)
- selectedTreeElement = outline.selectedTreeElement;
- });
-
- if (!selectedTreeElement)
- return;
-
- if (this._isTreeElementWithoutRepresentedObject(selectedTreeElement))
- return;
-
- var representedObject = selectedTreeElement.representedObject;
- cookie[WebInspector.TypeIdentifierCookieKey] = representedObject.constructor.TypeIdentifier;
-
- if (representedObject.saveIdentityToCookie)
- representedObject.saveIdentityToCookie(cookie);
- else
- console.error("Error: TreeElement.representedObject is missing a saveIdentityToCookie implementation. TreeElement.constructor: %s", selectedTreeElement.constructor);
- },
-
- // This can be supplemented by subclasses that admit a simpler strategy for static tree elements.
- restoreStateFromCookie: function(cookie, relaxedMatchDelay)
- {
- this._pendingViewStateCookie = cookie;
- this._restoringState = true;
-
- // Check if any existing tree elements in any outline match the cookie.
- this._checkOutlinesForPendingViewStateCookie();
-
- if (this._finalAttemptToRestoreViewStateTimeout)
- clearTimeout(this._finalAttemptToRestoreViewStateTimeout);
-
- function finalAttemptToRestoreViewStateFromCookie()
- {
- delete this._finalAttemptToRestoreViewStateTimeout;
-
- this._checkOutlinesForPendingViewStateCookie(true);
-
- delete this._pendingViewStateCookie;
- delete this._restoringState;
- }
-
- // If the specific tree element wasn't found, we may need to wait for the resources
- // to be registered. We try one last time (match type only) after an arbitrary amount of timeout.
- this._finalAttemptToRestoreViewStateTimeout = setTimeout(finalAttemptToRestoreViewStateFromCookie.bind(this), relaxedMatchDelay);
- },
-
- showEmptyContentPlaceholder: function(message, hideToolbarItem)
- {
- console.assert(message);
-
- this._emptyContentPlaceholderMessageElement.textContent = message;
- this.element.appendChild(this._emptyContentPlaceholderElement);
-
- this._hideToolbarItemWhenEmpty = hideToolbarItem || false;
- this._updateToolbarItemVisibility();
- this._updateContentOverflowShadowVisibility();
- },
-
- hideEmptyContentPlaceholder: function()
- {
- if (this._emptyContentPlaceholderElement.parentNode)
- this._emptyContentPlaceholderElement.parentNode.removeChild(this._emptyContentPlaceholderElement);
-
- this._hideToolbarItemWhenEmpty = false;
- this._updateToolbarItemVisibility();
- this._updateContentOverflowShadowVisibility();
- },
-
- updateEmptyContentPlaceholder: function(message)
- {
- this._updateToolbarItemVisibility();
-
- if (!this._contentTreeOutline.children.length) {
- // No tree elements, so no results.
- this.showEmptyContentPlaceholder(message);
- } else if (!this._emptyFilterResults) {
- // There are tree elements, and not all of them are hidden by the filter.
- this.hideEmptyContentPlaceholder();
- }
- },
-
- updateCustomContentOverflow: function()
- {
- // Implemented by subclasses if needed.
- },
-
- updateFilter: function()
- {
- this._updateFilter();
- },
-
- hasCustomFilters: function()
- {
- // Implemented by subclasses if needed.
- return false;
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- // Implemented by subclasses if needed.
- return true;
- },
-
- applyFiltersToTreeElement: function(treeElement)
- {
- if (!this._filterBar.hasActiveFilters() && !this.hasCustomFilters()) {
- // No filters, so make everything visible.
- treeElement.hidden = false;
-
- // If this tree element was expanded during filtering, collapse it again.
- if (treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
- delete treeElement.__wasExpandedDuringFiltering;
- treeElement.collapse();
- }
-
- return;
- }
-
- var filterableData = treeElement.filterableData || {};
-
- var matchedBuiltInFilters = false;
-
- var self = this;
- function matchTextFilter(inputs)
- {
- if (!inputs || !self._textFilterRegex)
- return true;
-
- // Convert to a single item array if needed.
- if (!(inputs instanceof Array))
- inputs = [inputs];
-
- // Loop over all the inputs and try to match them.
- for (var input of inputs) {
- if (!input)
- continue;
- if (self._textFilterRegex.test(input)) {
- matchedBuiltInFilters = true;
- return true;
- }
- }
-
- // No inputs matched.
- return false;
- }
-
- function makeVisible()
- {
- // Make this element visible.
- treeElement.hidden = false;
-
- // Make the ancestors visible and expand them.
- var currentAncestor = treeElement.parent;
- while (currentAncestor && !currentAncestor.root) {
- currentAncestor.hidden = false;
-
- // Only expand if the built-in filters matched, not custom filters.
- if (matchedBuiltInFilters && !currentAncestor.expanded) {
- currentAncestor.__wasExpandedDuringFiltering = true;
- currentAncestor.expand();
- }
-
- currentAncestor = currentAncestor.parent;
- }
- }
-
- if (matchTextFilter(filterableData.text) && this.matchTreeElementAgainstCustomFilters(treeElement)) {
- // Make this element visible since it matches.
- makeVisible();
-
- // If this tree element didn't match a built-in filter and was expanded earlier during filtering, collapse it again.
- if (!matchedBuiltInFilters && treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
- delete treeElement.__wasExpandedDuringFiltering;
- treeElement.collapse();
- }
-
- return;
- }
-
- // Make this element invisible since it does not match.
- treeElement.hidden = true;
- },
-
- show: function()
- {
- if (!this.parentSidebar)
- return;
-
- WebInspector.SidebarPanel.prototype.show.call(this);
-
- this.contentTreeOutlineElement.focus();
- },
-
- shown: function()
- {
- WebInspector.SidebarPanel.prototype.shown.call(this);
-
- this._updateContentOverflowShadowVisibility();
-
- // Force the navigation item to be visible. This makes sure it is
- // always visible when the panel is shown.
- this.toolbarItem.hidden = false;
- },
-
- hidden: function()
- {
- WebInspector.SidebarPanel.prototype.hidden.call(this);
-
- this._updateToolbarItemVisibility();
- },
-
- // Private
-
- _updateContentOverflowShadowVisibility: function()
- {
- this.updateCustomContentOverflow();
-
- var scrollHeight = this._contentElement.scrollHeight;
- var offsetHeight = this._contentElement.offsetHeight;
-
- if (scrollHeight < offsetHeight) {
- if (this._topOverflowShadowElement)
- this._topOverflowShadowElement.style.opacity = 0;
- this._bottomOverflowShadowElement.style.opacity = 0;
- return;
- }
-
- const edgeThreshold = 10;
- var scrollTop = this._contentElement.scrollTop;
-
- var topCoverage = Math.min(scrollTop, edgeThreshold);
- var bottomCoverage = Math.max(0, (offsetHeight + scrollTop) - (scrollHeight - edgeThreshold));
-
- if (this._topOverflowShadowElement)
- this._topOverflowShadowElement.style.opacity = (topCoverage / edgeThreshold).toFixed(1);
- this._bottomOverflowShadowElement.style.opacity = (1 - (bottomCoverage / edgeThreshold)).toFixed(1);
- },
-
- _updateToolbarItemVisibility: function()
- {
- // Hide the navigation item if requested or auto-hiding and we are not visible and we are empty.
- var shouldHide = ((this._hideToolbarItemWhenEmpty || this._autoHideToolbarItemWhenEmpty) && !this.selected && !this._contentTreeOutline.children.length);
- this.toolbarItem.hidden = shouldHide;
- },
-
- _checkForEmptyFilterResults: function()
- {
- // No tree elements, so don't touch the empty content placeholder.
- if (!this._contentTreeOutline.children.length)
- return;
-
- // Iterate over all the top level tree elements. If any are visible, return early.
- var currentTreeElement = this._contentTreeOutline.children[0];
- while (currentTreeElement) {
- if (!currentTreeElement.hidden) {
- // Not hidden, so hide any empty content message.
- this.hideEmptyContentPlaceholder();
- this._emptyFilterResults = false;
- return;
- }
-
- currentTreeElement = currentTreeElement.nextSibling;
- }
-
- // All top level tree elements are hidden, so filtering hid everything. Show a message.
- this.showEmptyContentPlaceholder(WebInspector.UIString("No Filter Results"));
- this._emptyFilterResults = true;
- },
-
- _textFilterDidChange: function()
- {
- this._updateFilter();
- },
-
- _updateFilter: function()
- {
- var filters = this._filterBar.filters;
- this._textFilterRegex = simpleGlobStringToRegExp(filters.text, "i");
- this._filtersSetting.value = filters;
-
- // Don't populate if we don't have any active filters.
- // We only need to populate when a filter needs to reveal.
- var dontPopulate = !this._filterBar.hasActiveFilters();
-
- // Update the whole tree.
- var currentTreeElement = this._contentTreeOutline.children[0];
- while (currentTreeElement && !currentTreeElement.root) {
- this.applyFiltersToTreeElement(currentTreeElement);
- currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, dontPopulate);
- }
-
- this._checkForEmptyFilterResults();
- this._updateContentOverflowShadowVisibility();
- },
-
- _treeElementAddedOrChanged: function(treeElement)
- {
- // Don't populate if we don't have any active filters.
- // We only need to populate when a filter needs to reveal.
- var dontPopulate = !this._filterBar.hasActiveFilters();
-
- // Apply the filters to the tree element and its descendants.
- var currentTreeElement = treeElement;
- while (currentTreeElement && !currentTreeElement.root) {
- this.applyFiltersToTreeElement(currentTreeElement);
- currentTreeElement = currentTreeElement.traverseNextTreeElement(false, treeElement, dontPopulate);
- }
-
- this._checkForEmptyFilterResults();
- this._updateContentOverflowShadowVisibility();
- this._checkElementsForPendingViewStateCookie(treeElement);
- },
-
- _treeElementExpandedOrCollapsed: function(treeElement)
- {
- this._updateContentOverflowShadowVisibility();
- },
-
- _generateStyleRulesIfNeeded: function()
- {
- if (WebInspector.NavigationSidebarPanel._styleElement)
- return;
-
- WebInspector.NavigationSidebarPanel._styleElement = document.createElement("style");
-
- const maximumSidebarTreeDepth = 32;
- const baseLeftPadding = 5; // Matches the padding in NavigationSidebarPanel.css for the item class. Keep in sync.
- const depthPadding = 10;
-
- var styleText = "";
- var childrenSubstring = "";
- for (var i = 1; i <= maximumSidebarTreeDepth; ++i) {
- // Keep all the elements at the same depth once the maximum is reached.
- childrenSubstring += i === maximumSidebarTreeDepth ? " .children" : " > .children";
- styleText += "." + WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName + childrenSubstring + " > .item { ";
- styleText += "padding-left: " + (baseLeftPadding + (depthPadding * i)) + "px; }\n";
- }
-
- WebInspector.NavigationSidebarPanel._styleElement.textContent = styleText;
-
- document.head.appendChild(WebInspector.NavigationSidebarPanel._styleElement);
- },
-
- _generateDisclosureTrianglesIfNeeded: function()
- {
- if (WebInspector.NavigationSidebarPanel._generatedDisclosureTriangles)
- return;
-
- // Set this early instead of in _generateDisclosureTriangle because we don't want multiple panels that are
- // created at the same time to duplicate the work (even though it would be harmless.)
- WebInspector.NavigationSidebarPanel._generatedDisclosureTriangles = true;
-
- var specifications = {};
- specifications[WebInspector.NavigationSidebarPanel.DisclosureTriangleNormalCanvasIdentifierSuffix] = {
- fillColor: [112, 126, 139],
- shadowColor: [255, 255, 255, 0.8],
- shadowOffsetX: 0,
- shadowOffsetY: 1,
- shadowBlur: 0
- };
-
- specifications[WebInspector.NavigationSidebarPanel.DisclosureTriangleSelectedCanvasIdentifierSuffix] = {
- fillColor: [255, 255, 255],
- shadowColor: [61, 91, 110, 0.8],
- shadowOffsetX: 0,
- shadowOffsetY: 1,
- shadowBlur: 2
- };
-
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, WebInspector.NavigationSidebarPanel.DisclosureTriangleOpenCanvasIdentifier);
- generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, WebInspector.NavigationSidebarPanel.DisclosureTriangleClosedCanvasIdentifier);
- },
-
- _checkForOldResources: function(event)
- {
- if (this._checkForOldResourcesTimeoutIdentifier)
- return;
-
- function delayedWork()
- {
- delete this._checkForOldResourcesTimeoutIdentifier;
-
- var contentTreeOutline = this.contentTreeOutlineToAutoPrune;
-
- // Check all the ResourceTreeElements at the top level to make sure their Resource still has a parentFrame in the frame hierarchy.
- // If the parentFrame is no longer in the frame hierarchy we know it was removed due to a navigation or some other page change and
- // we should remove the issues for that resource.
- for (var i = contentTreeOutline.children.length - 1; i >= 0; --i) {
- var treeElement = contentTreeOutline.children[i];
- if (!(treeElement instanceof WebInspector.ResourceTreeElement))
- continue;
-
- var resource = treeElement.resource;
- if (!resource.parentFrame || resource.parentFrame.isDetached())
- contentTreeOutline.removeChildAtIndex(i, true, true);
- }
-
- if (typeof this._updateEmptyContentPlaceholder === "function")
- this._updateEmptyContentPlaceholder();
- }
-
- // Check on a delay to coalesce multiple calls to _checkForOldResources.
- this._checkForOldResourcesTimeoutIdentifier = setTimeout(delayedWork.bind(this), 0);
- },
-
- _isTreeElementWithoutRepresentedObject: function(treeElement)
- {
- return treeElement instanceof WebInspector.FolderTreeElement
- || treeElement instanceof WebInspector.DatabaseHostTreeElement
- || typeof treeElement.representedObject === "string"
- || treeElement.representedObject instanceof String;
- },
-
- _checkOutlinesForPendingViewStateCookie: function(matchTypeOnly)
- {
- if (!this._pendingViewStateCookie)
- return;
-
- var visibleTreeElements = [];
- this._visibleContentTreeOutlines.forEach(function(outline) {
- var currentTreeElement = outline.hasChildren ? outline.children[0] : null;
- while (currentTreeElement) {
- visibleTreeElements.push(currentTreeElement);
- currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, false);
- }
- });
-
- return this._checkElementsForPendingViewStateCookie(visibleTreeElements, matchTypeOnly);
- },
-
- _checkElementsForPendingViewStateCookie: function(treeElements, matchTypeOnly)
- {
- if (!this._pendingViewStateCookie)
- return;
-
- var cookie = this._pendingViewStateCookie;
-
- function treeElementMatchesCookie(treeElement)
- {
- if (this._isTreeElementWithoutRepresentedObject(treeElement))
- return false;
-
- var representedObject = treeElement.representedObject;
- if (!representedObject)
- return false;
-
- var typeIdentifier = cookie[WebInspector.TypeIdentifierCookieKey];
- if (typeIdentifier !== representedObject.constructor.TypeIdentifier)
- return false;
-
- if (matchTypeOnly)
- return true;
-
- var candidateObjectCookie = {};
- if (representedObject.saveIdentityToCookie)
- representedObject.saveIdentityToCookie(candidateObjectCookie);
-
- return Object.keys(candidateObjectCookie).every(function valuesMatchForKey(key) {
- return candidateObjectCookie[key] === cookie[key];
- });
- }
-
- if (!(treeElements instanceof Array))
- treeElements = [treeElements];
-
- var matchedElement = null;
- treeElements.some(function(element) {
- if (treeElementMatchesCookie.call(this, element)) {
- matchedElement = element;
- return true;
- }
- }, this);
-
- if (matchedElement) {
- matchedElement.revealAndSelect(true, false);
-
- delete this._pendingViewStateCookie;
-
- // Delay clearing the restoringState flag until the next runloop so listeners
- // checking for it in this runloop still know state was being restored.
- setTimeout(function() {
- delete this._restoringState;
- }.bind(this));
-
- if (this._finalAttemptToRestoreViewStateTimeout) {
- clearTimeout(this._finalAttemptToRestoreViewStateTimeout);
- delete this._finalAttemptToRestoreViewStateTimeout;
- }
- }
- }
-};
-
-WebInspector.NavigationSidebarPanel.prototype.__proto__ = WebInspector.SidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.NetworkObserver.prototype = {
- constructor: WebInspector.NetworkObserver,
-
- // Events defined by the "Network" domain.
-
- requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse, type)
- {
- WebInspector.frameResourceManager.resourceRequestWillBeSent(requestId, frameId, loaderId, request, type, redirectResponse, timestamp, initiator);
- },
-
- requestServedFromCache: function(requestId)
- {
- WebInspector.frameResourceManager.markResourceRequestAsServedFromMemoryCache(requestId);
- },
-
- responseReceived: function(requestId, frameId, loaderId, timestamp, type, response)
- {
- WebInspector.frameResourceManager.resourceRequestDidReceiveResponse(requestId, frameId, loaderId, type, response, timestamp);
- },
-
- dataReceived: function(requestId, timestamp, dataLength, encodedDataLength)
- {
- WebInspector.frameResourceManager.resourceRequestDidReceiveData(requestId, dataLength, encodedDataLength, timestamp);
- },
-
- loadingFinished: function(requestId, timestamp, sourceMapURL)
- {
- WebInspector.frameResourceManager.resourceRequestDidFinishLoading(requestId, timestamp, sourceMapURL);
- },
-
- loadingFailed: function(requestId, timestamp, errorText, canceled)
- {
- WebInspector.frameResourceManager.resourceRequestDidFailLoading(requestId, canceled, timestamp);
- },
-
- requestServedFromMemoryCache: function(requestId, frameId, loaderId, documentURL, timestamp, initiator, resource)
- {
- WebInspector.frameResourceManager.resourceRequestWasServedFromMemoryCache(requestId, frameId, loaderId, resource, timestamp, initiator);
- },
-
- webSocketWillSendHandshakeRequest: function(requestId, timestamp, request)
- {
- // FIXME: Not implemented.
- },
-
- webSocketHandshakeResponseReceived: function(requestId, timestamp, response)
- {
- // FIXME: Not implemented.
- },
-
- webSocketCreated: function(requestId, url)
- {
- // FIXME: Not implemented.
- },
-
- webSocketClosed: function(requestId, timestamp)
- {
- // FIXME: Not implemented.
- }
-};
-
-WebInspector.NetworkObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkTimelinejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkTimeline.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkTimeline.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkTimeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimeline = function()
-{
- WebInspector.Timeline.call(this);
-};
-
-WebInspector.NetworkTimeline.prototype = {
- constructor: WebInspector.NetworkTimeline,
- __proto__: WebInspector.Timeline.prototype,
-
- // Public
-
- recordForResource: function(resource)
- {
- console.assert(resource instanceof WebInspector.Resource);
-
- return this._resourceRecordMap.get(resource) || null;
- },
-
- reset: function(suppressEvents)
- {
- this._resourceRecordMap = new Map;
-
- WebInspector.Timeline.prototype.reset.call(this, suppressEvents);
- },
-
- addRecord: function(record)
- {
- console.assert(record instanceof WebInspector.ResourceTimelineRecord);
-
- // Don't allow duplicate records for a resource.
- if (this._resourceRecordMap.has(record.resource))
- return;
-
- this._resourceRecordMap.set(record.resource, record);
-
- WebInspector.Timeline.prototype.addRecord.call(this, record);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-overview-graph.network {
- padding-top: 3px;
-}
-
-.timeline-overview-graph.network > .graph-row {
- height: 5px;
-}
-
-.timeline-overview-graph.network > .graph-row > .timeline-record-bar {
- height: 4px;
- margin-top: 1px;
-}
-
-.timeline-overview-graph.network > .graph-row > .timeline-record-bar > .segment:not(.inactive) {
- box-shadow: white 1px 0 0;
-}
-
-.timeline-overview-graph.network:nth-child(even) > .graph-row > .timeline-record-bar > .segment:not(.inactive) {
- box-shadow: rgb(247, 247, 247) 1px 0 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,163 +0,0 @@
</span><del>-
-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimelineOverviewGraph = function(recording)
-{
- WebInspector.TimelineOverviewGraph.call(this, recording);
-
- this.element.classList.add(WebInspector.NetworkTimelineOverviewGraph.StyleClassName);
-
- var networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
- networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
- networkTimeline.addEventListener(WebInspector.Timeline.Event.TimesUpdated, this.needsLayout, this);
-
- this.reset();
-};
-
-WebInspector.NetworkTimelineOverviewGraph.StyleClassName = "network";
-WebInspector.NetworkTimelineOverviewGraph.GraphRowStyleClassName = "graph-row";
-WebInspector.NetworkTimelineOverviewGraph.BarStyleClassName = "bar";
-WebInspector.NetworkTimelineOverviewGraph.InactiveBarStyleClassName = "inactive";
-WebInspector.NetworkTimelineOverviewGraph.UnfinishedStyleClassName = "unfinished";
-WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount = 6;
-
-WebInspector.NetworkTimelineOverviewGraph.prototype = {
- constructor: WebInspector.NetworkTimelineOverviewGraph,
- __proto__: WebInspector.TimelineOverviewGraph.prototype,
-
- // Public
-
- reset: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
-
- this._nextDumpRow = 0;
- this._timelineRecordGridRows = [];
-
- for (var i = 0; i < WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount; ++i)
- this._timelineRecordGridRows.push([]);
-
- this.element.removeChildren();
-
- for (var rowRecords of this._timelineRecordGridRows) {
- rowRecords.__element = document.createElement("div");
- rowRecords.__element.className = WebInspector.NetworkTimelineOverviewGraph.GraphRowStyleClassName;
- this.element.appendChild(rowRecords.__element);
-
- rowRecords.__recordBars = [];
- }
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
-
- var visibleWidth = this.element.offsetWidth;
- var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
-
- var recordBarIndex = 0;
-
- function createBar(rowElement, rowRecordBars, records, renderMode)
- {
- var timelineRecordBar = rowRecordBars[recordBarIndex];
- if (!timelineRecordBar)
- timelineRecordBar = rowRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
- timelineRecordBar.renderMode = renderMode;
- timelineRecordBar.records = records;
- timelineRecordBar.refresh(this);
- if (!timelineRecordBar.element.parentNode)
- rowElement.appendChild(timelineRecordBar.element);
- ++recordBarIndex;
- }
-
- for (var rowRecords of this._timelineRecordGridRows) {
- var rowElement = rowRecords.__element;
- var rowRecordBars = rowRecords.__recordBars;
-
- recordBarIndex = 0;
-
- WebInspector.TimelineRecordBar.createCombinedBars(rowRecords, secondsPerPixel, this, createBar.bind(this, rowElement, rowRecordBars));
-
- // Remove the remaining unused TimelineRecordBars.
- for (; recordBarIndex < rowRecordBars.length; ++recordBarIndex) {
- rowRecordBars[recordBarIndex].records = null;
- rowRecordBars[recordBarIndex].element.remove();
- }
- }
- },
-
- // Private
-
- _networkTimelineRecordAdded: function(event)
- {
- var resourceTimelineRecord = event.data.record;
- console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
-
- function compareByStartTime(a, b)
- {
- return a.startTime - b.startTime;
- }
-
- // Try to find a row that has room and does not overlap a previous record.
- var foundRowForRecord = false;
- for (var i = 0; i < this._timelineRecordGridRows.length; ++i) {
- var rowRecords = this._timelineRecordGridRows[i];
- var lastRecord = rowRecords.lastValue;
-
- if (!lastRecord || lastRecord.endTime + WebInspector.NetworkTimelineOverviewGraph.MinimumBarPaddingTime <= resourceTimelineRecord.startTime) {
- insertObjectIntoSortedArray(resourceTimelineRecord, rowRecords, compareByStartTime);
- this._nextDumpRow = i + 1;
- foundRowForRecord = true;
- break;
- }
- }
-
- if (!foundRowForRecord) {
- // Try to find a row that does not overlap a previous record's active time, but it can overlap the inactive time.
- for (var i = 0; i < this._timelineRecordGridRows.length; ++i) {
- var rowRecords = this._timelineRecordGridRows[i];
- var lastRecord = rowRecords.lastValue;
- console.assert(lastRecord);
-
- if (lastRecord.activeStartTime + WebInspector.NetworkTimelineOverviewGraph.MinimumBarPaddingTime <= resourceTimelineRecord.startTime) {
- insertObjectIntoSortedArray(resourceTimelineRecord, rowRecords, compareByStartTime);
- this._nextDumpRow = i + 1;
- foundRowForRecord = true;
- break;
- }
- }
- }
-
- // We didn't find a empty spot, so dump into the designated dump row.
- if (!foundRowForRecord) {
- if (this._nextDumpRow >= WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount)
- this._nextDumpRow = 0;
- insertObjectIntoSortedArray(resourceTimelineRecord, this._timelineRecordGridRows[this._nextDumpRow++], compareByStartTime);
- }
-
- this.needsLayout();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-view.network > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
-
-.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.network .item .subtitle {
- display: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,211 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimelineView = function(recording)
-{
- WebInspector.TimelineView.call(this);
-
- this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NetworkTimelineView.TreeOutlineStyleClassName);
-
- var columns = {domain: {}, type: {}, method: {}, scheme: {}, statusCode: {}, cached: {}, size: {}, transferSize: {}, requestSent: {}, latency: {}, duration: {}};
-
- columns.domain.title = WebInspector.UIString("Domain");
- columns.domain.width = "10%";
-
- columns.type.title = WebInspector.UIString("Type");
- columns.type.width = "8%";
- columns.type.scopeBar = WebInspector.TimelineDataGrid.createColumnScopeBar("network", WebInspector.Resource.Type);
-
- columns.method.title = WebInspector.UIString("Method");
- columns.method.width = "6%";
-
- columns.scheme.title = WebInspector.UIString("Scheme");
- columns.scheme.width = "6%";
-
- columns.statusCode.title = WebInspector.UIString("Status");
- columns.statusCode.width = "6%";
-
- columns.cached.title = WebInspector.UIString("Cached");
- columns.cached.width = "6%";
-
- columns.size.title = WebInspector.UIString("Size");
- columns.size.width = "8%";
- columns.size.aligned = "right";
-
- columns.transferSize.title = WebInspector.UIString("Transfered");
- columns.transferSize.width = "8%";
- columns.transferSize.aligned = "right";
-
- columns.requestSent.title = WebInspector.UIString("Start Time");
- columns.requestSent.width = "9%";
- columns.requestSent.aligned = "right";
- columns.requestSent.sort = "ascending";
-
- columns.latency.title = WebInspector.UIString("Latency");
- columns.latency.width = "9%";
- columns.latency.aligned = "right";
-
- columns.duration.title = WebInspector.UIString("Duration");
- columns.duration.width = "9%";
- columns.duration.aligned = "right";
-
- for (var column in columns)
- columns[column].sortable = true;
-
- this._dataGrid = new WebInspector.TimelineDataGrid(this.navigationSidebarTreeOutline, columns);
- this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
- this.element.classList.add(WebInspector.NetworkTimelineView.StyleClassName);
- this.element.appendChild(this._dataGrid.element);
-
- var networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
- networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
-
- this._pendingRecords = [];
-};
-
-WebInspector.NetworkTimelineView.StyleClassName = "network";
-WebInspector.NetworkTimelineView.TreeOutlineStyleClassName = "network";
-
-WebInspector.NetworkTimelineView.prototype = {
- constructor: WebInspector.NetworkTimelineView,
- __proto__: WebInspector.TimelineView.prototype,
-
- // Public
-
- get navigationSidebarTreeOutlineLabel()
- {
- return WebInspector.UIString("Resources");
- },
-
- shown: function()
- {
- WebInspector.TimelineView.prototype.shown.call(this);
-
- this._dataGrid.shown();
- },
-
- hidden: function()
- {
- this._dataGrid.hidden();
-
- WebInspector.TimelineView.prototype.hidden.call(this);
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineView.prototype.updateLayout.call(this);
-
- this._dataGrid.updateLayout();
-
- this._processPendingRecords();
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
- },
-
- reset: function()
- {
- WebInspector.TimelineView.prototype.reset.call(this);
-
- this._dataGrid.reset();
- },
-
- // Protected
-
- treeElementPathComponentSelected: function(event)
- {
- var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
- if (!dataGridNode)
- return;
- dataGridNode.revealAndSelect();
- },
-
- // Private
-
- _processPendingRecords: function()
- {
- if (!this._pendingRecords.length)
- return;
-
- for (var resourceTimelineRecord of this._pendingRecords) {
- // Skip the record if it already exists in the tree.
- var treeElement = this.navigationSidebarTreeOutline.findTreeElement(resourceTimelineRecord.resource);
- if (treeElement)
- continue;
-
- treeElement = new WebInspector.ResourceTreeElement(resourceTimelineRecord.resource);
- var dataGridNode = new WebInspector.ResourceTimelineDataGridNode(resourceTimelineRecord, false, this);
-
- this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
- }
-
- this._pendingRecords = [];
- },
-
- _networkTimelineRecordAdded: function(event)
- {
- var resourceTimelineRecord = event.data.record;
- console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
-
- this._pendingRecords.push(resourceTimelineRecord);
-
- this.needsLayout();
- },
-
- _dataGridFiltersDidChange: function(event)
- {
- WebInspector.timelineSidebarPanel.updateFilter();
- },
-
- _dataGridNodeSelected: function(event)
- {
- this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (this._dataGrid.shouldIgnoreSelectionEvent())
- return;
-
- if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
- return;
-
- if (treeElement instanceof WebInspector.FolderTreeElement)
- return;
-
- if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
- WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
- return;
- }
-
- console.error("Unknown tree element selected.");
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Object.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Object.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Object.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,236 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.
- */
-
-/**
- * @constructor
- */
-WebInspector.Object = function()
-{
-}
-
-/**
- * @param {function} constructor
- */
-WebInspector.Object.addConstructorFunctions = function(subclassConstructor)
-{
- // Copies the relevant functions the subclass constructor.
- for (var property in WebInspector.Object) {
- var value = WebInspector.Object[property];
- if (typeof value !== "function")
- continue;
- if (value === arguments.callee)
- continue;
- subclassConstructor[property] = value;
- }
-}
-
-/**
- * @param {string} eventType
- * @param {function(WebInspector.Event)} listener
- * @param {Object=} thisObject
- */
-WebInspector.Object.addEventListener = function(eventType, listener, thisObject)
-{
- thisObject = thisObject || null;
-
- console.assert(eventType, "Object.addEventListener: invalid event type ", eventType, "(listener: ", listener, "thisObject: ", thisObject, ")");
- if (!eventType)
- return;
-
- console.assert(listener, "Object.addEventListener: invalid listener ", listener, "(event type: ", eventType, "thisObject: ", thisObject, ")");
- if (!listener)
- return;
-
- if (!this._listeners)
- this._listeners = {};
-
- var listeners = this._listeners[eventType];
- if (!listeners)
- listeners = this._listeners[eventType] = [];
-
- // Prevent registering multiple times.
- for (var i = 0; i < listeners.length; ++i) {
- if (listeners[i].listener === listener && listeners[i].thisObject === thisObject)
- return;
- }
-
- listeners.push({thisObject: thisObject, listener: listener});
-};
-
-/**
- * @param {string} eventType
- * @param {function(WebInspector.Event)} listener
- * @param {Object=} thisObject
- */
-WebInspector.Object.removeEventListener = function(eventType, listener, thisObject)
-{
- eventType = eventType || null;
- listener = listener || null;
- thisObject = thisObject || null;
-
- if (!this._listeners)
- return;
-
- if (!eventType) {
- for (eventType in this._listeners)
- this.removeEventListener(eventType, listener, thisObject);
- return;
- }
-
- var listeners = this._listeners[eventType];
- if (!listeners)
- return;
-
- for (var i = listeners.length - 1; i >= 0; --i) {
- if (listener && listeners[i].listener === listener && listeners[i].thisObject === thisObject)
- listeners.splice(i, 1);
- else if (!listener && thisObject && listeners[i].thisObject === thisObject)
- listeners.splice(i, 1);
- }
-
- if (!listeners.length)
- delete this._listeners[eventType];
-
- if (!Object.keys(this._listeners).length)
- delete this._listeners;
-};
-
-WebInspector.Object.removeAllListeners = function()
-{
- delete this._listeners;
-};
-
-/**
- * @param {string} eventType
- * @return {boolean}
- */
-WebInspector.Object.hasEventListeners = function(eventType)
-{
- if (!this._listeners || !this._listeners[eventType])
- return false;
- return true;
-};
-
-WebInspector.Object.prototype = {
- constructor: WebInspector.Object,
-
- /**
- * @param {string} eventType
- * @param {function(WebInspector.Event)} listener
- * @param {Object=} thisObject
- */
- addEventListener: WebInspector.Object.addEventListener,
-
- /**
- * @param {string} eventType
- * @param {function(WebInspector.Event)} listener
- * @param {Object=} thisObject
- */
- removeEventListener: WebInspector.Object.removeEventListener,
-
- removeAllListeners: WebInspector.Object.removeAllListeners,
-
- /**
- * @param {string} eventType
- * @return {boolean}
- */
- hasEventListeners: WebInspector.Object.hasEventListeners,
-
- /**
- * @param {string} eventType
- * @param {*=} eventData
- * @return {boolean}
- */
- dispatchEventToListeners: function(eventType, eventData)
- {
- var event = new WebInspector.Event(this, eventType, eventData);
-
- function dispatch(object)
- {
- if (!object || !object._listeners || !object._listeners[eventType] || event._stoppedPropagation)
- return;
-
- // Make a copy with slice so mutations during the loop doesn't affect us.
- var listenersForThisEvent = object._listeners[eventType].slice(0);
-
- // Iterate over the listeners and call them. Stop if stopPropagation is called.
- for (var i = 0; i < listenersForThisEvent.length; ++i) {
- listenersForThisEvent[i].listener.call(listenersForThisEvent[i].thisObject, event);
- if (event._stoppedPropagation)
- break;
- }
- }
-
- // Dispatch to listeners of this specific object.
- dispatch(this);
-
- // Allow propagation again so listeners on the constructor always have a crack at the event.
- event._stoppedPropagation = false;
-
- // Dispatch to listeners on all constructors up the prototype chain, including the immediate constructor.
- var constructor = this.constructor;
- while (constructor) {
- dispatch(constructor);
-
- if (!constructor.prototype.__proto__)
- break;
-
- constructor = constructor.prototype.__proto__.constructor;
- }
-
- return event.defaultPrevented;
- }
-}
-
-/**
- * @constructor
- * @param {WebInspector.Object} target
- * @param {string} type
- * @param {*=} data
- */
-WebInspector.Event = function(target, type, data)
-{
- this.target = target;
- this.type = type;
- this.data = data;
- this.defaultPrevented = false;
- this._stoppedPropagation = false;
-}
-
-WebInspector.Event.prototype = {
- constructor: WebInspector.Event,
-
- stopPropagation: function()
- {
- this._stoppedPropagation = true;
- },
-
- preventDefault: function()
- {
- this.defaultPrevented = true;
- }
-}
-
-WebInspector.notifications = new WebInspector.Object;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceObjectPropertiesSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ObjectPropertiesSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ObjectPropertiesSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ObjectPropertiesSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,347 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor)
-{
- this.emptyPlaceholder = (emptyPlaceholder || WebInspector.UIString("No Properties"));
- this.object = object;
- this.ignoreHasOwnProperty = ignoreHasOwnProperty;
- this.extraProperties = extraProperties;
- this.treeElementConstructor = treeElementConstructor || WebInspector.ObjectPropertyTreeElement;
- this.editable = true;
-
- WebInspector.PropertiesSection.call(this, title, subtitle);
-}
-
-WebInspector.ObjectPropertiesSection.prototype = {
- onpopulate: function()
- {
- this.update();
- },
-
- update: function()
- {
- var self = this;
- function callback(properties)
- {
- if (!properties)
- return;
- self.updateProperties(properties);
- }
- if (this.ignoreHasOwnProperty)
- this.object.getAllProperties(callback);
- else
- this.object.getOwnProperties(callback);
- },
-
- updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
- {
- if (!rootTreeElementConstructor)
- rootTreeElementConstructor = this.treeElementConstructor;
-
- if (!rootPropertyComparer)
- rootPropertyComparer = WebInspector.ObjectPropertiesSection.CompareProperties;
-
- if (this.extraProperties)
- for (var i = 0; i < this.extraProperties.length; ++i)
- properties.push(this.extraProperties[i]);
-
- properties.sort(rootPropertyComparer);
-
- this.propertiesTreeOutline.removeChildren();
-
- for (var i = 0; i < properties.length; ++i) {
- properties[i].parentObject = this.object;
- this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));
- }
-
- if (!this.propertiesTreeOutline.children.length) {
- var title = document.createElement("div");
- title.className = "info";
- title.textContent = this.emptyPlaceholder;
- var infoElement = new TreeElement(title, null, false);
- this.propertiesTreeOutline.appendChild(infoElement);
- }
- this.propertiesForTest = properties;
-
- this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
- }
-}
-
-WebInspector.ObjectPropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;
-
-WebInspector.ObjectPropertiesSection.CompareProperties = function(propertyA, propertyB)
-{
- var a = propertyA.name;
- var b = propertyB.name;
- if (a === "__proto__")
- return 1;
- if (b === "__proto__")
- return -1;
-
- // if used elsewhere make sure to
- // - convert a and b to strings (not needed here, properties are all strings)
- // - check if a == b (not needed here, no two properties can be the same)
-
- var diff = 0;
- var chunk = /^\d+|^\D+/;
- var chunka, chunkb, anum, bnum;
- while (diff === 0) {
- if (!a && b)
- return -1;
- if (!b && a)
- return 1;
- chunka = a.match(chunk)[0];
- chunkb = b.match(chunk)[0];
- anum = !isNaN(chunka);
- bnum = !isNaN(chunkb);
- if (anum && !bnum)
- return -1;
- if (bnum && !anum)
- return 1;
- if (anum && bnum) {
- diff = chunka - chunkb;
- if (diff === 0 && chunka.length !== chunkb.length) {
- if (!+chunka && !+chunkb) // chunks are strings of all 0s (special case)
- return chunka.length - chunkb.length;
- else
- return chunkb.length - chunka.length;
- }
- } else if (chunka !== chunkb)
- return (chunka < chunkb) ? -1 : 1;
- a = a.substring(chunka.length);
- b = b.substring(chunkb.length);
- }
- return diff;
-}
-
-/**
- * @constructor
- * @extends {TreeElement}
- */
-WebInspector.ObjectPropertyTreeElement = function(property)
-{
- this.property = property;
-
- // Pass an empty title, the title gets made later in onattach.
- TreeElement.call(this, "", null, false);
- this.toggleOnClick = true;
- this.selectable = false;
-}
-
-WebInspector.ObjectPropertyTreeElement.prototype = {
- onpopulate: function()
- {
- if (this.children.length && !this.shouldRefreshChildren)
- return;
-
- var callback = function(properties) {
- this.removeChildren();
- if (!properties)
- return;
-
- properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);
- for (var i = 0; i < properties.length; ++i) {
- this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
- }
- };
- this.property.value.getOwnProperties(callback.bind(this));
- },
-
- ondblclick: function(event)
- {
- if (this.property.writable)
- this.startEditing();
- },
-
- onattach: function()
- {
- this.update();
- },
-
- update: function()
- {
- this.nameElement = document.createElement("span");
- this.nameElement.className = "name";
- this.nameElement.textContent = this.property.name;
- if (!this.property.enumerable && (!this.parent.root || !this.treeOutline.section.dontHighlightNonEnumerablePropertiesAtTopLevel))
- this.nameElement.classList.add("dimmed");
-
- var separatorElement = document.createElement("span");
- separatorElement.className = "separator";
- separatorElement.textContent = ": ";
-
- this.valueElement = document.createElement("span");
- this.valueElement.className = "value";
-
- var description = this.property.value.description;
- // Render \n as a nice unicode cr symbol.
- if (this.property.wasThrown)
- this.valueElement.textContent = "[Exception: " + description + "]";
- else if (this.property.value.type === "string" && typeof description === "string") {
- this.valueElement.textContent = "\"" + description.replace(/\n/g, "\u21B5") + "\"";
- this.valueElement._originalTextContent = "\"" + description + "\"";
- } else if (this.property.value.type === "function" && typeof description === "string") {
- this.valueElement.textContent = /.*/.exec(description)[0].replace(/ +$/g, "");
- this.valueElement._originalTextContent = description;
- } else
- this.valueElement.textContent = description;
-
- if (this.property.value.type === "function")
- this.valueElement.addEventListener("contextmenu", this._functionContextMenuEventFired.bind(this), false);
-
- if (this.property.wasThrown)
- this.valueElement.classList.add("error");
- if (this.property.value.subtype)
- this.valueElement.classList.add("console-formatted-" + this.property.value.subtype);
- else if (this.property.value.type)
- this.valueElement.classList.add("console-formatted-" + this.property.value.type);
- if (this.property.value.subtype === "node")
- this.valueElement.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), false);
-
- this.listItemElement.removeChildren();
-
- this.listItemElement.appendChild(this.nameElement);
- this.listItemElement.appendChild(separatorElement);
- this.listItemElement.appendChild(this.valueElement);
- this.hasChildren = this.property.value.hasChildren && !this.property.wasThrown;
- },
-
- _contextMenuEventFired: function(event)
- {
- function selectNode(nodeId)
- {
- if (nodeId)
- WebInspector.domTreeManager.inspectElement(nodeId);
- }
-
- function revealElement()
- {
- this.property.value.pushNodeToFrontend(selectNode);
- }
-
- var contextMenu = new WebInspector.ContextMenu(event);
- contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), revealElement.bind(this));
- contextMenu.show();
- },
-
- _functionContextMenuEventFired: function(event)
- {
- function didGetLocation(error, response)
- {
- if (error) {
- console.error(error);
- return;
- }
- WebInspector.panels.scripts.showFunctionDefinition(response);
- }
-
- function revealFunction()
- {
- DebuggerAgent.getFunctionLocation(this.property.value.objectId, didGetLocation.bind(this));
- }
-
- var contextMenu = new WebInspector.ContextMenu(event);
- contextMenu.appendItem(WebInspector.UIString("Show function definition"), revealFunction.bind(this));
- contextMenu.show();
- },
-
- updateSiblings: function()
- {
- if (this.parent.root)
- this.treeOutline.section.update();
- else
- this.parent.shouldRefreshChildren = true;
- },
-
- startEditing: function()
- {
- if (WebInspector.isBeingEdited(this.valueElement) || !this.treeOutline.section.editable)
- return;
-
- var context = { expanded: this.expanded };
-
- // Lie about our children to prevent expanding on double click and to collapse subproperties.
- this.hasChildren = false;
-
- this.listItemElement.classList.add("editing-sub-part");
-
- // Edit original source.
- if (typeof this.valueElement._originalTextContent === "string")
- this.valueElement.textContent = this.valueElement._originalTextContent;
-
- var config = new WebInspector.EditingConfig(this.editingCommitted.bind(this), this.editingCancelled.bind(this), context);
- WebInspector.startEditing(this.valueElement, config);
- },
-
- editingEnded: function(context)
- {
- this.listItemElement.scrollLeft = 0;
- this.listItemElement.classList.remove("editing-sub-part");
- if (context.expanded)
- this.expand();
- },
-
- editingCancelled: function(element, context)
- {
- this.update();
- this.editingEnded(context);
- },
-
- editingCommitted: function(element, userInput, previousContent, context)
- {
- if (userInput === previousContent)
- return this.editingCancelled(element, context); // nothing changed, so cancel
-
- this.applyExpression(userInput, true);
-
- this.editingEnded(context);
- },
-
- applyExpression: function(expression, updateInterface)
- {
- expression = expression.trim();
- var expressionLength = expression.length;
- function callback(error)
- {
- if (!updateInterface)
- return;
-
- if (error)
- this.update();
-
- if (!expressionLength) {
- // The property was deleted, so remove this tree element.
- this.parent.removeChild(this);
- } else {
- // Call updateSiblings since their value might be based on the value that just changed.
- this.updateSiblings();
- }
- };
- this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback.bind(this));
- }
-}
-
-WebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-view.overview > .timeline-ruler {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
-.timeline-view.overview > .timeline-ruler > .header {
- border-top: 1px solid rgb(200, 200, 200);
- height: 23px;
-}
-
-.timeline-view.overview > .timeline-ruler > .event-markers {
- top: 23px;
-}
-
-.timeline-view.overview > .data-grid {
- position: absolute;
- top: 23px;
- left: 0;
- right: 0;
- bottom: 0;
- border: none;
-}
-
-.timeline-view.overview > .data-grid table.header {
- display: none;
-}
-
-.timeline-view.overview > .data-grid .data-container {
- top: 0;
-}
-
-.timeline-view.overview > .data-grid td.graph-column {
- padding: 2px 0;
-}
-
-.timeline-view.overview > .data-grid td.graph-column > div {
- position: relative;
- height: 16px;
-}
-
-.timeline-view.overview > .data-grid td.graph-column .timeline-record-bar {
- top: 2px;
-}
-
-.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
- box-shadow: white 0 0 0 1px;
-}
-
-.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
- box-shadow: rgb(212, 212, 212) 0 0 0 1px;
-}
-
-.timeline-view.overview > .data-grid:focus tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
- box-shadow: rgb(56, 121, 217) 0 0 0 1px;
-}
-
-.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
- box-shadow: white 1px 0 0;
-}
-
-.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
- box-shadow: rgb(212, 212, 212) 1px 0 0;
-}
-
-.timeline-view.overview > .data-grid:focus tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
- box-shadow: rgb(56, 121, 217) 1px 0 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,352 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.OverviewTimelineView = function(recording)
-{
- WebInspector.TimelineView.call(this);
-
- this._recording = recording;
-
- this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
-
- var columns = {"graph": {width: "100%"}};
-
- this._dataGrid = new WebInspector.DataGrid(columns);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
- this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(this._contentTreeOutline, this._dataGrid);
-
- this._timelineRuler = new WebInspector.TimelineRuler;
- this._timelineRuler.allowsClippedLabels = true;
- this.element.appendChild(this._timelineRuler.element);
-
- this._currentTimeMarker = new WebInspector.TimelineMarker(0, WebInspector.TimelineMarker.Type.CurrentTime);
- this._timelineRuler.addMarker(this._currentTimeMarker);
-
- this.element.classList.add(WebInspector.OverviewTimelineView.StyleClassName);
- this.element.appendChild(this._dataGrid.element);
-
- this._networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
- this._networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
-
- recording.addEventListener(WebInspector.TimelineRecording.Event.SourceCodeTimelineAdded, this._sourceCodeTimelineAdded, this);
-
- this._pendingRepresentedObjects = [];
-};
-
-WebInspector.OverviewTimelineView.StyleClassName = "overview";
-
-WebInspector.OverviewTimelineView.prototype = {
- constructor: WebInspector.OverviewTimelineView,
- __proto__: WebInspector.TimelineView.prototype,
-
- // Public
-
- get navigationSidebarTreeOutlineLabel()
- {
- return WebInspector.UIString("Timeline Events");
- },
-
- shown: function()
- {
- WebInspector.TimelineView.prototype.shown.call(this);
-
- this._treeOutlineDataGridSynchronizer.synchronize();
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineView.prototype.updateLayout.call(this);
-
- var oldZeroTime = this._timelineRuler.zeroTime;
- var oldStartTime = this._timelineRuler.startTime;
- var oldEndTime = this._timelineRuler.endTime;
- var oldCurrentTime = this._currentTimeMarker.time;
-
- this._timelineRuler.zeroTime = this.zeroTime;
- this._timelineRuler.startTime = this.startTime;
- this._timelineRuler.endTime = this.endTime;
- this._currentTimeMarker.time = this.currentTime;
-
- // The TimelineDataGridNode graphs are positioned with percentages, so they auto resize with the view.
- // We only need to refresh the graphs when the any of the times change.
- if (this.zeroTime !== oldZeroTime || this.startTime !== oldStartTime || this.endTime !== oldEndTime || this.currentTime !== oldCurrentTime) {
- var dataGridNode = this._dataGrid.children[0];
- while (dataGridNode) {
- dataGridNode.refreshGraph();
- dataGridNode = dataGridNode.traverseNextNode(true, null, true);
- }
- }
-
- if (!this.currentTime !== oldCurrentTime) {
- var selectedTreeElement = this.navigationSidebarTreeOutline.selectedTreeElement;
- var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
-
- // Check the filters again since the current time change might have revealed this node. Start and end time changes are handled by TimelineContentView.
- WebInspector.timelineSidebarPanel.updateFilter();
-
- if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
- this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
- }
-
- this._timelineRuler.updateLayout();
-
- this._processPendingRepresentedObjects();
- },
-
- get selectionPathComponents()
- {
- var dataGridNode = this._dataGrid.selectedNode;
- if (!dataGridNode)
- return null;
-
- var pathComponents = [];
-
- while (dataGridNode && !dataGridNode.root) {
- var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
- console.assert(treeElement);
- if (!treeElement)
- break;
-
- if (treeElement.hidden)
- return null;
-
- var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
- pathComponents.unshift(pathComponent);
- dataGridNode = dataGridNode.parent;
- }
-
- return pathComponents;
- },
-
- // Protected
-
- treeElementPathComponentSelected: function(event)
- {
- var dataGridNode = this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
- if (!dataGridNode)
- return;
- dataGridNode.revealAndSelect();
- },
-
- // Private
-
- _compareTreeElementsByDetails: function(a, b)
- {
- if (a instanceof WebInspector.SourceCodeTimelineTreeElement && b instanceof WebInspector.ResourceTreeElement)
- return -1;
-
- if (a instanceof WebInspector.ResourceTreeElement && b instanceof WebInspector.SourceCodeTimelineTreeElement)
- return 1;
-
- if (a instanceof WebInspector.SourceCodeTimelineTreeElement && b instanceof WebInspector.SourceCodeTimelineTreeElement) {
- aTimeline = a.sourceCodeTimeline;
- bTimeline = b.sourceCodeTimeline;
-
- if (!aTimeline.sourceCodeLocation && !bTimeline.sourceCodeLocation) {
- if (aTimeline.recordType !== bTimeline.recordType)
- return aTimeline.recordType.localeCompare(bTimeline.recordType);
-
- return a.mainTitle.localeCompare(b.mainTitle);
- }
-
- if (!aTimeline.sourceCodeLocation || !bTimeline.sourceCodeLocation)
- return !!aTimeline.sourceCodeLocation - !!bTimeline.sourceCodeLocation;
-
- if (aTimeline.sourceCodeLocation.lineNumber !== bTimeline.sourceCodeLocation.lineNumber)
- return aTimeline.sourceCodeLocation.lineNumber - bTimeline.sourceCodeLocation.lineNumber;
-
- return aTimeline.sourceCodeLocation.columnNumber - bTimeline.sourceCodeLocation.columnNumber;
- }
-
- // Fallback to comparing by start time for ResourceTreeElement or anything else.
- return this._compareTreeElementsByStartTime(a, b);
- },
-
- _compareTreeElementsByStartTime: function(a, b)
- {
- function getStartTime(treeElement)
- {
- if (treeElement instanceof WebInspector.ResourceTreeElement)
- return treeElement.resource.firstTimestamp;
- if (treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)
- return treeElement.sourceCodeTimeline.startTime;
-
- console.error("Unknown tree element.");
- return 0;
- }
-
- var result = getStartTime(a) - getStartTime(b);
- if (result)
- return result;
-
- // Fallback to comparing titles.
- return a.mainTitle.localeCompare(b.mainTitle);
- },
-
- _insertTreeElement: function(treeElement, parentTreeElement)
- {
- console.assert(treeElement);
- console.assert(!treeElement.parent);
- console.assert(parentTreeElement);
-
- parentTreeElement.insertChild(treeElement, insertionIndexForObjectInListSortedByFunction(treeElement, parentTreeElement.children, this._compareTreeElementsByStartTime.bind(this)));
- },
-
- _addResourceToTreeIfNeeded: function(resource)
- {
- console.assert(resource);
- if (!resource)
- return null;
-
- var treeElement = this.navigationSidebarTreeOutline.findTreeElement(resource);
- if (treeElement)
- return treeElement;
-
- var parentFrame = resource.parentFrame;
- if (!parentFrame)
- return;
-
- var expandedByDefault = false;
- if (parentFrame.mainResource === resource || parentFrame.provisionalMainResource === resource) {
- parentFrame = parentFrame.parentFrame;
- expandedByDefault = !parentFrame; // Main frame expands by default.
- }
-
- var resourceTreeElement = new WebInspector.ResourceTreeElement(resource);
- if (expandedByDefault)
- resourceTreeElement.expand();
-
- var resourceTimelineRecord = this._networkTimeline ? this._networkTimeline.recordForResource(resource) : null;
- if (!resourceTimelineRecord)
- resourceTimelineRecord = new WebInspector.ResourceTimelineRecord(resource);
-
- var resourceDataGridNode = new WebInspector.ResourceTimelineDataGridNode(resourceTimelineRecord, true, this);
- this._treeOutlineDataGridSynchronizer.associate(resourceTreeElement, resourceDataGridNode);
-
- var parentTreeElement = this.navigationSidebarTreeOutline;
- if (parentFrame) {
- // Find the parent main resource, adding it if needed, to append this resource as a child.
- var parentResource = parentFrame.provisionalMainResource || parentFrame.mainResource;
-
- parentTreeElement = this._addResourceToTreeIfNeeded(parentResource);
- console.assert(parentTreeElement);
- if (!parentTreeElement)
- return;
- }
-
- this._insertTreeElement(resourceTreeElement, parentTreeElement);
-
- return resourceTreeElement;
- },
-
- _addSourceCodeTimeline: function(sourceCodeTimeline)
- {
- var parentTreeElement = sourceCodeTimeline.sourceCodeLocation ? this._addResourceToTreeIfNeeded(sourceCodeTimeline.sourceCode) : this.navigationSidebarTreeOutline;
- console.assert(parentTreeElement);
- if (!parentTreeElement)
- return;
-
- var sourceCodeTimelineTreeElement = new WebInspector.SourceCodeTimelineTreeElement(sourceCodeTimeline);
- var sourceCodeTimelineDataGridNode = new WebInspector.SourceCodeTimelineTimelineDataGridNode(sourceCodeTimeline, this);
-
- this._treeOutlineDataGridSynchronizer.associate(sourceCodeTimelineTreeElement, sourceCodeTimelineDataGridNode);
- this._insertTreeElement(sourceCodeTimelineTreeElement, parentTreeElement);
- },
-
- _processPendingRepresentedObjects: function()
- {
- if (!this._pendingRepresentedObjects || !this._pendingRepresentedObjects.length)
- return;
-
- for (var representedObject of this._pendingRepresentedObjects) {
- if (representedObject instanceof WebInspector.Resource)
- this._addResourceToTreeIfNeeded(representedObject);
- else if (representedObject instanceof WebInspector.SourceCodeTimeline)
- this._addSourceCodeTimeline(representedObject);
- else
- console.error("Unknown represented object");
- }
-
- this._pendingRepresentedObjects = [];
- },
-
- _networkTimelineRecordAdded: function(event)
- {
- var resourceTimelineRecord = event.data.record;
- console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
-
- this._pendingRepresentedObjects.push(resourceTimelineRecord.resource);
-
- this.needsLayout();
-
- // We don't expect to have any source code timelines yet. Those should be added with _sourceCodeTimelineAdded.
- console.assert(!this._recording.sourceCodeTimelinesForSourceCode(resourceTimelineRecord.resource).length);
- },
-
- _sourceCodeTimelineAdded: function(event)
- {
- var sourceCodeTimeline = event.data.sourceCodeTimeline;
- console.assert(sourceCodeTimeline);
- if (!sourceCodeTimeline)
- return;
-
- this._pendingRepresentedObjects.push(sourceCodeTimeline);
-
- this.needsLayout();
- },
-
- _dataGridNodeSelected: function(event)
- {
- this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
- return;
-
- if (treeElement instanceof WebInspector.FolderTreeElement)
- return;
-
- if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
- WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
- return;
- }
-
- if (!(treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)) {
- console.error("Unknown tree element selected.");
- return;
- }
-
- if (!treeElement.sourceCodeTimeline.sourceCodeLocation) {
- WebInspector.timelineSidebarPanel.showTimelineOverview();
- return;
- }
-
- WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfacePageObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/PageObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/PageObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/PageObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.PageObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.PageObserver.prototype = {
- constructor: WebInspector.PageObserver,
-
- // Events defined by the "Page" domain.
-
- domContentEventFired: function(timestamp)
- {
- // Covered by Timeline "MarkDOMContent" record.
- },
-
- loadEventFired: function(timestamp)
- {
- WebInspector.timelineManager.pageDidLoad(timestamp);
- },
-
- frameNavigated: function(frame, loaderId)
- {
- WebInspector.frameResourceManager.frameDidNavigate(frame, loaderId);
- },
-
- frameDetached: function(frameId)
- {
- WebInspector.frameResourceManager.frameDidDetach(frameId);
- },
-
- frameStartedLoading: function(frameId)
- {
- // Not handled yet.
- },
-
- frameStoppedLoading: function(frameId)
- {
- // Not handled yet.
- },
-
- frameScheduledNavigation: function(frameId, delay)
- {
- // Not handled yet.
- },
-
- frameClearedScheduledNavigation: function(frameId)
- {
- // Not handled yet.
- },
-
- javascriptDialogOpening: function(message)
- {
- // Not handled yet.
- },
-
- javascriptDialogClosed: function()
- {
- // Not handled yet.
- },
-
- scriptsEnabled: function(enabled)
- {
- // Not handled yet.
- }
-};
-
-WebInspector.PageObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfacePathComponentIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/PathComponentIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/PathComponentIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/PathComponentIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.source-code-icon .icon {
- content: url(Images/SourceCode.svg);
-}
-
-.dom-tree-icon .icon {
- content: url(Images/DOMTree.svg);
-}
-
-.request-icon .icon {
- content: url(Images/Request.svg);
-}
-
-.response-icon .icon {
- content: url(Images/Response.svg);
-}
-
-.dom-element-icon .icon {
- content: url(Images/DOMElement.svg);
-}
-
-.dom-text-node-icon .icon {
- content: url(Images/DOMTextNode.svg);
-}
-
-.dom-comment-icon .icon {
- content: url(Images/DOMComment.svg);
-}
-
-.dom-document-type-icon .icon {
- content: url(Images/DOMDocumentType.svg);
-}
-
-.dom-document-icon .icon {
- content: url(Images/DOMDocument.svg);
-}
-
-.dom-character-data-icon .icon {
- content: url(Images/DOMCharacterData.svg);
-}
-
-.dom-node-icon .icon {
- content: url(Images/DOMNode.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfacePopovercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Popover.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Popover.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Popover.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.popover {
- position: absolute;
- min-width: 20px;
- min-height: 20px;
- box-sizing: border-box;
- pointer-events: none;
-}
-
-.popover.arrow-up {
- padding: 16px 5px 5px 5px;
-}
-
-.popover.arrow-right {
- padding: 5px 16px 5px 5px;
-}
-
-.popover.arrow-down {
- padding: 5px 5px 16px 5px;
-}
-
-.popover.arrow-left {
- padding: 5px 5px 5px 16px;
-}
-
-.popover.fade-out {
- transition: opacity 350ms;
- pointer-events: none;
- opacity: 0;
-}
-
-.popover > .container {
- position: absolute;
- left: 5px;
- top: 5px;
- right: 5px;
- bottom: 5px;
-
- padding: 5px;
-
- overflow-y: auto;
- overflow-x: hidden;
-
- pointer-events: auto;
-}
-
-.popover > .container.center {
- display: -webkit-flex;
- -webkit-justify-content: center;
- -webkit-align-items: center;
-}
-
-.popover.arrow-up > .container {
- top: 16px;
-}
-
-.popover.arrow-right > .container {
- right: 16px;
-}
-
-.popover.arrow-down > .container {
- bottom: 16px;
-}
-
-.popover.arrow-left > .container {
- left: 16px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfacePopoverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Popover.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Popover.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Popover.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,544 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Popover = function(delegate) {
- WebInspector.Object.call(this);
-
- this.delegate = delegate;
- this._edge = null;
- this._frame = new WebInspector.Rect;
- this._content = null;
- this._targetFrame = new WebInspector.Rect;
- this._anchorPoint = new WebInspector.Point;
- this._preferredEdges = null;
-
- this._contentNeedsUpdate = false;
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.Popover.StyleClassName;
- this._canvasId = "popover-" + (WebInspector.Popover.canvasId++);
- this._element.style.backgroundImage = "-webkit-canvas(" + this._canvasId + ")";
- this._element.addEventListener("transitionend", this, true);
-
- this._container = this._element.appendChild(document.createElement("div"));
- this._container.className = "container";
-};
-
-WebInspector.Popover.StyleClassName = "popover";
-WebInspector.Popover.FadeOutClassName = "fade-out";
-WebInspector.Popover.canvasId = 0;
-WebInspector.Popover.CornerRadius = 5;
-WebInspector.Popover.MinWidth = 40;
-WebInspector.Popover.MinHeight = 40;
-WebInspector.Popover.ShadowPadding = 5;
-WebInspector.Popover.ContentPadding = 5;
-WebInspector.Popover.AnchorSize = new WebInspector.Size(22, 11);
-WebInspector.Popover.ShadowEdgeInsets = new WebInspector.EdgeInsets(WebInspector.Popover.ShadowPadding);
-
-WebInspector.Popover.prototype = {
- constructor: WebInspector.Popover,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get frame()
- {
- return this._frame;
- },
-
- get visible()
- {
- return this._element.parentNode === document.body && !this._element.classList.contains(WebInspector.Popover.FadeOutClassName);
- },
-
- set frame(frame)
- {
- this._element.style.left = frame.minX() + "px";
- this._element.style.top = frame.minY() + "px";
- this._element.style.width = frame.size.width + "px";
- this._element.style.height = frame.size.height + "px";
- this._element.style.backgroundSize = frame.size.width + "px " + frame.size.height + "px";
- this._frame = frame;
- },
-
- set content(content)
- {
- if (content === this._content)
- return;
-
- this._content = content;
-
- this._contentNeedsUpdate = true;
-
- if (this.visible)
- this._update(true);
- },
-
- update: function()
- {
- if (!this.visible)
- return;
-
- var previouslyFocusedElement = document.activeElement;
-
- this._contentNeedsUpdate = true;
- this._update(true);
-
- if (previouslyFocusedElement)
- previouslyFocusedElement.focus();
- },
-
- /**
- * @param {WebInspector.Rect} targetFrame
- * @param {WebInspector.RectEdge}[] preferredEdges
- */
- present: function(targetFrame, preferredEdges)
- {
- this._targetFrame = targetFrame;
- this._preferredEdges = preferredEdges;
-
- if (!this._content)
- return;
-
- window.addEventListener("mousedown", this, true);
- window.addEventListener("scroll", this, true);
-
- this._update();
- },
-
- dismiss: function()
- {
- if (this._element.parentNode !== document.body)
- return;
-
- window.removeEventListener("mousedown", this, true);
- window.removeEventListener("scroll", this, true);
-
- this._element.classList.add(WebInspector.Popover.FadeOutClassName);
-
- if (this.delegate && typeof this.delegate.willDismissPopover === "function")
- this.delegate.willDismissPopover(this);
- },
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mousedown":
- case "scroll":
- if (!this._element.contains(event.target))
- this.dismiss();
- break;
- case "transitionend":
- if (event.target === this._element) {
- document.body.removeChild(this._element);
- this._element.classList.remove(WebInspector.Popover.FadeOutClassName);
- this._container.textContent = "";
- if (this.delegate && typeof this.delegate.didDismissPopover === "function")
- this.delegate.didDismissPopover(this);
- break;
- }
- }
- },
-
- // Private
-
- _update: function(shouldAnimate)
- {
- if (shouldAnimate)
- var previousEdge = this._edge;
-
- var targetFrame = this._targetFrame;
- var preferredEdges = this._preferredEdges;
-
- // Ensure our element is on display so that its metrics can be resolved
- // or interrupt any pending transition to remove it from display.
- if (this._element.parentNode !== document.body)
- document.body.appendChild(this._element);
- else
- this._element.classList.remove(WebInspector.Popover.FadeOutClassName);
-
- if (this._contentNeedsUpdate) {
- // Reset CSS properties on element so that the element may be sized to fit its content.
- this._element.style.removeProperty("left");
- this._element.style.removeProperty("top");
- this._element.style.removeProperty("width");
- this._element.style.removeProperty("height");
- if (this._edge !== null)
- this._element.classList.remove(this._cssClassNameForEdge());
-
- // Add the content in place of the wrapper to get the raw metrics.
- this._element.replaceChild(this._content, this._container);
-
- // Get the ideal size for the popover to fit its content.
- var popoverBounds = this._element.getBoundingClientRect();
- this._preferredSize = new WebInspector.Size(Math.ceil(popoverBounds.width), Math.ceil(popoverBounds.height));
- }
-
- // The frame of the window with a little inset to make sure we have room for shadows.
- var containerFrame = new WebInspector.Rect(0, 0, window.innerWidth, window.innerHeight);
- containerFrame = containerFrame.inset(WebInspector.Popover.ShadowEdgeInsets);
-
- // Work out the metrics for all edges.
- var metrics = new Array(preferredEdges.length);
- for (var edgeName in WebInspector.RectEdge) {
- var edge = WebInspector.RectEdge[edgeName];
- var item = {
- edge: edge,
- metrics: this._bestMetricsForEdge(this._preferredSize, targetFrame, containerFrame, edge)
- };
- var preferredIndex = preferredEdges.indexOf(edge);
- if (preferredIndex !== -1)
- metrics[preferredIndex] = item;
- else
- metrics.push(item);
- }
-
- function area(size)
- {
- return size.width * size.height;
- }
-
- // Find if any of those fit better than the frame for the preferred edge.
- var bestEdge = metrics[0].edge;
- var bestMetrics = metrics[0].metrics;
- for (var i = 1; i < metrics.length; i++) {
- var itemMetrics = metrics[i].metrics;
- if (area(itemMetrics.contentSize) > area(bestMetrics.contentSize)) {
- bestEdge = metrics[i].edge;
- bestMetrics = itemMetrics;
- }
- }
-
- var anchorPoint;
- var bestFrame = bestMetrics.frame.round();
-
- this._edge = bestEdge;
-
- if (bestFrame === WebInspector.Rect.ZERO_RECT) {
- // The target for the popover is offscreen.
- this.dismiss();
- } else {
- switch (bestEdge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- anchorPoint = new WebInspector.Point(bestFrame.size.width - WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());
- break;
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- anchorPoint = new WebInspector.Point(WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());
- break;
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), bestFrame.size.height - WebInspector.Popover.ShadowPadding);
- break;
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), WebInspector.Popover.ShadowPadding);
- break;
- }
-
- this._element.classList.add(this._cssClassNameForEdge());
-
- if (shouldAnimate && this._edge === previousEdge)
- this._animateFrame(bestFrame);
- else {
- this.frame = bestFrame;
- this._setAnchorPoint(anchorPoint);
- this._drawBackground();
- }
-
- // Make sure content is centered in case either of the dimension is smaller than the minimal bounds.
- if (this._preferredSize.width < WebInspector.Popover.MinWidth || this._preferredSize.height < WebInspector.Popover.MinHeight)
- this._container.classList.add("center");
- else
- this._container.classList.remove("center");
- }
-
- // Wrap the content in the container so that it's located correctly.
- if (this._contentNeedsUpdate) {
- this._container.textContent = "";
- this._element.replaceChild(this._container, this._content);
- this._container.appendChild(this._content);
- }
-
- this._contentNeedsUpdate = false;
- },
-
- _cssClassNameForEdge: function()
- {
- switch (this._edge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- return "arrow-right";
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- return "arrow-left";
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- return "arrow-down";
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- return "arrow-up";
- }
- console.error("Unknown edge.");
- return "arrow-up";
- },
-
- _setAnchorPoint: function(anchorPoint) {
- anchorPoint.x = Math.floor(anchorPoint.x);
- anchorPoint.y = Math.floor(anchorPoint.y);
- this._anchorPoint = anchorPoint;
- },
-
- _animateFrame: function(toFrame)
- {
- var startTime = Date.now();
- var duration = 350;
- var epsilon = 1 / (200 * duration);
- var spline = new WebInspector.UnitBezier(0.25, 0.1, 0.25, 1);
-
- var fromFrame = this._frame.copy();
-
- var absoluteAnchorPoint = new WebInspector.Point(
- fromFrame.minX() + this._anchorPoint.x,
- fromFrame.minY() + this._anchorPoint.y
- );
-
- function animatedValue(from, to, progress)
- {
- return from + (to - from) * progress;
- }
-
- function drawBackground()
- {
- var progress = spline.solve(Math.min((Date.now() - startTime) / duration, 1), epsilon);
-
- this.frame = new WebInspector.Rect(
- animatedValue(fromFrame.minX(), toFrame.minX(), progress),
- animatedValue(fromFrame.minY(), toFrame.minY(), progress),
- animatedValue(fromFrame.size.width, toFrame.size.width, progress),
- animatedValue(fromFrame.size.height, toFrame.size.height, progress)
- ).round();
-
- this._setAnchorPoint(new WebInspector.Point(
- absoluteAnchorPoint.x - this._frame.minX(),
- absoluteAnchorPoint.y - this._frame.minY()
- ));
-
- this._drawBackground();
-
- if (progress < 1)
- window.requestAnimationFrame(drawBackground.bind(this));
- }
-
- drawBackground.call(this);
- },
-
- _drawBackground: function()
- {
- var scaleFactor = window.devicePixelRatio;
-
- var width = this._frame.size.width;
- var height = this._frame.size.height;
- var scaledWidth = width * scaleFactor;
- var scaledHeight = height * scaleFactor;
-
- // Create a scratch canvas so we can draw the popover that will later be drawn into
- // the final context with a shadow.
- var scratchCanvas = document.createElement("canvas");
- scratchCanvas.width = scaledWidth;
- scratchCanvas.height = scaledHeight;
-
- var ctx = scratchCanvas.getContext("2d");
- ctx.scale(scaleFactor, scaleFactor);
-
- // Bounds of the path don't take into account the arrow, but really only the tight bounding box
- // of the content contained within the frame.
- var bounds;
- var arrowHeight = WebInspector.Popover.AnchorSize.height;
- switch (this._edge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- bounds = new WebInspector.Rect(0, 0, width - arrowHeight, height);
- break;
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- bounds = new WebInspector.Rect(arrowHeight, 0, width - arrowHeight, height);
- break;
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- bounds = new WebInspector.Rect(0, 0, width, height - arrowHeight);
- break;
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- bounds = new WebInspector.Rect(0, arrowHeight, width, height - arrowHeight);
- break;
- }
-
- bounds = bounds.inset(WebInspector.Popover.ShadowEdgeInsets);
-
- // Clip the frame.
- ctx.fillStyle = "black";
- this._drawFrame(ctx, bounds, this._edge, this._anchorPoint);
- ctx.clip();
-
- // Gradient fill, top-to-bottom.
- var fillGradient = ctx.createLinearGradient(0, 0, 0, height);
- fillGradient.addColorStop(0, "rgba(255, 255, 255, 0.95)");
- fillGradient.addColorStop(1, "rgba(235, 235, 235, 0.95)");
- ctx.fillStyle = fillGradient;
- ctx.fillRect(0, 0, width, height);
-
- // Stroke.
- ctx.strokeStyle = "rgba(0, 0, 0, 0.25)";
- ctx.lineWidth = 2;
- this._drawFrame(ctx, bounds, this._edge, this._anchorPoint);
- ctx.stroke();
-
- // Draw the popover into the final context with a drop shadow.
- var finalContext = document.getCSSCanvasContext("2d", this._canvasId, scaledWidth, scaledHeight);
-
- finalContext.clearRect(0, 0, scaledWidth, scaledHeight);
-
- finalContext.shadowOffsetX = 1;
- finalContext.shadowOffsetY = 1;
- finalContext.shadowBlur = 5;
- finalContext.shadowColor = "rgba(0, 0, 0, 0.5)";
-
- finalContext.drawImage(scratchCanvas, 0, 0, scaledWidth, scaledHeight);
- },
-
- _bestMetricsForEdge: function(preferredSize, targetFrame, containerFrame, edge)
- {
- var x, y;
- var width = preferredSize.width + (WebInspector.Popover.ShadowPadding * 2) + (WebInspector.Popover.ContentPadding * 2);
- var height = preferredSize.height + (WebInspector.Popover.ShadowPadding * 2) + (WebInspector.Popover.ContentPadding * 2);
- var arrowLength = WebInspector.Popover.AnchorSize.height;
-
- switch (edge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- width += arrowLength;
- x = targetFrame.origin.x - width + WebInspector.Popover.ShadowPadding;
- y = targetFrame.origin.y - (height - targetFrame.size.height) / 2;
- break;
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- width += arrowLength;
- x = targetFrame.origin.x + targetFrame.size.width - WebInspector.Popover.ShadowPadding;
- y = targetFrame.origin.y - (height - targetFrame.size.height) / 2;
- break;
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- height += arrowLength;
- x = targetFrame.origin.x - (width - targetFrame.size.width) / 2;
- y = targetFrame.origin.y - height + WebInspector.Popover.ShadowPadding;
- break;
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- height += arrowLength;
- x = targetFrame.origin.x - (width - targetFrame.size.width) / 2;
- y = targetFrame.origin.y + targetFrame.size.height - WebInspector.Popover.ShadowPadding;
- break;
- }
-
- if (edge === WebInspector.RectEdge.MIN_X || edge === WebInspector.RectEdge.MAX_X) {
- if (y < containerFrame.minY())
- y = containerFrame.minY();
- if (y + height > containerFrame.maxY())
- y = containerFrame.maxY() - height;
- } else {
- if (x < containerFrame.minX())
- x = containerFrame.minX();
- if (x + width > containerFrame.maxX())
- x = containerFrame.maxX() - width;
- }
-
- var preferredFrame = new WebInspector.Rect(x, y, width, height);
- var bestFrame = preferredFrame.intersectionWithRect(containerFrame);
-
- width = bestFrame.size.width - (WebInspector.Popover.ShadowPadding * 2);
- height = bestFrame.size.height - (WebInspector.Popover.ShadowPadding * 2);
-
- switch (edge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- width -= arrowLength;
- break;
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- height -= arrowLength;
- break;
- }
-
- return {
- frame: bestFrame,
- contentSize: new WebInspector.Size(width, height)
- };
- },
-
- _drawFrame: function(ctx, bounds, anchorEdge)
- {
- var r = WebInspector.Popover.CornerRadius;
- var arrowHalfLength = WebInspector.Popover.AnchorSize.width / 2;
- var anchorPoint = this._anchorPoint;
-
- ctx.beginPath();
- switch (anchorEdge) {
- case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
- ctx.moveTo(bounds.maxX(), bounds.minY() + r);
- ctx.lineTo(bounds.maxX(), anchorPoint.y - arrowHalfLength);
- ctx.lineTo(anchorPoint.x, anchorPoint.y);
- ctx.lineTo(bounds.maxX(), anchorPoint.y + arrowHalfLength);
- ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
- ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
- ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
- ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
- break;
- case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
- ctx.moveTo(bounds.minX(), bounds.maxY() - r);
- ctx.lineTo(bounds.minX(), anchorPoint.y + arrowHalfLength);
- ctx.lineTo(anchorPoint.x, anchorPoint.y);
- ctx.lineTo(bounds.minX(), anchorPoint.y - arrowHalfLength);
- ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
- ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
- ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
- ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
- break;
- case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
- ctx.moveTo(bounds.maxX() - r, bounds.maxY());
- ctx.lineTo(anchorPoint.x + arrowHalfLength, bounds.maxY());
- ctx.lineTo(anchorPoint.x, anchorPoint.y);
- ctx.lineTo(anchorPoint.x - arrowHalfLength, bounds.maxY());
- ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
- ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
- ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
- ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
- break;
- case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
- ctx.moveTo(bounds.minX() + r, bounds.minY());
- ctx.lineTo(anchorPoint.x - arrowHalfLength, bounds.minY());
- ctx.lineTo(anchorPoint.x, anchorPoint.y);
- ctx.lineTo(anchorPoint.x + arrowHalfLength, bounds.minY());
- ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
- ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
- ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
- ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
- break;
- }
- ctx.closePath();
- }
-
-};
-
-WebInspector.Popover.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Probe.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Probe.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Probe.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,105 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeSample = function(sampleId, batchId, timestamp, payload)
-{
- this.sampleId = sampleId;
- this.batchId = batchId;
- this.timestamp = timestamp;
- this.object = WebInspector.RemoteObject.fromPayload(payload);
-};
-
-WebInspector.Probe = function(id, breakpoint, expression)
-{
- WebInspector.Object.call(this);
-
- console.assert(id);
- console.assert(breakpoint instanceof WebInspector.Breakpoint);
-
- this._id = id;
- this._breakpoint = breakpoint;
- this._expression = expression;
- this._samples = [];
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Probe);
-
-WebInspector.Probe.Event = {
- ExpressionChanged: "probe-object-expression-changed",
- SampleAdded: "probe-object-sample-added",
- SamplesCleared: "probe-object-samples-cleared"
-};
-
-WebInspector.Probe.prototype = {
- constructor: WebInspector.Probe,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get breakpoint()
- {
- return this._breakpoint;
- },
-
- get expression()
- {
- return this._expression;
- },
-
- set expression(value)
- {
- if (this._expression === value)
- return;
-
- var data = {oldValue: this._expression, newValue: value};
- this._expression = value;
- this.clearSamples();
- this.dispatchEventToListeners(WebInspector.Probe.Event.ExpressionChanged, data);
- },
-
- get samples()
- {
- return this._samples.slice();
- },
-
- clearSamples: function()
- {
- this._samples = [];
- this.dispatchEventToListeners(WebInspector.Probe.Event.SamplesCleared);
- },
-
- addSample: function(sample)
- {
- console.assert(sample instanceof WebInspector.ProbeSample, "Wrong object type passed as probe sample: ", sample);
- this._samples.push(sample);
- this.dispatchEventToListeners(WebInspector.Probe.Event.SampleAdded, sample);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-.sidebar > .panel.probes > .navigation-bar {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
-
-.sidebar > .panel.probes > .content {
- position: absolute;
- top: 22px;
-}
-
-.details-section.probe-set .options > .probe-remove,
-.details-section.probe-set .options > .probe-clear-samples,
-.details-section.probe-set .options > .probe-add {
- float: right;
- height: 11px;
- margin-top: 1px;
- margin-left: 5px;
- cursor: pointer;
-}
-
-.details-section.probe-set .options > .probe-clear-samples {
- content: url(Images/NavigationItemTrash.svg);
- height: 13px;
-}
-
-.details-section.probe-set .options > .probe-remove {
- content: url(Images/Close.svg);
-}
-
-.details-section.probe-set .options > .probe-add {
- content: url(Images/Plus.svg);
-}
-
-.details-section.probe-set .options > input {
- height: 12px;
- width: 40px;
- font-size: 10px;
-}
-
-.details-section.probe-set .options > a.go-to-link {
- text-overflow: ellipsis;
- overflow: hidden;
- display: block;
-}
-
-.panel.probes ::-webkit-scrollbar {
- height: 5px;
- width: 5px;
-}
-
-.panel.probes ::-webkit-scrollbar-track {
- -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
- border-radius: 4px;
- margin: 1px;
-}
-
-.panel.probes ::-webkit-scrollbar-thumb {
- border-radius: 4px;
- -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
-}
-
-.panel.probes ::-webkit-scrollbar-corner {
- opacity: 0;
-}
-
-.popover .probe-popover {
- padding: 2px;
- font-family: 'Lucida Grande', Helvetica, sans-serif;
- font-size: 11px;
- margin: 2px;
-}
-
-.popover .probe-popover input {
- margin: 5px 0 0 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,114 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeDetailsSidebarPanel = function()
-{
- WebInspector.DetailsSidebarPanel.call(this, "probe", WebInspector.UIString("Probes"), WebInspector.UIString("Probes"), "Images/NavigationItemProbes.pdf", "6");
-
- WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetAdded, this);
- WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetRemoved, this);
-
- this._probeSetSections = new Map;
- this._inspectedProbeSets = [];
-
- // Initialize sidebar sections for probe sets that already exist.
- for (var probeSet of WebInspector.probeManager.probeSets)
- this._probeSetAdded(probeSet);
-};
-
-WebInspector.ProbeDetailsSidebarPanel.OffsetSectionsStyleClassName = "offset-sections";
-
-WebInspector.ProbeDetailsSidebarPanel.prototype = {
- constructor: WebInspector.ProbeDetailsSidebarPanel,
- __proto__: WebInspector.DetailsSidebarPanel.prototype,
-
- // Public
-
- get inspectedProbeSets()
- {
- return this._inspectedProbeSets.slice();
- },
-
- set inspectedProbeSets(newProbeSets)
- {
- for (var probeSet of this._inspectedProbeSets) {
- var removedSection = this._probeSetSections.get(probeSet);
- this.element.removeChild(removedSection.element);
- }
-
- this._inspectedProbeSets = newProbeSets;
-
- for (var probeSet of newProbeSets) {
- var shownSection = this._probeSetSections.get(probeSet);
- this.element.appendChild(shownSection.element);
- }
- },
-
- inspect: function(objects)
- {
- if (!(objects instanceof Array))
- objects = [objects];
-
- this.inspectedProbeSets = objects.filter(function(object) {
- return object instanceof WebInspector.ProbeSet;
- });
-
- return !!this._inspectedProbeSets.length;
- },
-
- // Private
-
- _probeSetAdded: function(probeSetOrEvent)
- {
- var probeSet;
- if (probeSetOrEvent instanceof WebInspector.ProbeSet)
- probeSet = probeSetOrEvent;
- else
- probeSet = probeSetOrEvent.data.probeSet;
- console.assert(!this._probeSetSections.has(probeSet), "New probe group ", probeSet, " already has its own sidebar.");
-
- var newSection = new WebInspector.ProbeSetDetailsSection(probeSet);
- this._probeSetSections.set(probeSet, newSection);
- },
-
-
- _probeSetRemoved: function(event)
- {
- var probeSet = event.data.probeSet;
- console.assert(this._probeSetSections.has(probeSet), "Removed probe group ", probeSet, " doesn't have a sidebar.");
-
- // First remove probe set from inspected list, then from mapping.
- var inspectedProbeSets = this.inspectedProbeSets;
- var index = inspectedProbeSets.indexOf(probeSet);
- if (index !== -1) {
- inspectedProbeSets.splice(index, 1);
- this.inspectedProbeSets = inspectedProbeSets;
- }
- var removedSection = this._probeSetSections.get(probeSet);
- this._probeSetSections.delete(probeSet);
- removedSection.closed();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,176 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeManager = function()
-{
- WebInspector.Object.call(this);
-
- // Used to detect deleted probe actions.
- this._knownProbeIdentifiersForBreakpoint = new Map;
-
- // Main lookup tables for probes and probe sets.
- this._probesByIdentifier = new Map;
- this._probeSetsByBreakpoint = new Map;
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ActionsDidChange, this._breakpointActionsChanged, this);
-
- // Saved breakpoints should not be restored on the first event loop turn, because it
- // makes manager initialization order very fragile. No breakpoints should be available.
- console.assert(!WebInspector.debuggerManager.breakpoints.length, "No breakpoints should exist before all the managers are constructed.");
-}
-
-WebInspector.ProbeManager.Event = {
- ProbeSetAdded: "probe-manager-probe-set-added",
- ProbeSetRemoved: "probe-manager-probe-set-removed",
-};
-
-WebInspector.ProbeManager.prototype = {
- constructor: WebInspector.ProbeManager,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get probeSets()
- {
- var sets = [];
- for (var set of this._probeSetsByBreakpoint.values())
- sets.push(set);
-
- return sets;
- },
-
- // Protected (called by WebInspector.DebuggerObserver)
-
- didSampleProbe: function(sample)
- {
- console.assert(this._probesByIdentifier.has(sample.probeId), "Unknown probe identifier specified for sample: ", sample);
- var probe = this._probesByIdentifier.get(sample.probeId);
- probe.addSample(new WebInspector.ProbeSample(sample.sampleId, sample.batchId, sample.timestamp, sample.payload));
- },
-
- // Private
-
- _breakpointAdded: function(breakpointOrEvent)
- {
- var breakpoint;
- if (breakpointOrEvent instanceof WebInspector.Breakpoint)
- breakpoint = breakpointOrEvent;
- else
- breakpoint = breakpointOrEvent.data.breakpoint;
-
- console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown object passed as breakpoint: ", breakpoint);
-
- if (this._knownProbeIdentifiersForBreakpoint.has(breakpoint))
- return;
-
- this._knownProbeIdentifiersForBreakpoint.set(breakpoint, new Set);
-
- this._breakpointActionsChanged(breakpoint);
- },
-
- _breakpointRemoved: function(event)
- {
- var breakpoint = event.data.breakpoint;
- console.assert(this._knownProbeIdentifiersForBreakpoint.has(breakpoint));
-
- this._breakpointActionsChanged(breakpoint);
- this._knownProbeIdentifiersForBreakpoint.delete(breakpoint);
- },
-
- _breakpointActionsChanged: function(breakpointOrEvent)
- {
- var breakpoint;
- if (breakpointOrEvent instanceof WebInspector.Breakpoint)
- breakpoint = breakpointOrEvent;
- else
- breakpoint = breakpointOrEvent.target;
-
- console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown object passed as breakpoint: ", breakpoint);
-
- // Sometimes actions change before the added breakpoint is fully dispatched.
- if (!this._knownProbeIdentifiersForBreakpoint.has(breakpoint)) {
- this._breakpointAdded(breakpoint);
- return;
- }
-
- var knownProbeIdentifiers = this._knownProbeIdentifiersForBreakpoint.get(breakpoint);
- var seenProbeIdentifiers = new Set;
-
- breakpoint.probeActions.forEach(function(probeAction) {
- var probeIdentifier = probeAction.id;
- console.assert(probeIdentifier, "Probe added without breakpoint action identifier: ", breakpoint);
-
- seenProbeIdentifiers.add(probeIdentifier);
- if (!knownProbeIdentifiers.has(probeIdentifier)) {
- // New probe; find or create relevant probe set.
- knownProbeIdentifiers.add(probeIdentifier);
- var probeSet = this._probeSetForBreakpoint(breakpoint);
- var newProbe = new WebInspector.Probe(probeIdentifier, breakpoint, probeAction.data);
- this._probesByIdentifier.set(probeIdentifier, newProbe);
- probeSet.addProbe(newProbe);
- return;
- }
-
- var probe = this._probesByIdentifier.get(probeIdentifier);
- console.assert(probe, "Probe known but couldn't be found by identifier: ", probeIdentifier);
- // Update probe expression; if it differed, change events will fire.
- probe.expression = probeAction.data;
- }, this);
-
- // Look for missing probes based on what we saw last.
- knownProbeIdentifiers.forEach(function(probeIdentifier) {
- if (seenProbeIdentifiers.has(probeIdentifier))
- return;
-
- // The probe has gone missing, remove it.
- var probeSet = this._probeSetForBreakpoint(breakpoint);
- var probe = this._probesByIdentifier.get(probeIdentifier);
- this._probesByIdentifier.delete(probeIdentifier);
- knownProbeIdentifiers.delete(probeIdentifier);
- probeSet.removeProbe(probe);
-
- // Remove the probe set if it has become empty.
- if (!probeSet.probes.length) {
- this._probeSetsByBreakpoint.delete(probeSet.breakpoint);
- probeSet.willRemove();
- this.dispatchEventToListeners(WebInspector.ProbeManager.Event.ProbeSetRemoved, {probeSet: probeSet});
- }
- }, this);
- },
-
- _probeSetForBreakpoint: function(breakpoint)
- {
- if (this._probeSetsByBreakpoint.has(breakpoint))
- return this._probeSetsByBreakpoint.get(breakpoint);
-
- var newProbeSet = new WebInspector.ProbeSet(breakpoint);
- this._probeSetsByBreakpoint.set(breakpoint, newProbeSet);
- this.dispatchEventToListeners(WebInspector.ProbeManager.Event.ProbeSetAdded, {probeSet: newProbeSet});
- return newProbeSet;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSet.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSet.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSet.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,162 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.
- */
-
-// A ProbeSet clusters Probes from the same Breakpoint and their samples.
-
-WebInspector.ProbeSet = function(breakpoint)
-{
- console.assert(breakpoint instanceof WebInspector.Breakpoint, "Unknown breakpoint argument: ", breakpoint);
-
- WebInspector.Object.call(this);
- this._breakpoint = breakpoint;
- this._probes = [];
- this._probesByIdentifier = new Map;
-
- this._createDataTable();
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
- WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this);
-}
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ProbeSet);
-
-WebInspector.ProbeSet.Event = {
- ProbeAdded: "probe-set-probe-added",
- ProbeRemoved: "probe-set-probe-removed",
- ResolvedStateDidChange: "probe-set-resolved-state-did-change",
- SamplesCleared: "probe-set-samples-cleared",
-};
-
-WebInspector.ProbeSet.SampleObjectTitle = "Object";
-
-WebInspector.ProbeSet.prototype = {
- constructor: WebInspector.ProbeSet,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get breakpoint()
- {
- return this._breakpoint;
- },
-
- get probes()
- {
- return this._probes.slice();
- },
-
- get dataTable()
- {
- return this._dataTable;
- },
-
- clear: function()
- {
- this._breakpoint.clearActions(WebInspector.BreakpointAction.Type.Probe);
- },
-
- clearSamples: function()
- {
- for (var probe of this._probes)
- probe.clearSamples();
-
- var oldTable = this._dataTable;
- this._createDataTable();
- this.dispatchEventToListeners(WebInspector.ProbeSet.Event.SamplesCleared, {oldTable: oldTable});
- },
-
- createProbe: function(expression)
- {
- this.breakpoint.createAction(WebInspector.BreakpointAction.Type.Probe, null, expression);
- },
-
- addProbe: function(probe)
- {
- console.assert(probe instanceof WebInspector.Probe, "Tried to add non-probe ", probe, " to probe group", this);
- console.assert(probe.breakpoint === this.breakpoint, "Probe and ProbeSet must have same breakpoint.", probe, this);
-
- this._probes.push(probe);
- this._probesByIdentifier.set(probe.id, probe);
-
- this.dataTable.addProbe(probe);
- this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ProbeAdded, probe);
- },
-
- removeProbe: function(probe)
- {
- console.assert(probe instanceof WebInspector.Probe, "Tried to remove non-probe ", probe, " to probe group", this);
- console.assert(this._probes.indexOf(probe) != -1, "Tried to remove probe", probe, " not in group ", this);
- console.assert(this._probesByIdentifier.has(probe.id), "Tried to remove probe", probe, " not in group ", this);
-
- this._probes.splice(this._probes.indexOf(probe), 1);
- this._probesByIdentifier.delete(probe.id);
- this.dataTable.removeProbe(probe);
- this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ProbeRemoved, probe);
- },
-
- willRemove: function()
- {
- console.assert(!this._probes.length, "ProbeSet.willRemove called, but probes still associated with group: ", this._probes);
-
- WebInspector.Frame.removeEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
- WebInspector.Probe.removeEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this);
- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this);
- },
-
- // Private
-
- _mainResourceChanged: function()
- {
- this.dataTable.mainResourceChanged();
- },
-
- _createDataTable: function()
- {
- if (this.dataTable)
- this.dataTable.willRemove();
-
- this._dataTable = new WebInspector.ProbeSetDataTable(this);
- },
-
- _sampleCollected: function(event)
- {
- var sample = event.data;
- console.assert(sample instanceof WebInspector.ProbeSample, "Tried to add non-sample to probe group: ", sample);
-
- var probe = event.target;
- if (!this._probesByIdentifier.has(probe.id))
- return;
-
- console.assert(this.dataTable);
- this.dataTable.addSampleForProbe(probe, sample);
- },
-
- _breakpointResolvedStateDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ResolvedStateDidChange);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDataFramejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataFrame.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataFrame.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataFrame.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataFrame = function(index)
-{
- this._count = 0;
- this._index = index;
- this._separator = false;
-};
-
-WebInspector.ProbeSetDataFrame.compare = function(a, b) {
- console.assert(a instanceof WebInspector.ProbeSetDataFrame, a);
- console.assert(b instanceof WebInspector.ProbeSetDataFrame, b);
-
- return a.index - b.index;
-}
-
-WebInspector.ProbeSetDataFrame.MissingValue = "?";
-
-WebInspector.ProbeSetDataFrame.prototype = {
- constructor: WebInspector.ProbeSetDataFrame,
-
- // Public
-
- get key()
- {
- return String(this._index);
- },
-
- get count()
- {
- return this._count;
- },
-
- get index()
- {
- return this._index;
- },
-
- get isSeparator()
- {
- return this._separator;
- },
-
- // The last data frame before a main frame navigation is marked as a "separator" frame.
- set isSeparator(value)
- {
- this._separator = !!value;
- },
-
- addSampleForProbe: function(probe, sample)
- {
- this[probe.id] = sample;
- this._count++;
- },
-
- missingKeys: function(probeSet)
- {
- return probeSet.probes.filter(function(probe) {
- return !this.hasOwnProperty(probe.id);
- }, this);
- },
-
- isComplete: function(probeSet)
- {
- return !this.missingKeys(probeSet).length;
- },
-
- fillMissingValues: function(probeSet)
- {
- for (var key of this.missingKeys(probeSet))
- this[key] = WebInspector.ProbeSetDataFrame.MissingValue;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,117 +0,0 @@
</span><del>-/*
- * 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.
- */
-
-.details-section.probe-set .data-grid .data-container tr.past-value td {
- background-color: rgba(100, 100, 100, 0.2);
- font-style: italic;
- color: #777;
-}
-
-.details-section.probe-set .data-grid > .data-container td.unknown-value {
- background-color: rgba(230, 230, 230, 0.8);
- background-image: -webkit-repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(255, 255, 255, .5) 7px, rgba(255, 255, 255, .5) 14px);
-}
-
-.details-section.probe-set .data-grid .data-container tr.revealed.highlighted {
- -webkit-animation-duration: 2s;
- animation-timing-function: ease;
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-name: blink-frame-highlight;
-}
-
-@-webkit-keyframes blink-frame-highlight {
- 0% {
- background-color: rgba(144, 111, 199, 0.8);
- }
-
- 100% {
- background-color: rgba(144, 111, 199, 0);
- }
-}
-
-.details-section.probe-set .data-grid .data-container tr.separator {
- border-bottom: 3px solid #555;
-}
-
-.details-section.probe-set .data-grid .data-container tr.separator {
- border-bottom: 2px solid #666;
-}
-
-.details-section.probe-set .data-grid > .data-container tr.data-updated {
- -webkit-animation-duration: 0.3s;
- -webkit-animation-name: blink-probe-frame;
-}
-
-@-webkit-keyframes blink-probe-frame {
- 0% {
- background-color: rgba(144, 111, 199, 1);
- }
-
- 100% {
- background-color: rgba(144, 111, 199, 0);
- }
-}
-
-.details-section.probe-set .data-grid .data-container .selected .section * {
- color: white;
-}
-
-.details-section.probe-set .data-grid .data-container .selected td.unknown-value {
- color: black !important;
-}
-
-.details-section.probe-set .data-grid .data-container .section {
- left: -6px;
-}
-
-.details-section.probe-set .data-grid th {
- height: 21px;
-
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
- background-image: -webkit-linear-gradient(top, rgb(248, 248, 248), rgb(226, 226, 226));
- background-size: 100% 100% !important;
- background-position: center !important;
- background-repeat: no-repeat !important;
-
- box-shadow: inset rgba(255, 255, 255, 0.1) 0 1px 0;
- border-bottom: 1px solid rgb(179, 179, 179) !important;
-}
-
-.details-section.probe-set .data-grid th:not(:last-child) {
- border-right: 1px solid rgb(179, 179, 179);
-}
-
-.details-section.probe-set .data-grid th,
-.details-section.probe-set .data-grid td {
- padding-left: 6px;
- padding-right: 6px;
-}
-
-.details-section.probe-set .data-grid td {
- padding-top: 2px;
- padding-bottom: 2px;
- line-height: 17px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,192 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataGrid = function(probeSet)
-{
- console.assert(probeSet instanceof WebInspector.ProbeSet, "Invalid ProbeSet argument: ", probeSet);
- this.probeSet = probeSet;
-
- var columnsData = {};
- for (var probe of probeSet.probes) {
- var probeTitle = probe.expression || WebInspector.UIString("(uninitialized)");
- columnsData[probe.id] = { title: probeTitle };
- }
- WebInspector.DataGrid.call(this, columnsData);
-
- this._frameNodes = new Map;
- this._nodesSinceLastNavigation = [];
-
- this._listeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid instance listeners");
- this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeAdded, this._setupProbe);
- this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeRemoved, this._teardownProbe);
- this._listeners.register(probeSet, WebInspector.ProbeSet.Event.SamplesCleared, this._setupData);
- this._listeners.register(WebInspector.Probe, WebInspector.Probe.Event.ExpressionChanged, this._probeExpressionChanged)
- this._listeners.install();
-
- this._setupData();
-}
-
-WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName = "data-updated";
-WebInspector.ProbeSetDataGrid.PastFrameStyleClassName = "past-value";
-WebInspector.ProbeSetDataGrid.HighlightedFrameStyleClassName = "highlighted";
-
-WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration = 300; // milliseconds
-
-WebInspector.ProbeSetDataGrid.prototype = {
- constructor: WebInspector.ProbeSetDataGrid,
- __proto__: WebInspector.DataGrid.prototype,
-
- // Public
-
- closed: function()
- {
- for (var probe of this.probeSet)
- this._teardownProbe(probe);
-
- this._listeners.uninstall(true);
- },
-
- // Private
-
- _setupProbe: function(event)
- {
- var probe = event.data;
- this.insertColumn(probe.id, {title: probe.expression});
-
- for (var frame of this._data.frames)
- this._updateNodeForFrame(frame);
- },
-
- _teardownProbe: function(event)
- {
- var probe = event.data;
- this.removeColumn(probe.id);
-
- for (var frame of this._data.frames)
- this._updateNodeForFrame(frame);
- },
-
- _setupData: function()
- {
- this._data = this.probeSet.dataTable;
- for (var frame of this._data.frames)
- this._updateNodeForFrame(frame);
-
- this._dataListeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid data table listeners");
- this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataFrameInserted);
- this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.SeparatorInserted, this._dataSeparatorInserted);
- this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.WillRemove, this._teardownData);
- this._dataListeners.install();
- },
-
- _teardownData: function()
- {
- this._dataListeners.uninstall(true);
- this.removeChildren();
- this._frameNodes = new Map;
- this._separators = new Map;
- delete this._lastUpdatedFrame;
- },
-
- _updateNodeForFrame: function(frame)
- {
- console.assert(frame instanceof WebInspector.ProbeSetDataFrame, "Invalid ProbeSetDataFrame argument: ", frame);
- var node = null;
- if (this._frameNodes.has(frame)) {
- node = this._frameNodes.get(frame);
- node.frame = frame;
- node.refresh();
- } else {
- node = new WebInspector.ProbeSetDataGridNode(this);
- node.frame = frame;
- this._frameNodes.set(frame, node);
- node.createCells();
-
- var sortFunction = function(a, b) {
- return WebInspector.ProbeSetDataFrame.compare(a.frame, b.frame);
- };
- var insertionIndex = insertionIndexForObjectInListSortedByFunction(node, this.children, sortFunction);
- if (insertionIndex === this.children.length)
- this.appendChild(node);
- else if (this.children[insertionIndex].frame.key === frame.key) {
- this.removeChild(this.children[insertionIndex]);
- this.insertChild(node, insertionIndex);
- } else
- this.insertChild(node, insertionIndex);
- }
- console.assert(node);
-
- node.element.classList.add(WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName);
- window.setTimeout(function() {
- node.element.classList.remove(WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName);
- }, WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration);
-
- this._nodesSinceLastNavigation.push(node);
- },
-
- _updateNodeForSeparator: function(frame)
- {
- console.assert(this._frameNodes.has(frame), "Tried to add separator for unknown data frame: ", frame);
- this._frameNodes.get(frame).updateCellsForSeparator(frame, this.probeSet);
-
- for (var node of this._nodesSinceLastNavigation)
- node.element.classList.add(WebInspector.ProbeSetDataGrid.PastFrameStyleClassName);
-
- this._nodesSinceLastNavigation = [];
- },
-
- _dataFrameInserted: function(event)
- {
- var frame = event.data;
- this._lastUpdatedFrame = frame;
- this._updateNodeForFrame(frame);
- },
-
- _dataSeparatorInserted: function(event)
- {
- var frame = event.data;
- this._updateNodeForSeparator(frame);
- },
-
- _probeExpressionChanged: function(event)
- {
- var probe = event.target;
- if (probe.breakpoint !== this.probeSet.breakpoint)
- return;
-
- if (!this.columns.has(probe.id))
- return;
-
- var oldColumn = this.columns.get(probe.id);
- this.removeColumn(probe.id);
- var ordinal = oldColumn.get("ordinal");
- var newColumn = {title: event.data.newValue};
- this.insertColumn(probe.id, newColumn, ordinal);
-
- for (var frame of this._data.frames)
- this._updateNodeForFrame(frame);
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,116 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataGridNode = function(dataGrid)
-{
- console.assert(dataGrid instanceof WebInspector.ProbeSetDataGrid, "Invalid ProbeSetDataGrid argument:", dataGrid);
-
- WebInspector.DataGridNode.call(this, this.data);
- this.dataGrid = dataGrid; // This is set to null in DataGridNode's constructor.
- this._data = {};
-
- this._element = document.createElement("tr");
- this._element.dataGridNode = this;
- this._element.classList.add("revealed");
-};
-
-WebInspector.ProbeSetDataGridNode.SeparatorStyleClassName = "separator";
-WebInspector.ProbeSetDataGridNode.UnknownValueStyleClassName = "unknown-value";
-
-WebInspector.ProbeSetDataGridNode.prototype = {
- constructor: WebInspector.ProbeSetDataGridNode,
- __proto__: WebInspector.DataGridNode.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get data()
- {
- return this._data;
- },
-
- set frame(value)
- {
- console.assert(value instanceof WebInspector.ProbeSetDataFrame, "Invalid ProbeSetDataFrame argument: ", value);
- this._frame = value;
-
- var data = {};
- for (var probe of this.dataGrid.probeSet.probes) {
- var sample = this.frame[probe.id];
- if (!sample || !sample.object)
- data[probe.id] = WebInspector.ProbeSetDataFrame.MissingValue;
- else
- data[probe.id] = sample.object;
- }
- this._data = data;
- },
-
- get frame()
- {
- return this._frame;
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- var sample = this.data[columnIdentifier];
- if (sample === WebInspector.ProbeSetDataFrame.MissingValue) {
- cell.classList.add(WebInspector.ProbeSetDataGridNode.UnknownValueStyleClassName);
- return sample;
- }
-
- if (sample instanceof WebInspector.RemoteObject) {
- switch (sample.type) {
- case "function": // FIXME: is there a better way to visualize functions?
- case "object":
- return new WebInspector.ObjectPropertiesSection(sample, WebInspector.ProbeSet.SampleObjectTitle).element;
- case "string":
- case "number":
- case "boolean":
- case "undefined":
- case "null":
- return document.createTextNode(sample.value);
- case "array":
- // FIXME: reuse existing visualization of arrays here.
- default: console.log("Don't know how to represent sample:", sample);
- }
- }
-
- return sample;
- },
-
- updateCellsFromFrame: function(frame, probeSet)
- {
- },
-
- updateCellsForSeparator: function(frame, probeSet)
- {
- this._element.classList.add(WebInspector.ProbeSetDataGridNode.SeparatorStyleClassName);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDataTablejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataTable.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataTable.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataTable.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,134 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 University of Washington. All rights reserved.
- * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataTable = function(probeSet)
-{
- WebInspector.Object.call(this);
-
- this._probeSet = probeSet;
- this._frames = [];
- this._previousBatchIdentifier = WebInspector.ProbeSetDataTable.SentinelValue;
-};
-
-WebInspector.ProbeSetDataTable.Event = {
- FrameInserted: "probe-set-data-table-frame-inserted",
- SeparatorInserted: "probe-set-data-table-separator-inserted",
- WillRemove: "probe-set-data-table-will-remove"
-};
-
-WebInspector.ProbeSetDataTable.SentinelValue = -1;
-WebInspector.ProbeSetDataTable.UnknownValue = "?";
-
-WebInspector.ProbeSetDataTable.prototype = {
- constructor: WebInspector.ProbeSetDataTable,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get frames()
- {
- return this._frames.slice();
- },
-
- get separators()
- {
- return this._frames.filter(function(frame) { return frame.isSeparator; });
- },
-
- willRemove: function()
- {
- this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.WillRemove);
- this._frames = [];
- delete this._probeSet;
- },
-
- mainResourceChanged: function()
- {
- this.addSeparator();
- },
-
- addSampleForProbe: function(probe, sample)
- {
- // Eagerly save the frame if the batch identifier differs, or we know the frame is full.
- // Create a new frame when the batch identifier differs.
- if (sample.batchId != this._previousBatchIdentifier) {
- if (this._openFrame) {
- this._openFrame.fillMissingValues(this._probeSet);
- this.addFrame(this._openFrame);
- }
- this._openFrame = this.createFrame();
- this._previousBatchIdentifier = sample.batchId;
- }
-
- console.assert(this._openFrame, "Should always have an open frame before adding sample.", this, probe, sample);
- this._openFrame.addSampleForProbe(probe, sample);
- if (this._openFrame.count == this._probeSet.probes.length) {
- this.addFrame(this._openFrame);
- this._openFrame = null;
- }
- },
-
- addProbe: function(probe)
- {
- for (var frame of this.frames)
- if (!frame[probe.id])
- frame[probe.id] = WebInspector.ProbeSetDataTable.UnknownValue;
- },
-
- removeProbe: function(probe)
- {
- for (var frame of this.frames)
- delete frame[probe.id];
- },
-
- // Protected - can be overridden by subclasses.
-
- createFrame: function()
- {
- return new WebInspector.ProbeSetDataFrame(this._frames.length);
- },
-
- addFrame: function(frame)
- {
- this._frames.push(frame);
- this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.FrameInserted, frame);
- },
-
- addSeparator: function()
- {
- // Separators must be associated with a frame.
- if (!this._frames.length)
- return;
-
- var previousFrame = this._frames.lastValue;
- // Don't send out duplicate events for adjacent separators.
- if (previousFrame.isSeparator)
- return;
-
- previousFrame.isSeparator = true;
- this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.SeparatorInserted, previousFrame);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProbeSetDetailsSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProbeSetDetailsSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProbeSetDetailsSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProbeSetDetailsSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,131 +0,0 @@
</span><del>-/*
- * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProbeSetDetailsSection = function(probeSet)
-{
- console.assert(probeSet instanceof WebInspector.ProbeSet, "Invalid ProbeSet argument:", probeSet);
-
- this._listeners = new WebInspector.EventListenerSet(this, "ProbeSetDetailsSection UI listeners");
- this._probeSet = probeSet;
-
- var optionsElement = document.createElement("div");
- optionsElement.classList.add(WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName);
-
- var removeProbeButton = optionsElement.createChild("img");
- removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName);
- removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
- this._listeners.register(removeProbeButton, "click", this._removeButtonClicked);
-
- var clearSamplesButton = optionsElement.createChild("img");
- clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName);
- clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
- this._listeners.register(clearSamplesButton, "click", this._clearSamplesButtonClicked);
-
- var addProbeButton = optionsElement.createChild("img");
- addProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName);
- this._listeners.register(addProbeButton, "click", this._addProbeButtonClicked);
-
- var titleElement = this._probeSetPositionTextOrLink();
- titleElement.classList.add(WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName);
- optionsElement.appendChild(titleElement);
-
- this._dataGrid = new WebInspector.ProbeSetDataGrid(probeSet);
- this._dataGrid.element.classList.add("inline");
- var singletonRow = new WebInspector.DetailsSectionRow;
- singletonRow.element.appendChild(this._dataGrid.element);
- var probeSectionGroup = new WebInspector.DetailsSectionGroup([singletonRow]);
-
- var dummyTitle = "";
- WebInspector.DetailsSection.call(this, "probe", dummyTitle, [probeSectionGroup], optionsElement);
- this.element.classList.add(WebInspector.ProbeSetDetailsSection.StyleClassName);
-
- this._listeners.install();
-};
-
-WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName = "probe-add";
-WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName = "dont-float";
-WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName = "enabled";
-WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName = "probe-popover";
-WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName = "probe-clear-samples";
-WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName = "probe-remove";
-WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName = "options";
-WebInspector.ProbeSetDetailsSection.StyleClassName = "probe-set";
-
-WebInspector.ProbeSetDetailsSection.prototype = {
- __proto__: WebInspector.DetailsSection.prototype,
- constructor: WebInspector.ProbeSetDetailsSection,
-
- // Public
-
- closed: function()
- {
- this._listeners.uninstall(true);
- this.element.remove();
- },
-
- // Private
-
- _probeSetPositionTextOrLink: function()
- {
- var breakpoint = this._probeSet.breakpoint;
- return WebInspector.createSourceCodeLocationLink(breakpoint.sourceCodeLocation);
- },
-
- _addProbeButtonClicked: function(event)
- {
- function createProbeFromEnteredExpression(visiblePopover, event)
- {
- if (event.keyCode !== 13)
- return;
- var expression = event.target.value;
- this._probeSet.createProbe(expression);
- visiblePopover.dismiss();
- }
-
- var popover = new WebInspector.Popover;
- var content = document.createElement("div");
- content.classList.add(WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName);
- content.createChild("div").textContent = WebInspector.UIString("Add New Probe Expression");
- var textBox = content.createChild("input");
- textBox.addEventListener("keypress", createProbeFromEnteredExpression.bind(this, popover));
- textBox.addEventListener("click", function (event) {event.target.select()});
- textBox.type = "text";
- textBox.placeholder = WebInspector.UIString("Expression");
- popover.content = content;
- var target = WebInspector.Rect.rectFromClientRect(event.target.getBoundingClientRect());
- popover.present(target, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
- textBox.select();
- },
-
- _removeButtonClicked: function(event)
- {
- this._probeSet.clear();
- },
-
- _clearSamplesButtonClicked: function(event)
- {
- this._probeSet.clearSamples();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfilejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Profile.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Profile.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Profile.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Profile = function(topDownRootNodes, idleTime)
-{
- WebInspector.Object.call(this);
-
- topDownRootNodes = topDownRootNodes || [];
-
- console.assert(topDownRootNodes instanceof Array);
- console.assert(topDownRootNodes.reduce(function(previousValue, node) { return previousValue && node instanceof WebInspector.ProfileNode; }, true));
-
- this._topDownRootNodes = topDownRootNodes;
- this._idleTime = idleTime || 0;
-};
-
-WebInspector.Profile.prototype = {
- constructor: WebInspector.Profile,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get idleTime()
- {
- return this._idleTime;
- },
-
- get topDownRootNodes()
- {
- return this._topDownRootNodes;
- },
-
- get bottomUpRootNodes()
- {
- // FIXME: Implement.
- return [];
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,220 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNode = function(id, type, functionName, sourceCodeLocation, calls, childNodes)
-{
- WebInspector.Object.call(this);
-
- childNodes = childNodes || [];
-
- console.assert(id);
- console.assert(calls instanceof Array);
- console.assert(calls.length >= 1);
- console.assert(calls.reduce(function(previousValue, call) { return previousValue && call instanceof WebInspector.ProfileNodeCall; }, true));
- console.assert(childNodes instanceof Array);
- console.assert(childNodes.reduce(function(previousValue, node) { return previousValue && node instanceof WebInspector.ProfileNode; }, true));
-
- this._id = id;
- this._type = type || WebInspector.ProfileNode.Type.Function;
- this._functionName = functionName || null;
- this._sourceCodeLocation = sourceCodeLocation || null;
- this._calls = calls;
- this._childNodes = childNodes;
- this._parentNode = null;
- this._previousSibling = null;
- this._nextSibling = null;
-
- for (var i = 0; i < this._childNodes.length; ++i)
- this._childNodes[i].establishRelationships(this, this._childNodes[i - 1], this._childNodes[i + 1]);
-
- for (var i = 0; i < this._calls.length; ++i)
- this._calls[i].establishRelationships(this, this._calls[i - 1], this._calls[i + 1]);
-
- var info = this.computeCallInfoForTimeRange(0, Infinity);
- this._startTime = info.startTime;
- this._endTime = info.endTime;
- this._selfTime = info.selfTime;
- this._totalTime = info.totalTime;
-};
-
-WebInspector.ProfileNode.Type = {
- Function: "profile-node-type-function",
- Program: "profile-node-type-program"
-};
-
-WebInspector.ProfileNode.TypeIdentifier = "profile-node";
-WebInspector.ProfileNode.TypeCookieKey = "profile-node-type";
-WebInspector.ProfileNode.FunctionNameCookieKey = "profile-node-function-name";
-WebInspector.ProfileNode.SourceCodeURLCookieKey = "profile-node-source-code-url";
-WebInspector.ProfileNode.SourceCodeLocationLineCookieKey = "profile-node-source-code-location-line";
-WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey = "profile-node-source-code-location-column";
-
-WebInspector.ProfileNode.prototype = {
- constructor: WebInspector.ProfileNode,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get type()
- {
- return this._type;
- },
-
- get functionName()
- {
- return this._functionName;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- get selfTime()
- {
- return this._selfTime;
- },
-
- get totalTime()
- {
- return this._totalTime;
- },
-
- get calls()
- {
- return this._calls;
- },
-
- get previousSibling()
- {
- return this._previousSibling;
- },
-
- get nextSibling()
- {
- return this._nextSibling;
- },
-
- get parentNode()
- {
- return this._parentNode;
- },
-
- get childNodes()
- {
- return this._childNodes;
- },
-
- computeCallInfoForTimeRange: function(rangeStartTime, rangeEndTime)
- {
- console.assert(typeof rangeStartTime === "number");
- console.assert(typeof rangeEndTime === "number");
-
- var recordCallCount = true;
- var callCount = 0;
-
- function totalTimeInRange(previousValue, call)
- {
- if (rangeStartTime > call.endTime || rangeEndTime < call.startTime)
- return previousValue;
-
- if (recordCallCount)
- ++callCount;
-
- return previousValue + Math.min(call.endTime, rangeEndTime) - Math.max(rangeStartTime, call.startTime);
- }
-
- var startTime = Math.max(rangeStartTime, this._calls[0].startTime);
- var endTime = Math.min(this._calls.lastValue.endTime, rangeEndTime);
- var totalTime = this._calls.reduce(totalTimeInRange, 0);
-
- recordCallCount = false;
-
- var childNodesTotalTime = 0;
- for (var childNode of this._childNodes)
- childNodesTotalTime += childNode.calls.reduce(totalTimeInRange, 0);
-
- var selfTime = totalTime - childNodesTotalTime;
- var averageTime = selfTime / callCount;
-
- return {startTime: startTime, endTime: endTime, totalTime: totalTime, selfTime: selfTime, callCount: callCount, averageTime: averageTime};
- },
-
- traverseNextProfileNode: function(stayWithin)
- {
- var profileNode = this._childNodes[0];
- if (profileNode)
- return profileNode;
-
- if (this === stayWithin)
- return null;
-
- profileNode = this._nextSibling;
- if (profileNode)
- return profileNode;
-
- profileNode = this;
- while (profileNode && !profileNode.nextSibling && profileNode.parentNode !== stayWithin)
- profileNode = profileNode.parentNode;
-
- if (!profileNode)
- return null;
-
- return profileNode.nextSibling;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.ProfileNode.TypeCookieKey] = this._type || null;
- cookie[WebInspector.ProfileNode.FunctionNameCookieKey] = this._functionName || null;
- cookie[WebInspector.ProfileNode.SourceCodeURLCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url ? this._sourceCodeLocation.sourceCode.url.hash : null : null;
- cookie[WebInspector.ProfileNode.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
- cookie[WebInspector.ProfileNode.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
- },
-
- // Protected
-
- establishRelationships: function(parentNode, previousSibling, nextSibling)
- {
- this._parentNode = parentNode || null;
- this._previousSibling = previousSibling || null;
- this._nextSibling = nextSibling || null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileNodeCalljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileNodeCall.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileNodeCall.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileNodeCall.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,68 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeCall = function(startTime, totalTime)
-{
- WebInspector.Object.call(this);
-
- console.assert(startTime);
-
- this._startTime = startTime;
- this._totalTime = totalTime || 0;
- this._parentNode = null;
- this._previousSibling = null;
- this._nextSibling = null;
-};
-
-WebInspector.ProfileNodeCall.prototype = {
- constructor: WebInspector.ProfileNodeCall,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get startTime()
- {
- return this._startTime;
- },
-
- get totalTime()
- {
- return this._totalTime;
- },
-
- get endTime()
- {
- return this._startTime + this._totalTime;
- },
-
- // Protected
-
- establishRelationships: function(parentNode, previousSibling, nextSibling)
- {
- this._parentNode = parentNode || null;
- this._previousSibling = previousSibling || null;
- this._nextSibling = nextSibling || null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileNodeDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileNodeDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileNodeDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileNodeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,124 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeDataGridNode = function(profileNode, baseStartTime, rangeStartTime, rangeEndTime)
-{
- var hasChildren = !!profileNode.childNodes.length;
-
- WebInspector.TimelineDataGridNode.call(this, false, null, hasChildren);
-
- this._profileNode = profileNode;
- this._baseStartTime = baseStartTime || 0;
- this._rangeStartTime = rangeStartTime || 0;
- this._rangeEndTime = typeof rangeEndTime === "number" ? rangeEndTime : Infinity;
-
- this._data = this._profileNode.computeCallInfoForTimeRange(this._rangeStartTime, this._rangeEndTime);
- this._data.location = this._profileNode.sourceCodeLocation;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ProfileNodeDataGridNode);
-
-WebInspector.ProfileNodeDataGridNode.IconStyleClassName = "icon";
-
-WebInspector.ProfileNodeDataGridNode.prototype = {
- constructor: WebInspector.ProfileNodeDataGridNode,
- __proto__: WebInspector.TimelineDataGridNode.prototype,
-
- // Public
-
- get profileNode()
- {
- return this._profileNode;
- },
-
- get records()
- {
- return null;
- },
-
- get baseStartTime()
- {
- return this._baseStartTime;
- },
-
- get rangeStartTime()
- {
- return this._rangeStartTime;
- },
-
- set rangeStartTime(x)
- {
- if (this._rangeStartTime === x)
- return;
-
- this._rangeStartTime = x;
- this.needsRefresh();
- },
-
- get rangeEndTime()
- {
- return this._rangeEndTime;
- },
-
- set rangeEndTime(x)
- {
- if (this._rangeEndTime === x)
- return;
-
- this._rangeEndTime = x;
- this.needsRefresh();
- },
-
- get data()
- {
- return this._data;
- },
-
- refresh: function()
- {
- this._data = this._profileNode.computeCallInfoForTimeRange(this._rangeStartTime, this._rangeEndTime);
- this._data.location = this._profileNode.sourceCodeLocation;
-
- WebInspector.TimelineDataGridNode.prototype.refresh.call(this);
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- const emptyValuePlaceholderString = "\u2014";
- var value = this.data[columnIdentifier];
-
- switch (columnIdentifier) {
- case "startTime":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
-
- case "selfTime":
- case "totalTime":
- case "averageTime":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
- }
-
- return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProfileNodeTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ProfileNodeTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ProfileNodeTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ProfileNodeTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,138 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeTreeElement = function(profileNode, delegate)
-{
- console.assert(profileNode);
-
- this._profileNode = profileNode;
- this._delegate = delegate || null;
-
- var title = profileNode.functionName;
- var subtitle = "";
-
- if (!title) {
- switch (profileNode.type) {
- case WebInspector.ProfileNode.Type.Function:
- title = WebInspector.UIString("(anonymous function)");
- break;
- case WebInspector.ProfileNode.Type.Program:
- title = WebInspector.UIString("(program)");
- break;
- default:
- title = WebInspector.UIString("(anonymous function)");
- console.error("Unknown ProfileNode type: " + profileNode.type);
- }
- }
-
- var sourceCodeLocation = this._profileNode.sourceCodeLocation;
- if (sourceCodeLocation) {
- subtitle = document.createElement("span");
- sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent");
- }
-
- var className;
-
- switch (this._profileNode.type) {
- case WebInspector.ProfileNode.Type.Function:
- className = WebInspector.CallFrameTreeElement.FunctionIconStyleClassName;
- if (!sourceCodeLocation)
- className = WebInspector.CallFrameTreeElement.NativeIconStyleClassName;
- break;
- case WebInspector.ProfileNode.Type.Program:
- className = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
- break;
- }
-
- console.assert(className);
-
- // This is more than likely an event listener function with an "on" prefix and it is
- // as long or longer than the shortest event listener name -- "oncut".
- if (profileNode.functionName && profileNode.functionName.startsWith("on") && profileNode.functionName.length >= 5)
- className = WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName;
-
- var hasChildren = !!profileNode.childNodes.length;
-
- WebInspector.GeneralTreeElement.call(this, [className], title, subtitle, profileNode, hasChildren);
-
- this.small = true;
- this.shouldRefreshChildren = true;
-
- if (sourceCodeLocation)
- this.tooltipHandledSeparately = true;
-};
-
-WebInspector.ProfileNodeTreeElement.prototype = {
- constructor: WebInspector.ProfileNodeTreeElement,
- __proto__: WebInspector.GeneralTreeElement.prototype,
-
- // Public
-
- get profileNode()
- {
- return this._profileNode;
- },
-
- get filterableData()
- {
- var url = this._profileNode.sourceCodeLocation ? this._profileNode.sourceCodeLocation.sourceCode.url : "";
- return {text: [this.mainTitle, url || ""]};
- },
-
- // Protected
-
- onattach: function()
- {
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
- console.assert(this.element);
-
- if (!this.tooltipHandledSeparately)
- return;
-
- var tooltipPrefix = this.mainTitle + "\n";
- this._profileNode.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
- },
-
- onpopulate: function()
- {
- if (!this.hasChildren || !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
-
- if (this._delegate && typeof this._delegate.populateProfileNodeTreeElement === "function") {
- this._delegate.populateProfileNodeTreeElement(this);
- return;
- }
-
- for (var childProfileNode of this._profileNode.childNodes) {
- var childTreeElement = new WebInspector.ProfileNodeTreeElement(childProfileNode);
- this.appendChild(childTreeElement);
- }
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfacePropertiesSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/PropertiesSection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/PropertiesSection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/PropertiesSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.PropertiesSection = function(title, subtitle)
-{
- this.propertiesElement = document.createElement("ol");
- this.propertiesElement.className = "properties properties-tree";
- this.propertiesElement.tabIndex = 0;
- this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);
- this.propertiesTreeOutline.section = this;
-
- WebInspector.Section.call(this, title, subtitle);
-
- this.element.appendChild(this.propertiesElement);
-}
-
-WebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolApplicationCacheObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/ApplicationCacheObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/ApplicationCacheObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/ApplicationCacheObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.ApplicationCacheObserver.prototype = {
+ constructor: WebInspector.ApplicationCacheObserver,
+
+ // Events defined by the "ApplicationCache" domain.
+
+ applicationCacheStatusUpdated: function(frameId, manifestURL, status)
+ {
+ WebInspector.applicationCacheManager.applicationCacheStatusUpdated(frameId, manifestURL, status);
+ },
+
+ networkStateUpdated: function(isNowOnline)
+ {
+ WebInspector.applicationCacheManager.networkStateUpdated(isNowOnline);
+ }
+};
+
+WebInspector.ApplicationCacheObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolCSSObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.CSSObserver.prototype = {
+ constructor: WebInspector.CSSObserver,
+
+ // Events defined by the "CSS" domain.
+
+ mediaQueryResultChanged: function()
+ {
+ WebInspector.cssStyleManager.mediaQueryResultChanged();
+ },
+
+ styleSheetChanged: function(styleSheetId)
+ {
+ WebInspector.cssStyleManager.styleSheetChanged(styleSheetId);
+ },
+
+ styleSheetAdded: function(header)
+ {
+ // FIXME: Not implemented. <rdar://problem/13213680>
+ },
+
+ styleSheetRemoved: function(header)
+ {
+ // FIXME: Not implemented. <rdar://problem/13213680>
+ },
+
+ namedFlowCreated: function(namedFlow)
+ {
+ WebInspector.domTreeManager.namedFlowCreated(namedFlow);
+ },
+
+ namedFlowRemoved: function(documentNodeId, flowName)
+ {
+ WebInspector.domTreeManager.namedFlowRemoved(documentNodeId, flowName);
+ },
+
+ regionLayoutUpdated: function(namedFlow)
+ {
+ WebInspector.domTreeManager.regionLayoutUpdated(namedFlow);
+ },
+
+ regionOversetChanged: function(namedFlow)
+ {
+ WebInspector.domTreeManager.regionOversetChanged(namedFlow);
+ },
+
+ registeredNamedFlowContentElement: function(documentNodeId, flowName, contentNodeId, nextContentElementNodeId)
+ {
+ WebInspector.domTreeManager.registeredNamedFlowContentElement(documentNodeId, flowName, contentNodeId, nextContentElementNodeId);
+ },
+
+ unregisteredNamedFlowContentElement: function(documentNodeId, flowName, contentNodeId)
+ {
+ WebInspector.domTreeManager.unregisteredNamedFlowContentElement(documentNodeId, flowName, contentNodeId);
+ }
+};
+
+WebInspector.CSSObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolConsoleObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ConsoleObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.ConsoleObserver.prototype = {
+ constructor: WebInspector.ConsoleObserver,
+
+ // Events defined by the "Console" domain.
+
+ messageAdded: function(message)
+ {
+ if (message.level === "warning" || message.level === "error")
+ WebInspector.issueManager.issueWasAdded(message.source, message.level, message.text, message.url, message.line, message.column || 0, message.parameters);
+
+ if (message.url === "[native code]") {
+ if (message.type === "profile")
+ WebInspector.legacyProfileManager.profileWasStartedFromConsole(message.text);
+ else if (message.type === "profileEnd")
+ WebInspector.legacyProfileManager.profileWasEndedFromConsole();
+ }
+
+ if (message.source === "console-api" && message.type === "clear")
+ return;
+
+ WebInspector.logManager.messageWasAdded(message.source, message.level, message.text, message.type, message.url, message.line, message.column || 0, message.repeatCount, message.parameters, message.stackTrace, message.networkRequestId);
+ },
+
+ messageRepeatCountUpdated: function(count)
+ {
+ WebInspector.logManager.messageRepeatCountUpdated(count);
+ },
+
+ messagesCleared: function()
+ {
+ WebInspector.logManager.messagesCleared();
+ }
+};
+
+WebInspector.ConsoleObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolDOMObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.DOMObserver.prototype = {
+ constructor: WebInspector.DOMObserver,
+
+ // Events defined by the "DOM" domain.
+
+ documentUpdated: function()
+ {
+ WebInspector.domTreeManager._documentUpdated();
+ },
+
+ setChildNodes: function(parentId, payloads)
+ {
+ WebInspector.domTreeManager._setChildNodes(parentId, payloads);
+ },
+
+ attributeModified: function(nodeId, name, value)
+ {
+ WebInspector.domTreeManager._attributeModified(nodeId, name, value);
+ },
+
+ attributeRemoved: function(nodeId, name)
+ {
+ WebInspector.domTreeManager._attributeRemoved(nodeId, name);
+ },
+
+ inlineStyleInvalidated: function(nodeIds)
+ {
+ WebInspector.domTreeManager._inlineStyleInvalidated(nodeIds);
+ },
+
+ characterDataModified: function(nodeId, characterData)
+ {
+ WebInspector.domTreeManager._characterDataModified(nodeId, characterData);
+ },
+
+ childNodeCountUpdated: function(nodeId, childNodeCount)
+ {
+ WebInspector.domTreeManager._childNodeCountUpdated(nodeId, childNodeCount);
+ },
+
+ childNodeInserted: function(parentNodeId, previousNodeId, payload)
+ {
+ WebInspector.domTreeManager._childNodeInserted(parentNodeId, previousNodeId, payload);
+ },
+
+ childNodeRemoved: function(parentNodeId, nodeId)
+ {
+ WebInspector.domTreeManager._childNodeRemoved(parentNodeId, nodeId);
+ },
+
+ shadowRootPushed: function(parentNodeId, nodeId)
+ {
+ WebInspector.domTreeManager._childNodeInserted(parentNodeId, 0, nodeId);
+ },
+
+ shadowRootPopped: function(parentNodeId, nodeId)
+ {
+ WebInspector.domTreeManager._childNodeRemoved(parentNodeId, nodeId);
+ }
+};
+
+WebInspector.DOMObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolDOMStorageObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMStorageObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMStorageObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMStorageObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.DOMStorageObserver.prototype = {
+ constructor: WebInspector.DOMStorageObserver,
+ __proto__: WebInspector.Object.prototype,
+
+ // Events defined by the "DOMStorage" domain.
+
+ // COMPATIBILITY (iOS 6): This event no longer exists. It is still needed and called on iOS 6.
+ addDOMStorage: function(storage)
+ {
+ WebInspector.storageManager.domStorageWasAdded(storage.id, storage.host, storage.isLocalStorage);
+ },
+
+ // COMPATIBILITY (iOS 6): This event was split into the granular events below.
+ updateDOMStorage: function(storageId)
+ {
+ WebInspector.storageManager.domStorageWasUpdated(storageId);
+ },
+
+ domStorageItemsCleared: function(storageId)
+ {
+ WebInspector.storageManager.itemsCleared(storageId);
+ },
+
+ domStorageItemRemoved: function(storageId, key)
+ {
+ WebInspector.storageManager.itemRemoved(storageId, key);
+ },
+
+ domStorageItemAdded: function(storageId, key, value)
+ {
+ WebInspector.storageManager.itemAdded(storageId, key, value);
+ },
+
+ domStorageItemUpdated: function(storageId, key, oldValue, value)
+ {
+ WebInspector.storageManager.itemUpdated(storageId, key, oldValue, value);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolDatabaseObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/DatabaseObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/DatabaseObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/DatabaseObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.DatabaseObserver._callbacks = {};
+
+WebInspector.DatabaseObserver.prototype = {
+ constructor: WebInspector.DatabaseObserver,
+
+ // Events defined by the "Database" domain.
+
+ addDatabase: function(database)
+ {
+ WebInspector.storageManager.databaseWasAdded(database.id, database.domain, database.name, database.version);
+ },
+
+ // COMPATIBILITY (iOS 6): This event was removed in favor of a more async DatabaseAgent.executeSQL.
+ sqlTransactionSucceeded: function(transactionId, columnNames, values)
+ {
+ if (!WebInspector.DatabaseObserver._callbacks[transactionId])
+ return;
+
+ var callback = WebInspector.DatabaseObserver._callbacks[transactionId];
+ delete WebInspector.DatabaseObserver._callbacks[transactionId];
+
+ if (callback)
+ callback(columnNames, values, null);
+ },
+
+ // COMPATIBILITY (iOS 6): This event was removed in favor of a more async DatabaseAgent.executeSQL.
+ sqlTransactionFailed: function(transactionId, sqlError)
+ {
+ if (!WebInspector.DatabaseObserver._callbacks[transactionId])
+ return;
+
+ var callback = WebInspector.DatabaseObserver._callbacks[transactionId];
+ delete WebInspector.DatabaseObserver._callbacks[transactionId];
+
+ if (callback)
+ callback(null, null, sqlError);
+ }
+};
+
+WebInspector.DatabaseObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolDebuggerObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDebuggerObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DebuggerObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.DebuggerObserver.prototype = {
+ constructor: WebInspector.DebuggerObserver,
+
+ // Events defined by the "Debugger" domain.
+
+ globalObjectCleared: function()
+ {
+ WebInspector.debuggerManager.reset();
+ },
+
+ scriptParsed: function(scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL, hasSourceURL)
+ {
+ WebInspector.debuggerManager.scriptDidParse(scriptId, url, isContentScript, startLine, startColumn, endLine, endColumn, sourceMapURL);
+ },
+
+ scriptFailedToParse: function(url, scriptSource, startLine, errorLine, errorMessage)
+ {
+ // FIXME: Not implemented.
+ },
+
+ breakpointResolved: function(breakpointId, location)
+ {
+ WebInspector.debuggerManager.breakpointResolved(breakpointId, location);
+ },
+
+ paused: function(callFrames, reason, data)
+ {
+ WebInspector.debuggerManager.debuggerDidPause(callFrames);
+ },
+
+ resumed: function()
+ {
+ WebInspector.debuggerManager.debuggerDidResume();
+ },
+
+ playBreakpointActionSound: function(breakpointActionIdentifier)
+ {
+ WebInspector.debuggerManager.playBreakpointActionSound(breakpointActionIdentifier);
+ },
+
+ didSampleProbe: function(sample)
+ {
+ WebInspector.probeManager.didSampleProbe(sample);
+ }
+};
+
+WebInspector.DebuggerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorBackendjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorBackendjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorBackend.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @constructor
+ */
+function InspectorBackendClass()
+{
+ this._lastCallbackId = 1;
+ this._pendingResponsesCount = 0;
+ this._callbacks = {};
+ this._domainDispatchers = {};
+ this._eventArgs = {};
+ this._replyArgs = {};
+
+ this.dumpInspectorTimeStats = false;
+ this.dumpInspectorProtocolMessages = false;
+}
+
+InspectorBackendClass.prototype = {
+ _wrap: function(callback, method)
+ {
+ var callbackId = this._lastCallbackId++;
+ if (!callback)
+ callback = function() {};
+
+ this._callbacks[callbackId] = callback;
+ callback.methodName = method;
+ if (this.dumpInspectorTimeStats)
+ callback.sendRequestTime = Date.now();
+
+ return callbackId;
+ },
+
+ _getAgent: function(domain)
+ {
+ var agentName = domain + "Agent";
+ if (!window[agentName])
+ window[agentName] = {};
+ return window[agentName];
+ },
+
+ registerCommand: function(method, signature, replyArgs)
+ {
+ var domainAndMethod = method.split(".");
+ var agent = this._getAgent(domainAndMethod[0]);
+
+ agent[domainAndMethod[1]] = this._sendMessageToBackend.bind(this, method, signature);
+ agent[domainAndMethod[1]]["invoke"] = this._invoke.bind(this, method, signature);
+ agent[domainAndMethod[1]]["supports"] = this._supports.bind(this, method, signature);
+ this._replyArgs[method] = replyArgs;
+ },
+
+ registerEnum: function(type, values)
+ {
+ var domainAndMethod = type.split(".");
+ var agent = this._getAgent(domainAndMethod[0]);
+
+ agent[domainAndMethod[1]] = values;
+ },
+
+ registerEvent: function(eventName, params)
+ {
+ this._eventArgs[eventName] = params;
+ },
+
+ _invoke: function(method, signature, args, callback)
+ {
+ this._wrapCallbackAndSendMessageObject(method, args, callback);
+ },
+
+ _supports: function(method, signature, paramName)
+ {
+ for (var i = 0; i < signature.length; ++i) {
+ if (signature[i]["name"] === paramName)
+ return true;
+ }
+
+ return false;
+ },
+
+ _sendMessageToBackend: function(method, signature, vararg)
+ {
+ var args = Array.prototype.slice.call(arguments, 2);
+ var callback = typeof args.lastValue === "function" ? args.pop() : null;
+
+ var params = {};
+ var hasParams = false;
+ for (var i = 0; i < signature.length; ++i) {
+ var param = signature[i];
+ var paramName = param["name"];
+ var typeName = param["type"];
+ var optionalFlag = param["optional"];
+
+ if (!args.length && !optionalFlag) {
+ console.error("Protocol Error: Invalid number of arguments for method '" + method + "' call. It must have the following arguments '" + JSON.stringify(signature) + "'.");
+ return;
+ }
+
+ var value = args.shift();
+ if (optionalFlag && typeof value === "undefined") {
+ continue;
+ }
+
+ if (typeof value !== typeName) {
+ console.error("Protocol Error: Invalid type of argument '" + paramName + "' for method '" + method + "' call. It must be '" + typeName + "' but it is '" + typeof value + "'.");
+ return;
+ }
+
+ params[paramName] = value;
+ hasParams = true;
+ }
+
+ if (args.length === 1 && !callback) {
+ if (typeof args[0] !== "undefined") {
+ console.error("Protocol Error: Optional callback argument for method '" + method + "' call must be a function but its type is '" + typeof args[0] + "'.");
+ return;
+ }
+ }
+
+ this._wrapCallbackAndSendMessageObject(method, hasParams ? params : null, callback);
+ },
+
+ _wrapCallbackAndSendMessageObject: function(method, params, callback)
+ {
+ var messageObject = {};
+ messageObject.method = method;
+ if (params)
+ messageObject.params = params;
+ messageObject.id = this._wrap(callback, method);
+
+ if (this.dumpInspectorProtocolMessages)
+ console.log("frontend: " + JSON.stringify(messageObject));
+
+ ++this._pendingResponsesCount;
+ this.sendMessageObjectToBackend(messageObject);
+ },
+
+ sendMessageObjectToBackend: function(messageObject)
+ {
+ var message = JSON.stringify(messageObject);
+ InspectorFrontendHost.sendMessageToBackend(message);
+ },
+
+ registerDomainDispatcher: function(domain, dispatcher)
+ {
+ this._domainDispatchers[domain] = dispatcher;
+ },
+
+ dispatch: function(message)
+ {
+ if (this.dumpInspectorProtocolMessages)
+ console.log("backend: " + ((typeof message === "string") ? message : JSON.stringify(message)));
+
+ var messageObject = (typeof message === "string") ? JSON.parse(message) : message;
+
+ if ("id" in messageObject) { // just a response for some request
+ if (messageObject.error) {
+ if (messageObject.error.code !== -32000)
+ this.reportProtocolError(messageObject);
+ }
+
+ var callback = this._callbacks[messageObject.id];
+ if (callback) {
+ var argumentsArray = [];
+ if (messageObject.result) {
+ if (callback.expectsResultObject) {
+ // The callback expects results as an object with properties, this is useful
+ // for backwards compatibility with renamed or different parameters.
+ argumentsArray.push(messageObject.result);
+ } else {
+ var paramNames = this._replyArgs[callback.methodName];
+ if (paramNames) {
+ for (var i = 0; i < paramNames.length; ++i)
+ argumentsArray.push(messageObject.result[paramNames[i]]);
+ }
+ }
+ }
+
+ var processingStartTime;
+ if (this.dumpInspectorTimeStats && callback.methodName)
+ processingStartTime = Date.now();
+
+ argumentsArray.unshift(messageObject.error ? messageObject.error.message : null);
+ callback.apply(null, argumentsArray);
+ --this._pendingResponsesCount;
+ delete this._callbacks[messageObject.id];
+
+ if (this.dumpInspectorTimeStats && callback.methodName)
+ console.log("time-stats: " + callback.methodName + " = " + (processingStartTime - callback.sendRequestTime) + " + " + (Date.now() - processingStartTime));
+ }
+
+ if (this._scripts && !this._pendingResponsesCount)
+ this.runAfterPendingDispatches();
+
+ return;
+ } else {
+ var method = messageObject.method.split(".");
+ var domainName = method[0];
+ var functionName = method[1];
+ if (!(domainName in this._domainDispatchers)) {
+ console.error("Protocol Error: the message is for non-existing domain '" + domainName + "'");
+ return;
+ }
+ var dispatcher = this._domainDispatchers[domainName];
+ if (!(functionName in dispatcher)) {
+ console.error("Protocol Error: Attempted to dispatch an unimplemented method '" + messageObject.method + "'");
+ return;
+ }
+
+ if (!this._eventArgs[messageObject.method]) {
+ console.error("Protocol Error: Attempted to dispatch an unspecified method '" + messageObject.method + "'");
+ return;
+ }
+
+ var params = [];
+ if (messageObject.params) {
+ var paramNames = this._eventArgs[messageObject.method];
+ for (var i = 0; i < paramNames.length; ++i)
+ params.push(messageObject.params[paramNames[i]]);
+ }
+
+ var processingStartTime;
+ if (this.dumpInspectorTimeStats)
+ processingStartTime = Date.now();
+
+ dispatcher[functionName].apply(dispatcher, params);
+
+ if (this.dumpInspectorTimeStats)
+ console.log("time-stats: " + messageObject.method + " = " + (Date.now() - processingStartTime));
+ }
+ },
+
+ reportProtocolError: function(messageObject)
+ {
+ console.error("Request with id = " + messageObject.id + " failed. " + JSON.stringify(messageObject.error));
+ },
+
+ /**
+ * @param {string=} script
+ */
+ runAfterPendingDispatches: function(script)
+ {
+ if (!this._scripts)
+ this._scripts = [];
+
+ if (script)
+ this._scripts.push(script);
+
+ if (!this._pendingResponsesCount) {
+ var scripts = this._scripts;
+ this._scripts = [];
+ for (var id = 0; id < scripts.length; ++id)
+ scripts[id].call(this);
+ }
+ }
+}
+
+InspectorBackend = new InspectorBackendClass();
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorFrontendAPIjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorFrontendAPIjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendAPI.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,168 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+InspectorFrontendAPI = {
+ _loaded: false,
+
+ _pendingCommands: [],
+
+ savedURL: function(url)
+ {
+ // FIXME: Not implemented.
+ },
+
+ appendedToURL: function(url)
+ {
+ // FIXME: Not implemented.
+ },
+
+ isDebuggingEnabled: function()
+ {
+ // FIXME: Not implemented.
+ return false;
+ },
+
+ setDebuggingEnabled: function(enabled)
+ {
+ // FIXME: Not implemented.
+ },
+
+ isTimelineProfilingEnabled: function()
+ {
+ return WebInspector.timelineManager.recordingEnabled;
+ },
+
+ setTimelineProfilingEnabled: function(enabled)
+ {
+ if (enabled) {
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.timelineSidebarPanel;
+ WebInspector.timelineManager.startRecording();
+ } else {
+ WebInspector.timelineManager.stopRecording();
+ }
+ },
+
+ isProfilingJavaScript: function()
+ {
+ return WebInspector.legacyProfileManager.isProfilingJavaScript();
+ },
+
+ startProfilingJavaScript: function()
+ {
+ WebInspector.legacyProfileManager.startProfilingJavaScript();
+ },
+
+ stopProfilingJavaScript: function()
+ {
+ WebInspector.timelineSidebarPanel.show();
+ WebInspector.legacyProfileManager.stopProfilingJavaScript();
+ },
+
+ setDockSide: function(side)
+ {
+ WebInspector.updateDockedState(side);
+ },
+
+ showConsole: function()
+ {
+ WebInspector.showConsoleView();
+
+ WebInspector.quickConsole.prompt.focus();
+
+ // If the page is still loading, focus the quick console again after tabindex autofocus.
+ if (document.readyState !== "complete")
+ document.addEventListener("readystatechange", this);
+ },
+
+ handleEvent: function(event)
+ {
+ console.assert(event.type === "readystatechange");
+
+ if (document.readyState === "complete") {
+ WebInspector.quickConsole.prompt.focus();
+ document.removeEventListener("readystatechange", this);
+ }
+ },
+
+ showResources: function()
+ {
+ WebInspector.ignoreLastContentCookie = true;
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
+ WebInspector.navigationSidebar.collapsed = false;
+ },
+
+ showMainResourceForFrame: function(frameIdentifier)
+ {
+ WebInspector.ignoreLastContentCookie = true;
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
+ WebInspector.resourceSidebarPanel.showSourceCodeForFrame(frameIdentifier, true);
+ },
+
+ setDockingUnavailable: function(unavailable)
+ {
+ // Not used.
+ },
+
+ contextMenuItemSelected: function(id)
+ {
+ WebInspector.contextMenuItemSelected(id);
+ },
+
+ contextMenuCleared: function()
+ {
+ WebInspector.contextMenuCleared();
+ },
+
+ dispatchMessageAsync: function(messageObject)
+ {
+ WebInspector.dispatchMessageFromBackend(messageObject);
+ },
+
+ dispatchMessage: function(messageObject)
+ {
+ InspectorBackend.dispatch(messageObject);
+ },
+
+ dispatch: function(signature)
+ {
+ if (!InspectorFrontendAPI._loaded) {
+ InspectorFrontendAPI._pendingCommands.push(signature);
+ return null;
+ }
+
+ var methodName = signature.shift();
+ return InspectorFrontendAPI[methodName].apply(InspectorFrontendAPI, signature);
+ },
+
+ loadCompleted: function()
+ {
+ InspectorFrontendAPI._loaded = true;
+
+ for (var i = 0; i < InspectorFrontendAPI._pendingCommands.length; ++i)
+ InspectorFrontendAPI.dispatch(InspectorFrontendAPI._pendingCommands[i]);
+
+ InspectorFrontendAPI._pendingCommands = [];
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorFrontendHostStubjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorFrontendHostStubjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendHostStub.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorFrontendHostStub.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendHostStub.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendHostStub.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Seokju Kwon (seokju.kwon@gmail.com)
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+if (!window.InspectorFrontendHost) {
+ WebInspector.InspectorFrontendHostStub = function()
+ {
+ }
+
+ WebInspector.InspectorFrontendHostStub.prototype = {
+ // Public
+
+ initializeWebSocket: function(url)
+ {
+ var socket = new WebSocket(url);
+ socket.addEventListener("open", socketReady.bind(this));
+
+ function socketReady()
+ {
+ this._socket = socket;
+
+ this._socket.addEventListener("message", function(message) { InspectorBackend.dispatch(message.data); });
+ this._socket.addEventListener("error", function(error) { console.error(error); });
+
+ this._sendPendingMessagesToBackendIfNeeded();
+ }
+ },
+
+ bringToFront: function()
+ {
+ this._windowVisible = true;
+ },
+
+ closeWindow: function()
+ {
+ this._windowVisible = false;
+ },
+
+ requestSetDockSide: function(side)
+ {
+ InspectorFrontendAPI.setDockSide(side);
+ },
+
+ setAttachedWindowHeight: function(height)
+ {
+ },
+
+ setAttachedWindowWidth: function(width)
+ {
+ },
+
+ setToolbarHeight: function(width)
+ {
+ },
+
+ moveWindowBy: function(x, y)
+ {
+ },
+
+ loaded: function()
+ {
+ },
+
+ localizedStringsURL: function()
+ {
+ return undefined;
+ },
+
+ debuggableType: function()
+ {
+ return "web";
+ },
+
+ inspectedURLChanged: function(title)
+ {
+ document.title = title;
+ },
+
+ copyText: function(text)
+ {
+ this._textToCopy = text;
+ if (!document.execCommand("copy"))
+ console.error("Clipboard access is denied");
+ },
+
+ openInNewTab: function(url)
+ {
+ window.open(url, "_blank");
+ },
+
+ save: function(url, content, base64Encoded, forceSaveAs)
+ {
+ },
+
+ sendMessageToBackend: function(message)
+ {
+ if (!this._socket) {
+ if (!this._pendingMessages)
+ this._pendingMessages = [];
+ this._pendingMessages.push(message);
+ return;
+ }
+
+ this._sendPendingMessagesToBackendIfNeeded();
+
+ this._socket.send(message);
+ },
+
+ loadResourceSynchronously: function(url)
+ {
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", url, false);
+ xhr.send(null);
+
+ if (xhr.status === 200)
+ return xhr.responseText;
+ return null;
+ },
+
+ platform: function()
+ {
+ return (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
+ },
+
+ beep: function()
+ {
+ },
+
+ // Private
+
+ _sendPendingMessagesToBackendIfNeeded: function()
+ {
+ if (!this._pendingMessages)
+ return;
+
+ for (var i = 0; i < this._pendingMessages.length; ++i)
+ this._socket.send(this._pendingMessages[i]);
+
+ delete this._pendingMessages;
+ }
+ }
+
+ InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
+
+ WebInspector.dontLocalizeUserInterface = true;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorJSBackendCommandsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorJSBackendCommandsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorJSBackendCommands.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorJSBackendCommands.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorJSBackendCommands.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorJSBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+// File is generated by JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py
+
+// Copyright (c) 2013 Apple Inc. All Rights Reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// Console.
+InspectorBackend.registerConsoleDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Console");
+InspectorBackend.registerEnum("Console.ConsoleMessageSource", {XML: "xml", Javascript: "javascript", Network: "network", ConsoleAPI: "console-api", Storage: "storage", Appcache: "appcache", Rendering: "rendering", CSS: "css", Security: "security", Other: "other"});
+InspectorBackend.registerEnum("Console.ConsoleMessageLevel", {Log: "log", Warning: "warning", Error: "error", Debug: "debug"});
+InspectorBackend.registerEnum("Console.ConsoleMessageType", {Log: "log", Dir: "dir", DirXML: "dirxml", Table: "table", Trace: "trace", Clear: "clear", StartGroup: "startGroup", StartGroupCollapsed: "startGroupCollapsed", EndGroup: "endGroup", Assert: "assert", Timing: "timing", Profile: "profile", ProfileEnd: "profileEnd"});
+InspectorBackend.registerEvent("Console.messageAdded", ["message"]);
+InspectorBackend.registerEvent("Console.messageRepeatCountUpdated", ["count"]);
+InspectorBackend.registerEvent("Console.messagesCleared", []);
+InspectorBackend.registerCommand("Console.enable", [], []);
+InspectorBackend.registerCommand("Console.disable", [], []);
+InspectorBackend.registerCommand("Console.clearMessages", [], []);
+InspectorBackend.registerCommand("Console.setMonitoringXHREnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Console.addInspectedNode", [{"name": "nodeId", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("Console.addInspectedHeapObject", [{"name": "heapObjectId", "type": "number", "optional": false}], []);
+
+// Debugger.
+InspectorBackend.registerDebuggerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Debugger");
+InspectorBackend.registerEnum("Debugger.BreakpointActionType", {Log: "log", Evaluate: "evaluate", Sound: "sound", Probe: "probe"});
+InspectorBackend.registerEnum("Debugger.ScopeType", {Global: "global", Local: "local", With: "with", Closure: "closure", Catch: "catch"});
+InspectorBackend.registerEvent("Debugger.globalObjectCleared", []);
+InspectorBackend.registerEvent("Debugger.scriptParsed", ["scriptId", "url", "startLine", "startColumn", "endLine", "endColumn", "isContentScript", "sourceMapURL", "hasSourceURL"]);
+InspectorBackend.registerEvent("Debugger.scriptFailedToParse", ["url", "scriptSource", "startLine", "errorLine", "errorMessage"]);
+InspectorBackend.registerEvent("Debugger.breakpointResolved", ["breakpointId", "location"]);
+InspectorBackend.registerEvent("Debugger.paused", ["callFrames", "reason", "data"]);
+InspectorBackend.registerEvent("Debugger.resumed", []);
+InspectorBackend.registerEvent("Debugger.didSampleProbe", ["sample"]);
+InspectorBackend.registerEvent("Debugger.playBreakpointActionSound", ["breakpointActionId"]);
+InspectorBackend.registerCommand("Debugger.enable", [], []);
+InspectorBackend.registerCommand("Debugger.disable", [], []);
+InspectorBackend.registerCommand("Debugger.setBreakpointsActive", [{"name": "active", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Debugger.setBreakpointByUrl", [{"name": "lineNumber", "type": "number", "optional": false}, {"name": "url", "type": "string", "optional": true}, {"name": "urlRegex", "type": "string", "optional": true}, {"name": "columnNumber", "type": "number", "optional": true}, {"name": "options", "type": "object", "optional": true}], ["breakpointId", "locations"]);
+InspectorBackend.registerCommand("Debugger.setBreakpoint", [{"name": "location", "type": "object", "optional": false}, {"name": "options", "type": "object", "optional": true}], ["breakpointId", "actualLocation"]);
+InspectorBackend.registerCommand("Debugger.removeBreakpoint", [{"name": "breakpointId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Debugger.continueToLocation", [{"name": "location", "type": "object", "optional": false}], []);
+InspectorBackend.registerCommand("Debugger.stepOver", [], []);
+InspectorBackend.registerCommand("Debugger.stepInto", [], []);
+InspectorBackend.registerCommand("Debugger.stepOut", [], []);
+InspectorBackend.registerCommand("Debugger.pause", [], []);
+InspectorBackend.registerCommand("Debugger.resume", [], []);
+InspectorBackend.registerCommand("Debugger.searchInContent", [{"name": "scriptId", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
+InspectorBackend.registerCommand("Debugger.getScriptSource", [{"name": "scriptId", "type": "string", "optional": false}], ["scriptSource"]);
+InspectorBackend.registerCommand("Debugger.getFunctionDetails", [{"name": "functionId", "type": "string", "optional": false}], ["details"]);
+InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
+InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
+
+// Inspector.
+InspectorBackend.registerInspectorDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Inspector");
+InspectorBackend.registerEvent("Inspector.evaluateForTestInFrontend", ["testCallId", "script"]);
+InspectorBackend.registerEvent("Inspector.inspect", ["object", "hints"]);
+InspectorBackend.registerEvent("Inspector.detached", ["reason"]);
+InspectorBackend.registerEvent("Inspector.targetCrashed", []);
+InspectorBackend.registerCommand("Inspector.enable", [], []);
+InspectorBackend.registerCommand("Inspector.disable", [], []);
+
+// Runtime.
+InspectorBackend.registerRuntimeDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Runtime");
+InspectorBackend.registerEnum("Runtime.RemoteObjectType", {Object: "object", Function: "function", Undefined: "undefined", String: "string", Number: "number", Boolean: "boolean"});
+InspectorBackend.registerEnum("Runtime.RemoteObjectSubtype", {Array: "array", Null: "null", Node: "node", Regexp: "regexp", Date: "date"});
+InspectorBackend.registerEnum("Runtime.PropertyPreviewType", {Object: "object", Function: "function", Undefined: "undefined", String: "string", Number: "number", Boolean: "boolean"});
+InspectorBackend.registerEnum("Runtime.PropertyPreviewSubtype", {Array: "array", Null: "null", Node: "node", Regexp: "regexp", Date: "date"});
+InspectorBackend.registerEnum("Runtime.SyntaxErrorType", {None: "none", Irrecoverable: "irrecoverable", UnterminatedLiteral: "unterminated-literal", Recoverable: "recoverable"});
+InspectorBackend.registerEvent("Runtime.executionContextCreated", ["context"]);
+InspectorBackend.registerCommand("Runtime.parse", [{"name": "source", "type": "string", "optional": false}], ["result", "message", "range"]);
+InspectorBackend.registerCommand("Runtime.evaluate", [{"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "contextId", "type": "number", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
+InspectorBackend.registerCommand("Runtime.callFunctionOn", [{"name": "objectId", "type": "string", "optional": false}, {"name": "functionDeclaration", "type": "string", "optional": false}, {"name": "arguments", "type": "object", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
+InspectorBackend.registerCommand("Runtime.getProperties", [{"name": "objectId", "type": "string", "optional": false}, {"name": "ownProperties", "type": "boolean", "optional": true}], ["result", "internalProperties"]);
+InspectorBackend.registerCommand("Runtime.releaseObject", [{"name": "objectId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Runtime.releaseObjectGroup", [{"name": "objectGroup", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Runtime.run", [], []);
+InspectorBackend.registerCommand("Runtime.enable", [], []);
+InspectorBackend.registerCommand("Runtime.disable", [], []);
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.InspectorObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.InspectorObserver.prototype = {
+ constructor: WebInspector.InspectorObserver,
+
+ // Events defined by the "Inspector" domain.
+
+ evaluateForTestInFrontend: function(testCallId, script)
+ {
+ // FIXME: Not implemented.
+ },
+
+ inspect: function(payload, hints)
+ {
+ var remoteObject = WebInspector.RemoteObject.fromPayload(payload);
+ if (remoteObject.subtype === "node") {
+ WebInspector.domTreeManager.inspectNodeObject(remoteObject);
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
+ return;
+ }
+
+ if (hints.databaseId)
+ WebInspector.storageManager.inspectDatabase(hints.databaseId);
+ else if (hints.domStorageId)
+ WebInspector.storageManager.inspectDOMStorage(hints.domStorageId);
+
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
+
+ remoteObject.release();
+ },
+
+ detached: function(reason)
+ {
+ // FIXME: Not implemented.
+ }
+};
+
+WebInspector.InspectorObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolInspectorWebBackendCommandsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceInspectorWebBackendCommandsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorWebBackendCommands.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorWebBackendCommands.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorWebBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,310 @@
</span><ins>+// File is generated by JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py
+
+// Copyright (c) 2013 Apple Inc. All Rights Reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// ApplicationCache.
+InspectorBackend.registerApplicationCacheDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "ApplicationCache");
+InspectorBackend.registerEvent("ApplicationCache.applicationCacheStatusUpdated", ["frameId", "manifestURL", "status"]);
+InspectorBackend.registerEvent("ApplicationCache.networkStateUpdated", ["isNowOnline"]);
+InspectorBackend.registerCommand("ApplicationCache.getFramesWithManifests", [], ["frameIds"]);
+InspectorBackend.registerCommand("ApplicationCache.enable", [], []);
+InspectorBackend.registerCommand("ApplicationCache.getManifestForFrame", [{"name": "frameId", "type": "string", "optional": false}], ["manifestURL"]);
+InspectorBackend.registerCommand("ApplicationCache.getApplicationCacheForFrame", [{"name": "frameId", "type": "string", "optional": false}], ["applicationCache"]);
+
+// CSS.
+InspectorBackend.registerCSSDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "CSS");
+InspectorBackend.registerEnum("CSS.StyleSheetOrigin", {User: "user", UserAgent: "user-agent", Inspector: "inspector", Regular: "regular"});
+InspectorBackend.registerEnum("CSS.CSSPropertyStatus", {Active: "active", Inactive: "inactive", Disabled: "disabled", Style: "style"});
+InspectorBackend.registerEnum("CSS.CSSMediaSource", {MediaRule: "mediaRule", ImportRule: "importRule", LinkedSheet: "linkedSheet", InlineSheet: "inlineSheet"});
+InspectorBackend.registerEnum("CSS.RegionRegionOverset", {Overset: "overset", Fit: "fit", Empty: "empty"});
+InspectorBackend.registerEvent("CSS.mediaQueryResultChanged", []);
+InspectorBackend.registerEvent("CSS.styleSheetChanged", ["styleSheetId"]);
+InspectorBackend.registerEvent("CSS.namedFlowCreated", ["namedFlow"]);
+InspectorBackend.registerEvent("CSS.namedFlowRemoved", ["documentNodeId", "flowName"]);
+InspectorBackend.registerEvent("CSS.regionLayoutUpdated", ["namedFlow"]);
+InspectorBackend.registerEvent("CSS.regionOversetChanged", ["namedFlow"]);
+InspectorBackend.registerEvent("CSS.registeredNamedFlowContentElement", ["documentNodeId", "flowName", "contentNodeId", "nextContentNodeId"]);
+InspectorBackend.registerEvent("CSS.unregisteredNamedFlowContentElement", ["documentNodeId", "flowName", "contentNodeId"]);
+InspectorBackend.registerCommand("CSS.enable", [], []);
+InspectorBackend.registerCommand("CSS.disable", [], []);
+InspectorBackend.registerCommand("CSS.getMatchedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "includePseudo", "type": "boolean", "optional": true}, {"name": "includeInherited", "type": "boolean", "optional": true}], ["matchedCSSRules", "pseudoElements", "inherited"]);
+InspectorBackend.registerCommand("CSS.getInlineStylesForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["inlineStyle", "attributesStyle"]);
+InspectorBackend.registerCommand("CSS.getComputedStyleForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["computedStyle"]);
+InspectorBackend.registerCommand("CSS.getAllStyleSheets", [], ["headers"]);
+InspectorBackend.registerCommand("CSS.getStyleSheet", [{"name": "styleSheetId", "type": "string", "optional": false}], ["styleSheet"]);
+InspectorBackend.registerCommand("CSS.getStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}], ["text"]);
+InspectorBackend.registerCommand("CSS.setStyleSheetText", [{"name": "styleSheetId", "type": "string", "optional": false}, {"name": "text", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("CSS.setStyleText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "text", "type": "string", "optional": false}], ["style"]);
+InspectorBackend.registerCommand("CSS.setPropertyText", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "overwrite", "type": "boolean", "optional": false}], ["style"]);
+InspectorBackend.registerCommand("CSS.toggleProperty", [{"name": "styleId", "type": "object", "optional": false}, {"name": "propertyIndex", "type": "number", "optional": false}, {"name": "disable", "type": "boolean", "optional": false}], ["style"]);
+InspectorBackend.registerCommand("CSS.setRuleSelector", [{"name": "ruleId", "type": "object", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
+InspectorBackend.registerCommand("CSS.addRule", [{"name": "contextNodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["rule"]);
+InspectorBackend.registerCommand("CSS.getSupportedCSSProperties", [], ["cssProperties"]);
+InspectorBackend.registerCommand("CSS.forcePseudoState", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "forcedPseudoClasses", "type": "object", "optional": false}], []);
+InspectorBackend.registerCommand("CSS.getNamedFlowCollection", [{"name": "documentNodeId", "type": "number", "optional": false}], ["namedFlows"]);
+
+// Canvas.
+InspectorBackend.registerCanvasDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Canvas");
+InspectorBackend.registerEvent("Canvas.contextCreated", ["frameId"]);
+InspectorBackend.registerEvent("Canvas.traceLogsRemoved", ["frameId", "traceLogId"]);
+InspectorBackend.registerCommand("Canvas.enable", [], []);
+InspectorBackend.registerCommand("Canvas.disable", [], []);
+InspectorBackend.registerCommand("Canvas.dropTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Canvas.hasUninstrumentedCanvases", [], ["result"]);
+InspectorBackend.registerCommand("Canvas.captureFrame", [{"name": "frameId", "type": "string", "optional": true}], ["traceLogId"]);
+InspectorBackend.registerCommand("Canvas.startCapturing", [{"name": "frameId", "type": "string", "optional": true}], ["traceLogId"]);
+InspectorBackend.registerCommand("Canvas.stopCapturing", [{"name": "traceLogId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Canvas.getTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "startOffset", "type": "number", "optional": true}, {"name": "maxLength", "type": "number", "optional": true}], ["traceLog"]);
+InspectorBackend.registerCommand("Canvas.replayTraceLog", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "stepNo", "type": "number", "optional": false}], ["resourceState"]);
+InspectorBackend.registerCommand("Canvas.getResourceInfo", [{"name": "resourceId", "type": "string", "optional": false}], ["resourceInfo"]);
+InspectorBackend.registerCommand("Canvas.getResourceState", [{"name": "traceLogId", "type": "string", "optional": false}, {"name": "resourceId", "type": "string", "optional": false}], ["resourceState"]);
+
+// DOM.
+InspectorBackend.registerDOMDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "DOM");
+InspectorBackend.registerEvent("DOM.documentUpdated", []);
+InspectorBackend.registerEvent("DOM.setChildNodes", ["parentId", "nodes"]);
+InspectorBackend.registerEvent("DOM.attributeModified", ["nodeId", "name", "value"]);
+InspectorBackend.registerEvent("DOM.attributeRemoved", ["nodeId", "name"]);
+InspectorBackend.registerEvent("DOM.inlineStyleInvalidated", ["nodeIds"]);
+InspectorBackend.registerEvent("DOM.characterDataModified", ["nodeId", "characterData"]);
+InspectorBackend.registerEvent("DOM.childNodeCountUpdated", ["nodeId", "childNodeCount"]);
+InspectorBackend.registerEvent("DOM.childNodeInserted", ["parentNodeId", "previousNodeId", "node"]);
+InspectorBackend.registerEvent("DOM.childNodeRemoved", ["parentNodeId", "nodeId"]);
+InspectorBackend.registerEvent("DOM.shadowRootPushed", ["hostId", "root"]);
+InspectorBackend.registerEvent("DOM.shadowRootPopped", ["hostId", "rootId"]);
+InspectorBackend.registerCommand("DOM.getDocument", [], ["root"]);
+InspectorBackend.registerCommand("DOM.requestChildNodes", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "depth", "type": "number", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.querySelector", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.querySelectorAll", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "selector", "type": "string", "optional": false}], ["nodeIds"]);
+InspectorBackend.registerCommand("DOM.setNodeName", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.setNodeValue", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.removeNode", [{"name": "nodeId", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.setAttributeValue", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.setAttributesAsText", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "text", "type": "string", "optional": false}, {"name": "name", "type": "string", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.removeAttribute", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "name", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.getEventListenersForNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["listeners"]);
+InspectorBackend.registerCommand("DOM.getAccessibilityPropertiesForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["properties"]);
+InspectorBackend.registerCommand("DOM.getOuterHTML", [{"name": "nodeId", "type": "number", "optional": false}], ["outerHTML"]);
+InspectorBackend.registerCommand("DOM.setOuterHTML", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "outerHTML", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.performSearch", [{"name": "query", "type": "string", "optional": false}, {"name": "nodeIds", "type": "object", "optional": true}], ["searchId", "resultCount"]);
+InspectorBackend.registerCommand("DOM.getSearchResults", [{"name": "searchId", "type": "string", "optional": false}, {"name": "fromIndex", "type": "number", "optional": false}, {"name": "toIndex", "type": "number", "optional": false}], ["nodeIds"]);
+InspectorBackend.registerCommand("DOM.discardSearchResults", [{"name": "searchId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.requestNode", [{"name": "objectId", "type": "string", "optional": false}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.setInspectModeEnabled", [{"name": "enabled", "type": "boolean", "optional": false}, {"name": "highlightConfig", "type": "object", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.highlightRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "color", "type": "object", "optional": true}, {"name": "outlineColor", "type": "object", "optional": true}, {"name": "usePageCoordinates", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.highlightQuad", [{"name": "quad", "type": "object", "optional": false}, {"name": "color", "type": "object", "optional": true}, {"name": "outlineColor", "type": "object", "optional": true}, {"name": "usePageCoordinates", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.highlightNode", [{"name": "highlightConfig", "type": "object", "optional": false}, {"name": "nodeId", "type": "number", "optional": true}, {"name": "objectId", "type": "string", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.hideHighlight", [], []);
+InspectorBackend.registerCommand("DOM.highlightFrame", [{"name": "frameId", "type": "string", "optional": false}, {"name": "contentColor", "type": "object", "optional": true}, {"name": "contentOutlineColor", "type": "object", "optional": true}], []);
+InspectorBackend.registerCommand("DOM.pushNodeByPathToFrontend", [{"name": "path", "type": "string", "optional": false}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.pushNodeByBackendIdToFrontend", [{"name": "backendNodeId", "type": "number", "optional": false}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.releaseBackendNodeIds", [{"name": "nodeGroup", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOM.resolveNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["object"]);
+InspectorBackend.registerCommand("DOM.getAttributes", [{"name": "nodeId", "type": "number", "optional": false}], ["attributes"]);
+InspectorBackend.registerCommand("DOM.moveTo", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "targetNodeId", "type": "number", "optional": false}, {"name": "insertBeforeNodeId", "type": "number", "optional": true}], ["nodeId"]);
+InspectorBackend.registerCommand("DOM.undo", [], []);
+InspectorBackend.registerCommand("DOM.redo", [], []);
+InspectorBackend.registerCommand("DOM.markUndoableState", [], []);
+InspectorBackend.registerCommand("DOM.focus", [{"name": "nodeId", "type": "number", "optional": false}], []);
+
+// DOMDebugger.
+InspectorBackend.registerEnum("DOMDebugger.DOMBreakpointType", {SubtreeModified: "subtree-modified", AttributeModified: "attribute-modified", NodeRemoved: "node-removed"});
+InspectorBackend.registerCommand("DOMDebugger.setDOMBreakpoint", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "type", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.removeDOMBreakpoint", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "type", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.setEventListenerBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.removeEventListenerBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.setInstrumentationBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.removeInstrumentationBreakpoint", [{"name": "eventName", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.setXHRBreakpoint", [{"name": "url", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMDebugger.removeXHRBreakpoint", [{"name": "url", "type": "string", "optional": false}], []);
+
+// DOMStorage.
+InspectorBackend.registerDOMStorageDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "DOMStorage");
+InspectorBackend.registerEvent("DOMStorage.domStorageItemsCleared", ["storageId"]);
+InspectorBackend.registerEvent("DOMStorage.domStorageItemRemoved", ["storageId", "key"]);
+InspectorBackend.registerEvent("DOMStorage.domStorageItemAdded", ["storageId", "key", "newValue"]);
+InspectorBackend.registerEvent("DOMStorage.domStorageItemUpdated", ["storageId", "key", "oldValue", "newValue"]);
+InspectorBackend.registerCommand("DOMStorage.enable", [], []);
+InspectorBackend.registerCommand("DOMStorage.disable", [], []);
+InspectorBackend.registerCommand("DOMStorage.getDOMStorageItems", [{"name": "storageId", "type": "object", "optional": false}], ["entries"]);
+InspectorBackend.registerCommand("DOMStorage.setDOMStorageItem", [{"name": "storageId", "type": "object", "optional": false}, {"name": "key", "type": "string", "optional": false}, {"name": "value", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("DOMStorage.removeDOMStorageItem", [{"name": "storageId", "type": "object", "optional": false}, {"name": "key", "type": "string", "optional": false}], []);
+
+// Database.
+InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database");
+InspectorBackend.registerEvent("Database.addDatabase", ["database"]);
+InspectorBackend.registerCommand("Database.enable", [], []);
+InspectorBackend.registerCommand("Database.disable", [], []);
+InspectorBackend.registerCommand("Database.getDatabaseTableNames", [{"name": "databaseId", "type": "string", "optional": false}], ["tableNames"]);
+InspectorBackend.registerCommand("Database.executeSQL", [{"name": "databaseId", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "values", "sqlError"]);
+
+// HeapProfiler.
+InspectorBackend.registerHeapProfilerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "HeapProfiler");
+InspectorBackend.registerEvent("HeapProfiler.addProfileHeader", ["header"]);
+InspectorBackend.registerEvent("HeapProfiler.addHeapSnapshotChunk", ["uid", "chunk"]);
+InspectorBackend.registerEvent("HeapProfiler.finishHeapSnapshot", ["uid"]);
+InspectorBackend.registerEvent("HeapProfiler.resetProfiles", []);
+InspectorBackend.registerEvent("HeapProfiler.reportHeapSnapshotProgress", ["done", "total"]);
+InspectorBackend.registerCommand("HeapProfiler.hasHeapProfiler", [], ["result"]);
+InspectorBackend.registerCommand("HeapProfiler.getProfileHeaders", [], ["headers"]);
+InspectorBackend.registerCommand("HeapProfiler.getHeapSnapshot", [{"name": "uid", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("HeapProfiler.removeProfile", [{"name": "uid", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("HeapProfiler.clearProfiles", [], []);
+InspectorBackend.registerCommand("HeapProfiler.takeHeapSnapshot", [{"name": "reportProgress", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("HeapProfiler.collectGarbage", [], []);
+InspectorBackend.registerCommand("HeapProfiler.getObjectByHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["result"]);
+InspectorBackend.registerCommand("HeapProfiler.getHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}], ["heapSnapshotObjectId"]);
+
+// IndexedDB.
+InspectorBackend.registerIndexedDBDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "IndexedDB");
+InspectorBackend.registerEnum("IndexedDB.KeyType", {Number: "number", String: "string", Date: "date", Array: "array"});
+InspectorBackend.registerEnum("IndexedDB.KeyPathType", {Null: "null", String: "string", Array: "array"});
+InspectorBackend.registerCommand("IndexedDB.enable", [], []);
+InspectorBackend.registerCommand("IndexedDB.disable", [], []);
+InspectorBackend.registerCommand("IndexedDB.requestDatabaseNames", [{"name": "securityOrigin", "type": "string", "optional": false}], ["databaseNames"]);
+InspectorBackend.registerCommand("IndexedDB.requestDatabase", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}], ["databaseWithObjectStores"]);
+InspectorBackend.registerCommand("IndexedDB.requestData", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}, {"name": "objectStoreName", "type": "string", "optional": false}, {"name": "indexName", "type": "string", "optional": false}, {"name": "skipCount", "type": "number", "optional": false}, {"name": "pageSize", "type": "number", "optional": false}, {"name": "keyRange", "type": "object", "optional": true}], ["objectStoreDataEntries", "hasMore"]);
+InspectorBackend.registerCommand("IndexedDB.clearObjectStore", [{"name": "securityOrigin", "type": "string", "optional": false}, {"name": "databaseName", "type": "string", "optional": false}, {"name": "objectStoreName", "type": "string", "optional": false}], []);
+
+// Input.
+InspectorBackend.registerInputDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Input");
+InspectorBackend.registerCommand("Input.dispatchKeyEvent", [{"name": "type", "type": "string", "optional": false}, {"name": "modifiers", "type": "number", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "text", "type": "string", "optional": true}, {"name": "unmodifiedText", "type": "string", "optional": true}, {"name": "keyIdentifier", "type": "string", "optional": true}, {"name": "windowsVirtualKeyCode", "type": "number", "optional": true}, {"name": "nativeVirtualKeyCode", "type": "number", "optional": true}, {"name": "macCharCode", "type": "number", "optional": true}, {"name": "autoRepeat", "type": "boolean", "optional": true}, {"name": "isKeypad", "type": "boolean", "optional": true}, {"name": "isSystemKey", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("Input.dispatchMouseEvent", [{"name": "type", "type": "string", "optional": false}, {"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "modifiers", "type": "number", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "button", "type": "string", "optional": true}, {"name": "clickCount", "type": "number", "optional": true}], []);
+
+// LayerTree.
+InspectorBackend.registerLayerTreeDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "LayerTree");
+InspectorBackend.registerEvent("LayerTree.layerTreeDidChange", []);
+InspectorBackend.registerCommand("LayerTree.enable", [], []);
+InspectorBackend.registerCommand("LayerTree.disable", [], []);
+InspectorBackend.registerCommand("LayerTree.layersForNode", [{"name": "nodeId", "type": "number", "optional": false}], ["layers"]);
+InspectorBackend.registerCommand("LayerTree.reasonsForCompositingLayer", [{"name": "layerId", "type": "string", "optional": false}], ["compositingReasons"]);
+
+// Memory.
+InspectorBackend.registerMemoryDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Memory");
+InspectorBackend.registerCommand("Memory.getDOMCounters", [], ["documents", "nodes", "jsEventListeners"]);
+
+// Network.
+InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Network");
+InspectorBackend.registerEnum("Network.InitiatorType", {Parser: "parser", Script: "script", Other: "other"});
+InspectorBackend.registerEvent("Network.requestWillBeSent", ["requestId", "frameId", "loaderId", "documentURL", "request", "timestamp", "initiator", "redirectResponse", "type"]);
+InspectorBackend.registerEvent("Network.requestServedFromCache", ["requestId"]);
+InspectorBackend.registerEvent("Network.responseReceived", ["requestId", "frameId", "loaderId", "timestamp", "type", "response"]);
+InspectorBackend.registerEvent("Network.dataReceived", ["requestId", "timestamp", "dataLength", "encodedDataLength"]);
+InspectorBackend.registerEvent("Network.loadingFinished", ["requestId", "timestamp", "sourceMapURL"]);
+InspectorBackend.registerEvent("Network.loadingFailed", ["requestId", "timestamp", "errorText", "canceled"]);
+InspectorBackend.registerEvent("Network.requestServedFromMemoryCache", ["requestId", "frameId", "loaderId", "documentURL", "timestamp", "initiator", "resource"]);
+InspectorBackend.registerEvent("Network.webSocketWillSendHandshakeRequest", ["requestId", "timestamp", "request"]);
+InspectorBackend.registerEvent("Network.webSocketHandshakeResponseReceived", ["requestId", "timestamp", "response"]);
+InspectorBackend.registerEvent("Network.webSocketCreated", ["requestId", "url"]);
+InspectorBackend.registerEvent("Network.webSocketClosed", ["requestId", "timestamp"]);
+InspectorBackend.registerEvent("Network.webSocketFrameReceived", ["requestId", "timestamp", "response"]);
+InspectorBackend.registerEvent("Network.webSocketFrameError", ["requestId", "timestamp", "errorMessage"]);
+InspectorBackend.registerEvent("Network.webSocketFrameSent", ["requestId", "timestamp", "response"]);
+InspectorBackend.registerCommand("Network.enable", [], []);
+InspectorBackend.registerCommand("Network.disable", [], []);
+InspectorBackend.registerCommand("Network.setExtraHTTPHeaders", [{"name": "headers", "type": "object", "optional": false}], []);
+InspectorBackend.registerCommand("Network.getResponseBody", [{"name": "requestId", "type": "string", "optional": false}], ["body", "base64Encoded"]);
+InspectorBackend.registerCommand("Network.replayXHR", [{"name": "requestId", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Network.canClearBrowserCache", [], ["result"]);
+InspectorBackend.registerCommand("Network.clearBrowserCache", [], []);
+InspectorBackend.registerCommand("Network.canClearBrowserCookies", [], ["result"]);
+InspectorBackend.registerCommand("Network.clearBrowserCookies", [], []);
+InspectorBackend.registerCommand("Network.setCacheDisabled", [{"name": "cacheDisabled", "type": "boolean", "optional": false}], []);
+
+// Page.
+InspectorBackend.registerPageDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Page");
+InspectorBackend.registerEnum("Page.ResourceType", {Document: "Document", Stylesheet: "Stylesheet", Image: "Image", Font: "Font", Script: "Script", XHR: "XHR", WebSocket: "WebSocket", Other: "Other"});
+InspectorBackend.registerEnum("Page.CoordinateSystem", {Viewport: "Viewport", Page: "Page"});
+InspectorBackend.registerEvent("Page.domContentEventFired", ["timestamp"]);
+InspectorBackend.registerEvent("Page.loadEventFired", ["timestamp"]);
+InspectorBackend.registerEvent("Page.frameNavigated", ["frame"]);
+InspectorBackend.registerEvent("Page.frameDetached", ["frameId"]);
+InspectorBackend.registerEvent("Page.frameStartedLoading", ["frameId"]);
+InspectorBackend.registerEvent("Page.frameStoppedLoading", ["frameId"]);
+InspectorBackend.registerEvent("Page.frameScheduledNavigation", ["frameId", "delay"]);
+InspectorBackend.registerEvent("Page.frameClearedScheduledNavigation", ["frameId"]);
+InspectorBackend.registerEvent("Page.javascriptDialogOpening", ["message"]);
+InspectorBackend.registerEvent("Page.javascriptDialogClosed", []);
+InspectorBackend.registerEvent("Page.scriptsEnabled", ["isEnabled"]);
+InspectorBackend.registerCommand("Page.enable", [], []);
+InspectorBackend.registerCommand("Page.disable", [], []);
+InspectorBackend.registerCommand("Page.addScriptToEvaluateOnLoad", [{"name": "scriptSource", "type": "string", "optional": false}], ["identifier"]);
+InspectorBackend.registerCommand("Page.removeScriptToEvaluateOnLoad", [{"name": "identifier", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Page.reload", [{"name": "ignoreCache", "type": "boolean", "optional": true}, {"name": "scriptToEvaluateOnLoad", "type": "string", "optional": true}], []);
+InspectorBackend.registerCommand("Page.navigate", [{"name": "url", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Page.getCookies", [], ["cookies"]);
+InspectorBackend.registerCommand("Page.deleteCookie", [{"name": "cookieName", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Page.getResourceTree", [], ["frameTree"]);
+InspectorBackend.registerCommand("Page.getResourceContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}], ["content", "base64Encoded"]);
+InspectorBackend.registerCommand("Page.searchInResource", [{"name": "frameId", "type": "string", "optional": false}, {"name": "url", "type": "string", "optional": false}, {"name": "query", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
+InspectorBackend.registerCommand("Page.searchInResources", [{"name": "text", "type": "string", "optional": false}, {"name": "caseSensitive", "type": "boolean", "optional": true}, {"name": "isRegex", "type": "boolean", "optional": true}], ["result"]);
+InspectorBackend.registerCommand("Page.setDocumentContent", [{"name": "frameId", "type": "string", "optional": false}, {"name": "html", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Page.setShowPaintRects", [{"name": "result", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.canShowDebugBorders", [], ["show"]);
+InspectorBackend.registerCommand("Page.setShowDebugBorders", [{"name": "show", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.canShowFPSCounter", [], ["show"]);
+InspectorBackend.registerCommand("Page.setShowFPSCounter", [{"name": "show", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.canContinuouslyPaint", [], ["value"]);
+InspectorBackend.registerCommand("Page.setContinuousPaintingEnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.getScriptExecutionStatus", [], ["result"]);
+InspectorBackend.registerCommand("Page.setScriptExecutionDisabled", [{"name": "value", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.setTouchEmulationEnabled", [{"name": "enabled", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.setEmulatedMedia", [{"name": "media", "type": "string", "optional": false}], []);
+InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["result"]);
+InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
+InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
+InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
+InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
+InspectorBackend.registerCommand("Page.archive", [], ["data"]);
+
+// Profiler.
+InspectorBackend.registerProfilerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Profiler");
+InspectorBackend.registerEnum("Profiler.ProfileHeaderTypeId", {CPU: "CPU", HEAP: "HEAP"});
+InspectorBackend.registerEvent("Profiler.addProfileHeader", ["header"]);
+InspectorBackend.registerEvent("Profiler.addHeapSnapshotChunk", ["uid", "chunk"]);
+InspectorBackend.registerEvent("Profiler.finishHeapSnapshot", ["uid"]);
+InspectorBackend.registerEvent("Profiler.setRecordingProfile", ["isProfiling"]);
+InspectorBackend.registerEvent("Profiler.resetProfiles", []);
+InspectorBackend.registerEvent("Profiler.reportHeapSnapshotProgress", ["done", "total"]);
+InspectorBackend.registerCommand("Profiler.isSampling", [], ["result"]);
+InspectorBackend.registerCommand("Profiler.hasHeapProfiler", [], ["result"]);
+InspectorBackend.registerCommand("Profiler.enable", [], []);
+InspectorBackend.registerCommand("Profiler.disable", [], []);
+InspectorBackend.registerCommand("Profiler.start", [], []);
+InspectorBackend.registerCommand("Profiler.stop", [], []);
+InspectorBackend.registerCommand("Profiler.getProfileHeaders", [], ["headers"]);
+InspectorBackend.registerCommand("Profiler.getCPUProfile", [{"name": "uid", "type": "number", "optional": false}], ["profile"]);
+InspectorBackend.registerCommand("Profiler.getHeapSnapshot", [{"name": "uid", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("Profiler.removeProfile", [{"name": "type", "type": "string", "optional": false}, {"name": "uid", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("Profiler.clearProfiles", [], []);
+InspectorBackend.registerCommand("Profiler.takeHeapSnapshot", [{"name": "reportProgress", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("Profiler.collectGarbage", [], []);
+InspectorBackend.registerCommand("Profiler.getObjectByHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}], ["result"]);
+InspectorBackend.registerCommand("Profiler.getHeapObjectId", [{"name": "objectId", "type": "string", "optional": false}], ["heapSnapshotObjectId"]);
+
+// Timeline.
+InspectorBackend.registerTimelineDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Timeline");
+InspectorBackend.registerEnum("Timeline.EventType", {EventDispatch: "EventDispatch", BeginFrame: "BeginFrame", ScheduleStyleRecalculation: "ScheduleStyleRecalculation", RecalculateStyles: "RecalculateStyles", InvalidateLayout: "InvalidateLayout", Layout: "Layout", Paint: "Paint", ScrollLayer: "ScrollLayer", ResizeImage: "ResizeImage", CompositeLayers: "CompositeLayers", ParseHTML: "ParseHTML", TimerInstall: "TimerInstall", TimerRemove: "TimerRemove", TimerFire: "TimerFire", EvaluateScript: "EvaluateScript", MarkLoad: "MarkLoad", MarkDOMContent: "MarkDOMContent", TimeStamp: "TimeStamp", Time: "Time", TimeEnd: "TimeEnd", ScheduleResourceRequest: "ScheduleResourceRequest", ResourceSendRequest: "ResourceSendRequest", ResourceReceiveResponse: "ResourceReceiveResponse", ResourceReceivedData: "ResourceReceivedData", ResourceFinish: "ResourceFinish", XHRReadyStateChange: "XHRReadyStateChange", XHRLoad: "XHRLoad", FunctionCall: "FunctionCall", GCEvent: "GCEvent", RequestAnimationFrame: "RequestAnimationFrame", CancelAnimationFrame: "CancelAnimationFrame", FireAnimationFrame: "FireAnimationFrame", WebSocketCreate: "WebSocketCreate", WebSocketSendHandshakeRequest: "WebSocketSendHandshakeRequest", WebSocketReceiveHandshakeResponse: "WebSocketReceiveHandshakeResponse", WebSocketDestroy: "WebSocketDestroy"});
+InspectorBackend.registerEvent("Timeline.eventRecorded", ["record"]);
+InspectorBackend.registerCommand("Timeline.start", [{"name": "maxCallStackDepth", "type": "number", "optional": true}, {"name": "includeDomCounters", "type": "boolean", "optional": true}], []);
+InspectorBackend.registerCommand("Timeline.stop", [], []);
+InspectorBackend.registerCommand("Timeline.supportsFrameInstrumentation", [], ["result"]);
+InspectorBackend.registerCommand("Timeline.canMonitorMainThread", [], ["result"]);
+
+// Worker.
+InspectorBackend.registerWorkerDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Worker");
+InspectorBackend.registerEvent("Worker.workerCreated", ["workerId", "url", "inspectorConnected"]);
+InspectorBackend.registerEvent("Worker.workerTerminated", ["workerId"]);
+InspectorBackend.registerEvent("Worker.dispatchMessageFromWorker", ["workerId", "message"]);
+InspectorBackend.registerEvent("Worker.disconnectedFromWorker", []);
+InspectorBackend.registerCommand("Worker.enable", [], []);
+InspectorBackend.registerCommand("Worker.disable", [], []);
+InspectorBackend.registerCommand("Worker.sendMessageToWorker", [{"name": "workerId", "type": "number", "optional": false}, {"name": "message", "type": "object", "optional": false}], []);
+InspectorBackend.registerCommand("Worker.canInspectWorkers", [], ["result"]);
+InspectorBackend.registerCommand("Worker.connectToWorker", [{"name": "workerId", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("Worker.disconnectFromWorker", [{"name": "workerId", "type": "number", "optional": false}], []);
+InspectorBackend.registerCommand("Worker.setAutoconnectToWorkers", [{"name": "value", "type": "boolean", "optional": false}], []);
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLayerTreeObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/LayerTreeObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/LayerTreeObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/LayerTreeObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.LayerTreeObserver.prototype = {
+ constructor: WebInspector.LayerTreeObserver,
+
+ // Events defined by the "LayerTree" domain.
+
+ layerTreeDidChange: function()
+ {
+ if (WebInspector.layerTreeManager.supported)
+ WebInspector.layerTreeManager.layerTreeDidChange();
+ }
+};
+
+WebInspector.LayerTreeObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLegacyProfilerObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfilerObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/LegacyProfilerObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfilerObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/LegacyProfilerObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/LegacyProfilerObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfilerObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.LegacyProfilerObserver.prototype = {
+ constructor: WebInspector.LegacyProfilerObserver,
+
+ // Events defined by the "Profiler" domain.
+
+ resetProfiles: function()
+ {
+ // FIXME: Implement this.
+ },
+
+ addProfileHeader: function(profile)
+ {
+ WebInspector.legacyProfileManager.addJavaScriptProfile(profile);
+ },
+
+ addHeapSnapshotChunk: function(uid, chunk)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ },
+
+ finishHeapSnapshot: function(uid)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ },
+
+ setRecordingProfile: function(isProfiling)
+ {
+ WebInspector.legacyProfileManager.setRecordingJavaScriptProfile(isProfiling);
+ },
+
+ reportHeapSnapshotProgress: function(done, total)
+ {
+ // FIXME: Implement this (we need heap snapshots).
+ }
+
+};
+
+WebInspector.LegacyProfilerObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLoadInspectorBackendCommandsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLoadInspectorBackendCommandsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LoadInspectorBackendCommands.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+(function() {
+ var backendURLs;
+ if (InspectorFrontendHost.inspectorBackendCommandsURLs) {
+ var suggestedBackendCommandsURLs = InspectorFrontendHost.inspectorBackendCommandsURLs();
+ if (suggestedBackendCommandsURLs)
+ backendURLs = suggestedBackendCommandsURLs;
+ }
+
+ if (!backendURLs) {
+ backendURLs = ["Protocol/InspectorJSBackendCommands.js"];
+ if (InspectorFrontendHost.debuggableType() === "web")
+ backendURLs.push("Protocol/InspectorWebBackendCommands.js");
+ }
+
+ console.assert(backendURLs.length);
+ for (var backendCommandsURL of backendURLs)
+ document.write("<script src=\"" + backendCommandsURL + "\"></script>");
+})();
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolMessageDispatcherjsfromrev164541trunkSourceWebInspectorUIUserInterfaceMessageDispatcherjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/MessageDispatcher.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/MessageDispatcher.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/MessageDispatcher.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/MessageDispatcher.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.messagesToDispatch = [];
+
+WebInspector.dispatchNextQueuedMessageFromBackend = function()
+{
+ for (var i = 0; i < this.messagesToDispatch.length; ++i)
+ InspectorBackend.dispatch(this.messagesToDispatch[i]);
+
+ this.messagesToDispatch = [];
+
+ this._dispatchTimeout = null;
+}
+
+WebInspector.dispatchMessageFromBackend = function(message)
+{
+ // Enforce asynchronous interaction between the backend and the frontend by queueing messages.
+ // The messages are dequeued on a zero delay timeout.
+
+ this.messagesToDispatch.push(message);
+
+ if (this._dispatchTimeout)
+ return;
+
+ this._dispatchTimeout = setTimeout(this.dispatchNextQueuedMessageFromBackend.bind(this), 0);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolNetworkObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.NetworkObserver.prototype = {
+ constructor: WebInspector.NetworkObserver,
+
+ // Events defined by the "Network" domain.
+
+ requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse, type)
+ {
+ WebInspector.frameResourceManager.resourceRequestWillBeSent(requestId, frameId, loaderId, request, type, redirectResponse, timestamp, initiator);
+ },
+
+ requestServedFromCache: function(requestId)
+ {
+ WebInspector.frameResourceManager.markResourceRequestAsServedFromMemoryCache(requestId);
+ },
+
+ responseReceived: function(requestId, frameId, loaderId, timestamp, type, response)
+ {
+ WebInspector.frameResourceManager.resourceRequestDidReceiveResponse(requestId, frameId, loaderId, type, response, timestamp);
+ },
+
+ dataReceived: function(requestId, timestamp, dataLength, encodedDataLength)
+ {
+ WebInspector.frameResourceManager.resourceRequestDidReceiveData(requestId, dataLength, encodedDataLength, timestamp);
+ },
+
+ loadingFinished: function(requestId, timestamp, sourceMapURL)
+ {
+ WebInspector.frameResourceManager.resourceRequestDidFinishLoading(requestId, timestamp, sourceMapURL);
+ },
+
+ loadingFailed: function(requestId, timestamp, errorText, canceled)
+ {
+ WebInspector.frameResourceManager.resourceRequestDidFailLoading(requestId, canceled, timestamp);
+ },
+
+ requestServedFromMemoryCache: function(requestId, frameId, loaderId, documentURL, timestamp, initiator, resource)
+ {
+ WebInspector.frameResourceManager.resourceRequestWasServedFromMemoryCache(requestId, frameId, loaderId, resource, timestamp, initiator);
+ },
+
+ webSocketWillSendHandshakeRequest: function(requestId, timestamp, request)
+ {
+ // FIXME: Not implemented.
+ },
+
+ webSocketHandshakeResponseReceived: function(requestId, timestamp, response)
+ {
+ // FIXME: Not implemented.
+ },
+
+ webSocketCreated: function(requestId, url)
+ {
+ // FIXME: Not implemented.
+ },
+
+ webSocketClosed: function(requestId, timestamp)
+ {
+ // FIXME: Not implemented.
+ }
+};
+
+WebInspector.NetworkObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolPageObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfacePageObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/PageObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.PageObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.PageObserver.prototype = {
+ constructor: WebInspector.PageObserver,
+
+ // Events defined by the "Page" domain.
+
+ domContentEventFired: function(timestamp)
+ {
+ // Covered by Timeline "MarkDOMContent" record.
+ },
+
+ loadEventFired: function(timestamp)
+ {
+ WebInspector.timelineManager.pageDidLoad(timestamp);
+ },
+
+ frameNavigated: function(frame, loaderId)
+ {
+ WebInspector.frameResourceManager.frameDidNavigate(frame, loaderId);
+ },
+
+ frameDetached: function(frameId)
+ {
+ WebInspector.frameResourceManager.frameDidDetach(frameId);
+ },
+
+ frameStartedLoading: function(frameId)
+ {
+ // Not handled yet.
+ },
+
+ frameStoppedLoading: function(frameId)
+ {
+ // Not handled yet.
+ },
+
+ frameScheduledNavigation: function(frameId, delay)
+ {
+ // Not handled yet.
+ },
+
+ frameClearedScheduledNavigation: function(frameId)
+ {
+ // Not handled yet.
+ },
+
+ javascriptDialogOpening: function(message)
+ {
+ // Not handled yet.
+ },
+
+ javascriptDialogClosed: function()
+ {
+ // Not handled yet.
+ },
+
+ scriptsEnabled: function(enabled)
+ {
+ // Not handled yet.
+ }
+};
+
+WebInspector.PageObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceRemoteObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RemoteObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,492 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @constructor
+ * @param {string|undefined} objectId
+ * @param {string} type
+ * @param {string|undefined} subtype
+ * @param {*} value
+ * @param {string=} description
+ */
+WebInspector.RemoteObject = function(objectId, type, subtype, value, description)
+{
+ this._type = type;
+ this._subtype = subtype;
+ if (objectId) {
+ // handle
+ this._objectId = objectId;
+ this._description = description;
+ this._hasChildren = true;
+ } else {
+ // Primitive or null object.
+ console.assert(type !== "object" || value === null);
+ this._description = description || (value + "");
+ this._hasChildren = false;
+ this.value = value;
+ }
+}
+
+/**
+ * @param {number|string|boolean} value
+ * @return {WebInspector.RemoteObject}
+ */
+WebInspector.RemoteObject.fromPrimitiveValue = function(value)
+{
+ return new WebInspector.RemoteObject(undefined, typeof value, undefined, value);
+}
+
+/**
+ * @param {Object} value
+ * @return {WebInspector.RemoteObject}
+ */
+WebInspector.RemoteObject.fromLocalObject = function(value)
+{
+ return new WebInspector.LocalJSONObject(value);
+}
+
+/**
+ * @param {WebInspector.DOMNode} node
+ * @param {string} objectGroup
+ * @param {function(?WebInspector.RemoteObject)} callback
+ */
+WebInspector.RemoteObject.resolveNode = function(node, objectGroup, callback)
+{
+ /**
+ * @param {?Protocol.Error} error
+ * @param {RuntimeAgent.RemoteObject} object
+ */
+ function mycallback(error, object)
+ {
+ if (!callback)
+ return;
+
+ if (error || !object)
+ callback(null);
+ else
+ callback(WebInspector.RemoteObject.fromPayload(object));
+ }
+ DOMAgent.resolveNode(node.id, objectGroup, mycallback);
+}
+
+/**
+ * @param {RuntimeAgent.RemoteObject} payload
+ * @return {WebInspector.RemoteObject}
+ */
+WebInspector.RemoteObject.fromPayload = function(payload)
+{
+ console.assert(typeof payload === "object", "Remote object payload should only be an object");
+
+ return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description);
+}
+
+/**
+ * @param {WebInspector.RemoteObject} remoteObject
+ * @return {string}
+ */
+WebInspector.RemoteObject.type = function(remoteObject)
+{
+ if (remoteObject === null)
+ return "null";
+
+ var type = typeof remoteObject;
+ if (type !== "object" && type !== "function")
+ return type;
+
+ return remoteObject.type;
+}
+
+WebInspector.RemoteObject.prototype = {
+ /** @return {RuntimeAgent.RemoteObjectId} */
+ get objectId()
+ {
+ return this._objectId;
+ },
+
+ /** @return {string} */
+ get type()
+ {
+ return this._type;
+ },
+
+ /** @return {string|undefined} */
+ get subtype()
+ {
+ return this._subtype;
+ },
+
+ /** @return {string|undefined} */
+ get description()
+ {
+ return this._description;
+ },
+
+ /** @return {boolean} */
+ get hasChildren()
+ {
+ return this._hasChildren;
+ },
+
+ /**
+ * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+ */
+ getOwnProperties: function(callback)
+ {
+ this._getProperties(true, callback);
+ },
+
+ /**
+ * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+ */
+ getAllProperties: function(callback)
+ {
+ this._getProperties(false, callback);
+ },
+
+ /**
+ * @param {boolean} ownProperties
+ * @param {function(Array.<RuntimeAgent.RemoteObject>)} callback
+ */
+ _getProperties: function(ownProperties, callback)
+ {
+ if (!this._objectId) {
+ callback([]);
+ return;
+ }
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {Array.<WebInspector.RemoteObjectProperty>} properties
+ */
+ function remoteObjectBinder(error, properties)
+ {
+ if (error) {
+ callback(null);
+ return;
+ }
+ var result = [];
+ for (var i = 0; properties && i < properties.length; ++i) {
+ var property = properties[i];
+ if (property.get || property.set) {
+ if (property.get)
+ result.push(new WebInspector.RemoteObjectProperty("get " + property.name, WebInspector.RemoteObject.fromPayload(property.get), property));
+ if (property.set)
+ result.push(new WebInspector.RemoteObjectProperty("set " + property.name, WebInspector.RemoteObject.fromPayload(property.set), property));
+ } else
+ result.push(new WebInspector.RemoteObjectProperty(property.name, WebInspector.RemoteObject.fromPayload(property.value), property));
+ }
+ callback(result);
+ }
+ RuntimeAgent.getProperties(this._objectId, ownProperties, remoteObjectBinder);
+ },
+
+ /**
+ * @param {string} name
+ * @param {string} value
+ * @param {function(string=)} callback
+ */
+ setPropertyValue: function(name, value, callback)
+ {
+ if (!this._objectId) {
+ callback("Can't set a property of non-object.");
+ return;
+ }
+
+ RuntimeAgent.evaluate.invoke({expression:value, doNotPauseOnExceptionsAndMuteConsole:true}, evaluatedCallback.bind(this));
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {RuntimeAgent.RemoteObject} result
+ * @param {boolean=} wasThrown
+ */
+ function evaluatedCallback(error, result, wasThrown)
+ {
+ if (error || wasThrown) {
+ callback(error || result.description);
+ return;
+ }
+
+ function setPropertyValue(propertyName, propertyValue)
+ {
+ this[propertyName] = propertyValue;
+ }
+
+ delete result.description; // Optimize on traffic.
+ RuntimeAgent.callFunctionOn(this._objectId, setPropertyValue.toString(), [{ value:name }, result], true, undefined, propertySetCallback.bind(this));
+ if (result._objectId)
+ RuntimeAgent.releaseObject(result._objectId);
+ }
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {RuntimeAgent.RemoteObject} result
+ * @param {boolean=} wasThrown
+ */
+ function propertySetCallback(error, result, wasThrown)
+ {
+ if (error || wasThrown) {
+ callback(error || result.description);
+ return;
+ }
+ callback();
+ }
+ },
+
+ /**
+ * @param {function(DOMAgent.NodeId)} callback
+ */
+ pushNodeToFrontend: function(callback)
+ {
+ if (this._objectId)
+ WebInspector.domTreeManager.pushNodeToFrontend(this._objectId, callback);
+ else
+ callback(0);
+ },
+
+ /**
+ * @param {string} functionDeclaration
+ * @param {function(?WebInspector.RemoteObject)} callback
+ */
+ callFunction: function(functionDeclaration, args, callback)
+ {
+ function mycallback(error, result, wasThrown)
+ {
+ callback((error || wasThrown) ? null : WebInspector.RemoteObject.fromPayload(result));
+ }
+
+ RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, undefined, mycallback);
+ },
+
+ /**
+ * @param {string} functionDeclaration
+ * @param {function(*)} callback
+ */
+ callFunctionJSON: function(functionDeclaration, args, callback)
+ {
+ function mycallback(error, result, wasThrown)
+ {
+ callback((error || wasThrown) ? null : result.value);
+ }
+
+ RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, true, mycallback);
+ },
+
+ release: function()
+ {
+ RuntimeAgent.releaseObject(this._objectId);
+ },
+
+ /**
+ * @return {number}
+ */
+ arrayLength: function()
+ {
+ if (this.subtype !== "array")
+ return 0;
+
+ var matches = this._description.match(/\[([0-9]+)\]/);
+ if (!matches)
+ return 0;
+ return parseInt(matches[1], 10);
+ }
+}
+
+/**
+ * @constructor
+ * @param {string} name
+ * @param {WebInspector.RemoteObject} value
+ * @param {Object=} descriptor
+ */
+WebInspector.RemoteObjectProperty = function(name, value, descriptor)
+{
+ this.name = name;
+ this.value = value;
+ this.enumerable = descriptor ? !!descriptor.enumerable : true;
+ this.writable = descriptor ? !!descriptor.writable : true;
+ if (descriptor && descriptor.wasThrown)
+ this.wasThrown = true;
+}
+
+/**
+ * @param {string} name
+ * @param {string} value
+ * @return {WebInspector.RemoteObjectProperty}
+ */
+WebInspector.RemoteObjectProperty.fromPrimitiveValue = function(name, value)
+{
+ return new WebInspector.RemoteObjectProperty(name, WebInspector.RemoteObject.fromPrimitiveValue(value));
+}
+
+// The below is a wrapper around a local object that provides an interface comaptible
+// with RemoteObject, to be used by the UI code (primarily ObjectPropertiesSection).
+// Note that only JSON-compliant objects are currently supported, as there's no provision
+// for traversing prototypes, extracting class names via constuctor, handling properties
+// or functions.
+
+/**
+ * @constructor
+ * @extends {WebInspector.RemoteObject}
+ * @param {Object} value
+ */
+WebInspector.LocalJSONObject = function(value)
+{
+ this._value = value;
+}
+
+WebInspector.LocalJSONObject.prototype = {
+ /**
+ * @return {string}
+ */
+ get description()
+ {
+ if (this._cachedDescription)
+ return this._cachedDescription;
+
+ if (this.type === "object") {
+ switch (this.subtype) {
+ case "array":
+ function formatArrayItem(property)
+ {
+ return property.value.description;
+ }
+ this._cachedDescription = this._concatenate("[", "]", formatArrayItem);
+ break;
+ case "null":
+ this._cachedDescription = "null";
+ break;
+ default:
+ function formatObjectItem(property)
+ {
+ return property.name + ":" + property.value.description;
+ }
+ this._cachedDescription = this._concatenate("{", "}", formatObjectItem);
+ }
+ } else
+ this._cachedDescription = String(this._value);
+
+ return this._cachedDescription;
+ },
+
+ /**
+ * @param {string} prefix
+ * @param {string} suffix
+ * @return {string}
+ */
+ _concatenate: function(prefix, suffix, formatProperty)
+ {
+ const previewChars = 100;
+
+ var buffer = prefix;
+ var children = this._children();
+ for (var i = 0; i < children.length; ++i) {
+ var itemDescription = formatProperty(children[i]);
+ if (buffer.length + itemDescription.length > previewChars) {
+ buffer += ",\u2026";
+ break;
+ }
+ if (i)
+ buffer += ", ";
+ buffer += itemDescription;
+ }
+ buffer += suffix;
+ return buffer;
+ },
+
+ /**
+ * @return {string}
+ */
+ get type()
+ {
+ return typeof this._value;
+ },
+
+ /**
+ * @return {string|undefined}
+ */
+ get subtype()
+ {
+ if (this._value === null)
+ return "null";
+
+ if (this._value instanceof Array)
+ return "array";
+
+ return undefined;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ get hasChildren()
+ {
+ return typeof this._value === "object" && this._value !== null && !isEmptyObject(this._value);
+ },
+
+ /**
+ * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+ */
+ getOwnProperties: function(callback)
+ {
+ callback(this._children());
+ },
+
+ /**
+ * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+ */
+ getAllProperties: function(callback)
+ {
+ callback(this._children());
+ },
+
+ /**
+ * @return {Array.<WebInspector.RemoteObjectProperty>}
+ */
+ _children: function()
+ {
+ if (!this.hasChildren)
+ return [];
+
+ function buildProperty(propName)
+ {
+ return new WebInspector.RemoteObjectProperty(propName, new WebInspector.LocalJSONObject(this._value[propName]));
+ }
+ if (!this._cachedChildren)
+ this._cachedChildren = Object.keys(this._value || {}).map(buildProperty.bind(this));
+ return this._cachedChildren;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isError: function()
+ {
+ return false;
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRuntimeObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceRuntimeObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RuntimeObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RuntimeObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.RuntimeObserver.prototype = {
+ constructor: WebInspector.RuntimeObserver,
+
+ // Events defined by the "Runtime" domain.
+
+ executionContextCreated: function(contextPayload)
+ {
+ WebInspector.frameResourceManager.executionContextCreated(contextPayload);
+ }
+};
+
+WebInspector.RuntimeObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolTimelineObserverjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineObserver.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineObserver = function()
+{
+ WebInspector.Object.call(this);
+};
+
+WebInspector.TimelineObserver.prototype = {
+ constructor: WebInspector.TimelineObserver,
+
+ // Events defined by the "Timeline" domain.
+
+ eventRecorded: function(record)
+ {
+ WebInspector.timelineManager.eventRecorded(record);
+ }
+};
+
+WebInspector.TimelineObserver.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceQuickConsolecss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/QuickConsole.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/QuickConsole.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/QuickConsole.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,82 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.quick-console {
- position: relative;
-
- display: -webkit-flex;
- -webkit-align-items: flex-end;
-
- background-color: white;
- border-top: 1px solid rgb(190, 190, 190);
-
- outline: none;
- overflow: hidden;
-
- font-family: Menlo, monospace;
- font-size: 11px;
-}
-
-.quick-console.showing-log {
- border-top-color: rgb(240, 240, 240);
-}
-
-.quick-console > .console-prompt {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- -webkit-align-items: flex-start;
-
- max-height: 150px;
-
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-.quick-console > .console-prompt::before {
- position: relative;
- z-index: 1;
-
- top: 5px;
- left: 4px;
-
- margin-right: 1px;
-
- width: 10px;
- height: 10px;
-
- content: url(Images/UserInputPrompt.svg);
-}
-
-.quick-console > .console-prompt > .CodeMirror {
- margin: 4px 0 3px;
-}
-
-.quick-console > .navigation-bar {
- background: transparent;
- border: none;
-
- height: 21px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceQuickConsolejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/QuickConsole.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/QuickConsole.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/QuickConsole.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,352 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.QuickConsole = function(element)
-{
- WebInspector.Object.call(this);
-
- this._toggleOrFocusKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape, this._toggleOrFocus.bind(this));
-
- var mainFrameExecutionContext = new WebInspector.ExecutionContext(WebInspector.QuickConsole.MainFrameContextExecutionIdentifier, WebInspector.UIString("Main Frame"), true, null);
- this._mainFrameExecutionContextPathComponent = this._createExecutionContextPathComponent(mainFrameExecutionContext.name, mainFrameExecutionContext.identifier);
- this._selectedExecutionContextPathComponent = this._mainFrameExecutionContextPathComponent;
-
- this._otherExecutionContextPathComponents = [];
- this._frameIdentifierToExecutionContextPathComponentMap = {};
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.QuickConsole.StyleClassName);
-
- this.prompt = new WebInspector.ConsolePrompt(null, "text/javascript");
- this.prompt.element.classList.add(WebInspector.QuickConsole.TextPromptStyleClassName);
- this._element.appendChild(this.prompt.element);
-
- this.prompt.shown();
-
- this._navigationBar = new WebInspector.QuickConsoleNavigationBar;
- this._element.appendChild(this._navigationBar.element);
-
- this._executionContextSelectorItem = new WebInspector.HierarchicalPathNavigationItem;
- this._executionContextSelectorItem.showSelectorArrows = true;
- this._navigationBar.addNavigationItem(this._executionContextSelectorItem);
-
- this._executionContextSelectorDivider = new WebInspector.DividerNavigationItem;
- this._navigationBar.addNavigationItem(this._executionContextSelectorDivider);
-
- this._rebuildExecutionContextPathComponents();
-
- // COMPATIBILITY (iOS 6): Execution contexts did not exist, evaluation worked with frame ids.
- if (WebInspector.ExecutionContext.supported()) {
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextsChanged, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ExecutionContextsCleared, this._frameExecutionContextsCleared, this);
- } else {
- WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameAdded, this);
- WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasRemoved, this._frameRemoved, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._frameMainResourceChanged, this);
- }
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._debuggerActiveCallFrameDidChange, this);
-};
-
-WebInspector.QuickConsole.StyleClassName = "quick-console";
-WebInspector.QuickConsole.ShowingLogClassName = "showing-log";
-WebInspector.QuickConsole.NavigationBarContainerStyleClassName = "navigation-bar-container";
-WebInspector.QuickConsole.NavigationBarSpacerStyleClassName = "navigation-bar-spacer";
-WebInspector.QuickConsole.TextPromptStyleClassName = "text-prompt";
-
-WebInspector.QuickConsole.ToolbarSingleLineHeight = 21;
-WebInspector.QuickConsole.ToolbarPromptPadding = 4;
-WebInspector.QuickConsole.ToolbarTopBorder = 1;
-
-WebInspector.QuickConsole.MainFrameContextExecutionIdentifier = undefined;
-
-WebInspector.QuickConsole.Event = {
- DidResize: "quick-console-did-resize"
-};
-
-WebInspector.QuickConsole.prototype = {
- constructor: WebInspector.QuickConsole,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get navigationBar()
- {
- return this._navigationBar;
- },
-
- get executionContextIdentifier()
- {
- return this._selectedExecutionContextPathComponent._executionContextIdentifier;
- },
-
- updateLayout: function()
- {
- // A hard maximum size of 33% of the window.
- const maximumAllowedHeight = Math.round(window.innerHeight * 0.33);
- this.prompt.element.style.maxHeight = maximumAllowedHeight + "px";
- },
-
- consoleLogVisibilityChanged: function(visible)
- {
- if (visible)
- this.element.classList.add(WebInspector.QuickConsole.ShowingLogClassName);
- else
- this.element.classList.remove(WebInspector.QuickConsole.ShowingLogClassName);
-
- this.dispatchEventToListeners(WebInspector.QuickConsole.Event.DidResize);
- },
-
- // Private
-
- _executionContextPathComponentsToDisplay: function()
- {
- // If we are in the debugger the console will use the active call frame, don't show the selector.
- if (WebInspector.debuggerManager.activeCallFrame)
- return [];
-
- // If there is only the Main Frame, don't show the selector.
- if (!this._otherExecutionContextPathComponents.length)
- return [];
-
- return [this._selectedExecutionContextPathComponent];
- },
-
- _rebuildExecutionContextPathComponents: function()
- {
- var components = this._executionContextPathComponentsToDisplay();
- var isEmpty = !components.length;
-
- this._executionContextSelectorItem.components = components;
-
- this._executionContextSelectorItem.hidden = isEmpty;
- this._executionContextSelectorDivider.hidden = isEmpty;
- },
-
- _framePageExecutionContextsChanged: function(event)
- {
- var frame = event.target;
-
- var shouldAutomaticallySelect = this._restoreSelectedExecutionContextForFrame === frame;
-
- var newExecutionContextPathComponent = this._insertExecutionContextPathComponentForFrame(frame, shouldAutomaticallySelect);
-
- if (shouldAutomaticallySelect) {
- delete this._restoreSelectedExecutionContextForFrame;
- this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
- this._rebuildExecutionContextPathComponents();
- }
- },
-
- _frameExecutionContextsCleared: function(event)
- {
- var frame = event.target;
-
- // If this frame is navigating and it is selected in the UI we want to reselect its new item after navigation.
- if (event.data.committingProvisionalLoad && !this._restoreSelectedExecutionContextForFrame) {
- var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
- if (this._selectedExecutionContextPathComponent === executionContextPathComponent) {
- this._restoreSelectedExecutionContextForFrame = frame;
- // As a fail safe, if the frame never gets an execution context, clear the restore value.
- setTimeout(function() { delete this._restoreSelectedExecutionContextForFrame; }.bind(this), 10);
- }
- }
-
- this._removeExecutionContextPathComponentForFrame(frame);
- },
-
- _frameAdded: function(event)
- {
- var frame = event.data.frame;
- this._insertExecutionContextPathComponentForFrame(frame);
- },
-
- _frameRemoved: function(event)
- {
- var frame = event.data.frame;
- this._removeExecutionContextPathComponentForFrame(frame);
- },
-
- _frameMainResourceChanged: function(event)
- {
- var frame = event.target;
- this._updateExecutionContextPathComponentForFrame(frame);
- },
-
- _createExecutionContextPathComponent: function(name, identifier)
- {
- var pathComponent = new WebInspector.HierarchicalPathComponent(name, "execution-context", identifier, true, true);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._pathComponentClicked, this);
- pathComponent.truncatedDisplayNameLength = 50;
- pathComponent._executionContextIdentifier = identifier;
- return pathComponent;
- },
-
- _createExecutionContextPathComponentFromFrame: function(frame)
- {
- var name = frame.name ? frame.name + " \u2014 " + frame.mainResource.displayName : frame.mainResource.displayName;
- var identifier = WebInspector.ExecutionContext.supported() ? frame.pageExecutionContext.id : frame.id;
-
- var pathComponent = this._createExecutionContextPathComponent(name, identifier);
- pathComponent._frame = frame;
-
- return pathComponent;
- },
-
- _compareExecutionContextPathComponents: function(a, b)
- {
- // "Main Frame" always on top.
- if (!a._frame)
- return -1;
- if (!b._frame)
- return 1;
-
- // Frames with a name above frames without a name.
- if (a._frame.name && !b._frame.name)
- return -1;
- if (!a._frame.name && b._frame.name)
- return 1;
-
- return a.displayName.localeCompare(b.displayName);
- },
-
- _insertExecutionContextPathComponentForFrame: function(frame, skipRebuild)
- {
- if (frame.isMainFrame())
- return;
-
- console.assert(!this._frameIdentifierToExecutionContextPathComponentMap[frame.id]);
- if (this._frameIdentifierToExecutionContextPathComponentMap[frame.id])
- return;
-
- var executionContextPathComponent = this._createExecutionContextPathComponentFromFrame(frame);
-
- var index = insertionIndexForObjectInListSortedByFunction(executionContextPathComponent, this._otherExecutionContextPathComponents, this._compareExecutionContextPathComponents);
-
- var prev = index > 0 ? this._otherExecutionContextPathComponents[index - 1] : this._mainFrameExecutionContextPathComponent;
- var next = this._otherExecutionContextPathComponents[index] || null;
- if (prev) {
- prev.nextSibling = executionContextPathComponent;
- executionContextPathComponent.previousSibling = prev;
- }
- if (next) {
- next.previousSibling = executionContextPathComponent;
- executionContextPathComponent.nextSibling = next;
- }
-
- this._otherExecutionContextPathComponents.splice(index, 0, executionContextPathComponent);
- this._frameIdentifierToExecutionContextPathComponentMap[frame.id] = executionContextPathComponent;
-
- if (!skipRebuild)
- this._rebuildExecutionContextPathComponents();
-
- return executionContextPathComponent;
- },
-
- _removeExecutionContextPathComponentForFrame: function(frame, skipRebuild)
- {
- if (frame.isMainFrame())
- return;
-
- var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
- console.assert(executionContextPathComponent);
- if (!executionContextPathComponent)
- return;
-
- executionContextPathComponent.removeEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- executionContextPathComponent.removeEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._pathComponentClicked, this);
-
- var prev = executionContextPathComponent.previousSibling;
- var next = executionContextPathComponent.nextSibling;
- if (prev)
- prev.nextSibling = next;
- if (next)
- next.previousSibling = prev;
-
- if (this._selectedExecutionContextPathComponent === executionContextPathComponent)
- this._selectedExecutionContextPathComponent = this._mainFrameExecutionContextPathComponent;
-
- this._otherExecutionContextPathComponents.remove(executionContextPathComponent, true);
- delete this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
-
- if (!skipRebuild)
- this._rebuildExecutionContextPathComponents();
- },
-
- _updateExecutionContextPathComponentForFrame: function(frame)
- {
- if (frame.isMainFrame())
- return;
-
- var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
- if (!executionContextPathComponent)
- return;
-
- var wasSelected = this._selectedExecutionContextPathComponent === executionContextPathComponent;
-
- this._removeExecutionContextPathComponentForFrame(frame, true);
- var newExecutionContextPathComponent = this._insertExecutionContextPathComponentForFrame(frame, true);
-
- if (wasSelected)
- this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
-
- this._rebuildExecutionContextPathComponents();
- },
-
- _pathComponentSelected: function(event)
- {
- if (event.data.pathComponent === this._selectedExecutionContextPathComponent)
- return;
-
- this._selectedExecutionContextPathComponent = event.data.pathComponent;
-
- this._rebuildExecutionContextPathComponents();
- },
-
- _pathComponentClicked: function(event)
- {
- this.prompt.focus();
- },
-
- _debuggerActiveCallFrameDidChange: function(event)
- {
- this._rebuildExecutionContextPathComponents();
- },
-
- _toggleOrFocus: function(event)
- {
- if (this.prompt.focused)
- WebInspector.toggleSplitConsole();
- else if (!WebInspector.isEditingAnyField() && !WebInspector.isEventTargetAnEditableField(event))
- this.prompt.focus();
- }
-};
-
-WebInspector.QuickConsole.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceQuickConsoleNavigationBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/QuickConsoleNavigationBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/QuickConsoleNavigationBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/QuickConsoleNavigationBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.QuickConsoleNavigationBar = function(element, navigationItems)
-{
- WebInspector.NavigationBar.call(this, element, navigationItems);
-};
-
-WebInspector.QuickConsoleNavigationBar.prototype = {
- constructor: WebInspector.QuickConsoleNavigationBar,
-
- get sizesToFit()
- {
- return true;
- },
-
- addNavigationItem: function(navigationItem)
- {
- // Add new navigation items to the left.
- return this.insertNavigationItem(navigationItem, 0);
- }
-};
-
-WebInspector.QuickConsoleNavigationBar.prototype.__proto__ = WebInspector.NavigationBar.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.navigation-bar .item.radio.button:not(.text-only) {
- width: 32px;
-}
-
-.navigation-bar.collapsed .item.radio.button:not(.text-only) {
- width: 24px;
-}
-
-.navigation-bar .item.radio.button.text-only.selected {
- background-repeat: no-repeat;
- background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.09) 12%, rgba(0, 0, 0, 0.06) 12%, transparent), -webkit-linear-gradient(top, rgba(0, 0, 0, 0.45), transparent),
- -webkit-linear-gradient(top, rgba(0, 0, 0, 0.45), transparent);
- background-size: 100% 100%, 1px 100%, 1px 100%;
- background-position: left top, left top, right top;
-
- font-weight: bold;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,111 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RadioButtonNavigationItem = function(identifier, toolTip, image, imageWidth, imageHeight) {
- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, null, "tab");
-};
-
-WebInspector.RadioButtonNavigationItem.StyleClassName = "radio";
-WebInspector.RadioButtonNavigationItem.ActiveStyleClassName = "active";
-WebInspector.RadioButtonNavigationItem.SelectedStyleClassName = "selected";
-
-WebInspector.RadioButtonNavigationItem.prototype = {
- constructor: WebInspector.RadioButtonNavigationItem,
-
- // Public
-
- get selected()
- {
- return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
- },
-
- set selected(flag)
- {
- if (flag) {
- this.element.classList.add(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
- this.element.setAttribute("aria-selected", "true");
- } else {
- this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
- this.element.setAttribute("aria-selected", "false");
- }
- },
-
- get active()
- {
- return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
- },
-
- set active(flag)
- {
- if (flag)
- this.element.classList.add(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
- else
- this.element.classList.remove(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
- },
-
- generateStyleText: function(parentSelector)
- {
- var classNames = this._classNames.join(".");
-
- // Default state.
- var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier() + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
-
- // Selected state.
- styleText += parentSelector + " ." + classNames + ".selected:not(.disabled) > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
-
- // Selected and pressed state.
- styleText += parentSelector + " ." + classNames + ".selected:not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.ActiveFocus) + "); }\n";
-
- return styleText;
- },
-
- updateLayout: function(expandOnly)
- {
- if (expandOnly)
- return;
-
- var isSelected = this.selected;
-
- if (!isSelected) {
- this.element.classList.add(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
- this.element.setAttribute("aria-selected", "true");
- }
-
- var selectedWidth = this.element.offsetWidth;
- if (selectedWidth)
- this.element.style.minWidth = selectedWidth + "px";
-
- if (!isSelected) {
- this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
- this.element.setAttribute("aria-selected", "false");
- }
- },
-
- // Private
-
- _additionalClassNames: [WebInspector.RadioButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
-};
-
-WebInspector.RadioButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRemoteObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RemoteObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RemoteObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RemoteObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,492 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.
- */
-
-/**
- * @constructor
- * @param {string|undefined} objectId
- * @param {string} type
- * @param {string|undefined} subtype
- * @param {*} value
- * @param {string=} description
- */
-WebInspector.RemoteObject = function(objectId, type, subtype, value, description)
-{
- this._type = type;
- this._subtype = subtype;
- if (objectId) {
- // handle
- this._objectId = objectId;
- this._description = description;
- this._hasChildren = true;
- } else {
- // Primitive or null object.
- console.assert(type !== "object" || value === null);
- this._description = description || (value + "");
- this._hasChildren = false;
- this.value = value;
- }
-}
-
-/**
- * @param {number|string|boolean} value
- * @return {WebInspector.RemoteObject}
- */
-WebInspector.RemoteObject.fromPrimitiveValue = function(value)
-{
- return new WebInspector.RemoteObject(undefined, typeof value, undefined, value);
-}
-
-/**
- * @param {Object} value
- * @return {WebInspector.RemoteObject}
- */
-WebInspector.RemoteObject.fromLocalObject = function(value)
-{
- return new WebInspector.LocalJSONObject(value);
-}
-
-/**
- * @param {WebInspector.DOMNode} node
- * @param {string} objectGroup
- * @param {function(?WebInspector.RemoteObject)} callback
- */
-WebInspector.RemoteObject.resolveNode = function(node, objectGroup, callback)
-{
- /**
- * @param {?Protocol.Error} error
- * @param {RuntimeAgent.RemoteObject} object
- */
- function mycallback(error, object)
- {
- if (!callback)
- return;
-
- if (error || !object)
- callback(null);
- else
- callback(WebInspector.RemoteObject.fromPayload(object));
- }
- DOMAgent.resolveNode(node.id, objectGroup, mycallback);
-}
-
-/**
- * @param {RuntimeAgent.RemoteObject} payload
- * @return {WebInspector.RemoteObject}
- */
-WebInspector.RemoteObject.fromPayload = function(payload)
-{
- console.assert(typeof payload === "object", "Remote object payload should only be an object");
-
- return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description);
-}
-
-/**
- * @param {WebInspector.RemoteObject} remoteObject
- * @return {string}
- */
-WebInspector.RemoteObject.type = function(remoteObject)
-{
- if (remoteObject === null)
- return "null";
-
- var type = typeof remoteObject;
- if (type !== "object" && type !== "function")
- return type;
-
- return remoteObject.type;
-}
-
-WebInspector.RemoteObject.prototype = {
- /** @return {RuntimeAgent.RemoteObjectId} */
- get objectId()
- {
- return this._objectId;
- },
-
- /** @return {string} */
- get type()
- {
- return this._type;
- },
-
- /** @return {string|undefined} */
- get subtype()
- {
- return this._subtype;
- },
-
- /** @return {string|undefined} */
- get description()
- {
- return this._description;
- },
-
- /** @return {boolean} */
- get hasChildren()
- {
- return this._hasChildren;
- },
-
- /**
- * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
- */
- getOwnProperties: function(callback)
- {
- this._getProperties(true, callback);
- },
-
- /**
- * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
- */
- getAllProperties: function(callback)
- {
- this._getProperties(false, callback);
- },
-
- /**
- * @param {boolean} ownProperties
- * @param {function(Array.<RuntimeAgent.RemoteObject>)} callback
- */
- _getProperties: function(ownProperties, callback)
- {
- if (!this._objectId) {
- callback([]);
- return;
- }
-
- /**
- * @param {?Protocol.Error} error
- * @param {Array.<WebInspector.RemoteObjectProperty>} properties
- */
- function remoteObjectBinder(error, properties)
- {
- if (error) {
- callback(null);
- return;
- }
- var result = [];
- for (var i = 0; properties && i < properties.length; ++i) {
- var property = properties[i];
- if (property.get || property.set) {
- if (property.get)
- result.push(new WebInspector.RemoteObjectProperty("get " + property.name, WebInspector.RemoteObject.fromPayload(property.get), property));
- if (property.set)
- result.push(new WebInspector.RemoteObjectProperty("set " + property.name, WebInspector.RemoteObject.fromPayload(property.set), property));
- } else
- result.push(new WebInspector.RemoteObjectProperty(property.name, WebInspector.RemoteObject.fromPayload(property.value), property));
- }
- callback(result);
- }
- RuntimeAgent.getProperties(this._objectId, ownProperties, remoteObjectBinder);
- },
-
- /**
- * @param {string} name
- * @param {string} value
- * @param {function(string=)} callback
- */
- setPropertyValue: function(name, value, callback)
- {
- if (!this._objectId) {
- callback("Can't set a property of non-object.");
- return;
- }
-
- RuntimeAgent.evaluate.invoke({expression:value, doNotPauseOnExceptionsAndMuteConsole:true}, evaluatedCallback.bind(this));
-
- /**
- * @param {?Protocol.Error} error
- * @param {RuntimeAgent.RemoteObject} result
- * @param {boolean=} wasThrown
- */
- function evaluatedCallback(error, result, wasThrown)
- {
- if (error || wasThrown) {
- callback(error || result.description);
- return;
- }
-
- function setPropertyValue(propertyName, propertyValue)
- {
- this[propertyName] = propertyValue;
- }
-
- delete result.description; // Optimize on traffic.
- RuntimeAgent.callFunctionOn(this._objectId, setPropertyValue.toString(), [{ value:name }, result], true, undefined, propertySetCallback.bind(this));
- if (result._objectId)
- RuntimeAgent.releaseObject(result._objectId);
- }
-
- /**
- * @param {?Protocol.Error} error
- * @param {RuntimeAgent.RemoteObject} result
- * @param {boolean=} wasThrown
- */
- function propertySetCallback(error, result, wasThrown)
- {
- if (error || wasThrown) {
- callback(error || result.description);
- return;
- }
- callback();
- }
- },
-
- /**
- * @param {function(DOMAgent.NodeId)} callback
- */
- pushNodeToFrontend: function(callback)
- {
- if (this._objectId)
- WebInspector.domTreeManager.pushNodeToFrontend(this._objectId, callback);
- else
- callback(0);
- },
-
- /**
- * @param {string} functionDeclaration
- * @param {function(?WebInspector.RemoteObject)} callback
- */
- callFunction: function(functionDeclaration, args, callback)
- {
- function mycallback(error, result, wasThrown)
- {
- callback((error || wasThrown) ? null : WebInspector.RemoteObject.fromPayload(result));
- }
-
- RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, undefined, mycallback);
- },
-
- /**
- * @param {string} functionDeclaration
- * @param {function(*)} callback
- */
- callFunctionJSON: function(functionDeclaration, args, callback)
- {
- function mycallback(error, result, wasThrown)
- {
- callback((error || wasThrown) ? null : result.value);
- }
-
- RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, true, mycallback);
- },
-
- release: function()
- {
- RuntimeAgent.releaseObject(this._objectId);
- },
-
- /**
- * @return {number}
- */
- arrayLength: function()
- {
- if (this.subtype !== "array")
- return 0;
-
- var matches = this._description.match(/\[([0-9]+)\]/);
- if (!matches)
- return 0;
- return parseInt(matches[1], 10);
- }
-}
-
-/**
- * @constructor
- * @param {string} name
- * @param {WebInspector.RemoteObject} value
- * @param {Object=} descriptor
- */
-WebInspector.RemoteObjectProperty = function(name, value, descriptor)
-{
- this.name = name;
- this.value = value;
- this.enumerable = descriptor ? !!descriptor.enumerable : true;
- this.writable = descriptor ? !!descriptor.writable : true;
- if (descriptor && descriptor.wasThrown)
- this.wasThrown = true;
-}
-
-/**
- * @param {string} name
- * @param {string} value
- * @return {WebInspector.RemoteObjectProperty}
- */
-WebInspector.RemoteObjectProperty.fromPrimitiveValue = function(name, value)
-{
- return new WebInspector.RemoteObjectProperty(name, WebInspector.RemoteObject.fromPrimitiveValue(value));
-}
-
-// The below is a wrapper around a local object that provides an interface comaptible
-// with RemoteObject, to be used by the UI code (primarily ObjectPropertiesSection).
-// Note that only JSON-compliant objects are currently supported, as there's no provision
-// for traversing prototypes, extracting class names via constuctor, handling properties
-// or functions.
-
-/**
- * @constructor
- * @extends {WebInspector.RemoteObject}
- * @param {Object} value
- */
-WebInspector.LocalJSONObject = function(value)
-{
- this._value = value;
-}
-
-WebInspector.LocalJSONObject.prototype = {
- /**
- * @return {string}
- */
- get description()
- {
- if (this._cachedDescription)
- return this._cachedDescription;
-
- if (this.type === "object") {
- switch (this.subtype) {
- case "array":
- function formatArrayItem(property)
- {
- return property.value.description;
- }
- this._cachedDescription = this._concatenate("[", "]", formatArrayItem);
- break;
- case "null":
- this._cachedDescription = "null";
- break;
- default:
- function formatObjectItem(property)
- {
- return property.name + ":" + property.value.description;
- }
- this._cachedDescription = this._concatenate("{", "}", formatObjectItem);
- }
- } else
- this._cachedDescription = String(this._value);
-
- return this._cachedDescription;
- },
-
- /**
- * @param {string} prefix
- * @param {string} suffix
- * @return {string}
- */
- _concatenate: function(prefix, suffix, formatProperty)
- {
- const previewChars = 100;
-
- var buffer = prefix;
- var children = this._children();
- for (var i = 0; i < children.length; ++i) {
- var itemDescription = formatProperty(children[i]);
- if (buffer.length + itemDescription.length > previewChars) {
- buffer += ",\u2026";
- break;
- }
- if (i)
- buffer += ", ";
- buffer += itemDescription;
- }
- buffer += suffix;
- return buffer;
- },
-
- /**
- * @return {string}
- */
- get type()
- {
- return typeof this._value;
- },
-
- /**
- * @return {string|undefined}
- */
- get subtype()
- {
- if (this._value === null)
- return "null";
-
- if (this._value instanceof Array)
- return "array";
-
- return undefined;
- },
-
- /**
- * @return {boolean}
- */
- get hasChildren()
- {
- return typeof this._value === "object" && this._value !== null && !isEmptyObject(this._value);
- },
-
- /**
- * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
- */
- getOwnProperties: function(callback)
- {
- callback(this._children());
- },
-
- /**
- * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
- */
- getAllProperties: function(callback)
- {
- callback(this._children());
- },
-
- /**
- * @return {Array.<WebInspector.RemoteObjectProperty>}
- */
- _children: function()
- {
- if (!this.hasChildren)
- return [];
-
- function buildProperty(propName)
- {
- return new WebInspector.RemoteObjectProperty(propName, new WebInspector.LocalJSONObject(this._value[propName]));
- }
- if (!this._cachedChildren)
- this._cachedChildren = Object.keys(this._value || {}).map(buildProperty.bind(this));
- return this._cachedChildren;
- },
-
- /**
- * @return {boolean}
- */
- isError: function()
- {
- return false;
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourcejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Resource.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Resource.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Resource.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,707 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Resource = function(url, mimeType, type, loaderIdentifier, requestIdentifier, requestMethod, requestHeaders, requestData, requestSentTimestamp, initiatorSourceCodeLocation)
-{
- WebInspector.SourceCode.call(this);
-
- console.assert(url);
-
- if (type in WebInspector.Resource.Type)
- type = WebInspector.Resource.Type[type];
-
- this._url = url;
- this._mimeType = mimeType;
- this._type = type || WebInspector.Resource.Type.fromMIMEType(mimeType);
- this._loaderIdentifier = loaderIdentifier || null;
- this._requestIdentifier = requestIdentifier || null;
- this._requestMethod = requestMethod || null;
- this._requestData = requestData || null;
- this._requestHeaders = requestHeaders || {};
- this._responseHeaders = {};
- this._parentFrame = null;
- this._initiatorSourceCodeLocation = initiatorSourceCodeLocation || null;
- this._requestSentTimestamp = requestSentTimestamp || NaN;
- this._responseReceivedTimestamp = NaN;
- this._lastRedirectReceivedTimestamp = NaN;
- this._lastDataReceivedTimestamp = NaN;
- this._finishedOrFailedTimestamp = NaN;
- this._size = NaN;
- this._transferSize = NaN;
- this._cached = false;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Resource);
-
-WebInspector.Resource.TypeIdentifier = "resource";
-WebInspector.Resource.URLCookieKey = "resource-url";
-WebInspector.Resource.MainResourceCookieKey = "resource-is-main-resource";
-
-WebInspector.Resource.Event = {
- URLDidChange: "resource-url-did-change",
- MIMETypeDidChange: "resource-mime-type-did-change",
- TypeDidChange: "resource-type-did-change",
- RequestHeadersDidChange: "resource-request-headers-did-change",
- ResponseReceived: "resource-response-received",
- LoadingDidFinish: "resource-loading-did-finish",
- LoadingDidFail: "resource-loading-did-fail",
- TimestampsDidChange: "resource-timestamps-did-change",
- SizeDidChange: "resource-size-did-change",
- TransferSizeDidChange: "resource-transfer-size-did-change",
- CacheStatusDidChange: "resource-cached-did-change"
-};
-
-// Keep these in sync with the "ResourceType" enum defined by the "Page" domain.
-WebInspector.Resource.Type = {
- Document: "resource-type-document",
- Stylesheet: "resource-type-stylesheet",
- Image: "resource-type-image",
- Font: "resource-type-font",
- Script: "resource-type-script",
- XHR: "resource-type-xhr",
- WebSocket: "resource-type-websocket",
- Other: "resource-type-other"
-};
-
-// This MIME Type map is private, use WebInspector.Resource.Type.fromMIMEType().
-WebInspector.Resource.Type._mimeTypeMap = {
- "text/html": WebInspector.Resource.Type.Document,
- "text/xml": WebInspector.Resource.Type.Document,
- "text/plain": WebInspector.Resource.Type.Document,
- "application/xhtml+xml": WebInspector.Resource.Type.Document,
- "image/svg+xml": WebInspector.Resource.Type.Document,
-
- "text/css": WebInspector.Resource.Type.Stylesheet,
- "text/xsl": WebInspector.Resource.Type.Stylesheet,
- "text/x-less": WebInspector.Resource.Type.Stylesheet,
- "text/x-sass": WebInspector.Resource.Type.Stylesheet,
- "text/x-scss": WebInspector.Resource.Type.Stylesheet,
-
- "application/pdf": WebInspector.Resource.Type.Image,
-
- "application/x-font-type1": WebInspector.Resource.Type.Font,
- "application/x-font-ttf": WebInspector.Resource.Type.Font,
- "application/x-font-woff": WebInspector.Resource.Type.Font,
- "application/x-truetype-font": WebInspector.Resource.Type.Font,
-
- "text/javascript": WebInspector.Resource.Type.Script,
- "text/ecmascript": WebInspector.Resource.Type.Script,
- "application/javascript": WebInspector.Resource.Type.Script,
- "application/ecmascript": WebInspector.Resource.Type.Script,
- "application/x-javascript": WebInspector.Resource.Type.Script,
- "application/json": WebInspector.Resource.Type.Script,
- "application/x-json": WebInspector.Resource.Type.Script,
- "text/x-javascript": WebInspector.Resource.Type.Script,
- "text/x-json": WebInspector.Resource.Type.Script,
- "text/javascript1.1": WebInspector.Resource.Type.Script,
- "text/javascript1.2": WebInspector.Resource.Type.Script,
- "text/javascript1.3": WebInspector.Resource.Type.Script,
- "text/jscript": WebInspector.Resource.Type.Script,
- "text/livescript": WebInspector.Resource.Type.Script,
- "text/x-livescript": WebInspector.Resource.Type.Script,
- "text/typescript": WebInspector.Resource.Type.Script,
- "text/x-clojure": WebInspector.Resource.Type.Script,
- "text/x-coffeescript": WebInspector.Resource.Type.Script
-};
-
-WebInspector.Resource.Type.fromMIMEType = function(mimeType)
-{
- if (!mimeType)
- return WebInspector.Resource.Type.Other;
-
- mimeType = parseMIMEType(mimeType).type;
-
- if (mimeType in WebInspector.Resource.Type._mimeTypeMap)
- return WebInspector.Resource.Type._mimeTypeMap[mimeType];
-
- if (mimeType.startsWith("image/"))
- return WebInspector.Resource.Type.Image;
-
- if (mimeType.startsWith("font/"))
- return WebInspector.Resource.Type.Font;
-
- return WebInspector.Resource.Type.Other;
-};
-
-WebInspector.Resource.Type.displayName = function(type, plural)
-{
- switch(type) {
- case WebInspector.Resource.Type.Document:
- if (plural)
- return WebInspector.UIString("Documents");
- return WebInspector.UIString("Document");
- case WebInspector.Resource.Type.Stylesheet:
- if (plural)
- return WebInspector.UIString("Stylesheets");
- return WebInspector.UIString("Stylesheet");
- case WebInspector.Resource.Type.Image:
- if (plural)
- return WebInspector.UIString("Images");
- return WebInspector.UIString("Image");
- case WebInspector.Resource.Type.Font:
- if (plural)
- return WebInspector.UIString("Fonts");
- return WebInspector.UIString("Font");
- case WebInspector.Resource.Type.Script:
- if (plural)
- return WebInspector.UIString("Scripts");
- return WebInspector.UIString("Script");
- case WebInspector.Resource.Type.XHR:
- if (plural)
- return WebInspector.UIString("XHRs");
- return WebInspector.UIString("XHR");
- case WebInspector.Resource.Type.WebSocket:
- if (plural)
- return WebInspector.UIString("Sockets");
- return WebInspector.UIString("Socket");
- case WebInspector.Resource.Type.Other:
- return WebInspector.UIString("Other");
- default:
- console.error("Unknown resource type: ", type);
- return null;
- }
-};
-
-WebInspector.Resource.prototype = {
- constructor: WebInspector.Resource,
-
- // Public
-
- get url()
- {
- return this._url;
- },
-
- get urlComponents()
- {
- if (!this._urlComponents)
- this._urlComponents = parseURL(this._url);
- return this._urlComponents;
- },
-
- get displayName()
- {
- return WebInspector.displayNameForURL(this._url, this.urlComponents);
- },
-
- get initiatorSourceCodeLocation()
- {
- return this._initiatorSourceCodeLocation;
- },
-
- get type()
- {
- return this._type;
- },
-
- get mimeType()
- {
- return this._mimeType;
- },
-
- get mimeTypeComponents()
- {
- if (!this._mimeTypeComponents)
- this._mimeTypeComponents = parseMIMEType(this._mimeType);
- return this._mimeTypeComponents;
- },
-
- get syntheticMIMEType()
- {
- // Resources are often transferred with a MIME-type that doesn't match the purpose the
- // resource was loaded for, which is what WebInspector.Resource.Type represents.
- // This getter generates a MIME-type, if needed, that matches the resource type.
-
- // If the type matches the Resource.Type of the MIME-type, then return the actual MIME-type.
- if (this._type === WebInspector.Resource.Type.fromMIMEType(this._mimeType))
- return this._mimeType;
-
- // Return the default MIME-types for the Resource.Type, since the current MIME-type
- // does not match what is expected for the Resource.Type.
- switch (this._type) {
- case WebInspector.Resource.Type.Document:
- return "text/html";
- case WebInspector.Resource.Type.Stylesheet:
- return "text/css";
- case WebInspector.Resource.Type.Script:
- return "text/javascript";
- }
-
- // Return the actual MIME-type since we don't have a better synthesized one to return.
- return this._mimeType;
- },
-
- get contentURL()
- {
- const maximumDataURLSize = 1024 * 1024; // 1 MiB
-
- // If content is not available or won't fit a data URL, fallback to using original URL.
- var content = this.content;
- if (content === null || content.length > maximumDataURLSize)
- return this._url;
-
- return "data:" + this.mimeTypeComponents.type + (this.contentIsBase64Encoded ? ";base64," + content : "," + encodeURIComponent(content));
- },
-
- isMainResource: function()
- {
- return this._parentFrame ? this._parentFrame.mainResource === this : false;
- },
-
- get parentFrame()
- {
- return this._parentFrame;
- },
-
- get loaderIdentifier()
- {
- return this._loaderIdentifier;
- },
-
- get requestIdentifier()
- {
- return this._requestIdentifier;
- },
-
- get finished()
- {
- return this._finished;
- },
-
- get failed()
- {
- return this._failed;
- },
-
- get canceled()
- {
- return this._canceled;
- },
-
- get requestMethod()
- {
- return this._requestMethod;
- },
-
- get requestData()
- {
- return this._requestData;
- },
-
- get requestDataContentType()
- {
- return this._requestHeaders.valueForCaseInsensitiveKey("Content-Type") || null;
- },
-
- get requestHeaders()
- {
- return this._requestHeaders;
- },
-
- get responseHeaders()
- {
- return this._responseHeaders;
- },
-
- get requestSentTimestamp()
- {
- return this._requestSentTimestamp;
- },
-
- get lastRedirectReceivedTimestamp()
- {
- return this._lastRedirectReceivedTimestamp;
- },
-
- get responseReceivedTimestamp()
- {
- return this._responseReceivedTimestamp;
- },
-
- get lastDataReceivedTimestamp()
- {
- return this._lastDataReceivedTimestamp;
- },
-
- get finishedOrFailedTimestamp()
- {
- return this._finishedOrFailedTimestamp;
- },
-
- get firstTimestamp()
- {
- return this.requestSentTimestamp || this.lastRedirectReceivedTimestamp || this.responseReceivedTimestamp || this.lastDataReceivedTimestamp || this.finishedOrFailedTimestamp;
- },
-
- get lastTimestamp()
- {
- return this.finishedOrFailedTimestamp || this.lastDataReceivedTimestamp || this.responseReceivedTimestamp || this.lastRedirectReceivedTimestamp || this.requestSentTimestamp;
- },
-
- get duration()
- {
- return this._finishedOrFailedTimestamp - this._requestSentTimestamp;
- },
-
- get latency()
- {
- return this._responseReceivedTimestamp - this._requestSentTimestamp;
- },
-
- get receiveDuration()
- {
- return this._finishedOrFailedTimestamp - this._responseReceivedTimestamp;
- },
-
- get cached()
- {
- return this._cached;
- },
-
- get statusCode()
- {
- return this._statusCode;
- },
-
- get statusText()
- {
- return this._statusText;
- },
-
- get size()
- {
- return this._size;
- },
-
- get encodedSize()
- {
- if (!isNaN(this._transferSize))
- return this._transferSize;
-
- // If we did not receive actual transfer size from network
- // stack, we prefer using Content-Length over resourceSize as
- // resourceSize may differ from actual transfer size if platform's
- // network stack performed decoding (e.g. gzip decompression).
- // The Content-Length, though, is expected to come from raw
- // response headers and will reflect actual transfer length.
- // This won't work for chunked content encoding, so fall back to
- // resourceSize when we don't have Content-Length. This still won't
- // work for chunks with non-trivial encodings. We need a way to
- // get actual transfer size from the network stack.
-
- return Number(this._responseHeaders.valueForCaseInsensitiveKey("Content-Length") || this._size);
- },
-
- get transferSize()
- {
- if (this.statusCode === 304) // Not modified
- return this._responseHeadersSize;
-
- if (this._cached)
- return 0;
-
- return this._responseHeadersSize + this.encodedSize;
- },
-
- get compressed()
- {
- var contentEncoding = this._responseHeaders.valueForCaseInsensitiveKey("Content-Encoding");
- return contentEncoding && /\b(?:gzip|deflate)\b/.test(contentEncoding);
- },
-
- get scripts()
- {
- return this._scripts || [];
- },
-
- scriptForLocation: function(sourceCodeLocation)
- {
- console.assert(!(this instanceof WebInspector.SourceMapResource));
- console.assert(sourceCodeLocation.sourceCode === this, "SourceCodeLocation must be in this Resource");
- if (sourceCodeLocation.sourceCode !== this)
- return null;
-
- var lineNumber = sourceCodeLocation.lineNumber;
- var columnNumber = sourceCodeLocation.columnNumber;
- for (var i = 0; i < this._scripts.length; ++i) {
- var script = this._scripts[i];
- if (script.range.startLine <= lineNumber && script.range.endLine >= lineNumber) {
- if (script.range.startLine === lineNumber && columnNumber < script.range.startColumn)
- continue;
- if (script.range.endLine === lineNumber && columnNumber > script.range.endColumn)
- continue;
- return script;
- }
- }
-
- return null;
- },
-
- updateForRedirectResponse: function(url, requestHeaders, timestamp)
- {
- console.assert(!this._finished);
- console.assert(!this._failed);
- console.assert(!this._canceled);
-
- var oldURL = this._url;
-
- this._url = url;
- this._requestHeaders = requestHeaders || {};
- this._lastRedirectReceivedTimestamp = timestamp || NaN;
-
- if (oldURL !== url) {
- // Delete the URL components so the URL is re-parsed the next time it is requested.
- delete this._urlComponents;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange, {oldURL: oldURL});
- }
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.RequestHeadersDidChange);
- this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
- },
-
- updateForResponse: function(url, mimeType, type, responseHeaders, statusCode, statusText, timestamp)
- {
- console.assert(!this._finished);
- console.assert(!this._failed);
- console.assert(!this._canceled);
-
- var oldURL = this._url;
- var oldMIMEType = this._mimeType;
- var oldType = this._type;
-
- if (type in WebInspector.Resource.Type)
- type = WebInspector.Resource.Type[type];
-
- this._url = url;
- this._mimeType = mimeType;
- this._type = type || WebInspector.Resource.Type.fromMIMEType(mimeType);
- this._statusCode = statusCode;
- this._statusText = statusText;
- this._responseHeaders = responseHeaders || {};
- this._responseReceivedTimestamp = timestamp || NaN;
-
- this._responseHeadersSize = String(this._statusCode).length + this._statusText.length + 12; // Extra length is for "HTTP/1.1 ", " ", and "\r\n".
- for (var name in this._responseHeaders)
- this._responseHeadersSize += name.length + this._responseHeaders[name].length + 4; // Extra length is for ": ", and "\r\n".
-
- if (statusCode === 304 && !this._cached)
- this.markAsCached();
-
- if (oldURL !== url) {
- // Delete the URL components so the URL is re-parsed the next time it is requested.
- delete this._urlComponents;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.URLDidChange, {oldURL: oldURL});
- }
-
- if (oldMIMEType !== mimeType) {
- // Delete the MIME-type components so the MIME-type is re-parsed the next time it is requested.
- delete this._mimeTypeComponents;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.MIMETypeDidChange, {oldMIMEType: oldMIMEType});
- }
-
- if (oldType !== type)
- this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
-
- console.assert(isNaN(this._size));
- console.assert(isNaN(this._transferSize));
-
- // The transferSize becomes 0 when status is 304 or Content-Length is available, so
- // notify listeners of that change.
- if (statusCode === 304 || this._responseHeaders.valueForCaseInsensitiveKey("Content-Length"))
- this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.ResponseReceived);
- this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
- },
-
- canRequestContentFromBackend: function()
- {
- return this._finished;
- },
-
- requestContentFromBackend: function(callback)
- {
- // If we have the requestIdentifier we can get the actual response for this specific resource.
- // Otherwise the content will be cached resource data, which might not exist anymore.
- if (this._requestIdentifier) {
- NetworkAgent.getResponseBody(this._requestIdentifier, callback);
- return true;
- }
-
- if (this._parentFrame) {
- PageAgent.getResourceContent(this._parentFrame.id, this._url, callback);
- return true;
- }
-
- // There is no request identifier or frame to request content from. Return false to cause the
- // pending callbacks to get null content.
- return false;
- },
-
- increaseSize: function(dataLength, timestamp)
- {
- console.assert(dataLength >= 0);
-
- if (isNaN(this._size))
- this._size = 0;
-
- var previousSize = this._size;
-
- this._size += dataLength;
-
- this._lastDataReceivedTimestamp = timestamp || NaN;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.SizeDidChange, {previousSize: previousSize});
-
- // The transferSize is based off of size when status is not 304 or Content-Length is missing.
- if (isNaN(this._transferSize) && this._statusCode !== 304 && !this._responseHeaders.valueForCaseInsensitiveKey("Content-Length"))
- this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
- },
-
- increaseTransferSize: function(encodedDataLength)
- {
- console.assert(encodedDataLength >= 0);
-
- if (isNaN(this._transferSize))
- this._transferSize = 0;
- this._transferSize += encodedDataLength;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
- },
-
- markAsCached: function()
- {
- this._cached = true;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.CacheStatusDidChange);
-
- // The transferSize is starts returning 0 when cached is true, unless status is 304.
- if (this._statusCode !== 304)
- this.dispatchEventToListeners(WebInspector.Resource.Event.TransferSizeDidChange);
- },
-
- markAsFinished: function(timestamp)
- {
- console.assert(!this._failed);
- console.assert(!this._canceled);
-
- this._finished = true;
- this._finishedOrFailedTimestamp = timestamp || NaN;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFinish);
- this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
-
- if (this.canRequestContentFromBackend())
- this.requestContentFromBackendIfNeeded();
- },
-
- markAsFailed: function(canceled, timestamp)
- {
- console.assert(!this._finished);
-
- this._failed = true;
- this._canceled = canceled;
- this._finishedOrFailedTimestamp = timestamp || NaN;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.LoadingDidFail);
- this.dispatchEventToListeners(WebInspector.Resource.Event.TimestampsDidChange);
-
- // Force the content requests to be serviced. They will get null as the content.
- this.servicePendingContentRequests(true);
- },
-
- revertMarkAsFinished: function(timestamp)
- {
- console.assert(!this._failed);
- console.assert(!this._canceled);
- console.assert(this._finished);
-
- this._finished = false;
- this._finishedOrFailedTimestamp = NaN;
- },
-
- getImageSize: function(callback)
- {
- // Throw an error in the case this resource is not an image.
- if (this.type !== WebInspector.Resource.Type.Image)
- throw "Resource is not an image.";
-
- // See if we've already computed and cached the image size,
- // in which case we can provide them directly.
- if (this._imageSize) {
- callback(this._imageSize);
- return;
- }
-
- // Event handler for the image "load" event.
- function imageDidLoad()
- {
- // Cache the image metrics.
- this._imageSize = {
- width: image.width,
- height: image.height
- };
-
- callback(this._imageSize);
- };
-
- // Create an <img> element that we'll use to load the image resource
- // so that we can query its intrinsic size.
- var image = new Image;
- image.addEventListener("load", imageDidLoad.bind(this), false);
-
- // Set the image source once we've obtained the base64-encoded URL for it.
- this.requestContent(function() {
- image.src = this.contentURL;
- }.bind(this));
- },
-
- associateWithScript: function(script)
- {
- if (!this._scripts)
- this._scripts = []
-
- this._scripts.push(script);
-
- // COMPATIBILITY (iOS 6): Resources did not know their type until a response
- // was received. We can set the Resource type to be Script here.
- if (this._type === WebInspector.Resource.Type.Other) {
- var oldType = this._type;
- this._type = WebInspector.Resource.Type.Script;
- this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
- }
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.Resource.URLCookieKey] = this.url;
- cookie[WebInspector.Resource.MainResourceCookieKey] = this.isMainResource();
- }
-};
-
-WebInspector.Resource.prototype.__proto__ = WebInspector.SourceCode.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceClusterContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceClusterContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceClusterContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceClusterContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,272 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceClusterContentView = function(resource)
-{
- WebInspector.ClusterContentView.call(this, resource);
-
- this._resource = resource;
- this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
- this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._resourceLoadingDidFinish, this);
-
- function createPathComponent(displayName, className, identifier)
- {
- var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- return pathComponent;
- }
-
- this._requestPathComponent = createPathComponent.call(this, WebInspector.UIString("Request"), WebInspector.ResourceClusterContentView.RequestIconStyleClassName, WebInspector.ResourceClusterContentView.RequestIdentifier);
- this._responsePathComponent = createPathComponent.call(this, WebInspector.UIString("Response"), WebInspector.ResourceClusterContentView.ResponseIconStyleClassName, WebInspector.ResourceClusterContentView.ResponseIdentifier);
-
- this._requestPathComponent.nextSibling = this._responsePathComponent;
- this._responsePathComponent.previousSibling = this._requestPathComponent;
-
- this._currentContentViewSetting = new WebInspector.Setting("resource-current-view-" + this._resource.url.hash, WebInspector.ResourceClusterContentView.ResponseIdentifier);
-};
-
-WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey = "resource-cluster-content-view-identifier";
-
-WebInspector.ResourceClusterContentView.RequestIconStyleClassName = "request-icon";
-WebInspector.ResourceClusterContentView.ResponseIconStyleClassName = "response-icon";
-WebInspector.ResourceClusterContentView.RequestIdentifier = "request";
-WebInspector.ResourceClusterContentView.ResponseIdentifier = "response";
-
-WebInspector.ResourceClusterContentView.prototype = {
- constructor: WebInspector.ResourceClusterContentView,
-
- // Public
-
- get resource()
- {
- return this._resource;
- },
-
- get responseContentView()
- {
- if (this._responseContentView)
- return this._responseContentView;
-
- switch (this._resource.type) {
- case WebInspector.Resource.Type.Document:
- case WebInspector.Resource.Type.Script:
- case WebInspector.Resource.Type.Stylesheet:
- case WebInspector.Resource.Type.XHR:
- this._responseContentView = new WebInspector.TextResourceContentView(this._resource);
- break;
-
- case WebInspector.Resource.Type.Image:
- this._responseContentView = new WebInspector.ImageResourceContentView(this._resource);
- break;
-
- case WebInspector.Resource.Type.Font:
- this._responseContentView = new WebInspector.FontResourceContentView(this._resource);
- break;
-
- default:
- this._responseContentView = new WebInspector.GenericResourceContentView(this._resource);
- break;
- }
-
- return this._responseContentView;
- },
-
- get requestContentView()
- {
- if (!this._canShowRequestContentView())
- return null;
-
- if (this._requestContentView)
- return this._requestContentView;
-
- this._requestContentView = new WebInspector.TextContentView(this._resource.requestData || "", this._resource.requestDataContentType);
-
- return this._requestContentView;
- },
-
- get selectionPathComponents()
- {
- var currentContentView = this._contentViewContainer.currentContentView;
- if (!currentContentView)
- return [];
-
- if (!this._canShowRequestContentView())
- return currentContentView.selectionPathComponents;
-
- // Append the current view's path components to the path component representing the current view.
- var components = [this._pathComponentForContentView(currentContentView)];
- return components.concat(currentContentView.selectionPathComponents);
- },
-
- shown: function()
- {
- WebInspector.ClusterContentView.prototype.shown.call(this);
-
- if (this._shownInitialContent)
- return;
-
- this._showContentViewForIdentifier(this._currentContentViewSetting.value);
- },
-
- closed: function()
- {
- WebInspector.ClusterContentView.prototype.closed.call(this);
-
- this._shownInitialContent = false;
- },
-
- saveToCookie: function(cookie)
- {
- cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey] = this._currentContentViewSetting.value;
- },
-
- restoreFromCookie: function(cookie)
- {
- var contentView = this._showContentViewForIdentifier(cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]);
- if (typeof contentView.revealPosition === "function" && "lineNumber" in cookie && "columnNumber" in cookie)
- contentView.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
- },
-
- showRequest: function()
- {
- this._shownInitialContent = true;
-
- return this._showContentViewForIdentifier(WebInspector.ResourceClusterContentView.RequestIdentifier);
- },
-
- showResponse: function(positionToReveal, textRangeToSelect, forceUnformatted)
- {
- this._shownInitialContent = true;
-
- if (!this._resource.finished) {
- this._positionToReveal = positionToReveal;
- this._textRangeToSelect = textRangeToSelect;
- this._forceUnformatted = forceUnformatted;
- }
-
- var responseContentView = this._showContentViewForIdentifier(WebInspector.ResourceClusterContentView.ResponseIdentifier);
- if (typeof responseContentView.revealPosition === "function")
- responseContentView.revealPosition(positionToReveal, textRangeToSelect, forceUnformatted);
- return responseContentView;
- },
-
- // Private
-
- _canShowRequestContentView: function()
- {
- var requestData = this._resource.requestData;
- if (!requestData)
- return false;
-
- var requestDataContentType = this._resource.requestDataContentType;
- if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i))
- return false;
-
- return true;
- },
-
- _pathComponentForContentView: function(contentView)
- {
- console.assert(contentView);
- if (!contentView)
- return null;
- if (contentView === this._requestContentView)
- return this._requestPathComponent;
- if (contentView === this._responseContentView)
- return this._responsePathComponent;
- console.error("Unknown contentView.");
- return null;
- },
-
- _identifierForContentView: function(contentView)
- {
- console.assert(contentView);
- if (!contentView)
- return null;
- if (contentView === this._requestContentView)
- return WebInspector.ResourceClusterContentView.RequestIdentifier;
- if (contentView === this._responseContentView)
- return WebInspector.ResourceClusterContentView.ResponseIdentifier;
- console.error("Unknown contentView.");
- return null;
- },
-
- _showContentViewForIdentifier: function(identifier)
- {
- var contentViewToShow = null;
-
- switch (identifier) {
- case WebInspector.ResourceClusterContentView.RequestIdentifier:
- contentViewToShow = this._canShowRequestContentView() ? this.requestContentView : null;
- break;
- case WebInspector.ResourceClusterContentView.ResponseIdentifier:
- contentViewToShow = this.responseContentView;
- break;
- }
-
- if (!contentViewToShow)
- contentViewToShow = this.responseContentView;
-
- console.assert(contentViewToShow);
-
- this._currentContentViewSetting.value = this._identifierForContentView(contentViewToShow);
-
- return this.contentViewContainer.showContentView(contentViewToShow);
- },
-
- _pathComponentSelected: function(event)
- {
- this._showContentViewForIdentifier(event.data.pathComponent.representedObject);
- },
-
- _resourceTypeDidChange: function(event)
- {
- // Since resource views are based on the type, we need to make a new content view and tell the container to replace this
- // content view with the new one. Make a new ResourceContentView which will use the new resource type to make the correct
- // concrete ResourceContentView subclass.
-
- var currentResponseContentView = this._responseContentView;
- if (!currentResponseContentView)
- return;
-
- delete this._responseContentView;
-
- this.contentViewContainer.replaceContentView(currentResponseContentView, this.responseContentView);
- },
-
- _resourceLoadingDidFinish: function(event)
- {
- if ("_positionToReveal" in this) {
- if (this._contentViewContainer.currentContentView === this._responseContentView)
- this._responseContentView.revealPosition(this._positionToReveal, this._textRangeToSelect, this._forceUnformatted);
-
- delete this._positionToReveal;
- delete this._textRangeToSelect;
- delete this._forceUnformatted;
- }
- }
-};
-
-WebInspector.ResourceClusterContentView.prototype.__proto__ = WebInspector.ClusterContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceCollectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceCollection.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceCollection.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceCollection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,164 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceCollection = function()
-{
- WebInspector.Object.call(this);
-
- this._resources = [];
- this._resourceURLMap = {};
- this._resourcesTypeMap = {};
-};
-
-WebInspector.ResourceCollection.prototype = {
- constructor: WebInspector.ResourceCollection,
-
- // Public
-
- get resources()
- {
- return this._resources;
- },
-
- resourceForURL: function(url)
- {
- return this._resourceURLMap[url] || null;
- },
-
- resourcesWithType: function(type)
- {
- return this._resourcesTypeMap[type] || [];
- },
-
- addResource: function(resource)
- {
- console.assert(resource instanceof WebInspector.Resource);
- if (!(resource instanceof WebInspector.Resource))
- return;
-
- this._associateWithResource(resource);
- },
-
- removeResource: function(resourceOrURL)
- {
- console.assert(resourceOrURL);
-
- if (resourceOrURL instanceof WebInspector.Resource)
- var url = resourceOrURL.url;
- else
- var url = resourceOrURL;
-
- // Fetch the resource by URL even if we were passed a WebInspector.Resource.
- // We do this incase the WebInspector.Resource is a new object that isn't in _resources,
- // but the URL is a valid resource.
- var resource = this.resourceForURL(url);
- console.assert(resource instanceof WebInspector.Resource);
- if (!(resource instanceof WebInspector.Resource))
- return null;
-
- this._disassociateWithResource(resource);
-
- return resource;
- },
-
- removeAllResources: function()
- {
- if (!this._resources.length)
- return;
-
- for (var i = 0; i < this._resources.length; ++i)
- this._disassociateWithResource(this._resources[i], true);
-
- this._resources = [];
- this._resourceURLMap = {};
- this._resourcesTypeMap = {};
- },
-
- // Private
-
- _associateWithResource: function(resource)
- {
- this._resources.push(resource);
- this._resourceURLMap[resource.url] = resource;
-
- if (!this._resourcesTypeMap[resource.type])
- this._resourcesTypeMap[resource.type] = [];
- this._resourcesTypeMap[resource.type].push(resource);
-
- resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._resourceURLDidChange, this);
- resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
- },
-
- _disassociateWithResource: function(resource, skipRemoval)
- {
- if (skipRemoval) {
- this._resources.remove(resource);
- if (this._resourcesTypeMap[resource.type])
- this._resourcesTypeMap[resource.type].remove(resource);
- delete this._resourceURLMap[resource.url];
- }
-
- resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._resourceURLDidChange, this);
- resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
- },
-
- _resourceURLDidChange: function(event)
- {
- var resource = event.target;
- console.assert(resource instanceof WebInspector.Resource);
- if (!(resource instanceof WebInspector.Resource))
- return;
-
- var oldURL = event.data.oldURL;
- console.assert(oldURL);
- if (!oldURL)
- return;
-
- this._resourceURLMap[resource.url] = resource;
- delete this._resourceURLMap[oldURL];
- },
-
- _resourceTypeDidChange: function(event)
- {
- var resource = event.target;
- console.assert(resource instanceof WebInspector.Resource);
- if (!(resource instanceof WebInspector.Resource))
- return;
-
- var oldType = event.data.oldType;
- console.assert(oldType);
- if (!oldType)
- return;
-
- if (!this._resourcesTypeMap[resource.type])
- this._resourcesTypeMap[resource.type] = [];
- this._resourcesTypeMap[resource.type].push(resource);
-
- if (this._resourcesTypeMap[oldType])
- this._resourcesTypeMap[oldType].remove(resource);
- }
-};
-
-WebInspector.ResourceCollection.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,125 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceContentView = function(resource, styleClassName)
-{
- console.assert(resource);
- console.assert(styleClassName);
-
- WebInspector.ContentView.call(this, resource);
-
- this._resource = resource;
-
- this.element.classList.add(WebInspector.ResourceContentView.StyleClassName);
- this.element.classList.add(styleClassName);
-
- // Append a spinner while waiting for contentAvailable. The subclasses are responsible for removing
- // the spinner before showing the resource content.
- var spinner = new WebInspector.IndeterminateProgressSpinner;
- this.element.appendChild(spinner.element);
-
- this.element.addEventListener("click", this._mouseWasClicked.bind(this), false);
-
- // Request content last so the spinner will always be removed in case the content is immediately available.
- resource.requestContent(this._contentAvailable.bind(this));
-
- if (!this.managesOwnIssues) {
- WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
-
- var issues = WebInspector.issueManager.issuesForSourceCode(resource);
- for (var i = 0; i < issues.length; ++i)
- this.addIssue(issues[i]);
- }
-};
-
-WebInspector.ResourceContentView.StyleClassName = "resource";
-
-WebInspector.ResourceContentView.prototype = {
- constructor: WebInspector.ResourceContentView,
-
- // Public
-
- get resource()
- {
- return this._resource;
- },
-
- contentAvailable: function(content, base64Encoded)
- {
- // Implemented by subclasses.
- },
-
- addIssue: function(issue)
- {
- // This generically shows only the last issue, subclasses can override for better handling.
- this.element.removeChildren();
- this.element.appendChild(WebInspector.createMessageTextView(issue.text, issue.level === WebInspector.IssueMessage.Level.Error));
- },
-
- closed: function()
- {
- if (!this.managesOwnIssues)
- WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
- },
-
- // Private
-
- _contentAvailable: function(resource, content, base64Encoded)
- {
- // Check for failed loads.
- if (this.resource.failed) {
- // Don't show an error message if there is already an error message showing (like one added by addIssue.)
- if (this.element.querySelector(".message-text-view.error"))
- return;
-
- this.element.removeChildren();
- this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("An error occurred trying to load the resource."), true));
- return;
- }
-
- // Content is ready to show, call the public method now.
- this.contentAvailable(content, base64Encoded);
- },
-
- _issueWasAdded: function(event)
- {
- console.assert(!this.managesOwnIssues);
-
- var issue = event.data.issue;
-
- // FIXME: Check more than just the issue URL (the document could have multiple resources with the same URL).
- if (issue.url !== this.resource.url)
- return;
-
- this.addIssue(issue);
- },
-
- _mouseWasClicked: function(event)
- {
- WebInspector.handlePossibleLinkClick(event, this.resource.parentFrame);
- }
-};
-
-WebInspector.ResourceContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,484 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceDetailsSidebarPanel = function() {
- WebInspector.DetailsSidebarPanel.call(this, "resource-details", WebInspector.UIString("Resource"), WebInspector.UIString("Resource"), "Images/NavigationItemFile.svg", "1");
-
- this.element.classList.add(WebInspector.ResourceDetailsSidebarPanel.StyleClassName);
-
- this._resource = null;
-
- this._typeMIMETypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("MIME Type"));
- this._typeResourceTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Resource Type"));
-
- this._typeSection = new WebInspector.DetailsSection("resource-type", WebInspector.UIString("Type"));
- this._typeSection.groups = [new WebInspector.DetailsSectionGroup([this._typeMIMETypeRow, this._typeResourceTypeRow])];
-
- this._locationFullURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Full URL"));
- this._locationSchemeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Scheme"));
- this._locationHostRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Host"));
- this._locationPortRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Port"));
- this._locationPathRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Path"));
- this._locationQueryStringRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Query String"));
- this._locationFragmentRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Fragment"));
- this._locationFilenameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Filename"));
- this._initiatorRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Initiator"));
-
- var firstGroup = [this._locationFullURLRow];
- var secondGroup = [this._locationSchemeRow, this._locationHostRow, this._locationPortRow, this._locationPathRow,
- this._locationQueryStringRow, this._locationFragmentRow, this._locationFilenameRow];
- var thirdGroup = [this._initiatorRow];
-
- this._fullURLGroup = new WebInspector.DetailsSectionGroup(firstGroup);
- this._locationURLComponentsGroup = new WebInspector.DetailsSectionGroup(secondGroup);
- this._initiatorGroup = new WebInspector.DetailsSectionGroup(thirdGroup);
-
- this._locationSection = new WebInspector.DetailsSection("resource-location", WebInspector.UIString("Location"), [this._fullURLGroup, this._locationURLComponentsGroup, this._initiatorGroup]);
-
- this._queryParametersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Query Parameters"));
- this._queryParametersSection = new WebInspector.DetailsSection("resource-query-parameters", WebInspector.UIString("Query Parameters"));
- this._queryParametersSection.groups = [new WebInspector.DetailsSectionGroup([this._queryParametersRow])];
-
- this._requestDataSection = new WebInspector.DetailsSection("resource-request-data", WebInspector.UIString("Request Data"));
-
- this._requestMethodRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Method"));
- this._cachedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Cached"));
-
- this._statusTextRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));
- this._statusCodeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Code"));
-
- this._encodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Encoded"));
- this._decodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Decoded"));
- this._transferSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Transfered"));
-
- this._compressedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Compressed"));
- this._compressionRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Compression"));
-
- var requestGroup = new WebInspector.DetailsSectionGroup([this._requestMethodRow, this._cachedRow]);
- var statusGroup = new WebInspector.DetailsSectionGroup([this._statusTextRow, this._statusCodeRow]);
- var sizeGroup = new WebInspector.DetailsSectionGroup([this._encodedSizeRow, this._decodedSizeRow, this._transferSizeRow]);
- var compressionGroup = new WebInspector.DetailsSectionGroup([this._compressedRow, this._compressionRow]);
-
- this._requestAndResponseSection = new WebInspector.DetailsSection("resource-request-response", WebInspector.UIString("Request & Response"), [requestGroup, statusGroup, sizeGroup, compressionGroup]);
-
- this._requestHeadersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Request Headers"));
- this._requestHeadersSection = new WebInspector.DetailsSection("resource-request-headers", WebInspector.UIString("Request Headers"));
- this._requestHeadersSection.groups = [new WebInspector.DetailsSectionGroup([this._requestHeadersRow])];
-
- this._responseHeadersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Response Headers"));
- this._responseHeadersSection = new WebInspector.DetailsSection("resource-response-headers", WebInspector.UIString("Response Headers"));
- this._responseHeadersSection.groups = [new WebInspector.DetailsSectionGroup([this._responseHeadersRow])];
-
- // Rows for the "Image Size" section.
- this._imageWidthRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width"));
- this._imageHeightRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height"));
-
- // "Image Size" section where we display intrinsic metrics for image resources.
- this._imageSizeSection = new WebInspector.DetailsSection("resource-type", WebInspector.UIString("Image Size"));
- this._imageSizeSection.groups = [new WebInspector.DetailsSectionGroup([this._imageWidthRow, this._imageHeightRow])];
-
- this.element.appendChild(this._typeSection.element);
- this.element.appendChild(this._locationSection.element);
- this.element.appendChild(this._requestAndResponseSection.element);
- this.element.appendChild(this._requestHeadersSection.element);
- this.element.appendChild(this._responseHeadersSection.element);
-};
-
-WebInspector.ResourceDetailsSidebarPanel.StyleClassName = "resource";
-
-WebInspector.ResourceDetailsSidebarPanel.prototype = {
- constructor: WebInspector.ResourceDetailsSidebarPanel,
-
- // Public
-
- inspect: function(objects)
- {
- // Convert to a single item array if needed.
- if (!(objects instanceof Array))
- objects = [objects];
-
- var resourceToInspect = null;
-
- // Iterate over the objects to find a WebInspector.Resource to inspect.
- for (var i = 0; i < objects.length; ++i) {
- if (objects[i] instanceof WebInspector.Resource) {
- resourceToInspect = objects[i];
- break;
- }
-
- if (objects[i] instanceof WebInspector.Frame) {
- resourceToInspect = objects[i].mainResource;
- break;
- }
- }
-
- this.resource = resourceToInspect;
-
- return !!this._resource;
- },
-
- get resource()
- {
- return this._resource;
- },
-
- set resource(resource)
- {
- if (resource === this._resource)
- return;
-
- if (this._resource) {
- this._resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._refreshURL, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.MIMETypeDidChange, this._refreshMIMEType, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._refreshResourceType, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.RequestHeadersDidChange, this._refreshRequestHeaders, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.ResponseReceived, this._refreshRequestAndResponse, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.CacheStatusDidChange, this._refreshRequestAndResponse, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.SizeDidChange, this._refreshDecodedSize, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._refreshTransferSize, this);
- }
-
- this._resource = resource;
-
- if (this._resource) {
- this._resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._refreshURL, this);
- this._resource.addEventListener(WebInspector.Resource.Event.MIMETypeDidChange, this._refreshMIMEType, this);
- this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._refreshResourceType, this);
- this._resource.addEventListener(WebInspector.Resource.Event.RequestHeadersDidChange, this._refreshRequestHeaders, this);
- this._resource.addEventListener(WebInspector.Resource.Event.ResponseReceived, this._refreshRequestAndResponse, this);
- this._resource.addEventListener(WebInspector.Resource.Event.CacheStatusDidChange, this._refreshRequestAndResponse, this);
- this._resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._refreshDecodedSize, this);
- this._resource.addEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._refreshTransferSize, this);
- }
-
- this.needsRefresh();
- },
-
- refresh: function()
- {
- if (!this._resource)
- return;
-
- this._refreshURL();
- this._refreshMIMEType();
- this._refreshResourceType();
- this._refreshRequestAndResponse();
- this._refreshDecodedSize();
- this._refreshTransferSize();
- this._refreshRequestHeaders();
- this._refreshImageSizeSection();
- this._refreshRequestDataSection();
- },
-
- // Private
-
- _refreshURL: function()
- {
- if (!this._resource)
- return;
-
- this._locationFullURLRow.value = this._resource.url.insertWordBreakCharacters();
-
- var urlComponents = this._resource.urlComponents;
- if (urlComponents.scheme) {
- if (this._resource.initiatorSourceCodeLocation)
- this._locationSection.groups = [this._fullURLGroup, this._locationURLComponentsGroup, this._initiatorGroup];
- else
- this._locationSection.groups = [this._fullURLGroup, this._locationURLComponentsGroup];
-
- this._locationSchemeRow.value = urlComponents.scheme ? urlComponents.scheme : null;
- this._locationHostRow.value = urlComponents.host ? urlComponents.host : null;
- this._locationPortRow.value = urlComponents.port ? urlComponents.port : null;
- this._locationPathRow.value = urlComponents.path ? urlComponents.path.insertWordBreakCharacters() : null;
- this._locationQueryStringRow.value = urlComponents.queryString ? urlComponents.queryString.insertWordBreakCharacters() : null;
- this._locationFragmentRow.value = urlComponents.fragment ? urlComponents.fragment.insertWordBreakCharacters() : null;
- this._locationFilenameRow.value = urlComponents.lastPathComponent ? urlComponents.lastPathComponent.insertWordBreakCharacters() : null;
- } else {
- if (this._resource.initiatorSourceCodeLocation)
- this._locationSection.groups = [this._fullURLGroup, this._initiatorGroup];
- else
- this._locationSection.groups = [this._fullURLGroup];
- }
-
- if (this._resource.initiatorSourceCodeLocation)
- this._initiatorRow.value = WebInspector.createSourceCodeLocationLink(this._resource.initiatorSourceCodeLocation, true);
-
- if (urlComponents.queryString) {
- // Ensure the "Query Parameters" section is displayed, right after the "Request & Response" section.
- this.element.insertBefore(this._queryParametersSection.element, this._requestAndResponseSection.element.nextSibling);
-
- this._queryParametersRow.dataGrid = this._createNameValueDataGrid(parseQueryString(urlComponents.queryString, true));
- } else {
- // Hide the "Query Parameters" section if we don't have a query string.
- var queryParametersSectionElement = this._queryParametersSection.element;
- if (queryParametersSectionElement.parentNode)
- queryParametersSectionElement.parentNode.removeChild(queryParametersSectionElement);
- }
- },
-
- _refreshResourceType: function()
- {
- if (!this._resource)
- return;
-
- this._typeResourceTypeRow.value = WebInspector.Resource.Type.displayName(this._resource.type);
- },
-
- _refreshMIMEType: function()
- {
- if (!this._resource)
- return;
-
- this._typeMIMETypeRow.value = this._resource.mimeType;
- },
-
- _refreshRequestAndResponse: function()
- {
- var resource = this._resource;
- if (!resource)
- return;
-
- // If we don't have a value, we set an em-dash to keep the row from hiding.
- // This keeps the UI from shifting around as data comes in.
- const emDash = "\u2014";
-
- this._requestMethodRow.value = resource.requestMethod || emDash;
-
- this._cachedRow.value = resource.cached ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
-
- this._statusCodeRow.value = resource.statusCode || emDash;
- this._statusTextRow.value = resource.statusText || emDash;
-
- this._refreshResponseHeaders();
- this._refreshCompressed();
- },
-
- _valueForSize: function(size)
- {
- // If we don't have a value, we set an em-dash to keep the row from hiding.
- // This keeps the UI from shifting around as data comes in.
- const emDash = "\u2014";
- return size > 0 ? Number.bytesToString(size) : emDash;
- },
-
- _refreshCompressed: function()
- {
- this._compressedRow.value = this._resource.compressed ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
- this._compressionRow.value = this._resource.compressed ? WebInspector.UIString("%.2f\u00d7").format(this._resource.size / this._resource.encodedSize) : null;
- },
-
- _refreshDecodedSize: function()
- {
- if (!this._resource)
- return;
-
- this._encodedSizeRow.value = this._valueForSize(this._resource.encodedSize);
- this._decodedSizeRow.value = this._valueForSize(this._resource.size);
-
- this._refreshCompressed();
- },
-
- _refreshTransferSize: function()
- {
- if (!this._resource)
- return;
-
- this._encodedSizeRow.value = this._valueForSize(this._resource.encodedSize);
- this._transferSizeRow.value = this._valueForSize(this._resource.transferSize);
-
- this._refreshCompressed();
- },
-
- _refreshRequestHeaders: function()
- {
- if (!this._resource)
- return;
-
- this._requestHeadersRow.dataGrid = this._createNameValueDataGrid(this._resource.requestHeaders);
- },
-
- _refreshResponseHeaders: function()
- {
- if (!this._resource)
- return;
-
- this._responseHeadersRow.dataGrid = this._createNameValueDataGrid(this._resource.responseHeaders);
- },
-
- _createNameValueDataGrid: function(data)
- {
- if (!data || data instanceof Array ? !data.length : isEmptyObject(data))
- return null;
-
- var dataGrid = new WebInspector.DataGrid({
- name: {title: WebInspector.UIString("Name"), width: "30%", sortable: true},
- value: {title: WebInspector.UIString("Value"), sortable: true}
- });
-
- function addDataGridNode(nodeValue)
- {
- console.assert(typeof nodeValue.name === "string");
- console.assert(!nodeValue.value || typeof nodeValue.value === "string");
-
- var node = new WebInspector.DataGridNode({name: nodeValue.name, value: nodeValue.value || ""}, false);
- node.selectable = true;
- dataGrid.appendChild(node);
- }
-
- if (data instanceof Array) {
- for (var i = 0; i < data.length; ++i)
- addDataGridNode(data[i]);
- } else {
- for (var name in data)
- addDataGridNode({name: name, value: data[name] || ""});
- }
-
- dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, sortDataGrid, this);
-
- function sortDataGrid()
- {
- var nodes = dataGrid.children.slice();
- var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
- var sortDirection = dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function comparator(a, b)
- {
- var item1 = a.data[sortColumnIdentifier];
- var item2 = b.data[sortColumnIdentifier];
- return sortDirection * item1.localeCompare(item2);
- }
-
- nodes.sort(comparator);
-
- dataGrid.removeChildren();
- for (var i = 0; i < nodes.length; i++)
- dataGrid.appendChild(nodes[i]);
- }
-
- return dataGrid;
- },
-
- _refreshImageSizeSection: function()
- {
- var resource = this._resource;
-
- if (!resource)
- return;
-
- // Hide the section if we're not dealing with an image or if the load failed.
- if (resource.type !== WebInspector.Resource.Type.Image || resource.failed) {
- var imageSectionElement = this._imageSizeSection.element;
- if (imageSectionElement.parentNode)
- this.element.removeChild(imageSectionElement);
- return;
- }
-
- // Ensure the section is displayed, right before the "Location" section.
- this.element.insertBefore(this._imageSizeSection.element, this._locationSection.element);
-
- // Get the metrics for this resource and fill in the metrics rows with that information.
- resource.getImageSize(function(size) {
- this._imageWidthRow.value = WebInspector.UIString("%fpx").format(size.width);
- this._imageHeightRow.value = WebInspector.UIString("%fpx").format(size.height);
- }.bind(this));
- },
-
- _goToRequestDataClicked: function()
- {
- WebInspector.resourceSidebarPanel.showResourceRequest(this._resource);
- },
-
- _refreshRequestDataSection: function()
- {
- var resource = this._resource;
-
- if (!resource)
- return;
-
- // Hide the section if we're not dealing with a request with data.
- var requestData = resource.requestData;
- if (!requestData) {
- this._requestDataSection.element.remove();
- return;
- }
-
- // Ensure the section is displayed, right before the "Request Headers" section.
- this.element.insertBefore(this._requestDataSection.element, this._requestHeadersSection.element);
-
- var requestDataContentType = resource.requestDataContentType || "";
- if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {
- // Simple form data that should be parsable like a query string.
- var parametersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Parameters"));
- parametersRow.dataGrid = this._createNameValueDataGrid(parseQueryString(requestData, true));
-
- this._requestDataSection.groups = [new WebInspector.DetailsSectionGroup([parametersRow])];
- return;
- }
-
- // Not simple form data, so we can really only show the size and type here.
- // FIXME: Add a go-to arrow here to show the data in the content browser.
-
- var mimeTypeComponents = parseMIMEType(requestDataContentType);
-
- var mimeType = mimeTypeComponents.type;
- var boundary = mimeTypeComponents.boundary;
- var encoding = mimeTypeComponents.encoding;
-
- var rows = [];
-
- var mimeTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("MIME Type"));
- mimeTypeRow.value = mimeType;
- rows.push(mimeTypeRow);
-
- if (boundary) {
- var boundryRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Boundary"));
- boundryRow.value = boundary;
- rows.push(boundryRow);
- }
-
- if (encoding) {
- var encodingRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Encoding"));
- encodingRow.value = encoding;
- rows.push(encodingRow);
- }
-
- var sizeValue = Number.bytesToString(requestData.length);
-
- var dataValue = document.createDocumentFragment();
-
- dataValue.appendChild(document.createTextNode(sizeValue));
-
- var goToButton = dataValue.appendChild(WebInspector.createGoToArrowButton());
- goToButton.addEventListener("click", this._goToRequestDataClicked.bind(this));
-
- var dataRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Data"));
- dataRow.value = dataValue;
- rows.push(dataRow);
-
- this._requestDataSection.groups = [new WebInspector.DetailsSectionGroup(rows)];
- }
-};
-
-WebInspector.ResourceDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.resource-icon .icon {
- content: -webkit-image-set(url(Images/DocumentGeneric.png) 1x, url(Images/DocumentGeneric@2x.png) 2x);
-}
-
-.resource-icon.resource-type-document .icon {
- content: -webkit-image-set(url(Images/DocumentMarkup.png) 1x, url(Images/DocumentMarkup@2x.png) 2x);
-}
-
-.resource-icon.resource-type-image .icon {
- content: -webkit-image-set(url(Images/DocumentImage.png) 1x, url(Images/DocumentImage@2x.png) 2x);
-}
-
-.resource-icon.resource-type-font .icon {
- content: -webkit-image-set(url(Images/DocumentFont.png) 1x, url(Images/DocumentFont@2x.png) 2x);
-}
-
-.resource-icon.resource-type-stylesheet .icon {
- content: -webkit-image-set(url(Images/DocumentCSS.png) 1x, url(Images/DocumentCSS@2x.png) 2x);
-}
-
-.resource-icon.resource-type-script .icon {
- content: -webkit-image-set(url(Images/DocumentJS.png) 1x, url(Images/DocumentJS@2x.png) 2x);
-}
-
-.anonymous-script-icon .icon {
- content: -webkit-image-set(url(Images/ClippingJS.png) 1x, url(Images/ClippingJS@2x.png) 2x);
-}
-
-.source-map-resource.resource-icon .icon {
- content: -webkit-image-set(url(Images/ClippingGeneric.png) 1x, url(Images/ClippingGeneric@2x.png) 2x);
-}
-
-.source-map-resource.resource-icon.resource-type-stylesheet .icon {
- content: -webkit-image-set(url(Images/ClippingCSS.png) 1x, url(Images/ClippingCSS@2x.png) 2x);
-}
-
-.source-map-resource.resource-icon.resource-type-script .icon {
- content: -webkit-image-set(url(Images/ClippingJS.png) 1x, url(Images/ClippingJS@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceSearchMatchObjectjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceSearchMatchObject.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceSearchMatchObject.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceSearchMatchObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceSearchMatchObject = function(resource, lineText, searchTerm, textRange)
-{
- console.assert(resource instanceof WebInspector.Resource);
-
- WebInspector.Object.call(this);
-
- this._resource = resource;
- this._lineText = lineText;
- this._searchTerm = searchTerm;
- this._sourceCodeTextRange = resource.createSourceCodeTextRange(textRange);
-};
-
-WebInspector.ResourceSearchMatchObject.ResourceMatchIconStyleClassName = "resource-match-icon";
-
-WebInspector.ResourceSearchMatchObject.prototype = {
- constructor: WebInspector.ResourceSearchMatchObject,
-
- get resource()
- {
- return this._resource;
- },
-
- get title()
- {
- return this._lineText;
- },
-
- get className()
- {
- return WebInspector.ResourceSearchMatchObject.ResourceMatchIconStyleClassName;
- },
-
- get searchTerm()
- {
- return this._searchTerm;
- },
-
- get sourceCodeTextRange()
- {
- return this._sourceCodeTextRange;
- }
-};
-
-WebInspector.ResourceSearchMatchObject.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.resource > .content,
-.sidebar > .panel.resource > .empty-content-placeholder {
- top: 21px;
-}
-
-.sidebar > .panel.resource > .search-bar {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-
- display: -webkit-flex;
-
- box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
-
- height: 21px;
-
- white-space: nowrap;
- overflow: hidden;
-}
-
-.sidebar > .panel.resource > .search-bar > input[type="search"] {
- display: -webkit-flex;
- -webkit-flex: 1;
-
- margin: 1px 6px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,839 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceSidebarPanel = function() {
- WebInspector.NavigationSidebarPanel.call(this, "resource", WebInspector.UIString("Resources"), "Images/NavigationItemStorage.svg", "1", true, false, true);
-
- var searchElement = document.createElement("div");
- searchElement.classList.add("search-bar");
- this.element.appendChild(searchElement);
-
- this._inputElement = document.createElement("input");
- this._inputElement.type = "search";
- this._inputElement.spellcheck = false;
- this._inputElement.addEventListener("search", this._searchFieldChanged.bind(this));
- this._inputElement.addEventListener("input", this._searchFieldInput.bind(this));
- this._inputElement.setAttribute("results", 5);
- this._inputElement.setAttribute("autosave", "inspector-search");
- this._inputElement.setAttribute("placeholder", WebInspector.UIString("Search Resource Content"));
- searchElement.appendChild(this._inputElement);
-
- this.filterBar.placeholder = WebInspector.UIString("Filter Resource List");
-
- this._waitingForInitialMainFrame = true;
- this._lastSearchedPageSetting = new WebInspector.Setting("last-searched-page", null);
-
- this._searchQuerySetting = new WebInspector.Setting("search-sidebar-query", "");
- this._inputElement.value = this._searchQuerySetting.value;
-
- this._searchKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "F", this._focusSearchField.bind(this));
-
- this._localStorageRootTreeElement = null;
- this._sessionStorageRootTreeElement = null;
-
- this._databaseRootTreeElement = null;
- this._databaseHostTreeElementMap = {};
-
- this._indexedDatabaseRootTreeElement = null;
- this._indexedDatabaseHostTreeElementMap = {};
-
- this._cookieStorageRootTreeElement = null;
-
- this._applicationCacheRootTreeElement = null;
- this._applicationCacheURLTreeElementMap = {};
-
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, this._cookieStorageObjectWasAdded, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, this._domStorageObjectWasAdded, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasInspected, this._domStorageObjectWasInspected, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasAdded, this._databaseWasAdded, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasInspected, this._databaseWasInspected, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.IndexedDatabaseWasAdded, this._indexedDatabaseWasAdded, this);
- WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.Cleared, this._storageCleared, this);
-
- WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestAdded, this._frameManifestAdded, this);
- WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestRemoved, this._frameManifestRemoved, this);
-
- WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
- WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
-
- WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptWasAdded, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
-
- this._resourcesContentTreeOutline = this.contentTreeOutline;
- this._searchContentTreeOutline = this.createContentTreeOutline();
-
- this._resourcesContentTreeOutline.onselect = this._treeElementSelected.bind(this);
- this._searchContentTreeOutline.onselect = this._treeElementSelected.bind(this);
-
- this._resourcesContentTreeOutline.includeSourceMapResourceChildren = true;
-
- if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
- this._resourcesContentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
-};
-
-WebInspector.ResourceSidebarPanel.prototype = {
- constructor: WebInspector.ResourceSidebarPanel,
-
- // Public
-
- get contentTreeOutlineToAutoPrune()
- {
- return this._searchContentTreeOutline;
- },
-
- showMainFrameDOMTree: function(nodeToSelect, preventFocusChange)
- {
- var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
- contentView.showDOMTree(nodeToSelect, preventFocusChange);
- WebInspector.contentBrowser.showContentView(contentView);
- },
-
- showMainFrameSourceCode: function()
- {
- var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
- contentView.showSourceCode();
- WebInspector.contentBrowser.showContentView(contentView);
- },
-
- showContentFlowDOMTree: function(contentFlow, nodeToSelect, preventFocusChange)
- {
- var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(contentFlow);
- if (nodeToSelect)
- contentView.selectAndRevealDOMNode(nodeToSelect, preventFocusChange);
- WebInspector.contentBrowser.showContentView(contentView);
- },
-
- showSourceCodeForFrame: function(frameIdentifier, revealAndSelectTreeElement)
- {
- delete this._frameIdentifierToShowSourceCodeWhenAvailable;
-
- // We can't show anything until we have the main frame in the sidebar.
- // Otherwise the path components in the navigation bar would be missing.
- var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
- if (!frame || !this._mainFrameTreeElement) {
- this._frameIdentifierToShowSourceCodeWhenAvailable = frameIdentifier;
- return;
- }
-
- var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(frame);
- console.assert(contentView);
- if (!contentView)
- return;
-
- contentView.showSourceCode();
- WebInspector.contentBrowser.showContentView(contentView);
-
- if (revealAndSelectTreeElement)
- this.treeElementForRepresentedObject(frame).revealAndSelect(true, true, true, true);
- },
-
- showSourceCode: function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted)
- {
- console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
- var representedObject = sourceCode;
-
- if (representedObject instanceof WebInspector.Script) {
- // A script represented by a resource should always show the resource.
- representedObject = representedObject.resource || representedObject;
- }
-
- // A main resource is always represented by its parent frame.
- if (representedObject instanceof WebInspector.Resource && representedObject.isMainResource())
- representedObject = representedObject.parentFrame;
-
- var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
- WebInspector.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
- },
-
- showSourceCodeLocation: function(sourceCodeLocation)
- {
- this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition());
- },
-
- showOriginalUnformattedSourceCodeLocation: function(sourceCodeLocation)
- {
- this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), undefined, true);
- },
-
- showOriginalOrFormattedSourceCodeLocation: function(sourceCodeLocation)
- {
- this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition());
- },
-
- showSourceCodeTextRange: function(sourceCodeTextRange)
- {
- var textRangeToSelect = sourceCodeTextRange.displayTextRange;
- this.showSourceCode(sourceCodeTextRange.displaySourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
- },
-
- showOriginalOrFormattedSourceCodeTextRange: function(sourceCodeTextRange)
- {
- var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
- this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
- },
-
- showResource: function(resource)
- {
- WebInspector.contentBrowser.showContentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
- },
-
- showResourceRequest: function(resource)
- {
- var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
-
- if (contentView instanceof WebInspector.FrameContentView)
- var resourceContentView = contentView.showResource();
- else if (contentView instanceof WebInspector.ResourceClusterContentView)
- var resourceContentView = contentView;
-
- console.assert(resourceContentView instanceof WebInspector.ResourceClusterContentView);
- if (!(resourceContentView instanceof WebInspector.ResourceClusterContentView))
- return;
-
- resourceContentView.showRequest();
-
- WebInspector.contentBrowser.showContentView(contentView);
- },
-
- treeElementForRepresentedObject: function(representedObject)
- {
- // A custom implementation is needed for this since the frames are populated lazily.
-
- // The Frame is used as the representedObject instead of the main resource in our tree.
- if (representedObject instanceof WebInspector.Resource && representedObject.parentFrame && representedObject.parentFrame.mainResource === representedObject)
- representedObject = representedObject.parentFrame;
-
- function isAncestor(ancestor, resourceOrFrame)
- {
- // SourceMapResources are descendants of another SourceCode object.
- if (resourceOrFrame instanceof WebInspector.SourceMapResource) {
- if (resourceOrFrame.sourceMap.originalSourceCode === ancestor)
- return true;
-
- // Not a direct ancestor, so check the ancestors of the parent SourceCode object.
- resourceOrFrame = resourceOrFrame.sourceMap.originalSourceCode;
- }
-
- var currentFrame = resourceOrFrame.parentFrame;
- while (currentFrame) {
- if (currentFrame === ancestor)
- return true;
- currentFrame = currentFrame.parentFrame;
- }
-
- return false;
- }
-
- function getParent(resourceOrFrame)
- {
- // SourceMapResources are descendants of another SourceCode object.
- if (resourceOrFrame instanceof WebInspector.SourceMapResource)
- return resourceOrFrame.sourceMap.originalSourceCode;
- return resourceOrFrame.parentFrame;
- }
-
- var treeElement = this._resourcesContentTreeOutline.findTreeElement(representedObject, isAncestor, getParent);
- if (treeElement)
- return treeElement;
-
- // Only special case Script objects.
- if (!(representedObject instanceof WebInspector.Script)) {
- console.error("Didn't find a TreeElement for a representedObject associated with the ResourceSidebarPanel.");
- return null;
- }
-
- // If the Script has a URL we should have found it earlier.
- if (representedObject.url) {
- console.error("Didn't find a ScriptTreeElement for a Script with a URL.");
- return null;
- }
-
- // Since the Script does not have a URL we consider it an 'anonymous' script. These scripts happen from calls to
- // window.eval() or browser features like Auto Fill and Reader. They are not normally added to the sidebar, but since
- // we have a ScriptContentView asking for the tree element we will make a ScriptTreeElement on demand and add it.
-
- if (!this._anonymousScriptsFolderTreeElement)
- this._anonymousScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Anonymous Scripts"));
-
- if (!this._anonymousScriptsFolderTreeElement.parent) {
- var index = insertionIndexForObjectInListSortedByFunction(this._anonymousScriptsFolderTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
- this._resourcesContentTreeOutline.insertChild(this._anonymousScriptsFolderTreeElement, index);
- }
-
- var scriptTreeElement = new WebInspector.ScriptTreeElement(representedObject);
- this._anonymousScriptsFolderTreeElement.appendChild(scriptTreeElement);
-
- return scriptTreeElement;
- },
-
- performSearch: function(searchTerm)
- {
- // Before performing a new search, clear the old search.
- this._searchContentTreeOutline.removeChildren();
-
- this._inputElement.value = searchTerm;
- this._searchQuerySetting.value = searchTerm;
- this._lastSearchedPageSetting.value = searchTerm && WebInspector.frameResourceManager.mainFrame ? WebInspector.frameResourceManager.mainFrame.url.hash : null;
-
- this.hideEmptyContentPlaceholder();
-
- searchTerm = searchTerm.trim();
- if (!searchTerm.length) {
- this.filterBar.placeholder = WebInspector.UIString("Filter Resource List");
- this.contentTreeOutline = this._resourcesContentTreeOutline;
- return;
- }
-
- this.filterBar.placeholder = WebInspector.UIString("Filter Search Results");
- this.contentTreeOutline = this._searchContentTreeOutline;
-
- var updateEmptyContentPlaceholderTimeout = null;
-
- function updateEmptyContentPlaceholderSoon()
- {
- if (updateEmptyContentPlaceholderTimeout)
- return;
- updateEmptyContentPlaceholderTimeout = setTimeout(updateEmptyContentPlaceholder.bind(this), 100);
- }
-
- function updateEmptyContentPlaceholder()
- {
- if (updateEmptyContentPlaceholderTimeout) {
- clearTimeout(updateEmptyContentPlaceholderTimeout);
- updateEmptyContentPlaceholderTimeout = null;
- }
-
- this.updateEmptyContentPlaceholder(WebInspector.UIString("No Search Results"));
- }
-
- function resourcesCallback(error, result)
- {
- updateEmptyContentPlaceholderSoon.call(this);
-
- if (error)
- return;
-
- for (var i = 0; i < result.length; ++i) {
- var searchResult = result[i];
- if (!searchResult.url || !searchResult.frameId)
- continue;
-
- function resourceCallback(url, error, resourceMatches)
- {
- updateEmptyContentPlaceholderSoon.call(this);
-
- if (error || !resourceMatches || !resourceMatches.length)
- return;
-
- var frame = WebInspector.frameResourceManager.frameForIdentifier(searchResult.frameId);
- if (!frame)
- return;
-
- var resource = frame.url === url ? frame.mainResource : frame.resourceForURL(url);
- if (!resource)
- return;
-
- var resourceTreeElement = this._searchTreeElementForResource(resource);
-
- for (var i = 0; i < resourceMatches.length; ++i) {
- var match = resourceMatches[i];
-
- var lineMatch;
- var searchRegex = new RegExp(searchTerm.escapeForRegExp(), "gi");
- while ((searchRegex.lastIndex < match.lineContent.length) && (lineMatch = searchRegex.exec(match.lineContent))) {
- var matchObject = new WebInspector.ResourceSearchMatchObject(resource, match.lineContent, searchTerm, new WebInspector.TextRange(match.lineNumber, lineMatch.index, match.lineNumber, searchRegex.lastIndex));
- var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
- resourceTreeElement.appendChild(matchTreeElement);
- }
- }
-
- updateEmptyContentPlaceholder.call(this);
- }
-
- PageAgent.searchInResource(searchResult.frameId, searchResult.url, searchTerm, false, false, resourceCallback.bind(this, searchResult.url));
- }
- }
-
- function domCallback(error, searchId, resultsCount)
- {
- updateEmptyContentPlaceholderSoon.call(this);
-
- if (error || !resultsCount)
- return;
-
- this._domSearchIdentifier = searchId;
-
- function domSearchResults(error, nodeIds)
- {
- updateEmptyContentPlaceholderSoon.call(this);
-
- if (error)
- return;
-
- for (var i = 0; i < nodeIds.length; ++i) {
- // If someone started a new search, then return early and stop showing seach results from the old query.
- if (this._domSearchIdentifier !== searchId)
- return;
-
- var domNode = WebInspector.domTreeManager.nodeForId(nodeIds[i]);
- if (!domNode || !domNode.ownerDocument)
- continue;
-
- // We do not display the document node when the search query is "/". We don't have anything to display in the content view for it.
- if (domNode.nodeType() === Node.DOCUMENT_NODE)
- continue;
-
- // FIXME: Use this should use a frame to do resourceForURL, but DOMAgent does not provide a frameId.
- var resource = WebInspector.frameResourceManager.resourceForURL(domNode.ownerDocument.documentURL);
- if (!resource)
- continue;
-
- var resourceTreeElement = this._searchTreeElementForResource(resource);
-
- var domNodeTitle = WebInspector.DOMSearchMatchObject.titleForDOMNode(domNode);
- var searchRegex = new RegExp(searchTerm.escapeForRegExp(), "gi");
-
- // Textual matches.
- var lineMatch;
- var didFindTextualMatch = false;
- while ((searchRegex.lastIndex < domNodeTitle.length) && (lineMatch = searchRegex.exec(domNodeTitle))) {
- var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, searchTerm, new WebInspector.TextRange(0, lineMatch.index, 0, searchRegex.lastIndex));
- var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
- resourceTreeElement.appendChild(matchTreeElement);
- didFindTextualMatch = true;
- }
-
- // Non-textual matches are CSS Selector or XPath matches. In such cases, display the node entirely highlighted.
- if (!didFindTextualMatch) {
- var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, domNodeTitle, new WebInspector.TextRange(0, 0, 0, domNodeTitle.length));
- var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
- resourceTreeElement.appendChild(matchTreeElement);
- }
-
- updateEmptyContentPlaceholder.call(this);
- }
- }
-
- DOMAgent.getSearchResults(searchId, 0, resultsCount, domSearchResults.bind(this));
- }
-
- WebInspector.domTreeManager.requestDocument();
-
- // FIXME: Should we be searching for regexes or just plain text?
- PageAgent.searchInResources(searchTerm, false, false, resourcesCallback.bind(this));
-
- if ("_domSearchIdentifier" in this) {
- DOMAgent.discardSearchResults(this._domSearchIdentifier);
- delete this._domSearchIdentifier;
- }
-
- DOMAgent.performSearch(searchTerm, domCallback.bind(this));
- },
-
- // Private
-
- _searchFieldChanged: function(event)
- {
- this.performSearch(event.target.value);
- },
-
- _searchFieldInput: function(event)
- {
- // If the search field is cleared, immediately clear the search results tree outline.
- if (!event.target.value.length && this.contentTreeOutline === this._searchContentTreeOutline)
- this.performSearch("");
- },
-
- _searchTreeElementForResource: function(resource)
- {
- // FIXME: This should take a frame ID (if one is available) - so we can differentiate between multiple resources
- // with the same URL.
-
- var resourceTreeElement = this._searchContentTreeOutline.getCachedTreeElement(resource);
- if (!resourceTreeElement) {
- resourceTreeElement = new WebInspector.ResourceTreeElement(resource);
- resourceTreeElement.hasChildren = true;
- resourceTreeElement.expand();
-
- this._searchContentTreeOutline.appendChild(resourceTreeElement);
- }
-
- return resourceTreeElement;
- },
-
- _focusSearchField: function(keyboardShortcut, event)
- {
- this.show();
-
- this._inputElement.select();
- },
-
- _mainFrameDidChange: function(event)
- {
- if (this._mainFrameTreeElement) {
- this._mainFrameTreeElement.frame.removeEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainFrameMainResourceDidChange, this);
- this._resourcesContentTreeOutline.removeChild(this._mainFrameTreeElement);
- this._mainFrameTreeElement = null;
- }
-
- var newFrame = WebInspector.frameResourceManager.mainFrame;
- if (newFrame) {
- newFrame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainFrameMainResourceDidChange, this);
- this._mainFrameTreeElement = new WebInspector.FrameTreeElement(newFrame);
- this._resourcesContentTreeOutline.insertChild(this._mainFrameTreeElement, 0);
-
- // Select by default. Allow onselect if we aren't showing a content view.
- if (!this._resourcesContentTreeOutline.selectedTreeElement)
- this._mainFrameTreeElement.revealAndSelect(true, false, !!WebInspector.contentBrowser.currentContentView);
-
- if (this._frameIdentifierToShowSourceCodeWhenAvailable)
- this.showSourceCodeForFrame(this._frameIdentifierToShowSourceCodeWhenAvailable, true);
- }
-
- // We only care about the first time the main frame changes.
- if (!this._waitingForInitialMainFrame)
- return;
-
- // Only if there is a main frame.
- if (!newFrame)
- return;
-
- delete this._waitingForInitialMainFrame;
-
- // Only if the last page searched is the same as the current page.
- if (this._lastSearchedPageSetting.value !== newFrame.url.hash)
- return;
-
- // Search for whatever is in the input field. This was populated with the last used search term.
- this.performSearch(this._inputElement.value);
- },
-
- _mainFrameMainResourceDidChange: function(event)
- {
- var currentContentView = WebInspector.contentBrowser.currentContentView;
- var wasShowingResourceContentView = currentContentView instanceof WebInspector.ResourceContentView
- || currentContentView instanceof WebInspector.FrameContentView || currentContentView instanceof WebInspector.ScriptContentView;
-
- // Close all resource and frame content views since the main frame has navigated and all resources are cleared.
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ResourceClusterContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.FrameContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ScriptContentView);
-
- function delayedWork()
- {
- // Show the main frame since there is no content view showing or we were showing a resource before.
- // FIXME: We could try to select the same resource that was selected before in the case of a reload.
- if (!WebInspector.contentBrowser.currentContentView || wasShowingResourceContentView)
- this._mainFrameTreeElement.revealAndSelect(true, false);
- }
-
- // Delay this work because other listeners of this event might not have fired yet. So selecting the main frame
- // before those listeners do their work might cause the content of the old page to show instead of the new page.
- setTimeout(delayedWork.bind(this), 0);
- },
-
- _frameWasAdded: function(event)
- {
- if (!this._frameIdentifierToShowSourceCodeWhenAvailable)
- return;
-
- var frame = event.data.frame;
- if (frame.id !== this._frameIdentifierToShowSourceCodeWhenAvailable)
- return;
-
- this.showSourceCodeForFrame(frame.id, true);
- },
-
- _scriptWasAdded: function(event)
- {
- var script = event.data.script;
-
- // We don't add scripts without URLs here. Those scripts can quickly clutter the interface and
- // are usually more transient. They will get added if/when they need to be shown in a content view.
- if (!script.url)
- return;
-
- // Exclude inspector scripts.
- if (script.url.indexOf("__WebInspector") === 0)
- return;
-
- // If the script URL matches a resource we can assume it is part of that resource and does not need added.
- if (script.resource)
- return;
-
- var insertIntoTopLevel = false;
-
- if (script.injected) {
- if (!this._extensionScriptsFolderTreeElement)
- this._extensionScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Extension Scripts"));
- var parentFolderTreeElement = this._extensionScriptsFolderTreeElement;
- } else {
- if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
- insertIntoTopLevel = true;
- else {
- if (!this._extraScriptsFolderTreeElement)
- this._extraScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Extra Scripts"));
- var parentFolderTreeElement = this._extraScriptsFolderTreeElement;
- }
- }
-
- var scriptTreeElement = new WebInspector.ScriptTreeElement(script);
-
- if (insertIntoTopLevel) {
- var index = insertionIndexForObjectInListSortedByFunction(scriptTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
- this._resourcesContentTreeOutline.insertChild(scriptTreeElement, index);
- } else {
- if (!parentFolderTreeElement.parent) {
- var index = insertionIndexForObjectInListSortedByFunction(parentFolderTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
- this._resourcesContentTreeOutline.insertChild(parentFolderTreeElement, index);
- }
-
- parentFolderTreeElement.appendChild(scriptTreeElement);
- }
- },
-
- _scriptsCleared: function(event)
- {
- if (this._extensionScriptsFolderTreeElement) {
- if (this._extensionScriptsFolderTreeElement.parent)
- this._extensionScriptsFolderTreeElement.parent.removeChild(this._extensionScriptsFolderTreeElement);
- this._extensionScriptsFolderTreeElement = null;
- }
-
- if (this._extraScriptsFolderTreeElement) {
- if (this._extraScriptsFolderTreeElement.parent)
- this._extraScriptsFolderTreeElement.parent.removeChild(this._extraScriptsFolderTreeElement);
- this._extraScriptsFolderTreeElement = null;
- }
-
- if (this._anonymousScriptsFolderTreeElement) {
- if (this._anonymousScriptsFolderTreeElement.parent)
- this._anonymousScriptsFolderTreeElement.parent.removeChild(this._anonymousScriptsFolderTreeElement);
- this._anonymousScriptsFolderTreeElement = null;
- }
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (treeElement instanceof WebInspector.FolderTreeElement || treeElement instanceof WebInspector.DatabaseHostTreeElement ||
- treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.IndexedDatabaseTreeElement)
- return;
-
- if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement ||
- treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
- treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
- treeElement instanceof WebInspector.ContentFlowTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement ||
- treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
- WebInspector.contentBrowser.showContentViewForRepresentedObject(treeElement.representedObject);
- return;
- }
-
- console.assert(treeElement instanceof WebInspector.SearchResultTreeElement);
- if (!(treeElement instanceof WebInspector.SearchResultTreeElement))
- return;
-
- if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
- this.showMainFrameDOMTree(treeElement.representedObject.domNode, true);
- else if (treeElement.representedObject instanceof WebInspector.ResourceSearchMatchObject)
- this.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
- },
-
- _domNodeWasInspected: function(event)
- {
- this.showMainFrameDOMTree(event.data.node);
- },
-
- _domStorageObjectWasAdded: function(event)
- {
- var domStorage = event.data.domStorage;
- var storageElement = new WebInspector.DOMStorageTreeElement(domStorage);
-
- if (domStorage.isLocalStorage())
- this._localStorageRootTreeElement = this._addStorageChild(storageElement, this._localStorageRootTreeElement, WebInspector.UIString("Local Storage"));
- else
- this._sessionStorageRootTreeElement = this._addStorageChild(storageElement, this._sessionStorageRootTreeElement, WebInspector.UIString("Session Storage"));
- },
-
- _domStorageObjectWasInspected: function(event)
- {
- var domStorage = event.data.domStorage;
- var treeElement = this.treeElementForRepresentedObject(domStorage);
- treeElement.revealAndSelect(true);
- },
-
- _databaseWasAdded: function(event)
- {
- var database = event.data.database;
-
- console.assert(database instanceof WebInspector.DatabaseObject);
-
- if (!this._databaseHostTreeElementMap[database.host]) {
- this._databaseHostTreeElementMap[database.host] = new WebInspector.DatabaseHostTreeElement(database.host);
- this._databaseRootTreeElement = this._addStorageChild(this._databaseHostTreeElementMap[database.host], this._databaseRootTreeElement, WebInspector.UIString("Databases"));
- }
-
- var databaseElement = new WebInspector.DatabaseTreeElement(database);
- this._databaseHostTreeElementMap[database.host].appendChild(databaseElement);
- },
-
- _databaseWasInspected: function(event)
- {
- var database = event.data.database;
- var treeElement = this.treeElementForRepresentedObject(database);
- treeElement.revealAndSelect(true);
- },
-
- _indexedDatabaseWasAdded: function(event)
- {
- var indexedDatabase = event.data.indexedDatabase;
-
- console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
-
- if (!this._indexedDatabaseHostTreeElementMap[indexedDatabase.host]) {
- this._indexedDatabaseHostTreeElementMap[indexedDatabase.host] = new WebInspector.IndexedDatabaseHostTreeElement(indexedDatabase.host);
- this._indexedDatabaseRootTreeElement = this._addStorageChild(this._indexedDatabaseHostTreeElementMap[indexedDatabase.host], this._indexedDatabaseRootTreeElement, WebInspector.UIString("Indexed Databases"));
- }
-
- var indexedDatabaseElement = new WebInspector.IndexedDatabaseTreeElement(indexedDatabase);
- this._indexedDatabaseHostTreeElementMap[indexedDatabase.host].appendChild(indexedDatabaseElement);
- },
-
- _cookieStorageObjectWasAdded: function(event)
- {
- console.assert(event.data.cookieStorage instanceof WebInspector.CookieStorageObject);
-
- var cookieElement = new WebInspector.CookieStorageTreeElement(event.data.cookieStorage);
- this._cookieStorageRootTreeElement = this._addStorageChild(cookieElement, this._cookieStorageRootTreeElement, WebInspector.UIString("Cookies"));
- },
-
- _frameManifestAdded: function(event)
- {
- var frameManifest = event.data.frameManifest;
- console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
-
- var manifest = frameManifest.manifest;
- var manifestURL = manifest.manifestURL;
- if (!this._applicationCacheURLTreeElementMap[manifestURL]) {
- this._applicationCacheURLTreeElementMap[manifestURL] = new WebInspector.ApplicationCacheManifestTreeElement(manifest);
- this._applicationCacheRootTreeElement = this._addStorageChild(this._applicationCacheURLTreeElementMap[manifestURL], this._applicationCacheRootTreeElement, WebInspector.UIString("Application Cache"));
- }
-
- var frameCacheElement = new WebInspector.ApplicationCacheFrameTreeElement(frameManifest);
- this._applicationCacheURLTreeElementMap[manifestURL].appendChild(frameCacheElement);
- },
-
- _frameManifestRemoved: function(event)
- {
- // FIXME: Implement this.
- },
-
- _compareTreeElements: function(a, b)
- {
- // Always sort the main frame element first.
- if (a instanceof WebInspector.FrameTreeElement)
- return -1;
- if (b instanceof WebInspector.FrameTreeElement)
- return 1;
-
- console.assert(a.mainTitle);
- console.assert(b.mainTitle);
-
- return (a.mainTitle || "").localeCompare(b.mainTitle || "");
- },
-
- _addStorageChild: function(childElement, parentElement, folderName)
- {
- if (!parentElement) {
- childElement.flattened = true;
-
- this._resourcesContentTreeOutline.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
-
- return childElement;
- }
-
- if (parentElement instanceof WebInspector.StorageTreeElement) {
- console.assert(parentElement.flattened);
-
- var previousOnlyChild = parentElement;
- previousOnlyChild.flattened = false;
- this._resourcesContentTreeOutline.removeChild(previousOnlyChild);
-
- var folderElement = new WebInspector.FolderTreeElement(folderName, null, null);
- this._resourcesContentTreeOutline.insertChild(folderElement, insertionIndexForObjectInListSortedByFunction(folderElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
-
- folderElement.appendChild(previousOnlyChild);
- folderElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, folderElement.children, this._compareTreeElements));
-
- return folderElement;
- }
-
- console.assert(parentElement instanceof WebInspector.FolderTreeElement);
- parentElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, parentElement.children, this._compareTreeElements));
-
- return parentElement;
- },
-
- _storageCleared: function(event)
- {
- // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
- WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
-
- if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
- this._localStorageRootTreeElement.parent.removeChild(this._localStorageRootTreeElement);
-
- if (this._sessionStorageRootTreeElement && this._sessionStorageRootTreeElement.parent)
- this._sessionStorageRootTreeElement.parent.removeChild(this._sessionStorageRootTreeElement);
-
- if (this._databaseRootTreeElement && this._databaseRootTreeElement.parent)
- this._databaseRootTreeElement.parent.removeChild(this._databaseRootTreeElement);
-
- if (this._indexedDatabaseRootTreeElement && this._indexedDatabaseRootTreeElement.parent)
- this._indexedDatabaseRootTreeElement.parent.removeChild(this._indexedDatabaseRootTreeElement);
-
- if (this._cookieStorageRootTreeElement && this._cookieStorageRootTreeElement.parent)
- this._cookieStorageRootTreeElement.parent.removeChild(this._cookieStorageRootTreeElement);
-
- if (this._applicationCacheRootTreeElement && this._applicationCacheRootTreeElement.parent)
- this._applicationCacheRootTreeElement.parent.removeChild(this._applicationCacheRootTreeElement);
-
- this._localStorageRootTreeElement = null;
- this._sessionStorageRootTreeElement = null;
- this._databaseRootTreeElement = null;
- this._databaseHostTreeElementMap = {};
- this._indexedDatabaseRootTreeElement = null;
- this._indexedDatabaseHostTreeElementMap = {};
- this._cookieStorageRootTreeElement = null;
- this._applicationCacheRootTreeElement = null;
- this._applicationCacheURLTreeElementMap = {};
- }
-};
-
-WebInspector.ResourceSidebarPanel.prototype.__proto__ = WebInspector.NavigationSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,192 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineDataGridNode = function(resourceTimelineRecord, graphOnly, graphDataSource)
-{
- WebInspector.TimelineDataGridNode.call(this, graphOnly, graphDataSource);
-
- this._resource = resourceTimelineRecord.resource;
- this._record = resourceTimelineRecord;
-
- this._record.addEventListener(WebInspector.TimelineRecord.Event.Updated, graphOnly ? this._timelineRecordUpdated : this._needsRefresh, this);
-
- if (!graphOnly) {
- this._resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._needsRefresh, this);
- this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._needsRefresh, this);
- this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._needsRefresh, this);
- this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFail, this._needsRefresh, this);
- this._resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._needsRefresh, this);
- this._resource.addEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._needsRefresh, this);
- }
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ResourceTimelineDataGridNode);
-
-WebInspector.ResourceTimelineDataGridNode.IconStyleClassName = "icon";
-WebInspector.ResourceTimelineDataGridNode.ErrorStyleClassName = "error";
-
-WebInspector.ResourceTimelineDataGridNode.prototype = {
- constructor: WebInspector.ResourceTimelineDataGridNode,
- __proto__: WebInspector.TimelineDataGridNode.prototype,
-
- // Public
-
- get records()
- {
- return [this._record];
- },
-
- get resource()
- {
- return this._resource;
- },
-
- get data()
- {
- if (this._cachedData)
- return this._cachedData;
-
- var resource = this._resource;
- var data = {};
-
- if (!this._graphOnly) {
- var zeroTime = this.graphDataSource ? this.graphDataSource.zeroTime : 0;
-
- data.name = WebInspector.displayNameForURL(resource.url, resource.urlComponents);
- data.domain = WebInspector.displayNameForHost(resource.urlComponents.host);
- data.scheme = resource.urlComponents.scheme ? resource.urlComponents.scheme.toUpperCase() : "";
- data.method = resource.requestMethod;
- data.type = resource.type;
- data.statusCode = resource.statusCode;
- data.cached = resource.cached;
- data.size = resource.size;
- data.transferSize = resource.transferSize;
- data.requestSent = resource.requestSentTimestamp - zeroTime;
- data.duration = resource.receiveDuration;
- data.latency = resource.latency;
- }
-
- data.graph = this._record.startTime;
-
- this._cachedData = data;
- return data;
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- var resource = this._resource;
-
- if (resource.failed || resource.canceled || resource.statusCode >= 400)
- cell.classList.add(WebInspector.ResourceTimelineDataGridNode.ErrorStyleClassName);
-
- const emptyValuePlaceholderString = "\u2014";
- var value = this.data[columnIdentifier];
-
- switch (columnIdentifier) {
- case "name":
- cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- cell.classList.add(resource.type);
-
- var fragment = document.createDocumentFragment();
-
- var goToButton = WebInspector.createGoToArrowButton();
- goToButton.addEventListener("click", this._goToResource.bind(this));
- fragment.appendChild(goToButton);
-
- var icon = document.createElement("div");
- icon.className = WebInspector.ResourceTimelineDataGridNode.IconStyleClassName;
- fragment.appendChild(icon);
-
- var text = document.createTextNode(value);
- fragment.appendChild(text);
-
- cell.title = resource.url;
-
- return fragment;
-
- case "type":
- return WebInspector.Resource.Type.displayName(value);
-
- case "statusCode":
- cell.title = resource.statusText || "";
- return value || emptyValuePlaceholderString;
-
- case "cached":
- return value ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
-
- case "domain":
- return value || emptyValuePlaceholderString;
-
- case "size":
- case "transferSize":
- return isNaN(value) ? emptyValuePlaceholderString : Number.bytesToString(value, true);
-
- case "requestSent":
- case "latency":
- case "duration":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
- }
-
- return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- },
-
- refresh: function()
- {
- if (this._scheduledRefreshIdentifier) {
- cancelAnimationFrame(this._scheduledRefreshIdentifier);
- delete this._scheduledRefreshIdentifier;
- }
-
- delete this._cachedData;
-
- WebInspector.TimelineDataGridNode.prototype.refresh.call(this);
- },
-
- // Private
-
- _needsRefresh: function()
- {
- if (this.dataGrid instanceof WebInspector.TimelineDataGrid) {
- this.dataGrid.dataGridNodeNeedsRefresh(this);
- return;
- }
-
- if (this._scheduledRefreshIdentifier)
- return;
-
- this._scheduledRefreshIdentifier = requestAnimationFrame(this.refresh.bind(this));
- },
-
- _goToResource: function(event)
- {
- WebInspector.resourceSidebarPanel.showSourceCode(this._resource);
- },
-
- _timelineRecordUpdated: function(event)
- {
- if (this.isRecordVisible(this._record))
- this.needsGraphRefresh();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodePathComponentjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNodePathComponent.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNodePathComponent.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNodePathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineDataGridNodePathComponent = function(resourceTimelineDataGridNode) {
- var resource = resourceTimelineDataGridNode.record.resource;
- var classNames = [WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type];
-
- WebInspector.HierarchicalPathComponent.call(this, resourceTimelineDataGridNode.data.name, classNames, resource);
-
- this._resourceTimelineDataGridNode = resourceTimelineDataGridNode;
-};
-
-WebInspector.ResourceTimelineDataGridNodePathComponent.prototype = {
- constructor: WebInspector.ResourceTimelineDataGridNodePathComponent,
-
- // Public
-
- get resourceTimelineDataGridNode()
- {
- return this._resourceTimelineDataGridNode;
- },
-
- get previousSibling()
- {
- if (!this._resourceTimelineDataGridNode.previousSibling)
- return null;
- return new WebInspector.ResourceTimelineDataGridNodePathComponent(this._resourceTimelineDataGridNode.previousSibling);
- },
-
- get nextSibling()
- {
- if (!this._resourceTimelineDataGridNode.nextSibling)
- return null;
- return new WebInspector.ResourceTimelineDataGridNodePathComponent(this._resourceTimelineDataGridNode.nextSibling);
- }
-};
-
-WebInspector.ResourceTimelineDataGridNodePathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceTimelineRecordjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineRecord.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineRecord.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineRecord = function(resource)
-{
- WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Network);
-
- this._resource = resource;
- this._resource.addEventListener(WebInspector.Resource.Event.TimestampsDidChange, this._dispatchUpdatedEvent, this);
-};
-
-WebInspector.ResourceTimelineRecord.prototype = {
- constructor: WebInspector.ResourceTimelineRecord,
-
- // Public
-
- get resource()
- {
- return this._resource;
- },
-
- get updatesDynamically()
- {
- return true;
- },
-
- get usesActiveStartTime()
- {
- return true;
- },
-
- get startTime()
- {
- return this._resource.requestSentTimestamp;
- },
-
- get activeStartTime()
- {
- return this._resource.responseReceivedTimestamp;
- },
-
- get endTime()
- {
- return this._resource.finishedOrFailedTimestamp;
- },
-
- // Private
-
- _dispatchUpdatedEvent: function()
- {
- this.dispatchEventToListeners(WebInspector.TimelineRecord.Event.Updated);
- }
-};
-
-WebInspector.ResourceTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceTreeElementcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.item.resource.failed {
- color: rgb(224, 16, 16) !important;
-}
-
-.item.resource.failed .subtitle {
- color: rgba(224, 16, 16, 0.7) !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceResourceTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,198 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTreeElement = function(resource, representedObject)
-{
- console.assert(resource instanceof WebInspector.Resource);
-
- WebInspector.SourceCodeTreeElement.call(this, resource, [WebInspector.ResourceTreeElement.StyleClassName, WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type], "", "", representedObject || resource, false);
-
- this._updateResource(resource);
-};
-
-WebInspector.ResourceTreeElement.StyleClassName = "resource";
-WebInspector.ResourceTreeElement.ResourceIconStyleClassName = "resource-icon";
-WebInspector.ResourceTreeElement.FailedStyleClassName = "failed";
-
-WebInspector.ResourceTreeElement.compareResourceTreeElements = function(a, b)
-{
- // Compare by type first to keep resources grouped by type when not sorted into folders.
- var comparisonResult = a.resource.type.localeCompare(b.resource.type);
- if (comparisonResult !== 0)
- return comparisonResult;
-
- // Compare async resource types by their first timestamp so they are in chronological order.
- if (a.resource.type === WebInspector.Resource.Type.XHR || a.resource.type === WebInspector.Resource.Type.WebSocket)
- return a.resource.firstTimestamp - b.resource.firstTimestamp || 0;
-
- // Compare by subtitle when the types are the same. The subtitle is used to show the
- // domain of the resource. This causes resources to group by domain. If the resource
- // is on the same domain as the frame it will have an empty subtitle. This is good
- // because empty string sorts first, so those will appear before external resources.
- comparisonResult = a.subtitle.localeCompare(b.subtitle);
- if (comparisonResult !== 0)
- return comparisonResult;
-
- // Compare by title when the subtitles are the same.
- return a.mainTitle.localeCompare(b.mainTitle);
-}
-
-WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements = function(a, b)
-{
- var aIsFolder = a instanceof WebInspector.FolderTreeElement;
- var bIsFolder = b instanceof WebInspector.FolderTreeElement;
-
- if (aIsFolder && !bIsFolder)
- return -1;
- if (!aIsFolder && bIsFolder)
- return 1;
- if (aIsFolder && bIsFolder)
- return a.mainTitle.localeCompare(b.mainTitle);
-
- return WebInspector.ResourceTreeElement.compareResourceTreeElements(a, b);
-}
-
-WebInspector.ResourceTreeElement.prototype = {
- constructor: WebInspector.ResourceTreeElement,
-
- // Public
-
- get resource()
- {
- return this._resource;
- },
-
- get filterableData()
- {
- return {text: this._resource.url};
- },
-
- ondblclick: function()
- {
- InspectorFrontendHost.openInNewTab(this._resource.url);
- },
-
- // Protected (Used by FrameTreeElement)
-
- _updateResource: function(resource)
- {
- console.assert(resource instanceof WebInspector.Resource);
-
- // This method is for subclasses like FrameTreeElement who don't use a resource as the representedObject.
- // This method should only be called once if the representedObject is a resource, since changing the resource
- // without changing the representedObject is bad. If you need to change the resource, make a new ResourceTreeElement.
- console.assert(!this._resource || !(this.representedObject instanceof WebInspector.Resource));
-
- if (this._resource) {
- this._resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._urlDidChange, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._typeDidChange, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._updateStatus, this);
- this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFail, this._updateStatus, this);
- }
-
- this._updateSourceCode(resource);
-
- this._resource = resource;
-
- resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._urlDidChange, this);
- resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._typeDidChange, this);
- resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._updateStatus, this);
- resource.addEventListener(WebInspector.Resource.Event.LoadingDidFail, this._updateStatus, this);
-
- this._updateTitles();
- this._updateStatus();
- this._updateToolTip();
- },
-
- // Protected
-
- _updateTitles: function()
- {
- var frame = this._resource.parentFrame;
- var isMainResource = this._resource.isMainResource();
- if (isMainResource && frame) {
- // When the resource is a main resource, get the host from the current frame's parent frame instead of the current frame.
- var parentResourceHost = frame.parentFrame ? frame.parentFrame.mainResource.urlComponents.host : null;
- } else if (frame) {
- // When the resource is a normal sub-resource, get the host from the current frame's main resource.
- var parentResourceHost = frame.mainResource.urlComponents.host;
- }
-
- var urlComponents = this._resource.urlComponents;
-
- var oldMainTitle = this.mainTitle;
- this.mainTitle = WebInspector.displayNameForURL(this._resource.url, urlComponents);
-
- // Show the host as the subtitle if it is different from the main resource or if this is the main frame's main resource.
- var subtitle = parentResourceHost !== urlComponents.host || frame.isMainFrame() && isMainResource ? WebInspector.displayNameForHost(urlComponents.host) : null;
- this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
-
- if (oldMainTitle !== this.mainTitle)
- this.callFirstAncestorFunction("descendantResourceTreeElementMainTitleDidChange", [this, oldMainTitle]);
- },
-
- // Private
-
- _updateStatus: function()
- {
- if (this._resource.failed)
- this.addClassName(WebInspector.ResourceTreeElement.FailedStyleClassName);
- else
- this.removeClassName(WebInspector.ResourceTreeElement.FailedStyleClassName);
-
- if (this._resource.finished || this._resource.failed) {
- // Remove the spinner and replace with a reload button in case it's the main frame's main resource.
- var frame = this._resource.parentFrame;
- if (this._resource.isMainResource() && frame && frame.isMainFrame() && this instanceof WebInspector.FrameTreeElement)
- this.updateStatusForMainFrame();
- else
- this.status = null;
- } else {
- var spinner = new WebInspector.IndeterminateProgressSpinner;
- this.status = spinner.element;
- }
- },
-
- _updateToolTip: function()
- {
- this.tooltip = this._resource.url;
- },
-
- _urlDidChange: function(event)
- {
- this._updateTitles();
- this._updateToolTip();
- },
-
- _typeDidChange: function(event)
- {
- this.removeClassName(event.data.oldType);
- this.addClassName(this._resource.type);
-
- this.callFirstAncestorFunction("descendantResourceTreeElementTypeDidChange", [this, event.data.oldType]);
- }
-};
-
-WebInspector.ResourceTreeElement.prototype.__proto__ = WebInspector.SourceCodeTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRevisionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Revision.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Revision.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Revision.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,55 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Revision = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.Revision.prototype = {
- constructor: WebInspector.Revision,
-
- // Public
-
- apply: function()
- {
- // Implemented by subclasses.
- console.error("Needs to be implemented by a subclass.");
- },
-
- revert: function()
- {
- // Implemented by subclasses.
- console.error("Needs to be implemented by a subclass.");
- },
-
- copy: function()
- {
- // Override by subclasses.
- return this;
- }
-};
-
-WebInspector.Revision.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.details.css-style .rules .label {
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
-
- color: rgb(60%, 60%, 60%);
- text-shadow: white 0 1px 0;
-
- padding: 0 10px;
-}
-
-.sidebar > .panel.details.css-style .rules .label .go-to-link {
- color: inherit !important;
-}
-
-.sidebar > .panel.details.css-style .rules .label + .style-declaration-section {
- margin-top: 5px;
-}
-
-.sidebar > .panel.details.css-style .rules .new-rule {
- font-size: 12px;
- font-family: "Lucida Grande", sans-serif;
- font-weight: bold;
-
- color: black;
- text-shadow: white 0 1px 0;
-
- padding: 5px 10px;
-
- margin-bottom: 8px;
- margin-top: -5px;
-
- opacity: 0.5;
-}
-
-.sidebar > .panel.details.css-style .rules .new-rule img {
- content: url(Images/Plus.svg);
-
- width: 13px;
- height: 13px;
-
- vertical-align: -2px;
-
- margin-right: 6px;
-}
-
-.sidebar > .panel.details.css-style .rules .new-rule:hover {
- opacity: 0.6;
-}
-
-.sidebar > .panel.details.css-style .rules .new-rule:active {
- opacity: 0.7;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,273 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RulesStyleDetailsPanel = function()
-{
- WebInspector.StyleDetailsPanel.call(this, WebInspector.RulesStyleDetailsPanel.StyleClassName, "rules", WebInspector.UIString("Rules"));
-
- this._sections = [];
-};
-
-WebInspector.RulesStyleDetailsPanel.StyleClassName = "rules";
-WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName = "label";
-WebInspector.RulesStyleDetailsPanel.NewRuleElementStyleClassName = "new-rule";
-
-WebInspector.RulesStyleDetailsPanel.prototype = {
- constructor: WebInspector.RulesStyleDetailsPanel,
-
- // Public
-
- refresh: function(significantChange)
- {
- // We only need to do a rebuild on significant changes. Other changes are handled
- // by the sections and text editors themselves.
- if (!significantChange)
- return;
-
- var newSections = [];
- var newDOMFragment = document.createDocumentFragment();
-
- var previousMediaList = [];
- var previousSection = null;
- var previousFocusedSection = null;
-
- function mediaListsEqual(a, b)
- {
- a = a || [];
- b = b || [];
-
- if (a.length !== b.length)
- return false;
-
- for (var i = 0; i < a.length; ++i) {
- var aMedia = a[i];
- var bMedia = b[i];
-
- if (aMedia.type !== bMedia.type)
- return false;
-
- if (aMedia.text !== bMedia.text)
- return false;
-
- if (!aMedia.sourceCodeLocation && bMedia.sourceCodeLocation)
- return false;
-
- if (aMedia.sourceCodeLocation && !aMedia.sourceCodeLocation.isEqual(bMedia.sourceCodeLocation))
- return false;
- }
-
- return true;
- }
-
- function filteredMediaList(mediaList)
- {
- if (!mediaList)
- return [];
-
- // Exclude the basic "screen" query since it's very common and just clutters things.
- return mediaList.filter(function(media) {
- return media.text !== "screen";
- });
- }
-
- function appendStyleSection(style)
- {
- var section = style.__rulesSection;
- if (section && section.focused && !previousFocusedSection)
- previousFocusedSection = section;
-
- if (!section) {
- section = new WebInspector.CSSStyleDeclarationSection(style);
- style.__rulesSection = section;
- } else
- section.refresh();
-
- if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.Inspector) {
- previousFocusedSection = section;
- delete this._focusNextNewInspectorRule;
- }
-
- // Reset lastInGroup in case the order/grouping changed.
- section.lastInGroup = false;
-
- newDOMFragment.appendChild(section.element);
- newSections.push(section);
-
- previousSection = section;
- }
-
- function addNewRuleButton()
- {
- if (previousSection)
- previousSection.lastInGroup = true;
-
- var newRuleButton = document.createElement("div");
- newRuleButton.className = WebInspector.RulesStyleDetailsPanel.NewRuleElementStyleClassName;
- newRuleButton.addEventListener("click", this._newRuleClicked.bind(this));
-
- newRuleButton.appendChild(document.createElement("img"));
- newRuleButton.appendChild(document.createTextNode(WebInspector.UIString("New Rule")));
-
- newDOMFragment.appendChild(newRuleButton);
-
- addedNewRuleButton = true;
- }
-
- var pseudoElements = this.nodeStyles.pseudoElements;
- for (var pseudoIdentifier in pseudoElements) {
- var pseudoElement = pseudoElements[pseudoIdentifier];
- for (var i = 0; i < pseudoElement.orderedStyles.length; ++i) {
- var style = pseudoElement.orderedStyles[i];
- appendStyleSection.call(this, style);
- }
-
- if (previousSection)
- previousSection.lastInGroup = true;
- }
-
- var addedNewRuleButton = false;
-
- var orderedStyles = this.nodeStyles.orderedStyles;
- for (var i = 0; i < orderedStyles.length; ++i) {
- var style = orderedStyles[i];
-
- if (style.type === WebInspector.CSSStyleDeclaration.Type.Rule && !addedNewRuleButton)
- addNewRuleButton.call(this);
-
- if (previousSection && previousSection.style.node !== style.node) {
- previousSection.lastInGroup = true;
-
- var prefixElement = document.createElement("strong");
- prefixElement.textContent = WebInspector.UIString("Inherited From: ");
-
- var inheritedLabel = document.createElement("div");
- inheritedLabel.className = WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName;
- inheritedLabel.appendChild(prefixElement);
- inheritedLabel.appendChild(WebInspector.linkifyNodeReference(style.node));
- newDOMFragment.appendChild(inheritedLabel);
- }
-
- // Only include the media list if it is different from the previous media list shown.
- var currentMediaList = filteredMediaList(style.ownerRule && style.ownerRule.mediaList);
- if (!mediaListsEqual(previousMediaList, currentMediaList)) {
- previousMediaList = currentMediaList;
-
- // Break the section group even if the media list is empty. That way the user knows
- // the previous displayed media list does not apply to the next section.
- if (previousSection)
- previousSection.lastInGroup = true;
-
- for (var j = 0; j < currentMediaList.length; ++j) {
- var media = currentMediaList[j];
-
- var prefixElement = document.createElement("strong");
- prefixElement.textContent = WebInspector.UIString("Media: ");
-
- var mediaLabel = document.createElement("div");
- mediaLabel.className = WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName;
- mediaLabel.appendChild(prefixElement);
- mediaLabel.appendChild(document.createTextNode(media.text));
-
- if (media.sourceCodeLocation) {
- mediaLabel.appendChild(document.createTextNode(" \u2014 "));
- mediaLabel.appendChild(WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
- }
-
- newDOMFragment.appendChild(mediaLabel);
- }
- }
-
- appendStyleSection.call(this, style);
- }
-
- if (!addedNewRuleButton)
- addNewRuleButton.call(this);
-
- if (previousSection)
- previousSection.lastInGroup = true;
-
- this.element.removeChildren();
- this.element.appendChild(newDOMFragment);
-
- this._sections = newSections;
-
- for (var i = 0; i < this._sections.length; ++i)
- this._sections[i].updateLayout();
-
- if (previousFocusedSection) {
- previousFocusedSection.focus();
-
- function scrollToFocusedSection()
- {
- previousFocusedSection.element.scrollIntoViewIfNeeded(true);
- }
-
- // Do the scroll on a timeout since StyleDetailsPanel restores scroll position
- // after the refresh, and we might not need to scroll after the restore.
- setTimeout(scrollToFocusedSection, 0);
- }
- },
-
- // Protected
-
- shown: function()
- {
- WebInspector.StyleDetailsPanel.prototype.shown.call(this);
-
- // Associate the style and section objects so they can be reused.
- // Also update the layout in case we changed widths while hidden.
- for (var i = 0; i < this._sections.length; ++i) {
- var section = this._sections[i];
- section.style.__rulesSection = section;
- section.updateLayout();
- }
- },
-
- hidden: function()
- {
- WebInspector.StyleDetailsPanel.prototype.hidden.call(this);
-
- // Disconnect the style and section objects so they have a chance
- // to release their objects when this panel is not visible.
- for (var i = 0; i < this._sections.length; ++i)
- delete this._sections[i].style.__rulesSection;
- },
-
- widthDidChange: function()
- {
- for (var i = 0; i < this._sections.length; ++i)
- this._sections[i].updateLayout();
- },
-
- // Private
-
- _newRuleClicked: function(event)
- {
- this._focusNextNewInspectorRule = true;
- this.nodeStyles.addRule();
- }
-};
-
-WebInspector.RulesStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRuntimeManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RuntimeManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RuntimeManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RuntimeManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,95 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RuntimeManager = function()
-{
- WebInspector.Object.call(this);
-
- // Enable the RuntimeAgent to receive notification of execution contexts.
- if (RuntimeAgent.enable)
- RuntimeAgent.enable();
-};
-
-WebInspector.RuntimeManager.Event = {
- DidEvaluate: "runtime-manager-did-evaluate"
-};
-
-WebInspector.RuntimeManager.prototype = {
- constructor: WebInspector.RuntimeManager,
-
- // Public
-
- evaluateInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, callback)
- {
- if (!expression) {
- // There is no expression, so the completion should happen against global properties.
- expression = "this";
- }
-
- function evalCallback(error, result, wasThrown)
- {
- this.dispatchEventToListeners(WebInspector.RuntimeManager.Event.DidEvaluate);
-
- if (error) {
- console.error(error);
- callback(null, false);
- return;
- }
-
- if (returnByValue)
- callback(null, wasThrown, wasThrown ? null : result);
- else
- callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
- }
-
- if (WebInspector.debuggerManager.activeCallFrame) {
- DebuggerAgent.evaluateOnCallFrame(WebInspector.debuggerManager.activeCallFrame.id, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, evalCallback.bind(this));
- return;
- }
-
- // COMPATIBILITY (iOS 6): Execution context identifiers (contextId) did not exist
- // in iOS 6. Fallback to including the frame identifier (frameId).
- var contextId = WebInspector.quickConsole.executionContextIdentifier;
- RuntimeAgent.evaluate.invoke({expression: expression, objectGroup: objectGroup, includeCommandLineAPI: includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole: doNotPauseOnExceptionsAndMuteConsole, contextId: contextId, frameId: contextId, returnByValue: returnByValue}, evalCallback.bind(this));
- },
-
- getPropertiesForRemoteObject: function(objectId, callback)
- {
- RuntimeAgent.getProperties(objectId, function(error, result) {
- if (error) {
- callback(error);
- return;
- }
-
- var properties = new Map;
- for (var property of result)
- properties.set(property.name, property);
-
- callback(null, properties);
- });
- }
-};
-
-WebInspector.RuntimeManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceRuntimeObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/RuntimeObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/RuntimeObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/RuntimeObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RuntimeObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.RuntimeObserver.prototype = {
- constructor: WebInspector.RuntimeObserver,
-
- // Events defined by the "Runtime" domain.
-
- executionContextCreated: function(contextPayload)
- {
- WebInspector.frameResourceManager.executionContextCreated(contextPayload);
- }
-};
-
-WebInspector.RuntimeObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeBarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeBar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeBar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.scope-bar {
- font-family: Lucida Grande, sans-serif;
- padding: 0 3px;
- overflow: hidden;
-}
-
-.scope-bar > li {
- display: inline-block;
- margin: 0 2px;
- padding: 0 8px 3px;
- font-size: 11px;
- font-weight: bold;
- line-height: 12px;
- color: rgb(46, 46, 46);
- background-color: transparent;
- border: 1px solid transparent;
- border-radius: 9px;
- text-align: center;
-
- transition: 200ms ease-in-out;
- transition-property: background-color, border-color;
-}
-
-.scope-bar > li.selected,
-.scope-bar > li:active {
- transition-duration: 75ms;
-}
-
-.scope-bar > li:hover {
- border-color: rgba(0, 0, 0, 0.15);
-}
-
-.scope-bar > li.selected {
- background-color: rgba(0, 0, 0, 0.06);
- border-color: rgba(0, 0, 0, 0.30);
-}
-
-.scope-bar > li:active {
- background-color: rgba(0, 0, 0, 0.16);
- border-color: rgba(0, 0, 0, 0.40);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,134 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeBar = function(identifier, items, defaultItem) {
- WebInspector.NavigationItem.call(this, identifier);
-
- this._element.classList.add(WebInspector.ScopeBar.StyleClassName);
-
- this._items = items;
- this._defaultItem = defaultItem;
-
- this._itemsById = [];
- this._populate();
-};
-
-WebInspector.ScopeBar.StyleClassName = "scope-bar";
-WebInspector.ScopeBar.Event = {
- SelectionChanged: "scopebar-selection-did-change"
-};
-
-WebInspector.ScopeBar.prototype = {
- constructor: WebInspector.ScopeBar,
-
- // Public
-
- get defaultItem()
- {
- return this._defaultItem;
- },
-
- item: function(id)
- {
- return this._itemsById[id];
- },
-
- get selectedItems()
- {
- return this._items.filter(function(item) {
- return item.selected;
- });
- },
-
- updateLayout: function(expandOnly)
- {
- if (expandOnly)
- return;
-
- for (var i = 0; i < this._items.length; ++i) {
- var item = this._items[i];
- var isSelected = item.selected;
-
- if (!isSelected)
- item.element.classList.add(WebInspector.ScopeBarItem.SelectedStyleClassName);
-
- var selectedWidth = item.element.offsetWidth;
- if (selectedWidth)
- item.element.style.minWidth = selectedWidth + "px";
-
- if (!isSelected)
- item.element.classList.remove(WebInspector.ScopeBarItem.SelectedStyleClassName);
- }
- },
-
- // Private
-
- _populate: function()
- {
- var item;
- for (var i = 0; i < this._items.length; ++i) {
- item = this._items[i];
- this._itemsById[item.id] = item;
- this._element.appendChild(item.element);
-
- item.addEventListener(WebInspector.ScopeBarItem.Event.SelectionChanged, this._itemSelectionDidChange, this);
- }
-
- if (!this.selectedItems.length && this._defaultItem)
- this._defaultItem.selected = true;
- },
-
- _itemSelectionDidChange: function(event)
- {
- var sender = event.target;
- var item;
-
- // An exclusive item was selected, unselect everything else.
- if (sender.isExclusive && sender.selected) {
- for (var i = 0; i < this._items.length; ++i) {
- item = this._items[i];
- if (item !== sender)
- item.selected = false;
- }
- } else {
- var replacesCurrentSelection = !event.data.withModifier;
- for (var i = 0; i < this._items.length; ++i) {
- item = this._items[i];
- if (item.isExclusive && item !== sender && sender.selected)
- item.selected = false;
- else if (sender.selected && replacesCurrentSelection && sender !== item)
- item.selected = false;
- }
- }
-
- // If nothing is selected anymore, select the default item.
- if (!this.selectedItems.length && this._defaultItem)
- this._defaultItem.selected = true;
-
- this.dispatchEventToListeners(WebInspector.ScopeBar.Event.SelectionChanged);
- }
-};
-
-WebInspector.ScopeBar.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeBarItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeBarItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeBarItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeBarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeBarItem = function(id, label, isExclusive) {
- WebInspector.Object.call(this);
-
- this.id = id;
- this.label = label;
- this.isExclusive = isExclusive;
-
- this._selectedSetting = new WebInspector.Setting("scopebaritem-" + id, false);
-
- this._markElementSelected(this._selectedSetting.value);
-};
-
-WebInspector.ScopeBarItem.SelectedStyleClassName = "selected";
-WebInspector.ScopeBarItem.Event = {
- SelectionChanged: "scope-bar-item-selection-did-change"
-};
-
-WebInspector.ScopeBarItem.prototype = {
- constructor: WebInspector.ScopeBarItem,
-
- // Public
-
- get element()
- {
- if (!this._element) {
- this._element = document.createElement("li");
- this._element.textContent = this.label;
- this._element.addEventListener("click", this._clicked.bind(this), false);
- }
- return this._element;
- },
-
- get selected()
- {
- return this._selectedSetting.value;
- },
-
- set selected(selected)
- {
- this.setSelected(selected, false);
- },
-
- setSelected: function(selected, withModifier)
- {
- if (this._selectedSetting.value === selected)
- return;
-
- this._markElementSelected(selected);
-
- this._selectedSetting.value = selected;
-
- this.dispatchEventToListeners(WebInspector.ScopeBarItem.Event.SelectionChanged, {withModifier: withModifier});
- },
-
- // Private
-
- _markElementSelected: function(selected)
- {
- if (selected)
- this.element.classList.add(WebInspector.ScopeBarItem.SelectedStyleClassName);
- else
- this.element.classList.remove(WebInspector.ScopeBarItem.SelectedStyleClassName);
- },
-
- _clicked: function(event)
- {
- var withModifier = (event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey);
- this.setSelected(!this.selected, withModifier);
- }
-};
-
-WebInspector.ScopeBarItem.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeChainDetailsSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeChainDetailsSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeChainDetailsSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeChainDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,173 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeChainDetailsSidebarPanel = function() {
- WebInspector.DetailsSidebarPanel.call(this, "scope-chain", WebInspector.UIString("Scope Chain"), WebInspector.UIString("Scope Chain"), "Images/NavigationItemVariable.svg", "5");
-
- this._callFrame = null;
-
- // Update on console prompt eval as objects in the scope chain may have changed.
- WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this.needsRefresh, this);
-};
-
-WebInspector.ScopeChainDetailsSidebarPanel.prototype = {
- constructor: WebInspector.ScopeChainDetailsSidebarPanel,
-
- // Public
-
- inspect: function(objects)
- {
- // Convert to a single item array if needed.
- if (!(objects instanceof Array))
- objects = [objects];
-
- var callFrameToInspect = null;
-
- // Iterate over the objects to find a WebInspector.CallFrame to inspect.
- for (var i = 0; i < objects.length; ++i) {
- if (!(objects[i] instanceof WebInspector.CallFrame))
- continue;
- callFrameToInspect = objects[i];
- break;
- }
-
- this.callFrame = callFrameToInspect;
-
- return !!this.callFrame;
- },
-
- get callFrame()
- {
- return this._callFrame;
- },
-
- set callFrame(callFrame)
- {
- if (callFrame === this._callFrame)
- return;
-
- this._callFrame = callFrame;
-
- this.needsRefresh();
- },
-
- refresh: function()
- {
- var callFrame = this.callFrame;
- if (!callFrame)
- return;
-
- var detailsSections = [];
- var foundLocalScope = false;
-
- var sectionCountByType = {};
- for (var type in WebInspector.ScopeChainNode.Type)
- sectionCountByType[WebInspector.ScopeChainNode.Type[type]] = 0;
-
- var scopeChain = callFrame.scopeChain;
- for (var i = 0; i < scopeChain.length; ++i) {
- var scope = scopeChain[i];
-
- var title = null;
- var extraProperties = null;
- var collapsedByDefault = false;
- var dontHighlightNonEnumerableProperties = true;
-
- ++sectionCountByType[scope.type];
-
- switch (scope.type) {
- case WebInspector.ScopeChainNode.Type.Local:
- foundLocalScope = true;
- collapsedByDefault = false;
- dontHighlightNonEnumerableProperties = true;
-
- title = WebInspector.UIString("Local Variables");
-
- if (callFrame.thisObject)
- extraProperties = [new WebInspector.RemoteObjectProperty("this", callFrame.thisObject)];
- break;
-
- case WebInspector.ScopeChainNode.Type.Closure:
- title = WebInspector.UIString("Closure Variables");
- dontHighlightNonEnumerableProperties = true;
- collapsedByDefault = false;
- break;
-
- case WebInspector.ScopeChainNode.Type.Catch:
- title = WebInspector.UIString("Catch Variables");
- dontHighlightNonEnumerableProperties = true;
- collapsedByDefault = false;
- break;
-
- case WebInspector.ScopeChainNode.Type.With:
- title = WebInspector.UIString("With Object Properties");
- collapsedByDefault = foundLocalScope;
- dontHighlightNonEnumerableProperties = false;
- break;
-
- case WebInspector.ScopeChainNode.Type.Global:
- title = WebInspector.UIString("Global Variables");
- dontHighlightNonEnumerableProperties = false;
- collapsedByDefault = true;
- break;
- }
-
- var detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
-
- var section = new WebInspector.ObjectPropertiesSection(scope.object, null, null, null, true, extraProperties, WebInspector.ScopeVariableTreeElement);
- section.dontHighlightNonEnumerablePropertiesAtTopLevel = dontHighlightNonEnumerableProperties;
- section.__propertyIdentifierPrefix = detailsSectionIdentifier;
-
- var detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault);
- detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(section)];
- detailsSections.push(detailsSection);
- }
-
- function delayedWork()
- {
- // Clear the timeout so we don't update the interface twice.
- clearTimeout(timeout);
-
- // Bail if the call frame changed while we were waiting for the async response.
- if (this.callFrame !== callFrame)
- return;
-
- this.element.removeChildren();
- for (var i = 0; i < detailsSections.length; ++i)
- this.element.appendChild(detailsSections[i].element);
- }
-
- // We need a timeout in place in case there are long running, pending backend dispatches. This can happen
- // if the debugger is paused in code that was executed from the console. The console will be waiting for
- // the result of the execution and without a timeout we would never update the scope variables.
- var timeout = setTimeout(delayedWork.bind(this), 50);
-
- // Since ObjectPropertiesSection populates asynchronously, we want to wait to replace the existing content
- // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping.
- InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this));
- }
-};
-
-WebInspector.ScopeChainDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeChainNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeChainNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeChainNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeChainNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeChainNode = function(type, object)
-{
- WebInspector.Object.call(this);
-
- console.assert(typeof type === "string");
- console.assert(object instanceof WebInspector.RemoteObject);
-
- if (type in WebInspector.ScopeChainNode.Type)
- type = WebInspector.ScopeChainNode.Type[type];
-
- this._type = type || null;
- this._object = object || null;
-};
-
-WebInspector.ScopeChainNode.Type = {
- Local: "scope-chain-type-local",
- Global: "scope-chain-type-global",
- With: "scope-chain-type-with",
- Closure: "scope-chain-type-closure",
- Catch: "scope-chain-type-catch"
-};
-
-WebInspector.ScopeChainNode.prototype = {
- constructor: WebInspector.ScopeChainNode,
-
- // Public
-
- get type()
- {
- return this._type;
- },
-
- get object()
- {
- return this._object;
- }
-};
-
-WebInspector.ScopeChainNode.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScopeVariableTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScopeVariableTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScopeVariableTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScopeVariableTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
- * Copyright (C) 2011 Google Inc. 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 APPLE INC. ``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 APPLE INC. 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.ScopeVariableTreeElement = function(property)
-{
- WebInspector.ObjectPropertyTreeElement.call(this, property);
-};
-
-WebInspector.ScopeVariableTreeElement._expandedProperties = {};
-
-WebInspector.ScopeVariableTreeElement.prototype = {
- constructor: WebInspector.ScopeVariableTreeElement,
-
- // Public
-
- onattach: function()
- {
- WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);
-
- if (this.hasChildren && this.constructor._expandedProperties.hasOwnProperty(this.propertyIdentifier))
- this.expand();
- },
-
- onexpand: function()
- {
- this.constructor._expandedProperties[this.propertyIdentifier] = true;
- },
-
- oncollapse: function()
- {
- delete this.constructor._expandedProperties[this.propertyIdentifier];
- },
-
- get propertyIdentifier()
- {
- if ("_propertyIdentifier" in this)
- return this._propertyIdentifier;
-
- var section = this.treeOutline.section;
- this._propertyIdentifier = (section.__propertyIdentifierPrefix ? section.__propertyIdentifierPrefix + "-" : "") + this.propertyPath;
- return this._propertyIdentifier;
- },
-
- get propertyPath()
- {
- if ("_propertyPath" in this)
- return this._propertyPath;
-
- var current = this;
- var result;
-
- do {
- if (current.property) {
- if (result)
- result = current.property.name + "." + result;
- else
- result = current.property.name;
- }
-
- current = current.parent;
- } while (current && !current.root);
-
- this._propertyPath = result;
- return result;
- }
-};
-
-WebInspector.ScopeVariableTreeElement.prototype.__proto__ = WebInspector.ObjectPropertyTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Script.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Script.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Script.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,180 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Script = function(id, range, url, injected, sourceMapURL)
-{
- WebInspector.SourceCode.call(this);
-
- console.assert(id);
- console.assert(range instanceof WebInspector.TextRange);
-
- this._id = id || null;
- this._range = range || null;
- this._url = url || null;
- this._injected = injected || false;
-
- this._resource = this._resolveResource();
- if (this._resource)
- this._resource.associateWithScript(this);
-
- if (sourceMapURL)
- WebInspector.sourceMapManager.downloadSourceMap(sourceMapURL, this._url, this);
-};
-
-WebInspector.Script.TypeIdentifier = "script";
-WebInspector.Script.URLCookieKey = "script-url";
-WebInspector.Script.DisplayNameCookieKey = "script-display-name";
-
-WebInspector.Script.resetUniqueDisplayNameNumbers = function()
-{
- WebInspector.Script._nextUniqueDisplayNameNumber = 1;
-}
-
-WebInspector.Script._nextUniqueDisplayNameNumber = 1;
-
-WebInspector.Script.prototype = {
- constructor: WebInspector.Script,
-
- // Public
-
- get id()
- {
- return this._id;
- },
-
- get range()
- {
- return this._range;
- },
-
- get url()
- {
- return this._url;
- },
-
- get urlComponents()
- {
- if (!this._urlComponents)
- this._urlComponents = parseURL(this._url);
- return this._urlComponents;
- },
-
- get displayName()
- {
- if (this._url)
- return WebInspector.displayNameForURL(this._url, this.urlComponents);
-
- // Assign a unique number to the script object so it will stay the same.
- if (!this._uniqueDisplayNameNumber)
- this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
-
- return WebInspector.UIString("Anonymous Script %d").format(this._uniqueDisplayNameNumber);
- },
-
- get injected()
- {
- return this._injected;
- },
-
- get resource()
- {
- return this._resource;
- },
-
- canRequestContentFromBackend: function()
- {
- // We can request content if we have an id.
- return !!this._id;
- },
-
- requestContentFromBackend: function(callback)
- {
- if (!this._id) {
- // There is no identifier to request content with. Return false to cause the
- // pending callbacks to get null content.
- return false;
- }
-
- DebuggerAgent.getScriptSource(this._id, callback);
- return true;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.Script.URLCookieKey] = this.url;
- cookie[WebInspector.Script.DisplayNameCookieKey] = this.displayName;
- },
-
- // Private
-
- _resolveResource: function()
- {
- // FIXME: We should be able to associate a Script with a Resource through identifiers,
- // we shouldn't need to lookup by URL, which is not safe with frames, where there might
- // be multiple resources with the same URL.
- // <rdar://problem/13373951> Scripts should be able to associate directly with a Resource
-
- // No URL, no resource.
- if (!this._url)
- return null;
-
- try {
- // Try with the Script's full URL.
- var resource = WebInspector.frameResourceManager.resourceForURL(this.url);
- if (resource)
- return resource;
-
- // Try with the Script's full decoded URL.
- var decodedURL = decodeURI(this._url);
- if (decodedURL !== this._url) {
- resource = WebInspector.frameResourceManager.resourceForURL(decodedURL);
- if (resource)
- return resource;
- }
-
- // Next try removing any fragment in the original URL.
- var urlWithoutFragment = removeURLFragment(this._url);
- if (urlWithoutFragment !== this._url) {
- resource = WebInspector.frameResourceManager.resourceForURL(urlWithoutFragment);
- if (resource)
- return resource;
- }
-
- // Finally try removing any fragment in the decoded URL.
- var decodedURLWithoutFragment = removeURLFragment(decodedURL);
- if (decodedURLWithoutFragment !== decodedURL) {
- resource = WebInspector.frameResourceManager.resourceForURL(decodedURLWithoutFragment);
- if (resource)
- return resource;
- }
- } catch (e) {
- // Ignore possible URIErrors.
- }
-
- return null;
- }
-};
-
-WebInspector.Script.prototype.__proto__ = WebInspector.SourceCode.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.script > .text-editor {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,225 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptContentView = function(script)
-{
- WebInspector.ContentView.call(this, script);
-
- this.element.classList.add(WebInspector.ScriptContentView.StyleClassName);
-
- // Append a spinner while waiting for _contentWillPopulate.
- var spinner = new WebInspector.IndeterminateProgressSpinner;
- this.element.appendChild(spinner.element);
-
- this._script = script;
-
- // This view is only for standalone Scripts with no corresponding Resource. All other Scripts
- // should be handled by TextResourceContentView via the Resource.
- console.assert(!script.resource);
- console.assert(script.range.startLine === 0);
- console.assert(script.range.startColumn === 0);
-
- this._textEditor = new WebInspector.SourceCodeTextEditor(script);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
- this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate, this._contentWillPopulate, this);
- this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate, this._contentDidPopulate, this);
-
- var toolTip = WebInspector.UIString("Pretty print");
- var activatedToolTip = WebInspector.UIString("Original formatting");
- this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
- this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
- this._prettyPrintButtonNavigationItem.enabled = false; // Enabled when the text editor is populated with content.
-};
-
-WebInspector.ScriptContentView.StyleClassName = "script";
-
-WebInspector.ScriptContentView.prototype = {
- constructor: WebInspector.ScriptContentView,
-
- // Public
-
- get navigationItems()
- {
- return [this._prettyPrintButtonNavigationItem];
- },
-
- get script()
- {
- return this._script;
- },
-
- get textEditor()
- {
- return this._textEditor;
- },
-
- get supplementalRepresentedObjects()
- {
- if (isNaN(this._textEditor.executionLineNumber))
- return [];
-
- // If the SourceCodeTextEditor has an executionLineNumber, we can assume
- // it is always the active call frame.
- return [WebInspector.debuggerManager.activeCallFrame];
- },
-
- revealPosition: function(position, textRangeToSelect, forceUnformatted)
- {
- this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
- },
-
- shown: function()
- {
- this._textEditor.shown();
- },
-
- hidden: function()
- {
- this._textEditor.hidden();
- },
-
- closed: function()
- {
- this._textEditor.close();
- },
-
- saveToCookie: function(cookie)
- {
- cookie.type = WebInspector.ContentViewCookieType.Resource;
- cookie.url = this.representedObject.url;
- },
-
- restoreFromCookie: function(cookie)
- {
- if ("lineNumber" in cookie && "columnNumber" in cookie)
- this.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
- },
-
- get supportsSave()
- {
- return true;
- },
-
- get saveData()
- {
- var url = this._script.url || "web-inspector:///" + encodeURI(this._script.displayName) + ".js";
- return {url: url, content: this._textEditor.string};
- },
-
- get supportsSearch()
- {
- return true;
- },
-
- get numberOfSearchResults()
- {
- return this._textEditor.numberOfSearchResults;
- },
-
- get hasPerformedSearch()
- {
- return this._textEditor.currentSearchQuery !== null;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- this._textEditor.automaticallyRevealFirstSearchResult = reveal;
- },
-
- performSearch: function(query)
- {
- this._textEditor.performSearch(query);
- },
-
- searchCleared: function()
- {
- this._textEditor.searchCleared();
- },
-
- searchQueryWithSelection: function()
- {
- return this._textEditor.searchQueryWithSelection();
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- this._textEditor.revealPreviousSearchResult(changeFocus);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- this._textEditor.revealNextSearchResult(changeFocus);
- },
-
- updateLayout: function()
- {
- this._textEditor.updateLayout();
- },
-
- // Private
-
- _contentWillPopulate: function(event)
- {
- if (this._textEditor.element.parentNode === this.element)
- return;
-
- // Allow editing any local file since edits can be saved and reloaded right from the Inspector.
- if (this._script.urlComponents.scheme === "file")
- this._textEditor.readOnly = false;
-
- this.element.removeChildren();
- this.element.appendChild(this._textEditor.element);
- },
-
- _contentDidPopulate: function(event)
- {
- this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
- },
-
- _togglePrettyPrint: function(event)
- {
- var activated = !this._prettyPrintButtonNavigationItem.activated;
- this._textEditor.formatted = activated;
- },
-
- _textEditorFormattingDidChange: function(event)
- {
- this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
- },
-
- _executionLineNumberDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
- },
-
- _numberOfSearchResultsDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
- }
-};
-
-WebInspector.ScriptContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
-{
- WebInspector.TimelineDataGrid.call(this, treeOutline, columns, delegate, editCallback, deleteCallback);
-}
-
-WebInspector.ScriptTimelineDataGrid.prototype = {
- constructor: WebInspector.ScriptTimelineDataGrid,
-
- // Protected
-
- callFramePopoverAnchorElement: function()
- {
- return this.selectedNode.elementWithColumnIdentifier("location");
- }
-}
-
-WebInspector.ScriptTimelineDataGrid.prototype.__proto__ = WebInspector.TimelineDataGrid.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,119 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineDataGridNode = function(scriptTimelineRecord, baseStartTime, rangeStartTime, rangeEndTime)
-{
- WebInspector.TimelineDataGridNode.call(this, false, null);
-
- this._record = scriptTimelineRecord;
- this._baseStartTime = baseStartTime || 0;
- this._rangeStartTime = rangeStartTime || 0;
- this._rangeEndTime = typeof rangeEndTime === "number" ? rangeEndTime : Infinity;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.ScriptTimelineDataGridNode);
-
-WebInspector.ScriptTimelineDataGridNode.IconStyleClassName = "icon";
-
-WebInspector.ScriptTimelineDataGridNode.prototype = {
- constructor: WebInspector.ScriptTimelineDataGridNode,
- __proto__: WebInspector.TimelineDataGridNode.prototype,
-
- // Public
-
- get record()
- {
- return this._record;
- },
-
- get records()
- {
- return [this._record];
- },
-
- get baseStartTime()
- {
- return this._baseStartTime;
- },
-
- get rangeStartTime()
- {
- return this._rangeStartTime;
- },
-
- set rangeStartTime(x)
- {
- if (this._rangeStartTime === x)
- return;
-
- this._rangeStartTime = x;
- this.needsRefresh();
- },
-
- get rangeEndTime()
- {
- return this._rangeEndTime;
- },
-
- set rangeEndTime(x)
- {
- if (this._rangeEndTime === x)
- return;
-
- this._rangeEndTime = x;
- this.needsRefresh();
- },
-
- get data()
- {
- var startTime = Math.max(this._rangeStartTime, this._record.startTime);
- var duration = Math.min(this._record.startTime + this._record.duration, this._rangeEndTime) - startTime;
- var callFrameOrSourceCodeLocation = this._record.initiatorCallFrame || this._record.sourceCodeLocation;
-
- return {eventType: this._record.eventType, startTime: startTime, selfTime: duration, totalTime: duration,
- averageTime: duration, callCount: 1, location: callFrameOrSourceCodeLocation};
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- const emptyValuePlaceholderString = "\u2014";
- var value = this.data[columnIdentifier];
-
- switch (columnIdentifier) {
- case "eventType":
- return WebInspector.ScriptTimelineRecord.EventType.displayName(value, this._record.details);
-
- case "startTime":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
-
- case "selfTime":
- case "totalTime":
- case "averageTime":
- return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
- }
-
- return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-overview-graph.script > .timeline-record-bar {
- margin-top: 8px;
- height: 20px;
-}
-
-.timeline-overview-graph.script > .timeline-record-bar > .segment {
- border-radius: 2px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,94 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineOverviewGraph = function(recording)
-{
- WebInspector.TimelineOverviewGraph.call(this, recording);
-
- this.element.classList.add(WebInspector.ScriptTimelineOverviewGraph.StyleClassName);
-
- this._scriptTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Script);
- this._scriptTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._scriptTimelineRecordAdded, this);
-
- this._timelineRecordBars = [];
-
- this.reset();
-};
-
-WebInspector.ScriptTimelineOverviewGraph.StyleClassName = "script";
-
-WebInspector.ScriptTimelineOverviewGraph.prototype = {
- constructor: WebInspector.ScriptTimelineOverviewGraph,
- __proto__: WebInspector.TimelineOverviewGraph.prototype,
-
- // Public
-
- reset: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
-
- this._timelineRecordBarMap = new Map;
-
- this.element.removeChildren();
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
-
- var visibleWidth = this.element.offsetWidth;
- var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
-
- var recordBarIndex = 0;
-
- function createBar(records, renderMode)
- {
- var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
- if (!timelineRecordBar)
- timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
- timelineRecordBar.renderMode = renderMode;
- timelineRecordBar.records = records;
- timelineRecordBar.refresh(this);
- if (!timelineRecordBar.element.parentNode)
- this.element.appendChild(timelineRecordBar.element);
- ++recordBarIndex;
- }
-
- WebInspector.TimelineRecordBar.createCombinedBars(this._scriptTimeline.records, secondsPerPixel, this, createBar.bind(this));
-
- // Remove the remaining unused TimelineRecordBars.
- for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
- this._timelineRecordBars[recordBarIndex].records = null;
- this._timelineRecordBars[recordBarIndex].element.remove();
- }
- },
-
- // Private
-
- _scriptTimelineRecordAdded: function(event)
- {
- this.needsLayout();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineRecordjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineRecord.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineRecord.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,270 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineRecord = function(eventType, startTime, endTime, callFrames, sourceCodeLocation, details, profile)
-{
- WebInspector.TimelineRecord.call(this, WebInspector.TimelineRecord.Type.Script, startTime, endTime, callFrames, sourceCodeLocation);
-
- console.assert(eventType);
-
- if (eventType in WebInspector.ScriptTimelineRecord.EventType)
- eventType = WebInspector.ScriptTimelineRecord.EventType[eventType];
-
- this._eventType = eventType;
- this._details = details || "";
- this._profile = profile || null;
-};
-
-WebInspector.ScriptTimelineRecord.EventType = {
- ScriptEvaluated: "script-timeline-record-script-evaluated",
- EventDispatched: "script-timeline-record-event-dispatch",
- TimerFired: "script-timeline-record-timer-fired",
- TimerInstalled: "script-timeline-record-timer-installed",
- TimerRemoved: "script-timeline-record-timer-removed",
- AnimationFrameFired: "script-timeline-record-animation-frame-fired",
- AnimationFrameRequested: "script-timeline-record-animation-frame-requested",
- AnimationFrameCanceled: "script-timeline-record-animation-frame-canceled"
-};
-
-WebInspector.ScriptTimelineRecord.EventType.displayName = function(eventType, details, includeTimerIdentifierInMainTitle)
-{
- if (details && !WebInspector.ScriptTimelineRecord._eventDisplayNames) {
- // These display names are not localized because they closely represent
- // the real API name, just with word spaces and Title Case.
-
- var nameMap = new Map;
- nameMap.set("DOMActivate", "DOM Activate");
- nameMap.set("DOMCharacterDataModified", "DOM Character Data Modified");
- nameMap.set("DOMContentLoaded", "DOM Content Loaded");
- nameMap.set("DOMFocusIn", "DOM Focus In");
- nameMap.set("DOMFocusOut", "DOM Focus Out");
- nameMap.set("DOMNodeInserted", "DOM Node Inserted");
- nameMap.set("DOMNodeInsertedIntoDocument", "DOM Node Inserted Into Document");
- nameMap.set("DOMNodeRemoved", "DOM Node Removed");
- nameMap.set("DOMNodeRemovedFromDocument", "DOM Node Removed From Document");
- nameMap.set("DOMSubtreeModified", "DOM Sub-Tree Modified");
- nameMap.set("addsourcebuffer", "Add Source Buffer");
- nameMap.set("addstream", "Add Stream");
- nameMap.set("addtrack", "Add Track");
- nameMap.set("audioend", "Audio End");
- nameMap.set("audioprocess", "Audio Process");
- nameMap.set("audiostart", "Audio Start");
- nameMap.set("beforecopy", "Before Copy");
- nameMap.set("beforecut", "Before Cut");
- nameMap.set("beforeload", "Before Load");
- nameMap.set("beforepaste", "Before Paste");
- nameMap.set("beforeunload", "Before Unload");
- nameMap.set("canplay", "Can Play");
- nameMap.set("canplaythrough", "Can Play Through");
- nameMap.set("chargingchange", "Charging Change");
- nameMap.set("chargingtimechange", "Charging Time Change");
- nameMap.set("compositionend", "Composition End");
- nameMap.set("compositionstart", "Composition Start");
- nameMap.set("compositionupdate", "Composition Update");
- nameMap.set("contextmenu", "Context Menu");
- nameMap.set("cuechange", "Cue Change");
- nameMap.set("datachannel", "Data Channel");
- nameMap.set("dblclick", "Double Click");
- nameMap.set("devicemotion", "Device Motion");
- nameMap.set("deviceorientation", "Device Orientation");
- nameMap.set("dischargingtimechange", "Discharging Time Change");
- nameMap.set("dragend", "Drag End");
- nameMap.set("dragenter", "Drag Enter");
- nameMap.set("dragleave", "Drag Leave");
- nameMap.set("dragover", "Drag Over");
- nameMap.set("dragstart", "Drag Start");
- nameMap.set("durationchange", "Duration Change");
- nameMap.set("focusin", "Focus In");
- nameMap.set("focusout", "Focus Out");
- nameMap.set("gesturechange", "Gesture Change");
- nameMap.set("gestureend", "Gesture End");
- nameMap.set("gesturescrollend", "Gesture Scroll End");
- nameMap.set("gesturescrollstart", "Gesture Scroll Start");
- nameMap.set("gesturescrollupdate", "Gesture Scroll Update");
- nameMap.set("gesturestart", "Gesture Start");
- nameMap.set("gesturetap", "Gesture Tap");
- nameMap.set("gesturetapdown", "Gesture Tap Down");
- nameMap.set("hashchange", "Hash Change");
- nameMap.set("icecandidate", "ICE Candidate");
- nameMap.set("iceconnectionstatechange", "ICE Connection State Change");
- nameMap.set("keydown", "Key Down");
- nameMap.set("keypress", "Key Press");
- nameMap.set("keyup", "Key Up");
- nameMap.set("levelchange", "Level Change");
- nameMap.set("loadeddata", "Loaded Data");
- nameMap.set("loadedmetadata", "Loaded Metadata");
- nameMap.set("loadend", "Load End");
- nameMap.set("loadingdone", "Loading Done");
- nameMap.set("loadstart", "Load Start");
- nameMap.set("mousedown", "Mouse Down");
- nameMap.set("mouseenter", "Mouse Enter");
- nameMap.set("mouseleave", "Mouse Leave");
- nameMap.set("mousemove", "Mouse Move");
- nameMap.set("mouseout", "Mouse Out");
- nameMap.set("mouseover", "Mouse Over");
- nameMap.set("mouseup", "Mouse Up");
- nameMap.set("mousewheel", "Mouse Wheel");
- nameMap.set("negotiationneeded", "Negotiation Needed");
- nameMap.set("nomatch", "No Match");
- nameMap.set("noupdate", "No Update");
- nameMap.set("orientationchange", "Orientation Change");
- nameMap.set("overflowchanged", "Overflow Changed");
- nameMap.set("pagehide", "Page Hide");
- nameMap.set("pageshow", "Page Show");
- nameMap.set("popstate", "Pop State");
- nameMap.set("ratechange", "Rate Change");
- nameMap.set("readystatechange", "Ready State Change");
- nameMap.set("removesourcebuffer", "Remove Source Buffer");
- nameMap.set("removestream", "Remove Stream");
- nameMap.set("removetrack", "Remove Track");
- nameMap.set("securitypolicyviolation", "Security Policy Violation");
- nameMap.set("selectionchange", "Selection Change");
- nameMap.set("selectstart", "Select Start");
- nameMap.set("signalingstatechange", "Signaling State Change");
- nameMap.set("soundend", "Sound End");
- nameMap.set("soundstart", "Sound Start");
- nameMap.set("sourceclose", "Source Close");
- nameMap.set("sourceended", "Source Ended");
- nameMap.set("sourceopen", "Source Open");
- nameMap.set("speechend", "Speech End");
- nameMap.set("speechstart", "Speech Start");
- nameMap.set("textInput", "Text Input");
- nameMap.set("timeupdate", "Time Update");
- nameMap.set("tonechange", "Tone Change");
- nameMap.set("touchcancel", "Touch Cancel");
- nameMap.set("touchend", "Touch End");
- nameMap.set("touchmove", "Touch Move");
- nameMap.set("touchstart", "Touch Start");
- nameMap.set("transitionend", "Transition End");
- nameMap.set("updateend", "Update End");
- nameMap.set("updateready", "Update Ready");
- nameMap.set("updatestart", "Update Start");
- nameMap.set("upgradeneeded", "Upgrade Needed");
- nameMap.set("versionchange", "Version Change");
- nameMap.set("visibilitychange", "Visibility Change");
- nameMap.set("volumechange", "Volume Change");
- nameMap.set("webglcontextcreationerror", "WebGL Context Creation Error");
- nameMap.set("webglcontextlost", "WebGL Context Lost");
- nameMap.set("webglcontextrestored", "WebGL Context Restored");
- nameMap.set("webkitAnimationEnd", "Animation End");
- nameMap.set("webkitAnimationIteration", "Animation Iteration");
- nameMap.set("webkitAnimationStart", "Animation Start");
- nameMap.set("webkitBeforeTextInserted", "Before Text Inserted");
- nameMap.set("webkitEditableContentChanged", "Editable Content Changed");
- nameMap.set("webkitTransitionEnd", "Transition End");
- nameMap.set("webkitaddsourcebuffer", "Add Source Buffer");
- nameMap.set("webkitbeginfullscreen", "Begin Fullscreen");
- nameMap.set("webkitcurrentplaybacktargetiswirelesschanged", "Current Playback Target Is Wireless Changed");
- nameMap.set("webkitdeviceproximity", "Device Proximity");
- nameMap.set("webkitendfullscreen", "End Fullscreen");
- nameMap.set("webkitfullscreenchange", "Fullscreen Change");
- nameMap.set("webkitfullscreenerror", "Fullscreen Error");
- nameMap.set("webkitkeyadded", "Key Added");
- nameMap.set("webkitkeyerror", "Key Error");
- nameMap.set("webkitkeymessage", "Key Message");
- nameMap.set("webkitneedkey", "Need Key");
- nameMap.set("webkitnetworkinfochange", "Network Info Change");
- nameMap.set("webkitplaybacktargetavailabilitychanged", "Playback Target Availability Changed");
- nameMap.set("webkitpointerlockchange", "Pointer Lock Change");
- nameMap.set("webkitpointerlockerror", "Pointer Lock Error");
- nameMap.set("webkitregionlayoutupdate", "Region Layout Update");
- nameMap.set("webkitregionoversetchange", "Region Overset Change");
- nameMap.set("webkitremovesourcebuffer", "Remove Source Buffer");
- nameMap.set("webkitresourcetimingbufferfull", "Resource Timing Buffer Full");
- nameMap.set("webkitsourceclose", "Source Close");
- nameMap.set("webkitsourceended", "Source Ended");
- nameMap.set("webkitsourceopen", "Source Open");
- nameMap.set("webkitspeechchange", "Speech Change");
- nameMap.set("writeend", "Write End");
- nameMap.set("writestart", "Write Start");
-
- WebInspector.ScriptTimelineRecord._eventDisplayNames = nameMap;
- }
-
- switch(eventType) {
- case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
- return WebInspector.UIString("Script Evaluated");
- case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
- if (details && (details instanceof String || typeof details === "string")) {
- var eventDisplayName = WebInspector.ScriptTimelineRecord._eventDisplayNames.get(details) || details.capitalize();
- return WebInspector.UIString("%s Event Dispatched").format(eventDisplayName);
- }
-
- return WebInspector.UIString("Event Dispatched");
- case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
- if (details && includeTimerIdentifierInMainTitle)
- return WebInspector.UIString("Timer %s Fired").format(details);
- return WebInspector.UIString("Timer Fired");
- case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
- if (details && includeTimerIdentifierInMainTitle)
- return WebInspector.UIString("Timer %s Installed").format(details);
- return WebInspector.UIString("Timer Installed");
- case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
- if (details && includeTimerIdentifierInMainTitle)
- return WebInspector.UIString("Timer %s Removed").format(details);
- return WebInspector.UIString("Timer Removed");
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
- return WebInspector.UIString("Animation Frame Fired");
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
- return WebInspector.UIString("Animation Frame Requested");
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
- return WebInspector.UIString("Animation Frame Canceled");
- }
-};
-
-WebInspector.ScriptTimelineRecord.TypeIdentifier = "script-timeline-record";
-WebInspector.ScriptTimelineRecord.EventTypeCookieKey = "script-timeline-record-event-type";
-WebInspector.ScriptTimelineRecord.DetailsCookieKey = "script-timeline-record-details";
-
-WebInspector.ScriptTimelineRecord.prototype = {
- constructor: WebInspector.ScriptTimelineRecord,
-
- // Public
-
- get eventType()
- {
- return this._eventType;
- },
-
- get details()
- {
- return this._details;
- },
-
- get profile()
- {
- return this._profile;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- WebInspector.TimelineRecord.prototype.saveIdentityToCookie.call(this, cookie);
-
- cookie[WebInspector.ScriptTimelineRecord.EventTypeCookieKey] = this._eventType;
- cookie[WebInspector.ScriptTimelineRecord.DetailsCookieKey] = this._details;
- }
-};
-
-WebInspector.ScriptTimelineRecord.prototype.__proto__ = WebInspector.TimelineRecord.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-view.script > .data-grid {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
-.timeline-view.script > .data-grid .eventType-column {
- border-right: none;
-}
-
-.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.script .item .subtitle {
- display: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,279 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineView = function(recording)
-{
- WebInspector.TimelineView.call(this);
-
- this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.ScriptTimelineView.TreeOutlineStyleClassName);
-
- var columns = {location: {}, callCount: {}, startTime: {}, totalTime: {}, selfTime: {}, averageTime: {}};
-
- columns.location.title = WebInspector.UIString("Location");
- columns.location.width = "15%";
-
- columns.callCount.title = WebInspector.UIString("Calls");
- columns.callCount.width = "5%";
- columns.callCount.aligned = "right";
-
- columns.startTime.title = WebInspector.UIString("Start Time");
- columns.startTime.width = "10%";
- columns.startTime.aligned = "right";
- columns.startTime.sort = "ascending";
-
- columns.totalTime.title = WebInspector.UIString("Total Time");
- columns.totalTime.width = "10%";
- columns.totalTime.aligned = "right";
-
- columns.selfTime.title = WebInspector.UIString("Self Time");
- columns.selfTime.width = "10%";
- columns.selfTime.aligned = "right";
-
- columns.averageTime.title = WebInspector.UIString("Average Time");
- columns.averageTime.width = "10%";
- columns.averageTime.aligned = "right";
-
- for (var column in columns)
- columns[column].sortable = true;
-
- this._dataGrid = new WebInspector.ScriptTimelineDataGrid(this.navigationSidebarTreeOutline, columns, this);
- this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
- this.element.classList.add(WebInspector.ScriptTimelineView.StyleClassName);
- this.element.appendChild(this._dataGrid.element);
-
- var scriptTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Script);
- scriptTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._scriptTimelineRecordAdded, this);
-
- this._pendingRecords = [];
-};
-
-WebInspector.ScriptTimelineView.StyleClassName = "script";
-WebInspector.ScriptTimelineView.TreeOutlineStyleClassName = "script";
-
-WebInspector.ScriptTimelineView.prototype = {
- constructor: WebInspector.ScriptTimelineView,
- __proto__: WebInspector.TimelineView.prototype,
-
- // Public
-
- get navigationSidebarTreeOutlineLabel()
- {
- return WebInspector.UIString("Records");
- },
-
- shown: function()
- {
- WebInspector.TimelineView.prototype.shown.call(this);
-
- this._dataGrid.shown();
- },
-
- hidden: function()
- {
- this._dataGrid.hidden();
-
- WebInspector.TimelineView.prototype.hidden.call(this);
- },
-
- updateLayout: function()
- {
- WebInspector.TimelineView.prototype.updateLayout.call(this);
-
- this._dataGrid.updateLayout();
-
- if (this.startTime !== this._oldStartTime || this.endTime !== this._oldEndTime) {
- var dataGridNode = this._dataGrid.children[0];
- while (dataGridNode) {
- dataGridNode.rangeStartTime = this.startTime;
- dataGridNode.rangeEndTime = this.endTime;
- if (dataGridNode.revealed)
- dataGridNode.refreshIfNeeded();
- dataGridNode = dataGridNode.traverseNextNode(false, null, true);
- }
-
- this._oldStartTime = this.startTime;
- this._oldEndTime = this.endTime;
- }
-
- this._processPendingRecords();
- },
-
- get selectionPathComponents()
- {
- var dataGridNode = this._dataGrid.selectedNode;
- if (!dataGridNode)
- return null;
-
- var pathComponents = [];
-
- while (dataGridNode && !dataGridNode.root) {
- var treeElement = this._dataGrid.treeElementForDataGridNode(dataGridNode);
- console.assert(treeElement);
- if (!treeElement)
- break;
-
- if (treeElement.hidden)
- return null;
-
- var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
- pathComponents.unshift(pathComponent);
- dataGridNode = dataGridNode.parent;
- }
-
- return pathComponents;
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
- },
-
- reset: function()
- {
- WebInspector.TimelineView.prototype.reset.call(this);
-
- this._dataGrid.reset();
- },
-
- // Protected
-
- treeElementPathComponentSelected: function(event)
- {
- var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
- if (!dataGridNode)
- return;
- dataGridNode.revealAndSelect();
- },
-
- dataGridNodeForTreeElement: function(treeElement)
- {
- if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
- return new WebInspector.ProfileNodeDataGridNode(treeElement.profileNode, this.zeroTime, this.startTime, this.endTime);
- return null;
- },
-
- populateProfileNodeTreeElement: function(treeElement)
- {
- var zeroTime = this.zeroTime;
- var startTime = this.startTime;
- var endTime = this.endTime;
-
- for (var childProfileNode of treeElement.profileNode.childNodes) {
- var profileNodeTreeElement = new WebInspector.ProfileNodeTreeElement(childProfileNode, this);
- var profileNodeDataGridNode = new WebInspector.ProfileNodeDataGridNode(childProfileNode, zeroTime, startTime, endTime);
- this._dataGrid.addRowInSortOrder(profileNodeTreeElement, profileNodeDataGridNode, treeElement);
- }
- },
-
- // Private
-
- _processPendingRecords: function()
- {
- if (!this._pendingRecords.length)
- return;
-
- for (var scriptTimelineRecord of this._pendingRecords) {
- var rootNodes = [];
- if (scriptTimelineRecord.profile) {
- // FIXME: Support using the bottom-up tree once it is implemented.
- rootNodes = scriptTimelineRecord.profile.topDownRootNodes;
-
- // If there is only one node, promote its children. The TimelineRecordTreeElement already reflects the root
- // node in this case (e.g. a "Load Event Dispatched" record with an "onload" root profile node).
- // FIXME: Only do this for the top-down mode. Doing this for bottom-up would be incorrect.
- if (rootNodes.length === 1)
- rootNodes = rootNodes[0].childNodes;
- }
-
- var zeroTime = this.zeroTime;
- var treeElement = new WebInspector.TimelineRecordTreeElement(scriptTimelineRecord, WebInspector.SourceCodeLocation.NameStyle.Short, rootNodes.length);
- var dataGridNode = new WebInspector.ScriptTimelineDataGridNode(scriptTimelineRecord, zeroTime);
-
- this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
-
- var startTime = this.startTime;
- var endTime = this.endTime;
-
- for (var profileNode of rootNodes) {
- var profileNodeTreeElement = new WebInspector.ProfileNodeTreeElement(profileNode, this);
- var profileNodeDataGridNode = new WebInspector.ProfileNodeDataGridNode(profileNode, zeroTime, startTime, endTime);
- this._dataGrid.addRowInSortOrder(profileNodeTreeElement, profileNodeDataGridNode, treeElement);
- }
- }
-
- this._pendingRecords = [];
- },
-
- _scriptTimelineRecordAdded: function(event)
- {
- var scriptTimelineRecord = event.data.record;
- console.assert(scriptTimelineRecord instanceof WebInspector.ScriptTimelineRecord);
-
- this._pendingRecords.push(scriptTimelineRecord);
-
- this.needsLayout();
- },
-
- _dataGridFiltersDidChange: function(event)
- {
- WebInspector.timelineSidebarPanel.updateFilter();
- },
-
- _dataGridNodeSelected: function(event)
- {
- this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (this._dataGrid.shouldIgnoreSelectionEvent())
- return;
-
- if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
- return;
-
- if (treeElement instanceof WebInspector.FolderTreeElement)
- return;
-
- var sourceCodeLocation = null;
- if (treeElement instanceof WebInspector.TimelineRecordTreeElement)
- sourceCodeLocation = treeElement.record.sourceCodeLocation;
- else if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
- sourceCodeLocation = treeElement.profileNode.sourceCodeLocation;
- else
- console.error("Unknown tree element selected.");
-
- if (!sourceCodeLocation) {
- WebInspector.timelineSidebarPanel.showTimelineView(WebInspector.TimelineRecord.Type.Script);
- return;
- }
-
- WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceScriptTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ScriptTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ScriptTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ScriptTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,63 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTreeElement = function(script)
-{
- console.assert(script instanceof WebInspector.Script);
-
- WebInspector.SourceCodeTreeElement.call(this, script, WebInspector.ScriptTreeElement.StyleClassName, null, null, script, false);
-
- this.mainTitle = script.displayName;
-
- if (script.url) {
- // Show the host as the subtitle if it is different from the main title.
- var subtitle = WebInspector.displayNameForHost(script.urlComponents.host);
- this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
-
- this.tooltip = script.url;
-
- this.addClassName(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- this.addClassName(WebInspector.Resource.Type.Script);
- } else
- this.addClassName(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
-
- this._script = script;
-};
-
-WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName = "anonymous-script-icon";
-WebInspector.ScriptTreeElement.StyleClassName = "script";
-
-WebInspector.ScriptTreeElement.prototype = {
- constructor: WebInspector.ScriptTreeElement,
-
- // Public
-
- get script()
- {
- return this._script;
- }
-};
-
-WebInspector.ScriptTreeElement.prototype.__proto__ = WebInspector.SourceCodeTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSearchBarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SearchBar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SearchBar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SearchBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.search-bar > input[type="search"] {
- margin: 1px 6px;
-
- outline: none;
-
- -webkit-appearance: none;
-
- border: 1px solid rgba(0, 0, 0, 0.35);
- border-radius: 10px;
- background-color: rgba(255, 255, 255, 0.2);
- box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
- background-clip: padding-box;
-
- height: 19px;
-
- transition: background-color 200ms ease-in-out;
-}
-
-.search-bar > input[type="search"]::-webkit-input-placeholder {
- color: rgba(0, 0, 0, 0.35);
-}
-
-.search-bar > input[type="search"]:focus { background-color: white; }
-.search-bar > input[type="search"]:not(:placeholder-shown) { background-color: white; } /* Needs to be a separate rule. See http://webkit.org/b/118162 */
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSearchBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SearchBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SearchBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SearchBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SearchBar = function(identifier, placeholder, delegate) {
- WebInspector.NavigationItem.call(this, identifier);
-
- this.delegate = delegate;
-
- this._element.classList.add(WebInspector.SearchBar.StyleClassName);
-
- this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
- this._keyboardShortcutEnter = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter);
-
- this._searchInput = this._element.appendChild(document.createElement("input"));
- this._searchInput.type = "search";
- this._searchInput.spellcheck = false;
- this._searchInput.incremental = true;
- this._searchInput.setAttribute("results", 5);
- this._searchInput.setAttribute("autosave", identifier + "-autosave");
- this._searchInput.setAttribute("placeholder", placeholder);
- this._searchInput.addEventListener("search", this._handleSearchEvent.bind(this), false);
- this._searchInput.addEventListener("keydown", this._handleKeydownEvent.bind(this), false);
-};
-
-WebInspector.SearchBar.StyleClassName = "search-bar";
-WebInspector.SearchBar.Event = {
- TextChanged: "searchbar-text-did-change"
-};
-
-WebInspector.SearchBar.prototype = {
- constructor: WebInspector.SearchBar,
-
- // Public
-
- get text()
- {
- return this._searchInput.value;
- },
-
- set text(newText)
- {
- this._searchInput.value = newText;
- },
-
- focus: function()
- {
- this._searchInput.focus();
- this._searchInput.select();
- },
-
- // Private
-
- _handleSearchEvent: function(event)
- {
- this.dispatchEventToListeners(WebInspector.SearchBar.Event.TextChanged);
- },
-
- _handleKeydownEvent: function(event)
- {
- if (this._keyboardShortcutEsc.matchesEvent(event)) {
- if (this.delegate && typeof this.delegate.searchBarWantsToLoseFocus === "function") {
- this.delegate.searchBarWantsToLoseFocus(this);
- event.stopPropagation();
- event.preventDefault();
- }
- } else if (this._keyboardShortcutEnter.matchesEvent(event)) {
- if (this.delegate && typeof this.delegate.searchBarDidActivate === "function") {
- this.delegate.searchBarDidActivate(this);
- event.stopPropagation();
- event.preventDefault();
- }
- }
- }
-};
-
-WebInspector.SearchBar.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSearchIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SearchIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SearchIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SearchIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.dom-match-element-icon .icon {
- content: url(Images/DOMElement.svg);
-}
-
-.dom-match-text-node-icon .icon {
- content: url(Images/DOMTextNode.svg);
-}
-
-.dom-match-comment-icon .icon {
- content: url(Images/DOMComment.svg);
-}
-
-.dom-match-document-type-icon .icon {
- content: url(Images/DOMDocumentType.svg);
-}
-
-.dom-match-character-data-icon .icon {
- content: url(Images/DOMCharacterData.svg);
-}
-
-.dom-match-node-icon .icon {
- content: url(Images/DOMNode.svg);
-}
-
-.resource-match-icon .icon {
- content: url(Images/ResultLine.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSearchResultTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SearchResultTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SearchResultTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SearchResultTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,89 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SearchResultTreeElement = function(representedObject)
-{
- console.assert(representedObject instanceof WebInspector.DOMSearchMatchObject || representedObject instanceof WebInspector.ResourceSearchMatchObject);
-
- var title = WebInspector.SearchResultTreeElement.truncateAndHighlightTitle(representedObject.title, representedObject.searchTerm, representedObject.sourceCodeTextRange);
-
- WebInspector.GeneralTreeElement.call(this, representedObject.className, title, null, representedObject, false);
- this.small = true;
-};
-
-WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch = 15;
-WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch = 50;
-WebInspector.SearchResultTreeElement.HighlightedStyleClassName = "highlighted";
-
-WebInspector.SearchResultTreeElement.prototype = {
- constructor: WebInspector.SearchResultTreeElement,
-
- // Public
-
- get filterableData()
- {
- return {text: this.representedObject.title};
- }
-};
-
-WebInspector.SearchResultTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
-
-WebInspector.SearchResultTreeElement.truncateAndHighlightTitle = function(title, searchTerm, sourceCodeTextRange)
-{
- // Use the original location, since those line/column offsets match the line text in title.
- var textRange = sourceCodeTextRange.textRange;
-
- var searchTermIndex = textRange.startColumn;
-
- // We should only have one line text ranges, so make sure that is the case.
- console.assert(textRange.startLine === textRange.endLine);
-
- // Show some characters before the matching text (if there are enough) for context. TreeOutline takes care of the truncating
- // at the end of the string.
- var modifiedTitle = null;
- if (searchTermIndex > WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch) {
- modifiedTitle = "\u2026" + title.substring(searchTermIndex - WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch);
- searchTermIndex = WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch + 1;
- } else
- modifiedTitle = title;
-
- // Truncate the tail of the title so the tooltip isn't so large.
- modifiedTitle = modifiedTitle.trimEnd(searchTermIndex + searchTerm.length + WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch);
-
- console.assert(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length).toLowerCase() === searchTerm.toLowerCase());
-
- var highlightedTitle = document.createDocumentFragment();
-
- highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(0, searchTermIndex)));
-
- var highlightSpan = document.createElement("span");
- highlightSpan.className = WebInspector.SearchResultTreeElement.HighlightedStyleClassName;
- highlightSpan.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length)));
- highlightedTitle.appendChild(highlightSpan);
-
- highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex + searchTerm.length)));
-
- return highlightedTitle;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSectioncss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Section.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Section.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Section.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,195 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.section {
- position: relative;
-}
-
-.section .header {
- color: black;
- padding: 0 8px 0 18px;
- min-height: 18px;
- white-space: nowrap;
- background-origin: padding;
- background-clip: padding;
-}
-
-.section .header::before {
- position: absolute;
- top: 5px;
- left: 7px;
-
- width: 8px;
- height: 8px;
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- content: "";
-}
-
-.section.expanded .header::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.section .header .title, .event-bar .header .title {
- font-weight: normal;
- word-wrap: break-word;
- white-space: normal;
- line-height: 18px;
-}
-
-.section .header .title.blank-title {
- font-style: italic;
-}
-
-.section .header label, .event-bar .header label {
- display: none;
-}
-
-.section.expanded .header label, .event-bar.expanded .header label {
- display: inline;
-}
-
-.section .header .subtitle, .event-bar .header .subtitle {
- float: right;
- margin-left: 5px;
- max-width: 55%;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-.section .header .subtitle a {
- color: inherit;
-}
-
-.section .properties, .event-bar .event-properties {
- display: none;
-}
-
-.section.expanded .properties, .event-bar.expanded .event-properties {
- display: block;
- padding-left: 16px;
-}
-
-.section.expanded.no-header .properties {
- padding-left: 0;
-}
-
-.section.no-affect .properties li {
- opacity: 0.5;
-}
-
-.section.no-affect .properties li.editing {
- opacity: 1.0;
-}
-
-.properties-tree {
- margin: 0;
- padding: 0 6px 2px;
- list-style: none;
- min-height: 18px;
- outline: none;
-}
-
-.properties-tree li {
- margin-left: 12px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- -webkit-user-select: text;
- cursor: default;
-}
-
-.properties-tree li.parent {
- margin-left: 1px;
-}
-
-.properties-tree li.parent::before {
- float: left;
-
- content: "";
-
- background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
- background-size: 8px 8px;
- background-repeat: no-repeat;
-
- width: 8px;
- height: 8px;
-
- margin-top: 3px;
- padding-right: 2px;
-}
-
-.properties-tree li.parent.expanded::before {
- background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
-}
-
-.properties-tree li .info {
- padding-top: 4px;
- padding-bottom: 3px;
-}
-
-.properties-tree ol {
- display: none;
- margin: 0;
- -webkit-padding-start: 12px;
- list-style: none;
-}
-
-.properties-tree ol.expanded {
- display: block;
-}
-
-.section .properties li.editing-sub-part {
- padding: 3px 6px 8px 18px;
- margin: -3px -6px -8px -6px;
- text-overflow: clip;
-}
-
-.section .properties .name, .event-properties .name {
- color: rgb(136, 19, 145);
-}
-
-.section .properties .dimmed {
- opacity: 0.6;
-}
-
-.section .properties .value.error {
- color: red;
-}
-
-.section .properties .number, .event-properties .number {
- color: blue;
-}
-
-.section .properties .keyword, .event-properties .keyword {
- color: rgb(136, 19, 79);
-}
-
-.section .properties .color, .event-properties .color {
- color: rgb(118, 15, 21);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSectionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Section.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Section.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Section.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,227 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Section = function(title, subtitle)
-{
- WebInspector.Object.call(this);
-
- this.element = document.createElement("div");
- this.element.className = "section";
- this.element._section = this;
-
- if (typeof title === "string" || title instanceof Node || typeof subtitle === "string") {
- this.headerElement = document.createElement("div");
- this.headerElement.className = "header";
-
- this.titleElement = document.createElement("div");
- this.titleElement.className = "title";
-
- this.subtitleElement = document.createElement("div");
- this.subtitleElement.className = "subtitle";
-
- this.headerElement.appendChild(this.subtitleElement);
- this.headerElement.appendChild(this.titleElement);
-
- this.headerElement.addEventListener("click", this.handleClick.bind(this), false);
- this.element.appendChild(this.headerElement);
-
- this.title = title;
- this.subtitle = subtitle;
- } else
- this.element.classList.add("no-header");
-
- this._expanded = false;
-
- if (!this.headerElement)
- this.expand();
-};
-
-WebInspector.Section.Event = {
- VisibleContentDidChange: "section-visible-content-did-change"
-};
-
-WebInspector.Section.prototype = {
- get title()
- {
- return this._title;
- },
-
- set title(x)
- {
- if (this._title === x)
- return;
- this._title = x;
-
- if (x instanceof Node) {
- this.titleElement.removeChildren();
- this.titleElement.appendChild(x);
- } else
- this.titleElement.textContent = x;
- },
-
- get subtitle()
- {
- return this._subtitle;
- },
-
- set subtitle(x)
- {
- if (this._subtitle === x)
- return;
- this._subtitle = x;
- this.subtitleElement.textContent = x;
- },
-
- get subtitleAsTextForTest()
- {
- var result = this.subtitleElement.textContent;
- var child = this.subtitleElement.querySelector("[data-uncopyable]");
- if (child) {
- var linkData = child.getAttribute("data-uncopyable");
- if (linkData)
- result += linkData;
- }
- return result;
- },
-
- get expanded()
- {
- return this._expanded;
- },
-
- set expanded(x)
- {
- if (x)
- this.expand();
- else
- this.collapse();
- },
-
- get populated()
- {
- return this._populated;
- },
-
- set populated(x)
- {
- this._populated = x;
- if (!x && this._expanded) {
- this.onpopulate();
- this._populated = true;
- }
- },
-
- onpopulate: function()
- {
- // Overriden by subclasses.
- },
-
- get firstSibling()
- {
- var parent = this.element.parentElement;
- if (!parent)
- return null;
-
- var childElement = parent.firstChild;
- while (childElement) {
- if (childElement._section)
- return childElement._section;
- childElement = childElement.nextSibling;
- }
-
- return null;
- },
-
- get lastSibling()
- {
- var parent = this.element.parentElement;
- if (!parent)
- return null;
-
- var childElement = parent.lastChild;
- while (childElement) {
- if (childElement._section)
- return childElement._section;
- childElement = childElement.previousSibling;
- }
-
- return null;
- },
-
- get nextSibling()
- {
- var curElement = this.element;
- do {
- curElement = curElement.nextSibling;
- } while (curElement && !curElement._section);
-
- return curElement ? curElement._section : null;
- },
-
- get previousSibling()
- {
- var curElement = this.element;
- do {
- curElement = curElement.previousSibling;
- } while (curElement && !curElement._section);
-
- return curElement ? curElement._section : null;
- },
-
- expand: function()
- {
- if (this._expanded)
- return;
- this._expanded = true;
- this.element.classList.add("expanded");
-
- if (!this._populated) {
- this.onpopulate();
- this._populated = true;
- } else
- this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
- },
-
- collapse: function()
- {
- if (!this._expanded)
- return;
- this._expanded = false;
- this.element.classList.remove("expanded");
- },
-
- toggleExpanded: function()
- {
- this.expanded = !this.expanded;
- },
-
- handleClick: function(e)
- {
- this.toggleExpanded();
- e.stopPropagation();
- }
-};
-
-WebInspector.Section.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSettingjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Setting.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Setting.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Setting.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,96 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * 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
- * OWNER 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.Setting = function(name, defaultValue)
-{
- this._name = name;
- this._localStorageKey = WebInspector.Setting.LocalStorageKeyPrefix + name;
- this._defaultValue = defaultValue;
-}
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Setting);
-
-WebInspector.Setting.Event = {
- Changed: "setting-changed"
-};
-
-WebInspector.Setting.LocalStorageKeyPrefix = "com.apple.WebInspector.";
-
-WebInspector.Setting.prototype = {
- constructor: WebInspector.Setting,
-
- // Public
-
- get name()
- {
- return this._name;
- },
-
- get value()
- {
- if ("_value" in this)
- return this._value;
-
- // Make a copy of the default value so changes to object values don't modify the default value.
- this._value = JSON.parse(JSON.stringify(this._defaultValue));
-
- if (window.localStorage && this._localStorageKey in window.localStorage) {
- try {
- this._value = JSON.parse(window.localStorage[this._localStorageKey]);
- } catch(e) {
- delete window.localStorage[this._localStorageKey];
- }
- }
-
- return this._value;
- },
-
- set value(value)
- {
- this._value = value;
-
- if (window.localStorage) {
- try {
- // Use Object.shallowEqual to properly compare objects.
- if (Object.shallowEqual(this._value, this._defaultValue))
- delete window.localStorage[this._localStorageKey];
- else
- window.localStorage[this._localStorageKey] = JSON.stringify(this._value);
- } catch(e) {
- console.error("Error saving setting with name: " + this._name);
- }
- }
-
- this.dispatchEventToListeners(WebInspector.Setting.Event.Changed, this._value, {name: this._name});
- }
-}
-
-WebInspector.Setting.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSidebarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Sidebar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Sidebar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Sidebar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,93 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar {
- position: relative;
-
- background-color: rgb(227, 231, 235);
-}
-
-.sidebar.collapsed {
- width: 0 !important;
- border: none !important;
-}
-
-body.window-inactive .sidebar {
- background-color: rgb(231, 231, 231);
-}
-
-.sidebar > .panel {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-
- display: none;
-
- overflow: hidden;
-
- z-index: 0; /* Workaround so that scroll bars appear above position:sticky section headers. */
-}
-
-.sidebar > .panel.selected {
- display: block;
-}
-
-.sidebar > .resizer {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 5px;
-
- z-index: 100;
-
- cursor: col-resize;
-}
-
-.sidebar.right > .resizer {
- left: -3px;
-}
-
-.sidebar.left > .resizer {
- right: -3px;
-}
-
-.sidebar.collapsed.right > .resizer {
- left: -5px;
-}
-
-.sidebar.collapsed.left > .resizer {
- right: -5px;
-}
-
-.sidebar.left {
- border-right: 1px solid rgb(153, 153, 153);
-}
-
-.sidebar.right {
- background-color: rgb(231, 231, 231);
- border-left: 1px solid rgb(153, 153, 153);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSidebarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Sidebar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Sidebar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Sidebar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,319 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Sidebar = function(element, side, sidebarPanels, role, label) {
- WebInspector.Object.call(this);
-
- console.assert(!side || side === WebInspector.Sidebar.Sides.Left || side === WebInspector.Sidebar.Sides.Right);
- this._side = side || WebInspector.Sidebar.Sides.Left;
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.Sidebar.StyleClassName);
- this._element.classList.add(WebInspector.Sidebar.CollapsedStyleClassName);
- this._element.classList.add(this._side);
-
- this._element.setAttribute("role", role || "group");
- if (label)
- this._element.setAttribute("aria-label", label);
-
- this._resizeElement = document.createElement("div");
- this._resizeElement.classList.add(WebInspector.Sidebar.ResizeElementStyleClassName);
- this._resizeElement.addEventListener("mousedown", this._resizerMouseDown.bind(this), false);
- this._resizeElement.addEventListener("dblclick", this._resizerDoubleClicked.bind(this), false);
- this._element.insertBefore(this._resizeElement, this._element.firstChild);
-
- this._sidebarPanels = [];
-
- if (sidebarPanels) {
- for (var i = 0; i < sidebarPanels.length; ++i)
- this.addSidebarPanel(sidebarPanels[i]);
- }
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Sidebar);
-
-WebInspector.Sidebar.StyleClassName = "sidebar";
-WebInspector.Sidebar.CollapsedStyleClassName = "collapsed";
-WebInspector.Sidebar.ResizeElementStyleClassName = "resizer";
-WebInspector.Sidebar.AbsoluteMinimumWidth = 200;
-
-WebInspector.Sidebar.Sides = {};
-WebInspector.Sidebar.Sides.Right = "right";
-WebInspector.Sidebar.Sides.Left = "left";
-
-WebInspector.Sidebar.Event = {
- SidebarPanelSelected: "sidebar-sidebar-panel-selected",
- CollapsedStateDidChange: "sidebar-sidebar-collapsed-state-did-change",
- WidthDidChange: "sidebar-width-did-change",
-};
-
-WebInspector.Sidebar.prototype = {
- constructor: WebInspector.Sidebar,
-
- // Public
-
- addSidebarPanel: function(sidebarPanel)
- {
- console.assert(sidebarPanel instanceof WebInspector.SidebarPanel);
- if (!(sidebarPanel instanceof WebInspector.SidebarPanel))
- return;
-
- console.assert(!sidebarPanel.parentSidebar);
- if (sidebarPanel.parentSidebar)
- return;
-
- sidebarPanel._parentSidebar = this;
-
- this._sidebarPanels.push(sidebarPanel);
- this._element.appendChild(sidebarPanel.element);
-
- sidebarPanel.added();
-
- return sidebarPanel;
- },
-
- removeSidebarPanel: function(sidebarPanelOrIdentifierOrIndex, index)
- {
- var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
- if (!sidebarPanel)
- return;
-
- sidebarPanel.willRemove();
-
- sidebarPanel._parentSidebar = null;
-
- if (this._selectedSidebarPanel === sidebarPanel) {
- var index = this._sidebarPanels.indexOf(sidebarPanel);
- this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1];
- }
-
- this._sidebarPanels.remove(sidebarPanel);
- this._element.removeChild(sidebarPanel.element);
-
- sidebarPanel.removed();
-
- return sidebarPanel;
- },
-
- get selectedSidebarPanel()
- {
- return this._selectedSidebarPanel || null;
- },
-
- set selectedSidebarPanel(sidebarPanelOrIdentifierOrIndex)
- {
- var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
- if (this._selectedSidebarPanel === sidebarPanel)
- return;
-
- if (this._selectedSidebarPanel) {
- var wasVisible = this._selectedSidebarPanel.visible;
-
- this._selectedSidebarPanel.selected = false;
-
- if (wasVisible) {
- this._selectedSidebarPanel.hidden();
- this._selectedSidebarPanel.visibilityDidChange();
- }
- }
-
- this._selectedSidebarPanel = sidebarPanel || null;
-
- if (this._selectedSidebarPanel) {
- this._selectedSidebarPanel.selected = true;
-
- if (this._selectedSidebarPanel.visible) {
- this._selectedSidebarPanel.shown();
- this._selectedSidebarPanel.visibilityDidChange();
- }
- }
-
- this.dispatchEventToListeners(WebInspector.Sidebar.Event.SidebarPanelSelected);
- },
-
- get minimumWidth()
- {
- return WebInspector.Sidebar.AbsoluteMinimumWidth;
- },
-
- get maximumWidth()
- {
- // FIXME: This is kind of arbitrary and ideally would be a more complex calculation based on the
- // available space for the sibling elements.
- return Math.round(window.innerWidth / 3);
- },
-
- get width()
- {
- return this._element.offsetWidth;
- },
-
- set width(newWidth)
- {
- if (newWidth === this.width)
- return;
-
- newWidth = Math.max(this.minimumWidth, Math.min(newWidth, this.maximumWidth));
-
- this._element.style.width = newWidth + "px";
-
- if (!this.collapsed && this._selectedSidebarPanel)
- this._selectedSidebarPanel.widthDidChange();
-
- this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange);
- },
-
- get collapsed()
- {
- return this._element.classList.contains(WebInspector.Sidebar.CollapsedStyleClassName);
- },
-
- set collapsed(flag)
- {
- if (flag === this.collapsed)
- return;
-
- if (flag)
- this._element.classList.add(WebInspector.Sidebar.CollapsedStyleClassName);
- else
- this._element.classList.remove(WebInspector.Sidebar.CollapsedStyleClassName);
-
- if (this._selectedSidebarPanel) {
- if (this._selectedSidebarPanel.visible)
- this._selectedSidebarPanel.shown();
- else
- this._selectedSidebarPanel.hidden();
-
- this._selectedSidebarPanel.visibilityDidChange();
-
- this._selectedSidebarPanel.widthDidChange();
- }
-
- this.dispatchEventToListeners(WebInspector.Sidebar.Event.CollapsedStateDidChange);
- this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange);
- },
-
- get sidebarPanels()
- {
- return this._sidebarPanels;
- },
-
- get element()
- {
- return this._element;
- },
-
- get side()
- {
- return this._side;
- },
-
- findSidebarPanel: function(sidebarPanelOrIdentifierOrIndex)
- {
- var sidebarPanel = null;
-
- if (sidebarPanelOrIdentifierOrIndex instanceof WebInspector.SidebarPanel) {
- if (this._sidebarPanels.contains(sidebarPanelOrIdentifierOrIndex))
- sidebarPanel = sidebarPanelOrIdentifierOrIndex;
- } else if (typeof sidebarPanelOrIdentifierOrIndex === "number") {
- sidebarPanel = this._sidebarPanels[sidebarPanelOrIdentifierOrIndex];
- } else if (typeof sidebarPanelOrIdentifierOrIndex === "string") {
- for (var i = 0; i < this._sidebarPanels.length; ++i) {
- if (this._sidebarPanels[i].identifier === sidebarPanelOrIdentifierOrIndex) {
- sidebarPanel = this._sidebarPanels[i];
- break;
- }
- }
- }
-
- return sidebarPanel;
- },
-
- // Private
-
- _navigationItemSelected: function(event)
- {
- this.selectedSidebarPanel = event.target.selectedNavigationItem ? event.target.selectedNavigationItem.identifier : null;
- },
-
- _resizerDoubleClicked: function(event)
- {
- this.collapsed = !this.collapsed;
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _resizerMouseDown: function(event)
- {
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- document.body.style.cursor = "col-resize";
-
- this._resizerMouseMovedEventListener = this._resizerMouseMoved.bind(this);
- this._resizerMouseUpEventListener = this._resizerMouseUp.bind(this);
-
- // Register these listeners on the document so we can track the mouse if it leaves the resizer.
- document.addEventListener("mousemove", this._resizerMouseMovedEventListener, false);
- document.addEventListener("mouseup", this._resizerMouseUpEventListener, false);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _resizerMouseMoved: function(event)
- {
- if (this._side === WebInspector.Sidebar.Sides.Left)
- var newWidth = event.pageX - this._element.totalOffsetLeft;
- else
- var newWidth = this._element.totalOffsetLeft + this._element.offsetWidth - event.pageX;
-
- this.width = newWidth;
- this.collapsed = (newWidth < (this.minimumWidth / 2));
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _resizerMouseUp: function(event)
- {
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- document.body.style.removeProperty("cursor");
-
- document.removeEventListener("mousemove", this._resizerMouseMovedEventListener, false);
- document.removeEventListener("mouseup", this._resizerMouseUpEventListener, false);
-
- delete this._resizerMouseMovedEventListener;
- delete this._resizerMouseUpEventListener;
-
- event.preventDefault();
- event.stopPropagation();
- }
-};
-
-WebInspector.Sidebar.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,156 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SidebarPanel = function(identifier, displayName, showToolTip, hideToolTip, image, element, role, label) {
- WebInspector.Object.call(this);
-
- this._identifier = identifier;
-
- this._toolbarItem = new WebInspector.ActivateButtonToolbarItem(identifier, showToolTip, hideToolTip, displayName, image, null, "tab");
- this._toolbarItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggle, this);
- this._toolbarItem.enabled = false;
-
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.SidebarPanel.StyleClassName);
- this._element.classList.add(identifier);
-
- this._element.setAttribute("role", role || "group");
- this._element.setAttribute("aria-label", label || displayName);
-
-};
-
-WebInspector.SidebarPanel.StyleClassName = "panel";
-WebInspector.SidebarPanel.SelectedStyleClassName = "selected";
-
-WebInspector.SidebarPanel.prototype = {
- constructor: WebInspector.SidebarPanel,
-
- // Public
-
- get identifier()
- {
- return this._identifier;
- },
-
- get toolbarItem()
- {
- return this._toolbarItem;
- },
-
- get element()
- {
- return this._element;
- },
-
- get visible()
- {
- return this.selected && this._parentSidebar && !this._parentSidebar.collapsed;
- },
-
- get selected()
- {
- return this._element.classList.contains(WebInspector.SidebarPanel.SelectedStyleClassName);
- },
-
- set selected(flag)
- {
- if (flag)
- this._element.classList.add(WebInspector.SidebarPanel.SelectedStyleClassName);
- else
- this._element.classList.remove(WebInspector.SidebarPanel.SelectedStyleClassName);
- },
-
- get parentSidebar()
- {
- return this._parentSidebar;
- },
-
- show: function()
- {
- if (!this._parentSidebar)
- return;
-
- this._parentSidebar.collapsed = false;
- this._parentSidebar.selectedSidebarPanel = this;
- },
-
- hide: function()
- {
- if (!this._parentSidebar)
- return;
-
- this._parentSidebar.collapsed = true;
- this._parentSidebar.selectedSidebarPanel = null;
- },
-
- toggle: function()
- {
- if (this.visible)
- this.hide();
- else
- this.show();
- },
-
- added: function()
- {
- console.assert(this._parentSidebar);
- this._toolbarItem.enabled = true;
- this._toolbarItem.activated = this.visible;
- },
-
- removed: function()
- {
- console.assert(!this._parentSidebar);
- this._toolbarItem.enabled = false;
- this._toolbarItem.activated = false;
- },
-
- willRemove: function()
- {
- // Implemented by subclasses.
- },
-
- shown: function()
- {
- // Implemented by subclasses.
- },
-
- hidden: function()
- {
- // Implemented by subclasses.
- },
-
- widthDidChange: function()
- {
- // Implemented by subclasses.
- },
-
- visibilityDidChange: function()
- {
- this._toolbarItem.activated = this.visible;
- }
-};
-
-WebInspector.SidebarPanel.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSlidercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Slider.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Slider.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Slider.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.slider {
- position: relative;
- height: 11px;
- outline: 1px solid rgb(148, 148, 148);
- border: 1px solid white;
-}
-
-.slider > img {
- position: absolute;
- left: -5px;
- top: -5px;
- width: 14px;
- height: 17px;
- content: -webkit-image-set(url(Images/SliderThumb.png) 1x, url(Images/SliderThumb@2x.png) 2x);
-}
-
-.slider > img.dragging {
- content: -webkit-image-set(url(Images/SliderThumbPressed.png) 1x, url(Images/SliderThumbPressed@2x.png) 2x);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSliderjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Slider.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Slider.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Slider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Slider = function()
-{
- this._element = document.createElement("div");
- this._element.className = "slider";
-
- this._knob = this._element.appendChild(document.createElement("img"));
-
- this._value = 0;
- this._knobX = 0;
- this.__maxX = 0;
-
- this._element.addEventListener("mousedown", this);
-};
-
-WebInspector.Slider.KnobWidth = 13;
-
-WebInspector.Slider.prototype = {
- contructor: WebInspector.Slider,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get value()
- {
- return this._value;
- },
-
- set value(value)
- {
- value = Math.max(Math.min(value, 1), 0);
-
- if (value === this._value)
- return;
-
- this._value = value;
-
- this._knobX = Math.round(value * this._maxX);
- this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)";
-
- if (this.delegate && typeof this.delegate.sliderValueDidChange === "function")
- this.delegate.sliderValueDidChange(this, value);
- },
-
- // Protected
-
- handleEvent: function(event)
- {
- switch (event.type) {
- case "mousedown":
- this._handleMousedown(event);
- break;
- case "mousemove":
- this._handleMousemove(event);
- break;
- case "mouseup":
- this._handleMouseup(event);
- break;
- }
- },
-
- // Private
-
- _handleMousedown: function(event)
- {
- if (event.target !== this._knob)
- this.value = (this._localPointForEvent(event).x - 3) / this._maxX;
-
- this._startKnobX = this._knobX;
- this._startMouseX = this._localPointForEvent(event).x;
-
- this._element.classList.add("dragging");
-
- window.addEventListener("mousemove", this, true);
- window.addEventListener("mouseup", this, true);
- },
-
- _handleMousemove: function(event)
- {
- var dx = this._localPointForEvent(event).x - this._startMouseX;
- var x = Math.max(Math.min(this._startKnobX + dx, this._maxX), 0);
-
- this.value = x / this._maxX;
- },
-
- _handleMouseup: function(event)
- {
- this._element.classList.remove("dragging");
-
- window.removeEventListener("mousemove", this, true);
- window.removeEventListener("mouseup", this, true);
- },
-
- _localPointForEvent: function(event)
- {
- // We convert all event coordinates from page coordinates to local coordinates such that the slider
- // may be transformed using CSS Transforms and interaction works as expected.
- return window.webkitConvertPointFromPageToNode(this._element, new WebKitPoint(event.pageX, event.pageY));
- },
-
- get _maxX()
- {
- if (this.__maxX == 0 && document.body.contains(this._element))
- this.__maxX = this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2);
-
- return this.__maxX;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,262 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCode = function()
-{
- WebInspector.Object.call(this);
-
- this._pendingContentRequestCallbacks = [];
-
- this._originalRevision = new WebInspector.SourceCodeRevision(this, null, false);
- this._currentRevision = this._originalRevision;
-
- this._sourceMaps = null;
- this._formatterSourceMap = null;
-};
-
-WebInspector.SourceCode.Event = {
- ContentDidChange: "source-code-content-did-change",
- SourceMapAdded: "source-code-source-map-added",
- FormatterDidChange: "source-code-formatter-did-change"
-};
-
-WebInspector.SourceCode.prototype = {
- constructor: WebInspector.SourceCode,
-
- // Public
-
- get displayName()
- {
- // Implemented by subclasses.
- console.error("Needs to be implemented by a subclass.");
- return "";
- },
-
- get originalRevision()
- {
- return this._originalRevision;
- },
-
- get currentRevision()
- {
- return this._currentRevision;
- },
-
- set currentRevision(revision)
- {
- console.assert(revision instanceof WebInspector.SourceCodeRevision);
- if (!(revision instanceof WebInspector.SourceCodeRevision))
- return;
-
- console.assert(revision.sourceCode === this);
- if (revision.sourceCode !== this)
- return;
-
- this._currentRevision = revision;
-
- this.dispatchEventToListeners(WebInspector.SourceCode.Event.ContentDidChange);
- },
-
- get content()
- {
- return this._currentRevision.content;
- },
-
- get contentIsBase64Encoded()
- {
- return this._currentRevision.contentIsBase64Encoded;
- },
-
- get sourceMaps()
- {
- return this._sourceMaps || [];
- },
-
- addSourceMap: function(sourceMap)
- {
- console.assert(sourceMap instanceof WebInspector.SourceMap);
-
- if (!this._sourceMaps)
- this._sourceMaps = [];
-
- this._sourceMaps.push(sourceMap);
-
- this.dispatchEventToListeners(WebInspector.SourceCode.Event.SourceMapAdded);
- },
-
- get formatterSourceMap()
- {
- return this._formatterSourceMap;
- },
-
- set formatterSourceMap(formatterSourceMap)
- {
- console.assert(this._formatterSourceMap === null || formatterSourceMap === null);
- console.assert(formatterSourceMap === null || formatterSourceMap instanceof WebInspector.FormatterSourceMap);
-
- this._formatterSourceMap = formatterSourceMap;
-
- this.dispatchEventToListeners(WebInspector.SourceCode.Event.FormatterDidChange);
- },
-
- requestContent: function(callback)
- {
- console.assert(typeof callback === "function");
- if (typeof callback !== "function")
- return;
-
- this._pendingContentRequestCallbacks.push(callback);
-
- if (this._contentReceived) {
- // Call _servicePendingContentRequests on a timeout to force callbacks to be asynchronous.
- if (!this._servicePendingContentRequestsTimeoutIdentifier)
- this._servicePendingContentRequestsTimeoutIdentifier = setTimeout(this.servicePendingContentRequests.bind(this), 0);
- } else if (this.canRequestContentFromBackend())
- this.requestContentFromBackendIfNeeded();
- },
-
- createSourceCodeLocation: function(lineNumber, columnNumber)
- {
- return new WebInspector.SourceCodeLocation(this, lineNumber, columnNumber);
- },
-
- createSourceCodeTextRange: function(textRange)
- {
- return new WebInspector.SourceCodeTextRange(this, textRange);
- },
-
- // Protected
-
- revisionContentDidChange: function(revision)
- {
- if (this._ignoreRevisionContentDidChangeEvent)
- return;
-
- if (revision !== this._currentRevision)
- return;
-
- this.handleCurrentRevisionContentChange();
-
- this.dispatchEventToListeners(WebInspector.SourceCode.Event.ContentDidChange);
- },
-
- handleCurrentRevisionContentChange: function()
- {
- // Implemented by subclasses if needed.
- },
-
- get revisionForRequestedContent()
- {
- // Implemented by subclasses if needed.
- return this._originalRevision;
- },
-
- markContentAsStale: function()
- {
- this._contentReceived = false;
- },
-
- canRequestContentFromBackend: function()
- {
- // Implemented by subclasses.
- console.error("Needs to be implemented by a subclass.");
- return false;
- },
-
- requestContentFromBackend: function(callback)
- {
- // Implemented by subclasses.
- console.error("Needs to be implemented by a subclass.");
- },
-
- requestContentFromBackendIfNeeded: function()
- {
- console.assert(this.canRequestContentFromBackend());
- if (!this.canRequestContentFromBackend())
- return;
-
- if (!this._pendingContentRequestCallbacks.length)
- return;
-
- if (this._contentRequestResponsePending)
- return;
-
- this._contentRequestResponsePending = true;
-
- if (this.requestContentFromBackend(this._processContent.bind(this)))
- return;
-
- // Since requestContentFromBackend returned false, just call _processContent,
- // which will cause the pending callbacks to get null content.
- this._processContent();
- },
-
- servicePendingContentRequests: function(force)
- {
- if (this._servicePendingContentRequestsTimeoutIdentifier) {
- clearTimeout(this._servicePendingContentRequestsTimeoutIdentifier);
- delete this._servicePendingContentRequestsTimeoutIdentifier;
- }
-
- // Force the content requests to be sent. To do this correctly we also force
- // _contentReceived to be true so future calls to requestContent go through.
- if (force)
- this._contentReceived = true;
-
- console.assert(this._contentReceived);
- if (!this._contentReceived)
- return;
-
- // Move the callbacks into a local and clear _pendingContentRequestCallbacks so
- // callbacks that might call requestContent again will not modify the array.
- var callbacks = this._pendingContentRequestCallbacks;
- this._pendingContentRequestCallbacks = [];
-
- for (var i = 0; i < callbacks.length; ++i)
- callbacks[i](this, this.content, this.contentIsBase64Encoded);
- },
-
- // Private
-
- _processContent: function(error, content, base64Encoded)
- {
- if (error)
- console.error(error);
-
- this._contentRequestResponsePending = false;
- this._contentReceived = true;
-
- var revision = this.revisionForRequestedContent;
-
- this._ignoreRevisionContentDidChangeEvent = true;
- revision.content = content || null;
- revision.contentIsBase64Encoded = base64Encoded || false;
- delete this._ignoreRevisionContentDidChangeEvent;
-
- this.servicePendingContentRequests();
- }
-};
-
-WebInspector.SourceCode.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeLocationjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeLocation.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeLocation.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeLocation.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,455 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeLocation = function(sourceCode, lineNumber, columnNumber)
-{
- WebInspector.Object.call(this);
-
- console.assert(sourceCode === null || sourceCode instanceof WebInspector.SourceCode);
- console.assert(!(sourceCode instanceof WebInspector.SourceMapResource));
- console.assert(typeof lineNumber === "number" && !isNaN(lineNumber) && lineNumber >= 0);
- console.assert(typeof columnNumber === "number" && !isNaN(columnNumber) && columnNumber >= 0);
-
- this._sourceCode = sourceCode || null;
- this._lineNumber = lineNumber;
- this._columnNumber = columnNumber;
- this._resolveFormattedLocation();
-
- if (this._sourceCode) {
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
- }
-
- this._resetMappedLocation();
-};
-
-WebInspector.SourceCodeLocation.DisplayLocationClassName = "display-location";
-
-WebInspector.SourceCodeLocation.LargeColumnNumber = 80;
-
-WebInspector.SourceCodeLocation.NameStyle = {
- None: "none", // File name not included.
- Short: "short", // Only the file name.
- Full: "full" // Full URL is used.
-};
-
-WebInspector.SourceCodeLocation.ColumnStyle = {
- Hidden: "hidden", // column numbers are not included.
- OnlyIfLarge: "only-if-large", // column numbers greater than 80 are shown.
- Shown: "shown" // non-zero column numbers are shown.
-};
-
-WebInspector.SourceCodeLocation.Event = {
- LocationChanged: "source-code-location-location-changed",
- DisplayLocationChanged: "source-code-location-display-location-changed"
-};
-
-WebInspector.SourceCodeLocation.prototype = {
- constructor: WebInspector.SourceCodeLocation,
-
- // Public
-
- isEqual: function(other)
- {
- if (!other)
- return false;
- return this._sourceCode === other._sourceCode && this._lineNumber === other._lineNumber && this._columnNumber === other._columnNumber;
- },
-
- get sourceCode()
- {
- return this._sourceCode;
- },
-
- set sourceCode(sourceCode)
- {
- console.assert((this._sourceCode === null && sourceCode instanceof WebInspector.SourceCode) || (this._sourceCode instanceof WebInspector.SourceCode && sourceCode === null));
-
- if (sourceCode === this._sourceCode)
- return;
-
- this._makeChangeAndDispatchChangeEventIfNeeded(function() {
- if (this._sourceCode) {
- this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
- this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
- }
-
- this._sourceCode = sourceCode;
-
- if (this._sourceCode) {
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.FormatterDidChange, this._sourceCodeFormatterDidChange, this);
- }
- });
- },
-
- // Raw line and column in the original source code.
-
- get lineNumber()
- {
- return this._lineNumber;
- },
-
- get columnNumber()
- {
- return this._columnNumber;
- },
-
- position: function()
- {
- return new WebInspector.SourceCodePosition(this.lineNumber, this.columnNumber);
- },
-
- // Formatted line and column if the original source code is pretty printed.
- // This is the same as the raw location if there is no formatter.
-
- get formattedLineNumber()
- {
- return this._formattedLineNumber;
- },
-
- get formattedColumnNumber()
- {
- return this._formattedColumnNumber;
- },
-
- formattedPosition: function()
- {
- return new WebInspector.SourceCodePosition(this.formattedLineNumber, this.formattedColumnNumber);
- },
-
- // Display line and column:
- // - Mapped line and column if the original source code has a source map.
- // - Otherwise this is the formatted / raw line and column.
-
- get displaySourceCode()
- {
- this._resolveMappedLocation();
- return this._mappedResource || this._sourceCode;
- },
-
- get displayLineNumber()
- {
- this._resolveMappedLocation();
- return isNaN(this._mappedLineNumber) ? this._formattedLineNumber : this._mappedLineNumber;
- },
-
- get displayColumnNumber()
- {
- this._resolveMappedLocation();
- return isNaN(this._mappedColumnNumber) ? this._formattedColumnNumber : this._mappedColumnNumber;
- },
-
- displayPosition: function()
- {
- return new WebInspector.SourceCodePosition(this.displayLineNumber, this.displayColumnNumber);
- },
-
- // User presentable location strings: "file:lineNumber:columnNumber".
-
- originalLocationString: function(columnStyle, nameStyle, prefix)
- {
- return this._locationString(this.sourceCode, this.lineNumber, this.columnNumber, columnStyle, nameStyle, prefix);
- },
-
- formattedLocationString: function(columnStyle, nameStyle, prefix)
- {
- return this._locationString(this.sourceCode, this.formattedLineNumber, this.formattedColumn, columnStyle, nameStyle, prefix);
- },
-
- displayLocationString: function(columnStyle, nameStyle, prefix)
- {
- return this._locationString(this.displaySourceCode, this.displayLineNumber, this.displayColumnNumber, columnStyle, nameStyle, prefix);
- },
-
- tooltipString: function()
- {
- if (!this.hasDifferentDisplayLocation())
- return this.originalLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full);
-
- var tooltip = WebInspector.UIString("Located at %s").format(this.displayLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full));
- tooltip += "\n" + WebInspector.UIString("Originally %s").format(this.originalLocationString(WebInspector.SourceCodeLocation.ColumnStyle.Shown, WebInspector.SourceCodeLocation.NameStyle.Full));
- return tooltip;
- },
-
- hasMappedLocation: function()
- {
- this._resolveMappedLocation();
- return this._mappedResource !== null;
- },
-
- hasFormattedLocation: function()
- {
- return this._formattedLineNumber !== this._lineNumber || this._formattedColumnNumber !== this._columnNumber;
- },
-
- hasDifferentDisplayLocation: function()
- {
- return this.hasMappedLocation() || this.hasFormattedLocation();
- },
-
- update: function(sourceCode, lineNumber, columnNumber)
- {
- console.assert(sourceCode === this._sourceCode || (this._mappedResource && sourceCode === this._mappedResource));
- console.assert(typeof lineNumber === "number" && !isNaN(lineNumber) && lineNumber >= 0);
- console.assert(typeof columnNumber === "number" && !isNaN(columnNumber) && columnNumber >= 0);
-
- if (sourceCode === this._sourceCode && lineNumber === this._lineNumber && columnNumber === this._columnNumber)
- return;
- else if (this._mappedResource && sourceCode === this._mappedResource && lineNumber === this._mappedLineNumber && columnNumber === this._mappedColumnNumber)
- return;
-
- var newSourceCodeLocation = sourceCode.createSourceCodeLocation(lineNumber, columnNumber);
- console.assert(newSourceCodeLocation.sourceCode === this._sourceCode);
-
- this._makeChangeAndDispatchChangeEventIfNeeded(function() {
- this._lineNumber = newSourceCodeLocation._lineNumber;
- this._columnNumber = newSourceCodeLocation._columnNumber;
- if (newSourceCodeLocation._mappedLocationIsResolved) {
- this._mappedLocationIsResolved = true;
- this._mappedResource = newSourceCodeLocation._mappedResource;
- this._mappedLineNumber = newSourceCodeLocation._mappedLineNumber;
- this._mappedColumnNumber = newSourceCodeLocation._mappedColumnNumber;
- }
- });
- },
-
- populateLiveDisplayLocationTooltip: function(element, prefix)
- {
- prefix = prefix || "";
-
- element.title = prefix + this.tooltipString();
-
- this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) {
- element.title = prefix + this.tooltipString();
- }, this);
- },
-
- populateLiveDisplayLocationString: function(element, propertyName, columnStyle, nameStyle, prefix)
- {
- var currentDisplay = undefined;
-
- function updateDisplayString(showAlternativeLocation, forceUpdate)
- {
- if (!forceUpdate && currentDisplay === showAlternativeLocation)
- return;
-
- currentDisplay = showAlternativeLocation;
-
- if (!showAlternativeLocation) {
- element[propertyName] = this.displayLocationString(columnStyle, nameStyle, prefix);
- element.classList.toggle(WebInspector.SourceCodeLocation.DisplayLocationClassName, this.hasDifferentDisplayLocation());
- } else if (this.hasDifferentDisplayLocation()) {
- element[propertyName] = this.originalLocationString(columnStyle, nameStyle, prefix);
- element.classList.remove(WebInspector.SourceCodeLocation.DisplayLocationClassName);
- }
- }
-
- function mouseOverOrMove(event)
- {
- updateDisplayString.call(this, event.metaKey && !event.altKey && !event.shiftKey);
- }
-
- updateDisplayString.call(this, false);
-
- this.addEventListener(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, function(event) {
- updateDisplayString.call(this, currentDisplay, true);
- }, this);
-
- var boundMouseOverOrMove = mouseOverOrMove.bind(this);
- element.addEventListener("mouseover", boundMouseOverOrMove);
- element.addEventListener("mousemove", boundMouseOverOrMove);
-
- element.addEventListener("mouseout", function(event) {
- updateDisplayString.call(this, false);
- }.bind(this));
- },
-
- // Private
-
- _locationString: function(sourceCode, lineNumber, columnNumber, columnStyle, nameStyle, prefix)
- {
- console.assert(sourceCode);
- if (!sourceCode)
- return "";
-
- columnStyle = columnStyle || WebInspector.SourceCodeLocation.ColumnStyle.OnlyIfLarge;
- nameStyle = nameStyle || WebInspector.SourceCodeLocation.NameStyle.Short;
- prefix = prefix || "";
-
- var lineString = lineNumber + 1; // The user visible line number is 1-based.
- if (columnStyle === WebInspector.SourceCodeLocation.ColumnStyle.Shown && columnNumber > 0)
- lineString += ":" + (columnNumber + 1); // The user visible column number is 1-based.
- else if (columnStyle === WebInspector.SourceCodeLocation.ColumnStyle.OnlyIfLarge && columnNumber > WebInspector.SourceCodeLocation.LargeColumnNumber)
- lineString += ":" + (columnNumber + 1); // The user visible column number is 1-based.
-
- switch (nameStyle) {
- case WebInspector.SourceCodeLocation.NameStyle.None:
- return prefix + lineString;
-
- case WebInspector.SourceCodeLocation.NameStyle.Short:
- case WebInspector.SourceCodeLocation.NameStyle.Full:
- var lineSuffix = sourceCode.url ? ":" + lineString : WebInspector.UIString(" (line %s)").format(lineString);
- return prefix + (nameStyle === WebInspector.SourceCodeLocation.NameStyle.Full && sourceCode.url ? sourceCode.url : sourceCode.displayName) + lineSuffix;
-
- default:
- console.error("Unknown nameStyle: " + nameStyle);
- return prefix + lineString;
- }
- },
-
- _resetMappedLocation: function()
- {
- this._mappedLocationIsResolved = false;
- this._mappedResource = null;
- this._mappedLineNumber = NaN;
- this._mappedColumnNumber = NaN;
- },
-
- _setMappedLocation: function(mappedResource, mappedLineNumber, mappedColumnNumber)
- {
- // Called by SourceMapResource when it creates a SourceCodeLocation and already knows the resolved location.
- this._mappedLocationIsResolved = true;
- this._mappedResource = mappedResource;
- this._mappedLineNumber = mappedLineNumber;
- this._mappedColumnNumber = mappedColumnNumber;
- },
-
- _resolveMappedLocation: function()
- {
- if (this._mappedLocationIsResolved)
- return;
-
- console.assert(this._mappedResource === null);
- console.assert(isNaN(this._mappedLineNumber));
- console.assert(isNaN(this._mappedColumnNumber));
-
- this._mappedLocationIsResolved = true;
-
- if (!this._sourceCode)
- return;
-
- var sourceMaps = this._sourceCode.sourceMaps;
- if (!sourceMaps.length)
- return;
-
- for (var i = 0; i < sourceMaps.length; ++i) {
- var sourceMap = sourceMaps[i];
- var entry = sourceMap.findEntry(this._lineNumber, this._columnNumber);
- if (!entry || entry.length === 2)
- continue;
- console.assert(entry.length === 5);
- var url = entry[2];
- var sourceMapResource = sourceMap.resourceForURL(url);
- if (!sourceMapResource)
- return;
- this._mappedResource = sourceMapResource;
- this._mappedLineNumber = entry[3];
- this._mappedColumnNumber = entry[4];
- return;
- }
- },
-
- _resolveFormattedLocation: function()
- {
- if (this._sourceCode && this._sourceCode.formatterSourceMap) {
- var formattedLocation = this._sourceCode.formatterSourceMap.originalToFormatted(this._lineNumber, this._columnNumber);
- this._formattedLineNumber = formattedLocation.lineNumber;
- this._formattedColumnNumber = formattedLocation.columnNumber;
- } else {
- this._formattedLineNumber = this._lineNumber;
- this._formattedColumnNumber = this._columnNumber;
- }
- },
-
- _makeChangeAndDispatchChangeEventIfNeeded: function(changeFunction)
- {
- var oldSourceCode = this._sourceCode;
- var oldLineNumber = this._lineNumber;
- var oldColumnNumber = this._columnNumber;
-
- var oldFormattedLineNumber = this._formattedLineNumber;
- var oldFormattedColumnNumber = this._formattedColumnNumber;
-
- var oldDisplaySourceCode = this.displaySourceCode;
- var oldDisplayLineNumber = this.displayLineNumber;
- var oldDisplayColumnNumber = this.displayColumnNumber;
-
- this._resetMappedLocation();
-
- if (changeFunction)
- changeFunction.call(this);
-
- this._resolveMappedLocation();
- this._resolveFormattedLocation();
-
- // If the display source code is non-null then the addresses are not NaN and can be compared.
- var displayLocationChanged = false;
- var newDisplaySourceCode = this.displaySourceCode;
- if (oldDisplaySourceCode !== newDisplaySourceCode)
- displayLocationChanged = true;
- else if (newDisplaySourceCode && (oldDisplayLineNumber !== this.displayLineNumber || oldDisplayColumnNumber !== this.displayColumnNumber))
- displayLocationChanged = true;
-
- var anyLocationChanged = false;
- if (displayLocationChanged)
- anyLocationChanged = true;
- else if (oldSourceCode !== this._sourceCode)
- anyLocationChanged = true;
- else if (this._sourceCode && (oldLineNumber !== this._lineNumber || oldColumnNumber !== this._columnNumber))
- anyLocationChanged = true;
- else if (this._sourceCode && (oldFormattedLineNumber !== this._formattedLineNumber || oldFormattedColumnNumber !== this._formattedColumnNumber))
- anyLocationChanged = true;
-
- if (displayLocationChanged || anyLocationChanged) {
- var oldData = {
- oldSourceCode: oldSourceCode,
- oldLineNumber: oldLineNumber,
- oldColumnNumber: oldColumnNumber,
- oldFormattedLineNumber: oldFormattedLineNumber,
- oldFormattedColumnNumber: oldFormattedColumnNumber,
- oldDisplaySourceCode: oldDisplaySourceCode,
- oldDisplayLineNumber: oldDisplayLineNumber,
- oldDisplayColumnNumber: oldDisplayColumnNumber
- };
- if (displayLocationChanged)
- this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.DisplayLocationChanged, oldData);
- if (anyLocationChanged)
- this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.LocationChanged, oldData);
- }
- },
-
- _sourceCodeSourceMapAdded: function()
- {
- this._makeChangeAndDispatchChangeEventIfNeeded(null);
- },
-
- _sourceCodeFormatterDidChange: function()
- {
- this._makeChangeAndDispatchChangeEventIfNeeded(null);
- }
-};
-
-WebInspector.SourceCodeLocation.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodePositionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodePosition.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodePosition.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodePosition.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodePosition = function(lineNumber, columNumber)
-{
- WebInspector.Object.call(this);
-
- this._lineNumber = lineNumber || 0;
- this._columnNumber = columNumber || 0;
-}
-
-WebInspector.SourceCodePosition.prototype = {
- constructor: WebInspector.SourceCodePosition,
-
- // Public
-
- get lineNumber()
- {
- return this._lineNumber;
- },
-
- get columnNumber()
- {
- return this._columnNumber;
- }
-};
-
-WebInspector.SourceCodePosition.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeRevisionjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeRevision.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeRevision.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeRevision.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeRevision = function(sourceCode, content, contentIsBase64Encoded)
-{
- WebInspector.Revision.call(this);
-
- console.assert(sourceCode instanceof WebInspector.SourceCode);
-
- this._sourceCode = sourceCode;
- this._content = content || "";
- this._contentIsBase64Encoded = contentIsBase64Encoded || false;
-};
-
-WebInspector.SourceCodeRevision.prototype = {
- constructor: WebInspector.SourceCodeRevision,
-
- // Public
-
- get sourceCode()
- {
- return this._sourceCode;
- },
-
- get content()
- {
- return this._content;
- },
-
- set content(content)
- {
- content = content || "";
-
- if (this._content === content)
- return;
-
- this._content = content;
-
- this._sourceCode.revisionContentDidChange(this);
- },
-
- get contentIsBase64Encoded()
- {
- return this._contentIsBase64Encoded;
- },
-
- set contentIsBase64Encoded(encoded)
- {
- this._contentIsBase64Encoded = encoded || false;
- },
-
- apply: function()
- {
- this._sourceCode.currentRevision = this;
- },
-
- revert: function()
- {
- this._sourceCode.currentRevision = this._sourceCode.originalRevision;
- },
-
- copy: function()
- {
- return new WebInspector.SourceCodeRevision(this._sourceCode, this._content, this._contentIsBase64Encoded);
- }
-};
-
-WebInspector.SourceCodeRevision.prototype.__proto__ = WebInspector.Revision.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.source-code.text-editor > .CodeMirror .error {
- background-color: rgb(255, 220, 208);
-}
-
-.source-code.text-editor > .CodeMirror .warning {
- background-color: rgb(253, 249, 226);
-}
-
-.popover .debugger-popover-content {
- font-family: monospace;
- white-space: pre;
-}
-
-.popover .expandable {
- min-width: 300px;
- min-height: 250px;
-}
-
-.popover .debugger-popover-content .title {
- font-weight: bold;
- padding-left: 10px;
-
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.popover .debugger-popover-content .body {
- border-top: 1px solid rgb(194, 194, 147);
- overflow: auto;
- margin-top: 5px;
- padding-top: 5px;
-}
-
-.popover .debugger-popover-content.function .body {
- padding-left: 10px;
- padding-right: 10px;
-}
-
-/* Custom styling for the hover menu attached to color tokens */
-
-.hover-menu.color {
- padding-right: 15px;
-}
-
-.hover-menu.color > img {
- width: 16px;
- height: 16px;
- content: -webkit-image-set(url(Images/ColorIcon.png) 1x, url(Images/ColorIcon@2x.png) 2x);
-
- -webkit-transform: translateY(1px);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1359 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTextEditor = function(sourceCode)
-{
- console.assert(sourceCode instanceof WebInspector.SourceCode);
-
- this._sourceCode = sourceCode;
- this._breakpointMap = {};
- this._issuesLineNumberMap = {};
- this._contentPopulated = false;
- this._invalidLineNumbers = {0: true};
- this._ignoreContentDidChange = 0;
-
- WebInspector.TextEditor.call(this, null, null, this);
-
- // FIXME: Currently this just jumps between resources and related source map resources. It doesn't "jump to symbol" yet.
- this._updateTokenTrackingControllerState();
-
- this.element.classList.add(WebInspector.SourceCodeTextEditor.StyleClassName);
-
- if (this._supportsDebugging) {
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this);
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this);
-
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
- if (WebInspector.debuggerManager.activeCallFrame)
- this._debuggerDidPause();
-
- this._activeCallFrameDidChange();
- }
-
- WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
-
- if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0)
- WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
- else
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
-
- sourceCode.requestContent(this._contentAvailable.bind(this));
-
- // FIXME: Cmd+L shorcut doesn't actually work.
- new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command, "L", this.showGoToLineDialog.bind(this), this.element);
- new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "G", this.showGoToLineDialog.bind(this), this.element);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.SourceCodeTextEditor);
-
-WebInspector.SourceCodeTextEditor.StyleClassName = "source-code";
-WebInspector.SourceCodeTextEditor.LineErrorStyleClassName = "error";
-WebInspector.SourceCodeTextEditor.LineWarningStyleClassName = "warning";
-WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName = "debugger-popover-content";
-WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName = "hovered-expression-highlight";
-WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken = 500;
-WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease = 1000;
-
-WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength = 500;
-
-WebInspector.SourceCodeTextEditor.Event = {
- ContentWillPopulate: "source-code-text-editor-content-will-populate",
- ContentDidPopulate: "source-code-text-editor-content-did-populate"
-};
-
-WebInspector.SourceCodeTextEditor.prototype = {
- constructor: WebInspector.SourceCodeTextEditor,
-
- // Public
-
- get sourceCode()
- {
- return this._sourceCode;
- },
-
- hidden: function()
- {
- WebInspector.TextEditor.prototype.hidden.call(this);
-
- this.tokenTrackingController.removeHighlightedRange();
-
- this._dismissPopover();
-
- this._dismissEditingController(true);
- },
-
- close: function()
- {
- if (this._supportsDebugging) {
- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateBreakpointStatus, this);
- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this);
-
- WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
- WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this);
-
- if (this._activeCallFrameSourceCodeLocation) {
- this._activeCallFrameSourceCodeLocation.removeEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
- delete this._activeCallFrameSourceCodeLocation;
- }
- }
-
- WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
-
- WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
- this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
- },
-
- canBeFormatted: function()
- {
- // Currently we assume that source map resources are formatted how the author wants it.
- // We could allow source map resources to be formatted, we would then need to make
- // SourceCodeLocation watch listen for mappedResource's formatting changes, and keep
- // a formatted location alongside the regular mapped location.
- if (this._sourceCode instanceof WebInspector.SourceMapResource)
- return false;
-
- return WebInspector.TextEditor.prototype.canBeFormatted.call(this);
- },
-
- customPerformSearch: function(query)
- {
- function searchResultCallback(error, matches)
- {
- // Bail if the query changed since we started.
- if (this.currentSearchQuery !== query)
- return;
-
- if (error || !matches || !matches.length) {
- // Report zero matches.
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
- return;
- }
-
- var queryRegex = new RegExp(query.escapeForRegExp(), "gi");
- var searchResults = [];
-
- for (var i = 0; i < matches.length; ++i) {
- var matchLineNumber = matches[i].lineNumber;
- var line = this.line(matchLineNumber);
-
- // Reset the last index to reuse the regex on a new line.
- queryRegex.lastIndex = 0;
-
- // Search the line and mark the ranges.
- var lineMatch = null;
- while (queryRegex.lastIndex + query.length <= line.length && (lineMatch = queryRegex.exec(line))) {
- var resultTextRange = new WebInspector.TextRange(matchLineNumber, lineMatch.index, matchLineNumber, queryRegex.lastIndex);
- searchResults.push(resultTextRange);
- }
- }
-
- this.addSearchResults(searchResults);
-
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
- }
-
- if (this._sourceCode instanceof WebInspector.SourceMapResource)
- return false;
-
- if (this._sourceCode instanceof WebInspector.Resource)
- PageAgent.searchInResource(this._sourceCode.parentFrame.id, this._sourceCode.url, query, false, false, searchResultCallback.bind(this));
- else if (this._sourceCode instanceof WebInspector.Script)
- DebuggerAgent.searchInContent(this._sourceCode.id, query, false, false, searchResultCallback.bind(this));
- return true;
- },
-
- showGoToLineDialog: function()
- {
- if (!this._goToLineDialog) {
- this._goToLineDialog = new WebInspector.GoToLineDialog;
- this._goToLineDialog.delegate = this;
- }
-
- this._goToLineDialog.present(this.element);
- },
-
- isGoToLineDialogValueValid: function(goToLineDialog, lineNumber)
- {
- return !isNaN(lineNumber) && lineNumber > 0 && lineNumber <= this.lineCount;
- },
-
- goToLineDialogValueWasValidated: function(goToLineDialog, lineNumber)
- {
- var position = new WebInspector.SourceCodePosition(lineNumber - 1, 0);
- var range = new WebInspector.TextRange(lineNumber - 1, 0, lineNumber, 0);
- this.revealPosition(position, range, false, true);
- },
-
- goToLineDialogWasDismissed: function()
- {
- this.focus();
- },
-
- contentDidChange: function(replacedRanges, newRanges)
- {
- WebInspector.TextEditor.prototype.contentDidChange.call(this, replacedRanges, newRanges);
-
- if (this._ignoreContentDidChange > 0)
- return;
-
- for (var range of newRanges)
- this._updateEditableMarkers(range);
- },
-
- // Private
-
- _unformattedLineInfoForEditorLineInfo: function(lineInfo)
- {
- if (this.formatterSourceMap)
- return this.formatterSourceMap.formattedToOriginal(lineInfo.lineNumber, lineInfo.columnNumber);
- return lineInfo;
- },
-
- _sourceCodeLocationForEditorPosition: function(position)
- {
- var lineInfo = {lineNumber: position.line, columnNumber: position.ch};
- var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(lineInfo);
- return this.sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
- },
-
- _editorLineInfoForSourceCodeLocation: function(sourceCodeLocation)
- {
- if (this._sourceCode instanceof WebInspector.SourceMapResource)
- return {lineNumber: sourceCodeLocation.displayLineNumber, columnNumber: sourceCodeLocation.displayColumnNumber};
- return {lineNumber: sourceCodeLocation.formattedLineNumber, columnNumber: sourceCodeLocation.formattedColumnNumber};
- },
-
- _breakpointForEditorLineInfo: function(lineInfo)
- {
- if (!this._breakpointMap[lineInfo.lineNumber])
- return null;
- return this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber];
- },
-
- _addBreakpointWithEditorLineInfo: function(breakpoint, lineInfo)
- {
- if (!this._breakpointMap[lineInfo.lineNumber])
- this._breakpointMap[lineInfo.lineNumber] = {};
-
- this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber] = breakpoint;
- },
-
- _removeBreakpointWithEditorLineInfo: function(breakpoint, lineInfo)
- {
- console.assert(breakpoint === this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber]);
-
- delete this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber];
-
- if (isEmptyObject(this._breakpointMap[lineInfo.lineNumber]))
- delete this._breakpointMap[lineInfo.lineNumber];
- },
-
- _contentWillPopulate: function(content)
- {
- this.dispatchEventToListeners(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate);
-
- // We only do the rest of this work before the first populate.
- if (this._contentPopulated)
- return;
-
- if (this._supportsDebugging) {
- this._breakpointMap = {};
-
- var breakpoints = WebInspector.debuggerManager.breakpointsForSourceCode(this._sourceCode);
- for (var i = 0; i < breakpoints.length; ++i) {
- var breakpoint = breakpoints[i];
- console.assert(this._matchesBreakpoint(breakpoint));
- var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
- this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
- }
- }
-
- if (this._sourceCode instanceof WebInspector.Resource)
- this.mimeType = this._sourceCode.syntheticMIMEType;
- else if (this._sourceCode instanceof WebInspector.Script)
- this.mimeType = "text/javascript";
-
- // Automatically format the content if it looks minified and it can be formatted.
- console.assert(!this.formatted);
- if (this.canBeFormatted()) {
- var lastNewlineIndex = 0;
- while (true) {
- var nextNewlineIndex = content.indexOf("\n", lastNewlineIndex);
- if (nextNewlineIndex === -1) {
- if (content.length - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength)
- this.autoFormat = true;
- break;
- }
-
- if (nextNewlineIndex - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength) {
- this.autoFormat = true;
- break;
- }
-
- lastNewlineIndex = nextNewlineIndex + 1;
- }
- }
- },
-
- _contentDidPopulate: function()
- {
- this._contentPopulated = true;
-
- this.dispatchEventToListeners(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate);
-
- // We add the issues each time content is populated. This is needed because lines might not exist
- // if we tried added them before when the full content wasn't avaiable. (When populating with
- // partial script content this can be called multiple times.)
-
- this._issuesLineNumberMap = {};
-
- var issues = WebInspector.issueManager.issuesForSourceCode(this._sourceCode);
- for (var i = 0; i < issues.length; ++i) {
- var issue = issues[i];
- console.assert(this._matchesIssue(issue));
- this._addIssue(issue);
- }
-
- this._updateEditableMarkers();
- },
-
- _populateWithContent: function(content)
- {
- content = content || "";
-
- this._contentWillPopulate(content);
- this.string = content;
- this._contentDidPopulate();
- },
-
- _contentAvailable: function(sourceCode, content, base64Encoded)
- {
- console.assert(sourceCode === this._sourceCode);
- console.assert(!base64Encoded);
-
- // Abort if the full content populated while waiting for this async callback.
- if (this._fullContentPopulated)
- return;
-
- this._fullContentPopulated = true;
- this._invalidLineNumbers = {};
-
- this._populateWithContent(content);
- },
-
- _updateBreakpointStatus: function(event)
- {
- console.assert(this._supportsDebugging);
-
- if (!this._contentPopulated)
- return;
-
- var breakpoint = event.target;
- if (!this._matchesBreakpoint(breakpoint))
- return;
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
- },
-
- _updateBreakpointLocation: function(event)
- {
- console.assert(this._supportsDebugging);
-
- if (!this._contentPopulated)
- return;
-
- var breakpoint = event.target;
- if (!this._matchesBreakpoint(breakpoint))
- return;
-
- if (this._ignoreAllBreakpointLocationUpdates)
- return;
-
- if (breakpoint === this._ignoreLocationUpdateBreakpoint)
- return;
-
- var sourceCodeLocation = breakpoint.sourceCodeLocation;
-
- if (this._sourceCode instanceof WebInspector.SourceMapResource) {
- // Update our breakpoint location if the display location changed.
- if (sourceCodeLocation.displaySourceCode !== this._sourceCode)
- return;
- var oldLineInfo = {lineNumber: event.data.oldDisplayLineNumber, columnNumber: event.data.oldDisplayColumnNumber};
- var newLineInfo = {lineNumber: sourceCodeLocation.displayLineNumber, columnNumber: sourceCodeLocation.displayColumnNumber};
- } else {
- // Update our breakpoint location if the original location changed.
- if (sourceCodeLocation.sourceCode !== this._sourceCode)
- return;
- var oldLineInfo = {lineNumber: event.data.oldFormattedLineNumber, columnNumber: event.data.oldFormattedColumnNumber};
- var newLineInfo = {lineNumber: sourceCodeLocation.formattedLineNumber, columnNumber: sourceCodeLocation.formattedColumnNumber};
- }
-
- var existingBreakpoint = this._breakpointForEditorLineInfo(oldLineInfo);
- if (!existingBreakpoint)
- return;
-
- console.assert(breakpoint === existingBreakpoint);
-
- this.setBreakpointInfoForLineAndColumn(oldLineInfo.lineNumber, oldLineInfo.columnNumber, null);
- this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
-
- this._removeBreakpointWithEditorLineInfo(breakpoint, oldLineInfo);
- this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo);
- },
-
- _breakpointAdded: function(event)
- {
- console.assert(this._supportsDebugging);
-
- if (!this._contentPopulated)
- return;
-
- var breakpoint = event.data.breakpoint;
- if (!this._matchesBreakpoint(breakpoint))
- return;
-
- if (breakpoint === this._ignoreBreakpointAddedBreakpoint)
- return;
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
- this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
- },
-
- _breakpointRemoved: function(event)
- {
- console.assert(this._supportsDebugging);
-
- if (!this._contentPopulated)
- return;
-
- var breakpoint = event.data.breakpoint;
- if (!this._matchesBreakpoint(breakpoint))
- return;
-
- if (breakpoint === this._ignoreBreakpointRemovedBreakpoint)
- return;
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._removeBreakpointWithEditorLineInfo(breakpoint, lineInfo);
- this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, null);
- },
-
- _activeCallFrameDidChange: function()
- {
- console.assert(this._supportsDebugging);
-
- if (this._activeCallFrameSourceCodeLocation) {
- this._activeCallFrameSourceCodeLocation.removeEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
- delete this._activeCallFrameSourceCodeLocation;
- }
-
- var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
- if (!activeCallFrame || !this._matchesSourceCodeLocation(activeCallFrame.sourceCodeLocation)) {
- this.executionLineNumber = NaN;
- this.executionColumnNumber = NaN;
- return;
- }
-
- this._dismissPopover();
-
- this._activeCallFrameSourceCodeLocation = activeCallFrame.sourceCodeLocation;
- this._activeCallFrameSourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
-
- // Don't return early if the line number didn't change. The execution state still
- // could have changed (e.g. continuing in a loop with a breakpoint inside).
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(activeCallFrame.sourceCodeLocation);
- this.executionLineNumber = lineInfo.lineNumber;
- this.executionColumnNumber = lineInfo.columnNumber;
-
- // If we have full content or this source code isn't a Resource we can return early.
- // Script source code populates from the request started in the constructor.
- if (this._fullContentPopulated || !(this._sourceCode instanceof WebInspector.Resource) || this._requestingScriptContent)
- return;
-
- // Since we are paused in the debugger we need to show some content, and since the Resource
- // content hasn't populated yet we need to populate with content from the Scripts by URL.
- // Document resources will attempt to populate the scripts as inline (in <script> tags.)
- // Other resources are assumed to be full scripts (JavaScript resources).
- if (this._sourceCode.type === WebInspector.Resource.Type.Document)
- this._populateWithInlineScriptContent();
- else
- this._populateWithScriptContent();
- },
-
- _activeCallFrameSourceCodeLocationChanged: function(event)
- {
- console.assert(!isNaN(this.executionLineNumber));
- if (isNaN(this.executionLineNumber))
- return;
-
- console.assert(WebInspector.debuggerManager.activeCallFrame);
- console.assert(this._activeCallFrameSourceCodeLocation === WebInspector.debuggerManager.activeCallFrame.sourceCodeLocation);
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(this._activeCallFrameSourceCodeLocation);
- this.executionLineNumber = lineInfo.lineNumber;
- this.executionColumnNumber = lineInfo.columnNumber;
- },
-
- _populateWithInlineScriptContent: function()
- {
- console.assert(this._sourceCode instanceof WebInspector.Resource);
- console.assert(!this._fullContentPopulated);
- console.assert(!this._requestingScriptContent);
-
- var scripts = this._sourceCode.scripts;
- console.assert(scripts.length);
- if (!scripts.length)
- return;
-
- var pendingRequestCount = scripts.length;
-
- // If the number of scripts hasn't change since the last populate, then there is nothing to do.
- if (this._inlineScriptContentPopulated === pendingRequestCount)
- return;
-
- this._inlineScriptContentPopulated = pendingRequestCount;
-
- function scriptContentAvailable(error, content)
- {
- // Return early if we are still waiting for content from other scripts.
- if (--pendingRequestCount)
- return;
-
- delete this._requestingScriptContent;
-
- // Abort if the full content populated while waiting for these async callbacks.
- if (this._fullContentPopulated)
- return;
-
- const scriptOpenTag = "<script>";
- const scriptCloseTag = "</script>";
-
- var content = "";
- var lineNumber = 0;
- var columnNumber = 0;
-
- this._invalidLineNumbers = {};
-
- for (var i = 0; i < scripts.length; ++i) {
- // Fill the line gap with newline characters.
- for (var newLinesCount = scripts[i].range.startLine - lineNumber; newLinesCount > 0; --newLinesCount) {
- if (!columnNumber)
- this._invalidLineNumbers[scripts[i].range.startLine - newLinesCount] = true;
- columnNumber = 0;
- content += "\n";
- }
-
- // Fill the column gap with space characters.
- for (var spacesCount = scripts[i].range.startColumn - columnNumber - scriptOpenTag.length; spacesCount > 0; --spacesCount)
- content += " ";
-
- // Add script tags and content.
- content += scriptOpenTag;
- content += scripts[i].content;
- content += scriptCloseTag;
-
- lineNumber = scripts[i].range.endLine;
- columnNumber = scripts[i].range.endColumn + scriptCloseTag.length;
- }
-
- this._populateWithContent(content);
- }
-
- this._requestingScriptContent = true;
-
- var boundScriptContentAvailable = scriptContentAvailable.bind(this);
- for (var i = 0; i < scripts.length; ++i)
- scripts[i].requestContent(boundScriptContentAvailable);
- },
-
- _populateWithScriptContent: function()
- {
- console.assert(this._sourceCode instanceof WebInspector.Resource);
- console.assert(!this._fullContentPopulated);
- console.assert(!this._requestingScriptContent);
-
- // We can assume this resource only has one script that starts at line/column 0.
- var scripts = this._sourceCode.scripts;
- console.assert(scripts.length === 1);
- if (!scripts.length)
- return;
-
- console.assert(scripts[0].range.startLine === 0);
- console.assert(scripts[0].range.startColumn === 0);
-
- function scriptContentAvailable(error, content)
- {
- delete this._requestingScriptContent;
-
- // Abort if the full content populated while waiting for this async callback.
- if (this._fullContentPopulated)
- return;
-
- // This is the full content.
- this._fullContentPopulated = true;
-
- this._populateWithContent(content);
- }
-
- this._requestingScriptContent = true;
-
- scripts[0].requestContent(scriptContentAvailable.bind(this));
- },
-
- _matchesSourceCodeLocation: function(sourceCodeLocation)
- {
- if (this._sourceCode instanceof WebInspector.SourceMapResource)
- return sourceCodeLocation.displaySourceCode === this._sourceCode;
- if (this._sourceCode instanceof WebInspector.Resource)
- return sourceCodeLocation.sourceCode.url === this._sourceCode.url;
- if (this._sourceCode instanceof WebInspector.Script)
- return sourceCodeLocation.sourceCode === this._sourceCode;
- return false;
- },
-
- _matchesBreakpoint: function(breakpoint)
- {
- console.assert(this._supportsDebugging);
- if (this._sourceCode instanceof WebInspector.SourceMapResource)
- return breakpoint.sourceCodeLocation.displaySourceCode === this._sourceCode;
- if (this._sourceCode instanceof WebInspector.Resource)
- return breakpoint.url === this._sourceCode.url;
- if (this._sourceCode instanceof WebInspector.Script)
- return breakpoint.url === this._sourceCode.url || breakpoint.scriptIdentifier === this._sourceCode.id;
- return false;
- },
-
- _matchesIssue: function(issue)
- {
- if (this._sourceCode instanceof WebInspector.Resource)
- return issue.url === this._sourceCode.url;
- // FIXME: Support issues for Scripts based on id, not only by URL.
- if (this._sourceCode instanceof WebInspector.Script)
- return issue.url === this._sourceCode.url;
- return false;
- },
-
- _issueWasAdded: function(event)
- {
- var issue = event.data.issue;
- if (!this._matchesIssue(issue))
- return;
-
- this._addIssue(issue);
- },
-
- _addIssue: function(issue)
- {
- var lineNumberIssues = this._issuesLineNumberMap[issue.lineNumber];
- if (!lineNumberIssues)
- lineNumberIssues = this._issuesLineNumberMap[issue.lineNumber] = [];
-
- lineNumberIssues.push(issue);
-
- if (issue.level === WebInspector.IssueMessage.Level.Error)
- this.addStyleClassToLine(issue.lineNumber, WebInspector.SourceCodeTextEditor.LineErrorStyleClassName);
- else if (issue.level === WebInspector.IssueMessage.Level.Warning)
- this.addStyleClassToLine(issue.lineNumber, WebInspector.SourceCodeTextEditor.LineWarningStyleClassName);
- else
- console.error("Unknown issue level");
-
- // FIXME <rdar://problem/10854857>: Show the issue message on the line as a bubble.
- },
-
- _breakpointInfoForBreakpoint: function(breakpoint)
- {
- return {resolved: breakpoint.resolved, disabled: breakpoint.disabled, autoContinue: breakpoint.autoContinue};
- },
-
- get _supportsDebugging()
- {
- if (this._sourceCode instanceof WebInspector.Resource)
- return this._sourceCode.type === WebInspector.Resource.Type.Document || this._sourceCode.type === WebInspector.Resource.Type.Script;
- if (this._sourceCode instanceof WebInspector.Script)
- return true;
- return false;
- },
-
- // TextEditor Delegate
-
- textEditorBaseURL: function(textEditor)
- {
- return this._sourceCode.url;
- },
-
- textEditorShouldHideLineNumber: function(textEditor, lineNumber)
- {
- return lineNumber in this._invalidLineNumbers;
- },
-
- textEditorGutterContextMenu: function(textEditor, lineNumber, columnNumber, editorBreakpoints, event)
- {
- if (!this._supportsDebugging)
- return;
-
- event.preventDefault();
-
- var contextMenu = new WebInspector.ContextMenu(event);
-
- // Paused. Add Continue to Here option only if we have a script identifier for the location.
- if (WebInspector.debuggerManager.paused) {
- var editorLineInfo = {lineNumber:lineNumber, columnNumber:columnNumber};
- var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(editorLineInfo);
- var sourceCodeLocation = this._sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
-
- if (sourceCodeLocation.sourceCode instanceof WebInspector.Script)
- var script = sourceCodeLocation.sourceCode;
- else if (sourceCodeLocation.sourceCode instanceof WebInspector.Resource)
- var script = sourceCodeLocation.sourceCode.scriptForLocation(sourceCodeLocation);
-
- if (script) {
- function continueToLocation()
- {
- WebInspector.debuggerManager.continueToLocation(script.id, sourceCodeLocation.lineNumber, sourceCodeLocation.columnNumber);
- }
-
- contextMenu.appendItem(WebInspector.UIString("Continue to Here"), continueToLocation);
- contextMenu.appendSeparator();
- }
- }
-
- var breakpoints = [];
- for (var i = 0; i < editorBreakpoints.length; ++i) {
- var lineInfo = editorBreakpoints[i];
- var breakpoint = this._breakpointForEditorLineInfo(lineInfo);
- console.assert(breakpoint);
- if (breakpoint)
- breakpoints.push(breakpoint);
- }
-
- // No breakpoints.
- if (!breakpoints.length) {
- function addBreakpoint()
- {
- var data = this.textEditorBreakpointAdded(this, lineNumber, columnNumber);
- this.setBreakpointInfoForLineAndColumn(data.lineNumber, data.columnNumber, data.breakpointInfo);
- }
-
- contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), addBreakpoint.bind(this));
- contextMenu.show();
- return;
- }
-
- // Single breakpoint.
- if (breakpoints.length === 1) {
- var breakpoint = breakpoints[0];
- function revealInSidebar()
- {
- WebInspector.debuggerSidebarPanel.show();
- var treeElement = WebInspector.debuggerSidebarPanel.treeElementForRepresentedObject(breakpoint);
- if (treeElement)
- treeElement.revealAndSelect();
- }
-
- breakpoint.appendContextMenuItems(contextMenu, event.target);
- contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString("Reveal in Debugger Navigation Sidebar"), revealInSidebar);
- contextMenu.show();
- return;
- }
-
- // Multiple breakpoints.
- var shouldDisable = false;
- for (var i = 0; i < breakpoints.length; ++i) {
- if (!breakpoints[i].disabled) {
- shouldDisable = true;
- break;
- }
- }
-
- function removeBreakpoints()
- {
- for (var i = 0; i < breakpoints.length; ++i) {
- var breakpoint = breakpoints[i];
- if (WebInspector.debuggerManager.isBreakpointRemovable(breakpoint))
- WebInspector.debuggerManager.removeBreakpoint(breakpoint);
- }
- }
-
- function toggleBreakpoints()
- {
- for (var i = 0; i < breakpoints.length; ++i)
- breakpoints[i].disabled = shouldDisable;
- }
-
- if (shouldDisable)
- contextMenu.appendItem(WebInspector.UIString("Disable Breakpoints"), toggleBreakpoints.bind(this));
- else
- contextMenu.appendItem(WebInspector.UIString("Enable Breakpoints"), toggleBreakpoints.bind(this));
- contextMenu.appendItem(WebInspector.UIString("Delete Breakpoints"), removeBreakpoints.bind(this));
- contextMenu.show();
- },
-
- textEditorBreakpointAdded: function(textEditor, lineNumber, columnNumber)
- {
- if (!this._supportsDebugging)
- return null;
-
- var editorLineInfo = {lineNumber:lineNumber, columnNumber:columnNumber};
- var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(editorLineInfo);
- var sourceCodeLocation = this._sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
- var breakpoint = new WebInspector.Breakpoint(sourceCodeLocation);
-
- var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
-
- this._ignoreBreakpointAddedBreakpoint = breakpoint;
- WebInspector.debuggerManager.addBreakpoint(breakpoint);
- delete this._ignoreBreakpointAddedBreakpoint;
-
- // Return the more accurate location and breakpoint info.
- return {
- breakpointInfo: this._breakpointInfoForBreakpoint(breakpoint),
- lineNumber: lineInfo.lineNumber,
- columnNumber: lineInfo.columnNumber
- };
- },
-
- textEditorBreakpointRemoved: function(textEditor, lineNumber, columnNumber)
- {
- console.assert(this._supportsDebugging);
- if (!this._supportsDebugging)
- return;
-
- var lineInfo = {lineNumber: lineNumber, columnNumber: columnNumber};
- var breakpoint = this._breakpointForEditorLineInfo(lineInfo);
- console.assert(breakpoint);
- if (!breakpoint)
- return;
-
- this._removeBreakpointWithEditorLineInfo(breakpoint, lineInfo);
-
- this._ignoreBreakpointRemovedBreakpoint = breakpoint;
- WebInspector.debuggerManager.removeBreakpoint(breakpoint);
- delete this._ignoreBreakpointAddedBreakpoint;
- },
-
- textEditorBreakpointMoved: function(textEditor, oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)
- {
- console.assert(this._supportsDebugging);
- if (!this._supportsDebugging)
- return;
-
- var oldLineInfo = {lineNumber: oldLineNumber, columnNumber: oldColumnNumber};
- var breakpoint = this._breakpointForEditorLineInfo(oldLineInfo);
- console.assert(breakpoint);
- if (!breakpoint)
- return;
-
- this._removeBreakpointWithEditorLineInfo(breakpoint, oldLineInfo);
-
- var newLineInfo = {lineNumber: newLineNumber, columnNumber: newColumnNumber};
- var unformattedNewLineInfo = this._unformattedLineInfoForEditorLineInfo(newLineInfo);
- this._ignoreLocationUpdateBreakpoint = breakpoint;
- breakpoint.sourceCodeLocation.update(this._sourceCode, unformattedNewLineInfo.lineNumber, unformattedNewLineInfo.columnNumber);
- delete this._ignoreLocationUpdateBreakpoint;
-
- var accurateNewLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._addBreakpointWithEditorLineInfo(breakpoint, accurateNewLineInfo);
-
- if (accurateNewLineInfo.lineNumber !== newLineInfo.lineNumber || accurateNewLineInfo.columnNumber !== newLineInfo.columnNumber)
- this.updateBreakpointLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, accurateNewLineInfo.lineNumber, accurateNewLineInfo.columnNumber);
- },
-
- textEditorBreakpointClicked: function(textEditor, lineNumber, columnNumber)
- {
- console.assert(this._supportsDebugging);
- if (!this._supportsDebugging)
- return;
-
- var breakpoint = this._breakpointForEditorLineInfo({lineNumber: lineNumber, columnNumber: columnNumber});
- console.assert(breakpoint);
- if (!breakpoint)
- return;
-
- breakpoint.cycleToNextMode();
- },
-
- textEditorUpdatedFormatting: function(textEditor)
- {
- this._ignoreAllBreakpointLocationUpdates = true;
- this._sourceCode.formatterSourceMap = this.formatterSourceMap;
- delete this._ignoreAllBreakpointLocationUpdates;
-
- // Always put the source map on both the Script and Resource if both exist. For example,
- // if this SourceCode is a Resource, then there might also be a Script. In the debugger,
- // the backend identifies call frames with Script line and column information, and the
- // Script needs the formatter source map to produce the proper display line and column.
- if (this._sourceCode instanceof WebInspector.Resource && !(this._sourceCode instanceof WebInspector.SourceMapResource)) {
- var scripts = this._sourceCode.scripts;
- for (var i = 0; i < scripts.length; ++i)
- scripts[i].formatterSourceMap = this.formatterSourceMap;
- } else if (this._sourceCode instanceof WebInspector.Script) {
- if (this._sourceCode.resource)
- this._sourceCode.resource.formatterSourceMap = this.formatterSourceMap;
- }
-
- // Some breakpoints may have moved, some might not have. Just go through
- // and remove and reinsert all the breakpoints.
-
- var oldBreakpointMap = this._breakpointMap;
- this._breakpointMap = {};
-
- for (var lineNumber in oldBreakpointMap) {
- for (var columnNumber in oldBreakpointMap[lineNumber]) {
- var breakpoint = oldBreakpointMap[lineNumber][columnNumber];
- var newLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
- this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo);
- this.setBreakpointInfoForLineAndColumn(lineNumber, columnNumber, null);
- this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
- }
- }
- },
-
- _debuggerDidPause: function(event)
- {
- this._updateTokenTrackingControllerState();
- },
-
- _debuggerDidResume: function(event)
- {
- this._updateTokenTrackingControllerState();
- this._dismissPopover();
- },
-
- _sourceCodeSourceMapAdded: function(event)
- {
- WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
- this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
-
- this._updateTokenTrackingControllerState();
- },
-
- _updateTokenTrackingControllerState: function()
- {
- var mode = WebInspector.CodeMirrorTokenTrackingController.Mode.None;
- if (WebInspector.debuggerManager.paused)
- mode = WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression;
- else if (this._hasColorMarkers())
- mode = WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens;
- else if ((this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length !== 0) && WebInspector.modifierKeys.metaKey && !WebInspector.modifierKeys.altKey && !WebInspector.modifierKeys.shiftKey)
- mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
-
- this.tokenTrackingController.enabled = mode !== WebInspector.CodeMirrorTokenTrackingController.Mode.None;
-
- if (mode === this.tokenTrackingController.mode)
- return;
-
- switch (mode) {
- case WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens:
- this.tokenTrackingController.mouseOverDelayDuration = 0;
- this.tokenTrackingController.mouseOutReleaseDelayDuration = 0;
- break;
- case WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens:
- this.tokenTrackingController.mouseOverDelayDuration = 0;
- this.tokenTrackingController.mouseOutReleaseDelayDuration = 0;
- this.tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
- this._dismissPopover();
- break;
- case WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression:
- this.tokenTrackingController.mouseOverDelayDuration = WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken;
- this.tokenTrackingController.mouseOutReleaseDelayDuration = WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease;
- this.tokenTrackingController.classNameForHighlightedRange = WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName;
- break;
- }
-
- this.tokenTrackingController.mode = mode;
- },
-
- _hasColorMarkers: function()
- {
- for (var marker of this.markers) {
- if (marker.type === WebInspector.TextMarker.Type.Color)
- return true;
- }
- return false;
- },
-
- // CodeMirrorTokenTrackingController Delegate
-
- tokenTrackingControllerCanReleaseHighlightedRange: function(tokenTrackingController, element)
- {
- if (!this._popover)
- return true;
-
- if (!window.getSelection().isCollapsed && this._popover.element.contains(window.getSelection().anchorNode))
- return false;
-
- return true;
- },
-
- tokenTrackingControllerHighlightedRangeReleased: function(tokenTrackingController)
- {
- if (!this._mouseIsOverPopover)
- this._dismissPopover();
- },
-
- tokenTrackingControllerHighlightedRangeWasClicked: function(tokenTrackingController)
- {
- if (this.tokenTrackingController.mode !== WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens)
- return;
-
- // Links are handled by TextEditor.
- if (/\blink\b/.test(this.tokenTrackingController.candidate.hoveredToken.type))
- return;
-
- var sourceCodeLocation = this._sourceCodeLocationForEditorPosition(this.tokenTrackingController.candidate.hoveredTokenRange.start);
- if (this.sourceCode instanceof WebInspector.SourceMapResource)
- WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
- else
- WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
- },
-
- tokenTrackingControllerNewHighlightCandidate: function(tokenTrackingController, candidate)
- {
- if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens) {
- this.tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
- return;
- }
-
- if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression) {
- this._tokenTrackingControllerHighlightedJavaScriptExpression(candidate);
- return;
- }
-
- if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens) {
- var markers = this.markersAtPosition(candidate.hoveredTokenRange.start);
- if (markers.length > 0)
- this._tokenTrackingControllerHighlightedMarkedExpression(candidate, markers);
- else
- this._dismissEditingController();
- }
- },
-
- tokenTrackingControllerMouseOutOfHoveredMarker: function(tokenTrackingController, hoveredMarker)
- {
- this._dismissEditingController();
- },
-
- _tokenTrackingControllerHighlightedJavaScriptExpression: function(candidate)
- {
- console.assert(candidate.expression);
-
- function populate(error, result, wasThrown)
- {
- if (error || wasThrown)
- return;
-
- if (candidate !== this.tokenTrackingController.candidate)
- return;
-
- var data = WebInspector.RemoteObject.fromPayload(result);
- switch (data.type) {
- case "function":
- this._showPopoverForFunction(data);
- break;
- case "object":
- this._showPopoverForObject(data);
- break;
- case "string":
- this._showPopoverForString(data);
- break;
- case "number":
- this._showPopoverForNumber(data);
- break;
- case "boolean":
- this._showPopoverForBoolean(data);
- break;
- case "undefined":
- this._showPopoverForUndefined(data);
- break;
- }
- }
-
- DebuggerAgent.evaluateOnCallFrame.invoke({callFrameId: WebInspector.debuggerManager.activeCallFrame.id, expression: candidate.expression, objectGroup: "popover", doNotPauseOnExceptionsAndMuteConsole: true}, populate.bind(this));
- },
-
- _showPopover: function(content)
- {
- console.assert(this.tokenTrackingController.candidate);
-
- var candidate = this.tokenTrackingController.candidate;
- if (!candidate)
- return;
-
- content.classList.add(WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName);
-
- var rects = this.rectsForRange(candidate.hoveredTokenRange);
- var bounds = WebInspector.Rect.unionOfRects(rects);
-
- this._popover = this._popover || new WebInspector.Popover(this);
- this._popover.content = content;
- this._popover.present(bounds.pad(5), [WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X]);
-
- this._trackPopoverEvents();
-
- this.tokenTrackingController.highlightRange(candidate.expressionRange);
- },
-
- _showPopoverForFunction: function(data)
- {
- var candidate = this.tokenTrackingController.candidate;
-
- function didGetDetails(error, response)
- {
- if (error) {
- console.error(error);
- this._dismissPopover();
- return;
- }
-
- // Nothing to do if the token has changed since the time we
- // asked for the function details from the backend.
- if (candidate !== this.tokenTrackingController.candidate)
- return;
-
- var wrapper = document.createElement("div");
- wrapper.className = "body console-formatted-function";
- wrapper.textContent = data.description;
-
- var content = document.createElement("div");
- content.className = "function";
-
- var title = content.appendChild(document.createElement("div"));
- title.className = "title";
- title.textContent = response.name || response.inferredName || response.displayName || WebInspector.UIString("(anonymous function)");
-
- content.appendChild(wrapper);
-
- this._showPopover(content);
- }
- DebuggerAgent.getFunctionDetails(data.objectId, didGetDetails.bind(this));
- },
-
- _showPopoverForObject: function(data)
- {
- if (data.subtype === "null") {
- this._showPopoverForNull(data);
- return;
- }
-
- var content = document.createElement("div");
- content.className = "object expandable";
-
- var titleElement = document.createElement("div");
- titleElement.className = "title";
- titleElement.textContent = data.description;
- content.appendChild(titleElement);
-
- var section = new WebInspector.ObjectPropertiesSection(data);
- section.expanded = true;
- section.element.classList.add("body");
- content.appendChild(section.element);
-
- this._showPopover(content);
- },
-
- _showPopoverForString: function(data)
- {
- var content = document.createElement("div");
- content.className = "string console-formatted-string";
- content.textContent = "\"" + data.description + "\"";
-
- this._showPopover(content);
- },
-
- _showPopoverForNumber: function(data)
- {
- var content = document.createElement("span");
- content.className = "number console-formatted-number";
- content.textContent = data.description;
-
- this._showPopover(content);
- },
-
- _showPopoverForBoolean: function(data)
- {
- var content = document.createElement("span");
- content.className = "boolean console-formatted-boolean";
- content.textContent = data.description;
-
- this._showPopover(content);
- },
-
- _showPopoverForNull: function(data)
- {
- var content = document.createElement("span");
- content.className = "boolean console-formatted-null";
- content.textContent = data.description;
-
- this._showPopover(content);
- },
-
- _showPopoverForUndefined: function(data)
- {
- var content = document.createElement("span");
- content.className = "boolean console-formatted-undefined";
- content.textContent = data.description;
-
- this._showPopover(content);
- },
-
- willDismissPopover: function(popover)
- {
- this.tokenTrackingController.removeHighlightedRange();
-
- RuntimeAgent.releaseObjectGroup("popover");
- },
-
- _dismissPopover: function()
- {
- if (!this._popover)
- return;
-
- this._popover.dismiss();
-
- if (this._popoverEventHandler)
- this._popoverEventHandler.stopTrackingEvents();
- },
-
- _trackPopoverEvents: function()
- {
- if (!this._popoverEventHandler) {
- this._popoverEventHandler = new WebInspector.EventHandler(this, {
- "mouseover": this._popoverMouseover,
- "mouseout": this._popoverMouseout,
- });
- }
-
- this._popoverEventHandler.trackEvents(this._popover.element);
- },
-
- _popoverMouseover: function(event)
- {
- this._mouseIsOverPopover = true;
- },
-
- _popoverMouseout: function(event)
- {
- this._mouseIsOverPopover = this._popover.element.contains(event.relatedTarget);
- },
-
- _updateEditableMarkers: function(range)
- {
- this.createColorMarkers(range);
- this.createGradientMarkers(range);
-
- this._updateTokenTrackingControllerState();
- },
-
- _tokenTrackingControllerHighlightedMarkedExpression: function(candidate, markers)
- {
- // Look for the outermost editable marker.
- var editableMarker;
- for (var marker of markers) {
- if (!marker.range || (marker.type !== WebInspector.TextMarker.Type.Color && marker.type !== WebInspector.TextMarker.Type.Gradient))
- continue;
-
- if (!editableMarker || (marker.range.startLine < editableMarker.range.startLine || (marker.range.startLine === editableMarker.range.startLine && marker.range.startColumn < editableMarker.range.startColumn)))
- editableMarker = marker;
- }
-
- if (!editableMarker) {
- this.tokenTrackingController.hoveredMarker = null;
- return;
- }
-
- if (this.tokenTrackingController.hoveredMarker === editableMarker)
- return;
-
- this._dismissEditingController();
-
- this.tokenTrackingController.hoveredMarker = editableMarker;
-
- this._editingController = this.editingControllerForMarker(editableMarker);
-
- if (marker.type === WebInspector.TextMarker.Type.Color) {
- var color = this._editingController.value;
- if (!color || !color.valid) {
- editableMarker.clear();
- delete this._editingController;
- return;
- }
- }
-
- this._editingController.delegate = this;
- this._editingController.presentHoverMenu();
- },
-
- _dismissEditingController: function(discrete)
- {
- if (this._editingController)
- this._editingController.dismissHoverMenu(discrete);
-
- this.tokenTrackingController.hoveredMarker = null;
- delete this._editingController;
- },
-
- // CodeMirrorEditingController Delegate
-
- editingControllerDidStartEditing: function(editingController)
- {
- // We can pause the token tracking controller during editing, it will be reset
- // to the expected state by calling _updateEditableMarkers() in the
- // editingControllerDidFinishEditing delegate.
- this.tokenTrackingController.enabled = false;
-
- // We clear the marker since we'll reset it after editing.
- editingController.marker.clear();
-
- // We ignore content changes made as a result of color editing.
- this._ignoreContentDidChange++;
- },
-
- editingControllerDidFinishEditing: function(editingController)
- {
- this._updateEditableMarkers(editingController.range);
-
- this._ignoreContentDidChange--;
-
- delete this._editingController;
- }
-};
-
-WebInspector.SourceCodeTextEditor.prototype.__proto__ = WebInspector.TextEditor.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTextRangejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextRange.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextRange.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextRange.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,126 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTextRange = function(sourceCode) /* textRange || startLocation, endLocation */
-{
- WebInspector.Object.call(this);
-
- console.assert(sourceCode instanceof WebInspector.SourceCode);
- console.assert(arguments.length === 2 || arguments.length === 3);
-
- this._sourceCode = sourceCode;
-
- if (arguments.length === 2) {
- var textRange = arguments[1];
- console.assert(textRange instanceof WebInspector.TextRange);
- this._startLocation = sourceCode.createSourceCodeLocation(textRange.startLine, textRange.startColumn);
- this._endLocation = sourceCode.createSourceCodeLocation(textRange.endLine, textRange.endColumn);
- } else {
- console.assert(arguments[1] instanceof WebInspector.SourceCodeLocation);
- console.assert(arguments[2] instanceof WebInspector.SourceCodeLocation);
- this._startLocation = arguments[1];
- this._endLocation = arguments[2];
- }
-
- this._startLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationChanged, this);
- this._endLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._sourceCodeLocationChanged, this);
-};
-
-WebInspector.SourceCodeTextRange.Event = {
- RangeChanged: "source-code-text-range-range-changed"
-};
-
-WebInspector.SourceCodeTextRange.prototype = {
- constructor: WebInspector.SourceCodeTextRange,
-
- // Public
-
- get sourceCode()
- {
- return this._sourceCode;
- },
-
- // Raw text range in the original source code.
-
- get textRange()
- {
- var startLine = this._startLocation.lineNumber;
- var startColumn = this._startLocation.columnNumber;
- var endLine = this._endLocation.lineNumber;
- var endColumn = this._endLocation.columnNumber;
- return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
- },
-
- // Formatted text range in the original source code if it is pretty printed.
- // This is the same as the raw text range if the source code has no formatter.
-
- get formattedTextRange()
- {
- var startLine = this._startLocation.formattedLineNumber;
- var startColumn = this._startLocation.formattedColumnNumber;
- var endLine = this._endLocation.formattedLineNumber;
- var endColumn = this._endLocation.formattedColumnNumber;
- return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
- },
-
- // Display values:
- // - Mapped resource and text range locations if the original source code has a
- // source map and both start and end locations are in the same mapped resource.
- // - Otherwise this is the formatted / raw text range.
-
- get displaySourceCode()
- {
- if (!this._startAndEndLocationsInSameMappedResource())
- return this._sourceCode;
-
- return this._startLocation.displaySourceCode;
- },
-
- get displayTextRange()
- {
- if (!this._startAndEndLocationsInSameMappedResource())
- return this.formattedTextRange;
-
- var startLine = this._startLocation.displayLineNumber;
- var startColumn = this._startLocation.displayColumnNumber;
- var endLine = this._endLocation.displayLineNumber;
- var endColumn = this._endLocation.displayColumnNumber;
- return new WebInspector.TextRange(startLine, startColumn, endLine, endColumn);
- },
-
- // Private
-
- _startAndEndLocationsInSameMappedResource: function()
- {
- return this._startLocation.hasMappedLocation() && this._endLocation.hasMappedLocation() && this._startLocation.displaySourceCode === this._endLocation.displaySourceCode;
- },
-
- _sourceCodeLocationChanged: function(event)
- {
- this.dispatchEventToListeners(WebInspector.SourceCodeLocation.Event.RangeChanged);
- }
-};
-
-WebInspector.SourceCodeTextRange.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelinejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimeline.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimeline.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,82 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimeline = function(sourceCode, sourceCodeLocation, recordType, recordEventType)
-{
- WebInspector.Timeline.call(this);
-
- console.assert(sourceCode);
- console.assert(!sourceCodeLocation || sourceCodeLocation.sourceCode === sourceCode);
- console.assert(recordType);
-
- this._sourceCode = sourceCode;
- this._sourceCodeLocation = sourceCodeLocation || null;
- this._recordType = recordType;
- this._recordEventType = recordEventType || null;
-};
-
-WebInspector.SourceCodeTimeline.TypeIdentifier = "source-code-timeline";
-WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey = "source-code-timeline-source-code-url";
-WebInspector.SourceCodeTimeline.SourceCodeLocationLineCookieKey = "source-code-timeline-source-code-location-line";
-WebInspector.SourceCodeTimeline.SourceCodeLocationColumnCookieKey = "source-code-timeline-source-code-location-column";
-WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey = "source-code-timeline-source-code-url";
-WebInspector.SourceCodeTimeline.RecordTypeCookieKey = "source-code-timeline-record-type";
-WebInspector.SourceCodeTimeline.RecordEventTypeCookieKey = "source-code-timeline-record-event-type";
-
-WebInspector.SourceCodeTimeline.prototype = {
- constructor: WebInspector.SourceCodeTimeline,
- __proto__: WebInspector.Timeline.prototype,
-
- // Public
-
- get sourceCode()
- {
- return this._sourceCode;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- get recordType()
- {
- return this._recordType;
- },
-
- get recordEventType()
- {
- return this._recordEventType;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.SourceCodeTimeline.SourceCodeURLCookieKey] = this._sourceCode.url ? this._sourceCode.url.hash : null;
- cookie[WebInspector.SourceCodeTimeline.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
- cookie[WebInspector.SourceCodeTimeline.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
- cookie[WebInspector.SourceCodeTimeline.RecordTypeCookieKey] = this._recordType || null;
- cookie[WebInspector.SourceCodeTimeline.RecordEventTypeCookieKey] = this._recordEventType || null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTimelineDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTimelineDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTimelineDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimelineTimelineDataGridNode = function(sourceCodeTimeline, graphDataSource)
-{
- WebInspector.TimelineDataGridNode.call(this, true, graphDataSource);
-
- this._sourceCodeTimeline = sourceCodeTimeline;
- this._sourceCodeTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._timelineRecordAdded, this);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.SourceCodeTimelineTimelineDataGridNode);
-
-WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype = {
- constructor: WebInspector.SourceCodeTimelineTimelineDataGridNode,
- __proto__: WebInspector.TimelineDataGridNode.prototype,
-
- // Public
-
- get records()
- {
- return this._sourceCodeTimeline.records;
- },
-
- get sourceCodeTimeline()
- {
- return this._sourceCodeTimeline;
- },
-
- get data()
- {
- return {graph: this._sourceCodeTimeline.startTime};
- },
-
- // Private
-
- _timelineRecordAdded: function(event)
- {
- if (this.isRecordVisible(event.data.record))
- this.needsGraphRefresh();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimelineTreeElement = function(sourceCodeTimeline, subtitleNameStyle, includeTimerIdentifierInMainTitle)
-{
- console.assert(sourceCodeTimeline);
-
- this._sourceCodeTimeline = sourceCodeTimeline;
-
- subtitleNameStyle = subtitleNameStyle || WebInspector.SourceCodeLocation.NameStyle.None;
-
- WebInspector.TimelineRecordTreeElement.call(this, sourceCodeTimeline.records[0], subtitleNameStyle, includeTimerIdentifierInMainTitle, sourceCodeTimeline.sourceCodeLocation, sourceCodeTimeline);
-};
-
-WebInspector.SourceCodeTimelineTreeElement.prototype = {
- constructor: WebInspector.SourceCodeTimelineTreeElement,
- __proto__: WebInspector.TimelineRecordTreeElement.prototype,
-
- // Public
-
- record: undefined,
-
- get sourceCodeTimeline()
- {
- return this._sourceCodeTimeline;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceCodeTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceCodeTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceCodeTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceCodeTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTreeElement = function(sourceCode, classNames, title, subtitle, representedObject, hasChildren)
-{
- console.assert(sourceCode instanceof WebInspector.SourceCode);
-
- WebInspector.GeneralTreeElement.call(this, classNames, title, subtitle, representedObject || sourceCode, hasChildren);
-
- this.small = true;
-
- this._updateSourceCode(sourceCode);
-};
-
-WebInspector.SourceCodeTreeElement.prototype = {
- constructor: WebInspector.SourceCodeTreeElement,
-
- // Public
-
- updateSourceMapResources: function()
- {
- if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
- return;
-
- this.hasChildren = !!this._sourceCode.sourceMaps.length;
- this.shouldRefreshChildren = this.hasChildren;
-
- if (!this.hasChildren)
- this.removeChildren();
- },
-
- // Overrides from TreeElement
-
- onattach: function()
- {
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
- this.updateSourceMapResources();
- },
-
- onpopulate: function()
- {
- if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
- return;
-
- if (!this.hasChildren || !this.shouldRefreshChildren)
- return;
-
- this.shouldRefreshChildren = false;
-
- this.removeChildren();
-
- function combineFolderChain(topFolder, bottomFolder)
- {
- console.assert(topFolder.children.length === 1);
-
- var components = [];
-
- for (var currentFolder = bottomFolder; currentFolder !== topFolder; currentFolder = currentFolder.parent)
- components.push(currentFolder.mainTitle);
- components.push(topFolder.mainTitle);
-
- var folderName = components.reverse().join("/");
- var newFolder = new WebInspector.FolderTreeElement(folderName);
-
- var folderIndex = topFolder.parent.children.indexOf(topFolder);
- topFolder.parent.insertChild(newFolder, folderIndex);
- topFolder.parent.removeChild(topFolder);
-
- var children = bottomFolder.children;
- bottomFolder.removeChildren();
- for (var i = 0; i < children.length; ++i)
- newFolder.appendChild(children[i]);
- }
-
- function findAndCombineFolderChains(treeElement, previousSingleTreeElement)
- {
- if (!(treeElement instanceof WebInspector.FolderTreeElement)) {
- if (previousSingleTreeElement && previousSingleTreeElement !== treeElement.parent)
- combineFolderChain(previousSingleTreeElement, treeElement.parent);
- return;
- }
-
- if (previousSingleTreeElement && treeElement.children.length !== 1) {
- combineFolderChain(previousSingleTreeElement, treeElement);
- previousSingleTreeElement = null;
- }
-
- if (!previousSingleTreeElement && treeElement.children.length === 1)
- previousSingleTreeElement = treeElement;
-
- for (var i = 0; i < treeElement.children.length; ++i)
- findAndCombineFolderChains(treeElement.children[i], previousSingleTreeElement);
- }
-
- var sourceMaps = this._sourceCode.sourceMaps;
- for (var i = 0; i < sourceMaps.length; ++i) {
- var sourceMap = sourceMaps[i];
- for (var j = 0; j < sourceMap.resources.length; ++j) {
- var sourceMapResource = sourceMap.resources[j];
- var relativeSubpath = sourceMapResource.sourceMapDisplaySubpath;
- var folderTreeElement = this.createFoldersAsNeededForSubpath(relativeSubpath);
- var sourceMapTreeElement = new WebInspector.SourceMapResourceTreeElement(sourceMapResource);
- folderTreeElement.insertChild(sourceMapTreeElement, insertionIndexForObjectInListSortedByFunction(sourceMapTreeElement, folderTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements));
- }
- }
-
- for (var i = 0; i < this.children.length; ++i)
- findAndCombineFolderChains(this.children[i], null);
- },
-
- // Protected
-
- createFoldersAsNeededForSubpath: function(subpath)
- {
- if (!subpath)
- return this;
-
- var components = subpath.split("/");
- if (components.length === 1)
- return this;
-
- if (!this._subpathFolderTreeElementMap)
- this._subpathFolderTreeElementMap = {};
-
- var currentPath = "";
- var currentFolderTreeElement = this;
-
- for (var i = 0 ; i < components.length - 1; ++i) {
- var componentName = components[i];
- currentPath += (i ? "/" : "") + componentName;
-
- var cachedFolder = this._subpathFolderTreeElementMap[currentPath];
- if (cachedFolder) {
- currentFolderTreeElement = cachedFolder;
- continue;
- }
-
- var newFolder = new WebInspector.FolderTreeElement(componentName);
- newFolder.__path = currentPath;
- this._subpathFolderTreeElementMap[currentPath] = newFolder;
-
- var index = insertionIndexForObjectInListSortedByFunction(newFolder, currentFolderTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements);
- currentFolderTreeElement.insertChild(newFolder, index);
- currentFolderTreeElement = newFolder;
- }
-
- return currentFolderTreeElement;
- },
-
- descendantResourceTreeElementTypeDidChange: function(childTreeElement, oldType)
- {
- // Called by descendant SourceMapResourceTreeElements.
-
- console.assert(this.hasChildren);
-
- var wasSelected = childTreeElement.selected;
-
- var parentTreeElement = childTreeElement.parent;
- parentTreeElement.removeChild(childTreeElement, true, true);
- parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements));
-
- if (wasSelected)
- childTreeElement.revealAndSelect(true, false, true, true);
- },
-
- // Protected (ResourceTreeElement calls this when its Resource changes dynamically for Frames)
-
- _updateSourceCode: function(sourceCode)
- {
- console.assert(sourceCode instanceof WebInspector.SourceCode);
-
- if (this._sourceCode === sourceCode)
- return;
-
- if (this._sourceCode)
- this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this.updateSourceMapResources, this);
-
- this._sourceCode = sourceCode;
- this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this.updateSourceMapResources, this);
-
- this.updateSourceMapResources();
- }
-};
-
-WebInspector.SourceCodeTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceMapjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceMap.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceMap.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceMap.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,333 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-/**
- * Implements Source Map V3 model. See http://code.google.com/p/closure-compiler/wiki/SourceMaps
- * for format description.
- * @constructor
- * @param {string} sourceMappingURL
- * @param {SourceMapV3} payload
- * @param {WebInspector.Resource|WebInspector.Script} originalSourceCode
- */
-WebInspector.SourceMap = function(sourceMappingURL, payload, originalSourceCode)
-{
- if (!WebInspector.SourceMap.prototype._base64Map) {
- const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- WebInspector.SourceMap.prototype._base64Map = {};
- for (var i = 0; i < base64Digits.length; ++i)
- WebInspector.SourceMap.prototype._base64Map[base64Digits.charAt(i)] = i;
- }
-
- this._originalSourceCode = originalSourceCode || null;
- this._sourceMapResources = {};
- this._sourceMapResourcesList = [];
-
- this._sourceMappingURL = sourceMappingURL;
- this._reverseMappingsBySourceURL = {};
- this._mappings = [];
- this._sources = {};
- this._sourceRoot = null;
- this._sourceContentByURL = {};
- this._parseMappingPayload(payload);
-}
-
-WebInspector.SourceMap.prototype = {
-
- get originalSourceCode()
- {
- return this._originalSourceCode;
- },
-
- get sourceMappingBasePathURLComponents()
- {
- if (this._sourceMappingURLBasePathComponents)
- return this._sourceMappingURLBasePathComponents;
-
- if (this._sourceRoot) {
- var baseURLPath = absoluteURL(this._sourceRoot, this._sourceMappingURL);
- console.assert(baseURLPath);
- if (baseURLPath) {
- var urlComponents = parseURL(baseURLPath);
- if (!/\/$/.test(urlComponents.path))
- urlComponents.path += "/";
- this._sourceMappingURLBasePathComponents = urlComponents;
- return this._sourceMappingURLBasePathComponents;
- }
- }
-
- var urlComponents = parseURL(this._sourceMappingURL);
- urlComponents.path = urlComponents.path.substr(0, urlComponents.path.lastIndexOf(urlComponents.lastPathComponent));
- urlComponents.lastPathComponent = null;
- this._sourceMappingURLBasePathComponents = urlComponents;
- return this._sourceMappingURLBasePathComponents;
- },
-
- get resources()
- {
- return this._sourceMapResourcesList;
- },
-
- addResource: function(resource)
- {
- console.assert(!(resource.url in this._sourceMapResources));
- this._sourceMapResources[resource.url] = resource;
- this._sourceMapResourcesList.push(resource);
- },
-
- resourceForURL: function(url)
- {
- return this._sourceMapResources[url];
- },
-
- /**
- * @return {Array.<string>}
- */
- sources: function()
- {
- return Object.keys(this._sources);
- },
-
- /**
- * @param {string} sourceURL
- * @return {string|undefined}
- */
- sourceContent: function(sourceURL)
- {
- return this._sourceContentByURL[sourceURL];
- },
-
- /**
- * @param {SourceMapV3} mappingPayload
- */
- _parseMappingPayload: function(mappingPayload)
- {
- if (mappingPayload.sections)
- this._parseSections(mappingPayload.sections);
- else
- this._parseMap(mappingPayload, 0, 0);
- },
-
- /**
- * @param {Array.<SourceMapV3.Section>} sections
- */
- _parseSections: function(sections)
- {
- for (var i = 0; i < sections.length; ++i) {
- var section = sections[i];
- this._parseMap(section.map, section.offset.line, section.offset.column);
- }
- },
-
- /**
- * @param {number} lineNumber in compiled resource
- * @param {number} columnNumber in compiled resource
- * @return {?Array}
- */
- findEntry: function(lineNumber, columnNumber)
- {
- var first = 0;
- var count = this._mappings.length;
- while (count > 1) {
- var step = count >> 1;
- var middle = first + step;
- var mapping = this._mappings[middle];
- if (lineNumber < mapping[0] || (lineNumber === mapping[0] && columnNumber < mapping[1]))
- count = step;
- else {
- first = middle;
- count -= step;
- }
- }
- var entry = this._mappings[first];
- if (!first && entry && (lineNumber < entry[0] || (lineNumber === entry[0] && columnNumber < entry[1])))
- return null;
- return entry;
- },
-
- /**
- * @param {string} sourceURL of the originating resource
- * @param {number} lineNumber in the originating resource
- * @return {Array}
- */
- findEntryReversed: function(sourceURL, lineNumber)
- {
- var mappings = this._reverseMappingsBySourceURL[sourceURL];
- for ( ; lineNumber < mappings.length; ++lineNumber) {
- var mapping = mappings[lineNumber];
- if (mapping)
- return mapping;
- }
- return this._mappings[0];
- },
-
- /**
- * @param {SourceMapV3} map
- * @param {number} lineNumber
- * @param {number} columnNumber
- */
- _parseMap: function(map, lineNumber, columnNumber)
- {
- var sourceIndex = 0;
- var sourceLineNumber = 0;
- var sourceColumnNumber = 0;
- var nameIndex = 0;
-
- var sources = [];
- var originalToCanonicalURLMap = {};
- for (var i = 0; i < map.sources.length; ++i) {
- var originalSourceURL = map.sources[i];
- var href = originalSourceURL;
- if (map.sourceRoot && href.charAt(0) !== "/")
- href = map.sourceRoot.replace(/\/+$/, "") + "/" + href;
- var url = absoluteURL(href, this._sourceMappingURL) || href;
- originalToCanonicalURLMap[originalSourceURL] = url;
- sources.push(url);
- this._sources[url] = true;
-
- if (map.sourcesContent && map.sourcesContent[i])
- this._sourceContentByURL[url] = map.sourcesContent[i];
- }
-
- this._sourceRoot = map.sourceRoot || null;
-
- var stringCharIterator = new WebInspector.SourceMap.StringCharIterator(map.mappings);
- var sourceURL = sources[sourceIndex];
-
- while (true) {
- if (stringCharIterator.peek() === ",")
- stringCharIterator.next();
- else {
- while (stringCharIterator.peek() === ";") {
- lineNumber += 1;
- columnNumber = 0;
- stringCharIterator.next();
- }
- if (!stringCharIterator.hasNext())
- break;
- }
-
- columnNumber += this._decodeVLQ(stringCharIterator);
- if (this._isSeparator(stringCharIterator.peek())) {
- this._mappings.push([lineNumber, columnNumber]);
- continue;
- }
-
- var sourceIndexDelta = this._decodeVLQ(stringCharIterator);
- if (sourceIndexDelta) {
- sourceIndex += sourceIndexDelta;
- sourceURL = sources[sourceIndex];
- }
- sourceLineNumber += this._decodeVLQ(stringCharIterator);
- sourceColumnNumber += this._decodeVLQ(stringCharIterator);
- if (!this._isSeparator(stringCharIterator.peek()))
- nameIndex += this._decodeVLQ(stringCharIterator);
-
- this._mappings.push([lineNumber, columnNumber, sourceURL, sourceLineNumber, sourceColumnNumber]);
- }
-
- for (var i = 0; i < this._mappings.length; ++i) {
- var mapping = this._mappings[i];
- var url = mapping[2];
- if (!url)
- continue;
- if (!this._reverseMappingsBySourceURL[url])
- this._reverseMappingsBySourceURL[url] = [];
- var reverseMappings = this._reverseMappingsBySourceURL[url];
- var sourceLine = mapping[3];
- if (!reverseMappings[sourceLine])
- reverseMappings[sourceLine] = [mapping[0], mapping[1]];
- }
- },
-
- /**
- * @param {string} char
- * @return {boolean}
- */
- _isSeparator: function(char)
- {
- return char === "," || char === ";";
- },
-
- /**
- * @param {WebInspector.SourceMap.StringCharIterator} stringCharIterator
- * @return {number}
- */
- _decodeVLQ: function(stringCharIterator)
- {
- // Read unsigned value.
- var result = 0;
- var shift = 0;
- do {
- var digit = this._base64Map[stringCharIterator.next()];
- result += (digit & this._VLQ_BASE_MASK) << shift;
- shift += this._VLQ_BASE_SHIFT;
- } while (digit & this._VLQ_CONTINUATION_MASK);
-
- // Fix the sign.
- var negative = result & 1;
- result >>= 1;
- return negative ? -result : result;
- },
-
- _VLQ_BASE_SHIFT: 5,
- _VLQ_BASE_MASK: (1 << 5) - 1,
- _VLQ_CONTINUATION_MASK: 1 << 5
-}
-
-/**
- * @constructor
- * @param {string} string
- */
-WebInspector.SourceMap.StringCharIterator = function(string)
-{
- this._string = string;
- this._position = 0;
-}
-
-WebInspector.SourceMap.StringCharIterator.prototype = {
- /**
- * @return {string}
- */
- next: function()
- {
- return this._string.charAt(this._position++);
- },
-
- /**
- * @return {string}
- */
- peek: function()
- {
- return this._string.charAt(this._position);
- },
-
- /**
- * @return {boolean}
- */
- hasNext: function()
- {
- return this._position < this._string.length;
- }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceMapManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceMapManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceMapManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceMapManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,143 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapManager = function()
-{
- WebInspector.Object.call(this);
-
- this._sourceMapURLMap = {};
- this._downloadingSourceMaps = {};
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-};
-
-WebInspector.SourceMapManager.prototype = {
- constructor: WebInspector.SourceMapManager,
-
- // Public
-
- sourceMapForURL: function(sourceMapURL)
- {
- return this._sourceMapURLMap[sourceMapURL];
- },
-
- downloadSourceMap: function(sourceMapURL, baseURL, originalSourceCode)
- {
- sourceMapURL = absoluteURL(sourceMapURL, baseURL);
- if (!sourceMapURL)
- return;
-
- console.assert(originalSourceCode.url);
- if (!originalSourceCode.url)
- return;
-
- // FIXME: <rdar://problem/13265694> Source Maps: Better handle when multiple resources reference the same SourceMap
-
- if (sourceMapURL in this._sourceMapURLMap)
- return;
-
- if (sourceMapURL in this._downloadingSourceMaps)
- return;
-
- this._loadAndParseSourceMap(sourceMapURL, baseURL, originalSourceCode);
- },
-
- // Private
-
- _loadAndParseSourceMap: function(sourceMapURL, baseURL, originalSourceCode)
- {
- this._downloadingSourceMaps[sourceMapURL] = true;
-
- // FIXME: <rdar://problem/13238886> Source Maps: Frontend needs asynchronous resource loading of content + mime type
- var response = InspectorFrontendHost.loadResourceSynchronously(sourceMapURL);
- if (response === undefined) {
- this._loadAndParseFailed(sourceMapURL);
- return;
- }
-
- if (response.slice(0, 3) === ")]}") {
- var firstNewlineIndex = response.indexOf("\n");
- if (firstNewlineIndex === -1) {
- this._loadAndParseFailed(sourceMapURL);
- return;
- }
- response = response.substring(firstNewlineIndex);
- }
-
- try {
- var payload = JSON.parse(response);
- var baseURL = sourceMapURL.startsWith("data:") ? originalSourceCode.url : sourceMapURL;
- var sourceMap = new WebInspector.SourceMap(baseURL, payload, originalSourceCode);
- this._loadAndParseSucceeded(sourceMapURL, sourceMap);
- } catch(e) {
- console.error(e.message);
- this._loadAndParseFailed(sourceMapURL);
- }
- },
-
- _loadAndParseFailed: function(sourceMapURL)
- {
- delete this._downloadingSourceMaps[sourceMapURL];
- },
-
- _loadAndParseSucceeded: function(sourceMapURL, sourceMap)
- {
- if (!(sourceMapURL in this._downloadingSourceMaps))
- return;
-
- delete this._downloadingSourceMaps[sourceMapURL];
-
- this._sourceMapURLMap[sourceMapURL] = sourceMap;
-
- var sources = sourceMap.sources();
- for (var i = 0; i < sources.length; ++i) {
- var sourceMapResource = new WebInspector.SourceMapResource(sources[i], sourceMap);
- sourceMap.addResource(sourceMapResource);
- }
-
- // Associate the SourceMap with the originalSourceCode.
- sourceMap.originalSourceCode.addSourceMap(sourceMap);
-
- // If the originalSourceCode was not a Resource, be sure to also associate with the Resource if one exists.
- // FIXME: We should try to use the right frame instead of a global lookup by URL.
- if (!(sourceMap.originalSourceCode instanceof WebInspector.Resource)) {
- console.assert(sourceMap.originalSourceCode instanceof WebInspector.Script);
- var resource = sourceMap.originalSourceCode.resource;
- if (resource)
- resource.addSourceMap(sourceMap);
- }
- },
-
- _mainResourceDidChange: function(event)
- {
- if (!event.target.isMainFrame())
- return;
-
- this._sourceMapURLMap = {};
- this._downloadingSourceMaps = {};
- }
-};
-
-WebInspector.SourceMapManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceMapResourcejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceMapResource.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceMapResource.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceMapResource.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,153 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapResource = function(url, sourceMap)
-{
- WebInspector.Resource.call(this, url, null);
-
- console.assert(url);
- console.assert(sourceMap);
-
- this._sourceMap = sourceMap;
-};
-
-WebInspector.SourceMapResource.prototype = {
- constructor: WebInspector.SourceMapResource,
-
- // Public
-
- get sourceMap()
- {
- return this._sourceMap;
- },
-
- get sourceMapDisplaySubpath()
- {
- var sourceMappingBasePathURLComponents = this._sourceMap.sourceMappingBasePathURLComponents;
- var resourceURLComponents = this.urlComponents;
-
- // Different schemes / hosts. Return the host + path of this resource.
- if (resourceURLComponents.scheme !== sourceMappingBasePathURLComponents.scheme || resourceURLComponents.host !== sourceMappingBasePathURLComponents.host)
- return resourceURLComponents.host + (resourceURLComponents.port ? (":" + resourceURLComponents.port) : "") + resourceURLComponents.path;
-
- // Same host, but not a subpath of the base. This implies a ".." in the relative path.
- if (!resourceURLComponents.path.startsWith(sourceMappingBasePathURLComponents.path))
- return relativePath(resourceURLComponents.path, sourceMappingBasePathURLComponents.path);
-
- // Same host. Just a subpath of the base.
- return resourceURLComponents.path.substring(sourceMappingBasePathURLComponents.path.length, resourceURLComponents.length);
- },
-
- canRequestContentFromBackend: function()
- {
- return !this.finished;
- },
-
- requestContentFromBackend: function(callback)
- {
- function requestAsyncCallback(body, base64encoded, mimeType)
- {
- if (body === null) {
- this.markAsFailed();
- callback("Failed to load resource", body, base64encoded);
- return;
- }
-
- var oldType = this._type;
- var oldMIMEType = this._mimeType;
-
- this._mimeType = mimeType;
- this._type = WebInspector.Resource.Type.fromMIMEType(this._mimeType);
-
- if (oldMIMEType !== mimeType) {
- // Delete the MIME-type components so the MIME-type is re-parsed the next time it is requested.
- delete this._mimeTypeComponents;
-
- this.dispatchEventToListeners(WebInspector.Resource.Event.MIMETypeDidChange, {oldMIMEType: oldMIMEType});
- }
-
- if (oldType !== this._type)
- this.dispatchEventToListeners(WebInspector.Resource.Event.TypeDidChange, {oldType: oldType});
-
- this.markAsFinished();
-
- callback(null, body, base64encoded);
- }
-
- this._requestResourceAsynchronously(requestAsyncCallback.bind(this));
- return true;
- },
-
- createSourceCodeLocation: function(lineNumber, columnNumber)
- {
- // SourceCodeLocations are always constructed with raw resources and raw locations. Lookup the raw location.
- var entry = this._sourceMap.findEntryReversed(this.url, lineNumber);
- var rawLineNumber = entry[0];
- var rawColumnNumber = entry[1];
-
- // If the raw location is an inline script we need to include that offset.
- var originalSourceCode = this._sourceMap.originalSourceCode;
- if (originalSourceCode instanceof WebInspector.Script) {
- if (rawLineNumber === 0)
- rawColumnNumber += originalSourceCode.range.startColumn;
- rawLineNumber += originalSourceCode.range.startLine;
- }
-
- // Create the SourceCodeLocation and since we already know the the mapped location set it directly.
- var location = originalSourceCode.createSourceCodeLocation(rawLineNumber, rawColumnNumber);
- location._setMappedLocation(this, lineNumber, columnNumber);
- return location;
- },
-
- createSourceCodeTextRange: function(textRange)
- {
- // SourceCodeTextRanges are always constructed with raw resources and raw locations.
- // However, we can provide the most accurate mapped locations in construction.
- var startSourceCodeLocation = this.createSourceCodeLocation(textRange.startLine, textRange.startColumn);
- var endSourceCodeLocation = this.createSourceCodeLocation(textRange.endLine, textRange.endColumn);
- return new WebInspector.SourceCodeTextRange(this._sourceMap.originalSourceCode, startSourceCodeLocation, endSourceCodeLocation);
- },
-
- // Private
-
- _requestResourceAsynchronously: function(callback)
- {
- // FIXME: <rdar://problem/13238886> Source Maps: Frontend needs asynchronous resource loading of content + mime type
-
- function async()
- {
- var body = this._sourceMap.sourceContent(this.url) || InspectorFrontendHost.loadResourceSynchronously(this.url);
- if (body === undefined)
- body = null;
- var fileExtension = WebInspector.fileExtensionForURL(this.url);
- var mimeType = WebInspector.mimeTypeForFileExtension(fileExtension, true) || "text/javascript";
- callback(body, false, mimeType);
- }
-
- setTimeout(async.bind(this), 0);
- }
-};
-
-WebInspector.SourceMapResource.prototype.__proto__ = WebInspector.Resource.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSourceMapResourceTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SourceMapResourceTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SourceMapResourceTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SourceMapResourceTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapResourceTreeElement = function(sourceMapResource, representedObject)
-{
- console.assert(sourceMapResource instanceof WebInspector.SourceMapResource);
-
- WebInspector.ResourceTreeElement.call(this, sourceMapResource);
-
- console.assert(this.resource === sourceMapResource);
-
- this.addClassName(WebInspector.SourceMapResourceTreeElement.StyleClassName);
-};
-
-WebInspector.SourceMapResourceTreeElement.StyleClassName = "source-map-resource";
-
-WebInspector.SourceMapResourceTreeElement.prototype = {
- constructor: WebInspector.SourceMapResourceTreeElement,
-
- // Protected
-
- onattach: function()
- {
- WebInspector.ResourceTreeElement.prototype.onattach.call(this);
-
- // SourceMap resources must be loaded by the frontend, and only
- // then do they get their type information. So force a load as
- // soon as they are attached to the sidebar.
- this.resource.requestContent(function() {});
- },
-
- _updateTitles: function()
- {
- var oldMainTitle = this.mainTitle;
- this.mainTitle = this.resource.displayName;
-
- // Show the host as the subtitle if it is different from the originalSourceCode's host.
- var sourceMapHost = this.resource.urlComponents.host;
- var originalHost = this.resource.sourceMap.originalSourceCode.urlComponents.host;
- var subtitle = sourceMapHost !== originalHost ? WebInspector.displayNameForHost(sourceMapHost) : null;
- this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
-
- if (oldMainTitle !== this.mainTitle)
- this.callFirstAncestorFunction("descendantResourceTreeElementMainTitleDidChange", [this, oldMainTitle]);
- }
-};
-
-WebInspector.SourceMapResourceTreeElement.prototype.__proto__ = WebInspector.ResourceTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceStorageManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/StorageManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/StorageManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/StorageManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,308 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StorageManager = function()
-{
- WebInspector.Object.call(this);
-
- if (window.DOMStorageAgent)
- DOMStorageAgent.enable();
- if (window.DatabaseAgent)
- DatabaseAgent.enable();
- if (window.IndexedDBAgent)
- IndexedDBAgent.enable();
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
- // COMPATIBILITY (iOS 6): DOMStorage was discovered via a DOMStorageObserver event. Now DOM Storage
- // is added whenever a new securityOrigin is discovered. Check for DOMStorageAgent.getDOMStorageItems,
- // which was renamed at the same time the change to start using securityOrigin was made.
- if (window.DOMStorageAgent && DOMStorageAgent.getDOMStorageItems)
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.SecurityOriginDidChange, this._securityOriginDidChange, this);
-
- this.initialize();
-};
-
-WebInspector.StorageManager.Event = {
- CookieStorageObjectWasAdded: "storage-manager-cookie-storage-object-was-added",
- DOMStorageObjectWasAdded: "storage-manager-dom-storage-object-was-added",
- DOMStorageObjectWasInspected: "storage-dom-object-was-inspected",
- DatabaseWasAdded: "storage-manager-database-was-added",
- DatabaseWasInspected: "storage-object-was-inspected",
- IndexedDatabaseWasAdded: "storage-manager-indexed-database-was-added",
- Cleared: "storage-manager-cleared"
-};
-
-WebInspector.StorageManager.prototype = {
- constructor: WebInspector.StorageManager,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- initialize: function()
- {
- this._domStorageObjects = [];
- this._databaseObjects = [];
- this._indexedDatabases = [];
- this._cookieStorageObjects = {};
- },
-
- domStorageWasAdded: function(id, host, isLocalStorage)
- {
- var domStorage = new WebInspector.DOMStorageObject(id, host, isLocalStorage);
-
- this._domStorageObjects.push(domStorage);
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, {domStorage: domStorage});
- },
-
- databaseWasAdded: function(id, host, name, version)
- {
- var database = new WebInspector.DatabaseObject(id, host, name, version);
-
- this._databaseObjects.push(database);
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.DatabaseWasAdded, {database: database});
- },
-
- domStorageWasUpdated: function(id)
- {
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageWasUpdated, id);
- },
-
- itemsCleared: function(storageId)
- {
- this._domStorageForIdentifier(storageId).itemsCleared(storageId);
- },
-
- itemRemoved: function(storageId, key)
- {
- this._domStorageForIdentifier(storageId).itemRemoved(key);
- },
-
- itemAdded: function(storageId, key, value)
- {
- this._domStorageForIdentifier(storageId).itemAdded(key, value);
- },
-
- itemUpdated: function(storageId, key, oldValue, value)
- {
- this._domStorageForIdentifier(storageId).itemUpdated(key, oldValue, value);
- },
-
- inspectDatabase: function(id)
- {
- var database = this._databaseForIdentifier(id);
- console.assert(database);
- if (!database)
- return;
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.DatabaseWasInspected, {database: database});
- },
-
- inspectDOMStorage: function(id)
- {
- var domStorage = this._domStorageForIdentifier(id);
- console.assert(domStorage);
- if (!domStorage)
- return;
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.DOMStorageObjectWasInspected, {domStorage: domStorage});
- },
-
- // Protected
-
- requestIndexedDatabaseData: function(objectStore, objectStoreIndex, startEntryIndex, maximumEntryCount, callback)
- {
- console.assert(window.IndexedDBAgent);
- console.assert(objectStore);
- console.assert(callback);
-
- function processData(error, entryPayloads, moreAvailable)
- {
- if (error) {
- callback(null, false);
- return;
- }
-
- var entries = [];
-
- for (var entryPayload of entryPayloads) {
- var entry = {};
- entry.primaryKey = new WebInspector.RemoteObject.fromPayload(entryPayload.primaryKey);
- entry.key = new WebInspector.RemoteObject.fromPayload(entryPayload.key);
- entry.value = new WebInspector.RemoteObject.fromPayload(entryPayload.value);
- entries.push(entry);
- }
-
- callback(entries, moreAvailable);
- }
-
- var requestArguments = {
- securityOrigin: objectStore.parentDatabase.securityOrigin,
- databaseName: objectStore.parentDatabase.name,
- objectStoreName: objectStore.name,
- indexName: objectStoreIndex && objectStoreIndex.name || "",
- skipCount: startEntryIndex || 0,
- pageSize: maximumEntryCount || 100
- };
-
- IndexedDBAgent.requestData.invoke(requestArguments, processData);
- },
-
- // Private
-
- _domStorageForIdentifier: function(id)
- {
- for (var storageObject of this._domStorageObjects) {
- // The id is an object, so we need to compare the properties using Object.shallowEqual.
- // COMPATIBILITY (iOS 6): The id was a string. Object.shallowEqual works for both.
- if (Object.shallowEqual(storageObject.id, id))
- return storageObject;
- }
-
- return null;
- },
-
- _mainResourceDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- if (event.target.isMainFrame()) {
- // If we are dealing with the main frame, we want to clear our list of objects, because we are navigating to a new page.
- this.initialize();
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.Cleared);
-
- this._addDOMStorageIfNeeded(event.target);
- this._addIndexedDBDatabasesIfNeeded(event.target);
- }
-
- // Add the host of the frame that changed the main resource to the list of hosts there could be cookies for.
- var host = parseURL(event.target.url).host;
- if (!host)
- return;
-
- if (this._cookieStorageObjects[host])
- return;
-
- this._cookieStorageObjects[host] = new WebInspector.CookieStorageObject(host);
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, {cookieStorage: this._cookieStorageObjects[host]});
- },
-
- _addDOMStorageIfNeeded: function(frame)
- {
- // Don't show storage if we don't have a security origin (about:blank).
- if (!frame.securityOrigin || frame.securityOrigin === "://")
- return;
-
- // FIXME: Consider passing the other parts of the origin along to domStorageWasAdded.
-
- var localStorageIdentifier = {securityOrigin: frame.securityOrigin, isLocalStorage: true};
- if (!this._domStorageForIdentifier(localStorageIdentifier))
- this.domStorageWasAdded(localStorageIdentifier, frame.mainResource.urlComponents.host, true);
-
- var sessionStorageIdentifier = {securityOrigin: frame.securityOrigin, isLocalStorage: false};
- if (!this._domStorageForIdentifier(sessionStorageIdentifier))
- this.domStorageWasAdded(sessionStorageIdentifier, frame.mainResource.urlComponents.host, false);
- },
-
- _addIndexedDBDatabasesIfNeeded: function(frame)
- {
- if (!window.IndexedDBAgent)
- return;
-
- var securityOrigin = frame.securityOrigin;
-
- // Don't show storage if we don't have a security origin (about:blank).
- if (!securityOrigin || securityOrigin === "://")
- return;
-
- function processDatabaseNames(error, names)
- {
- if (error || !names)
- return;
-
- for (var name of names)
- IndexedDBAgent.requestDatabase(securityOrigin, name, processDatabase.bind(this));
- }
-
- function processDatabase(error, databasePayload)
- {
- if (error || !databasePayload)
- return;
-
- var objectStores = databasePayload.objectStores.map(processObjectStore);
- var indexedDatabase = new WebInspector.IndexedDatabase(databasePayload.name, securityOrigin, databasePayload.version, objectStores);
-
- this._indexedDatabases.push(indexedDatabase);
- this.dispatchEventToListeners(WebInspector.StorageManager.Event.IndexedDatabaseWasAdded, {indexedDatabase: indexedDatabase});
- }
-
- function processKeyPath(keyPathPayload)
- {
- switch (keyPathPayload.type) {
- case "null":
- return null;
- case "string":
- return keyPathPayload.string;
- case "array":
- return keyPathPayload.array;
- default:
- console.error("Unknown KeyPath type:", keyPathPayload.type);
- return null;
- }
- }
-
- function processObjectStore(objectStorePayload)
- {
- var keyPath = processKeyPath(objectStorePayload.keyPath);
- var indexes = objectStorePayload.indexes.map(processObjectStoreIndex);
- return new WebInspector.IndexedDatabaseObjectStore(objectStorePayload.name, keyPath, objectStorePayload.autoIncrement, indexes);
- }
-
- function processObjectStoreIndex(objectStoreIndexPayload)
- {
- var keyPath = processKeyPath(objectStoreIndexPayload.keyPath);
- return new WebInspector.IndexedDatabaseObjectStoreIndex(objectStoreIndexPayload.name, keyPath, objectStoreIndexPayload.unique, objectStoreIndexPayload.multiEntry);
- }
-
- IndexedDBAgent.requestDatabaseNames(securityOrigin, processDatabaseNames.bind(this));
- },
-
- _securityOriginDidChange: function(event)
- {
- console.assert(event.target instanceof WebInspector.Frame);
-
- this._addDOMStorageIfNeeded(event.target);
- this._addIndexedDBDatabasesIfNeeded(event.target);
- },
-
- _databaseForIdentifier: function(id)
- {
- for (var i = 0; i < this._databaseObjects.length; ++i) {
- if (this._databaseObjects[i].id === id)
- return this._databaseObjects[i];
- }
-
- return null;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceStorageTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/StorageTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/StorageTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/StorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,73 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StorageTreeElement = function(classNames, title, representedObject)
-{
- WebInspector.GeneralTreeElement.call(this, classNames, title, null, representedObject, false);
-
- this.small = true;
- this.flattened = false;
-};
-
-WebInspector.StorageTreeElement.prototype = {
- constructor: WebInspector.StorageTreeElement,
-
- // Public
-
- get flattened()
- {
- return this._flattened;
- },
-
- set flattened(flattened)
- {
- if (this._flattened === flattened)
- return;
-
- this._flattened = flattened;
- if (!this._flattened) {
- this.mainTitle = this.name;
- this.subtitle = this.secondaryName;
- this._updateChildrenTitles();
- return;
- }
-
- this.mainTitle = this.categoryName;
- this.subtitle = this.name;
- this._updateChildrenTitles();
- },
-
- // Private
-
- _updateChildrenTitles: function()
- {
- for (var i = 0; i < this.children.length; ++i) {
- if (typeof this.children[i].updateTitles === "function")
- this.children[i].updateTitles();
- }
- }
-};
-
-WebInspector.StorageTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceStyleDetailsPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/StyleDetailsPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/StyleDetailsPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/StyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,163 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StyleDetailsPanel = function(className, identifier, label)
-{
- this._element = document.createElement("div");
- this._element.className = className;
-
- // Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
- this.element.classList.add(WebInspector.StyleDetailsPanel.OffsetSectionsStyleClassName);
-
- this._navigationItem = new WebInspector.RadioButtonNavigationItem(identifier, label);
-
- this._nodeStyles = null;
- this._visible = false;
-};
-
-WebInspector.StyleDetailsPanel.OffsetSectionsStyleClassName = "offset-sections";
-
-WebInspector.StyleDetailsPanel.prototype = {
- constructor: WebInspector.StyleDetailsPanel,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get navigationItem()
- {
- return this._navigationItem;
- },
-
- get nodeStyles()
- {
- return this._nodeStyles;
- },
-
- shown: function()
- {
- if (this._visible)
- return;
-
- this._visible = true;
-
- this._refreshNodeStyles();
- },
-
- hidden: function()
- {
- this._visible = false;
- },
-
- widthDidChange: function()
- {
- // Implemented by subclasses.
- },
-
- markAsNeedsRefresh: function(domNode)
- {
- console.assert(domNode);
- if (!domNode)
- return;
-
- if (!this._nodeStyles || this._nodeStyles.node !== domNode) {
- if (this._nodeStyles) {
- this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
- this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
- }
-
- this._nodeStyles = WebInspector.cssStyleManager.stylesForNode(domNode);
-
- console.assert(this._nodeStyles);
- if (!this._nodeStyles)
- return;
-
- this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
- this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
-
- this._forceSignificantChange = true;
- }
-
- if (this._visible)
- this._refreshNodeStyles();
- },
-
- refresh: function(significantChange)
- {
- // Implemented by subclasses.
- },
-
- // Private
-
- get _initialScrollOffset()
- {
- if (!WebInspector.cssStyleManager.canForcePseudoClasses())
- return 0;
- return this.nodeStyles.node.enabledPseudoClasses.length ? 0 : WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset;
- },
-
- _refreshNodeStyles: function()
- {
- if (!this._nodeStyles)
- return;
- this._nodeStyles.refresh();
- },
-
- _refreshPreservingScrollPosition: function(significantChange)
- {
- significantChange = this._forceSignificantChange || significantChange || false;
- delete this._forceSignificantChange;
-
- var previousScrollTop = this._initialScrollOffset;
-
- // Only remember the scroll position if the previous node is the same as this one.
- if (this.element.parentNode && this._previousRefreshNodeIdentifier === this._nodeStyles.node.id)
- previousScrollTop = this.element.parentNode.scrollTop;
-
- this.refresh(significantChange);
-
- this._previousRefreshNodeIdentifier = this._nodeStyles.node.id;
-
- if (this.element.parentNode)
- this.element.parentNode.scrollTop = previousScrollTop;
- },
-
- _nodeStylesRefreshed: function(event)
- {
- if (this._visible)
- this._refreshPreservingScrollPosition(event.data.significantChange);
- },
-
- _nodeStylesNeedsRefreshed: function(event)
- {
- if (this._visible)
- this._refreshNodeStyles();
- }
-};
-
-WebInspector.StyleDetailsPanel.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceStyleRuleIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/StyleRuleIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/StyleRuleIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/StyleRuleIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.author-style-rule-icon .icon {
- content: url(Images/StyleRuleAuthor.svg);
-}
-
-.user-style-rule-icon .icon {
- content: url(Images/StyleRuleUser.svg);
-}
-
-.user-agent-style-rule-icon .icon {
- content: url(Images/StyleRuleUserAgent.svg);
-}
-
-.inspector-style-rule-icon .icon {
- content: url(Images/StyleRuleInspector.svg);
-}
-
-.inherited-style-rule-icon .icon {
- content: url(Images/StyleRuleInherited.svg);
-}
-
-.inherited-element-style-rule-icon .icon {
- content: url(Images/StyleRuleInheritedElement.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingDefaultThemecss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingDefaultTheme.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingDefaultTheme.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingDefaultTheme.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,117 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-/* These styles match Xcode 4's Default theme. */
-
-.cm-s-default,
-.syntax-highlighted {
- color: black;
-
- font-family: Menlo, monospace;
- font-size: 11px;
-}
-
-.cm-s-default .cm-comment,
-.syntax-highlighted .css-comment,
-.syntax-highlighted .javascript-comment,
-.syntax-highlighted .html-comment {
- color: rgb(0, 116, 0);
-}
-
-.cm-s-default .cm-tag,
-.cm-s-default .cm-atom,
-.cm-s-default .cm-keyword,
-.cm-s-default .cm-m-css.cm-meta,
-.cm-s-default .cm-m-css.cm-property,
-.cm-s-default .cm-m-css.cm-string-2,
-.cm-s-default .cm-m-javascript.cm-builtin,
-.syntax-highlighted .css-keyword,
-.syntax-highlighted .css-property,
-.syntax-highlighted .css-at-rule,
-.syntax-highlighted .css-important,
-.syntax-highlighted .javascript-keyword,
-.syntax-highlighted .html-tag {
- color: rgb(170, 13, 145);
-}
-
-.cm-s-default .cm-number,
-.cm-s-default .cm-m-css.cm-atom,
-.syntax-highlighted .css-number,
-.syntax-highlighted .javascript-number {
- color: rgb(28, 0, 207);
-}
-
-.cm-s-default .cm-def,
-.cm-s-default .cm-bracket,
-.cm-s-default .cm-operator,
-.cm-s-default .cm-qualifier,
-.cm-s-default .cm-variable,
-.cm-s-default .cm-variable-2,
-.cm-s-default .cm-variable-3,
-.cm-s-default .cm-m-css.cm-tag,
-.cm-s-default .cm-m-css.cm-builtin,
-.syntax-highlighted .css-selector,
-.syntax-highlighted .javascript-ident {
- color: inherit;
-}
-
-.cm-s-default .cm-string,
-.syntax-highlighted .css-string,
-.syntax-highlighted .javascript-string,
-.syntax-highlighted .javascript-regexp,
-.syntax-highlighted .html-attribute-value {
- color: rgb(196, 26, 22);
-}
-
-.cm-s-default .cm-m-xml.cm-meta,
-.syntax-highlighted .html-doctype {
- color: rgb(192, 192, 192);
-}
-
-.cm-s-default .cm-m-xml.cm-attribute,
-.syntax-highlighted .html-attribute-name {
- color: rgb(131, 108, 40);
-}
-
-.syntax-highlighted a {
- color: rgb(14, 14, 255);
-}
-
-.cm-s-default .cm-link,
-.syntax-highlighted a {
- text-decoration: none;
- cursor: pointer;
-}
-
-.cm-s-default .cm-link:hover,
-.syntax-highlighted a:hover {
- text-decoration: underline;
-}
-
-.supports-find-banner.showing-find-banner.syntax-highlighted .search-result,
-.supports-find-banner.showing-find-banner .syntax-highlighted .search-result {
- background-color: rgba(235, 215, 38, 0.2);
- border-bottom: 1px solid rgb(237, 202, 71);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingSupportjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingSupport.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingSupport.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingSupport.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SyntaxHighlightedStyleClassName = "syntax-highlighted";
-
-WebInspector.syntaxHighlightStringAsDocumentFragment = function(string, mimeType, baseURL)
-{
- var resultFragment = document.createDocumentFragment();
-
- function appendText(text, style)
- {
- if (!style) {
- resultFragment.appendChild(document.createTextNode(text));
- return;
- }
-
- var span = document.createElement("span");
- span.className = "cm-" + style;
- span.textContent = text;
-
- resultFragment.appendChild(span);
- }
-
- mimeType = parseMIMEType(mimeType).type;
-
- CodeMirror.runMode(string, mimeType, appendText);
-
- return resultFragment;
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.text > .text-editor {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,172 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextContentView = function(string, mimeType)
-{
- WebInspector.ContentView.call(this, string);
-
- this.element.classList.add(WebInspector.TextContentView.StyleClassName);
-
- this._textEditor = new WebInspector.TextEditor;
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
-
- this.element.appendChild(this._textEditor.element);
-
- this._textEditor.readOnly = true;
- this._textEditor.mimeType = mimeType;
- this._textEditor.string = string;
-
- var toolTip = WebInspector.UIString("Pretty print");
- var activatedToolTip = WebInspector.UIString("Original formatting");
- this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
- this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
- this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
-};
-
-WebInspector.TextContentView.StyleClassName = "text";
-
-WebInspector.TextContentView.prototype = {
- constructor: WebInspector.TextContentView,
-
- // Public
-
- get textEditor()
- {
- return this._textEditor;
- },
-
- get navigationItems()
- {
- return [this._prettyPrintButtonNavigationItem];
- },
-
- revealPosition: function(position, textRangeToSelect, forceUnformatted)
- {
- this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
- },
-
- shown: function()
- {
- WebInspector.ResourceContentView.prototype.shown.call(this);
-
- this._textEditor.shown();
- },
-
- hidden: function()
- {
- WebInspector.ResourceContentView.prototype.hidden.call(this);
-
- this._textEditor.hidden();
- },
-
- closed: function()
- {
- WebInspector.ContentView.prototype.closed.call(this);
-
- this._textEditor.close();
- },
-
- get supportsSave()
- {
- return true;
- },
-
- get saveData()
- {
- var url = "web-inspector:///" + encodeURI(WebInspector.UIString("Untitled")) + ".txt";
- return {url: url, content: this._textEditor.string, forceSaveAs: true};
- },
-
- get supportsSearch()
- {
- return true;
- },
-
- get numberOfSearchResults()
- {
- return this._textEditor.numberOfSearchResults;
- },
-
- get hasPerformedSearch()
- {
- return this._textEditor.currentSearchQuery !== null;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- this._textEditor.automaticallyRevealFirstSearchResult = reveal;
- },
-
- performSearch: function(query)
- {
- this._textEditor.performSearch(query);
- },
-
- searchCleared: function()
- {
- this._textEditor.searchCleared();
- },
-
- searchQueryWithSelection: function()
- {
- return this._textEditor.searchQueryWithSelection();
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- this._textEditor.revealPreviousSearchResult(changeFocus);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- this._textEditor.revealNextSearchResult(changeFocus);
- },
-
- updateLayout: function()
- {
- this._textEditor.updateLayout();
- },
-
- // Private
-
- _togglePrettyPrint: function(event)
- {
- var activated = !this._prettyPrintButtonNavigationItem.activated;
- this._textEditor.formatted = activated;
- },
-
- _textEditorFormattingDidChange: function(event)
- {
- this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
- },
-
- _numberOfSearchResultsDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
- }
-};
-
-WebInspector.TextContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextEditorcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextEditor.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextEditor.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,168 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.text-editor {
- position: relative;
-
- overflow: hidden;
-}
-
-.text-editor > .CodeMirror {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- height: auto;
-}
-
-.text-editor > .CodeMirror .has-breakpoint:not(.breakpoint-disabled) .CodeMirror-linenumber {
- color: white;
-}
-
-.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber {
- color: transparent;
-}
-
-.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: -7px;
-
- content: "";
-
- z-index: -2;
-
- border-image-source: -webkit-image-set(url(Images/BreakpointInactive.png) 1x, url(Images/BreakpointInactive@2x.png) 2x);
- border-image-slice: 3 7 3 3 fill;
- border-width: 3px 7px 3px 3px;
-}
-
-.text-editor > .CodeMirror .breakpoint-resolved .CodeMirror-linenumber::before {
- border-image-source: -webkit-image-set(url(Images/Breakpoint.png) 1x, url(Images/Breakpoint@2x.png) 2x);
-}
-
-.text-editor > .CodeMirror .breakpoint-auto-continue:not(.breakpoint-disabled) .CodeMirror-linenumber::before {
- opacity: 0.6;
-}
-
-.text-editor > .CodeMirror .breakpoint-disabled .CodeMirror-linenumber::before {
- opacity: 0.35;
-}
-
-.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber::before {
- content: "•••";
- color: white;
- line-height: 6px;
- text-align: center;
- text-indent: -1px;
-}
-
-.text-editor > .CodeMirror .execution-line .CodeMirror-linenumber::after {
- position: absolute;
- top: 0;
- bottom: 0;
- right: -9px;
- width: 9px;
-
- content: "";
-
- z-index: -1;
-
- background-image: -webkit-image-set(url(Images/InstructionPointer.png) 1x, url(Images/InstructionPointer@2x.png) 2x);
- background-size: 9px 100%;
- background-repeat: no-repeat;
-}
-
-.text-editor > .CodeMirror .execution-line {
- background-color: rgb(217, 234, 208) !important;
-}
-
-.text-editor .bouncy-highlight {
- position: absolute;
- z-index: 100;
-
- box-shadow: inset rgb(250, 232, 140) 0 -1px 0, rgba(211, 197, 96, 1) 0 1px 1px, rgba(0, 0, 0, 0.33) 0 1px 2px 1px;
- text-shadow: white 0 0 2px;
-
- background: -webkit-linear-gradient(top, rgb(250, 237, 108), rgb(242, 220, 100));
- border-radius: 7px;
-
- padding: 2px 4px;
- margin-top: -2px;
- margin-left: -4px;
-
- -webkit-user-select: none;
- pointer-events: none;
-
- -webkit-animation-name: text-editor-bouncy;
- -webkit-animation-duration: 750ms;
- -webkit-animation-timing-function: ease-in-out;
-
- opacity: 0;
-}
-
-@-webkit-keyframes text-editor-bouncy {
- 0% {
- -webkit-transform: scale(1);
- opacity: 1;
- }
-
- 12.5% {
- -webkit-transform: scale(1.25);
- }
-
- 25% {
- -webkit-transform: scale(1);
- }
-
- 62.5% {
- opacity: 1;
- }
-
- 100% {
- opacity: 0;
- }
-}
-
-.text-editor > .CodeMirror .highlighted {
- -webkit-animation: "text-editor-highlight-fadeout" 2s;
-}
-
-@-webkit-keyframes text-editor-highlight-fadeout {
- from { background-color: highlight; }
-}
-
-.text-editor > .CodeMirror .hovered-expression-highlight {
- -webkit-animation: "text-editor-hovered-expression-highlight-fadeout" 2s;
- background-color: rgba(0, 0, 0, 0.1);
-}
-
-@-webkit-keyframes text-editor-hovered-expression-highlight-fadeout {
- from { background-color: highlight; }
- to { background-color: rgba(0, 0, 0, 0.1); }
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextEditorjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextEditor.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextEditor.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1338 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextEditor = function(element, mimeType, delegate)
-{
- WebInspector.Object.call(this);
-
- var text = (element ? element.textContent : "");
- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.TextEditor.StyleClassName);
- this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
-
- this._codeMirror = CodeMirror(this.element, {
- readOnly: true,
- indentWithTabs: true,
- indentUnit: 4,
- lineNumbers: true,
- lineWrapping: true,
- matchBrackets: true,
- autoCloseBrackets: true
- });
-
- this._codeMirror.on("change", this._contentChanged.bind(this));
- this._codeMirror.on("gutterClick", this._gutterMouseDown.bind(this));
- this._codeMirror.on("gutterContextMenu", this._gutterContextMenu.bind(this));
- this._codeMirror.getScrollerElement().addEventListener("click", this._openClickedLinks.bind(this), true);
-
- this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
- this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
-
- this._initialStringNotSet = true;
-
- this.mimeType = mimeType;
-
- this._breakpoints = {};
- this._executionLineNumber = NaN;
- this._executionColumnNumber = NaN;
-
- this._searchQuery = null;
- this._searchResults = [];
- this._currentSearchResultIndex = -1;
- this._ignoreCodeMirrorContentDidChangeEvent = 0;
-
- this._formatted = false;
- this._formatterSourceMap = null;
-
- this._delegate = delegate || null;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.TextEditor);
-
-WebInspector.TextEditor.StyleClassName = "text-editor";
-WebInspector.TextEditor.HighlightedStyleClassName = "highlighted";
-WebInspector.TextEditor.SearchResultStyleClassName = "search-result";
-WebInspector.TextEditor.HasBreakpointStyleClassName = "has-breakpoint";
-WebInspector.TextEditor.BreakpointResolvedStyleClassName = "breakpoint-resolved";
-WebInspector.TextEditor.BreakpointAutoContinueStyleClassName = "breakpoint-auto-continue";
-WebInspector.TextEditor.BreakpointDisabledStyleClassName = "breakpoint-disabled";
-WebInspector.TextEditor.MultipleBreakpointsStyleClassName = "multiple-breakpoints";
-WebInspector.TextEditor.ExecutionLineStyleClassName = "execution-line";
-WebInspector.TextEditor.BouncyHighlightStyleClassName = "bouncy-highlight";
-WebInspector.TextEditor.NumberOfFindsPerSearchBatch = 10;
-WebInspector.TextEditor.HighlightAnimationDuration = 2000;
-
-WebInspector.TextEditor.Event = {
- ExecutionLineNumberDidChange: "text-editor-execution-line-number-did-change",
- NumberOfSearchResultsDidChange: "text-editor-number-of-search-results-did-change",
- ContentDidChange: "text-editor-content-did-change",
- FormattingDidChange: "text-editor-formatting-did-change"
-};
-
-WebInspector.TextEditor.prototype = {
- constructor: WebInspector.TextEditor,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get string()
- {
- return this._codeMirror.getValue();
- },
-
- set string(newString)
- {
- function update()
- {
- this._codeMirror.setValue(newString);
-
- if (this._initialStringNotSet) {
- this._codeMirror.clearHistory();
- this._codeMirror.markClean();
- delete this._initialStringNotSet;
- }
-
- // Automatically format the content.
- if (this._autoFormat) {
- console.assert(!this.formatted);
- this.formatted = true;
- delete this._autoFormat;
- }
-
- // Update the execution line now that we might have content for that line.
- this._updateExecutionLine();
-
- // Set the breakpoint styles now that we might have content for those lines.
- for (var lineNumber in this._breakpoints)
- this._setBreakpointStylesOnLine(lineNumber);
-
- // Try revealing the pending line now that we might have content with enough lines.
- this._revealPendingPositionIfPossible();
- }
-
- this._ignoreCodeMirrorContentDidChangeEvent++;
- this._codeMirror.operation(update.bind(this));
- this._ignoreCodeMirrorContentDidChangeEvent--;
- console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
- },
-
- get readOnly()
- {
- return this._codeMirror.getOption("readOnly") || false;
- },
-
- set readOnly(readOnly)
- {
- this._codeMirror.setOption("readOnly", readOnly);
- },
-
- get formatted()
- {
- return this._formatted;
- },
-
- set formatted(formatted)
- {
- if (this._formatted === formatted)
- return;
-
- console.assert(!formatted || this.canBeFormatted());
- if (formatted && !this.canBeFormatted())
- return;
-
- this._ignoreCodeMirrorContentDidChangeEvent++;
- this._prettyPrint(formatted);
- this._ignoreCodeMirrorContentDidChangeEvent--;
- console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
-
- this._formatted = formatted;
-
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
- },
-
- set autoFormat(auto)
- {
- this._autoFormat = auto;
- },
-
- hasFormatter: function()
- {
- const supportedModes = {
- "javascript": true,
- "css": true,
- };
-
- var mode = this._codeMirror.getMode();
- return mode.name in supportedModes;
- },
-
- canBeFormatted: function()
- {
- // Can be overriden by subclasses.
- return this.hasFormatter();
- },
-
- get selectedTextRange()
- {
- var start = this._codeMirror.getCursor(true);
- var end = this._codeMirror.getCursor(false);
- return this._textRangeFromCodeMirrorPosition(start, end);
- },
-
- set selectedTextRange(textRange)
- {
- var position = this._codeMirrorPositionFromTextRange(textRange);
- this._codeMirror.setSelection(position.start, position.end);
- },
-
- get mimeType()
- {
- return this._mimeType;
- },
-
- set mimeType(newMIMEType)
- {
- newMIMEType = parseMIMEType(newMIMEType).type;
-
- this._mimeType = newMIMEType;
- this._codeMirror.setOption("mode", newMIMEType);
- },
-
- get executionLineNumber()
- {
- return this._executionLineNumber;
- },
-
- set executionLineNumber(lineNumber)
- {
- // Only return early if there isn't a line handle and that isn't changing.
- if (!this._executionLineHandle && isNaN(lineNumber))
- return;
-
- this._executionLineNumber = lineNumber;
- this._updateExecutionLine();
-
- // Still dispatch the event even if the number didn't change. The execution state still
- // could have changed (e.g. continuing in a loop with a breakpoint inside).
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange);
- },
-
- get executionColumnNumber()
- {
- return this._executionColumnNumber;
- },
-
- set executionColumnNumber(columnNumber)
- {
- this._executionColumnNumber = columnNumber;
- },
-
- get formatterSourceMap()
- {
- return this._formatterSourceMap;
- },
-
- get tokenTrackingController()
- {
- return this._tokenTrackingController;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- set delegate(newDelegate)
- {
- this._delegate = newDelegate || null;
- },
-
- get numberOfSearchResults()
- {
- return this._searchResults.length;
- },
-
- get currentSearchQuery()
- {
- return this._searchQuery;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- this._automaticallyRevealFirstSearchResult = reveal;
-
- // If we haven't shown a search result yet, reveal one now.
- if (this._automaticallyRevealFirstSearchResult && this._searchResults.length > 0) {
- if (this._currentSearchResultIndex === -1)
- this._revealFirstSearchResultAfterCursor();
- }
- },
-
- performSearch: function(query)
- {
- if (this._searchQuery === query)
- return;
-
- this.searchCleared();
-
- this._searchQuery = query;
-
- // Allow subclasses to handle the searching if they have a better way.
- // If we are formatted, just use CodeMirror's search.
- if (typeof this.customPerformSearch === "function" && !this.formatted) {
- if (this.customPerformSearch(query))
- return;
- }
-
- // Go down the slow patch for all other text content.
- var searchCursor = this._codeMirror.getSearchCursor(query, {line: 0, ch: 0}, true);
- var boundBatchSearch = batchSearch.bind(this);
- var numberOfSearchResultsDidChangeTimeout = null;
-
- function reportNumberOfSearchResultsDidChange()
- {
- if (numberOfSearchResultsDidChangeTimeout) {
- clearTimeout(numberOfSearchResultsDidChangeTimeout);
- numberOfSearchResultsDidChangeTimeout = null;
- }
-
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
- }
-
- function batchSearch()
- {
- // Bail if the query changed since we started.
- if (this._searchQuery !== query)
- return;
-
- var newSearchResults = [];
- var foundResult = false;
- for (var i = 0; i < WebInspector.TextEditor.NumberOfFindsPerSearchBatch && (foundResult = searchCursor.findNext()); ++i) {
- var textRange = this._textRangeFromCodeMirrorPosition(searchCursor.from(), searchCursor.to());
- newSearchResults.push(textRange);
- }
-
- this.addSearchResults(newSearchResults);
-
- // Don't report immediately, coalesce updates so they come in no faster than half a second.
- if (!numberOfSearchResultsDidChangeTimeout)
- numberOfSearchResultsDidChangeTimeout = setTimeout(reportNumberOfSearchResultsDidChange.bind(this), 500);
-
- if (foundResult) {
- // More lines to search, set a timeout so we don't block the UI long.
- setTimeout(boundBatchSearch, 50);
- } else {
- // Report immediately now that we are finished, canceling any pending update.
- reportNumberOfSearchResultsDidChange.call(this);
- }
- }
-
- // Start the search.
- boundBatchSearch();
- },
-
- addSearchResults: function(textRanges)
- {
- console.assert(textRanges);
- if (!textRanges || !textRanges.length)
- return;
-
- function markRanges()
- {
- for (var i = 0; i < textRanges.length; ++i) {
- var position = this._codeMirrorPositionFromTextRange(textRanges[i]);
- var mark = this._codeMirror.markText(position.start, position.end, {className: WebInspector.TextEditor.SearchResultStyleClassName});
- this._searchResults.push(mark);
- }
-
- // If we haven't shown a search result yet, reveal one now.
- if (this._automaticallyRevealFirstSearchResult) {
- if (this._currentSearchResultIndex === -1)
- this._revealFirstSearchResultAfterCursor();
- }
- }
-
- this._codeMirror.operation(markRanges.bind(this));
- },
-
- searchCleared: function()
- {
- function clearResults() {
- for (var i = 0; i < this._searchResults.length; ++i)
- this._searchResults[i].clear();
- }
-
- this._codeMirror.operation(clearResults.bind(this));
-
- this._searchQuery = null;
- this._searchResults = [];
- this._currentSearchResultIndex = -1;
- },
-
- searchQueryWithSelection: function()
- {
- if (!this._codeMirror.somethingSelected())
- return null;
-
- return this._codeMirror.getSelection();
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- if (!this._searchResults.length)
- return;
-
- if (this._currentSearchResultIndex === -1 || this._cursorDoesNotMatchLastRevealedSearchResult()) {
- this._revealFirstSearchResultBeforeCursor(changeFocus);
- return;
- }
-
- if (this._currentSearchResultIndex > 0)
- --this._currentSearchResultIndex;
- else
- this._currentSearchResultIndex = this._searchResults.length - 1;
-
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, -1);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- if (!this._searchResults.length)
- return;
-
- if (this._currentSearchResultIndex === -1 || this._cursorDoesNotMatchLastRevealedSearchResult()) {
- this._revealFirstSearchResultAfterCursor(changeFocus);
- return;
- }
-
- if (this._currentSearchResultIndex + 1 < this._searchResults.length)
- ++this._currentSearchResultIndex;
- else
- this._currentSearchResultIndex = 0;
-
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, 1);
- },
-
- line: function(lineNumber)
- {
- return this._codeMirror.getLine(lineNumber);
- },
-
- revealPosition: function(position, textRangeToSelect, forceUnformatted, noHighlight)
- {
- console.assert(position === undefined || position instanceof WebInspector.SourceCodePosition, "revealPosition called without a SourceCodePosition");
- if (!(position instanceof WebInspector.SourceCodePosition))
- return;
-
- var lineHandle = this._codeMirror.getLineHandle(position.lineNumber);
- if (!lineHandle || !this._visible || this._initialStringNotSet) {
- // If we can't get a line handle or are not visible then we wait to do the reveal.
- this._positionToReveal = position;
- this._textRangeToSelect = textRangeToSelect;
- this._forceUnformatted = forceUnformatted;
- return;
- }
-
- // Delete now that the reveal is happening.
- delete this._positionToReveal;
- delete this._textRangeToSelect;
- delete this._forceUnformatted;
-
- // If we need to unformat, reveal the line after a wait.
- // Otherwise the line highlight doesn't work properly.
- if (this._formatted && forceUnformatted) {
- this.formatted = false;
- setTimeout(this.revealPosition.bind(this), 0, position, textRangeToSelect);
- return;
- }
-
- if (!textRangeToSelect)
- textRangeToSelect = new WebInspector.TextRange(position.lineNumber, position.columnNumber, position.lineNumber, position.columnNumber);
-
- function removeStyleClass()
- {
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.HighlightedStyleClassName);
- }
-
- function revealAndHighlightLine()
- {
- // If the line is not visible, reveal it as the center line in the editor.
- var position = this._codeMirrorPositionFromTextRange(textRangeToSelect);
- if (!this._isPositionVisible(position.start))
- this._scrollIntoViewCentered(position.start);
-
- this.selectedTextRange = textRangeToSelect;
-
- if (noHighlight)
- return;
-
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.HighlightedStyleClassName);
-
- // Use a timeout instead of a webkitAnimationEnd event listener because the line element might
- // be removed if the user scrolls during the animation. In that case webkitAnimationEnd isn't
- // fired, and the line would highlight again the next time it scrolls into view.
- setTimeout(removeStyleClass.bind(this), WebInspector.TextEditor.HighlightAnimationDuration);
- }
-
- this._codeMirror.operation(revealAndHighlightLine.bind(this));
- },
-
- updateLayout: function(force)
- {
- this._codeMirror.refresh();
- },
-
- shown: function()
- {
- this._visible = true;
-
- // Refresh since our size might have changed.
- this._codeMirror.refresh();
-
- // Try revealing the pending line now that we are visible.
- // This needs to be done as a separate operation from the refresh
- // so that the scrollInfo coordinates are correct.
- this._revealPendingPositionIfPossible();
- },
-
- hidden: function()
- {
- this._visible = false;
- },
-
- setBreakpointInfoForLineAndColumn: function(lineNumber, columnNumber, breakpointInfo)
- {
- if (this._ignoreSetBreakpointInfoCalls)
- return;
-
- if (breakpointInfo)
- this._addBreakpointToLineAndColumnWithInfo(lineNumber, columnNumber, breakpointInfo);
- else
- this._removeBreakpointFromLineAndColumn(lineNumber, columnNumber);
- },
-
- updateBreakpointLineAndColumn: function(oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)
- {
- console.assert(this._breakpoints[oldLineNumber]);
- if (!this._breakpoints[oldLineNumber])
- return;
-
- console.assert(this._breakpoints[oldLineNumber][oldColumnNumber]);
- if (!this._breakpoints[oldLineNumber][oldColumnNumber])
- return;
-
- var breakpointInfo = this._breakpoints[oldLineNumber][oldColumnNumber];
- this._removeBreakpointFromLineAndColumn(oldLineNumber, oldColumnNumber);
- this._addBreakpointToLineAndColumnWithInfo(newLineNumber, newColumnNumber, breakpointInfo);
- },
-
- addStyleClassToLine: function(lineNumber, styleClassName)
- {
- var lineHandle = this._codeMirror.getLineHandle(lineNumber);
- console.assert(lineHandle);
- if (!lineHandle)
- return;
-
- return this._codeMirror.addLineClass(lineHandle, "wrap", styleClassName);
- },
-
- removeStyleClassFromLine: function(lineNumber, styleClassName)
- {
- var lineHandle = this._codeMirror.getLineHandle(lineNumber);
- console.assert(lineHandle);
- if (!lineHandle)
- return;
-
- return this._codeMirror.removeLineClass(lineHandle, "wrap", styleClassName);
- },
-
- toggleStyleClassForLine: function(lineNumber, styleClassName)
- {
- var lineHandle = this._codeMirror.getLineHandle(lineNumber);
- console.assert(lineHandle);
- if (!lineHandle)
- return;
-
- return this._codeMirror.toggleLineClass(lineHandle, "wrap", styleClassName);
- },
-
- get lineCount()
- {
- return this._codeMirror.lineCount();
- },
-
- focus: function()
- {
- this._codeMirror.focus();
- },
-
- contentDidChange: function(replacedRanges, newRanges)
- {
- // Implemented by subclasses.
- },
-
- rectsForRange: function(range)
- {
- return this._codeMirror.rectsForRange(range);
- },
-
- get markers()
- {
- return this._codeMirror.getAllMarks().map(function(codeMirrorTextMarker) {
- return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
- });
- },
-
- markersAtPosition: function(position)
- {
- return this._codeMirror.findMarksAt(position).map(function(codeMirrorTextMarker) {
- return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
- });
- },
-
- createColorMarkers: function(range)
- {
- return this._codeMirror.createColorMarkers(range);
- },
-
- createGradientMarkers: function(range)
- {
- return this._codeMirror.createGradientMarkers(range);
- },
-
- editingControllerForMarker: function(editableMarker)
- {
- switch (editableMarker.type) {
- case WebInspector.TextMarker.Type.Color:
- return new WebInspector.CodeMirrorColorEditingController(this._codeMirror, editableMarker);
- case WebInspector.TextMarker.Type.Gradient:
- return new WebInspector.CodeMirrorGradientEditingController(this._codeMirror, editableMarker);
- default:
- return new WebInspector.CodeMirrorEditingController(this._codeMirror, editableMarker);
- }
- },
-
- // Private
-
- _contentChanged: function(codeMirror, change)
- {
- if (this._ignoreCodeMirrorContentDidChangeEvent > 0)
- return;
-
- var replacedRanges = [];
- var newRanges = [];
- while (change) {
- replacedRanges.push(new WebInspector.TextRange(
- change.from.line,
- change.from.ch,
- change.to.line,
- change.to.ch
- ));
- newRanges.push(new WebInspector.TextRange(
- change.from.line,
- change.from.ch,
- change.from.line + change.text.length - 1,
- change.text.length === 1 ? change.from.ch + change.text[0].length : change.text.lastValue.length
- ));
- change = change.next;
- }
- this.contentDidChange(replacedRanges, newRanges);
-
- if (this._formatted) {
- this._formatterSourceMap = null;
- this._formatted = false;
-
- if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function")
- this._delegate.textEditorUpdatedFormatting(this);
-
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
- }
-
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.ContentDidChange);
- },
-
- _textRangeFromCodeMirrorPosition: function(start, end)
- {
- console.assert(start);
- console.assert(end);
-
- return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch);
- },
-
- _codeMirrorPositionFromTextRange: function(textRange)
- {
- console.assert(textRange);
-
- var start = {line: textRange.startLine, ch: textRange.startColumn};
- var end = {line: textRange.endLine, ch: textRange.endColumn};
- return {start: start, end: end};
- },
-
- _revealPendingPositionIfPossible: function()
- {
- // Nothing to do if we don't have a pending position.
- if (!this._positionToReveal)
- return;
-
- // Don't try to reveal unless we are visible.
- if (!this._visible)
- return;
-
- this.revealPosition(this._positionToReveal, this._textRangeToSelect, this._forceUnformatted);
- },
-
- _revealSearchResult: function(result, changeFocus, directionInCaseOfRevalidation)
- {
- var position = result.find();
-
- // Check for a valid position, it might have been removed from editing by the user.
- // If the position is invalide, revalidate all positions reveal as needed.
- if (!position) {
- this._revalidateSearchResults(directionInCaseOfRevalidation);
- return;
- }
-
- // If the line is not visible, reveal it as the center line in the editor.
- if (!this._isPositionVisible(position.from))
- this._scrollIntoViewCentered(position.from);
-
- // Update the text selection to select the search result.
- this.selectedTextRange = this._textRangeFromCodeMirrorPosition(position.from, position.to);
-
- // Remove the automatically reveal state now that we have revealed a search result.
- this._automaticallyRevealFirstSearchResult = false;
-
- // Focus the editor if requested.
- if (changeFocus)
- this._codeMirror.focus();
-
- // Remove the bouncy highlight if it is still around. The animation will not
- // start unless we remove it and add it back to the document.
- if (this._bouncyHighlightElement)
- this._bouncyHighlightElement.remove();
-
- // Create the bouncy highlight.
- this._bouncyHighlightElement = document.createElement("div");
- this._bouncyHighlightElement.className = WebInspector.TextEditor.BouncyHighlightStyleClassName;
-
- // Collect info for the bouncy highlight.
- var textContent = this._codeMirror.getSelection();
- var coordinates = this._codeMirror.cursorCoords(true, "page");
-
- // Adjust the coordinates to be based in the text editor's space.
- var textEditorRect = this._element.getBoundingClientRect();
- coordinates.top -= textEditorRect.top;
- coordinates.left -= textEditorRect.left;
-
- // Position and show the bouncy highlight.
- this._bouncyHighlightElement.textContent = textContent;
- this._bouncyHighlightElement.style.top = coordinates.top + "px";
- this._bouncyHighlightElement.style.left = coordinates.left + "px";
- this._element.appendChild(this._bouncyHighlightElement);
-
- function animationEnded()
- {
- if (!this._bouncyHighlightElement)
- return;
-
- this._bouncyHighlightElement.remove();
- delete this._bouncyHighlightElement;
- }
-
- // Listen for the end of the animation so we can remove the element.
- this._bouncyHighlightElement.addEventListener("webkitAnimationEnd", animationEnded.bind(this));
- },
-
- _binarySearchInsertionIndexInSearchResults: function(object, comparator)
- {
- // It is possible that markers in the search results array may have been deleted.
- // In those cases the comparator will return "null" and we immediately stop
- // the binary search and return null. The search results list needs to be updated.
- var array = this._searchResults;
-
- var first = 0;
- var last = array.length - 1;
-
- while (first <= last) {
- var mid = (first + last) >> 1;
- var c = comparator(object, array[mid]);
- if (c === null)
- return null;
- if (c > 0)
- first = mid + 1;
- else if (c < 0)
- last = mid - 1;
- else
- return mid;
- }
-
- return first - 1;
- },
-
- _revealFirstSearchResultBeforeCursor: function(changeFocus)
- {
- console.assert(this._searchResults.length);
-
- var currentCursorPosition = this._codeMirror.getCursor("start");
- if (currentCursorPosition.line === 0 && currentCursorPosition.ch === 0) {
- this._currentSearchResultIndex = this._searchResults.length - 1;
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, -1);
- return;
- }
-
- var index = this._binarySearchInsertionIndexInSearchResults(currentCursorPosition, function(current, searchResult) {
- var searchResultMarker = searchResult.find();
- if (!searchResultMarker)
- return null;
- return WebInspector.compareCodeMirrorPositions(current, searchResultMarker.from);
- });
-
- if (index === null) {
- this._revalidateSearchResults(-1);
- return;
- }
-
- this._currentSearchResultIndex = index;
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus);
- },
-
- _revealFirstSearchResultAfterCursor: function(changeFocus)
- {
- console.assert(this._searchResults.length);
-
- var currentCursorPosition = this._codeMirror.getCursor("start");
- if (currentCursorPosition.line === 0 && currentCursorPosition.ch === 0) {
- this._currentSearchResultIndex = 0;
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, 1);
- return;
- }
-
- var index = this._binarySearchInsertionIndexInSearchResults(currentCursorPosition, function(current, searchResult) {
- var searchResultMarker = searchResult.find();
- if (!searchResultMarker)
- return null;
- return WebInspector.compareCodeMirrorPositions(current, searchResultMarker.from);
- });
-
- if (index === null) {
- this._revalidateSearchResults(1);
- return;
- }
-
- if (index + 1 < this._searchResults.length)
- ++index;
- else
- index = 0;
-
- this._currentSearchResultIndex = index;
- this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus);
- },
-
- _cursorDoesNotMatchLastRevealedSearchResult: function()
- {
- console.assert(this._currentSearchResultIndex !== -1);
- console.assert(this._searchResults.length);
-
- var lastRevealedSearchResultMarker = this._searchResults[this._currentSearchResultIndex].find();
- if (!lastRevealedSearchResultMarker)
- return true;
-
- var currentCursorPosition = this._codeMirror.getCursor("start");
- var lastRevealedSearchResultPosition = lastRevealedSearchResultMarker.from;
-
- return WebInspector.compareCodeMirrorPositions(currentCursorPosition, lastRevealedSearchResultPosition) !== 0;
- },
-
- _revalidateSearchResults: function(direction)
- {
- console.assert(direction !== undefined);
-
- this._currentSearchResultIndex = -1;
-
- var updatedSearchResults = [];
- for (var i = 0; i < this._searchResults.length; ++i) {
- if (this._searchResults[i].find())
- updatedSearchResults.push(this._searchResults[i]);
- }
-
- console.assert(updatedSearchResults.length !== this._searchResults.length);
-
- this._searchResults = updatedSearchResults;
- this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
-
- if (this._searchResults.length) {
- if (direction > 0)
- this._revealFirstSearchResultAfterCursor();
- else
- this._revealFirstSearchResultBeforeCursor();
- }
- },
-
- _updateExecutionLine: function()
- {
- function update()
- {
- if (this._executionLineHandle)
- this._codeMirror.removeLineClass(this._executionLineHandle, "wrap", WebInspector.TextEditor.ExecutionLineStyleClassName);
-
- this._executionLineHandle = !isNaN(this._executionLineNumber) ? this._codeMirror.getLineHandle(this._executionLineNumber) : null;
-
- if (this._executionLineHandle)
- this._codeMirror.addLineClass(this._executionLineHandle, "wrap", WebInspector.TextEditor.ExecutionLineStyleClassName);
- }
-
- this._codeMirror.operation(update.bind(this));
- },
-
- _setBreakpointStylesOnLine: function(lineNumber)
- {
- var columnBreakpoints = this._breakpoints[lineNumber];
- console.assert(columnBreakpoints);
- if (!columnBreakpoints)
- return;
-
- var allDisabled = true;
- var allResolved = true;
- var allAutoContinue = true;
- var multiple = Object.keys(columnBreakpoints).length > 1;
- for (var columnNumber in columnBreakpoints) {
- var breakpointInfo = columnBreakpoints[columnNumber];
- if (!breakpointInfo.disabled)
- allDisabled = false;
- if (!breakpointInfo.resolved)
- allResolved = false;
- if (!breakpointInfo.autoContinue)
- allAutoContinue = false;
- }
-
- function updateStyles()
- {
- // We might not have a line if the content isn't fully populated yet.
- // This will be called again when the content is available.
- var lineHandle = this._codeMirror.getLineHandle(lineNumber);
- if (!lineHandle)
- return;
-
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName);
-
- if (allResolved)
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
- else
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
-
- if (allDisabled)
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
- else
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
-
- if (allAutoContinue)
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
- else
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
-
- if (multiple)
- this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
- else
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
- }
-
- this._codeMirror.operation(updateStyles.bind(this));
- },
-
- _addBreakpointToLineAndColumnWithInfo: function(lineNumber, columnNumber, breakpointInfo)
- {
- if (!this._breakpoints[lineNumber])
- this._breakpoints[lineNumber] = {};
- this._breakpoints[lineNumber][columnNumber] = breakpointInfo;
-
- this._setBreakpointStylesOnLine(lineNumber);
- },
-
- _removeBreakpointFromLineAndColumn: function(lineNumber, columnNumber)
- {
- console.assert(columnNumber in this._breakpoints[lineNumber]);
- delete this._breakpoints[lineNumber][columnNumber];
-
- // There are still breakpoints on the line. Update the breakpoint style.
- if (!isEmptyObject(this._breakpoints[lineNumber])) {
- this._setBreakpointStylesOnLine(lineNumber);
- return;
- }
-
- delete this._breakpoints[lineNumber];
-
- function updateStyles()
- {
- var lineHandle = this._codeMirror.getLineHandle(lineNumber);
- if (!lineHandle)
- return;
-
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName);
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
- this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
- }
-
- this._codeMirror.operation(updateStyles.bind(this));
- },
-
- _allColumnBreakpointInfoForLine: function(lineNumber)
- {
- return this._breakpoints[lineNumber];
- },
-
- _setColumnBreakpointInfoForLine: function(lineNumber, columnBreakpointInfo)
- {
- console.assert(columnBreakpointInfo);
- this._breakpoints[lineNumber] = columnBreakpointInfo;
- this._setBreakpointStylesOnLine(lineNumber);
- },
-
- _gutterMouseDown: function(codeMirror, lineNumber, gutterElement, event)
- {
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- if (!this._codeMirror.hasLineClass(lineNumber, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName)) {
- console.assert(!(lineNumber in this._breakpoints));
-
- // No breakpoint, add a new one.
- if (this._delegate && typeof this._delegate.textEditorBreakpointAdded === "function") {
- var data = this._delegate.textEditorBreakpointAdded(this, lineNumber, 0);
- if (data) {
- var breakpointInfo = data.breakpointInfo;
- if (breakpointInfo)
- this._addBreakpointToLineAndColumnWithInfo(data.lineNumber, data.columnNumber, breakpointInfo);
- }
- }
-
- return;
- }
-
- console.assert(lineNumber in this._breakpoints);
-
- if (this._codeMirror.hasLineClass(lineNumber, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName)) {
- console.assert(!isEmptyObject(this._breakpoints[lineNumber]));
- return;
- }
-
- // Single existing breakpoint, start tracking it for dragging.
- console.assert(Object.keys(this._breakpoints[lineNumber]).length === 1);
- var columnNumber = Object.keys(this._breakpoints[lineNumber])[0];
- this._draggingBreakpointInfo = this._breakpoints[lineNumber][columnNumber];
- this._lineNumberWithMousedDownBreakpoint = lineNumber;
- this._lineNumberWithDraggedBreakpoint = lineNumber;
- this._columnNumberWithMousedDownBreakpoint = columnNumber;
- this._columnNumberWithDraggedBreakpoint = columnNumber;
-
- this._documentMouseMovedEventListener = this._documentMouseMoved.bind(this);
- this._documentMouseUpEventListener = this._documentMouseUp.bind(this);
-
- // Register these listeners on the document so we can track the mouse if it leaves the gutter.
- document.addEventListener("mousemove", this._documentMouseMovedEventListener, true);
- document.addEventListener("mouseup", this._documentMouseUpEventListener, true);
- },
-
- _gutterContextMenu: function(codeMirror, lineNumber, gutterElement, event)
- {
- if (this._delegate && typeof this._delegate.textEditorGutterContextMenu === "function") {
- var breakpoints = [];
- for (var columnNumber in this._breakpoints[lineNumber])
- breakpoints.push({lineNumber:lineNumber, columnNumber:columnNumber});
-
- this._delegate.textEditorGutterContextMenu(this, lineNumber, 0, breakpoints, event);
- }
- },
-
- _documentMouseMoved: function(event)
- {
- console.assert("_lineNumberWithMousedDownBreakpoint" in this);
- if (!("_lineNumberWithMousedDownBreakpoint" in this))
- return;
-
- event.preventDefault();
-
- var lineNumber;
- var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
-
- // CodeMirror's coordsChar returns a position even if it is outside the bounds. Nullify the position
- // if the event is outside the bounds of the gutter so we will remove the breakpoint.
- var gutterBounds = this._codeMirror.getGutterElement().getBoundingClientRect();
- if (event.pageX < gutterBounds.left || event.pageX > gutterBounds.right || event.pageY < gutterBounds.top || event.pageY > gutterBounds.bottom)
- position = null;
-
- // If we have a position and it has a line then use it.
- if (position && "line" in position)
- lineNumber = position.line;
-
- // The _lineNumberWithDraggedBreakpoint property can be undefined if the user drags
- // outside of the gutter. The lineNumber variable can be undefined for the same reason.
-
- if (lineNumber === this._lineNumberWithDraggedBreakpoint)
- return;
-
- // Record that the mouse dragged some so when mouse up fires we know to do the
- // work of removing and moving the breakpoint.
- this._mouseDragged = true;
-
- if ("_lineNumberWithDraggedBreakpoint" in this) {
- // We have a line that is currently showing the dragged breakpoint. Remove that breakpoint
- // and restore the previous one (if any.)
- if (this._previousColumnBreakpointInfo)
- this._setColumnBreakpointInfoForLine(this._lineNumberWithDraggedBreakpoint, this._previousColumnBreakpointInfo);
- else
- this._removeBreakpointFromLineAndColumn(this._lineNumberWithDraggedBreakpoint, this._columnNumberWithDraggedBreakpoint);
-
- delete this._previousColumnBreakpointInfo;
- delete this._lineNumberWithDraggedBreakpoint;
- delete this._columnNumberWithDraggedBreakpoint;
- }
-
- if (lineNumber !== undefined) {
- // We have a new line that will now show the dragged breakpoint.
- var newColumnBreakpoints = {};
- var columnNumber = (lineNumber === this._lineNumberWithMousedDownBreakpoint ? this._columnNumberWithDraggedBreakpoint : 0);
- newColumnBreakpoints[columnNumber] = this._draggingBreakpointInfo;
- this._previousColumnBreakpointInfo = this._allColumnBreakpointInfoForLine(lineNumber);
- this._setColumnBreakpointInfoForLine(lineNumber, newColumnBreakpoints);
- this._lineNumberWithDraggedBreakpoint = lineNumber;
- this._columnNumberWithDraggedBreakpoint = columnNumber;
- }
- },
-
- _documentMouseUp: function(event)
- {
- console.assert("_lineNumberWithMousedDownBreakpoint" in this);
- if (!("_lineNumberWithMousedDownBreakpoint" in this))
- return;
-
- event.preventDefault();
-
- document.removeEventListener("mousemove", this._documentMouseMovedEventListener, true);
- document.removeEventListener("mouseup", this._documentMouseUpEventListener, true);
-
- const delegateImplementsBreakpointClicked = this._delegate && typeof this._delegate.textEditorBreakpointClicked === "function";
- const delegateImplementsBreakpointRemoved = this._delegate && typeof this._delegate.textEditorBreakpointRemoved === "function";
- const delegateImplementsBreakpointMoved = this._delegate && typeof this._delegate.textEditorBreakpointMoved === "function";
-
- if (this._mouseDragged) {
- if (!("_lineNumberWithDraggedBreakpoint" in this)) {
- // The breakpoint was dragged off the gutter, remove it.
- if (delegateImplementsBreakpointRemoved) {
- this._ignoreSetBreakpointInfoCalls = true;
- this._delegate.textEditorBreakpointRemoved(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint);
- delete this._ignoreSetBreakpointInfoCalls;
- }
- } else if (this._lineNumberWithMousedDownBreakpoint !== this._lineNumberWithDraggedBreakpoint) {
- // The dragged breakpoint was moved to a new line.
-
- // If there is are breakpoints already at the drop line, tell the delegate to remove them.
- // We have already updated the breakpoint info internally, so when the delegate removes the breakpoints
- // and tells us to clear the breakpoint info, we can ignore those calls.
- if (this._previousColumnBreakpointInfo && delegateImplementsBreakpointRemoved) {
- this._ignoreSetBreakpointInfoCalls = true;
- for (var columnNumber in this._previousColumnBreakpointInfo)
- this._delegate.textEditorBreakpointRemoved(this, this._lineNumberWithDraggedBreakpoint, columnNumber);
- delete this._ignoreSetBreakpointInfoCalls;
- }
-
- // Tell the delegate to move the breakpoint from one line to another.
- if (delegateImplementsBreakpointMoved) {
- this._ignoreSetBreakpointInfoCalls = true;
- this._delegate.textEditorBreakpointMoved(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint, this._lineNumberWithDraggedBreakpoint, this._columnNumberWithDraggedBreakpoint);
- delete this._ignoreSetBreakpointInfoCalls;
- }
- }
- } else {
- // Toggle the disabled state of the breakpoint.
- console.assert(this._lineNumberWithMousedDownBreakpoint in this._breakpoints);
- console.assert(this._columnNumberWithMousedDownBreakpoint in this._breakpoints[this._lineNumberWithMousedDownBreakpoint]);
- if (this._lineNumberWithMousedDownBreakpoint in this._breakpoints && this._columnNumberWithMousedDownBreakpoint in this._breakpoints[this._lineNumberWithMousedDownBreakpoint] && delegateImplementsBreakpointClicked)
- this._delegate.textEditorBreakpointClicked(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint);
- }
-
- delete this._documentMouseMovedEventListener;
- delete this._documentMouseUpEventListener;
- delete this._lineNumberWithMousedDownBreakpoint;
- delete this._lineNumberWithDraggedBreakpoint;
- delete this._columnNumberWithMousedDownBreakpoint;
- delete this._columnNumberWithDraggedBreakpoint;
- delete this._previousColumnBreakpointInfo;
- delete this._mouseDragged;
- },
-
- _openClickedLinks: function(event)
- {
- // Get the position in the text and the token at that position.
- var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
- var tokenInfo = this._codeMirror.getTokenAt(position);
- if (!tokenInfo || !tokenInfo.type || !tokenInfo.string)
- return;
-
- // If the token is not a link, then ignore it.
- if (!/\blink\b/.test(tokenInfo.type))
- return;
-
- // The token string is the URL we should open. It might be a relative URL.
- var url = tokenInfo.string;
-
- // Get the base URL.
- var baseURL = "";
- if (this._delegate && typeof this._delegate.textEditorBaseURL === "function")
- baseURL = this._delegate.textEditorBaseURL(this);
-
- // Open the link after resolving the absolute URL from the base URL.
- WebInspector.openURL(absoluteURL(url, baseURL));
-
- // Stop processing the event.
- event.preventDefault();
- event.stopPropagation();
- },
-
- _isPositionVisible: function(position)
- {
- var scrollInfo = this._codeMirror.getScrollInfo();
- var visibleRangeStart = scrollInfo.top;
- var visibleRangeEnd = visibleRangeStart + scrollInfo.clientHeight;
- var coords = this._codeMirror.charCoords(position, "local");
-
- return coords.top >= visibleRangeStart && coords.bottom <= visibleRangeEnd;
- },
-
- _scrollIntoViewCentered: function(position)
- {
- var scrollInfo = this._codeMirror.getScrollInfo();
- var lineHeight = Math.ceil(this._codeMirror.defaultTextHeight());
- var margin = Math.floor((scrollInfo.clientHeight - lineHeight) / 2);
- this._codeMirror.scrollIntoView(position, margin);
- },
-
- _prettyPrint: function(pretty)
- {
- function prettyPrintAndUpdateEditor()
- {
- const start = {line: 0, ch: 0};
- const end = {line: this._codeMirror.lineCount() - 1};
-
- var oldSelectionAnchor = this._codeMirror.getCursor("anchor");
- var oldSelectionHead = this._codeMirror.getCursor("head");
- var newSelectionAnchor, newSelectionHead;
- var newExecutionLocation = null;
-
- if (pretty) {
- // <rdar://problem/10593948> Provide a way to change the tab width in the Web Inspector
- const indentString = " ";
- var originalLineEndings = [];
- var formattedLineEndings = [];
- var mapping = {original: [0], formatted: [0]};
- var builder = new FormatterContentBuilder(mapping, originalLineEndings, formattedLineEndings, 0, 0, indentString);
- var formatter = new Formatter(this._codeMirror, builder);
- formatter.format(start, end);
-
- this._formatterSourceMap = WebInspector.FormatterSourceMap.fromBuilder(builder);
-
- this._codeMirror.setValue(builder.formattedContent);
-
- if (this._positionToReveal) {
- var newRevealPosition = this._formatterSourceMap.originalToFormatted(this._positionToReveal.lineNumber, this._positionToReveal.columnNumber);
- this._positionToReveal = new WebInspector.SourceCodePosition(newRevealPosition.lineNumber, newRevealPosition.columnNumber);
- }
-
- if (this._textRangeToSelect) {
- var mappedRevealSelectionStart = this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.startLine, this._textRangeToSelect.startColumn);
- var mappedRevealSelectionEnd = this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.endLine, this._textRangeToSelect.endColumn);
- this._textRangeToSelect = new WebInspector.TextRange(mappedRevealSelectionStart.lineNumber, mappedRevealSelectionStart.columnNumber, mappedRevealSelectionEnd.lineNumber, mappedRevealSelectionEnd.columnNumber);
- }
-
- if (!isNaN(this._executionLineNumber)) {
- console.assert(!isNaN(this._executionColumnNumber));
- newExecutionLocation = this._formatterSourceMap.originalToFormatted(this._executionLineNumber, this._executionColumnNumber);
- }
-
- var mappedAnchorLocation = this._formatterSourceMap.originalToFormatted(oldSelectionAnchor.line, oldSelectionAnchor.ch);
- var mappedHeadLocation = this._formatterSourceMap.originalToFormatted(oldSelectionHead.line, oldSelectionHead.ch);
- newSelectionAnchor = {line:mappedAnchorLocation.lineNumber, ch:mappedAnchorLocation.columnNumber};
- newSelectionHead = {line:mappedHeadLocation.lineNumber, ch:mappedHeadLocation.columnNumber};
- } else {
- this._codeMirror.undo();
-
- if (this._positionToReveal) {
- var newRevealPosition = this._formatterSourceMap.formattedToOriginal(this._positionToReveal.lineNumber, this._positionToReveal.columnNumber);
- this._positionToReveal = new WebInspector.SourceCodePosition(newRevealPosition.lineNumber, newRevealPosition.columnNumber);
- }
-
- if (this._textRangeToSelect) {
- var mappedRevealSelectionStart = this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.startLine, this._textRangeToSelect.startColumn);
- var mappedRevealSelectionEnd = this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.endLine, this._textRangeToSelect.endColumn);
- this._textRangeToSelect = new WebInspector.TextRange(mappedRevealSelectionStart.lineNumber, mappedRevealSelectionStart.columnNumber, mappedRevealSelectionEnd.lineNumber, mappedRevealSelectionEnd.columnNumber);
- }
-
- if (!isNaN(this._executionLineNumber)) {
- console.assert(!isNaN(this._executionColumnNumber));
- newExecutionLocation = this._formatterSourceMap.formattedToOriginal(this._executionLineNumber, this._executionColumnNumber);
- }
-
- var mappedAnchorLocation = this._formatterSourceMap.formattedToOriginal(oldSelectionAnchor.line, oldSelectionAnchor.ch);
- var mappedHeadLocation = this._formatterSourceMap.formattedToOriginal(oldSelectionHead.line, oldSelectionHead.ch);
- newSelectionAnchor = {line:mappedAnchorLocation.lineNumber, ch:mappedAnchorLocation.columnNumber};
- newSelectionHead = {line:mappedHeadLocation.lineNumber, ch:mappedHeadLocation.columnNumber};
-
- this._formatterSourceMap = null;
- }
-
- this._scrollIntoViewCentered(newSelectionAnchor);
- this._codeMirror.setSelection(newSelectionAnchor, newSelectionHead);
-
- if (newExecutionLocation) {
- delete this._executionLineHandle;
- this.executionColumnNumber = newExecutionLocation.columnNumber;
- this.executionLineNumber = newExecutionLocation.lineNumber;
- }
-
- // FIXME: <rdar://problem/13129955> FindBanner: New searches should not lose search position (start from current selection/caret)
- if (this.currentSearchQuery) {
- var searchQuery = this.currentSearchQuery;
- this.searchCleared();
- // Set timeout so that this happens after the current CodeMirror operation.
- // The editor has to update for the value and selection changes.
- setTimeout(function(query) {
- this.performSearch(searchQuery);
- }.bind(this), 0);
- }
-
- if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function")
- this._delegate.textEditorUpdatedFormatting(this);
- }
-
- this._codeMirror.operation(prettyPrintAndUpdateEditor.bind(this));
- }
-};
-
-WebInspector.TextEditor.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextMarkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextMarker.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextMarker.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextMarker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,86 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextMarker = function(codeMirrorTextMarker, type)
-{
- WebInspector.Object.call(this);
-
- this._codeMirrorTextMarker = codeMirrorTextMarker;
- codeMirrorTextMarker.__webInspectorTextMarker = this;
-
- this._type = type || WebInspector.TextMarker.Type.Plain;
-}
-
-WebInspector.TextMarker.Type = {
- Color: "text-marker-type-color",
- Gradient: "text-marker-type-gradient",
- Plain: "text-marker-type-plain"
-};
-
-WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker = function(codeMirrorTextMarker)
-{
- return codeMirrorTextMarker.__webInspectorTextMarker || new WebInspector.TextMarker(codeMirrorTextMarker);
-};
-
-WebInspector.TextMarker.prototype = {
- constructor: WebInspector.TextMarker,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get codeMirrorTextMarker()
- {
- return this._codeMirrorTextMarker;
- },
-
- get type()
- {
- return this._type;
- },
-
- get range()
- {
- var range = this._codeMirrorTextMarker.find();
- if (!range)
- return null;
- return new WebInspector.TextRange(range.from.line, range.from.ch, range.to.line, range.to.ch);
- },
-
- get rects()
- {
- var range = this._codeMirrorTextMarker.find();
- if (!range)
- return WebInspector.Rect.ZERO_RECT;
- return this._codeMirrorTextMarker.doc.cm.rectsForRange({
- start: range.from,
- end: range.to
- });
- },
-
- clear: function()
- {
- this._codeMirrorTextMarker.clear();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextRangejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextRange.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextRange.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextRange.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,161 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextRange = function(startLineOrStartOffset, startColumnOrEndOffset, endLine, endColumn)
-{
- WebInspector.Object.call(this);
-
- if (arguments.length === 4) {
- console.assert(startLineOrStartOffset <= endLine);
- console.assert(startLineOrStartOffset !== endLine || startColumnOrEndOffset <= endColumn);
-
- this._startLine = typeof startLineOrStartOffset === "number" ? startLineOrStartOffset : NaN;
- this._startColumn = typeof startColumnOrEndOffset === "number" ? startColumnOrEndOffset : NaN;
- this._endLine = typeof endLine === "number" ? endLine : NaN;
- this._endColumn = typeof endColumn === "number" ? endColumn : NaN;
-
- this._startOffset = NaN;
- this._endOffset = NaN;
- } else if (arguments.length === 2) {
- console.assert(startLineOrStartOffset <= startColumnOrEndOffset);
-
- this._startOffset = typeof startLineOrStartOffset === "number" ? startLineOrStartOffset : NaN;
- this._endOffset = typeof startColumnOrEndOffset === "number" ? startColumnOrEndOffset : NaN;
-
- this._startLine = NaN;
- this._startColumn = NaN;
- this._endLine = NaN;
- this._endColumn = NaN;
- }
-}
-
-WebInspector.TextRange.prototype = {
- constructor: WebInspector.TextRange,
-
- // Public
-
- get startLine()
- {
- return this._startLine;
- },
-
- get startColumn()
- {
- return this._startColumn;
- },
-
- get endLine()
- {
- return this._endLine;
- },
-
- get endColumn()
- {
- return this._endColumn;
- },
-
- get startOffset()
- {
- return this._startOffset;
- },
-
- get endOffset()
- {
- return this._endOffset;
- },
-
- startPosition: function()
- {
- return new WebInspector.SourceCodePosition(this._startLine, this._startColumn);
- },
-
- endPosition: function()
- {
- return new WebInspector.SourceCodePosition(this._endLine, this._endColumn);
- },
-
- resolveLinesAndColumns: function(text)
- {
- console.assert(typeof text === "string");
- if (typeof text !== "string")
- return;
-
- console.assert(!isNaN(this._startOffset));
- console.assert(!isNaN(this._endOffset));
- if (isNaN(this._startOffset) || isNaN(this._endOffset))
- return;
-
- function countNewLineCharacters(text)
- {
- var matches = text.match(/\n/g);
- return matches ? matches.length : 0;
- }
-
- var startSubstring = text.substring(0, this._startOffset);
- var rangeSubstring = text.substring(this._startOffset, this._endOffset);
-
- var startNewLineCount = countNewLineCharacters(startSubstring);
- var rangeNewLineCount = countNewLineCharacters(rangeSubstring);
-
- this._startLine = startNewLineCount;
- this._endLine = startNewLineCount + rangeNewLineCount;
-
- var lastNewLineOffset = startNewLineCount ? startSubstring.lastIndexOf("\n") + 1 : 0;
- this._startColumn = startSubstring.length - lastNewLineOffset;
-
- lastNewLineOffset = rangeNewLineCount ? rangeSubstring.lastIndexOf("\n") + 1 : 0;
- this._endColumn = rangeSubstring.length - lastNewLineOffset;
-
- if (this._startLine === this._endLine)
- this._endColumn += this._startColumn;
- },
-
- resolveOffsets: function(text)
- {
- console.assert(typeof text === "string");
- if (typeof text !== "string")
- return;
-
- console.assert(!isNaN(this._startLine));
- console.assert(!isNaN(this._startColumn));
- console.assert(!isNaN(this._endLine));
- console.assert(!isNaN(this._endColumn));
- if (isNaN(this._startLine) || isNaN(this._startColumn) || isNaN(this._endLine) || isNaN(this._endColumn))
- return;
-
- var lastNewLineOffset = 0;
- for (var i = 0; i < this._startLine; ++i)
- lastNewLineOffset = text.indexOf("\n", lastNewLineOffset) + 1;
-
- this._startOffset = lastNewLineOffset + this._startColumn;
-
- for (var i = this._startLine; i < this._endLine; ++i)
- lastNewLineOffset = text.indexOf("\n", lastNewLineOffset) + 1;
-
- this._endOffset = lastNewLineOffset + this._endColumn;
- }
-};
-
-WebInspector.TextRange.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.resource.text > .text-editor {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,243 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextResourceContentView = function(resource)
-{
- WebInspector.ResourceContentView.call(this, resource, WebInspector.TextResourceContentView.StyleClassName);
-
- resource.addEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._sourceCodeContentDidChange, this);
-
- this._textEditor = new WebInspector.SourceCodeTextEditor(resource);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.ContentDidChange, this._textEditorContentDidChange, this);
- this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
- this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate, this._contentWillPopulate, this);
- this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate, this._contentDidPopulate, this);
-
- WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetsChanged, this);
- WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetsChanged, this);
-
- var toolTip = WebInspector.UIString("Pretty print");
- var activatedToolTip = WebInspector.UIString("Original formatting");
- this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
- this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
- this._prettyPrintButtonNavigationItem.enabled = false; // Enabled when the text editor is populated with content.
-};
-
-WebInspector.TextResourceContentView.StyleClassName = "text";
-
-WebInspector.TextResourceContentView.prototype = {
- constructor: WebInspector.TextResourceContentView,
-
- // Public
-
- get navigationItems()
- {
- return [this._prettyPrintButtonNavigationItem];
- },
-
- get managesOwnIssues()
- {
- // SourceCodeTextEditor manages the issues, we don't need ResourceContentView doing it.
- return true;
- },
-
- get textEditor()
- {
- return this._textEditor;
- },
-
- get supplementalRepresentedObjects()
- {
- var objects = WebInspector.probeManager.probeSets.filter(function(probeSet) {
- return this._resource.url === probeSet.breakpoint.url;
- }.bind(this));
-
- // If the SourceCodeTextEditor has an executionLineNumber, we can assume
- // it is always the active call frame.
- if (!isNaN(this._textEditor.executionLineNumber))
- objects.push(WebInspector.debuggerManager.activeCallFrame);
-
- return objects;
- },
-
- revealPosition: function(position, textRangeToSelect, forceUnformatted)
- {
- this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
- },
-
- shown: function()
- {
- WebInspector.ResourceContentView.prototype.shown.call(this);
-
- this._textEditor.shown();
- },
-
- hidden: function()
- {
- WebInspector.ResourceContentView.prototype.hidden.call(this);
-
- this._textEditor.hidden();
- },
-
- closed: function()
- {
- WebInspector.ResourceContentView.prototype.closed.call(this);
-
- this.resource.removeEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._sourceCodeContentDidChange, this);
-
- this._textEditor.close();
- },
-
- get supportsSave()
- {
- return true;
- },
-
- get saveData()
- {
- return {url: this.resource.url, content: this._textEditor.string};
- },
-
- get supportsSearch()
- {
- return true;
- },
-
- get numberOfSearchResults()
- {
- return this._textEditor.numberOfSearchResults;
- },
-
- get hasPerformedSearch()
- {
- return this._textEditor.currentSearchQuery !== null;
- },
-
- set automaticallyRevealFirstSearchResult(reveal)
- {
- this._textEditor.automaticallyRevealFirstSearchResult = reveal;
- },
-
- performSearch: function(query)
- {
- this._textEditor.performSearch(query);
- },
-
- searchCleared: function()
- {
- this._textEditor.searchCleared();
- },
-
- searchQueryWithSelection: function()
- {
- return this._textEditor.searchQueryWithSelection();
- },
-
- revealPreviousSearchResult: function(changeFocus)
- {
- this._textEditor.revealPreviousSearchResult(changeFocus);
- },
-
- revealNextSearchResult: function(changeFocus)
- {
- this._textEditor.revealNextSearchResult(changeFocus);
- },
-
- updateLayout: function()
- {
- this._textEditor.updateLayout();
- },
-
- // Private
-
- _contentWillPopulate: function(event)
- {
- if (this._textEditor.element.parentNode === this.element)
- return;
-
- // Check the MIME-type for CSS since Resource.Type.Stylesheet also includes XSL, which we can't edit yet.
- if (this.resource.type === WebInspector.Resource.Type.Stylesheet && this.resource.syntheticMIMEType === "text/css")
- this._textEditor.readOnly = false;
-
- // Allow editing any local file since edits can be saved and reloaded right from the Inspector.
- if (this.resource.urlComponents.scheme === "file")
- this._textEditor.readOnly = false;
-
- this.element.removeChildren();
- this.element.appendChild(this._textEditor.element);
- },
-
- _contentDidPopulate: function(event)
- {
- this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
- },
-
- _togglePrettyPrint: function(event)
- {
- var activated = !this._prettyPrintButtonNavigationItem.activated;
- this._textEditor.formatted = activated;
- },
-
- _textEditorFormattingDidChange: function(event)
- {
- this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
- },
-
- _sourceCodeContentDidChange: function(event)
- {
- if (this._ignoreSourceCodeContentDidChangeEvent)
- return;
-
- this._textEditor.string = this.resource.currentRevision.content;
- },
-
- _textEditorContentDidChange: function(event)
- {
- this._ignoreSourceCodeContentDidChangeEvent = true;
- WebInspector.branchManager.currentBranch.revisionForRepresentedObject(this.resource).content = this._textEditor.string;
- delete this._ignoreSourceCodeContentDidChangeEvent;
- },
-
- _executionLineNumberDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
- },
-
- _numberOfSearchResultsDidChange: function(event)
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
- },
-
- _probeSetsChanged: function(event)
- {
- var breakpoint = event.data.probeSet.breakpoint;
- if (breakpoint.sourceCodeLocation.sourceCode === this.resource)
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
- }
-};
-
-WebInspector.TextResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelinejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Timeline.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Timeline.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Timeline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Timeline = function()
-{
- WebInspector.Object.call(this);
-
- this.reset(true);
-};
-
-WebInspector.Timeline.Event = {
- Reset: "timeline-reset",
- RecordAdded: "timeline-record-added",
- TimesUpdated: "timeline-times-updated"
-};
-
-WebInspector.Timeline.prototype = {
- constructor: WebInspector.Timeline,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get startTime()
- {
- return this._startTime;
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- get records()
- {
- return this._records;
- },
-
- reset: function(suppressEvents)
- {
- this._records = [];
- this._startTime = NaN;
- this._endTime = NaN;
-
- if (!suppressEvents) {
- this.dispatchEventToListeners(WebInspector.Timeline.Event.Reset);
- this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated);
- }
- },
-
- addRecord: function(record)
- {
- if (record.updatesDynamically)
- record.addEventListener(WebInspector.TimelineRecord.Event.Updated, this._recordUpdated, this);
-
- this._records.push(record);
-
- this._updateTimesIfNeeded(record);
-
- this.dispatchEventToListeners(WebInspector.Timeline.Event.RecordAdded, {record: record});
- },
-
- // Private
-
- _updateTimesIfNeeded: function(record)
- {
- var changed = false;
-
- if (isNaN(this._startTime) || record.startTime < this._startTime) {
- this._startTime = record.startTime;
- changed = true;
- }
-
- if (isNaN(this._endTime) || this._endTime < record.endTime) {
- this._endTime = record.endTime;
- changed = true;
- }
-
- if (changed)
- this.dispatchEventToListeners(WebInspector.Timeline.Event.TimesUpdated);
- },
-
- _recordUpdated: function(event)
- {
- this._updateTimesIfNeeded(event.target);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineContentViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,51 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.content-view.timeline > .timeline-overview {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 130px;
-}
-
-.content-view.timeline > .view-container {
- position: absolute;
- top: 130px;
- left: 0;
- right: 0;
- bottom: 0;
- overflow: hidden;
-}
-
-.content-view.timeline > .view-container > .timeline-view > .data-grid td {
- height: 16px;
- line-height: 16px;
-}
-
-.content-view.timeline > .view-container > .timeline-view > .data-grid table.data {
- background-image: -webkit-linear-gradient(top, white, white 50%, rgb(243, 243, 243) 50%, rgb(243, 243, 243));
- background-size: 100% 40px;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineContentViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,427 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineContentView = function(recording)
-{
- WebInspector.ContentView.call(this, recording);
-
- this._recording = recording;
-
- this.element.classList.add(WebInspector.TimelineContentView.StyleClassName);
-
- this._discreteTimelineOverviewGraphMap = new Map;
- this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimelineOverviewGraph(recording));
- this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.LayoutTimelineOverviewGraph(recording));
- this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.ScriptTimelineOverviewGraph(recording));
-
- this._timelineOverview = new WebInspector.TimelineOverview(this._discreteTimelineOverviewGraphMap);
- this._timelineOverview.addEventListener(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
- this.element.appendChild(this._timelineOverview.element);
-
- this._viewContainer = document.createElement("div");
- this._viewContainer.classList.add(WebInspector.TimelineContentView.ViewContainerStyleClassName);
- this.element.appendChild(this._viewContainer);
-
- this._clearTimelineNavigationItem = new WebInspector.ButtonNavigationItem("clear-timeline", WebInspector.UIString("Clear Timeline"), "Images/NavigationItemTrash.svg", 16, 16);
- this._clearTimelineNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearTimeline, this);
-
- this._overviewTimelineView = new WebInspector.OverviewTimelineView(recording);
-
- this._discreteTimelineViewMap = new Map;
- this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimelineView(recording));
- this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.LayoutTimelineView(recording));
- this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.ScriptTimelineView(recording));
-
- function createPathComponent(displayName, className, representedObject)
- {
- var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, representedObject);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
- return pathComponent;
- }
-
- this._pathComponentMap = new Map;
- this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Network, createPathComponent.call(this, WebInspector.UIString("Network Requests"), WebInspector.TimelineSidebarPanel.NetworkIconStyleClass, WebInspector.TimelineRecord.Type.Network));
- this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Layout, createPathComponent.call(this, WebInspector.UIString("Layout & Rendering"), WebInspector.TimelineSidebarPanel.ColorsIconStyleClass, WebInspector.TimelineRecord.Type.Layout));
- this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Script, createPathComponent.call(this, WebInspector.UIString("JavaScript & Events"), WebInspector.TimelineSidebarPanel.ScriptIconStyleClass, WebInspector.TimelineRecord.Type.Script));
-
- var previousPathComponent = null;
- for (var pathComponent of this._pathComponentMap.values()) {
- if (previousPathComponent) {
- previousPathComponent.nextSibling = pathComponent;
- pathComponent.previousSibling = previousPathComponent;
- }
-
- previousPathComponent = pathComponent;
- }
-
- this._currentTimelineView = null;
- this._currentTimelineViewIdentifier = null;
-
- this._updating = false;
- this._currentTime = NaN;
- this._lastUpdateTimestamp = NaN;
- this._startTimeNeedsReset = true;
-
- recording.addEventListener(WebInspector.TimelineRecording.Event.Reset, this._recordingReset, this);
-
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStarted, this._recordingStarted, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
-
- this.showOverviewTimelineView();
-};
-
-WebInspector.TimelineContentView.StyleClassName = "timeline";
-WebInspector.TimelineContentView.ViewContainerStyleClassName = "view-container";
-
-WebInspector.TimelineContentView.prototype = {
- constructor: WebInspector.TimelineContentView,
- __proto__: WebInspector.ContentView.prototype,
-
- // Public
-
- showOverviewTimelineView: function()
- {
- this._showTimelineView(this._overviewTimelineView);
- },
-
- showTimelineView: function(identifier)
- {
- console.assert(this._discreteTimelineViewMap.has(identifier));
- if (!this._discreteTimelineViewMap.has(identifier))
- return;
-
- this._showTimelineView(this._discreteTimelineViewMap.get(identifier), identifier);
- },
-
- get allowedNavigationSidebarPanels()
- {
- return ["timeline"];
- },
-
- get supportsSplitContentBrowser()
- {
- // The layout of the overview and split content browser don't work well.
- return false;
- },
-
- get selectionPathComponents()
- {
- var pathComponents = this._currentTimelineViewIdentifier ? [this._pathComponentMap.get(this._currentTimelineViewIdentifier)] : [];
- pathComponents = pathComponents.concat(this._currentTimelineView.selectionPathComponents || []);
- return pathComponents;
- },
-
- get navigationItems()
- {
- return [this._clearTimelineNavigationItem];
- },
-
- shown: function()
- {
- if (!this._currentTimelineView)
- return;
-
- this._currentTimelineView.shown();
- },
-
- hidden: function()
- {
- if (!this._currentTimelineView)
- return;
-
- this._currentTimelineView.hidden();
- },
-
- updateLayout: function()
- {
- this._timelineOverview.updateLayout();
-
- if (!this._currentTimelineView)
- return;
-
- this._currentTimelineView.updateLayout();
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- if (this._currentTimelineView && !this._currentTimelineView.matchTreeElementAgainstCustomFilters(treeElement))
- return false;
-
- var startTime = this._timelineOverview.selectionStartTime;
- var endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
- var currentTime = this._currentTime || this._recording.startTime;
-
- function checkTimeBounds(itemStartTime, itemEndTime)
- {
- itemStartTime = itemStartTime || currentTime;
- itemEndTime = itemEndTime || currentTime;
-
- return startTime <= itemEndTime && itemStartTime <= endTime;
- }
-
- if (treeElement instanceof WebInspector.ResourceTreeElement) {
- var resource = treeElement.resource;
- return checkTimeBounds(resource.requestSentTimestamp, resource.finishedOrFailedTimestamp);
- }
-
- if (treeElement instanceof WebInspector.SourceCodeTimelineTreeElement) {
- var sourceCodeTimeline = treeElement.sourceCodeTimeline;
-
- // Do a quick check of the timeline bounds before we check each record.
- if (!checkTimeBounds(sourceCodeTimeline.startTime, sourceCodeTimeline.endTime))
- return false;
-
- for (var record of sourceCodeTimeline.records) {
- if (checkTimeBounds(record.startTime, record.endTime))
- return true;
- }
-
- return false;
- }
-
- if (treeElement instanceof WebInspector.ProfileNodeTreeElement) {
- var profileNode = treeElement.profileNode;
- for (var call of profileNode.calls) {
- if (checkTimeBounds(call.startTime, call.endTime))
- return true;
- }
-
- return false;
- }
-
- if (treeElement instanceof WebInspector.TimelineRecordTreeElement) {
- var record = treeElement.record;
- return checkTimeBounds(record.startTime, record.endTime);
- }
-
- console.error("Unknown TreeElement, can't filter by time.");
- return true;
- },
-
- // Private
-
- _pathComponentSelected: function(event)
- {
- WebInspector.timelineSidebarPanel.showTimelineView(event.data.pathComponent.representedObject);
- },
-
- _timelineViewSelectionPathComponentsDidChange: function()
- {
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- },
-
- _showTimelineView: function(timelineView, identifier)
- {
- console.assert(timelineView instanceof WebInspector.TimelineView);
-
- if (this._currentTimelineView === timelineView)
- return;
-
- if (this._currentTimelineView) {
- this._currentTimelineView.removeEventListener(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange, this._timelineViewSelectionPathComponentsDidChange, this);
-
- this._currentTimelineView.hidden();
- this._currentTimelineView.element.remove();
- }
-
- this._currentTimelineView = timelineView;
- this._currentTimelineViewIdentifier = identifier || null;
-
- WebInspector.timelineSidebarPanel.contentTreeOutline = timelineView && timelineView.navigationSidebarTreeOutline;
- WebInspector.timelineSidebarPanel.contentTreeOutlineLabel = timelineView && timelineView.navigationSidebarTreeOutlineLabel;
-
- if (this._currentTimelineView) {
- this._currentTimelineView.addEventListener(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange, this._timelineViewSelectionPathComponentsDidChange, this);
-
- this._viewContainer.appendChild(this._currentTimelineView.element);
-
- this._currentTimelineView.startTime = this._timelineOverview.selectionStartTime;
- this._currentTimelineView.endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
- this._currentTimelineView.currentTime = this._currentTime;
-
- this._currentTimelineView.shown();
- this._currentTimelineView.updateLayout();
- }
-
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- },
-
- _update: function(timestamp)
- {
- if (this._waitingToResetCurrentTime) {
- requestAnimationFrame(this._updateCallback);
- return;
- }
-
- var startTime = this._recording.startTime;
- var currentTime = this._currentTime || startTime;
- var endTime = this._recording.endTime;
- var timespanSinceLastUpdate = (timestamp - this._lastUpdateTimestamp) / 1000 || 0;
-
- currentTime += timespanSinceLastUpdate;
-
- this._updateTimes(startTime, currentTime, endTime);
-
- // Only stop updating if the current time is greater than the end time.
- if (!this._updating && currentTime >= endTime) {
- this._lastUpdateTimestamp = NaN;
- return;
- }
-
- this._lastUpdateTimestamp = timestamp;
-
- requestAnimationFrame(this._updateCallback);
- },
-
- _updateTimes: function(startTime, currentTime, endTime)
- {
- if (this._startTimeNeedsReset && !isNaN(startTime)) {
- var selectionOffset = this._timelineOverview.selectionStartTime - this._timelineOverview.startTime;
-
- this._timelineOverview.startTime = startTime;
- this._timelineOverview.selectionStartTime = startTime + selectionOffset;
-
- this._overviewTimelineView.zeroTime = startTime;
- for (var timelineView of this._discreteTimelineViewMap.values())
- timelineView.zeroTime = startTime;
-
- delete this._startTimeNeedsReset;
- }
-
- this._timelineOverview.endTime = Math.max(endTime, currentTime);
-
- this._currentTime = currentTime;
- this._timelineOverview.currentTime = currentTime;
- this._currentTimelineView.currentTime = currentTime;
-
- // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
- this._timelineOverview.updateLayoutIfNeeded();
- this._currentTimelineView.updateLayoutIfNeeded();
- },
-
- _startUpdatingCurrentTime: function()
- {
- console.assert(!this._updating);
- if (this._updating)
- return;
-
- if (!isNaN(this._currentTime)) {
- // We have a current time already, so we likely need to jump into the future to a better current time.
- // This happens when you stop and later restart recording.
- this._waitingToResetCurrentTime = true;
- this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
- }
-
- this._updating = true;
-
- if (!this._updateCallback)
- this._updateCallback = this._update.bind(this);
-
- requestAnimationFrame(this._updateCallback);
- },
-
- _stopUpdatingCurrentTime: function()
- {
- console.assert(this._updating);
- this._updating = false;
- },
-
- _recordingStarted: function(event)
- {
- this._startUpdatingCurrentTime();
- },
-
- _recordingStopped: function(event)
- {
- this._stopUpdatingCurrentTime();
- },
-
- _recordingTimesUpdated: function(event)
- {
- if (!this._waitingToResetCurrentTime)
- return;
-
- // Make the current time be the start time of the last added record. This is the best way
- // currently to jump to the right period of time after recording starts.
- // FIXME: If no activity is happening we can sit for a while until a record is added.
- // We might want to have the backend send a "start" record to get current time moving.
-
- for (var timeline of this._recording.timelines.values()) {
- var lastRecord = timeline.records.lastValue;
- if (!lastRecord)
- continue;
- this._currentTime = Math.max(this._currentTime, lastRecord.startTime);
- }
-
- this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
- delete this._waitingToResetCurrentTime;
- },
-
- _clearTimeline: function(event)
- {
- this._recording.reset();
- },
-
- _recordingReset: function(event)
- {
- this._currentTime = NaN;
-
- if (!this._updating) {
- // Force the time ruler and views to reset to 0.
- this._startTimeNeedsReset = true;
- this._updateTimes(0, 0, 0);
- }
-
- this._lastUpdateTimestamp = NaN;
- this._startTimeNeedsReset = true;
-
- this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
- delete this._waitingToResetCurrentTime;
-
- this._overviewTimelineView.reset();
- for (var timelineView of this._discreteTimelineViewMap.values())
- timelineView.reset();
-
- for (var timelineOverviewGraph of this._discreteTimelineOverviewGraphMap.values())
- timelineOverviewGraph.reset();
- },
-
- _timeRangeSelectionChanged: function(event)
- {
- this._currentTimelineView.startTime = this._timelineOverview.selectionStartTime;
- this._currentTimelineView.endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
-
- // Delay until the next frame to stay in sync with the current timeline view's time-based layout changes.
- requestAnimationFrame(function() {
- var selectedTreeElement = this._currentTimelineView && this._currentTimelineView.navigationSidebarTreeOutline ? this._currentTimelineView.navigationSidebarTreeOutline.selectedTreeElement : null;
- var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
-
- WebInspector.timelineSidebarPanel.updateFilter();
-
- if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
- this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
- }.bind(this));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineDataGridcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,273 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.data-grid.timeline {
- border: none;
-}
-
-.data-grid.timeline table {
- font-size: 11px;
-}
-
-.data-grid.timeline th {
- height: 22px;
-
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
-
- background-image: none;
- background-color: white;
-
- border-top: 1px solid rgb(179, 179, 179) !important;
- border-bottom: 1px solid rgb(179, 179, 179) !important;
-}
-
-.data-grid.timeline th:not(:last-child) {
- border-right: 1px solid rgb(179, 179, 179);
-}
-
-.data-grid.timeline th.sortable:active {
- background-image: none !important;
- background-color: rgb(210, 210, 210);
-}
-
-.data-grid.timeline th.sort-ascending,
-.data-grid.timeline th.sort-descending {
- background-image: none !important;
- background-color: rgb(230, 230, 230);
-}
-
-.data-grid.timeline .data-container {
- top: 23px;
-}
-
-.data-grid.timeline th,
-.data-grid.timeline td {
- padding-left: 6px;
- padding-right: 6px;
-}
-
-.data-grid.timeline td:last-child {
- padding-right: 12px;
-}
-
-.data-grid.timeline td {
- padding-top: 2px;
- padding-bottom: 2px;
- line-height: 17px;
-}
-
-.data-grid.timeline td:not(:last-child) {
- border-right: 1px solid rgb(179, 179, 179);
-}
-
-.data-grid.timeline:focus tr.selected td:not(:last-child) {
- border-right-color: rgb(53, 109, 189);
-}
-
-.data-grid.timeline th.sort-ascending > div:first-child,
-.data-grid.timeline th.sort-descending > div:first-child {
- padding-right: 13px;
-}
-
-.data-grid.timeline th.sort-ascending > div:first-child::after,
-.data-grid.timeline th.sort-descending > div:first-child::after {
- top: 1px;
-}
-
-.data-grid.timeline td.error {
- color: rgb(224, 16, 16);
-}
-
-.data-grid.timeline tr.selected td.error {
- color: inherit;
-}
-
-.data-grid.timeline td .icon {
- display: inline-block;
- vertical-align: top;
-
- width: 16px;
- height: 16px;
-
- margin-right: 2px;
-}
-
-.data-grid.timeline td .go-to-arrow {
- float: right;
-
- visibility: hidden;
-
- margin-left: 2px;
-}
-
-.data-grid.timeline tr.selected .go-to-arrow,
-.data-grid.timeline tr:hover .go-to-arrow {
- visibility: visible;
-}
-
-.data-grid.timeline td .subtitle {
- color: rgba(0, 0, 0, 0.7);
-}
-
-.data-grid.timeline td .subtitle::before {
- content: " — ";
-}
-
-.data-grid.timeline:focus tr.selected td .subtitle {
- color: rgba(255, 255, 255, 0.9);
-}
-
-.data-grid.timeline > .navigation-bar-container {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- height: 32px;
-
- pointer-events: none;
- visibility: hidden;
-}
-
-.data-grid.timeline:hover > .navigation-bar-container {
- pointer-events: all;
- visibility: visible;
-}
-
-.data-grid.timeline > .navigation-bar-container > .navigation-bar {
- position: absolute;
- top: 10px;
- left: 0;
- right: 0;
- height: 22px;
-
- border-bottom: none;
- border-top: 1px solid rgb(200, 200, 200);
- box-shadow: none;
-
- background-color: white;
-}
-
-.timeline-data-grid-tree-outline {
- position: relative;
- padding: 0;
- margin: 0;
- outline: none;
- list-style: none;
- font-family: "Lucida Grande", "Helvetica", sans-serif;
- font-size: 11px;
-}
-
-.timeline-data-grid-tree-outline .item {
- position: relative;
- height: 36px;
- line-height: 34px;
- padding: 0 5px;
- border-top: 1px solid transparent;
- white-space: nowrap;
-}
-
-.timeline-data-grid-tree-outline > .children,
-.timeline-data-grid-tree-outline .disclosure-button,
-.timeline-data-grid-tree-outline .item .status {
- display: none;
-}
-
-.timeline-data-grid-tree-outline .item .icon {
- float: left;
- width: 32px;
- height: 32px;
- margin-top: 1px;
- margin-right: 3px;
-}
-
-.timeline-data-grid-tree-outline .item:hover {
- color: white;
- border-radius: 4px;
- box-shadow: inset rgb(87, 152, 206) 0 1px 0;
- background: -webkit-linear-gradient(top, rgb(110, 167, 216), rgb(36, 114, 181));
- background-origin: padding-box;
- background-clip: padding-box;
- text-shadow: rgb(51, 88, 123) 0 1px 0;
- -webkit-text-stroke: 0.4px;
-}
-
-.timeline-data-grid-tree-outline .item .titles {
- position: relative;
- top: 5px;
- line-height: 11px;
- padding-bottom: 1px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.timeline-data-grid-tree-outline .item .title::after {
- content: "\A"; /* Newline */
- white-space: pre;
-}
-
-.timeline-data-grid-tree-outline .item .subtitle {
- font-size: 9px;
- color: rgba(0, 0, 0, 0.7);
-}
-
-.timeline-data-grid-tree-outline .item:hover .subtitle {
- color: white;
-}
-
-.timeline-data-grid-tree-outline .item .subtitle:empty {
- display: none;
-}
-
-.timeline-data-grid-tree-outline .item.small {
- height: 20px;
-}
-
-.timeline-data-grid-tree-outline .item.small .icon {
- width: 16px;
- height: 16px;
-}
-
-.timeline-data-grid-tree-outline .item.small .status {
- margin-top: 1px;
-}
-
-.timeline-data-grid-tree-outline .item.small .titles {
- top: 2px;
- line-height: normal;
-}
-
-.timeline-data-grid-tree-outline .item.small .subtitle {
- font-size: inherit;
-}
-
-.timeline-data-grid-tree-outline .item.small:not(.two-line) .title::after {
- content: "";
-}
-
-.timeline-data-grid-tree-outline .item.small:not(.two-line) .subtitle::before {
- content: " — ";
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineDataGridjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,481 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
-{
- WebInspector.DataGrid.call(this, columns, editCallback, deleteCallback);
-
- this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(treeOutline, this, delegate);
-
- this.element.classList.add(WebInspector.TimelineDataGrid.StyleClassName);
-
- this._filterableColumns = [];
-
- // Check if any of the cells can be filtered.
- for (var identifier in columns) {
- var scopeBar = columns[identifier].scopeBar;
- if (!scopeBar)
- continue;
- this._filterableColumns.push(identifier);
- scopeBar.columnIdenfifier = identifier;
- scopeBar.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged, this._scopeBarSelectedItemsDidChange, this);
- }
-
- if (this._filterableColumns.length > 1) {
- console.error("Creating a TimelineDataGrid with more than one filterable column is not yet supported.");
- return;
- }
-
- if (this._filterableColumns.length) {
- var items = [new WebInspector.FlexibleSpaceNavigationItem, this.columns.get(this._filterableColumns[0]).get("scopeBar"), new WebInspector.FlexibleSpaceNavigationItem];
- this._navigationBar = new WebInspector.NavigationBar(null, items);
- var container = this.element.appendChild(document.createElement("div"));
- container.className = "navigation-bar-container";
- container.appendChild(this._navigationBar.element);
- }
-
- this.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridSelectedNodeChanged, this);
- this.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sort, this);
-
- window.addEventListener("resize", this._windowResized.bind(this));
-}
-
-WebInspector.TimelineDataGrid.StyleClassName = "timeline";
-WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout = 250;
-WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout = 500;
-
-WebInspector.TimelineDataGrid.Event = {
- FiltersDidChange: "timelinedatagrid-filters-did-change"
-};
-
-WebInspector.TimelineDataGrid.createColumnScopeBar = function(prefix, dictionary)
-{
- prefix = prefix + "-timeline-data-grid-";
-
- var keys = Object.keys(dictionary).filter(function(key) {
- return typeof dictionary[key] === "string" || dictionary[key] instanceof String;
- });
-
- var scopeBarItems = keys.map(function(key) {
- var value = dictionary[key];
- var id = prefix + value;
- var label = dictionary.displayName(value, true);
- var item = new WebInspector.ScopeBarItem(id, label);
- item.value = value;
- return item;
- });
-
- scopeBarItems.unshift(new WebInspector.ScopeBarItem(prefix + "type-all", WebInspector.UIString("All"), true));
-
- return new WebInspector.ScopeBar(prefix + "scope-bar", scopeBarItems, scopeBarItems[0]);
-};
-
-WebInspector.TimelineDataGrid.prototype = {
- constructor: WebInspector.TimelineDataGrid,
- __proto__: WebInspector.DataGrid.prototype,
-
- // Public
-
- reset: function()
- {
- // May be overridden by subclasses. If so, they should call the superclass.
-
- this._hidePopover();
- },
-
- shown: function()
- {
- // May be overridden by subclasses. If so, they should call the superclass.
-
- this._treeOutlineDataGridSynchronizer.synchronize();
- },
-
- hidden: function()
- {
- // May be overridden by subclasses. If so, they should call the superclass.
-
- this._hidePopover();
- },
-
- treeElementForDataGridNode: function(dataGridNode)
- {
- return this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
- },
-
- dataGridNodeForTreeElement: function(treeElement)
- {
- return this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(treeElement);
- },
-
- callFramePopoverAnchorElement: function()
- {
- // Implemented by subclasses.
- return null;
- },
-
- updateLayout: function()
- {
- WebInspector.DataGrid.prototype.updateLayout.call(this);
-
- if (this._navigationBar)
- this._navigationBar.updateLayout();
- },
-
- treeElementMatchesActiveScopeFilters: function(treeElement)
- {
- var dataGridNode = this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(treeElement);
- console.assert(dataGridNode);
-
- for (var identifier of this._filterableColumns) {
- var scopeBar = this.columns.get(identifier).scopeBar;
- if (!scopeBar || scopeBar.defaultItem.selected)
- continue;
-
- var value = dataGridNode.data[identifier];
- var matchesFilter = scopeBar.selectedItems.some(function(scopeBarItem) {
- return scopeBarItem.value === value;
- });
-
- if (!matchesFilter)
- return false;
- }
-
- return true;
- },
-
- addRowInSortOrder: function(treeElement, dataGridNode, parentElement)
- {
- this._treeOutlineDataGridSynchronizer.associate(treeElement, dataGridNode);
-
- parentElement = parentElement || this._treeOutlineDataGridSynchronizer.treeOutline;
- parentNode = parentElement.root ? this : this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(parentElement);
-
- console.assert(parentNode);
-
- if (this.sortColumnIdentifier) {
- var insertionIndex = insertionIndexForObjectInListSortedByFunction(dataGridNode, parentNode.children, this._sortComparator.bind(this));
-
- // Insert into the parent, which will cause the synchronizer to insert into the data grid.
- parentElement.insertChild(treeElement, insertionIndex);
- } else {
- // Append to the parent, which will cause the synchronizer to append to the data grid.
- parentElement.appendChild(treeElement);
- }
- },
-
- shouldIgnoreSelectionEvent: function()
- {
- return this._ignoreSelectionEvent || false;
- },
-
- // Protected
-
- dataGridNodeNeedsRefresh: function(dataGridNode)
- {
- if (!this._dirtyDataGridNodes)
- this._dirtyDataGridNodes = new Set;
- this._dirtyDataGridNodes.add(dataGridNode);
-
- if (this._scheduledDataGridNodeRefreshIdentifier)
- return;
-
- this._scheduledDataGridNodeRefreshIdentifier = requestAnimationFrame(this._refreshDirtyDataGridNodes.bind(this));
- },
-
- // Private
-
- _refreshDirtyDataGridNodes: function()
- {
- if (this._scheduledDataGridNodeRefreshIdentifier) {
- cancelAnimationFrame(this._scheduledDataGridNodeRefreshIdentifier);
- delete this._scheduledDataGridNodeRefreshIdentifier;
- }
-
- if (!this._dirtyDataGridNodes)
- return;
-
- var selectedNode = this.selectedNode;
- var sortComparator = this._sortComparator.bind(this);
- var treeOutline = this._treeOutlineDataGridSynchronizer.treeOutline;
-
- this._treeOutlineDataGridSynchronizer.enabled = false;
-
- for (var dataGridNode of this._dirtyDataGridNodes) {
- dataGridNode.refresh();
-
- if (!this.sortColumnIdentifier)
- continue;
-
- if (dataGridNode === selectedNode)
- this._ignoreSelectionEvent = true;
-
- var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
- console.assert(treeElement);
-
- treeOutline.removeChild(treeElement);
- this.removeChild(dataGridNode);
-
- var insertionIndex = insertionIndexForObjectInListSortedByFunction(dataGridNode, this.children, sortComparator);
- treeOutline.insertChild(treeElement, insertionIndex);
- this.insertChild(dataGridNode, insertionIndex);
-
- // Adding the tree element back to the tree outline subjects it to filters.
- // Make sure we keep the hidden state in-sync while the synchronizer is disabled.
- dataGridNode.element.classList.toggle("hidden", treeElement.hidden);
-
- if (dataGridNode === selectedNode) {
- selectedNode.revealAndSelect();
- delete this._ignoreSelectionEvent;
- }
- }
-
- this._treeOutlineDataGridSynchronizer.enabled = true;
-
- delete this._dirtyDataGridNodes;
- },
-
- _sort: function()
- {
- var sortColumnIdentifier = this.sortColumnIdentifier;
- if (!sortColumnIdentifier)
- return;
-
- var selectedNode = this.selectedNode;
- this._ignoreSelectionEvent = true;
-
- this._treeOutlineDataGridSynchronizer.enabled = false;
-
- var treeOutline = this._treeOutlineDataGridSynchronizer.treeOutline;
- if (treeOutline.selectedTreeElement)
- treeOutline.selectedTreeElement.deselect(true);
-
- // Collect parent nodes that need their children sorted. So this in two phases since
- // traverseNextNode would get confused if we sort the tree while traversing it.
- var parentDataGridNodes = [this];
- var currentDataGridNode = this.children[0];
- while (currentDataGridNode) {
- if (currentDataGridNode.children.length)
- parentDataGridNodes.push(currentDataGridNode);
- currentDataGridNode = currentDataGridNode.traverseNextNode(false, null, true);
- }
-
- // Sort the children of collected parent nodes.
- for (var parentDataGridNode of parentDataGridNodes) {
- var parentTreeElement = parentDataGridNode === this ? treeOutline : this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(parentDataGridNode);
- console.assert(parentTreeElement);
-
- var childDataGridNodes = parentDataGridNode.children.slice();
-
- parentDataGridNode.removeChildren();
- parentTreeElement.removeChildren();
-
- childDataGridNodes.sort(this._sortComparator.bind(this));
-
- for (var dataGridNode of childDataGridNodes) {
- var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
- console.assert(treeElement);
-
- parentTreeElement.appendChild(treeElement);
- parentDataGridNode.appendChild(dataGridNode);
-
- // Adding the tree element back to the tree outline subjects it to filters.
- // Make sure we keep the hidden state in-sync while the synchronizer is disabled.
- dataGridNode.element.classList.toggle("hidden", treeElement.hidden);
- }
- }
-
- this._treeOutlineDataGridSynchronizer.enabled = true;
-
- if (selectedNode)
- selectedNode.revealAndSelect();
-
- delete this._ignoreSelectionEvent;
- },
-
- _sortComparator: function(node1, node2)
- {
- var sortColumnIdentifier = this.sortColumnIdentifier;
- if (!sortColumnIdentifier)
- return 0;
-
- var sortDirection = this.sortOrder === "ascending" ? 1 : -1;
-
- var value1 = node1.data[sortColumnIdentifier];
- var value2 = node2.data[sortColumnIdentifier];
-
- if (typeof value1 === "number" && typeof value2 === "number") {
- if (isNaN(value1) && isNaN(value2))
- return 0;
- if (isNaN(value1))
- return -sortDirection;
- if (isNaN(value2))
- return sortDirection;
- return (value1 - value2) * sortDirection;
- }
-
- if (typeof value1 === "string" && typeof value2 === "string")
- return value1.localeCompare(value2) * sortDirection;
-
- if (value1 instanceof WebInspector.CallFrame || value2 instanceof WebInspector.CallFrame) {
- // Sort by function name if available, then fall back to the source code object.
- value1 = value1 && value1.functionName ? value1.functionName : (value1 && value1.sourceCodeLocation ? value1.sourceCodeLocation.sourceCode : "");
- value2 = value2 && value2.functionName ? value2.functionName : (value2 && value2.sourceCodeLocation ? value2.sourceCodeLocation.sourceCode : "");
- }
-
- if (value1 instanceof WebInspector.SourceCode || value2 instanceof WebInspector.SourceCode) {
- value1 = value1 ? value1.displayName || "" : "";
- value2 = value2 ? value2.displayName || "" : "";
- }
-
- // For everything else (mostly booleans).
- return (value1 < value2 ? -1 : (value1 > value2 ? 1 : 0)) * sortDirection;
- },
-
- _scopeBarSelectedItemsDidChange: function(event)
- {
- var columnIdentifier = event.target.columnIdenfifier;
- this.dispatchEventToListeners(WebInspector.TimelineDataGrid.Event.FiltersDidChange, {columnIdentifier: columnIdentifier});
- },
-
- _dataGridSelectedNodeChanged: function(event)
- {
- if (!this.selectedNode) {
- this._hidePopover();
- return;
- }
-
- var record = this.selectedNode.record;
- if (!record || !record.callFrames || !record.callFrames.length) {
- this._hidePopover();
- return;
- }
-
- this._showPopoverForSelectedNodeSoon();
- },
-
- _windowResized: function(event)
- {
- if (this._popover && this._popover.visible)
- this._updatePopoverForSelectedNode(false);
- },
-
- _showPopoverForSelectedNodeSoon: function()
- {
- if (this._showPopoverTimeout)
- return;
-
- function delayedWork()
- {
- if (!this._popover)
- this._popover = new WebInspector.Popover;
-
- this._updatePopoverForSelectedNode(true);
- }
-
- this._showPopoverTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout);
- },
-
- _hidePopover: function()
- {
- if (this._showPopoverTimeout) {
- clearTimeout(this._showPopoverTimeout);
- delete this._showPopoverTimeout;
- }
-
- if (this._popover)
- this._popover.dismiss();
-
- function delayedWork()
- {
- if (this._popoverCallStackTreeOutline)
- this._popoverCallStackTreeOutline.removeChildren();
- }
-
- if (this._hidePopoverContentClearTimeout)
- clearTimeout(this._hidePopoverContentClearTimeout);
- this._hidePopoverContentClearTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout);
- },
-
- _updatePopoverForSelectedNode: function(updateContent)
- {
- if (!this._popover || !this.selectedNode)
- return;
-
- var targetPopoverElement = this.callFramePopoverAnchorElement();
- console.assert(targetPopoverElement, "TimelineDataGrid subclass should always return a valid element from callFramePopoverAnchorElement.");
- if (!targetPopoverElement)
- return;
-
- var targetFrame = WebInspector.Rect.rectFromClientRect(targetPopoverElement.getBoundingClientRect());
-
- // The element might be hidden if it does not have a width and height.
- if (!targetFrame.size.width && !targetFrame.size.height)
- return;
-
- if (this._hidePopoverContentClearTimeout) {
- clearTimeout(this._hidePopoverContentClearTimeout);
- delete this._hidePopoverContentClearTimeout;
- }
-
- if (updateContent)
- this._popover.content = this._createPopoverContent();
-
- this._popover.present(targetFrame.pad(2), [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
- },
-
- _createPopoverContent: function()
- {
- if (!this._popoverCallStackTreeOutline) {
- var contentElement = document.createElement("ol");
- contentElement.classList.add("timeline-data-grid-tree-outline");
- this._popoverCallStackTreeOutline = new TreeOutline(contentElement);
- this._popoverCallStackTreeOutline.onselect = this._popoverCallStackTreeElementSelected.bind(this);
- } else
- this._popoverCallStackTreeOutline.removeChildren();
-
- var callFrames = this.selectedNode.record.callFrames;
- for (var i = 0 ; i < callFrames.length; ++i) {
- var callFrameTreeElement = new WebInspector.CallFrameTreeElement(callFrames[i]);
- this._popoverCallStackTreeOutline.appendChild(callFrameTreeElement);
- }
-
- var content = document.createElement("div");
- content.className = "timeline-data-grid-popover";
- content.appendChild(this._popoverCallStackTreeOutline.element);
- return content;
- },
-
- _popoverCallStackTreeElementSelected: function(treeElement, selectedByUser)
- {
- this._popover.dismiss();
-
- console.assert(treeElement instanceof WebInspector.CallFrameTreeElement, "TreeElements in TimelineDataGrid popover should always be CallFrameTreeElements");
- var callFrame = treeElement.callFrame;
- if (!callFrame.sourceCodeLocation)
- return;
-
- WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineDataGridNodejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,346 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineDataGridNode = function(graphOnly, graphDataSource, hasChildren)
-{
- WebInspector.DataGridNode.call(this, {}, hasChildren);
-
- this._graphOnly = graphOnly || false;
- this._graphDataSource = graphDataSource || null;
-
- if (graphDataSource) {
- this._graphContainerElement = document.createElement("div");
- this._timelineRecordBars = [];
- }
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.TimelineDataGridNode);
-
-WebInspector.TimelineDataGridNode.prototype = {
- constructor: WebInspector.TimelineDataGridNode,
- __proto__: WebInspector.DataGridNode.prototype,
-
- // Public
-
- get records()
- {
- // Implemented by subclasses.
- return [];
- },
-
- get graphDataSource()
- {
- return this._graphDataSource;
- },
-
- get data()
- {
- if (!this._graphDataSource)
- return {};
-
- var records = this.records || [];
- return {graph: records.length ? records[0].startTime : 0};
- },
-
- collapse: function()
- {
- WebInspector.DataGridNode.prototype.collapse.call(this);
-
- if (!this._graphDataSource || !this.revealed)
- return;
-
- // Refresh to show child bars in our graph now that we collapsed.
- this.refreshGraph();
- },
-
- expand: function()
- {
- WebInspector.DataGridNode.prototype.expand.call(this);
-
- if (!this._graphDataSource || !this.revealed)
- return;
-
- // Refresh to remove child bars from our graph now that we expanded.
- this.refreshGraph();
-
- // Refresh child graphs since they haven't been updating while we were collapsed.
- var childNode = this.children[0];
- while (childNode) {
- if (childNode instanceof WebInspector.TimelineDataGridNode)
- childNode.refreshGraph();
- childNode = childNode.traverseNextNode(true, this);
- }
- },
-
- createCellContent: function(columnIdentifier, cell)
- {
- if (columnIdentifier === "graph" && this._graphDataSource) {
- this.needsGraphRefresh();
- return this._graphContainerElement;
- }
-
- var value = this.data[columnIdentifier];
- if (!value)
- return "\u2014";
-
- if (value instanceof WebInspector.SourceCodeLocation) {
- if (value.sourceCode instanceof WebInspector.Resource) {
- cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- cell.classList.add(value.sourceCode.type);
- } else if (value.sourceCode instanceof WebInspector.Script) {
- if (value.sourceCode.url) {
- cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- cell.classList.add(WebInspector.Resource.Type.Script);
- } else
- cell.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
- } else
- console.error("Unknown SourceCode subclass.");
-
- // Give the whole cell a tooltip and keep it up to date.
- value.populateLiveDisplayLocationTooltip(cell);
-
- var fragment = document.createDocumentFragment();
-
- var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(value, false, true);
- fragment.appendChild(goToArrowButtonLink);
-
- var icon = document.createElement("div");
- icon.className = WebInspector.ScriptTimelineDataGridNode.IconStyleClassName;
- fragment.appendChild(icon);
-
- var titleElement = document.createElement("span");
- value.populateLiveDisplayLocationString(titleElement, "textContent");
- fragment.appendChild(titleElement);
-
- return fragment;
- }
-
- if (value instanceof WebInspector.CallFrame) {
- var callFrame = value;
-
- var isAnonymousFunction = false;
- var functionName = callFrame.functionName;
- if (!functionName) {
- functionName = WebInspector.UIString("(anonymous function)");
- isAnonymousFunction = true;
- }
-
- cell.classList.add(WebInspector.CallFrameTreeElement.FunctionIconStyleClassName);
-
- var fragment = document.createDocumentFragment();
-
- if (callFrame.sourceCodeLocation && callFrame.sourceCodeLocation.sourceCode) {
- // Give the whole cell a tooltip and keep it up to date.
- callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(cell);
-
- var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(callFrame.sourceCodeLocation, false, true);
- fragment.appendChild(goToArrowButtonLink);
-
- var icon = document.createElement("div");
- icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
- fragment.appendChild(icon);
-
- if (isAnonymousFunction) {
- // For anonymous functions we show the resource or script icon and name.
- if (callFrame.sourceCodeLocation.sourceCode instanceof WebInspector.Resource) {
- cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- cell.classList.add(callFrame.sourceCodeLocation.sourceCode.type);
- } else if (callFrame.sourceCodeLocation.sourceCode instanceof WebInspector.Script) {
- if (callFrame.sourceCodeLocation.sourceCode.url) {
- cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
- cell.classList.add(WebInspector.Resource.Type.Script);
- } else
- cell.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
- } else
- console.error("Unknown SourceCode subclass.");
-
- var titleElement = document.createElement("span");
- callFrame.sourceCodeLocation.populateLiveDisplayLocationString(titleElement, "textContent");
-
- fragment.appendChild(titleElement);
- } else {
- // Show the function name and icon.
- cell.classList.add(WebInspector.CallFrameTreeElement.FunctionIconStyleClassName);
-
- fragment.appendChild(document.createTextNode(functionName));
-
- var subtitleElement = document.createElement("span");
- subtitleElement.className = WebInspector.LayoutTimelineDataGridNode.SubtitleStyleClassName;
- callFrame.sourceCodeLocation.populateLiveDisplayLocationString(subtitleElement, "textContent");
-
- fragment.appendChild(subtitleElement);
- }
-
- return fragment;
- }
-
- var icon = document.createElement("div");
- icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
- fragment.appendChild(icon);
-
- fragment.appendChild(document.createTextNode(functionName));
-
- return fragment;
- }
-
- return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
- },
-
- refresh: function()
- {
- if (this._graphDataSource && this._graphOnly) {
- this.needsGraphRefresh();
- return;
- }
-
- WebInspector.DataGridNode.prototype.refresh.call(this);
- },
-
- refreshGraph: function()
- {
- if (!this._graphDataSource)
- return;
-
- if (this._scheduledGraphRefreshIdentifier) {
- cancelAnimationFrame(this._scheduledGraphRefreshIdentifier);
- delete this._scheduledGraphRefreshIdentifier;
- }
-
- // We are not visible, but an ancestor will draw our graph.
- // They need notified by using our needsGraphRefresh.
- console.assert(this.revealed);
- if (!this.revealed)
- return;
-
- var startTime = this._graphDataSource.startTime;
- var currentTime = this._graphDataSource.currentTime;
- var endTime = this._graphDataSource.endTime;
- var duration = endTime - startTime;
- var visibleWidth = this._graphContainerElement.offsetWidth;
- var secondsPerPixel = duration / visibleWidth;
- var recordBarIndex = 0;
-
- function createBar(records, renderMode)
- {
- var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
- if (!timelineRecordBar)
- timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
- timelineRecordBar.renderMode = renderMode;
- timelineRecordBar.records = records;
- timelineRecordBar.refresh(this._graphDataSource);
- if (!timelineRecordBar.element.parentNode)
- this._graphContainerElement.appendChild(timelineRecordBar.element);
- ++recordBarIndex;
- }
-
- var boundCreateBar = createBar.bind(this);
-
- if (this.expanded) {
- // When expanded just use the records for this node.
- WebInspector.TimelineRecordBar.createCombinedBars(this.records, secondsPerPixel, this._graphDataSource, boundCreateBar);
- } else {
- // When collapsed use the records for this node and its descendants.
- // To share bars better, group records by type.
-
- var recordTypeMap = new Map;
-
- function collectRecordsByType(records)
- {
- for (var record of records) {
- var typedRecords = recordTypeMap.get(record.type);
- if (!typedRecords) {
- typedRecords = [];
- recordTypeMap.set(record.type, typedRecords);
- }
-
- typedRecords.push(record);
- }
- }
-
- collectRecordsByType(this.records);
-
- var childNode = this.children[0];
- while (childNode) {
- if (childNode instanceof WebInspector.TimelineDataGridNode)
- collectRecordsByType(childNode.records);
- childNode = childNode.traverseNextNode(false, this);
- }
-
- for (var records of recordTypeMap.values())
- WebInspector.TimelineRecordBar.createCombinedBars(records, secondsPerPixel, this._graphDataSource, boundCreateBar);
- }
-
- // Remove the remaining unused TimelineRecordBars.
- for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
- this._timelineRecordBars[recordBarIndex].records = null;
- this._timelineRecordBars[recordBarIndex].element.remove();
- }
- },
-
- needsGraphRefresh: function()
- {
- if (!this.revealed) {
- // We are not visible, but an ancestor will be drawing our graph.
- // Notify the next visible ancestor that their graph needs to refresh.
- var ancestor = this;
- while (ancestor && !ancestor.root) {
- if (ancestor.revealed && ancestor instanceof WebInspector.TimelineDataGridNode) {
- ancestor.needsGraphRefresh();
- return;
- }
-
- ancestor = ancestor.parent;
- }
-
- return;
- }
-
- if (!this._graphDataSource || this._scheduledGraphRefreshIdentifier)
- return;
-
- this._scheduledGraphRefreshIdentifier = requestAnimationFrame(this.refreshGraph.bind(this));
- },
-
- // Protected
-
- isRecordVisible: function(record)
- {
- if (!this._graphDataSource)
- return false;
-
- if (isNaN(record.startTime))
- return false;
-
- // If this bar is completely before the bounds of the graph, not visible.
- if (record.endTime < this.graphDataSource.startTime)
- return false;
-
- // If this record is completely after the current time or end time, not visible.
- if (record.startTime > this.graphDataSource.currentTime || record.startTime > this.graphDataSource.endTime)
- return false;
-
- return true;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineIconscss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineIcons.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineIcons.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.network-icon .icon {
- content: -webkit-image-set(url(Images/Network.png) 1x, url(Images/Network@2x.png) 2x);
-}
-
-.network-icon.large .icon {
- content: -webkit-image-set(url(Images/NetworkLarge.png) 1x, url(Images/NetworkLarge@2x.png) 2x);
-}
-
-.colors-icon .icon {
- content: -webkit-image-set(url(Images/Colors.png) 1x, url(Images/Colors@2x.png) 2x);
-}
-
-.colors-icon.large .icon {
- content: -webkit-image-set(url(Images/ColorsLarge.png) 1x, url(Images/ColorsLarge@2x.png) 2x);
-}
-
-.script-icon .icon {
- content: -webkit-image-set(url(Images/Script.png) 1x, url(Images/Script@2x.png) 2x);
-}
-
-.script-icon.large .icon {
- content: -webkit-image-set(url(Images/ScriptLarge.png) 1x, url(Images/ScriptLarge@2x.png) 2x);
-}
-
-.stopwatch-icon .icon {
- content: -webkit-image-set(url(Images/Stopwatch.png) 1x, url(Images/Stopwatch@2x.png) 2x);
-}
-
-.profile-icon .icon {
- content: -webkit-image-set(url(Images/Profile.png) 1x, url(Images/Profile@2x.png) 2x);
-}
-
-.style-record .icon {
- content: url(Images/TimelineRecordStyle.svg);
-}
-
-.layout-record .icon {
- content: url(Images/TimelineRecordLayout.svg);
-}
-
-.paint-record .icon {
- content: url(Images/TimelineRecordPaint.svg);
-}
-
-.evaluated-record .icon {
- content: url(Images/TimelineRecordScriptEvaluated.svg);
-}
-
-.event-record .icon {
- content: url(Images/TimelineRecordEvent.svg);
-}
-
-.timer-record .icon {
- content: url(Images/TimelineRecordTimer.svg);
-}
-
-.animation-record .icon {
- content: url(Images/TimelineRecordAnimation.svg);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineManagerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineManager.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineManager.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineManager.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,521 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineManager = function()
-{
- WebInspector.Object.call(this);
-
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ProvisionalLoadStarted, this._startAutoRecording, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
-
- this._recording = new WebInspector.TimelineRecording;
- this._recordingEnabled = false;
-};
-
-WebInspector.TimelineManager.Event = {
- RecordingStarted: "timeline-manager-recording-started",
- RecordingStopped: "timeline-manager-recording-stopped"
-};
-
-WebInspector.TimelineManager.MaximumAutoRecordDuration = 90000; // 90 seconds
-WebInspector.TimelineManager.MaximumAutoRecordDurationAfterLoadEvent = 10000; // 10 seconds
-WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly = 2000; // 2 seconds
-
-WebInspector.TimelineManager.prototype = {
- constructor: WebInspector.TimelineManager,
-
- // Public
-
- get recording()
- {
- return this._recording;
- },
-
- get recordingEnabled()
- {
- return this._recordingEnabled;
- },
-
- startRecording: function()
- {
- if (this._recordingEnabled)
- return;
-
- this._recordingEnabled = true;
-
- TimelineAgent.start();
-
- this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingStarted);
- },
-
- stopRecording: function()
- {
- if (!this._recordingEnabled)
- return;
-
- if (this._stopRecordingTimeout) {
- clearTimeout(this._stopRecordingTimeout);
- delete this._stopRecordingTimeout;
- }
-
- if (this._deadTimeTimeout) {
- clearTimeout(this._deadTimeTimeout);
- delete this._deadTimeTimeout;
- }
-
- TimelineAgent.stop();
-
- this._recordingEnabled = false;
- this._autoRecordingMainResource = null;
-
- this.dispatchEventToListeners(WebInspector.TimelineManager.Event.RecordingStopped);
- },
-
- eventRecorded: function(originalRecordPayload)
- {
- // Called from WebInspector.TimelineObserver.
-
- if (!this._recordingEnabled)
- return;
-
- function processRecord(recordPayload, parentRecordPayload)
- {
- // Convert the timestamps to seconds to match the resource timestamps.
- var startTime = recordPayload.startTime / 1000;
- var endTime = recordPayload.endTime / 1000;
-
- var callFrames = this._callFramesFromPayload(recordPayload.stackTrace);
-
- var significantCallFrame = null;
- if (callFrames) {
- for (var i = 0; i < callFrames.length; ++i) {
- if (callFrames[i].nativeCode)
- continue;
- significantCallFrame = callFrames[i];
- break;
- }
- }
-
- var sourceCodeLocation = significantCallFrame && significantCallFrame.sourceCodeLocation;
-
- switch (recordPayload.type) {
- case TimelineAgent.EventType.MarkLoad:
- console.assert(isNaN(endTime));
-
- var frame = WebInspector.frameResourceManager.frameForIdentifier(recordPayload.frameId);
- console.assert(frame);
- if (!frame)
- break;
-
- frame.markLoadEvent(startTime);
-
- if (!frame.isMainFrame())
- break;
-
- var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.LoadEvent);
- this._recording.addEventMarker(eventMarker);
-
- this._stopAutoRecordingSoon();
- break;
-
- case TimelineAgent.EventType.MarkDOMContent:
- console.assert(isNaN(endTime));
-
- var frame = WebInspector.frameResourceManager.frameForIdentifier(recordPayload.frameId);
- console.assert(frame);
- if (!frame)
- break;
-
- frame.markDOMContentReadyEvent(startTime);
-
- if (!frame.isMainFrame())
- break;
-
- var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.DOMContentEvent);
- this._recording.addEventMarker(eventMarker);
- break;
-
- case TimelineAgent.EventType.ScheduleStyleRecalculation:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles, startTime, startTime, callFrames, sourceCodeLocation));
- break;
-
- case TimelineAgent.EventType.RecalculateStyles:
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles, startTime, endTime, callFrames, sourceCodeLocation));
- break;
-
- case TimelineAgent.EventType.InvalidateLayout:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout, startTime, startTime, callFrames, sourceCodeLocation));
- break;
-
- case TimelineAgent.EventType.Layout:
- // COMPATIBILITY (iOS 6): Layout records did not contain area properties. This is not exposed via a quad "root".
- var quad = recordPayload.data.root ? new WebInspector.Quad(recordPayload.data.root) : null;
- if (quad)
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Layout, startTime, endTime, callFrames, sourceCodeLocation, quad.points[0].x, quad.points[0].y, quad.width, quad.height, quad));
- else
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Layout, startTime, endTime, callFrames, sourceCodeLocation));
- break;
-
- case TimelineAgent.EventType.Paint:
- // COMPATIBILITY (iOS 6): Paint records data contained x, y, width, height properties. This became a quad "clip".
- var quad = recordPayload.data.clip ? new WebInspector.Quad(recordPayload.data.clip) : null;
- if (quad)
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad));
- else
- this._addRecord(new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.x, recordPayload.data.y, recordPayload.data.width, recordPayload.data.height));
- break;
-
- case TimelineAgent.EventType.EvaluateScript:
- if (!sourceCodeLocation) {
- var mainFrame = WebInspector.frameResourceManager.mainFrame;
- var scriptResource = mainFrame.url === recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.url, true);
- if (scriptResource) {
- // The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = recordPayload.data.lineNumber - 1;
-
- // FIXME: No column number is provided.
- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
- }
- }
-
- var profile = null;
- if (recordPayload.data.profile)
- profile = this._profileFromPayload(recordPayload.data.profile);
-
- switch (parentRecordPayload && parentRecordPayload.type) {
- case TimelineAgent.EventType.TimerFire:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profile));
- break;
- default:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated, startTime, endTime, callFrames, sourceCodeLocation, null, profile));
- break;
- }
-
- break;
-
- case TimelineAgent.EventType.TimeStamp:
- var eventMarker = new WebInspector.TimelineMarker(startTime, WebInspector.TimelineMarker.Type.TimeStamp);
- this._recording.addEventMarker(eventMarker);
- break;
-
- case TimelineAgent.EventType.FunctionCall:
- // FunctionCall always happens as a child of another record, and since the FunctionCall record
- // has useful info we just make the timeline record here (combining the data from both records).
- if (!parentRecordPayload)
- break;
-
- var profile = null;
- if (recordPayload.data.profile)
- profile = this._profileFromPayload(recordPayload.data.profile);
-
- if (!sourceCodeLocation) {
- var mainFrame = WebInspector.frameResourceManager.mainFrame;
- var scriptResource = mainFrame.url === recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.scriptName, true);
- if (scriptResource) {
- // The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = recordPayload.data.scriptLine - 1;
-
- // FIXME: No column number is provided.
- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0);
- }
- }
-
- switch (parentRecordPayload.type) {
- case TimelineAgent.EventType.TimerFire:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.timerId, profile));
- break;
- case TimelineAgent.EventType.EventDispatch:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profile));
- break;
- case TimelineAgent.EventType.XHRLoad:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "load", profile));
- break;
- case TimelineAgent.EventType.XHRReadyStateChange:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, "readystatechange", profile));
- break;
- case TimelineAgent.EventType.FireAnimationFrame:
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.id, profile));
- break;
- }
-
- break;
-
- case TimelineAgent.EventType.TimerInstall:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerInstalled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
- break;
-
- case TimelineAgent.EventType.TimerRemove:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerRemoved, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
- break;
-
- case TimelineAgent.EventType.RequestAnimationFrame:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
- break;
-
- case TimelineAgent.EventType.CancelAnimationFrame:
- console.assert(isNaN(endTime));
-
- // Pass the startTime as the endTime since this record type has no duration.
- this._addRecord(new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled, startTime, startTime, callFrames, sourceCodeLocation, recordPayload.data.timerId));
- break;
- }
- }
-
- // Iterate over the records tree using a stack. Doing this recursively has
- // been known to cause a call stack overflow. https://webkit.org/b/79106
- var stack = [{array: [originalRecordPayload], parent: null, index: 0}];
- while (stack.length) {
- var entry = stack.lastValue;
- var recordPayloads = entry.array;
- var parentRecordPayload = entry.parent;
-
- if (entry.index < recordPayloads.length) {
- var recordPayload = recordPayloads[entry.index];
-
- processRecord.call(this, recordPayload, parentRecordPayload);
-
- if (recordPayload.children)
- stack.push({array: recordPayload.children, parent: recordPayload, index: 0});
- ++entry.index;
- } else
- stack.pop();
- }
- },
-
- pageDidLoad: function(timestamp)
- {
- if (isNaN(WebInspector.frameResourceManager.mainFrame.loadEventTimestamp))
- WebInspector.frameResourceManager.mainFrame.markLoadEvent(timestamp);
- },
-
- // Private
-
- _profileFromPayload: function(payload)
- {
- if (!payload)
- return null;
-
- console.assert(payload.rootNodes instanceof Array);
-
- function profileNodeFromPayload(nodePayload)
- {
- console.assert("id" in nodePayload);
- console.assert(nodePayload.calls instanceof Array);
-
- if (nodePayload.url) {
- var sourceCode = WebInspector.frameResourceManager.resourceForURL(nodePayload.url);
- if (!sourceCode)
- sourceCode = WebInspector.debuggerManager.scriptsForURL(nodePayload.url)[0];
-
- // The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = nodePayload.lineNumber - 1;
-
- var sourceCodeLocation = sourceCode ? sourceCode.createSourceCodeLocation(lineNumber, nodePayload.columnNumber) : null;
- }
-
- var isProgramCode = nodePayload.functionName === "(program)";
- var isAnonymousFunction = nodePayload.functionName === "(anonymous function)";
-
- var type = isProgramCode ? WebInspector.ProfileNode.Type.Program : WebInspector.ProfileNode.Type.Function;
- var functionName = !isProgramCode && !isAnonymousFunction && nodePayload.functionName !== "(unknown)" ? nodePayload.functionName : null;
- var calls = nodePayload.calls.map(profileNodeCallFromPayload);
-
- return new WebInspector.ProfileNode(nodePayload.id, type, functionName, sourceCodeLocation, calls, nodePayload.children);
- }
-
- function profileNodeCallFromPayload(nodeCallPayload)
- {
- console.assert("startTime" in nodeCallPayload);
- console.assert("totalTime" in nodeCallPayload);
-
- return new WebInspector.ProfileNodeCall(nodeCallPayload.startTime, nodeCallPayload.totalTime);
- }
-
- var rootNodes = payload.rootNodes;
-
- // Iterate over the node tree using a stack. Doing this recursively can easily cause a stack overflow.
- // We traverse the profile in post-order and convert the payloads in place until we get back to the root.
- var stack = [{parent: {children: rootNodes}, index: 0, root: true}];
- while (stack.length) {
- var entry = stack.lastValue;
-
- if (entry.index < entry.parent.children.length) {
- var childNodePayload = entry.parent.children[entry.index];
- if (childNodePayload.children && childNodePayload.children.length)
- stack.push({parent: childNodePayload, index: 0});
-
- ++entry.index;
- } else {
- if (!entry.root)
- entry.parent.children = entry.parent.children.map(profileNodeFromPayload);
- else
- rootNodes = rootNodes.map(profileNodeFromPayload);
-
- stack.pop();
- }
- }
-
- return new WebInspector.Profile(rootNodes, payload.idleTime);
- },
-
- _callFramesFromPayload: function(payload)
- {
- if (!payload)
- return null;
-
- function createCallFrame(payload)
- {
- var url = payload.url;
- var nativeCode = false;
-
- if (url === "[native code]") {
- nativeCode = true;
- url = null;
- }
-
- var sourceCode = WebInspector.frameResourceManager.resourceForURL(url);
- if (!sourceCode)
- sourceCode = WebInspector.debuggerManager.scriptsForURL(url)[0];
-
- // The lineNumber is 1-based, but we expect 0-based.
- var lineNumber = payload.lineNumber - 1;
-
- var sourceCodeLocation = sourceCode ? sourceCode.createSourceCodeLocation(lineNumber, payload.columnNumber) : null;
- var functionName = payload.functionName !== "global code" ? payload.functionName : null;
-
- return new WebInspector.CallFrame(null, sourceCodeLocation, functionName, null, null, nativeCode);
- }
-
- return payload.map(createCallFrame);
- },
-
- _addRecord: function(record)
- {
- this._recording.addRecord(record);
-
- // Only worry about dead time after the load event.
- if (!isNaN(WebInspector.frameResourceManager.mainFrame.loadEventTimestamp))
- this._resetAutoRecordingDeadTimeTimeout();
- },
-
- _startAutoRecording: function(event)
- {
- if (!event.target.isMainFrame() || (this._recordingEnabled && !this._autoRecordingMainResource))
- return false;
-
- var mainResource = event.target.provisionalMainResource || event.target.mainResource;
- if (mainResource === this._autoRecordingMainResource)
- return false;
-
- this.stopRecording();
-
- this._autoRecordingMainResource = mainResource;
-
- this._recording.reset();
-
- this.startRecording();
-
- this._addRecord(new WebInspector.ResourceTimelineRecord(mainResource));
-
- if (this._stopRecordingTimeout)
- clearTimeout(this._stopRecordingTimeout);
- this._stopRecordingTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.MaximumAutoRecordDuration);
-
- return true;
- },
-
- _stopAutoRecordingSoon: function()
- {
- // Only auto stop when auto recording.
- if (!this._recordingEnabled || !this._autoRecordingMainResource)
- return;
-
- if (this._stopRecordingTimeout)
- clearTimeout(this._stopRecordingTimeout);
- this._stopRecordingTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.MaximumAutoRecordDurationAfterLoadEvent);
- },
-
- _resetAutoRecordingDeadTimeTimeout: function()
- {
- // Only monitor dead time when auto recording.
- if (!this._recordingEnabled || !this._autoRecordingMainResource)
- return;
-
- if (this._deadTimeTimeout)
- clearTimeout(this._deadTimeTimeout);
- this._deadTimeTimeout = setTimeout(this.stopRecording.bind(this), WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly);
- },
-
- _mainResourceDidChange: function(event)
- {
- // Ignore resource events when there isn't a main frame yet. Those events are triggered by
- // loading the cached resources when the inspector opens, and they do not have timing information.
- if (!WebInspector.frameResourceManager.mainFrame)
- return;
-
- if (this._startAutoRecording(event))
- return;
-
- if (!this._recordingEnabled)
- return;
-
- var mainResource = event.target.mainResource;
- if (mainResource === this._autoRecordingMainResource)
- return;
-
- this._addRecord(new WebInspector.ResourceTimelineRecord(mainResource));
- },
-
- _resourceWasAdded: function(event)
- {
- // Ignore resource events when there isn't a main frame yet. Those events are triggered by
- // loading the cached resources when the inspector opens, and they do not have timing information.
- if (!WebInspector.frameResourceManager.mainFrame)
- return;
-
- if (!this._recordingEnabled)
- return;
-
- this._addRecord(new WebInspector.ResourceTimelineRecord(event.data.resource));
- }
-};
-
-WebInspector.TimelineManager.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineMarkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineMarker.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineMarker.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineMarker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,72 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineMarker = function(time, type)
-{
- WebInspector.Object.call(this);
-
- console.assert(type);
-
- this._time = time || 0;
- this._type = type;
-};
-
-WebInspector.TimelineMarker.Event = {
- TimeChanged: "timeline-marker-time-changed"
-};
-
-WebInspector.TimelineMarker.Type = {
- CurrentTime: "current-time",
- LoadEvent: "load-event",
- DOMContentEvent: "dom-content-event",
- TimeStamp: "timestamp"
-};
-
-WebInspector.TimelineMarker.prototype = {
- constructor: WebInspector.TimelineMarker,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get time()
- {
- return this._time;
- },
-
- set time(x)
- {
- if (this._time === x)
- return;
-
- this._time = x || 0;
-
- this.dispatchEventToListeners(WebInspector.TimelineMarker.Event.TimeChanged);
- },
-
- get type()
- {
- return this._type;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineObserverjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineObserver.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineObserver.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineObserver.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineObserver = function()
-{
- WebInspector.Object.call(this);
-};
-
-WebInspector.TimelineObserver.prototype = {
- constructor: WebInspector.TimelineObserver,
-
- // Events defined by the "Timeline" domain.
-
- eventRecorded: function(record)
- {
- WebInspector.timelineManager.eventRecorded(record);
- }
-};
-
-WebInspector.TimelineObserver.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineOverviewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,81 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-overview > .scroll-container {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- height: 16px;
- overflow-x: auto;
- overflow-y: hidden;
- opacity: 0;
-}
-
-.timeline-overview:hover > .scroll-container {
- opacity: 0.75;
-}
-
-.timeline-overview > .scroll-container:hover {
- opacity: 1;
-}
-
-.timeline-overview > .timeline-ruler {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
-}
-
-.timeline-overview > .graphs-container {
- position: absolute;
- top: 22px;
- left: 0;
- bottom: 0;
- right: 0;
-}
-
-.timeline-overview > .graphs-container > .timeline-overview-graph {
- height: 36px;
-}
-
-.timeline-overview > .graphs-container > .timeline-overview-graph:nth-child(even) {
- background-color: rgb(247, 247, 247);
- background-clip: padding-box;
-}
-
-.timeline-overview > .graphs-container > .timeline-overview-graph:not(:first-child) {
- border-top: 1px solid rgba(0, 0, 0, 0.09);
-}
-
-.timeline-overview > .scroll-container > .scroll-width-sizer {
- position: absolute;
- top: 0;
- left: 0;
- height: 1px;
- visibility: hidden;
- pointer-events: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineOverviewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,346 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineOverview = function(timelineOverviewGraphsMap)
-{
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.TimelineOverview.StyleClassName;
- this._element.addEventListener("wheel", this._handleWheelEvent.bind(this));
-
- this._graphsContainer = document.createElement("div");
- this._graphsContainer.className = WebInspector.TimelineOverview.GraphsContainerStyleClassName;
- this._element.appendChild(this._graphsContainer);
-
- this._timelineOverviewGraphsMap = timelineOverviewGraphsMap;
-
- for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values())
- this._graphsContainer.appendChild(timelineOverviewGraph.element);
-
- this._timelineRuler = new WebInspector.TimelineRuler;
- this._timelineRuler.allowsClippedLabels = true;
- this._timelineRuler.allowsTimeRangeSelection = true;
- this._timelineRuler.addEventListener(WebInspector.TimelineRuler.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
- this._element.appendChild(this._timelineRuler.element);
-
- this._currentTimeMarker = new WebInspector.TimelineMarker(0, WebInspector.TimelineMarker.Type.CurrentTime);
- this._timelineRuler.addMarker(this._currentTimeMarker);
-
- this._scrollContainer = document.createElement("div");
- this._scrollContainer.className = WebInspector.TimelineOverview.ScrollContainerStyleClassName;
- this._scrollContainer.addEventListener("scroll", this._handleScrollEvent.bind(this));
- this._element.appendChild(this._scrollContainer);
-
- this._scrollWidthSizer = document.createElement("div");
- this._scrollWidthSizer.className = WebInspector.TimelineOverview.ScrollWidthSizerStyleClassName;
- this._scrollContainer.appendChild(this._scrollWidthSizer);
-
- this._secondsPerPixelSetting = new WebInspector.Setting("timeline-overview-seconds-per-pixel", 0.01);
- this._selectionStartTimeSetting = new WebInspector.Setting("timeline-overview-selection-start-time", 0);
- this._selectionDurationSetting = new WebInspector.Setting("timeline-overview-selection-duration", 5);
-
- this._startTime = 0;
- this._currentTime = 0;
- this._endTime = 0;
- this._secondsPerPixel = this._secondsPerPixelSetting.value;
- this._scrollStartTime = 0;
-
- this.selectionStartTime = this._selectionStartTimeSetting.value;
- this.selectionDuration = this._selectionDurationSetting.value;
-};
-
-WebInspector.TimelineOverview.StyleClassName = "timeline-overview";
-WebInspector.TimelineOverview.GraphsContainerStyleClassName = "graphs-container";
-WebInspector.TimelineOverview.ScrollContainerStyleClassName = "scroll-container";
-WebInspector.TimelineOverview.ScrollWidthSizerStyleClassName = "scroll-width-sizer";
-WebInspector.TimelineOverview.MinimumSecondsPerPixel = 0.001;
-WebInspector.TimelineOverview.ScrollDeltaDenominator = 500;
-
-WebInspector.TimelineOverview.Event = {
- TimeRangeSelectionChanged: "timeline-overview-time-range-selection-changed"
-};
-
-WebInspector.TimelineOverview.prototype = {
- constructor: WebInspector.TimelineOverview,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- set startTime(x)
- {
- if (this._startTime === x)
- return;
-
- this._startTime = x || 0;
-
- this._needsLayout();
- },
-
- get currentTime()
- {
- return this._currentTime;
- },
-
- set currentTime(x)
- {
- if (this._currentTime === x)
- return;
-
- this._currentTime = x || 0;
- this._revealCurrentTime = true;
-
- this._needsLayout();
- },
-
- get secondsPerPixel()
- {
- return this._secondsPerPixel;
- },
-
- set secondsPerPixel(x)
- {
- x = Math.max(WebInspector.TimelineOverview.MinimumSecondsPerPixel, x);
-
- if (this._secondsPerPixel === x)
- return;
-
- this._secondsPerPixel = x;
- this._secondsPerPixelSetting.value = x;
-
- this._needsLayout();
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- set endTime(x)
- {
- if (this._endTime === x)
- return;
-
- this._endTime = x || 0;
-
- this._needsLayout();
- },
-
- get scrollStartTime()
- {
- return this._scrollStartTime;
- },
-
- set scrollStartTime(x)
- {
- if (this._scrollStartTime === x)
- return;
-
- this._scrollStartTime = x || 0;
-
- this._needsLayout();
- },
-
- get visibleDuration()
- {
- return this._scrollContainer.offsetWidth * this._secondsPerPixel;
- },
-
- get selectionStartTime()
- {
- return this._timelineRuler.selectionStartTime;
- },
-
- set selectionStartTime(x)
- {
- x = x || 0;
-
- var selectionDuration = this.selectionDuration;
- this._timelineRuler.selectionStartTime = x;
- this._timelineRuler.selectionEndTime = x + selectionDuration;
- },
-
- get selectionDuration()
- {
- return this._timelineRuler.selectionEndTime - this._timelineRuler.selectionStartTime;
- },
-
- set selectionDuration(x)
- {
- x = Math.max(WebInspector.TimelineRuler.MinimumSelectionTimeRange, x);
- this._timelineRuler.selectionEndTime = this._timelineRuler.selectionStartTime + x;
- },
-
- addMarker: function(marker)
- {
- this._timelineRuler.addMarker(marker);
- },
-
- revealMarker: function(marker)
- {
- this.scrollStartTime = marker.time - (this.visibleDuration / 2);
- },
-
- updateLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
- delete this._scheduledLayoutUpdateIdentifier;
- }
-
- // Calculate the required width based on the duration and seconds per pixel.
- var duration = this._endTime - this._startTime;
- var newWidth = Math.ceil(duration / this._secondsPerPixel);
-
- // Update all relevant elements to the new required width.
- this._updateElementWidth(this._scrollWidthSizer, newWidth);
-
- this._currentTimeMarker.time = this._currentTime;
-
- if (this._revealCurrentTime) {
- this.revealMarker(this._currentTimeMarker);
- delete this._revealCurrentTime;
- }
-
- // Clamp the scroll start time to match what the scroll bar would allow.
- var scrollStartTime = Math.min(this._scrollStartTime, this._endTime - this.visibleDuration);
- scrollStartTime = Math.max(this._startTime, scrollStartTime);
-
- this._timelineRuler.zeroTime = this._startTime;
- this._timelineRuler.startTime = scrollStartTime;
- this._timelineRuler.secondsPerPixel = this._secondsPerPixel;
-
- if (!this._dontUpdateScrollLeft) {
- this._ignoreNextScrollEvent = true;
- this._scrollContainer.scrollLeft = Math.ceil((scrollStartTime - this._startTime) / this._secondsPerPixel);
- }
-
- this._timelineRuler.updateLayout();
-
- for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values()) {
- timelineOverviewGraph.zeroTime = this._startTime;
- timelineOverviewGraph.startTime = scrollStartTime;
- timelineOverviewGraph.currentTime = this._currentTime;
- timelineOverviewGraph.endTime = scrollStartTime + this.visibleDuration;
- timelineOverviewGraph.updateLayout();
- }
- },
-
- updateLayoutIfNeeded: function()
- {
- if (this._scheduledLayoutUpdateIdentifier) {
- this.updateLayout();
- return;
- }
-
- this._timelineRuler.updateLayoutIfNeeded();
-
- for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values())
- timelineOverviewGraph.updateLayoutIfNeeded();
- },
-
- // Private
-
- _updateElementWidth: function(element, newWidth)
- {
- var currentWidth = parseInt(element.style.width);
- if (currentWidth !== newWidth)
- element.style.width = newWidth + "px";
- },
-
- _needsLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier)
- return;
- this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
- },
-
- _handleScrollEvent: function(event)
- {
- if (this._ignoreNextScrollEvent) {
- delete this._ignoreNextScrollEvent;
- return;
- }
-
- this._dontUpdateScrollLeft = true;
-
- var scrollOffset = this._scrollContainer.scrollLeft;
- this.scrollStartTime = this._startTime + (scrollOffset * this._secondsPerPixel);
-
- // Force layout so we can update with the scroll position synchronously.
- this.updateLayoutIfNeeded();
-
- delete this._dontUpdateScrollLeft;
- },
-
- _handleWheelEvent: function(event)
- {
- // Ignore cloned events that come our way, we already handled the original.
- if (event.__cloned)
- return;
-
- // Require twice the vertical delta to overcome horizontal scrolling. This prevents most
- // cases of inadvertent zooming for slightly diagonal scrolls.
- if (Math.abs(event.deltaX) >= Math.abs(event.deltaY) * 0.5) {
- // Clone the event to dispatch it on the scroll container. Mark it as cloned so we don't get into a loop.
- var newWheelEvent = new event.constructor(event.type, event);
- newWheelEvent.__cloned = true;
-
- this._scrollContainer.dispatchEvent(newWheelEvent);
- return;
- }
-
- // Remember the mouse position in time.
- var mouseOffset = event.pageX - this._element.totalOffsetLeft;
- var mousePositionTime = this._scrollStartTime + (mouseOffset * this._secondsPerPixel);
- var deviceDirection = event.webkitDirectionInvertedFromDevice ? 1 : -1;
-
- this.secondsPerPixel += event.deltaY * (this._secondsPerPixel / WebInspector.TimelineOverview.ScrollDeltaDenominator) * deviceDirection;
-
- // Center the zoom around the mouse based on the remembered mouse position time.
- this.scrollStartTime = mousePositionTime - (mouseOffset * this._secondsPerPixel);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _timeRangeSelectionChanged: function(event)
- {
- this._selectionStartTimeSetting.value = this.selectionStartTime - this._startTime;
- this._selectionDurationSetting.value = this.selectionDuration;
-
- this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineOverviewGraphjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineOverviewGraph.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineOverviewGraph.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,141 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineOverviewGraph = function(recording)
-{
- WebInspector.Object.call(this);
-
- this.element = document.createElement("div");
- this.element.classList.add(WebInspector.TimelineOverviewGraph.StyleClassName);
-
- this._zeroTime = 0;
- this._startTime = 0;
- this._endTime = 5;
- this._currentTime = 0;
-};
-
-WebInspector.TimelineOverviewGraph.StyleClassName = "timeline-overview-graph";
-
-WebInspector.TimelineOverviewGraph.prototype = {
- constructor: WebInspector.TimelineOverviewGraph,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get zeroTime()
- {
- return this._zeroTime;
- },
-
- set zeroTime(x)
- {
- if (this._zeroTime === x)
- return;
-
- this._zeroTime = x || 0;
-
- this.needsLayout();
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- set startTime(x)
- {
- if (this._startTime === x)
- return;
-
- this._startTime = x || 0;
-
- this.needsLayout();
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- set endTime(x)
- {
- if (this._endTime === x)
- return;
-
- this._endTime = x || 0;
-
- this.needsLayout();
- },
-
- get currentTime()
- {
- return this._currentTime;
- },
-
- set currentTime(x)
- {
- if (this._currentTime === x)
- return;
-
- var oldCurrentTime = this._currentTime;
-
- this._currentTime = x || 0;
-
- if ((this._startTime <= oldCurrentTime && oldCurrentTime <= this._endTime) || (this._startTime <= this._currentTime && this._currentTime <= this._endTime))
- this.needsLayout();
- },
-
- reset: function()
- {
- // Implemented by sub-classes if needed.
- },
-
- updateLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
- delete this._scheduledLayoutUpdateIdentifier;
- }
-
- // Implemented by sub-classes if needed.
- },
-
- updateLayoutIfNeeded: function()
- {
- if (!this._scheduledLayoutUpdateIdentifier)
- return;
- this.updateLayout();
- },
-
- // Protected
-
- needsLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier)
- return;
-
- this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRecordjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRecord.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRecord.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRecord.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,150 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecord = function(type, startTime, endTime, callFrames, sourceCodeLocation)
-{
- WebInspector.Object.call(this);
-
- console.assert(type);
-
- if (type in WebInspector.TimelineRecord.Type)
- type = WebInspector.TimelineRecord.Type[type];
-
- this._type = type;
- this._startTime = startTime || NaN;
- this._endTime = endTime || NaN;
- this._callFrames = callFrames || null;
- this._sourceCodeLocation = sourceCodeLocation || null;
-};
-
-WebInspector.TimelineRecord.Event = {
- Updated: "timeline-record-updated"
-};
-
-WebInspector.TimelineRecord.Type = {
- Network: "timeline-record-type-network",
- Layout: "timeline-record-type-layout",
- Script: "timeline-record-type-script"
-};
-
-WebInspector.TimelineRecord.TypeIdentifier = "timeline-record";
-WebInspector.TimelineRecord.SourceCodeURLCookieKey = "timeline-record-source-code-url";
-WebInspector.TimelineRecord.SourceCodeLocationLineCookieKey = "timeline-record-source-code-location-line";
-WebInspector.TimelineRecord.SourceCodeLocationColumnCookieKey = "timeline-record-source-code-location-column";
-WebInspector.TimelineRecord.TypeCookieKey = "timeline-record-type";
-
-WebInspector.TimelineRecord.prototype = {
- constructor: WebInspector.TimelineRecord,
-
- // Public
-
- get type()
- {
- return this._type;
- },
-
- get startTime()
- {
- // Implemented by subclasses if needed.
- return this._startTime;
- },
-
- get activeStartTime()
- {
- // Implemented by subclasses if needed.
- return this._startTime;
- },
-
- get endTime()
- {
- // Implemented by subclasses if needed.
- return this._endTime;
- },
-
- get duration()
- {
- // Use the getters instead of the properties so this works for subclasses that override the getters.
- return this.endTime - this.startTime;
- },
-
- get inactiveDuration()
- {
- // Use the getters instead of the properties so this works for subclasses that override the getters.
- return this.activeStartTime - this.startTime;
- },
-
- get activeDuration()
- {
- // Use the getters instead of the properties so this works for subclasses that override the getters.
- return this.endTime - this.activeStartTime;
- },
-
- get updatesDynamically()
- {
- // Implemented by subclasses if needed.
- return false;
- },
-
- get usesActiveStartTime()
- {
- // Implemented by subclasses if needed.
- return false;
- },
-
- get callFrames()
- {
- return this._callFrames;
- },
-
- get initiatorCallFrame()
- {
- if (!this._callFrames || !this._callFrames.length)
- return null;
-
- // Return the first non-native code call frame as the initiator.
- for (var i = 0; i < this._callFrames.length; ++i) {
- if (this._callFrames[i].nativeCode)
- continue;
- return this._callFrames[i];
- }
-
- return null;
- },
-
- get sourceCodeLocation()
- {
- return this._sourceCodeLocation;
- },
-
- saveIdentityToCookie: function(cookie)
- {
- cookie[WebInspector.TimelineRecord.SourceCodeURLCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url ? this._sourceCodeLocation.sourceCode.url.hash : null : null;
- cookie[WebInspector.TimelineRecord.SourceCodeLocationLineCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.lineNumber : null;
- cookie[WebInspector.TimelineRecord.SourceCodeLocationColumnCookieKey] = this._sourceCodeLocation ? this._sourceCodeLocation.columnNumber : null;
- cookie[WebInspector.TimelineRecord.TypeCookieKey] = this._type || null;
- }
-};
-
-WebInspector.TimelineRecord.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,93 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-record-bar {
- position: absolute;
- height: 12px;
-}
-
-.timeline-record-bar > .segment {
- position: absolute;
- height: 100%;
- background-color: rgb(225, 225, 225);
- border: 1px solid rgb(200, 200, 200);
- border-radius: 3px;
- min-width: 4px;
- z-index: 1;
-}
-
-.timeline-record-bar:not(.has-inactive-segment) > .segment {
- left: 0;
- width: 100%;
-}
-
-.timeline-record-bar > .segment.inactive {
- z-index: 0;
-}
-
-.timeline-record-bar > .segment.inactive,
-.timeline-record-bar.unfinished > .segment {
- border-top-right-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
- border-right: none;
-}
-
-.timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
- border-top-left-radius: 0 !important;
- border-bottom-left-radius: 0 !important;
-}
-
-:focus .selected .timeline-record-bar > .segment {
- background-color: white !important;
- border: none !important;
-}
-
-:focus .selected .timeline-record-bar > .segment.inactive {
- background-color: rgb(196, 215, 242) !important;
-}
-
-:focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
- border-left: 1px solid rgba(56, 121, 217, 0.7) !important;
-}
-
-.timeline-record-bar.timeline-record-type-network > .segment {
- background-color: rgb(120, 176, 225);
- border-color: rgb(61, 147, 200);
-}
-
-.timeline-record-bar.timeline-record-type-network > .segment.inactive {
- background-color: rgb(167, 204, 237);
- border-color: rgb(127, 185, 220);
-}
-
-.timeline-record-bar.timeline-record-type-layout > .segment {
- background-color: rgb(234, 153, 153);
- border-color: rgb(212, 108, 108);
-}
-
-.timeline-record-bar.timeline-record-type-script > .segment {
- background-color: rgb(190, 148, 233);
- border-color: rgb(153, 113, 185);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,346 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecordBar = function(records, renderMode)
-{
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.classList.add(WebInspector.TimelineRecordBar.StyleClassName);
-
- this.renderMode = renderMode;
- this.records = records;
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.TimelineRecordBar);
-
-WebInspector.TimelineRecordBar.StyleClassName = "timeline-record-bar";
-WebInspector.TimelineRecordBar.BarSegmentStyleClassName = "segment";
-WebInspector.TimelineRecordBar.InactiveStyleClassName = "inactive";
-WebInspector.TimelineRecordBar.UnfinishedStyleClassName = "unfinished";
-WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName = "has-inactive-segment";
-WebInspector.TimelineRecordBar.MinimumWidthPixels = 4;
-WebInspector.TimelineRecordBar.MinimumMarginPixels = 1;
-
-WebInspector.TimelineRecordBar.RenderMode = {
- Normal: "timeline-record-bar-normal-render-mode",
- InactiveOnly: "timeline-record-bar-inactive-only-render-mode",
- ActiveOnly: "timeline-record-bar-active-only-render-mode"
-};
-
-WebInspector.TimelineRecordBar.createCombinedBars = function(records, secondsPerPixel, graphDataSource, createBarCallback)
-{
- if (!records.length)
- return;
-
- var startTime = graphDataSource.startTime;
- var currentTime = graphDataSource.currentTime;
- var endTime = graphDataSource.endTime;
-
- var visibleRecords = [];
- var usesActiveStartTime = false;
- var lastRecordType = null;
-
- // FIXME: Do a binary search for records that fall inside start and current time.
-
- for (var record of records) {
- if (isNaN(record.startTime))
- continue;
-
- // If this bar is completely before the bounds of the graph, skip this record.
- if (record.endTime < startTime)
- continue;
-
- // If this record is completely after the current time or end time, break out now.
- // Records are sorted, so all records after this will be beyond the current or end time too.
- if (record.startTime > currentTime || record.startTime > endTime)
- break;
-
- if (record.usesActiveStartTime)
- usesActiveStartTime = true;
-
- // If one record uses active time the rest are assumed to use it.
- console.assert(record.usesActiveStartTime === usesActiveStartTime);
-
- // Only a single record type is supported right now.
- console.assert(!lastRecordType || record.type === lastRecordType);
-
- visibleRecords.push(record);
-
- lastRecordType = record.type;
- }
-
- if (!visibleRecords.length)
- return;
-
- if (visibleRecords.length === 1) {
- createBarCallback(visibleRecords, WebInspector.TimelineRecordBar.RenderMode.Normal);
- return;
- }
-
- function compareByActiveStartTime(a, b)
- {
- return a.activeStartTime - b.activeStartTime;
- }
-
- var minimumDuration = secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;
- var minimumMargin = secondsPerPixel * WebInspector.TimelineRecordBar.MinimumMarginPixels;
-
- if (usesActiveStartTime) {
- var inactiveStartTime = NaN;
- var inactiveEndTime = NaN;
- var inactiveRecords = [];
-
- for (var record of visibleRecords) {
- // Check if the previous record is far enough away to create the inactive bar.
- if (!isNaN(inactiveStartTime) && inactiveStartTime + Math.max(inactiveEndTime - inactiveStartTime, minimumDuration) + minimumMargin <= record.startTime) {
- createBarCallback(inactiveRecords, WebInspector.TimelineRecordBar.RenderMode.InactiveOnly);
- inactiveRecords = [];
- inactiveStartTime = NaN;
- inactiveEndTime = NaN;
- }
-
- // If this is a new bar, peg the start time.
- if (isNaN(inactiveStartTime))
- inactiveStartTime = record.startTime;
-
- // Update the end time to be the maximum we encounter. inactiveEndTime might be NaN, so "|| 0" to prevent Math.max from returning NaN.
- inactiveEndTime = Math.max(inactiveEndTime || 0, record.activeStartTime);
-
- inactiveRecords.push(record);
- }
-
- // Create the inactive bar for the last record if needed.
- if (!isNaN(inactiveStartTime))
- createBarCallback(inactiveRecords, WebInspector.TimelineRecordBar.RenderMode.InactiveOnly);
-
- visibleRecords.sort(compareByActiveStartTime);
- }
-
- lastRecordType = null;
-
- var activeStartTime = NaN;
- var activeEndTime = NaN;
- var activeRecords = [];
-
- var startTimeProperty = usesActiveStartTime ? "activeStartTime" : "startTime";
-
- for (var record of visibleRecords) {
- // Check if the previous record is far enough away to create the active bar. We also create it now if the current record has no active state time.
- if (!isNaN(activeStartTime) && (activeStartTime + Math.max(activeEndTime - activeStartTime, minimumDuration) + minimumMargin <= record[startTimeProperty]
- || (isNaN(record[startTimeProperty]) && !isNaN(activeEndTime)))) {
- createBarCallback(activeRecords, WebInspector.TimelineRecordBar.RenderMode.ActiveOnly);
- activeRecords = [];
- activeStartTime = NaN;
- activeEndTime = NaN;
- }
-
- if (isNaN(record[startTimeProperty]))
- continue;
-
- // If this is a new bar, peg the start time.
- if (isNaN(activeStartTime))
- activeStartTime = record[startTimeProperty];
-
- // Update the end time to be the maximum we encounter. activeEndTime might be NaN, so "|| 0" to prevent Math.max from returning NaN.
- if (!isNaN(record.endTime))
- activeEndTime = Math.max(activeEndTime || 0, record.endTime);
-
- activeRecords.push(record);
- }
-
- // Create the active bar for the last record if needed.
- if (!isNaN(activeStartTime))
- createBarCallback(activeRecords, WebInspector.TimelineRecordBar.RenderMode.ActiveOnly);
-};
-
-WebInspector.TimelineRecordBar.prototype = {
- constructor: WebInspector.TimelineRecordBar,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get renderMode()
- {
- return this._renderMode;
- },
-
- set renderMode(renderMode)
- {
- this._renderMode = renderMode || WebInspector.TimelineRecordBar.RenderMode.Normal;
- },
-
- get records()
- {
- return this._records;
- },
-
- set records(records)
- {
- if (this._records && this._records.length)
- this._element.classList.remove(this._records[0].type);
-
- records = records || [];
-
- if (!(records instanceof Array))
- records = [records];
-
- this._records = records;
-
- // Assume all records are the same type.
- if (this._records.length)
- this._element.classList.add(this._records[0].type);
- },
-
- refresh: function(graphDataSource)
- {
- if (!this._records || !this._records.length)
- return false;
-
- var firstRecord = this._records[0];
- var barStartTime = firstRecord.startTime;
-
- // If this bar has no time info, return early.
- if (isNaN(barStartTime))
- return false;
-
- var graphStartTime = graphDataSource.startTime;
- var graphEndTime = graphDataSource.endTime;
- var graphCurrentTime = graphDataSource.currentTime;
-
- var barEndTime = this._records.reduce(function(previousValue, currentValue) { return Math.max(previousValue, currentValue.endTime); }, 0);
-
- // If this bar is completely after the current time, return early.
- if (barStartTime > graphCurrentTime)
- return false;
-
- // If this bar is completely before or after the bounds of the graph, return early.
- if (barEndTime < graphStartTime || barStartTime > graphEndTime)
- return false;
-
- var barUnfinished = isNaN(barEndTime) || barEndTime >= graphCurrentTime;
- if (barUnfinished)
- barEndTime = graphCurrentTime;
-
- var graphDuration = graphEndTime - graphStartTime;
-
- this._element.classList.toggle(WebInspector.TimelineRecordBar.UnfinishedStyleClassName, barUnfinished);
-
- var newBarLeftPosition = (barStartTime - graphStartTime) / graphDuration;
- this._updateElementPosition(this._element, newBarLeftPosition, "left");
-
- var newBarWidth = ((barEndTime - graphStartTime) / graphDuration) - newBarLeftPosition;
- this._updateElementPosition(this._element, newBarWidth, "width");
-
- if (!this._activeBarElement && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
- this._activeBarElement = document.createElement("div");
- this._activeBarElement.classList.add(WebInspector.TimelineRecordBar.BarSegmentStyleClassName);
- }
-
- if (!firstRecord.usesActiveStartTime) {
- this._element.classList.remove(WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName);
-
- if (this._inactiveBarElement)
- this._inactiveBarElement.remove();
-
- if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
- if (this._activeBarElement)
- this._activeBarElement.remove();
-
- return false;
- }
-
- // If this TimelineRecordBar is reused and had an inactive bar previously, clean it up.
- this._activeBarElement.style.removeProperty("left");
- this._activeBarElement.style.removeProperty("width");
-
- if (!this._activeBarElement.parentNode)
- this._element.appendChild(this._activeBarElement);
-
- return true;
- }
-
- this._element.classList.add(WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName);
-
- // Find the earliest active start time for active only rendering, and the latest for the other modes.
- // This matches the values that TimelineRecordBar.createCombinedBars uses when combining.
- if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.ActiveOnly)
- var barActiveStartTime = this._records.reduce(function(previousValue, currentValue) { return Math.min(previousValue, currentValue.activeStartTime); }, Infinity);
- else
- var barActiveStartTime = this._records.reduce(function(previousValue, currentValue) { return Math.max(previousValue, currentValue.activeStartTime); }, 0);
-
- var barDuration = barEndTime - barStartTime;
-
- var inactiveUnfinished = isNaN(barActiveStartTime) || barActiveStartTime >= graphCurrentTime;
- this._element.classList.toggle(WebInspector.TimelineRecordBar.UnfinishedStyleClassName, inactiveUnfinished);
-
- if (inactiveUnfinished)
- barActiveStartTime = graphCurrentTime;
-
- var middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
-
- if (this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
- if (!this._inactiveBarElement) {
- this._inactiveBarElement = document.createElement("div");
- this._inactiveBarElement.classList.add(WebInspector.TimelineRecordBar.BarSegmentStyleClassName);
- this._inactiveBarElement.classList.add(WebInspector.TimelineRecordBar.InactiveStyleClassName);
- }
-
- this._updateElementPosition(this._inactiveBarElement, 1 - middlePercentage, "right");
- this._updateElementPosition(this._inactiveBarElement, middlePercentage, "width");
-
- if (!this._inactiveBarElement.parentNode)
- this._element.insertBefore(this._inactiveBarElement, this._element.firstChild);
- }
-
- if (!inactiveUnfinished && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
- this._updateElementPosition(this._activeBarElement, middlePercentage, "left");
- this._updateElementPosition(this._activeBarElement, 1 - middlePercentage, "width");
-
- if (!this._activeBarElement.parentNode)
- this._element.appendChild(this._activeBarElement);
- } else if (this._activeBarElement)
- this._activeBarElement.remove();
-
- return true;
- },
-
- // Private
-
- _updateElementPosition: function(element, newPosition, property)
- {
- newPosition *= 100;
- newPosition = newPosition.toFixed(2);
-
- var currentPosition = parseFloat(element.style[property]).toFixed(2);
- if (currentPosition !== newPosition)
- element.style[property] = newPosition + "%";
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRecordTreeElementjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRecordTreeElement.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRecordTreeElement.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRecordTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,146 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecordTreeElement = function(timelineRecord, subtitleNameStyle, includeTimerIdentifierInMainTitle, sourceCodeLocation, representedObject)
-{
- console.assert(timelineRecord);
-
- this._record = timelineRecord;
- this._sourceCodeLocation = sourceCodeLocation || timelineRecord.sourceCodeLocation || null;
-
- var title = "";
- var subtitle = "";
-
- if (this._sourceCodeLocation) {
- subtitle = document.createElement("span");
-
- if (subtitleNameStyle !== WebInspector.SourceCodeLocation.NameStyle.None)
- this._sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent", null, subtitleNameStyle);
- else
- this._sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent", null, WebInspector.SourceCodeLocation.NameStyle.None, WebInspector.UIString("line "));
- }
-
- var iconStyleClass = null;
-
- switch (timelineRecord.type) {
- case WebInspector.TimelineRecord.Type.Layout:
- title = WebInspector.LayoutTimelineRecord.EventType.displayName(timelineRecord.eventType);
-
- switch (timelineRecord.eventType) {
- case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
- case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass;
- break;
- case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
- case WebInspector.LayoutTimelineRecord.EventType.Layout:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass;
- break;
- case WebInspector.LayoutTimelineRecord.EventType.Paint:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
- break;
- default:
- console.error("Unknown LayoutTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
- }
-
- break;
-
- case WebInspector.TimelineRecord.Type.Script:
- title = WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeTimerIdentifierInMainTitle);
-
- switch (timelineRecord.eventType) {
- case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
- break;
- case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;
- break;
- case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
- case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
- case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
- break;
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
- case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
- iconStyleClass = WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass;
- break;
- default:
- console.error("Unknown ScriptTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
- }
-
- break;
-
- default:
- console.error("Unknown TimelineRecord type: " + timelineRecord.type, timelineRecord);
- }
-
- WebInspector.GeneralTreeElement.call(this, [iconStyleClass], title, subtitle, representedObject || timelineRecord, false);
-
- this.small = true;
-
- if (this._sourceCodeLocation)
- this.tooltipHandledSeparately = true;
-};
-
-WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass = "style-record";
-WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass = "layout-record";
-WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass = "paint-record";
-WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass = "evaluated-record";
-WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass = "event-record";
-WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass = "timer-record";
-WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass = "animation-record";
-
-WebInspector.TimelineRecordTreeElement.prototype = {
- constructor: WebInspector.TimelineRecordTreeElement,
- __proto__: WebInspector.GeneralTreeElement.prototype,
-
- // Public
-
- get record()
- {
- return this._record;
- },
-
- get filterableData()
- {
- var url = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url : "";
- return {text: [this.mainTitle, url || "", this._record.details || ""]};
- },
-
- // Protected
-
- onattach: function()
- {
- WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
- console.assert(this.element);
-
- if (!this.tooltipHandledSeparately)
- return;
-
- var tooltipPrefix = this.mainTitle + "\n";
- this._sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRecordingjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRecording.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRecording.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRecording.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,163 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecording = function()
-{
- WebInspector.Object.call(this);
-
- this._timelines = new Map;
- this._timelines.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimeline);
- this._timelines.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.Timeline);
- this._timelines.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.Timeline);
-
- for (var timeline of this._timelines.values())
- timeline.addEventListener(WebInspector.Timeline.Event.TimesUpdated, this._timelineTimesUpdated, this);
-
- this.reset(true);
-};
-
-WebInspector.TimelineRecording.Event = {
- Reset: "timeline-recording-reset",
- SourceCodeTimelineAdded: "timeline-recording-source-code-timeline-added",
- TimesUpdated: "timeline-recording-times-updated"
-};
-
-WebInspector.TimelineRecording.prototype = {
- constructor: WebInspector.TimelineRecording,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get timelines()
- {
- return this._timelines;
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- reset: function(suppressEvents)
- {
- this._sourceCodeTimelinesMap = new Map;
- this._eventMarkers = [];
- this._startTime = NaN;
- this._endTime = NaN;
-
- for (var timeline of this._timelines.values())
- timeline.reset(suppressEvents);
-
- if (!suppressEvents) {
- this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.Reset);
- this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated);
- }
- },
-
- sourceCodeTimelinesForSourceCode: function(sourceCode)
- {
- var timelines = this._sourceCodeTimelinesMap.get(sourceCode);
- if (!timelines)
- return [];
- return timelines.values();
- },
-
- addEventMarker: function(eventMarker)
- {
- this._eventMarkers.push(eventMarker);
- },
-
- addRecord: function(record)
- {
- // Add the record to the global timeline by type.
- this._timelines.get(record.type).addRecord(record);
-
- // Netowrk records don't have source code timelines.
- if (record.type === WebInspector.TimelineRecord.Type.Network)
- return;
-
- // Add the record to the source code timelines.
- var activeMainResource = WebInspector.frameResourceManager.mainFrame.provisionalMainResource || WebInspector.frameResourceManager.mainFrame.mainResource;
- var sourceCode = record.sourceCodeLocation ? record.sourceCodeLocation.sourceCode : activeMainResource;
-
- var sourceCodeTimelines = this._sourceCodeTimelinesMap.get(sourceCode);
- if (!sourceCodeTimelines) {
- sourceCodeTimelines = new Map;
- this._sourceCodeTimelinesMap.set(sourceCode, sourceCodeTimelines);
- }
-
- var newTimeline = false;
- var key = this._keyForRecord(record);
- var sourceCodeTimeline = sourceCodeTimelines.get(key);
- if (!sourceCodeTimeline) {
- sourceCodeTimeline = new WebInspector.SourceCodeTimeline(sourceCode, record.sourceCodeLocation, record.type, record.eventType);
- sourceCodeTimelines.set(key, sourceCodeTimeline);
- newTimeline = true;
- }
-
- sourceCodeTimeline.addRecord(record);
-
- if (newTimeline)
- this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.SourceCodeTimelineAdded, {sourceCodeTimeline: sourceCodeTimeline});
- },
-
- // Private
-
- _keyForRecord: function(record)
- {
- var key = record.type;
- if (record instanceof WebInspector.ScriptTimelineRecord || record instanceof WebInspector.LayoutTimelineRecord)
- key += ":" + record.eventType;
- if (record instanceof WebInspector.ScriptTimelineRecord && record.eventType === WebInspector.ScriptTimelineRecord.EventType.EventDispatched)
- key += ":" + record.details;
- if (record.sourceCodeLocation)
- key += ":" + record.sourceCodeLocation.lineNumber + ":" + record.sourceCodeLocation.columnNumber;
- return key;
- },
-
- _timelineTimesUpdated: function(event)
- {
- var timeline = event.target;
- var changed = false;
-
- if (isNaN(this._startTime) || timeline.startTime < this._startTime) {
- this._startTime = timeline.startTime;
- changed = true;
- }
-
- if (isNaN(this._endTime) || this._endTime < timeline.endTime) {
- this._endTime = timeline.endTime;
- changed = true;
- }
-
- if (changed)
- this.dispatchEventToListeners(WebInspector.TimelineRecording.Event.TimesUpdated);
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRulercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,176 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-ruler {
- position: relative;
- pointer-events: none;
-}
-
-.timeline-ruler.allows-time-range-selection {
- pointer-events: all;
-}
-
-.timeline-ruler > * {
- pointer-events: none;
-}
-
-.timeline-ruler > .header {
- border-bottom: 1px solid rgb(200, 200, 200);
-
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 22px;
-}
-
-.timeline-ruler > .header > .divider {
- position: absolute;
- width: 1px;
- top: 0;
- bottom: 0;
- -webkit-transform: translateX(-1px);
- background-image: -webkit-linear-gradient(bottom, rgba(200, 200, 200, 1), rgba(200, 200, 200, 0) 85%);
-}
-
-.timeline-ruler > .header > .divider > .label {
- position: absolute;
- top: 5px;
- right: 5px;
- font-size: 9px;
- font-family: "Lucida Grande", sans-serif;
- color: rgb(128, 128, 128);
- white-space: nowrap;
-}
-
-.timeline-ruler > .markers {
- position: absolute;
- top: 22px;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 10;
-}
-
-.timeline-ruler > .markers > .divider {
- position: absolute;
- width: 1px;
- top: 1px;
- bottom: 0;
- -webkit-transform: translateX(-1px);
- background-color: rgba(0, 0, 0, 0.05);
-}
-
-.timeline-ruler > .markers > .marker {
- position: absolute;
- top: 0;
- bottom: 0;
-
- -webkit-transform: translateX(-1px);
-
- border-left-width: 1px;
- border-left-style: dashed;
- border-left-color: rgba(128, 128, 128, 0.5);
-}
-
-.timeline-ruler > .markers > .marker.current-time {
- border-left-color: red;
- border-left-style: solid;
-}
-
-.timeline-ruler > .markers > .marker.current-time::before {
- position: absolute;
- top: -5px;
- left: -5px;
-
- width: 9px;
- height: 9px;
- border-radius: 5px;
-
- background-color: red;
-
- content: "";
-}
-
-.timeline-ruler > .markers > .marker.load-event {
- border-left-color: rgba(255, 0, 0, 0.5);
-}
-
-.timeline-ruler > .markers > .marker.dom-content-event {
- border-left-color: rgba(0, 0, 255, 0.5);
-}
-
-.timeline-ruler > .markers > .marker.timestamp {
- border-left-color: rgba(0, 110, 0, 0.5);
-}
-
-.timeline-ruler > .selection-drag {
- position: absolute;
- top: 0;
- height: 22px;
- cursor: -webkit-grab;
- pointer-events: all;
-}
-
-.timeline-ruler > .selection-drag:active {
- cursor: -webkit-grabbing;
-}
-
-.timeline-ruler > .selection-handle {
- position: absolute;
- top: 0;
- width: 8px;
- height: 21px;
- border-radius: 5px;
- background-color: rgb(164, 164, 164);
- border: 1px solid white;
- cursor: col-resize;
- pointer-events: all;
- z-index: 15;
-}
-
-.timeline-ruler > .selection-handle.left {
- -webkit-transform: translateX(-4px);
-}
-
-.timeline-ruler > .selection-handle.right {
- -webkit-transform: translateX(4px);
-}
-
-.timeline-ruler > .shaded-area {
- position: absolute;
- top: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.1);
- z-index: 15;
-}
-
-.timeline-ruler > .shaded-area.left {
- left: 0;
-}
-
-.timeline-ruler > .shaded-area.right {
- right: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineRulerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,753 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRuler = function()
-{
- WebInspector.Object.call(this);
-
- this._element = document.createElement("div");
- this._element.className = WebInspector.TimelineRuler.StyleClassName;
-
- this._headerElement = document.createElement("div");
- this._headerElement.className = WebInspector.TimelineRuler.HeaderElementStyleClassName;
- this._element.appendChild(this._headerElement);
-
- this._markersElement = document.createElement("div");
- this._markersElement.className = WebInspector.TimelineRuler.MarkersElementStyleClassName;
- this._element.appendChild(this._markersElement);
-
- this._zeroTime = 0;
- this._startTime = 0;
- this._endTime = 0;
- this._duration = NaN;
- this._secondsPerPixel = 0;
- this._selectionStartTime = 0;
- this._selectionEndTime = Infinity;
- this._endTimePinned = false;
- this._allowsClippedLabels = false;
- this._allowsTimeRangeSelection = false;
-
- this._markerElementMap = new Map;
-}
-
-WebInspector.TimelineRuler.MinimumLeftDividerSpacing = 48;
-WebInspector.TimelineRuler.MinimumDividerSpacing = 64;
-
-WebInspector.TimelineRuler.StyleClassName = "timeline-ruler";
-WebInspector.TimelineRuler.AllowsTimeRangeSelectionStyleClassName = "allows-time-range-selection";
-WebInspector.TimelineRuler.HeaderElementStyleClassName = "header";
-WebInspector.TimelineRuler.DividerElementStyleClassName = "divider";
-WebInspector.TimelineRuler.DividerLabelElementStyleClassName = "label";
-
-WebInspector.TimelineRuler.MarkersElementStyleClassName = "markers";
-WebInspector.TimelineRuler.BaseMarkerElementStyleClassName = "marker";
-WebInspector.TimelineRuler.ShadedAreaElementStyleClassName = "shaded-area";
-WebInspector.TimelineRuler.SelectionDragElementStyleClassName = "selection-drag";
-WebInspector.TimelineRuler.SelectionHandleElementStyleClassName = "selection-handle";
-WebInspector.TimelineRuler.LeftSelectionElementStyleClassName = "left";
-WebInspector.TimelineRuler.RightSelectionElementStyleClassName = "right";
-WebInspector.TimelineRuler.MinimumSelectionTimeRange = 0.01;
-
-WebInspector.TimelineRuler.Event = {
- TimeRangeSelectionChanged: "time-ruler-time-range-selection-changed"
-};
-
-WebInspector.TimelineRuler.prototype = {
- constructor: WebInspector.TimelineRuler,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get allowsClippedLabels()
- {
- return this._allowsClippedLabels
- },
-
- set allowsClippedLabels(x)
- {
- if (this._allowsClippedLabels === x)
- return;
-
- this._allowsClippedLabels = x || false;
-
- this._needsLayout();
- },
-
- get allowsTimeRangeSelection()
- {
- return this._allowsTimeRangeSelection;
- },
-
- set allowsTimeRangeSelection(x)
- {
- if (this._allowsTimeRangeSelection === x)
- return;
-
- this._allowsTimeRangeSelection = x || false;
-
- if (x) {
- this._mouseDownEventListener = this._handleMouseDown.bind(this);
- this._element.addEventListener("mousedown", this._mouseDownEventListener);
-
- this._leftShadedAreaElement = document.createElement("div");
- this._leftShadedAreaElement.classList.add(WebInspector.TimelineRuler.ShadedAreaElementStyleClassName);
- this._leftShadedAreaElement.classList.add(WebInspector.TimelineRuler.LeftSelectionElementStyleClassName);
-
- this._rightShadedAreaElement = document.createElement("div");
- this._rightShadedAreaElement.classList.add(WebInspector.TimelineRuler.ShadedAreaElementStyleClassName);
- this._rightShadedAreaElement.classList.add(WebInspector.TimelineRuler.RightSelectionElementStyleClassName);
-
- this._leftSelectionHandleElement = document.createElement("div");
- this._leftSelectionHandleElement.classList.add(WebInspector.TimelineRuler.SelectionHandleElementStyleClassName);
- this._leftSelectionHandleElement.classList.add(WebInspector.TimelineRuler.LeftSelectionElementStyleClassName);
- this._leftSelectionHandleElement.addEventListener("mousedown", this._handleSelectionHandleMouseDown.bind(this));
-
- this._rightSelectionHandleElement = document.createElement("div");
- this._rightSelectionHandleElement.classList.add(WebInspector.TimelineRuler.SelectionHandleElementStyleClassName);
- this._rightSelectionHandleElement.classList.add(WebInspector.TimelineRuler.RightSelectionElementStyleClassName);
- this._rightSelectionHandleElement.addEventListener("mousedown", this._handleSelectionHandleMouseDown.bind(this));
-
- this._selectionDragElement = document.createElement("div");
- this._selectionDragElement.classList.add(WebInspector.TimelineRuler.SelectionDragElementStyleClassName);
-
- this._needsSelectionLayout();
- } else {
- this._element.removeEventListener("mousedown", this._mouseDownEventListener);
- delete this._mouseDownEventListener;
-
- this._leftShadedAreaElement.remove();
- this._rightShadedAreaElement.remove();
- this._leftSelectionHandleElement.remove();
- this._rightSelectionHandleElement.remove();
- this._selectionDragElement.remove();
-
- delete this._leftShadedAreaElement;
- delete this._rightShadedAreaElement;
- delete this._leftSelectionHandleElement;
- delete this._rightSelectionHandleElement;
- delete this._selectionDragElement;
- }
- },
-
- get zeroTime()
- {
- return this._zeroTime;
- },
-
- set zeroTime(x)
- {
- if (this._zeroTime === x)
- return;
-
- this._zeroTime = x || 0;
-
- this._needsLayout();
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- set startTime(x)
- {
- if (this._startTime === x)
- return;
-
- this._startTime = x || 0;
-
- if (!isNaN(this._duration))
- this._endTime = this._startTime + this._duration;
-
- this._needsLayout();
- },
-
- get duration()
- {
- if (!isNaN(this._duration))
- return this._duration;
- return this.endTime - this.startTime;
- },
-
- set duration(x)
- {
- if (this._duration === x)
- return;
-
- this._duration = x || NaN;
-
- if (!isNaN(this._duration)) {
- this._endTime = this._startTime + this._duration;
- this._endTimePinned = true;
- } else
- this._endTimePinned = false;
-
- this._needsLayout();
- },
-
- get endTime()
- {
- if (!this._endTimePinned && this._scheduledLayoutUpdateIdentifier)
- this._recalculate();
- return this._endTime;
- },
-
- set endTime(x)
- {
- if (this._endTime === x)
- return;
-
- this._endTime = x || 0;
- this._endTimePinned = true;
-
- this._needsLayout();
- },
-
- get secondsPerPixel()
- {
- if (this._scheduledLayoutUpdateIdentifier)
- this._recalculate();
- return this._secondsPerPixel;
- },
-
- set secondsPerPixel(x)
- {
- if (this._secondsPerPixel === x)
- return;
-
- this._secondsPerPixel = x || 0;
- this._endTimePinned = false;
- this._currentSliceTime = 0;
-
- this._needsLayout();
- },
-
- get selectionStartTime()
- {
- return this._selectionStartTime;
- },
-
- set selectionStartTime(x)
- {
- if (this._selectionStartTime === x)
- return;
-
- this._selectionStartTime = x || 0;
- this._timeRangeSelectionChanged = true;
-
- this._needsSelectionLayout();
- },
-
- get selectionEndTime()
- {
- return this._selectionEndTime;
- },
-
- set selectionEndTime(x)
- {
- if (this._selectionEndTime === x)
- return;
-
- this._selectionEndTime = x || 0;
- this._timeRangeSelectionChanged = true;
-
- this._needsSelectionLayout();
- },
-
- addMarker: function(marker)
- {
- console.assert(marker instanceof WebInspector.TimelineMarker);
-
- if (this._markerElementMap.has(marker))
- return;
-
- marker.addEventListener(WebInspector.TimelineMarker.Event.TimeChanged, this._timelineMarkerTimeChanged, this);
-
- var markerElement = document.createElement("div");
- markerElement.classList.add(WebInspector.TimelineRuler.BaseMarkerElementStyleClassName);
- markerElement.classList.add(marker.type);
-
- this._markerElementMap.set(marker, markerElement);
-
- this._needsMarkerLayout();
- },
-
- elementForMarker: function(marker)
- {
- return this._markerElementMap.get(marker) || null;
- },
-
- updateLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
- delete this._scheduledLayoutUpdateIdentifier;
- }
-
- var visibleWidth = this._recalculate();
- if (visibleWidth <= 0)
- return;
-
- var duration = this.duration;
-
- var pixelsPerSecond = visibleWidth / duration;
-
- // Calculate a divider count based on the maximum allowed divider density.
- var dividerCount = Math.round(visibleWidth / WebInspector.TimelineRuler.MinimumDividerSpacing);
-
- if (this._endTimePinned || !this._currentSliceTime) {
- // Calculate the slice time based on the rough divider count and the time span.
- var sliceTime = duration / dividerCount;
-
- // Snap the slice time to a nearest number (e.g. 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, etc.)
- sliceTime = Math.pow(10, Math.ceil(Math.log(sliceTime) / Math.LN10));
- if (sliceTime * pixelsPerSecond >= 5 * WebInspector.TimelineRuler.MinimumDividerSpacing)
- sliceTime = sliceTime / 5;
- if (sliceTime * pixelsPerSecond >= 2 * WebInspector.TimelineRuler.MinimumDividerSpacing)
- sliceTime = sliceTime / 2;
-
- this._currentSliceTime = sliceTime;
- } else {
- // Reuse the last slice time since the time duration does not scale to fit when the end time isn't pinned.
- var sliceTime = this._currentSliceTime;
- }
-
- var firstDividerTime = (Math.ceil((this._startTime - this._zeroTime) / sliceTime) * sliceTime) + this._zeroTime;
- var lastDividerTime = this._endTime;
-
- // Calculate the divider count now based on the final slice time.
- dividerCount = Math.ceil((lastDividerTime - firstDividerTime) / sliceTime);
-
- // Make an extra divider in case the last one is partially visible.
- if (!this._endTimePinned)
- ++dividerCount;
-
- var markerDividers = this._markersElement.querySelectorAll("." + WebInspector.TimelineRuler.DividerElementStyleClassName);
-
- var dividerElement = this._headerElement.firstChild;
-
- for (var i = 0; i <= dividerCount; ++i) {
- if (!dividerElement) {
- dividerElement = document.createElement("div");
- dividerElement.className = WebInspector.TimelineRuler.DividerElementStyleClassName;
- this._headerElement.appendChild(dividerElement);
-
- var labelElement = document.createElement("div");
- labelElement.className = WebInspector.TimelineRuler.DividerLabelElementStyleClassName;
- dividerElement._labelElement = labelElement;
- dividerElement.appendChild(labelElement);
- }
-
- var markerDividerElement = markerDividers[i];
- if (!markerDividerElement) {
- markerDividerElement = document.createElement("div");
- markerDividerElement.className = WebInspector.TimelineRuler.DividerElementStyleClassName;
- this._markersElement.appendChild(markerDividerElement);
- }
-
- var dividerTime = firstDividerTime + (sliceTime * i);
-
- var newLeftPosition = (dividerTime - this._startTime) / duration;
-
- if (!this._allowsClippedLabels) {
- // Don't allow dividers under 0% where they will be completely hidden.
- if (newLeftPosition < 0)
- continue;
-
- // When over 100% it is time to stop making/updating dividers.
- if (newLeftPosition > 1)
- break;
-
- // Don't allow the left-most divider spacing to be so tight it clips.
- if ((newLeftPosition * visibleWidth) < WebInspector.TimelineRuler.MinimumLeftDividerSpacing)
- continue;
- }
-
- this._updatePositionOfElement(dividerElement, newLeftPosition, visibleWidth);
- this._updatePositionOfElement(markerDividerElement, newLeftPosition, visibleWidth);
-
- dividerElement._labelElement.textContent = isNaN(dividerTime) ? "" : Number.secondsToString(dividerTime - this._zeroTime, true);
- dividerElement = dividerElement.nextSibling;
- }
-
- // Remove extra dividers.
- while (dividerElement) {
- var nextDividerElement = dividerElement.nextSibling;
- dividerElement.remove();
- dividerElement = nextDividerElement;
- }
-
- for (; i < markerDividers.length; ++i)
- markerDividers[i].remove();
-
- this._updateMarkers(visibleWidth, duration);
- this._updateSelection(visibleWidth, duration);
- },
-
- updateLayoutIfNeeded: function()
- {
- // If there is a main layout scheduled we can just update layout and return, since that
- // will update markers and the selection at the same time.
- if (this._scheduledLayoutUpdateIdentifier) {
- this.updateLayout();
- return;
- }
-
- var visibleWidth = this._element.clientWidth;
- if (visibleWidth <= 0)
- return;
-
- if (this._scheduledMarkerLayoutUpdateIdentifier)
- this._updateMarkers(visibleWidth, this.duration);
-
- if (this._scheduledSelectionLayoutUpdateIdentifier)
- this._updateSelection(visibleWidth, this.duration);
- },
-
- // Private
-
- _needsLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier)
- return;
-
- if (this._scheduledMarkerLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledMarkerLayoutUpdateIdentifier);
- delete this._scheduledMarkerLayoutUpdateIdentifier;
- }
-
- if (this._scheduledSelectionLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledSelectionLayoutUpdateIdentifier);
- delete this._scheduledSelectionLayoutUpdateIdentifier;
- }
-
- this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
- },
-
- _needsMarkerLayout: function()
- {
- // If layout is scheduled, abort since markers will be updated when layout happens.
- if (this._scheduledLayoutUpdateIdentifier)
- return;
-
- if (this._scheduledMarkerLayoutUpdateIdentifier)
- return;
-
- function update()
- {
- delete this._scheduledMarkerLayoutUpdateIdentifier;
-
- var visibleWidth = this._element.clientWidth;
- if (visibleWidth <= 0)
- return;
-
- this._updateMarkers(visibleWidth, this.duration);
- }
-
- this._scheduledMarkerLayoutUpdateIdentifier = requestAnimationFrame(update.bind(this));
- },
-
- _needsSelectionLayout: function()
- {
- if (!this._allowsTimeRangeSelection)
- return;
-
- // If layout is scheduled, abort since the selection will be updated when layout happens.
- if (this._scheduledLayoutUpdateIdentifier)
- return;
-
- if (this._scheduledSelectionLayoutUpdateIdentifier)
- return;
-
- function update()
- {
- delete this._scheduledSelectionLayoutUpdateIdentifier;
-
- var visibleWidth = this._element.clientWidth;
- if (visibleWidth <= 0)
- return;
-
- this._updateSelection(visibleWidth, this.duration);
- }
-
- this._scheduledSelectionLayoutUpdateIdentifier = requestAnimationFrame(update.bind(this));
- },
-
- _recalculate: function()
- {
- var visibleWidth = this._element.clientWidth;
- if (visibleWidth <= 0)
- return 0;
-
- if (this._endTimePinned)
- var duration = this._endTime - this._startTime;
- else
- var duration = visibleWidth * this._secondsPerPixel;
-
- this._secondsPerPixel = duration / visibleWidth;
-
- if (!this._endTimePinned)
- this._endTime = this._startTime + (visibleWidth * this._secondsPerPixel);
-
- return visibleWidth;
- },
-
- _updatePositionOfElement: function(element, newPosition, visibleWidth, property)
- {
- property = property || "left";
-
- newPosition *= this._endTimePinned ? 100 : visibleWidth;
- newPosition = newPosition.toFixed(2);
-
- var currentPosition = parseFloat(element.style[property]).toFixed(2);
- if (currentPosition !== newPosition)
- element.style[property] = newPosition + (this._endTimePinned ? "%" : "px");
- },
-
- _updateMarkers: function(visibleWidth, duration)
- {
- if (this._scheduledMarkerLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledMarkerLayoutUpdateIdentifier);
- delete this._scheduledMarkerLayoutUpdateIdentifier;
- }
-
- this._markerElementMap.forEach(function(markerElement, marker) {
- var newLeftPosition = (marker.time - this._startTime) / duration;
-
- this._updatePositionOfElement(markerElement, newLeftPosition, visibleWidth);
-
- if (!markerElement.parentNode)
- this._markersElement.appendChild(markerElement);
- }, this);
- },
-
- _updateSelection: function(visibleWidth, duration)
- {
- if (this._scheduledSelectionLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledSelectionLayoutUpdateIdentifier);
- delete this._scheduledSelectionLayoutUpdateIdentifier;
- }
-
- this._element.classList.toggle(WebInspector.TimelineRuler.AllowsTimeRangeSelectionStyleClassName, this._allowsTimeRangeSelection);
-
- if (!this._allowsTimeRangeSelection)
- return;
-
- var newLeftPosition = Math.max(0, (this._selectionStartTime - this._startTime) / duration);
- this._updatePositionOfElement(this._leftShadedAreaElement, newLeftPosition, visibleWidth, "width");
- this._updatePositionOfElement(this._leftSelectionHandleElement, newLeftPosition, visibleWidth, "left");
- this._updatePositionOfElement(this._selectionDragElement, newLeftPosition, visibleWidth, "left");
-
- var newRightPosition = 1 - Math.min((this._selectionEndTime - this._startTime) / duration, 1);
- this._updatePositionOfElement(this._rightShadedAreaElement, newRightPosition, visibleWidth, "width");
- this._updatePositionOfElement(this._rightSelectionHandleElement, newRightPosition, visibleWidth, "right");
- this._updatePositionOfElement(this._selectionDragElement, newRightPosition, visibleWidth, "right");
-
- if (!this._selectionDragElement.parentNode) {
- this._element.appendChild(this._selectionDragElement);
- this._element.appendChild(this._leftShadedAreaElement);
- this._element.appendChild(this._leftSelectionHandleElement);
- this._element.appendChild(this._rightShadedAreaElement);
- this._element.appendChild(this._rightSelectionHandleElement);
- }
-
- if (this._timeRangeSelectionChanged)
- this._dispatchTimeRangeSelectionChangedEvent();
- },
-
- _dispatchTimeRangeSelectionChangedEvent: function()
- {
- delete this._timeRangeSelectionChanged;
-
- if (this._suppressTimeRangeSelectionChangedEvent)
- return;
-
- this.dispatchEventToListeners(WebInspector.TimelineRuler.Event.TimeRangeSelectionChanged);
- },
-
- _timelineMarkerTimeChanged: function()
- {
- this._needsMarkerLayout();
- },
-
- _handleMouseDown: function(event)
- {
- // Only handle left mouse clicks.
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- this._selectionIsMove = event.target === this._selectionDragElement;
- this._suppressTimeRangeSelectionChangedEvent = !this._selectionIsMove;
-
- if (this._selectionIsMove)
- this._lastMousePosition = event.pageX;
- else
- this._mouseDownPosition = event.pageX - this._element.totalOffsetLeft;
-
- this._mouseMoveEventListener = this._handleMouseMove.bind(this);
- this._mouseUpEventListener = this._handleMouseUp.bind(this);
-
- // Register these listeners on the document so we can track the mouse if it leaves the ruler.
- document.addEventListener("mousemove", this._mouseMoveEventListener);
- document.addEventListener("mouseup", this._mouseUpEventListener);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _handleMouseMove: function(event)
- {
- console.assert(event.button === 0);
-
- if (this._selectionIsMove) {
- var currentMousePosition = event.pageX;
-
- var offsetTime = (currentMousePosition - this._lastMousePosition) * this.secondsPerPixel;
- var selectionDuration = this.selectionEndTime - this.selectionStartTime;
-
- this.selectionStartTime = Math.max(this.startTime, Math.min(this.selectionStartTime + offsetTime, this.endTime - selectionDuration));
- this.selectionEndTime = this.selectionStartTime + selectionDuration;
-
- this._lastMousePosition = currentMousePosition;
- } else {
- var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
-
- this.selectionStartTime = Math.max(this.startTime, this.startTime + (Math.min(currentMousePosition, this._mouseDownPosition) * this.secondsPerPixel));
- this.selectionEndTime = Math.min(this.startTime + (Math.max(currentMousePosition, this._mouseDownPosition) * this.secondsPerPixel), this.endTime);
- }
-
- this._updateSelection(this._element.clientWidth, this.duration);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _handleMouseUp: function(event)
- {
- console.assert(event.button === 0);
-
- if (!this._selectionIsMove && this.selectionEndTime - this.selectionStartTime < WebInspector.TimelineRuler.MinimumSelectionTimeRange) {
- // The section is smaller than allowed, grow in the direction of the drag to meet the minumum.
- var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
- if (currentMousePosition > this._mouseDownPosition) {
- this.selectionEndTime = Math.min(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, this.endTime);
- this.selectionStartTime = this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange;
- } else {
- this.selectionStartTime = Math.max(this.startTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange);
- this.selectionEndTime = this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange
- }
- }
-
- delete this._suppressTimeRangeSelectionChangedEvent;
-
- this._dispatchTimeRangeSelectionChangedEvent();
-
- document.removeEventListener("mousemove", this._mouseMoveEventListener);
- document.removeEventListener("mouseup", this._mouseUpEventListener);
-
- delete this._mouseMovedEventListener;
- delete this._mouseUpEventListener;
- delete this._mouseDownPosition;
- delete this._lastMousePosition;
- delete this._selectionIsMove;
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _handleSelectionHandleMouseDown: function(event)
- {
- // Only handle left mouse clicks.
- if (event.button !== 0 || event.ctrlKey)
- return;
-
- this._dragHandleIsStartTime = event.target === this._leftSelectionHandleElement;
- this._mouseDownPosition = event.pageX - this._element.totalOffsetLeft;
-
- this._selectionHandleMouseMoveEventListener = this._handleSelectionHandleMouseMove.bind(this);
- this._selectionHandleMouseUpEventListener = this._handleSelectionHandleMouseUp.bind(this);
-
- // Register these listeners on the document so we can track the mouse if it leaves the ruler.
- document.addEventListener("mousemove", this._selectionHandleMouseMoveEventListener);
- document.addEventListener("mouseup", this._selectionHandleMouseUpEventListener);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _handleSelectionHandleMouseMove: function(event)
- {
- console.assert(event.button === 0);
-
- var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
- var currentTime = this.startTime + (currentMousePosition * this.secondsPerPixel);
-
- if (event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
- // Resize the selection on both sides when the Option keys is held down.
- if (this._dragHandleIsStartTime) {
- var timeDifference = currentTime - this.selectionStartTime;
- this.selectionStartTime = Math.max(this.startTime, Math.min(currentTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
- this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, this.selectionEndTime - timeDifference), this.endTime);
- } else {
- var timeDifference = currentTime - this.selectionEndTime;
- this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, currentTime), this.endTime);
- this.selectionStartTime = Math.max(this.startTime, Math.min(this.selectionStartTime - timeDifference, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
- }
- } else {
- // Resize the selection on side being dragged.
- if (this._dragHandleIsStartTime)
- this.selectionStartTime = Math.max(this.startTime, Math.min(currentTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
- else
- this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, currentTime), this.endTime);
- }
-
- this._updateSelection(this._element.clientWidth, this.duration);
-
- event.preventDefault();
- event.stopPropagation();
- },
-
- _handleSelectionHandleMouseUp: function(event)
- {
- console.assert(event.button === 0);
-
- document.removeEventListener("mousemove", this._selectionHandleMouseMoveEventListener);
- document.removeEventListener("mouseup", this._selectionHandleMouseUpEventListener);
-
- delete this._selectionHandleMouseMoveEventListener;
- delete this._selectionHandleMouseUpEventListener;
- delete this._dragHandleIsStartTime;
- delete this._mouseDownPosition;
-
- event.preventDefault();
- event.stopPropagation();
- }
-}
-
-WebInspector.TimelineRuler.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPanelcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,207 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.sidebar > .panel.timeline > .status-bar {
- position: absolute;
- top: 0;
- left: 5px;
- right: 0;
- height: 22px;
- border-bottom: 1px solid rgb(179, 179, 179);
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph {
- position: absolute;
- top: 0;
- left: 0;
- width: 21px;
- height: 21px;
- padding: 0;
- border: none;
- outline: none;
- color: transparent;
- overflow: hidden;
-
- -webkit-appearance: none;
-
- background-color: transparent;
- background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x);
- background-repeat: no-repeat;
- background-size: 21px 21px;
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph.recording {
- background-image: -webkit-image-set(url(Images/Recording.png) 1x, url(Images/Recording@2x.png) 2x);
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph:hover {
- background-image: -webkit-image-set(url(Images/RecordingHovered.png) 1x, url(Images/RecordingHovered@2x.png) 2x);
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph.recording:hover {
- background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x);
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph.forced {
- background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x) !important;
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-glyph.recording.forced {
- background-image: -webkit-image-set(url(Images/Recording.png) 1x, url(Images/Recording@2x.png) 2x) !important;
-}
-
-.sidebar > .panel.timeline > .status-bar > .record-status {
- position: absolute;
- top: 0;
- right: 21px;
- left: 21px;
-
- text-align: center;
-
- line-height: 20px;
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
- font-weight: bold;
-
- color: rgb(76, 76, 76);
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
-}
-
-.sidebar > .panel.timeline > .title-bar {
- position: absolute;
- left: 0;
- right: 0;
-
- height: 22px;
-
- border-bottom: 1px solid rgb(179, 179, 179);
- background-image: -webkit-linear-gradient(top, rgb(238, 240, 244), rgb(224, 226, 230));
-
- color: rgb(57, 57, 57);
- text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
-
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- font-size: 11px;
- font-family: "Lucida Grande", sans-serif;
- font-weight: bold;
-
- padding: 4px 9px;
-
- white-space: nowrap;
- overflow: hidden;
-}
-
-.sidebar > .panel.timeline > .title-bar.timelines {
- top: 22px;
-}
-
-.sidebar > .panel.timeline > .title-bar.timeline-events {
- height: 23px;
- border-top: 1px solid rgb(179, 179, 179);
- top: 152px;
-}
-
-.sidebar > .panel.timeline > .timelines-content {
- position: absolute;
- top: 44px;
- height: 108px;
- left: 0;
- right: 0;
-
- overflow: hidden;
-}
-
-.sidebar > .panel.timeline > .timelines-content .close-button {
- margin-top: 2px;
- width: 12px;
- height: 12px;
-
- content: -webkit-image-set(url(Images/CloseTimeline.png) 1x, url(Images/CloseTimeline@2x.png) 2x);
-
- visibility: hidden;
-}
-
-.sidebar > .panel.timeline > .timelines-content li.item .icon {
- width: 24px;
- height: 24px;
- margin-top: 5px;
-}
-
-.sidebar > .panel.timeline > .timelines-content li.item.selected .close-button {
- visibility: visible;
-}
-
-.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):nth-child(even) {
- background-color: rgba(0, 0, 0, 0.03);
- background-clip: padding-box;
-}
-
-.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):not(:first-child) {
- border-top: 1px solid rgba(0, 0, 0, 0.09);
-}
-
-.sidebar > .panel.timeline > .timelines-content li.item.selected + li.item {
- border-top-color: rgb(120, 139, 168);
-}
-
-.sidebar > .panel.timeline > .timelines-content :focus li.item.selected + li.item {
- border-top-color: rgb(107, 130, 164);
-}
-
-.sidebar > .panel.timeline > .timelines-content .close-button:active {
- opacity: 0.8;
-}
-
-.sidebar > .panel.timeline > .content,
-.sidebar > .panel.timeline > .empty-content-placeholder {
- top: 175px;
-}
-
-.sidebar > .panel.timeline.timeline-content-view-showing > .content {
- /* This hides the scrollbar. The view shows a scrollbar, we don't need two. */
- padding-right: 16px;
- right: -16px;
-}
-
-.sidebar > .panel.timeline > .content > .stripe-background {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- min-height: 100%;
-
- background-image: -webkit-linear-gradient(top, transparent, transparent 50%, rgba(0, 0, 0, 0.03) 50%, rgba(0, 0, 0, 0.03));
- background-size: 100% 40px;
-
- pointer-events: none;
- display: none;
-}
-
-.sidebar > .panel.timeline.timeline-content-view-showing > .content > .stripe-background {
- display: block;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPaneljs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,354 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineSidebarPanel = function()
-{
- WebInspector.NavigationSidebarPanel.call(this, "timeline", WebInspector.UIString("Timelines"), "Images/NavigationItemStopwatch.svg", "2");
-
- this._timelineEventsTitleBarElement = document.createElement("div");
- this._timelineEventsTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TitleBarStyleClass);
- this._timelineEventsTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelineEventsTitleBarStyleClass);
- this.element.insertBefore(this._timelineEventsTitleBarElement, this.element.firstChild);
-
- this.contentTreeOutlineLabel = "";
-
- this._timelinesContentContainer = document.createElement("div");
- this._timelinesContentContainer.classList.add(WebInspector.TimelineSidebarPanel.TimelinesContentContainerStyleClass);
- this.element.insertBefore(this._timelinesContentContainer, this.element.firstChild);
-
- this._timelinesTreeOutline = this.createContentTreeOutline(true, true);
- this._timelinesTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
- this._timelinesTreeOutline.onselect = this._timelinesTreeElementSelected.bind(this);
- this._timelinesContentContainer.appendChild(this._timelinesTreeOutline.element);
-
- var timelinesTitleBarElement = document.createElement("div");
- timelinesTitleBarElement.textContent = WebInspector.UIString("Timelines");
- timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TitleBarStyleClass);
- timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass);
- this.element.insertBefore(timelinesTitleBarElement, this.element.firstChild);
-
- var statusBarElement = document.createElement("div");
- statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.StatusBarStyleClass);
- this.element.insertBefore(statusBarElement, this.element.firstChild);
-
- this._recordGlyphElement = document.createElement("div");
- this._recordGlyphElement.className = WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass;
- this._recordGlyphElement.addEventListener("mouseover", this._recordGlyphMousedOver.bind(this));
- this._recordGlyphElement.addEventListener("mouseout", this._recordGlyphMousedOut.bind(this));
- this._recordGlyphElement.addEventListener("click", this._recordGlyphClicked.bind(this));
- statusBarElement.appendChild(this._recordGlyphElement);
-
- this._recordStatusElement = document.createElement("div");
- this._recordStatusElement.className = WebInspector.TimelineSidebarPanel.RecordStatusStyleClass;
- statusBarElement.appendChild(this._recordStatusElement);
-
- function createTimelineTreeElement(label, iconClass, identifier)
- {
- var treeElement = new WebInspector.GeneralTreeElement([iconClass, WebInspector.TimelineSidebarPanel.LargeIconStyleClass], label, null, identifier);
- var closeButton = document.createElement("img");
- closeButton.classList.add(WebInspector.TimelineSidebarPanel.CloseButtonStyleClass);
- closeButton.addEventListener("click", this.showTimelineOverview.bind(this));
- treeElement.status = closeButton;
- return treeElement;
- }
-
- this._timelineTreeElementMap = new Map;
- this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Network, createTimelineTreeElement.call(this, WebInspector.UIString("Network Requests"), WebInspector.TimelineSidebarPanel.NetworkIconStyleClass, WebInspector.TimelineRecord.Type.Network));
- this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Layout, createTimelineTreeElement.call(this, WebInspector.UIString("Layout & Rendering"), WebInspector.TimelineSidebarPanel.ColorsIconStyleClass, WebInspector.TimelineRecord.Type.Layout));
- this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Script, createTimelineTreeElement.call(this, WebInspector.UIString("JavaScript & Events"), WebInspector.TimelineSidebarPanel.ScriptIconStyleClass, WebInspector.TimelineRecord.Type.Script));
-
- for (var timelineTreeElement of this._timelineTreeElementMap.values())
- this._timelinesTreeOutline.appendChild(timelineTreeElement);
-
- this._timelineOverviewTreeElement = new WebInspector.GeneralTreeElement(WebInspector.TimelineSidebarPanel.StopwatchIconStyleClass, WebInspector.UIString("Timelines"), null, WebInspector.timelineManager.recording);
- this._timelineOverviewTreeElement.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.showTimelineOverview, this);
-
- this._stripeBackgroundElement = document.createElement("div");
- this._stripeBackgroundElement.className = WebInspector.TimelineSidebarPanel.StripeBackgroundStyleClass;
- this.contentElement.insertBefore(this._stripeBackgroundElement, this.contentElement.firstChild);
-
- WebInspector.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStarted, this._recordingStarted, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
-
- function delayedWork()
- {
- // Prime the creation of the singleton TimelineContentCiew since it needs to listen for events.
- // It needs to be delayed since TimelineContentView depends on WebInspector.timelineSidebarPanel existing.
- this._timelineContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.timelineManager.recording);
- }
-
- setTimeout(delayedWork.bind(this), 0);
-};
-
-WebInspector.TimelineSidebarPanel.StatusBarStyleClass = "status-bar";
-WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass = "record-glyph";
-WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass = "recording";
-WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass = "forced";
-WebInspector.TimelineSidebarPanel.RecordStatusStyleClass = "record-status";
-WebInspector.TimelineSidebarPanel.TitleBarStyleClass = "title-bar";
-WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass = "timelines";
-WebInspector.TimelineSidebarPanel.TimelineEventsTitleBarStyleClass = "timeline-events";
-WebInspector.TimelineSidebarPanel.TimelinesContentContainerStyleClass = "timelines-content";
-WebInspector.TimelineSidebarPanel.StripeBackgroundStyleClass = "stripe-background";
-WebInspector.TimelineSidebarPanel.CloseButtonStyleClass = "close-button";
-WebInspector.TimelineSidebarPanel.LargeIconStyleClass = "large";
-WebInspector.TimelineSidebarPanel.StopwatchIconStyleClass = "stopwatch-icon";
-WebInspector.TimelineSidebarPanel.NetworkIconStyleClass = "network-icon";
-WebInspector.TimelineSidebarPanel.ColorsIconStyleClass = "colors-icon";
-WebInspector.TimelineSidebarPanel.ScriptIconStyleClass = "script-icon";
-WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass = "timeline-content-view-showing";
-WebInspector.TimelineSidebarPanel.ShowingTimelineContentViewCookieKey = "timeline-sidebar-panel-showing-timeline-content-view";
-WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey = "timeline-sidebar-panel-selected-timeline-view-identifier";
-WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue = "overview";
-
-WebInspector.TimelineSidebarPanel.prototype = {
- constructor: WebInspector.TimelineSidebarPanel,
- __proto__: WebInspector.NavigationSidebarPanel.prototype,
-
- // Public
-
- showDefaultContentView: function()
- {
- WebInspector.contentBrowser.showContentView(this._timelineContentView);
- },
-
- treeElementForRepresentedObject: function(representedObject)
- {
- if (representedObject instanceof WebInspector.TimelineRecording)
- return this._timelineOverviewTreeElement;
-
- // The main resource is used as the representedObject instead of Frame in our tree.
- if (representedObject instanceof WebInspector.Frame)
- representedObject = representedObject.mainResource;
-
- var foundTreeElement = this.contentTreeOutline.getCachedTreeElement(representedObject);
- if (foundTreeElement)
- return foundTreeElement;
-
- // Look for TreeElements loosely based on represented objects that can contain the represented
- // object we are really looking for. This allows a SourceCodeTimelineTreeElement or a
- // TimelineRecordTreeElement to stay selected when the Resource it represents is showing.
-
- function looselyCompareRepresentedObjects(candidateTreeElement)
- {
- if (!candidateTreeElement)
- return false;
-
- var candidateRepresentedObject = candidateTreeElement.representedObject;
- if (candidateRepresentedObject instanceof WebInspector.SourceCodeTimeline) {
- if (candidateRepresentedObject.sourceCode === representedObject)
- return true;
- return false;
- }
-
- if (candidateRepresentedObject instanceof WebInspector.TimelineRecord) {
- if (!candidateRepresentedObject.sourceCodeLocation)
- return false;
- if (candidateRepresentedObject.sourceCodeLocation.sourceCode === representedObject)
- return true;
- return false;
- }
-
- console.error("Unknown TreeElement");
- return false;
- }
-
- // Check the selected tree element first so we don't need to do a longer search and it is
- // likely to be the best candidate for the current view.
- if (looselyCompareRepresentedObjects(this.contentTreeOutline.selectedTreeElement))
- return this.contentTreeOutline.selectedTreeElement;
-
- var currentTreeElement = this._contentTreeOutline.children[0];
- while (currentTreeElement && !currentTreeElement.root) {
- if (looselyCompareRepresentedObjects(currentTreeElement))
- return currentTreeElement;
- currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, false);
- }
-
- return null;
- },
-
- get contentTreeOutlineLabel()
- {
- return this._timelineEventsTitleBarElement.textContent;
- },
-
- set contentTreeOutlineLabel(label)
- {
- label = label || WebInspector.UIString("Timeline Events");
-
- this._timelineEventsTitleBarElement.textContent = label;
- this.filterBar.placeholder = WebInspector.UIString("Filter %s").format(label);
- },
-
- showTimelineOverview: function()
- {
- if (this._timelinesTreeOutline.selectedTreeElement)
- this._timelinesTreeOutline.selectedTreeElement.deselect();
-
- this._timelineContentView.showOverviewTimelineView();
- WebInspector.contentBrowser.showContentView(this._timelineContentView);
- },
-
- showTimelineView: function(identifier)
- {
- console.assert(this._timelineTreeElementMap.has(identifier));
- if (!this._timelineTreeElementMap.has(identifier))
- return;
-
- this._timelineTreeElementMap.get(identifier).select(true, false, true, true);
-
- this._timelineContentView.showTimelineView(identifier);
- WebInspector.contentBrowser.showContentView(this._timelineContentView);
- },
-
- // Protected
-
- updateCustomContentOverflow: function()
- {
- if (!this._stripeBackgroundElement)
- return;
-
- var contentHeight = this.contentTreeOutline.element.offsetHeight;
- var currentHeight = parseInt(this._stripeBackgroundElement.style.height);
- if (currentHeight !== contentHeight)
- this._stripeBackgroundElement.style.height = contentHeight + "px";
- },
-
- hasCustomFilters: function()
- {
- return true;
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- if (!this._timelineContentView)
- return true;
-
- return this._timelineContentView.matchTreeElementAgainstCustomFilters(treeElement);
- },
-
- canShowDifferentContentView: function()
- {
- return !this.restoringState || !this._restoredShowingTimelineContentView;
- },
-
- saveStateToCookie: function(cookie)
- {
- console.assert(cookie);
-
- cookie[WebInspector.timelineSidebarPanel.ShowingTimelineContentViewCookieKey] = WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineContentView;
-
- var selectedTreeElement = this._timelinesTreeOutline.selectedTreeElement;
- if (selectedTreeElement)
- cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey] = selectedTreeElement.representedObject;
- else
- cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey] = WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue;
-
- WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie.call(this, cookie);
- },
-
- restoreStateFromCookie: function(cookie, relaxedMatchDelay)
- {
- console.assert(cookie);
-
- // The _timelineContentView is not ready on initial load, so delay the restore.
- // This matches the delayed work in the WebInspector.TimelineSidebarPanel constructor.
- if (!this._timelineContentView) {
- setTimeout(this.restoreStateFromCookie.bind(this, cookie, relaxedMatchDelay), 0);
- return;
- }
-
- this._restoredShowingTimelineContentView = cookie[WebInspector.timelineSidebarPanel.ShowingTimelineContentViewCookieKey];
-
- var selectedTimelineViewIdentifier = cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey];
- if (selectedTimelineViewIdentifier === WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue)
- this.showTimelineOverview();
- else
- this.showTimelineView(selectedTimelineViewIdentifier);
-
- WebInspector.NavigationSidebarPanel.prototype.restoreStateFromCookie.call(this, cookie, relaxedMatchDelay);
- },
-
- // Private
-
- _timelinesTreeElementSelected: function(treeElement, selectedByUser)
- {
- console.assert(this._timelineTreeElementMap.get(treeElement.representedObject) === treeElement);
- this.showTimelineView(treeElement.representedObject);
- },
-
- _contentBrowserCurrentContentViewDidChange: function(event)
- {
- if (WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineContentView)
- this.element.classList.add(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
- else
- this.element.classList.remove(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
- },
-
- _recordingStarted: function(event)
- {
- this._recordStatusElement.textContent = WebInspector.UIString("Recording");
- this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
- },
-
- _recordingStopped: function(event)
- {
- this._recordStatusElement.textContent = "";
- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
- },
-
- _recordGlyphMousedOver: function(event)
- {
- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
-
- if (WebInspector.timelineManager.recordingEnabled)
- this._recordStatusElement.textContent = WebInspector.UIString("Stop Recording");
- else
- this._recordStatusElement.textContent = WebInspector.UIString("Start Recording");
- },
-
- _recordGlyphMousedOut: function(event)
- {
- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
-
- if (WebInspector.timelineManager.recordingEnabled)
- this._recordStatusElement.textContent = WebInspector.UIString("Recording");
- else
- this._recordStatusElement.textContent = "";
- },
-
- _recordGlyphClicked: function(event)
- {
- // Add forced class to prevent the glyph from showing a confusing status after click.
- this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
-
- if (WebInspector.timelineManager.recordingEnabled)
- WebInspector.timelineManager.stopRecording();
- else
- WebInspector.timelineManager.startRecording();
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineViewcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineView.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineView.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.timeline-view {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineViewjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TimelineView.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineView.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineView = function()
-{
- WebInspector.Object.call(this);
-
- this._contentTreeOutline = WebInspector.timelineSidebarPanel.createContentTreeOutline();
-
- this.element = document.createElement("div");
- this.element.classList.add(WebInspector.TimelineView.StyleClassName);
-
- this._zeroTime = 0;
- this._startTime = 0;
- this._endTime = 5;
- this._currentTime = 0;
-};
-
-WebInspector.TimelineView.StyleClassName = "timeline-view";
-
-WebInspector.TimelineView.Event = {
- SelectionPathComponentsDidChange: "timeline-view-selection-path-components-did-change"
-};
-
-WebInspector.TimelineView.prototype = {
- constructor: WebInspector.TimelineView,
- __proto__: WebInspector.Object.prototype,
-
- // Public
-
- get navigationSidebarTreeOutline()
- {
- return this._contentTreeOutline;
- },
-
- get navigationSidebarTreeOutlineLabel()
- {
- // Implemented by sub-classes if needed.
- return null;
- },
-
- get selectionPathComponents()
- {
- if (!this._contentTreeOutline.selectedTreeElement || this._contentTreeOutline.selectedTreeElement.hidden)
- return null;
-
- var pathComponent = new WebInspector.GeneralTreeElementPathComponent(this._contentTreeOutline.selectedTreeElement);
- pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
- return [pathComponent];
- },
-
- get zeroTime()
- {
- return this._zeroTime;
- },
-
- set zeroTime(x)
- {
- if (this._zeroTime === x)
- return;
-
- this._zeroTime = x || 0;
-
- this.needsLayout();
- },
-
- get startTime()
- {
- return this._startTime;
- },
-
- set startTime(x)
- {
- if (this._startTime === x)
- return;
-
- this._startTime = x || 0;
-
- this.needsLayout();
- },
-
- get endTime()
- {
- return this._endTime;
- },
-
- set endTime(x)
- {
- if (this._endTime === x)
- return;
-
- this._endTime = x || 0;
-
- this.needsLayout();
- },
-
- get currentTime()
- {
- return this._currentTime;
- },
-
- set currentTime(x)
- {
- if (this._currentTime === x)
- return;
-
- var oldCurrentTime = this._currentTime;
-
- this._currentTime = x || 0;
-
- function checkIfLayoutIsNeeded(currentTime)
- {
- // Include some wiggle room since the current time markers can be clipped off the ends a bit and still partially visible.
- const wiggleTime = 0.05; // 50ms
- return this._startTime - wiggleTime <= currentTime && currentTime <= this._endTime + wiggleTime;
- }
-
- if (checkIfLayoutIsNeeded.call(this, oldCurrentTime) || checkIfLayoutIsNeeded.call(this, this._currentTime))
- this.needsLayout();
- },
-
- get visible()
- {
- return this._visible;
- },
-
- reset: function()
- {
- this._contentTreeOutline.removeChildren();
- },
-
- shown: function()
- {
- this._visible = true;
-
- // Implemented by sub-classes if needed.
- },
-
- hidden: function()
- {
- // Implemented by sub-classes if needed.
-
- this._visible = false;
- },
-
- matchTreeElementAgainstCustomFilters: function(treeElement)
- {
- // Implemented by sub-classes if needed.
- return true;
- },
-
- updateLayout: function()
- {
- if (this._scheduledLayoutUpdateIdentifier) {
- cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
- delete this._scheduledLayoutUpdateIdentifier;
- }
-
- // Implemented by sub-classes if needed.
- },
-
- updateLayoutIfNeeded: function()
- {
- if (!this._scheduledLayoutUpdateIdentifier)
- return;
- this.updateLayout();
- },
-
- // Protected
-
- treeElementPathComponentSelected: function(event)
- {
- // Implemented by sub-classes if needed.
- },
-
- needsLayout: function()
- {
- if (!this._visible)
- return;
-
- if (this._scheduledLayoutUpdateIdentifier)
- return;
-
- this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceToggleButtonNavigationItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ToggleButtonNavigationItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ToggleButtonNavigationItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ToggleButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,112 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ToggleButtonNavigationItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, suppressEmboss) {
- WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, defaultImage, imageWidth, imageHeight, suppressEmboss);
-
- this._toggled = false;
- this._defaultImage = defaultImage;
- this._alternateImage = alternateImage;
- this._defaultToolTip = defaultToolTip;
- this._alternateToolTip = alternateToolTip || defaultToolTip;
-};
-
-WebInspector.ToggleButtonNavigationItem.StyleClassName = "toggle";
-
-WebInspector.ToggleButtonNavigationItem.prototype = {
- constructor: WebInspector.ToggleButtonNavigationItem,
-
- // Public
-
- get defaultToolTip()
- {
- return this._defaultToolTip;
- },
-
- get alternateToolTip()
- {
- return this._alternateToolTip;
- },
-
- set alternateToolTip(toolTip)
- {
- this._alternateToolTip = toolTip;
-
- if (this._toggled)
- this.toolTip = this._alternateToolTip;
- },
-
- get defaultImage()
- {
- return this._defaultImage;
- },
-
- get alternateImage()
- {
- return this._alternateImage;
- },
-
- set alternateImage(image)
- {
- this._alternateImage = image;
-
- if (this._toggled)
- this.image = this._alternateImage;
- },
-
- get toggled()
- {
- return this._toggled;
- },
-
- set toggled(flag)
- {
- flag = flag || false;
-
- if (this._toggled === flag)
- return;
-
- this._toggled = flag;
-
- if (this._toggled) {
- this.toolTip = this._alternateToolTip;
- this.image = this._alternateImage;
- } else {
- this.toolTip = this._defaultToolTip;
- this.image = this._defaultImage;
- }
- },
-
- // Private
-
- _additionalClassNames: [WebInspector.ToggleButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
-
- // The image isn't cacheable because it dynamically changes and the same canvas identifier is reused.
- // FIXME: We could try overriding _canvasIdentifier() to return different identifiers. If we did that
- // we would also need to override generateStyleText() to use the different identifiers.
- _imageCacheable: false
-};
-
-WebInspector.ToggleButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceToggleControlToolbarItemjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/ToggleControlToolbarItem.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ToggleControlToolbarItem.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/ToggleControlToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ToggleControlToolbarItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight) {
- WebInspector.ToggleButtonNavigationItem.call(this, identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, false);
-};
-
-WebInspector.ToggleControlToolbarItem.StyleClassName = "toggle";
-
-WebInspector.ToggleControlToolbarItem.prototype = {
- constructor: WebInspector.ToggleControlToolbarItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.ToggleControlToolbarItem.StyleClassName, WebInspector.ControlToolbarItem.StyleClassName]
-};
-
-WebInspector.ToggleControlToolbarItem.prototype.__proto__ = WebInspector.ToggleButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceToolbarcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Toolbar.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Toolbar.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Toolbar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,121 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.toolbar {
- display: -webkit-flex;
-
- white-space: nowrap;
- overflow: hidden;
-
- border-bottom: 1px solid rgb(85, 85, 85);
-
- outline: none;
-}
-
-.toolbar.icon-and-label-vertical {
- height: 56px;
-}
-
-.toolbar.icon-and-label-vertical.small-size {
- height: 48px;
-}
-
-.toolbar.icon-and-label-horizontal,
-.toolbar.icon-only {
- height: 40px;
-}
-
-.toolbar.icon-and-label-horizontal.small-size,
-.toolbar.icon-only.small-size,
-.toolbar.label-only {
- height: 32px;
-}
-
-body.docked .toolbar {
- background-image: -webkit-linear-gradient(top, rgb(216, 216, 216), rgb(190, 190, 190));
- box-shadow: inset rgba(255, 255, 255, 0.1) 0 1px 0, inset rgba(0, 0, 0, 0.02) 0 -1px 0;
-}
-
-body:not(.docked) .toolbar .item.button > .label {
- /* We need to disable sub-pixel antialiasing in the toolbar when not docked because the
- toolbar is transparent and so is the WebView. */
- -webkit-font-smoothing: antialiased;
-
- /* Compensate for the text not being sub-pixel antialiased by adding a small stroke. */
- -webkit-text-stroke: 0.2px;
-}
-
-body.window-inactive .toolbar {
- border-bottom: 1px solid rgb(128, 128, 128);
-}
-
-.toolbar .control-section {
- display: -webkit-flex;
-
- -webkit-flex-direction: column;
- -webkit-align-items: center;
- -webkit-justify-content: center;
-
- padding-left: 6px;
- padding-right: 6px;
-
- min-width: -webkit-min-content;
-}
-
-.toolbar.icon-and-label-horizontal.small-size .control-section,
-.toolbar.icon-only.small-size .control-section,
-.toolbar.label-only .control-section {
- -webkit-flex-direction: row;
-}
-
-.toolbar .item-section {
- display: -webkit-flex;
- min-width: -webkit-min-content;
-}
-
-.toolbar .item-section:not(.center) {
- -webkit-flex: 1;
-}
-
-.toolbar .item-section.left {
- -webkit-justify-content: flex-start;
- margin-right: 12px;
-}
-
-.toolbar .item-section.center {
- -webkit-flex: 2;
- -webkit-justify-content: center;
-}
-
-.toolbar .item-section.right {
- -webkit-justify-content: flex-end;
- margin-left: 12px;
- margin-right: 12px;
-}
-
-.toolbar .item {
- display: -webkit-flex;
- outline: none;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceToolbarjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Toolbar.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Toolbar.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Toolbar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,240 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Toolbar = function(element, navigationItems) {
- WebInspector.NavigationBar.call(this, element, navigationItems, "toolbar");
-
- this.displayMode = WebInspector.Toolbar.DisplayMode.IconAndLabelVertical;
- this.sizeMode = WebInspector.Toolbar.SizeMode.Normal;
-
- this._controlSectionElement = document.createElement("div");
- this._controlSectionElement.className = WebInspector.Toolbar.ControlSectionStyleClassName;
- this._element.appendChild(this._controlSectionElement);
-
- this._leftSectionElement = document.createElement("div");
- this._leftSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.LeftItemSectionStyleClassName;
- this._leftSectionElement.setAttribute("role", "tablist");
- this._element.appendChild(this._leftSectionElement);
-
- this._centerSectionElement = document.createElement("div");
- this._centerSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.CenterItemSectionStyleClassName;
- this._element.appendChild(this._centerSectionElement);
-
- this._rightSectionElement = document.createElement("div");
- this._rightSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.RightItemSectionStyleClassName;
- this._rightSectionElement.setAttribute("role", "tablist");
- this._element.appendChild(this._rightSectionElement);
-
- this._element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false);
-};
-
-WebInspector.Object.addConstructorFunctions(WebInspector.Toolbar);
-
-WebInspector.Toolbar.StyleClassName = "toolbar";
-WebInspector.Toolbar.ControlSectionStyleClassName = "control-section";
-WebInspector.Toolbar.ItemSectionStyleClassName = "item-section";
-WebInspector.Toolbar.LeftItemSectionStyleClassName = "left";
-WebInspector.Toolbar.CenterItemSectionStyleClassName = "center";
-WebInspector.Toolbar.RightItemSectionStyleClassName = "right";
-WebInspector.Toolbar.TotalSectionMargins = 12 * 3;
-
-WebInspector.Toolbar.Event = {
- DisplayModeDidChange: "toolbar-display-mode-did-change",
- SizeModeDidChange: "toolbar-size-mode-did-change"
-};
-
-WebInspector.Toolbar.Section = {
- Control: "control",
- Left: "left",
- Center: "center",
- Right: "right"
-};
-
-WebInspector.Toolbar.DisplayMode = {
- IconAndLabelVertical: "icon-and-label-vertical",
- IconAndLabelHorizontal: "icon-and-label-horizontal",
- IconOnly: "icon-only",
- LabelOnly: "label-only"
-};
-
-WebInspector.Toolbar.SizeMode = {
- Normal: "normal-size",
- Small: "small-size"
-};
-
-WebInspector.Toolbar.prototype = {
- constructor: WebInspector.Toolbar,
-
- // Public
-
- get displayMode()
- {
- return this._displayMode;
- },
-
- set displayMode(mode)
- {
- if (mode === this._displayMode)
- return;
-
- if (this._displayMode)
- this._element.classList.remove(this._displayMode);
-
- // Revert the forced icon-only mode if it was applied.
- if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal)
- this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconOnly);
-
- this._displayMode = mode;
-
- this._element.classList.add(mode);
-
- this.updateLayout();
-
- this.dispatchEventToListeners(WebInspector.Toolbar.Event.DisplayModeDidChange);
- },
-
- get sizeMode()
- {
- return this._sizeMode;
- },
-
- set sizeMode(mode)
- {
- if (mode === this._sizeMode)
- return;
-
- if (this._sizeMode)
- this._element.classList.remove(this._sizeMode);
-
- this._sizeMode = mode;
-
- this._element.classList.add(mode);
-
- this.updateLayout();
-
- this.dispatchEventToListeners(WebInspector.Toolbar.Event.SizeModeDidChange);
- },
-
- customUpdateLayout: function()
- {
- // Bail early if our sections are not created yet. This means we are being called during construction.
- if (!this._leftSectionElement || !this._centerSectionElement || !this._rightSectionElement)
- return;
-
- // Remove the collapsed style class to test if the items can fit at full width.
- this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
-
- // Revert the forced icon-only mode if it was applied.
- if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal) {
- this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconOnly);
- this._element.classList.add(WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
- }
-
- function isOverflowingToolbar()
- {
- var controlSectionWidth = this._controlSectionElement.offsetWidth;
- var leftSectionWidth = this._leftSectionElement.offsetWidth;
- var rightSectionWidth = this._rightSectionElement.offsetWidth;
- var centerSectionWidth = this._centerSectionElement.offsetWidth;
-
- // Add one to the actual toolbar width to allow some slop. This wasn't needed when sub-pixel layout was on,
- // but that was disabled in: http://webkit.org/b/149209
- var toolbarWidth = this.element.offsetWidth + 1;
-
- return controlSectionWidth + leftSectionWidth + centerSectionWidth + rightSectionWidth + WebInspector.Toolbar.TotalSectionMargins > toolbarWidth;
- }
-
- // Only the horizontal display mode supports collapsing labels.
- // If any sections are overflowing the toolbar then force the display mode to be icon only.
- if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal && isOverflowingToolbar.call(this)) {
- this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
- this._element.classList.add(WebInspector.Toolbar.DisplayMode.IconOnly);
- }
-
- if (!isOverflowingToolbar.call(this))
- return;
-
- this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
- },
-
- addToolbarItem: function(toolbarItem, sectionIdentifier)
- {
- var sectionElement;
-
- switch (sectionIdentifier) {
- case WebInspector.Toolbar.Section.Control:
- sectionElement = this._controlSectionElement;
- break;
-
- case WebInspector.Toolbar.Section.Left:
- sectionElement = this._leftSectionElement;
- break;
-
- default:
- case WebInspector.Toolbar.Section.Center:
- sectionElement = this._centerSectionElement;
- break;
-
- case WebInspector.Toolbar.Section.Right:
- sectionElement = this._rightSectionElement;
- break;
- }
-
- console.assert(sectionElement);
-
- this.addNavigationItem(toolbarItem, sectionElement);
- },
-
- // Private
-
- _handleContextMenuEvent: function(event)
- {
- var contextMenu = new WebInspector.ContextMenu(event);
-
- contextMenu.appendCheckboxItem(WebInspector.UIString("Icon and Text (Vertical)"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconAndLabelVertical), this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
- contextMenu.appendCheckboxItem(WebInspector.UIString("Icon and Text (Horizontal)"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal), this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
- contextMenu.appendCheckboxItem(WebInspector.UIString("Icon Only"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconOnly), this._displayMode === WebInspector.Toolbar.DisplayMode.IconOnly);
- contextMenu.appendCheckboxItem(WebInspector.UIString("Text Only"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.LabelOnly), this._displayMode === WebInspector.Toolbar.DisplayMode.LabelOnly);
-
- if (this._displayMode !== WebInspector.Toolbar.DisplayMode.LabelOnly) {
- contextMenu.appendSeparator();
- contextMenu.appendCheckboxItem(WebInspector.UIString("Small Icons"), this._toggleSmallIcons.bind(this), this._sizeMode === WebInspector.Toolbar.SizeMode.Small);
- }
-
- contextMenu.show();
- },
-
- _changeDisplayMode: function(displayMode)
- {
- this.displayMode = displayMode;
- },
-
- _toggleSmallIcons: function()
- {
- this.sizeMode = this._sizeMode === WebInspector.Toolbar.SizeMode.Normal ? WebInspector.Toolbar.SizeMode.Small : WebInspector.Toolbar.SizeMode.Normal;
- }
-};
-
-WebInspector.Toolbar.prototype.__proto__ = WebInspector.NavigationBar.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtoncss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.css (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.css        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-.item > .status > .status-button {
- width: 16px;
- height: 16px;
- display: inline-block;
-}
-
-.item > .status > .status-button > svg * {
- fill: rgb(112, 126, 139);
-}
-
-.item.selected > .status > .status-button > svg * {
- fill: white;
-}
-
-.item.selected > .status > .status-button:active > svg * {
- fill: rgba(255, 255, 255, 0.75);
-}
-
-.item > .status > .status-button.disabled > svg * {
- fill: rgba(112, 126, 139, 0.5) !important;
-}
-
-.item.selected > .status > .status-button.disabled > svg * {
- fill: rgba(255, 255, 255, 0.5) !important;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtonjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TreeElementStatusButton = function(element) {
- WebInspector.Object.call(this);
-
- console.assert(element);
-
- this._element = element;
- this._element.classList.add(WebInspector.TreeElementStatusButton.StyleClassName);
- this._element.addEventListener("click", this._clicked.bind(this));
-};
-
-WebInspector.TreeElementStatusButton.StyleClassName = "status-button";
-WebInspector.TreeElementStatusButton.DisabledStyleClassName = "disabled";
-
-WebInspector.TreeElementStatusButton.Event = {
- Clicked: "status-button-clicked"
-};
-
-WebInspector.TreeElementStatusButton.prototype = {
- constructor: WebInspector.TreeElementStatusButton,
-
- // Public
-
- get element()
- {
- return this._element;
- },
-
- get hidden()
- {
- return !this._element.classList.contains(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
- },
-
- set hidden(flag)
- {
- if (flag)
- this._element.classList.remove("hidden");
- else
- this._element.classList.add("hidden");
- },
-
- get enabled()
- {
- return !this._element.classList.contains(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
- },
-
- set enabled(flag)
- {
- if (flag)
- this._element.classList.remove(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
- else
- this._element.classList.add(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
- },
-
- // Private
-
- _clicked: function(event)
- {
- if (!this.enabled)
- return;
-
- event.stopPropagation();
-
- this.dispatchEventToListeners(WebInspector.TreeElementStatusButton.Event.Clicked, event);
- }
-};
-
-WebInspector.TreeElementStatusButton.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTreeOutlinejs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1094 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2013 Apple Inc. 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-/**
- * @constructor
- */
-function TreeOutline(listNode)
-{
- WebInspector.Object.call(this);
-
- this.element = listNode;
-
- /**
- * @type {Array.<TreeElement>}
- */
- this.children = [];
- this.selectedTreeElement = null;
- this._childrenListNode = listNode;
- this._childrenListNode.removeChildren();
- this._knownTreeElements = [];
- this._treeElementsExpandedState = [];
- this.expandTreeElementsWhenArrowing = false;
- this.allowsRepeatSelection = false;
- this.root = true;
- this.hasChildren = false;
- this.expanded = true;
- this.selected = false;
- this.treeOutline = this;
-
- this._childrenListNode.tabIndex = 0;
- this._childrenListNode.addEventListener("keydown", this._treeKeyDown.bind(this), true);
-}
-
-TreeOutline._knownTreeElementNextIdentifier = 1;
-TreeOutline.prototype.constructor = TreeOutline;
-
-TreeOutline.prototype.appendChild = function(child)
-{
- if (!child)
- throw("child can't be undefined or null");
-
- var lastChild = this.children[this.children.length - 1];
- if (lastChild) {
- lastChild.nextSibling = child;
- child.previousSibling = lastChild;
- } else {
- child.previousSibling = null;
- child.nextSibling = null;
- }
-
- var isFirstChild = !this.children.length;
-
- this.children.push(child);
- this.hasChildren = true;
- child.parent = this;
- child.treeOutline = this.treeOutline;
- child.treeOutline._rememberTreeElement(child);
-
- var current = child.children[0];
- while (current) {
- current.treeOutline = this.treeOutline;
- current.treeOutline._rememberTreeElement(current);
- current = current.traverseNextTreeElement(false, child, true);
- }
-
- if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)
- child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];
-
- if (this._childrenListNode)
- child._attach();
-
- if (this.treeOutline.onadd)
- this.treeOutline.onadd(child);
-
- if (isFirstChild && this.expanded)
- this.expand();
-}
-
-TreeOutline.prototype.insertChild = function(child, index)
-{
- if (!child)
- throw("child can't be undefined or null");
-
- var previousChild = (index > 0 ? this.children[index - 1] : null);
- if (previousChild) {
- previousChild.nextSibling = child;
- child.previousSibling = previousChild;
- } else {
- child.previousSibling = null;
- }
-
- var nextChild = this.children[index];
- if (nextChild) {
- nextChild.previousSibling = child;
- child.nextSibling = nextChild;
- } else {
- child.nextSibling = null;
- }
-
- var isFirstChild = !this.children.length;
-
- this.children.splice(index, 0, child);
- this.hasChildren = true;
- child.parent = this;
- child.treeOutline = this.treeOutline;
- child.treeOutline._rememberTreeElement(child);
-
- var current = child.children[0];
- while (current) {
- current.treeOutline = this.treeOutline;
- current.treeOutline._rememberTreeElement(current);
- current = current.traverseNextTreeElement(false, child, true);
- }
-
- if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)
- child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];
-
- if (this._childrenListNode)
- child._attach();
-
- if (this.treeOutline.onadd)
- this.treeOutline.onadd(child);
-
- if (isFirstChild && this.expanded)
- this.expand();
-}
-
-TreeOutline.prototype.removeChildAtIndex = function(childIndex, suppressOnDeselect, suppressSelectSibling)
-{
- if (childIndex < 0 || childIndex >= this.children.length)
- throw("childIndex out of range");
-
- var child = this.children[childIndex];
- this.children.splice(childIndex, 1);
-
- var parent = child.parent;
- if (child.deselect(suppressOnDeselect)) {
- if (child.previousSibling && !suppressSelectSibling)
- child.previousSibling.select(true, false);
- else if (child.nextSibling && !suppressSelectSibling)
- child.nextSibling.select(true, false);
- else if (!suppressSelectSibling)
- parent.select(true, false);
- }
-
- if (child.previousSibling)
- child.previousSibling.nextSibling = child.nextSibling;
- if (child.nextSibling)
- child.nextSibling.previousSibling = child.previousSibling;
-
- if (child.treeOutline) {
- child.treeOutline._forgetTreeElement(child);
- child.treeOutline._forgetChildrenRecursive(child);
- }
-
- child._detach();
- child.treeOutline = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
-
- if (this.treeOutline && this.treeOutline.onremove)
- this.treeOutline.onremove(child);
-}
-
-TreeOutline.prototype.removeChild = function(child, suppressOnDeselect, suppressSelectSibling)
-{
- if (!child)
- throw("child can't be undefined or null");
-
- var childIndex = this.children.indexOf(child);
- if (childIndex === -1)
- throw("child not found in this node's children");
-
- this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling);
-}
-
-TreeOutline.prototype.removeChildren = function(suppressOnDeselect)
-{
- var treeOutline = this.treeOutline;
-
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i];
- child.deselect(suppressOnDeselect);
-
- if (child.treeOutline) {
- child.treeOutline._forgetTreeElement(child);
- child.treeOutline._forgetChildrenRecursive(child);
- }
-
- child._detach();
- child.treeOutline = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
-
- if (treeOutline && treeOutline.onremove)
- treeOutline.onremove(child);
- }
-
- this.children = [];
-}
-
-TreeOutline.prototype.removeChildrenRecursive = function(suppressOnDeselect)
-{
- var childrenToRemove = this.children;
-
- var treeOutline = this.treeOutline;
-
- var child = this.children[0];
- while (child) {
- if (child.children.length)
- childrenToRemove = childrenToRemove.concat(child.children);
- child = child.traverseNextTreeElement(false, this, true);
- }
-
- for (var i = 0; i < childrenToRemove.length; ++i) {
- child = childrenToRemove[i];
- child.deselect(suppressOnDeselect);
-
- if (child.treeOutline)
- child.treeOutline._forgetTreeElement(child);
-
- child._detach();
- child.children = [];
- child.treeOutline = null;
- child.parent = null;
- child.nextSibling = null;
- child.previousSibling = null;
-
- if (treeOutline && treeOutline.onremove)
- treeOutline.onremove(child);
- }
-
- this.children = [];
-}
-
-TreeOutline.prototype._rememberTreeElement = function(element)
-{
- if (!this._knownTreeElements[element.identifier])
- this._knownTreeElements[element.identifier] = [];
-
- // check if the element is already known
- var elements = this._knownTreeElements[element.identifier];
- if (elements.indexOf(element) !== -1)
- return;
-
- // add the element
- elements.push(element);
-}
-
-TreeOutline.prototype._forgetTreeElement = function(element)
-{
- if (this.selectedTreeElement === element)
- this.selectedTreeElement = null;
- if (this._knownTreeElements[element.identifier])
- this._knownTreeElements[element.identifier].remove(element, true);
-}
-
-TreeOutline.prototype._forgetChildrenRecursive = function(parentElement)
-{
- var child = parentElement.children[0];
- while (child) {
- this._forgetTreeElement(child);
- child = child.traverseNextTreeElement(false, parentElement, true);
- }
-}
-
-TreeOutline.prototype.getCachedTreeElement = function(representedObject)
-{
- if (!representedObject)
- return null;
-
- if (representedObject.__treeElementIdentifier) {
- // If this representedObject has a tree element identifier, and it is a known TreeElement
- // in our tree we can just return that tree element.
- var elements = this._knownTreeElements[representedObject.__treeElementIdentifier];
- if (elements) {
- for (var i = 0; i < elements.length; ++i)
- if (elements[i].representedObject === representedObject)
- return elements[i];
- }
- }
- return null;
-}
-
-TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor, getParent)
-{
- if (!representedObject)
- return null;
-
- var cachedElement = this.getCachedTreeElement(representedObject);
- if (cachedElement)
- return cachedElement;
-
- // The representedObject isn't known, so we start at the top of the tree and work down to find the first
- // tree element that represents representedObject or one of its ancestors.
- var item;
- var found = false;
- for (var i = 0; i < this.children.length; ++i) {
- item = this.children[i];
- if (item.representedObject === representedObject || (isAncestor && isAncestor(item.representedObject, representedObject))) {
- found = true;
- break;
- }
- }
-
- if (!found)
- return null;
-
- // Make sure the item that we found is connected to the root of the tree.
- // Build up a list of representedObject's ancestors that aren't already in our tree.
- var ancestors = [];
- var currentObject = representedObject;
- while (currentObject) {
- ancestors.unshift(currentObject);
- if (currentObject === item.representedObject)
- break;
- currentObject = getParent(currentObject);
- }
-
- // For each of those ancestors we populate them to fill in the tree.
- for (var i = 0; i < ancestors.length; ++i) {
- // Make sure we don't call findTreeElement with the same representedObject
- // again, to prevent infinite recursion.
- if (ancestors[i] === representedObject)
- continue;
- // FIXME: we could do something faster than findTreeElement since we will know the next
- // ancestor exists in the tree.
- item = this.findTreeElement(ancestors[i], isAncestor, getParent);
- if (item)
- item.onpopulate();
- }
-
- return this.getCachedTreeElement(representedObject);
-}
-
-TreeOutline.prototype._treeElementDidChange = function(treeElement)
-{
- if (treeElement.treeOutline !== this)
- return;
-
- if (this.onchange)
- this.onchange(treeElement);
-}
-
-TreeOutline.prototype.treeElementFromPoint = function(x, y)
-{
- var node = this._childrenListNode.ownerDocument.elementFromPoint(x, y);
- if (!node)
- return null;
-
- var listNode = node.enclosingNodeOrSelfWithNodeNameInArray(["ol", "li"]);
- if (listNode)
- return listNode.parentTreeElement || listNode.treeElement;
- return null;
-}
-
-TreeOutline.prototype._treeKeyDown = function(event)
-{
- if (event.target !== this._childrenListNode)
- return;
-
- if (!this.selectedTreeElement || event.shiftKey || event.metaKey || event.ctrlKey)
- return;
-
- var handled = false;
- var nextSelectedElement;
- if (event.keyIdentifier === "Up" && !event.altKey) {
- nextSelectedElement = this.selectedTreeElement.traversePreviousTreeElement(true);
- while (nextSelectedElement && !nextSelectedElement.selectable)
- nextSelectedElement = nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);
- handled = nextSelectedElement ? true : false;
- } else if (event.keyIdentifier === "Down" && !event.altKey) {
- nextSelectedElement = this.selectedTreeElement.traverseNextTreeElement(true);
- while (nextSelectedElement && !nextSelectedElement.selectable)
- nextSelectedElement = nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);
- handled = nextSelectedElement ? true : false;
- } else if (event.keyIdentifier === "Left") {
- if (this.selectedTreeElement.expanded) {
- if (event.altKey)
- this.selectedTreeElement.collapseRecursively();
- else
- this.selectedTreeElement.collapse();
- handled = true;
- } else if (this.selectedTreeElement.parent && !this.selectedTreeElement.parent.root) {
- handled = true;
- if (this.selectedTreeElement.parent.selectable) {
- nextSelectedElement = this.selectedTreeElement.parent;
- while (nextSelectedElement && !nextSelectedElement.selectable)
- nextSelectedElement = nextSelectedElement.parent;
- handled = nextSelectedElement ? true : false;
- } else if (this.selectedTreeElement.parent)
- this.selectedTreeElement.parent.collapse();
- }
- } else if (event.keyIdentifier === "Right") {
- if (!this.selectedTreeElement.revealed()) {
- this.selectedTreeElement.reveal();
- handled = true;
- } else if (this.selectedTreeElement.hasChildren) {
- handled = true;
- if (this.selectedTreeElement.expanded) {
- nextSelectedElement = this.selectedTreeElement.children[0];
- while (nextSelectedElement && !nextSelectedElement.selectable)
- nextSelectedElement = nextSelectedElement.nextSibling;
- handled = nextSelectedElement ? true : false;
- } else {
- if (event.altKey)
- this.selectedTreeElement.expandRecursively();
- else
- this.selectedTreeElement.expand();
- }
- }
- } else if (event.keyCode === 8 /* Backspace */ || event.keyCode === 46 /* Delete */) {
- if (this.selectedTreeElement.ondelete)
- handled = this.selectedTreeElement.ondelete();
- if (!handled && this.treeOutline.ondelete)
- handled = this.treeOutline.ondelete(this.selectedTreeElement);
- } else if (isEnterKey(event)) {
- if (this.selectedTreeElement.onenter)
- handled = this.selectedTreeElement.onenter();
- if (!handled && this.treeOutline.onenter)
- handled = this.treeOutline.onenter(this.selectedTreeElement);
- } else if (event.keyIdentifier === "U+0020" /* Space */) {
- if (this.selectedTreeElement.onspace)
- handled = this.selectedTreeElement.onspace();
- if (!handled && this.treeOutline.onspace)
- handled = this.treeOutline.onspace(this.selectedTreeElement);
- }
-
- if (nextSelectedElement) {
- nextSelectedElement.reveal();
- nextSelectedElement.select(false, true);
- }
-
- if (handled) {
- event.preventDefault();
- event.stopPropagation();
- }
-}
-
-TreeOutline.prototype.expand = function()
-{
- // this is the root, do nothing
-}
-
-TreeOutline.prototype.collapse = function()
-{
- // this is the root, do nothing
-}
-
-TreeOutline.prototype.revealed = function()
-{
- return true;
-}
-
-TreeOutline.prototype.reveal = function()
-{
- // this is the root, do nothing
-}
-
-TreeOutline.prototype.select = function()
-{
- // this is the root, do nothing
-}
-
-/**
- * @param {boolean=} omitFocus
- */
-TreeOutline.prototype.revealAndSelect = function(omitFocus)
-{
- // this is the root, do nothing
-}
-
-TreeOutline.prototype.__proto__ = WebInspector.Object.prototype;
-
-/**
- * @constructor
- * @param {Object=} representedObject
- * @param {boolean=} hasChildren
- */
-function TreeElement(title, representedObject, hasChildren)
-{
- WebInspector.Object.call(this);
-
- this._title = title;
- this.representedObject = (representedObject || {});
-
- if (this.representedObject.__treeElementIdentifier)
- this.identifier = this.representedObject.__treeElementIdentifier;
- else {
- this.identifier = TreeOutline._knownTreeElementNextIdentifier++;
- this.representedObject.__treeElementIdentifier = this.identifier;
- }
-
- this._hidden = false;
- this._selectable = true;
- this.expanded = false;
- this.selected = false;
- this.hasChildren = hasChildren;
- this.children = [];
- this.treeOutline = null;
- this.parent = null;
- this.previousSibling = null;
- this.nextSibling = null;
- this._listItemNode = null;
-}
-
-TreeElement.prototype = {
- constructor: TreeElement,
-
- arrowToggleWidth: 10,
-
- get selectable() {
- if (this._hidden)
- return false;
- return this._selectable;
- },
-
- set selectable(x) {
- this._selectable = x;
- },
-
- get listItemElement() {
- return this._listItemNode;
- },
-
- get childrenListElement() {
- return this._childrenListNode;
- },
-
- get title() {
- return this._title;
- },
-
- set title(x) {
- this._title = x;
- this._setListItemNodeContent();
- this.didChange();
- },
-
- get titleHTML() {
- return this._titleHTML;
- },
-
- set titleHTML(x) {
- this._titleHTML = x;
- this._setListItemNodeContent();
- this.didChange();
- },
-
- get tooltip() {
- return this._tooltip;
- },
-
- set tooltip(x) {
- this._tooltip = x;
- if (this._listItemNode)
- this._listItemNode.title = x ? x : "";
- this.didChange();
- },
-
- get hasChildren() {
- return this._hasChildren;
- },
-
- set hasChildren(x) {
- if (this._hasChildren === x)
- return;
-
- this._hasChildren = x;
-
- if (!this._listItemNode)
- return;
-
- if (x)
- this._listItemNode.classList.add("parent");
- else {
- this._listItemNode.classList.remove("parent");
- this.collapse();
- }
-
- this.didChange();
- },
-
- get hidden() {
- return this._hidden;
- },
-
- set hidden(x) {
- if (this._hidden === x)
- return;
-
- this._hidden = x;
-
- if (x) {
- if (this._listItemNode)
- this._listItemNode.classList.add("hidden");
- if (this._childrenListNode)
- this._childrenListNode.classList.add("hidden");
- } else {
- if (this._listItemNode)
- this._listItemNode.classList.remove("hidden");
- if (this._childrenListNode)
- this._childrenListNode.classList.remove("hidden");
- }
-
- if (this.treeOutline && this.treeOutline.onhidden)
- this.treeOutline.onhidden(this, x);
- },
-
- get shouldRefreshChildren() {
- return this._shouldRefreshChildren;
- },
-
- set shouldRefreshChildren(x) {
- this._shouldRefreshChildren = x;
- if (x && this.expanded)
- this.expand();
- },
-
- _fireDidChange: function()
- {
- delete this._didChangeTimeoutIdentifier;
-
- if (this.treeOutline)
- this.treeOutline._treeElementDidChange(this);
- },
-
- didChange: function()
- {
- if (!this.treeOutline)
- return;
-
- // Prevent telling the TreeOutline multiple times in a row by delaying it with a timeout.
- if (!this._didChangeTimeoutIdentifier)
- this._didChangeTimeoutIdentifier = setTimeout(this._fireDidChange.bind(this), 0);
- },
-
- _setListItemNodeContent: function()
- {
- if (!this._listItemNode)
- return;
-
- if (!this._titleHTML && !this._title)
- this._listItemNode.removeChildren();
- else if (typeof this._titleHTML === "string")
- this._listItemNode.innerHTML = this._titleHTML;
- else if (typeof this._title === "string")
- this._listItemNode.textContent = this._title;
- else {
- this._listItemNode.removeChildren();
- if (this._title.parentNode)
- this._title.parentNode.removeChild(this._title);
- this._listItemNode.appendChild(this._title);
- }
- }
-}
-
-TreeElement.prototype.appendChild = TreeOutline.prototype.appendChild;
-TreeElement.prototype.insertChild = TreeOutline.prototype.insertChild;
-TreeElement.prototype.removeChild = TreeOutline.prototype.removeChild;
-TreeElement.prototype.removeChildAtIndex = TreeOutline.prototype.removeChildAtIndex;
-TreeElement.prototype.removeChildren = TreeOutline.prototype.removeChildren;
-TreeElement.prototype.removeChildrenRecursive = TreeOutline.prototype.removeChildrenRecursive;
-
-TreeElement.prototype._attach = function()
-{
- if (!this._listItemNode || this.parent._shouldRefreshChildren) {
- if (this._listItemNode && this._listItemNode.parentNode)
- this._listItemNode.parentNode.removeChild(this._listItemNode);
-
- this._listItemNode = this.treeOutline._childrenListNode.ownerDocument.createElement("li");
- this._listItemNode.treeElement = this;
- this._setListItemNodeContent();
- this._listItemNode.title = this._tooltip ? this._tooltip : "";
-
- if (this.hidden)
- this._listItemNode.classList.add("hidden");
- if (this.hasChildren)
- this._listItemNode.classList.add("parent");
- if (this.expanded)
- this._listItemNode.classList.add("expanded");
- if (this.selected)
- this._listItemNode.classList.add("selected");
-
- this._listItemNode.addEventListener("mousedown", TreeElement.treeElementMouseDown, false);
- this._listItemNode.addEventListener("click", TreeElement.treeElementToggled, false);
- this._listItemNode.addEventListener("dblclick", TreeElement.treeElementDoubleClicked, false);
-
- if (this.onattach)
- this.onattach(this);
- }
-
- var nextSibling = null;
- if (this.nextSibling && this.nextSibling._listItemNode && this.nextSibling._listItemNode.parentNode === this.parent._childrenListNode)
- nextSibling = this.nextSibling._listItemNode;
- this.parent._childrenListNode.insertBefore(this._listItemNode, nextSibling);
- if (this._childrenListNode)
- this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);
- if (this.selected)
- this.select();
- if (this.expanded)
- this.expand();
-}
-
-TreeElement.prototype._detach = function()
-{
- if (this.ondetach)
- this.ondetach(this);
- if (this._listItemNode && this._listItemNode.parentNode)
- this._listItemNode.parentNode.removeChild(this._listItemNode);
- if (this._childrenListNode && this._childrenListNode.parentNode)
- this._childrenListNode.parentNode.removeChild(this._childrenListNode);
-}
-
-TreeElement.treeElementMouseDown = function(event)
-{
- var element = event.currentTarget;
- if (!element || !element.treeElement || !element.treeElement.selectable)
- return;
-
- if (element.treeElement.isEventWithinDisclosureTriangle(event)) {
- event.preventDefault();
- return;
- }
-
- element.treeElement.selectOnMouseDown(event);
-}
-
-TreeElement.treeElementToggled = function(event)
-{
- var element = event.currentTarget;
- if (!element || !element.treeElement)
- return;
-
- var toggleOnClick = element.treeElement.toggleOnClick && !element.treeElement.selectable;
- var isInTriangle = element.treeElement.isEventWithinDisclosureTriangle(event);
- if (!toggleOnClick && !isInTriangle)
- return;
-
- if (element.treeElement.expanded) {
- if (event.altKey)
- element.treeElement.collapseRecursively();
- else
- element.treeElement.collapse();
- } else {
- if (event.altKey)
- element.treeElement.expandRecursively();
- else
- element.treeElement.expand();
- }
- event.stopPropagation();
-}
-
-TreeElement.treeElementDoubleClicked = function(event)
-{
- var element = event.currentTarget;
- if (!element || !element.treeElement)
- return;
-
- if (element.treeElement.isEventWithinDisclosureTriangle(event))
- return;
-
- if (element.treeElement.ondblclick)
- element.treeElement.ondblclick.call(element.treeElement, event);
- else if (element.treeElement.hasChildren && !element.treeElement.expanded)
- element.treeElement.expand();
-}
-
-TreeElement.prototype.collapse = function()
-{
- if (this._listItemNode)
- this._listItemNode.classList.remove("expanded");
- if (this._childrenListNode)
- this._childrenListNode.classList.remove("expanded");
-
- this.expanded = false;
- if (this.treeOutline)
- this.treeOutline._treeElementsExpandedState[this.identifier] = false;
-
- if (this.oncollapse)
- this.oncollapse(this);
-
- if (this.treeOutline && this.treeOutline.oncollapse)
- this.treeOutline.oncollapse(this);
-}
-
-TreeElement.prototype.collapseRecursively = function()
-{
- var item = this;
- while (item) {
- if (item.expanded)
- item.collapse();
- item = item.traverseNextTreeElement(false, this, true);
- }
-}
-
-TreeElement.prototype.expand = function()
-{
- if (this.expanded && !this._shouldRefreshChildren && this._childrenListNode)
- return;
-
- // Set this before onpopulate. Since onpopulate can add elements and call onadd, this makes
- // sure the expanded flag is true before calling those functions. This prevents the possibility
- // of an infinite loop if onpopulate or onadd were to call expand.
-
- this.expanded = true;
- if (this.treeOutline)
- this.treeOutline._treeElementsExpandedState[this.identifier] = true;
-
- // If there are no children, return. We will be expanded once we have children.
- if (!this.hasChildren)
- return;
-
- if (this.treeOutline && (!this._childrenListNode || this._shouldRefreshChildren)) {
- if (this._childrenListNode && this._childrenListNode.parentNode)
- this._childrenListNode.parentNode.removeChild(this._childrenListNode);
-
- this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol");
- this._childrenListNode.parentTreeElement = this;
- this._childrenListNode.classList.add("children");
-
- if (this.hidden)
- this._childrenListNode.classList.add("hidden");
-
- this.onpopulate();
-
- for (var i = 0; i < this.children.length; ++i)
- this.children[i]._attach();
-
- delete this._shouldRefreshChildren;
- }
-
- if (this._listItemNode) {
- this._listItemNode.classList.add("expanded");
- if (this._childrenListNode && this._childrenListNode.parentNode != this._listItemNode.parentNode)
- this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);
- }
-
- if (this._childrenListNode)
- this._childrenListNode.classList.add("expanded");
-
- if (this.onexpand)
- this.onexpand(this);
-
- if (this.treeOutline && this.treeOutline.onexpand)
- this.treeOutline.onexpand(this);
-}
-
-TreeElement.prototype.expandRecursively = function(maxDepth)
-{
- var item = this;
- var info = {};
- var depth = 0;
-
- // The Inspector uses TreeOutlines to represents object properties, so recursive expansion
- // in some case can be infinite, since JavaScript objects can hold circular references.
- // So default to a recursion cap of 3 levels, since that gives fairly good results.
- if (typeof maxDepth === "undefined" || typeof maxDepth === "null")
- maxDepth = 3;
-
- while (item) {
- if (depth < maxDepth)
- item.expand();
- item = item.traverseNextTreeElement(false, this, (depth >= maxDepth), info);
- depth += info.depthChange;
- }
-}
-
-TreeElement.prototype.hasAncestor = function(ancestor) {
- if (!ancestor)
- return false;
-
- var currentNode = this.parent;
- while (currentNode) {
- if (ancestor === currentNode)
- return true;
- currentNode = currentNode.parent;
- }
-
- return false;
-}
-
-TreeElement.prototype.reveal = function()
-{
- var currentAncestor = this.parent;
- while (currentAncestor && !currentAncestor.root) {
- if (!currentAncestor.expanded)
- currentAncestor.expand();
- currentAncestor = currentAncestor.parent;
- }
-
- if (this.onreveal)
- this.onreveal(this);
-}
-
-TreeElement.prototype.revealed = function()
-{
- var currentAncestor = this.parent;
- while (currentAncestor && !currentAncestor.root) {
- if (!currentAncestor.expanded)
- return false;
- currentAncestor = currentAncestor.parent;
- }
-
- return true;
-}
-
-TreeElement.prototype.selectOnMouseDown = function(event)
-{
- this.select(false, true);
-}
-
-/**
- * @param {boolean=} omitFocus
- * @param {boolean=} selectedByUser
- */
-TreeElement.prototype.select = function(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect)
-{
- if (!this.treeOutline || !this.selectable)
- return;
-
- if (this.selected && !this.treeOutline.allowsRepeatSelection)
- return;
-
- if (!omitFocus)
- this.treeOutline._childrenListNode.focus();
-
- // Focusing on another node may detach "this" from tree.
- if (!this.treeOutline)
- return;
-
- this.treeOutline.processingSelectionChange = true;
-
- if (!this.selected) {
- if (this.treeOutline.selectedTreeElement)
- this.treeOutline.selectedTreeElement.deselect(suppressOnDeselect);
-
- this.selected = true;
- this.treeOutline.selectedTreeElement = this;
-
- if (this._listItemNode)
- this._listItemNode.classList.add("selected");
- }
-
- if (this.onselect && !suppressOnSelect)
- this.onselect(this, selectedByUser);
-
- if (this.treeOutline.onselect && !suppressOnSelect)
- this.treeOutline.onselect(this, selectedByUser);
-
- delete this.treeOutline.processingSelectionChange;
-}
-
-/**
- * @param {boolean=} omitFocus
- */
-TreeElement.prototype.revealAndSelect = function(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect)
-{
- this.reveal();
- this.select(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect);
-}
-
-/**
- * @param {boolean=} suppressOnDeselect
- */
-TreeElement.prototype.deselect = function(suppressOnDeselect)
-{
- if (!this.treeOutline || this.treeOutline.selectedTreeElement !== this || !this.selected)
- return false;
-
- this.selected = false;
- this.treeOutline.selectedTreeElement = null;
-
- if (this._listItemNode)
- this._listItemNode.classList.remove("selected");
-
- if (this.ondeselect && !suppressOnDeselect)
- this.ondeselect(this);
-
- if (this.treeOutline.ondeselect && !suppressOnDeselect)
- this.treeOutline.ondeselect(this);
-
- return true;
-}
-
-TreeElement.prototype.onpopulate = function()
-{
- // Overriden by subclasses.
-}
-
-/**
- * @param {boolean} skipUnrevealed
- * @param {(TreeOutline|TreeElement)=} stayWithin
- * @param {boolean=} dontPopulate
- * @param {Object=} info
- * @return {TreeElement}
- */
-TreeElement.prototype.traverseNextTreeElement = function(skipUnrevealed, stayWithin, dontPopulate, info)
-{
- if (!dontPopulate && this.hasChildren)
- this.onpopulate.call(this); // FIXME: This shouldn't need to use call, but this is working around a JSC bug. https://webkit.org/b/74811
-
- if (info)
- info.depthChange = 0;
-
- var element = skipUnrevealed ? (this.revealed() ? this.children[0] : null) : this.children[0];
- if (element && (!skipUnrevealed || (skipUnrevealed && this.expanded))) {
- if (info)
- info.depthChange = 1;
- return element;
- }
-
- if (this === stayWithin)
- return null;
-
- element = skipUnrevealed ? (this.revealed() ? this.nextSibling : null) : this.nextSibling;
- if (element)
- return element;
-
- element = this;
- while (element && !element.root && !(skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling) && element.parent !== stayWithin) {
- if (info)
- info.depthChange -= 1;
- element = element.parent;
- }
-
- if (!element)
- return null;
-
- return (skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling);
-}
-
-/**
- * @param {boolean} skipUnrevealed
- * @param {boolean=} dontPopulate
- * @return {TreeElement}
- */
-TreeElement.prototype.traversePreviousTreeElement = function(skipUnrevealed, dontPopulate)
-{
- var element = skipUnrevealed ? (this.revealed() ? this.previousSibling : null) : this.previousSibling;
- if (!dontPopulate && element && element.hasChildren)
- element.onpopulate();
-
- while (element && (skipUnrevealed ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1])) {
- if (!dontPopulate && element.hasChildren)
- element.onpopulate();
- element = (skipUnrevealed ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1]);
- }
-
- if (element)
- return element;
-
- if (!this.parent || this.parent.root)
- return null;
-
- return this.parent;
-}
-
-TreeElement.prototype.isEventWithinDisclosureTriangle = function(event)
-{
- // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)
- var computedLeftPadding = window.getComputedStyle(this._listItemNode).getPropertyCSSValue("padding-left").getFloatValue(CSSPrimitiveValue.CSS_PX);
- var left = this._listItemNode.totalOffsetLeft + computedLeftPadding;
- return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
-}
-
-TreeElement.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTreeOutlineDataGridSynchronizerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/TreeOutlineDataGridSynchronizer.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TreeOutlineDataGridSynchronizer.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/TreeOutlineDataGridSynchronizer.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,298 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TreeOutlineDataGridSynchronizer = function(treeOutline, dataGrid, delegate)
-{
- WebInspector.Object.call(this);
-
- this._treeOutline = treeOutline;
- this._dataGrid = dataGrid;
- this._delegate = delegate || null;
- this._enabled = true;
-
- this._treeOutline.element.parentNode.addEventListener("scroll", this._treeOutlineScrolled.bind(this));
- this._dataGrid.scrollContainer.addEventListener("scroll", this._dataGridScrolled.bind(this));
-
- this._treeOutline.__dataGridNode = this._dataGrid;
-
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.ExpandedNode, this._dataGridNodeExpanded, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.CollapsedNode, this._dataGridNodeCollapsed, this);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
-
- // FIXME: This is a hack. TreeOutline should just dispatch events via WebInspector.Object.
- var existingOnAdd = treeOutline.onadd;
- var existingOnRemove = treeOutline.onremove;
- var existingOnExpand = treeOutline.onexpand;
- var existingOnCollapse = treeOutline.oncollapse;
- var existingOnHidden = treeOutline.onhidden;
- var existingOnSelect = treeOutline.onselect;
-
- treeOutline.onadd = function(element) {
- this._treeElementAdded(element);
- if (existingOnAdd)
- existingOnAdd.call(treeOutline, element);
- }.bind(this);
-
- treeOutline.onremove = function(element) {
- this._treeElementRemoved(element);
- if (existingOnRemove)
- existingOnRemove.call(treeOutline, element);
- }.bind(this);
-
- treeOutline.onexpand = function(element) {
- this._treeElementExpanded(element);
- if (existingOnExpand)
- existingOnExpand.call(treeOutline, element);
- }.bind(this);
-
- treeOutline.oncollapse = function(element) {
- this._treeElementCollapsed(element);
- if (existingOnCollapse)
- existingOnCollapse.call(treeOutline, element);
- }.bind(this);
-
- treeOutline.onhidden = function(element, hidden) {
- this._treeElementHiddenChanged(element, hidden);
- if (existingOnHidden)
- existingOnHidden.call(treeOutline, element, hidden);
- }.bind(this);
-
- treeOutline.onselect = function(element, selectedByUser) {
- this._treeElementSelected(element, selectedByUser);
- if (existingOnSelect)
- existingOnSelect.call(treeOutline, element, selectedByUser);
- }.bind(this);
-}
-
-WebInspector.TreeOutlineDataGridSynchronizer.prototype = {
- constructor: WebInspector.TreeOutlineDataGridSynchronizer,
- __proto__: WebInspector.Object,
-
- // Public
-
- get treeOutline()
- {
- return this._treeOutline;
- },
-
- get dataGrid()
- {
- return this._dataGrid;
- },
-
- get delegate()
- {
- return this._delegate;
- },
-
- get enabled()
- {
- return this._enabled;
- },
-
- set enabled(x)
- {
- this._enabled = x || false;
- },
-
- associate: function(treeElement, dataGridNode)
- {
- console.assert(treeElement);
- console.assert(dataGridNode);
-
- treeElement.__dataGridNode = dataGridNode;
- dataGridNode.__treeElement = treeElement;
- },
-
- synchronize: function()
- {
- this._dataGrid.scrollContainer.scrollTop = this._treeOutline.element.parentNode.scrollTop;
- if (this._treeOutline.selectedTreeElement)
- this._treeOutline.selectedTreeElement.__dataGridNode.select(true);
- else if (this._dataGrid.selectedNode)
- this._dataGrid.selectedNode.deselect(true);
- },
-
- treeElementForDataGridNode: function(dataGridNode)
- {
- return dataGridNode.__treeElement || null;
- },
-
- dataGridNodeForTreeElement: function(treeElement)
- {
- if (treeElement.__dataGridNode)
- return treeElement.__dataGridNode;
-
- if (typeof this._delegate.dataGridNodeForTreeElement === "function") {
- var dataGridNode = this._delegate.dataGridNodeForTreeElement(treeElement);
- if (dataGridNode)
- this.associate(treeElement, dataGridNode);
- return dataGridNode;
- }
-
- return null;
- },
-
- // Private
-
- _treeOutlineScrolled: function(event)
- {
- if (!this._enabled)
- return;
-
- if (this._ignoreNextTreeOutlineScrollEvent) {
- delete this._ignoreNextTreeOutlineScrollEvent;
- return;
- }
-
- this._ignoreNextDataGridScrollEvent = true;
- this._dataGrid.scrollContainer.scrollTop = this._treeOutline.element.parentNode.scrollTop;
- },
-
- _dataGridScrolled: function(event)
- {
- if (!this._enabled)
- return;
-
- if (this._ignoreNextDataGridScrollEvent) {
- delete this._ignoreNextDataGridScrollEvent;
- return;
- }
-
- this._ignoreNextTreeOutlineScrollEvent = true;
- this._treeOutline.element.parentNode.scrollTop = this._dataGrid.scrollContainer.scrollTop;
- },
-
- _dataGridNodeSelected: function(event)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = this._dataGrid.selectedNode;
- if (dataGridNode)
- dataGridNode.__treeElement.select(true, true, true, true);
- },
-
- _dataGridNodeExpanded: function(event)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = event.data.dataGridNode;
- console.assert(dataGridNode);
-
- if (!dataGridNode.__treeElement.expanded)
- dataGridNode.__treeElement.expand();
- },
-
- _dataGridNodeCollapsed: function(event)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = event.data.dataGridNode;
- console.assert(dataGridNode);
-
- if (dataGridNode.__treeElement.expanded)
- dataGridNode.__treeElement.collapse();
- },
-
- _treeElementSelected: function(treeElement, selectedByUser)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = treeElement.__dataGridNode;
- console.assert(dataGridNode);
-
- dataGridNode.select(true);
- },
-
- _treeElementAdded: function(treeElement)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = this.dataGridNodeForTreeElement(treeElement);
- console.assert(dataGridNode);
-
- var parentDataGridNode = treeElement.parent.__dataGridNode;
- console.assert(dataGridNode);
-
- var childIndex = treeElement.parent.children.indexOf(treeElement);
- console.assert(childIndex !== -1);
-
- parentDataGridNode.insertChild(dataGridNode, childIndex);
- },
-
- _treeElementRemoved: function(treeElement)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = treeElement.__dataGridNode;
- console.assert(dataGridNode);
-
- if (dataGridNode.parent)
- dataGridNode.parent.removeChild(dataGridNode);
- },
-
- _treeElementExpanded: function(treeElement)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = treeElement.__dataGridNode;
- console.assert(dataGridNode);
-
- if (!dataGridNode.expanded)
- dataGridNode.expand();
- },
-
- _treeElementCollapsed: function(treeElement)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = treeElement.__dataGridNode;
- console.assert(dataGridNode);
-
- if (dataGridNode.expanded)
- dataGridNode.collapse();
- },
-
- _treeElementHiddenChanged: function(treeElement, hidden)
- {
- if (!this._enabled)
- return;
-
- var dataGridNode = treeElement.__dataGridNode;
- console.assert(dataGridNode);
-
- dataGridNode.element.classList.toggle("hidden", hidden);
- }
-}
-
-WebInspector.TreeOutlineDataGridSynchronizer.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceURLUtilitiesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/URLUtilities.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/URLUtilities.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/URLUtilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,211 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-function removeURLFragment(url)
-{
- var hashIndex = url.indexOf("#");
- if (hashIndex >= 0)
- return url.substring(0, hashIndex);
- return url;
-}
-
-function relativePath(path, basePath)
-{
- console.assert(path.charAt(0) === "/");
- console.assert(basePath.charAt(0) === "/");
-
- var pathComponents = path.split("/");
- var baseComponents = basePath.replace(/\/$/, "").split("/");
- var finalComponents = [];
-
- var index = 1;
- for (; index < pathComponents.length && index < baseComponents.length; ++index) {
- if (pathComponents[index] !== baseComponents[index])
- break;
- }
-
- for (var i = index; i < baseComponents.length; ++i)
- finalComponents.push("..");
-
- for (var i = index; i < pathComponents.length; ++i)
- finalComponents.push(pathComponents[i]);
-
- return finalComponents.join("/");
-}
-
-function parseSecurityOrigin(securityOrigin)
-{
- securityOrigin = securityOrigin ? securityOrigin.trim() : "";
-
- var match = securityOrigin.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?$/i);
- if (!match)
- return {scheme: null, host: null, port: null};
-
- var scheme = match[1].toLowerCase();
- var host = match[2].toLowerCase();
- var port = Number(match[3]) || null;
-
- return {scheme: scheme, host: host, port: port};
-}
-
-function parseURL(url)
-{
- url = url ? url.trim() : "";
-
- var match = url.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);
- if (!match)
- return {scheme: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null};
-
- var scheme = match[1].toLowerCase();
- var host = match[2].toLowerCase();
- var port = Number(match[3]) || null;
- var wholePath = match[4] || null;
- var fragment = match[5] || null;
- var path = wholePath;
- var queryString = null;
-
- // Split the path and the query string.
- if (wholePath) {
- var indexOfQuery = wholePath.indexOf("?");
- if (indexOfQuery !== -1) {
- path = wholePath.substring(0, indexOfQuery);
- queryString = wholePath.substring(indexOfQuery + 1);
- }
- path = resolveDotsInPath(path);
- }
-
- // Find last path component.
- var lastPathComponent = null;
- if (path && path !== "/") {
- // Skip the trailing slash if there is one.
- var endOffset = path[path.length - 1] === "/" ? 1 : 0;
- var lastSlashIndex = path.lastIndexOf("/", path.length - 1 - endOffset);
- if (lastSlashIndex !== -1)
- lastPathComponent = path.substring(lastSlashIndex + 1, path.length - endOffset);
- }
-
- return {scheme: scheme, host: host, port: port, path: path, queryString: queryString, fragment: fragment, lastPathComponent: lastPathComponent};
-}
-
-function absoluteURL(partialURL, baseURL)
-{
- partialURL = partialURL ? partialURL.trim() : "";
-
- // Return data and javascript URLs as-is.
- if (partialURL.startsWith("data:") || partialURL.startsWith("javascript:") || partialURL.startsWith("mailto:"))
- return partialURL;
-
- // If the URL has a scheme it is already a full URL, so return it.
- if (parseURL(partialURL).scheme)
- return partialURL;
-
- // If there is no partial URL, just return the base URL.
- if (!partialURL)
- return baseURL || null;
-
- var baseURLComponents = parseURL(baseURL);
-
- // The base URL needs to be an absolute URL. Return null if it isn't.
- if (!baseURLComponents.scheme)
- return null;
-
- // A URL that starts with "//" is a full URL without the scheme. Use the base URL scheme.
- if (partialURL[0] === "/" && partialURL[1] === "/")
- return baseURLComponents.scheme + ":" + partialURL;
-
- // The path can be null for URLs that have just a scheme and host (like "http://apple.com"). So make the path be "/".
- if (!baseURLComponents.path)
- baseURLComponents.path = "/";
-
- // Generate the base URL prefix that is used in the rest of the cases.
- var baseURLPrefix = baseURLComponents.scheme + "://" + baseURLComponents.host + (baseURLComponents.port ? (":" + baseURLComponents.port) : "");
-
- // A URL that starts with "?" is just a query string that gets applied to the base URL (replacing the base URL query string and fragment).
- if (partialURL[0] === "?")
- return baseURLPrefix + baseURLComponents.path + partialURL;
-
- // A URL that starts with "/" is an absolute path that gets applied to the base URL (replacing the base URL path, query string and fragment).
- if (partialURL[0] === "/")
- return baseURLPrefix + resolveDotsInPath(partialURL);
-
- // Generate the base path that is used in the final case by removing everything after the last "/" from the base URL's path.
- var basePath = baseURLComponents.path.substring(0, baseURLComponents.path.lastIndexOf("/")) + "/";
- return baseURLPrefix + resolveDotsInPath(basePath + partialURL);
-}
-
-function parseLocationQueryParameters(arrayResult)
-{
- // The first character is always the "?".
- return parseQueryString(window.location.search.substring(1), arrayResult);
-}
-
-function parseQueryString(queryString, arrayResult)
-{
- if (!queryString)
- return arrayResult ? [] : {};
-
- function decode(string)
- {
- try {
- // Replace "+" with " " then decode precent encoded values.
- return decodeURIComponent(string.replace(/\+/g, " "));
- } catch (e) {
- return string;
- }
- }
-
- var parameters = arrayResult ? [] : {};
- var parameterStrings = queryString.split("&");
- for (var i = 0; i < parameterStrings.length; ++i) {
- var pair = parameterStrings[i].split("=").map(decode);
- if (arrayResult)
- parameters.push({name: pair[0], value: pair[1]});
- else
- parameters[pair[0]] = pair[1];
- }
-
- return parameters;
-}
-
-WebInspector.displayNameForURL = function(url, urlComponents)
-{
- if (!urlComponents)
- urlComponents = parseURL(url);
-
- var displayName;
- try {
- displayName = decodeURIComponent(urlComponents.lastPathComponent || "");
- } catch (e) {
- displayName = urlComponents.lastPathComponent;
- }
-
- return displayName || WebInspector.displayNameForHost(urlComponents.host) || url;
-}
-
-WebInspector.displayNameForHost = function(host)
-{
- // FIXME <rdar://problem/11237413>: This should decode punycode hostnames.
- return host;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceUnitBezierjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/UnitBezier.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/UnitBezier.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/UnitBezier.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.UnitBezier = function(x1, y1, x2, y2)
-{
- WebInspector.Object.call(this);
-
- // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
- this._cx = 3.0 * x1;
- this._bx = 3.0 * (x2 - x1) - this._cx;
- this._ax = 1.0 - this._cx - this._bx;
-
- this._cy = 3.0 * y1;
- this._by = 3.0 * (y2 - y1) - this._cy;
- this._ay = 1.0 - this._cy - this._by;
-};
-
-WebInspector.UnitBezier.prototype = {
- constructor: WebInspector.UnitBezier,
-
- // Public
-
- solve: function(x, epsilon)
- {
- return this._sampleCurveY(this._solveCurveX(x, epsilon));
- },
-
- // Private
-
- _sampleCurveX: function(t)
- {
- // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
- return ((this._ax * t + this._bx) * t + this._cx) * t;
- },
-
- _sampleCurveY: function(t)
- {
- return ((this._ay * t + this._by) * t + this._cy) * t;
- },
-
- _sampleCurveDerivativeX: function(t)
- {
- return (3.0 * this._ax * t + 2.0 * this._bx) * t + this._cx;
- },
-
- // Given an x value, find a parametric value it came from.
- _solveCurveX: function(x, epsilon)
- {
- var t0, t1, t2, x2, d2, i;
-
- // First try a few iterations of Newton's method -- normally very fast.
- for (t2 = x, i = 0; i < 8; i++) {
- x2 = this._sampleCurveX(t2) - x;
- if (Math.abs(x2) < epsilon)
- return t2;
- d2 = this._sampleCurveDerivativeX(t2);
- if (Math.abs(d2) < 1e-6)
- break;
- t2 = t2 - x2 / d2;
- }
-
- // Fall back to the bisection method for reliability.
- t0 = 0.0;
- t1 = 1.0;
- t2 = x;
-
- if (t2 < t0)
- return t0;
- if (t2 > t1)
- return t1;
-
- while (t0 < t1) {
- x2 = this._sampleCurveX(t2);
- if (Math.abs(x2 - x) < epsilon)
- return t2;
- if (x > x2)
- t0 = t2;
- else
- t1 = t2;
- t2 = (t1 - t0) * 0.5 + t0;
- }
-
- // Failure.
- return t2;
- }
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceUtilitiesjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Utilities.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Utilities.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/Utilities.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,1012 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-Object.defineProperty(Object, "shallowCopy",
-{
- value: function(object)
- {
- // Make a new object and copy all the key/values. The values are not copied.
- var copy = {};
- var keys = Object.keys(object);
- for (var i = 0; i < keys.length; ++i)
- copy[keys[i]] = object[keys[i]];
- return copy;
- }
-});
-
-Object.defineProperty(Object, "shallowEqual",
-{
- value: function(a, b)
- {
- // Checks if two objects have the same top-level properties.
-
- // Check for strict equality in case they are the same object.
- if (a === b)
- return true;
-
- // Only objects can proceed. null is an object, but Object.keys throws for null.
- if (typeof a !== "object" || typeof b !== "object" || a === null || b === null)
- return false;
-
- var aKeys = Object.keys(a);
- var bKeys = Object.keys(b);
-
- // Check that each object has the same number of keys.
- if (aKeys.length !== bKeys.length)
- return false;
-
- // Check if all the keys and their values are equal.
- for (var i = 0; i < aKeys.length; ++i) {
- // Check that b has the same key as a.
- if (!(aKeys[i] in b))
- return false;
-
- // Check that the values are strict equal since this is only
- // a shallow check, not a recursive one.
- if (a[aKeys[i]] !== b[aKeys[i]])
- return false;
- }
-
- return true;
- }
-});
-
-Object.defineProperty(Object.prototype, "valueForCaseInsensitiveKey",
-{
- value: function(key)
- {
- if (this.hasOwnProperty(key))
- return this[key];
-
- var lowerCaseKey = key.toLowerCase();
- for (var currentKey in this) {
- if (currentKey.toLowerCase() === lowerCaseKey)
- return this[currentKey];
- }
-
- return undefined;
- }
-});
-
-Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithClass",
-{
- value: function(className)
- {
- for (var node = this; node && node !== this.ownerDocument; node = node.parentNode)
- if (node.nodeType === Node.ELEMENT_NODE && node.classList.contains(className))
- return node;
- return null;
- }
-});
-
-Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithNodeNameInArray",
-{
- value: function(nameArray)
- {
- var lowerCaseNameArray = nameArray.map(function(name) { return name.toLowerCase() });
- for (var node = this; node && node !== this.ownerDocument; node = node.parentNode) {
- for (var i = 0; i < nameArray.length; ++i) {
- if (node.nodeName.toLowerCase() === lowerCaseNameArray[i])
- return node;
- }
- }
-
- return null;
- }
-});
-
-Object.defineProperty(Node.prototype, "enclosingNodeOrSelfWithNodeName",
-{
- value: function(nodeName)
- {
- return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);
- }
-});
-
-Object.defineProperty(Node.prototype, "isAncestor",
-{
- value: function(node)
- {
- if (!node)
- return false;
-
- var currentNode = node.parentNode;
- while (currentNode) {
- if (this === currentNode)
- return true;
- currentNode = currentNode.parentNode;
- }
-
- return false;
- }
-});
-
-Object.defineProperty(Node.prototype, "isDescendant",
-{
- value: function(descendant)
- {
- return !!descendant && descendant.isAncestor(this);
- }
-});
-
-
-Object.defineProperty(Node.prototype, "isSelfOrAncestor",
-{
- value: function(node)
- {
- return !!node && (node === this || this.isAncestor(node));
- }
-});
-
-
-Object.defineProperty(Node.prototype, "isSelfOrDescendant",
-{
- value: function(node)
- {
- return !!node && (node === this || this.isDescendant(node));
- }
-});
-
-Object.defineProperty(Node.prototype, "traverseNextNode",
-{
- value: function(stayWithin)
- {
- var node = this.firstChild;
- if (node)
- return node;
-
- if (stayWithin && this === stayWithin)
- return null;
-
- node = this.nextSibling;
- if (node)
- return node;
-
- node = this;
- while (node && !node.nextSibling && (!stayWithin || !node.parentNode || node.parentNode !== stayWithin))
- node = node.parentNode;
- if (!node)
- return null;
-
- return node.nextSibling;
- }
-});
-
-Object.defineProperty(Node.prototype, "traversePreviousNode",
-{
- value: function(stayWithin)
- {
- if (stayWithin && this === stayWithin)
- return null;
- var node = this.previousSibling;
- while (node && node.lastChild)
- node = node.lastChild;
- if (node)
- return node;
- return this.parentNode;
- }
-});
-
-
-Object.defineProperty(Node.prototype, "rangeOfWord",
-{
- value: function(offset, stopCharacters, stayWithinNode, direction)
- {
- var startNode;
- var startOffset = 0;
- var endNode;
- var endOffset = 0;
-
- if (!stayWithinNode)
- stayWithinNode = this;
-
- if (!direction || direction === "backward" || direction === "both") {
- var node = this;
- while (node) {
- if (node === stayWithinNode) {
- if (!startNode)
- startNode = stayWithinNode;
- break;
- }
-
- if (node.nodeType === Node.TEXT_NODE) {
- var start = (node === this ? (offset - 1) : (node.nodeValue.length - 1));
- for (var i = start; i >= 0; --i) {
- if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {
- startNode = node;
- startOffset = i + 1;
- break;
- }
- }
- }
-
- if (startNode)
- break;
-
- node = node.traversePreviousNode(stayWithinNode);
- }
-
- if (!startNode) {
- startNode = stayWithinNode;
- startOffset = 0;
- }
- } else {
- startNode = this;
- startOffset = offset;
- }
-
- if (!direction || direction === "forward" || direction === "both") {
- node = this;
- while (node) {
- if (node === stayWithinNode) {
- if (!endNode)
- endNode = stayWithinNode;
- break;
- }
-
- if (node.nodeType === Node.TEXT_NODE) {
- var start = (node === this ? offset : 0);
- for (var i = start; i < node.nodeValue.length; ++i) {
- if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {
- endNode = node;
- endOffset = i;
- break;
- }
- }
- }
-
- if (endNode)
- break;
-
- node = node.traverseNextNode(stayWithinNode);
- }
-
- if (!endNode) {
- endNode = stayWithinNode;
- endOffset = stayWithinNode.nodeType === Node.TEXT_NODE ? stayWithinNode.nodeValue.length : stayWithinNode.childNodes.length;
- }
- } else {
- endNode = this;
- endOffset = offset;
- }
-
- var result = this.ownerDocument.createRange();
- result.setStart(startNode, startOffset);
- result.setEnd(endNode, endOffset);
-
- return result;
-
- }
-});
-
-Object.defineProperty(Element.prototype, "totalOffsetLeft",
-{
- get: function()
- {
- return this.getBoundingClientRect().left;
- }
-});
-
-Object.defineProperty(Element.prototype, "totalOffsetTop",
-{
- get: function()
- {
- return this.getBoundingClientRect().top;
- }
-});
-
-Object.defineProperty(Element.prototype, "removeChildren",
-{
- value: function()
- {
- // This has been tested to be the fastest removal method.
- if (this.firstChild)
- this.textContent = "";
- }
-});
-
-Object.defineProperty(Element.prototype, "isInsertionCaretInside",
-{
- value: function()
- {
- var selection = window.getSelection();
- if (!selection.rangeCount || !selection.isCollapsed)
- return false;
- var selectionRange = selection.getRangeAt(0);
- return selectionRange.startContainer === this || selectionRange.startContainer.isDescendant(this);
- }
-});
-
-Object.defineProperty(Element.prototype, "removeMatchingStyleClasses",
-{
- value: function(classNameRegex)
- {
- var regex = new RegExp("(^|\\s+)" + classNameRegex + "($|\\s+)");
- if (regex.test(this.className))
- this.className = this.className.replace(regex, " ");
- }
-});
-
-Object.defineProperty(Element.prototype, "createChild",
-{
- value: function(elementName, className)
- {
- var element = this.ownerDocument.createElement(elementName);
- if (className)
- element.className = className;
- this.appendChild(element);
- return element;
- }
-});
-
-Object.defineProperty(Element.prototype, "isScrolledToBottom",
-{
- value: function()
- {
- // This code works only for 0-width border
- return this.scrollTop + this.clientHeight === this.scrollHeight;
- }
-});
-
-Object.defineProperty(Element.prototype, "recalculateStyles",
-{
- value: function()
- {
- this.ownerDocument.defaultView.getComputedStyle(this);
- }
-});
-
-Object.defineProperty(DocumentFragment.prototype, "createChild",
-{
- value: Element.prototype.createChild
-});
-
-Object.defineProperty(Array.prototype, "contains",
-{
- value: function(value)
- {
- return this.indexOf(value) !== -1;
- }
-});
-
-Object.defineProperty(Array.prototype, "lastValue",
-{
- get: function()
- {
- if (!this.length)
- return undefined;
- return this[this.length - 1];
- }
-});
-
-Object.defineProperty(Array.prototype, "remove",
-{
- value: function(value, onlyFirst)
- {
- for (var i = this.length - 1; i >= 0; --i) {
- if (this[i] === value) {
- this.splice(i, 1);
- if (onlyFirst)
- return;
- }
- }
- }
-});
-
-Object.defineProperty(Array.prototype, "keySet",
-{
- value: function()
- {
- var keys = {};
- for (var i = 0; i < this.length; ++i)
- keys[this[i]] = true;
- return keys;
- }
-});
-
-Object.defineProperty(String.prototype, "trimMiddle",
-{
- value: function(maxLength)
- {
- if (this.length <= maxLength)
- return this;
- var leftHalf = maxLength >> 1;
- var rightHalf = maxLength - leftHalf - 1;
- return this.substr(0, leftHalf) + "\u2026" + this.substr(this.length - rightHalf, rightHalf);
- }
-});
-
-Object.defineProperty(String.prototype, "trimEnd",
-{
- value: function(maxLength)
- {
- if (this.length <= maxLength)
- return this;
- return this.substr(0, maxLength - 1) + "\u2026";
- }
-});
-
-Object.defineProperty(String.prototype, "collapseWhitespace",
-{
- value: function()
- {
- return this.replace(/[\s\xA0]+/g, " ");
- }
-});
-
-Object.defineProperty(String.prototype, "escapeCharacters",
-{
- value: function(chars)
- {
- var foundChar = false;
- for (var i = 0; i < chars.length; ++i) {
- if (this.indexOf(chars.charAt(i)) !== -1) {
- foundChar = true;
- break;
- }
- }
-
- if (!foundChar)
- return this;
-
- var result = "";
- for (var i = 0; i < this.length; ++i) {
- if (chars.indexOf(this.charAt(i)) !== -1)
- result += "\\";
- result += this.charAt(i);
- }
-
- return result;
- }
-});
-
-Object.defineProperty(String.prototype, "escapeForRegExp",
-{
- value: function()
- {
- return this.escapeCharacters("^[]{}()\\.$*+?|");
- }
-});
-
-Object.defineProperty(String.prototype, "capitalize",
-{
- value: function()
- {
- return this.charAt(0).toUpperCase() + this.slice(1);
- }
-});
-
-Object.defineProperty(String, "tokenizeFormatString",
-{
- value: function(format)
- {
- var tokens = [];
- var substitutionIndex = 0;
-
- function addStringToken(str)
- {
- tokens.push({ type: "string", value: str });
- }
-
- function addSpecifierToken(specifier, precision, substitutionIndex)
- {
- tokens.push({ type: "specifier", specifier: specifier, precision: precision, substitutionIndex: substitutionIndex });
- }
-
- var index = 0;
- for (var precentIndex = format.indexOf("%", index); precentIndex !== -1; precentIndex = format.indexOf("%", index)) {
- addStringToken(format.substring(index, precentIndex));
- index = precentIndex + 1;
-
- if (format[index] === "%") {
- addStringToken("%");
- ++index;
- continue;
- }
-
- if (!isNaN(format[index])) {
- // The first character is a number, it might be a substitution index.
- var number = parseInt(format.substring(index), 10);
- while (!isNaN(format[index]))
- ++index;
-
- // If the number is greater than zero and ends with a "$",
- // then this is a substitution index.
- if (number > 0 && format[index] === "$") {
- substitutionIndex = (number - 1);
- ++index;
- }
- }
-
- var precision = -1;
- if (format[index] === ".") {
- // This is a precision specifier. If no digit follows the ".",
- // then the precision should be zero.
- ++index;
-
- precision = parseInt(format.substring(index), 10);
- if (isNaN(precision))
- precision = 0;
-
- while (!isNaN(format[index]))
- ++index;
- }
-
- addSpecifierToken(format[index], precision, substitutionIndex);
-
- ++substitutionIndex;
- ++index;
- }
-
- addStringToken(format.substring(index));
-
- return tokens;
- }
-});
-
-Object.defineProperty(String.prototype, "startsWith",
-{
- value: function(string)
- {
- return this.lastIndexOf(string, 0) === 0;
- }
-});
-
-Object.defineProperty(String.prototype, "hash",
-{
- get: function()
- {
- // Matches the wtf/StringHasher.h (SuperFastHash) algorithm.
-
- // Arbitrary start value to avoid mapping all 0's to all 0's.
- const stringHashingStartValue = 0x9e3779b9;
-
- var result = stringHashingStartValue;
- var pendingCharacter = null;
- for (var i = 0; i < this.length; ++i) {
- var currentCharacter = this[i].charCodeAt(0);
- if (pendingCharacter === null) {
- pendingCharacter = currentCharacter;
- continue;
- }
-
- result += pendingCharacter;
- result = (result << 16) ^ ((currentCharacter << 11) ^ result);
- result += result >> 11;
-
- pendingCharacter = null;
- }
-
- // Handle the last character in odd length strings.
- if (pendingCharacter !== null) {
- result += pendingCharacter;
- result ^= result << 11;
- result += result >> 17;
- }
-
- // Force "avalanching" of final 31 bits.
- result ^= result << 3;
- result += result >> 5;
- result ^= result << 2;
- result += result >> 15;
- result ^= result << 10;
-
- // Prevent 0 and negative results.
- return (0xffffffff + result + 1).toString(36);
- }
-});
-
-Object.defineProperty(String, "standardFormatters",
-{
- value: {
- d: function(substitution)
- {
- return !isNaN(substitution) ? substitution : 0;
- },
-
- f: function(substitution, token)
- {
- if (substitution && token.precision > -1)
- substitution = substitution.toFixed(token.precision);
- return !isNaN(substitution) ? substitution : (token.precision > -1 ? Number(0).toFixed(token.precision) : 0);
- },
-
- s: function(substitution)
- {
- return substitution;
- }
- }
-});
-
-Object.defineProperty(String, "format",
-{
- value: function(format, substitutions, formatters, initialValue, append)
- {
- if (!format || !substitutions || !substitutions.length)
- return { formattedResult: append(initialValue, format), unusedSubstitutions: substitutions };
-
- function prettyFunctionName()
- {
- return "String.format(\"" + format + "\", \"" + substitutions.join("\", \"") + "\")";
- }
-
- function warn(msg)
- {
- console.warn(prettyFunctionName() + ": " + msg);
- }
-
- function error(msg)
- {
- console.error(prettyFunctionName() + ": " + msg);
- }
-
- var result = initialValue;
- var tokens = String.tokenizeFormatString(format);
- var usedSubstitutionIndexes = {};
-
- for (var i = 0; i < tokens.length; ++i) {
- var token = tokens[i];
-
- if (token.type === "string") {
- result = append(result, token.value);
- continue;
- }
-
- if (token.type !== "specifier") {
- error("Unknown token type \"" + token.type + "\" found.");
- continue;
- }
-
- if (token.substitutionIndex >= substitutions.length) {
- // If there are not enough substitutions for the current substitutionIndex
- // just output the format specifier literally and move on.
- error("not enough substitution arguments. Had " + substitutions.length + " but needed " + (token.substitutionIndex + 1) + ", so substitution was skipped.");
- result = append(result, "%" + (token.precision > -1 ? token.precision : "") + token.specifier);
- continue;
- }
-
- usedSubstitutionIndexes[token.substitutionIndex] = true;
-
- if (!(token.specifier in formatters)) {
- // Encountered an unsupported format character, treat as a string.
- warn("unsupported format character \u201C" + token.specifier + "\u201D. Treating as a string.");
- result = append(result, substitutions[token.substitutionIndex]);
- continue;
- }
-
- result = append(result, formatters[token.specifier](substitutions[token.substitutionIndex], token));
- }
-
- var unusedSubstitutions = [];
- for (var i = 0; i < substitutions.length; ++i) {
- if (i in usedSubstitutionIndexes)
- continue;
- unusedSubstitutions.push(substitutions[i]);
- }
-
- return {formattedResult: result, unusedSubstitutions: unusedSubstitutions};
- }
-});
-
-Object.defineProperty(String.prototype, "format",
-{
- value: function()
- {
- return String.format(this, arguments, String.standardFormatters, "", function(a, b) { return a + b; }).formattedResult;
- }
-});
-
-Object.defineProperty(String.prototype, "insertWordBreakCharacters",
-{
- value: function()
- {
- // Add zero width spaces after characters that are good to break after.
- // Otherwise a string with no spaces will not break and overflow its container.
- // This is mainly used on URL strings, so the characters are tailored for URLs.
- return this.replace(/([\/;:\)\]\}&?])/g, "$1\u200b");
- }
-});
-
-Object.defineProperty(String.prototype, "removeWordBreakCharacters",
-{
- value: function()
- {
- // Undoes what insertWordBreakCharacters did.
- return this.replace(/\u200b/g, "");
- }
-});
-
-Object.defineProperty(Number, "constrain",
-{
- value: function(num, min, max)
- {
- if (num < min)
- num = min;
- else if (num > max)
- num = max;
- return num;
- }
-});
-
-Object.defineProperty(Number, "secondsToString",
-{
- value: function(seconds, higherResolution)
- {
- var ms = seconds * 1000;
-
- if (higherResolution && Math.abs(ms) < 10)
- return WebInspector.UIString("%.3fms").format(ms);
- else if (Math.abs(ms) < 10)
- return WebInspector.UIString("%.2fms").format(ms);
-
- if (higherResolution && Math.abs(ms) < 100)
- return WebInspector.UIString("%.2fms").format(ms);
- else if (Math.abs(ms) < 100)
- return WebInspector.UIString("%.1fms").format(ms);
-
- if (higherResolution && Math.abs(ms) < 1000)
- return WebInspector.UIString("%.1fms").format(ms);
- else if (Math.abs(ms) < 1000)
- return WebInspector.UIString("%.0fms").format(ms);
-
- if (Math.abs(seconds) < 60)
- return WebInspector.UIString("%.2fs").format(seconds);
-
- var minutes = seconds / 60;
- if (Math.abs(minutes) < 60)
- return WebInspector.UIString("%.1fmin").format(minutes);
-
- var hours = minutes / 60;
- if (Math.abs(hours) < 24)
- return WebInspector.UIString("%.1fhrs").format(hours);
-
- var days = hours / 24;
- return WebInspector.UIString("%.1f days").format(days);
- }
-});
-
-Object.defineProperty(Number, "bytesToString",
-{
- value: function(bytes, higherResolution)
- {
- if (higherResolution === undefined)
- higherResolution = true;
-
- if (Math.abs(bytes) < 1024)
- return WebInspector.UIString("%.0f B").format(bytes);
-
- var kilobytes = bytes / 1024;
- if (Math.abs(kilobytes) < 10 || (higherResolution && Math.abs(kilobytes) < 1024))
- return WebInspector.UIString("%.2f KB").format(kilobytes);
- else if (Math.abs(kilobytes) < 1024)
- return WebInspector.UIString("%.1f KB").format(kilobytes);
-
- var megabytes = kilobytes / 1024;
- if (higherResolution || Math.abs(megabytes) < 10)
- return WebInspector.UIString("%.2f MB").format(megabytes);
- else
- return WebInspector.UIString("%.1f MB").format(megabytes);
- }
-});
-
-Object.defineProperty(Uint32Array, "isLittleEndian",
-{
- value: function()
- {
- if ("_isLittleEndian" in this)
- return this._isLittleEndian;
-
- var buffer = new ArrayBuffer(4);
- var longData = new Uint32Array(buffer);
- var data = new Uint8Array(buffer);
-
- longData[0] = 0x0a0b0c0d;
-
- this._isLittleEndian = data[0] === 0x0d && data[1] === 0x0c && data[2] === 0x0b && data[3] === 0x0a;
-
- return this._isLittleEndian;
- }
-});
-
-function isEmptyObject(object)
-{
- for (var property in object)
- return false;
- return true;
-}
-
-function isEnterKey(event)
-{
- // Check if this is an IME event.
- return event.keyCode !== 229 && event.keyIdentifier === "Enter";
-}
-
-function resolveDotsInPath(path)
-{
- if (!path)
- return path;
-
- if (path.indexOf("./") === -1)
- return path;
-
- console.assert(path.charAt(0) === "/");
-
- var result = [];
-
- var components = path.split("/");
- for (var i = 0; i < components.length; ++i) {
- var component = components[i];
-
- // Skip over "./".
- if (component === ".")
- continue;
-
- // Rewind one component for "../".
- if (component === "..") {
- if (result.length === 1)
- continue;
- result.pop();
- continue;
- }
-
- result.push(component);
- }
-
- return result.join("/");
-}
-
-function parseMIMEType(fullMimeType)
-{
- if (!fullMimeType)
- return {type: fullMimeType, boundary: null, encoding: null};
-
- var typeParts = fullMimeType.split(/\s*;\s*/);
- console.assert(typeParts.length >= 1);
-
- var type = typeParts[0];
- var boundary = null;
- var encoding = null;
-
- for (var i = 1; i < typeParts.length; ++i) {
- var subparts = typeParts[i].split(/\s*=\s*/);
- if (subparts.length !== 2)
- continue;
-
- if (subparts[0].toLowerCase() === "boundary")
- boundary = subparts[1];
- else if (subparts[0].toLowerCase() === "charset")
- encoding = subparts[1].replace("^\"|\"$", ""); // Trim quotes.
- }
-
- return {type: type, boundary: boundary || null, encoding: encoding || null};
-}
-
-function simpleGlobStringToRegExp(globString, regExpFlags)
-{
- // Only supports "*" globs.
-
- if (!globString)
- return null;
-
- // Escape everything from String.prototype.escapeForRegExp except "*".
- var regexString = globString.escapeCharacters("^[]{}()\\.$+?|");
-
- // Unescape all doubly escaped backslashes in front of escaped asterisks.
- // So "\\*" will become "\*" again, undoing escapeCharacters escaping of "\".
- // This makes "\*" match a literal "*" instead of using the "*" for globbing.
- regexString = regexString.replace(/\\\\\*/g, "\\*");
-
- // The following regex doesn't match an asterisk that has a backslash in front.
- // It also catches consecutive asterisks so they collapse down when replaced.
- var unescapedAsteriskRegex = /(^|[^\\])\*+/g;
- if (unescapedAsteriskRegex.test(globString)) {
- // Replace all unescaped asterisks with ".*".
- regexString = regexString.replace(unescapedAsteriskRegex, "$1.*");
-
- // Match edge boundaries when there is an asterisk to better meet the expectations
- // of the user. When someone types "*.js" they don't expect "foo.json" to match. They
- // would only expect that if they type "*.js*". We use \b (instead of ^ and $) to allow
- // matches inside paths or URLs, so "ba*.js" will match "foo/bar.js" but not "boo/bbar.js".
- // When there isn't an asterisk the regexString is just a substring search.
- regexString = "\\b" + regexString + "\\b";
- }
-
- return new RegExp(regexString, regExpFlags);
-}
-
-Object.defineProperty(Array.prototype, "lowerBound",
-{
- // Return index of the leftmost element that is equal or greater
- // than the specimen object. If there's no such element (i.e. all
- // elements are smaller than the specimen) returns array.length.
- // The function works for sorted array.
- value: function(object, comparator)
- {
- function defaultComparator(a, b)
- {
- return a - b;
- }
- comparator = comparator || defaultComparator;
- var l = 0;
- var r = this.length;
- while (l < r) {
- var m = (l + r) >> 1;
- if (comparator(object, this[m]) > 0)
- l = m + 1;
- else
- r = m;
- }
- return r;
- }
-});
-
-Object.defineProperty(Array.prototype, "upperBound",
-{
- // Return index of the leftmost element that is greater
- // than the specimen object. If there's no such element (i.e. all
- // elements are smaller than the specimen) returns array.length.
- // The function works for sorted array.
- value: function(object, comparator)
- {
- function defaultComparator(a, b)
- {
- return a - b;
- }
- comparator = comparator || defaultComparator;
- var l = 0;
- var r = this.length;
- while (l < r) {
- var m = (l + r) >> 1;
- if (comparator(object, this[m]) >= 0)
- l = m + 1;
- else
- r = m;
- }
- return r;
- }
-});
-
-Object.defineProperty(Array.prototype, "binaryIndexOf",
-{
- value: function(value, comparator)
- {
- var index = this.lowerBound(value, comparator);
- return index < this.length && comparator(value, this[index]) === 0 ? index : -1;
- }
-});
-
-function insertionIndexForObjectInListSortedByFunction(object, list, comparator, insertionIndexAfter)
-{
- if (insertionIndexAfter) {
- return list.upperBound(object, comparator);
- } else {
- return list.lowerBound(object, comparator);
- }
-}
-
-function insertObjectIntoSortedArray(object, array, comparator)
-{
- array.splice(insertionIndexForObjectInListSortedByFunction(object, array, comparator), 0, object);
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsActivateButtonNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceActivateButtonNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ActivateButtonNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ActivateButtonNavigationItem = function(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
+{
+ WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
+
+ this._defaultToolTip = defaultToolTip;
+ this._activatedToolTip = activatedToolTip || defaultToolTip;
+ this._role = role;
+};
+
+WebInspector.ActivateButtonNavigationItem.StyleClassName = "activate";
+WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName = "activated";
+
+WebInspector.ActivateButtonNavigationItem.prototype = {
+ constructor: WebInspector.ActivateButtonNavigationItem,
+
+ // Public
+
+ get defaultToolTip()
+ {
+ return this._defaultToolTip;
+ },
+
+ get activatedToolTip()
+ {
+ return this._activatedToolTip;
+ },
+
+ get activated()
+ {
+ return this.element.classList.contains(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
+ },
+
+ set activated(flag)
+ {
+ if (flag) {
+ this.toolTip = this._activatedToolTip;
+ this.element.classList.add(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
+ if (this._role === "tab")
+ this.element.setAttribute("aria-selected", "true");
+ } else {
+ this.toolTip = this._defaultToolTip;
+ this.element.classList.remove(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
+ if (this._role === "tab")
+ this.element.removeAttribute("aria-selected");
+ }
+ },
+
+ generateStyleText: function(parentSelector)
+ {
+ var classNames = this._classNames.join(".");
+
+ if (this._suppressEmboss)
+ var styleText = parentSelector + " ." + classNames + " > .glyph { background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
+ else {
+ var activatedClassName = "." + WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName;
+
+ // Default state.
+ var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Normal) + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
+
+ // Pressed state.
+ styleText += parentSelector + " ." + classNames + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Active) + "); }\n";
+
+ // Activated state.
+ styleText += parentSelector + " ." + classNames + activatedClassName + ":not(.disabled) > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
+
+ // Activated and pressed state.
+ styleText += parentSelector + " ." + classNames + activatedClassName + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.ActiveFocus) + "); }\n";
+ }
+
+ return styleText;
+ },
+
+ // Private
+
+ _additionalClassNames: [WebInspector.ActivateButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName]
+};
+
+WebInspector.ActivateButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsActivateButtonToolbarItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceActivateButtonToolbarItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ActivateButtonToolbarItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ActivateButtonToolbarItem = function(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss, role)
+{
+ WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss, role);
+
+ console.assert(label);
+
+ this._labelElement = document.createElement("div");
+ this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
+ this._element.appendChild(this._labelElement);
+
+ this.label = label;
+};
+
+WebInspector.ActivateButtonToolbarItem.prototype = {
+ constructor: WebInspector.ActivateButtonToolbarItem,
+
+ // Public
+
+ get label()
+ {
+ return this._labelElement.textContent;
+ },
+
+ set label(newLabel)
+ {
+ console.assert(newLabel);
+ if (!newLabel)
+ return;
+
+ this._labelElement.textContent = newLabel;
+ }
+};
+
+WebInspector.ActivateButtonToolbarItem.prototype.__proto__ = WebInspector.ActivateButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,152 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheDetailsSidebarPanel = function() {
+ WebInspector.DetailsSidebarPanel.call(this, "application-cache-details", WebInspector.UIString("Storage"), WebInspector.UIString("Storage"), "Images/NavigationItemStorage.svg");
+
+ this.element.classList.add(WebInspector.ApplicationCacheDetailsSidebarPanel.StyleClassName);
+
+ this._applicationCacheFrame = null;
+
+ this._locationManifestURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Manifest URL"));
+ this._locationFrameURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Frame URL"));
+
+ this._locationGroup = new WebInspector.DetailsSectionGroup([this._locationManifestURLRow, this._locationFrameURLRow]);
+
+ this._locationSection = new WebInspector.DetailsSection("application-cache-location", WebInspector.UIString("Location"), [this._locationGroup]);
+
+ this._onlineRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Online"));
+ this._statusRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));
+
+ this._statusGroup = new WebInspector.DetailsSectionGroup([this._onlineRow, this._statusRow]);
+
+ this._statusSection = new WebInspector.DetailsSection("application-cache-status", WebInspector.UIString("Status"), [this._statusGroup]);
+
+ this.element.appendChild(this._locationSection.element);
+ this.element.appendChild(this._statusSection.element);
+
+ WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.NetworkStateUpdated, this._networkStateUpdated, this);
+ WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._frameManifestStatusChanged, this);
+};
+
+WebInspector.ApplicationCacheDetailsSidebarPanel.StyleClassName = "application-cache";
+
+// This needs to be kept in sync with ApplicationCacheManager.js.
+WebInspector.ApplicationCacheDetailsSidebarPanel.Status = {
+ 0: "Uncached",
+ 1: "Idle",
+ 2: "Checking",
+ 3: "Downloading",
+ 4: "UpdateReady",
+ 5: "Obsolete"
+};
+
+WebInspector.ApplicationCacheDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.ApplicationCacheDetailsSidebarPanel,
+
+ // Public
+
+ inspect: function(objects)
+ {
+ // Convert to a single item array if needed.
+ if (!(objects instanceof Array))
+ objects = [objects];
+
+ var applicationCacheFrameToInspect = null;
+
+ // Iterate over the objects to find a WebInspector.ApplicationCacheFrame to inspect.
+ for (var i = 0; i < objects.length; ++i) {
+ if (objects[i] instanceof WebInspector.ApplicationCacheFrame) {
+ applicationCacheFrameToInspect = objects[i];
+ break;
+ }
+ }
+
+ this.applicationCacheFrame = applicationCacheFrameToInspect;
+
+ return !!this.applicationCacheFrame;
+ },
+
+ get applicationCacheFrame()
+ {
+ return this._applicationCacheFrame;
+ },
+
+ set applicationCacheFrame(applicationCacheFrame)
+ {
+ if (this._applicationCacheFrame === applicationCacheFrame)
+ return;
+
+ this._applicationCacheFrame = applicationCacheFrame;
+
+ this.needsRefresh();
+ },
+
+ refresh: function()
+ {
+ if (!this.applicationCacheFrame)
+ return;
+
+ this._locationFrameURLRow.value = this.applicationCacheFrame.frame.url;
+ this._locationManifestURLRow.value = this.applicationCacheFrame.manifest.manifestURL;
+
+ this._refreshOnlineRow();
+ this._refreshStatusRow();
+ },
+
+ // Private
+
+ _networkStateUpdated: function(event)
+ {
+ if (!this.applicationCacheFrame)
+ return;
+
+ this._refreshOnlineRow();
+ },
+
+ _frameManifestStatusChanged: function(event)
+ {
+ if (!this.applicationCacheFrame)
+ return;
+
+ console.assert(event.data.frameManifest instanceof WebInspector.ApplicationCacheFrame);
+ if (event.data.frameManifest !== this.applicationCacheFrame)
+ return;
+
+ this._refreshStatusRow();
+ },
+
+ _refreshOnlineRow: function()
+ {
+ this._onlineRow.value = WebInspector.applicationCacheManager.online ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+ },
+
+ _refreshStatusRow: function()
+ {
+ this._statusRow.value = WebInspector.ApplicationCacheDetailsSidebarPanel.Status[this.applicationCacheFrame.status];
+ }
+};
+
+WebInspector.ApplicationCacheDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.application-cache-frame > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,250 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
+WebInspector.ApplicationCacheFrameContentView = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.ApplicationCacheFrame);
+
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.element.classList.add(WebInspector.ApplicationCacheFrameContentView.StyleClassName);
+
+ this.element.classList.add("storage-view");
+ this.element.classList.add("table");
+
+ this._frame = representedObject.frame;
+
+ this._emptyView = WebInspector.createMessageTextView(WebInspector.UIString("No Application Cache information available"), false);
+ this._emptyView.classList.add("hidden");
+ this.element.appendChild(this._emptyView);
+
+ this._markDirty();
+
+ var status = representedObject.status;
+ this.updateStatus(status);
+
+ WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
+}
+
+WebInspector.ApplicationCacheFrameContentView.StyleClassName = "application-cache-frame";
+
+WebInspector.ApplicationCacheFrameContentView.prototype = {
+ constructor: WebInspector.ApplicationCacheFrameContentView,
+
+ shown: function()
+ {
+ this._maybeUpdate();
+ },
+
+ closed: function()
+ {
+ WebInspector.applicationCacheManager.removeEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
+ },
+
+ updateLayout: function()
+ {
+ if (this.dataGrid)
+ this.dataGrid.updateLayout();
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.ApplicationCache;
+ cookie.frame = this.representedObject.frame.url;
+ cookie.manifest = this.representedObject.manifest.manifestURL;
+ },
+
+ get scrollableElements()
+ {
+ if (!this._dataGrid)
+ return [];
+ return [this._dataGrid.scrollContainer];
+ },
+
+ _maybeUpdate: function()
+ {
+ if (!this.visible || !this._viewDirty)
+ return;
+
+ this._update();
+ this._viewDirty = false;
+ },
+
+ _markDirty: function()
+ {
+ this._viewDirty = true;
+ },
+
+ _updateStatus: function(event)
+ {
+ var frameManifest = event.data.frameManifest;
+ if (frameManifest !== this.representedObject)
+ return;
+
+ console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
+
+ this.updateStatus(frameManifest.status);
+ },
+
+ /**
+ * @param {number} status
+ */
+ updateStatus: function(status)
+ {
+ var oldStatus = this._status;
+ this._status = status;
+
+ if (this.visible && this._status === WebInspector.ApplicationCacheManager.Status.Idle && (oldStatus === WebInspector.ApplicationCacheManager.Status.UpdateReady || !this._resources))
+ this._markDirty();
+
+ this._maybeUpdate();
+ },
+
+ _update: function()
+ {
+ WebInspector.applicationCacheManager.requestApplicationCache(this._frame, this._updateCallback.bind(this));
+ },
+
+ /**
+ * @param {Object} applicationCache
+ */
+ _updateCallback: function(applicationCache)
+ {
+ if (!applicationCache || !applicationCache.manifestURL) {
+ delete this._manifest;
+ delete this._creationTime;
+ delete this._updateTime;
+ delete this._size;
+ delete this._resources;
+
+ this._emptyView.classList.remove("hidden");
+
+ if (this._dataGrid)
+ this._dataGrid.element.classList.add("hidden");
+ return;
+ }
+
+ // FIXME: are these variables needed anywhere else?
+ this._manifest = applicationCache.manifestURL;
+ this._creationTime = applicationCache.creationTime;
+ this._updateTime = applicationCache.updateTime;
+ this._size = applicationCache.size;
+ this._resources = applicationCache.resources;
+
+ if (!this._dataGrid)
+ this._createDataGrid();
+
+ this._populateDataGrid();
+ this._dataGrid.autoSizeColumns(20, 80);
+ this._dataGrid.element.classList.remove("hidden");
+
+ this._emptyView.classList.add("hidden");
+ },
+
+ _createDataGrid: function()
+ {
+ var columns = { 0: {}, 1: {}, 2: {} };
+ columns[0].title = WebInspector.UIString("Resource");
+ columns[0].sort = "ascending";
+ columns[0].sortable = true;
+ columns[1].title = WebInspector.UIString("Type");
+ columns[1].sortable = true;
+ columns[2].title = WebInspector.UIString("Size");
+ columns[2].aligned = "right";
+ columns[2].sortable = true;
+ this._dataGrid = new WebInspector.DataGrid(columns);
+ this.element.appendChild(this._dataGrid.element);
+ this._dataGrid.updateLayout();
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._populateDataGrid, this);
+ },
+
+ _populateDataGrid: function()
+ {
+ var selectedResource = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.resource : null;
+ var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function numberCompare(field, resource1, resource2)
+ {
+ return sortDirection * (resource1[field] - resource2[field]);
+ }
+ function localeCompare(field, resource1, resource2)
+ {
+ return sortDirection * (resource1[field] + "").localeCompare(resource2[field] + "");
+ }
+
+ var comparator;
+ switch (parseInt(this._dataGrid.sortColumnIdentifier, 10)) {
+ case 0: comparator = localeCompare.bind(this, "url"); break;
+ case 1: comparator = localeCompare.bind(this, "type"); break;
+ case 2: comparator = numberCompare.bind(this, "size"); break;
+ default: localeCompare.bind(this, "resource"); // FIXME: comparator = ?
+ }
+
+ this._resources.sort(comparator);
+ this._dataGrid.removeChildren();
+
+ var nodeToSelect;
+ for (var i = 0; i < this._resources.length; ++i) {
+ var data = {};
+ var resource = this._resources[i];
+ data[0] = resource.url;
+ data[1] = resource.type;
+ data[2] = Number.bytesToString(resource.size);
+ var node = new WebInspector.DataGridNode(data);
+ node.resource = resource;
+ node.selectable = true;
+ this._dataGrid.appendChild(node);
+ if (resource === selectedResource) {
+ nodeToSelect = node;
+ nodeToSelect.selected = true;
+ }
+ }
+
+ if (!nodeToSelect && this._dataGrid.children.length)
+ this._dataGrid.children[0].selected = true;
+ },
+
+ _deleteButtonClicked: function(event)
+ {
+ if (!this._dataGrid || !this._dataGrid.selectedNode)
+ return;
+
+ // FIXME: Delete Button semantics are not yet defined. (Delete a single, or all?)
+ this._deleteCallback(this._dataGrid.selectedNode);
+ },
+
+ _deleteCallback: function(node)
+ {
+ // FIXME: Should we delete a single (selected) resource or all resources?
+ // InspectorBackend.deleteCachedResource(...)
+ // this._update();
+ }
+}
+
+WebInspector.ApplicationCacheFrameContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheFrameTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheFrameTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheFrameTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheFrameTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.ApplicationCacheFrame);
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.ApplicationCacheFrameTreeElement.StyleClassName, "", "", representedObject, false);
+
+ this.small = true;
+
+ this.updateTitles();
+};
+
+WebInspector.ApplicationCacheFrameTreeElement.StyleClassName = "application-cache-frame";
+
+WebInspector.ApplicationCacheFrameTreeElement.prototype = {
+ constructor: WebInspector.ApplicationCacheFrameTreeElement,
+
+ updateTitles: function()
+ {
+ var url = this.representedObject.frame.url;
+ var parsedURL = parseURL(url);
+
+ this.mainTitle = WebInspector.displayNameForURL(url, parsedURL);
+
+ // Show the host as the subtitle only if it doesn't match the subtitle of the manifest tree element,
+ // and it doesn't match the mainTitle.
+ var subtitle = WebInspector.displayNameForHost(parsedURL.host);
+
+ // FIXME: This is bad layering. We should not be calling a global object to get this.
+ var manifestTreeElement = WebInspector.resourceSidebarPanel.treeElementForRepresentedObject(this.representedObject.manifest);
+
+ var subtitleIsDuplicate = subtitle === this._mainTitle || subtitle === manifestTreeElement.subtitle;
+ this.subtitle = subtitleIsDuplicate ? null : subtitle;
+ }
+};
+
+WebInspector.ApplicationCacheFrameTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.application-cache-manifest .icon {
+ content: -webkit-image-set(url(../Images/ApplicationCacheManifest.png) 1x, url(../Images/ApplicationCacheManifest@2x.png) 2x);
+}
+
+.application-cache-frame .icon {
+ content: -webkit-image-set(url(../Images/ApplicationCache.png) 1x, url(../Images/ApplicationCache@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsApplicationCacheManifestTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceApplicationCacheManifestTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheManifestTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ApplicationCacheManifestTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheManifestTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ApplicationCacheManifestTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ApplicationCacheManifestTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.ApplicationCacheManifest);
+
+ WebInspector.StorageTreeElement.call(this, WebInspector.ApplicationCacheManifestTreeElement.StyleClassName, "", representedObject);
+};
+
+WebInspector.ApplicationCacheManifestTreeElement.StyleClassName = "application-cache-manifest";
+
+WebInspector.ApplicationCacheManifestTreeElement.prototype = {
+ constructor: WebInspector.ApplicationCacheManifestTreeElement,
+
+ // Public
+
+ get name()
+ {
+ if (!this._name)
+ this._generateTitles();
+
+ return this._name;
+ },
+
+ get secondaryName()
+ {
+ if (!this._secondaryName)
+ this._generateTitles();
+
+ return this._secondaryName;
+ },
+
+ get categoryName()
+ {
+ return WebInspector.UIString("Application Cache");
+ },
+
+ _generateTitles: function()
+ {
+ var parsedURL = parseURL(this.representedObject.manifestURL);
+
+ // Prefer the last path component, with a fallback for the host as the main title.
+ this._name = WebInspector.displayNameForURL(this.representedObject.manifestURL, parsedURL);
+
+ // Show the host as the subtitle.
+ var secondaryName = WebInspector.displayNameForHost(parsedURL.host);
+ this._secondaryName = this._name !== secondaryName ? secondaryName : null;
+ }
+};
+
+WebInspector.ApplicationCacheManifestTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBoxModelDetailsSectionRowcssfromrev164541trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.details-section .row.box-model {
+ padding: 6px;
+ text-align: center;
+ white-space: nowrap;
+}
+
+.details-section .row.box-model .label {
+ position: absolute;
+ color: black;
+ margin-left: 3px;
+ padding-left: 2px;
+ padding-right: 2px;
+}
+
+.details-section .row.box-model .position {
+ border: 1px rgb(66%, 66%, 66%) dotted;
+ background-color: rgb(231, 231, 231);
+ display: inline-block;
+ text-align: center;
+ padding: 3px;
+ margin: 3px;
+}
+
+.details-section .row.box-model .margin {
+ border: 1px dashed;
+ background-color: rgb(231, 231, 231);
+ display: inline-block;
+ text-align: center;
+ vertical-align: middle;
+ padding: 3px;
+ margin: 3px;
+}
+
+.details-section .row.box-model .margin.active {
+ background-color: rgba(246, 178, 107, .66);
+}
+
+.details-section .row.box-model .border {
+ border: 1px black solid;
+ background-color: rgb(231, 231, 231);
+ display: inline-block;
+ text-align: center;
+ vertical-align: middle;
+ padding: 3px;
+ margin: 3px;
+}
+
+.details-section .row.box-model .border.active {
+ background-color: rgba(255, 229, 153, .66);
+}
+
+.details-section .row.box-model .padding {
+ border: 1px grey dashed;
+ background-color: rgb(231, 231, 231);
+ display: inline-block;
+ text-align: center;
+ vertical-align: middle;
+ padding: 3px;
+ margin: 3px;
+}
+
+.details-section .row.box-model .padding.active {
+ background-color: rgba(147, 196, 125, .55);
+}
+
+.details-section .row.box-model .content {
+ position: static;
+ border: 1px gray solid;
+ background-color: rgb(231, 231, 231);
+ display: inline-block;
+ text-align: center;
+ vertical-align: middle;
+ padding: 3px;
+ margin: 3px;
+ min-width: 80px;
+ overflow: visible;
+}
+
+.details-section .row.box-model .content.active {
+ background-color: rgba(111, 168, 220, .66);
+}
+
+.details-section .row.box-model .content span {
+ display: inline-block;
+}
+
+.details-section .row.box-model .editing {
+ position: relative;
+ z-index: 100;
+}
+
+.details-section .row.box-model .left {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.details-section .row.box-model .right {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.details-section .row.box-model .top {
+ display: inline-block;
+}
+
+.details-section .row.box-model .bottom {
+ display: inline-block;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBoxModelDetailsSectionRowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBoxModelDetailsSectionRowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BoxModelDetailsSectionRow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,428 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BoxModelDetailsSectionRow = function() {
+ WebInspector.DetailsSectionRow.call(this, WebInspector.UIString("No Box Model Information"));
+
+ this.element.classList.add(WebInspector.BoxModelDetailsSectionRow.StyleClassName);
+
+ this._nodeStyles = null;
+};
+
+WebInspector.BoxModelDetailsSectionRow.StyleClassName = "box-model";
+WebInspector.BoxModelDetailsSectionRow.StyleValueDelimiters = " \xA0\t\n\"':;,/()";
+WebInspector.BoxModelDetailsSectionRow.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;
+
+WebInspector.BoxModelDetailsSectionRow.prototype = {
+ constructor: WebInspector.BoxModelDetailsSectionRow,
+
+ // Public
+
+ get nodeStyles()
+ {
+ return this._nodeStyles;
+ },
+
+ set nodeStyles(nodeStyles)
+ {
+ this._nodeStyles = nodeStyles;
+
+ this._refresh();
+ },
+
+ // Private
+
+ _refresh: function()
+ {
+ if (this._ignoreNextRefresh) {
+ delete this._ignoreNextRefresh;
+ return;
+ }
+
+ this._updateMetrics();
+ },
+
+ _getPropertyValueAsPx: function(style, propertyName)
+ {
+ return Number(style.propertyForName(propertyName).value.replace(/px$/, "") || 0);
+ },
+
+ _getBox: function(computedStyle, componentName)
+ {
+ var suffix = componentName === "border" ? "-width" : "";
+ var left = this._getPropertyValueAsPx(computedStyle, componentName + "-left" + suffix);
+ var top = this._getPropertyValueAsPx(computedStyle, componentName + "-top" + suffix);
+ var right = this._getPropertyValueAsPx(computedStyle, componentName + "-right" + suffix);
+ var bottom = this._getPropertyValueAsPx(computedStyle, componentName + "-bottom" + suffix);
+ return { left: left, top: top, right: right, bottom: bottom };
+ },
+
+ _highlightDOMNode: function(showHighlight, mode, event)
+ {
+ event.stopPropagation();
+
+ var nodeId = showHighlight ? this.nodeStyles.node.id : 0;
+ if (nodeId) {
+ if (this._highlightMode === mode)
+ return;
+ this._highlightMode = mode;
+ WebInspector.domTreeManager.highlightDOMNode(nodeId, mode);
+ } else {
+ delete this._highlightMode;
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ }
+
+ for (var i = 0; this._boxElements && i < this._boxElements.length; ++i) {
+ var element = this._boxElements[i];
+ if (nodeId && (mode === "all" || element._name === mode))
+ element.classList.add("active");
+ else
+ element.classList.remove("active");
+ }
+ },
+
+ _updateMetrics: function()
+ {
+ // Updating with computed style.
+ var metricsElement = document.createElement("div");
+
+ var self = this;
+ var style = this._nodeStyles.computedStyle;
+
+ function createElement(type, value, name, propertyName, style)
+ {
+ // Check if the value is a float and whether it should be rounded.
+ var floatValue = parseFloat(value);
+ var shouldRoundValue = (!isNaN(floatValue) && floatValue % 1 !== 0);
+
+ var element = document.createElement(type);
+ element.textContent = shouldRoundValue ? ("~" + Math.round(floatValue * 100) / 100) : value;
+ if (shouldRoundValue)
+ element.title = value;
+ element.addEventListener("dblclick", this._startEditing.bind(this, element, name, propertyName, style), false);
+ return element;
+ }
+
+ function createBoxPartElement(style, name, side, suffix)
+ {
+ var propertyName = (name !== "position" ? name + "-" : "") + side + suffix;
+ var value = style.propertyForName(propertyName).value;
+ if (value === "" || (name !== "position" && value === "0px"))
+ value = "\u2012";
+ else if (name === "position" && value === "auto")
+ value = "\u2012";
+ value = value.replace(/px$/, "");
+
+ var element = createElement.call(this, "div", value, name, propertyName, style);
+ element.className = side;
+ return element;
+ }
+
+ function createContentAreaWidthElement(style)
+ {
+ var width = style.propertyForName("width").value.replace(/px$/, "");
+ if (style.propertyForName("box-sizing").value === "border-box") {
+ var borderBox = self._getBox(style, "border");
+ var paddingBox = self._getBox(style, "padding");
+
+ width = width - borderBox.left - borderBox.right - paddingBox.left - paddingBox.right;
+ }
+
+ return createElement.call(this, "span", width, "width", "width", style);
+ }
+
+ function createContentAreaHeightElement(style)
+ {
+ var height = style.propertyForName("height").value.replace(/px$/, "");
+ if (style.propertyForName("box-sizing").value === "border-box") {
+ var borderBox = self._getBox(style, "border");
+ var paddingBox = self._getBox(style, "padding");
+
+ height = height - borderBox.top - borderBox.bottom - paddingBox.top - paddingBox.bottom;
+ }
+
+ return createElement.call(this, "span", height, "height", "height", style);
+ }
+
+ // Display types for which margin is ignored.
+ var noMarginDisplayType = {
+ "table-cell": true,
+ "table-column": true,
+ "table-column-group": true,
+ "table-footer-group": true,
+ "table-header-group": true,
+ "table-row": true,
+ "table-row-group": true
+ };
+
+ // Display types for which padding is ignored.
+ var noPaddingDisplayType = {
+ "table-column": true,
+ "table-column-group": true,
+ "table-footer-group": true,
+ "table-header-group": true,
+ "table-row": true,
+ "table-row-group": true
+ };
+
+ // Position types for which top, left, bottom and right are ignored.
+ var noPositionType = {
+ "static": true
+ };
+
+ this._boxElements = [];
+ var boxes = ["content", "padding", "border", "margin", "position"];
+
+ if (!style.properties.length) {
+ this.showEmptyMessage();
+ return;
+ }
+
+ var previousBox = null;
+ for (var i = 0; i < boxes.length; ++i) {
+ var name = boxes[i];
+
+ if (name === "margin" && noMarginDisplayType[style.propertyForName("display").value])
+ continue;
+ if (name === "padding" && noPaddingDisplayType[style.propertyForName("display").value])
+ continue;
+ if (name === "position" && noPositionType[style.propertyForName("position").value])
+ continue;
+
+ var boxElement = document.createElement("div");
+ boxElement.className = name;
+ boxElement._name = name;
+ boxElement.addEventListener("mouseover", this._highlightDOMNode.bind(this, true, name === "position" ? "all" : name), false);
+ this._boxElements.push(boxElement);
+
+ if (name === "content") {
+ var widthElement = createContentAreaWidthElement.call(this, style);
+ var heightElement = createContentAreaHeightElement.call(this, style);
+
+ boxElement.appendChild(widthElement);
+ boxElement.appendChild(document.createTextNode(" \u00D7 "));
+ boxElement.appendChild(heightElement);
+ } else {
+ var suffix = (name === "border" ? "-width" : "");
+
+ var labelElement = document.createElement("div");
+ labelElement.className = "label";
+ labelElement.textContent = boxes[i];
+ boxElement.appendChild(labelElement);
+
+ boxElement.appendChild(createBoxPartElement.call(this, style, name, "top", suffix));
+ boxElement.appendChild(document.createElement("br"));
+ boxElement.appendChild(createBoxPartElement.call(this, style, name, "left", suffix));
+
+ if (previousBox)
+ boxElement.appendChild(previousBox);
+
+ boxElement.appendChild(createBoxPartElement.call(this, style, name, "right", suffix));
+ boxElement.appendChild(document.createElement("br"));
+ boxElement.appendChild(createBoxPartElement.call(this, style, name, "bottom", suffix));
+ }
+
+ previousBox = boxElement;
+ }
+
+ metricsElement.appendChild(previousBox);
+ metricsElement.addEventListener("mouseover", this._highlightDOMNode.bind(this, false, ""), false);
+
+ this.hideEmptyMessage();
+ this.element.appendChild(metricsElement);
+ },
+
+ _startEditing: function(targetElement, box, styleProperty, computedStyle)
+ {
+ if (WebInspector.isBeingEdited(targetElement))
+ return;
+
+ // If the target element has a title use it as the editing value
+ // since the current text is likely truncated/rounded.
+ if (targetElement.title)
+ targetElement.textContent = targetElement.title;
+
+ var context = {box: box, styleProperty: styleProperty};
+ var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty);
+ context.keyDownHandler = boundKeyDown;
+ targetElement.addEventListener("keydown", boundKeyDown, false);
+
+ this._isEditingMetrics = true;
+
+ var config = new WebInspector.EditingConfig(this._editingCommitted.bind(this), this._editingCancelled.bind(this), context);
+ WebInspector.startEditing(targetElement, config);
+
+ window.getSelection().setBaseAndExtent(targetElement, 0, targetElement, 1);
+ },
+
+ _alteredFloatNumber: function(number, event)
+ {
+ var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
+
+ // Jump by 10 when shift is down or jump by 0.1 when Alt/Option is down.
+ // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
+ var changeAmount = 1;
+ if (event.shiftKey && !arrowKeyPressed)
+ changeAmount = 100;
+ else if (event.shiftKey || !arrowKeyPressed)
+ changeAmount = 10;
+ else if (event.altKey)
+ changeAmount = 0.1;
+
+ if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
+ changeAmount *= -1;
+
+ // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
+ // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
+ var result = Number((number + changeAmount).toFixed(6));
+ if (!String(result).match(WebInspector.BoxModelDetailsSectionRow.CSSNumberRegex))
+ return null;
+
+ return result;
+ },
+
+ _handleKeyDown: function(context, styleProperty, event)
+ {
+ if (!/^(?:Page)?(?:Up|Down)$/.test(event.keyIdentifier))
+ return;
+
+ var element = event.currentTarget;
+
+ var selection = window.getSelection();
+ if (!selection.rangeCount)
+ return;
+
+ var selectionRange = selection.getRangeAt(0);
+ if (!selectionRange.commonAncestorContainer.isSelfOrDescendant(element))
+ return;
+
+ var originalValue = element.textContent;
+ var wordRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.BoxModelDetailsSectionRow.StyleValueDelimiters, element);
+ var wordString = wordRange.toString();
+
+ var matches = /(.*?)(-?(?:\d+(?:\.\d+)?|\.\d+))(.*)/.exec(wordString);
+ var replacementString;
+ if (matches && matches.length) {
+ var prefix = matches[1];
+ var suffix = matches[3];
+ var number = this._alteredFloatNumber(parseFloat(matches[2]), event);
+ if (number === null) {
+ // Need to check for null explicitly.
+ return;
+ }
+
+ if (styleProperty !== "margin" && number < 0)
+ number = 0;
+
+ replacementString = prefix + number + suffix;
+ }
+
+ if (!replacementString)
+ return;
+
+ var replacementTextNode = document.createTextNode(replacementString);
+
+ wordRange.deleteContents();
+ wordRange.insertNode(replacementTextNode);
+
+ var finalSelectionRange = document.createRange();
+ finalSelectionRange.setStart(replacementTextNode, 0);
+ finalSelectionRange.setEnd(replacementTextNode, replacementString.length);
+
+ selection.removeAllRanges();
+ selection.addRange(finalSelectionRange);
+
+ event.handled = true;
+ event.preventDefault();
+
+ this._ignoreNextRefresh = true;
+
+ this._applyUserInput(element, replacementString, originalValue, context, false);
+ },
+
+ _editingEnded: function(element, context)
+ {
+ delete this.originalPropertyData;
+ delete this.previousPropertyDataCandidate;
+ element.removeEventListener("keydown", context.keyDownHandler, false);
+ delete this._isEditingMetrics;
+ },
+
+ _editingCancelled: function(element, context)
+ {
+ this._editingEnded(element, context);
+ this._refresh();
+ },
+
+ _applyUserInput: function(element, userInput, previousContent, context, commitEditor)
+ {
+ if (commitEditor && userInput === previousContent)
+ return this._editingCancelled(element, context); // nothing changed, so cancel
+
+ if (context.box !== "position" && (!userInput || userInput === "\u2012"))
+ userInput = "0px";
+ else if (context.box === "position" && (!userInput || userInput === "\u2012"))
+ userInput = "auto";
+
+ userInput = userInput.toLowerCase();
+ // Append a "px" unit if the user input was just a number.
+ if (/^-?(?:\d+(?:\.\d+)?|\.\d+)$/.test(userInput))
+ userInput += "px";
+
+ var styleProperty = context.styleProperty;
+ var computedStyle = this._nodeStyles.computedStyle;
+
+ if (computedStyle.propertyForName("box-sizing").value === "border-box" && (styleProperty === "width" || styleProperty === "height")) {
+ if (!userInput.match(/px$/)) {
+ console.error("For elements with box-sizing: border-box, only absolute content area dimensions can be applied");
+ return;
+ }
+
+ var borderBox = this._getBox(computedStyle, "border");
+ var paddingBox = this._getBox(computedStyle, "padding");
+ var userValuePx = Number(userInput.replace(/px$/, ""));
+ if (isNaN(userValuePx))
+ return;
+ if (styleProperty === "width")
+ userValuePx += borderBox.left + borderBox.right + paddingBox.left + paddingBox.right;
+ else
+ userValuePx += borderBox.top + borderBox.bottom + paddingBox.top + paddingBox.bottom;
+
+ userInput = userValuePx + "px";
+ }
+
+ var property = this._nodeStyles.inlineStyle.propertyForName(context.styleProperty);
+ property.value = userInput;
+ property.add();
+ },
+
+ _editingCommitted: function(element, userInput, previousContent, context)
+ {
+ this._editingEnded(element, context);
+ this._applyUserInput(element, userInput, previousContent, context, true);
+ }
+};
+
+WebInspector.BoxModelDetailsSectionRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBreakpointcssfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Breakpoint.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Breakpoint.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Breakpoint.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Breakpoint.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.popover .edit-breakpoint-popover-content {
+ width: 420px;
+ padding: 5px 15px;
+
+ font-family: "Lucida Grande", Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+.popover .edit-breakpoint-popover-content.wide {
+ width: 460px;
+}
+
+.popover .edit-breakpoint-popover-content > label.toggle {
+ color: black;
+ font-weight: bold;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.popover .edit-breakpoint-popover-content > table {
+ width: 100%;
+}
+
+.popover .edit-breakpoint-popover-content > table > tr > th {
+ color: rgb(89, 89, 89);
+ font-weight: bold;
+ text-align: right;
+ width: 1px; /* Shrink to fit. */
+ vertical-align: top;
+ line-height: 23px;
+}
+
+.popover .edit-breakpoint-popover-content > table > tr > td {
+ padding-left: 5px;
+}
+
+#edit-breakpoint-popover-condition {
+ width: 100%;
+}
+
+#edit-breakpoint-popoover-auto-continue {
+ margin-left: 0;
+ margin-right: 4px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBreakpointActionViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.breakpoint-action-block-header {
+ margin-bottom: 3px;
+}
+
+.breakpoint-action-append-button,
+.breakpoint-action-remove-button {
+ border: 1px solid rgb(170, 170, 170);
+ border-radius: 10px;
+ background-size: 16px 16px;
+ background-origin: border-box;
+ width: 16px;
+ height: 16px;
+ float: right;
+ margin-left: 2px;
+ margin-top: 2px;
+}
+
+.breakpoint-action-append-button:active,
+.breakpoint-action-remove-button:active {
+ -webkit-filter: brightness(50%);
+}
+
+.breakpoint-action-append-button {
+ background-image: url(../Images/BreakpointActionAdd.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
+}
+
+.breakpoint-action-remove-button {
+ background-image: url(../Images/BreakpointActionRemove.svg), -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(200, 200, 200));
+}
+
+.breakpoint-action-block-body {
+ margin: 1px 2px 6px 2px;
+ padding: 8px;
+ width: 100%;
+ border-radius: 4px;
+ border: 1px solid rgb(190, 190, 190);
+ background-color: rgba(222, 222, 222, 0.95);
+ -webkit-box-shadow: inset 0 0 2px rgb(200, 200, 200);
+}
+
+.breakpoint-action-block-body > input {
+ width: 100%;
+}
+
+.breakpoint-action-eval-editor {
+ padding: 4px 0 2px 0;
+ -webkit-appearance: textfield;
+ border: 1px solid rgb(200, 200, 200);
+ background: white;
+}
+
+.breakpoint-action-eval-editor > .CodeMirror {
+ width: 336px; /* NOTE: Fixed value, manually tuned to .edit-breakpoint-popover-content.wide width */
+ height: auto;
+}
+
+.breakpoint-action-eval-editor > .CodeMirror-scroll {
+ width: 336px; /* NOTE: Fixed value, manually tuned to .edit-breakpoint-popover-content.wide width */
+ overflow: hidden;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBreakpointActionViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointActionViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BreakpointActionView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointActionView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointActionView = function(action, delegate, omitFocus)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(action);
+ console.assert(delegate);
+ console.assert(DebuggerAgent.BreakpointActionType);
+
+ this._action = action;
+ this._delegate = delegate;
+
+ this._element = document.createElement("div");
+ this._element.className = "breakpoint-action-block";
+
+ var header = this._element.appendChild(document.createElement("div"));
+ header.className = "breakpoint-action-block-header";
+
+ var picker = header.appendChild(document.createElement("select"));
+ picker.addEventListener("change", this._pickerChanged.bind(this));
+
+ for (var key in WebInspector.BreakpointAction.Type) {
+ var type = WebInspector.BreakpointAction.Type[key];
+ var option = document.createElement("option");
+ option.textContent = WebInspector.BreakpointActionView.displayStringForType(type);
+ option.selected = this._action.type === type;
+ option.value = type;
+ picker.add(option);
+ }
+
+ var appendActionButton = header.appendChild(document.createElement("button"));
+ appendActionButton.className = "breakpoint-action-append-button";
+ appendActionButton.addEventListener("click", this._appendActionButtonClicked.bind(this));
+ appendActionButton.title = WebInspector.UIString("Add new breakpoint action after this action");
+
+ var removeActionButton = header.appendChild(document.createElement("button"));
+ removeActionButton.className = "breakpoint-action-remove-button";
+ removeActionButton.addEventListener("click", this._removeAction.bind(this));
+ removeActionButton.title = WebInspector.UIString("Remove this breakpoint action");
+
+ this._bodyElement = this._element.appendChild(document.createElement("div"));
+ this._bodyElement.className = "breakpoint-action-block-body";
+
+ this._updateBody(omitFocus);
+};
+
+WebInspector.BreakpointActionView.displayStringForType = function(type)
+{
+ switch (type) {
+ case WebInspector.BreakpointAction.Type.Log:
+ return WebInspector.UIString("Log Message");
+ case WebInspector.BreakpointAction.Type.Evaluate:
+ return WebInspector.UIString("Evaluate JavaScript");
+ case WebInspector.BreakpointAction.Type.Sound:
+ return WebInspector.UIString("Play Sound");
+ case WebInspector.BreakpointAction.Type.Probe:
+ return WebInspector.UIString("Probe Expression");
+ default:
+ console.assert(false);
+ return "";
+ }
+}
+
+WebInspector.BreakpointActionView.prototype = {
+ constructor: WebInspector.BreakpointActionView,
+
+ // Public
+
+ get action()
+ {
+ return this._action;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ // Private
+
+ _pickerChanged: function(event)
+ {
+ var newType = event.target.value;
+ this._action = this._action.breakpoint.recreateAction(newType, this._action);
+ this._updateBody();
+ this._delegate.breakpointActionViewResized(this);
+ },
+
+ _appendActionButtonClicked: function(event)
+ {
+ var newAction = this._action.breakpoint.createAction(WebInspector.Breakpoint.DefaultBreakpointActionType, this._action);
+ this._delegate.breakpointActionViewAppendActionView(this, newAction);
+ },
+
+ _removeAction: function()
+ {
+ this._action.breakpoint.removeAction(this._action);
+ this._delegate.breakpointActionViewRemoveActionView(this);
+ },
+
+ _updateBody: function(omitFocus)
+ {
+ this._bodyElement.removeChildren();
+
+ switch (this._action.type) {
+ case WebInspector.BreakpointAction.Type.Log:
+ this._bodyElement.hidden = false;
+
+ var input = this._bodyElement.appendChild(document.createElement("input"));
+ input.placeholder = WebInspector.UIString("Message");
+ input.addEventListener("change", this._logInputChanged.bind(this));
+ input.value = this._action.data || "";
+ input.spellcheck = false;
+ if (!omitFocus)
+ setTimeout(function() { input.focus(); }, 0);
+
+ break;
+
+ case WebInspector.BreakpointAction.Type.Evaluate:
+ case WebInspector.BreakpointAction.Type.Probe:
+ this._bodyElement.hidden = false;
+
+ var editorElement = this._bodyElement.appendChild(document.createElement("div"));
+ editorElement.classList.add("breakpoint-action-eval-editor");
+ editorElement.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ this._codeMirror = CodeMirror(editorElement, {
+ lineWrapping: true,
+ mode: "text/javascript",
+ indentWithTabs: true,
+ indentUnit: 4,
+ matchBrackets: true,
+ value: this._action.data || "",
+ });
+
+ this._codeMirror.on("viewportChange", this._codeMirrorViewportChanged.bind(this));
+ this._codeMirror.on("blur", this._codeMirrorBlurred.bind(this));
+
+ var completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror);
+ completionController.addExtendedCompletionProvider("javascript", WebInspector.javaScriptRuntimeCompletionProvider);
+
+ // CodeMirror needs a refresh after the popover displays, to layout, otherwise it doesn't appear.
+ setTimeout(function() {
+ this._codeMirror.refresh();
+ if (!omitFocus)
+ this._codeMirror.focus();
+ }.bind(this), 0);
+
+ break;
+
+ case WebInspector.BreakpointAction.Type.Sound:
+ this._bodyElement.hidden = true;
+ break;
+
+ default:
+ console.assert(false);
+ this._bodyElement.hidden = true;
+ break;
+ }
+ },
+
+ _logInputChanged: function(event)
+ {
+ this._action.data = event.target.value;
+ },
+
+ _codeMirrorBlurred: function(event)
+ {
+ // Throw away the expression if it's just whitespace.
+ var data = (this._codeMirror.getValue() || "").trim();
+
+ if (!data.length)
+ this._removeAction();
+ else
+ this._action.data = data;
+ },
+
+ _codeMirrorViewportChanged: function(event)
+ {
+ this._delegate.breakpointActionViewResized(this);
+ }
+};
+
+WebInspector.BreakpointActionView.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBreakpointTreeElementcssfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.item.breakpoint .status > .status-image {
+ width: 21px;
+ height: 12px;
+ content: url(../Images/BreakpointInactiveButton.svg);
+ margin-top: 3px;
+}
+
+.item.breakpoint .status > .status-image.resolved {
+ content: url(../Images/BreakpointButton.svg);
+}
+
+.item.breakpoint .status > .status-image.auto-continue {
+ opacity: 0.6;
+}
+
+.item.breakpoint .status > .status-image.disabled {
+ opacity: 0.35;
+}
+
+.item.breakpoint .subtitle.formatted-location {
+ font-style: italic;
+}
+
+.breakpoint-exception-icon .icon {
+ content: url(../Images/Exception.svg);
+}
+
+/* When animating a layer on top of a tree element's icon, move the main
+icon to the icon element's background so animations are layered on top. */
+.breakpoint-generic-line-icon .icon {
+ background-image: url(../Images/ResultLine.svg);
+ content: '';
+}
+
+.breakpoint-generic-line-icon .icon > span {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+
+ border-radius: 50%;
+ -webkit-transform: scale(0);
+ -webkit-transition: none;
+ background-color: rgba(76, 102, 143, 1);
+}
+
+.data-updated.breakpoint-generic-line-icon .icon > span {
+ border-radius: 0;
+ -webkit-transform: scale(0.85);
+ -webkit-transition: all .4s ease-out;
+ background-color: rgba(76, 102, 143, 0.1);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsBreakpointTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceBreakpointTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/BreakpointTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,262 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.BreakpointTreeElement = function(breakpoint, className, title)
+{
+ console.assert(breakpoint instanceof WebInspector.Breakpoint);
+
+ if (!className)
+ className = WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName;
+
+ WebInspector.GeneralTreeElement.call(this, [WebInspector.BreakpointTreeElement.StyleClassName, className], title, null, breakpoint, false);
+
+ this._breakpoint = breakpoint;
+
+ this._listeners = new WebInspector.EventListenerSet(this, "BreakpointTreeElement listeners");
+ if (!title)
+ this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.LocationDidChange, this._breakpointLocationDidChange);
+ this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateStatus);
+ this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateStatus);
+ this._listeners.register(breakpoint, WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateStatus);
+
+ this._listeners.register(WebInspector.probeManager, WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetAdded);
+ this._listeners.register(WebInspector.probeManager, WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetRemoved);
+
+ this._statusImageElement = document.createElement("img");
+ this._statusImageElement.className = WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName;
+ this._listeners.register(this._statusImageElement, "mousedown", this._statusImageElementMouseDown);
+ this._listeners.register(this._statusImageElement, "click", this._statusImageElementClicked);
+
+ if (!title)
+ this._updateTitles();
+ this._updateStatus();
+
+ this.status = this._statusImageElement;
+ this.small = true;
+
+ this._iconAnimationLayerElement = document.createElement("span");
+ this.iconElement.appendChild(this._iconAnimationLayerElement);
+};
+
+WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName = "breakpoint-generic-line-icon";
+WebInspector.BreakpointTreeElement.StyleClassName = "breakpoint";
+WebInspector.BreakpointTreeElement.StatusImageElementStyleClassName = "status-image";
+WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName = "resolved";
+WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName = "auto-continue";
+WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName = "disabled";
+WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName = "formatted-location";
+WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName = "data-updated";
+
+WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration = 400; // milliseconds
+
+
+WebInspector.BreakpointTreeElement.prototype = {
+ constructor: WebInspector.BreakpointTreeElement,
+
+ // Public
+
+ get breakpoint()
+ {
+ return this._breakpoint;
+ },
+
+ ondelete: function()
+ {
+ if (!WebInspector.debuggerManager.isBreakpointRemovable(this._breakpoint))
+ return false;
+
+ WebInspector.debuggerManager.removeBreakpoint(this._breakpoint);
+ return true;
+ },
+
+ onenter: function()
+ {
+ this._breakpoint.cycleToNextMode();
+ return true;
+ },
+
+ onspace: function()
+ {
+ this._breakpoint.cycleToNextMode();
+ return true;
+ },
+
+ oncontextmenu: function(event)
+ {
+ var contextMenu = new WebInspector.ContextMenu(event);
+ this._breakpoint.appendContextMenuItems(contextMenu, this._statusImageElement);
+ contextMenu.show();
+ },
+
+ onattach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+
+ this._listeners.install();
+
+ for (var probeSet of WebInspector.probeManager.probeSets)
+ if (probeSet.breakpoint === this._breakpoint)
+ this._addProbeSet(probeSet);
+ },
+
+ ondetach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.ondetach.call(this);
+
+ this._listeners.uninstall();
+
+ if (this._probeSet)
+ this._removeProbeSet(this._probeSet);
+ },
+
+ // Private
+
+ _updateTitles: function()
+ {
+ var sourceCodeLocation = this._breakpoint.sourceCodeLocation;
+
+ var displayLineNumber = sourceCodeLocation.displayLineNumber;
+ var displayColumnNumber = sourceCodeLocation.displayColumnNumber;
+ if (displayColumnNumber > 0)
+ this.mainTitle = WebInspector.UIString("Line %d:%d").format(displayLineNumber + 1, displayColumnNumber + 1); // The user visible line and column numbers are 1-based.
+ else
+ this.mainTitle = WebInspector.UIString("Line %d").format(displayLineNumber + 1); // The user visible line number is 1-based.
+
+ if (sourceCodeLocation.hasMappedLocation()) {
+ this.subtitle = sourceCodeLocation.formattedLocationString();
+
+ if (sourceCodeLocation.hasFormattedLocation())
+ this.subtitleElement.classList.add(WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName);
+ else
+ this.subtitleElement.classList.remove(WebInspector.BreakpointTreeElement.FormattedLocationStyleClassName);
+
+ this.tooltip = this.mainTitle + " \u2014 " + WebInspector.UIString("originally %s").format(sourceCodeLocation.originalLocationString());
+ }
+ },
+
+ _updateStatus: function()
+ {
+ if (this._breakpoint.disabled)
+ this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName);
+ else
+ this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageDisabledStyleClassName);
+
+ if (this._breakpoint.autoContinue)
+ this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
+ else
+ this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
+
+ if (this._breakpoint.resolved)
+ this._statusImageElement.classList.add(WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName);
+ else
+ this._statusImageElement.classList.remove(WebInspector.BreakpointTreeElement.StatusImageResolvedStyleClassName);
+ },
+
+ _addProbeSet: function(probeSet)
+ {
+ console.assert(probeSet instanceof WebInspector.ProbeSet);
+ console.assert(probeSet.breakpoint === this._breakpoint);
+ console.assert(probeSet !== this._probeSet);
+
+ this._probeSet = probeSet;
+ probeSet.addEventListener(WebInspector.ProbeSet.Event.SamplesCleared, this._samplesCleared, this);
+ probeSet.dataTable.addEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
+ },
+
+ _removeProbeSet: function(probeSet)
+ {
+ console.assert(probeSet instanceof WebInspector.ProbeSet);
+ console.assert(probeSet === this._probeSet);
+
+ probeSet.removeEventListener(WebInspector.ProbeSet.Event.SamplesCleared, this._samplesCleared, this);
+ probeSet.dataTable.removeEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
+ delete this._probeSet;
+ },
+
+ _probeSetAdded: function(event)
+ {
+ var probeSet = event.data.probeSet;
+ if (probeSet.breakpoint === this._breakpoint)
+ this._addProbeSet(probeSet);
+ },
+
+ _probeSetRemoved: function(event)
+ {
+ var probeSet = event.data.probeSet;
+ if (probeSet.breakpoint === this._breakpoint)
+ this._removeProbeSet(probeSet);
+ },
+
+ _samplesCleared: function(event)
+ {
+ console.assert(this._probeSet);
+
+ var oldTable = event.data.oldTable;
+ oldTable.removeEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
+ this._probeSet.dataTable.addEventListener(WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataUpdated, this);
+ },
+
+ _dataUpdated: function()
+ {
+ if (this.element.classList.contains(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName)) {
+ clearTimeout(this._removeIconAnimationTimeoutIdentifier);
+ this.element.classList.remove(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+ // We want to restart the animation, which can only be done by removing the class,
+ // performing layout, and re-adding the class. Try adding class back on next run loop.
+ window.requestAnimationFrame(this._dataUpdated.bind(this));
+ return;
+ }
+
+ this.element.classList.add(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+ this._removeIconAnimationTimeoutIdentifier = setTimeout(function() {
+ this.element.classList.remove(WebInspector.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+ }.bind(this), WebInspector.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration);
+ },
+
+
+ _breakpointLocationDidChange: function(event)
+ {
+ console.assert(event.target === this._breakpoint);
+
+ // The Breakpoint has a new display SourceCode. The sidebar will remove us, and ondetach() will clear listeners.
+ if (event.data.oldDisplaySourceCode === this._breakpoint.displaySourceCode)
+ return;
+
+ this._updateTitles();
+ },
+
+ _statusImageElementMouseDown: function(event)
+ {
+ // To prevent the tree element from selecting.
+ event.stopPropagation();
+ },
+
+ _statusImageElementClicked: function(event)
+ {
+ this._breakpoint.cycleToNextMode();
+ }
+};
+
+WebInspector.BreakpointTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.navigation-bar .item.button {
+ width: 26px;
+}
+
+.navigation-bar .item.button.text-only {
+ width: auto;
+ padding: 0 10px;
+
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 11px;
+ line-height: 20px;
+
+ -webkit-justify-content: center;
+}
+
+.navigation-bar .item.button > .glyph {
+ width: 100%;
+ height: 100%;
+
+ background-repeat: no-repeat;
+ background-position: center center;
+}
+
+body.window-inactive .navigation-bar .item.button:not(.suppress-emboss) > .glyph {
+ opacity: 0.65;
+}
+
+.navigation-bar .item.button.disabled > .glyph {
+ opacity: 0.55 !important;
+}
+
+body.window-inactive .navigation-bar .item.button.disabled:not(.suppress-emboss) > .glyph {
+ opacity: 0.35 !important;
+}
+
+.navigation-bar .item.button.suppress-emboss > .glyph {
+ opacity: 0.7;
+}
+
+.navigation-bar .item.button.suppress-emboss:active > .glyph {
+ opacity: 1;
+}
+
+.navigation-bar .item.button.suppress-emboss.disabled > .glyph {
+ opacity: 0.3 !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceButtonNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ButtonNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ButtonNavigationItem = function(identifier, toolTipOrLabel, image, imageWidth, imageHeight, suppressEmboss, role, label) {
+ WebInspector.NavigationItem.call(this, identifier);
+
+ console.assert(identifier);
+ console.assert(toolTipOrLabel);
+
+ this.toolTip = toolTipOrLabel;
+
+ this._element.addEventListener("click", this._mouseClicked.bind(this));
+
+ this._element.setAttribute("role", role || "button");
+
+ if (label)
+ this._element.setAttribute("aria-label", label);
+
+ this._imageWidth = imageWidth || 16;
+ this._imageHeight = imageHeight || 16;
+ this._suppressEmboss = suppressEmboss || false;
+
+ if (suppressEmboss)
+ this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName);
+
+ if (image)
+ this.image = image;
+ else
+ this.label = toolTipOrLabel;
+};
+
+WebInspector.ButtonNavigationItem.StyleClassName = "button";
+WebInspector.ButtonNavigationItem.DisabledStyleClassName = "disabled";
+WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName = "suppress-bezel";
+WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName = "suppress-emboss";
+WebInspector.ButtonNavigationItem.TextOnlyClassName = "text-only";
+
+WebInspector.ButtonNavigationItem.States = {};
+WebInspector.ButtonNavigationItem.States.Normal = "normal";
+WebInspector.ButtonNavigationItem.States.Active = "active";
+WebInspector.ButtonNavigationItem.States.Focus = "focus";
+WebInspector.ButtonNavigationItem.States.ActiveFocus = "active-focus";
+
+WebInspector.ButtonNavigationItem.Event = {
+ Clicked: "button-navigation-item-clicked"
+};
+
+WebInspector.ButtonNavigationItem.prototype = {
+ constructor: WebInspector.ButtonNavigationItem,
+
+ // Public
+
+ get toolTip()
+ {
+ return this._element.title;
+ },
+
+ set toolTip(newToolTip)
+ {
+ console.assert(newToolTip);
+ if (!newToolTip)
+ return;
+
+ this._element.title = newToolTip;
+ },
+
+ get label()
+ {
+ return this._element.textContent;
+ },
+
+ set label(newLabel)
+ {
+ this._element.classList.add(WebInspector.ButtonNavigationItem.TextOnlyClassName);
+ this._element.textContent = newLabel || "";
+ if (this.parentNavigationBar)
+ this.parentNavigationBar.updateLayout();
+ },
+
+ get image()
+ {
+ return this._image;
+ },
+
+ set image(newImage)
+ {
+ if (!newImage) {
+ this._element.removeChildren();
+ return;
+ }
+
+ this._element.removeChildren();
+ this._element.classList.remove(WebInspector.ButtonNavigationItem.TextOnlyClassName);
+
+ this._image = newImage;
+
+ this._glyphElement = document.createElement("div");
+ this._glyphElement.className = "glyph";
+ this._element.appendChild(this._glyphElement);
+
+ this._updateImage();
+ },
+
+ get enabled()
+ {
+ return !this._element.classList.contains(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
+ },
+
+ set enabled(flag)
+ {
+ if (flag)
+ this._element.classList.remove(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
+ else
+ this._element.classList.add(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
+ },
+
+ get suppressBezel()
+ {
+ return this._element.classList.contains(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
+ },
+
+ set suppressBezel(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
+ },
+
+ generateStyleText: function(parentSelector)
+ {
+ var classNames = this._classNames.join(".");
+
+ if (this._suppressEmboss)
+ var styleText = parentSelector + " ." + classNames + " > .glyph { background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
+ else {
+ // Default state.
+ var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier() + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
+
+ // Pressed state.
+ styleText += parentSelector + " ." + classNames + ":not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Active) + "); }\n";
+
+ // Focused state.
+ styleText += parentSelector + " ." + classNames + ":not(.disabled):focus > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
+ }
+
+ return styleText;
+ },
+
+ // Private
+
+ _additionalClassNames: [WebInspector.ButtonNavigationItem.StyleClassName],
+ _embossedImageStates: WebInspector.ButtonNavigationItem.States,
+ _imageCacheable: true,
+
+ _mouseClicked: function(event)
+ {
+ if (!this.enabled)
+ return;
+ this.dispatchEventToListeners(WebInspector.ButtonNavigationItem.Event.Clicked);
+ },
+
+ _canvasIdentifier: function(state)
+ {
+ console.assert(!this._suppressEmboss);
+ return "navigation-item-" + this._identifier + "-" + (state || WebInspector.ButtonNavigationItem.States.Normal);
+ },
+
+ _updateImage: function()
+ {
+ if (this._suppressEmboss)
+ this._glyphElement.style.backgroundImage = "url(" + this._image + ")";
+ else
+ this._generateImages();
+ },
+
+ _generateImages: function()
+ {
+ console.assert(!this._suppressEmboss);
+ if (this._suppressEmboss)
+ return;
+ generateEmbossedImages(this.image, this._imageWidth, this._imageHeight, this._embossedImageStates, this._canvasIdentifier.bind(this), !this._imageCacheable);
+ }
+};
+
+WebInspector.ButtonNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.toolbar .item.button {
+ -webkit-align-items: center;
+ -webkit-justify-content: center;
+
+ padding: 0 6px;
+}
+
+.toolbar.icon-and-label-vertical .item.button {
+ -webkit-flex-direction: column;
+}
+
+.toolbar.icon-and-label-horizontal .item.button {
+ -webkit-flex-direction: row;
+}
+
+.toolbar .item.button > .glyph {
+ width: 32px;
+ height: 32px;
+
+ background-size: 100% 100% !important;
+
+ background-repeat: no-repeat;
+ background-position: center center;
+}
+
+.toolbar.small-size .item.button > .glyph {
+ width: 24px;
+ height: 24px;
+}
+
+.toolbar.label-only .item.button > .glyph {
+ display: none;
+}
+
+.toolbar .item.button > .label {
+ font-size: 11px;
+ font-family: Lucida Grande, sans-serif;
+ text-align: center;
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ color: rgb(60, 60, 60);
+}
+
+.toolbar.label-only .item.activate.button.activated > .label {
+ color: rgb(35, 125, 195);
+}
+
+.toolbar.icon-and-label-horizontal .item.button > .label {
+ margin-left: 4px;
+}
+
+.toolbar.icon-only .item.button > .label {
+ display: none;
+}
+
+body.window-inactive .toolbar .item.button {
+ opacity: 0.65;
+}
+
+.toolbar .item.button.disabled {
+ opacity: 0.55 !important;
+}
+
+body.window-inactive .toolbar .item.button.disabled {
+ opacity: 0.35 !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceButtonToolbarItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ButtonToolbarItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ButtonToolbarItem = function(identifier, toolTip, label, image, suppressEmboss, role)
+{
+ WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, 32, 32, suppressEmboss, role);
+
+ console.assert(label);
+
+ this._labelElement = document.createElement("div");
+ this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
+ this._element.appendChild(this._labelElement);
+
+ this.label = label;
+};
+
+WebInspector.ButtonToolbarItem.LabelStyleClassName = "label";
+
+WebInspector.ButtonToolbarItem.prototype = {
+ constructor: WebInspector.ButtonToolbarItem,
+
+ // Public
+
+ get label()
+ {
+ return this._labelElement.textContent;
+ },
+
+ set label(newLabel)
+ {
+ console.assert(newLabel);
+ if (!newLabel)
+ return;
+
+ this._labelElement.textContent = newLabel;
+ }
+};
+
+WebInspector.ButtonToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectioncssfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectioncss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.style-declaration-section {
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+
+ padding: 5px;
+
+ background-color: white;
+}
+
+.style-declaration-section + .style-declaration-section {
+ border-top: 1px solid rgb(210, 210, 210);
+}
+
+.style-declaration-section.last-in-group {
+ margin-bottom: 15px;
+
+ box-shadow: rgba(0, 0, 0, 0.3) 0 2px 2px 0;
+}
+
+.style-declaration-section.last-in-group + .style-declaration-section {
+ margin-top: 15px;
+
+ border-top: none;
+
+ box-shadow: rgba(0, 0, 0, 0.3) 0 0 2px 0;
+}
+
+.style-declaration-section:first-child,
+div:not(.style-declaration-section) + .style-declaration-section,
+.style-declaration-section.last-in-group + .style-declaration-section.last-in-group,
+.style-declaration-section.last-in-group + .style-declaration-section:last-child {
+ box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px 1px;
+}
+
+.style-declaration-section:last-child {
+ margin-bottom: 0 !important;
+}
+
+.style-declaration-section > .header {
+ position: relative;
+
+ padding: 4px 5px 3px 25px;
+
+ font-size: 11px;
+ line-height: 12px;
+}
+
+.style-declaration-section > .header > .icon {
+ position: absolute;
+
+ top: 2px;
+ left: 4px;
+
+ width: 16px;
+ height: 16px;
+}
+
+.style-declaration-section > .header > .selector {
+ font-family: Menlo, monospace;
+ color: rgb(128, 128, 128);
+
+ outline: none;
+
+ cursor: text;
+
+ word-wrap: break-word;
+
+ -webkit-user-select: text;
+ -webkit-user-modify: read-write-plaintext-only;
+}
+
+.style-declaration-section > .header > .selector:empty {
+ /* This prevents the cursor from disappearing when empty. */
+ display: inline-block;
+ min-width: 1px;
+}
+
+.style-declaration-section > .header > .selector:empty::before {
+ /* This prevents the cursor from positioning badly when empty. */
+ content: "";
+}
+
+.style-declaration-section > .header > .selector:focus {
+ color: black;
+}
+
+.style-declaration-section.locked > .header > .selector,
+.style-declaration-section.selector-locked > .header > .selector {
+ -webkit-user-modify: read-only;
+}
+
+.style-declaration-section.locked > .header::before {
+ float: right;
+
+ content: "";
+
+ width: 8px;
+ height: 10px;
+
+ background-image: -webkit-canvas(style-lock-normal);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 8px 10px;
+
+ margin-left: 5px;
+}
+
+.style-declaration-section > .header > .selector > .matched {
+ color: black;
+}
+
+.style-declaration-section > .header > .origin {
+ line-height: 10px;
+ font-family: "Lucida Grande", sans-serif;
+
+ color: rgb(128, 128, 128);
+
+ word-wrap: break-word;
+ white-space: nowrap;
+}
+
+.style-declaration-section > .header > .origin a {
+ white-space: normal;
+}
+
+.style-declaration-section > .header > .origin > .go-to-link {
+ color: inherit !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,261 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclarationSection = function(style)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(style);
+ this._style = style || null;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.CSSStyleDeclarationSection.StyleClassName;
+
+ this._headerElement = document.createElement("div");
+ this._headerElement.className = WebInspector.CSSStyleDeclarationSection.HeaderElementStyleClassName;
+
+ this._iconElement = document.createElement("img");
+ this._iconElement.className = WebInspector.CSSStyleDeclarationSection.IconElementStyleClassName;
+ this._headerElement.appendChild(this._iconElement);
+
+ this._selectorElement = document.createElement("span");
+ this._selectorElement.className = WebInspector.CSSStyleDeclarationSection.SelectorElementStyleClassName;
+ this._selectorElement.setAttribute("spellcheck", "false");
+ this._headerElement.appendChild(this._selectorElement);
+
+ this._originElement = document.createElement("span");
+ this._originElement.className = WebInspector.CSSStyleDeclarationSection.OriginElementStyleClassName;
+ this._headerElement.appendChild(this._originElement);
+
+ this._propertiesElement = document.createElement("div");
+ this._propertiesElement.className = WebInspector.CSSStyleDeclarationSection.PropertiesElementStyleClassName;
+
+ this._propertiesTextEditor = new WebInspector.CSSStyleDeclarationTextEditor(this, style);
+ this._propertiesElement.appendChild(this._propertiesTextEditor.element);
+
+ this._element.appendChild(this._headerElement);
+ this._element.appendChild(this._propertiesElement);
+
+ var iconClassName;
+ switch (style.type) {
+ case WebInspector.CSSStyleDeclaration.Type.Rule:
+ console.assert(style.ownerRule);
+
+ if (style.inherited)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName;
+ else if (style.ownerRule.type === WebInspector.CSSRule.Type.Author)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName;
+ else if (style.ownerRule.type === WebInspector.CSSRule.Type.User)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName;
+ else if (style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName;
+ else if (style.ownerRule.type === WebInspector.CSSRule.Type.Inspector)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName;
+ break;
+
+ case WebInspector.CSSStyleDeclaration.Type.Inline:
+ case WebInspector.CSSStyleDeclaration.Type.Attribute:
+ if (style.inherited)
+ iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName;
+ else
+ iconClassName = WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
+ break;
+ }
+
+ console.assert(iconClassName);
+ this._element.classList.add(iconClassName);
+
+ if (!style.editable)
+ this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LockedStyleClassName);
+ else if (style.ownerRule) {
+ this._commitSelectorKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter, this._commitSelector.bind(this), this._selectorElement);
+ this._selectorElement.addEventListener("blur", this._commitSelector.bind(this));
+ } else
+ this._element.classList.add(WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName);
+
+ if (!WebInspector.CSSStyleDeclarationSection._generatedLockImages) {
+ WebInspector.CSSStyleDeclarationSection._generatedLockImages = true;
+
+ var specifications = {"style-lock-normal": {fillColor: [0, 0, 0, 0.5]}};
+ generateColoredImagesForCSS("Images/Locked.svg", specifications, 8, 10);
+ }
+
+ this.refresh();
+};
+
+WebInspector.CSSStyleDeclarationSection.StyleClassName = "style-declaration-section";
+WebInspector.CSSStyleDeclarationSection.LockedStyleClassName = "locked";
+WebInspector.CSSStyleDeclarationSection.SelectorLockedStyleClassName = "selector-locked";
+WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName = "last-in-group";
+WebInspector.CSSStyleDeclarationSection.HeaderElementStyleClassName = "header";
+WebInspector.CSSStyleDeclarationSection.IconElementStyleClassName = "icon";
+WebInspector.CSSStyleDeclarationSection.SelectorElementStyleClassName = "selector";
+WebInspector.CSSStyleDeclarationSection.OriginElementStyleClassName = "origin";
+WebInspector.CSSStyleDeclarationSection.PropertiesElementStyleClassName = "properties";
+WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName = "matched";
+
+WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName = "author-style-rule-icon";
+WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName = "user-style-rule-icon";
+WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName = "user-agent-style-rule-icon";
+WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName = "inspector-style-rule-icon";
+WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName = "inherited-style-rule-icon";
+WebInspector.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName = "inherited-element-style-rule-icon";
+
+WebInspector.CSSStyleDeclarationSection.prototype = {
+ constructor: WebInspector.CSSStyleDeclarationSection,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get style()
+ {
+ return this._style;
+ },
+
+ get lastInGroup()
+ {
+ return this._element.classList.contains(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
+ },
+
+ set lastInGroup(last)
+ {
+ if (last)
+ this._element.classList.add(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.CSSStyleDeclarationSection.LastInGroupStyleClassName);
+ },
+
+ get focused()
+ {
+ return this._propertiesTextEditor.focused;
+ },
+
+ focus: function()
+ {
+ this._propertiesTextEditor.focus();
+ },
+
+ refresh: function()
+ {
+ this._selectorElement.removeChildren();
+ this._originElement.removeChildren();
+
+ this._originElement.appendChild(document.createTextNode(" \u2014 "));
+
+ function appendSelector(selectorText, matched)
+ {
+ var selectorElement = document.createElement("span");
+ if (matched)
+ selectorElement.className = WebInspector.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName;
+ selectorElement.textContent = selectorText;
+ this._selectorElement.appendChild(selectorElement);
+ }
+
+ switch (this._style.type) {
+ case WebInspector.CSSStyleDeclaration.Type.Rule:
+ console.assert(this._style.ownerRule);
+
+ var selectors = this._style.ownerRule.selectors;
+ var matchedSelectorIndices = this._style.ownerRule.matchedSelectorIndices;
+ if (selectors.length && matchedSelectorIndices.length) {
+ for (var i = 0; i < selectors.length; ++i) {
+ appendSelector.call(this, selectors[i], matchedSelectorIndices.contains(i));
+ if (i < selectors.length - 1)
+ this._selectorElement.appendChild(document.createTextNode(", "));
+ }
+ } else
+ appendSelector.call(this, this._style.ownerRule.selectorText, true);
+
+ if (this._style.ownerRule.sourceCodeLocation) {
+ var sourceCodeLink = WebInspector.createSourceCodeLocationLink(this._style.ownerRule.sourceCodeLocation, true);
+ this._originElement.appendChild(sourceCodeLink);
+ } else {
+ var originString;
+ switch (this._style.ownerRule.type) {
+ case WebInspector.CSSRule.Type.Author:
+ originString = WebInspector.UIString("Author Stylesheet");
+ break;
+
+ case WebInspector.CSSRule.Type.User:
+ originString = WebInspector.UIString("User Stylesheet");
+ break;
+
+ case WebInspector.CSSRule.Type.UserAgent:
+ originString = WebInspector.UIString("User Agent Stylesheet");
+ break;
+
+ case WebInspector.CSSRule.Type.Inspector:
+ originString = WebInspector.UIString("Web Inspector");
+ break;
+ }
+
+ console.assert(originString);
+ if (originString)
+ this._originElement.appendChild(document.createTextNode(originString));
+ }
+
+ break;
+
+ case WebInspector.CSSStyleDeclaration.Type.Inline:
+ appendSelector.call(this, WebInspector.displayNameForNode(this._style.node), true);
+ this._originElement.appendChild(document.createTextNode(WebInspector.UIString("Style Attribute")));
+ break;
+
+ case WebInspector.CSSStyleDeclaration.Type.Attribute:
+ appendSelector.call(this, WebInspector.displayNameForNode(this._style.node), true);
+ this._originElement.appendChild(document.createTextNode(WebInspector.UIString("HTML Attributes")));
+ break;
+ }
+ },
+
+ updateLayout: function()
+ {
+ this._propertiesTextEditor.updateLayout();
+ },
+
+ // Private
+
+ _commitSelector: function(mutations)
+ {
+ console.assert(this._style.ownerRule);
+ if (!this._style.ownerRule)
+ return;
+
+ var newSelectorText = this._selectorElement.textContent.trim();
+ if (!newSelectorText) {
+ // Revert to the current selector (by doing a refresh) since the new selector is empty.
+ this.refresh();
+ return;
+ }
+
+ this._style.ownerRule.selectorText = newSelectorText;
+ }
+};
+
+WebInspector.CSSStyleDeclarationSection.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorcssfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,161 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.css-style-text-editor {
+ background-color: white;
+ padding: 2px 0;
+}
+
+.css-style-text-editor > .CodeMirror {
+ height: auto;
+}
+
+.css-style-text-editor > .CodeMirror-scroll {
+ overflow: hidden;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-placeholder {
+ font-family: "Lucida Grande", sans-serif;
+ color: rgb(128, 128, 128);
+ padding: 0 5px 0 39px;
+ text-indent: -14px;
+}
+
+.css-style-text-editor > .CodeMirror pre {
+ padding: 1px 5px 1px 39px;
+ text-indent: -35px;
+}
+
+.css-style-text-editor > .CodeMirror pre * {
+ text-indent: 0;
+}
+
+.css-style-text-editor.read-only > .CodeMirror pre {
+ /* Compensate for the missing checkboxes so properties line up with editable styles that have checkboxes. */
+ text-indent: -14px;
+}
+
+.css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor {
+ display: none;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines pre span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.disabled,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.invalid,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.other-vendor,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.not-inherited,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.overridden {
+ text-decoration: line-through;
+ -webkit-text-stroke-width: 0.000000000000001px; /* A hack to get a different line-through color. */
+ -webkit-text-stroke-color: rgba(0, 0, 0, 0.6);
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines pre span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.invalid {
+ -webkit-text-stroke-color: rgba(255, 0, 0, 0.6);
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.implicit,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.not-inherited {
+ opacity: 0.5;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.disabled,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.other-vendor,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.not-inherited,
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.overridden {
+ -webkit-text-stroke-color: rgba(0, 0, 0, 0.3);
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line span:not(.css-style-declaration-property):not(.CodeMirror-widget):not(.cm-comment):not(.cm-tab),
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.invalid {
+ text-decoration: none;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox] {
+ width: 10px;
+ height: 10px;
+ vertical-align: middle;
+ margin: 0 8px 0 3px;
+ visibility: hidden;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .checkbox-placeholder {
+ display: inline-block;
+ width: 21px;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox]:not(:checked),
+.css-style-text-editor > .CodeMirror.CodeMirror-focused .CodeMirror-lines input[type=checkbox],
+.css-style-text-editor:hover > .CodeMirror .CodeMirror-lines input[type=checkbox] {
+ visibility: visible;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch {
+ display: inline-block;
+
+ margin-right: 3px;
+ vertical-align: -2px;
+
+ width: 1em;
+ height: 1em;
+
+ position: relative;
+
+ /* Make a checkered background for transparent colors to show against. */
+ background-image: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(204, 204, 204)),
+ -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(204, 204, 204));
+ background-color: white;
+ background-size: calc(50% + 1px);
+ background-position: top left, bottom right;
+ background-repeat: no-repeat;
+
+ cursor: default;
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch > span {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ border: 1px solid rgba(64, 64, 64, 0.4);
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch:hover > span {
+ border: 1px solid rgba(64, 64, 64, 0.8);
+}
+
+.css-style-text-editor > .CodeMirror .CodeMirror-lines .color-swatch:active > span {
+ border: 1px solid rgba(64, 64, 64, 1);
+}
+
+.css-style-text-editor > .CodeMirror .cm-link {
+ /* Style url(...) links as if they are strings. */
+ color: rgb(196, 26, 22);
+ text-decoration: inherit;
+ cursor: inherit;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDeclarationTextEditorjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1007 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDeclarationTextEditor = function(delegate, style, element)
+{
+ WebInspector.Object.call(this);
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.StyleClassName);
+ this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ this._showsImplicitProperties = true;
+ this._alwaysShowPropertyNames = {};
+ this._sortProperties = false;
+
+ this._prefixWhitespace = "";
+ this._suffixWhitespace = "";
+ this._linePrefixWhitespace = "";
+
+ this._delegate = delegate || null;
+
+ this._codeMirror = CodeMirror(this.element, {
+ readOnly: true,
+ lineWrapping: true,
+ mode: "css-rule",
+ electricChars: false,
+ indentWithTabs: true,
+ indentUnit: 4,
+ smartIndent: false,
+ matchBrackets: true,
+ autoCloseBrackets: true
+ });
+
+ this._codeMirror.on("change", this._contentChanged.bind(this));
+ this._codeMirror.on("blur", this._editorBlured.bind(this));
+
+ this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
+ this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
+
+ this._jumpToSymbolTrackingModeEnabled = false;
+ this._tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
+ this._tokenTrackingController.mouseOverDelayDuration = 0;
+ this._tokenTrackingController.mouseOutReleaseDelayDuration = 0;
+ this._tokenTrackingController.mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
+
+ this.style = style;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.CSSStyleDeclarationTextEditor);
+
+WebInspector.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor";
+WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
+WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName = "color-swatch";
+WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName = "checkbox-placeholder";
+WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName = "editing-line";
+WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay = 250;
+WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay = 2000;
+
+WebInspector.CSSStyleDeclarationTextEditor.prototype = {
+ constructor: WebInspector.CSSStyleDeclarationTextEditor,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(delegate)
+ {
+ this._delegate = delegate || null;
+ },
+
+ get style()
+ {
+ return this._style;
+ },
+
+ set style(style)
+ {
+ if (this._style === style)
+ return;
+
+ if (this._style) {
+ this._style.removeEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
+ if (this._style.ownerRule && this._style.ownerRule.sourceCodeLocation)
+ WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
+ }
+
+ this._style = style || null;
+
+ if (this._style) {
+ this._style.addEventListener(WebInspector.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
+ if (this._style.ownerRule && this._style.ownerRule.sourceCodeLocation)
+ WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
+ }
+
+ this._updateJumpToSymbolTrackingMode();
+
+ this._resetContent();
+ },
+
+ get focused()
+ {
+ return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
+ },
+
+ get alwaysShowPropertyNames()
+ {
+ return Object.keys(this._alwaysShowPropertyNames);
+ },
+
+ set alwaysShowPropertyNames(alwaysShowPropertyNames)
+ {
+ this._alwaysShowPropertyNames = (alwaysShowPropertyNames || []).keySet();
+
+ this._resetContent();
+ },
+
+ get showsImplicitProperties()
+ {
+ return this._showsImplicitProperties;
+ },
+
+ set showsImplicitProperties(showsImplicitProperties)
+ {
+ if (this._showsImplicitProperties === showsImplicitProperties)
+ return;
+
+ this._showsImplicitProperties = showsImplicitProperties;
+
+ this._resetContent();
+ },
+
+ get sortProperties()
+ {
+ return this._sortProperties;
+ },
+
+ set sortProperties(sortProperties)
+ {
+ if (this._sortProperties === sortProperties)
+ return;
+
+ this._sortProperties = sortProperties;
+
+ this._resetContent();
+ },
+
+ focus: function()
+ {
+ this._codeMirror.focus();
+ },
+
+ refresh: function()
+ {
+ this._resetContent();
+ },
+
+ updateLayout: function(force)
+ {
+ this._codeMirror.refresh();
+ },
+
+ // Protected
+
+ didDismissPopover: function(popover)
+ {
+ if (popover === this._colorPickerPopover)
+ delete this._colorPickerPopover;
+ },
+
+ completionControllerCompletionsHidden: function(completionController)
+ {
+ var styleText = this._style.text;
+ var currentText = this._formattedContent();
+
+ // If the style text and the current editor text differ then we need to commit.
+ // Otherwise we can just update the properties that got skipped because a completion
+ // was pending the last time _propertiesChanged was called.
+ if (styleText !== currentText)
+ this._commitChanges();
+ else
+ this._propertiesChanged();
+ },
+
+ // Private
+
+ _clearRemoveEditingLineClassesTimeout: function()
+ {
+ if (!this._removeEditingLineClassesTimeout)
+ return;
+
+ clearTimeout(this._removeEditingLineClassesTimeout);
+ delete this._removeEditingLineClassesTimeout;
+ },
+
+ _removeEditingLineClasses: function()
+ {
+ this._clearRemoveEditingLineClassesTimeout();
+
+ function removeEditingLineClasses()
+ {
+ var lineCount = this._codeMirror.lineCount();
+ for (var i = 0; i < lineCount; ++i)
+ this._codeMirror.removeLineClass(i, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
+ }
+
+ this._codeMirror.operation(removeEditingLineClasses.bind(this));
+ },
+
+ _removeEditingLineClassesSoon: function()
+ {
+ if (this._removeEditingLineClassesTimeout)
+ return;
+ this._removeEditingLineClassesTimeout = setTimeout(this._removeEditingLineClasses.bind(this), WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay);
+ },
+
+ _formattedContent: function()
+ {
+ // Start with the prefix whitespace we stripped.
+ var content = this._prefixWhitespace;
+
+ // Get each line and add the line prefix whitespace and newlines.
+ var lineCount = this._codeMirror.lineCount();
+ for (var i = 0; i < lineCount; ++i) {
+ var lineContent = this._codeMirror.getLine(i);
+ content += this._linePrefixWhitespace + lineContent;
+ if (i !== lineCount - 1)
+ content += "\n";
+ }
+
+ // Add the suffix whitespace we stripped.
+ content += this._suffixWhitespace;
+
+ return content;
+ },
+
+ _commitChanges: function()
+ {
+ if (this._commitChangesTimeout) {
+ clearTimeout(this._commitChangesTimeout);
+ delete this._commitChangesTimeout;
+ }
+
+ this._style.text = this._formattedContent();
+ },
+
+ _editorBlured: function(codeMirror)
+ {
+ // Clicking a suggestion causes the editor to blur. We don't want to reset content in this case.
+ if (this._completionController.isHandlingClickEvent())
+ return;
+
+ // Reset the content on blur since we stop accepting external changes while the the editor is focused.
+ // This causes us to pick up any change that was suppressed while the editor was focused.
+ this._resetContent();
+ },
+
+ _contentChanged: function(codeMirror, change)
+ {
+ // Return early if the style isn't editable. This still can be called when readOnly is set because
+ // clicking on a color swatch modifies the text.
+ if (!this._style || !this._style.editable || this._ignoreCodeMirrorContentDidChangeEvent)
+ return;
+
+ this._markLinesWithCheckboxPlaceholder();
+
+ this._clearRemoveEditingLineClassesTimeout();
+ this._codeMirror.addLineClass(change.from.line, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
+
+ // When the change is a completion change, create color swatches now since the changes
+ // will not go through _propertiesChanged until completionControllerCompletionsHidden happens.
+ // This way any auto completed colors get swatches right away.
+ if (this._completionController.isCompletionChange(change))
+ this._createColorSwatches(false, change.from.line);
+
+ // Use a short delay for user input to coalesce more changes before committing. Other actions like
+ // undo, redo and paste are atomic and work better with a zero delay. CodeMirror identifies changes that
+ // get coalesced in the undo stack with a "+" prefix on the origin. Use that to set the delay for our coalescing.
+ const delay = change.origin && change.origin.charAt(0) === "+" ? WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0;
+
+ // Reset the timeout so rapid changes coalesce after a short delay.
+ if (this._commitChangesTimeout)
+ clearTimeout(this._commitChangesTimeout);
+ this._commitChangesTimeout = setTimeout(this._commitChanges.bind(this), delay);
+ },
+
+ _updateTextMarkers: function(nonatomic)
+ {
+ function update()
+ {
+ this._clearTextMarkers(true);
+
+ var styleText = this._style.text;
+
+ this._iterateOverProperties(true, function(property) {
+ var styleTextRange = property.styleDeclarationTextRange;
+ console.assert(styleTextRange);
+ if (!styleTextRange)
+ return;
+
+ var from = {line: styleTextRange.startLine, ch: styleTextRange.startColumn};
+ var to = {line: styleTextRange.endLine, ch: styleTextRange.endColumn};
+
+ // Adjust the line position for the missing prefix line.
+ if (this._prefixWhitespace) {
+ --from.line;
+ --to.line;
+ }
+
+ // Adjust the column for the stripped line prefix whitespace.
+ from.ch -= this._linePrefixWhitespace.length;
+ to.ch -= this._linePrefixWhitespace.length;
+
+ this._createTextMarkerForPropertyIfNeeded(from, to, property);
+ });
+
+ if (!this._codeMirror.getOption("readOnly")) {
+ // Matches a comment like: /* -webkit-foo: bar; */
+ const commentedPropertyRegex = /\/\*\s*[-\w]+\s*:\s*[^;]+;?\s*\*\//g;
+
+ // Look for comments that look like properties and add checkboxes in front of them.
+ var lineCount = this._codeMirror.lineCount();
+ for (var i = 0; i < lineCount; ++i) {
+ var lineContent = this._codeMirror.getLine(i);
+
+ var match = commentedPropertyRegex.exec(lineContent);
+ while (match) {
+ var checkboxElement = document.createElement("input");
+ checkboxElement.type = "checkbox";
+ checkboxElement.checked = false;
+ checkboxElement.addEventListener("change", this._propertyCommentCheckboxChanged.bind(this));
+
+ var from = {line: i, ch: match.index};
+ var to = {line: i, ch: match.index + match[0].length};
+
+ var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
+ checkboxMarker.__propertyCheckbox = true;
+
+ var commentTextMarker = this._codeMirror.markText(from, to);
+
+ checkboxElement.__commentTextMarker = commentTextMarker;
+
+ match = commentedPropertyRegex.exec(lineContent);
+ }
+ }
+ }
+
+ // Look for colors and make swatches.
+ this._createColorSwatches(true);
+
+ this._markLinesWithCheckboxPlaceholder();
+ }
+
+ if (nonatomic)
+ update.call(this);
+ else
+ this._codeMirror.operation(update.bind(this));
+ },
+
+ _createColorSwatches: function(nonatomic, lineNumber)
+ {
+ function update()
+ {
+ var range = typeof lineNumber === "number" ? new WebInspector.TextRange(lineNumber, 0, lineNumber + 1, 0) : null;
+
+ // Look for color strings and add swatches in front of them.
+ this._codeMirror.createColorMarkers(range, function(marker, color, colorString) {
+ var swatchElement = document.createElement("span");
+ swatchElement.title = WebInspector.UIString("Click to open a colorpicker. Shift-click to change color format.");
+ swatchElement.className = WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName;
+ swatchElement.addEventListener("click", this._colorSwatchClicked.bind(this));
+
+ var swatchInnerElement = document.createElement("span");
+ swatchInnerElement.style.backgroundColor = colorString;
+ swatchElement.appendChild(swatchInnerElement);
+
+ var codeMirrorTextMarker = marker.codeMirrorTextMarker;
+ var swatchMarker = this._codeMirror.setUniqueBookmark(codeMirrorTextMarker.find().from, swatchElement);
+
+ swatchInnerElement.__colorTextMarker = codeMirrorTextMarker;
+ swatchInnerElement.__color = color;
+ }.bind(this));
+ }
+
+ if (nonatomic)
+ update.call(this);
+ else
+ this._codeMirror.operation(update.bind(this));
+ },
+
+ _updateTextMarkerForPropertyIfNeeded: function(property)
+ {
+ var textMarker = property.__propertyTextMarker;
+ console.assert(textMarker);
+ if (!textMarker)
+ return;
+
+ var range = textMarker.find();
+ console.assert(range);
+ if (!range)
+ return;
+
+ this._createTextMarkerForPropertyIfNeeded(range.from, range.to, property);
+ },
+
+ _createTextMarkerForPropertyIfNeeded: function(from, to, property)
+ {
+ if (!this._codeMirror.getOption("readOnly")) {
+ // Create a new checkbox element and marker.
+
+ console.assert(property.enabled);
+
+ var checkboxElement = document.createElement("input");
+ checkboxElement.type = "checkbox";
+ checkboxElement.checked = true;
+ checkboxElement.addEventListener("change", this._propertyCheckboxChanged.bind(this));
+ checkboxElement.__cssProperty = property;
+
+ var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
+ checkboxMarker.__propertyCheckbox = true;
+ }
+
+ var classNames = ["css-style-declaration-property"];
+
+ if (property.overridden)
+ classNames.push("overridden");
+
+ if (property.implicit)
+ classNames.push("implicit");
+
+ if (this._style.inherited && !property.inherited)
+ classNames.push("not-inherited");
+
+ if (!property.valid && property.hasOtherVendorNameOrKeyword())
+ classNames.push("other-vendor");
+ else if (!property.valid)
+ classNames.push("invalid");
+
+ if (!property.enabled)
+ classNames.push("disabled");
+
+ var classNamesString = classNames.join(" ");
+
+ // If there is already a text marker and it's in the same document, then try to avoid recreating it.
+ // FIXME: If there are multiple CSSStyleDeclarationTextEditors for the same style then this will cause
+ // both editors to fight and always recreate their text markers. This isn't really common.
+ if (property.__propertyTextMarker && property.__propertyTextMarker.doc.cm === this._codeMirror && property.__propertyTextMarker.find()) {
+ // If the class name is the same then we don't need to make a new marker.
+ if (property.__propertyTextMarker.className === classNamesString)
+ return;
+
+ property.__propertyTextMarker.clear();
+ }
+
+ var propertyTextMarker = this._codeMirror.markText(from, to, {className: classNamesString});
+
+ propertyTextMarker.__cssProperty = property;
+ property.__propertyTextMarker = propertyTextMarker;
+
+ property.addEventListener(WebInspector.CSSProperty.Event.OverriddenStatusChanged, this._propertyOverriddenStatusChanged, this);
+
+ this._removeCheckboxPlaceholder(from.line);
+ },
+
+ _clearTextMarkers: function(nonatomic, all)
+ {
+ function clear()
+ {
+ var markers = this._codeMirror.getAllMarks();
+ for (var i = 0; i < markers.length; ++i) {
+ var textMarker = markers[i];
+
+ if (!all && textMarker.__checkboxPlaceholder) {
+ var position = textMarker.find();
+
+ // Only keep checkbox placeholders if they are in the first column.
+ if (position && !position.ch)
+ continue;
+ }
+
+ if (textMarker.__cssProperty) {
+ textMarker.__cssProperty.removeEventListener(null, null, this);
+
+ delete textMarker.__cssProperty.__propertyTextMarker;
+ delete textMarker.__cssProperty;
+ }
+
+ textMarker.clear();
+ }
+ }
+
+ if (nonatomic)
+ clear.call(this);
+ else
+ this._codeMirror.operation(clear.bind(this));
+ },
+
+ _iterateOverProperties: function(onlyVisibleProperties, callback)
+ {
+ var properties = onlyVisibleProperties ? this._style.visibleProperties : this._style.properties;
+
+ if (!onlyVisibleProperties) {
+ // Filter based on options only when all properties are used.
+ properties = properties.filter((function(property) {
+ return !property.implicit || this._showsImplicitProperties || property.canonicalName in this._alwaysShowPropertyNames;
+ }).bind(this));
+
+ if (this._sortProperties)
+ properties.sort(function(a, b) { return a.name.localeCompare(b.name) });
+ }
+
+ for (var i = 0; i < properties.length; ++i) {
+ if (callback.call(this, properties[i], i === properties.length - 1))
+ break;
+ }
+ },
+
+ _propertyCheckboxChanged: function(event)
+ {
+ var property = event.target.__cssProperty;
+ console.assert(property);
+ if (!property)
+ return;
+
+ var textMarker = property.__propertyTextMarker;
+ console.assert(textMarker);
+ if (!textMarker)
+ return;
+
+ // Check if the property has been removed already, like from double-clicking
+ // the checkbox and calling this event listener multiple times.
+ var range = textMarker.find();
+ if (!range)
+ return;
+
+ var text = this._codeMirror.getRange(range.from, range.to);
+
+ function update()
+ {
+ // Replace the text with a commented version.
+ this._codeMirror.replaceRange("/* " + text + " */", range.from, range.to);
+
+ // Update the line for any color swatches that got removed.
+ this._createColorSwatches(true, range.from.line);
+ }
+
+ this._codeMirror.operation(update.bind(this));
+ },
+
+ _propertyCommentCheckboxChanged: function(event)
+ {
+ var commentTextMarker = event.target.__commentTextMarker;
+ console.assert(commentTextMarker);
+ if (!commentTextMarker)
+ return;
+
+ // Check if the comment has been removed already, like from double-clicking
+ // the checkbox and calling event listener multiple times.
+ var range = commentTextMarker.find();
+ if (!range)
+ return;
+
+ var text = this._codeMirror.getRange(range.from, range.to);
+
+ // Remove the comment prefix and suffix.
+ text = text.replace(/^\/\*\s*/, "").replace(/\s*\*\/$/, "");
+
+ // Add a semicolon if there isn't one already.
+ if (text.length && text.charAt(text.length - 1) !== ";")
+ text += ";";
+
+ function update()
+ {
+ this._codeMirror.addLineClass(range.from.line, "wrap", WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
+ this._codeMirror.replaceRange(text, range.from, range.to);
+
+ // Update the line for any color swatches that got removed.
+ this._createColorSwatches(true, range.from.line);
+ }
+
+ this._codeMirror.operation(update.bind(this));
+ },
+
+ _colorSwatchClicked: function(event)
+ {
+ if (this._colorPickerPopover)
+ return;
+
+ var swatch = event.target;
+
+ var color = swatch.__color;
+ console.assert(color);
+ if (!color)
+ return;
+
+ var colorTextMarker = swatch.__colorTextMarker;
+ console.assert(colorTextMarker);
+ if (!colorTextMarker)
+ return;
+
+ var range = colorTextMarker.find();
+ console.assert(range);
+ if (!range)
+ return;
+
+ function updateCodeMirror(newColorText)
+ {
+ function update()
+ {
+ // The original text marker might have been cleared by a style update,
+ // in this case we need to find the new color text marker so we know
+ // the right range for the new style color text.
+ if (!colorTextMarker || !colorTextMarker.find()) {
+ colorTextMarker = null;
+
+ var marks = this._codeMirror.findMarksAt(range.from);
+ if (!marks.length)
+ return;
+
+ for (var i = 0; i < marks.length; ++i) {
+ var mark = marks[i];
+ if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(mark).type !== WebInspector.TextMarker.Type.Color)
+ continue;
+ colorTextMarker = mark;
+ break;
+ }
+ }
+
+ if (!colorTextMarker)
+ return;
+
+ // Sometimes we still might find a stale text marker with findMarksAt.
+ var newRange = colorTextMarker.find();
+ if (!newRange)
+ return;
+
+ range = newRange;
+
+ colorTextMarker.clear();
+
+ this._codeMirror.replaceRange(newColorText, range.from, range.to);
+
+ // The color's text format could have changed, so we need to update the "range"
+ // variable to anticipate a different "range.to" property.
+ range.to.ch = range.from.ch + newColorText.length;
+
+ colorTextMarker = this._codeMirror.markText(range.from, range.to);
+
+ swatch.__colorTextMarker = colorTextMarker;
+ }
+
+ this._codeMirror.operation(update.bind(this));
+ }
+
+ if (event.shiftKey || this._codeMirror.getOption("readOnly")) {
+ var nextFormat = color.nextFormat();
+ console.assert(nextFormat);
+ if (!nextFormat)
+ return;
+ color.format = nextFormat;
+
+ var newColorText = color.toString();
+
+ // Ignore the change so we don't commit the format change. However, any future user
+ // edits will commit the color format.
+ this._ignoreCodeMirrorContentDidChangeEvent = true;
+ updateCodeMirror.call(this, newColorText);
+ delete this._ignoreCodeMirrorContentDidChangeEvent;
+ } else {
+ this._colorPickerPopover = new WebInspector.Popover(this);
+
+ var colorPicker = new WebInspector.ColorPicker;
+
+ colorPicker.addEventListener(WebInspector.ColorPicker.Event.ColorChanged, function(event) {
+ updateCodeMirror.call(this, event.data.color.toString());
+ }.bind(this));
+
+ var bounds = WebInspector.Rect.rectFromClientRect(swatch.getBoundingClientRect());
+
+ this._colorPickerPopover.content = colorPicker.element;
+ this._colorPickerPopover.present(bounds.pad(2), [WebInspector.RectEdge.MIN_X]);
+
+ colorPicker.color = color;
+ }
+ },
+
+ _propertyOverriddenStatusChanged: function(event)
+ {
+ this._updateTextMarkerForPropertyIfNeeded(event.target);
+ },
+
+ _propertiesChanged: function(event)
+ {
+ // Don't try to update the document while completions are showing. Doing so will clear
+ // the completion hint and prevent further interaction with the completion.
+ if (this._completionController.isShowingCompletions())
+ return;
+
+ // Reset the content if the text is different and we are not focused.
+ if (!this.focused && this._style.text !== this._formattedContent()) {
+ this._resetContent();
+ return;
+ }
+
+ this._removeEditingLineClassesSoon();
+
+ this._updateTextMarkers();
+ },
+
+ _markLinesWithCheckboxPlaceholder: function()
+ {
+ if (this._codeMirror.getOption("readOnly"))
+ return;
+
+ var linesWithPropertyCheckboxes = {};
+ var linesWithCheckboxPlaceholders = {};
+
+ var markers = this._codeMirror.getAllMarks();
+ for (var i = 0; i < markers.length; ++i) {
+ var textMarker = markers[i];
+ if (textMarker.__propertyCheckbox) {
+ var position = textMarker.find();
+ if (position)
+ linesWithPropertyCheckboxes[position.line] = true;
+ } else if (textMarker.__checkboxPlaceholder) {
+ var position = textMarker.find();
+ if (position)
+ linesWithCheckboxPlaceholders[position.line] = true;
+ }
+ }
+
+ var lineCount = this._codeMirror.lineCount();
+
+ for (var i = 0; i < lineCount; ++i) {
+ if (i in linesWithPropertyCheckboxes || i in linesWithCheckboxPlaceholders)
+ continue;
+
+ var position = {line: i, ch: 0};
+
+ var placeholderElement = document.createElement("div");
+ placeholderElement.className = WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName;
+
+ var placeholderMark = this._codeMirror.setUniqueBookmark(position, placeholderElement);
+ placeholderMark.__checkboxPlaceholder = true;
+ }
+ },
+
+ _removeCheckboxPlaceholder: function(lineNumber)
+ {
+ var marks = this._codeMirror.findMarksAt({line: lineNumber, ch: 0});
+ for (var i = 0; i < marks.length; ++i) {
+ var mark = marks[i];
+ if (!mark.__checkboxPlaceholder)
+ continue;
+
+ mark.clear();
+ return;
+ }
+ },
+
+ _resetContent: function()
+ {
+ if (this._commitChangesTimeout) {
+ clearTimeout(this._commitChangesTimeout);
+ delete this._commitChangesTimeout;
+ }
+
+ this._removeEditingLineClasses();
+
+ // Only allow editing if we have a style, it is editable and we have text range in the stylesheet.
+ var readOnly = !this._style || !this._style.editable || !this._style.styleSheetTextRange;
+ this._codeMirror.setOption("readOnly", readOnly);
+
+ if (readOnly) {
+ this.element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
+ this._codeMirror.setOption("placeholder", WebInspector.UIString("No Properties"));
+ } else {
+ this.element.classList.remove(WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
+ this._codeMirror.setOption("placeholder", WebInspector.UIString("No Properties \u2014 Click to Edit"));
+ }
+
+ if (!this._style) {
+ this._ignoreCodeMirrorContentDidChangeEvent = true;
+
+ this._clearTextMarkers(false, true);
+
+ this._codeMirror.setValue("");
+ this._codeMirror.clearHistory();
+ this._codeMirror.markClean();
+
+ delete this._ignoreCodeMirrorContentDidChangeEvent;
+
+ return;
+ }
+
+ function update()
+ {
+ // Remember the cursor position/selection.
+ var selectionAnchor = this._codeMirror.getCursor("anchor");
+ var selectionHead = this._codeMirror.getCursor("head");
+
+ function countNewLineCharacters(text)
+ {
+ var matches = text.match(/\n/g);
+ return matches ? matches.length : 0;
+ }
+
+ var styleText = this._style.text;
+
+ // Pretty print the content if there are more properties than there are lines.
+ // This could be an option exposed to the user; however, it is almost always
+ // desired in this case.
+
+ if (styleText && this._style.visibleProperties.length <= countNewLineCharacters(styleText.trim()) + 1) {
+ // This style has formatted text content, so use it for a high-fidelity experience.
+
+ var prefixWhitespaceMatch = styleText.match(/^[ \t]*\n/);
+ this._prefixWhitespace = prefixWhitespaceMatch ? prefixWhitespaceMatch[0] : "";
+
+ var suffixWhitespaceMatch = styleText.match(/\n[ \t]*$/);
+ this._suffixWhitespace = suffixWhitespaceMatch ? suffixWhitespaceMatch[0] : "";
+
+ this._codeMirror.setValue(styleText);
+
+ if (this._prefixWhitespace)
+ this._codeMirror.removeLine(0);
+
+ if (this._suffixWhitespace) {
+ var lineCount = this._codeMirror.lineCount();
+ this._codeMirror.replaceRange("", {line: lineCount - 2}, {line: lineCount - 1});
+ }
+
+ this._linePrefixWhitespace = "";
+
+ var linesToStrip = [];
+
+ // Remember the whitespace so it can be restored on commit.
+ var lineCount = this._codeMirror.lineCount();
+ for (var i = 0; i < lineCount; ++i) {
+ var lineContent = this._codeMirror.getLine(i);
+
+ var prefixWhitespaceMatch = lineContent.match(/^\s+/);
+ if (!prefixWhitespaceMatch)
+ continue;
+
+ linesToStrip.push(i);
+
+ // Only remember the shortest whitespace so we don't loose any of the
+ // original author's whitespace if their indentation lengths differed.
+ // Using the shortest also makes the adjustment work in _updateTextMarkers.
+
+ // FIXME: This messes up if there is a mix of spaces and tabs. One tab
+ // will be shorter than 4 or 8 spaces, but will look the same visually.
+ if (!this._linePrefixWhitespace || prefixWhitespaceMatch[0].length < this._linePrefixWhitespace.length)
+ this._linePrefixWhitespace = prefixWhitespaceMatch[0];
+ }
+
+ // Strip the whitespace from the beginning of each line.
+ for (var i = 0; i < linesToStrip.length; ++i) {
+ var lineNumber = linesToStrip[i];
+ var from = {line: lineNumber, ch: 0};
+ var to = {line: lineNumber, ch: this._linePrefixWhitespace.length};
+ this._codeMirror.replaceRange("", from, to);
+ }
+
+ // Update all the text markers.
+ this._updateTextMarkers(true);
+ } else {
+ // This style does not have text content or it is minified, so we want to synthesize the text content.
+
+ this._prefixWhitespace = "";
+ this._suffixWhitespace = "";
+ this._linePrefixWhitespace = "";
+
+ this._codeMirror.setValue("");
+
+ var lineNumber = 0;
+
+ // Iterate only visible properties if we have original style text. That way we known we only syntesize
+ // what was originaly in the style text.
+ this._iterateOverProperties(styleText ? true : false, function(property) {
+ // Some property text can have line breaks, so consider that in the ranges below.
+ var propertyText = property.synthesizedText;
+ var propertyLineCount = countNewLineCharacters(propertyText);
+
+ var from = {line: lineNumber, ch: 0};
+ var to = {line: lineNumber + propertyLineCount};
+
+ this._codeMirror.replaceRange((lineNumber ? "\n" : "") + propertyText, from);
+ this._createTextMarkerForPropertyIfNeeded(from, to, property);
+
+ lineNumber += propertyLineCount + 1;
+ });
+
+ // Look for colors and make swatches.
+ this._createColorSwatches(true);
+ }
+
+ this._markLinesWithCheckboxPlaceholder();
+
+ // Restore the cursor position/selection.
+ this._codeMirror.setSelection(selectionAnchor, selectionHead);
+
+ // Reset undo history since undo past the reset is wrong when the content was empty before
+ // or the content was representing a previous style object.
+ this._codeMirror.clearHistory();
+
+ // Mark the editor as clean (unedited state).
+ this._codeMirror.markClean();
+ }
+
+ // This needs to be done first and as a separate operation to avoid an exception in CodeMirror.
+ this._clearTextMarkers(false, true);
+
+ this._ignoreCodeMirrorContentDidChangeEvent = true;
+ this._codeMirror.operation(update.bind(this));
+ delete this._ignoreCodeMirrorContentDidChangeEvent;
+ },
+
+ _updateJumpToSymbolTrackingMode: function()
+ {
+ var oldJumpToSymbolTrackingModeEnabled = this._jumpToSymbolTrackingModeEnabled;
+
+ if (!this._style || !this._style.ownerRule || !this._style.ownerRule.sourceCodeLocation)
+ this._jumpToSymbolTrackingModeEnabled = false;
+ else
+ this._jumpToSymbolTrackingModeEnabled = WebInspector.modifierKeys.metaKey && !WebInspector.modifierKeys.altKey && !WebInspector.modifierKeys.shiftKey;
+
+ if (oldJumpToSymbolTrackingModeEnabled !== this._jumpToSymbolTrackingModeEnabled) {
+ if (this._jumpToSymbolTrackingModeEnabled) {
+ this._tokenTrackingController.highlightLastHoveredRange();
+ this._tokenTrackingController.enabled = !this._codeMirror.getOption("readOnly");
+ } else {
+ this._tokenTrackingController.removeHighlightedRange();
+ this._tokenTrackingController.enabled = false;
+ }
+ }
+ },
+
+ tokenTrackingControllerHighlightedRangeWasClicked: function(tokenTrackingController)
+ {
+ console.assert(this._style.ownerRule.sourceCodeLocation);
+ if (!this._style.ownerRule.sourceCodeLocation)
+ return;
+
+ // Special case command clicking url(...) links.
+ var token = this._tokenTrackingController.candidate.hoveredToken;
+ if (/\blink\b/.test(token.type)) {
+ var url = token.string;
+ var baseURL = this._style.ownerRule.sourceCodeLocation.sourceCode.url;
+ WebInspector.openURL(absoluteURL(url, baseURL));
+ return;
+ }
+
+ // Jump to the rule if we can't find a property.
+ // Find a better source code location from the property that was clicked.
+ var sourceCodeLocation = this._style.ownerRule.sourceCodeLocation;
+ var marks = this._codeMirror.findMarksAt(this._tokenTrackingController.candidate.hoveredTokenRange.start);
+ for (var i = 0; i < marks.length; ++i) {
+ var mark = marks[i];
+ var property = mark.__cssProperty;
+ if (property) {
+ var sourceCode = sourceCodeLocation.sourceCode;
+ var styleSheetTextRange = property.styleSheetTextRange;
+ sourceCodeLocation = sourceCode.createSourceCodeLocation(styleSheetTextRange.startLine, styleSheetTextRange.startColumn);
+ }
+ }
+
+ WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
+ },
+
+ tokenTrackingControllerNewHighlightCandidate: function(tokenTrackingController, candidate)
+ {
+ this._tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
+ }
+};
+
+WebInspector.CSSStyleDeclarationTextEditor.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDetailsSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.details.css-style > .navigation-bar {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+}
+
+.sidebar > .panel.details.css-style > .content {
+ position: absolute;
+ top: 22px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.sidebar > .panel.details.css-style > .content > .pseudo-classes {
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+
+ padding: 10px;
+
+ display: -webkit-flex;
+ -webkit-flex-flow: row wrap;
+ -webkit-justify-content: space-around;
+}
+
+.sidebar > .panel.details.css-style > .content > .pseudo-classes > .group {
+ display: -webkit-inline-flex;
+ -webkit-flex-flow: row wrap;
+ -webkit-justify-content: space-around;
+ -webkit-flex: 1;
+}
+
+.sidebar > .panel.details.css-style > .content > .pseudo-classes > .group > label {
+ color: rgb(96, 96, 96);
+ text-shadow: white 0 1px 0;
+
+ margin: 0 5px;
+ min-width: 55px;
+
+ display: inline-block;
+ white-space: nowrap;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceCSSStyleDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CSSStyleDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,240 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CSSStyleDetailsSidebarPanel = function()
+{
+ WebInspector.DOMDetailsSidebarPanel.call(this, "css-style", WebInspector.UIString("Styles"), WebInspector.UIString("Style"), "Images/NavigationItemBrushAndRuler.svg", "4");
+
+ this._selectedPanel = null;
+
+ this._navigationBar = new WebInspector.NavigationBar(null, null, "tablist");
+ this._navigationBar.addEventListener(WebInspector.NavigationBar.Event.NavigationItemSelected, this._navigationItemSelected, this);
+ this.element.appendChild(this._navigationBar.element);
+
+ this._contentElement = document.createElement("div");
+ this._contentElement.className = WebInspector.CSSStyleDetailsSidebarPanel.ContentStyleClassName;
+
+ this._forcedPseudoClassCheckboxes = {};
+
+ if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
+ this._forcedPseudoClassContainer = document.createElement("div");
+ this._forcedPseudoClassContainer.className = WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesElementStyleClassName;
+
+ var groupElement = null;
+
+ WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(pseudoClass) {
+ // We don't localize the label since it is a CSS pseudo-class from the CSS standard.
+ var label = pseudoClass.capitalize();
+
+ var labelElement = document.createElement("label");
+
+ var checkboxElement = document.createElement("input");
+ checkboxElement.addEventListener("change", this._forcedPseudoClassCheckboxChanged.bind(this, pseudoClass));
+ checkboxElement.type = "checkbox";
+
+ this._forcedPseudoClassCheckboxes[pseudoClass] = checkboxElement;
+
+ labelElement.appendChild(checkboxElement);
+ labelElement.appendChild(document.createTextNode(label));
+
+ if (!groupElement || groupElement.children.length === 2) {
+ groupElement = document.createElement("div");
+ groupElement.className = WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesGroupElementStyleClassName;
+ this._forcedPseudoClassContainer.appendChild(groupElement);
+ }
+
+ groupElement.appendChild(labelElement);
+ }.bind(this));
+
+ this._contentElement.appendChild(this._forcedPseudoClassContainer);
+ }
+
+ this.element.appendChild(this._contentElement);
+
+ this._computedStyleDetailsPanel = new WebInspector.ComputedStyleDetailsPanel;
+ this._rulesStyleDetailsPanel = new WebInspector.RulesStyleDetailsPanel;
+ this._metricsStyleDetailsPanel = new WebInspector.MetricsStyleDetailsPanel;
+
+ this._panels = [this._computedStyleDetailsPanel, this._rulesStyleDetailsPanel, this._metricsStyleDetailsPanel];
+
+ this._navigationBar.addNavigationItem(this._computedStyleDetailsPanel.navigationItem);
+ this._navigationBar.addNavigationItem(this._rulesStyleDetailsPanel.navigationItem);
+ this._navigationBar.addNavigationItem(this._metricsStyleDetailsPanel.navigationItem);
+
+ this._lastSelectedSectionSetting = new WebInspector.Setting("last-selected-style-details-panel", this._rulesStyleDetailsPanel.navigationItem.identifier);
+
+ // This will cause the selected panel to be set in _navigationItemSelected.
+ this._navigationBar.selectedNavigationItem = this._lastSelectedSectionSetting.value;
+};
+
+WebInspector.CSSStyleDetailsSidebarPanel.ContentStyleClassName = "content";
+WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesElementStyleClassName = "pseudo-classes";
+WebInspector.CSSStyleDetailsSidebarPanel.PseudoClassesGroupElementStyleClassName = "group";
+WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset = 38; // Default height of the forced pseudo classes container. Updated in widthDidChange.
+
+WebInspector.CSSStyleDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.CSSStyleDetailsSidebarPanel,
+
+ // Public
+
+ supportsDOMNode: function(nodeToInspect)
+ {
+ return nodeToInspect.nodeType() === Node.ELEMENT_NODE;
+ },
+
+ refresh: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode)
+ return;
+
+ this._contentElement.scrollTop = this._initialScrollOffset;
+
+ for (var i = 0; i < this._panels.length; ++i) {
+ delete this._panels[i].element._savedScrollTop;
+ this._panels[i].markAsNeedsRefresh(domNode);
+ }
+
+ this._updatePseudoClassCheckboxes();
+ },
+
+ visibilityDidChange: function()
+ {
+ WebInspector.SidebarPanel.prototype.visibilityDidChange.call(this);
+
+ if (!this._selectedPanel)
+ return;
+
+ if (!this.visible) {
+ this._selectedPanel.hidden();
+ return;
+ }
+
+ this._navigationBar.updateLayout();
+
+ this._updateNoForcedPseudoClassesScrollOffset();
+
+ this._selectedPanel.shown();
+ this._selectedPanel.markAsNeedsRefresh(this.domNode);
+ },
+
+ widthDidChange: function()
+ {
+ this._updateNoForcedPseudoClassesScrollOffset();
+
+ if (this._selectedPanel)
+ this._selectedPanel.widthDidChange();
+ },
+
+ // Protected
+
+ addEventListeners: function()
+ {
+ this.domNode.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged, this._updatePseudoClassCheckboxes, this);
+ },
+
+ removeEventListeners: function()
+ {
+ this.domNode.removeEventListener(null, null, this);
+ },
+
+ // Private
+
+ get _initialScrollOffset()
+ {
+ if (!WebInspector.cssStyleManager.canForcePseudoClasses())
+ return 0;
+ return this.domNode && this.domNode.enabledPseudoClasses.length ? 0 : WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset;
+ },
+
+ _updateNoForcedPseudoClassesScrollOffset: function()
+ {
+ if (this._forcedPseudoClassContainer)
+ WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset = this._forcedPseudoClassContainer.offsetHeight;
+ },
+
+ _navigationItemSelected: function(event)
+ {
+ console.assert(event.target.selectedNavigationItem);
+ if (!event.target.selectedNavigationItem)
+ return;
+
+ var selectedNavigationItem = event.target.selectedNavigationItem;
+
+ var selectedPanel = null;
+ for (var i = 0; i < this._panels.length; ++i) {
+ if (this._panels[i].navigationItem !== selectedNavigationItem)
+ continue;
+ selectedPanel = this._panels[i];
+ break;
+ }
+
+ console.assert(selectedPanel);
+
+ if (this._selectedPanel) {
+ this._selectedPanel.hidden();
+ this._selectedPanel.element._savedScrollTop = this._contentElement.scrollTop;
+ this._selectedPanel.element.remove();
+ }
+
+ this._selectedPanel = selectedPanel;
+
+ if (this._selectedPanel) {
+ this._contentElement.appendChild(this._selectedPanel.element);
+
+ if (typeof this._selectedPanel.element._savedScrollTop === "number")
+ this._contentElement.scrollTop = this._selectedPanel.element._savedScrollTop;
+ else
+ this._contentElement.scrollTop = this._initialScrollOffset;
+
+ this._selectedPanel.shown();
+ }
+
+ this._lastSelectedSectionSetting.value = selectedNavigationItem.identifier;
+ },
+
+ _forcedPseudoClassCheckboxChanged: function(pseudoClass, event)
+ {
+ if (!this.domNode)
+ return;
+
+ this.domNode.setPseudoClassEnabled(pseudoClass, event.target.checked);
+ },
+
+ _updatePseudoClassCheckboxes: function()
+ {
+ if (!this.domNode)
+ return;
+
+ var enabledPseudoClasses = this.domNode.enabledPseudoClasses;
+
+ for (var pseudoClass in this._forcedPseudoClassCheckboxes) {
+ var checkboxElement = this._forcedPseudoClassCheckboxes[pseudoClass];
+ checkboxElement.checked = enabledPseudoClasses.contains(pseudoClass);
+ }
+ }
+};
+
+WebInspector.CSSStyleDetailsSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCallFrameIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceCallFrameIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CallFrameIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.function-icon .icon {
+ content: url(../Images/Function.svg);
+}
+
+.event-listener-icon .icon {
+ content: url(../Images/EventListener.svg);
+}
+
+.native-icon .icon {
+ content: url(../Images/Native.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCallFrameTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCallFrameTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CallFrameTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CallFrameTreeElement = function(callFrame)
+{
+ console.assert(callFrame instanceof WebInspector.CallFrame);
+
+ var className = WebInspector.CallFrameTreeElement.FunctionIconStyleClassName;
+ if (callFrame.nativeCode)
+ className = WebInspector.CallFrameTreeElement.NativeIconStyleClassName;
+
+ // This is more than likely an event listener function with an "on" prefix and it is
+ // as long or longer than the shortest event listener name -- "oncut".
+ if (callFrame.functionName && callFrame.functionName.startsWith("on") && callFrame.functionName.length >= 5)
+ className = WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName;
+
+ var title = callFrame.functionName || WebInspector.UIString("(anonymous function)");
+
+ WebInspector.GeneralTreeElement.call(this, className, title, null, callFrame, false);
+
+ if (!callFrame.nativeCode && callFrame.sourceCodeLocation) {
+ var displayScriptURL = callFrame.sourceCodeLocation.displaySourceCode.url;
+ if (displayScriptURL) {
+ this.subtitle = document.createElement("span");
+ callFrame.sourceCodeLocation.populateLiveDisplayLocationString(this.subtitle, "textContent");
+ // Set the tooltip on the entire tree element in onattach, once the element is created.
+ this.tooltipHandledSeparately = true;
+ }
+ }
+
+ this._callFrame = callFrame;
+
+ this.small = true;
+};
+
+WebInspector.CallFrameTreeElement.FunctionIconStyleClassName = "function-icon";
+WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName = "event-listener-icon";
+WebInspector.CallFrameTreeElement.NativeIconStyleClassName = "native-icon";
+
+WebInspector.CallFrameTreeElement.prototype = {
+ constructor: WebInspector.CallFrameTreeElement,
+
+ // Public
+
+ get callFrame()
+ {
+ return this._callFrame;
+ },
+
+ // Protected
+
+ onattach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+
+ console.assert(this.element);
+
+ if (this.tooltipHandledSeparately) {
+ var tooltipPrefix = this.mainTitle + "\n";
+ this._callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
+ }
+ }
+};
+
+WebInspector.CallFrameTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsClusterContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceClusterContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.cluster > .content-view-container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsClusterContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceClusterContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ClusterContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ClusterContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,257 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ClusterContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.element.classList.add(WebInspector.ClusterContentView.StyleClassName);
+
+ this._contentViewContainer = new WebInspector.ContentViewContainer();
+ this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this);
+ this.element.appendChild(this._contentViewContainer.element);
+
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
+};
+
+WebInspector.ClusterContentView.StyleClassName = "cluster";
+
+WebInspector.ClusterContentView.prototype = {
+ constructor: WebInspector.ClusterContentView,
+
+ // Public
+
+ get navigationItems()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ return currentContentView ? currentContentView.navigationItems : [];
+ },
+
+ get contentViewContainer()
+ {
+ return this._contentViewContainer;
+ },
+
+ get supportsSplitContentBrowser()
+ {
+ if (this._contentViewContainer.currentContentView)
+ return this._contentViewContainer.currentContentView.supportsSplitContentBrowser;
+ return true;
+ },
+
+ updateLayout: function()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (currentContentView)
+ currentContentView.updateLayout();
+ },
+
+ shown: function()
+ {
+ this._contentViewContainer.shown();
+ },
+
+ hidden: function()
+ {
+ this._contentViewContainer.hidden();
+ },
+
+ closed: function()
+ {
+ this._contentViewContainer.closeAllContentViews();
+
+ WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
+ WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
+ WebInspector.ContentView.removeEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
+ },
+
+ canGoBack: function()
+ {
+ return this._contentViewContainer.canGoBack();
+ },
+
+ canGoForward: function()
+ {
+ return this._contentViewContainer.canGoForward();
+ },
+
+ goBack: function()
+ {
+ this._contentViewContainer.goBack()
+ },
+
+ goForward: function()
+ {
+ this._contentViewContainer.goForward()
+ },
+
+ get selectionPathComponents()
+ {
+ if (!this._contentViewContainer.currentContentView)
+ return [];
+ return this._contentViewContainer.currentContentView.selectionPathComponents;
+ },
+
+ get supplementalRepresentedObjects()
+ {
+ if (!this._contentViewContainer.currentContentView)
+ return [];
+ return this._contentViewContainer.currentContentView.supplementalRepresentedObjects;
+ },
+
+ get handleCopyEvent()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ return currentContentView && typeof currentContentView.handleCopyEvent === "function" ? currentContentView.handleCopyEvent.bind(currentContentView) : null;
+ },
+
+ get supportsSave()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ return currentContentView && currentContentView.supportsSave;
+ },
+
+ get saveData()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ return currentContentView && currentContentView.saveData || null;
+ },
+
+ get supportsSearch()
+ {
+ // Always return true so we can intercept the search query to resend it when switching content views.
+ return true;
+ },
+
+ get numberOfSearchResults()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return null;
+ return currentContentView.numberOfSearchResults;
+ },
+
+ get hasPerformedSearch()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return false;
+ return currentContentView.hasPerformedSearch;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+ currentContentView.automaticallyRevealFirstSearchResult = reveal;
+ },
+
+ performSearch: function(query)
+ {
+ this._searchQuery = query;
+
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+ currentContentView.performSearch(query);
+ },
+
+ searchCleared: function()
+ {
+ this._searchQuery = null;
+
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+ currentContentView.searchCleared();
+ },
+
+ searchQueryWithSelection: function()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return null;
+ return currentContentView.searchQueryWithSelection();
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+ currentContentView.revealPreviousSearchResult(changeFocus);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+ currentContentView.revealNextSearchResult(changeFocus);
+ },
+
+ // Private
+
+ _currentContentViewDidChange: function(event)
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (currentContentView && currentContentView.supportsSearch) {
+ if (this._searchQuery)
+ currentContentView.performSearch(this._searchQuery);
+ else
+ currentContentView.searchCleared();
+ }
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ },
+
+ _contentViewSelectionPathComponentDidChange: function(event)
+ {
+ if (event.target !== this._contentViewContainer.currentContentView)
+ return;
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _contentViewSupplementalRepresentedObjectsDidChange: function(event)
+ {
+ if (event.target !== this._contentViewContainer.currentContentView)
+ return;
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
+ },
+
+ _contentViewNumberOfSearchResultsDidChange: function(event)
+ {
+ if (event.target !== this._contentViewContainer.currentContentView)
+ return;
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+ }
+};
+
+WebInspector.ClusterContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorAdditionsjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorAdditionsjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorAdditions.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,648 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+(function () {
+ // By default CodeMirror defines syntax highlighting styles based on token
+ // only and shared styles between modes. This limiting and does not match
+ // what we have done in the Web Inspector. So this modifies the XML, CSS
+ // and JavaScript modes to supply two styles for each token. One for the
+ // token and one with the mode name.
+
+ function tokenizeLinkString(stream, state)
+ {
+ console.assert(state._linkQuoteCharacter !== undefined);
+
+ // Eat the string until the same quote is found that started the string.
+ // If this is unquoted, then eat until whitespace or common parse errors.
+ if (state._linkQuoteCharacter)
+ stream.eatWhile(new RegExp("[^" + state._linkQuoteCharacter + "]"));
+ else
+ stream.eatWhile(/[^\s\u00a0=<>\"\']/);
+
+ // If the stream isn't at the end of line then we found the end quote.
+ // In the case, change _linkTokenize to parse the end of the link next.
+ // Otherwise _linkTokenize will stay as-is to parse more of the link.
+ if (!stream.eol())
+ state._linkTokenize = tokenizeEndOfLinkString;
+
+ return "link";
+ }
+
+ function tokenizeEndOfLinkString(stream, state)
+ {
+ console.assert(state._linkQuoteCharacter !== undefined);
+ console.assert(state._linkBaseStyle);
+
+ // Eat the quote character to style it with the base style.
+ if (state._linkQuoteCharacter)
+ stream.eat(state._linkQuoteCharacter);
+
+ var style = state._linkBaseStyle;
+
+ // Clean up the state.
+ delete state._linkTokenize;
+ delete state._linkQuoteCharacter;
+ delete state._linkBaseStyle;
+
+ return style;
+ }
+
+ function extendedXMLToken(stream, state)
+ {
+ if (state._linkTokenize) {
+ // Call the link tokenizer instead.
+ var style = state._linkTokenize(stream, state);
+ return style && (style + " m-" + this.name);
+ }
+
+ // Remember the start position so we can rewind if needed.
+ var startPosition = stream.pos;
+ var style = this._token(stream, state);
+
+ if (style === "attribute") {
+ // Look for "href" or "src" attributes. If found then we should
+ // expect a string later that should get the "link" style instead.
+ var text = stream.current().toLowerCase();
+ if (text === "href" || text === "src")
+ state._expectLink = true;
+ else
+ delete state._expectLink;
+ } else if (state._expectLink && style === "string") {
+ delete state._expectLink;
+
+ // This is a link, so setup the state to process it next.
+ state._linkTokenize = tokenizeLinkString;
+ state._linkBaseStyle = style;
+
+ // The attribute may or may not be quoted.
+ var quote = stream.current()[0];
+ state._linkQuoteCharacter = quote === "'" || quote === "\"" ? quote : null;
+
+ // Rewind the steam to the start of this token.
+ stream.pos = startPosition;
+
+ // Eat the open quote of the string so the string style
+ // will be used for the quote character.
+ if (state._linkQuoteCharacter)
+ stream.eat(state._linkQuoteCharacter);
+ } else if (style) {
+ // We don't expect other tokens between attribute and string since
+ // spaces and the equal character are not tokenized. So if we get
+ // another token before a string then we stop expecting a link.
+ delete state._expectLink;
+ }
+
+ return style && (style + " m-" + this.name);
+ }
+
+ function tokenizeCSSURLString(stream, state)
+ {
+ console.assert(state._urlQuoteCharacter);
+
+ // If we are an unquoted url string, return whitespace blocks as a whitespace token (null).
+ if (state._unquotedURLString && stream.eatSpace())
+ return null;
+
+ var ch = null;
+ var escaped = false;
+ var reachedEndOfURL = false;
+ var lastNonWhitespace = stream.pos;
+ var quote = state._urlQuoteCharacter;
+
+ // Parse characters until the end of the stream/line or a proper end quote character.
+ while ((ch = stream.next()) != null) {
+ if (ch == quote && !escaped) {
+ reachedEndOfURL = true;
+ break;
+ }
+ escaped = !escaped && ch === "\\";
+ if (!/[\s\u00a0]/.test(ch))
+ lastNonWhitespace = stream.pos;
+ }
+
+ // If we are an unquoted url string, do not include trailing whitespace, rewind to the last real character.
+ if (state._unquotedURLString)
+ stream.pos = lastNonWhitespace;
+
+ // If we have reached the proper the end of the url string, switch to the end tokenizer to reset the state.
+ if (reachedEndOfURL) {
+ if (!state._unquotedURLString)
+ stream.backUp(1);
+ this._urlTokenize = tokenizeEndOfCSSURLString;
+ }
+
+ return "link";
+ }
+
+ function tokenizeEndOfCSSURLString(stream, state)
+ {
+ console.assert(state._urlQuoteCharacter);
+ console.assert(state._urlBaseStyle);
+
+ // Eat the quote character to style it with the base style.
+ if (!state._unquotedURLString)
+ stream.eat(state._urlQuoteCharacter);
+
+ var style = state._urlBaseStyle;
+
+ delete state._urlTokenize;
+ delete state._urlQuoteCharacter;
+ delete state._urlBaseStyle;
+
+ return style;
+ }
+
+ function extendedCSSToken(stream, state)
+ {
+ if (state._urlTokenize) {
+ // Call the link tokenizer instead.
+ var style = state._urlTokenize(stream, state);
+ return style && (style + " m-" + (this.alternateName || this.name));
+ }
+
+ // Remember the start position so we can rewind if needed.
+ var startPosition = stream.pos;
+ var style = this._token(stream, state);
+
+ if (style) {
+ if (style === "string-2" && stream.current() === "url") {
+ // If the current text is "url" then we should expect the next string token to be a link.
+ state._expectLink = true;
+ } else if (state._expectLink && style === "string") {
+ // We expected a string and got it. This is a link. Parse it the way we want it.
+ delete state._expectLink;
+
+ // This is a link, so setup the state to process it next.
+ state._urlTokenize = tokenizeCSSURLString;
+ state._urlBaseStyle = style;
+
+ // The url may or may not be quoted.
+ var quote = stream.current()[0];
+ state._urlQuoteCharacter = quote === "'" || quote === "\"" ? quote : ")";
+ state._unquotedURLString = state._urlQuoteCharacter === ")";
+
+ // Rewind the steam to the start of this token.
+ stream.pos = startPosition;
+
+ // Eat the open quote of the string so the string style
+ // will be used for the quote character.
+ if (!state._unquotedURLString)
+ stream.eat(state._urlQuoteCharacter);
+ } else if (state._expectLink) {
+ // We expected a string and didn't get one. Cleanup.
+ delete state._expectLink;
+ }
+ }
+
+ return style && (style + " m-" + (this.alternateName || this.name));
+ }
+
+ function extendedToken(stream, state)
+ {
+ // CodeMirror moves the original token function to _token when we extended it.
+ // So call it to get the style that we will add an additional class name to.
+ var style = this._token(stream, state);
+ return style && (style + " m-" + (this.alternateName || this.name));
+ }
+
+ function extendedCSSRuleStartState(base)
+ {
+ // CodeMirror moves the original token function to _startState when we extended it.
+ // So call it to get the original start state that we will modify.
+ var state = this._startState(base);
+
+ // Start the stack off like it has already parsed a rule. This causes everything
+ // after to be parsed as properties in a rule.
+ state.stack = ["rule"];
+
+ return state;
+ }
+
+ CodeMirror.extendMode("css", {token: extendedCSSToken});
+ CodeMirror.extendMode("xml", {token: extendedXMLToken});
+ CodeMirror.extendMode("javascript", {token: extendedToken});
+
+ CodeMirror.defineMode("css-rule", CodeMirror.modes.css);
+ CodeMirror.extendMode("css-rule", {token: extendedCSSToken, startState: extendedCSSRuleStartState, alternateName: "css"});
+
+ CodeMirror.defineExtension("hasLineClass", function(line, where, className) {
+ // This matches the arguments to addLineClass and removeLineClass.
+ var classProperty = (where === "text" ? "textClass" : (where == "background" ? "bgClass" : "wrapClass"));
+ var lineInfo = this.lineInfo(line);
+ if (!lineInfo)
+ return false;
+
+ if (!lineInfo[classProperty])
+ return false;
+
+ // Test for the simple case.
+ if (lineInfo[classProperty] === className)
+ return true;
+
+ // Do a quick check for the substring. This is faster than a regex, which requires escaping the input first.
+ var index = lineInfo[classProperty].indexOf(className);
+ if (index === -1)
+ return false;
+
+ // Check that it is surrounded by spaces. Add padding spaces first to work with beginning and end of string cases.
+ var paddedClass = " " + lineInfo[classProperty] + " ";
+ return paddedClass.indexOf(" " + className + " ", index) !== -1;
+ });
+
+ CodeMirror.defineExtension("setUniqueBookmark", function(position, options) {
+ var marks = this.findMarksAt(position);
+ for (var i = 0; i < marks.length; ++i) {
+ if (marks[i].__uniqueBookmark) {
+ marks[i].clear();
+ break;
+ }
+ }
+
+ var uniqueBookmark = this.setBookmark(position, options);
+ uniqueBookmark.__uniqueBookmark = true;
+ return uniqueBookmark;
+ });
+
+ CodeMirror.defineExtension("toggleLineClass", function(line, where, className) {
+ if (this.hasLineClass(line, where, className)) {
+ this.removeLineClass(line, where, className);
+ return false;
+ }
+
+ this.addLineClass(line, where, className);
+ return true;
+ });
+
+ CodeMirror.defineExtension("alterNumberInRange", function(amount, startPosition, endPosition, updateSelection) {
+ // We don't try if the range is multiline, pass to another key handler.
+ if (startPosition.line !== endPosition.line)
+ return false;
+
+ if (updateSelection) {
+ // Remember the cursor position/selection.
+ var selectionStart = this.getCursor("start");
+ var selectionEnd = this.getCursor("end");
+ }
+
+ var line = this.getLine(startPosition.line);
+
+ var foundPeriod = false;
+
+ var start = NaN;
+ var end = NaN;
+
+ for (var i = startPosition.ch; i >= 0; --i) {
+ var character = line.charAt(i);
+
+ if (character === ".") {
+ if (foundPeriod)
+ break;
+ foundPeriod = true;
+ } else if (character !== "-" && character !== "+" && isNaN(parseInt(character))) {
+ // Found the end already, just scan backwards.
+ if (i === startPosition.ch) {
+ end = i;
+ continue;
+ }
+
+ break;
+ }
+
+ start = i;
+ }
+
+ if (isNaN(end)) {
+ for (var i = startPosition.ch + 1; i < line.length; ++i) {
+ var character = line.charAt(i);
+
+ if (character === ".") {
+ if (foundPeriod) {
+ end = i;
+ break;
+ }
+
+ foundPeriod = true;
+ } else if (isNaN(parseInt(character))) {
+ end = i;
+ break;
+ }
+
+ end = i + 1;
+ }
+ }
+
+ // No number range found, pass to another key handler.
+ if (isNaN(start) || isNaN(end))
+ return false;
+
+ var number = parseFloat(line.substring(start, end));
+
+ // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns.
+ // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1.
+ var alteredNumber = Number((number + amount).toFixed(6));
+ var alteredNumberString = alteredNumber.toString();
+
+ var from = {line: startPosition.line, ch: start};
+ var to = {line: startPosition.line, ch: end};
+
+ this.replaceRange(alteredNumberString, from, to);
+
+ if (updateSelection) {
+ var previousLength = to.ch - from.ch;
+ var newLength = alteredNumberString.length;
+
+ // Fix up the selection so it follows the increase or decrease in the replacement length.
+ if (previousLength != newLength) {
+ if (selectionStart.line === from.line && selectionStart.ch > from.ch)
+ selectionStart.ch += newLength - previousLength;
+
+ if (selectionEnd.line === from.line && selectionEnd.ch > from.ch)
+ selectionEnd.ch += newLength - previousLength;
+ }
+
+ this.setSelection(selectionStart, selectionEnd);
+ }
+
+ return true;
+ });
+
+ function alterNumber(amount, codeMirror)
+ {
+ function findNumberToken(position)
+ {
+ // CodeMirror includes the unit in the number token, so searching for
+ // number tokens is the best way to get both the number and unit.
+ var token = codeMirror.getTokenAt(position);
+ if (token && token.type && /\bnumber\b/.test(token.type))
+ return token;
+ return null;
+ }
+
+ var position = codeMirror.getCursor("head");
+ var token = findNumberToken(position);
+
+ if (!token) {
+ // If the cursor is at the outside beginning of the token, the previous
+ // findNumberToken wont find it. So check the next column for a number too.
+ position.ch += 1;
+ token = findNumberToken(position);
+ }
+
+ if (!token)
+ return CodeMirror.Pass;
+
+ var foundNumber = codeMirror.alterNumberInRange(amount, {ch: token.start, line: position.line}, {ch: token.end, line: position.line}, true);
+ if (!foundNumber)
+ return CodeMirror.Pass;
+ }
+
+ CodeMirror.defineExtension("rectsForRange", function(range) {
+ var lineRects = [];
+
+ for (var line = range.start.line; line <= range.end.line; ++line) {
+ var lineContent = this.getLine(line);
+
+ var startChar = line === range.start.line ? range.start.ch : (lineContent.length - lineContent.trimLeft().length);
+ var endChar = line === range.end.line ? range.end.ch : lineContent.length;
+ var firstCharCoords = this.cursorCoords({ch: startChar, line: line});
+ var endCharCoords = this.cursorCoords({ch: endChar, line: line});
+
+ // Handle line wrapping.
+ if (firstCharCoords.bottom !== endCharCoords.bottom) {
+ var maxY = -Number.MAX_VALUE;
+ for (var ch = startChar; ch <= endChar; ++ch) {
+ var coords = this.cursorCoords({ch: ch, line: line});
+ if (coords.bottom > maxY) {
+ if (ch > startChar) {
+ var maxX = Math.ceil(this.cursorCoords({ch: ch - 1, line: line}).right);
+ lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
+ }
+ var minX = Math.floor(coords.left);
+ var minY = Math.floor(coords.top)
+ maxY = Math.ceil(coords.bottom);
+ }
+ }
+ maxX = Math.ceil(coords.right);
+ lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
+ } else {
+ var minX = Math.floor(firstCharCoords.left);
+ var minY = Math.floor(firstCharCoords.top);
+ var maxX = Math.ceil(endCharCoords.right);
+ var maxY = Math.ceil(endCharCoords.bottom);
+ lineRects.push(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
+ }
+ }
+ return lineRects;
+ });
+
+ CodeMirror.defineExtension("createColorMarkers", function(range, callback) {
+ var createdMarkers = [];
+
+ var start = range instanceof WebInspector.TextRange ? range.startLine : 0;
+ var end = range instanceof WebInspector.TextRange ? range.endLine + 1 : this.lineCount();
+
+ // Matches rgba(0, 0, 0, 0.5), rgb(0, 0, 0), hsl(), hsla(), #fff, #ffffff, white
+ const colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?![-.]))/g;
+
+ for (var lineNumber = start; lineNumber < end; ++lineNumber) {
+ var lineContent = this.getLine(lineNumber);
+ var match = colorRegex.exec(lineContent);
+ while (match) {
+
+ // Act as a negative look-behind and disallow the color from being prefixing with certain characters.
+ if (match.index > 0 && /[-.]/.test(lineContent[match.index - 1])) {
+ match = colorRegex.exec(lineContent);
+ continue;
+ }
+
+ var from = {line: lineNumber, ch: match.index};
+ var to = {line: lineNumber, ch: match.index + match[0].length};
+
+ var foundColorMarker = false;
+ var markers = this.findMarksAt(to);
+ for (var j = 0; j < markers.length; ++j) {
+ if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(markers[j]).type === WebInspector.TextMarker.Type.Color) {
+ foundColorMarker = true;
+ break;
+ }
+ }
+
+ if (foundColorMarker) {
+ match = colorRegex.exec(lineContent);
+ continue;
+ }
+
+ // We're not interested in text within a CSS selector.
+ var tokenType = this.getTokenTypeAt(from);
+ if (tokenType && (tokenType.indexOf("builtin") !== -1 || tokenType.indexOf("tag") !== -1)) {
+ match = colorRegex.exec(lineContent);
+ continue;
+ }
+
+ var colorString = match[0];
+ var color = WebInspector.Color.fromString(colorString);
+ if (!color) {
+ match = colorRegex.exec(lineContent);
+ continue;
+ }
+
+ var marker = this.markText(from, to);
+ marker = new WebInspector.TextMarker(marker, WebInspector.TextMarker.Type.Color);
+
+ createdMarkers.push(marker);
+
+ if (callback)
+ callback(marker, color, colorString);
+
+ match = colorRegex.exec(lineContent);
+ }
+ }
+
+ return createdMarkers;
+ });
+
+ CodeMirror.defineExtension("createGradientMarkers", function(range, callback) {
+ var createdMarkers = [];
+
+ var start = range instanceof WebInspector.TextRange ? range.startLine : 0;
+ var end = range instanceof WebInspector.TextRange ? range.endLine + 1 : this.lineCount();
+
+ const gradientRegex = /(repeating-)?(linear|radial)-gradient\s*\(\s*/g;
+
+ for (var lineNumber = start; lineNumber < end; ++lineNumber) {
+ var lineContent = this.getLine(lineNumber);
+ var match = gradientRegex.exec(lineContent);
+ while (match) {
+ var startLine = lineNumber;
+ var startChar = match.index;
+ var endChar = match.index + match[0].length;
+
+ var openParentheses = 0;
+ while (c = lineContent[endChar]) {
+ if (c === "(")
+ openParentheses++;
+ if (c === ")")
+ openParentheses--;
+
+ if (openParentheses === -1) {
+ endChar++;
+ break;
+ }
+
+ endChar++;
+ if (endChar >= lineContent.length) {
+ lineNumber++;
+ endChar = 0;
+ lineContent = this.getLine(lineNumber);
+ if (!lineContent)
+ break;
+ }
+ }
+
+ if (openParentheses !== -1) {
+ match = gradientRegex.exec(lineContent);
+ continue;
+ }
+
+ var from = {line: startLine, ch: startChar};
+ var to = {line: lineNumber, ch: endChar};
+
+ var gradientString = this.getRange(from, to);
+ var gradient = WebInspector.Gradient.fromString(gradientString);
+ if (!gradient) {
+ match = gradientRegex.exec(lineContent);
+ continue;
+ }
+
+ var marker = new WebInspector.TextMarker(this.markText(from, to), WebInspector.TextMarker.Type.Gradient);
+
+ createdMarkers.push(marker);
+
+ if (callback)
+ callback(marker, gradient, gradientString);
+
+ match = gradientRegex.exec(lineContent);
+ }
+ }
+
+ return createdMarkers;
+ });
+
+ function ignoreKey(codeMirror)
+ {
+ // Do nothing to ignore the key.
+ }
+
+ CodeMirror.keyMap["default"] = {
+ "Alt-Up": alterNumber.bind(null, 1),
+ "Ctrl-Alt-Up": alterNumber.bind(null, 0.1),
+ "Shift-Alt-Up": alterNumber.bind(null, 10),
+ "Alt-PageUp": alterNumber.bind(null, 10),
+ "Shift-Alt-PageUp": alterNumber.bind(null, 100),
+ "Alt-Down": alterNumber.bind(null, -1),
+ "Ctrl-Alt-Down": alterNumber.bind(null, -0.1),
+ "Shift-Alt-Down": alterNumber.bind(null, -10),
+ "Alt-PageDown": alterNumber.bind(null, -10),
+ "Shift-Alt-PageDown": alterNumber.bind(null, -100),
+ "Cmd-/": "toggleComment",
+ "Shift-Tab": ignoreKey,
+ fallthrough: "macDefault"
+ };
+
+ // Register some extra MIME-types for CodeMirror. These are in addition to the
+ // ones CodeMirror already registers, like text/html, text/javascript, etc.
+ const extraXMLTypes = ["text/xml", "text/xsl"];
+ extraXMLTypes.forEach(function(type) {
+ CodeMirror.defineMIME(type, "xml");
+ });
+
+ const extraHTMLTypes = ["application/xhtml+xml", "image/svg+xml"];
+ extraHTMLTypes.forEach(function(type) {
+ CodeMirror.defineMIME(type, "htmlmixed");
+ });
+
+ const extraJavaScriptTypes = ["text/ecmascript", "application/javascript", "application/ecmascript", "application/x-javascript",
+ "text/x-javascript", "text/javascript1.1", "text/javascript1.2", "text/javascript1.3", "text/jscript", "text/livescript"];
+ extraJavaScriptTypes.forEach(function(type) {
+ CodeMirror.defineMIME(type, "javascript");
+ });
+
+ const extraJSONTypes = ["application/x-json", "text/x-json"];
+ extraJSONTypes.forEach(function(type) {
+ CodeMirror.defineMIME(type, {name: "javascript", json: true});
+ });
+
+})();
+
+WebInspector.compareCodeMirrorPositions = function(a, b)
+{
+ var lineCompare = a.line - b.line;
+ if (lineCompare !== 0)
+ return lineCompare;
+
+ var aColumn = "ch" in a ? a.ch : Number.MAX_VALUE;
+ var bColumn = "ch" in b ? b.ch : Number.MAX_VALUE;
+ return aColumn - bColumn;
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorFormattersjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorFormattersjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorFormatters.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,403 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+// In the inspector token types have been modified to include extra mode information
+// after the actual token type. So we can't do token === "foo". So instead we do
+// /\bfoo\b/.test(token).
+
+CodeMirror.extendMode("javascript", {
+ shouldHaveSpaceBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!token) {
+ if (content === "(") // Most keywords like "if (" but not "function(" or "typeof(".
+ return lastToken && /\bkeyword\b/.test(lastToken) && (lastContent !== "function" && lastContent !== "typeof" && lastContent !== "instanceof");
+ if (content === ":") // Ternary.
+ return (state.lexical.type === "stat" || state.lexical.type === ")");
+ if (content === "!") // Unary ! should not be confused with "!=".
+ return false;
+ return "+-/*&&||!===+=-=>=<=?".indexOf(content) >= 0; // Operators.
+ }
+
+ if (isComment)
+ return true;
+
+ if (/\bkeyword\b/.test(token)) { // Most keywords require spaces before them, unless a '}' can come before it.
+ if (content === "else" || content === "catch" || content === "finally")
+ return lastContent === "}";
+ return false;
+ }
+
+ return false;
+ },
+
+ shouldHaveSpaceAfterLastToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (lastToken && /\bkeyword\b/.test(lastToken)) { // Most keywords require spaces after them, unless a '{' or ';' can come after it.
+ if (lastContent === "else")
+ return true;
+ if (lastContent === "catch")
+ return true;
+ if (lastContent === "return")
+ return content !== ";";
+ if (lastContent === "throw")
+ return true;
+ if (lastContent === "try")
+ return true;
+ if (lastContent === "finally")
+ return true;
+ if (lastContent === "do")
+ return true;
+ return false;
+ }
+
+ if (lastToken && /\bcomment\b/.test(lastToken)) // Embedded /* comment */.
+ return true;
+ if (lastContent === ")") // "){".
+ return content === "{";
+ if (lastContent === ";") // In for loop.
+ return state.lexical.type === ")";
+ if (lastContent === "!") // Unary ! should not be confused with "!=".
+ return false;
+
+ return ",+-/*&&||:!===+=-=>=<=?".indexOf(lastContent) >= 0; // Operators.
+ },
+
+ newlinesAfterToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!token) {
+ if (content === ",") // In object literals, like in {a:1,b:2}, but not in param lists or vardef lists.
+ return state.lexical.type === "}" ? 1 : 0;
+ if (content === ";") // Everywhere except in for loop conditions.
+ return state.lexical.type !== ")" ? 1 : 0;
+ if (content === ":" && state.lexical.type === "}" && state.lexical.prev && state.lexical.prev.type === "form") // Switch case/default.
+ return 1;
+ return content.length === 1 && "{}".indexOf(content) >= 0 ? 1 : 0; // After braces.
+ }
+
+ if (isComment)
+ return 1;
+
+ return 0;
+ },
+
+ removeLastNewline: function(lastToken, lastContent, token, state, content, isComment, firstTokenOnLine)
+ {
+ if (!token) {
+ if (content === "}") // "{}".
+ return lastContent === "{";
+ if (content === ";") // "x = {};" or ";;".
+ return "};".indexOf(lastContent) >= 0;
+ if (content === ":") // Ternary.
+ return lastContent === "}" && (state.lexical.type === "stat" || state.lexical.type === ")");
+ if (",().".indexOf(content) >= 0) // "})", "}.bind", "function() { ... }()", or "}, false)".
+ return lastContent === "}";
+ return false;
+ }
+
+ if (isComment) { // Comment after semicolon.
+ if (!firstTokenOnLine && lastContent === ";")
+ return true;
+ return false;
+ }
+
+ if (/\bkeyword\b/.test(token)) {
+ if (content === "else" || content === "catch" || content === "finally") // "} else", "} catch", "} finally"
+ return lastContent === "}";
+ return false;
+ }
+
+ return false;
+ },
+
+ indentAfterToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ return content === "{" || content === "case" || content === "default";
+ },
+
+ newlineBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (state._jsPrettyPrint.shouldIndent)
+ return true;
+
+ return content === "}" && lastContent !== "{"; // "{}"
+ },
+
+ indentBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (state._jsPrettyPrint.shouldIndent)
+ return true;
+
+ return false;
+ },
+
+ dedentsBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ var dedent = 0;
+
+ if (state._jsPrettyPrint.shouldDedent)
+ dedent += state._jsPrettyPrint.dedentSize;
+
+ if (!token && content === "}")
+ dedent += 1;
+ else if (token && /\bkeyword\b/.test(token) && (content === "case" || content === "default"))
+ dedent += 1;
+
+ return dedent;
+ },
+
+ modifyStateForTokenPre: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!state._jsPrettyPrint) {
+ state._jsPrettyPrint = {
+ indentCount: 0, // How far have we indented because of single statement blocks.
+ shouldIndent: false, // Signal we should indent on entering a single statement block.
+ shouldDedent: false, // Signal we should dedent on leaving a single statement block.
+ dedentSize: 0, // How far we should dedent when leaving a single statement block.
+ lastIfIndentCount: 0, // Keep track of the indent the last time we saw an if without braces.
+ openBraceStartMarkers: [], // Keep track of non-single statement blocks.
+ openBraceTrackingCount: -1, // Keep track of "{" and "}" in non-single statement blocks.
+ };
+ }
+
+ // - Entering:
+ // - Preconditions:
+ // - last lexical was a "form" we haven't encountered before
+ // - last content was ")", "else", or "do"
+ // - current lexical is not ")" (in an expression or condition)
+ // - Cases:
+ // 1. "{"
+ // - indent +0
+ // - save this indent size so when we encounter the "}" we know how far to dedent
+ // 2. "else if"
+ // - indent +0 and do not signal to add a newline and indent
+ // - mark the last if location so when we encounter an "else" we know how far to dedent
+ // - mark the lexical state so we know we are inside a single statement block
+ // 3. Token without brace.
+ // - indent +1 and signal to add a newline and indent
+ // - mark the last if location so when we encounter an "else" we know how far to dedent
+ // - mark the lexical state so we know we are inside a single statement block
+ if (!isComment && state.lexical.prev && state.lexical.prev.type === "form" && !state.lexical.prev._jsPrettyPrintMarker && (lastContent === ")" || lastContent === "else" || lastContent === "do") && (state.lexical.type !== ")")) {
+ if (content === "{") {
+ // Save the state at the opening brace so we can return to it when we see "}".
+ var savedState = {indentCount:state._jsPrettyPrint.indentCount, openBraceTrackingCount:state._jsPrettyPrint.openBraceTrackingCount};
+ state._jsPrettyPrint.openBraceStartMarkers.push(savedState);
+ state._jsPrettyPrint.openBraceTrackingCount = 1;
+ } else if (state.lexical.type !== "}") {
+ // Increase the indent count. Signal for a newline and indent if needed.
+ if (!(lastContent === "else" && content === "if")) {
+ state._jsPrettyPrint.indentCount++;
+ state._jsPrettyPrint.shouldIndent = true;
+ }
+ state.lexical.prev._jsPrettyPrintMarker = true;
+ if (state._jsPrettyPrint.enteringIf)
+ state._jsPrettyPrint.lastIfIndentCount = state._jsPrettyPrint.indentCount - 1;
+ }
+ }
+
+ // - Leaving:
+ // - Preconditions:
+ // - we must be indented
+ // - ignore ";", wait for the next token instead.
+ // - Cases:
+ // 1. "else"
+ // - dedent to the last "if"
+ // 2. "}" and all braces we saw are balanced
+ // - dedent to the last "{"
+ // 3. Token without a marker on the stack
+ // - dedent all the way
+ else if (state._jsPrettyPrint.indentCount) {
+ console.assert(!state._jsPrettyPrint.shouldDedent);
+ console.assert(!state._jsPrettyPrint.dedentSize);
+
+ // Track "{" and "}" to know when the "}" is really closing a block.
+ if (!isComment) {
+ if (content === "{")
+ state._jsPrettyPrint.openBraceTrackingCount++;
+ else if (content === "}")
+ state._jsPrettyPrint.openBraceTrackingCount--;
+ }
+
+ if (content === ";") {
+ // Ignore.
+ } else if (content === "else") {
+ // Dedent to the last "if".
+ if (lastContent !== "}") {
+ state._jsPrettyPrint.shouldDedent = true;
+ state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount - state._jsPrettyPrint.lastIfIndentCount;
+ state._jsPrettyPrint.lastIfIndentCount = 0;
+ }
+ } else if (content === "}" && !state._jsPrettyPrint.openBraceTrackingCount && state._jsPrettyPrint.openBraceStartMarkers.length) {
+ // Dedent to the last "{".
+ var savedState = state._jsPrettyPrint.openBraceStartMarkers.pop();
+ state._jsPrettyPrint.shouldDedent = true;
+ state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount - savedState.indentCount;
+ state._jsPrettyPrint.openBraceTrackingCount = savedState.openBraceTrackingCount;
+ } else {
+ // Dedent all the way.
+ var shouldDedent = true;
+ var lexical = state.lexical.prev;
+ while (lexical) {
+ if (lexical._jsPrettyPrintMarker) {
+ shouldDedent = false;
+ break;
+ }
+ lexical = lexical.prev;
+ }
+ if (shouldDedent) {
+ state._jsPrettyPrint.shouldDedent = true;
+ state._jsPrettyPrint.dedentSize = state._jsPrettyPrint.indentCount;
+ }
+ }
+ }
+
+ // Signal for when we will be entering an if.
+ if (token && state.lexical.type === "form" && state.lexical.prev && state.lexical.prev !== "form" && /\bkeyword\b/.test(token))
+ state._jsPrettyPrint.enteringIf = (content === "if");
+ },
+
+ modifyStateForTokenPost: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (state._jsPrettyPrint.shouldIndent)
+ state._jsPrettyPrint.shouldIndent = false;
+
+ if (state._jsPrettyPrint.shouldDedent) {
+ state._jsPrettyPrint.indentCount -= state._jsPrettyPrint.dedentSize;
+ state._jsPrettyPrint.dedentSize = 0;
+ state._jsPrettyPrint.shouldDedent = false;
+ }
+ }
+});
+
+CodeMirror.extendMode("css", {
+ shouldHaveSpaceBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!token) {
+ if (content === "{")
+ return true;
+ return false;
+ }
+
+ if (isComment)
+ return true;
+
+ if (/\bkeyword\b/.test(token)) {
+ if (content.charAt(0) === "!") // "!important".
+ return true;
+ return false;
+ }
+
+ return false;
+ },
+
+ shouldHaveSpaceAfterLastToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!lastToken) {
+ if (lastContent === ",")
+ return true;
+ return false;
+ }
+
+ if (/\boperator\b/.test(lastToken)) {
+ if (lastContent === ":") // Space in "prop: value" but not in a selectors "a:link" or "div::after" or media queries "(max-device-width:480px)".
+ return state.stack.lastValue === "propertyValue";
+ return false;
+ }
+
+ if (/\bcomment\b/.test(lastToken))
+ return true;
+
+ return false;
+ },
+
+ newlinesAfterToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!token) {
+ if (content === ";")
+ return 1;
+ if (content === ",") { // "a,b,c,...,z{}" rule list at top level or in @media top level and only if the line length will be large.
+ if ((!state.stack.length || state.stack.lastValue === "@media{") && state._cssPrettyPrint.lineLength > 60) {
+ state._cssPrettyPrint.lineLength = 0;
+ return 1;
+ }
+ return 0;
+ }
+ if (content === "{")
+ return 1;
+ if (content === "}") // 2 newlines between rule declarations.
+ return 2;
+ return 0;
+ }
+
+ if (isComment)
+ return 1;
+
+ return 0;
+ },
+
+ removeLastNewline: function(lastToken, lastContent, token, state, content, isComment, firstTokenOnLine)
+ {
+ if (isComment) { // Comment after semicolon.
+ if (!firstTokenOnLine && lastContent === ";")
+ return true;
+ return false;
+ }
+
+ return content === "}" && (lastContent === "{" || lastContent === "}"); // "{}" and "}\n}" when closing @media.
+ },
+
+ indentAfterToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ return content === "{";
+ },
+
+ newlineBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ return content === "}" && (lastContent !== "{" && lastContent !== "}"); // "{}" and "}\n}" when closing @media.
+ },
+
+ indentBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ return false;
+ },
+
+ dedentsBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ return content === "}" ? 1 : 0;
+ },
+
+ modifyStateForTokenPost: function(lastToken, lastContent, token, state, content, isComment)
+ {
+ if (!state._cssPrettyPrint)
+ state._cssPrettyPrint = {lineLength: 0};
+
+ // In order insert newlines in selector lists we need keep track of the length of the current line.
+ // This isn't exact line length, only the builder knows that, but it is good enough to get an idea.
+ // If we are at a top level, keep track of the current line length, otherwise we reset to 0.
+ if (!state.stack.length || state.stack.lastValue === "@media{")
+ state._cssPrettyPrint.lineLength += content.length;
+ else
+ state._cssPrettyPrint.lineLength = 0;
+ }
+});
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorOverridescssfromrev164541trunkSourceWebInspectorUIUserInterfaceCodeMirrorOverridescss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorOverrides.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorOverrides.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorOverrides.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorOverrides.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.CodeMirror {
+ z-index: 0;
+}
+
+.CodeMirror,
+.CodeMirror * {
+ box-sizing: content-box;
+}
+
+.CodeMirror .CodeMirror-lines {
+ /* One pixel bottom padding needed to show the bottom border for matching brackets and search matches. */
+ padding: 0 0 1px 0;
+}
+
+.CodeMirror pre {
+ padding: 1px 3px 1px 7px;
+}
+
+.CodeMirror .CodeMirror-selected {
+ background-color: rgb(212, 212, 212);
+}
+
+.CodeMirror.CodeMirror-focused .CodeMirror-selected {
+ background-color: highlight;
+}
+
+.CodeMirror .CodeMirror-cursor {
+ pointer-events: none;
+}
+
+.CodeMirror .CodeMirror-lines .CodeMirror-matchingbracket {
+ color: inherit;
+ background-color: rgba(100, 130, 235, 0.2);
+ border-bottom: 1px dotted rgb(20, 20, 235);
+}
+
+.CodeMirror .CodeMirror-lines .CodeMirror-nonmatchingbracket {
+ color: inherit;
+ background-color: rgba(235, 30, 20, 0.2);
+ border-bottom: 1px dotted rgb(235, 30, 20);
+}
+
+.CodeMirror .CodeMirror-gutters {
+ background-color: rgb(247, 247, 247);
+ border-right: 1px solid rgb(231, 231, 231);
+}
+
+.CodeMirror .CodeMirror-linenumber {
+ padding: 0 2px;
+ min-width: 21px;
+
+ color: rgb(146, 146, 146);
+
+ font-size: 9px;
+ line-height: 13px;
+ font-family: "Lucida Grande", sans-serif;
+ text-align: right;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsColorPickercssfromrev164541trunkSourceWebInspectorUIUserInterfaceColorPickercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ColorPicker.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.color-picker {
+ position: relative;
+ width: 256px;
+ height: 210px;
+ padding: 5px;
+}
+
+.color-picker > * {
+ position: absolute;
+}
+
+.color-picker > .slider {
+ top: 7px;
+ width: 196px;
+ -webkit-transform: rotate(-90deg) translateX(-100%);
+ -webkit-transform-origin: 0 0;
+}
+
+.color-picker > .brightness {
+ left: 215px;
+}
+
+.color-picker > .opacity {
+ left: 238px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsColorPickerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceColorPickerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ColorPicker.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,157 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ColorPicker = function()
+{
+ WebInspector.Object.call(this);
+
+ this._colorWheel = new WebInspector.ColorWheel();
+ this._colorWheel.delegate = this;
+ this._colorWheel.dimension = 200;
+
+ this._brightnessSlider = new WebInspector.Slider();
+ this._brightnessSlider.delegate = this;
+ this._brightnessSlider.element.classList.add("brightness");
+
+ this._opacitySlider = new WebInspector.Slider();
+ this._opacitySlider.delegate = this;
+ this._opacitySlider.element.classList.add("opacity");
+
+ this._element = document.createElement("div");
+ this._element.className = "color-picker";
+
+ this._element.appendChild(this._colorWheel.element);
+ this._element.appendChild(this._brightnessSlider.element);
+ this._element.appendChild(this._opacitySlider.element);
+
+ this._opacity = 0;
+ this._opacityPattern = "url(Images/Checkers.svg)";
+
+ this._color = "white";
+};
+
+WebInspector.ColorPicker.Event = {
+ ColorChanged: "css-color-picker-color-changed"
+};
+
+WebInspector.ColorPicker.prototype = {
+ contructor: WebInspector.ColorPicker,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ set brightness(brightness)
+ {
+ if (brightness === this._brightness)
+ return;
+
+ this._colorWheel.brightness = brightness;
+
+ this._updateColor();
+ this._updateSliders(this._colorWheel.rawColor, this._colorWheel.tintedColor);
+ },
+
+ set opacity(opacity)
+ {
+ if (opacity === this._opacity)
+ return;
+
+ this._opacity = opacity;
+ this._updateColor();
+ },
+
+ get colorWheel()
+ {
+ return this._colorWheel;
+ },
+
+ get color()
+ {
+ return this._color;
+ },
+
+ set color(color)
+ {
+ this._dontUpdateColor = true;
+
+ this._colorFormat = color.format;
+
+ this._colorWheel.tintedColor = color;
+ this._brightnessSlider.value = this._colorWheel.brightness;
+
+ this._opacitySlider.value = color.alpha;
+ this._updateSliders(this._colorWheel.rawColor, color);
+
+ delete this._dontUpdateColor;
+ },
+
+ colorWheelColorDidChange: function(colorWheel)
+ {
+ this._updateColor();
+ this._updateSliders(this._colorWheel.rawColor, this._colorWheel.tintedColor);
+ },
+
+ sliderValueDidChange: function(slider, value)
+ {
+ if (slider === this._opacitySlider)
+ this.opacity = value;
+ else if (slider === this._brightnessSlider)
+ this.brightness = value;
+ },
+
+ // Private
+
+ _updateColor: function()
+ {
+ if (this._dontUpdateColor)
+ return;
+
+ var opacity = Math.round(this._opacity * 100) / 100;
+
+ var components;
+ if (this._colorFormat === WebInspector.Color.Format.HSL || this._colorFormat === WebInspector.Color.Format.HSLA)
+ components = this._colorWheel.tintedColor.hsl.concat(opacity);
+ else
+ components = this._colorWheel.tintedColor.rgb.concat(opacity);
+
+ this._color = new WebInspector.Color(this._colorFormat, components);
+ this.dispatchEventToListeners(WebInspector.ColorPicker.Event.ColorChanged, {color: this._color});
+ },
+
+ _updateSliders: function(rawColor, tintedColor)
+ {
+ var rgb = this._colorWheel.tintedColor.rgb;
+ var opaque = new WebInspector.Color(WebInspector.Color.Format.RGBA, rgb.concat(1)).toString();
+ var transparent = new WebInspector.Color(WebInspector.Color.Format.RGBA, rgb.concat(0)).toString();
+
+ this._opacitySlider.element.style.backgroundImage = "linear-gradient(90deg, " + transparent + ", " + opaque + "), " + this._opacityPattern;
+ this._brightnessSlider.element.style.backgroundImage = "linear-gradient(90deg, black, " + rawColor + ")";
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsColorWheelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceColorWheelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ColorWheel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.color-wheel {
+ position: relative;
+}
+
+.color-wheel > .crosshair {
+ position: absolute;
+ top: -4px;
+ left: -3px;
+ width: 5px;
+ height: 5px;
+ border: 1px solid black;
+ border-radius: 3px;
+ pointer-events: none;
+ background-color: white;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsColorWheeljsfromrev164541trunkSourceWebInspectorUIUserInterfaceColorWheeljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ColorWheel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ColorWheel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,285 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ColorWheel = function()
+{
+ WebInspector.Object.call(this);
+
+ this._rawCanvas = document.createElement("canvas");
+ this._tintedCanvas = document.createElement("canvas");
+ this._finalCanvas = document.createElement("canvas");
+
+ this._crosshair = document.createElement("div");
+ this._crosshair.className = "crosshair";
+
+ this._element = document.createElement("div");
+ this._element.className = "color-wheel";
+
+ this._element.appendChild(this._finalCanvas);
+ this._element.appendChild(this._crosshair);
+
+ this._finalCanvas.addEventListener("mousedown", this);
+}
+
+WebInspector.ColorWheel.prototype = {
+ contructor: WebInspector.ColorWheel,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ set dimension(dimension)
+ {
+ this._finalCanvas.width = this._tintedCanvas.width = this._rawCanvas.width = dimension * window.devicePixelRatio;
+ this._finalCanvas.height = this._tintedCanvas.height = this._rawCanvas.height = dimension * window.devicePixelRatio;
+
+ this._finalCanvas.style.width = this._finalCanvas.style.height = dimension + "px";
+
+ this._dimension = dimension;
+ // We shrink the radius a bit for better anti-aliasing.
+ this._radius = dimension / 2 - 2;
+
+ this._setCrosshairPosition(new WebInspector.Point(dimension / 2, dimension / 2));
+
+ this._drawRawCanvas();
+ this._draw();
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get brightness()
+ {
+ return this._brightness;
+ },
+
+ set brightness(brightness)
+ {
+ this._brightness = brightness;
+ this._draw();
+ },
+
+ get tintedColor()
+ {
+ if (this._crosshairPosition)
+ return this._colorAtPointWithBrightness(this._crosshairPosition.x * window.devicePixelRatio, this._crosshairPosition.y * window.devicePixelRatio, this._brightness);
+
+ return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
+ },
+
+ set tintedColor(tintedColor)
+ {
+ var data = this._tintedColorToPointAndBrightness(tintedColor);
+ this._setCrosshairPosition(data.point);
+ this.brightness = data.brightness;
+ },
+
+ get rawColor()
+ {
+ if (this._crosshairPosition)
+ return this._colorAtPointWithBrightness(this._crosshairPosition.x * window.devicePixelRatio, this._crosshairPosition.y * window.devicePixelRatio, 1);
+
+ return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mousedown":
+ this._handleMousedown(event);
+ break;
+ case "mousemove":
+ this._handleMousemove(event);
+ break;
+ case "mouseup":
+ this._handleMouseup(event);
+ break;
+ }
+ },
+
+ // Private
+
+ _handleMousedown: function(event)
+ {
+ window.addEventListener("mousemove", this, true);
+ window.addEventListener("mouseup", this, true);
+
+ this._updateColorForMouseEvent(event);
+ },
+
+ _handleMousemove: function(event)
+ {
+ this._updateColorForMouseEvent(event);
+ },
+
+ _handleMouseup: function(event)
+ {
+ window.removeEventListener("mousemove", this, true);
+ window.removeEventListener("mouseup", this, true);
+ },
+
+ _pointInCircleForEvent: function(event)
+ {
+ function distance(a, b)
+ {
+ return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
+ }
+
+ function angleFromCenterToPoint(center, point)
+ {
+ return Math.atan2(point.y - center.y, point.x - center.x);
+ }
+
+ function pointOnCircumference(c, r, a)
+ {
+ return new WebInspector.Point(c.x + r * Math.cos(a), c.y + r * Math.sin(a));
+ }
+
+ var dimension = this._dimension;
+ var point = window.webkitConvertPointFromPageToNode(this._finalCanvas, new WebKitPoint(event.pageX, event.pageY));
+ var center = new WebInspector.Point(dimension / 2, dimension / 2);
+ if (distance(point, center) > this._radius) {
+ var angle = angleFromCenterToPoint(center, point);
+ point = pointOnCircumference(center, this._radius, angle);
+ }
+ return point;
+ },
+
+ _updateColorForMouseEvent: function(event)
+ {
+ var point = this._pointInCircleForEvent(event);
+
+ this._setCrosshairPosition(point);
+
+ if (this.delegate && typeof this.delegate.colorWheelColorDidChange === "function")
+ this.delegate.colorWheelColorDidChange(this);
+ },
+
+ _setCrosshairPosition: function(point)
+ {
+ this._crosshairPosition = point;
+ this._crosshair.style.webkitTransform = "translate(" + Math.round(point.x) + "px, " + Math.round(point.y) + "px)";
+ },
+
+ _tintedColorToPointAndBrightness: function(color)
+ {
+ var rgb = color.rgb;
+ var hsv = WebInspector.Color.rgb2hsv(rgb[0], rgb[1], rgb[2]);
+ var cosHue = Math.cos(hsv[0] * Math.PI / 180);
+ var sinHue = Math.sin(hsv[0] * Math.PI / 180);
+ var center = this._dimension / 2;
+ var x = center + (center * cosHue * hsv[1]);
+ var y = center - (center * sinHue * hsv[1]);
+ return {
+ point: new WebInspector.Point(x, y),
+ brightness: hsv[2]
+ };
+ },
+
+ _drawRawCanvas: function() {
+ var ctx = this._rawCanvas.getContext("2d");
+
+ var dimension = this._dimension * window.devicePixelRatio;
+ var center = dimension / 2;
+
+ ctx.fillStyle = "white";
+ ctx.fillRect(0, 0, dimension, dimension);
+
+ var imageData = ctx.getImageData(0, 0, dimension, dimension);
+ var data = imageData.data;
+ for (var j = 0; j < dimension; ++j) {
+ for (var i = 0; i < dimension; ++i) {
+ var color = this._colorAtPointWithBrightness(i, j, 1);
+ if (!color)
+ continue;
+ var pos = (j * dimension + i) * 4;
+ data[pos] = color.rgb[0];
+ data[pos + 1] = color.rgb[1];
+ data[pos + 2] = color.rgb[2];
+ }
+ }
+ ctx.putImageData(imageData, 0, 0);
+ },
+
+ _colorAtPointWithBrightness: function(x, y, brightness)
+ {
+ var center = this._dimension / 2 * window.devicePixelRatio;
+ var xDis = x - center;
+ var yDis = y - center;
+ var distance = Math.sqrt(xDis * xDis + yDis * yDis);
+
+ if (distance - center > 0.001)
+ return new WebInspector.Color(WebInspector.Color.Format.RGBA, [0, 0, 0, 0]);
+
+ var h = Math.atan2(y - center, center - x) * 180 / Math.PI;
+ h = (h + 180) % 360;
+ var v = brightness;
+ var s = Math.max(0, distance) / center;
+
+ var rgb = WebInspector.Color.hsv2rgb(h, s, v);
+ return new WebInspector.Color(WebInspector.Color.Format.RGBA, [
+ Math.round(rgb[0] * 255),
+ Math.round(rgb[1] * 255),
+ Math.round(rgb[2] * 255),
+ 1
+ ]);
+ },
+
+ _drawTintedCanvas: function()
+ {
+ var ctx = this._tintedCanvas.getContext("2d");
+ var dimension = this._dimension * window.devicePixelRatio;
+
+ ctx.save();
+ ctx.drawImage(this._rawCanvas, 0, 0, dimension, dimension);
+ if (this._brightness !== 1) {
+ ctx.globalAlpha = 1 - this._brightness;
+ ctx.fillStyle = "black";
+ ctx.fillRect(0, 0, dimension, dimension);
+ }
+ ctx.restore();
+ },
+
+ _draw: function()
+ {
+ this._drawTintedCanvas();
+
+ var ctx = this._finalCanvas.getContext("2d");
+ var dimension = this._dimension * window.devicePixelRatio;
+ var radius = this._radius * window.devicePixelRatio;
+
+ ctx.save();
+ ctx.clearRect(0, 0, dimension, dimension);
+ ctx.beginPath();
+ ctx.arc(dimension / 2, dimension / 2, radius + 1, 0, Math.PI * 2, true);
+ ctx.closePath();
+ ctx.clip();
+ ctx.drawImage(this._tintedCanvas, 0, 0, dimension, dimension);
+ ctx.restore();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.completion-suggestions {
+ position: absolute;
+ display: block;
+
+ background-color: rgba(255, 255, 255, 0.9);
+ border-radius: 5px;
+
+ z-index: 100;
+
+ margin-top: -1px;
+ margin-left: -10px;
+
+ box-shadow: rgba(0, 0, 0, 0.25) 0 5px 10px, rgba(0, 0, 0, 0.15) 0 0 0 1px;
+}
+
+.completion-suggestions > .completion-suggestions-container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ overflow-x: hidden;
+ overflow-y: auto;
+
+ border-radius: 5px;
+}
+
+.completion-suggestions-container > .item {
+ padding: 1px 10px;
+ margin: 0;
+
+ font-size: 11px;
+ font-family: Menlo, monospace;
+
+ line-height: 16px;
+ height: 16px;
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ color: black;
+}
+
+.completion-suggestions-container:not(:active) > .item.selected,
+.completion-suggestions-container > .item:active {
+ box-shadow: inset rgb(87, 152, 206) 0 1px 0;
+ background: -webkit-linear-gradient(top, rgb(110, 167, 216), rgb(36, 114, 181));
+
+ color: white;
+ text-shadow: rgb(51, 88, 123) 0 1px 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCompletionSuggestionsViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCompletionSuggestionsViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CompletionSuggestionsView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,228 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CompletionSuggestionsView = function(delegate)
+{
+ WebInspector.Object.call(this);
+
+ this._delegate = delegate || null;
+
+ this._selectedIndex = NaN;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.CompletionSuggestionsView.StyleClassName;
+
+ this._containerElement = document.createElement("div");
+ this._containerElement.className = WebInspector.CompletionSuggestionsView.ContainerElementStyleClassName;
+ this._containerElement.addEventListener("mousedown", this._mouseDown.bind(this));
+ this._containerElement.addEventListener("mouseup", this._mouseUp.bind(this));
+ this._containerElement.addEventListener("click", this._itemClicked.bind(this));
+ this._element.appendChild(this._containerElement);
+};
+
+WebInspector.CompletionSuggestionsView.StyleClassName = "completion-suggestions";
+WebInspector.CompletionSuggestionsView.ContainerElementStyleClassName = "completion-suggestions-container";
+WebInspector.CompletionSuggestionsView.ItemElementStyleClassName = "item";
+WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName = "selected";
+
+WebInspector.CompletionSuggestionsView.prototype = {
+ constructor: WebInspector.CompletionSuggestionsView,
+
+ // Public
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ get visible()
+ {
+ return !!this._element.parentNode;
+ },
+
+ get selectedIndex()
+ {
+ return this._selectedIndex;
+ },
+
+ set selectedIndex(index)
+ {
+ var selectedItemElement = this._selectedItemElement;
+ if (selectedItemElement)
+ selectedItemElement.classList.remove(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
+
+ this._selectedIndex = index;
+
+ selectedItemElement = this._selectedItemElement;
+ if (!selectedItemElement)
+ return;
+
+ selectedItemElement.classList.add(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
+ selectedItemElement.scrollIntoViewIfNeeded(false);
+ },
+
+ selectNext: function()
+ {
+ var count = this._containerElement.children.length;
+
+ if (isNaN(this._selectedIndex) || this._selectedIndex === count - 1)
+ this.selectedIndex = 0;
+ else
+ ++this.selectedIndex;
+
+ var selectedItemElement = this._selectedItemElement;
+ if (selectedItemElement && this._delegate && typeof this._delegate.completionSuggestionsSelectedCompletion === "function")
+ this._delegate.completionSuggestionsSelectedCompletion(this, selectedItemElement.textContent);
+ },
+
+ selectPrevious: function()
+ {
+ if (isNaN(this._selectedIndex) || this._selectedIndex === 0)
+ this.selectedIndex = this._containerElement.children.length - 1;
+ else
+ --this.selectedIndex;
+
+ var selectedItemElement = this._selectedItemElement;
+ if (selectedItemElement && this._delegate && typeof this._delegate.completionSuggestionsSelectedCompletion === "function")
+ this._delegate.completionSuggestionsSelectedCompletion(this, selectedItemElement.textContent);
+ },
+
+ isHandlingClickEvent: function()
+ {
+ return this._mouseIsDown;
+ },
+
+ show: function(anchorBounds)
+ {
+ // Measure the container so we can know the intrinsic size of the items.
+ this._containerElement.style.position = "absolute";
+ document.body.appendChild(this._containerElement);
+
+ var containerWidth = this._containerElement.offsetWidth;
+ var containerHeight = this._containerElement.offsetHeight;
+
+ this._containerElement.removeAttribute("style");
+ this._element.appendChild(this._containerElement);
+
+ // Lay out the suggest-box relative to the anchorBounds.
+ const margin = 10;
+ const horizontalPadding = 22;
+ const absoluteMaximumHeight = 160;
+
+ var x = anchorBounds.origin.x;
+ var y = anchorBounds.origin.y + anchorBounds.size.height;
+
+ var maximumWidth = window.innerWidth - anchorBounds.origin.x - margin;
+ var width = Math.min(containerWidth, maximumWidth - horizontalPadding) + horizontalPadding;
+ var paddedWidth = containerWidth + horizontalPadding;
+
+ if (width < paddedWidth) {
+ // Shift the suggest box to the left to accommodate the content without trimming to the BODY edge.
+ maximumWidth = window.innerWidth - margin;
+ width = Math.min(containerWidth, maximumWidth - horizontalPadding) + horizontalPadding;
+ x = document.body.offsetWidth - width;
+ }
+
+ var aboveHeight = anchorBounds.origin.y;
+ var underHeight = window.innerHeight - anchorBounds.origin.y - anchorBounds.size.height;
+ var maximumHeight = Math.min(absoluteMaximumHeight, Math.max(underHeight, aboveHeight) - margin);
+ var height = Math.min(containerHeight, maximumHeight);
+
+ // Position the suggestions below the anchor. If there is no room, position the suggestions above.
+ if (underHeight - height < 0)
+ y = aboveHeight - height;
+
+ this._element.style.left = x + "px";
+ this._element.style.top = y + "px";
+ this._element.style.width = width + "px";
+ this._element.style.height = height + "px";
+
+ document.body.appendChild(this._element);
+ },
+
+ hide: function()
+ {
+ this._element.remove();
+ },
+
+ update: function(completions, selectedIndex)
+ {
+ this._containerElement.removeChildren();
+
+ if (typeof selectedIndex === "number")
+ this._selectedIndex = selectedIndex;
+
+ for (var i = 0; i < completions.length; ++i) {
+ var itemElement = document.createElement("div");
+ itemElement.className = WebInspector.CompletionSuggestionsView.ItemElementStyleClassName;
+ itemElement.textContent = completions[i];
+ if (i === this._selectedIndex)
+ itemElement.classList.add(WebInspector.CompletionSuggestionsView.SelectedItemStyleClassName);
+ this._containerElement.appendChild(itemElement);
+ }
+ },
+
+ // Private
+
+ get _selectedItemElement()
+ {
+ if (isNaN(this._selectedIndex))
+ return null;
+
+ var element = this._containerElement.children[this._selectedIndex] || null;
+ console.assert(element);
+ return element;
+ },
+
+ _mouseDown: function(event)
+ {
+ if (event.button !== 0)
+ return;
+ this._mouseIsDown = true;
+ },
+
+ _mouseUp: function(event)
+ {
+ if (event.button !== 0)
+ return;
+ this._mouseIsDown = false;
+ },
+
+ _itemClicked: function(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.CompletionSuggestionsView.ItemElementStyleClassName);
+ console.assert(itemElement);
+ if (!itemElement)
+ return;
+
+ if (this._delegate && typeof this._delegate.completionSuggestionsClickedCompletion === "function")
+ this._delegate.completionSuggestionsClickedCompletion(this, itemElement.textContent);
+ }
+};
+
+WebInspector.CompletionSuggestionsView.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.details-section > .content > .group > .row.simple.content-flow-link > .value > span > .icon {
+ width: 12px;
+ height: 12px;
+ content: url(../Images/ContentFlow.svg);
+ margin-right: 4px;
+ -webkit-user-select: none;
+}
+
+.details-section > .content > .group > .row.simple.content-flow-link span
+{
+ vertical-align: top;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsComputedStyleDetailsPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceComputedStyleDetailsPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ComputedStyleDetailsPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,219 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ComputedStyleDetailsPanel = function()
+{
+ WebInspector.StyleDetailsPanel.call(this, WebInspector.ComputedStyleDetailsPanel.StyleClassName, "computed", WebInspector.UIString("Computed"));
+
+ this._computedStyleShowAllSetting = new WebInspector.Setting("computed-style-show-all", false);
+
+ var computedStyleShowAllLabel = document.createElement("label");
+ computedStyleShowAllLabel.textContent = WebInspector.UIString("Show All");
+
+ this._computedStyleShowAllCheckbox = document.createElement("input");
+ this._computedStyleShowAllCheckbox.type = "checkbox";
+ this._computedStyleShowAllCheckbox.checked = this._computedStyleShowAllSetting.value;
+ this._computedStyleShowAllCheckbox.addEventListener("change", this._computedStyleShowAllCheckboxValueChanged.bind(this));
+ computedStyleShowAllLabel.appendChild(this._computedStyleShowAllCheckbox);
+
+ this._propertiesTextEditor = new WebInspector.CSSStyleDeclarationTextEditor(this);
+ this._propertiesTextEditor.showsImplicitProperties = this._computedStyleShowAllSetting.value;
+ this._propertiesTextEditor.alwaysShowPropertyNames = ["display", "width", "height"];
+ this._propertiesTextEditor.sortProperties = true;
+
+ var propertiesRow = new WebInspector.DetailsSectionRow;
+ var propertiesGroup = new WebInspector.DetailsSectionGroup([propertiesRow]);
+ var propertiesSection = new WebInspector.DetailsSection("computed-style-properties", WebInspector.UIString("Properties"), [propertiesGroup], computedStyleShowAllLabel);
+
+ propertiesRow.element.appendChild(this._propertiesTextEditor.element);
+
+ // Region flow name is used to display the "flow-from" property of the Region Containers.
+ this._regionFlowFragment = document.createElement("span");
+ this._regionFlowFragment.appendChild(document.createElement("img")).className = "icon";
+ this._regionFlowNameLabelValue = this._regionFlowFragment.appendChild(document.createElement("span"));
+
+ var goToRegionFlowButton = this._regionFlowFragment.appendChild(WebInspector.createGoToArrowButton());
+ goToRegionFlowButton.addEventListener("click", this._goToRegionFlowArrowWasClicked.bind(this));
+
+ this._regionFlowNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Region Flow"));
+ this._regionFlowNameRow.element.classList.add("content-flow-link");
+
+ // Content flow name is used to display the "flow-into" property of the Content nodes.
+ this._contentFlowFragment = document.createElement("span");
+ this._contentFlowFragment.appendChild(document.createElement("img")).className = "icon";
+ this._contentFlowNameLabelValue = this._contentFlowFragment.appendChild(document.createElement("span"));
+
+ var goToContentFlowButton = this._contentFlowFragment.appendChild(WebInspector.createGoToArrowButton());
+ goToContentFlowButton.addEventListener("click", this._goToContentFlowArrowWasClicked.bind(this));
+
+ this._contentFlowNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Content Flow"));
+ this._contentFlowNameRow.element.classList.add("content-flow-link");
+
+ var flowNamesGroup = new WebInspector.DetailsSectionGroup([this._regionFlowNameRow, this._contentFlowNameRow]);
+ this._flowNamesSection = new WebInspector.DetailsSection("content-flow", WebInspector.UIString("Flows"), [flowNamesGroup]);
+
+ this._containerRegionsDataGrid = new WebInspector.DOMTreeDataGrid;
+ this._containerRegionsDataGrid.element.classList.add("no-header");
+
+ var containerRegionsRow = new WebInspector.DetailsSectionDataGridRow(this._containerRegionsDataGrid);
+ var containerRegionsGroup = new WebInspector.DetailsSectionGroup([containerRegionsRow]);
+ this._containerRegionsFlowSection = new WebInspector.DetailsSection("container-regions", WebInspector.UIString("Container Regions"), [containerRegionsGroup]);
+
+ this.element.appendChild(propertiesSection.element);
+ this.element.appendChild(this._flowNamesSection.element);
+ this.element.appendChild(this._containerRegionsFlowSection.element);
+
+ this._resetFlowDetails();
+};
+
+WebInspector.ComputedStyleDetailsPanel.StyleClassName = "computed";
+
+WebInspector.ComputedStyleDetailsPanel.prototype = {
+ constructor: WebInspector.ComputedStyleDetailsPanel,
+
+ // Public
+
+ get regionFlow()
+ {
+ return this._regionFlow;
+ },
+
+ set regionFlow(regionFlow)
+ {
+ this._regionFlow = regionFlow;
+ this._regionFlowNameLabelValue.textContent = regionFlow ? regionFlow.name : "";
+ this._regionFlowNameRow.value = regionFlow ? this._regionFlowFragment : null;
+ this._updateFlowNamesSectionVisibility();
+ },
+
+ get contentFlow()
+ {
+ return this._contentFlow;
+ },
+
+ set contentFlow(contentFlow)
+ {
+ this._contentFlow = contentFlow;
+ this._contentFlowNameLabelValue.textContent = contentFlow ? contentFlow.name : "";
+ this._contentFlowNameRow.value = contentFlow ? this._contentFlowFragment : null;
+ this._updateFlowNamesSectionVisibility();
+ },
+
+ get containerRegions()
+ {
+ return this._containerRegions;
+ },
+
+ set containerRegions(regions)
+ {
+ this._containerRegions = regions;
+
+ if (!regions || !regions.length) {
+ this._containerRegionsFlowSection.element.classList.add("hidden");
+ return;
+ }
+
+ this._containerRegionsDataGrid.removeChildren();
+ for (var regionNode of regions)
+ this._containerRegionsDataGrid.appendChild(new WebInspector.DOMTreeDataGridNode(regionNode));
+
+ this._containerRegionsFlowSection.element.classList.remove("hidden");
+ },
+
+ refresh: function()
+ {
+ this._propertiesTextEditor.style = this.nodeStyles.computedStyle;
+ this._refreshFlowDetails(this.nodeStyles.node);
+ },
+
+ // Protected
+
+ shown: function()
+ {
+ WebInspector.StyleDetailsPanel.prototype.shown.call(this);
+
+ this._propertiesTextEditor.updateLayout();
+ },
+
+ widthDidChange: function()
+ {
+ this._propertiesTextEditor.updateLayout();
+ },
+
+ // Private
+
+ _computedStyleShowAllCheckboxValueChanged: function(event)
+ {
+ var checked = this._computedStyleShowAllCheckbox.checked;
+ this._computedStyleShowAllSetting.value = checked;
+ this._propertiesTextEditor.showsImplicitProperties = checked;
+ },
+
+ _updateFlowNamesSectionVisibility: function()
+ {
+ this._flowNamesSection.element.classList.toggle("hidden", !this._contentFlow && !this._regionFlow);
+ },
+
+ _resetFlowDetails : function()
+ {
+ this.regionFlow = null;
+ this.contentFlow = null;
+ this.containerRegions = null;
+ },
+
+ _refreshFlowDetails: function(domNode)
+ {
+ this._resetFlowDetails();
+ if (!domNode)
+ return;
+
+ function contentFlowInfoReady(error, flowData)
+ {
+ // Element is not part of any flow.
+ if (error || !flowData) {
+ this._resetFlowDetails();
+ return;
+ }
+
+ this.regionFlow = flowData.regionFlow;
+ this.contentFlow = flowData.contentFlow;
+ this.containerRegions = flowData.regions;
+ }
+
+ WebInspector.domTreeManager.getNodeContentFlowInfo(domNode, contentFlowInfoReady.bind(this));
+ },
+
+ _goToRegionFlowArrowWasClicked: function()
+ {
+ WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._regionFlow);
+ },
+
+ _goToContentFlowArrowWasClicked: function()
+ {
+ WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node, true);
+ }
+};
+
+WebInspector.ComputedStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandjsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleCommandjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleCommand.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommand.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleCommand = function(command)
+{
+ WebInspector.Object.call(this);
+
+ this.command = command;
+};
+
+WebInspector.ConsoleCommand.prototype = {
+ constructor: WebInspector.ConsoleCommand,
+
+ // Public
+
+ clearHighlight: function()
+ {
+ var highlightedMessage = this._formattedCommand;
+ delete this._formattedCommand;
+ this._formatCommand();
+ this._element.replaceChild(this._formattedCommand, highlightedMessage);
+ },
+
+ highlightSearchResults: function(regexObject)
+ {
+ regexObject.lastIndex = 0;
+ var text = this.command;
+ var match = regexObject.exec(text);
+ var offset = 0;
+ var matchRanges = [];
+ while (match) {
+ matchRanges.push({ offset: match.index, length: match[0].length });
+ match = regexObject.exec(text);
+ }
+ highlightSearchResults(this._formattedCommand, matchRanges);
+ this._element.scrollIntoViewIfNeeded();
+ },
+
+ matchesRegex: function(regexObject)
+ {
+ return regexObject.test(this.command);
+ },
+
+ toMessageElement: function()
+ {
+ if (!this._element) {
+ this._element = document.createElement("div");
+ this._element.command = this;
+ this._element.className = "console-user-command";
+ this._element.setAttribute("data-labelprefix", WebInspector.UIString("Input: "));
+
+ this._formatCommand();
+ this._element.appendChild(this._formattedCommand);
+ }
+ return this._element;
+ },
+
+ // Private
+
+ _formatCommand: function()
+ {
+ this._formattedCommand = document.createElement("span");
+ this._formattedCommand.className = "console-message-text source-code";
+ this._formattedCommand.textContent = this.command;
+ },
+
+ toClipboardString: function(isPrefixOptional)
+ {
+ return (isPrefixOptional ? "" : "> ") + this.command;
+ }
+};
+
+WebInspector.ConsoleCommand.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleCommandResultjsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleCommandResultjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleCommandResult.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandResult.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleCommandResult = function(result, wasThrown, originatingCommand)
+{
+ var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
+ this.originatingCommand = originatingCommand;
+
+ WebInspector.ConsoleMessageImpl.call(this, WebInspector.ConsoleMessage.MessageSource.JS, level, "", null, WebInspector.ConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]);
+};
+
+WebInspector.ConsoleCommandResult.prototype = {
+ constructor: WebInspector.ConsoleCommandResult,
+
+ // Public
+
+ enforcesClipboardPrefixString: false,
+
+ toMessageElement: function()
+ {
+ var element = WebInspector.ConsoleMessageImpl.prototype.toMessageElement.call(this);
+ element.classList.add("console-user-command-result");
+ if (!element.getAttribute("data-labelprefix"))
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Output: "));
+ return element;
+ },
+
+ get clipboardPrefixString()
+ {
+ return "< ";
+ }
+};
+
+WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessageImpl.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleGroupjsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleGroupjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleGroup.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleGroup = function(parentGroup, isNewSession)
+{
+ WebInspector.Object.call(this);
+
+ this.parentGroup = parentGroup;
+
+ var element = document.createElement("div");
+ element.className = "console-group";
+ element.group = this;
+ this.element = element;
+
+ if (isNewSession)
+ element.classList.add("new-session");
+
+ var messagesElement = document.createElement("div");
+ messagesElement.className = "console-group-messages";
+ element.appendChild(messagesElement);
+ this.messagesElement = messagesElement;
+};
+
+WebInspector.ConsoleGroup.prototype = {
+ constructor: WebInspector.ConsoleGroup,
+
+ // Public
+
+ addMessage: function(msg)
+ {
+ var element = msg.toMessageElement();
+
+ var wrapper = document.createElement("div");
+ wrapper.className = WebInspector.LogContentView.ItemWrapperStyleClassName;
+ wrapper.messageElement = wrapper.appendChild(element);
+
+ if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) {
+ this.messagesElement.parentNode.insertBefore(wrapper, this.messagesElement);
+ element.addEventListener("click", this._titleClicked.bind(this));
+ element.addEventListener("mousedown", this._titleMouseDown.bind(this));
+ var groupElement = element.enclosingNodeOrSelfWithClass("console-group");
+ if (groupElement && msg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
+ groupElement.classList.add("collapsed");
+ } else
+ this.messagesElement.appendChild(wrapper);
+ },
+
+ hasMessages: function()
+ {
+ return !!this.messagesElement.childNodes.length;
+ },
+
+ // Private
+
+ _titleMouseDown: function(event)
+ {
+ event.preventDefault();
+ },
+
+ _titleClicked: function(event)
+ {
+ var groupTitleElement = event.target.enclosingNodeOrSelfWithClass("console-group-title");
+ if (groupTitleElement) {
+ var groupElement = groupTitleElement.enclosingNodeOrSelfWithClass("console-group");
+ if (groupElement)
+ if (groupElement.classList.contains("collapsed"))
+ groupElement.classList.remove("collapsed");
+ else
+ groupElement.classList.add("collapsed");
+ groupTitleElement.scrollIntoViewIfNeeded(true);
+ }
+ }
+};
+
+WebInspector.ConsoleGroup.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessagejsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleMessagejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessage.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleMessage.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessage.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessage.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleMessage = function(source, level, url, line, column, repeatCount)
+{
+ this.source = source;
+ this.level = level;
+ this.url = url || null;
+ this.line = line || 0;
+ this.column = column || 0;
+
+ repeatCount = repeatCount || 1;
+ this.repeatCount = repeatCount;
+ this.repeatDelta = repeatCount;
+ this.totalRepeatCount = repeatCount;
+}
+
+WebInspector.ConsoleMessage.prototype = {
+ /**
+ * @return {boolean}
+ */
+ isErrorOrWarning: function()
+ {
+ return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error);
+ },
+
+ updateRepeatCount: function()
+ {
+ // Implemented by concrete instances
+ },
+
+ /**
+ * @return {WebInspector.ConsoleMessage}
+ */
+ clone: function()
+ {
+ // Implemented by concrete instances
+ }
+}
+
+/**
+ * @param {string} source
+ * @param {string} level
+ * @param {string} message
+ * @param {string=} type
+ * @param {string=} url
+ * @param {number=} line
+ * @param {number=} repeatCount
+ * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
+ * @param {ConsoleAgent.StackTrace=} stackTrace
+ * @param {WebInspector.Resource=} request
+ *
+ * @return {WebInspector.ConsoleMessage}
+ */
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, column, repeatCount, parameters, stackTrace, request)
+{
+ return new WebInspector.ConsoleMessageImpl(source, level, message, null, type, url, line, column, repeatCount, parameters, stackTrace, request);
+}
+
+// Note: Keep these constants in sync with the ones in Console.h
+WebInspector.ConsoleMessage.MessageSource = {
+ HTML: "html",
+ XML: "xml",
+ JS: "javascript",
+ Network: "network",
+ ConsoleAPI: "console-api",
+ Other: "other"
+};
+
+WebInspector.ConsoleMessage.MessageType = {
+ Log: "log",
+ Dir: "dir",
+ DirXML: "dirxml",
+ Trace: "trace",
+ StartGroup: "startGroup",
+ StartGroupCollapsed: "startGroupCollapsed",
+ EndGroup: "endGroup",
+ Assert: "assert",
+ Result: "result"
+};
+
+WebInspector.ConsoleMessage.MessageLevel = {
+ Tip: "tip",
+ Log: "log",
+ Warning: "warning",
+ Error: "error",
+ Debug: "debug"
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsoleMessageImpljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,735 @@
</span><ins>+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, column, repeatCount, parameters, stackTrace, request)
+{
+ WebInspector.ConsoleMessage.call(this, source, level, url, line, column, repeatCount);
+
+ this._linkifier = linkifier;
+ this.type = type || WebInspector.ConsoleMessage.MessageType.Log;
+ this._messageText = message;
+ this._parameters = parameters;
+ this._stackTrace = stackTrace;
+ this._request = request;
+
+ this._customFormatters = {
+ "object": this._formatParameterAsObject,
+ "array": this._formatParameterAsArray,
+ "node": this._formatParameterAsNode,
+ "string": this._formatParameterAsString
+ };
+}
+
+WebInspector.ConsoleMessageImpl.prototype = {
+
+ enforcesClipboardPrefixString: true,
+
+ _formatMessage: function()
+ {
+ this._formattedMessage = document.createElement("span");
+ this._formattedMessage.className = "console-message-text source-code";
+
+ var messageText;
+ if (this.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI) {
+ switch (this.type) {
+ case WebInspector.ConsoleMessage.MessageType.Trace:
+ messageText = document.createTextNode("console.trace()");
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Assert:
+ var args = [WebInspector.UIString("Assertion failed:")];
+ if (this._parameters)
+ args = args.concat(this._parameters);
+ messageText = this._format(args);
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Dir:
+ var obj = this._parameters ? this._parameters[0] : undefined;
+ var args = ["%O", obj];
+ messageText = this._format(args);
+ break;
+ default:
+ var args = this._parameters || [this._messageText];
+ messageText = this._format(args);
+ }
+ } else if (this.source === WebInspector.ConsoleMessage.MessageSource.Network) {
+ if (this._request) {
+ this._stackTrace = this._request.stackTrace;
+ if (this._request.initiator && this._request.initiator.url) {
+ this.url = this._request.initiator.url;
+ this.line = this._request.initiator.lineNumber;
+ }
+ messageText = document.createElement("span");
+ if (this.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
+ messageText.appendChild(document.createTextNode(this._request.requestMethod + " "));
+ messageText.appendChild(WebInspector.linkifyRequestAsNode(this._request));
+ if (this._request.failed)
+ messageText.appendChild(document.createTextNode(" " + this._request.localizedFailDescription));
+ else
+ messageText.appendChild(document.createTextNode(" " + this._request.statusCode + " (" + this._request.statusText + ")"));
+ } else {
+ var fragment = WebInspector.linkifyStringAsFragmentWithCustomLinkifier(this._messageText, WebInspector.linkifyRequestAsNode.bind(null, this._request, ""));
+ messageText.appendChild(fragment);
+ }
+ } else {
+ if (this.url) {
+ var anchor = WebInspector.linkifyURLAsNode(this.url, this.url, "console-message-url");
+ this._formattedMessage.appendChild(anchor);
+ }
+ messageText = this._format([this._messageText]);
+ }
+ } else {
+ var args = this._parameters || [this._messageText];
+ messageText = this._format(args);
+ }
+
+ if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network || this._request) {
+ var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
+ if (firstNonNativeCallFrame) {
+ var urlElement = this._linkifyCallFrame(firstNonNativeCallFrame);
+ this._formattedMessage.appendChild(urlElement);
+ } else if (this.url && !this._shouldHideURL(this.url)) {
+ var urlElement = this._linkifyLocation(this.url, this.line, this.column);
+ this._formattedMessage.appendChild(urlElement);
+ }
+ }
+
+ this._formattedMessage.appendChild(messageText);
+
+ if (this._shouldDumpStackTrace()) {
+ var ol = document.createElement("ol");
+ ol.className = "outline-disclosure";
+ var treeOutline = new TreeOutline(ol);
+
+ var content = this._formattedMessage;
+ var root = new TreeElement(content, null, true);
+ content.treeElementForTest = root;
+ treeOutline.appendChild(root);
+ if (this.type === WebInspector.ConsoleMessage.MessageType.Trace)
+ root.expand();
+
+ this._populateStackTraceTreeElement(root);
+ this._formattedMessage = ol;
+ }
+
+ // This is used for inline message bubbles in SourceFrames, or other plain-text representations.
+ this._message = messageText.textContent;
+ },
+
+ _shouldDumpStackTrace: function()
+ {
+ return !!this._stackTrace && this._stackTrace.length && (this.source === WebInspector.ConsoleMessage.MessageSource.Network || this.level === WebInspector.ConsoleMessage.MessageLevel.Error || this.type === WebInspector.ConsoleMessage.MessageType.Trace);
+ },
+
+ _shouldHideURL: function(url)
+ {
+ return url === "undefined" || url === "[native code]";
+ },
+
+ _firstNonNativeCallFrame: function()
+ {
+ if (!this._stackTrace)
+ return null;
+
+ for (var i = 0; i < this._stackTrace.length; i++) {
+ var frame = this._stackTrace[i];
+ if (!frame.url || frame.url === "[native code]")
+ continue;
+ return frame;
+ }
+
+ return null;
+ },
+
+ get message()
+ {
+ // force message formatting
+ var formattedMessage = this.formattedMessage;
+ return this._message;
+ },
+
+ get formattedMessage()
+ {
+ if (!this._formattedMessage)
+ this._formatMessage();
+ return this._formattedMessage;
+ },
+
+ _linkifyLocation: function(url, lineNumber, columnNumber)
+ {
+ // ConsoleMessage stack trace line numbers are one-based.
+ lineNumber = lineNumber ? lineNumber - 1 : 0;
+
+ return WebInspector.linkifyLocation(url, lineNumber, columnNumber, "console-message-url");
+ },
+
+ _linkifyCallFrame: function(callFrame)
+ {
+ return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
+ },
+
+ isErrorOrWarning: function()
+ {
+ return (this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || this.level === WebInspector.ConsoleMessage.MessageLevel.Error);
+ },
+
+ _format: function(parameters)
+ {
+ // This node is used like a Builder. Values are continually appended onto it.
+ var formattedResult = document.createElement("span");
+ if (!parameters.length)
+ return formattedResult;
+
+ // Formatting code below assumes that parameters are all wrappers whereas frontend console
+ // API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.
+ for (var i = 0; i < parameters.length; ++i) {
+ // FIXME: Only pass runtime wrappers here.
+ if (parameters[i] instanceof WebInspector.RemoteObject)
+ continue;
+
+ if (typeof parameters[i] === "object")
+ parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
+ else
+ parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
+ }
+
+ // There can be string log and string eval result. We distinguish between them based on message type.
+ var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
+
+ // Multiple parameters with the first being a format string. Save unused substitutions.
+ if (shouldFormatMessage) {
+ // Multiple parameters with the first being a format string. Save unused substitutions.
+ var result = this._formatWithSubstitutionString(parameters, formattedResult);
+ parameters = result.unusedSubstitutions;
+ if (parameters.length)
+ formattedResult.appendChild(document.createTextNode(" "));
+ }
+
+ // Single parameter, or unused substitutions from above.
+ for (var i = 0; i < parameters.length; ++i) {
+ // Inline strings when formatting.
+ if (shouldFormatMessage && parameters[i].type === "string")
+ formattedResult.appendChild(document.createTextNode(parameters[i].description));
+ else
+ formattedResult.appendChild(this._formatParameter(parameters[i]));
+ if (i < parameters.length - 1)
+ formattedResult.appendChild(document.createTextNode(" "));
+ }
+ return formattedResult;
+ },
+
+ /**
+ * @param {boolean=} forceObjectFormat
+ */
+ _formatParameter: function(output, forceObjectFormat)
+ {
+ var type;
+ if (forceObjectFormat)
+ type = "object";
+ else if (output instanceof WebInspector.RemoteObject)
+ type = output.subtype || output.type;
+ else
+ type = typeof output;
+
+ var formatter = this._customFormatters[type];
+ if (!formatter) {
+ formatter = this._formatParameterAsValue;
+ output = output.description;
+ }
+
+ var span = document.createElement("span");
+ span.className = "console-formatted-" + type + " source-code";
+ formatter.call(this, output, span);
+ return span;
+ },
+
+ _formatParameterAsValue: function(val, elem)
+ {
+ elem.appendChild(document.createTextNode(val));
+ },
+
+ _formatParameterAsObject: function(obj, elem)
+ {
+ elem.appendChild(new WebInspector.ObjectPropertiesSection(obj, obj.description).element);
+ },
+
+ _formatParameterAsNode: function(object, elem)
+ {
+ function printNode(nodeId)
+ {
+ if (!nodeId) {
+ // Sometimes DOM is loaded after the sync message is being formatted, so we get no
+ // nodeId here. So we fall back to object formatting here.
+ this._formatParameterAsObject(object, elem);
+ return;
+ }
+ var treeOutline = new WebInspector.DOMTreeOutline(false, false, true);
+ treeOutline.setVisible(true);
+ treeOutline.rootDOMNode = WebInspector.domTreeManager.nodeForId(nodeId);
+ treeOutline.element.classList.add("outline-disclosure");
+ if (!treeOutline.children[0].hasChildren)
+ treeOutline.element.classList.add("single-node");
+ elem.appendChild(treeOutline.element);
+ }
+ object.pushNodeToFrontend(printNode.bind(this));
+ },
+
+ _formatParameterAsArray: function(arr, elem)
+ {
+ arr.getOwnProperties(this._printArray.bind(this, arr, elem));
+ },
+
+ _formatParameterAsString: function(output, elem)
+ {
+ var span = document.createElement("span");
+ span.className = "console-formatted-string source-code";
+ span.appendChild(WebInspector.linkifyStringAsFragment(output.description));
+
+ // Make black quotes.
+ elem.classList.remove("console-formatted-string");
+ elem.appendChild(document.createTextNode("\""));
+ elem.appendChild(span);
+ elem.appendChild(document.createTextNode("\""));
+ },
+
+ _printArray: function(array, elem, properties)
+ {
+ if (!properties)
+ return;
+
+ var elements = [];
+ for (var i = 0; i < properties.length; ++i) {
+ var property = properties[i];
+ var name = property.name;
+ if (!isNaN(name))
+ elements[name] = this._formatAsArrayEntry(property.value);
+ }
+
+ elem.appendChild(document.createTextNode("["));
+ var lastNonEmptyIndex = -1;
+
+ function appendUndefined(elem, index)
+ {
+ if (index - lastNonEmptyIndex <= 1)
+ return;
+ var span = elem.createChild("span", "console-formatted-undefined");
+ span.textContent = WebInspector.UIString("undefined × %d").format(index - lastNonEmptyIndex - 1);
+ }
+
+ var length = array.arrayLength();
+ for (var i = 0; i < length; ++i) {
+ var element = elements[i];
+ if (!element)
+ continue;
+
+ if (i - lastNonEmptyIndex > 1) {
+ appendUndefined(elem, i);
+ elem.appendChild(document.createTextNode(", "));
+ }
+
+ elem.appendChild(element);
+ lastNonEmptyIndex = i;
+ if (i < length - 1)
+ elem.appendChild(document.createTextNode(", "));
+ }
+ appendUndefined(elem, length);
+
+ elem.appendChild(document.createTextNode("]"));
+ },
+
+ _formatAsArrayEntry: function(output)
+ {
+ // Prevent infinite expansion of cross-referencing arrays.
+ return this._formatParameter(output, output.subtype && output.subtype === "array");
+ },
+
+ _formatWithSubstitutionString: function(parameters, formattedResult)
+ {
+ var formatters = {};
+
+ function parameterFormatter(force, obj)
+ {
+ return this._formatParameter(obj, force);
+ }
+
+ function stringFormatter(obj)
+ {
+ return obj.description;
+ }
+
+ function floatFormatter(obj)
+ {
+ if (typeof obj.value !== "number")
+ return parseFloat(obj.description);
+ return obj.value;
+ }
+
+ function integerFormatter(obj)
+ {
+ if (typeof obj.value !== "number")
+ return parseInt(obj.description);
+ return Math.floor(obj.value);
+ }
+
+ var currentStyle = null;
+ function styleFormatter(obj)
+ {
+ currentStyle = {};
+ var buffer = document.createElement("span");
+ buffer.setAttribute("style", obj.description);
+ for (var i = 0; i < buffer.style.length; i++) {
+ var property = buffer.style[i];
+ if (isWhitelistedProperty(property))
+ currentStyle[property] = buffer.style[property];
+ }
+ }
+
+ function isWhitelistedProperty(property)
+ {
+ var prefixes = ["background", "border", "color", "font", "line", "margin", "padding", "text", "-webkit-background", "-webkit-border", "-webkit-font", "-webkit-margin", "-webkit-padding", "-webkit-text"];
+ for (var i = 0; i < prefixes.length; i++) {
+ if (property.startsWith(prefixes[i]))
+ return true;
+ }
+ return false;
+ }
+
+ // Firebug uses %o for formatting objects.
+ formatters.o = parameterFormatter.bind(this, false);
+ formatters.s = stringFormatter;
+ formatters.f = floatFormatter;
+
+ // Firebug allows both %i and %d for formatting integers.
+ formatters.i = integerFormatter;
+ formatters.d = integerFormatter;
+
+ // Firebug uses %c for styling the message.
+ formatters.c = styleFormatter;
+
+ // Support %O to force object formatting, instead of the type-based %o formatting.
+ formatters.O = parameterFormatter.bind(this, true);
+
+ function append(a, b)
+ {
+ if (b instanceof Node)
+ a.appendChild(b);
+ else if (b) {
+ var toAppend = WebInspector.linkifyStringAsFragment(b.toString());
+ if (currentStyle) {
+ var wrapper = document.createElement("span");
+ for (var key in currentStyle)
+ wrapper.style[key] = currentStyle[key];
+ wrapper.appendChild(toAppend);
+ toAppend = wrapper;
+ }
+ a.appendChild(toAppend);
+ }
+ return a;
+ }
+
+ // String.format does treat formattedResult like a Builder, result is an object.
+ return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
+ },
+
+ clearHighlight: function()
+ {
+ if (!this._formattedMessage)
+ return;
+
+ var highlightedMessage = this._formattedMessage;
+ delete this._formattedMessage;
+ this._formatMessage();
+ this._element.replaceChild(this._formattedMessage, highlightedMessage);
+ },
+
+ highlightSearchResults: function(regexObject)
+ {
+ if (!this._formattedMessage)
+ return;
+
+ regexObject.lastIndex = 0;
+ var text = this.message;
+ var match = regexObject.exec(text);
+ var offset = 0;
+ var matchRanges = [];
+ while (match) {
+ matchRanges.push({ offset: match.index, length: match[0].length });
+ match = regexObject.exec(text);
+ }
+ highlightSearchResults(this._formattedMessage, matchRanges);
+ this._element.scrollIntoViewIfNeeded();
+ },
+
+ matchesRegex: function(regexObject)
+ {
+ return regexObject.test(this.message);
+ },
+
+ toMessageElement: function()
+ {
+ if (this._element)
+ return this._element;
+
+ var element = document.createElement("div");
+ element.message = this;
+ element.className = "console-message";
+
+ this._element = element;
+
+ switch (this.level) {
+ case WebInspector.ConsoleMessage.MessageLevel.Tip:
+ element.classList.add("console-tip-level");
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Tip: "));
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Log:
+ element.classList.add("console-log-level");
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Log: "));
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Debug:
+ element.classList.add("console-debug-level");
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Debug: "));
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Warning:
+ element.classList.add("console-warning-level");
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Warning: "));
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Error:
+ element.classList.add("console-error-level");
+ element.setAttribute("data-labelprefix", WebInspector.UIString("Error: "));
+ break;
+ }
+
+ if (this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
+ element.classList.add("console-group-title");
+
+ element.appendChild(this.formattedMessage);
+
+ if (this.repeatCount > 1)
+ this.updateRepeatCount();
+
+ return element;
+ },
+
+ _populateStackTraceTreeElement: function(parentTreeElement)
+ {
+ for (var i = 0; i < this._stackTrace.length; i++) {
+ var frame = this._stackTrace[i];
+
+ var content = document.createElement("div");
+ var messageTextElement = document.createElement("span");
+ messageTextElement.className = "console-message-text source-code";
+ var functionName = frame.functionName || WebInspector.UIString("(anonymous function)");
+ messageTextElement.appendChild(document.createTextNode(functionName));
+ content.appendChild(messageTextElement);
+
+ if (frame.url && !this._shouldHideURL(frame.url)) {
+ var urlElement = this._linkifyCallFrame(frame);
+ content.appendChild(urlElement);
+ }
+
+ var treeElement = new TreeElement(content);
+ parentTreeElement.appendChild(treeElement);
+ }
+ },
+
+ updateRepeatCount: function() {
+ if (!this.repeatCountElement) {
+ this.repeatCountElement = document.createElement("span");
+ this.repeatCountElement.className = "bubble";
+
+ this._element.insertBefore(this.repeatCountElement, this._element.firstChild);
+ }
+ this.repeatCountElement.textContent = this.repeatCount;
+ },
+
+ toString: function()
+ {
+ var sourceString;
+ switch (this.source) {
+ case WebInspector.ConsoleMessage.MessageSource.HTML:
+ sourceString = "HTML";
+ break;
+ case WebInspector.ConsoleMessage.MessageSource.XML:
+ sourceString = "XML";
+ break;
+ case WebInspector.ConsoleMessage.MessageSource.JS:
+ sourceString = "JS";
+ break;
+ case WebInspector.ConsoleMessage.MessageSource.Network:
+ sourceString = "Network";
+ break;
+ case WebInspector.ConsoleMessage.MessageSource.ConsoleAPI:
+ sourceString = "ConsoleAPI";
+ break;
+ case WebInspector.ConsoleMessage.MessageSource.Other:
+ sourceString = "Other";
+ break;
+ }
+
+ var typeString;
+ switch (this.type) {
+ case WebInspector.ConsoleMessage.MessageType.Log:
+ typeString = "Log";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Dir:
+ typeString = "Dir";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.DirXML:
+ typeString = "Dir XML";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Trace:
+ typeString = "Trace";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
+ case WebInspector.ConsoleMessage.MessageType.StartGroup:
+ typeString = "Start Group";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.EndGroup:
+ typeString = "End Group";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Assert:
+ typeString = "Assert";
+ break;
+ case WebInspector.ConsoleMessage.MessageType.Result:
+ typeString = "Result";
+ break;
+ }
+
+ return sourceString + " " + typeString + " " + this.levelString + ": " + this.formattedMessage.textContent + "\n" + this.url + " line " + this.line;
+ },
+
+ get text()
+ {
+ return this._messageText;
+ },
+
+ isEqual: function(msg)
+ {
+ if (!msg)
+ return false;
+
+ if (this._stackTrace) {
+ if (!msg._stackTrace)
+ return false;
+ var l = this._stackTrace;
+ var r = msg._stackTrace;
+ for (var i = 0; i < l.length; i++) {
+ if (l[i].url !== r[i].url ||
+ l[i].functionName !== r[i].functionName ||
+ l[i].lineNumber !== r[i].lineNumber ||
+ l[i].columnNumber !== r[i].columnNumber)
+ return false;
+ }
+ }
+
+ return (this.source === msg.source)
+ && (this.type === msg.type)
+ && (this.level === msg.level)
+ && (this.line === msg.line)
+ && (this.url === msg.url)
+ && (this.message === msg.message)
+ && (this._request === msg._request);
+ },
+
+ get stackTrace()
+ {
+ return this._stackTrace;
+ },
+
+ /**
+ * @return {WebInspector.ConsoleMessage}
+ */
+ clone: function()
+ {
+ return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.column, this.repeatCount, this._parameters, this._stackTrace, this._request);
+ },
+
+ get levelString()
+ {
+ switch (this.level) {
+ case WebInspector.ConsoleMessage.MessageLevel.Tip:
+ return "Tip";
+ case WebInspector.ConsoleMessage.MessageLevel.Log:
+ return "Log";
+ case WebInspector.ConsoleMessage.MessageLevel.Warning:
+ return "Warning";
+ case WebInspector.ConsoleMessage.MessageLevel.Debug:
+ return "Debug";
+ case WebInspector.ConsoleMessage.MessageLevel.Error:
+ return "Error";
+ }
+ },
+
+ get clipboardPrefixString()
+ {
+ return "[" + this.levelString + "] ";
+ },
+
+ toClipboardString: function(isPrefixOptional)
+ {
+ var isTrace = this._shouldDumpStackTrace();
+
+ var clipboardString = "";
+ if (this._formattedMessage && !isTrace)
+ clipboardString = this._formattedMessage.querySelector("span").innerText;
+ else
+ clipboardString = this.type === WebInspector.ConsoleMessage.MessageType.Trace ? "console.trace()" : this._message || this._messageText;
+
+ if (!isPrefixOptional || this.enforcesClipboardPrefixString)
+ clipboardString = this.clipboardPrefixString + clipboardString;
+
+ if (isTrace) {
+ this._stackTrace.forEach(function(frame) {
+ clipboardString += "\n\t" + (frame.functionName || WebInspector.UIString("(anonymous function)"));
+ if (frame.url)
+ clipboardString += " (" + WebInspector.displayNameForURL(frame.url) + ", line " + frame.lineNumber + ")";
+ });
+ } else {
+ var repeatString = this.repeatCount > 1 ? "x" + this.repeatCount : "";
+
+ var urlLine = "";
+ if (this.url) {
+ var components = [WebInspector.displayNameForURL(this.url), "line " + this.line];
+ if (repeatString)
+ components.push(repeatString);
+ urlLine = " (" + components.join(", ") + ")";
+ } else if (repeatString)
+ urlLine = " (" + repeatString + ")";
+
+ if (urlLine) {
+ var lines = clipboardString.split("\n");
+ lines[0] += urlLine;
+ clipboardString = lines.join("\n");
+ }
+ }
+
+ return clipboardString;
+ }
+}
+
+WebInspector.ConsoleMessageImpl.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsolePromptcssfromrev164541trunkSourceWebInspectorUIUserInterfaceConsolePromptcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.console-prompt {
+ background-color: white;
+}
+
+.console-prompt > .CodeMirror {
+ width: 100%;
+ height: auto;
+}
+
+.console-prompt > .CodeMirror-scroll {
+ overflow: hidden;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsolePromptjsfromrev164541trunkSourceWebInspectorUIUserInterfaceConsolePromptjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ConsolePrompt.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,294 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ConsolePrompt = function(delegate, mimeType, element)
+{
+ WebInspector.Object.call(this);
+
+ mimeType = parseMIMEType(mimeType).type;
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.ConsolePrompt.StyleClassName);
+ this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ this._delegate = delegate || null;
+
+ this._codeMirror = CodeMirror(this.element, {
+ lineWrapping: true,
+ mode: mimeType,
+ indentWithTabs: true,
+ indentUnit: 4,
+ matchBrackets: true
+ });
+
+ var keyMap = {
+ "Up": this._handlePreviousKey.bind(this),
+ "Down": this._handleNextKey.bind(this),
+ "Ctrl-P": this._handlePreviousKey.bind(this),
+ "Ctrl-N": this._handleNextKey.bind(this),
+ "Enter": this._handleEnterKey.bind(this),
+ "Cmd-Enter": this._handleCommandEnterKey.bind(this)
+ };
+
+ this._codeMirror.addKeyMap(keyMap);
+
+ this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
+ this._completionController.addExtendedCompletionProvider("javascript", WebInspector.javaScriptRuntimeCompletionProvider);
+
+ this._history = [{}];
+ this._historyIndex = 0;
+};
+
+WebInspector.ConsolePrompt.StyleClassName = "console-prompt";
+WebInspector.ConsolePrompt.MaximumHistorySize = 30;
+
+WebInspector.ConsolePrompt.prototype = {
+ constructor: WebInspector.ConsolePrompt,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(delegate)
+ {
+ this._delegate = delegate || null;
+ },
+
+ get text()
+ {
+ return this._codeMirror.getValue();
+ },
+
+ set text(text)
+ {
+ this._codeMirror.setValue(text || "");
+ this._codeMirror.clearHistory();
+ this._codeMirror.markClean();
+ },
+
+ get history()
+ {
+ this._history[this._historyIndex] = this._historyEntryForCurrentText();
+ return this._history;
+ },
+
+ set history(history)
+ {
+ this._history = history instanceof Array ? history.slice(0, WebInspector.ConsolePrompt.MaximumHistorySize) : [{}];
+ this._historyIndex = 0;
+ this._restoreHistoryEntry(0);
+ },
+
+ get focused()
+ {
+ return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
+ },
+
+ focus: function()
+ {
+ this._codeMirror.focus();
+ },
+
+ shown: function()
+ {
+ this._codeMirror.refresh();
+ },
+
+ updateLayout: function()
+ {
+ this._codeMirror.refresh();
+ },
+
+ updateCompletions: function(completions, implicitSuffix)
+ {
+ this._completionController.updateCompletions(completions, implicitSuffix);
+ },
+
+ // Protected
+
+ completionControllerCompletionsNeeded: function(completionController, prefix, defaultCompletions, base, suffix, forced)
+ {
+ if (this.delegate && typeof this.delegate.consolePromptCompletionsNeeded === "function")
+ this.delegate.consolePromptCompletionsNeeded(this, defaultCompletions, base, prefix, suffix, forced);
+ else
+ this._completionController.updateCompletions(defaultCompletions);
+ },
+
+ completionControllerShouldAllowEscapeCompletion: function(completionController)
+ {
+ // Only allow escape to complete if there is text in the prompt. Otherwise allow it to pass through
+ // so escape to toggle the quick console still works.
+ return !!this.text;
+ },
+
+ // Private
+
+ _handlePreviousKey: function(codeMirror)
+ {
+ if (this._codeMirror.somethingSelected())
+ return CodeMirror.Pass;
+
+ // Pass unless we are on the first line.
+ if (this._codeMirror.getCursor().line)
+ return CodeMirror.Pass;
+
+ var historyEntry = this._history[this._historyIndex + 1];
+ if (!historyEntry)
+ return CodeMirror.Pass;
+
+ this._rememberCurrentTextInHistory();
+
+ ++this._historyIndex;
+
+ this._restoreHistoryEntry(this._historyIndex);
+ },
+
+ _handleNextKey: function(codeMirror)
+ {
+ if (this._codeMirror.somethingSelected())
+ return CodeMirror.Pass;
+
+ // Pass unless we are on the last line.
+ if (this._codeMirror.getCursor().line !== this._codeMirror.lastLine())
+ return CodeMirror.Pass;
+
+ var historyEntry = this._history[this._historyIndex - 1];
+ if (!historyEntry)
+ return CodeMirror.Pass;
+
+ this._rememberCurrentTextInHistory();
+
+ --this._historyIndex;
+
+ this._restoreHistoryEntry(this._historyIndex);
+ },
+
+ _handleEnterKey: function(codeMirror, forceCommit)
+ {
+ var currentText = this.text;
+
+ // Always do nothing when there is just whitespace.
+ if (!currentText.trim())
+ return;
+
+ var cursor = this._codeMirror.getCursor();
+ var lastLine = this._codeMirror.lastLine();
+ var lastLineLength = this._codeMirror.getLine(lastLine).length;
+ var cursorIsAtLastPosition = positionsEqual(cursor, {line: lastLine, ch: lastLineLength});
+
+ function positionsEqual(a, b)
+ {
+ console.assert(a);
+ console.assert(b);
+ return a.line === b.line && a.ch === b.ch;
+ }
+
+ function commitTextOrInsertNewLine(commit)
+ {
+ if (!commit) {
+ // Only insert a new line if the previous cursor and the current cursor are in the same position.
+ if (positionsEqual(cursor, this._codeMirror.getCursor()))
+ CodeMirror.commands.newlineAndIndent(this._codeMirror);
+ return;
+ }
+
+ var historyEntry = this._historyEntryForCurrentText();
+
+ // Replace the previous entry if it does not have text or if the text is the same.
+ if (this._history[1] && (!this._history[1].text || this._history[1].text === historyEntry.text)) {
+ this._history[1] = historyEntry;
+ this._history[0] = {};
+ } else {
+ // Replace the first history entry and push a new empty one.
+ this._history[0] = historyEntry;
+ this._history.unshift({});
+
+ // Trim the history length if needed.
+ if (this._history.length > WebInspector.ConsolePrompt.MaximumHistorySize)
+ this._history = this._history.slice(0, WebInspector.ConsolePrompt.MaximumHistorySize);
+ }
+
+ this._historyIndex = 0;
+
+ this._codeMirror.setValue("");
+ this._codeMirror.clearHistory();
+
+ if (this.delegate && typeof this.delegate.consolePromptHistoryDidChange === "function")
+ this.delegate.consolePromptHistoryDidChange(this);
+
+ if (this.delegate && typeof this.delegate.consolePromptTextCommitted === "function")
+ this.delegate.consolePromptTextCommitted(this, currentText);
+ }
+
+ if (!forceCommit && this.delegate && typeof this.delegate.consolePromptShouldCommitText === "function") {
+ this.delegate.consolePromptShouldCommitText(this, currentText, cursorIsAtLastPosition, commitTextOrInsertNewLine.bind(this));
+ return;
+ }
+
+ commitTextOrInsertNewLine.call(this, true);
+ },
+
+ _handleCommandEnterKey: function(codeMirror)
+ {
+ this._handleEnterKey(codeMirror, true);
+ },
+
+ _restoreHistoryEntry: function(index)
+ {
+ var historyEntry = this._history[index];
+
+ this._codeMirror.setValue(historyEntry.text || "");
+
+ if (historyEntry.undoHistory)
+ this._codeMirror.setHistory(historyEntry.undoHistory);
+ else
+ this._codeMirror.clearHistory();
+
+ this._codeMirror.setCursor(historyEntry.cursor || {line: 0});
+ },
+
+ _historyEntryForCurrentText: function()
+ {
+ return {text: this.text, undoHistory: this._codeMirror.getHistory(), cursor: this._codeMirror.getCursor()};
+ },
+
+ _rememberCurrentTextInHistory: function()
+ {
+ this._history[this._historyIndex] = this._historyEntryForCurrentText();
+
+ if (this.delegate && typeof this.delegate.consolePromptHistoryDidChange === "function")
+ this.delegate.consolePromptHistoryDidChange(this);
+ }
+};
+
+WebInspector.ConsolePrompt.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentBrowsercssfromrev164541trunkSourceWebInspectorUIUserInterfaceContentBrowsercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-browser {
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+}
+
+.content-browser > .content-view-container {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentBrowserjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentBrowserjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentBrowser.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,532 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentBrowser = function(element, delegate, disableBackForward)
+{
+ WebInspector.Object.call(this);
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.ContentBrowser.StyleClassName);
+
+ this._navigationBar = new WebInspector.NavigationBar;
+ this._element.appendChild(this._navigationBar.element);
+
+ this._contentViewContainer = new WebInspector.ContentViewContainer;
+ this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this);
+ this._element.appendChild(this._contentViewContainer.element);
+
+ this._findBanner = new WebInspector.FindBanner(this);
+ this._findKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "F", this._showFindBanner.bind(this));
+ this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidShow, this._findBannerDidShow, this);
+ this._findBanner.addEventListener(WebInspector.FindBanner.Event.DidHide, this._findBannerDidHide, this);
+
+ this._saveKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "S", this._save.bind(this));
+ this._saveAsKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "S", this._saveAs.bind(this));
+
+ if (!disableBackForward) {
+ this._backKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Left, this._backButtonClicked.bind(this));
+ this._forwardKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Right, this._forwardButtonClicked.bind(this));
+
+ this._backButtonNavigationItem = new WebInspector.ButtonNavigationItem("back", WebInspector.UIString("Back (%s)").format(this._backKeyboardShortcut.displayName), "Images/BackArrow.svg", 9, 9);
+ this._backButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._backButtonClicked, this);
+ this._backButtonNavigationItem.enabled = false;
+ this._navigationBar.addNavigationItem(this._backButtonNavigationItem);
+
+ this._forwardButtonNavigationItem = new WebInspector.ButtonNavigationItem("forward", WebInspector.UIString("Forward (%s)").format(this._forwardKeyboardShortcut.displayName), "Images/ForwardArrow.svg", 9, 9);
+ this._forwardButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._forwardButtonClicked, this);
+ this._forwardButtonNavigationItem.enabled = false;
+ this._navigationBar.addNavigationItem(this._forwardButtonNavigationItem);
+
+ this._navigationBar.addNavigationItem(new WebInspector.DividerNavigationItem);
+ }
+
+ this._hierarchicalPathNavigationItem = new WebInspector.HierarchicalPathNavigationItem;
+ this._hierarchicalPathNavigationItem.addEventListener(WebInspector.HierarchicalPathNavigationItem.Event.PathComponentWasSelected, this._hierarchicalPathComponentWasSelected, this);
+ this._navigationBar.addNavigationItem(this._hierarchicalPathNavigationItem);
+
+ this._contentViewSelectionPathNavigationItem = new WebInspector.HierarchicalPathNavigationItem;
+
+ this._navigationBar.addNavigationItem(new WebInspector.FlexibleSpaceNavigationItem);
+
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange, this._contentViewSupplementalRepresentedObjectsDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange, this._contentViewNumberOfSearchResultsDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.NavigationItemsDidChange, this._contentViewNavigationItemsDidChange, this);
+
+ this._delegate = delegate || null;
+
+ this._currentContentViewNavigationItems = [];
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ContentBrowser);
+
+WebInspector.ContentBrowser.StyleClassName = "content-browser";
+
+WebInspector.ContentBrowser.Event = {
+ CurrentRepresentedObjectsDidChange: "content-browser-current-represented-objects-did-change",
+ CurrentContentViewDidChange: "content-browser-current-content-view-did-change"
+};
+
+WebInspector.ContentBrowser.prototype = {
+ constructor: WebInspector.ContentBrowser,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get navigationBar()
+ {
+ return this._navigationBar;
+ },
+
+ get contentViewContainer()
+ {
+ return this._contentViewContainer;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(newDelegate)
+ {
+ this._delegate = newDelegate || null;
+ },
+
+ get currentContentView()
+ {
+ return this._contentViewContainer.currentContentView;
+ },
+
+ get currentRepresentedObjects()
+ {
+ var representedObjects = [];
+
+ var lastComponent = this._hierarchicalPathNavigationItem.lastComponent;
+ if (lastComponent && lastComponent.representedObject)
+ representedObjects.push(lastComponent.representedObject);
+
+ lastComponent = this._contentViewSelectionPathNavigationItem.lastComponent;
+ if (lastComponent && lastComponent.representedObject)
+ representedObjects.push(lastComponent.representedObject);
+
+ var currentContentView = this.currentContentView;
+ if (currentContentView) {
+ var supplementalRepresentedObjects = currentContentView.supplementalRepresentedObjects;
+ if (supplementalRepresentedObjects && supplementalRepresentedObjects.length)
+ representedObjects = representedObjects.concat(supplementalRepresentedObjects);
+ }
+
+ return representedObjects;
+ },
+
+ updateLayout: function()
+ {
+ this._navigationBar.updateLayout();
+ this._contentViewContainer.updateLayout();
+ },
+
+ showContentViewForRepresentedObject: function(representedObject, cookie)
+ {
+ var contentView = this.contentViewForRepresentedObject(representedObject);
+ return this._contentViewContainer.showContentView(contentView, cookie);
+ },
+
+ showContentView: function(contentView, cookie)
+ {
+ return this._contentViewContainer.showContentView(contentView, cookie);
+ },
+
+ contentViewForRepresentedObject: function(representedObject, onlyExisting)
+ {
+ return this._contentViewContainer.contentViewForRepresentedObject(representedObject, onlyExisting);
+ },
+
+ canGoBack: function()
+ {
+ var currentContentView = this.currentContentView;
+ if (currentContentView && currentContentView.canGoBack())
+ return true;
+ return this._contentViewContainer.canGoBack();
+ },
+
+ canGoForward: function()
+ {
+ var currentContentView = this.currentContentView;
+ if (currentContentView && currentContentView.canGoForward())
+ return true;
+ return this._contentViewContainer.canGoForward();
+ },
+
+ goBack: function()
+ {
+ var currentContentView = this.currentContentView;
+ if (currentContentView && currentContentView.canGoBack()) {
+ currentContentView.goBack();
+ this._updateBackForwardButtons();
+ return;
+ }
+
+ this._contentViewContainer.goBack();
+
+ // The _updateBackForwardButtons function is called by _currentContentViewDidChange,
+ // so it does not need to be called here.
+ },
+
+ goForward: function()
+ {
+ var currentContentView = this.currentContentView;
+ if (currentContentView && currentContentView.canGoForward()) {
+ currentContentView.goForward();
+ this._updateBackForwardButtons();
+ return;
+ }
+
+ this._contentViewContainer.goForward();
+
+ // The _updateBackForwardButtons function is called by _currentContentViewDidChange,
+ // so it does not need to be called here.
+ },
+
+ findBannerPerformSearch: function(findBanner, query)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.performSearch(query);
+ },
+
+ findBannerSearchCleared: function(findBanner)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.searchCleared();
+ },
+
+ findBannerSearchQueryForSelection: function(findBanner)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return null;
+
+ return currentContentView.searchQueryWithSelection();
+ },
+
+ findBannerRevealPreviousResult: function(findBanner)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.revealPreviousSearchResult(!findBanner.showing);
+ },
+
+ findBannerRevealNextResult: function(findBanner)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.revealNextSearchResult(!findBanner.showing);
+ },
+
+ // Private
+
+ _backButtonClicked: function(event)
+ {
+ this.goBack();
+ },
+
+ _forwardButtonClicked: function(event)
+ {
+ this.goForward();
+ },
+
+ _saveDataToFile: function(saveData, forceSaveAs)
+ {
+ console.assert(saveData);
+ if (!saveData)
+ return;
+
+ if (typeof saveData.customSaveHandler === "function") {
+ saveData.customSaveHandler(forceSaveAs);
+ return;
+ }
+
+ console.assert(saveData.url);
+ console.assert(typeof saveData.content === "string");
+ if (!saveData.url || typeof saveData.content !== "string")
+ return;
+
+ InspectorFrontendHost.save(saveData.url, saveData.content, false, forceSaveAs || saveData.forceSaveAs);
+ },
+
+ _save: function(event)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSave)
+ return;
+
+ this._saveDataToFile(currentContentView.saveData);
+ },
+
+ _saveAs: function(event)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSave)
+ return;
+
+ this._saveDataToFile(currentContentView.saveData, true);
+ },
+
+ _showFindBanner: function(event)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ this._findBanner.show();
+ },
+
+ _findBannerDidShow: function(event)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.automaticallyRevealFirstSearchResult = true;
+ },
+
+ _findBannerDidHide: function(event)
+ {
+ var currentContentView = this.currentContentView;
+ if (!currentContentView || !currentContentView.supportsSearch)
+ return;
+
+ currentContentView.automaticallyRevealFirstSearchResult = false;
+ },
+
+ _contentViewNumberOfSearchResultsDidChange: function(event)
+ {
+ if (event.target !== this.currentContentView)
+ return;
+
+ this._findBanner.numberOfResults = this.currentContentView.numberOfSearchResults;
+ },
+
+ _updateHierarchicalPathNavigationItem: function(representedObject)
+ {
+ if (!this.delegate || typeof this.delegate.contentBrowserTreeElementForRepresentedObject !== "function")
+ return;
+
+ var treeElement = representedObject ? this.delegate.contentBrowserTreeElementForRepresentedObject(this, representedObject) : null;
+ var pathComponents = [];
+
+ while (treeElement && !treeElement.root) {
+ var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
+ pathComponents.unshift(pathComponent);
+ treeElement = treeElement.parent;
+ }
+
+ this._hierarchicalPathNavigationItem.components = pathComponents;
+ },
+
+ _updateContentViewSelectionPathNavigationItem: function(contentView)
+ {
+ var selectionPathComponents = contentView ? contentView.selectionPathComponents || [] : [];
+ this._contentViewSelectionPathNavigationItem.components = selectionPathComponents;
+
+ if (!selectionPathComponents.length) {
+ this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator = false;
+ this._navigationBar.removeNavigationItem(this._contentViewSelectionPathNavigationItem);
+ return;
+ }
+
+ // Insert the _contentViewSelectionPathNavigationItem after the _hierarchicalPathNavigationItem, if needed.
+ if (!this._navigationBar.navigationItems.contains(this._contentViewSelectionPathNavigationItem)) {
+ var hierarchicalPathItemIndex = this._navigationBar.navigationItems.indexOf(this._hierarchicalPathNavigationItem);
+ console.assert(hierarchicalPathItemIndex !== -1);
+ this._navigationBar.insertNavigationItem(this._contentViewSelectionPathNavigationItem, hierarchicalPathItemIndex + 1);
+ this._hierarchicalPathNavigationItem.alwaysShowLastPathComponentSeparator = true;
+ }
+ },
+
+ _updateBackForwardButtons: function()
+ {
+ if (!this._backButtonNavigationItem || !this._forwardButtonNavigationItem)
+ return;
+
+ this._backButtonNavigationItem.enabled = this.canGoBack();
+ this._forwardButtonNavigationItem.enabled = this.canGoForward();
+ },
+
+ _updateContentViewNavigationItems: function()
+ {
+ var navigationBar = this.navigationBar;
+
+ // First, we remove the navigation items added by the previous content view.
+ this._currentContentViewNavigationItems.forEach(function(navigationItem) {
+ navigationBar.removeNavigationItem(navigationItem);
+ });
+
+ var currentContentView = this.currentContentView;
+ if (!currentContentView) {
+ this._currentContentViewNavigationItems = [];
+ return;
+ }
+
+ var insertionIndex = navigationBar.navigationItems.length;
+ console.assert(insertionIndex >= 0);
+
+ // Keep track of items we'll be adding to the navigation bar.
+ var newNavigationItems = [];
+
+ // Go through each of the items of the new content view and add a divider before them.
+ currentContentView.navigationItems.forEach(function(navigationItem, index) {
+ // Add dividers before items unless it's the first item and not a button.
+ if (index !== 0 || navigationItem instanceof WebInspector.ButtonNavigationItem) {
+ var divider = new WebInspector.DividerNavigationItem;
+ navigationBar.insertNavigationItem(divider, insertionIndex++);
+ newNavigationItems.push(divider);
+ }
+ navigationBar.insertNavigationItem(navigationItem, insertionIndex++);
+ newNavigationItems.push(navigationItem);
+ });
+
+ // Remember the navigation items we inserted so we can remove them
+ // for the next content view.
+ this._currentContentViewNavigationItems = newNavigationItems;
+ },
+
+ _updateFindBanner: function(currentContentView)
+ {
+ if (!currentContentView) {
+ this._findBanner.targetElement = null;
+ this._findBanner.numberOfResults = null;
+ return;
+ }
+
+ this._findBanner.targetElement = currentContentView.element;
+ this._findBanner.numberOfResults = currentContentView.hasPerformedSearch ? currentContentView.numberOfSearchResults : null;
+
+ if (currentContentView.supportsSearch && this._findBanner.searchQuery) {
+ currentContentView.automaticallyRevealFirstSearchResult = this._findBanner.showing;
+ currentContentView.performSearch(this._findBanner.searchQuery);
+ }
+ },
+
+ _dispatchCurrentRepresentedObjectsDidChangeEventSoon: function()
+ {
+ if (this._currentRepresentedObjectsDidChangeTimeout)
+ return;
+ this._currentRepresentedObjectsDidChangeTimeout = setTimeout(this._dispatchCurrentRepresentedObjectsDidChangeEvent.bind(this), 0);
+ },
+
+ _dispatchCurrentRepresentedObjectsDidChangeEvent: function()
+ {
+ if (this._currentRepresentedObjectsDidChangeTimeout) {
+ clearTimeout(this._currentRepresentedObjectsDidChangeTimeout);
+ delete this._currentRepresentedObjectsDidChangeTimeout;
+ }
+
+ this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange);
+ },
+
+ _contentViewSelectionPathComponentDidChange: function(event)
+ {
+ if (event.target !== this.currentContentView)
+ return;
+
+ this._updateContentViewSelectionPathNavigationItem(event.target);
+ this._updateBackForwardButtons();
+
+ this._updateContentViewNavigationItems();
+
+ this._navigationBar.updateLayout();
+
+ this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
+ },
+
+ _contentViewSupplementalRepresentedObjectsDidChange: function(event)
+ {
+ if (event.target !== this.currentContentView)
+ return;
+
+ this._dispatchCurrentRepresentedObjectsDidChangeEventSoon();
+ },
+
+ _currentContentViewDidChange: function(event)
+ {
+ var currentContentView = this.currentContentView;
+
+ this._updateHierarchicalPathNavigationItem(currentContentView ? currentContentView.representedObject : null);
+ this._updateContentViewSelectionPathNavigationItem(currentContentView);
+ this._updateBackForwardButtons();
+
+ this._updateContentViewNavigationItems();
+ this._updateFindBanner(currentContentView);
+
+ this._navigationBar.updateLayout();
+
+ this.dispatchEventToListeners(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange);
+
+ this._dispatchCurrentRepresentedObjectsDidChangeEvent();
+ },
+
+ _contentViewNavigationItemsDidChange: function(event)
+ {
+ if (event.target !== this.currentContentView)
+ return;
+
+ this._updateContentViewNavigationItems();
+ this._navigationBar.updateLayout();
+ },
+
+ _hierarchicalPathComponentWasSelected: function(event)
+ {
+ console.assert(event.data.pathComponent instanceof WebInspector.GeneralTreeElementPathComponent);
+
+ var treeElement = event.data.pathComponent.generalTreeElement;
+ var originalTreeElement = treeElement;
+
+ // Some tree elements (like folders) are not viewable. Find the first descendant that is viewable.
+ while (treeElement && !WebInspector.ContentView.isViewable(treeElement.representedObject))
+ treeElement = treeElement.traverseNextTreeElement(false, originalTreeElement, false);
+
+ if (!treeElement)
+ return;
+
+ this.showContentViewForRepresentedObject(treeElement.representedObject);
+ }
+};
+
+WebInspector.ContentBrowser.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentFlowDOMTreeContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentFlowDOMTreeContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowDOMTreeContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentFlowDOMTreeContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowDOMTreeContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowDOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlowDOMTreeContentView = function(contentFlow)
+{
+ console.assert(contentFlow);
+
+ WebInspector.DOMTreeContentView.call(this, contentFlow);
+
+ contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded, this._contentNodeWasAdded, this);
+ contentFlow.addEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, this._contentNodeWasRemoved, this);
+
+ this._createContentTrees();
+};
+
+WebInspector.ContentFlowDOMTreeContentView.prototype = {
+ constructor: WebInspector.ContentFlowDOMTreeContentView,
+ __proto__: WebInspector.DOMTreeContentView.prototype,
+
+ // Public
+
+ closed: function()
+ {
+ this.representedObject.removeEventListener(WebInspector.ContentFlow.Event.ContentNodeWasAdded, this._contentNodeWasAdded, this);
+ this.representedObject.removeEventListener(WebInspector.ContentFlow.Event.ContentNodeWasRemoved, this._contentNodeWasRemoved, this);
+ WebInspector.DOMTreeContentView.prototype.closed.call(this);
+ },
+
+ getSearchContextNodes: function(callback)
+ {
+ callback(this.domTreeOutline.children.map(function(treeOutline) {
+ return treeOutline.representedObject.id;
+ }));
+ },
+
+ // Private
+
+ _createContentTrees: function()
+ {
+ var contentNodes = this.representedObject.contentNodes;
+ for (var contentNode of contentNodes)
+ this.domTreeOutline.appendChild(new WebInspector.DOMTreeElement(contentNode));
+
+ var documentURL = contentNodes.length ? contentNodes[0].ownerDocument.documentURL : null;
+ this._restoreSelectedNodeAfterUpdate(documentURL, contentNodes[0]);
+ },
+
+ _contentNodeWasAdded: function(event)
+ {
+ var treeElement = new WebInspector.DOMTreeElement(event.data.node);
+ if (!event.data.before) {
+ this.domTreeOutline.appendChild(treeElement);
+ return;
+ }
+
+ var beforeElement = this.domTreeOutline.findTreeElement(event.data.before);
+ console.assert(beforeElement);
+
+ var index = this.domTreeOutline.children.indexOf(beforeElement);
+ console.assert(index !== -1);
+
+ this.domTreeOutline.insertChild(treeElement, index);
+ },
+
+ _contentNodeWasRemoved: function(event)
+ {
+ var treeElement = this.domTreeOutline.findTreeElement(event.data.node);
+ console.assert(treeElement);
+ this.domTreeOutline.removeChild(treeElement);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentFlowIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceContentFlowIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentFlowIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.
+ */
+
+.content-flow-icon .icon {
+ content: url(../Images/ContentFlow.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentFlowTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentFlowTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentFlowTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentFlowTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 HOLDER "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 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.ContentFlowTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.ContentFlow);
+ WebInspector.GeneralTreeElement.call(this, [WebInspector.ContentFlowTreeElement.StyleClassName, WebInspector.ContentFlowTreeElement.ContentFlowIconStyleClassName], representedObject.name, null, representedObject, false);
+
+ this.small = true;
+};
+
+WebInspector.ContentFlowTreeElement.ContentFlowIconStyleClassName = "content-flow-icon";
+
+WebInspector.ContentFlowTreeElement.prototype = {
+ constructor: WebInspector.ContentFlowTreeElement
+};
+
+WebInspector.ContentFlowTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view > .indeterminate-progress-spinner {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+
+ width: 32px;
+ height: 32px;
+
+ margin-left: -16px;
+ margin-right: -16px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,323 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentView = function(representedObject)
+{
+ if (this.constructor === WebInspector.ContentView) {
+ // When instantiated directly return an instance of a type-based concrete subclass.
+
+ console.assert(representedObject);
+
+ if (representedObject instanceof WebInspector.Frame)
+ return new WebInspector.FrameContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.Resource)
+ return new WebInspector.ResourceClusterContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.Script)
+ return new WebInspector.ScriptContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.TimelineRecording)
+ return new WebInspector.TimelineContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.DOMStorageObject)
+ return new WebInspector.DOMStorageContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.CookieStorageObject)
+ return new WebInspector.CookieStorageContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.DatabaseTableObject)
+ return new WebInspector.DatabaseTableContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.DatabaseObject)
+ return new WebInspector.DatabaseContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
+ return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
+ return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.ApplicationCacheFrame)
+ return new WebInspector.ApplicationCacheFrameContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.DOMTree)
+ return new WebInspector.FrameDOMTreeContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.LogObject)
+ return new WebInspector.LogContentView(representedObject);
+
+ if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
+ return new WebInspector.LegacyJavaScriptProfileView(representedObject);
+
+ if (representedObject instanceof WebInspector.ContentFlow)
+ return new WebInspector.ContentFlowDOMTreeContentView(representedObject);
+
+ if (typeof representedObject === "string" || representedObject instanceof String)
+ return new WebInspector.TextContentView(representedObject);
+
+ console.assert(!WebInspector.ContentView.isViewable(representedObject));
+
+ throw "Can't make a ContentView for an unknown representedObject.";
+ }
+
+ // Concrete object instantiation.
+ console.assert(this.constructor !== WebInspector.ContentView && this instanceof WebInspector.ContentView);
+ console.assert(WebInspector.ContentView.isViewable(representedObject));
+
+ WebInspector.Object.call(this);
+
+ this._representedObject = representedObject;
+
+ this._element = document.createElement("div");
+ this._element.classList.add(WebInspector.ContentView.StyleClassName);
+
+ this._parentContainer = null;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ContentView);
+
+WebInspector.ContentView.isViewable = function(representedObject)
+{
+ if (representedObject instanceof WebInspector.Frame)
+ return true;
+ if (representedObject instanceof WebInspector.Resource)
+ return true;
+ if (representedObject instanceof WebInspector.Script)
+ return true;
+ if (representedObject instanceof WebInspector.TimelineRecording)
+ return true;
+ if (representedObject instanceof WebInspector.DOMStorageObject)
+ return true;
+ if (representedObject instanceof WebInspector.CookieStorageObject)
+ return true;
+ if (representedObject instanceof WebInspector.DatabaseTableObject)
+ return true;
+ if (representedObject instanceof WebInspector.DatabaseObject)
+ return true;
+ if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
+ return true;
+ if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
+ return true;
+ if (representedObject instanceof WebInspector.ApplicationCacheFrame)
+ return true;
+ if (representedObject instanceof WebInspector.DOMTree)
+ return true;
+ if (representedObject instanceof WebInspector.LogObject)
+ return true;
+ if (representedObject instanceof WebInspector.LegacyJavaScriptProfileObject)
+ return true;
+ if (representedObject instanceof WebInspector.ContentFlow)
+ return true;
+ if (typeof representedObject === "string" || representedObject instanceof String)
+ return true;
+ return false;
+};
+
+WebInspector.ContentView.StyleClassName = "content-view";
+
+WebInspector.ContentView.Event = {
+ SelectionPathComponentsDidChange: "content-view-selection-path-components-did-change",
+ SupplementalRepresentedObjectsDidChange: "content-view-supplemental-represented-objects-did-change",
+ NumberOfSearchResultsDidChange: "content-view-number-of-search-results-did-change",
+ NavigationItemsDidChange: "content-view-navigation-items-did-change"
+};
+
+WebInspector.ContentView.prototype = {
+ constructor: WebInspector.ContentView,
+
+ // Public
+
+ get representedObject()
+ {
+ return this._representedObject;
+ },
+
+ get navigationItems()
+ {
+ // Navigation items that will be displayed by the ContentBrowser instance,
+ // meant to be subclassed. Implemented by subclasses.
+ return [];
+ },
+
+ get allowedNavigationSidebarPanels()
+ {
+ // Allow any navigation sidebar panel.
+ return [];
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get parentContainer()
+ {
+ return this._parentContainer;
+ },
+
+ get visible()
+ {
+ return this._visible;
+ },
+
+ set visible(flag)
+ {
+ this._visible = flag;
+ },
+
+ get scrollableElements()
+ {
+ // Implemented by subclasses.
+ return [];
+ },
+
+ get shouldKeepElementsScrolledToBottom()
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ get selectionPathComponents()
+ {
+ // Implemented by subclasses.
+ return [];
+ },
+
+ get supplementalRepresentedObjects()
+ {
+ // Implemented by subclasses.
+ return [];
+ },
+
+ get supportsSplitContentBrowser()
+ {
+ // Implemented by subclasses.
+ return true;
+ },
+
+ updateLayout: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ shown: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ hidden: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ closed: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ saveToCookie: function(cookie)
+ {
+ // Implemented by subclasses.
+ },
+
+ restoreFromCookie: function(cookie)
+ {
+ // Implemented by subclasses.
+ },
+
+ canGoBack: function()
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ canGoForward: function()
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ goBack: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ goForward: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ get supportsSearch()
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ get numberOfSearchResults()
+ {
+ // Implemented by subclasses.
+ return null;
+ },
+
+ get hasPerformedSearch()
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ // Implemented by subclasses.
+ },
+
+ performSearch: function(query)
+ {
+ // Implemented by subclasses.
+ },
+
+ searchCleared: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ searchQueryWithSelection: function()
+ {
+ // Implemented by subclasses.
+ return null;
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ // Implemented by subclasses.
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ // Implemented by subclasses.
+ }
+};
+
+WebInspector.ContentView.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewContainercssfromrev164541trunkSourceWebInspectorUIUserInterfaceContentViewContainercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view-container {
+ position: relative;
+ overflow: hidden;
+}
+
+.content-view-container > .content-view {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ overflow: hidden;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewContainerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceContentViewContainerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContentViewContainer.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,413 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ContentViewContainer = function(element)
+{
+ WebInspector.Object.call(this);
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.ContentViewContainer.StyleClassName);
+
+ this._backForwardList = [];
+ this._currentIndex = -1;
+};
+
+WebInspector.ContentViewContainer.StyleClassName = "content-view-container";
+
+WebInspector.ContentViewContainer.Event = {
+ CurrentContentViewDidChange: "content-view-container-current-content-view-did-change"
+};
+
+WebInspector.ContentViewContainer.prototype = {
+ constructor: WebInspector.ContentViewContainer,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get currentIndex()
+ {
+ return this._currentIndex;
+ },
+
+ get backForwardList()
+ {
+ return this._backForwardList;
+ },
+
+ get currentContentView()
+ {
+ if (this._currentIndex < 0 || this._currentIndex > this._backForwardList.length - 1)
+ return null;
+ return this._backForwardList[this._currentIndex].contentView;
+ },
+
+ get currentBackForwardEntry()
+ {
+ if (this._currentIndex < 0 || this._currentIndex > this._backForwardList.length - 1)
+ return null;
+ return this._backForwardList[this._currentIndex];
+ },
+
+ updateLayout: function()
+ {
+ var currentContentView = this.currentContentView;
+ if (currentContentView)
+ currentContentView.updateLayout();
+ },
+
+ contentViewForRepresentedObject: function(representedObject, onlyExisting)
+ {
+ console.assert(representedObject);
+ if (!representedObject)
+ return null;
+
+ // Iterate over all the known content views for the representedObject (if any) and find one that doesn't
+ // have a parent container or has this container as its parent.
+ var contentView = null;
+ for (var i = 0; representedObject.__contentViews && i < representedObject.__contentViews.length; ++i) {
+ var currentContentView = representedObject.__contentViews[i];
+ if (!currentContentView._parentContainer || currentContentView._parentContainer === this) {
+ contentView = currentContentView;
+ break;
+ }
+ }
+
+ console.assert(!contentView || contentView instanceof WebInspector.ContentView);
+ if (contentView instanceof WebInspector.ContentView)
+ return contentView;
+
+ // Return early to avoid creating a new content view when onlyExisting is true.
+ if (onlyExisting)
+ return null;
+
+ try {
+ // No existing content view found, make a new one.
+ contentView = new WebInspector.ContentView(representedObject);
+ } catch (e) {
+ console.error(e);
+ return null;
+ }
+
+ // Remember this content view for future calls.
+ if (!representedObject.__contentViews)
+ representedObject.__contentViews = [];
+ representedObject.__contentViews.push(contentView);
+
+ return contentView;
+ },
+
+ showContentViewForRepresentedObject: function(representedObject)
+ {
+ var contentView = this.contentViewForRepresentedObject(representedObject);
+ if (!contentView)
+ return null;
+
+ this.showContentView(contentView);
+
+ return contentView;
+ },
+
+ showContentView: function(contentView, cookie)
+ {
+ console.assert(contentView instanceof WebInspector.ContentView);
+ if (!(contentView instanceof WebInspector.ContentView))
+ return null;
+
+ // Don't allow showing a content view that is already associated with another container.
+ // Showing a content view that is already associated with this container is allowed.
+ console.assert(!contentView.parentContainer || contentView.parentContainer === this);
+ if (contentView.parentContainer && contentView.parentContainer !== this)
+ return null;
+
+ var currentEntry = this.currentBackForwardEntry;
+ var provisionalEntry = new WebInspector.BackForwardEntry(contentView, cookie);
+ // Don't do anything if we would have added an identical back/forward list entry.
+ if (currentEntry && currentEntry.contentView === contentView && Object.shallowEqual(provisionalEntry.cookie, currentEntry.cookie))
+ return currentEntry.contentView;
+
+ // Showing a content view will truncate the back/forward list after the current index and insert the content view
+ // at the end of the list. Finally, the current index will be updated to point to the end of the back/forward list.
+
+ // Increment the current index to where we will insert the content view.
+ var newIndex = this._currentIndex + 1;
+
+ // Insert the content view at the new index. This will remove any content views greater than or equal to the index.
+ var removedEntries = this._backForwardList.splice(newIndex, this._backForwardList.length - newIndex, provisionalEntry);
+
+ console.assert(newIndex === this._backForwardList.length - 1);
+ console.assert(this._backForwardList[newIndex] === provisionalEntry);
+
+ // Disassociate with the removed content views.
+ for (var i = 0; i < removedEntries.length; ++i) {
+ // Skip disassociation if this content view is still in the back/forward list.
+ var shouldDissociateContentView = this._backForwardList.some(function(existingEntry) {
+ return existingEntry.contentView === removedEntries[i].contentView;
+ });
+ if (shouldDissociateContentView)
+ this._disassociateFromContentView(removedEntries[i]);
+ }
+
+ // Associate with the new content view.
+ contentView._parentContainer = this;
+
+ this.showBackForwardEntryForIndex(newIndex);
+
+ return contentView;
+ },
+
+ showBackForwardEntryForIndex: function(index)
+ {
+ console.assert(index >= 0 && index <= this._backForwardList.length - 1);
+ if (index < 0 || index > this._backForwardList.length - 1)
+ return;
+
+ if (this._currentIndex === index)
+ return;
+
+ // Hide the currently visible content view.
+ var previousEntry = this.currentBackForwardEntry;
+ if (previousEntry)
+ this._hideEntry(previousEntry);
+
+ this._currentIndex = index;
+ var currentEntry = this.currentBackForwardEntry;
+ console.assert(currentEntry);
+
+ this._showEntry(currentEntry);
+
+ this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
+ },
+
+ replaceContentView: function(oldContentView, newContentView)
+ {
+ console.assert(oldContentView instanceof WebInspector.ContentView);
+ if (!(oldContentView instanceof WebInspector.ContentView))
+ return;
+
+ console.assert(newContentView instanceof WebInspector.ContentView);
+ if (!(newContentView instanceof WebInspector.ContentView))
+ return;
+
+ console.assert(oldContentView.parentContainer === this);
+ if (oldContentView.parentContainer !== this)
+ return;
+
+ console.assert(!newContentView.parentContainer || newContentView.parentContainer === this);
+ if (newContentView.parentContainer && newContentView.parentContainer !== this)
+ return;
+
+ var currentlyShowing = (this.currentContentView === oldContentView);
+ if (currentlyShowing)
+ this._hideEntry(this.currentBackForwardEntry);
+
+ // Disassociate with the old content view.
+ this._disassociateFromContentView(oldContentView);
+
+ // Associate with the new content view.
+ newContentView._parentContainer = this;
+
+ // Replace all occurrences of oldContentView with newContentView in the back/forward list.
+ for (var i = 0; i < this._backForwardList.length; ++i) {
+ if (this._backForwardList[i].contentView === oldContentView)
+ this._backForwardList[i].contentView = newContentView;
+ }
+
+ // Re-show the current entry, because its content view instance was replaced.
+ if (currentlyShowing) {
+ this._showEntry(this.currentBackForwardEntry);
+ this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
+ }
+ },
+
+ closeAllContentViewsOfPrototype: function(constructor)
+ {
+ if (!this._backForwardList.length) {
+ console.assert(this._currentIndex === -1);
+ return;
+ }
+
+ // Do a check to see if all the content views are instances of this prototype.
+ // If they all are we can use the quicker closeAllContentViews method.
+ var allSamePrototype = true;
+ for (var i = this._backForwardList.length - 1; i >= 0; --i) {
+ if (!(this._backForwardList[i].contentView instanceof constructor)) {
+ allSamePrototype = false;
+ break;
+ }
+ }
+
+ if (allSamePrototype) {
+ this.closeAllContentViews();
+ return;
+ }
+
+ var oldCurrentContentView = this.currentContentView;
+
+ var backForwardListDidChange = false;
+ // Hide and disassociate with all the content views that are instances of the constructor.
+ for (var i = this._backForwardList.length - 1; i >= 0; --i) {
+ var entry = this._backForwardList[i];
+ if (!(entry.contentView instanceof constructor))
+ continue;
+
+ if (entry.contentView === oldCurrentContentView)
+ this._hideEntry(entry);
+
+ if (this._currentIndex >= i) {
+ // Decrement the currentIndex since we will remove an item in the back/forward array
+ // that it the current index or comes before it.
+ --this._currentIndex;
+ }
+
+ this._disassociateFromContentView(entry.contentView);
+
+ // Remove the item from the back/forward list.
+ this._backForwardList.splice(i, 1);
+ backForwardListDidChange = true;
+ }
+
+ var currentEntry = this.currentBackForwardEntry;
+ console.assert(currentEntry || (!currentEntry && this._currentIndex === -1));
+
+ if (currentEntry && currentEntry.contentView !== oldCurrentContentView || backForwardListDidChange) {
+ this._showEntry(currentEntry);
+ this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
+ }
+ },
+
+ closeAllContentViews: function()
+ {
+ if (!this._backForwardList.length) {
+ console.assert(this._currentIndex === -1);
+ return;
+ }
+
+ // Hide and disassociate with all the content views.
+ for (var i = 0; i < this._backForwardList.length; ++i) {
+ var entry = this._backForwardList[i];
+ if (i === this._currentIndex)
+ this._hideEntry(entry);
+ this._disassociateFromContentView(entry.contentView);
+ }
+
+ this._backForwardList = [];
+ this._currentIndex = -1;
+
+ this.dispatchEventToListeners(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange);
+ },
+
+ canGoBack: function()
+ {
+ return this._currentIndex > 0;
+ },
+
+ canGoForward: function()
+ {
+ return this._currentIndex < this._backForwardList.length - 1;
+ },
+
+ goBack: function()
+ {
+ if (!this.canGoBack())
+ return;
+ this.showBackForwardEntryForIndex(this._currentIndex - 1);
+ },
+
+ goForward: function()
+ {
+ if (!this.canGoForward())
+ return;
+ this.showBackForwardEntryForIndex(this._currentIndex + 1);
+ },
+
+ shown: function()
+ {
+ var currentEntry = this.currentBackForwardEntry;
+ if (!currentEntry)
+ return;
+
+ this._showEntry(currentEntry);
+ },
+
+ hidden: function()
+ {
+ var currentEntry = this.currentBackForwardEntry;
+ if (!currentEntry)
+ return;
+
+ this._hideEntry(currentEntry);
+ },
+
+ // Private
+
+ _addContentViewElement: function(contentView)
+ {
+ if (contentView.element.parentNode !== this._element)
+ this._element.appendChild(contentView.element);
+ },
+
+ _removeContentViewElement: function(contentView)
+ {
+ if (contentView.element.parentNode)
+ contentView.element.parentNode.removeChild(contentView.element);
+ },
+
+ _disassociateFromContentView: function(contentView)
+ {
+ console.assert(!contentView.visible);
+
+ contentView._parentContainer = null;
+
+ var representedObject = contentView.representedObject;
+ if (!representedObject || !representedObject.__contentViews)
+ return;
+
+ representedObject.__contentViews.remove(contentView);
+
+ contentView.closed();
+ },
+
+ _showEntry: function(entry)
+ {
+ console.assert(entry instanceof WebInspector.BackForwardEntry);
+
+ this._addContentViewElement(entry.contentView);
+ entry.prepareToShow();
+ },
+
+ _hideEntry: function(entry)
+ {
+ console.assert(entry instanceof WebInspector.BackForwardEntry);
+
+ entry.prepareToHide();
+ this._removeContentViewElement(entry.contentView);
+ }
+};
+
+WebInspector.ContentViewContainer.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContextMenujsfromrev164541trunkSourceWebInspectorUIUserInterfaceContextMenujs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenu.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ContextMenu.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenu.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenu.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,299 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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
+ * OWNER 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.
+ */
+
+/**
+ * @constructor
+ * @param {WebInspector.ContextSubMenuItem} topLevelMenu
+ * @param {string} type
+ * @param {string=} label
+ * @param {boolean=} disabled
+ * @param {boolean=} checked
+ */
+WebInspector.ContextMenuItem = function(topLevelMenu, type, label, disabled, checked)
+{
+ this._type = type;
+ this._label = label;
+ this._disabled = disabled;
+ this._checked = checked;
+ this._contextMenu = topLevelMenu;
+ if (type === "item" || type === "checkbox")
+ this._id = topLevelMenu.nextId();
+}
+
+WebInspector.ContextMenuItem.prototype = {
+ id: function()
+ {
+ return this._id;
+ },
+
+ type: function()
+ {
+ return this._type;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isEnabled: function()
+ {
+ return !this._disabled;
+ },
+
+ /**
+ * @param {boolean} enabled
+ */
+ setEnabled: function(enabled)
+ {
+ this._disabled = !enabled;
+ },
+
+ _buildDescriptor: function()
+ {
+ switch (this._type) {
+ case "item":
+ return { type: "item", id: this._id, label: this._label, enabled: !this._disabled };
+ case "separator":
+ return { type: "separator" };
+ case "checkbox":
+ return { type: "checkbox", id: this._id, label: this._label, checked: !!this._checked, enabled: !this._disabled };
+ }
+ }
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.ContextMenuItem}
+ * @param topLevelMenu
+ * @param {string=} label
+ * @param {boolean=} disabled
+ */
+WebInspector.ContextSubMenuItem = function(topLevelMenu, label, disabled)
+{
+ WebInspector.ContextMenuItem.call(this, topLevelMenu, "subMenu", label, disabled);
+ this._items = [];
+}
+
+WebInspector.ContextSubMenuItem.prototype = {
+ /**
+ * @param {string} label
+ * @param {function} handler
+ * @param {boolean=} disabled
+ * @return {WebInspector.ContextMenuItem}
+ */
+ appendItem: function(label, handler, disabled)
+ {
+ var item = new WebInspector.ContextMenuItem(this._contextMenu, "item", label, disabled);
+ this._pushItem(item);
+ this._contextMenu._setHandler(item.id(), handler);
+ return item;
+ },
+
+ /**
+ * @param {string} label
+ * @param {boolean=} disabled
+ * @return {WebInspector.ContextMenuItem}
+ */
+ appendSubMenuItem: function(label, disabled)
+ {
+ var item = new WebInspector.ContextSubMenuItem(this._contextMenu, label, disabled);
+ this._pushItem(item);
+ return item;
+ },
+
+ /**
+ * @param {boolean=} disabled
+ */
+ appendCheckboxItem: function(label, handler, checked, disabled)
+ {
+ var item = new WebInspector.ContextMenuItem(this._contextMenu, "checkbox", label, disabled, checked);
+ this._pushItem(item);
+ this._contextMenu._setHandler(item.id(), handler);
+ return item;
+ },
+
+ appendSeparator: function()
+ {
+ if (this._items.length)
+ this._pendingSeparator = true;
+ },
+
+ _pushItem: function(item)
+ {
+ if (this._pendingSeparator) {
+ this._items.push(new WebInspector.ContextMenuItem(this._contextMenu, "separator"));
+ delete this._pendingSeparator;
+ }
+ this._items.push(item);
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isEmpty: function()
+ {
+ return !this._items.length;
+ },
+
+ _buildDescriptor: function()
+ {
+ var result = { type: "subMenu", label: this._label, enabled: !this._disabled, subItems: [] };
+ for (var i = 0; i < this._items.length; ++i)
+ result.subItems.push(this._items[i]._buildDescriptor());
+ return result;
+ },
+
+ __proto__: WebInspector.ContextMenuItem.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.ContextSubMenuItem}
+ */
+WebInspector.ContextMenu = function(event) {
+ WebInspector.ContextSubMenuItem.call(this, this, "");
+ this._event = event;
+ this._handlers = {};
+ this._id = 0;
+}
+
+WebInspector.ContextMenu.prototype = {
+
+ // Public
+
+ nextId: function()
+ {
+ return this._id++;
+ },
+
+ show: function()
+ {
+ console.assert(this._event instanceof MouseEvent);
+
+ var menuObject = this._buildDescriptor();
+
+ if (menuObject.length) {
+ WebInspector._contextMenu = this;
+ if (this._event.type !== "contextmenu" && typeof InspectorFrontendHost.dispatchEventAsContextMenuEvent === "function") {
+ this._menuObject = menuObject;
+ this._event.target.addEventListener("contextmenu", this, true);
+ InspectorFrontendHost.dispatchEventAsContextMenuEvent(this._event);
+ } else
+ InspectorFrontendHost.showContextMenu(this._event, menuObject);
+ }
+ if (this._event)
+ this._event.stopImmediatePropagation();
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ this._event.target.removeEventListener("contextmenu", this, true);
+ InspectorFrontendHost.showContextMenu(event, this._menuObject);
+ delete this._menuObject;
+
+ event.stopImmediatePropagation();
+ },
+
+ // Private
+
+ _setHandler: function(id, handler)
+ {
+ if (handler)
+ this._handlers[id] = handler;
+ },
+
+ _buildDescriptor: function()
+ {
+ var result = [];
+ for (var i = 0; i < this._items.length; ++i)
+ result.push(this._items[i]._buildDescriptor());
+ return result;
+ },
+
+ _itemSelected: function(id)
+ {
+ if (this._handlers[id])
+ this._handlers[id].call(this);
+ },
+
+ /**
+ * @param {Object} target
+ */
+ appendApplicableItems: function(target)
+ {
+ for (var i = 0; i < WebInspector.ContextMenu._providers.length; ++i) {
+ var provider = WebInspector.ContextMenu._providers[i];
+ this.appendSeparator();
+ provider.appendApplicableItems(this._event, this, target);
+ this.appendSeparator();
+ }
+ },
+
+ __proto__: WebInspector.ContextSubMenuItem.prototype
+}
+
+/**
+ * @interface
+ */
+WebInspector.ContextMenu.Provider = function()
+{
+}
+
+WebInspector.ContextMenu.Provider.prototype = {
+ /**
+ * @param {WebInspector.ContextMenu} contextMenu
+ * @param {Object} target
+ */
+ appendApplicableItems: function(event, contextMenu, target) { }
+}
+
+/**
+ * @param {WebInspector.ContextMenu.Provider} provider
+ */
+WebInspector.ContextMenu.registerProvider = function(provider)
+{
+ WebInspector.ContextMenu._providers.push(provider);
+}
+
+WebInspector.ContextMenu._providers = [];
+
+WebInspector.contextMenuItemSelected = function(id)
+{
+ if (WebInspector._contextMenu)
+ WebInspector._contextMenu._itemSelected(id);
+}
+
+WebInspector.contextMenuCleared = function()
+{
+ // FIXME: Unfortunately, contextMenuCleared is invoked between show and item selected
+ // so we can't delete last menu object from WebInspector. Fix the contract.
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsControlToolbarItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceControlToolbarItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.toolbar .item.control {
+ -webkit-align-items: center;
+ -webkit-justify-content: center;
+
+ padding: 3px 2px;
+
+ opacity: 0.5;
+}
+
+.toolbar.small-size .item.control {
+ padding: 2px;
+}
+
+.toolbar.icon-and-label-horizontal .item.control,
+.toolbar.icon-only .item.control {
+ padding: 0 2px;
+}
+
+.toolbar .item.control:hover {
+ opacity: 0.8;
+}
+
+.toolbar .item.control:active {
+ opacity: 1;
+}
+
+.toolbar .item.control > .glyph {
+ width: 16px;
+ height: 16px;
+
+ background-repeat: no-repeat;
+ background-position: center center;
+}
+
+body.window-inactive .toolbar .item.control {
+ opacity: 0.35;
+}
+
+.toolbar .item.control.disabled {
+ opacity: 0.35 !important;
+}
+
+body.window-inactive .toolbar .item.control.disabled {
+ opacity: 0.2 !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsControlToolbarItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceControlToolbarItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ControlToolbarItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ControlToolbarItem = function(identifier, toolTip, image, imageWidth, imageHeight)
+{
+ WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, false);
+};
+
+WebInspector.ControlToolbarItem.StyleClassName = "control";
+
+WebInspector.ControlToolbarItem.prototype = {
+ constructor: WebInspector.ControlToolbarItem,
+
+ // Private
+
+ _additionalClassNames: [WebInspector.ControlToolbarItem.StyleClassName],
+};
+
+WebInspector.ControlToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCookieIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceCookieIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CookieIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CookieIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CookieIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookieIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.cookie-icon .icon {
+ content: -webkit-image-set(url(../Images/Cookie.png) 1x, url(../Images/Cookie@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.cookie-storage > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCookieStorageContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CookieStorageContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,262 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.element.classList.add(WebInspector.CookieStorageContentView.StyleClassName);
+
+ this.update();
+};
+
+WebInspector.CookieStorageContentView.StyleClassName = "cookie-storage";
+
+WebInspector.CookieStorageContentView.prototype = {
+ constructor: WebInspector.CookieStorageContentView,
+
+ // Public
+
+ update: function()
+ {
+ function callback(error, cookies)
+ {
+ if (error)
+ return;
+
+ this._cookies = this._filterCookies(cookies);
+ this._rebuildTable();
+ }
+
+ PageAgent.getCookies(callback.bind(this));
+ },
+
+ updateLayout: function()
+ {
+ if (this._dataGrid)
+ this._dataGrid.updateLayout();
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.CookieStorage;
+ cookie.host = this.representedObject.host;
+ },
+
+ get scrollableElements()
+ {
+ if (!this._dataGrid)
+ return [];
+ return [this._dataGrid.scrollContainer];
+ },
+
+ // Private
+
+ _rebuildTable: function()
+ {
+ // FIXME: If there are no cookies, do we want to show an empty datagrid, or do something like the old
+ // inspector and show some text saying there are no cookies?
+ if (!this._dataGrid) {
+ var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
+ columns[0].title = WebInspector.UIString("Name");
+ columns[0].sortable = true;
+ columns[0].width = "24%";
+ columns[1].title = WebInspector.UIString("Value");
+ columns[1].sortable = true;
+ columns[1].width = "34%";
+ columns[2].title = WebInspector.UIString("Domain");
+ columns[2].sortable = true;
+ columns[2].width = "7%";
+ columns[3].title = WebInspector.UIString("Path");
+ columns[3].sortable = true;
+ columns[3].width = "7%";
+ columns[4].title = WebInspector.UIString("Expires");
+ columns[4].sortable = true;
+ columns[4].width = "7%";
+ columns[5].title = WebInspector.UIString("Size");
+ columns[5].aligned = "right";
+ columns[5].sortable = true;
+ columns[5].width = "7%";
+ columns[6].title = WebInspector.UIString("HTTP");
+ columns[6].aligned = "centered";
+ columns[6].sortable = true;
+ columns[6].width = "7%";
+ columns[7].title = WebInspector.UIString("Secure");
+ columns[7].aligned = "centered";
+ columns[7].sortable = true;
+ columns[7].width = "7%";
+
+ this._dataGrid = new WebInspector.DataGrid(columns, null, this._deleteCallback.bind(this));
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._rebuildTable, this);
+
+ this.element.appendChild(this._dataGrid.element);
+ this._dataGrid.updateLayout();
+ }
+
+ console.assert(this._dataGrid);
+ this._dataGrid.removeChildren();
+
+ this._sortCookies(this._cookies);
+
+ for (var i = 0; i < this._cookies.length; ++i) {
+ const cookie = this._cookies[i];
+
+ var data = {};
+ data[0] = cookie.name;
+ data[1] = cookie.value;
+ data[2] = cookie.domain || "";
+ data[3] = cookie.path || "";
+
+ if (cookie.type === WebInspector.CookieType.Request)
+ data[4] = "";
+ else
+ data[4] = cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toLocaleString();
+
+ data[5] = Number.bytesToString(cookie.size);
+ const checkmark = "\u2713";
+ data[6] = cookie.httpOnly ? checkmark : "";
+ data[7] = cookie.secure ? checkmark : "";
+
+ var node = new WebInspector.DataGridNode(data);
+ node.cookie = cookie;
+ node.selectable = true;
+
+ this._dataGrid.appendChild(node);
+ }
+ },
+
+ _filterCookies: function(cookies)
+ {
+ var filteredCookies = [];
+ var resourcesForDomain = [];
+
+ var frames = WebInspector.frameResourceManager.frames;
+ for (var i = 0; i < frames.length; ++i) {
+ var resources = frames[i].resources;
+ for (var j = 0; j < resources.length; ++j) {
+ var urlComponents = resources[j].urlComponents;
+ if (urlComponents && urlComponents.host && urlComponents.host === this.representedObject.host)
+ resourcesForDomain.push(resources[j].url);
+ }
+
+ // The main resource isn't always in the list of resources, make sure to add it to the list of resources
+ // we get the URLs from.
+ var mainResourceURLComponents = frames[i].mainResource.urlComponents;
+ if (mainResourceURLComponents && mainResourceURLComponents.host && mainResourceURLComponents.host == this.representedObject.host)
+ resourcesForDomain.push(frames[i].mainResource.url);
+ }
+
+ for (var i = 0; i < cookies.length; ++i) {
+ for (var j = 0; j < resourcesForDomain.length; ++j) {
+ if (WebInspector.cookieMatchesResourceURL(cookies[i], resourcesForDomain[j])) {
+ filteredCookies.push(cookies[i]);
+ break;
+ }
+ }
+ }
+
+ return filteredCookies;
+ },
+
+ _sortCookies: function(cookies)
+ {
+ var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function localeCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
+ }
+
+ function numberCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] - cookie2[field]);
+ }
+
+ function expiresCompare(cookie1, cookie2)
+ {
+ if (cookie1.session !== cookie2.session)
+ return sortDirection * (cookie1.session ? 1 : -1);
+
+ if (cookie1.session)
+ return 0;
+
+ return sortDirection * (cookie1.expires - cookie2.expires);
+ }
+
+ var comparator;
+ switch (parseInt(this._dataGrid.sortColumnIdentifier, 10)) {
+ case 0: comparator = localeCompare.bind(this, "name"); break;
+ case 1: comparator = localeCompare.bind(this, "value"); break;
+ case 2: comparator = localeCompare.bind(this, "domain"); break;
+ case 3: comparator = localeCompare.bind(this, "path"); break;
+ case 4: comparator = expiresCompare; break;
+ case 5: comparator = numberCompare.bind(this, "size"); break;
+ case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
+ case 7: comparator = localeCompare.bind(this, "secure"); break;
+ default: localeCompare.bind(this, "name");
+ }
+
+ cookies.sort(comparator);
+ },
+
+ _deleteCallback: function(node)
+ {
+ if (!node || !node.cookie)
+ return;
+
+ var cookie = node.cookie;
+ var cookieURL = (cookie.secure ? "https://" : "http://") + cookie.domain + cookie.path;
+
+ // COMPATIBILITY (iOS 6): PageAgent.deleteCookie used to take 'domain', now takes 'url'. Send both.
+ PageAgent.deleteCookie.invoke({cookieName: cookie.name, domain: cookie.domain, url: cookieURL});
+
+ this.update();
+ }
+};
+
+WebInspector.CookieStorageContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
+
+WebInspector.cookieMatchesResourceURL = function(cookie, resourceURL)
+{
+ var parsedURL = parseURL(resourceURL);
+ if (!parsedURL || !WebInspector.cookieDomainMatchesResourceDomain(cookie.domain, parsedURL.host))
+ return false;
+
+ return (parsedURL.path.startsWith(cookie.path)
+ && (!cookie.port || parsedURL.port == cookie.port)
+ && (!cookie.secure || parsedURL.scheme === "https"));
+}
+
+WebInspector.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain)
+{
+ if (cookieDomain.charAt(0) !== '.')
+ return resourceDomain === cookieDomain;
+ return !!resourceDomain.match(new RegExp("^([^\\.]+\\.)?" + cookieDomain.substring(1).escapeForRegExp() + "$"), "i");
+}
+
+WebInspector.CookieType = {
+ Request: 0,
+ Response: 1
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCookieStorageTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceCookieStorageTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/CookieStorageTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CookieStorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.CookieStorageTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.CookieStorageObject);
+
+ WebInspector.StorageTreeElement.call(this, WebInspector.CookieStorageTreeElement.CookieIconStyleClassName, WebInspector.displayNameForHost(representedObject.host), representedObject);
+};
+
+WebInspector.CookieStorageTreeElement.CookieIconStyleClassName = "cookie-icon";
+
+WebInspector.CookieStorageTreeElement.prototype = {
+ constructor: WebInspector.CookieStorageTreeElement,
+
+ // Public
+
+ get name()
+ {
+ return this.representedObject.host;
+ },
+
+ get categoryName()
+ {
+ return WebInspector.UIString("Cookies");
+ }
+};
+
+WebInspector.CookieStorageTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMDetailsSidebarPanel = function(identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element) {
+ WebInspector.DetailsSidebarPanel.call(this, identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element);
+
+ this.element.addEventListener("click", this._mouseWasClicked.bind(this), true);
+
+ this._domNode = null;
+};
+
+WebInspector.DOMDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.DOMDetailsSidebarPanel,
+
+ // Public
+
+ inspect: function(objects)
+ {
+ // Convert to a single item array if needed.
+ if (!(objects instanceof Array))
+ objects = [objects];
+
+ var nodeToInspect = null;
+
+ // Iterate over the objects to find a WebInspector.DOMNode to inspect.
+ for (var i = 0; i < objects.length; ++i) {
+ if (objects[i] instanceof WebInspector.DOMNode) {
+ nodeToInspect = objects[i];
+ break;
+ }
+ }
+
+ if (nodeToInspect && !this.supportsDOMNode(nodeToInspect))
+ nodeToInspect = null;
+
+ this.domNode = nodeToInspect;
+
+ return !!this._domNode;
+ },
+
+ get domNode()
+ {
+ return this._domNode;
+ },
+
+ set domNode(domNode)
+ {
+ if (domNode === this._domNode)
+ return;
+
+ if (this._domNode)
+ this.removeEventListeners();
+
+ this._domNode = domNode;
+
+ if (this._domNode)
+ this.addEventListeners();
+
+ this.needsRefresh();
+ },
+
+ supportsDOMNode: function(nodeToInspect)
+ {
+ // Implemented by subclasses.
+ return true;
+ },
+
+ addEventListeners: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ removeEventListeners: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ // Private
+
+ _mouseWasClicked: function(event)
+ {
+ if (this._domNode && this._domNode.ownerDocument) {
+ var mainResource = WebInspector.frameResourceManager.resourceForURL(this._domNode.ownerDocument.documentURL);
+ if (mainResource)
+ var parentFrame = mainResource.parentFrame;
+ }
+
+ WebInspector.handlePossibleLinkClick(event, parentFrame);
+ }
+};
+
+WebInspector.DOMDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMNodeDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMNodeDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMNodeDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,365 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMNodeDetailsSidebarPanel = function() {
+ WebInspector.DOMDetailsSidebarPanel.call(this, "dom-node-details", WebInspector.UIString("Node"), WebInspector.UIString("Node"), "Images/NavigationItemAngleBrackets.svg", "2");
+
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._attributesChanged, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._attributesChanged, this);
+
+ this.element.classList.add(WebInspector.DOMNodeDetailsSidebarPanel.StyleClassName);
+
+ this._identityNodeTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type"));
+ this._identityNodeNameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Name"));
+ this._identityNodeValueRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Value"));
+
+ var identityGroup = new WebInspector.DetailsSectionGroup([this._identityNodeTypeRow, this._identityNodeNameRow, this._identityNodeValueRow]);
+ var identitySection = new WebInspector.DetailsSection("dom-node-identity", WebInspector.UIString("Identity"), [identityGroup]);
+
+ this._attributesDataGridRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Attributes"));
+
+ var attributesGroup = new WebInspector.DetailsSectionGroup([this._attributesDataGridRow]);
+ var attributesSection = new WebInspector.DetailsSection("dom-node-attributes", WebInspector.UIString("Attributes"), [attributesGroup]);
+
+ this._propertiesRow = new WebInspector.DetailsSectionRow;
+
+ var propertiesGroup = new WebInspector.DetailsSectionGroup([this._propertiesRow]);
+ var propertiesSection = new WebInspector.DetailsSection("dom-node-properties", WebInspector.UIString("Properties"), [propertiesGroup]);
+
+ this._eventListenersSectionGroup = new WebInspector.DetailsSectionGroup;
+ var eventListenersSection = new WebInspector.DetailsSection("dom-node-event-listeners", WebInspector.UIString("Event Listeners"), [this._eventListenersSectionGroup]);
+
+ this._accessibilityEmptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Accessibility Information"));
+ this._accessibilityNodeIgnoredRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Ignored"));
+ this._accessibilityNodeInvalidRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Invalid"));
+ this._accessibilityNodeLabelRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Label"));
+ this._accessibilityNodeRequiredRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Required"));
+ this._accessibilityNodeRoleRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Role"));
+
+ this._accessibilityGroup = new WebInspector.DetailsSectionGroup([this._accessibilityEmptyRow]);
+ var accessibilitySection = new WebInspector.DetailsSection("dom-node-accessibility", WebInspector.UIString("Accessibility"), [this._accessibilityGroup]);
+
+ this.element.appendChild(identitySection.element);
+ this.element.appendChild(attributesSection.element);
+ this.element.appendChild(propertiesSection.element);
+ this.element.appendChild(eventListenersSection.element);
+ this.element.appendChild(accessibilitySection.element);
+};
+
+WebInspector.DOMNodeDetailsSidebarPanel.StyleClassName = "dom-node";
+WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName = "dom-node-details-sidebar-properties-object-group";
+
+WebInspector.DOMNodeDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.DOMNodeDetailsSidebarPanel,
+
+ // Public
+
+ refresh: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode)
+ return;
+
+ this._identityNodeTypeRow.value = this._nodeTypeDisplayName();
+ this._identityNodeNameRow.value = domNode.nodeNameInCorrectCase();
+ this._identityNodeValueRow.value = domNode.nodeValue();
+
+ this._refreshAttributes();
+ this._refreshProperties();
+ this._refreshEventListeners();
+ this._refreshAccessibility();
+ },
+
+ // Private
+
+ _refreshAttributes: function()
+ {
+ this._attributesDataGridRow.dataGrid = this._createAttributesDataGrid();
+ },
+
+ _refreshProperties: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode)
+ return;
+
+ RuntimeAgent.releaseObjectGroup(WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName);
+ WebInspector.RemoteObject.resolveNode(domNode, WebInspector.DOMNodeDetailsSidebarPanel.PropertiesObjectGroupName, nodeResolved.bind(this));
+
+ function nodeResolved(object)
+ {
+ if (!object)
+ return;
+
+ // Bail if the DOM node changed while we were waiting for the async response.
+ if (this.domNode !== domNode)
+ return;
+
+ function collectPrototypes()
+ {
+ // This builds an object with numeric properties. This is easier than dealing with arrays
+ // with the way RemoteObject works. Start at 1 since we use parseInt later and parseInt
+ // returns 0 for non-numeric strings make it ambiguous.
+ var prototype = this;
+ var result = [];
+ var counter = 1;
+
+ while (prototype) {
+ result[counter++] = prototype;
+ prototype = prototype.__proto__;
+ }
+
+ return result;
+ }
+
+ object.callFunction(collectPrototypes, undefined, nodePrototypesReady.bind(this));
+ object.release();
+ }
+
+ function nodePrototypesReady(object)
+ {
+ if (!object)
+ return;
+
+ // Bail if the DOM node changed while we were waiting for the async response.
+ if (this.domNode !== domNode)
+ return;
+
+ object.getOwnProperties(fillSection.bind(this));
+ }
+
+ function fillSection(prototypes)
+ {
+ if (!prototypes)
+ return;
+
+ // Bail if the DOM node changed while we were waiting for the async response.
+ if (this.domNode !== domNode)
+ return;
+
+ var element = this._propertiesRow.element;
+ element.removeChildren();
+
+ // Get array of prototype user-friendly names.
+ for (var i = 0; i < prototypes.length; ++i) {
+ // The only values we care about are numeric, as assigned in collectPrototypes.
+ if (!parseInt(prototypes[i].name, 10))
+ continue;
+
+ var prototype = prototypes[i].value;
+ var title = prototype.description;
+ if (title.match(/Prototype$/))
+ title = title.replace(/Prototype$/, WebInspector.UIString(" (Prototype)"));
+ else if (title === "Object")
+ title = title + WebInspector.UIString(" (Prototype)");
+
+ var propertiesSection = new WebInspector.ObjectPropertiesSection(prototype);
+
+ var detailsSection = new WebInspector.DetailsSection(prototype.description.hash + "-prototype-properties", title, null, null, true);
+ detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(propertiesSection)];
+
+ element.appendChild(detailsSection.element);
+ }
+ }
+ },
+
+ _refreshEventListeners: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode)
+ return;
+
+ domNode.eventListeners(eventListenersCallback.bind(this));
+
+ function eventListenersCallback(error, eventListeners)
+ {
+ if (error)
+ return;
+
+ // Bail if the DOM node changed while we were waiting for the async response.
+ if (this.domNode !== domNode)
+ return;
+
+ var eventListenerTypes = [];
+ var eventListenerSections = {};
+ for (var i = 0; i < eventListeners.length; ++i) {
+ var eventListener = eventListeners[i];
+ eventListener.node = WebInspector.domTreeManager.nodeForId(eventListener.nodeId);
+
+ var type = eventListener.type;
+ var section = eventListenerSections[type];
+ if (!section) {
+ section = new WebInspector.EventListenerSection(type, domNode.id);
+ eventListenerSections[type] = section;
+ eventListenerTypes.push(type);
+ }
+
+ section.addListener(eventListener);
+ }
+
+ if (!eventListenerTypes.length) {
+ var emptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Event Listeners"));
+ emptyRow.showEmptyMessage();
+ this._eventListenersSectionGroup.rows = [emptyRow];
+ return;
+ }
+
+ eventListenerTypes.sort();
+
+ var rows = [];
+ for (var i = 0; i < eventListenerTypes.length; ++i)
+ rows.push(eventListenerSections[eventListenerTypes[i]]);
+ this._eventListenersSectionGroup.rows = rows;
+ }
+ },
+
+ _refreshAccessibility: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode)
+ return;
+
+ function accessibilityPropertiesCallback(accessibilityProperties)
+ {
+ if (this.domNode !== domNode)
+ return;
+
+ if (accessibilityProperties && accessibilityProperties.exists) {
+
+ var ignored = "";
+ if (accessibilityProperties.ignored) {
+ ignored = WebInspector.UIString("Yes");
+ if (accessibilityProperties.hidden)
+ ignored = WebInspector.UIString("%s (hidden)").format(ignored);
+ else if (accessibilityProperties.ignoredByDefault)
+ ignored = WebInspector.UIString("%s (default)").format(ignored);
+ }
+
+ var invalid = accessibilityProperties.invalid ? accessibilityProperties.invalid : "";
+
+ // FIXME: label will always come back as empty. Blocked by http://webkit.org/b/121134
+ var label = accessibilityProperties.label;
+ if (label && label !== domNode.getAttribute("aria-label"))
+ label = WebInspector.UIString("%s (computed)").format(label);
+
+ var required = "";
+ if (accessibilityProperties.required !== undefined) {
+ if (accessibilityProperties.required)
+ required = WebInspector.UIString("Yes");
+ else
+ required = WebInspector.UIString("No");
+ }
+
+ var role = accessibilityProperties.role;
+ if (role === "" || role === "unknown")
+ role = WebInspector.UIString("No exact ARIA role match.");
+ else if (role) {
+ if (!domNode.getAttribute("role"))
+ role = WebInspector.UIString("%s (default)").format(role);
+ else if (domNode.getAttribute("role") !== role)
+ role = WebInspector.UIString("%s (computed)").format(role);
+ }
+
+ this._accessibilityNodeIgnoredRow.value = ignored;
+ this._accessibilityNodeInvalidRow.value = invalid;
+ this._accessibilityNodeLabelRow.value = label;
+ this._accessibilityNodeRequiredRow.value = required;
+ this._accessibilityNodeRoleRow.value = role;
+
+ this._accessibilityGroup.rows = [
+ this._accessibilityNodeIgnoredRow,
+ this._accessibilityNodeRoleRow,
+ this._accessibilityNodeLabelRow,
+ this._accessibilityNodeRequiredRow,
+ this._accessibilityNodeInvalidRow
+ ];
+
+ this._accessibilityEmptyRow.hideEmptyMessage();
+
+ } else {
+ this._accessibilityGroup.rows = [this._accessibilityEmptyRow];
+ this._accessibilityEmptyRow.showEmptyMessage();
+ }
+ }
+ domNode.accessibilityProperties(accessibilityPropertiesCallback.bind(this));
+ },
+
+ _attributesChanged: function(event)
+ {
+ if (event.data.node !== this.domNode)
+ return;
+ this._refreshAttributes();
+ this._refreshAccessibility();
+ },
+
+ _nodeTypeDisplayName: function()
+ {
+ switch (this.domNode.nodeType()) {
+ case Node.ELEMENT_NODE:
+ return WebInspector.UIString("Element");
+ case Node.TEXT_NODE:
+ return WebInspector.UIString("Text Node");
+ case Node.COMMENT_NODE:
+ return WebInspector.UIString("Comment");
+ case Node.DOCUMENT_NODE:
+ return WebInspector.UIString("Document");
+ case Node.DOCUMENT_TYPE_NODE:
+ return WebInspector.UIString("Document Type");
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ return WebInspector.UIString("Document Fragment");
+ case Node.CDATA_SECTION_NODE:
+ return WebInspector.UIString("Character Data");
+ case Node.PROCESSING_INSTRUCTION_NODE:
+ return WebInspector.UIString("Processing Instruction");
+ default:
+ console.error("Unknown DOM node type: ", this.domNode.nodeType());
+ return this.domNode.nodeType();
+ }
+ },
+
+ _createAttributesDataGrid: function()
+ {
+ var domNode = this.domNode;
+ if (!domNode || !domNode.hasAttributes())
+ return null;
+
+ var columns = {name: {title: WebInspector.UIString("Name"), width: "30%"}, value: {title: WebInspector.UIString("Value")}};
+ var dataGrid = new WebInspector.DataGrid(columns);
+
+ var attributes = domNode.attributes();
+ for (var i = 0; i < attributes.length; ++i) {
+ var attribute = attributes[i];
+
+ var node = new WebInspector.DataGridNode({name: attribute.name, value: attribute.value || ""}, false);
+ node.selectable = true;
+
+ dataGrid.appendChild(node);
+ }
+
+ return dataGrid;
+ }
+};
+
+WebInspector.DOMNodeDetailsSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.dom-storage > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ outline: none;
+ border: none;
+}
+
+.content-view.dom-storage > .data-grid tr.duplicate-key td.key-column,
+.content-view.dom-storage > .data-grid tr.missing-key td.key-column,
+.content-view.dom-storage > .data-grid tr.missing-value td.value-column {
+ background-color: #fee;
+}
+
+.content-view.dom-storage > .data-grid:focus tr.selected.duplicate-key td.key-column,
+.content-view.dom-storage > .data-grid:focus tr.selected.missing-key td.key-column,
+.content-view.dom-storage > .data-grid:focus tr.selected.missing-value td.value-column {
+ background-color: #daa;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,242 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.element.classList.add(WebInspector.DOMStorageContentView.StyleClassName);
+
+ representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemsCleared, this.itemsCleared, this);
+ representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemAdded, this.itemAdded, this);
+ representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemRemoved, this.itemRemoved, this);
+ representedObject.addEventListener(WebInspector.DOMStorageObject.Event.ItemUpdated, this.itemUpdated, this);
+
+ this.reset();
+};
+
+WebInspector.DOMStorageContentView.StyleClassName = "dom-storage";
+WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName = "duplicate-key";
+WebInspector.DOMStorageContentView.MissingKeyStyleClassName = "missing-key";
+WebInspector.DOMStorageContentView.MissingValueStyleClassName = "missing-value";
+
+
+WebInspector.DOMStorageContentView.prototype = {
+ constructor: WebInspector.DOMStorageContentView,
+ __proto__: WebInspector.ContentView.prototype,
+
+ // Public
+
+ reset: function()
+ {
+ this.representedObject.getEntries(function(error, entries) {
+ if (error)
+ return;
+
+ if (!this._dataGrid) {
+ var columns = {};
+ columns.key = {title: WebInspector.UIString("Key"), sortable: true};
+ columns.value = {title: WebInspector.UIString("Value"), sortable: true};
+
+ this._dataGrid = new WebInspector.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this));
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
+
+ this.element.appendChild(this._dataGrid.element);
+ }
+
+ console.assert(this._dataGrid);
+
+ var nodes = [];
+ for (var entry of entries) {
+ if (!entry[0] || !entry[1])
+ continue;
+ var data = {key: entry[0], value: entry[1]};
+ var node = new WebInspector.DataGridNode(data, false);
+ node.selectable = true;
+ this._dataGrid.appendChild(node);
+ }
+
+ this._sortDataGrid();
+ this._dataGrid.addPlaceholderNode();
+ this._dataGrid.updateLayout();
+ }.bind(this));
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.DOMStorage;
+ cookie.isLocalStorage = this.representedObject.isLocalStorage();
+ cookie.host = this.representedObject.host;
+ },
+
+ itemsCleared: function(event)
+ {
+ this._dataGrid.removeChildren();
+ this._dataGrid.addPlaceholderNode();
+ },
+
+ itemRemoved: function(event)
+ {
+ for (var node of this._dataGrid.children) {
+ if (node.data.key === event.data.key)
+ return this._dataGrid.removeChild(node);
+ }
+ },
+
+ itemAdded: function(event)
+ {
+ var key = event.data.key;
+ var value = event.data.value;
+
+ // Enforce key uniqueness.
+ for (var node of this._dataGrid.children) {
+ if (node.data.key === key)
+ return;
+ }
+
+ var data = {key: key, value: value};
+ this._dataGrid.appendChild(new WebInspector.DataGridNode(data, false));
+ this._sortDataGrid();
+ },
+
+ itemUpdated: function(event)
+ {
+ var key = event.data.key;
+ var value = event.data.value;
+
+ var keyFound = false;
+ for (var childNode of this._dataGrid.children) {
+ if (childNode.data.key === key) {
+ // Remove any rows that are now duplicates.
+ if (keyFound) {
+ this._dataGrid.removeChild(childNode);
+ continue;
+ }
+
+ keyFound = true;
+ childNode.data.value = value;
+ childNode.refresh();
+ }
+ }
+ this._sortDataGrid();
+ },
+
+ updateLayout: function()
+ {
+ if (this._dataGrid)
+ this._dataGrid.updateLayout();
+ },
+
+ get scrollableElements()
+ {
+ if (!this._dataGrid)
+ return [];
+ return [this._dataGrid.scrollContainer];
+ },
+
+ // Private
+
+ _sortDataGrid: function()
+ {
+ if (!this._dataGrid.sortOrder)
+ return;
+
+ var sortColumnIdentifier = this._dataGrid.sortColumnIdentifier || "key";
+
+ function comparator(a, b)
+ {
+ return b.data[sortColumnIdentifier].localeCompare(a.data[sortColumnIdentifier]);
+ }
+
+ this._dataGrid.sortNodes(comparator, this._dataGrid.sortOrder);
+ },
+
+ _deleteCallback: function(node)
+ {
+ if (!node || node.isPlaceholderNode)
+ return;
+
+ this._dataGrid.removeChild(node);
+ this.representedObject.removeItem(node.data["key"]);
+ },
+
+ _editingCallback: function(editingNode, columnIdentifier, oldText, newText, moveDirection)
+ {
+ var key = editingNode.data["key"].trim();
+ var value = editingNode.data["value"].trim();
+ var previousValue = oldText.trim();
+ var enteredValue = newText.trim();
+ var columnIndex = this._dataGrid.orderedColumns.indexOf(columnIdentifier);
+ var mayMoveToNextRow = moveDirection === "forward" && columnIndex == this._dataGrid.orderedColumns.length - 1;
+ var mayMoveToPreviousRow = moveDirection === "backward" && columnIndex == 0;
+ var willMoveRow = mayMoveToNextRow || mayMoveToPreviousRow;
+ var shouldCommitRow = willMoveRow && key.length && value.length;
+
+ // Remove the row if its values are newly cleared, and it's not a placeholder.
+ if (!key.length && !value.length && willMoveRow) {
+ if (previousValue.length && !editingNode.isPlaceholderNode)
+ this._dataGrid.removeChild(editingNode);
+ return;
+ }
+
+ // If the key field was deleted, restore it when committing the row.
+ if (key === enteredValue && !key.length) {
+ if (willMoveRow && !editingNode.isPlaceholderNode) {
+ editingNode.data.key = previousValue;
+ editingNode.refresh();
+ } else
+ editingNode.element.classList.add(WebInspector.DOMStorageContentView.MissingKeyStyleClassName);
+ } else if (key.length) {
+ editingNode.element.classList.remove(WebInspector.DOMStorageContentView.MissingKeyStyleClassName);
+ editingNode.__previousKeyValue = previousValue;
+ }
+
+ if (value === enteredValue && !value.length)
+ editingNode.element.classList.add(WebInspector.DOMStorageContentView.MissingValueStyleClassName);
+ else
+ editingNode.element.classList.remove(WebInspector.DOMStorageContentView.MissingValueStyleClassName);
+
+ if (editingNode.isPlaceholderNode && previousValue !== enteredValue)
+ this._dataGrid.addPlaceholderNode();
+
+ if (!shouldCommitRow)
+ return; // One of the inputs is missing, or we aren't moving between rows.
+
+ var domStorage = this.representedObject;
+ if (domStorage.entries.has(key)) {
+ editingNode.element.classList.add(WebInspector.DOMStorageContentView.DuplicateKeyStyleClassName);
+ return;
+ }
+
+ editingNode.element.classList.remove(WebInspector.DOMStorageContentView.DuplicateKeySyleClassName);
+
+ if (editingNode.__previousKeyValue != key)
+ domStorage.removeItem(editingNode.__previousKeyValue);
+
+ domStorage.setItem(key, value);
+ // The table will be re-sorted when the backend fires the itemUpdated event.
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.local-storage-icon .icon {
+ content: -webkit-image-set(url(../Images/LocalStorage.png) 1x, url(../Images/LocalStorage@2x.png) 2x);
+}
+
+.session-storage-icon .icon {
+ content: -webkit-image-set(url(../Images/SessionStorage.png) 1x, url(../Images/SessionStorage@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMStorageTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMStorageTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMStorageTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMStorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMStorageTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.DOMStorageObject);
+
+ if (representedObject.isLocalStorage())
+ var className = WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName;
+ else
+ var className = WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName;
+
+ WebInspector.StorageTreeElement.call(this, className, WebInspector.displayNameForHost(representedObject.host), representedObject);
+};
+
+WebInspector.DOMStorageTreeElement.LocalStorageIconStyleClassName = "local-storage-icon";
+WebInspector.DOMStorageTreeElement.SessionStorageIconStyleClassName = "session-storage-icon";
+
+WebInspector.DOMStorageTreeElement.prototype = {
+ constructor: WebInspector.DOMStorageTreeElement,
+
+ // Public
+
+ get name()
+ {
+ return WebInspector.displayNameForHost(this.representedObject.host);
+ },
+
+ get categoryName()
+ {
+ if (this.representedObject.isLocalStorage())
+ return WebInspector.UIString("Local Storage");
+ return WebInspector.UIString("Session Storage");
+ }
+};
+
+WebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.dom-tree {
+ overflow: auto;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,426 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeContentView = function(representedObject)
+{
+ console.assert(representedObject);
+
+ WebInspector.ContentView.call(this, representedObject);
+
+ this._compositingBordersButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("layer-borders", WebInspector.UIString("Show compositing borders"), WebInspector.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 16, 16);
+ this._compositingBordersButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this);
+ this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible;
+
+ WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+ this._showsShadowDOMButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("shows-shadow-DOM", WebInspector.UIString("Show shadow DOM nodes"), WebInspector.UIString("Hide shadow DOM nodes"), "Images/ShadowDOM.svg", 16, 16);
+ this._showsShadowDOMButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleShowsShadowDOMSetting, this);
+ this._showShadowDOMSettingChanged();
+
+ this.element.classList.add(WebInspector.DOMTreeContentView.StyleClassName);
+ this.element.addEventListener("click", this._mouseWasClicked.bind(this), false);
+
+ this._domTreeOutline = new WebInspector.DOMTreeOutline(true, true, false);
+ this._domTreeOutline.addEventListener(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged, this._selectedNodeDidChange, this);
+ this._domTreeOutline.wireToDomAgent();
+ this.element.appendChild(this._domTreeOutline.element);
+
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._domNodeChanged, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._domNodeChanged, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified, this._domNodeChanged, this);
+
+ this._lastSelectedNodePathSetting = new WebInspector.Setting("last-selected-node-path", null);
+
+ this._numberOfSearchResults = null;
+};
+
+WebInspector.DOMTreeContentView.StyleClassName = "dom-tree";
+
+WebInspector.DOMTreeContentView.prototype = {
+ constructor: WebInspector.DOMTreeContentView,
+ __proto__: WebInspector.ContentView.prototype,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this._showsShadowDOMButtonNavigationItem, this._compositingBordersButtonNavigationItem];
+ },
+
+ get domTreeOutline()
+ {
+ return this._domTreeOutline;
+ },
+
+ get scrollableElements()
+ {
+ return [this.element];
+ },
+
+ updateLayout: function()
+ {
+ this._domTreeOutline.updateSelection();
+ },
+
+ shown: function()
+ {
+ this._domTreeOutline.setVisible(true, WebInspector.isConsoleFocused());
+ this._updateCompositingBordersButtonToMatchPageSettings();
+ },
+
+ hidden: function()
+ {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ this._domTreeOutline.setVisible(false);
+ },
+
+ closed: function()
+ {
+ WebInspector.domTreeManager.removeEventListener(null, null, this);
+
+ this._domTreeOutline.close();
+ },
+
+ get selectionPathComponents()
+ {
+ var treeElement = this._domTreeOutline.selectedTreeElement;
+ var pathComponents = [];
+
+ while (treeElement && !treeElement.root) {
+ // The close tag is contained within the element it closes. So skip it since we don't want to
+ // show the same node twice in the hierarchy.
+ if (treeElement.isCloseTag()) {
+ treeElement = treeElement.parent;
+ continue;
+ }
+
+ var pathComponent = new WebInspector.DOMTreeElementPathComponent(treeElement, treeElement.representedObject);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ pathComponents.unshift(pathComponent);
+ treeElement = treeElement.parent;
+ }
+
+ return pathComponents;
+ },
+
+ selectAndRevealDOMNode: function(domNode, preventFocusChange)
+ {
+ this._domTreeOutline.selectDOMNode(domNode, !preventFocusChange);
+ },
+
+ handleCopyEvent: function(event)
+ {
+ var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
+ if (!selectedDOMNode)
+ return;
+
+ event.clipboardData.clearData();
+ event.preventDefault();
+
+ selectedDOMNode.copyNode();
+ },
+
+ get supportsSave()
+ {
+ return WebInspector.canArchiveMainFrame();
+ },
+
+ get saveData()
+ {
+ function saveHandler(forceSaveAs)
+ {
+ WebInspector.archiveMainFrame();
+ }
+
+ return { customSaveHandler: saveHandler };
+ },
+
+ get supportsSearch()
+ {
+ return true;
+ },
+
+ get numberOfSearchResults()
+ {
+ return this._numberOfSearchResults;
+ },
+
+ get hasPerformedSearch()
+ {
+ return this._numberOfSearchResults !== null;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ this._automaticallyRevealFirstSearchResult = reveal;
+
+ // If we haven't shown a search result yet, reveal one now.
+ if (this._automaticallyRevealFirstSearchResult && this._numberOfSearchResults > 0) {
+ if (this._currentSearchResultIndex === -1)
+ this.revealNextSearchResult();
+ }
+ },
+
+ performSearch: function(query)
+ {
+ if (this._searchQuery === query)
+ return;
+
+ if (this._searchIdentifier)
+ DOMAgent.discardSearchResults(this._searchIdentifier);
+
+ this._searchQuery = query;
+ this._searchIdentifier = null;
+ this._numberOfSearchResults = null;
+ this._currentSearchResultIndex = -1;
+
+ function searchResultsReady(error, searchIdentifier, resultsCount)
+ {
+ if (error)
+ return;
+
+ this._searchIdentifier = searchIdentifier;
+ this._numberOfSearchResults = resultsCount;
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+
+ if (this._automaticallyRevealFirstSearchResult)
+ this.revealNextSearchResult();
+ }
+
+ function contextNodesReady(nodeIds)
+ {
+ DOMAgent.performSearch(query, nodeIds, searchResultsReady.bind(this));
+ }
+
+ this.getSearchContextNodes(contextNodesReady.bind(this));
+ },
+
+ getSearchContextNodes: function(callback)
+ {
+ // Overwrite this to limit the search to just a subtree.
+ // Passing undefined will make DOMAgent.performSearch search through all the documents.
+ callback(undefined);
+ },
+
+ searchCleared: function()
+ {
+ if (this._searchIdentifier)
+ DOMAgent.discardSearchResults(this._searchIdentifier);
+
+ this._searchQuery = null;
+ this._searchIdentifier = null;
+ this._numberOfSearchResults = null;
+ this._currentSearchResultIndex = -1;
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ if (!this._numberOfSearchResults)
+ return;
+
+ if (this._currentSearchResultIndex > 0)
+ --this._currentSearchResultIndex;
+ else
+ this._currentSearchResultIndex = this._numberOfSearchResults - 1;
+
+ this._revealSearchResult(this._currentSearchResultIndex, changeFocus);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ if (!this._numberOfSearchResults)
+ return;
+
+ if (this._currentSearchResultIndex + 1 < this._numberOfSearchResults)
+ ++this._currentSearchResultIndex;
+ else
+ this._currentSearchResultIndex = 0;
+
+ this._revealSearchResult(this._currentSearchResultIndex, changeFocus);
+ },
+
+ // Private
+
+ _revealSearchResult: function(index, changeFocus)
+ {
+ console.assert(this._searchIdentifier);
+
+ var searchIdentifier = this._searchIdentifier;
+
+ function revealResult(error, nodeIdentifiers)
+ {
+ if (error)
+ return;
+
+ // Bail if the searchIdentifier changed since we started.
+ if (this._searchIdentifier !== searchIdentifier)
+ return;
+
+ console.assert(nodeIdentifiers.length === 1);
+
+ var domNode = WebInspector.domTreeManager.nodeForId(nodeIdentifiers[0]);
+ console.assert(domNode);
+ if (!domNode)
+ return;
+
+ this._domTreeOutline.selectDOMNode(domNode, changeFocus);
+ }
+
+ DOMAgent.getSearchResults(this._searchIdentifier, index, index + 1, revealResult.bind(this));
+ },
+
+ _restoreSelectedNodeAfterUpdate: function(documentURL, defaultNode)
+ {
+ function selectNode(lastSelectedNode)
+ {
+ var nodeToFocus = lastSelectedNode;
+ if (!nodeToFocus)
+ nodeToFocus = defaultNode;
+
+ if (!nodeToFocus)
+ return;
+
+ this._dontSetLastSelectedNodePath = true;
+ this.selectAndRevealDOMNode(nodeToFocus, WebInspector.isConsoleFocused());
+ this._dontSetLastSelectedNodePath = false;
+
+ // If this wasn't the last selected node, then expand it.
+ if (!lastSelectedNode && this._domTreeOutline.selectedTreeElement)
+ this._domTreeOutline.selectedTreeElement.expand();
+ }
+
+ function selectLastSelectedNode(nodeId)
+ {
+ selectNode.call(this, WebInspector.domTreeManager.nodeForId(nodeId));
+ }
+
+ if (documentURL && this._lastSelectedNodePathSetting.value && this._lastSelectedNodePathSetting.value.path && this._lastSelectedNodePathSetting.value.url === documentURL.hash)
+ WebInspector.domTreeManager.pushNodeByPathToFrontend(this._lastSelectedNodePathSetting.value.path, selectLastSelectedNode.bind(this));
+ else
+ selectNode.call(this);
+ },
+
+ _selectedNodeDidChange: function(event)
+ {
+ var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
+ if (selectedDOMNode && !this._dontSetLastSelectedNodePath)
+ this._lastSelectedNodePathSetting.value = {url: selectedDOMNode.ownerDocument.documentURL.hash, path: selectedDOMNode.path()};
+
+ if (selectedDOMNode)
+ ConsoleAgent.addInspectedNode(selectedDOMNode.id);
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _pathComponentSelected: function(event)
+ {
+ console.assert(event.data.pathComponent instanceof WebInspector.DOMTreeElementPathComponent);
+ console.assert(event.data.pathComponent.domTreeElement instanceof WebInspector.DOMTreeElement);
+
+ this._domTreeOutline.selectDOMNode(event.data.pathComponent.domTreeElement.representedObject, true);
+ },
+
+ _domNodeChanged: function(event)
+ {
+ var selectedDOMNode = this._domTreeOutline.selectedDOMNode();
+ if (selectedDOMNode !== event.data.node)
+ return;
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _mouseWasClicked: function(event)
+ {
+ var anchorElement = event.target.enclosingNodeOrSelfWithNodeName("a");
+ if (!anchorElement || !anchorElement.href)
+ return;
+
+ // Prevent the link from navigating, since we don't do any navigation by following links normally.
+ event.preventDefault();
+ event.stopPropagation();
+
+ if (WebInspector.isBeingEdited(anchorElement)) {
+ // Don't follow the link when it is being edited.
+ return;
+ }
+
+ // Cancel any pending link navigation.
+ if (this._followLinkTimeoutIdentifier) {
+ clearTimeout(this._followLinkTimeoutIdentifier);
+ delete this._followLinkTimeoutIdentifier;
+ }
+
+ // If this is a double-click (or multiple-click), return early.
+ if (event.detail > 1)
+ return;
+
+ function followLink()
+ {
+ // Since followLink is delayed, the call to WebInspector.openURL can't look at window.event
+ // to see if the command key is down like it normally would. So we need to do that check
+ // before calling WebInspector.openURL.
+ var alwaysOpenExternally = event ? event.metaKey : false;
+ WebInspector.openURL(anchorElement.href, this._frame, alwaysOpenExternally, anchorElement.lineNumber);
+ }
+
+ // Start a timeout since this is a single click, if the timeout is canceled before it fires,
+ // then a double-click happened or another link was clicked.
+ // FIXME: The duration might be longer or shorter than the user's configured double click speed.
+ this._followLinkTimeoutIdentifier = setTimeout(followLink.bind(this), 333);
+ },
+
+ _toggleCompositingBorders: function(event)
+ {
+ console.assert(PageAgent.setCompositingBordersVisible);
+
+ var activated = !this._compositingBordersButtonNavigationItem.activated;
+ this._compositingBordersButtonNavigationItem.activated = activated;
+ PageAgent.setCompositingBordersVisible(activated);
+ },
+
+ _updateCompositingBordersButtonToMatchPageSettings: function()
+ {
+ if (!PageAgent.getCompositingBordersVisible)
+ return;
+
+ var button = this._compositingBordersButtonNavigationItem;
+
+ // We need to sync with the page settings since these can be controlled
+ // in a different way than just using the navigation bar button.
+ PageAgent.getCompositingBordersVisible(function(error, compositingBordersVisible) {
+ button.activated = error ? false : compositingBordersVisible;
+ });
+ },
+
+ _showShadowDOMSettingChanged: function(event)
+ {
+ this._showsShadowDOMButtonNavigationItem.activated = WebInspector.showShadowDOMSetting.value;
+ },
+
+ _toggleShowsShadowDOMSetting: function(event)
+ {
+ WebInspector.showShadowDOMSetting.value = !WebInspector.showShadowDOMSetting.value;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+ .dom-tree-data-grid .data-grid {
+ position: relative;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ /* Turn off the default borders, we want to snap to edges. */
+ border: none;
+}
+
+.dom-tree-data-grid .data-grid table.data {
+ background-size: 100% 44px;
+}
+
+.dom-tree-data-grid .data-container {
+ position: absolute;
+ /* Leave room for the data grid header. */
+ top: 16px;
+ /* Use all remaining vertical space in the container. */
+ bottom: 0;
+ /* Let the inline table content scroll, independently of the header. */
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.dom-tree-data-grid .data-container tr {
+ height: 22px;
+}
+
+.dom-tree-data-grid .data-container td > div {
+ display: -webkit-flex;
+ width: 100%;
+ height: 100%;
+ -webkit-align-items: center;
+ -webkit-justify-content: flex-end;
+}
+
+.dom-tree-data-grid .data-container .name-column {
+ padding-right: 0;
+}
+
+.dom-tree-data-grid .data-container .name-column .icon {
+ vertical-align: top;
+ width: 16px;
+ height: 16px;
+ /* FIXME: There can be multiple types of DOM nodes that we might need to support in the future. */
+ content: url(../Images/DOMElement.svg);
+}
+
+.dom-tree-data-grid .data-container .name-column .label {
+ -webkit-flex: 1;
+ padding: 0 4px;
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.dom-tree-data-grid .data-container tr:hover .name-column .label {
+ padding-right: 0;
+}
+
+.dom-tree-data-grid .data-container .go-to-arrow {
+ display: none;
+}
+
+.dom-tree-data-grid .data-container tr:hover .go-to-arrow {
+ display: block;
+}
+
+.dom-tree-data-grid .data-container tbody > tr:nth-child(2n) {
+ background-color: white;
+}
+
+.dom-tree-data-grid .data-container tbody > tr:nth-child(2n+1) {
+ background-color: rgb(243, 246, 250);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeDataGrid = function() {
+ WebInspector.DataGrid.call(this, {
+ name: { title: WebInspector.UIString("Node"), sortable: false }
+ });
+
+ this._previousHoveredElement = null;
+
+ this.element.classList.add("dom-tree-data-grid");
+
+ this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
+ this.element.addEventListener("mouseout", this._onmouseout.bind(this), false);
+};
+
+WebInspector.DOMTreeDataGrid.prototype = {
+ constructor: WebInspector.DOMTreeDataGrid,
+ __proto__: WebInspector.DataGrid.prototype,
+
+ _onmousemove: function(event)
+ {
+ var gridNode = this.dataGridNodeFromNode(event.target);
+ if (!gridNode || this._previousHoveredElement === gridNode.domNode)
+ return;
+ this._previousHoveredElement = gridNode.domNode;
+ WebInspector.domTreeManager.highlightDOMNode(gridNode.domNode.id);
+ },
+
+ _onmouseout: function(event) {
+ if (!this._previousHoveredElement)
+ return;
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ this._previousHoveredElement = null;
+ }
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2013 Adobe Systems Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeDataGridNode = function(domNode)
+{
+ WebInspector.DataGridNode.call(this);
+
+ this._nameLabel = null;
+ this._domNode = domNode;
+ this._updateNodeName();
+};
+
+WebInspector.DOMTreeDataGridNode.prototype = {
+ constructor: WebInspector.DOMTreeDataGridNode,
+ __proto__: WebInspector.DataGridNode.prototype,
+
+ get domNode()
+ {
+ return this._domNode;
+ },
+
+ // DataGridNode Overrides.
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ if (columnIdentifier !== "name")
+ return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+
+ var cell = this._makeNameCell();
+ this._updateNameCellData();
+ return cell;
+ },
+
+ // Private
+
+ _updateNodeName: function()
+ {
+ this.data = {name: WebInspector.displayNameForNode(this._domNode)};
+ },
+
+ _makeNameCell: function()
+ {
+ var fragment = document.createDocumentFragment();
+
+ fragment.appendChild(document.createElement("img")).className = "icon";
+
+ this._nameLabel = document.createElement("div");
+ this._nameLabel.className = "label";
+ fragment.appendChild(this._nameLabel);
+
+ var goToButton = fragment.appendChild(WebInspector.createGoToArrowButton());
+ goToButton.addEventListener("click", this._goToArrowWasClicked.bind(this), false);
+
+ return fragment;
+ },
+
+ _updateNameCellData: function()
+ {
+ this._nameLabel.textContent = this.data.name;
+ },
+
+ _goToArrowWasClicked: function()
+ {
+ WebInspector.resourceSidebarPanel.showMainFrameDOMTree(this._domNode, true);
+ }
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1319 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+/**
+ * @constructor
+ * @extends {TreeElement}
+ * @param {boolean=} elementCloseTag
+ */
+WebInspector.DOMTreeElement = function(node, elementCloseTag)
+{
+ this._elementCloseTag = elementCloseTag;
+ var hasChildrenOverride = !elementCloseTag && node.hasChildNodes() && !this._showInlineText(node);
+
+ // The title will be updated in onattach.
+ TreeElement.call(this, "", node, hasChildrenOverride);
+
+ if (this.representedObject.nodeType() == Node.ELEMENT_NODE && !elementCloseTag)
+ this._canAddAttributes = true;
+ this._searchQuery = null;
+ this._expandedChildrenLimit = WebInspector.DOMTreeElement.InitialChildrenLimit;
+}
+
+WebInspector.DOMTreeElement.InitialChildrenLimit = 500;
+WebInspector.DOMTreeElement.MaximumInlineTextChildLength = 80;
+
+// A union of HTML4 and HTML5-Draft elements that explicitly
+// or implicitly (for HTML5) forbid the closing tag.
+// FIXME: Revise once HTML5 Final is published.
+WebInspector.DOMTreeElement.ForbiddenClosingTagElements = [
+ "area", "base", "basefont", "br", "canvas", "col", "command", "embed", "frame",
+ "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source"
+].keySet();
+
+// These tags we do not allow editing their tag name.
+WebInspector.DOMTreeElement.EditTagBlacklist = [
+ "html", "head", "body"
+].keySet();
+
+WebInspector.DOMTreeElement.prototype = {
+ isCloseTag: function()
+ {
+ return this._elementCloseTag;
+ },
+
+ highlightSearchResults: function(searchQuery)
+ {
+ if (this._searchQuery !== searchQuery) {
+ this._updateSearchHighlight(false);
+ delete this._highlightResult; // A new search query.
+ }
+
+ this._searchQuery = searchQuery;
+ this._searchHighlightsVisible = true;
+ this.updateTitle(true);
+ },
+
+ hideSearchHighlights: function()
+ {
+ delete this._searchHighlightsVisible;
+ this._updateSearchHighlight(false);
+ },
+
+ _updateSearchHighlight: function(show)
+ {
+ if (!this._highlightResult)
+ return;
+
+ function updateEntryShow(entry)
+ {
+ switch (entry.type) {
+ case "added":
+ entry.parent.insertBefore(entry.node, entry.nextSibling);
+ break;
+ case "changed":
+ entry.node.textContent = entry.newText;
+ break;
+ }
+ }
+
+ function updateEntryHide(entry)
+ {
+ switch (entry.type) {
+ case "added":
+ if (entry.node.parentElement)
+ entry.node.parentElement.removeChild(entry.node);
+ break;
+ case "changed":
+ entry.node.textContent = entry.oldText;
+ break;
+ }
+ }
+
+ var updater = show ? updateEntryShow : updateEntryHide;
+
+ for (var i = 0, size = this._highlightResult.length; i < size; ++i)
+ updater(this._highlightResult[i]);
+ },
+
+ get hovered()
+ {
+ return this._hovered;
+ },
+
+ set hovered(x)
+ {
+ if (this._hovered === x)
+ return;
+
+ this._hovered = x;
+
+ if (this.listItemElement) {
+ if (x) {
+ this.updateSelection();
+ this.listItemElement.classList.add("hovered");
+ } else {
+ this.listItemElement.classList.remove("hovered");
+ }
+ }
+ },
+
+ get expandedChildrenLimit()
+ {
+ return this._expandedChildrenLimit;
+ },
+
+ set expandedChildrenLimit(x)
+ {
+ if (this._expandedChildrenLimit === x)
+ return;
+
+ this._expandedChildrenLimit = x;
+ if (this.treeOutline && !this._updateChildrenInProgress)
+ this._updateChildren(true);
+ },
+
+ get expandedChildCount()
+ {
+ var count = this.children.length;
+ if (count && this.children[count - 1]._elementCloseTag)
+ count--;
+ if (count && this.children[count - 1].expandAllButton)
+ count--;
+ return count;
+ },
+
+ showChild: function(index)
+ {
+ if (this._elementCloseTag)
+ return;
+
+ if (index >= this.expandedChildrenLimit) {
+ this._expandedChildrenLimit = index + 1;
+ this._updateChildren(true);
+ }
+
+ // Whether index-th child is visible in the children tree
+ return this.expandedChildCount > index;
+ },
+
+ _createTooltipForNode: function()
+ {
+ var node = /** @type {WebInspector.DOMNode} */ this.representedObject;
+ if (!node.nodeName() || node.nodeName().toLowerCase() !== "img")
+ return;
+
+ function setTooltip(result)
+ {
+ if (!result || result.type !== "string")
+ return;
+
+ try {
+ var properties = JSON.parse(result.description);
+ var offsetWidth = properties[0];
+ var offsetHeight = properties[1];
+ var naturalWidth = properties[2];
+ var naturalHeight = properties[3];
+ if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
+ this.tooltip = WebInspector.UIString("%d \xd7 %d pixels").format(offsetWidth, offsetHeight);
+ else
+ this.tooltip = WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)").format(offsetWidth, offsetHeight, naturalWidth, naturalHeight);
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
+ function resolvedNode(object)
+ {
+ if (!object)
+ return;
+
+ function dimensions()
+ {
+ return "[" + this.offsetWidth + "," + this.offsetHeight + "," + this.naturalWidth + "," + this.naturalHeight + "]";
+ }
+
+ object.callFunction(dimensions, undefined, setTooltip.bind(this));
+ object.release();
+ }
+ WebInspector.RemoteObject.resolveNode(node, "", resolvedNode.bind(this));
+ },
+
+ updateSelection: function()
+ {
+ var listItemElement = this.listItemElement;
+ if (!listItemElement)
+ return;
+
+ if (document.body.offsetWidth <= 0) {
+ // The stylesheet hasn't loaded yet or the window is closed,
+ // so we can't calculate what is need. Return early.
+ return;
+ }
+
+ if (!this.selectionElement) {
+ this.selectionElement = document.createElement("div");
+ this.selectionElement.className = "selection selected";
+ listItemElement.insertBefore(this.selectionElement, listItemElement.firstChild);
+ }
+
+ this.selectionElement.style.height = listItemElement.offsetHeight + "px";
+ },
+
+ onattach: function()
+ {
+ if (this._hovered) {
+ this.updateSelection();
+ this.listItemElement.classList.add("hovered");
+ }
+
+ this.updateTitle();
+ this.listItemElement.draggable = true;
+ this.listItemElement.addEventListener("dragstart", this);
+ },
+
+ onpopulate: function()
+ {
+ if (this.children.length || this._showInlineText(this.representedObject) || this._elementCloseTag)
+ return;
+
+ this.updateChildren();
+ },
+
+ expandRecursively: function()
+ {
+ function callback()
+ {
+ TreeElement.prototype.expandRecursively.call(this, Number.MAX_VALUE);
+ }
+
+ this.representedObject.getSubtree(-1, callback.bind(this));
+ },
+
+ /**
+ * @param {boolean=} fullRefresh
+ */
+ updateChildren: function(fullRefresh)
+ {
+ if (this._elementCloseTag)
+ return;
+ this.representedObject.getChildNodes(this._updateChildren.bind(this, fullRefresh));
+ },
+
+ /**
+ * @param {boolean=} closingTag
+ */
+ insertChildElement: function(child, index, closingTag)
+ {
+ var newElement = new WebInspector.DOMTreeElement(child, closingTag);
+ newElement.selectable = this.treeOutline._selectEnabled;
+ this.insertChild(newElement, index);
+ return newElement;
+ },
+
+ moveChild: function(child, targetIndex)
+ {
+ var wasSelected = child.selected;
+ this.removeChild(child);
+ this.insertChild(child, targetIndex);
+ if (wasSelected)
+ child.select();
+ },
+
+ /**
+ * @param {boolean=} fullRefresh
+ */
+ _updateChildren: function(fullRefresh)
+ {
+ if (this._updateChildrenInProgress || !this.treeOutline._visible)
+ return;
+
+ this._updateChildrenInProgress = true;
+ var selectedNode = this.treeOutline.selectedDOMNode();
+ var originalScrollTop = 0;
+ if (fullRefresh) {
+ var treeOutlineContainerElement = this.treeOutline.element.parentNode;
+ originalScrollTop = treeOutlineContainerElement.scrollTop;
+ var selectedTreeElement = this.treeOutline.selectedTreeElement;
+ if (selectedTreeElement && selectedTreeElement.hasAncestor(this))
+ this.select();
+ this.removeChildren();
+ }
+
+ var treeElement = this;
+ var treeChildIndex = 0;
+ var elementToSelect;
+
+ function updateChildrenOfNode(node)
+ {
+ var treeOutline = treeElement.treeOutline;
+ var child = node.firstChild;
+ while (child) {
+ var currentTreeElement = treeElement.children[treeChildIndex];
+ if (!currentTreeElement || currentTreeElement.representedObject !== child) {
+ // Find any existing element that is later in the children list.
+ var existingTreeElement = null;
+ for (var i = (treeChildIndex + 1), size = treeElement.expandedChildCount; i < size; ++i) {
+ if (treeElement.children[i].representedObject === child) {
+ existingTreeElement = treeElement.children[i];
+ break;
+ }
+ }
+
+ if (existingTreeElement && existingTreeElement.parent === treeElement) {
+ // If an existing element was found and it has the same parent, just move it.
+ treeElement.moveChild(existingTreeElement, treeChildIndex);
+ } else {
+ // No existing element found, insert a new element.
+ if (treeChildIndex < treeElement.expandedChildrenLimit) {
+ var newElement = treeElement.insertChildElement(child, treeChildIndex);
+ if (child === selectedNode)
+ elementToSelect = newElement;
+ if (treeElement.expandedChildCount > treeElement.expandedChildrenLimit)
+ treeElement.expandedChildrenLimit++;
+ }
+ }
+ }
+
+ child = child.nextSibling;
+ ++treeChildIndex;
+ }
+ }
+
+ // Remove any tree elements that no longer have this node (or this node's contentDocument) as their parent.
+ for (var i = (this.children.length - 1); i >= 0; --i) {
+ var currentChild = this.children[i];
+ var currentNode = currentChild.representedObject;
+ var currentParentNode = currentNode.parentNode;
+
+ if (currentParentNode === this.representedObject)
+ continue;
+
+ var selectedTreeElement = this.treeOutline.selectedTreeElement;
+ if (selectedTreeElement && (selectedTreeElement === currentChild || selectedTreeElement.hasAncestor(currentChild)))
+ this.select();
+
+ this.removeChildAtIndex(i);
+ }
+
+ updateChildrenOfNode(this.representedObject);
+ this.adjustCollapsedRange();
+
+ var lastChild = this.children.lastValue;
+ if (this.representedObject.nodeType() == Node.ELEMENT_NODE && (!lastChild || !lastChild._elementCloseTag))
+ this.insertChildElement(this.representedObject, this.children.length, true);
+
+ // We want to restore the original selection and tree scroll position after a full refresh, if possible.
+ if (fullRefresh && elementToSelect) {
+ elementToSelect.select();
+ if (treeOutlineContainerElement && originalScrollTop <= treeOutlineContainerElement.scrollHeight)
+ treeOutlineContainerElement.scrollTop = originalScrollTop;
+ }
+
+ delete this._updateChildrenInProgress;
+ },
+
+ adjustCollapsedRange: function()
+ {
+ // Ensure precondition: only the tree elements for node children are found in the tree
+ // (not the Expand All button or the closing tag).
+ if (this.expandAllButtonElement && this.expandAllButtonElement.__treeElement.parent)
+ this.removeChild(this.expandAllButtonElement.__treeElement);
+
+ const node = this.representedObject;
+ if (!node.children)
+ return;
+ const childNodeCount = node.children.length;
+
+ // In case some nodes from the expanded range were removed, pull some nodes from the collapsed range into the expanded range at the bottom.
+ for (var i = this.expandedChildCount, limit = Math.min(this.expandedChildrenLimit, childNodeCount); i < limit; ++i)
+ this.insertChildElement(node.children[i], i);
+
+ const expandedChildCount = this.expandedChildCount;
+ if (childNodeCount > this.expandedChildCount) {
+ var targetButtonIndex = expandedChildCount;
+ if (!this.expandAllButtonElement) {
+ var button = document.createElement("button");
+ button.className = "show-all-nodes";
+ button.value = "";
+ var item = new TreeElement(button, null, false);
+ item.selectable = false;
+ item.expandAllButton = true;
+ this.insertChild(item, targetButtonIndex);
+ this.expandAllButtonElement = item.listItemElement.firstChild;
+ this.expandAllButtonElement.__treeElement = item;
+ this.expandAllButtonElement.addEventListener("click", this.handleLoadAllChildren.bind(this), false);
+ } else if (!this.expandAllButtonElement.__treeElement.parent)
+ this.insertChild(this.expandAllButtonElement.__treeElement, targetButtonIndex);
+ this.expandAllButtonElement.textContent = WebInspector.UIString("Show All Nodes (%d More)").format(childNodeCount - expandedChildCount);
+ } else if (this.expandAllButtonElement)
+ delete this.expandAllButtonElement;
+ },
+
+ handleLoadAllChildren: function()
+ {
+ this.expandedChildrenLimit = Math.max(this.representedObject.childNodeCount, this.expandedChildrenLimit + WebInspector.DOMTreeElement.InitialChildrenLimit);
+ },
+
+ onexpand: function()
+ {
+ if (this._elementCloseTag)
+ return;
+
+ this.updateTitle();
+ this.treeOutline.updateSelection();
+ },
+
+ oncollapse: function()
+ {
+ if (this._elementCloseTag)
+ return;
+
+ this.updateTitle();
+ this.treeOutline.updateSelection();
+ },
+
+ onreveal: function()
+ {
+ if (this.listItemElement) {
+ var tagSpans = this.listItemElement.getElementsByClassName("html-tag-name");
+ if (tagSpans.length)
+ tagSpans[0].scrollIntoViewIfNeeded(false);
+ else
+ this.listItemElement.scrollIntoViewIfNeeded(false);
+ }
+ },
+
+ onselect: function(treeElement, selectedByUser)
+ {
+ this.treeOutline.suppressRevealAndSelect = true;
+ this.treeOutline.selectDOMNode(this.representedObject, selectedByUser);
+ if (selectedByUser)
+ WebInspector.domTreeManager.highlightDOMNode(this.representedObject.id);
+ this.updateSelection();
+ this.treeOutline.suppressRevealAndSelect = false;
+ },
+
+ ondeselect: function(treeElement)
+ {
+ this.treeOutline.selectDOMNode(null);
+ },
+
+ ondelete: function()
+ {
+ var startTagTreeElement = this.treeOutline.findTreeElement(this.representedObject);
+ startTagTreeElement ? startTagTreeElement.remove() : this.remove();
+ return true;
+ },
+
+ onenter: function()
+ {
+ // On Enter or Return start editing the first attribute
+ // or create a new attribute on the selected element.
+ if (this.treeOutline.editing)
+ return false;
+
+ this._startEditing();
+
+ // prevent a newline from being immediately inserted
+ return true;
+ },
+
+ selectOnMouseDown: function(event)
+ {
+ TreeElement.prototype.selectOnMouseDown.call(this, event);
+
+ if (this._editing)
+ return;
+
+ // Prevent selecting the nearest word on double click.
+ if (event.detail >= 2)
+ event.preventDefault();
+ },
+
+ ondblclick: function(event)
+ {
+ if (this._editing || this._elementCloseTag)
+ return;
+
+ if (this._startEditingTarget(event.target))
+ return;
+
+ if (this.hasChildren && !this.expanded)
+ this.expand();
+ },
+
+ _insertInLastAttributePosition: function(tag, node)
+ {
+ if (tag.getElementsByClassName("html-attribute").length > 0)
+ tag.insertBefore(node, tag.lastChild);
+ else {
+ var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];
+ tag.textContent = '';
+ tag.appendChild(document.createTextNode('<'+nodeName));
+ tag.appendChild(node);
+ tag.appendChild(document.createTextNode('>'));
+ }
+
+ this.updateSelection();
+ },
+
+ _startEditingTarget: function(eventTarget)
+ {
+ if (this.treeOutline.selectedDOMNode() != this.representedObject)
+ return;
+
+ if (this.representedObject.nodeType() != Node.ELEMENT_NODE && this.representedObject.nodeType() != Node.TEXT_NODE)
+ return false;
+
+ var textNode = eventTarget.enclosingNodeOrSelfWithClass("html-text-node");
+ if (textNode)
+ return this._startEditingTextNode(textNode);
+
+ var attribute = eventTarget.enclosingNodeOrSelfWithClass("html-attribute");
+ if (attribute)
+ return this._startEditingAttribute(attribute, eventTarget);
+
+ var tagName = eventTarget.enclosingNodeOrSelfWithClass("html-tag-name");
+ if (tagName)
+ return this._startEditingTagName(tagName);
+
+ var newAttribute = eventTarget.enclosingNodeOrSelfWithClass("add-attribute");
+ if (newAttribute)
+ return this._addNewAttribute();
+
+ return false;
+ },
+
+ _populateTagContextMenu: function(contextMenu, event)
+ {
+ var attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
+ var newAttribute = event.target.enclosingNodeOrSelfWithClass("add-attribute");
+
+ // Add attribute-related actions.
+ contextMenu.appendItem(WebInspector.UIString("Add Attribute"), this._addNewAttribute.bind(this));
+ if (attribute && !newAttribute)
+ contextMenu.appendItem(WebInspector.UIString("Edit Attribute"), this._startEditingAttribute.bind(this, attribute, event.target));
+ contextMenu.appendSeparator();
+
+ if (WebInspector.cssStyleManager.canForcePseudoClasses()) {
+ var pseudoSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Forced Pseudo-Classes"));
+ this._populateForcedPseudoStateItems(pseudoSubMenu);
+ contextMenu.appendSeparator();
+ }
+
+ this._populateNodeContextMenu(contextMenu);
+ this.treeOutline._populateContextMenu(contextMenu, this.representedObject);
+ },
+
+ _populateForcedPseudoStateItems: function(subMenu)
+ {
+ var node = this.representedObject;
+ var enabledPseudoClasses = node.enabledPseudoClasses;
+ // These strings don't need to be localized as they are CSS pseudo-classes.
+ WebInspector.CSSStyleManager.ForceablePseudoClasses.forEach(function(pseudoClass) {
+ var label = pseudoClass.capitalize();
+ var enabled = enabledPseudoClasses.contains(pseudoClass);
+ subMenu.appendCheckboxItem(label, function() {
+ node.setPseudoClassEnabled(pseudoClass, !enabled);
+ }, enabled, false);
+ });
+ },
+
+ _populateTextContextMenu: function(contextMenu, textNode)
+ {
+ contextMenu.appendItem(WebInspector.UIString("Edit Text"), this._startEditingTextNode.bind(this, textNode));
+ this._populateNodeContextMenu(contextMenu);
+ },
+
+ _populateNodeContextMenu: function(contextMenu)
+ {
+ // Add free-form node-related actions.
+ contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
+ },
+
+ _startEditing: function()
+ {
+ if (this.treeOutline.selectedDOMNode() !== this.representedObject)
+ return;
+
+ var listItem = this._listItemNode;
+
+ if (this._canAddAttributes) {
+ var attribute = listItem.getElementsByClassName("html-attribute")[0];
+ if (attribute)
+ return this._startEditingAttribute(attribute, attribute.getElementsByClassName("html-attribute-value")[0]);
+
+ return this._addNewAttribute();
+ }
+
+ if (this.representedObject.nodeType() === Node.TEXT_NODE) {
+ var textNode = listItem.getElementsByClassName("html-text-node")[0];
+ if (textNode)
+ return this._startEditingTextNode(textNode);
+ return;
+ }
+ },
+
+ _addNewAttribute: function()
+ {
+ // Cannot just convert the textual html into an element without
+ // a parent node. Use a temporary span container for the HTML.
+ var container = document.createElement("span");
+ this._buildAttributeDOM(container, " ", "");
+ var attr = container.firstChild;
+ attr.style.marginLeft = "2px"; // overrides the .editing margin rule
+ attr.style.marginRight = "2px"; // overrides the .editing margin rule
+
+ var tag = this.listItemElement.getElementsByClassName("html-tag")[0];
+ this._insertInLastAttributePosition(tag, attr);
+ return this._startEditingAttribute(attr, attr);
+ },
+
+ _triggerEditAttribute: function(attributeName)
+ {
+ var attributeElements = this.listItemElement.getElementsByClassName("html-attribute-name");
+ for (var i = 0, len = attributeElements.length; i < len; ++i) {
+ if (attributeElements[i].textContent === attributeName) {
+ for (var elem = attributeElements[i].nextSibling; elem; elem = elem.nextSibling) {
+ if (elem.nodeType !== Node.ELEMENT_NODE)
+ continue;
+
+ if (elem.classList.contains("html-attribute-value"))
+ return this._startEditingAttribute(elem.parentNode, elem);
+ }
+ }
+ }
+ },
+
+ _startEditingAttribute: function(attribute, elementForSelection)
+ {
+ if (WebInspector.isBeingEdited(attribute))
+ return true;
+
+ var attributeNameElement = attribute.getElementsByClassName("html-attribute-name")[0];
+ if (!attributeNameElement)
+ return false;
+
+ var attributeName = attributeNameElement.textContent;
+
+ function removeZeroWidthSpaceRecursive(node)
+ {
+ if (node.nodeType === Node.TEXT_NODE) {
+ node.nodeValue = node.nodeValue.replace(/\u200B/g, "");
+ return;
+ }
+
+ if (node.nodeType !== Node.ELEMENT_NODE)
+ return;
+
+ for (var child = node.firstChild; child; child = child.nextSibling)
+ removeZeroWidthSpaceRecursive(child);
+ }
+
+ // Remove zero-width spaces that were added by nodeTitleInfo.
+ removeZeroWidthSpaceRecursive(attribute);
+
+ var config = new WebInspector.EditingConfig(this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
+ this._editing = WebInspector.startEditing(attribute, config);
+
+ window.getSelection().setBaseAndExtent(elementForSelection, 0, elementForSelection, 1);
+
+ return true;
+ },
+
+ _startEditingTextNode: function(textNode)
+ {
+ if (WebInspector.isBeingEdited(textNode))
+ return true;
+
+ var config = new WebInspector.EditingConfig(this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this));
+ config.spellcheck = true;
+ this._editing = WebInspector.startEditing(textNode, config);
+ window.getSelection().setBaseAndExtent(textNode, 0, textNode, 1);
+
+ return true;
+ },
+
+ _startEditingTagName: function(tagNameElement)
+ {
+ if (!tagNameElement) {
+ tagNameElement = this.listItemElement.getElementsByClassName("html-tag-name")[0];
+ if (!tagNameElement)
+ return false;
+ }
+
+ var tagName = tagNameElement.textContent;
+ if (WebInspector.DOMTreeElement.EditTagBlacklist[tagName.toLowerCase()])
+ return false;
+
+ if (WebInspector.isBeingEdited(tagNameElement))
+ return true;
+
+ var closingTagElement = this._distinctClosingTagElement();
+
+ function keyupListener(event)
+ {
+ if (closingTagElement)
+ closingTagElement.textContent = "</" + tagNameElement.textContent + ">";
+ }
+
+ function editingComitted(element, newTagName)
+ {
+ tagNameElement.removeEventListener('keyup', keyupListener, false);
+ this._tagNameEditingCommitted.apply(this, arguments);
+ }
+
+ function editingCancelled()
+ {
+ tagNameElement.removeEventListener('keyup', keyupListener, false);
+ this._editingCancelled.apply(this, arguments);
+ }
+
+ tagNameElement.addEventListener('keyup', keyupListener, false);
+
+ var config = new WebInspector.EditingConfig(editingComitted.bind(this), editingCancelled.bind(this), tagName);
+ this._editing = WebInspector.startEditing(tagNameElement, config);
+ window.getSelection().setBaseAndExtent(tagNameElement, 0, tagNameElement, 1);
+ return true;
+ },
+
+ _startEditingAsHTML: function(commitCallback, error, initialValue)
+ {
+ if (error)
+ return;
+ if (this._htmlEditElement && WebInspector.isBeingEdited(this._htmlEditElement))
+ return;
+
+ this._htmlEditElement = document.createElement("div");
+ this._htmlEditElement.className = "source-code elements-tree-editor";
+ this._htmlEditElement.textContent = initialValue;
+
+ // Hide header items.
+ var child = this.listItemElement.firstChild;
+ while (child) {
+ child.style.display = "none";
+ child = child.nextSibling;
+ }
+ // Hide children item.
+ if (this._childrenListNode)
+ this._childrenListNode.style.display = "none";
+ // Append editor.
+ this.listItemElement.appendChild(this._htmlEditElement);
+
+ this.updateSelection();
+
+ function commit()
+ {
+ commitCallback(this._htmlEditElement.textContent);
+ dispose.call(this);
+ }
+
+ function dispose()
+ {
+ this._editing = false;
+
+ // Remove editor.
+ this.listItemElement.removeChild(this._htmlEditElement);
+ delete this._htmlEditElement;
+ // Unhide children item.
+ if (this._childrenListNode)
+ this._childrenListNode.style.removeProperty("display");
+ // Unhide header items.
+ var child = this.listItemElement.firstChild;
+ while (child) {
+ child.style.removeProperty("display");
+ child = child.nextSibling;
+ }
+
+ this.updateSelection();
+ }
+
+ var config = new WebInspector.EditingConfig(commit.bind(this), dispose.bind(this));
+ config.setMultiline(true);
+ this._editing = WebInspector.startEditing(this._htmlEditElement, config);
+ },
+
+ _attributeEditingCommitted: function(element, newText, oldText, attributeName, moveDirection)
+ {
+ this._editing = false;
+
+ var treeOutline = this.treeOutline;
+ function moveToNextAttributeIfNeeded(error)
+ {
+ if (error)
+ this._editingCancelled(element, attributeName);
+
+ if (!moveDirection)
+ return;
+
+ treeOutline._updateModifiedNodes();
+
+ // Search for the attribute's position, and then decide where to move to.
+ var attributes = this.representedObject.attributes();
+ for (var i = 0; i < attributes.length; ++i) {
+ if (attributes[i].name !== attributeName)
+ continue;
+
+ if (moveDirection === "backward") {
+ if (i === 0)
+ this._startEditingTagName();
+ else
+ this._triggerEditAttribute(attributes[i - 1].name);
+ } else {
+ if (i === attributes.length - 1)
+ this._addNewAttribute();
+ else
+ this._triggerEditAttribute(attributes[i + 1].name);
+ }
+ return;
+ }
+
+ // Moving From the "New Attribute" position.
+ if (moveDirection === "backward") {
+ if (newText === " ") {
+ // Moving from "New Attribute" that was not edited
+ if (attributes.length)
+ this._triggerEditAttribute(attributes.lastValue.name);
+ } else {
+ // Moving from "New Attribute" that holds new value
+ if (attributes.length > 1)
+ this._triggerEditAttribute(attributes[attributes.length - 2].name);
+ }
+ } else if (moveDirection === "forward") {
+ if (!/^\s*$/.test(newText))
+ this._addNewAttribute();
+ else
+ this._startEditingTagName();
+ }
+ }
+
+ this.representedObject.setAttribute(attributeName, newText, moveToNextAttributeIfNeeded.bind(this));
+ },
+
+ _tagNameEditingCommitted: function(element, newText, oldText, tagName, moveDirection)
+ {
+ this._editing = false;
+ var self = this;
+
+ function cancel()
+ {
+ var closingTagElement = self._distinctClosingTagElement();
+ if (closingTagElement)
+ closingTagElement.textContent = "</" + tagName + ">";
+
+ self._editingCancelled(element, tagName);
+ moveToNextAttributeIfNeeded.call(self);
+ }
+
+ function moveToNextAttributeIfNeeded()
+ {
+ if (moveDirection !== "forward") {
+ this._addNewAttribute();
+ return;
+ }
+
+ var attributes = this.representedObject.attributes();
+ if (attributes.length > 0)
+ this._triggerEditAttribute(attributes[0].name);
+ else
+ this._addNewAttribute();
+ }
+
+ newText = newText.trim();
+ if (newText === oldText) {
+ cancel();
+ return;
+ }
+
+ var treeOutline = this.treeOutline;
+ var wasExpanded = this.expanded;
+
+ function changeTagNameCallback(error, nodeId)
+ {
+ if (error || !nodeId) {
+ cancel();
+ return;
+ }
+
+ var node = WebInspector.domTreeManager.nodeForId(nodeId);
+
+ // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.
+ treeOutline._updateModifiedNodes();
+ treeOutline.selectDOMNode(node, true);
+
+ var newTreeItem = treeOutline.findTreeElement(node);
+ if (wasExpanded)
+ newTreeItem.expand();
+
+ moveToNextAttributeIfNeeded.call(newTreeItem);
+ }
+
+ this.representedObject.setNodeName(newText, changeTagNameCallback);
+ },
+
+ _textNodeEditingCommitted: function(element, newText)
+ {
+ this._editing = false;
+
+ var textNode;
+ if (this.representedObject.nodeType() === Node.ELEMENT_NODE) {
+ // We only show text nodes inline in elements if the element only
+ // has a single child, and that child is a text node.
+ textNode = this.representedObject.firstChild;
+ } else if (this.representedObject.nodeType() == Node.TEXT_NODE)
+ textNode = this.representedObject;
+
+ textNode.setNodeValue(newText, this.updateTitle.bind(this));
+ },
+
+ _editingCancelled: function(element, context)
+ {
+ this._editing = false;
+
+ // Need to restore attributes structure.
+ this.updateTitle();
+ },
+
+ _distinctClosingTagElement: function()
+ {
+ // FIXME: Improve the Tree Element / Outline Abstraction to prevent crawling the DOM
+
+ // For an expanded element, it will be the last element with class "close"
+ // in the child element list.
+ if (this.expanded) {
+ var closers = this._childrenListNode.querySelectorAll(".close");
+ return closers[closers.length-1];
+ }
+
+ // Remaining cases are single line non-expanded elements with a closing
+ // tag, or HTML elements without a closing tag (such as <br>). Return
+ // null in the case where there isn't a closing tag.
+ var tags = this.listItemElement.getElementsByClassName("html-tag");
+ return (tags.length === 1 ? null : tags[tags.length-1]);
+ },
+
+ /**
+ * @param {boolean=} onlySearchQueryChanged
+ */
+ updateTitle: function(onlySearchQueryChanged)
+ {
+ // If we are editing, return early to prevent canceling the edit.
+ // After editing is committed updateTitle will be called.
+ if (this._editing)
+ return;
+
+ if (onlySearchQueryChanged) {
+ if (this._highlightResult)
+ this._updateSearchHighlight(false);
+ } else {
+ var highlightElement = document.createElement("span");
+ highlightElement.className = "highlight";
+ highlightElement.appendChild(this._nodeTitleInfo().titleDOM);
+ this.title = highlightElement;
+ delete this._highlightResult;
+ }
+
+ delete this.selectionElement;
+ this.updateSelection();
+ this._highlightSearchResults();
+ },
+
+ /**
+ * @param {WebInspector.DOMNode=} node
+ */
+ _buildAttributeDOM: function(parentElement, name, value, node)
+ {
+ var hasText = (value.length > 0);
+ var attrSpanElement = parentElement.createChild("span", "html-attribute");
+ var attrNameElement = attrSpanElement.createChild("span", "html-attribute-name");
+ attrNameElement.textContent = name;
+
+ if (hasText)
+ attrSpanElement.appendChild(document.createTextNode("=\u200B\""));
+
+ if (name === "src" || name === "href") {
+ var baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
+ var rewrittenURL = absoluteURL(value, baseURL);
+
+ value = value.insertWordBreakCharacters();
+
+ if (!rewrittenURL) {
+ var attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
+ attrValueElement.textContent = value;
+ } else {
+ if (value.startsWith("data:"))
+ value = value.trimMiddle(60);
+
+ var linkElement = document.createElement("a");
+ linkElement.href = rewrittenURL;
+ linkElement.textContent = value;
+
+ attrSpanElement.appendChild(linkElement);
+ }
+ } else {
+ value = value.insertWordBreakCharacters();
+ var attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
+ attrValueElement.textContent = value;
+ }
+
+ if (hasText)
+ attrSpanElement.appendChild(document.createTextNode("\""));
+ },
+
+ _buildTagDOM: function(parentElement, tagName, isClosingTag, isDistinctTreeElement)
+ {
+ var node = /** @type WebInspector.DOMNode */ this.representedObject;
+ var classes = [ "html-tag" ];
+ if (isClosingTag && isDistinctTreeElement)
+ classes.push("close");
+ if (node.isInShadowTree())
+ classes.push("shadow");
+ var tagElement = parentElement.createChild("span", classes.join(" "));
+ tagElement.appendChild(document.createTextNode("<"));
+ var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "html-tag-name");
+ tagNameElement.textContent = (isClosingTag ? "/" : "") + tagName;
+ if (!isClosingTag && node.hasAttributes()) {
+ var attributes = node.attributes();
+ for (var i = 0; i < attributes.length; ++i) {
+ var attr = attributes[i];
+ tagElement.appendChild(document.createTextNode(" "));
+ this._buildAttributeDOM(tagElement, attr.name, attr.value, node);
+ }
+ }
+ tagElement.appendChild(document.createTextNode(">"));
+ parentElement.appendChild(document.createTextNode("\u200B"));
+ },
+
+ _nodeTitleInfo: function()
+ {
+ var node = this.representedObject;
+ var info = {titleDOM: document.createDocumentFragment(), hasChildren: this.hasChildren};
+
+ switch (node.nodeType()) {
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ var fragmentElement = info.titleDOM.createChild("span", "webkit-html-fragment");
+ if (node.isInShadowTree()) {
+ fragmentElement.textContent = WebInspector.UIString("Shadow Content");
+ fragmentElement.classList.add("shadow");
+ } else
+ fragmentElement.textContent = WebInspector.UIString("Document Fragment");
+ break;
+
+ case Node.ATTRIBUTE_NODE:
+ var value = node.value || "\u200B"; // Zero width space to force showing an empty value.
+ this._buildAttributeDOM(info.titleDOM, node.name, value);
+ break;
+
+ case Node.ELEMENT_NODE:
+ var tagName = node.nodeNameInCorrectCase();
+ if (this._elementCloseTag) {
+ this._buildTagDOM(info.titleDOM, tagName, true, true);
+ info.hasChildren = false;
+ break;
+ }
+
+ this._buildTagDOM(info.titleDOM, tagName, false, false);
+
+ var textChild = this._singleTextChild(node);
+ var showInlineText = textChild && textChild.nodeValue().length < WebInspector.DOMTreeElement.MaximumInlineTextChildLength;
+
+ if (!this.expanded && (!showInlineText && (this.treeOutline.isXMLMimeType || !WebInspector.DOMTreeElement.ForbiddenClosingTagElements[tagName]))) {
+ if (this.hasChildren) {
+ var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
+ textNodeElement.textContent = "\u2026";
+ info.titleDOM.appendChild(document.createTextNode("\u200B"));
+ }
+ this._buildTagDOM(info.titleDOM, tagName, true, false);
+ }
+
+ // If this element only has a single child that is a text node,
+ // just show that text and the closing tag inline rather than
+ // create a subtree for them
+ if (showInlineText) {
+ var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
+ var nodeNameLowerCase = node.nodeName().toLowerCase();
+
+ if (nodeNameLowerCase === "script")
+ textNodeElement.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(textChild.nodeValue().trim(), "text/javascript"));
+ else if (nodeNameLowerCase === "style")
+ textNodeElement.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(textChild.nodeValue().trim(), "text/css"));
+ else
+ textNodeElement.textContent = textChild.nodeValue();
+
+ info.titleDOM.appendChild(document.createTextNode("\u200B"));
+
+ this._buildTagDOM(info.titleDOM, tagName, true, false);
+ info.hasChildren = false;
+ }
+ break;
+
+ case Node.TEXT_NODE:
+ function trimedNodeValue()
+ {
+ // Trim empty lines from the beginning and extra space at the end since most style and script tags begin with a newline
+ // and end with a newline and indentation for the end tag.
+ return node.nodeValue().replace(/^[\n\r]*/, "").replace(/\s*$/, "");
+ }
+
+ if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "script") {
+ var newNode = info.titleDOM.createChild("span", "html-text-node large");
+ newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/javascript"));
+ } else if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "style") {
+ var newNode = info.titleDOM.createChild("span", "html-text-node large");
+ newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/css"));
+ } else {
+ info.titleDOM.appendChild(document.createTextNode("\""));
+ var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
+ textNodeElement.textContent = node.nodeValue();
+ info.titleDOM.appendChild(document.createTextNode("\""));
+ }
+ break;
+
+ case Node.COMMENT_NODE:
+ var commentElement = info.titleDOM.createChild("span", "html-comment");
+ commentElement.appendChild(document.createTextNode("<!--" + node.nodeValue() + "-->"));
+ break;
+
+ case Node.DOCUMENT_TYPE_NODE:
+ var docTypeElement = info.titleDOM.createChild("span", "html-doctype");
+ docTypeElement.appendChild(document.createTextNode("<!DOCTYPE " + node.nodeName()));
+ if (node.publicId) {
+ docTypeElement.appendChild(document.createTextNode(" PUBLIC \"" + node.publicId + "\""));
+ if (node.systemId)
+ docTypeElement.appendChild(document.createTextNode(" \"" + node.systemId + "\""));
+ } else if (node.systemId)
+ docTypeElement.appendChild(document.createTextNode(" SYSTEM \"" + node.systemId + "\""));
+
+ if (node.internalSubset)
+ docTypeElement.appendChild(document.createTextNode(" [" + node.internalSubset + "]"));
+
+ docTypeElement.appendChild(document.createTextNode(">"));
+ break;
+
+ case Node.CDATA_SECTION_NODE:
+ var cdataElement = info.titleDOM.createChild("span", "html-text-node");
+ cdataElement.appendChild(document.createTextNode("<![CDATA[" + node.nodeValue() + "]]>"));
+ break;
+ default:
+ var defaultElement = info.titleDOM.appendChild(document.createTextNode(node.nodeNameInCorrectCase().collapseWhitespace()));
+ }
+
+ return info;
+ },
+
+ _singleTextChild: function(node)
+ {
+ if (!node)
+ return null;
+
+ var firstChild = node.firstChild;
+ if (!firstChild || firstChild.nodeType() !== Node.TEXT_NODE)
+ return null;
+
+ if (node.hasShadowRoots())
+ return null;
+
+ var sibling = firstChild.nextSibling;
+ return sibling ? null : firstChild;
+ },
+
+ _showInlineText: function(node)
+ {
+ if (node.nodeType() === Node.ELEMENT_NODE) {
+ var textChild = this._singleTextChild(node);
+ if (textChild && textChild.nodeValue().length < WebInspector.DOMTreeElement.MaximumInlineTextChildLength)
+ return true;
+ }
+ return false;
+ },
+
+ remove: function()
+ {
+ var parentElement = this.parent;
+ if (!parentElement)
+ return;
+
+ var self = this;
+ function removeNodeCallback(error, removedNodeId)
+ {
+ if (error)
+ return;
+
+ if (!self.parent)
+ return;
+
+ parentElement.removeChild(self);
+ parentElement.adjustCollapsedRange();
+ }
+
+ this.representedObject.removeNode(removeNodeCallback);
+ },
+
+ _editAsHTML: function()
+ {
+ var treeOutline = this.treeOutline;
+ var node = this.representedObject;
+ var parentNode = node.parentNode;
+ var index = node.index;
+ var wasExpanded = this.expanded;
+
+ function selectNode(error, nodeId)
+ {
+ if (error)
+ return;
+
+ // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.
+ treeOutline._updateModifiedNodes();
+
+ var newNode = parentNode ? parentNode.children[index] || parentNode : null;
+ if (!newNode)
+ return;
+
+ treeOutline.selectDOMNode(newNode, true);
+
+ if (wasExpanded) {
+ var newTreeItem = treeOutline.findTreeElement(newNode);
+ if (newTreeItem)
+ newTreeItem.expand();
+ }
+ }
+
+ function commitChange(value)
+ {
+ node.setOuterHTML(value, selectNode);
+ }
+
+ node.getOuterHTML(this._startEditingAsHTML.bind(this, commitChange));
+ },
+
+ _copyHTML: function()
+ {
+ this.representedObject.copyNode();
+ },
+
+ _highlightSearchResults: function()
+ {
+ if (!this._searchQuery || !this._searchHighlightsVisible)
+ return;
+ if (this._highlightResult) {
+ this._updateSearchHighlight(true);
+ return;
+ }
+
+ var text = this.listItemElement.textContent;
+ var regexObject = createPlainTextSearchRegex(this._searchQuery, "gi");
+
+ var offset = 0;
+ var match = regexObject.exec(text);
+ var matchRanges = [];
+ while (match) {
+ matchRanges.push({ offset: match.index, length: match[0].length });
+ match = regexObject.exec(text);
+ }
+
+ // Fall back for XPath, etc. matches.
+ if (!matchRanges.length)
+ matchRanges.push({ offset: 0, length: text.length });
+
+ this._highlightResult = [];
+ highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult);
+ },
+
+ handleEvent: function(event)
+ {
+ if (event.type === "dragstart" && this._editing)
+ event.preventDefault();
+ }
+}
+
+WebInspector.DOMTreeElement.prototype.__proto__ = TreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementPathComponentjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeElementPathComponentjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeElementPathComponent.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DOMTreeElementPathComponent = function(domTreeElement, representedObject) {
+ var node = domTreeElement.representedObject;
+
+ var title = null;
+ var className = null;
+
+ switch (node.nodeType()) {
+ case Node.ELEMENT_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
+ title = WebInspector.displayNameForNode(node);
+ break;
+
+ case Node.TEXT_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName;
+ title = "\"" + node.nodeValue().trimEnd(32) + "\"";
+ break;
+
+ case Node.COMMENT_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName;
+ title = "<!--" + node.nodeValue().trimEnd(32) + "-->";
+ break;
+
+ case Node.DOCUMENT_TYPE_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
+ title = "<!DOCTYPE>";
+ break;
+
+ case Node.DOCUMENT_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName;
+ title = node.nodeNameInCorrectCase();
+ break;
+
+ case Node.CDATA_SECTION_NODE:
+ className = WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName;
+ title = "<![CDATA[" + node.trimEnd(32) + "]]>";
+ break;
+
+ case Node.DOCUMENT_FRAGMENT_NODE:
+ // FIXME: At some point we might want a different icon for this.
+ // <rdar://problem/12800950> Need icon for DOCUMENT_FRAGMENT_NODE
+ className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
+ if (node.isInShadowTree())
+ title = WebInspector.UIString("Shadow Content");
+ else
+ title = WebInspector.displayNameForNode(node);
+ break;
+
+ default:
+ console.error("Unknown DOM node type: ", node.nodeType());
+ className = WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName;
+ title = node.nodeNameInCorrectCase();
+ }
+
+ WebInspector.HierarchicalPathComponent.call(this, title, className, representedObject || domTreeElement.representedObject);
+
+ this._domTreeElement = domTreeElement;
+};
+
+WebInspector.DOMTreeElementPathComponent.DOMElementIconStyleClassName = "dom-element-icon";
+WebInspector.DOMTreeElementPathComponent.DOMTextNodeIconStyleClassName = "dom-text-node-icon";
+WebInspector.DOMTreeElementPathComponent.DOMCommentIconStyleClassName = "dom-comment-icon";
+WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName = "dom-document-type-icon";
+WebInspector.DOMTreeElementPathComponent.DOMDocumentIconStyleClassName = "dom-document-icon";
+WebInspector.DOMTreeElementPathComponent.DOMCharacterDataIconStyleClassName = "dom-character-data-icon";
+WebInspector.DOMTreeElementPathComponent.DOMNodeIconStyleClassName = "dom-node-icon";
+
+WebInspector.DOMTreeElementPathComponent.prototype = {
+ constructor: WebInspector.DOMTreeElementPathComponent,
+
+ // Public
+
+ get domTreeElement()
+ {
+ return this._domTreeElement;
+ },
+
+ get previousSibling()
+ {
+ if (!this._domTreeElement.previousSibling)
+ return null;
+ return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.previousSibling);
+ },
+
+ get nextSibling()
+ {
+ if (!this._domTreeElement.nextSibling)
+ return null;
+ if (this._domTreeElement.nextSibling.isCloseTag())
+ return null;
+ return new WebInspector.DOMTreeElementPathComponent(this._domTreeElement.nextSibling);
+ },
+
+ // Protected
+
+ mouseOver: function()
+ {
+ var nodeId = this._domTreeElement.representedObject.id;
+ WebInspector.domTreeManager.highlightDOMNode(nodeId);
+ },
+
+ mouseOut: function()
+ {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ }
+};
+
+WebInspector.DOMTreeElementPathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecssfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinecss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,148 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.dom-tree-outline {
+ position: relative;
+
+ padding: 0 6px;
+ margin: 0;
+ min-width: 100%;
+
+ outline: none;
+
+ list-style-type: none;
+
+ /* Needed to make the negative z-index on .selection works. Otherwise the background-color from .syntax-highlighted hides the selection. */
+ background-color: transparent !important;
+ color: black;
+}
+
+.dom-tree-outline li.hovered:not(.selected) .selection {
+ display: block;
+ left: 3px;
+ right: 3px;
+
+ background-color: rgba(56, 121, 217, 0.1);
+ border-radius: 5px;
+}
+
+.dom-tree-outline li .selection {
+ display: none;
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 15px;
+ z-index: -1;
+}
+
+.dom-tree-outline li.selected .selection {
+ display: block;
+ background-color: rgb(212, 212, 212);
+}
+
+.dom-tree-outline li.elements-drag-over .selection {
+ display: block;
+ margin-top: -2px;
+ border-top: 2px solid rgb(56, 121, 217);
+}
+
+.dom-tree-outline:focus li.selected .selection {
+ background-color: rgb(56, 121, 217);
+}
+
+.dom-tree-outline ol {
+ list-style-type: none;
+ padding-left: 14px;
+ margin: 0;
+}
+
+.dom-tree-outline ol.children {
+ display: none;
+}
+
+.dom-tree-outline ol.children.expanded {
+ display: block;
+}
+
+.dom-tree-outline li {
+ padding: 0 0 0 12px;
+ word-wrap: break-word;
+}
+
+.dom-tree-outline:focus li.selected {
+ color: white;
+}
+
+.dom-tree-outline:focus li.selected * {
+ color: inherit;
+}
+
+.dom-tree-outline li.parent {
+ margin-left: -10px;
+}
+
+.dom-tree-outline li .html-tag.close {
+ margin-left: -14px;
+}
+
+.dom-tree-outline li.parent::before {
+ float: left;
+
+ content: "";
+
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
+ background-size: 8px 8px;
+ background-repeat: no-repeat;
+
+ width: 8px;
+ height: 8px;
+
+ margin-top: 2px;
+ padding-right: 2px;
+}
+
+.dom-tree-outline:focus li.parent.selected::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
+}
+
+.dom-tree-outline li.parent.expanded::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
+}
+
+.dom-tree-outline:focus li.parent.expanded.selected::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
+}
+
+.dom-tree-outline .add-attribute {
+ margin-left: 1px;
+ margin-right: 1px;
+ white-space: nowrap;
+}
+
+.dom-tree-outline .html-text-node.large {
+ display: inline-block;
+ min-width: 100%;
+ white-space: pre-wrap;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinejsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeOutlinejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,588 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+/**
+ * @constructor
+ * @extends {TreeOutline}
+ * @param {boolean=} omitRootDOMNode
+ * @param {boolean=} selectEnabled
+ */
+WebInspector.DOMTreeOutline = function(omitRootDOMNode, selectEnabled, showInElementsPanelEnabled)
+{
+ this.element = document.createElement("ol");
+ this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
+ this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
+ this.element.addEventListener("mouseout", this._onmouseout.bind(this), false);
+ this.element.addEventListener("dragstart", this._ondragstart.bind(this), false);
+ this.element.addEventListener("dragover", this._ondragover.bind(this), false);
+ this.element.addEventListener("dragleave", this._ondragleave.bind(this), false);
+ this.element.addEventListener("drop", this._ondrop.bind(this), false);
+ this.element.addEventListener("dragend", this._ondragend.bind(this), false);
+
+ this.element.classList.add(WebInspector.DOMTreeOutline.StyleClassName);
+ this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ TreeOutline.call(this, this.element);
+
+ this._includeRootDOMNode = !omitRootDOMNode;
+ this._selectEnabled = selectEnabled;
+ this._showInElementsPanelEnabled = showInElementsPanelEnabled;
+ this._rootDOMNode = null;
+ this._selectedDOMNode = null;
+ this._eventSupport = new WebInspector.Object();
+ this._editing = false;
+
+ this._visible = false;
+
+ this.element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
+
+ this._hideElementKeyboardShortcut = new WebInspector.KeyboardShortcut(null, "H", this._hideElement.bind(this), this.element);
+ this._hideElementKeyboardShortcut.implicitlyPreventsDefault = false;
+
+ WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+}
+
+WebInspector.Object.addConstructorFunctions(WebInspector.DOMTreeOutline);
+
+WebInspector.DOMTreeOutline.StyleClassName = "dom-tree-outline";
+
+WebInspector.DOMTreeOutline.Event = {
+ SelectedNodeChanged: "dom-tree-outline-selected-node-changed"
+}
+
+WebInspector.DOMTreeOutline.prototype = {
+ constructor: WebInspector.DOMTreeOutline,
+
+ wireToDomAgent: function()
+ {
+ this._elementsTreeUpdater = new WebInspector.DOMTreeUpdater(this);
+ },
+
+ close: function()
+ {
+ if (this._elementsTreeUpdater) {
+ this._elementsTreeUpdater.close();
+ this._elementsTreeUpdater = null;
+ }
+ },
+
+ setVisible: function(visible, omitFocus)
+ {
+ this._visible = visible;
+ if (!this._visible)
+ return;
+
+ this._updateModifiedNodes();
+ if (this._selectedDOMNode)
+ this._revealAndSelectNode(this._selectedDOMNode, omitFocus);
+ },
+
+ addEventListener: function(eventType, listener, thisObject)
+ {
+ this._eventSupport.addEventListener(eventType, listener, thisObject);
+ },
+
+ removeEventListener: function(eventType, listener, thisObject)
+ {
+ this._eventSupport.removeEventListener(eventType, listener, thisObject);
+ },
+
+ get rootDOMNode()
+ {
+ return this._rootDOMNode;
+ },
+
+ set rootDOMNode(x)
+ {
+ if (this._rootDOMNode === x)
+ return;
+
+ this._rootDOMNode = x;
+
+ this._isXMLMimeType = x && x.isXMLNode();
+
+ this.update();
+ },
+
+ get isXMLMimeType()
+ {
+ return this._isXMLMimeType;
+ },
+
+ selectedDOMNode: function()
+ {
+ return this._selectedDOMNode;
+ },
+
+ selectDOMNode: function(node, focus)
+ {
+ if (this._selectedDOMNode === node) {
+ this._revealAndSelectNode(node, !focus);
+ return;
+ }
+
+ this._selectedDOMNode = node;
+ this._revealAndSelectNode(node, !focus);
+
+ // The _revealAndSelectNode() method might find a different element if there is inlined text,
+ // and the select() call would change the selectedDOMNode and reenter this setter. So to
+ // avoid calling _selectedNodeChanged() twice, first check if _selectedDOMNode is the same
+ // node as the one passed in.
+ // Note that _revealAndSelectNode will not do anything for a null node.
+ if (!node || this._selectedDOMNode === node)
+ this._selectedNodeChanged();
+ },
+
+ get editing()
+ {
+ return this._editing;
+ },
+
+ update: function()
+ {
+ var selectedNode = this.selectedTreeElement ? this.selectedTreeElement.representedObject : null;
+
+ this.removeChildren();
+
+ if (!this.rootDOMNode)
+ return;
+
+ var treeElement;
+ if (this._includeRootDOMNode) {
+ treeElement = new WebInspector.DOMTreeElement(this.rootDOMNode);
+ treeElement.selectable = this._selectEnabled;
+ this.appendChild(treeElement);
+ } else {
+ // FIXME: this could use findTreeElement to reuse a tree element if it already exists
+ var node = this.rootDOMNode.firstChild;
+ while (node) {
+ treeElement = new WebInspector.DOMTreeElement(node);
+ treeElement.selectable = this._selectEnabled;
+ this.appendChild(treeElement);
+ node = node.nextSibling;
+ }
+ }
+
+ if (selectedNode)
+ this._revealAndSelectNode(selectedNode, true);
+ },
+
+ updateSelection: function()
+ {
+ if (!this.selectedTreeElement)
+ return;
+ var element = this.treeOutline.selectedTreeElement;
+ element.updateSelection();
+ },
+
+ _selectedNodeChanged: function()
+ {
+ this._eventSupport.dispatchEventToListeners(WebInspector.DOMTreeOutline.Event.SelectedNodeChanged);
+ },
+
+ findTreeElement: function(node)
+ {
+ function isAncestorNode(ancestor, node)
+ {
+ return ancestor.isAncestor(node);
+ }
+
+ function parentNode(node)
+ {
+ return node.parentNode;
+ }
+
+ var treeElement = TreeOutline.prototype.findTreeElement.call(this, node, isAncestorNode, parentNode);
+ if (!treeElement && node.nodeType() === Node.TEXT_NODE) {
+ // The text node might have been inlined if it was short, so try to find the parent element.
+ treeElement = TreeOutline.prototype.findTreeElement.call(this, node.parentNode, isAncestorNode, parentNode);
+ }
+
+ return treeElement;
+ },
+
+ createTreeElementFor: function(node)
+ {
+ var treeElement = this.findTreeElement(node);
+ if (treeElement)
+ return treeElement;
+ if (!node.parentNode)
+ return null;
+
+ treeElement = this.createTreeElementFor(node.parentNode);
+ if (treeElement && treeElement.showChild(node.index))
+ return treeElement.children[node.index];
+
+ return null;
+ },
+
+ set suppressRevealAndSelect(x)
+ {
+ if (this._suppressRevealAndSelect === x)
+ return;
+ this._suppressRevealAndSelect = x;
+ },
+
+ _revealAndSelectNode: function(node, omitFocus)
+ {
+ if (!node || this._suppressRevealAndSelect)
+ return;
+
+ var treeElement = this.createTreeElementFor(node);
+ if (!treeElement)
+ return;
+
+ treeElement.revealAndSelect(omitFocus);
+ },
+
+ _treeElementFromEvent: function(event)
+ {
+ var scrollContainer = this.element.parentElement;
+
+ // We choose this X coordinate based on the knowledge that our list
+ // items extend at least to the right edge of the outer <ol> container.
+ // In the no-word-wrap mode the outer <ol> may be wider than the tree container
+ // (and partially hidden), in which case we are left to use only its right boundary.
+ var x = scrollContainer.totalOffsetLeft + scrollContainer.offsetWidth - 36;
+
+ var y = event.pageY;
+
+ // Our list items have 1-pixel cracks between them vertically. We avoid
+ // the cracks by checking slightly above and slightly below the mouse
+ // and seeing if we hit the same element each time.
+ var elementUnderMouse = this.treeElementFromPoint(x, y);
+ var elementAboveMouse = this.treeElementFromPoint(x, y - 2);
+ var element;
+ if (elementUnderMouse === elementAboveMouse)
+ element = elementUnderMouse;
+ else
+ element = this.treeElementFromPoint(x, y + 2);
+
+ return element;
+ },
+
+ _onmousedown: function(event)
+ {
+ var element = this._treeElementFromEvent(event);
+ if (!element || element.isEventWithinDisclosureTriangle(event)) {
+ event.preventDefault();
+ return;
+ }
+
+ element.select();
+ },
+
+ _onmousemove: function(event)
+ {
+ var element = this._treeElementFromEvent(event);
+ if (element && this._previousHoveredElement === element)
+ return;
+
+ if (this._previousHoveredElement) {
+ this._previousHoveredElement.hovered = false;
+ delete this._previousHoveredElement;
+ }
+
+ if (element) {
+ element.hovered = true;
+ this._previousHoveredElement = element;
+
+ // Lazily compute tag-specific tooltips.
+ if (element.representedObject && !element.tooltip)
+ element._createTooltipForNode();
+ }
+
+ WebInspector.domTreeManager.highlightDOMNode(element ? element.representedObject.id : 0);
+ },
+
+ _onmouseout: function(event)
+ {
+ var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);
+ if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.element))
+ return;
+
+ if (this._previousHoveredElement) {
+ this._previousHoveredElement.hovered = false;
+ delete this._previousHoveredElement;
+ }
+
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ },
+
+ _ondragstart: function(event)
+ {
+ var treeElement = this._treeElementFromEvent(event);
+ if (!treeElement)
+ return false;
+
+ if (!this._isValidDragSourceOrTarget(treeElement))
+ return false;
+
+ if (treeElement.representedObject.nodeName() === "BODY" || treeElement.representedObject.nodeName() === "HEAD")
+ return false;
+
+ event.dataTransfer.setData("text/plain", treeElement.listItemElement.textContent);
+ event.dataTransfer.effectAllowed = "copyMove";
+ this._nodeBeingDragged = treeElement.representedObject;
+
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+
+ return true;
+ },
+
+ _ondragover: function(event)
+ {
+ if (!this._nodeBeingDragged)
+ return false;
+
+ var treeElement = this._treeElementFromEvent(event);
+ if (!this._isValidDragSourceOrTarget(treeElement))
+ return false;
+
+ var node = treeElement.representedObject;
+ while (node) {
+ if (node === this._nodeBeingDragged)
+ return false;
+ node = node.parentNode;
+ }
+
+ treeElement.updateSelection();
+ treeElement.listItemElement.classList.add("elements-drag-over");
+ this._dragOverTreeElement = treeElement;
+ event.preventDefault();
+ event.dataTransfer.dropEffect = 'move';
+ return false;
+ },
+
+ _ondragleave: function(event)
+ {
+ this._clearDragOverTreeElementMarker();
+ event.preventDefault();
+ return false;
+ },
+
+ _isValidDragSourceOrTarget: function(treeElement)
+ {
+ if (!treeElement)
+ return false;
+
+ var node = treeElement.representedObject;
+ if (!(node instanceof WebInspector.DOMNode))
+ return false;
+
+ if (!node.parentNode || node.parentNode.nodeType() !== Node.ELEMENT_NODE)
+ return false;
+
+ return true;
+ },
+
+ _ondrop: function(event)
+ {
+ event.preventDefault();
+ var treeElement = this._treeElementFromEvent(event);
+ if (this._nodeBeingDragged && treeElement) {
+ var parentNode;
+ var anchorNode;
+
+ if (treeElement._elementCloseTag) {
+ // Drop onto closing tag -> insert as last child.
+ parentNode = treeElement.representedObject;
+ } else {
+ var dragTargetNode = treeElement.representedObject;
+ parentNode = dragTargetNode.parentNode;
+ anchorNode = dragTargetNode;
+ }
+
+ function callback(error, newNodeId)
+ {
+ if (error)
+ return;
+
+ this._updateModifiedNodes();
+ var newNode = WebInspector.domTreeManager.nodeForId(newNodeId);
+ if (newNode)
+ this.selectDOMNode(newNode, true);
+ }
+ this._nodeBeingDragged.moveTo(parentNode, anchorNode, callback.bind(this));
+ }
+
+ delete this._nodeBeingDragged;
+ },
+
+ _ondragend: function(event)
+ {
+ event.preventDefault();
+ this._clearDragOverTreeElementMarker();
+ delete this._nodeBeingDragged;
+ },
+
+ _clearDragOverTreeElementMarker: function()
+ {
+ if (this._dragOverTreeElement) {
+ this._dragOverTreeElement.updateSelection();
+ this._dragOverTreeElement.listItemElement.classList.remove("elements-drag-over");
+ delete this._dragOverTreeElement;
+ }
+ },
+
+ _contextMenuEventFired: function(event)
+ {
+ var treeElement = this._treeElementFromEvent(event);
+ if (!treeElement)
+ return;
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+ this.populateContextMenu(contextMenu, event);
+ contextMenu.show();
+ },
+
+ populateContextMenu: function(contextMenu, event)
+ {
+ var treeElement = this._treeElementFromEvent(event);
+ if (!treeElement)
+ return false;
+
+ var tag = event.target.enclosingNodeOrSelfWithClass("html-tag");
+ var textNode = event.target.enclosingNodeOrSelfWithClass("html-text-node");
+ var commentNode = event.target.enclosingNodeOrSelfWithClass("html-comment");
+ var populated = false;
+ if (tag && treeElement._populateTagContextMenu) {
+ if (populated)
+ contextMenu.appendSeparator();
+ treeElement._populateTagContextMenu(contextMenu, event);
+ populated = true;
+ } else if (textNode && treeElement._populateTextContextMenu) {
+ if (populated)
+ contextMenu.appendSeparator();
+ treeElement._populateTextContextMenu(contextMenu, textNode);
+ populated = true;
+ } else if (commentNode && treeElement._populateNodeContextMenu) {
+ if (populated)
+ contextMenu.appendSeparator();
+ treeElement._populateNodeContextMenu(contextMenu, textNode);
+ populated = true;
+ }
+
+ return populated;
+ },
+
+ adjustCollapsedRange: function()
+ {
+ },
+
+ _updateModifiedNodes: function()
+ {
+ if (this._elementsTreeUpdater)
+ this._elementsTreeUpdater._updateModifiedNodes();
+ },
+
+ _populateContextMenu: function(contextMenu, domNode)
+ {
+ if (!this._showInElementsPanelEnabled)
+ return;
+
+ function revealElement()
+ {
+ WebInspector.domTreeManager.inspectElement(domNode.id);
+ }
+
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), revealElement);
+ },
+
+ _showShadowDOMSettingChanged: function(event)
+ {
+ var nodeToSelect = this.selectedTreeElement ? this.selectedTreeElement.representedObject : null;
+ while (nodeToSelect) {
+ if (!nodeToSelect.isInShadowTree())
+ break;
+ nodeToSelect = nodeToSelect.parentNode;
+ }
+
+ this.children.forEach(function(child) {
+ child.updateChildren(true);
+ });
+
+ if (nodeToSelect)
+ this.selectDOMNode(nodeToSelect);
+ },
+
+ _hideElement: function(event, keyboardShortcut)
+ {
+ if (!this.selectedTreeElement || WebInspector.isEditingAnyField())
+ return;
+
+ event.preventDefault();
+
+ var selectedNode = this.selectedTreeElement.representedObject;
+ console.assert(selectedNode);
+ if (!selectedNode)
+ return;
+
+ if (selectedNode.nodeType() !== Node.ELEMENT_NODE)
+ return;
+
+ if (this._togglePending)
+ return;
+ this._togglePending = true;
+
+ function toggleProperties()
+ {
+ nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, toggleProperties, this);
+
+ var opacityProperty = nodeStyles.inlineStyle.propertyForName("opacity");
+ opacityProperty.value = "0";
+ opacityProperty.important = true;
+
+ var pointerEventsProperty = nodeStyles.inlineStyle.propertyForName("pointer-events");
+ pointerEventsProperty.value = "none";
+ pointerEventsProperty.important = true;
+
+ if (opacityProperty.enabled && pointerEventsProperty.enabled) {
+ opacityProperty.remove();
+ pointerEventsProperty.remove();
+ } else {
+ opacityProperty.add();
+ pointerEventsProperty.add();
+ }
+
+ delete this._togglePending;
+ }
+
+ var nodeStyles = WebInspector.cssStyleManager.stylesForNode(selectedNode);
+ if (nodeStyles.needsRefresh) {
+ nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, toggleProperties, this);
+ nodeStyles.refresh();
+ } else
+ toggleProperties.call(this);
+ }
+}
+
+WebInspector.DOMTreeOutline.prototype.__proto__ = TreeOutline.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeUpdaterjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDOMTreeUpdaterjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DOMTreeUpdater.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+/**
+ * @constructor
+ */
+WebInspector.DOMTreeUpdater = function(treeOutline)
+{
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeInserted, this._nodeInserted, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeModified, this._attributesUpdated, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.AttributeRemoved, this._attributesUpdated, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.CharacterDataModified, this._characterDataModified, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DocumentUpdated, this._documentUpdated, this);
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.ChildNodeCountUpdated, this._childNodeCountUpdated, this);
+
+ this._treeOutline = treeOutline;
+ this._recentlyModifiedNodes = [];
+}
+
+WebInspector.DOMTreeUpdater.prototype = {
+ close: function()
+ {
+ WebInspector.domTreeManager.removeEventListener(null, null, this);
+ },
+
+ _documentUpdated: function(event)
+ {
+ this._reset();
+ },
+
+ _attributesUpdated: function(event)
+ {
+ this._recentlyModifiedNodes.push({node: event.data.node, updated: true});
+ if (this._treeOutline._visible)
+ this._updateModifiedNodesSoon();
+ },
+
+ _characterDataModified: function(event)
+ {
+ this._recentlyModifiedNodes.push({node: event.data.node, updated: true});
+ if (this._treeOutline._visible)
+ this._updateModifiedNodesSoon();
+ },
+
+ _nodeInserted: function(event)
+ {
+ this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, inserted: true});
+ if (this._treeOutline._visible)
+ this._updateModifiedNodesSoon();
+ },
+
+ _nodeRemoved: function(event)
+ {
+ this._recentlyModifiedNodes.push({node: event.data.node, parent: event.data.parent, removed: true});
+ if (this._treeOutline._visible)
+ this._updateModifiedNodesSoon();
+ },
+
+ _childNodeCountUpdated: function(event)
+ {
+ var treeElement = this._treeOutline.findTreeElement(event.data);
+ if (treeElement)
+ treeElement.hasChildren = event.data.hasChildNodes();
+ },
+
+ _updateModifiedNodesSoon: function()
+ {
+ if (this._updateModifiedNodesTimeout)
+ return;
+ this._updateModifiedNodesTimeout = setTimeout(this._updateModifiedNodes.bind(this), 0);
+ },
+
+ _updateModifiedNodes: function()
+ {
+ if (this._updateModifiedNodesTimeout) {
+ clearTimeout(this._updateModifiedNodesTimeout);
+ delete this._updateModifiedNodesTimeout;
+ }
+
+ var updatedParentTreeElements = [];
+
+ for (var i = 0; i < this._recentlyModifiedNodes.length; ++i) {
+ var parent = this._recentlyModifiedNodes[i].parent;
+ var node = this._recentlyModifiedNodes[i].node;
+
+ if (this._recentlyModifiedNodes[i].updated) {
+ var nodeItem = this._treeOutline.findTreeElement(node);
+ if (nodeItem)
+ nodeItem.updateTitle();
+ continue;
+ }
+
+ if (!parent)
+ continue;
+
+ var parentNodeItem = this._treeOutline.findTreeElement(parent);
+ if (parentNodeItem && !parentNodeItem.alreadyUpdatedChildren) {
+ parentNodeItem.updateChildren();
+ parentNodeItem.alreadyUpdatedChildren = true;
+ updatedParentTreeElements.push(parentNodeItem);
+ }
+ }
+
+ for (var i = 0; i < updatedParentTreeElements.length; ++i)
+ delete updatedParentTreeElements[i].alreadyUpdatedChildren;
+
+ this._recentlyModifiedNodes = [];
+ },
+
+ _reset: function()
+ {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ this._recentlyModifiedNodes = [];
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDashboardViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DashboardView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,243 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.toolbar .dashboard {
+ display: -webkit-flex;
+ -webkit-flex-flow: row nowrap;
+
+ -webkit-justify-content: space-between;
+
+ margin: 4px 10px;
+ padding: 0 5px;
+
+ width: 375px;
+
+ background-image: -webkit-linear-gradient(bottom, rgba(0, 128, 255, 0.075), rgba(0, 128, 255, 0)),
+ -webkit-linear-gradient(left, rgba(0, 0, 0, 0.09), transparent, rgba(0, 0, 0, 0.09)),
+ -webkit-linear-gradient(top, rgb(240, 244, 251), rgb(250, 253, 255));
+ background-size: 100% 6px, auto, auto;
+ background-position: bottom, center, center;
+ background-repeat: no-repeat;
+
+ border: 1px solid rgb(163, 163, 163);
+ border-radius: 4px;
+
+ box-shadow: rgba(255, 255, 255, 0.45) 0 1px 0;
+}
+
+body.window-inactive .toolbar .dashboard {
+ border-color: rgb(196, 196, 196);
+ background-image: none;
+ background-color: rgb(239, 239, 239);
+}
+
+.toolbar.collapsed .dashboard,
+body.javascript .toolbar .dashboard {
+ width: 175px;
+}
+
+body.web .toolbar.collapsed .dashboard > .time,
+body.web .toolbar.collapsed .dashboard > .resourcesSize,
+body.web .toolbar.collapsed .dashboard > .logs {
+ display: none;
+}
+
+body.javascript .toolbar .dashboard > .time,
+body.javascript .toolbar .dashboard > .resourcesSize,
+body.javascript .toolbar .dashboard > .resourcesCount {
+ display: none;
+}
+
+.toolbar .dashboard > .item {
+ font-family: Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 11px;
+ line-height: 12px;
+
+ padding: 0 5px;
+
+ display: -webkit-flex;
+
+ min-width: 45px;
+
+ -webkit-justify-content: center;
+ -webkit-align-items: center;
+
+ border-radius: 4px;
+ border: 1px solid transparent;
+}
+
+.toolbar .dashboard > .time,
+.toolbar .dashboard > .resourcesSize {
+ min-width: 70px;
+}
+
+.toolbar .dashboard > .item.enabled:hover {
+ border: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.toolbar .dashboard > .item.enabled:active {
+ border: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+.toolbar .dashboard > .item > * {
+ display: -webkit-flex;
+ -webkit-align-items: center;
+}
+
+.toolbar .dashboard > .item > img {
+ opacity: 0.2;
+ width: 16px;
+ height: 16px;
+ pointer-events: none;
+}
+
+.toolbar .dashboard > .item.enabled > img {
+ opacity: 0.5;
+}
+
+.toolbar .dashboard > .item.enabled:hover > img {
+ opacity: 0.65;
+}
+
+.toolbar .dashboard > .item > div {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ color: rgba(0, 0, 0, 0.2);
+ padding-left: 2px;
+}
+
+.toolbar .dashboard > .item.enabled > div {
+ color: rgba(0, 0, 0, 0.7);
+}
+
+.toolbar .dashboard > .item.enabled:hover > div {
+ color: rgba(0, 0, 0, 0.85);
+}
+
+.toolbar .dashboard > .resourcesCount > img {
+ content: url(../Images/Resources.svg);
+}
+
+.toolbar .dashboard > .time > img {
+ content: url(../Images/Time.svg);
+}
+
+.toolbar .dashboard > .logs > img {
+ content: url(../Images/Logs.svg);
+}
+
+.toolbar .dashboard > .resourcesSize > img {
+ content: url(../Images/Weight.svg);
+}
+
+.toolbar .dashboard > .errors > img {
+ content: url(../Images/Errors.svg);
+}
+
+.toolbar .dashboard > .errors.enabled > img {
+ content: url(../Images/ErrorsEnabled.svg);
+ opacity: 0.9;
+}
+
+.toolbar .dashboard > .errors.enabled:hover > img {
+ opacity: 1;
+}
+
+.toolbar .dashboard > .errors.enabled > div {
+ color: rgba(201, 55, 57, 0.9);
+}
+
+.toolbar .dashboard > .errors.enabled:hover > div {
+ color: rgb(201, 55, 57);
+}
+
+.toolbar .dashboard > .issues > img {
+ content: url(../Images/Issues.svg);
+}
+
+.toolbar .dashboard > .issues.enabled > img {
+ content: url(../Images/IssuesEnabled.svg);
+ opacity: 0.9;
+}
+
+.toolbar .dashboard > .issues.enabled:hover > img {
+ opacity: 1;
+}
+
+.toolbar .dashboard > .issues.enabled > div {
+ color: rgba(224, 164, 4, 0.9);
+}
+
+.toolbar .dashboard > .issues.enabled:hover > div {
+ color: rgb(224, 164, 4);
+}
+
+.toolbar.small-size.icon-and-label-vertical .dashboard,
+.toolbar.normal-size.icon-and-label-vertical .dashboard {
+ margin-top: 6px;
+}
+
+/* Styles for the extra short style, one row with quite a small y-margin */
+
+.toolbar.label-only .dashboard,
+.toolbar.small-size.icon-only .dashboard,
+.toolbar.small-size.icon-and-label-vertical .dashboard,
+.toolbar.small-size.icon-and-label-horizontal .dashboard {
+ height: 22px;
+}
+
+.toolbar.label-only .dashboard > .item,
+.toolbar.small-size.icon-only .dashboard > .item,
+.toolbar.small-size.icon-and-label-vertical .dashboard > .item,
+.toolbar.small-size.icon-and-label-horizontal .dashboard > .item {
+ margin: 1px 0;
+}
+
+/* Styles for the fairly short style, one row with quite a bit of y-margin */
+
+.toolbar.normal-size.icon-only .dashboard,
+.toolbar.normal-size.icon-and-label-vertical .dashboard,
+.toolbar.normal-size.icon-and-label-horizontal .dashboard {
+ height: 30px;
+}
+
+.toolbar.normal-size.icon-only .dashboard > .item,
+.toolbar.normal-size.icon-and-label-vertical .dashboard > .item,
+.toolbar.normal-size.icon-and-label-horizontal .dashboard > .item {
+ margin: 4px 0;
+}
+
+/* Styles for the pulsing animated state of console items */
+
+.toolbar .dashboard > .item.pulsing {
+ -webkit-animation-name: console-item-pulse;
+ -webkit-animation-duration: 0.75s;
+}
+
+@-webkit-keyframes console-item-pulse {
+ 50% { opacity: 0.6; }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDashboardViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DashboardView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,245 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DashboardView = function(element)
+{
+ WebInspector.Object.call(this);
+
+ this._element = element;
+
+ this._items = {
+ resourcesCount: {
+ tooltip: WebInspector.UIString("Total number of resources, click to show the Resources navigation sidebar"),
+ handler: this._resourcesWasClicked
+ },
+ resourcesSize: {
+ tooltip: WebInspector.UIString("Total size of all resources, click to show the Network Requests timeline"),
+ handler: this._networkItemWasClicked
+ },
+ time: {
+ tooltip: WebInspector.UIString("Time until the load event fired, click to show the Network Requests timeline"),
+ handler: this._networkItemWasClicked
+ },
+ logs: {
+ tooltip: WebInspector.UIString("Console logs, click to show the Console"),
+ handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Logs)
+ },
+ errors: {
+ tooltip: WebInspector.UIString("Console errors, click to show the Console"),
+ handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Errors)
+ },
+ issues: {
+ tooltip: WebInspector.UIString("Console warnings, click to show the Console"),
+ handler: this._consoleItemWasClicked.bind(this, WebInspector.LogContentView.Scopes.Warnings)
+ }
+ };
+
+ for (var name in this._items)
+ this._appendElementForNamedItem(name);
+
+ this.resourcesCount = 0;
+ this.resourcesSize = 0;
+ this.time = 0;
+ this.logs = 0;
+ this.errors = 0;
+ this.issues = 0;
+};
+
+WebInspector.DashboardView.EnabledStyleClassName = "enabled";
+
+WebInspector.DashboardView.prototype = {
+ constructor: WebInspector.DashboardView,
+
+ // Public
+
+ get logs()
+ {
+ return this._logs;
+ },
+
+ set logs(logs)
+ {
+ this._setConsoleItemValue("logs", logs);
+ },
+
+ get issues()
+ {
+ return this._issues;
+ },
+
+ set issues(issues)
+ {
+ this._setConsoleItemValue("issues", issues);
+ },
+
+ get errors()
+ {
+ return this._errors;
+ },
+
+ set errors(errors)
+ {
+ this._setConsoleItemValue("errors", errors);
+ },
+
+ set time(time)
+ {
+ var item = this._items.time;
+ item.text = time ? Number.secondsToString(time) : "\u2014";
+ this._setItemEnabled(item, time > 0);
+ },
+
+ get resourcesCount()
+ {
+ return this._resourcesCount;
+ },
+
+ set resourcesCount(resourcesCount)
+ {
+ this._resourcesCount = resourcesCount;
+
+ var item = this._items.resourcesCount;
+ item.text = this._formatPossibleLargeNumber(resourcesCount);
+ this._setItemEnabled(item, resourcesCount > 0);
+ },
+
+ get resourcesSize()
+ {
+ return this._resourcesSize;
+ },
+
+ set resourcesSize(resourcesSize)
+ {
+ this._resourcesSize = resourcesSize;
+
+ var item = this._items.resourcesSize;
+ item.text = resourcesSize ? Number.bytesToString(resourcesSize, false) : "\u2014";
+ this._setItemEnabled(item, resourcesSize > 0);
+ },
+
+ // Private
+
+ _formatPossibleLargeNumber: function(number)
+ {
+ return number > 999 ? WebInspector.UIString("999+") : number;
+ },
+
+ _appendElementForNamedItem: function(name)
+ {
+ var item = this._items[name];
+
+ item.container = this._element.appendChild(document.createElement("div"));
+ item.container.className = "item " + name;
+ item.container.title = item.tooltip;
+
+ item.container.appendChild(document.createElement("img"));
+
+ item.outlet = item.container.appendChild(document.createElement("div"));
+
+ Object.defineProperty(item, "text",
+ {
+ set: function(newText)
+ {
+ if (newText === item.outlet.textContent)
+ return;
+ item.outlet.textContent = newText;
+ }
+ });
+
+ item.container.addEventListener("click", function(event) {
+ this._itemWasClicked(name);
+ }.bind(this));
+ },
+
+ _itemWasClicked: function(name)
+ {
+ var item = this._items[name];
+ if (!item.container.classList.contains(WebInspector.DashboardView.EnabledStyleClassName))
+ return;
+
+ if (item.handler)
+ item.handler.call(this);
+ },
+
+ _resourcesWasClicked: function()
+ {
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
+ WebInspector.navigationSidebar.collapsed = false;
+ },
+
+ _networkItemWasClicked: function()
+ {
+ WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.timelineSidebarPanel;
+ },
+
+ _consoleItemWasClicked: function(scope)
+ {
+ WebInspector.showConsoleView(scope);
+ },
+
+ _setConsoleItemValue: function(itemName, newValue)
+ {
+ var iVarName = "_" + itemName;
+ var previousValue = this[iVarName];
+ this[iVarName] = newValue;
+
+ var item = this._items[itemName];
+ item.text = this._formatPossibleLargeNumber(newValue);
+ this._setItemEnabled(item, newValue > 0);
+
+ if (newValue <= previousValue)
+ return;
+
+ var container = item.container;
+
+ function animationEnded(event)
+ {
+ if (event.target === container) {
+ container.classList.remove("pulsing");
+ container.removeEventListener("webkitAnimationEnd", animationEnded);
+ }
+ }
+
+ // We need to force a style invalidation in the case where we already
+ // were animating this item after we've removed the pulsing CSS class.
+ if (container.classList.contains("pulsing")) {
+ container.classList.remove("pulsing");
+ container.recalculateStyles();
+ } else
+ container.addEventListener("webkitAnimationEnd", animationEnded);
+
+ container.classList.add("pulsing");
+ },
+
+ _setItemEnabled: function(item, enabled)
+ {
+ if (enabled)
+ item.container.classList.add(WebInspector.DashboardView.EnabledStyleClassName);
+ else
+ item.container.classList.remove(WebInspector.DashboardView.EnabledStyleClassName);
+ }
+};
+
+WebInspector.DashboardView.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDataGridcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDataGridcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DataGrid.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,337 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.data-grid {
+ position: relative;
+ border: 1px solid #aaa;
+ outline: none;
+}
+
+.data-grid .highlight {
+ background-color: rgb(255, 230, 179);
+}
+
+.data-grid tr.selected .highlight {
+ background-color: transparent;
+}
+
+.data-grid table {
+ table-layout: fixed;
+ border-spacing: 0;
+ border-collapse: collapse;
+ width: 100%;
+ font-size: 10px;
+ font-family: Lucida Grande, sans-serif;
+}
+
+.data-grid .data-container {
+ position: absolute;
+ top: 16px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ overflow-x: hidden;
+ overflow-y: overlay;
+}
+
+.data-grid.inline .data-container {
+ position: static;
+}
+
+.data-grid.inline {
+ border: 1px solid rgb(181, 181, 181);
+}
+
+.data-grid.no-header > table.header {
+ display: none;
+}
+
+.data-grid.no-header .data-container {
+ top: 0;
+}
+
+.data-grid th {
+ text-align: left;
+ vertical-align: middle;
+
+ background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), -webkit-linear-gradient(top, transparent, transparent),
+ -webkit-linear-gradient(top, white, white 25%, rgb(244, 244, 244) 50%, rgb(236, 236, 236) 50%, rgb(237, 237, 237));
+ background-size: 1px 11px, 0 0, 100% 100%;
+ background-position: left 2px, right 2px, center;
+ background-repeat: no-repeat;
+
+ box-shadow: inset rgba(255, 255, 255, 0.3) 0 -1px 0;
+ border-bottom: 1px solid rgb(182, 182, 182);
+
+ height: 15px;
+ font-weight: normal;
+ padding: 0 4px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.data-grid th:first-child {
+ background-position: -1px 2px, right 2px, center;
+}
+
+.data-grid th:active:first-child {
+ background-position: -1px 2px, right top, center;
+}
+
+.data-grid th:last-child {
+ background-position: left 2px, -1px 2px, center;
+}
+
+.data-grid th:active:last-child {
+ background-position: left top, -1px top, center;
+}
+
+.data-grid tr.filler {
+ display: table-row !important;
+ height: auto !important;
+}
+
+.data-grid tr.filler td {
+ height: auto !important;
+ padding: 0 !important;
+}
+
+.data-grid table.data {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ height: 100%;
+ border-top: 0 none transparent;
+ background-image: -webkit-linear-gradient(top, white, white 50%, rgb(243, 246, 250) 50%, rgb(243, 246, 250));
+ background-size: 100% 32px;
+ table-layout: fixed;
+}
+
+.data-grid.inline table.data {
+ position: static;
+}
+
+.data-grid table.data tr {
+ display: none;
+}
+
+.data-grid table.data tr.revealed {
+ display: table-row;
+}
+
+.data-grid td {
+ vertical-align: top;
+ height: 12px;
+ line-height: 12px;
+ padding: 2px 4px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.data-grid td:last-child {
+ padding-right: 16px;
+}
+
+.data-grid td > div, .data-grid th > div {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.data-grid .centered div {
+ text-align: center;
+}
+
+.data-grid .right div {
+ text-align: right;
+}
+
+.data-grid th.sortable div {
+ position: relative;
+}
+
+.data-grid th.sortable:not(.mouse-over-collapser):active {
+ background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
+ -webkit-linear-gradient(top, rgb(224, 224, 224), rgb(224, 224, 224) 25%, rgb(214, 214, 214) 50%, rgb(207, 207, 207) 50%, rgb(208, 208, 208));
+ background-size: 1px 15px, 1px 15px, 100% 100%;
+ background-position: left top, right top, center;
+
+ box-shadow: inset rgba(255, 255, 255, 0.1) 0 -1px 0;
+ border-bottom: 1px solid rgb(160, 160, 160);
+}
+
+.data-grid th.sort-ascending, .data-grid th.sort-descending {
+ background-image: -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)), -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)),
+ -webkit-linear-gradient(top, rgb(199, 226, 246), rgb(169, 209, 239) 25%, rgb(158, 204, 239) 50%, rgb(142, 196, 237) 50%, rgb(187, 230, 245));
+ background-size: 1px 15px, 1px 15px, 100% 100%;
+ background-position: left top, right top, center;
+
+ box-shadow: inset rgba(255, 255, 255, 0.1) 0 -1px 0;
+ border-bottom: 1px solid rgb(130, 179, 210);
+}
+
+.data-grid th.sortable.sort-ascending:not(.mouse-over-collapser):active, .data-grid th.sortable.sort-descending:not(.mouse-over-collapser):active {
+ background-image: -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)), -webkit-linear-gradient(top, rgba(0, 0, 120, 0.2), rgba(0, 0, 120, 0.2)),
+ -webkit-linear-gradient(top, rgb(144, 180, 227), rgb(109, 160, 220) 25%, rgb(96, 155, 221) 50%, rgb(77, 146, 219) 50%, rgb(130, 186, 227));
+ background-size: 1px 15px, 1px 15px, 100% 100%;
+ background-position: left top, right top, center;
+
+ border-bottom: 1px solid rgb(63, 125, 192);
+}
+
+.data-grid th:active + th,
+.data-grid th.sort-ascending + th,
+.data-grid th.sort-descending + th {
+ background-position: -1px 2px, -1px 2px, center;
+}
+
+.data-grid th:active + th.sort-ascending,
+.data-grid th:active + th.sort-descending,
+.data-grid th.sort-ascending + th:active,
+.data-grid th.sort-descending + th:active {
+ background-position: -1px top, right top, center;
+}
+
+.data-grid th:first-child:active,
+.data-grid th.sort-ascending:first-child,
+.data-grid th.sort-descending:first-child {
+ background-position: -1px top, right top, center !important;
+}
+
+.data-grid th:last-child:active,
+.data-grid th.sort-ascending:last-child,
+.data-grid th.sort-descending:last-child {
+ background-position: left top, -1px top, center !important;
+}
+
+.data-grid th.sort-ascending > div:first-child,
+.data-grid th.sort-descending > div:first-child {
+ padding-right: 10px;
+}
+
+.data-grid th.sort-ascending > div:first-child::after {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+
+ margin-bottom: auto;
+ margin-top: auto;
+
+ width: 9px;
+ height: 8px;
+
+ content: "";
+
+ background-image: -webkit-canvas(data-grid-sort-indicator-up-arrow);
+ background-size: 9px 8px;
+ background-repeat: no-repeat;
+}
+
+.data-grid th.sort-descending > div:first-child::after {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+
+ margin-bottom: auto;
+ margin-top: auto;
+
+ width: 9px;
+ height: 8px;
+
+ content: "";
+
+ background-image: -webkit-canvas(data-grid-sort-indicator-down-arrow);
+ background-size: 9px 8px;
+ background-repeat: no-repeat;
+}
+
+.data-grid button {
+ line-height: 19px;
+}
+
+body.window-inactive .data-grid th.sort-ascending,
+body.window-inactive .data-grid th.sort-descending {
+ background-image: -webkit-linear-gradient(top, white, white 25%, rgb(244, 244, 244) 50%, rgb(236, 236, 236) 50%, rgb(237, 237, 237)),
+ -webkit-linear-gradient(top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
+ background-size: 100% 100%, 1px 11px;
+ background-position: center, right center;
+ background-repeat: no-repeat;
+ border-bottom: 1px solid rgb(182, 182, 182);
+}
+
+.data-grid tr.parent td.disclosure::before {
+ float: left;
+
+ content: "";
+
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
+ background-size: 8px 8px;
+ background-repeat: no-repeat;
+
+ width: 8px;
+ height: 8px;
+
+ margin-top: 2px;
+ margin-right: 2px;
+}
+
+.data-grid tr.parent.expanded td.disclosure::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
+}
+
+.data-grid:focus tr.parent.selected td.disclosure::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
+}
+
+.data-grid:focus tr.parent.expanded.selected td.disclosure::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
+}
+
+.data-grid tr.selected {
+ background-color: rgb(212, 212, 212) !important;
+ color: inherit !important;
+}
+
+.data-grid:focus tr.selected {
+ background-color: rgb(56, 121, 217) !important;
+ color: white !important;
+}
+
+.data-grid tr:not(.parent) td.disclosure {
+ text-indent: 10px;
+}
+
+.data-grid-resizer {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 5px;
+ z-index: 500;
+ cursor: col-resize;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1872 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013, 2014 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.DataGrid = function(columnsData, editCallback, deleteCallback)
+{
+ this.columns = new Map;
+ this.orderedColumns = [];
+
+ this.children = [];
+ this.selectedNode = null;
+ this.expandNodesWhenArrowing = false;
+ this.root = true;
+ this.hasChildren = false;
+ this.expanded = true;
+ this.revealed = true;
+ this.selected = false;
+ this.dataGrid = this;
+ this.indentWidth = 15;
+ this.resizerElements = [];
+ this._columnWidthsInitialized = false;
+
+ this.element = document.createElement("div");
+ this.element.className = "data-grid";
+ this.element.tabIndex = 0;
+ this.element.addEventListener("keydown", this._keyDown.bind(this), false);
+ this.element.copyHandler = this;
+
+ this._headerTableElement = document.createElement("table");
+ this._headerTableElement.className = "header";
+ this._headerTableColumnGroupElement = this._headerTableElement.createChild("colgroup");
+ this._headerTableBodyElement = this._headerTableElement.createChild("tbody");
+ this._headerTableRowElement = this._headerTableBodyElement.createChild("tr");
+ this._headerTableCellElements = new Map;
+
+ this._scrollContainerElement = document.createElement("div");
+ this._scrollContainerElement.className = "data-container";
+
+ this._dataTableElement = this._scrollContainerElement.createChild("table");
+ this._dataTableElement.className = "data";
+
+ this._dataTableElement.addEventListener("mousedown", this._mouseDownInDataTable.bind(this));
+ this._dataTableElement.addEventListener("click", this._clickInDataTable.bind(this));
+ this._dataTableElement.addEventListener("contextmenu", this._contextMenuInDataTable.bind(this), true);
+
+ // FIXME: Add a createCallback which is different from editCallback and has different
+ // behavior when creating a new node.
+ if (editCallback) {
+ this._dataTableElement.addEventListener("dblclick", this._ondblclick.bind(this), false);
+ this._editCallback = editCallback;
+ }
+ if (deleteCallback)
+ this._deleteCallback = deleteCallback;
+
+ this._dataTableColumnGroupElement = this._headerTableColumnGroupElement.cloneNode(true);
+ this._dataTableElement.appendChild(this._dataTableColumnGroupElement);
+
+ // This element is used by DataGridNodes to manipulate table rows and cells.
+ this.dataTableBodyElement = this._dataTableElement.createChild("tbody");
+ this._fillerRowElement = this.dataTableBodyElement.createChild("tr");
+ this._fillerRowElement.className = "filler";
+
+ this.element.appendChild(this._headerTableElement);
+ this.element.appendChild(this._scrollContainerElement);
+
+ for (var columnIdentifier in columnsData)
+ this.insertColumn(columnIdentifier, columnsData[columnIdentifier]);
+
+ this._generateSortIndicatorImagesIfNeeded();
+}
+
+WebInspector.DataGrid.Event = {
+ DidLayout: "datagrid-did-layout",
+ SortChanged: "datagrid-sort-changed",
+ SelectedNodeChanged: "datagrid-selected-node-changed",
+ ExpandedNode: "datagrid-expanded-node",
+ CollapsedNode: "datagrid-collapsed-node"
+};
+
+/**
+ * @param {Array.<string>} columnNames
+ * @param {Array.<string>} values
+ */
+WebInspector.DataGrid.createSortableDataGrid = function(columnNames, values)
+{
+ var numColumns = columnNames.length;
+ if (!numColumns)
+ return null;
+
+ var columnsData = {};
+
+ for (var columnName of columnNames) {
+ var column = {};
+ column.width = columnName.length;
+ column.title = columnName;
+ column.sortable = true;
+
+ columnsData[columnName] = column;
+ }
+
+ var dataGrid = new WebInspector.DataGrid(columnsData);
+ for (var i = 0; i < values.length / numColumns; ++i) {
+ var data = {};
+ for (var j = 0; j < columnNames.length; ++j)
+ data[columnNames[j]] = values[numColumns * i + j];
+
+ var node = new WebInspector.DataGridNode(data, false);
+ node.selectable = false;
+ dataGrid.appendChild(node);
+ }
+
+ function sortDataGrid()
+ {
+ var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
+ var sortAscending = dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ for (var node of dataGrid.children) {
+ if (isNaN(Number(node.data[sortColumnIdentifier] || "")))
+ columnIsNumeric = false;
+ }
+
+ function comparator(dataGridNode1, dataGridNode2)
+ {
+ var item1 = dataGridNode1.data[sortColumnIdentifier] || "";
+ var item2 = dataGridNode2.data[sortColumnIdentifier] || "";
+
+ var comparison;
+ if (columnIsNumeric) {
+ // Sort numbers based on comparing their values rather than a lexicographical comparison.
+ var number1 = parseFloat(item1);
+ var number2 = parseFloat(item2);
+ comparison = number1 < number2 ? -1 : (number1 > number2 ? 1 : 0);
+ } else
+ comparison = item1 < item2 ? -1 : (item1 > item2 ? 1 : 0);
+
+ return sortDirection * comparison;
+ }
+
+ dataGrid.sortNodes(comparator);
+ }
+
+ dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, sortDataGrid, this);
+ return dataGrid;
+}
+
+WebInspector.DataGrid.prototype = {
+ get refreshCallback()
+ {
+ return this._refreshCallback;
+ },
+
+ set refreshCallback(refreshCallback)
+ {
+ this._refreshCallback = refreshCallback;
+ },
+
+ _ondblclick: function(event)
+ {
+ if (this._editing || this._editingNode)
+ return;
+
+ this._startEditing(event.target);
+ },
+
+ _startEditingNodeAtColumnIndex: function(node, columnIndex)
+ {
+ console.assert(node, "Invalid argument: must provide DataGridNode to edit.");
+
+ this._editing = true;
+ this._editingNode = node;
+ this._editingNode.select();
+
+ var element = this._editingNode._element.children[columnIndex];
+ WebInspector.startEditing(element, this._startEditingConfig(element));
+ window.getSelection().setBaseAndExtent(element, 0, element, 1);
+ },
+
+ _startEditing: function(target)
+ {
+ var element = target.enclosingNodeOrSelfWithNodeName("td");
+ if (!element)
+ return;
+
+ this._editingNode = this.dataGridNodeFromNode(target);
+ if (!this._editingNode) {
+ if (!this.placeholderNode)
+ return;
+ this._editingNode = this.placeholderNode;
+ }
+
+ // Force editing the 1st column when editing the placeholder node
+ if (this._editingNode.isPlaceholderNode)
+ return this._startEditingNodeAtColumnIndex(this._editingNode, 0);
+
+ this._editing = true;
+ WebInspector.startEditing(element, this._startEditingConfig(element));
+
+ window.getSelection().setBaseAndExtent(element, 0, element, 1);
+ },
+
+ _startEditingConfig: function(element)
+ {
+ return new WebInspector.EditingConfig(this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent);
+ },
+
+ _editingCommitted: function(element, newText, oldText, context, moveDirection)
+ {
+ var columnIdentifier = element.__columnIdentifier;
+ var columnIndex = this.orderedColumns.indexOf(columnIdentifier);
+
+ var textBeforeEditing = this._editingNode.data[columnIdentifier] || "";
+ var currentEditingNode = this._editingNode;
+
+ // Returns an object with the next node and column index to edit, and whether it
+ // is an appropriate time to re-sort the table rows. When editing, we want to
+ // postpone sorting until we switch rows or wrap around a row.
+ function determineNextCell(valueDidChange) {
+ if (moveDirection === "forward") {
+ if (columnIndex < this.orderedColumns.length - 1)
+ return {shouldSort: false, editingNode: currentEditingNode, columnIndex: columnIndex + 1};
+
+ // Continue by editing the first column of the next row if it exists.
+ var nextDataGridNode = currentEditingNode.traverseNextNode(true, null, true);
+ return {shouldSort: true, editingNode: nextDataGridNode || currentEditingNode, columnIndex: 0};
+ }
+
+ if (moveDirection === "backward") {
+ if (columnIndex > 0)
+ return {shouldSort: false, editingNode: currentEditingNode, columnIndex: columnIndex - 1};
+
+ var previousDataGridNode = currentEditingNode.traversePreviousNode(true, null, true);
+ return {shouldSort: true, editingNode: previousDataGridNode || currentEditingNode, columnIndex: this.orderedColumns.length - 1};
+ }
+
+ // If we are not moving in any direction, then sort but don't move.
+ return {shouldSort: true, editingNode: currentEditingNode, columnIndex: columnIndex};
+ }
+
+ function moveToNextCell(valueDidChange) {
+ var moveCommand = determineNextCell.call(this, valueDidChange);
+ if (moveCommand.shouldSort && this._sortAfterEditingCallback) {
+ this._sortAfterEditingCallback();
+ delete this._sortAfterEditingCallback;
+ }
+ this._startEditingNodeAtColumnIndex(moveCommand.editingNode, moveCommand.columnIndex);
+ }
+
+ this._editingCancelled(element);
+
+ // Update table's data model, and delegate to the callback to update other models.
+ currentEditingNode.data[columnIdentifier] = newText.trim();
+ this._editCallback(currentEditingNode, columnIdentifier, textBeforeEditing, newText, moveDirection);
+
+ var textDidChange = textBeforeEditing.trim() !== newText.trim();
+ moveToNextCell.call(this, textDidChange);
+ },
+
+ _editingCancelled: function(element)
+ {
+ console.assert(this._editingNode.element === element.enclosingNodeOrSelfWithNodeName("tr"));
+ delete this._editing;
+ this._editingNode = null;
+ },
+
+ get sortColumnIdentifier()
+ {
+ return this._sortColumnCell ? this._sortColumnCell.columnIdentifier : null;
+ },
+
+ get sortOrder()
+ {
+ if (!this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending"))
+ return "ascending";
+ if (this._sortColumnCell.classList.contains("sort-descending"))
+ return "descending";
+ return null;
+ },
+
+ autoSizeColumns: function(minPercent, maxPercent, maxDescentLevel)
+ {
+ if (minPercent)
+ minPercent = Math.min(minPercent, Math.floor(100 / this.orderedColumns.length));
+ var widths = {};
+ // For the first width approximation, use the character length of column titles.
+ for (var [identifier, column] of this.columns)
+ widths[identifier] = column.get("title", "").length;
+
+ // Now approximate the width of each column as max(title, cells).
+ var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel + 1) : this.children;
+ for (var node of children) {
+ for (var identifier of this.columns.keys()) {
+ var text = node.data[identifier] || "";
+ if (text.length > widths[identifier])
+ widths[identifier] = text.length;
+ }
+ }
+
+ var totalColumnWidths = 0;
+ for (var identifier of this.columns.keys())
+ totalColumnWidths += widths[identifier];
+
+ // Compute percentages and clamp desired widths to min and max widths.
+ var recoupPercent = 0;
+ for (var identifier of this.columns.keys()) {
+ var width = Math.round(100 * widths[identifier] / totalColumnWidths);
+ if (minPercent && width < minPercent) {
+ recoupPercent += (minPercent - width);
+ width = minPercent;
+ } else if (maxPercent && width > maxPercent) {
+ recoupPercent -= (width - maxPercent);
+ width = maxPercent;
+ }
+ widths[identifier] = width;
+ }
+
+ // If we assigned too much width due to the above, reduce column widths.
+ while (minPercent && recoupPercent > 0) {
+ for (var identifier of this.columns.keys()) {
+ if (widths[identifier] > minPercent) {
+ --widths[identifier];
+ --recoupPercent;
+ if (!recoupPercent)
+ break;
+ }
+ }
+ }
+
+ // If extra width remains after clamping widths, expand column widths.
+ while (maxPercent && recoupPercent < 0) {
+ for (var identifier of this.columns.keys()) {
+ if (widths[identifier] < maxPercent) {
+ ++widths[identifier];
+ ++recoupPercent;
+ if (!recoupPercent)
+ break;
+ }
+ }
+ }
+
+ for (var [identifier, column] of this.columns)
+ column.get("element").style.width = widths[identifier] + "%";
+ this._columnWidthsInitialized = false;
+ this.updateLayout();
+ },
+
+ insertColumn: function(columnIdentifier, columnData, insertionIndex) {
+ if (typeof insertionIndex === "undefined")
+ insertionIndex = this.orderedColumns.length;
+ insertionIndex = Number.constrain(insertionIndex, 0, this.orderedColumns.length);
+
+ var listeners = new WebInspector.EventListenerSet(this, "DataGrid column DOM listeners");
+
+ // Copy configuration properties instead of keeping a reference to the passed-in object.
+ var column = new Map;
+ for (var propertyName in columnData)
+ column.set(propertyName, columnData[propertyName]);
+
+ column.set("listeners", listeners);
+ column.set("ordinal", insertionIndex);
+ column.set("columnIdentifier", columnIdentifier);
+ this.orderedColumns.splice(insertionIndex, 0, columnIdentifier);
+
+ for (var [identifier, existingColumn] of this.columns) {
+ var ordinal = existingColumn.get("ordinal");
+ if (ordinal >= insertionIndex) // Also adjust the "old" column at insertion index.
+ existingColumn.set("ordinal", ordinal + 1);
+ }
+ this.columns.set(columnIdentifier, column);
+
+ if (column.has("disclosure"))
+ this.disclosureColumnIdentifier = columnIdentifier;
+
+ var headerColumnElement = document.createElement("col");
+ if (column.has("width"))
+ headerColumnElement.style.width = column.get("width");
+ column.set("element", headerColumnElement);
+ var referenceElement = this._headerTableColumnGroupElement.children[insertionIndex];
+ this._headerTableColumnGroupElement.insertBefore(headerColumnElement, referenceElement);
+
+ var headerCellElement = document.createElement("th");
+ headerCellElement.className = columnIdentifier + "-column";
+ headerCellElement.columnIdentifier = columnIdentifier;
+ if (column.has("aligned"))
+ headerCellElement.classList.add(column.get("aligned"));
+ this._headerTableCellElements.set(columnIdentifier, headerCellElement);
+ var referenceElement = this._headerTableRowElement.children[insertionIndex];
+ this._headerTableRowElement.insertBefore(headerCellElement, referenceElement);
+
+ var div = headerCellElement.createChild("div");
+ if (column.has("titleDOMFragment"))
+ div.appendChild(column.get("titleDOMFragment"));
+ else
+ div.textContent = column.get("title", "");
+
+ if (column.has("sort")) {
+ headerCellElement.classList.add("sort-" + column.get("sort"));
+ this._sortColumnCell = headerCellElement;
+ }
+
+ if (column.has("sortable")) {
+ listeners.register(headerCellElement, "click", this._clickInHeaderCell, false);
+ headerCellElement.classList.add("sortable");
+ }
+
+ if (column.has("group"))
+ headerCellElement.classList.add("column-group-" + column.get("group"));
+
+ if (column.has("collapsesGroup")) {
+ console.assert(column.get("group") !== column.get("collapsesGroup"));
+
+ var dividerElement = headerCellElement.createChild("div");
+ dividerElement.className = "divider";
+
+ var collapseDiv = headerCellElement.createChild("div");
+ collapseDiv.className = "collapser-button";
+ collapseDiv.title = this._collapserButtonCollapseColumnsToolTip();
+ listeners.register(collapseDiv, "mouseover", this._mouseoverColumnCollapser);
+ listeners.register(collapseDiv, "mouseout", this._mouseoutColumnCollapser);
+ listeners.register(collapseDiv, "click", this._clickInColumnCollapser);
+
+ headerCellElement.collapsesGroup = column.get("collapsesGroup");
+ headerCellElement.classList.add("collapser");
+ }
+
+ this._headerTableColumnGroupElement.span = this.orderedColumns.length;
+
+ var dataColumnElement = headerColumnElement.cloneNode();
+ var referenceElement = this._dataTableColumnGroupElement.children[insertionIndex];
+ this._dataTableColumnGroupElement.insertBefore(dataColumnElement, referenceElement);
+ column.set("bodyElement", dataColumnElement);
+
+ var fillerCellElement = document.createElement("td");
+ fillerCellElement.className = columnIdentifier + "-column";
+ fillerCellElement.__columnIdentifier = columnIdentifier;
+ if (column.has("group"))
+ fillerCellElement.classList.add("column-group-" + column.get("group"));
+ var referenceElement = this._fillerRowElement.children[insertionIndex];
+ this._fillerRowElement.insertBefore(fillerCellElement, referenceElement);
+
+ listeners.install();
+
+ if (column.has("hidden"))
+ this._hideColumn(columnIdentifier);
+ },
+
+ removeColumn: function(columnIdentifier)
+ {
+ console.assert(this.columns.has(columnIdentifier));
+ var removedColumn = this.columns.get(columnIdentifier);
+ this.columns.delete(columnIdentifier);
+ this.orderedColumns.splice(this.orderedColumns.indexOf(columnIdentifier), 1);
+
+ var removedOrdinal = removedColumn.get("ordinal");
+ for (var [identifier, column] of this.columns) {
+ var ordinal = column.get("ordinal");
+ if (ordinal > removedOrdinal)
+ column.set("ordinal", ordinal - 1);
+ }
+
+ removedColumn.get("listeners").uninstall(true);
+
+ if (removedColumn.has("disclosure"))
+ delete this.disclosureColumnIdentifier;
+
+ if (removedColumn.has("sort"))
+ delete this._sortColumnCell;
+
+ this._headerTableCellElements.delete(columnIdentifier);
+ this._headerTableRowElement.children[removedOrdinal].remove();
+ this._headerTableColumnGroupElement.children[removedOrdinal].remove();
+ this._dataTableColumnGroupElement.children[removedOrdinal].remove();
+ this._fillerRowElement.children[removedOrdinal].remove();
+
+ this._headerTableColumnGroupElement.span = this.orderedColumns.length;
+
+ for (var child of this.children)
+ child.refresh();
+ },
+
+ _enumerateChildren: function(rootNode, result, maxLevel)
+ {
+ if (!rootNode.root)
+ result.push(rootNode);
+ if (!maxLevel)
+ return;
+ for (var i = 0; i < rootNode.children.length; ++i)
+ this._enumerateChildren(rootNode.children[i], result, maxLevel - 1);
+ return result;
+ },
+
+ // Updates the widths of the table, including the positions of the column
+ // resizers.
+ //
+ // IMPORTANT: This function MUST be called once after the element of the
+ // DataGrid is attached to its parent element and every subsequent time the
+ // width of the parent element is changed in order to make it possible to
+ // resize the columns.
+ //
+ // If this function is not called after the DataGrid is attached to its
+ // parent element, then the DataGrid's columns will not be resizable.
+ updateLayout: function()
+ {
+ // Do not attempt to use offsetes if we're not attached to the document tree yet.
+ if (!this._columnWidthsInitialized && this.element.offsetWidth) {
+ // Give all the columns initial widths now so that during a resize,
+ // when the two columns that get resized get a percent value for
+ // their widths, all the other columns already have percent values
+ // for their widths.
+ var headerTableColumnElements = this._headerTableColumnGroupElement.children;
+ var tableWidth = this._dataTableElement.offsetWidth;
+ var numColumns = headerTableColumnElements.length;
+ for (var i = 0; i < numColumns; i++) {
+ var headerCellElement = this._headerTableBodyElement.rows[0].cells[i]
+ if (this._isColumnVisible(headerCellElement.columnIdentifier)) {
+ var columnWidth = headerCellElement.offsetWidth;
+ var percentWidth = ((columnWidth / tableWidth) * 100) + "%";
+ this._headerTableColumnGroupElement.children[i].style.width = percentWidth;
+ this._dataTableColumnGroupElement.children[i].style.width = percentWidth;
+ } else {
+ this._headerTableColumnGroupElement.children[i].style.width = 0;
+ this._dataTableColumnGroupElement.children[i].style.width = 0;
+ }
+ }
+
+ this._columnWidthsInitialized = true;
+ }
+
+ this._positionResizerElements();
+ this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
+ },
+
+ columnWidthsMap: function()
+ {
+ var result = {};
+ for (var [identifier, column] of this.columns) {
+ var width = this._headerTableColumnGroupElement.children[column.get("ordinal")].style.width;
+ result[columnIdentifier] = parseFloat(width);
+ }
+ return result;
+ },
+
+ applyColumnWidthsMap: function(columnWidthsMap)
+ {
+ for (var [identifier, column] of this.columns) {
+ var width = (columnWidthsMap[identifier] || 0) + "%";
+ var ordinal = column.get("ordinal");
+ this._headerTableColumnGroupElement.children[ordinal].style.width = width;
+ this._dataTableColumnGroupElement.children[ordinal].style.width = width;
+ }
+
+ this.updateLayout();
+ },
+
+ _isColumnVisible: function(columnIdentifier)
+ {
+ return !this.columns.get(columnIdentifier).has("hidden");
+ },
+
+ _showColumn: function(columnIdentifier)
+ {
+ this.columns.get(columnIdentifier).delete("hidden");
+ },
+
+ _hideColumn: function(columnIdentifier)
+ {
+ var column = this.columns.get(columnIdentifier);
+ column.set("hidden", true);
+
+ var columnElement = column.get("element");
+ columnElement.style.width = 0;
+
+ this._columnWidthsInitialized = false;
+ },
+
+ get scrollContainer()
+ {
+ return this._scrollContainerElement;
+ },
+
+ isScrolledToLastRow: function()
+ {
+ return this._scrollContainerElement.isScrolledToBottom();
+ },
+
+ scrollToLastRow: function()
+ {
+ this._scrollContainerElement.scrollTop = this._scrollContainerElement.scrollHeight - this._scrollContainerElement.offsetHeight;
+ },
+
+ _positionResizerElements: function()
+ {
+ var left = 0;
+ var previousResizerElement = null;
+
+ // Make n - 1 resizers for n columns.
+ for (var i = 0; i < this.orderedColumns.length - 1; ++i) {
+ var resizerElement = this.resizerElements[i];
+
+ if (!resizerElement) {
+ // This is the first call to updateWidth, so the resizers need
+ // to be created.
+ resizerElement = document.createElement("div");
+ resizerElement.classList.add("data-grid-resizer");
+ // This resizer is associated with the column to its right.
+ resizerElement.addEventListener("mousedown", this._startResizerDragging.bind(this), false);
+ this.element.appendChild(resizerElement);
+ this.resizerElements[i] = resizerElement;
+ }
+
+ // Get the width of the cell in the first (and only) row of the
+ // header table in order to determine the width of the column, since
+ // it is not possible to query a column for its width.
+ left += this._headerTableBodyElement.rows[0].cells[i].offsetWidth;
+
+ if (this._isColumnVisible(this.orderedColumns[i])) {
+ resizerElement.style.removeProperty("display");
+ resizerElement.style.left = left + "px";
+ resizerElement.leftNeighboringColumnID = i;
+ if (previousResizerElement)
+ previousResizerElement.rightNeighboringColumnID = i;
+ previousResizerElement = resizerElement;
+ } else {
+ resizerElement.style.setProperty("display", "none");
+ resizerElement.leftNeighboringColumnID = 0;
+ resizerElement.rightNeighboringColumnID = 0;
+ }
+ }
+ if (previousResizerElement)
+ previousResizerElement.rightNeighboringColumnID = this.orderedColumns.length - 1;
+ },
+
+ addPlaceholderNode: function()
+ {
+ if (this.placeholderNode)
+ this.placeholderNode.makeNormal();
+
+ var emptyData = {};
+ for (var identifier of this.columns.keys())
+ emptyData[identifier] = '';
+ this.placeholderNode = new WebInspector.PlaceholderDataGridNode(emptyData);
+ this.appendChild(this.placeholderNode);
+ },
+
+ appendChild: function(child)
+ {
+ this.insertChild(child, this.children.length);
+ },
+
+ insertChild: function(child, index)
+ {
+ if (!child)
+ throw("insertChild: Node can't be undefined or null.");
+ if (child.parent === this)
+ throw("insertChild: Node is already a child of this node.");
+
+ if (child.parent)
+ child.parent.removeChild(child);
+
+ this.children.splice(index, 0, child);
+ this.hasChildren = true;
+
+ child.parent = this;
+ child.dataGrid = this.dataGrid;
+ child._recalculateSiblings(index);
+
+ delete child._depth;
+ delete child._revealed;
+ delete child._attached;
+ child._shouldRefreshChildren = true;
+
+ var current = child.children[0];
+ while (current) {
+ current.dataGrid = this.dataGrid;
+ delete current._depth;
+ delete current._revealed;
+ delete current._attached;
+ current._shouldRefreshChildren = true;
+ current = current.traverseNextNode(false, child, true);
+ }
+
+ if (this.expanded)
+ child._attach();
+ },
+
+ removeChild: function(child)
+ {
+ if (!child)
+ throw("removeChild: Node can't be undefined or null.");
+ if (child.parent !== this)
+ throw("removeChild: Node is not a child of this node.");
+
+ child.deselect();
+ child._detach();
+
+ this.children.remove(child, true);
+
+ if (child.previousSibling)
+ child.previousSibling.nextSibling = child.nextSibling;
+ if (child.nextSibling)
+ child.nextSibling.previousSibling = child.previousSibling;
+
+ child.dataGrid = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+
+ if (this.children.length <= 0)
+ this.hasChildren = false;
+
+ console.assert(!child.isPlaceholderNode, "Shouldn't delete the placeholder node.")
+ },
+
+ removeChildren: function()
+ {
+ for (var i = 0; i < this.children.length; ++i) {
+ var child = this.children[i];
+ child.deselect();
+ child._detach();
+
+ child.dataGrid = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+ }
+
+ this.children = [];
+ this.hasChildren = false;
+ },
+
+ removeChildrenRecursive: function()
+ {
+ var childrenToRemove = this.children;
+
+ var child = this.children[0];
+ while (child) {
+ if (child.children.length)
+ childrenToRemove = childrenToRemove.concat(child.children);
+ child = child.traverseNextNode(false, this, true);
+ }
+
+ for (var i = 0; i < childrenToRemove.length; ++i) {
+ child = childrenToRemove[i];
+ child.deselect();
+ child._detach();
+
+ child.children = [];
+ child.dataGrid = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+ }
+
+ this.children = [];
+ },
+
+ sortNodes: function(comparator)
+ {
+ function comparatorWrapper(aRow, bRow)
+ {
+ var reverseFactor = this.sortOrder !== "asceding" ? -1 : 1;
+ var aNode = aRow._dataGridNode;
+ var bNode = bRow._dataGridNode;
+ if (aNode._data.summaryRow || aNode.isPlaceholderNode)
+ return 1;
+ if (bNode._data.summaryRow || bNode.isPlaceholderNode)
+ return -1;
+
+ return reverseFactor * comparator(aNode, bNode);
+ }
+
+ if (this._editing) {
+ this._sortAfterEditingCallback = this.sortNodes.bind(this, comparator);
+ return;
+ }
+
+ var tbody = this.dataTableBodyElement;
+ var childNodes = tbody.childNodes;
+ var fillerRowElement = tbody.lastChild;
+
+ var sortedRowElements = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1);
+ sortedRowElements.sort(comparatorWrapper);
+
+ tbody.removeChildren();
+
+ var previousSiblingNode = null;
+ for (var rowElement of sortedRowElements) {
+ var node = rowElement._dataGridNode;
+ node.previousSibling = previousSiblingNode;
+ if (previousSiblingNode)
+ previousSiblingNode.nextSibling = node;
+ tbody.appendChild(rowElement);
+ previousSiblingNode = node;
+ }
+
+ if (previousSiblingNode)
+ previousSiblingNode.nextSibling = null;
+
+ tbody.appendChild(fillerRowElement); // We expect to find a filler row when attaching nodes.
+ },
+
+ _keyDown: function(event)
+ {
+ if (!this.selectedNode || event.shiftKey || event.metaKey || event.ctrlKey || this._editing)
+ return;
+
+ var handled = false;
+ var nextSelectedNode;
+ if (event.keyIdentifier === "Up" && !event.altKey) {
+ nextSelectedNode = this.selectedNode.traversePreviousNode(true);
+ while (nextSelectedNode && !nextSelectedNode.selectable)
+ nextSelectedNode = nextSelectedNode.traversePreviousNode(true);
+ handled = nextSelectedNode ? true : false;
+ } else if (event.keyIdentifier === "Down" && !event.altKey) {
+ nextSelectedNode = this.selectedNode.traverseNextNode(true);
+ while (nextSelectedNode && !nextSelectedNode.selectable)
+ nextSelectedNode = nextSelectedNode.traverseNextNode(true);
+ handled = nextSelectedNode ? true : false;
+ } else if (event.keyIdentifier === "Left") {
+ if (this.selectedNode.expanded) {
+ if (event.altKey)
+ this.selectedNode.collapseRecursively();
+ else
+ this.selectedNode.collapse();
+ handled = true;
+ } else if (this.selectedNode.parent && !this.selectedNode.parent.root) {
+ handled = true;
+ if (this.selectedNode.parent.selectable) {
+ nextSelectedNode = this.selectedNode.parent;
+ handled = nextSelectedNode ? true : false;
+ } else if (this.selectedNode.parent)
+ this.selectedNode.parent.collapse();
+ }
+ } else if (event.keyIdentifier === "Right") {
+ if (!this.selectedNode.revealed) {
+ this.selectedNode.reveal();
+ handled = true;
+ } else if (this.selectedNode.hasChildren) {
+ handled = true;
+ if (this.selectedNode.expanded) {
+ nextSelectedNode = this.selectedNode.children[0];
+ handled = nextSelectedNode ? true : false;
+ } else {
+ if (event.altKey)
+ this.selectedNode.expandRecursively();
+ else
+ this.selectedNode.expand();
+ }
+ }
+ } else if (event.keyCode === 8 || event.keyCode === 46) {
+ if (this._deleteCallback) {
+ handled = true;
+ this._deleteCallback(this.selectedNode);
+ }
+ } else if (isEnterKey(event)) {
+ if (this._editCallback) {
+ handled = true;
+ this._startEditing(this.selectedNode._element.children[0]);
+ }
+ }
+
+ if (nextSelectedNode) {
+ nextSelectedNode.reveal();
+ nextSelectedNode.select();
+ }
+
+ if (handled) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ },
+
+ expand: function()
+ {
+ // This is the root, do nothing.
+ },
+
+ collapse: function()
+ {
+ // This is the root, do nothing.
+ },
+
+ reveal: function()
+ {
+ // This is the root, do nothing.
+ },
+
+ revealAndSelect: function()
+ {
+ // This is the root, do nothing.
+ },
+
+ dataGridNodeFromNode: function(target)
+ {
+ var rowElement = target.enclosingNodeOrSelfWithNodeName("tr");
+ return rowElement && rowElement._dataGridNode;
+ },
+
+ dataGridNodeFromPoint: function(x, y)
+ {
+ var node = this._dataTableElement.ownerDocument.elementFromPoint(x, y);
+ var rowElement = node.enclosingNodeOrSelfWithNodeName("tr");
+ return rowElement && rowElement._dataGridNode;
+ },
+
+ _clickInHeaderCell: function(event)
+ {
+ var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
+ if (!cell || !cell.columnIdentifier || !cell.classList.contains("sortable"))
+ return;
+
+ var sortOrder = this.sortOrder;
+
+ if (this._sortColumnCell)
+ this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
+
+ if (cell == this._sortColumnCell) {
+ if (sortOrder === "ascending")
+ sortOrder = "descending";
+ else
+ sortOrder = "ascending";
+ }
+
+ this._sortColumnCell = cell;
+
+ cell.classList.add("sort-" + sortOrder);
+
+ this.dispatchEventToListeners(WebInspector.DataGrid.Event.SortChanged);
+ },
+
+ _mouseoverColumnCollapser: function(event)
+ {
+ var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
+ if (!cell || !cell.collapsesGroup)
+ return;
+
+ cell.classList.add("mouse-over-collapser");
+ },
+
+ _mouseoutColumnCollapser: function(event)
+ {
+ var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
+ if (!cell || !cell.collapsesGroup)
+ return;
+
+ cell.classList.remove("mouse-over-collapser");
+ },
+
+ _clickInColumnCollapser: function(event)
+ {
+ var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
+ if (!cell || !cell.collapsesGroup)
+ return;
+
+ this._collapseColumnGroupWithCell(cell);
+
+ event.stopPropagation();
+ event.preventDefault();
+ },
+
+ collapseColumnGroup: function(columnGroup)
+ {
+ var collapserColumnIdentifier = null;
+ for (var [identifier, column] of this.columns) {
+ if (column.get("collapsesGroup") == columnGroup) {
+ collapserColumnIdentifier = identifier;
+ break;
+ }
+ }
+
+ console.assert(collapserColumnIdentifier);
+ if (!collapserColumnIdentifier)
+ return;
+
+ var cell = this._headerTableCellElements.get(collapserColumnIdentifier);
+ this._collapseColumnGroupWithCell(cell);
+ },
+
+ _collapseColumnGroupWithCell: function(cell)
+ {
+ var columnsWillCollapse = cell.classList.toggle("collapsed");
+
+ this.willToggleColumnGroup(cell.collapsesGroup, columnsWillCollapse);
+
+ var showOrHide = columnsWillCollapse ? this._hideColumn : this._showColumn;
+ for (var [identifier, column] of this.columns) {
+ if (column.get("group") === cell.collapsesGroup)
+ showOrHide.call(this, identifier);
+ }
+
+ var collapserButton = cell.querySelector(".collapser-button");
+ if (collapserButton)
+ collapserButton.title = columnsWillCollapse ? this._collapserButtonExpandColumnsToolTip() : this._collapserButtonCollapseColumnsToolTip();
+
+ this.didToggleColumnGroup(cell.collapsesGroup, columnsWillCollapse);
+ },
+
+ _collapserButtonCollapseColumnsToolTip: function()
+ {
+ return WebInspector.UIString("Collapse columns");
+ },
+
+ _collapserButtonExpandColumnsToolTip: function()
+ {
+ return WebInspector.UIString("Expand columns");
+ },
+
+ willToggleColumnGroup: function(columnGroup, willCollapse)
+ {
+ // Implemented by subclasses if needed.
+ },
+
+ didToggleColumnGroup: function(columnGroup, didCollapse)
+ {
+ // Implemented by subclasses if needed.
+ },
+
+ isColumnSortColumn: function(columnIdentifier)
+ {
+ return this._sortColumnCell === this._headerTableCellElements.get(columnIdentifier);
+ },
+
+ markColumnAsSortedBy: function(columnIdentifier, sortOrder)
+ {
+ if (this._sortColumnCell)
+ this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
+ this._sortColumnCell = this._headerTableCellElements.get(columnIdentifier);
+ this._sortColumnCell.classList.add("sort-" + sortOrder);
+ },
+
+ headerTableHeader: function(columnIdentifier)
+ {
+ return this._headerTableCellElements.get(columnIdentifier);
+ },
+
+ _generateSortIndicatorImagesIfNeeded: function()
+ {
+ if (WebInspector.DataGrid._generatedSortIndicatorImages)
+ return;
+
+ WebInspector.DataGrid._generatedSortIndicatorImages = true;
+
+ var specifications = {};
+ specifications["arrow"] = {
+ fillColor: [81, 81, 81],
+ shadowColor: [255, 255, 255, 0.5],
+ shadowOffsetX: 0,
+ shadowOffsetY: 1,
+ shadowBlur: 0
+ };
+
+ generateColoredImagesForCSS("Images/SortIndicatorDownArrow.svg", specifications, 9, 8, "data-grid-sort-indicator-down-");
+ generateColoredImagesForCSS("Images/SortIndicatorUpArrow.svg", specifications, 9, 8, "data-grid-sort-indicator-up-");
+ },
+
+ _mouseDownInDataTable: function(event)
+ {
+ var gridNode = this.dataGridNodeFromNode(event.target);
+ if (!gridNode || !gridNode.selectable)
+ return;
+
+ if (gridNode.isEventWithinDisclosureTriangle(event))
+ return;
+
+ if (event.metaKey) {
+ if (gridNode.selected)
+ gridNode.deselect();
+ else
+ gridNode.select();
+ } else
+ gridNode.select();
+ },
+
+ _contextMenuInDataTable: function(event)
+ {
+ var contextMenu = new WebInspector.ContextMenu(event);
+
+ var gridNode = this.dataGridNodeFromNode(event.target);
+ if (this.dataGrid._refreshCallback && (!gridNode || gridNode !== this.placeholderNode))
+ contextMenu.appendItem(WebInspector.UIString("Refresh"), this._refreshCallback.bind(this));
+
+ if (gridNode && gridNode.selectable && !gridNode.isEventWithinDisclosureTriangle(event)) {
+ contextMenu.appendItem(WebInspector.UIString("Copy Row"), this._copyRow.bind(this, event.target));
+
+ if (this.dataGrid._editCallback) {
+ if (gridNode === this.placeholderNode)
+ contextMenu.appendItem(WebInspector.UIString("Add New"), this._startEditing.bind(this, event.target));
+ else {
+ var element = event.target.enclosingNodeOrSelfWithNodeName("td");
+ var columnIdentifier = element.__columnIdentifier;
+ var columnTitle = this.dataGrid.columns.get(columnIdentifier).get('title');
+ contextMenu.appendItem(WebInspector.UIString("Edit “%s”").format(columnTitle), this._startEditing.bind(this, event.target));
+ }
+ }
+ if (this.dataGrid._deleteCallback && gridNode !== this.placeholderNode)
+ contextMenu.appendItem(WebInspector.UIString("Delete"), this._deleteCallback.bind(this, gridNode));
+ }
+
+ contextMenu.show();
+ },
+
+ _clickInDataTable: function(event)
+ {
+ var gridNode = this.dataGridNodeFromNode(event.target);
+ if (!gridNode || !gridNode.hasChildren)
+ return;
+
+ if (!gridNode.isEventWithinDisclosureTriangle(event))
+ return;
+
+ if (gridNode.expanded) {
+ if (event.altKey)
+ gridNode.collapseRecursively();
+ else
+ gridNode.collapse();
+ } else {
+ if (event.altKey)
+ gridNode.expandRecursively();
+ else
+ gridNode.expand();
+ }
+ },
+
+ _copyTextForDataGridNode: function(node)
+ {
+ var fields = [];
+ for (var identifier of node.dataGrid.orderedColumns)
+ fields.push(node.data[identifier] || "");
+
+ var tabSeparatedValues = fields.join("\t");
+ return tabSeparatedValues;
+ },
+
+ handleBeforeCopyEvent: function(event)
+ {
+ if (this.selectedNode && window.getSelection().isCollapsed)
+ event.preventDefault();
+ },
+
+ handleCopyEvent: function(event)
+ {
+ if (!this.selectedNode || !window.getSelection().isCollapsed)
+ return;
+
+ var copyText = this._copyTextForDataGridNode(this.selectedNode);
+ event.clipboardData.setData("text/plain", copyText);
+ event.stopPropagation();
+ event.preventDefault();
+ },
+
+ _copyRow: function(target)
+ {
+ var gridNode = this.dataGridNodeFromNode(target);
+ if (!gridNode)
+ return;
+
+ var copyText = this._copyTextForDataGridNode(gridNode);
+ InspectorFrontendHost.copyText(copyText);
+ },
+
+ get resizeMethod()
+ {
+ if (typeof this._resizeMethod === "undefined")
+ return WebInspector.DataGrid.ResizeMethod.Nearest;
+ return this._resizeMethod;
+ },
+
+ set resizeMethod(method)
+ {
+ this._resizeMethod = method;
+ },
+
+ _startResizerDragging: function(event)
+ {
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ this._currentResizer = event.target;
+ if (!this._currentResizer.rightNeighboringColumnID)
+ return;
+
+ WebInspector.elementDragStart(this._currentResizer, this._resizerDragging.bind(this),
+ this._endResizerDragging.bind(this), event, "col-resize");
+ },
+
+ _resizerDragging: function(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ var resizer = this._currentResizer;
+ if (!resizer)
+ return;
+
+ // Constrain the dragpoint to be within the containing div of the
+ // datagrid.
+ var dragPoint = event.clientX - this.element.totalOffsetLeft;
+ // Constrain the dragpoint to be within the space made up by the
+ // column directly to the left and the column directly to the right.
+ var leftCellIndex = resizer.leftNeighboringColumnID;
+ var rightCellIndex = resizer.rightNeighboringColumnID;
+ var firstRowCells = this._headerTableBodyElement.rows[0].cells;
+ var leftEdgeOfPreviousColumn = 0;
+ for (var i = 0; i < leftCellIndex; i++)
+ leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;
+
+ // Differences for other resize methods
+ if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.Last) {
+ rightCellIndex = this.resizerElements.length;
+ } else if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.First) {
+ leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth;
+ leftCellIndex = 0;
+ }
+
+ var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth;
+
+ // Give each column some padding so that they don't disappear.
+ var leftMinimum = leftEdgeOfPreviousColumn + this.ColumnResizePadding;
+ var rightMaximum = rightEdgeOfNextColumn - this.ColumnResizePadding;
+
+ dragPoint = Number.constrain(dragPoint, leftMinimum, rightMaximum);
+
+ resizer.style.left = (dragPoint - this.CenterResizerOverBorderAdjustment) + "px";
+
+ var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTableElement.offsetWidth) * 100) + "%";
+ this._headerTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
+ this._dataTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
+
+ var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTableElement.offsetWidth) * 100) + "%";
+ this._headerTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
+ this._dataTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
+
+ this._positionResizerElements();
+ event.preventDefault();
+ this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
+ },
+
+ _endResizerDragging: function(event)
+ {
+ if (event.button !== 0)
+ return;
+
+ WebInspector.elementDragEnd(event);
+ this._currentResizer = null;
+ this.dispatchEventToListeners(WebInspector.DataGrid.Event.DidLayout);
+ },
+
+ ColumnResizePadding: 10,
+
+ CenterResizerOverBorderAdjustment: 3,
+}
+
+WebInspector.DataGrid.ResizeMethod = {
+ Nearest: "nearest",
+ First: "first",
+ Last: "last"
+};
+
+WebInspector.DataGrid.prototype.__proto__ = WebInspector.Object.prototype;
+
+/**
+ * @constructor
+ * @extends {WebInspector.Object}
+ * @param {boolean=} hasChildren
+ */
+WebInspector.DataGridNode = function(data, hasChildren)
+{
+ this._expanded = false;
+ this._selected = false;
+ this._shouldRefreshChildren = true;
+ this._data = data || {};
+ this.hasChildren = hasChildren || false;
+ this.children = [];
+ this.dataGrid = null;
+ this.parent = null;
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this.disclosureToggleWidth = 10;
+}
+
+WebInspector.DataGridNode.prototype = {
+ get selectable()
+ {
+ return !this._element || !this._element.classList.contains("hidden");
+ },
+
+ get element()
+ {
+ if (this._element)
+ return this._element;
+
+ if (!this.dataGrid)
+ return null;
+
+ this._element = document.createElement("tr");
+ this._element._dataGridNode = this;
+
+ if (this.hasChildren)
+ this._element.classList.add("parent");
+ if (this.expanded)
+ this._element.classList.add("expanded");
+ if (this.selected)
+ this._element.classList.add("selected");
+ if (this.revealed)
+ this._element.classList.add("revealed");
+
+ this.createCells();
+ return this._element;
+ },
+
+ createCells: function()
+ {
+ for (var columnIdentifier of this.dataGrid.orderedColumns)
+ this._element.appendChild(this.createCell(columnIdentifier));
+ },
+
+ refreshIfNeeded: function()
+ {
+ if (!this._needsRefresh)
+ return;
+
+ delete this._needsRefresh;
+
+ this.refresh();
+ },
+
+ needsRefresh: function()
+ {
+ this._needsRefresh = true;
+
+ if (!this._revealed)
+ return;
+
+ if (this._scheduledRefreshIdentifier)
+ return;
+
+ this._scheduledRefreshIdentifier = requestAnimationFrame(this.refresh.bind(this));
+ },
+
+ get data()
+ {
+ return this._data;
+ },
+
+ set data(x)
+ {
+ this._data = x || {};
+ this.needsRefresh();
+ },
+
+ get revealed()
+ {
+ if ("_revealed" in this)
+ return this._revealed;
+
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded) {
+ this._revealed = false;
+ return false;
+ }
+
+ currentAncestor = currentAncestor.parent;
+ }
+
+ this._revealed = true;
+ return true;
+ },
+
+ set hasChildren(x)
+ {
+ if (this._hasChildren === x)
+ return;
+
+ this._hasChildren = x;
+
+ if (!this._element)
+ return;
+
+ if (this._hasChildren)
+ {
+ this._element.classList.add("parent");
+ if (this.expanded)
+ this._element.classList.add("expanded");
+ }
+ else
+ {
+ this._element.classList.remove("parent");
+ this._element.classList.remove("expanded");
+ }
+ },
+
+ get hasChildren()
+ {
+ return this._hasChildren;
+ },
+
+ set revealed(x)
+ {
+ if (this._revealed === x)
+ return;
+
+ this._revealed = x;
+
+ if (this._element) {
+ if (this._revealed)
+ this._element.classList.add("revealed");
+ else
+ this._element.classList.remove("revealed");
+ }
+
+ this.refreshIfNeeded();
+
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i].revealed = x && this.expanded;
+ },
+
+ get depth()
+ {
+ if ("_depth" in this)
+ return this._depth;
+ if (this.parent && !this.parent.root)
+ this._depth = this.parent.depth + 1;
+ else
+ this._depth = 0;
+ return this._depth;
+ },
+
+ get leftPadding()
+ {
+ if (typeof(this._leftPadding) === "number")
+ return this._leftPadding;
+
+ this._leftPadding = this.depth * this.dataGrid.indentWidth;
+ return this._leftPadding;
+ },
+
+ get shouldRefreshChildren()
+ {
+ return this._shouldRefreshChildren;
+ },
+
+ set shouldRefreshChildren(x)
+ {
+ this._shouldRefreshChildren = x;
+ if (x && this.expanded)
+ this.expand();
+ },
+
+ get selected()
+ {
+ return this._selected;
+ },
+
+ set selected(x)
+ {
+ if (x)
+ this.select();
+ else
+ this.deselect();
+ },
+
+ get expanded()
+ {
+ return this._expanded;
+ },
+
+ set expanded(x)
+ {
+ if (x)
+ this.expand();
+ else
+ this.collapse();
+ },
+
+ refresh: function()
+ {
+ if (!this._element || !this.dataGrid)
+ return;
+
+ if (this._scheduledRefreshIdentifier) {
+ cancelAnimationFrame(this._scheduledRefreshIdentifier);
+ delete this._scheduledRefreshIdentifier;
+ }
+
+ delete this._needsRefresh;
+
+ this._element.removeChildren();
+ this.createCells();
+ },
+
+ updateLayout: function()
+ {
+ // Implemented by subclasses if needed.
+ },
+
+ createCell: function(columnIdentifier)
+ {
+ var cellElement = document.createElement("td");
+ cellElement.className = columnIdentifier + "-column";
+ cellElement.__columnIdentifier = columnIdentifier;
+
+ var column = this.dataGrid.columns.get(columnIdentifier);
+
+ if (column.has("aligned"))
+ cellElement.classList.add(column.get("aligned"));
+
+ if (column.has("group"))
+ cellElement.classList.add("column-group-" + column.get("group"));
+
+ var div = cellElement.createChild("div");
+ var content = this.createCellContent(columnIdentifier, cellElement);
+ div.appendChild(content instanceof Node ? content : document.createTextNode(content));
+
+ if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {
+ cellElement.classList.add("disclosure");
+ if (this.leftPadding)
+ cellElement.style.setProperty("padding-left", this.leftPadding + "px");
+ }
+
+ return cellElement;
+ },
+
+ createCellContent: function(columnIdentifier)
+ {
+ return this.data[columnIdentifier] || "\u200b"; // Zero width space to keep the cell from collapsing.
+ },
+
+ elementWithColumnIdentifier: function(columnIdentifier)
+ {
+ var index = this.dataGrid.orderedColumns.indexOf(columnIdentifier);
+ if (index === -1)
+ return null;
+
+ return this._element.children[index];
+ },
+
+ // Share these functions with DataGrid. They are written to work with a DataGridNode this object.
+ appendChild: WebInspector.DataGrid.prototype.appendChild,
+ insertChild: WebInspector.DataGrid.prototype.insertChild,
+ removeChild: WebInspector.DataGrid.prototype.removeChild,
+ removeChildren: WebInspector.DataGrid.prototype.removeChildren,
+ removeChildrenRecursive: WebInspector.DataGrid.prototype.removeChildrenRecursive,
+
+ _recalculateSiblings: function(myIndex)
+ {
+ if (!this.parent)
+ return;
+
+ var previousChild = (myIndex > 0 ? this.parent.children[myIndex - 1] : null);
+
+ if (previousChild) {
+ previousChild.nextSibling = this;
+ this.previousSibling = previousChild;
+ } else
+ this.previousSibling = null;
+
+ var nextChild = this.parent.children[myIndex + 1];
+
+ if (nextChild) {
+ nextChild.previousSibling = this;
+ this.nextSibling = nextChild;
+ } else
+ this.nextSibling = null;
+ },
+
+ collapse: function()
+ {
+ if (this._element)
+ this._element.classList.remove("expanded");
+
+ this._expanded = false;
+
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i].revealed = false;
+
+ this.dispatchEventToListeners("collapsed");
+
+ if (this.dataGrid)
+ this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.CollapsedNode, {dataGridNode: this});
+ },
+
+ collapseRecursively: function()
+ {
+ var item = this;
+ while (item) {
+ if (item.expanded)
+ item.collapse();
+ item = item.traverseNextNode(false, this, true);
+ }
+ },
+
+ expand: function()
+ {
+ if (!this.hasChildren || this.expanded)
+ return;
+
+ if (this.revealed && !this._shouldRefreshChildren)
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i].revealed = true;
+
+ if (this._shouldRefreshChildren) {
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i]._detach();
+
+ this.dispatchEventToListeners("populate");
+
+ if (this._attached) {
+ for (var i = 0; i < this.children.length; ++i) {
+ var child = this.children[i];
+ if (this.revealed)
+ child.revealed = true;
+ child._attach();
+ }
+ }
+
+ delete this._shouldRefreshChildren;
+ }
+
+ if (this._element)
+ this._element.classList.add("expanded");
+
+ this._expanded = true;
+
+ this.dispatchEventToListeners("expanded");
+
+ if (this.dataGrid)
+ this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.ExpandedNode, {dataGridNode: this});
+ },
+
+ expandRecursively: function()
+ {
+ var item = this;
+ while (item) {
+ item.expand();
+ item = item.traverseNextNode(false, this);
+ }
+ },
+
+ reveal: function()
+ {
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded)
+ currentAncestor.expand();
+ currentAncestor = currentAncestor.parent;
+ }
+
+ this.element.scrollIntoViewIfNeeded(false);
+
+ this.dispatchEventToListeners("revealed");
+ },
+
+ /**
+ * @param {boolean=} supressSelectedEvent
+ */
+ select: function(supressSelectedEvent)
+ {
+ if (!this.dataGrid || !this.selectable || this.selected)
+ return;
+
+ if (this.dataGrid.selectedNode)
+ this.dataGrid.selectedNode.deselect();
+
+ this._selected = true;
+ this.dataGrid.selectedNode = this;
+
+ if (this._element)
+ this._element.classList.add("selected");
+
+ if (!supressSelectedEvent)
+ this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.SelectedNodeChanged);
+ },
+
+ revealAndSelect: function()
+ {
+ this.reveal();
+ this.select();
+ },
+
+ /**
+ * @param {boolean=} supressDeselectedEvent
+ */
+ deselect: function(supressDeselectedEvent)
+ {
+ if (!this.dataGrid || this.dataGrid.selectedNode !== this || !this.selected)
+ return;
+
+ this._selected = false;
+ this.dataGrid.selectedNode = null;
+
+ if (this._element)
+ this._element.classList.remove("selected");
+
+ if (!supressDeselectedEvent)
+ this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.SelectedNodeChanged);
+ },
+
+ traverseNextNode: function(skipHidden, stayWithin, dontPopulate, info)
+ {
+ if (!dontPopulate && this.hasChildren)
+ this.dispatchEventToListeners("populate");
+
+ if (info)
+ info.depthChange = 0;
+
+ var node = (!skipHidden || this.revealed) ? this.children[0] : null;
+ if (node && (!skipHidden || this.expanded)) {
+ if (info)
+ info.depthChange = 1;
+ return node;
+ }
+
+ if (this === stayWithin)
+ return null;
+
+ node = (!skipHidden || this.revealed) ? this.nextSibling : null;
+ if (node)
+ return node;
+
+ node = this;
+ while (node && !node.root && !((!skipHidden || node.revealed) ? node.nextSibling : null) && node.parent !== stayWithin) {
+ if (info)
+ info.depthChange -= 1;
+ node = node.parent;
+ }
+
+ if (!node)
+ return null;
+
+ return (!skipHidden || node.revealed) ? node.nextSibling : null;
+ },
+
+ traversePreviousNode: function(skipHidden, dontPopulate)
+ {
+ var node = (!skipHidden || this.revealed) ? this.previousSibling : null;
+ if (!dontPopulate && node && node.hasChildren)
+ node.dispatchEventToListeners("populate");
+
+ while (node && ((!skipHidden || (node.revealed && node.expanded)) ? node.children.lastValue : null)) {
+ if (!dontPopulate && node.hasChildren)
+ node.dispatchEventToListeners("populate");
+ node = ((!skipHidden || (node.revealed && node.expanded)) ? node.children.lastValue : null);
+ }
+
+ if (node)
+ return node;
+
+ if (!this.parent || this.parent.root)
+ return null;
+
+ return this.parent;
+ },
+
+ isEventWithinDisclosureTriangle: function(event)
+ {
+ if (!this.hasChildren)
+ return false;
+ var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
+ if (!cell.classList.contains("disclosure"))
+ return false;
+
+ var left = cell.totalOffsetLeft + this.leftPadding;
+ return event.pageX >= left && event.pageX <= left + this.disclosureToggleWidth;
+ },
+
+ _attach: function()
+ {
+ if (!this.dataGrid || this._attached)
+ return;
+
+ this._attached = true;
+
+ var nextElement = null;
+
+ var previousGridNode = this.traversePreviousNode(true, true);
+ if (previousGridNode && previousGridNode.element.parentNode)
+ nextElement = previousGridNode.element.nextSibling;
+ else if (!previousGridNode)
+ nextElement = this.dataGrid.dataTableBodyElement.firstChild;
+
+ // If there is no next grid node, then append before the last child since the last child is the filler row.
+ console.assert(this.dataGrid.dataTableBodyElement.lastChild.classList.contains("filler"));
+
+ if (!nextElement)
+ nextElement = this.dataGrid.dataTableBodyElement.lastChild;
+
+ this.dataGrid.dataTableBodyElement.insertBefore(this.element, nextElement);
+
+ if (this.expanded)
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i]._attach();
+ },
+
+ _detach: function()
+ {
+ if (!this._attached)
+ return;
+
+ this._attached = false;
+
+ if (this._element && this._element.parentNode)
+ this._element.parentNode.removeChild(this._element);
+
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i]._detach();
+ },
+
+ savePosition: function()
+ {
+ if (this._savedPosition)
+ return;
+
+ if (!this.parent)
+ throw("savePosition: Node must have a parent.");
+ this._savedPosition = {
+ parent: this.parent,
+ index: this.parent.children.indexOf(this)
+ };
+ },
+
+ restorePosition: function()
+ {
+ if (!this._savedPosition)
+ return;
+
+ if (this.parent !== this._savedPosition.parent)
+ this._savedPosition.parent.insertChild(this, this._savedPosition.index);
+
+ delete this._savedPosition;
+ }
+}
+
+WebInspector.DataGridNode.prototype.__proto__ = WebInspector.Object.prototype;
+
+// Used to create a new table row when entering new data by editing cells.
+WebInspector.PlaceholderDataGridNode = function(data)
+{
+ WebInspector.DataGridNode.call(this, data, false);
+ this.isPlaceholderNode = true;
+}
+
+WebInspector.PlaceholderDataGridNode.prototype = {
+ constructor: WebInspector.PlaceholderDataGridNode,
+ __proto__: WebInspector.DataGridNode.prototype,
+
+ makeNormal: function()
+ {
+ delete this.isPlaceholderNode;
+ delete this.makeNormal;
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.storage-view {
+ /* Added so fonts look good */
+ font-family: Menlo, monospace;
+ font-size: 11px;
+}
+
+.storage-view .data-grid {
+ border: none;
+ height: 100%;
+}
+
+.storage-view .storage-table-error {
+ color: rgb(66%, 33%, 33%);
+}
+
+.storage-view.query {
+ padding: 2px 0;
+ overflow-y: overlay;
+ overflow-x: hidden;
+ -webkit-text-size-adjust: auto;
+}
+
+.database-query-prompt {
+ position: relative;
+ padding: 4px 22px 4px 11px;
+ min-height: 16px;
+ white-space: pre-wrap;
+ -webkit-user-modify: read-write-plaintext-only;
+ -webkit-user-select: text;
+
+ /* Added to remove outline */
+ outline: none;
+}
+
+.database-user-query::before, .database-query-prompt::before, .database-query-result::before {
+ position: absolute;
+ display: block;
+ z-index: 1;
+ content: "";
+ left: 4px;
+ top: 10px;
+ width: 10px;
+ height: 10px;
+ margin-top: -5px;
+ -webkit-user-select: none;
+}
+
+.database-query-prompt::before {
+ background-image: url(../Images/UserInputPrompt.svg);
+}
+
+.database-user-query {
+ position: relative;
+ border-bottom: 1px solid rgb(245, 245, 245);
+ padding: 4px 22px 4px 18px;
+ min-height: 16px;
+}
+
+.database-user-query::before {
+ background-image: url(../Images/UserInputPromptPrevious.svg);
+}
+
+.database-query-text {
+ color: rgb(0, 128, 255);
+ -webkit-user-select: text;
+}
+
+.database-query-result {
+ position: relative;
+ padding: 4px 0 1px 18px;
+ min-height: 16px;
+ margin-left: -18px;
+}
+
+.database-query-result.error {
+ color: red;
+ -webkit-user-select: text;
+}
+
+.database-query-result.error::before {
+ background-image: url(../Images/Error.svg);
+ background-size: 10px 10px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.database = representedObject;
+
+ this.element.classList.add("storage-view");
+ this.element.classList.add("query");
+ this.element.classList.add("monospace");
+
+ this._promptElement = document.createElement("div");
+ this._promptElement.className = "database-query-prompt";
+ this.element.appendChild(this._promptElement);
+
+ this.prompt = new WebInspector.ConsolePrompt(this, "text/x-sql");
+ this._promptElement.appendChild(this.prompt.element);
+
+ this.element.addEventListener("click", this._messagesClicked.bind(this), true);
+}
+
+WebInspector.DatabaseContentView.Event = {
+ SchemaUpdated: "SchemaUpdated"
+};
+
+WebInspector.DatabaseContentView.prototype = {
+ constructor: WebInspector.DatabaseContentView,
+
+ // Public
+
+ shown: function()
+ {
+ this.prompt.shown();
+ },
+
+ updateLayout: function()
+ {
+ this.prompt.updateLayout();
+
+ var results = this.element.querySelectorAll(".database-query-result");
+ for (var i = 0; i < results.length; ++i) {
+ var resultElement = results[i];
+ if (resultElement.dataGrid)
+ resultElement.dataGrid.updateLayout();
+ }
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.Database;
+ cookie.host = this.representedObject.host;
+ cookie.name = this.representedObject.name;
+ },
+
+ consolePromptCompletionsNeeded: function(prompt, defaultCompletions, base, prefix, suffix)
+ {
+ var results = [];
+
+ prefix = prefix.toLowerCase();
+
+ function accumulateMatches(textArray)
+ {
+ for (var i = 0; i < textArray.length; ++i) {
+ var lowerCaseText = textArray[i].toLowerCase();
+ if (lowerCaseText.startsWith(prefix))
+ results.push(textArray[i]);
+ }
+ }
+
+ function tableNamesCallback(tableNames)
+ {
+ accumulateMatches(tableNames);
+ accumulateMatches(["SELECT", "FROM", "WHERE", "LIMIT", "DELETE FROM", "CREATE", "DROP", "TABLE", "INDEX", "UPDATE", "INSERT INTO", "VALUES"]);
+
+ this.prompt.updateCompletions(results, " ");
+ }
+
+ this.database.getTableNames(tableNamesCallback.bind(this));
+ },
+
+ consolePromptTextCommitted: function(prompt, query)
+ {
+ this.database.executeSQL(query, this._queryFinished.bind(this, query), this._queryError.bind(this, query));
+ },
+
+ // Private
+
+ _messagesClicked: function()
+ {
+ this.prompt.focus();
+ },
+
+ _queryFinished: function(query, columnNames, values)
+ {
+ var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
+ var trimmedQuery = query.trim();
+
+ if (dataGrid) {
+ dataGrid.element.classList.add("inline");
+ this._appendViewQueryResult(trimmedQuery, dataGrid);
+ dataGrid.autoSizeColumns(5);
+ }
+
+ if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i))
+ this.dispatchEventToListeners(WebInspector.DatabaseContentView.Event.SchemaUpdated, this.database);
+ },
+
+ _queryError: function(query, error)
+ {
+ if (error.message)
+ var message = error.message;
+ else if (error.code == 2)
+ var message = WebInspector.UIString("Database no longer has expected version.");
+ else
+ var message = WebInspector.UIString("An unexpected error %s occurred.").format(error.code);
+
+ this._appendErrorQueryResult(query, message);
+ },
+
+ /**
+ * @param {string} query
+ * @param {WebInspector.View} view
+ */
+ _appendViewQueryResult: function(query, view)
+ {
+ var resultElement = this._appendQueryResult(query);
+
+ // Add our DataGrid with the results to the database query result div.
+ resultElement.dataGrid = view;
+ resultElement.appendChild(view.element);
+
+ this._promptElement.scrollIntoView(false);
+ },
+
+ /**
+ * @param {string} query
+ * @param {string} errorText
+ */
+ _appendErrorQueryResult: function(query, errorText)
+ {
+ var resultElement = this._appendQueryResult(query);
+ resultElement.classList.add("error");
+ resultElement.textContent = errorText;
+
+ this._promptElement.scrollIntoView(false);
+ },
+
+ _appendQueryResult: function(query)
+ {
+ var element = document.createElement("div");
+ element.className = "database-user-query";
+ this.element.insertBefore(element, this._promptElement);
+
+ var commandTextElement = document.createElement("span");
+ commandTextElement.className = "database-query-text";
+ commandTextElement.textContent = query;
+ element.appendChild(commandTextElement);
+
+ var resultElement = document.createElement("div");
+ resultElement.className = "database-query-result";
+ element.appendChild(resultElement);
+ return resultElement;
+ }
+}
+
+WebInspector.DatabaseContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseHostTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseHostTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseHostTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseHostTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseHostTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseHostTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseHostTreeElement = function(host)
+{
+ WebInspector.StorageTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, WebInspector.displayNameForHost(host), null);
+
+ this._host = host;
+
+ this.hasChildren = true;
+};
+
+WebInspector.DatabaseHostTreeElement.prototype = {
+ constructor: WebInspector.DatabaseHostTreeElement,
+
+ // Public
+
+ get name()
+ {
+ return WebInspector.displayNameForHost(this._host);
+ },
+
+ get categoryName()
+ {
+ return WebInspector.UIString("Databases");
+ }
+};
+
+WebInspector.DatabaseHostTreeElement.prototype.__proto__ = WebInspector.StorageTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.database-icon .icon {
+ content: -webkit-image-set(url(../Images/Database.png) 1x, url(../Images/Database@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.database-table > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTableContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTableContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this.element.classList.add(WebInspector.DatabaseTableContentView.StyleClassName);
+
+ this.update();
+};
+
+WebInspector.DatabaseTableContentView.StyleClassName = "database-table";
+
+WebInspector.DatabaseTableContentView.prototype = {
+ constructor: WebInspector.DatabaseTableContentView,
+
+ // Public
+
+ update: function()
+ {
+ this.representedObject.database.executeSQL("SELECT * FROM \"" + this._escapeTableName(this.representedObject.name) + "\"", this._queryFinished.bind(this), this._queryError.bind(this));
+ },
+
+ updateLayout: function()
+ {
+ if (this._dataGrid)
+ this._dataGrid.updateLayout();
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.DatabaseTable;
+ cookie.host = this.representedObject.host;
+ cookie.name = this.representedObject.name;
+ cookie.database = this.representedObject.database.name;
+ },
+
+ get scrollableElements()
+ {
+ if (!this._dataGrid)
+ return [];
+ return [this._dataGrid.scrollContainer];
+ },
+
+ // Private
+
+ _escapeTableName: function(name)
+ {
+ return name.replace(/\"/g, "\"\"");
+ },
+
+ _queryFinished: function(columnNames, values)
+ {
+ // It would be nice to do better than creating a new data grid each time the table is updated, but the table updating
+ // doesn't happen very frequently. Additionally, using DataGrid's createSortableDataGrid makes our code much cleaner and it knows
+ // how to sort arbitrary columns.
+ this.element.removeChildren();
+
+ this._dataGrid = new WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
+ if (!this._dataGrid || !this._dataGrid.element) {
+ // If the DataGrid is empty, then we were returned a table with no columns. This can happen when a table has
+ // no data, the SELECT query only returns column names when there is data.
+ this.element.removeChildren();
+ this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("The “%s”\ntable is empty.").format(this.representedObject.name), false));
+ return;
+ }
+
+ this.element.appendChild(this._dataGrid.element);
+ this._dataGrid.updateLayout();
+ },
+
+ _queryError: function(error)
+ {
+ this.element.removeChildren();
+ this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("An error occured trying to\nread the “%s” table.").format(this.representedObject.name), true));
+ }
+};
+
+WebInspector.DatabaseTableContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTableIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTableIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.database-table-icon .icon {
+ content: -webkit-image-set(url(../Images/DatabaseTable.png) 1x, url(../Images/DatabaseTable@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTableTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTableTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTableTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTableTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTableTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.DatabaseTableObject);
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.DatabaseTableTreeElement.DatabaseTableIconStyleClassName, representedObject.name, null, representedObject, false);
+
+ this.small = true;
+};
+
+WebInspector.DatabaseTableTreeElement.DatabaseTableIconStyleClassName = "database-table-icon";
+
+WebInspector.DatabaseTableTreeElement.prototype = {
+ constructor: WebInspector.DatabaseTableTreeElement
+};
+
+WebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDatabaseTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDatabaseTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DatabaseTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DatabaseTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DatabaseTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.DatabaseObject);
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.DatabaseTreeElement.DatabaseIconStyleClassName, representedObject.name, null, representedObject, true);
+
+ this.small = true;
+ this.hasChildren = false;
+
+ // Since we are initially telling the tree element we don't have any children, make sure that we try to populate
+ // the tree element (which will get a list of tables) when the element is created.
+ this.onpopulate();
+};
+
+WebInspector.DatabaseTreeElement.DatabaseIconStyleClassName = "database-icon";
+
+WebInspector.DatabaseTreeElement.prototype = {
+ constructor: WebInspector.DatabaseTreeElement,
+
+ // Overrides from TreeElement (Private)
+
+ oncollapse: function()
+ {
+ this.shouldRefreshChildren = true;
+ },
+
+ onpopulate: function()
+ {
+ if (this.children.length && !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+
+ function tableNamesCallback(tableNames)
+ {
+ for (var i = 0; i < tableNames.length; ++i) {
+ var databaseTable = new WebInspector.DatabaseTableObject(tableNames[i], this.representedObject);
+ this.appendChild(new WebInspector.DatabaseTableTreeElement(databaseTable));
+ }
+
+ this.hasChildren = tableNames.length;
+ }
+
+ this.representedObject.getTableNames(tableNamesCallback.bind(this));
+ }
+};
+
+WebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.debugger > .content {
+ top: 22px;
+}
+
+.sidebar > .panel.debugger > .navigation-bar {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceDebuggerSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DebuggerSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,558 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DebuggerSidebarPanel = function()
+{
+ WebInspector.NavigationSidebarPanel.call(this, "debugger", WebInspector.UIString("Debugger"), "Images/NavigationItemBug.svg", "3", true);
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceAdded, this);
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, this._debuggerCallFramesDidChange, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptAdded, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._debuggerActiveCallFrameDidChange, this);
+
+ this._pauseOrResumeKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "Y", this._debuggerPauseResumeButtonClicked.bind(this));
+ this._stepOverKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F6, this._debuggerStepOverButtonClicked.bind(this));
+ this._stepIntoKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F7, this._debuggerStepIntoButtonClicked.bind(this));
+ this._stepOutKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.F8, this._debuggerStepOutButtonClicked.bind(this));
+
+ this._pauseOrResumeAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Slash, this._debuggerPauseResumeButtonClicked.bind(this));
+ this._stepOverAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.SingleQuote, this._debuggerStepOverButtonClicked.bind(this));
+ this._stepIntoAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Semicolon, this._debuggerStepIntoButtonClicked.bind(this));
+ this._stepOutAlternateKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, WebInspector.KeyboardShortcut.Key.Semicolon, this._debuggerStepOutButtonClicked.bind(this));
+
+ this._navigationBar = new WebInspector.NavigationBar;
+ this.element.appendChild(this._navigationBar.element);
+
+ var toolTip = WebInspector.UIString("Enable all breakpoints");
+ var altToolTip = WebInspector.UIString("Disable all breakpoints");
+
+ this._debuggerBreakpointsButtonItem = new WebInspector.ActivateButtonNavigationItem("debugger-breakpoints", toolTip, altToolTip, "Images/Breakpoints.svg", 16, 16);
+ this._debuggerBreakpointsButtonItem.activated = WebInspector.debuggerManager.breakpointsEnabled;
+ this._debuggerBreakpointsButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._breakpointsToggleButtonClicked, this);
+ this._navigationBar.addNavigationItem(this._debuggerBreakpointsButtonItem);
+
+ toolTip = WebInspector.UIString("Pause script execution (%s or %s)").format(this._pauseOrResumeKeyboardShortcut.displayName, this._pauseOrResumeAlternateKeyboardShortcut.displayName);
+ altToolTip = WebInspector.UIString("Continue script execution (%s or %s)").format(this._pauseOrResumeKeyboardShortcut.displayName, this._pauseOrResumeAlternateKeyboardShortcut.displayName);
+
+ this._debuggerPauseResumeButtonItem = new WebInspector.ToggleButtonNavigationItem("debugger-pause-resume", toolTip, altToolTip, "Images/Pause.svg", "Images/Resume.svg", 16, 16);
+ this._debuggerPauseResumeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerPauseResumeButtonClicked, this);
+ this._navigationBar.addNavigationItem(this._debuggerPauseResumeButtonItem);
+
+ this._debuggerStepOverButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-over", WebInspector.UIString("Step over (%s or %s)").format(this._stepOverKeyboardShortcut.displayName, this._stepOverAlternateKeyboardShortcut.displayName), "Images/StepOver.svg", 16, 16);
+ this._debuggerStepOverButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepOverButtonClicked, this);
+ this._debuggerStepOverButtonItem.enabled = false;
+ this._navigationBar.addNavigationItem(this._debuggerStepOverButtonItem);
+
+ this._debuggerStepIntoButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-into", WebInspector.UIString("Step into (%s or %s)").format(this._stepIntoKeyboardShortcut.displayName, this._stepIntoAlternateKeyboardShortcut.displayName), "Images/StepInto.svg", 16, 16);
+ this._debuggerStepIntoButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepIntoButtonClicked, this);
+ this._debuggerStepIntoButtonItem.enabled = false;
+ this._navigationBar.addNavigationItem(this._debuggerStepIntoButtonItem);
+
+ this._debuggerStepOutButtonItem = new WebInspector.ButtonNavigationItem("debugger-step-out", WebInspector.UIString("Step out (%s or %s)").format(this._stepOutKeyboardShortcut.displayName, this._stepOutAlternateKeyboardShortcut.displayName), "Images/StepOut.svg", 16, 16);
+ this._debuggerStepOutButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._debuggerStepOutButtonClicked, this);
+ this._debuggerStepOutButtonItem.enabled = false;
+ this._navigationBar.addNavigationItem(this._debuggerStepOutButtonItem);
+
+ // Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
+ this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName);
+
+ this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions"));
+ this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions"));
+
+ this.filterBar.placeholder = WebInspector.UIString("Filter Breakpoint List");
+
+ this._breakpointsContentTreeOutline = this.contentTreeOutline;
+ this._breakpointsContentTreeOutline.onselect = this._treeElementSelected.bind(this);
+ this._breakpointsContentTreeOutline.ondelete = this._breakpointTreeOutlineDeleteTreeElement.bind(this);
+ this._breakpointsContentTreeOutline.oncontextmenu = this._breakpointTreeOutlineContextMenuTreeElement.bind(this);
+
+ this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement);
+ this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
+
+ var breakpointsRow = new WebInspector.DetailsSectionRow;
+ breakpointsRow.element.appendChild(this._breakpointsContentTreeOutline.element);
+
+ var breakpointsGroup = new WebInspector.DetailsSectionGroup([breakpointsRow]);
+ var breakpointsSection = new WebInspector.DetailsSection("breakpoints", WebInspector.UIString("Breakpoints"), [breakpointsGroup]);
+ this.contentElement.appendChild(breakpointsSection.element);
+
+ this._callStackContentTreeOutline = this.createContentTreeOutline(true);
+ this._callStackContentTreeOutline.onselect = this._treeElementSelected.bind(this);
+
+ this._callStackRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Call Frames"));
+ this._callStackRow.showEmptyMessage();
+
+ var callStackGroup = new WebInspector.DetailsSectionGroup([this._callStackRow]);
+ this._callStackSection = new WebInspector.DetailsSection("call-stack", WebInspector.UIString("Call Stack"), [callStackGroup]);
+
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisplayLocationDidChange, this._breakpointDisplayLocationDidChange, this);
+};
+
+WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName = "offset-sections";
+WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon";
+
+WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
+WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint";
+
+WebInspector.DebuggerSidebarPanel.prototype = {
+ constructor: WebInspector.DebuggerSidebarPanel,
+
+ // Public
+
+ treeElementForRepresentedObject: function(representedObject)
+ {
+ // The main resource is used as the representedObject instead of Frame in our tree.
+ if (representedObject instanceof WebInspector.Frame)
+ representedObject = representedObject.mainResource;
+
+ return this.contentTreeOutline.getCachedTreeElement(representedObject);
+ },
+
+ // Protected
+
+ saveStateToCookie: function(cookie)
+ {
+ console.assert(cookie);
+
+ var selectedTreeElement = this._breakpointsContentTreeOutline.selectedTreeElement;
+ if (!selectedTreeElement)
+ return;
+
+ var representedObject = selectedTreeElement.representedObject;
+
+ if (representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint)
+ cookie[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey] = true;
+
+ if (representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint)
+ cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey] = true;
+
+ WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie.call(this, cookie);
+ },
+
+ restoreStateFromCookie: function(cookie, relaxedMatchDelay)
+ {
+ console.assert(cookie);
+
+ // Eagerly resolve the special breakpoints; otherwise, use the default behavior.
+ if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey])
+ this._allExceptionsBreakpointTreeElement.revealAndSelect();
+ else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey])
+ this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect();
+ else
+ WebInspector.NavigationSidebarPanel.prototype.restoreStateFromCookie.call(this, cookie, relaxedMatchDelay);
+ },
+
+ // Private
+
+ _debuggerPauseResumeButtonClicked: function(event)
+ {
+ if (WebInspector.debuggerManager.paused)
+ WebInspector.debuggerManager.resume();
+ else {
+ this._debuggerPauseResumeButtonItem.enabled = false;
+ WebInspector.debuggerManager.pause();
+ }
+ },
+
+ _debuggerStepOverButtonClicked: function(event)
+ {
+ WebInspector.debuggerManager.stepOver();
+ },
+
+ _debuggerStepIntoButtonClicked: function(event)
+ {
+ WebInspector.debuggerManager.stepInto();
+ },
+
+ _debuggerStepOutButtonClicked: function(event)
+ {
+ WebInspector.debuggerManager.stepOut();
+ },
+
+ _debuggerDidPause: function(event)
+ {
+ this.contentElement.insertBefore(this._callStackSection.element, this.contentElement.firstChild);
+
+ this._debuggerPauseResumeButtonItem.enabled = true;
+ this._debuggerPauseResumeButtonItem.toggled = true;
+ this._debuggerStepOverButtonItem.enabled = true;
+ this._debuggerStepIntoButtonItem.enabled = true;
+ },
+
+ _debuggerDidResume: function(event)
+ {
+ this._callStackSection.element.remove();
+
+ this._debuggerPauseResumeButtonItem.enabled = true;
+ this._debuggerPauseResumeButtonItem.toggled = false;
+ this._debuggerStepOverButtonItem.enabled = false;
+ this._debuggerStepIntoButtonItem.enabled = false;
+ this._debuggerStepOutButtonItem.enabled = false;
+ },
+
+ _breakpointsToggleButtonClicked: function(event)
+ {
+ this._debuggerBreakpointsButtonItem.activated = !this._debuggerBreakpointsButtonItem.activated;
+ WebInspector.debuggerManager.breakpointsEnabled = this._debuggerBreakpointsButtonItem.activated;
+ },
+
+ _addBreakpoint: function(breakpoint, sourceCode)
+ {
+ var sourceCode = breakpoint.sourceCodeLocation.displaySourceCode;
+ if (!sourceCode)
+ return null;
+
+ var parentTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(sourceCode);
+ if (!parentTreeElement) {
+ if (sourceCode instanceof WebInspector.SourceMapResource)
+ parentTreeElement = new WebInspector.SourceMapResourceTreeElement(sourceCode);
+ else if (sourceCode instanceof WebInspector.Resource)
+ parentTreeElement = new WebInspector.ResourceTreeElement(sourceCode);
+ else if (sourceCode instanceof WebInspector.Script)
+ parentTreeElement = new WebInspector.ScriptTreeElement(sourceCode);
+ }
+
+ if (!parentTreeElement.parent) {
+ parentTreeElement.hasChildren = true;
+ parentTreeElement.expand();
+
+ this._breakpointsContentTreeOutline.insertChild(parentTreeElement, insertionIndexForObjectInListSortedByFunction(parentTreeElement, this._breakpointsContentTreeOutline.children, this._compareTopLevelTreeElements.bind(this)));
+ }
+
+ // Mark disabled breakpoints as resolved if there is source code loaded with that URL.
+ // This gives the illusion the breakpoint was resolved, but since we don't send disabled
+ // breakpoints to the backend we don't know for sure. If the user enables the breakpoint
+ // it will be resolved properly.
+ if (breakpoint.disabled)
+ breakpoint.resolved = true;
+
+ var breakpointTreeElement = new WebInspector.BreakpointTreeElement(breakpoint);
+ parentTreeElement.insertChild(breakpointTreeElement, insertionIndexForObjectInListSortedByFunction(breakpointTreeElement, parentTreeElement.children, this._compareBreakpointTreeElements));
+ return breakpointTreeElement;
+ },
+
+ _addBreakpointsForSourceCode: function(sourceCode)
+ {
+ var breakpoints = WebInspector.debuggerManager.breakpointsForSourceCode(sourceCode);
+ for (var i = 0; i < breakpoints.length; ++i)
+ this._addBreakpoint(breakpoints[i], sourceCode);
+ },
+
+ _resourceAdded: function(event)
+ {
+ var resource = event.data.resource;
+ this._addBreakpointsForSourceCode(resource);
+ },
+
+ _mainResourceChanged: function(event)
+ {
+ var resource = event.target.mainResource;
+ this._addBreakpointsForSourceCode(resource);
+ },
+
+ _scriptAdded: function(event)
+ {
+ var script = event.data.script;
+
+ // Don't add breakpoints if the script is represented by a Resource. They were
+ // already added by _resourceAdded.
+ if (script.resource)
+ return;
+
+ this._addBreakpointsForSourceCode(script);
+ },
+
+ _scriptsCleared: function(event)
+ {
+ for (var i = this._breakpointsContentTreeOutline.children.length - 1; i >= 0; --i) {
+ var treeElement = this._breakpointsContentTreeOutline.children[i];
+ if (!(treeElement instanceof WebInspector.ScriptTreeElement))
+ continue;
+
+ this._breakpointsContentTreeOutline.removeChildAtIndex(i, true, true);
+ }
+ },
+
+ _breakpointAdded: function(event)
+ {
+ var breakpoint = event.data.breakpoint;
+ this._addBreakpoint(breakpoint);
+ },
+
+ _breakpointRemoved: function(event)
+ {
+ var breakpoint = event.data.breakpoint;
+
+ var breakpointTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(breakpoint);
+ console.assert(breakpointTreeElement);
+ if (!breakpointTreeElement)
+ return;
+
+ this._removeBreakpointTreeElement(breakpointTreeElement);
+ },
+
+ _breakpointDisplayLocationDidChange: function(event)
+ {
+ var breakpoint = event.target;
+ if (event.data.oldDisplaySourceCode === breakpoint.displaySourceCode)
+ return;
+
+ var breakpointTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(breakpoint);
+ if (!breakpointTreeElement)
+ return;
+
+ // A known breakpoint moved between resources, remove the old tree element
+ // and create a new tree element with the updated file.
+
+ var wasSelected = breakpointTreeElement.selected;
+
+ this._removeBreakpointTreeElement(breakpointTreeElement);
+ var newBreakpointTreeElement = this._addBreakpoint(breakpoint);
+
+ if (newBreakpointTreeElement && wasSelected)
+ newBreakpointTreeElement.revealAndSelect(true, false, true, true);
+ },
+
+ _removeBreakpointTreeElement: function(breakpointTreeElement)
+ {
+ var parentTreeElement = breakpointTreeElement.parent;
+ parentTreeElement.removeChild(breakpointTreeElement);
+
+ console.assert(parentTreeElement.parent === this._breakpointsContentTreeOutline);
+
+ if (!parentTreeElement.children.length)
+ this._breakpointsContentTreeOutline.removeChild(parentTreeElement);
+ },
+
+ _debuggerCallFramesDidChange: function()
+ {
+ this._callStackContentTreeOutline.removeChildren();
+
+ var callFrames = WebInspector.debuggerManager.callFrames;
+ if (!callFrames || !callFrames.length) {
+ this._callStackRow.showEmptyMessage();
+ return;
+ }
+
+ this._callStackRow.hideEmptyMessage();
+ this._callStackRow.element.appendChild(this._callStackContentTreeOutline.element);
+
+ var treeElementToSelect = null;
+
+ var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
+ for (var i = 0; i < callFrames.length; ++i) {
+ var callFrameTreeElement = new WebInspector.CallFrameTreeElement(callFrames[i]);
+ if (callFrames[i] === activeCallFrame)
+ treeElementToSelect = callFrameTreeElement;
+ this._callStackContentTreeOutline.appendChild(callFrameTreeElement);
+ }
+
+ if (treeElementToSelect)
+ treeElementToSelect.select(true, true);
+ },
+
+ _debuggerActiveCallFrameDidChange: function()
+ {
+ var callFrames = WebInspector.debuggerManager.callFrames;
+ if (!callFrames)
+ return;
+
+ var indexOfActiveCallFrame = callFrames.indexOf(WebInspector.debuggerManager.activeCallFrame);
+ // It is useful to turn off the step out button when there is no call frame to go through
+ // since there might be call frames in the backend that were removed when processing the call
+ // frame payload.
+ this._debuggerStepOutButtonItem.enabled = indexOfActiveCallFrame < callFrames.length - 1;
+ },
+
+ _breakpointsBeneathTreeElement: function(treeElement)
+ {
+ console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
+ if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
+ return [];
+
+ var breakpoints = [];
+ var breakpointTreeElements = treeElement.children;
+ for (var i = 0; i < breakpointTreeElements.length; ++i) {
+ console.assert(breakpointTreeElements[i] instanceof WebInspector.BreakpointTreeElement);
+ console.assert(breakpointTreeElements[i].breakpoint);
+ var breakpoint = breakpointTreeElements[i].breakpoint;
+ if (breakpoint)
+ breakpoints.push(breakpoint);
+ }
+
+ return breakpoints;
+ },
+
+ _removeAllBreakpoints: function(breakpoints)
+ {
+ for (var i = 0; i < breakpoints.length; ++i) {
+ var breakpoint = breakpoints[i];
+ if (WebInspector.debuggerManager.isBreakpointRemovable(breakpoint))
+ WebInspector.debuggerManager.removeBreakpoint(breakpoint);
+ }
+ },
+
+ _toggleAllBreakpoints: function(breakpoints, disabled)
+ {
+ for (var i = 0; i < breakpoints.length; ++i)
+ breakpoints[i].disabled = disabled;
+ },
+
+ _breakpointTreeOutlineDeleteTreeElement: function(treeElement)
+ {
+ console.assert(treeElement.selected);
+ console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
+ if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
+ return false;
+
+ var wasTopResourceTreeElement = treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement;
+ var nextSibling = treeElement.nextSibling;
+
+ var breakpoints = this._breakpointsBeneathTreeElement(treeElement);
+ this._removeAllBreakpoints(breakpoints);
+
+ if (wasTopResourceTreeElement && nextSibling)
+ nextSibling.select(true, true);
+
+ return true;
+ },
+
+ _breakpointTreeOutlineContextMenuTreeElement: function(event, treeElement)
+ {
+ console.assert(treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement);
+ if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
+ return;
+
+ var breakpoints = this._breakpointsBeneathTreeElement(treeElement);
+ var shouldDisable = false;
+ for (var i = 0; i < breakpoints.length; ++i) {
+ if (!breakpoints[i].disabled) {
+ shouldDisable = true;
+ break;
+ }
+ }
+
+ function removeAllResourceBreakpoints()
+ {
+ this._removeAllBreakpoints(breakpoints);
+ }
+
+ function toggleAllResourceBreakpoints()
+ {
+ this._toggleAllBreakpoints(breakpoints, shouldDisable);
+ }
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+ if (shouldDisable)
+ contextMenu.appendItem(WebInspector.UIString("Disable Breakpoints"), toggleAllResourceBreakpoints.bind(this));
+ else
+ contextMenu.appendItem(WebInspector.UIString("Enable Breakpoints"), toggleAllResourceBreakpoints.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Delete Breakpoints"), removeAllResourceBreakpoints.bind(this));
+ contextMenu.show();
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ function deselectCallStackContentTreeElements()
+ {
+ // Deselect any tree element in the call stack content tree outline to prevent two selections in the sidebar.
+ var selectedTreeElement = this._callStackContentTreeOutline.selectedTreeElement;
+ if (selectedTreeElement)
+ selectedTreeElement.deselect();
+ }
+
+ if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
+ // If the resource is being selected when it has no children it is in the process of being deleted, don't do anything.
+ if (!treeElement.children.length)
+ return;
+ deselectCallStackContentTreeElements.call(this);
+ WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
+ return;
+ }
+
+ if (treeElement instanceof WebInspector.CallFrameTreeElement) {
+ // Deselect any tree element in the breakpoints content tree outline to prevent two selections in the sidebar.
+ var selectedTreeElement = this._breakpointsContentTreeOutline.selectedTreeElement;
+ if (selectedTreeElement)
+ selectedTreeElement.deselect();
+
+ var callFrame = treeElement.callFrame;
+ WebInspector.debuggerManager.activeCallFrame = callFrame;
+ WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
+ return;
+ }
+
+ if (!(treeElement instanceof WebInspector.BreakpointTreeElement))
+ return;
+
+ deselectCallStackContentTreeElements.call(this);
+
+ if (!treeElement.parent.representedObject)
+ return;
+
+ console.assert(treeElement.parent.representedObject instanceof WebInspector.SourceCode);
+ if (!(treeElement.parent.representedObject instanceof WebInspector.SourceCode))
+ return;
+
+ var breakpoint = treeElement.breakpoint;
+ WebInspector.resourceSidebarPanel.showSourceCodeLocation(breakpoint.sourceCodeLocation);
+ },
+
+ _compareTopLevelTreeElements: function(a, b)
+ {
+ if (a === this._allExceptionsBreakpointTreeElement)
+ return -1;
+ if (b === this._allExceptionsBreakpointTreeElement)
+ return 1;
+
+ if (a === this._allUncaughtExceptionsBreakpointTreeElement)
+ return -1;
+ if (b === this._allUncaughtExceptionsBreakpointTreeElement)
+ return 1;
+
+ return a.mainTitle.localeCompare(b.mainTitle);
+ },
+
+ _compareBreakpointTreeElements: function(a, b)
+ {
+ var aLocation = a.breakpoint.sourceCodeLocation;
+ var bLocation = b.breakpoint.sourceCodeLocation;
+
+ var comparisonResult = aLocation.displayLineNumber - bLocation.displayLineNumber;
+ if (comparisonResult !== 0)
+ return comparisonResult;
+
+ return aLocation.displayColumnNumber - bLocation.displayColumnNumber;
+ }
+};
+
+WebInspector.DebuggerSidebarPanel.prototype.__proto__ = WebInspector.NavigationSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectioncssfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectioncss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSection.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.details-section {
+ margin-top: -1px;
+ margin-bottom: -1px;
+
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 10px;
+}
+
+.details-section > .header {
+ position: -webkit-sticky;
+ top: -1px;
+ height: 23px;
+
+ border-top: 1px solid rgb(153, 153, 153);
+ border-bottom: 1px solid rgb(153, 153, 153);
+ box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
+ background-image: -webkit-linear-gradient(top, rgb(238, 240, 244), rgb(224, 226, 230));
+
+ color: rgb(57, 57, 57);
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ font-size: 11px;
+ font-weight: bold;
+
+ padding: 4px 5px 4px 0;
+
+ /* Ensure the headers are displayed above scrollbars. */
+ z-index: 200;
+}
+
+.details-section .details-section > .header {
+ background-image: -webkit-linear-gradient(top, rgb(250, 250, 250), rgb(240, 240, 240));
+
+ top: 21px;
+
+ /* Ensure these headers are displayed below the parent header but above scrollbars. */
+ z-index: 100;
+}
+
+.details-section > .header::before {
+ display: block;
+ float: left;
+
+ width: 21px;
+ height: 100%;
+
+ background-image: -webkit-canvas(details-section-disclosure-triangle-open-normal);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 13px 13px;
+
+ content: "";
+}
+
+.details-section > .header:not(.mouse-over-options-element):active::before {
+ background-image: -webkit-canvas(details-section-disclosure-triangle-open-active);
+}
+
+.details-section.collapsed > .header::before {
+ background-image: -webkit-canvas(details-section-disclosure-triangle-closed-normal);
+}
+
+.details-section.collapsed > .header:not(.mouse-over-options-element):active::before {
+ background-image: -webkit-canvas(details-section-disclosure-triangle-closed-active);
+}
+
+.details-section > .header > label {
+ float: right;
+ font-size: 10px;
+ color: rgba(0, 0, 0, 0.6);
+ text-align: right;
+}
+
+.details-section.collapsed > .header > label {
+ display: none;
+}
+
+.details-section > .header > label > input[type="checkbox"] {
+ margin: 0 0 0 5px;
+ vertical-align: 1px;
+ font-size: 10px;
+}
+
+.details-section > .header > .node-link,
+.details-section > .header > .go-to-arrow {
+ float: right;
+}
+
+.details-section > .header .go-to-arrow {
+ width: 10px;
+ height: 12px;
+ margin-left: 3px;
+}
+
+.details-section > .content {
+ display: table;
+ width: 100%;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+.details-section.collapsed > .content {
+ display: none;
+}
+
+.details-section > .content > .group {
+ display: table-row-group;
+}
+
+.details-section > .content > .group:nth-child(even) {
+ background-color: rgb(222, 222, 222);
+}
+
+.details-section > .content > .group:nth-child(even) > .row:not(.simple):first-child,
+.details-section > .content > .group:nth-child(even) > .row.simple:first-child > * {
+ border-top: 1px solid rgb(153, 153, 153);
+}
+
+.details-section > .content > .group:nth-child(even) > .row:not(.simple):last-child,
+.details-section > .content > .group:last-child > .row:not(.simple):last-child,
+.details-section > .content > .group:nth-child(even) > .row.simple:last-child > *,
+.details-section > .content > .group:last-child > .row.simple:last-child > * {
+ border-bottom: 1px solid rgb(153, 153, 153);
+}
+
+.details-section > .content > .group > .row.simple {
+ display: table-row;
+}
+
+.details-section > .content > .group > .row.simple:last-child > * {
+ padding-bottom: 5px !important;
+}
+
+.details-section > .content > .group > .row.simple.empty {
+ display: none;
+}
+
+.details-section > .content > .group > .row.empty.syntax-highlighted {
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 10px;
+}
+
+.details-section > .content > .group > .row.simple.empty:last-child {
+ display: table-row;
+}
+
+.details-section > .content > .group > .row.simple.empty:last-child > * {
+ display: table-cell;
+ height: 1px;
+ font-size: 0;
+ color: transparent;
+ padding-top: 0;
+ padding-bottom: 3px !important;
+}
+
+.details-section > .content > .group > .row.simple.empty:last-child > * > * {
+ display: none;
+}
+
+.details-section > .content > .group > .row.simple > * {
+ display: table-cell;
+ vertical-align: top;
+ padding: 5px 4px 2px;
+}
+
+.details-section > .content > .group > .row.simple > .label {
+ color: rgb(51, 51, 51);
+
+ text-align: right;
+
+ padding-left: 6px;
+
+ width: 85px;
+}
+
+.details-section > .content > .group > .row.simple > .value {
+ word-wrap: break-word;
+
+ padding-right: 6px;
+
+ -webkit-user-select: text;
+ cursor: text;
+}
+
+.details-section > .content > .group > .row.simple > .value .go-to-arrow {
+ width: 10px;
+ height: 12px;
+ margin-left: 5px;
+}
+
+.details-section > .content > .group > .row.simple.data > .value {
+ word-break: break-all;
+}
+
+.details-section > .content > .group > .row.empty {
+ padding: 6px;
+ text-align: center;
+ color: gray;
+}
+
+.details-section > .content > .group > .row.properties:not(.empty) {
+ padding: 4px 6px;
+}
+
+.details-section > .content .data-grid {
+ border: none;
+}
+
+.details-section > .content .data-grid table.data {
+ background-image: none;
+}
+
+.details-section > .content .data-grid tr:nth-child(even) {
+ background-color: white;
+}
+
+.details-section > .content .data-grid tr:nth-child(odd) {
+ background-color: rgb(243, 246, 250);
+}
+
+.details-section > .content .data-grid td.value-column {
+ height: auto;
+ line-height: initial;
+ white-space: normal;
+}
+
+.details-section > .content .data-grid td.value-column > div {
+ white-space: normal;
+ word-break: break-all;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,175 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSection = function(identifier, title, groups, optionsElement, defaultCollapsedSettingValue) {
+ WebInspector.Object.call(this);
+
+ console.assert(identifier);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.DetailsSection.StyleClassName;
+ this._element.classList.add(identifier);
+
+ this._headerElement = document.createElement("div");
+ this._headerElement.addEventListener("click", this._headerElementClicked.bind(this));
+ this._headerElement.className = WebInspector.DetailsSection.HeaderElementStyleClassName;
+ this._element.appendChild(this._headerElement);
+
+ if (optionsElement instanceof HTMLElement) {
+ this._optionsElement = optionsElement;
+ this._optionsElement.addEventListener("mousedown", this._optionsElementMouseDown.bind(this));
+ this._optionsElement.addEventListener("mouseup", this._optionsElementMouseUp.bind(this));
+ this._headerElement.appendChild(this._optionsElement);
+ }
+
+ this._titleElement = document.createElement("span");
+ this._headerElement.appendChild(this._titleElement);
+
+ this._contentElement = document.createElement("div");
+ this._contentElement.className = WebInspector.DetailsSection.ContentElementStyleClassName;
+ this._element.appendChild(this._contentElement);
+
+ this._generateDisclosureTrianglesIfNeeded();
+
+ this._identifier = identifier;
+ this.title = title;
+ this.groups = groups || [new WebInspector.DetailsSectionGroup];
+
+ this._collapsedSetting = new WebInspector.Setting(identifier + "-details-section-collapsed", !!defaultCollapsedSettingValue);
+ this.collapsed = this._collapsedSetting.value;
+};
+
+WebInspector.DetailsSection.StyleClassName = "details-section";
+WebInspector.DetailsSection.HeaderElementStyleClassName = "header";
+WebInspector.DetailsSection.TitleElementStyleClassName = "title";
+WebInspector.DetailsSection.ContentElementStyleClassName = "content";
+WebInspector.DetailsSection.CollapsedStyleClassName = "collapsed";
+WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName = "mouse-over-options-element";
+WebInspector.DetailsSection.DisclosureTriangleOpenCanvasIdentifier = "details-section-disclosure-triangle-open";
+WebInspector.DetailsSection.DisclosureTriangleClosedCanvasIdentifier = "details-section-disclosure-triangle-closed";
+WebInspector.DetailsSection.DisclosureTriangleNormalCanvasIdentifierSuffix = "-normal";
+WebInspector.DetailsSection.DisclosureTriangleActiveCanvasIdentifierSuffix = "-active";
+
+WebInspector.DetailsSection.prototype = {
+ constructor: WebInspector.DetailsSection,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get identifier()
+ {
+ return this._identifier;
+ },
+
+ get title()
+ {
+ return this._titleElement.textContent;
+ },
+
+ set title(title)
+ {
+ this._titleElement.textContent = title;
+ },
+
+ get collapsed()
+ {
+ return this._element.classList.contains(WebInspector.DetailsSection.CollapsedStyleClassName);
+ },
+
+ set collapsed(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.DetailsSection.CollapsedStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.DetailsSection.CollapsedStyleClassName);
+
+ this._collapsedSetting.value = flag || false;
+ },
+
+ get groups()
+ {
+ return this._groups;
+ },
+
+ set groups(groups)
+ {
+ this._contentElement.removeChildren();
+
+ this._groups = groups || [];
+
+ for (var i = 0; i < this._groups.length; ++i)
+ this._contentElement.appendChild(this._groups[i].element);
+ },
+
+ // Private
+
+ _headerElementClicked: function(event)
+ {
+ if (event.target.isSelfOrDescendant(this._optionsElement))
+ return;
+
+ this.collapsed = !this.collapsed;
+
+ this._element.scrollIntoViewIfNeeded(false);
+ },
+
+ _optionsElementMouseDown: function(event)
+ {
+ this._headerElement.classList.add(WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName);
+ },
+
+ _optionsElementMouseUp: function(event)
+ {
+ this._headerElement.classList.remove(WebInspector.DetailsSection.MouseOverOptionsElementStyleClassName);
+ },
+
+ _generateDisclosureTrianglesIfNeeded: function()
+ {
+ if (WebInspector.DetailsSection._generatedDisclosureTriangles)
+ return;
+
+ // Set this early instead of in _generateDisclosureTriangle because we don't want multiple sections that are
+ // created at the same time to duplicate the work (even though it would be harmless.)
+ WebInspector.DetailsSection._generatedDisclosureTriangles = true;
+
+ var specifications = {};
+ specifications[WebInspector.DetailsSection.DisclosureTriangleNormalCanvasIdentifierSuffix] = {
+ fillColor: [134, 134, 134]
+ };
+
+ specifications[WebInspector.DetailsSection.DisclosureTriangleActiveCanvasIdentifierSuffix] = {
+ fillColor: [57, 57, 57]
+ };
+
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, WebInspector.DetailsSection.DisclosureTriangleOpenCanvasIdentifier);
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, WebInspector.DetailsSection.DisclosureTriangleClosedCanvasIdentifier);
+ }
+};
+
+WebInspector.DetailsSection.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionDataGridRowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionDataGridRowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionDataGridRow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSectionDataGridRow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionDataGridRow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionDataGridRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionDataGridRow = function(dataGrid, emptyMessage) {
+ WebInspector.DetailsSectionRow.call(this, emptyMessage);
+
+ this.element.classList.add(WebInspector.DetailsSectionDataGridRow.StyleClassName);
+
+ this.dataGrid = dataGrid;
+};
+
+WebInspector.DetailsSectionDataGridRow.StyleClassName = "data-grid";
+
+WebInspector.DetailsSectionDataGridRow.prototype = {
+ constructor: WebInspector.DetailsSectionDataGridRow,
+
+ // Public
+
+ get dataGrid()
+ {
+ return this._dataGrid;
+ },
+
+ set dataGrid(dataGrid)
+ {
+ if (this._dataGrid === dataGrid)
+ return;
+
+ this._dataGrid = dataGrid || null;
+
+ if (dataGrid) {
+ dataGrid.element.classList.add("inline");
+
+ this.hideEmptyMessage();
+ this.element.appendChild(dataGrid.element);
+ } else
+ this.showEmptyMessage();
+ }
+};
+
+WebInspector.DetailsSectionDataGridRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionGroupjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionGroupjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionGroup.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSectionGroup.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionGroup.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionGroup = function(rows) {
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.DetailsSectionGroup.StyleClassName;
+
+ this.rows = rows;
+};
+
+WebInspector.DetailsSectionGroup.StyleClassName = "group";
+
+WebInspector.DetailsSectionGroup.prototype = {
+ constructor: WebInspector.DetailsSectionGroup,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get rows()
+ {
+ return this._rows;
+ },
+
+ set rows(rows)
+ {
+ this._element.removeChildren();
+
+ this._rows = rows || [];
+
+ for (var i = 0; i < this._rows.length; ++i)
+ this._element.appendChild(this._rows[i].element);
+ }
+};
+
+WebInspector.DetailsSectionGroup.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionPropertiesRowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionPropertiesRowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionPropertiesRow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSectionPropertiesRow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionPropertiesRow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionPropertiesRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionPropertiesRow = function(propertiesSection, emptyMessage) {
+ WebInspector.DetailsSectionRow.call(this, emptyMessage);
+
+ this.element.classList.add(WebInspector.DetailsSectionPropertiesRow.StyleClassName);
+ this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ this.propertiesSection = propertiesSection;
+};
+
+WebInspector.DetailsSectionPropertiesRow.StyleClassName = "properties";
+
+WebInspector.DetailsSectionPropertiesRow.prototype = {
+ constructor: WebInspector.DetailsSectionPropertiesRow,
+
+ // Public
+
+ get propertiesSection()
+ {
+ return this._propertiesSection;
+ },
+
+ set propertiesSection(propertiesSection)
+ {
+ this._propertiesSection = propertiesSection || null;
+
+ if (propertiesSection) {
+ // Call expand to cause the section to populate.
+ propertiesSection.expand();
+
+ this.hideEmptyMessage();
+ this.element.appendChild(propertiesSection.element);
+ } else
+ this.showEmptyMessage();
+ }
+};
+
+WebInspector.DetailsSectionPropertiesRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionRowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionRowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionRow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSectionRow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionRow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionRow = function(emptyMessage) {
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.DetailsSectionRow.StyleClassName;
+
+ this._emptyMessage = emptyMessage || "";
+};
+
+WebInspector.DetailsSectionRow.StyleClassName = "row";
+WebInspector.DetailsSectionRow.EmptyStyleClassName = "empty";
+
+WebInspector.DetailsSectionRow.prototype = {
+ constructor: WebInspector.DetailsSectionRow,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get emptyMessage()
+ {
+ return this._emptyMessage;
+ },
+
+ set emptyMessage(emptyMessage)
+ {
+ this._emptyMessage = emptyMessage || "";
+
+ if (!this.childNodes.length)
+ this.showEmptyMessage();
+ },
+
+ showEmptyMessage: function()
+ {
+ this.element.classList.add(WebInspector.DetailsSectionRow.EmptyStyleClassName);
+
+ if (this._emptyMessage instanceof Node) {
+ this.element.removeChildren();
+ this.element.appendChild(this._emptyMessage);
+ } else
+ this.element.textContent = this._emptyMessage;
+ },
+
+ hideEmptyMessage: function()
+ {
+ this.element.classList.remove(WebInspector.DetailsSectionRow.EmptyStyleClassName);
+ this.element.removeChildren();
+ }
+};
+
+WebInspector.DetailsSectionRow.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionSimpleRowjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSectionSimpleRowjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSectionSimpleRow.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSectionSimpleRow.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSectionSimpleRow = function(label, value) {
+ WebInspector.DetailsSectionRow.call(this);
+
+ this.element.classList.add(WebInspector.DetailsSectionSimpleRow.StyleClassName);
+
+ this._labelElement = document.createElement("div");
+ this._labelElement.className = WebInspector.DetailsSectionSimpleRow.LabelElementStyleClassName;
+ this.element.appendChild(this._labelElement);
+
+ this._valueElement = document.createElement("div");
+ this._valueElement.className = WebInspector.DetailsSectionSimpleRow.ValueElementStyleClassName;
+ this.element.appendChild(this._valueElement);
+
+ // Workaround for <rdar://problem/12668870> Triple-clicking text within a
+ // <div> set to "display: table-cell" selects text outside the cell.
+ //
+ // On triple-click, adjust the selection range to include only the value
+ // element if the selection extends beyond it.
+ var valueElementClicked = function(event) {
+ event.stopPropagation();
+
+ if (event.detail < 3)
+ return;
+
+ var currentSelection = window.getSelection();
+ if (!currentSelection)
+ return;
+
+ var currentRange = currentSelection.getRangeAt(0);
+ if (!currentRange || currentRange.startContainer == currentRange.endContainer)
+ return;
+
+ var correctedRange = document.createRange();
+ correctedRange.selectNodeContents(event.currentTarget);
+ currentSelection.removeAllRanges();
+ currentSelection.addRange(correctedRange);
+ };
+ this._valueElement.addEventListener("click", valueElementClicked);
+
+ this.label = label;
+ this.value = value;
+};
+
+WebInspector.DetailsSectionSimpleRow.StyleClassName = "simple";
+WebInspector.DetailsSectionSimpleRow.DataStyleClassName = "data";
+WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName = "empty";
+WebInspector.DetailsSectionSimpleRow.LabelElementStyleClassName = "label";
+WebInspector.DetailsSectionSimpleRow.ValueElementStyleClassName = "value";
+
+WebInspector.DetailsSectionSimpleRow.prototype = {
+ constructor: WebInspector.DetailsSectionSimpleRow,
+
+ // Public
+
+ get label()
+ {
+ return this._labelElement.textContent;
+ },
+
+ set label(label)
+ {
+ this._labelElement.textContent = label;
+ },
+
+ get value()
+ {
+ return this._value;
+ },
+
+ set value(value)
+ {
+ this._value = value || "";
+
+ if (this._value) {
+ this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName);
+
+ // If the value has space characters that cause word wrapping then we don't need the data class.
+ if (/[\s\u200b]/.test(this._value))
+ this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
+ else
+ this.element.classList.add(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
+ } else {
+ this.element.classList.add(WebInspector.DetailsSectionSimpleRow.EmptyStyleClassName);
+ this.element.classList.remove(WebInspector.DetailsSectionSimpleRow.DataStyleClassName);
+ }
+
+ if (value instanceof Node) {
+ this._valueElement.removeChildren();
+ this._valueElement.appendChild(this._value);
+ } else
+ this._valueElement.textContent = this._value;
+ }
+};
+
+WebInspector.DetailsSectionSimpleRow.prototype.__proto__ = WebInspector.DetailsSectionRow.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.details {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DetailsSidebarPanel = function(identifier, displayName, singularDisplayName, image, keyboardShortcutKey, element) {
+ if (keyboardShortcutKey)
+ this._keyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control | WebInspector.KeyboardShortcut.Modifier.Shift, keyboardShortcutKey, this.toggle.bind(this));
+
+ if (this._keyboardShortcut) {
+ var showToolTip = WebInspector.UIString("Show the %s details sidebar (%s)").format(singularDisplayName, this._keyboardShortcut.displayName);
+ var hideToolTip = WebInspector.UIString("Hide the %s details sidebar (%s)").format(singularDisplayName, this._keyboardShortcut.displayName);
+ } else {
+ var showToolTip = WebInspector.UIString("Show the %s details sidebar").format(singularDisplayName);
+ var hideToolTip = WebInspector.UIString("Hide the %s details sidebar").format(singularDisplayName);
+ }
+
+ WebInspector.SidebarPanel.call(this, identifier, displayName, showToolTip, hideToolTip, image, element);
+
+ this.element.classList.add(WebInspector.DetailsSidebarPanel.StyleClassName);
+};
+
+WebInspector.DetailsSidebarPanel.StyleClassName = "details";
+
+WebInspector.DetailsSidebarPanel.prototype = {
+ constructor: WebInspector.DetailsSidebarPanel,
+
+ // Public
+
+ inspect: function(objects)
+ {
+ // Implemented by subclasses.
+ return false;
+ },
+
+ shown: function()
+ {
+ if (this._needsRefresh) {
+ delete this._needsRefresh;
+ this.refresh();
+ }
+ },
+
+ needsRefresh: function()
+ {
+ if (!this.selected) {
+ this._needsRefresh = true;
+ return;
+ }
+
+ this.refresh();
+ },
+
+ refresh: function()
+ {
+ // Implemented by subclasses.
+ }
+};
+
+WebInspector.DetailsSidebarPanel.prototype.__proto__ = WebInspector.SidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.navigation-bar .item.divider {
+ width: 1px;
+
+ background-image: -webkit-linear-gradient(rgb(190, 190, 190), rgb(190, 190, 190));
+ background-size: 100% 13px;
+ background-repeat: no-repeat;
+ background-position: center;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceDividerNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/DividerNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.DividerNavigationItem = function(identifier) {
+ WebInspector.NavigationItem.call(this, identifier);
+};
+
+WebInspector.DividerNavigationItem.StyleClassName = "divider";
+
+WebInspector.DividerNavigationItem.prototype = {
+ constructor: WebInspector.DividerNavigationItem,
+
+ // Private
+
+ _additionalClassNames: [WebInspector.DividerNavigationItem.StyleClassName],
+};
+
+WebInspector.DividerNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsEditingcssfromrev164541trunkSourceWebInspectorUIUserInterfaceEditingcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Editing.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Editing.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Editing.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Editing.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.editing {
+ -webkit-user-select: text;
+ box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;
+ outline: 1px solid rgb(66%, 66%, 66%) !important;
+ background-color: white;
+ -webkit-user-modify: read-write-plaintext-only;
+ text-overflow: clip !important;
+ padding-left: 2px;
+ margin-left: -2px;
+ padding-right: 2px;
+ margin-right: -2px;
+ margin-bottom: -1px;
+ padding-bottom: 1px;
+ opacity: 1.0 !important;
+}
+
+.editing.multiline {
+ white-space: pre-wrap;
+}
+
+.editing, .editing * {
+ color: black !important;
+ text-decoration: none !important;
+}
+
+.editing br {
+ display: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsEditingSupportjsfromrev164541trunkSourceWebInspectorUIUserInterfaceEditingSupportjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EditingSupport.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,271 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.isBeingEdited = function(element)
+{
+ while (element) {
+ if (element.__editing)
+ return true;
+ element = element.parentNode;
+ }
+
+ return false;
+}
+
+WebInspector.markBeingEdited = function(element, value)
+{
+ if (value) {
+ if (element.__editing)
+ return false;
+ element.__editing = true;
+ WebInspector.__editingCount = (WebInspector.__editingCount || 0) + 1;
+ } else {
+ if (!element.__editing)
+ return false;
+ delete element.__editing;
+ --WebInspector.__editingCount;
+ }
+ return true;
+}
+
+WebInspector.isEditingAnyField = function()
+{
+ return !!WebInspector.__editingCount;
+}
+
+WebInspector.isEventTargetAnEditableField = function(event)
+{
+ const textInputTypes = {"text": true, "search": true, "tel": true, "url": true, "email": true, "password": true};
+ if (event.target instanceof HTMLInputElement)
+ return event.target.type in textInputTypes;
+
+ var codeMirrorEditorElement = event.target.enclosingNodeOrSelfWithClass("CodeMirror");
+ if (codeMirrorEditorElement && codeMirrorEditorElement.CodeMirror)
+ return !codeMirrorEditorElement.CodeMirror.getOption("readOnly");
+
+ if (event.target instanceof HTMLTextAreaElement)
+ return true;
+
+ if (event.target.enclosingNodeOrSelfWithClass("text-prompt"))
+ return true;
+
+ return false;
+}
+
+/**
+ * @constructor
+ * @param {function(Element,string,string,*,string)} commitHandler
+ * @param {function(Element,*)} cancelHandler
+ * @param {*=} context
+ */
+WebInspector.EditingConfig = function(commitHandler, cancelHandler, context)
+{
+ this.commitHandler = commitHandler;
+ this.cancelHandler = cancelHandler;
+ this.context = context;
+
+ /**
+ * Handles the "paste" event, return values are the same as those for customFinishHandler
+ * @type {function(Element)|undefined}
+ */
+ this.pasteHandler;
+
+ /**
+ * Whether the edited element is multiline
+ * @type {boolean|undefined}
+ */
+ this.multiline;
+
+ /**
+ * Custom finish handler for the editing session (invoked on keydown)
+ * @type {function(Element,*)|undefined}
+ */
+ this.customFinishHandler;
+
+ /**
+ * Whether or not spellcheck is enabled.
+ * @type {boolean}
+ */
+ this.spellcheck = false;
+}
+
+WebInspector.EditingConfig.prototype = {
+ setPasteHandler: function(pasteHandler)
+ {
+ this.pasteHandler = pasteHandler;
+ },
+
+ setMultiline: function(multiline)
+ {
+ this.multiline = multiline;
+ },
+
+ setCustomFinishHandler: function(customFinishHandler)
+ {
+ this.customFinishHandler = customFinishHandler;
+ }
+}
+
+/**
+ * @param {Element} element
+ * @param {WebInspector.EditingConfig=} config
+ */
+WebInspector.startEditing = function(element, config)
+{
+ if (!WebInspector.markBeingEdited(element, true))
+ return;
+
+ config = config || new WebInspector.EditingConfig(function() {}, function() {});
+ var committedCallback = config.commitHandler;
+ var cancelledCallback = config.cancelHandler;
+ var pasteCallback = config.pasteHandler;
+ var context = config.context;
+ var oldText = getContent(element);
+ var moveDirection = "";
+
+ element.classList.add("editing");
+
+ var oldSpellCheck = element.hasAttribute("spellcheck") ? element.spellcheck : undefined;
+ element.spellcheck = config.spellcheck;
+
+ if (config.multiline)
+ element.classList.add("multiline");
+
+ var oldTabIndex = element.tabIndex;
+ if (element.tabIndex < 0)
+ element.tabIndex = 0;
+
+ function blurEventListener() {
+ editingCommitted.call(element);
+ }
+
+ function getContent(element) {
+ if (element.tagName === "INPUT" && element.type === "text")
+ return element.value;
+ else
+ return element.textContent;
+ }
+
+ /** @this {Element} */
+ function cleanUpAfterEditing()
+ {
+ WebInspector.markBeingEdited(element, false);
+
+ this.classList.remove("editing");
+ this.scrollTop = 0;
+ this.scrollLeft = 0;
+
+ if (oldSpellCheck === undefined)
+ element.removeAttribute("spellcheck");
+ else
+ element.spellcheck = oldSpellCheck;
+
+ if (oldTabIndex === -1)
+ this.removeAttribute("tabindex");
+ else
+ this.tabIndex = oldTabIndex;
+
+ element.removeEventListener("blur", blurEventListener, false);
+ element.removeEventListener("keydown", keyDownEventListener, true);
+ if (pasteCallback)
+ element.removeEventListener("paste", pasteEventListener, true);
+
+ WebInspector.restoreFocusFromElement(element);
+ }
+
+ /** @this {Element} */
+ function editingCancelled()
+ {
+ if (this.tagName === "INPUT" && this.type === "text")
+ this.value = oldText;
+ else
+ this.textContent = oldText;
+
+ cleanUpAfterEditing.call(this);
+
+ cancelledCallback(this, context);
+ }
+
+ /** @this {Element} */
+ function editingCommitted()
+ {
+ cleanUpAfterEditing.call(this);
+
+ committedCallback(this, getContent(this), oldText, context, moveDirection);
+ }
+
+ function defaultFinishHandler(event)
+ {
+ var hasOnlyMetaModifierKey = event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey;
+ if (isEnterKey(event) && (!config.multiline || hasOnlyMetaModifierKey))
+ return "commit";
+ else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Escape.keyCode || event.keyIdentifier === "U+001B")
+ return "cancel";
+ else if (event.keyIdentifier === "U+0009") // Tab key
+ return "move-" + (event.shiftKey ? "backward" : "forward");
+ }
+
+ function handleEditingResult(result, event)
+ {
+ if (result === "commit") {
+ editingCommitted.call(element);
+ event.preventDefault();
+ event.stopPropagation();
+ } else if (result === "cancel") {
+ editingCancelled.call(element);
+ event.preventDefault();
+ event.stopPropagation();
+ } else if (result && result.startsWith("move-")) {
+ moveDirection = result.substring(5);
+ if (event.keyIdentifier !== "U+0009")
+ blurEventListener();
+ }
+ }
+
+ function pasteEventListener(event)
+ {
+ var result = pasteCallback(event);
+ handleEditingResult(result, event);
+ }
+
+ function keyDownEventListener(event)
+ {
+ var handler = config.customFinishHandler || defaultFinishHandler;
+ var result = handler(event);
+ handleEditingResult(result, event);
+ }
+
+ element.addEventListener("blur", blurEventListener, false);
+ element.addEventListener("keydown", keyDownEventListener, true);
+ if (pasteCallback)
+ element.addEventListener("paste", pasteEventListener, true);
+
+ element.focus();
+
+ return {
+ cancel: editingCancelled.bind(element),
+ commit: editingCommitted.bind(element)
+ };
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceEventListenerSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EventListenerSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventListenerSection = function(type, nodeId)
+{
+ WebInspector.DetailsSection.call(this, type + "-event-listener-section", type, [], null, true);
+
+ this.element.classList.add("event-listener-section");
+
+ this._nodeId = nodeId;
+}
+
+WebInspector.EventListenerSection.prototype = {
+ constructor: WebInspector.EventListenerSection,
+
+ addListener: function(eventListener)
+ {
+ var groups = this.groups;
+ groups.push(new WebInspector.EventListenerSectionGroup(eventListener, this._nodeId));
+ this.groups = groups;
+ }
+}
+
+WebInspector.EventListenerSection.prototype.__proto__ = WebInspector.DetailsSection.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionGroupcssfromrev164541trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.event-listener-section > .content > .group > .row.simple > .value {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsEventListenerSectionGroupjsfromrev164541trunkSourceWebInspectorUIUserInterfaceEventListenerSectionGroupjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/EventListenerSectionGroup.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.EventListenerSectionGroup = function(eventListener, nodeId)
+{
+ this._eventListener = eventListener;
+ this._nodeId = nodeId;
+
+ var rows = [];
+ rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Node"), this._nodeTextOrLink()));
+ rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Function"), this._functionTextOrLink()));
+ rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type"), this._type()));
+
+ WebInspector.DetailsSectionGroup.call(this, rows);
+}
+
+WebInspector.EventListenerSectionGroup.prototype = {
+ constructor: WebInspector.EventListenerSectionGroup,
+
+ _nodeTextOrLink: function()
+ {
+ var node = this._eventListener.node;
+ if (!node)
+ return;
+
+ if (node.nodeType() === Node.DOCUMENT_NODE)
+ return "document";
+
+ return WebInspector.linkifyNodeReference(node);
+ },
+
+ _type: function()
+ {
+ if (this._eventListener.useCapture)
+ return WebInspector.UIString("Capturing");
+
+ if (this._eventListener.isAttribute)
+ return WebInspector.UIString("Attribute");
+
+ return WebInspector.UIString("Bubbling");
+ },
+
+ _functionTextOrLink: function()
+ {
+ var match = this._eventListener.handlerBody.match(/function ([^\(]+?)\(/);
+ if (match) {
+ var anonymous = false;
+ var functionName = match[1];
+ } else {
+ var anonymous = true;
+ var functionName = WebInspector.UIString("(anonymous function)");
+ }
+
+ if (!this._eventListener.location)
+ return functionName;
+
+ // COMPATIBILITY (iOS 6): In the past scriptId could be a URL. Now it is always a script identifier.
+ // So try looking up the resource by URL if a script can't be found directly.
+ var scriptIdentifierOrURL = this._eventListener.location.scriptId;
+ var sourceCode = WebInspector.debuggerManager.scriptForIdentifier(scriptIdentifierOrURL);
+ if (!sourceCode)
+ sourceCode = WebInspector.frameResourceManager.resourceForURL(scriptIdentifierOrURL);
+
+ if (!sourceCode)
+ return functionName;
+
+ var sourceCodeLocation = sourceCode.createSourceCodeLocation(this._eventListener.location.lineNumber, this._eventListener.location.columnNumber || 0);
+ var linkElement = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, anonymous);
+ if (anonymous)
+ return linkElement;
+
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild(linkElement);
+ fragment.appendChild(document.createTextNode(functionName));
+ return fragment;
+ }
+}
+
+WebInspector.EventListenerSectionGroup.prototype.__proto__ = WebInspector.DetailsSectionGroup.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFilterBarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceFilterBarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FilterBar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.filter-bar {
+ display: -webkit-flex;
+
+ height: 21px;
+
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.filter-bar > input[type="search"] {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ margin: 1px 6px;
+
+ outline: none;
+
+ -webkit-appearance: none;
+
+ border: 1px solid rgba(0, 0, 0, 0.35);
+ border-radius: 10px;
+ background-color: rgba(255, 255, 255, 0.2);
+ box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
+ background-clip: padding-box;
+
+ height: 19px;
+
+ transition: background-color 200ms ease-in-out;
+}
+
+.filter-bar > input[type="search"]::-webkit-input-placeholder {
+ color: rgba(0, 0, 0, 0.35);
+}
+
+.filter-bar > input[type="search"]:focus { background-color: white; }
+.filter-bar > input[type="search"]:not(:placeholder-shown) { background-color: white; } /* Needs to be a separate rule. See http://webkit.org/b/118162 */
+
+.filter-bar > input[type="search"]::-webkit-search-decoration {
+ width: 13px;
+ height: 13px;
+
+ margin-left: 1px;
+ margin-right: 3px;
+
+ vertical-align: bottom;
+
+ background-image: url(../Images/FilterFieldGlyph.svg);
+
+ -webkit-appearance: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFilterBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFilterBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FilterBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FilterBar = function(element) {
+ WebInspector.Object.call(this);
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.FilterBar.StyleClassName);
+
+ this._inputField = document.createElement("input");
+ this._inputField.type = "search";
+ this._inputField.spellcheck = false;
+ this._inputField.incremental = true;
+ this._inputField.addEventListener("search", this._inputFieldChanged.bind(this), false);
+ this._element.appendChild(this._inputField);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.FilterBar);
+
+WebInspector.FilterBar.StyleClassName = "filter-bar";
+
+WebInspector.FilterBar.Event = {
+ TextFilterDidChange: "filter-bar-text-filter-did-change"
+};
+
+WebInspector.FilterBar.prototype = {
+ constructor: WebInspector.FilterBar,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get placeholder()
+ {
+ return this._inputField.getAttribute("placeholder");
+ },
+
+ set placeholder(text)
+ {
+ this._inputField.setAttribute("placeholder", text);
+ },
+
+ get inputField()
+ {
+ return this._inputField;
+ },
+
+ get filters()
+ {
+ return {text: this._inputField.value};
+ },
+
+ set filters(filters)
+ {
+ filters = filters || {};
+
+ var oldTextValue = this._inputField.value;
+ this._inputField.value = filters.text || "";
+ if (oldTextValue !== this._inputField.value)
+ this._inputFieldChanged();
+ },
+
+ hasActiveFilters: function()
+ {
+ if (this._inputField.value)
+ return true;
+ return false;
+ },
+
+ // Private
+
+ _inputFieldChanged: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.FilterBar.Event.TextFilterDidChange);
+ }
+};
+
+WebInspector.FilterBar.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFindBannercssfromrev164541trunkSourceWebInspectorUIUserInterfaceFindBannercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FindBanner.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,196 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.find-banner {
+ border-bottom: 1px solid rgb(153, 153, 153);
+
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 11px;
+
+ position: absolute;
+ top: -22px;
+ left: 0;
+ right: 0;
+ height: 22px;
+
+ text-align: right;
+
+ white-space: nowrap;
+ overflow: hidden;
+
+ transition-property: top;
+ transition-duration: 200ms;
+ transition-timing-function: ease-in;
+
+ z-index: 500;
+}
+
+.find-banner.showing {
+ top: 0;
+ transition-timing-function: ease-out;
+}
+
+.find-banner.no-find-banner-transition,
+.supports-find-banner.no-find-banner-transition {
+ transition-duration: 0 !important;
+}
+
+.supports-find-banner {
+ transition-property: top;
+ transition-duration: 200ms;
+ transition-timing-function: ease-in;
+}
+
+.supports-find-banner.showing-find-banner {
+ top: 22px !important;
+ transition-timing-function: ease-out;
+}
+
+.find-banner > :first-child {
+ margin-left: 8px !important;
+}
+
+.find-banner > :last-child {
+ margin-right: 8px !important;
+}
+
+.find-banner > input[type="search"] {
+ margin: 1px 4px;
+
+ width: 143px;
+ height: 19px;
+
+ vertical-align: top;
+
+ -webkit-appearance: none;
+
+ outline: none;
+
+ border: 1px solid rgb(146, 146, 146);
+ border-radius: 4px;
+ background-color: white;
+ box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
+}
+
+.find-banner > button {
+ margin: 1px 4px;
+
+ padding-left: 6px;
+ padding-right: 6px;
+
+ -webkit-appearance: none;
+
+ border-radius: 4px;
+ border: 1px solid rgb(146, 146, 146);
+
+ background-color: white;
+ background-image: none;
+ box-shadow: none;
+
+ line-height: 11px;
+
+ height: 19px;
+
+ text-align: center;
+ vertical-align: top;
+
+ outline-offset: -2px;
+}
+
+.find-banner > button > .glyph {
+ display: inline-block;
+
+ width: 7px;
+ height: 7px;
+}
+
+.find-banner > button:disabled > .glyph {
+ opacity: 0.65;
+}
+
+.find-banner > button:active:not(:disabled) {
+ border: 1px solid rgb(141, 141, 141);
+ background-image: -webkit-linear-gradient(top, rgb(200, 200, 200), rgb(218, 218, 218));
+ box-shadow: rgba(255, 255, 255, 0.33) 0 1px 0, inset rgb(165, 165, 165) 0 1px 1px;
+}
+
+.find-banner > button:disabled {
+ border: 1px solid rgb(195, 195, 195);
+ background-image: none;
+}
+
+.find-banner > button.segmented.left {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+
+ margin-right: 0;
+
+ padding-left: 6px;
+ padding-right: 6px;
+}
+
+.find-banner > button.segmented.left > .glyph {
+ background-image: -webkit-canvas(find-banner-previous-arrow-normal);
+ background-size: 7px 7px;
+ background-repeat: no-repeat;
+}
+
+.find-banner > button.segmented.left:active:not(:disabled) > .glyph {
+ background-image: -webkit-canvas(find-banner-previous-arrow-normal-active);
+}
+
+.find-banner > button.segmented.right {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+
+ margin-left: -1px;
+
+ padding-left: 5px;
+ padding-right: 7px;
+}
+
+.find-banner > button.segmented.right > .glyph {
+ background-image: -webkit-canvas(find-banner-next-arrow-normal);
+ background-size: 7px 7px;
+ background-repeat: no-repeat;
+}
+
+.find-banner > button.segmented.right:active:not(:disabled) > .glyph {
+ background-image: -webkit-canvas(find-banner-next-arrow-normal-active);
+}
+
+.find-banner > button.segmented {
+ min-width: 22px;
+}
+
+.find-banner > button.segmented:active {
+ z-index: 100;
+ position: relative;
+}
+
+.find-banner > label {
+ margin: 0 6px;
+ line-height: 21px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFindBannerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFindBannerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FindBanner.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,334 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FindBanner = function(delegate, element) {
+ WebInspector.Object.call(this);
+
+ this._delegate = delegate || null;
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.FindBanner.StyleClassName);
+
+ this._resultCountLabel = document.createElement("label");
+ this._element.appendChild(this._resultCountLabel);
+
+ this._previousResultButton = document.createElement("button");
+ this._previousResultButton.classList.add(WebInspector.FindBanner.SegmentedButtonStyleClassName);
+ this._previousResultButton.classList.add(WebInspector.FindBanner.LeftSegmentButtonStyleClassName);
+ this._previousResultButton.disabled = true;
+ this._previousResultButton.addEventListener("click", this._previousResultButtonClicked.bind(this));
+ this._element.appendChild(this._previousResultButton);
+
+ var previousResultButtonGlyphElement = document.createElement("div");
+ previousResultButtonGlyphElement.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName);
+ this._previousResultButton.appendChild(previousResultButtonGlyphElement);
+
+ this._nextResultButton = document.createElement("button");
+ this._nextResultButton.classList.add(WebInspector.FindBanner.SegmentedButtonStyleClassName);
+ this._nextResultButton.classList.add(WebInspector.FindBanner.RightSegmentButtonStyleClassName);
+ this._nextResultButton.disabled = true;
+ this._nextResultButton.addEventListener("click", this._nextResultButtonClicked.bind(this));
+ this._element.appendChild(this._nextResultButton);
+
+ var nextResultButtonGlyphElement = document.createElement("div");
+ nextResultButtonGlyphElement.classList.add(WebInspector.FindBanner.SegmentGlyphStyleClassName);
+ this._nextResultButton.appendChild(nextResultButtonGlyphElement);
+
+ this._inputField = document.createElement("input");
+ this._inputField.type = "search";
+ this._inputField.spellcheck = false;
+ this._inputField.incremental = true;
+ this._inputField.setAttribute("results", 5);
+ this._inputField.setAttribute("autosave", "inspector-search");
+ this._inputField.addEventListener("keydown", this._inputFieldKeyDown.bind(this), false);
+ this._inputField.addEventListener("keyup", this._inputFieldKeyUp.bind(this), false);
+ this._inputField.addEventListener("search", this._inputFieldSearch.bind(this), false);
+ this._element.appendChild(this._inputField);
+
+ this._doneButton = document.createElement("button");
+ this._doneButton.textContent = WebInspector.UIString("Done");
+ this._doneButton.addEventListener("click", this._doneButtonClicked.bind(this));
+ this._element.appendChild(this._doneButton);
+
+ this._numberOfResults = null;
+ this._searchBackwards = false;
+ this._searchKeyPressed = false;
+ this._previousSearchValue = "";
+
+ this._hideKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape, this.hide.bind(this), this._element);
+ this._populateFindKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "E", this._populateSearchQueryFromSelection.bind(this));
+ this._populateFindKeyboardShortcut.implicitlyPreventsDefault = false;
+ this._findNextKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._nextResultButtonClicked.bind(this));
+ this._findPreviousKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift | WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "G", this._previousResultButtonClicked.bind(this));
+
+ this._generateButtonsGlyphsIfNeeded();
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.FindBanner);
+
+WebInspector.FindBanner.StyleClassName = "find-banner";
+WebInspector.FindBanner.SupportsFindBannerStyleClassName = "supports-find-banner";
+WebInspector.FindBanner.ShowingFindBannerStyleClassName = "showing-find-banner";
+WebInspector.FindBanner.NoTransitionStyleClassName = "no-find-banner-transition";
+WebInspector.FindBanner.ShowingStyleClassName = "showing";
+WebInspector.FindBanner.SegmentedButtonStyleClassName = "segmented";
+WebInspector.FindBanner.LeftSegmentButtonStyleClassName = "left";
+WebInspector.FindBanner.RightSegmentButtonStyleClassName = "right";
+WebInspector.FindBanner.SegmentGlyphStyleClassName = "glyph";
+
+WebInspector.FindBanner.Event = {
+ DidShow: "find-banner-did-show",
+ DidHide: "find-banner-did-hide"
+}
+
+WebInspector.FindBanner.prototype = {
+ constructor: WebInspector.FindBanner,
+
+ // Public
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(newDelegate)
+ {
+ this._delegate = newDelegate || null;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get inputField()
+ {
+ return this._inputField;
+ },
+
+ get searchQuery()
+ {
+ return this._inputField.value || "";
+ },
+
+ set searchQuery(query)
+ {
+ this._inputField.value = query || "";
+ },
+
+ get numberOfResults()
+ {
+ return this._numberOfResults;
+ },
+
+ set numberOfResults(numberOfResults)
+ {
+ if (numberOfResults === undefined || isNaN(numberOfResults))
+ numberOfResults = null;
+
+ this._numberOfResults = numberOfResults;
+
+ this._previousResultButton.disabled = this._nextResultButton.disabled = (numberOfResults <= 0);
+
+ if (numberOfResults === null)
+ this._resultCountLabel.textContent = "";
+ else if (numberOfResults <= 0)
+ this._resultCountLabel.textContent = WebInspector.UIString("Not found");
+ else if (numberOfResults === 1)
+ this._resultCountLabel.textContent = WebInspector.UIString("1 match");
+ else if (numberOfResults > 1)
+ this._resultCountLabel.textContent = WebInspector.UIString("%d matches").format(numberOfResults);
+ },
+
+ get targetElement()
+ {
+ return this._targetElement;
+ },
+
+ set targetElement(element)
+ {
+ if (this._targetElement) {
+ var oldTargetElement = this._targetElement;
+
+ this._targetElement.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName);
+ this._targetElement.classList.remove(WebInspector.FindBanner.SupportsFindBannerStyleClassName);
+ this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
+
+ this._element.classList.add(WebInspector.FindBanner.NoTransitionStyleClassName);
+ this._element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName);
+
+ function delayedWork()
+ {
+ oldTargetElement.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName);
+ this._element.classList.remove(WebInspector.FindBanner.NoTransitionStyleClassName);
+ }
+
+ // Delay so we can remove the no transition style class after the other style changes are committed.
+ setTimeout(delayedWork.bind(this), 0);
+ }
+
+ this._targetElement = element || null;
+
+ if (this._targetElement)
+ this._targetElement.classList.add(WebInspector.FindBanner.SupportsFindBannerStyleClassName);
+ },
+
+ get showing()
+ {
+ return this._element.classList.contains(WebInspector.FindBanner.ShowingStyleClassName);
+ },
+
+ show: function()
+ {
+ console.assert(this._targetElement);
+ if (!this._targetElement)
+ return;
+
+ console.assert(this._targetElement.parentNode);
+ if (!this._targetElement.parentNode)
+ return;
+
+ if (this._element.parentNode !== this._targetElement.parentNode)
+ this._targetElement.parentNode.insertBefore(this._element, this._targetElement);
+
+ function delayedWork()
+ {
+ this._targetElement.classList.add(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
+ this._element.classList.add(WebInspector.FindBanner.ShowingStyleClassName);
+
+ this._inputField.select();
+ }
+
+ // Delay adding the classes in case the target element and/or the find banner were just added to
+ // the document. Adding the class right away will prevent the animation from working the firs time.
+ setTimeout(delayedWork.bind(this), 0);
+
+ this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidShow);
+ },
+
+ hide: function()
+ {
+ console.assert(this._targetElement);
+ if (!this._targetElement)
+ return;
+
+ this._inputField.blur();
+
+ this._targetElement.classList.remove(WebInspector.FindBanner.ShowingFindBannerStyleClassName);
+ this._element.classList.remove(WebInspector.FindBanner.ShowingStyleClassName);
+
+ this.dispatchEventToListeners(WebInspector.FindBanner.Event.DidHide);
+ },
+
+ // Private
+
+ _inputFieldKeyDown: function(event)
+ {
+ if (event.keyIdentifier === "Shift")
+ this._searchBackwards = true;
+ else if (event.keyIdentifier === "Enter")
+ this._searchKeyPressed = true;
+ },
+
+ _inputFieldKeyUp: function(event)
+ {
+ if (event.keyIdentifier === "Shift")
+ this._searchBackwards = false;
+ else if (event.keyIdentifier === "Enter")
+ this._searchKeyPressed = false;
+ },
+
+ _inputFieldSearch: function(event)
+ {
+ if (this._inputField.value) {
+ if (this._previousSearchValue !== this.searchQuery) {
+ if (this._delegate && typeof this._delegate.findBannerPerformSearch === "function")
+ this._delegate.findBannerPerformSearch(this, this.searchQuery);
+ } else if (this._searchKeyPressed && this._numberOfResults > 0) {
+ if (this._searchBackwards) {
+ if (this._delegate && typeof this._delegate.findBannerRevealPreviousResult === "function")
+ this._delegate.findBannerRevealPreviousResult(this);
+ } else {
+ if (this._delegate && typeof this._delegate.findBannerRevealNextResult === "function")
+ this._delegate.findBannerRevealNextResult(this);
+ }
+ }
+ } else {
+ this.numberOfResults = null;
+
+ if (this._delegate && typeof this._delegate.findBannerSearchCleared === "function")
+ this._delegate.findBannerSearchCleared(this);
+ }
+
+ this._previousSearchValue = this.searchQuery;
+ },
+
+ _populateSearchQueryFromSelection: function(event)
+ {
+ if (this._delegate && typeof this._delegate.findBannerSearchQueryForSelection === "function") {
+ var query = this._delegate.findBannerSearchQueryForSelection(this);
+ if (query) {
+ this.searchQuery = query;
+
+ if (this._delegate && typeof this._delegate.findBannerPerformSearch === "function")
+ this._delegate.findBannerPerformSearch(this, this.searchQuery);
+ }
+ }
+ },
+
+ _previousResultButtonClicked: function(event)
+ {
+ if (this._delegate && typeof this._delegate.findBannerRevealPreviousResult === "function")
+ this._delegate.findBannerRevealPreviousResult(this);
+ },
+
+ _nextResultButtonClicked: function(event)
+ {
+ if (this._delegate && typeof this._delegate.findBannerRevealNextResult === "function")
+ this._delegate.findBannerRevealNextResult(this);
+ },
+
+ _doneButtonClicked: function(event)
+ {
+ this.hide();
+ },
+
+ _generateButtonsGlyphsIfNeeded: function()
+ {
+ if (WebInspector.FindBanner._generatedButtonsGlyphs)
+ return;
+
+ WebInspector.FindBanner._generatedButtonsGlyphs = true;
+
+ var specifications = {};
+ specifications["normal"] = {fillColor: [81, 81, 81]};
+ specifications["normal-active"] = {fillColor: [37, 37, 37]};
+
+ generateColoredImagesForCSS("Images/BackArrow.svg", specifications, 7, 7, "find-banner-previous-arrow-");
+ generateColoredImagesForCSS("Images/ForwardArrow.svg", specifications, 7, 7, "find-banner-next-arrow-");
+ }
+};
+
+WebInspector.FindBanner.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.navigation-bar .item.flexible-space,
+.toolbar .item.flexible-space {
+ -webkit-flex: 1;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFlexibleSpaceNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FlexibleSpaceNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FlexibleSpaceNavigationItem = function(identifier) {
+ WebInspector.NavigationItem.call(this, identifier);
+};
+
+WebInspector.FlexibleSpaceNavigationItem.StyleClassName = "flexible-space";
+
+WebInspector.FlexibleSpaceNavigationItem.prototype = {
+ constructor: WebInspector.FlexibleSpaceNavigationItem,
+
+ // Private
+
+ _additionalClassNames: [WebInspector.FlexibleSpaceNavigationItem.StyleClassName],
+};
+
+WebInspector.FlexibleSpaceNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFolderIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceFolderIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FolderIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FolderIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FolderIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FolderIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.folder-icon .icon {
+ content: -webkit-image-set(url(../Images/FolderGeneric.png) 1x, url(../Images/FolderGeneric@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFolderTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFolderTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FolderTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FolderTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FolderTreeElement = function(title, subtitle, representedObject)
+{
+ WebInspector.GeneralTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, title, subtitle, representedObject, true);
+
+ this.small = true;
+};
+
+WebInspector.FolderTreeElement.FolderIconStyleClassName = "folder-icon";
+
+WebInspector.FolderTreeElement.prototype = {
+ constructor: WebInspector.FolderTreeElement,
+
+ // No Methods or Properties
+};
+
+WebInspector.FolderTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.resource.font {
+ display: -webkit-flex;
+
+ -webkit-justify-content: center;
+
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.content-view.resource.font .preview {
+ font-size: 72px;
+ font-family: serif;
+
+ white-space: nowrap;
+
+ /* A border is used instead of padding or margin so when there is scrolling
+ overflow there will be space on all sides. It also avoids having to account
+ for the padding/margin in FontResourceContentView.siteToFit. */
+ border: 15px solid transparent;
+
+ margin: auto 0;
+}
+
+.content-view.resource.font .preview > .line {
+ border-left: 1px solid lightgrey;
+ border-right: 1px solid lightgrey;
+
+ margin-top: -1px; /* Causes adjacent .line elements to share one border instead of doubling up. */
+}
+
+.content-view.resource.font .preview > .line > .content {
+ display: inline-block;
+
+ width: 100%;
+
+ text-align: center;
+ text-rendering: optimizeLegibility;
+
+ -webkit-user-select: text;
+ cursor: text;
+}
+
+.content-view.resource.font .preview > .line > .metric {
+ display: inline-block;
+
+ width: 100%;
+ height: 1px;
+
+ margin-right: -100%; /* Causes this element to be zero width and draw behind the text. */
+}
+
+.content-view.resource.font .metric.top {
+ vertical-align: top;
+ background-color: lightgrey;
+}
+
+.content-view.resource.font .metric.baseline {
+ vertical-align: baseline;
+ background-color: lightblue;
+}
+
+.content-view.resource.font .metric.middle {
+ vertical-align: middle;
+ background-color: lightgreen;
+}
+
+.content-view.resource.font .metric.xheight {
+ vertical-align: 1ex;
+ background-color: pink;
+}
+
+.content-view.resource.font .metric.bottom {
+ vertical-align: bottom;
+ background-color: lightgrey;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFontResourceContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFontResourceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FontResourceContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FontResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,151 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FontResourceContentView = function(resource)
+{
+ WebInspector.ResourceContentView.call(this, resource, WebInspector.FontResourceContentView.StyleClassName);
+
+ this._styleElement = null;
+ this._previewElement = null;
+};
+
+WebInspector.FontResourceContentView._uniqueFontIdentifier = 0;
+
+WebInspector.FontResourceContentView.StyleClassName = "font";
+WebInspector.FontResourceContentView.PreviewElementStyleClassName = "preview";
+WebInspector.FontResourceContentView.LineElementStyleClassName = "line";
+WebInspector.FontResourceContentView.ContentElementStyleClassName = "content";
+WebInspector.FontResourceContentView.MetricElementStyleClassName = "metric";
+WebInspector.FontResourceContentView.TopMetricElementStyleClassName = "top";
+WebInspector.FontResourceContentView.XHeightMetricElementStyleClassName = "xheight";
+WebInspector.FontResourceContentView.MiddleMetricElementStyleClassName = "middle";
+WebInspector.FontResourceContentView.BaselineMetricElementStyleClassName = "baseline";
+WebInspector.FontResourceContentView.BottomMetricElementStyleClassName = "bottom";
+WebInspector.FontResourceContentView.PreviewLines = ["ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "abcdefghijklm", "nopqrstuvwxyz", "1234567890"];
+
+WebInspector.FontResourceContentView.MaximumFontSize = 72;
+WebInspector.FontResourceContentView.MinimumFontSize = 12;
+
+WebInspector.FontResourceContentView.prototype = {
+ constructor: WebInspector.FontResourceContentView,
+
+ // Public
+
+ get previewElement()
+ {
+ return this._previewElement;
+ },
+
+ sizeToFit: function()
+ {
+ if (!this._previewElement)
+ return;
+
+ // Start at the maximum size and try progressively smaller font sizes until minimum is reached or the preview element is not as wide as the main element.
+ for (var fontSize = WebInspector.FontResourceContentView.MaximumFontSize; fontSize >= WebInspector.FontResourceContentView.MinimumFontSize; fontSize -= 5) {
+ this._previewElement.style.fontSize = fontSize + "px";
+ if (this._previewElement.offsetWidth <= this.element.offsetWidth)
+ break;
+ }
+ },
+
+ contentAvailable: function(content, base64Encoded)
+ {
+ this.element.removeChildren();
+
+ const uniqueFontName = "WebInspectorFontPreview" + (++WebInspector.FontResourceContentView._uniqueFontIdentifier);
+
+ var format = "";
+
+ // We need to specify a format when loading SVG fonts to make them work.
+ if (this.resource.mimeTypeComponents.type === "image/svg+xml")
+ format = " format(\"svg\")";
+
+ if (this._styleElement && this._styleElement.parentNode)
+ this._styleElement.parentNode.removeChild(this._styleElement);
+
+ this._styleElement = document.createElement("style");
+ this._styleElement.textContent = "@font-face { font-family: \"" + uniqueFontName + "\"; src: url(" + this.resource.contentURL + ")" + format + "; }";
+
+ // The style element will be added when shown later if we are not visible now.
+ if (this.visible)
+ document.head.appendChild(this._styleElement);
+
+ this._previewElement = document.createElement("div");
+ this._previewElement.className = WebInspector.FontResourceContentView.PreviewElementStyleClassName;
+ this._previewElement.style.fontFamily = uniqueFontName;
+
+ function createMetricElement(className)
+ {
+ var metricElement = document.createElement("div");
+ metricElement.className = WebInspector.FontResourceContentView.MetricElementStyleClassName + " " + className;
+ return metricElement;
+ }
+
+ var lines = WebInspector.FontResourceContentView.PreviewLines;
+ for (var i = 0; i < lines.length; ++i) {
+ var lineElement = document.createElement("div");
+ lineElement.className = WebInspector.FontResourceContentView.LineElementStyleClassName;
+
+ lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.TopMetricElementStyleClassName));
+ lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.XHeightMetricElementStyleClassName));
+ lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.MiddleMetricElementStyleClassName));
+ lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.BaselineMetricElementStyleClassName));
+ lineElement.appendChild(createMetricElement(WebInspector.FontResourceContentView.BottomMetricElementStyleClassName));
+
+ var contentElement = document.createElement("div");
+ contentElement.className = WebInspector.FontResourceContentView.ContentElementStyleClassName;
+ contentElement.textContent = lines[i];
+ lineElement.appendChild(contentElement);
+
+ this._previewElement.appendChild(lineElement);
+ }
+
+ this.element.appendChild(this._previewElement);
+
+ this.sizeToFit();
+ },
+
+ updateLayout: function()
+ {
+ this.sizeToFit();
+ },
+
+ shown: function()
+ {
+ // Add the style element since it is removed when hidden.
+ if (this._styleElement)
+ document.head.appendChild(this._styleElement);
+ },
+
+ hidden: function()
+ {
+ // Remove the style element so it will not stick around when this content view is destroyed.
+ if (this._styleElement && this._styleElement.parentNode)
+ this._styleElement.parentNode.removeChild(this._styleElement);
+ }
+};
+
+WebInspector.FontResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFrameContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFrameContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FrameContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FrameContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameContentView = function(frame)
+{
+ WebInspector.ClusterContentView.call(this, frame);
+
+ this._frame = frame;
+
+ function createPathComponent(displayName, className, identifier)
+ {
+ var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ return pathComponent;
+ }
+
+ this._sourceCodePathComponent = createPathComponent.call(this, WebInspector.UIString("Source Code"), WebInspector.FrameContentView.SourceCodeIconStyleClassName, WebInspector.FrameContentView.SourceCodeIdentifier);
+ this._domTreePathComponent = createPathComponent.call(this, WebInspector.UIString("DOM Tree"), WebInspector.FrameContentView.DOMTreeIconStyleClassName, WebInspector.FrameContentView.DOMTreeIdentifier);
+
+ this._sourceCodePathComponent.nextSibling = this._domTreePathComponent;
+ this._domTreePathComponent.previousSibling = this._sourceCodePathComponent;
+
+ this.element.classList.add(WebInspector.FrameContentView.StyleClassName);
+
+ this._currentContentViewSetting = new WebInspector.Setting("frame-current-view-" + this._frame.url.hash, WebInspector.FrameContentView.DOMTreeIdentifier);
+};
+
+WebInspector.FrameContentView.StyleClassName = "frame";
+WebInspector.FrameContentView.SourceCodeIconStyleClassName = "source-code-icon";
+WebInspector.FrameContentView.SourceCodeIdentifier = "source-code";
+WebInspector.FrameContentView.DOMTreeIconStyleClassName = "dom-tree-icon";
+WebInspector.FrameContentView.DOMTreeIdentifier = "dom-tree";
+
+WebInspector.FrameContentView.prototype = {
+ constructor: WebInspector.FrameContentView,
+
+ // Public
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ get selectionPathComponents()
+ {
+ if (!this._contentViewContainer.currentContentView)
+ return [];
+
+ // Append the current view's path components to the path component representing the current view.
+ var components = [this._pathComponentForContentView(this._contentViewContainer.currentContentView)];
+ return components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
+ },
+
+ shown: function()
+ {
+ WebInspector.ClusterContentView.prototype.shown.call(this);
+
+ if (this._shownInitialContent)
+ return;
+
+ this._showContentViewForIdentifier(this._currentContentViewSetting.value);
+ },
+
+ closed: function()
+ {
+ WebInspector.ClusterContentView.prototype.closed.call(this);
+
+ this._shownInitialContent = false;
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.Resource;
+ cookie.subview = this._currentContentViewSetting.value;
+ if (!this.representedObject.isMainFrame())
+ cookie.url = this.representedObject.url;
+ },
+
+ restoreFromCookie: function(cookie)
+ {
+ var shownView = this._showContentViewForIdentifier(cookie.subview);
+ if ("lineNumber" in cookie && "columnNumber" in cookie)
+ this.showSourceCode(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
+ },
+
+ showResource: function()
+ {
+ this._shownInitialContent = true;
+
+ return this._showContentViewForIdentifier(WebInspector.FrameContentView.SourceCodeIdentifier);
+ },
+
+ showSourceCode: function(positionToReveal, textRangeToSelect, forceUnformatted)
+ {
+ var resourceContentView = this.showResource();
+ console.assert(resourceContentView instanceof WebInspector.ResourceClusterContentView);
+ if (!resourceContentView)
+ return null;
+
+ return resourceContentView.showResponse(positionToReveal, textRangeToSelect, forceUnformatted);
+ },
+
+ showDOMTree: function(domNodeToSelect, preventFocusChange)
+ {
+ this._shownInitialContent = true;
+
+ var domTreeContentView = this._showContentViewForIdentifier(WebInspector.FrameContentView.DOMTreeIdentifier);
+ console.assert(domTreeContentView);
+ if (!domTreeContentView || !domNodeToSelect)
+ return null;
+
+ domTreeContentView.selectAndRevealDOMNode(domNodeToSelect, preventFocusChange);
+
+ return domTreeContentView;
+ },
+
+ // Private
+
+ _pathComponentForContentView: function(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView.representedObject instanceof WebInspector.Resource)
+ return this._sourceCodePathComponent;
+ if (contentView.representedObject instanceof WebInspector.DOMTree)
+ return this._domTreePathComponent;
+ console.error("Unknown contentView.");
+ return null;
+ },
+
+ _identifierForContentView: function(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView.representedObject instanceof WebInspector.Resource)
+ return WebInspector.FrameContentView.SourceCodeIdentifier;
+ if (contentView.representedObject instanceof WebInspector.DOMTree)
+ return WebInspector.FrameContentView.DOMTreeIdentifier;
+ console.error("Unknown contentView.");
+ return null;
+ },
+
+ _showContentViewForIdentifier: function(identifier)
+ {
+ var representedObjectToShow = null;
+
+ switch (identifier) {
+ case WebInspector.FrameContentView.SourceCodeIdentifier:
+ representedObjectToShow = this._frame.mainResource;
+ break;
+ case WebInspector.FrameContentView.DOMTreeIdentifier:
+ representedObjectToShow = this._frame.domTree;
+ break;
+ }
+
+ console.assert(representedObjectToShow);
+ if (!representedObjectToShow)
+ return;
+
+ this._currentContentViewSetting.value = identifier;
+
+ return this.contentViewContainer.showContentViewForRepresentedObject(representedObjectToShow);
+ },
+
+ _pathComponentSelected: function(event)
+ {
+ this._showContentViewForIdentifier(event.data.pathComponent.representedObject);
+ }
+};
+
+WebInspector.FrameContentView.prototype.__proto__ = WebInspector.ClusterContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFrameDOMTreeContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFrameDOMTreeContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FrameDOMTreeContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameDOMTreeContentView = function(domTree)
+{
+ console.assert(domTree);
+
+ WebInspector.DOMTreeContentView.call(this, domTree);
+
+ this._domTree = domTree;
+ this._domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, this._rootDOMNodeInvalidated, this);
+
+ this._requestRootDOMNode();
+};
+
+
+WebInspector.FrameDOMTreeContentView.prototype = {
+ constructor: WebInspector.FrameDOMTreeContentView,
+ __proto__: WebInspector.DOMTreeContentView.prototype,
+
+ // Public
+
+ get domTree()
+ {
+ return this._domTree;
+ },
+
+ closed: function()
+ {
+ this._domTree.removeEventListener(null, null, this);
+ WebInspector.DOMTreeContentView.prototype.closed.call(this);
+ },
+
+ getSearchContextNodes: function(callback)
+ {
+ this._domTree.requestRootDOMNode(function(rootDOMNode) {
+ callback([rootDOMNode.id]);
+ });
+ },
+
+ // Private
+
+ _rootDOMNodeAvailable: function(rootDOMNode)
+ {
+ this.domTreeOutline.rootDOMNode = rootDOMNode;
+
+ if (!rootDOMNode) {
+ this.domTreeOutline.selectDOMNode(null, false);
+ return;
+ }
+
+ this._restoreSelectedNodeAfterUpdate(this._domTree.frame.url, rootDOMNode.body || rootDOMNode.documentElement);
+ },
+
+ _rootDOMNodeInvalidated: function(event)
+ {
+ this._requestRootDOMNode();
+ },
+
+ _requestRootDOMNode: function()
+ {
+ this._domTree.requestRootDOMNode(this._rootDOMNodeAvailable.bind(this));
+ }
+
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFrameTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceFrameTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/FrameTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,631 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.FrameTreeElement = function(frame, representedObject)
+{
+ console.assert(frame instanceof WebInspector.Frame);
+
+ WebInspector.ResourceTreeElement.call(this, frame.mainResource, representedObject || frame);
+
+ this._frame = frame;
+ this._newChildQueue = [];
+
+ this._updateExpandedSetting();
+
+ frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+ frame.addEventListener(WebInspector.Frame.Event.ResourceWasAdded, this._resourceWasAdded, this);
+ frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved, this._resourceWasRemoved, this);
+ frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasAdded, this._childFrameWasAdded, this);
+ frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._childFrameWasRemoved, this);
+
+ frame.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, this._childContentFlowWasAdded, this);
+ frame.domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, this._childContentFlowWasRemoved, this);
+ frame.domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, this._rootDOMNodeInvalidated, this);
+
+ if (this._frame.isMainFrame()) {
+ this._downloadingPage = false;
+ WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveStarted, this._pageArchiveStarted, this);
+ WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveEnded, this._pageArchiveEnded, this);
+ }
+
+ this._updateParentStatus();
+ this.shouldRefreshChildren = true;
+};
+
+WebInspector.FrameTreeElement.MediumChildCountThreshold = 5;
+WebInspector.FrameTreeElement.LargeChildCountThreshold = 15;
+WebInspector.FrameTreeElement.NumberOfMediumCategoriesThreshold = 2;
+WebInspector.FrameTreeElement.NewChildQueueUpdateInterval = 500;
+
+WebInspector.FrameTreeElement.prototype = {
+ constructor: WebInspector.FrameTreeElement,
+
+ // Public
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ descendantResourceTreeElementTypeDidChange: function(resourceTreeElement, oldType)
+ {
+ // Called by descendant ResourceTreeElements.
+
+ // Add the tree element again, which will move it to the new location
+ // based on sorting and possible folder changes.
+ this._addTreeElement(resourceTreeElement);
+ },
+
+ descendantResourceTreeElementMainTitleDidChange: function(resourceTreeElement, oldMainTitle)
+ {
+ // Called by descendant ResourceTreeElements.
+
+ // Add the tree element again, which will move it to the new location
+ // based on sorting and possible folder changes.
+ this._addTreeElement(resourceTreeElement);
+ },
+
+ // Overrides from SourceCodeTreeElement.
+
+ updateSourceMapResources: function()
+ {
+ // Frames handle their own SourceMapResources.
+
+ if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
+ return;
+
+ if (!this._frame)
+ return;
+
+ this._updateParentStatus();
+
+ if (this.resource && this.resource.sourceMaps.length)
+ this.shouldRefreshChildren = true;
+ },
+
+ onattach: function()
+ {
+ // Frames handle their own SourceMapResources.
+
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+ },
+
+ // Called from ResourceTreeElement.
+
+ updateStatusForMainFrame: function()
+ {
+ function loadedImages()
+ {
+ if (!this._reloadButton || !this._downloadButton)
+ return;
+
+ var fragment = document.createDocumentFragment("div");
+ fragment.appendChild(this._downloadButton.element);
+ fragment.appendChild(this._reloadButton.element);
+ this.status = fragment;
+
+ delete this._loadingMainFrameButtons;
+ }
+
+ if (this._reloadButton && this._downloadButton) {
+ loadedImages.call(this);
+ return;
+ }
+
+ if (!this._loadingMainFrameButtons) {
+ this._loadingMainFrameButtons = true;
+
+ var tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName);
+ wrappedSVGDocument("Images/Reload.svg", null, tooltip, function(element) {
+ this._reloadButton = new WebInspector.TreeElementStatusButton(element);
+ this._reloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._reloadPageClicked, this);
+ loadedImages.call(this);
+ }.bind(this));
+
+ wrappedSVGDocument("Images/DownloadArrow.svg", null, WebInspector.UIString("Download Web Archive"), function(element) {
+ this._downloadButton = new WebInspector.TreeElementStatusButton(element);
+ this._downloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._downloadButtonClicked, this);
+ this._updateDownloadButton();
+ loadedImages.call(this);
+ }.bind(this));
+ }
+ },
+
+ // Overrides from TreeElement (Private).
+
+ onpopulate: function()
+ {
+ if (this.children.length && !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+ this._clearNewChildQueue();
+
+ if (this._shouldGroupIntoFolders() && !this._groupedIntoFolders)
+ this._groupedIntoFolders = true;
+
+ for (var i = 0; i < this._frame.childFrames.length; ++i)
+ this._addTreeElementForRepresentedObject(this._frame.childFrames[i]);
+
+ for (var i = 0; i < this._frame.resources.length; ++i)
+ this._addTreeElementForRepresentedObject(this._frame.resources[i]);
+
+ var sourceMaps = this.resource && this.resource.sourceMaps;
+ for (var i = 0; i < sourceMaps.length; ++i) {
+ var sourceMap = sourceMaps[i];
+ for (var j = 0; j < sourceMap.resources.length; ++j)
+ this._addTreeElementForRepresentedObject(sourceMap.resources[j]);
+ }
+
+ var flowMap = this._frame.domTree.flowMap;
+ for (var flowKey in flowMap)
+ this._addTreeElementForRepresentedObject(flowMap[flowKey]);
+ },
+
+ onexpand: function()
+ {
+ this._expandedSetting.value = true;
+ this._frame.domTree.requestContentFlowList();
+ },
+
+ oncollapse: function()
+ {
+ // Only store the setting if we have children, since setting hasChildren to false will cause a collapse,
+ // and we only care about user triggered collapses.
+ if (this.hasChildren)
+ this._expandedSetting.value = false;
+ },
+
+ removeChildren: function()
+ {
+ TreeElement.prototype.removeChildren.call(this);
+
+ if (this._framesFolderTreeElement)
+ this._framesFolderTreeElement.removeChildren();
+
+ for (var type in this._resourceFoldersTypeMap)
+ this._resourceFoldersTypeMap[type].removeChildren();
+
+ delete this._resourceFoldersTypeMap;
+ delete this._framesFolderTreeElement;
+ },
+
+ // Private
+
+ _updateExpandedSetting: function()
+ {
+ this._expandedSetting = new WebInspector.Setting("frame-expanded-" + this._frame.url.hash, this._frame.isMainFrame() ? true : false);
+ if (this._expandedSetting.value)
+ this.expand();
+ else
+ this.collapse();
+ },
+
+ _updateParentStatus: function()
+ {
+ this.hasChildren = (this._frame.resources.length || this._frame.childFrames.length || (this.resource && this.resource.sourceMaps.length));
+ if (!this.hasChildren)
+ this.removeChildren();
+ },
+
+ _mainResourceDidChange: function(event)
+ {
+ this._updateResource(this._frame.mainResource);
+ this._updateParentStatus();
+
+ this._groupedIntoFolders = false;
+
+ this._clearNewChildQueue();
+
+ this.removeChildren();
+
+ // Change the expanded setting since the frame URL has changed. Do this before setting shouldRefreshChildren, since
+ // shouldRefreshChildren will call onpopulate if expanded is true.
+ this._updateExpandedSetting();
+
+ if (this._frame.isMainFrame())
+ this._updateDownloadButton();
+
+ this.shouldRefreshChildren = true;
+ },
+
+ _resourceWasAdded: function(event)
+ {
+ this._addRepresentedObjectToNewChildQueue(event.data.resource);
+ },
+
+ _resourceWasRemoved: function(event)
+ {
+ this._removeChildForRepresentedObject(event.data.resource);
+ },
+
+ _childFrameWasAdded: function(event)
+ {
+ this._addRepresentedObjectToNewChildQueue(event.data.childFrame);
+ },
+
+ _childFrameWasRemoved: function(event)
+ {
+ this._removeChildForRepresentedObject(event.data.childFrame);
+ },
+
+ _childContentFlowWasAdded: function(event)
+ {
+ this._addRepresentedObjectToNewChildQueue(event.data.flow);
+ },
+
+ _childContentFlowWasRemoved: function(event)
+ {
+ this._removeChildForRepresentedObject(event.data.flow);
+ },
+
+ _rootDOMNodeInvalidated: function() {
+ if (this.expanded)
+ this._frame.domTree.requestContentFlowList();
+ },
+
+ _addRepresentedObjectToNewChildQueue: function(representedObject)
+ {
+ // This queue reduces flashing as resources load and change folders when their type becomes known.
+
+ this._newChildQueue.push(representedObject);
+ if (!this._newChildQueueTimeoutIdentifier)
+ this._newChildQueueTimeoutIdentifier = setTimeout(this._populateFromNewChildQueue.bind(this), WebInspector.FrameTreeElement.NewChildQueueUpdateInterval);
+ },
+
+ _removeRepresentedObjectFromNewChildQueue: function(representedObject)
+ {
+ this._newChildQueue.remove(representedObject);
+ },
+
+ _populateFromNewChildQueue: function()
+ {
+ for (var i = 0; i < this._newChildQueue.length; ++i)
+ this._addChildForRepresentedObject(this._newChildQueue[i]);
+
+ this._newChildQueue = [];
+ this._newChildQueueTimeoutIdentifier = null;
+ },
+
+ _clearNewChildQueue: function()
+ {
+ this._newChildQueue = [];
+ if (this._newChildQueueTimeoutIdentifier) {
+ clearTimeout(this._newChildQueueTimeoutIdentifier);
+ this._newChildQueueTimeoutIdentifier = null;
+ }
+ },
+
+ _addChildForRepresentedObject: function(representedObject)
+ {
+ console.assert(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow);
+ if (!(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow))
+ return;
+
+ this._updateParentStatus();
+
+ if (!this.treeOutline) {
+ // Just mark as needing to update to avoid doing work that might not be needed.
+ this.shouldRefreshChildren = true;
+ return;
+ }
+
+ if (this._shouldGroupIntoFolders() && !this._groupedIntoFolders) {
+ // Mark as needing a refresh to rebuild the tree into folders.
+ this._groupedIntoFolders = true;
+ this.shouldRefreshChildren = true;
+ return;
+ }
+
+ this._addTreeElementForRepresentedObject(representedObject);
+ },
+
+ _removeChildForRepresentedObject: function(representedObject)
+ {
+ console.assert(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow);
+ if (!(representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.ContentFlow))
+ return;
+
+ this._removeRepresentedObjectFromNewChildQueue(representedObject);
+
+ this._updateParentStatus();
+
+ if (!this.treeOutline) {
+ // Just mark as needing to update to avoid doing work that might not be needed.
+ this.shouldRefreshChildren = true;
+ return;
+ }
+
+ // Find the tree element for the frame by using getCachedTreeElement
+ // to only get the item if it has been created already.
+ var childTreeElement = this.treeOutline.getCachedTreeElement(representedObject);
+ if (!childTreeElement || !childTreeElement.parent)
+ return;
+
+ this._removeTreeElement(childTreeElement);
+ },
+
+ _addTreeElementForRepresentedObject: function(representedObject)
+ {
+ var childTreeElement = this.treeOutline.getCachedTreeElement(representedObject);
+ if (!childTreeElement) {
+ if (representedObject instanceof WebInspector.SourceMapResource)
+ childTreeElement = new WebInspector.SourceMapResourceTreeElement(representedObject);
+ else if (representedObject instanceof WebInspector.Resource)
+ childTreeElement = new WebInspector.ResourceTreeElement(representedObject);
+ else if (representedObject instanceof WebInspector.Frame)
+ childTreeElement = new WebInspector.FrameTreeElement(representedObject);
+ else if (representedObject instanceof WebInspector.ContentFlow)
+ childTreeElement = new WebInspector.ContentFlowTreeElement(representedObject);
+ }
+
+ this._addTreeElement(childTreeElement);
+ },
+
+ _addTreeElement: function(childTreeElement)
+ {
+ console.assert(childTreeElement);
+ if (!childTreeElement)
+ return;
+
+ var wasSelected = childTreeElement.selected;
+
+ this._removeTreeElement(childTreeElement, true, true);
+
+ var parentTreeElement = this._parentTreeElementForRepresentedObject(childTreeElement.representedObject);
+ if (parentTreeElement !== this && !parentTreeElement.parent)
+ this._insertFolderTreeElement(parentTreeElement);
+
+ this._insertResourceTreeElement(parentTreeElement, childTreeElement);
+
+ if (wasSelected)
+ childTreeElement.revealAndSelect(true, false, true, true);
+ },
+
+ _compareTreeElementsByMainTitle: function(a, b)
+ {
+ return a.mainTitle.localeCompare(b.mainTitle);
+ },
+
+ _insertFolderTreeElement: function(folderTreeElement)
+ {
+ console.assert(this._groupedIntoFolders);
+ console.assert(!folderTreeElement.parent);
+ this.insertChild(folderTreeElement, insertionIndexForObjectInListSortedByFunction(folderTreeElement, this.children, this._compareTreeElementsByMainTitle));
+ },
+
+ _compareResourceTreeElements: function(a, b)
+ {
+ if (a === b)
+ return 0;
+
+ var aIsResource = a instanceof WebInspector.ResourceTreeElement;
+ var bIsResource = b instanceof WebInspector.ResourceTreeElement;
+
+ if (aIsResource && bIsResource)
+ return WebInspector.ResourceTreeElement.compareResourceTreeElements(a, b);
+
+ if (!aIsResource && !bIsResource) {
+ // When both components are not resources then just compare the titles.
+ return a.mainTitle.localeCompare(b.mainTitle);
+ }
+
+ // Non-resources should appear before the resources.
+ // FIXME: There should be a better way to group the elements by their type.
+ return aIsResource ? 1 : -1;
+ },
+
+ _insertResourceTreeElement: function(parentTreeElement, childTreeElement)
+ {
+ console.assert(!childTreeElement.parent);
+ parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, this._compareResourceTreeElements));
+ },
+
+ _removeTreeElement: function(childTreeElement, suppressOnDeselect, suppressSelectSibling)
+ {
+ var oldParent = childTreeElement.parent;
+ if (!oldParent)
+ return;
+
+ oldParent.removeChild(childTreeElement, suppressOnDeselect, suppressSelectSibling);
+
+ if (oldParent === this)
+ return;
+
+ console.assert(oldParent instanceof WebInspector.FolderTreeElement);
+ if (!(oldParent instanceof WebInspector.FolderTreeElement))
+ return;
+
+ // Remove the old parent folder if it is now empty.
+ if (!oldParent.children.length)
+ oldParent.parent.removeChild(oldParent);
+ },
+
+ _folderNameForResourceType: function(type)
+ {
+ return WebInspector.Resource.Type.displayName(type, true);
+ },
+
+ _parentTreeElementForRepresentedObject: function(representedObject)
+ {
+ if (!this._groupedIntoFolders)
+ return this;
+
+ function createFolderTreeElement(type, displayName)
+ {
+ var folderTreeElement = new WebInspector.FolderTreeElement(displayName);
+ folderTreeElement._expandedSetting = new WebInspector.Setting(type + "-folder-expanded-" + this._frame.url.hash, false);
+ if (folderTreeElement._expandedSetting.value)
+ folderTreeElement.expand();
+ folderTreeElement.onexpand = this._folderTreeElementExpandedStateChange.bind(this);
+ folderTreeElement.oncollapse = this._folderTreeElementExpandedStateChange.bind(this);
+ return folderTreeElement;
+ }
+
+ if (representedObject instanceof WebInspector.Frame) {
+ if (!this._framesFolderTreeElement)
+ this._framesFolderTreeElement = createFolderTreeElement.call(this, "frames", WebInspector.UIString("Frames"));
+ return this._framesFolderTreeElement;
+ }
+
+ if (representedObject instanceof WebInspector.ContentFlow) {
+ if (!this._flowsFolderTreeElement)
+ this._flowsFolderTreeElement = createFolderTreeElement.call(this, "flows", WebInspector.UIString("Flows"));
+ return this._flowsFolderTreeElement;
+ }
+
+ if (representedObject instanceof WebInspector.Resource) {
+ var folderName = this._folderNameForResourceType(representedObject.type);
+ if (!folderName)
+ return this;
+
+ if (!this._resourceFoldersTypeMap)
+ this._resourceFoldersTypeMap = {};
+ if (!this._resourceFoldersTypeMap[representedObject.type])
+ this._resourceFoldersTypeMap[representedObject.type] = createFolderTreeElement.call(this, representedObject.type, folderName);
+ return this._resourceFoldersTypeMap[representedObject.type];
+ }
+
+ console.error("Unknown representedObject: ", representedObject);
+ return this;
+ },
+
+ _folderTreeElementExpandedStateChange: function(folderTreeElement)
+ {
+ console.assert(folderTreeElement._expandedSetting);
+ folderTreeElement._expandedSetting.value = folderTreeElement.expanded;
+ },
+
+ _shouldGroupIntoFolders: function()
+ {
+ // Already grouped into folders, keep it that way.
+ if (this._groupedIntoFolders)
+ return true;
+
+ // Resources and Frames are grouped into folders if one of two thresholds are met:
+ // 1) Once the number of medium categories passes NumberOfMediumCategoriesThreshold.
+ // 2) When there is a category that passes LargeChildCountThreshold and there are
+ // any resources in another category.
+
+ // Folders are avoided when there is only one category or most categories are small.
+
+ var numberOfSmallCategories = 0;
+ var numberOfMediumCategories = 0;
+ var foundLargeCategory = false;
+ var frame = this._frame;
+
+ function pushResourceType(type) {
+ // There are some other properties on WebInspector.Resource.Type that we need to skip, like private data and functions
+ if (type.charAt(0) === "_")
+ return false;
+
+ // Only care about the values that are strings, not functions, etc.
+ var typeValue = WebInspector.Resource.Type[type];
+ if (typeof typeValue !== "string")
+ return false;
+
+ return pushCategory(frame.resourcesWithType(typeValue).length);
+ }
+
+ function pushCategory(resourceCount)
+ {
+ if (!resourceCount)
+ return false;
+
+ // If this type has any resources and there is a known large category, make folders.
+ if (foundLargeCategory)
+ return true;
+
+ // If there are lots of this resource type, then count it as a large category.
+ if (resourceCount >= WebInspector.FrameTreeElement.LargeChildCountThreshold) {
+ // If we already have other resources in other small or medium categories, make folders.
+ if (numberOfSmallCategories || numberOfMediumCategories)
+ return true;
+
+ foundLargeCategory = true;
+ return false;
+ }
+
+ // Check if this is a medium category.
+ if (resourceCount >= WebInspector.FrameTreeElement.MediumChildCountThreshold) {
+ // If this is the medium category that puts us over the maximum allowed, make folders.
+ return ++numberOfMediumCategories >= WebInspector.FrameTreeElement.NumberOfMediumCategoriesThreshold;
+ }
+
+ // This is a small category.
+ ++numberOfSmallCategories;
+ return false;
+ }
+
+ // Iterate over all the available resource types.
+ return pushCategory(frame.childFrames.length) || pushCategory(frame.domTree.flowsCount) || Object.keys(WebInspector.Resource.Type).some(pushResourceType);
+ },
+
+ _reloadPageClicked: function(event)
+ {
+ // Ignore cache when the shift key is pressed.
+ PageAgent.reload(event.data.shiftKey);
+ },
+
+ _downloadButtonClicked: function(event)
+ {
+ WebInspector.archiveMainFrame();
+ },
+
+ _updateDownloadButton: function()
+ {
+ console.assert(this._frame.isMainFrame());
+ if (!this._downloadButton)
+ return;
+
+ if (!PageAgent.archive) {
+ this._downloadButton.hidden = true;
+ return;
+ }
+
+ if (this._downloadingPage) {
+ this._downloadButton.enabled = false;
+ return;
+ }
+
+ this._downloadButton.enabled = WebInspector.canArchiveMainFrame();
+ },
+
+ _pageArchiveStarted: function(event)
+ {
+ this._downloadingPage = true;
+ this._updateDownloadButton();
+ },
+
+ _pageArchiveEnded: function(event)
+ {
+ this._downloadingPage = false;
+ this._updateDownloadButton();
+ }
+};
+
+WebInspector.FrameTreeElement.prototype.__proto__ = WebInspector.ResourceTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,395 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GeneralTreeElement = function(classNames, title, subtitle, representedObject, hasChildren)
+{
+ TreeElement.call(this, "", representedObject, hasChildren);
+
+ this.classNames = classNames;
+
+ this._tooltipHandledSeparately = false;
+ this._mainTitle = title || "";
+ this._subtitle = subtitle || "";
+ this._status = "";
+}
+
+WebInspector.GeneralTreeElement.StyleClassName = "item";
+WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName = "disclosure-button";
+WebInspector.GeneralTreeElement.IconElementStyleClassName = "icon";
+WebInspector.GeneralTreeElement.StatusElementStyleClassName = "status";
+WebInspector.GeneralTreeElement.TitlesElementStyleClassName = "titles";
+WebInspector.GeneralTreeElement.MainTitleElementStyleClassName = "title";
+WebInspector.GeneralTreeElement.SubtitleElementStyleClassName = "subtitle";
+WebInspector.GeneralTreeElement.NoSubtitleStyleClassName = "no-subtitle";
+WebInspector.GeneralTreeElement.SmallStyleClassName = "small";
+WebInspector.GeneralTreeElement.TwoLineStyleClassName = "two-line";
+
+WebInspector.GeneralTreeElement.Event = {
+ MainTitleDidChange: "general-tree-element-main-title-did-change"
+};
+
+WebInspector.GeneralTreeElement.prototype = {
+ constructor: WebInspector.GeneralTreeElement,
+
+ // Public
+
+ get element()
+ {
+ return this._listItemNode;
+ },
+
+ get disclosureButton()
+ {
+ this._createElementsIfNeeded();
+ return this._disclosureButton;
+ },
+
+ get iconElement()
+ {
+ this._createElementsIfNeeded();
+ return this._iconElement;
+ },
+
+ get titlesElement()
+ {
+ this._createElementsIfNeeded();
+ return this._titlesElement;
+ },
+
+ get mainTitleElement()
+ {
+ this._createElementsIfNeeded();
+ return this._mainTitleElement;
+ },
+
+ get subtitleElement()
+ {
+ this._createElementsIfNeeded();
+ this._createSubtitleElementIfNeeded();
+ return this._subtitleElement;
+ },
+
+ get classNames()
+ {
+ return this._classNames;
+ },
+
+ set classNames(x)
+ {
+ if (this._listItemNode && this._classNames) {
+ for (var i = 0; i < this._classNames.length; ++i)
+ this._listItemNode.classList.remove(this._classNames[i]);
+ }
+
+ if (typeof x === "string")
+ x = [x];
+
+ this._classNames = x || [];
+
+ if (this._listItemNode) {
+ for (var i = 0; i < this._classNames.length; ++i)
+ this._listItemNode.classList.add(this._classNames[i]);
+ }
+ },
+
+ addClassName: function(className)
+ {
+ if (this._classNames.contains(className))
+ return;
+
+ this._classNames.push(className);
+
+ if (this._listItemNode)
+ this._listItemNode.classList.add(className);
+ },
+
+ removeClassName: function(className)
+ {
+ if (!this._classNames.contains(className))
+ return;
+
+ this._classNames.remove(className);
+
+ if (this._listItemNode)
+ this._listItemNode.classList.remove(className);
+ },
+
+ get small()
+ {
+ return this._small;
+ },
+
+ set small(x)
+ {
+ this._small = x;
+
+ if (this._listItemNode) {
+ if (this._small)
+ this._listItemNode.classList.add(WebInspector.GeneralTreeElement.SmallStyleClassName);
+ else
+ this._listItemNode.classList.remove(WebInspector.GeneralTreeElement.SmallStyleClassName);
+ }
+ },
+
+ get twoLine()
+ {
+ return this._twoLine;
+ },
+
+ set twoLine(x)
+ {
+ this._twoLine = x;
+
+ if (this._listItemNode) {
+ if (this._twoLine)
+ this._listItemNode.classList.add(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
+ else
+ this._listItemNode.classList.remove(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
+ }
+ },
+
+ get mainTitle()
+ {
+ return this._mainTitle;
+ },
+
+ set mainTitle(x)
+ {
+ this._mainTitle = x || "";
+ this._updateTitleElements();
+ this.didChange();
+ this.dispatchEventToListeners(WebInspector.GeneralTreeElement.Event.MainTitleDidChange);
+ },
+
+ get subtitle()
+ {
+ return this._subtitle;
+ },
+
+ set subtitle(x)
+ {
+ this._subtitle = x || "";
+ this._updateTitleElements();
+ this.didChange();
+ },
+
+ get status()
+ {
+ return this._status;
+ },
+
+ set status(x)
+ {
+ this._status = x || "";
+ this._updateStatusElement();
+ },
+
+ get filterableData()
+ {
+ return {text: [this.mainTitle, this.subtitle]};
+ },
+
+ get tooltipHandledSeparately()
+ {
+ return this._tooltipHandledSeparately;
+ },
+
+ set tooltipHandledSeparately(x)
+ {
+ this._tooltipHandledSeparately = x || false;
+ },
+
+ // Overrides from TreeElement (Private)
+
+ isEventWithinDisclosureTriangle: function(event)
+ {
+ return event.target === this._disclosureButton;
+ },
+
+ onattach: function()
+ {
+ this._createElementsIfNeeded();
+ this._updateTitleElements();
+ this._updateStatusElement();
+
+ this._listItemNode.classList.add(WebInspector.GeneralTreeElement.StyleClassName);
+
+ if (this._classNames) {
+ for (var i = 0; i < this._classNames.length; ++i)
+ this._listItemNode.classList.add(this._classNames[i]);
+ }
+
+ if (this._small)
+ this._listItemNode.classList.add(WebInspector.GeneralTreeElement.SmallStyleClassName);
+
+ if (this._twoLine)
+ this._listItemNode.classList.add(WebInspector.GeneralTreeElement.TwoLineStyleClassName);
+
+ this._listItemNode.appendChild(this._disclosureButton);
+ this._listItemNode.appendChild(this._iconElement);
+ this._listItemNode.appendChild(this._statusElement);
+ this._listItemNode.appendChild(this._titlesElement);
+
+ if (this.oncontextmenu && typeof this.oncontextmenu === "function") {
+ this._boundContextMenuEventHandler = this.oncontextmenu.bind(this);
+ this._listItemNode.addEventListener("contextmenu", this._boundContextMenuEventHandler, true);
+ }
+
+ if (!this._boundContextMenuEventHandler && this.treeOutline.oncontextmenu && typeof this.treeOutline.oncontextmenu === "function") {
+ this._boundContextMenuEventHandler = function(event) { this.treeOutline.oncontextmenu(event, this); }.bind(this);
+ this._listItemNode.addEventListener("contextmenu", this._boundContextMenuEventHandler, true);
+ }
+ },
+
+ ondetach: function()
+ {
+ if (this._boundContextMenuEventHandler) {
+ this._listItemNode.removeEventListener("contextmenu", this._boundContextMenuEventHandler, true);
+ delete this._boundContextMenuEventHandler;
+ }
+ },
+
+ onreveal: function()
+ {
+ if (this._listItemNode)
+ this._listItemNode.scrollIntoViewIfNeeded(false);
+ },
+
+ // Protected
+
+ callFirstAncestorFunction: function(functionName, args)
+ {
+ // Call the first ancestor that implements a function named functionName (if any).
+ var currentNode = this.parent;
+ while (currentNode) {
+ if (typeof currentNode[functionName] === "function") {
+ currentNode[functionName].apply(currentNode, args);
+ break;
+ }
+
+ currentNode = currentNode.parent;
+ }
+ },
+
+ // Private
+
+ _createElementsIfNeeded: function()
+ {
+ if (this._createdElements)
+ return;
+
+ this._disclosureButton = document.createElement("button");
+ this._disclosureButton.className = WebInspector.GeneralTreeElement.DisclosureButtonStyleClassName;
+
+ // Don't allow the disclosure button to be keyboard focusable. The TreeOutline is focusable and has
+ // its own keybindings for toggling expand and collapse.
+ this._disclosureButton.tabIndex = -1;
+
+ this._iconElement = document.createElement("img");
+ this._iconElement.className = WebInspector.GeneralTreeElement.IconElementStyleClassName;
+
+ this._statusElement = document.createElement("div");
+ this._statusElement.className = WebInspector.GeneralTreeElement.StatusElementStyleClassName;
+
+ this._titlesElement = document.createElement("div");
+ this._titlesElement.className = WebInspector.GeneralTreeElement.TitlesElementStyleClassName;
+
+ this._mainTitleElement = document.createElement("span");
+ this._mainTitleElement.className = WebInspector.GeneralTreeElement.MainTitleElementStyleClassName;
+ this._titlesElement.appendChild(this._mainTitleElement);
+
+ this._createdElements = true;
+ },
+
+ _createSubtitleElementIfNeeded: function()
+ {
+ if (this._subtitleElement)
+ return;
+
+ this._subtitleElement = document.createElement("span");
+ this._subtitleElement.className = WebInspector.GeneralTreeElement.SubtitleElementStyleClassName;
+ this._titlesElement.appendChild(this._subtitleElement);
+ },
+
+ _updateTitleElements: function()
+ {
+ if (!this._createdElements)
+ return;
+
+ if (typeof this._mainTitle === "string") {
+ if (this._mainTitleElement.textContent !== this._mainTitle)
+ this._mainTitleElement.textContent = this._mainTitle;
+ } else if (this._mainTitle instanceof Node) {
+ this._mainTitleElement.removeChildren();
+ this._mainTitleElement.appendChild(this._mainTitle);
+ }
+
+ if (typeof this._subtitle === "string" && this._subtitle) {
+ this._createSubtitleElementIfNeeded();
+ if (this._subtitleElement.textContent !== this._subtitle)
+ this._subtitleElement.textContent = this._subtitle;
+ this._titlesElement.classList.remove(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName);
+ } else if (this._subtitle instanceof Node) {
+ this._createSubtitleElementIfNeeded();
+ this._subtitleElement.removeChildren();
+ this._subtitleElement.appendChild(this._subtitle);
+ } else {
+ if (this._subtitleElement)
+ this._subtitleElement.textContent = "";
+ this._titlesElement.classList.add(WebInspector.GeneralTreeElement.NoSubtitleStyleClassName);
+ }
+
+ // Set a default tooltip if there isn't a custom one already assigned.
+ if (!this.tooltip && !this._tooltipHandledSeparately) {
+ console.assert(this._listItemNode);
+
+ // Get the textContent for the elements since they can contain other nodes,
+ // and the tool tip only cares about the text.
+ var mainTitleText = this._mainTitleElement.textContent;
+ var subtitleText = this._subtitleElement ? this._subtitleElement.textContent : "";
+
+ if (mainTitleText && subtitleText)
+ this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText;
+ else if (mainTitleText)
+ this._listItemNode.title = mainTitleText;
+ else
+ this._listItemNode.title = subtitleText;
+ }
+ },
+
+ _updateStatusElement: function()
+ {
+ if (!this._createdElements)
+ return;
+
+ if (this._status instanceof Node) {
+ this._statusElement.removeChildren();
+ this._statusElement.appendChild(this._status);
+ } else
+ this._statusElement.textContent = this._status;
+ }
+}
+
+WebInspector.GeneralTreeElement.prototype.__proto__ = TreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementPathComponentjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGeneralTreeElementPathComponentjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElementPathComponent.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GeneralTreeElementPathComponent.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElementPathComponent.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElementPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GeneralTreeElementPathComponent = function(generalTreeElement, representedObject) {
+ WebInspector.HierarchicalPathComponent.call(this, generalTreeElement.mainTitle, generalTreeElement.classNames, representedObject || generalTreeElement.representedObject);
+
+ this._generalTreeElement = generalTreeElement;
+ generalTreeElement.addEventListener(WebInspector.GeneralTreeElement.Event.MainTitleDidChange, this._mainTitleDidChange, this);
+};
+
+WebInspector.GeneralTreeElementPathComponent.prototype = {
+ constructor: WebInspector.GeneralTreeElementPathComponent,
+
+ // Public
+
+ get generalTreeElement()
+ {
+ return this._generalTreeElement;
+ },
+
+ get previousSibling()
+ {
+ var previousSibling = this._generalTreeElement.previousSibling;
+ while (previousSibling && previousSibling.hidden)
+ previousSibling = previousSibling.previousSibling;
+
+ if (!previousSibling)
+ return null;
+
+ return new WebInspector.GeneralTreeElementPathComponent(previousSibling);
+ },
+
+ get nextSibling()
+ {
+ var nextSibling = this._generalTreeElement.nextSibling;
+ while (nextSibling && nextSibling.hidden)
+ nextSibling = nextSibling.nextSibling;
+
+ if (!nextSibling)
+ return null;
+
+ return new WebInspector.GeneralTreeElementPathComponent(nextSibling);
+ },
+
+ // Private
+
+ _mainTitleDidChange: function(event)
+ {
+ this.displayName = this._generalTreeElement.mainTitle;
+ }
+};
+
+WebInspector.GeneralTreeElementPathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGenericResourceContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGenericResourceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GenericResourceContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GenericResourceContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GenericResourceContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GenericResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GenericResourceContentView = function(resource)
+{
+ WebInspector.ResourceContentView.call(this, resource, WebInspector.GenericResourceContentView.StyleClassName);
+};
+
+WebInspector.GenericResourceContentView.StyleClassName = "generic";
+
+WebInspector.GenericResourceContentView.prototype = {
+ constructor: WebInspector.GenericResourceContentView
+};
+
+WebInspector.GenericResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogcssfromrev164541trunkSourceWebInspectorUIUserInterfaceGoToLineDialogcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.go-to-line-dialog {
+ position: relative;
+ left: 50%;
+ top: 50px;
+ width: calc(100% - 40px);
+ max-width: 452px;
+ height: 38px;
+ -webkit-transform: translate(-50%, -50%);
+ padding: 3px;
+ border-radius: 5px;
+ background-color: rgba(232, 232, 232, 0.95);
+ border: 1px rgb(218, 218, 218) solid;
+ box-shadow: 1px 5px 20px 3px rgba(0, 0, 0, 0.33);
+}
+
+.go-to-line-dialog > div {
+ width: 100%;
+ height: 100%;
+ border-radius: 4px;
+ background-color: white;
+ border: 1px rgb(206, 206, 206) solid;
+}
+
+.go-to-line-dialog > div > input {
+ position: absolute;
+ left: 2px;
+ right: 36px;
+ border: none;
+ background-color: transparent;
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 20px;
+ color: rgb(12, 12, 12);
+ padding: 0 0 1px 5px;
+ outline: none;
+}
+
+.go-to-line-dialog > div > input::-webkit-input-placeholder {
+ color: rgb(133, 133, 133);
+}
+
+.go-to-line-dialog > div > img {
+ position: absolute;
+ top: 9px;
+ right: 12px;
+ padding: 2px;
+ border-radius: 9px;
+ width: 18px;
+ height: 18px;
+ background-color: rgb(188, 188, 188);
+ display: none;
+ content: url(../Images/CloseWhite.svg);
+}
+
+.go-to-line-dialog > div > img:active {
+ background-color: rgb(140, 140, 140);
+}
+
+.go-to-line-dialog.non-empty > div > img {
+ display: block;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGoToLineDialogjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGoToLineDialogjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GoToLineDialog.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.GoToLineDialog = function()
+{
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.GoToLineDialog.StyleClassName;
+
+ var field = this._element.appendChild(document.createElement("div"));
+
+ this._input = field.appendChild(document.createElement("input"));
+ this._input.type = "text";
+ this._input.placeholder = WebInspector.UIString("Line Number");
+ this._input.spellcheck = false;
+
+ this._clearIcon = field.appendChild(document.createElement("img"));
+
+ this._input.addEventListener("input", this);
+ this._input.addEventListener("keydown", this);
+ this._input.addEventListener("blur", this);
+ this._clearIcon.addEventListener("mousedown", this);
+ this._clearIcon.addEventListener("click", this);
+}
+
+WebInspector.GoToLineDialog.StyleClassName = "go-to-line-dialog";
+WebInspector.GoToLineDialog.NonEmptyClassName = "non-empty";
+
+WebInspector.GoToLineDialog.prototype = {
+ constructor: WebInspector.GoToLineDialog,
+
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ present: function(parent)
+ {
+ parent.appendChild(this._element);
+ this._input.focus();
+ this._clear();
+ },
+
+ dismiss: function()
+ {
+ var parent = this._element.parentNode;
+ if (!parent)
+ return;
+
+ parent.removeChild(this._element);
+
+ if (this.delegate && typeof this.delegate.goToLineDialogWasDismissed === "function")
+ this.delegate.goToLineDialogWasDismissed(this);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "input":
+ this._handleInputEvent(event);
+ break;
+ case "keydown":
+ this._handleKeydownEvent(event);
+ break;
+ case "blur":
+ this._handleBlurEvent(event);
+ break;
+ case "mousedown":
+ this._handleMousedownEvent(event);
+ break;
+ case "click":
+ this._handleClickEvent(event);
+ break;
+ }
+ },
+
+ // Private
+
+ _handleInputEvent: function(event)
+ {
+ if (this._input.value === "")
+ this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
+ else
+ this._element.classList.add(WebInspector.GoToLineDialog.NonEmptyClassName);
+ },
+
+ _handleKeydownEvent: function(event)
+ {
+ if (event.keyCode === WebInspector.KeyboardShortcut.Key.Escape.keyCode) {
+ if (this._input.value === "")
+ this.dismiss();
+ else
+ this._clear();
+ } else if (event.keyCode === WebInspector.KeyboardShortcut.Key.Enter.keyCode) {
+ var value = parseInt(this._input.value, 10);
+
+ var valueIsValid = false;
+ if (this.delegate && typeof this.delegate.isGoToLineDialogValueValid === "function")
+ valueIsValid = this.delegate.isGoToLineDialogValueValid(this, value);
+
+ if (valueIsValid && this.delegate && typeof this.delegate.goToLineDialogValueWasValidated === "function") {
+ this.delegate.goToLineDialogValueWasValidated(this, value);
+ this.dismiss();
+ return;
+ }
+
+ this._input.select();
+ InspectorFrontendHost.beep();
+ }
+ },
+
+ _handleBlurEvent: function(event)
+ {
+ this.dismiss();
+ },
+
+ _handleMousedownEvent: function(event)
+ {
+ this._input.select();
+ // This ensures we don't get a "blur" event triggered for the text field
+ // which would end up dimissing the dialog, which is not the intent.
+ event.preventDefault();
+ },
+
+ _handleClickEvent: function(event)
+ {
+ this._clear();
+ },
+
+ _clear: function()
+ {
+ this._input.value = "";
+ this._element.classList.remove(WebInspector.GoToLineDialog.NonEmptyClassName);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGradientSlidercssfromrev164541trunkSourceWebInspectorUIUserInterfaceGradientSlidercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GradientSlider.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+.gradient-slider {
+ position: absolute;
+
+ left: 26px;
+ width: 238px;
+ height: 21px;
+
+ border: 1px solid rgb(146, 146, 146);
+}
+
+.gradient-slider > canvas {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+
+ background-image: url(../Images/Checkers.svg);
+ background-size: 6px 6px;
+}
+
+.gradient-slider > .add-area {
+ position: absolute;
+
+ top: 14px;
+ left: 0;
+ height: 20px;
+ width: 100%;
+}
+
+.gradient-slider-knob {
+ position: absolute;
+
+ left: -11px;
+ top: 10px;
+ width: 20px;
+ height: 26px;
+
+ background-image: -webkit-image-set(url(../Images/GradientStop.png) 1x, url(../Images/GradientStop@2x.png) 2x);
+
+ transition: opacity 350ms;
+}
+
+.gradient-slider-knob.shadow {
+ opacity: 0.5;
+ pointer-events: none;
+}
+
+.gradient-slider-knob.selected {
+ background-image: -webkit-image-set(url(../Images/GradientStopSelected.png) 1x, url(../Images/GradientStopSelected@2x.png) 2x);
+}
+
+.gradient-slider-knob.detaching {
+ opacity: 0.75;
+}
+
+.gradient-slider-knob.fade-out {
+ transition: opacity 0.35s;
+ opacity: 0;
+}
+
+.gradient-slider-knob > img,
+.gradient-slider-knob > div {
+ position: absolute;
+
+ left: 5px;
+ top: 12px;
+ width: 10px;
+ height: 10px;
+}
+
+.gradient-slider-knob > img {
+ content: url(../Images/Checkers.svg);
+}
+
+.gradient-slider-knob > div {
+ border: 1px solid rgba(0, 0, 0, 0.25);
+
+ background-color: white;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGradientSliderjsfromrev164541trunkSourceWebInspectorUIUserInterfaceGradientSliderjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/GradientSlider.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GradientSlider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,450 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.GradientSlider = function(delegate)
+{
+ this.delegate = delegate;
+
+ this._element = null;
+ this._stops = [];
+ this._knobs = [];
+
+ this._selectedKnob = null;
+ this._canvas = document.createElement("canvas");
+
+ this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
+}
+
+WebInspector.GradientSlider.Width = 238;
+WebInspector.GradientSlider.Height = 19;
+
+WebInspector.GradientSlider.StyleClassName = "gradient-slider";
+WebInspector.GradientSlider.AddAreaClassName = "add-area";
+WebInspector.GradientSlider.DetachingClassName = "detaching";
+WebInspector.GradientSlider.ShadowClassName = "shadow";
+
+WebInspector.GradientSlider.prototype = {
+ constructor: WebInspector.GradientSlider,
+
+ // Public
+
+ get element()
+ {
+ if (!this._element) {
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.GradientSlider.StyleClassName;
+ this._element.appendChild(this._canvas);
+
+ this._addArea = this._element.appendChild(document.createElement("div"));
+ this._addArea.addEventListener("mouseover", this);
+ this._addArea.addEventListener("mousemove", this);
+ this._addArea.addEventListener("mouseout", this);
+ this._addArea.addEventListener("click", this);
+ this._addArea.className = WebInspector.GradientSlider.AddAreaClassName;
+ }
+ return this._element;
+ },
+
+ get stops()
+ {
+ return this._stops;
+ },
+
+ set stops(stops)
+ {
+ this._stops = stops;
+
+ this._updateStops();
+ },
+
+ get selectedStop()
+ {
+ return this._selectedKnob ? this._selectedKnob.stop : null;
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mouseover":
+ this._handleMouseover(event);
+ break;
+ case "mousemove":
+ this._handleMousemove(event);
+ break;
+ case "mouseout":
+ this._handleMouseout(event);
+ break;
+ case "click":
+ this._handleClick(event);
+ break;
+ }
+ },
+
+ handleKeydownEvent: function(event)
+ {
+ if (!this._keyboardShortcutEsc.matchesEvent(event) || !this._selectedKnob || !this._selectedKnob.selected)
+ return false;
+
+ this._selectedKnob.selected = false;
+
+ return true;
+ },
+
+ knobXDidChange: function(knob)
+ {
+ knob.stop.offset = knob.x / WebInspector.GradientSlider.Width;
+ this._sortStops();
+ this._updateCanvas();
+ },
+
+ knobCanDetach: function(knob)
+ {
+ return this._knobs.length > 2;
+ },
+
+ knobWillDetach: function(knob)
+ {
+ knob.element.classList.add(WebInspector.GradientSlider.DetachingClassName);
+
+ this._stops.remove(knob.stop);
+ this._knobs.remove(knob);
+ this._sortStops();
+ this._updateCanvas();
+ },
+
+ knobSelectionChanged: function(knob)
+ {
+ if (this._selectedKnob && this._selectedKnob !== knob && knob.selected)
+ this._selectedKnob.selected = false;
+
+ this._selectedKnob = knob.selected ? knob : null;
+
+ if (this.delegate && typeof this.delegate.gradientSliderStopWasSelected === "function")
+ this.delegate.gradientSliderStopWasSelected(this, knob.stop);
+
+ if (this._selectedKnob)
+ WebInspector.addWindowKeydownListener(this);
+ else
+ WebInspector.removeWindowKeydownListener(this);
+ },
+
+ // Private
+
+ _handleMouseover: function(event)
+ {
+ this._updateShadowKnob(event);
+ },
+
+ _handleMousemove: function(event)
+ {
+ this._updateShadowKnob(event);
+ },
+
+ _handleMouseout: function(event)
+ {
+ if (!this._shadowKnob)
+ return;
+
+ this._shadowKnob.element.remove();
+ delete this._shadowKnob;
+ },
+
+ _handleClick: function(event)
+ {
+ this._updateShadowKnob(event);
+
+ this._knobs.push(this._shadowKnob);
+
+ this._shadowKnob.element.classList.remove(WebInspector.GradientSlider.ShadowClassName);
+
+ var stop = {offset: this._shadowKnob.x / WebInspector.GradientSlider.Width, color: this._shadowKnob.wellColor};
+ this._stops.push(stop);
+ this._sortStops();
+ this._updateStops();
+
+ this._knobs[this._stops.indexOf(stop)].selected = true;
+
+ delete this._shadowKnob;
+ },
+
+ _updateShadowKnob: function(event)
+ {
+ if (!this._shadowKnob) {
+ this._shadowKnob = new WebInspector.GradientSliderKnob(this);
+ this._shadowKnob.element.classList.add(WebInspector.GradientSlider.ShadowClassName);
+ this.element.appendChild(this._shadowKnob.element);
+ }
+
+ this._shadowKnob.x = window.webkitConvertPointFromPageToNode(this.element, new WebKitPoint(event.pageX, event.pageY)).x;
+
+ var colorData = this._canvas.getContext("2d").getImageData(this._shadowKnob.x - 1, 0, 1, 1).data;
+ this._shadowKnob.wellColor = new WebInspector.Color(WebInspector.Color.Format.RGB, [colorData[0], colorData[1], colorData[2], colorData[3] / 255]);
+ },
+
+ _sortStops: function()
+ {
+ this._stops.sort(function(a, b) {
+ return a.offset - b.offset;
+ });
+ },
+
+ _updateStops: function()
+ {
+ this._updateCanvas();
+ this._updateKnobs();
+ },
+
+ _updateCanvas: function()
+ {
+ var w = WebInspector.GradientSlider.Width;
+ var h = WebInspector.GradientSlider.Height;
+
+ this._canvas.width = w;
+ this._canvas.height = h;
+
+ var ctx = this._canvas.getContext("2d");
+ var gradient = ctx.createLinearGradient(0, 0, w, 0);
+ for (var stop of this._stops)
+ gradient.addColorStop(stop.offset, stop.color);
+
+ ctx.clearRect(0, 0, w, h);
+ ctx.fillStyle = gradient;
+ ctx.fillRect(0, 0, w, h);
+
+ if (this.delegate && typeof this.delegate.gradientSliderStopsDidChange === "function")
+ this.delegate.gradientSliderStopsDidChange(this);
+ },
+
+ _updateKnobs: function()
+ {
+ var selectedStop = this._selectedKnob ? this._selectedKnob.stop : null;
+
+ while (this._knobs.length > this._stops.length)
+ this._knobs.pop().element.remove();
+
+ while (this._knobs.length < this._stops.length) {
+ var knob = new WebInspector.GradientSliderKnob(this);
+ this.element.appendChild(knob.element);
+ this._knobs.push(knob);
+ }
+
+ for (var i = 0; i < this._stops.length; ++i) {
+ var stop = this._stops[i];
+ var knob = this._knobs[i];
+
+ knob.stop = stop;
+ knob.x = Math.round(stop.offset * WebInspector.GradientSlider.Width);
+ knob.selected = stop === selectedStop;
+ }
+ }
+}
+
+WebInspector.GradientSliderKnob = function(delegate)
+{
+ this._x = 0;
+ this._y = 0;
+ this._stop = null;
+
+ this.delegate = delegate;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.GradientSliderKnob.StyleClassName;
+
+ // Checkers pattern.
+ this._element.appendChild(document.createElement("img"));
+
+ this._well = this._element.appendChild(document.createElement("div"));
+
+ this._element.addEventListener("mousedown", this);
+};
+
+WebInspector.GradientSliderKnob.StyleClassName = "gradient-slider-knob";
+WebInspector.GradientSliderKnob.SelectedClassName = "selected";
+WebInspector.GradientSliderKnob.FadeOutClassName = "fade-out";
+
+WebInspector.GradientSliderKnob.prototype = {
+ constructor: WebInspector.GradientSliderKnob,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get stop()
+ {
+ return this._stop;
+ },
+
+ set stop(stop)
+ {
+ this.wellColor = stop.color;
+ this._stop = stop;
+ },
+
+ get x()
+ {
+ return this._x;
+ },
+
+ set x(x) {
+ this._x = x;
+ this._updateTransform();
+ },
+
+ get y()
+ {
+ return this._x;
+ },
+
+ set y(y) {
+ this._y = y;
+ this._updateTransform();
+ },
+
+ get wellColor(color)
+ {
+ return this._wellColor;
+ },
+
+ set wellColor(color)
+ {
+ this._wellColor = color;
+ this._well.style.backgroundColor = color;
+ },
+
+ get selected()
+ {
+ return this._element.classList.contains(WebInspector.GradientSliderKnob.SelectedClassName);
+ },
+
+ set selected(selected)
+ {
+ if (this.selected === selected)
+ return;
+
+ this._element.classList.toggle(WebInspector.GradientSliderKnob.SelectedClassName, selected);
+
+ if (this.delegate && typeof this.delegate.knobSelectionChanged === "function")
+ this.delegate.knobSelectionChanged(this);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ event.preventDefault();
+ event.stopPropagation();
+
+ switch (event.type) {
+ case "mousedown":
+ this._handleMousedown(event);
+ break;
+ case "mousemove":
+ this._handleMousemove(event);
+ break;
+ case "mouseup":
+ this._handleMouseup(event);
+ break;
+ case "transitionend":
+ this._handleTransitionEnd(event);
+ break;
+ }
+ },
+
+ // Private
+
+ _handleMousedown: function(event)
+ {
+ this._moved = false;
+ this._detaching = false;
+
+ window.addEventListener("mousemove", this, true);
+ window.addEventListener("mouseup", this, true);
+
+ this._startX = this.x;
+ this._startMouseX = event.pageX;
+ this._startMouseY = event.pageY;
+ },
+
+ _handleMousemove: function(event)
+ {
+ var w = WebInspector.GradientSlider.Width;
+
+ this._moved = true;
+
+ if (!this._detaching && Math.abs(event.pageY - this._startMouseY) > 50) {
+ this._detaching = this.delegate && typeof this.delegate.knobCanDetach === "function" && this.delegate.knobCanDetach(this);
+ if (this._detaching && this.delegate && typeof this.delegate.knobWillDetach === "function") {
+ var translationFromParentToBody = window.webkitConvertPointFromNodeToPage(this.element.parentNode, new WebKitPoint(0, 0));
+ this._startMouseX -= translationFromParentToBody.x;
+ this._startMouseY -= translationFromParentToBody.y;
+ document.body.appendChild(this.element);
+ this.delegate.knobWillDetach(this);
+ }
+ }
+
+ var x = this._startX + event.pageX - this._startMouseX;
+ if (!this._detaching)
+ x = Math.min(Math.max(0, x), w);
+ this.x = x;
+
+ if (this._detaching)
+ this.y = event.pageY - this._startMouseY;
+ else if (this.delegate && typeof this.delegate.knobXDidChange === "function")
+ this.delegate.knobXDidChange(this);
+ },
+
+ _handleMouseup: function(event)
+ {
+ window.removeEventListener("mousemove", this, true);
+ window.removeEventListener("mouseup", this, true);
+
+ if (this._detaching) {
+ this.element.addEventListener("transitionend", this);
+ this.element.classList.add(WebInspector.GradientSliderKnob.FadeOutClassName);
+ this.selected = false;
+ } else if (!this._moved)
+ this.selected = !this.selected;
+ },
+
+ _handleTransitionEnd: function(event)
+ {
+ this.element.removeEventListener("transitionend", this);
+ this.element.classList.remove(WebInspector.GradientSliderKnob.FadeOutClassName);
+ this.element.remove();
+ },
+
+ _updateTransform: function()
+ {
+ this.element.style.webkitTransform = "translate3d(" + this._x + "px, " + this._y + "px, 0)";
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathComponentcssfromrev164541trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.hierarchical-path-component {
+ display: -webkit-flex;
+ position: relative;
+ height: 20px;
+ min-width: 32px;
+}
+
+.hierarchical-path-component.show-selector-arrows {
+ min-width: 44px;
+}
+
+.hierarchical-path-component.collapsed {
+ min-width: 24px;
+}
+
+.hierarchical-path-component.collapsed > .icon {
+ display: none;
+}
+
+.hierarchical-path-component.collapsed > .title {
+ margin-left: 3px;
+}
+
+.hierarchical-path-component.collapsed > select {
+ display: none;
+}
+
+.hierarchical-path-component > .icon {
+ vertical-align: top;
+ margin: 2px 3px 2px 4px;
+ width: 16px;
+ height: 16px;
+}
+
+.hierarchical-path-component > .selector-arrows {
+ vertical-align: top;
+ margin: 2px 3px 2px 4px;
+ width: 5px;
+ height: 16px;
+ opacity: 0.6;
+ content: url(../Images/UpDownArrows.svg);
+}
+
+.hierarchical-path-component > .title {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ vertical-align: top;
+
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 11px;
+ line-height: 20px;
+ height: 20px;
+
+ min-width: 0;
+ max-width: 400px;
+}
+
+.hierarchical-path-component > .title > .content {
+ min-width: 0;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.hierarchical-path-component > select {
+ opacity: 0;
+
+ /* Positioned so the text in the menu aligns with the text in .title. */
+ position: absolute;
+ top: -1px;
+ left: 10px;
+ right: 0;
+ bottom: 0;
+}
+
+.hierarchical-path:not(.always-show-last-path-component-separator) > .hierarchical-path-component:last-child > .separator {
+ visibility: hidden;
+}
+
+.hierarchical-path-component > .separator {
+ display: inline-block;
+ vertical-align: top;
+
+ background-image: url(../Images/HierarchicalNavigationItemChevron.svg);
+ background-repeat: no-repeat;
+ background-position-y: center;
+
+ opacity: 0.75;
+
+ width: 7px;
+ height: 20px;
+
+ margin-left: 2px;
+}
+
+.hierarchical-path-component.text-only {
+ padding-left: 5px;
+ padding-right: 1px;
+}
+
+.hierarchical-path-component.text-only > select {
+ /* Positions so the text in the menu aligns with the text in .title for text only path components. */
+ left: -8px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathComponentjsfromrev164541trunkSourceWebInspectorUIUserInterfaceHierarchicalPathComponentjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathComponent.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,339 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HierarchicalPathComponent = function(displayName, styleClassNames, representedObject, textOnly, showSelectorArrows)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(displayName);
+ console.assert(styleClassNames);
+
+ this._representedObject = representedObject || null;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.HierarchicalPathComponent.StyleClassName;
+
+ if (!(styleClassNames instanceof Array))
+ styleClassNames = [styleClassNames];
+
+ for (var i = 0; i < styleClassNames.length; ++i) {
+ if (!styleClassNames[i])
+ continue;
+ this._element.classList.add(styleClassNames[i]);
+ }
+
+ if (!textOnly) {
+ this._iconElement = document.createElement("img");
+ this._iconElement.className = WebInspector.HierarchicalPathComponent.IconElementStyleClassName;
+ this._element.appendChild(this._iconElement);
+ } else
+ this._element.classList.add(WebInspector.HierarchicalPathComponent.TextOnlyStyleClassName);
+
+ this._titleElement = document.createElement("div");
+ this._titleElement.className = WebInspector.HierarchicalPathComponent.TitleElementStyleClassName;
+ this._element.appendChild(this._titleElement);
+
+ this._titleContentElement = document.createElement("div");
+ this._titleContentElement.className = WebInspector.HierarchicalPathComponent.TitleContentElementStyleClassName;
+ this._titleElement.appendChild(this._titleContentElement);
+
+ this._separatorElement = document.createElement("div");
+ this._separatorElement.className = WebInspector.HierarchicalPathComponent.SeparatorElementStyleClassName;
+ this._element.appendChild(this._separatorElement);
+
+ this._selectElement = document.createElement("select");
+ this._selectElement.addEventListener("mouseover", this._selectElementMouseOver.bind(this));
+ this._selectElement.addEventListener("mouseout", this._selectElementMouseOut.bind(this));
+ this._selectElement.addEventListener("mousedown", this._selectElementMouseDown.bind(this));
+ this._selectElement.addEventListener("mouseup", this._selectElementMouseUp.bind(this));
+ this._selectElement.addEventListener("change", this._selectElementSelectionChanged.bind(this));
+ this._element.appendChild(this._selectElement);
+
+ this._previousSibling = null;
+ this._nextSibling = null;
+
+ this._truncatedDisplayNameLength = 0;
+
+ this.selectorArrows = showSelectorArrows;
+ this.displayName = displayName;
+};
+
+WebInspector.HierarchicalPathComponent.StyleClassName = "hierarchical-path-component";
+WebInspector.HierarchicalPathComponent.HiddenStyleClassName = "hidden";
+WebInspector.HierarchicalPathComponent.CollapsedStyleClassName = "collapsed";
+WebInspector.HierarchicalPathComponent.IconElementStyleClassName = "icon";
+WebInspector.HierarchicalPathComponent.TextOnlyStyleClassName = "text-only";
+WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName = "show-selector-arrows";
+WebInspector.HierarchicalPathComponent.TitleElementStyleClassName = "title";
+WebInspector.HierarchicalPathComponent.TitleContentElementStyleClassName = "content";
+WebInspector.HierarchicalPathComponent.SelectorArrowsElementStyleClassName = "selector-arrows";
+WebInspector.HierarchicalPathComponent.SeparatorElementStyleClassName = "separator";
+
+WebInspector.HierarchicalPathComponent.MinimumWidth = 32;
+WebInspector.HierarchicalPathComponent.MinimumWidthCollapsed = 24;
+WebInspector.HierarchicalPathComponent.MinimumWidthForOneCharacterTruncatedTitle = 54;
+WebInspector.HierarchicalPathComponent.SelectorArrowsWidth = 12;
+
+WebInspector.HierarchicalPathComponent.Event = {
+ SiblingWasSelected: "hierarchical-path-component-sibling-was-selected",
+ Clicked: "hierarchical-path-component-clicked"
+};
+
+WebInspector.HierarchicalPathComponent.prototype = {
+ constructor: WebInspector.HierarchicalPathComponent,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get representedObject()
+ {
+ return this._representedObject;
+ },
+
+ get displayName()
+ {
+ return this._displayName;
+ },
+
+ set displayName(newDisplayName)
+ {
+ console.assert(newDisplayName);
+ if (newDisplayName === this._displayName)
+ return;
+
+ this._displayName = newDisplayName;
+
+ this._updateElementTitleAndText();
+ },
+
+ get truncatedDisplayNameLength()
+ {
+ return this._truncatedDisplayNameLength;
+ },
+
+ set truncatedDisplayNameLength(truncatedDisplayNameLength)
+ {
+ truncatedDisplayNameLength = truncatedDisplayNameLength || 0;
+
+ if (truncatedDisplayNameLength === this._truncatedDisplayNameLength)
+ return;
+
+ this._truncatedDisplayNameLength = truncatedDisplayNameLength;
+
+ this._updateElementTitleAndText();
+ },
+
+ get minimumWidth()
+ {
+ if (this.collapsed)
+ return WebInspector.HierarchicalPathComponent.MinimumWidthCollapsed;
+ if (this.selectorArrows)
+ return WebInspector.HierarchicalPathComponent.MinimumWidth + WebInspector.HierarchicalPathComponent.SelectorArrowsWidth;
+ return WebInspector.HierarchicalPathComponent.MinimumWidth;
+ },
+
+ get forcedWidth()
+ {
+ var maxWidth = this._element.style.getProperty("width");
+ if (typeof maxWidth === "string")
+ return parseInt(maxWidth);
+ return null;
+ },
+
+ set forcedWidth(width)
+ {
+ if (typeof width === "number") {
+ var minimumWidthForOneCharacterTruncatedTitle = WebInspector.HierarchicalPathComponent.MinimumWidthForOneCharacterTruncatedTitle;
+ if (this.selectorArrows)
+ minimumWidthForOneCharacterTruncatedTitle += WebInspector.HierarchicalPathComponent.SelectorArrowsWidth;
+
+ // If the width is less than the minimum width required to show a single character and ellipsis, then
+ // just collapse down to the bare minimum to show only the icon.
+ if (width < minimumWidthForOneCharacterTruncatedTitle)
+ width = 0;
+
+ // Ensure the width does not go less than 1px. If the width is 0 the layout gets funky. There is a min-width
+ // in the CSS too, so as long the width is less than min-width we get the desired effect of only showing the icon.
+ this._element.style.setProperty("width", Math.max(1, width) + "px");
+ } else
+ this._element.style.removeProperty("width");
+ },
+
+ get hidden()
+ {
+ return this._element.classList.contains(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
+ },
+
+ set hidden(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.HierarchicalPathComponent.HiddenStyleClassName);
+ },
+
+ get collapsed()
+ {
+ return this._element.classList.contains(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
+ },
+
+ set collapsed(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.HierarchicalPathComponent.CollapsedStyleClassName);
+ },
+
+ get selectorArrows()
+ {
+ return this._element.classList.contains(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
+ },
+
+ set selectorArrows(flag)
+ {
+ if (flag) {
+ this._selectorArrowsElement = document.createElement("img");
+ this._selectorArrowsElement.className = WebInspector.HierarchicalPathComponent.SelectorArrowsElementStyleClassName;
+ this._element.insertBefore(this._selectorArrowsElement, this._separatorElement);
+
+ this._element.classList.add(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
+ } else {
+ if (this._selectorArrowsElement) {
+ this._selectorArrowsElement.remove();
+ delete this._selectorArrowsElement;
+ }
+
+ this._element.classList.remove(WebInspector.HierarchicalPathComponent.ShowSelectorArrowsStyleClassName);
+ }
+ },
+
+ get previousSibling()
+ {
+ return this._previousSibling;
+ },
+
+ set previousSibling(newSlibling)
+ {
+ this._previousSibling = newSlibling || null;
+ },
+
+ get nextSibling()
+ {
+ return this._nextSibling;
+ },
+
+ set nextSibling(newSlibling)
+ {
+ this._nextSibling = newSlibling || null;
+ },
+
+ // Private
+
+ _updateElementTitleAndText: function()
+ {
+ var truncatedDisplayName = this._displayName;
+ if (this._truncatedDisplayNameLength && truncatedDisplayName.length > this._truncatedDisplayNameLength)
+ truncatedDisplayName = truncatedDisplayName.substring(0, this._truncatedDisplayNameLength) + "\u2026";
+
+ this._element.title = this._displayName;
+ this._titleContentElement.textContent = truncatedDisplayName;
+ },
+
+ _updateSelectElement: function()
+ {
+ this._selectElement.removeChildren();
+
+ function createOption(component)
+ {
+ var optionElement = document.createElement("option");
+ const maxPopupMenuLength = 130; // <rdar://problem/13445374> <select> with very long option has clipped text and popup menu is still very wide
+ optionElement.textContent = component.displayName.length <= maxPopupMenuLength ? component.displayName : component.displayName.substring(0, maxPopupMenuLength) + "\u2026";
+ optionElement._pathComponent = component;
+ return optionElement;
+ }
+
+ var previousSiblingCount = 0;
+ var sibling = this.previousSibling;
+ while (sibling) {
+ this._selectElement.insertBefore(createOption(sibling), this._selectElement.firstChild);
+ sibling = sibling.previousSibling;
+ ++previousSiblingCount;
+ }
+
+ this._selectElement.appendChild(createOption(this));
+
+ sibling = this.nextSibling;
+ while (sibling) {
+ this._selectElement.appendChild(createOption(sibling));
+ sibling = sibling.nextSibling;
+ }
+
+ // Since the change event only fires when the selection actually changes we are
+ // stuck with either not showing the current selection in the menu or accepting that
+ // the user can't select what is already selected again. Selecting the same item
+ // again can be desired (for selecting the main resource while looking at an image).
+ // So if there is only one option, don't make it be selected by default. This lets
+ // you select the top level item which usually has no siblings to go back.
+ // FIXME: Make this work when there are multiple options with a selectedIndex.
+ if (this._selectElement.options.length === 1)
+ this._selectElement.selectedIndex = -1;
+ else
+ this._selectElement.selectedIndex = previousSiblingCount;
+ },
+
+ _selectElementMouseOver: function(event)
+ {
+ if (typeof this.mouseOver === "function")
+ this.mouseOver();
+ },
+
+ _selectElementMouseOut: function(event)
+ {
+ if (typeof this.mouseOut === "function")
+ this.mouseOut();
+ },
+
+ _selectElementMouseDown: function(event)
+ {
+ this._updateSelectElement();
+ },
+
+ _selectElementMouseUp: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.Clicked);
+ },
+
+ _selectElementSelectionChanged: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, {pathComponent: this._selectElement[this._selectElement.selectedIndex]._pathComponent});
+ }
+};
+
+WebInspector.HierarchicalPathComponent.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHierarchicalPathNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceHierarchicalPathNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/HierarchicalPathNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,237 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HierarchicalPathNavigationItem = function(identifier, components) {
+ WebInspector.NavigationItem.call(this, identifier);
+
+ this.components = components;
+};
+
+WebInspector.HierarchicalPathNavigationItem.StyleClassName = "hierarchical-path";
+WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName = "always-show-last-path-component-separator";
+
+WebInspector.HierarchicalPathNavigationItem.Event = {
+ PathComponentWasSelected: "hierarchical-path-navigation-item-path-component-was-selected"
+};
+
+WebInspector.HierarchicalPathNavigationItem.prototype = {
+ constructor: WebInspector.HierarchicalPathNavigationItem,
+
+ // Public
+
+ get components()
+ {
+ return this._components;
+ },
+
+ set components(newComponents)
+ {
+ if (!newComponents)
+ newComponents = [];
+
+ for (var i = 0; this._components && i < this._components.length; ++i)
+ this._components[i].removeEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._siblingPathComponentWasSelected, this);
+
+ // Make a shallow copy of the newComponents array using slice.
+ this._components = newComponents.slice(0);
+
+ for (var i = 0; i < this._components.length; ++i)
+ this._components[i].addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._siblingPathComponentWasSelected, this);
+
+ this.element.removeChildren();
+ delete this._collapsedComponent;
+
+ for (var i = 0; i < newComponents.length; ++i)
+ this.element.appendChild(newComponents[i].element);
+
+ // Update layout for the so other items can adjust to the extra space (or lack thereof) too.
+ if (this.parentNavigationBar)
+ this.parentNavigationBar.updateLayoutSoon();
+ },
+
+ get lastComponent()
+ {
+ return this._components.lastValue || null;
+ },
+
+ get alwaysShowLastPathComponentSeparator()
+ {
+ return this.element.classList.contains(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
+ },
+
+ set alwaysShowLastPathComponentSeparator(flag)
+ {
+ if (flag)
+ this.element.classList.add(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
+ else
+ this.element.classList.remove(WebInspector.HierarchicalPathNavigationItem.AlwaysShowLastPathComponentSeparatorStyleClassName);
+ },
+
+ updateLayout: function(expandOnly)
+ {
+ var navigationBar = this.parentNavigationBar;
+ if (!navigationBar)
+ return;
+
+ if (this._collapsedComponent) {
+ this.element.removeChild(this._collapsedComponent.element);
+ delete this._collapsedComponent;
+ }
+
+ // Expand our components to full width to test if the items can fit at full width.
+ for (var i = 0; i < this._components.length; ++i) {
+ this._components[i].hidden = false;
+ this._components[i].forcedWidth = null;
+ }
+
+ if (expandOnly)
+ return;
+
+ if (navigationBar.sizesToFit)
+ return;
+
+ // Iterate over all the other navigation items in the bar and calculate their width.
+ var totalOtherItemsWidth = 0;
+ for (var i = 0; i < navigationBar.navigationItems.length; ++i) {
+ // Skip ourself.
+ if (navigationBar.navigationItems[i] === this)
+ continue;
+
+ // Skip flexible space items since they can take up no space at the minimum width.
+ if (navigationBar.navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
+ continue;
+
+ totalOtherItemsWidth += navigationBar.navigationItems[i].element.offsetWidth;
+ }
+
+ // Calculate the width for all the components.
+ var thisItemWidth = 0;
+ var componentWidths = [];
+ for (var i = 0; i < this._components.length; ++i) {
+ var componentWidth = this._components[i].element.offsetWidth;
+ componentWidths.push(componentWidth);
+ thisItemWidth += componentWidth;
+ }
+
+ // If all our components fit with the other navigation items in the width of the bar,
+ // then we don't need to collapse any components.
+ var barWidth = navigationBar.element.offsetWidth;
+ if (totalOtherItemsWidth + thisItemWidth <= barWidth)
+ return;
+
+ // Calculate the width we need to remove from our components, then iterate over them
+ // and force their width to be smaller.
+ var widthToRemove = totalOtherItemsWidth + thisItemWidth - barWidth;
+ for (var i = 0; i < this._components.length; ++i) {
+ var componentWidth = componentWidths[i];
+
+ // Try to take the whole width we need to remove from each component.
+ var forcedWidth = componentWidth - widthToRemove;
+ this._components[i].forcedWidth = forcedWidth;
+
+ // Since components have a minimum width, we need to see how much was actually
+ // removed and subtract that from what remans to be removed.
+ componentWidths[i] = Math.max(this._components[i].minimumWidth, forcedWidth);
+ widthToRemove -= (componentWidth - componentWidths[i]);
+
+ // If there is nothing else to remove, then we can stop.
+ if (widthToRemove <= 0)
+ break;
+ }
+
+ // If there is nothing else to remove, then we can stop.
+ if (widthToRemove <= 0)
+ return;
+
+ // If there are 3 or fewer components, then we can stop. Collapsing the middle of 3 components
+ // does not save more than a few pixels over just the icon, so it isn't worth it unless there
+ // are 4 or more components.
+ if (this._components.length <= 3)
+ return;
+
+ // We want to collapse the middle components, so find the nearest middle index.
+ var middle = this._components.length >> 1;
+ var distance = -1;
+ var i = middle;
+
+ // Create a component that will represent the hidden components with a ellipse as the display name.
+ this._collapsedComponent = new WebInspector.HierarchicalPathComponent("\u2026", []);
+ this._collapsedComponent.collapsed = true;
+
+ // Insert it in the middle, it doesn't matter exactly where since the elements around it will be hidden soon.
+ this.element.insertBefore(this._collapsedComponent.element, this._components[middle].element);
+
+ // Add the width of the collapsed component to the width we need to remove.
+ widthToRemove += this._collapsedComponent.minimumWidth;
+
+ var hiddenDisplayNames = [];
+
+ // Loop through the components starting at the middle and fanning out in each direction.
+ while (i >= 0 && i <= this._components.length - 1) {
+ // Only hide components in the middle and never the ends.
+ if (i > 0 && i < this._components.length - 1) {
+ var component = this._components[i];
+ component.hidden = true;
+
+ // Remember the displayName so it can be put in the tool tip of the collapsed component.
+ if (distance > 0)
+ hiddenDisplayNames.unshift(component.displayName);
+ else
+ hiddenDisplayNames.push(component.displayName);
+
+ // Fully subtract the hidden component's width.
+ widthToRemove -= componentWidths[i];
+
+ // If there is nothing else to remove, then we can stop.
+ if (widthToRemove <= 0)
+ break;
+ }
+
+ // Calculate the next index.
+ i = middle + distance;
+
+ // Increment the distance when it is in the positive direction.
+ if (distance > 0)
+ ++distance;
+
+ // Flip the direction of the distance.
+ distance *= -1;
+ }
+
+ // Set the tool tip of the collapsed component.
+ this._collapsedComponent.element.title = hiddenDisplayNames.join("\n");
+ },
+
+ // Private
+
+ _additionalClassNames: [WebInspector.HierarchicalPathNavigationItem.StyleClassName],
+
+ _siblingPathComponentWasSelected: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.HierarchicalPathNavigationItem.Event.PathComponentWasSelected, event.data);
+ }
+};
+
+WebInspector.HierarchicalPathNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHoverMenucssfromrev164541trunkSourceWebInspectorUIUserInterfaceHoverMenucss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/HoverMenu.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.hover-menu {
+ position: absolute;
+
+ -webkit-transform: translate(-1px, -1px);
+
+ pointer-events: none;
+ opacity: 0;
+
+ transition: opacity 350ms;
+}
+
+.hover-menu.visible {
+ opacity: 1;
+}
+
+.hover-menu > svg {
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+.hover-menu > svg > path,
+.hover-menu > svg > rect {
+ stroke: rgba(0, 0, 0, 0.22);
+ stroke-width: 2px;
+ fill: none;
+}
+
+.hover-menu > img {
+ position: absolute;
+
+ left: 0;
+ top: 0;
+ width: 15px;
+ height: 13px;
+
+ content: -webkit-image-set(url(../Images/HoverMenuButton.png) 1x, url(../Images/HoverMenuButton@2x.png) 2x);
+}
+
+.hover-menu.visible > img {
+ pointer-events: all;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHoverMenujsfromrev164541trunkSourceWebInspectorUIUserInterfaceHoverMenujs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/HoverMenu.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HoverMenu.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,276 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.HoverMenu = function(delegate)
+{
+ WebInspector.Object.call(this);
+
+ this.delegate = delegate;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.HoverMenu.StyleClassName;
+ this._element.addEventListener("transitionend", this, true);
+
+ this._outlineElement = this._element.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
+
+ this._button = this._element.appendChild(document.createElement("img"));
+ this._button.addEventListener("click", this);
+}
+
+WebInspector.HoverMenu.StyleClassName = "hover-menu";
+WebInspector.HoverMenu.VisibleClassName = "visible";
+
+WebInspector.HoverMenu.prototype = {
+ constructor: WebInspector.HoverMenu,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ present: function(rects)
+ {
+ this._outlineElement.textContent = "";
+
+ document.body.appendChild(this._element);
+ this._drawOutline(rects);
+ this._element.classList.add(WebInspector.HoverMenu.VisibleClassName);
+
+ window.addEventListener("scroll", this, true);
+ },
+
+ dismiss: function(discrete)
+ {
+ if (this._element.parentNode !== document.body)
+ return;
+
+ if (discrete)
+ this._element.remove();
+
+ this._element.classList.remove(WebInspector.HoverMenu.VisibleClassName);
+
+ window.removeEventListener("scroll", this, true);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "scroll":
+ if (!this._element.contains(event.target))
+ this.dismiss(true);
+ break;
+ case "click":
+ this._handleClickEvent(event);
+ break;
+ case "transitionend":
+ if (!this._element.classList.contains(WebInspector.HoverMenu.VisibleClassName))
+ this._element.remove();
+ break;
+ }
+ },
+
+ // Private
+
+ _handleClickEvent: function(event)
+ {
+ if (this.delegate && typeof this.delegate.hoverMenuButtonWasPressed === "function")
+ this.delegate.hoverMenuButtonWasPressed(this);
+ },
+
+ _drawOutline: function(rects)
+ {
+ var buttonWidth = this._button.width;
+ var buttonHeight = this._button.height;
+
+ // Add room for the button on the last line.
+ var lastRect = rects.pop();
+ lastRect.size.width += buttonWidth;
+ rects.push(lastRect);
+
+ if (rects.length === 1)
+ this._drawSingleLine(rects[0]);
+ else if (rects.length === 2 && rects[0].minX() >= rects[1].maxX())
+ this._drawTwoNonOverlappingLines(rects);
+ else
+ this._drawOverlappingLines(rects);
+
+ var bounds = WebInspector.Rect.unionOfRects(rects).pad(3); // padding + 1/2 stroke-width
+
+ var style = this._element.style;
+ style.left = bounds.minX() + "px";
+ style.top = bounds.minY() + "px";
+ style.width = bounds.size.width + "px";
+ style.height = bounds.size.height + "px";
+
+ this._outlineElement.style.width = bounds.size.width + "px";
+ this._outlineElement.style.height = bounds.size.height + "px";
+
+ this._button.style.left = (lastRect.maxX() - bounds.minX() - buttonWidth) + "px";
+ this._button.style.top = (lastRect.maxY() - bounds.minY() - buttonHeight) + "px";
+ },
+
+ _addRect: function(rect)
+ {
+ const r = 4;
+
+ var svgRect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+ svgRect.setAttribute("x", 1);
+ svgRect.setAttribute("y", 1);
+ svgRect.setAttribute("width", rect.size.width);
+ svgRect.setAttribute("height", rect.size.height);
+ svgRect.setAttribute("rx", r);
+ svgRect.setAttribute("ry", r);
+ return this._outlineElement.appendChild(svgRect);
+ },
+
+ _addPath: function(commands, tx, ty)
+ {
+ var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
+ path.setAttribute("d", commands.join(" "));
+ path.setAttribute("transform", "translate(" + (tx + 1) + "," + (ty + 1) + ")");
+ return this._outlineElement.appendChild(path);
+ },
+
+ _drawSingleLine: function(rect)
+ {
+ this._addRect(rect.pad(2));
+ },
+
+ _drawTwoNonOverlappingLines: function(rects)
+ {
+ const r = 4;
+
+ var firstRect = rects[0].pad(2);
+ var secondRect = rects[1].pad(2);
+
+ var tx = -secondRect.minX();
+ var ty = -firstRect.minY();
+
+ var rect = firstRect;
+ this._addPath([
+ "M", rect.maxX(), rect.minY(),
+ "H", rect.minX() + r,
+ "q", -r, 0, -r, r,
+ "V", rect.maxY() - r,
+ "q", 0, r, r, r,
+ "H", rect.maxX()
+ ], tx, ty);
+
+ rect = secondRect;
+ this._addPath([
+ "M", rect.minX(), rect.minY(),
+ "H", rect.maxX() - r,
+ "q", r, 0, r, r,
+ "V", rect.maxY() - r,
+ "q", 0, r, -r, r,
+ "H", rect.minX()
+ ], tx, ty);
+ },
+
+ _drawOverlappingLines: function(rects)
+ {
+ const PADDING = 2;
+ const r = 4;
+
+ var minX = Number.MAX_VALUE;
+ var maxX = -Number.MAX_VALUE;
+ for (var rect of rects) {
+ var minX = Math.min(rect.minX(), minX);
+ var maxX = Math.max(rect.maxX(), maxX);
+ }
+
+ minX -= PADDING;
+ maxX += PADDING;
+
+ var minY = rects[0].minY() - PADDING;
+ var maxY = rects.lastValue.maxY() + PADDING;
+ var firstLineMinX = rects[0].minX() - PADDING;
+ var lastLineMaxX = rects.lastValue.maxX() + PADDING;
+
+ if (firstLineMinX === minX && lastLineMaxX === maxX)
+ return this._addRect(new WebInspector.Rect(minX, minY, maxX - minX, maxY - minY));
+
+ var lastLineMinY = rects.lastValue.minY() + PADDING;
+ if (rects[0].minX() === minX + PADDING)
+ return this._addPath([
+ "M", minX + r, minY,
+ "H", maxX - r,
+ "q", r, 0, r, r,
+ "V", lastLineMinY - r,
+ "q", 0, r, -r, r,
+ "H", lastLineMaxX + r,
+ "q", -r, 0, -r, r,
+ "V", maxY - r,
+ "q", 0, r, -r, r,
+ "H", minX + r,
+ "q", -r, 0, -r, -r,
+ "V", minY + r,
+ "q", 0, -r, r, -r
+ ], -minX, -minY);
+
+ var firstLineMaxY = rects[0].maxY() - PADDING;
+ if (rects.lastValue.maxX() === maxX - PADDING)
+ return this._addPath([
+ "M", firstLineMinX + r, minY,
+ "H", maxX - r,
+ "q", r, 0, r, r,
+ "V", maxY - r,
+ "q", 0, r, -r, r,
+ "H", minX + r,
+ "q", -r, 0, -r, -r,
+ "V", firstLineMaxY + r,
+ "q", 0, -r, r, -r,
+ "H", firstLineMinX - r,
+ "q", r, 0, r, -r,
+ "V", minY + r,
+ "q", 0, -r, r, -r
+ ], -minX, -minY);
+
+ return this._addPath([
+ "M", firstLineMinX + r, minY,
+ "H", maxX - r,
+ "q", r, 0, r, r,
+ "V", lastLineMinY - r,
+ "q", 0, r, -r, r,
+ "H", lastLineMaxX + r,
+ "q", -r, 0, -r, r,
+ "V", maxY - r,
+ "q", 0, r, -r, r,
+ "H", minX + r,
+ "q", -r, 0, -r, -r,
+ "V", firstLineMaxY + r,
+ "q", 0, -r, r, -r,
+ "H", firstLineMinX - r,
+ "q", r, 0, r, -r,
+ "V", minY + r,
+ "q", 0, -r, r, -r
+ ], -minX, -minY);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsImageResourceContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.resource.image {
+ background-color: rgb(231, 231, 231);
+
+ overflow-x: hidden;
+ overflow-y: auto;
+
+ display: -webkit-flex;
+
+ -webkit-justify-content: center;
+}
+
+.content-view.resource.image img {
+ min-width: 0;
+ max-width: 100%;
+
+ -webkit-user-select: text;
+ -webkit-user-drag: auto;
+
+ /* A border is used instead of padding or margin so when there is overflow
+ there will be space on all sides. */
+ border: 15px solid transparent;
+
+ margin: auto 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsImageResourceContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceImageResourceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ImageResourceContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ImageResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ImageResourceContentView = function(resource)
+{
+ WebInspector.ResourceContentView.call(this, resource, WebInspector.ImageResourceContentView.StyleClassName);
+
+ this._imageElement = null;
+};
+
+WebInspector.ImageResourceContentView.StyleClassName = "image";
+
+WebInspector.ImageResourceContentView.prototype = {
+ constructor: WebInspector.ImageResourceContentView,
+
+ // Public
+
+ get imageElement()
+ {
+ return this._imageElement;
+ },
+
+ contentAvailable: function(content, base64Encoded)
+ {
+ this.element.removeChildren();
+
+ this._imageElement = document.createElement("img");
+ this._imageElement.src = this.resource.contentURL;
+
+ this.element.appendChild(this._imageElement);
+ }
+};
+
+WebInspector.ImageResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndeterminateProgressSpinnercssfromrev164541trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+/* These keyframes try to reproduce the 12 discrete steps seen in a standard system progress indicator. */
+@-webkit-keyframes discrete-spinner {
+ 0% {
+ background-image: url(../Images/IndeterminateProgressSpinner1.svg);
+ }
+
+ 8.333% {
+ background-image: url(../Images/IndeterminateProgressSpinner2.svg);
+ }
+
+ 16.666% {
+ background-image: url(../Images/IndeterminateProgressSpinner3.svg);
+ }
+
+ 25.000% {
+ background-image: url(../Images/IndeterminateProgressSpinner4.svg);
+ }
+
+ 33.333% {
+ background-image: url(../Images/IndeterminateProgressSpinner5.svg);
+ }
+
+ 41.666% {
+ background-image: url(../Images/IndeterminateProgressSpinner6.svg);
+ }
+
+ 50.000% {
+ background-image: url(../Images/IndeterminateProgressSpinner7.svg);
+ }
+
+ 58.333% {
+ background-image: url(../Images/IndeterminateProgressSpinner8.svg);
+ }
+
+ 66.666% {
+ background-image: url(../Images/IndeterminateProgressSpinner9.svg);
+ }
+
+ 75.000% {
+ background-image: url(../Images/IndeterminateProgressSpinner10.svg);
+ }
+
+ 83.333% {
+ background-image: url(../Images/IndeterminateProgressSpinner11.svg);
+ }
+
+ 91.666% {
+ background-image: url(../Images/IndeterminateProgressSpinner12.svg);
+ }
+
+ 100% {
+ background-image: url(../Images/IndeterminateProgressSpinner1.svg);
+ }
+}
+
+.indeterminate-progress-spinner {
+ background-image: url(../Images/IndeterminateProgressSpinner1.svg);
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+
+ width: 16px;
+ height: 16px;
+
+ -webkit-animation-name: discrete-spinner;
+ -webkit-animation-duration: 1s;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-animation-timing-function: step-start;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndeterminateProgressSpinnerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndeterminateProgressSpinnerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndeterminateProgressSpinner.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinner.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndeterminateProgressSpinner = function()
+{
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.IndeterminateProgressSpinner.StyleClassName;
+}
+
+WebInspector.IndeterminateProgressSpinner.StyleClassName = "indeterminate-progress-spinner";
+
+WebInspector.IndeterminateProgressSpinner.prototype = {
+ constructor: WebInspector.IndeterminateProgressSpinner,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ }
+}
+
+WebInspector.IndeterminateProgressSpinner.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseEntryDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseEntryDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseEntryDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseEntryDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseEntryDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseEntryDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseEntryDataGridNode = function(entry)
+{
+ WebInspector.DataGridNode.call(this, entry);
+
+ this._entry = entry;
+};
+
+WebInspector.IndexedDatabaseEntryDataGridNode.prototype = {
+ constructor: WebInspector.IndexedDatabaseEntryDataGridNode,
+ __proto__: WebInspector.DataGridNode.prototype,
+
+ // Public
+
+ get entry()
+ {
+ return this._entry;
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ var value = this._entry[columnIdentifier];
+
+ if (value instanceof WebInspector.RemoteObject) {
+ switch (value.type) {
+ case "object":
+ case "array":
+ var propertiesSection = new WebInspector.ObjectPropertiesSection(value, value.description);
+ propertiesSection.editable = false;
+ return propertiesSection.element;
+
+ case "string":
+ return "\"" + value.description + "\"";
+
+ default:
+ return value.description;
+ }
+ }
+
+ return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseHostTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseHostTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseHostTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseHostTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseHostTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseHostTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseHostTreeElement = function(host)
+{
+ WebInspector.StorageTreeElement.call(this, WebInspector.FolderTreeElement.FolderIconStyleClassName, WebInspector.displayNameForHost(host), null);
+
+ this._host = host;
+
+ this.hasChildren = true;
+};
+
+WebInspector.IndexedDatabaseHostTreeElement.prototype = {
+ constructor: WebInspector.IndexedDatabaseHostTreeElement,
+ __proto__: WebInspector.StorageTreeElement.prototype,
+
+ // Public
+
+ get name()
+ {
+ return WebInspector.displayNameForHost(this._host);
+ },
+
+ get categoryName()
+ {
+ return WebInspector.UIString("Indexed Databases");
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.indexed-database-object-store > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
+
+.content-view.indexed-database-object-store > .data-grid td .section .header {
+ padding: 0 0 0 18px;
+ min-height: initial;
+ color: inherit;
+}
+
+.content-view.indexed-database-object-store > .data-grid td .section .header::before {
+ top: 2px;
+}
+
+.content-view.indexed-database-object-store > .data-grid td .section .header .title {
+ line-height: initial;
+}
+
+.content-view.indexed-database-object-store > .data-grid table.data {
+ background-image: none;
+}
+
+.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(even) {
+ background-color: white;
+}
+
+.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(odd) {
+ background-color: rgb(243, 246, 250);
+}
+
+.content-view.indexed-database-object-store > .data-grid table.data tr.filler {
+ /* FIXME: This should show an alternating stripe, but I couldn't make it work. */
+ background-color: white;
+}
+
+.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .section .header::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
+}
+
+.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .section.expanded .header::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
+}
+
+.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li.parent::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-selected);
+}
+
+.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li.parent.expanded::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-selected);
+}
+
+.content-view.indexed-database-object-store > .data-grid:focus tr.selected td .properties-tree li * {
+ color: inherit;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,152 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreContentView = function(objectStoreOrIndex)
+{
+ WebInspector.ContentView.call(this, objectStoreOrIndex);
+
+ this.element.classList.add(WebInspector.IndexedDatabaseObjectStoreContentView.StyleClassName);
+
+ if (objectStoreOrIndex instanceof WebInspector.IndexedDatabaseObjectStore) {
+ this._objectStore = objectStoreOrIndex;
+ this._objectStoreIndex = null;
+ } else if (objectStoreOrIndex instanceof WebInspector.IndexedDatabaseObjectStoreIndex) {
+ this._objectStore = objectStoreOrIndex.parentObjectStore;
+ this._objectStoreIndex = objectStoreOrIndex;
+ }
+
+ function displayKeyPath(keyPath)
+ {
+ if (!keyPath)
+ return "";
+ if (keyPath instanceof Array)
+ return keyPath.join(WebInspector.UIString(", "));
+ console.assert(keyPath instanceof String || typeof keyPath === "string");
+ return keyPath;
+ }
+
+ var displayPrimaryKeyPath = displayKeyPath(this._objectStore.keyPath);
+
+ var columnInfo = {
+ primaryKey: {title: displayPrimaryKeyPath ? WebInspector.UIString("Primary Key \u2014 %s").format(displayPrimaryKeyPath) : WebInspector.UIString("Primary Key")},
+ key: {},
+ value: {title: WebInspector.UIString("Value")}
+ };
+
+ if (this._objectStoreIndex) {
+ // When there is an index, show the key path in the Key column.
+ var displayIndexKeyPath = displayKeyPath(this._objectStoreIndex.keyPath);
+ columnInfo.key.title = WebInspector.UIString("Index Key \u2014 %s").format(displayIndexKeyPath);
+ } else {
+ // Only need to show Key for indexes -- it is the same as Primary Key
+ // when there is no index being used.
+ delete columnInfo.key;
+ }
+
+ this._dataGrid = new WebInspector.DataGrid(columnInfo);
+ this.element.appendChild(this._dataGrid.element);
+
+ this._dataGrid.scrollContainer.addEventListener("scroll", this._dataGridScrolled.bind(this));
+
+ this._entries = [];
+
+ this._fetchMoreData();
+};
+
+WebInspector.IndexedDatabaseObjectStoreContentView.StyleClassName = "indexed-database-object-store";
+
+WebInspector.IndexedDatabaseObjectStoreContentView.prototype = {
+ constructor: WebInspector.IndexedDatabaseObjectStoreContentView,
+ __proto__: WebInspector.ContentView.prototype,
+
+ // Public
+
+ closed: function()
+ {
+ this._reset();
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.IndexedDatabaseObjectStore;
+ cookie.securityOrigin = this._objectStore.parentDatabase.securityOrigin;
+ cookie.databaseName = this._objectStore.parentDatabase.name;
+ cookie.objectStoreName = this._objectStore.name;
+ cookie.objectStoreIndexName = this._objectStoreIndex && this._objectStoreIndex.name;
+ },
+
+ updateLayout: function()
+ {
+ this._dataGrid.updateLayout();
+ },
+
+ // Private
+
+ _reset: function()
+ {
+ for (var entry of this._entries) {
+ entry.primaryKey.release();
+ entry.key.release();
+ entry.value.release();
+ }
+
+ this._entries = [];
+ this._dataGrid.removeChildren();
+ },
+
+ _dataGridScrolled: function()
+ {
+ if (!this._moreEntriesAvailable || !this._dataGrid.isScrolledToLastRow())
+ return;
+
+ this._fetchMoreData();
+ },
+
+ _fetchMoreData: function()
+ {
+ if (this._fetchingMoreData)
+ return;
+
+ function processEntries(entries, moreAvailable)
+ {
+ this._entries = this._entries.concat(entries);
+ this._moreEntriesAvailable = moreAvailable;
+
+ for (var entry of entries) {
+ var dataGridNode = new WebInspector.IndexedDatabaseEntryDataGridNode(entry);
+ this._dataGrid.appendChild(dataGridNode);
+ }
+
+ delete this._fetchingMoreData;
+
+ if (moreAvailable && this._dataGrid.isScrolledToLastRow())
+ this._fetchMoreData();
+ }
+
+ this._fetchingMoreData = true;
+
+ WebInspector.storageManager.requestIndexedDatabaseData(this._objectStore, this._objectStoreIndex, this._entries.length, 25, processEntries.bind(this));
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreIndexTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreIndexTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreIndexTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreIndexTreeElement = function(objectStoreIndex)
+{
+ console.assert(objectStoreIndex instanceof WebInspector.IndexedDatabaseObjectStoreIndex);
+
+ this._objectStoreIndex = objectStoreIndex;
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName, objectStoreIndex.name, null, objectStoreIndex, false);
+
+ this.small = true;
+};
+
+WebInspector.IndexedDatabaseObjectStoreIndexTreeElement.IconStyleClassName = "database-table-icon";
+
+WebInspector.IndexedDatabaseObjectStoreIndexTreeElement.prototype = {
+ constructor: WebInspector.IndexedDatabaseObjectStoreIndexTreeElement,
+ __proto__: WebInspector.GeneralTreeElement.prototype,
+
+ // Public
+
+ get objectStoreIndex()
+ {
+ return this._objectStoreIndex;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseObjectStoreTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseObjectStoreTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseObjectStoreTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseObjectStoreTreeElement = function(objectStore)
+{
+ console.assert(objectStore instanceof WebInspector.IndexedDatabaseObjectStore);
+
+ this._objectStore = objectStore;
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName, objectStore.name, null, objectStore, !!this._objectStore.indexes.length);
+
+ this.small = true;
+};
+
+WebInspector.IndexedDatabaseObjectStoreTreeElement.IconStyleClassName = "database-table-icon";
+
+WebInspector.IndexedDatabaseObjectStoreTreeElement.prototype = {
+ constructor: WebInspector.IndexedDatabaseObjectStoreTreeElement,
+ __proto__: WebInspector.GeneralTreeElement.prototype,
+
+ // Public
+
+ get objectStore()
+ {
+ return this._objectStore;
+ },
+
+ // Overrides from TreeElement (Protected)
+
+ oncollapse: function()
+ {
+ this.shouldRefreshChildren = true;
+ },
+
+ onpopulate: function()
+ {
+ if (this.children.length && !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+
+ for (var objectStoreIndex of this._objectStore.indexes)
+ this.appendChild(new WebInspector.IndexedDatabaseObjectStoreIndexTreeElement(objectStoreIndex));
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsIndexedDatabaseTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceIndexedDatabaseTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/IndexedDatabaseTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.IndexedDatabaseTreeElement = function(indexedDatabase)
+{
+ console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
+
+ this._indexedDatabase = indexedDatabase;
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.IndexedDatabaseTreeElement.IconStyleClassName, indexedDatabase.name, null, indexedDatabase, !!this._indexedDatabase.objectStores.length);
+
+ this.small = true;
+};
+
+WebInspector.IndexedDatabaseTreeElement.IconStyleClassName = "database-icon";
+
+WebInspector.IndexedDatabaseTreeElement.prototype = {
+ constructor: WebInspector.IndexedDatabaseTreeElement,
+
+ // Public
+
+ get indexedDatabase()
+ {
+ return this._indexedDatabase;
+ },
+
+ // Overrides from TreeElement (Protected)
+
+ oncollapse: function()
+ {
+ this.shouldRefreshChildren = true;
+ },
+
+ onpopulate: function()
+ {
+ if (this.children.length && !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+
+ for (var objectStore of this._indexedDatabase.objectStores)
+ this.appendChild(new WebInspector.IndexedDatabaseObjectStoreTreeElement(objectStore));
+ }
+};
+
+WebInspector.IndexedDatabaseTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeDataGrid = function() {
+ WebInspector.DataGrid.call(this, {
+ name: { title: WebInspector.UIString("Node"), sortable: false },
+ paintCount: { title: WebInspector.UIString("Paints"), sortable: true, aligned: "right", width: "50px" },
+ memory: { title: WebInspector.UIString("Memory"), sortable: true, sort: "descending", aligned: "right", width: "70px" }
+ });
+};
+
+WebInspector.LayerTreeDataGrid.prototype = {
+ constructor: WebInspector.LayerTreeDataGrid,
+
+ insertChild: function(child)
+ {
+ WebInspector.DataGrid.prototype.insertChild.call(this, child);
+
+ this._updateChildren();
+ },
+
+ removeChild: function(child)
+ {
+ WebInspector.DataGrid.prototype.removeChild.call(this, child);
+
+ this._updateChildren();
+ },
+
+ setChildren: function(children)
+ {
+ this._suspendLayout = true;
+
+ var removedChildren = this.children.filter(function(child) {
+ return !children.contains(child);
+ });
+
+ while (removedChildren.length)
+ this.removeChild(removedChildren.pop());
+
+ children.forEach(function(child) {
+ if (child.parent !== this)
+ this.appendChild(child);
+ }.bind(this));
+
+ this._suspendLayout = false;
+
+ this.children = children;
+ this._updateChildren();
+ },
+
+ _updateChildren: function()
+ {
+ if (this._suspendLayout)
+ return;
+
+ // Iterate through nodes by DOM order first so we can establish
+ // the DOM index.
+ var elements = this.dataTableBodyElement.rows;
+ for (var i = 0, count = elements.length - 1; i < count; ++i)
+ elements[i]._dataGridNode._domIndex = i;
+
+ // Now iterate through children to set up their sibling relationship
+ // and update the element style to offset the position of the node
+ // to match its position in the children list vs. DOM order.
+ var children = this.children;
+ for (var i = 0, count = children.length; i < count; ++i) {
+ var child = children[i];
+ child.previousSibling = i > 0 ? children[i - 1] : null;
+ child.nextSibling = i + 1 < count ? children[i + 1] : null;
+
+ var ty = (i - child._domIndex) * 100;
+ child.element.style.webkitTransform = "translateY(" + ty + "%)";
+
+ // Since the DOM order won't necessarily match the visual order of the
+ // children in the data grid we manually set "even" and "odd" and CSS
+ // class names on the data grid nodes so that they may be styled with
+ // a different mechanism than the built-in CSS pseudo-classes.
+ var classList = child.element.classList;
+ if (i % 2) {
+ classList.remove("odd");
+ classList.add("even");
+ } else {
+ classList.remove("even");
+ classList.add("odd");
+ }
+ }
+
+ this.hasChildren = this.children.length > 0;
+ },
+
+ _recalculateSiblings: function(myIndex)
+ {
+ // Overriding default implementation to do nothing at all
+ // since we're setting sibling relationship in _updateChildren.
+ }
+};
+
+WebInspector.LayerTreeDataGrid.prototype.__proto__ = WebInspector.DataGrid.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,168 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeDataGridNode = function(layer)
+{
+ WebInspector.DataGridNode.call(this);
+
+ this._outlets = {};
+
+ this.layer = layer;
+};
+
+WebInspector.LayerTreeDataGridNode.prototype = {
+ constructor: WebInspector.DataGridNode,
+
+ // DataGridNode Overrides.
+
+ createCells: function()
+ {
+ WebInspector.DataGridNode.prototype.createCells.call(this);
+
+ this._cellsWereCreated = true;
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ var cell = columnIdentifier === "name" ? this._makeNameCell() : this._makeOutlet(columnIdentifier, document.createTextNode());
+ this._updateCell(columnIdentifier);
+ return cell;
+ },
+
+ // Public
+
+ get layer()
+ {
+ return this._layer;
+ },
+
+ set layer(layer)
+ {
+ this._layer = layer;
+
+ var domNode = WebInspector.domTreeManager.nodeForId(layer.nodeId);
+
+ this.data = {
+ name: domNode ? WebInspector.displayNameForNode(domNode) : WebInspector.UIString("Unknown node"),
+ paintCount: layer.paintCount || "\u2014",
+ memory: Number.bytesToString(layer.memory || 0)
+ };
+ },
+
+ get data()
+ {
+ return this._data;
+ },
+
+ set data(data)
+ {
+ Object.keys(data).forEach(function(columnIdentifier) {
+ if (this._data[columnIdentifier] === data[columnIdentifier])
+ return;
+
+ this._data[columnIdentifier] = data[columnIdentifier];
+ if (this._cellsWereCreated)
+ this._updateCell(columnIdentifier);
+ }, this);
+ },
+
+ // Private
+
+ _makeOutlet: function(name, element)
+ {
+ return this._outlets[name] = element;
+ },
+
+ _makeNameCell: function()
+ {
+ var fragment = document.createDocumentFragment();
+
+ fragment.appendChild(document.createElement("img")).className = "icon";
+
+ var label = this._makeOutlet("label", fragment.appendChild(document.createElement("div")));
+ label.className = "label";
+
+ var nameLabel = this._makeOutlet("nameLabel", label.appendChild(document.createElement("span")));
+ nameLabel.className = "name";
+
+ var pseudoLabel = this._makeOutlet("pseudoLabel", document.createElement("span"));
+ pseudoLabel.className = "pseudo-element";
+
+ var reflectionLabel = this._makeOutlet("reflectionLabel", document.createElement("span"));
+ reflectionLabel.className = "reflection";
+ reflectionLabel.textContent = " \u2014 " + WebInspector.UIString("Reflection");
+
+ var goToButton = this._makeOutlet("goToButton", fragment.appendChild(WebInspector.createGoToArrowButton()));
+ goToButton.addEventListener("click", this._goToArrowWasClicked.bind(this), false);
+
+ return fragment;
+ },
+
+ _updateCell: function(columnIdentifier)
+ {
+ var data = this._data[columnIdentifier];
+ if (columnIdentifier === "name")
+ this._updateNameCellData(data);
+ else
+ this._outlets[columnIdentifier].textContent = data;
+ },
+
+ _updateNameCellData: function(data)
+ {
+ var layer = this._layer;
+ var label = this._outlets.label;
+
+ this._outlets.nameLabel.textContent = data;
+
+ if (layer.pseudoElement)
+ label.appendChild(this._outlets.pseudoLabel).textContent = "::" + layer.pseudoElement;
+ else if (this._outlets.pseudoLabel.parentNode)
+ label.removeChild(this._outlets.pseudoLabel);
+
+ if (layer.isReflection)
+ label.appendChild(this._outlets.reflectionLabel);
+ else if (this._outlets.reflectionLabel.parentNode)
+ label.removeChild(this._outlets.reflectionLabel);
+
+ if (WebInspector.domTreeManager.nodeForId(layer.nodeId))
+ label.parentNode.appendChild(this._outlets.goToButton);
+ else if (this._outlets.goToButton.parentNode)
+ label.parentNode.removeChild(this._outlets.goToButton);
+
+ var element = this.element;
+ if (layer.isReflection)
+ element.classList.add("reflection");
+ else if (layer.pseudoElement)
+ element.classList.add("pseudo-element");
+ },
+
+ _goToArrowWasClicked: function()
+ {
+ var domNode = WebInspector.domTreeManager.nodeForId(this._layer.nodeId);
+ WebInspector.resourceSidebarPanel.showMainFrameDOMTree(domNode, true);
+ }
+};
+
+WebInspector.LayerTreeDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,230 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+
+/* We use an internal container to act as a vertical stack. */
+
+.layer-tree.panel .box-container {
+ height: 100%;
+ /* Let it stack its content as vertical boxes. */
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+}
+
+/* Hide the collapsed arrow from sections. */
+
+.layer-tree.panel .details-section > .header::before {
+ /* Don't show the collpased arrow. */
+ display: none;
+}
+
+.layer-tree.panel .details-section > .header {
+ /* Add a little padding since there's no arrow to show. */
+ padding-left: 4px;
+ /* Turn off mouse events so we can't click to toggle section. */
+ pointer-events: none;
+}
+
+.layer-tree.panel .details-section > .header > label {
+ /* Always show the options box. */
+ display: block !important;
+ /* Turn on events just for the <label> and <input>. */
+ pointer-events: all;
+}
+
+/* Customizing the DataGrid. */
+
+.layer-tree.panel .details-section.layer-children {
+ position: relative;
+ /* Use all available vertical space. */
+ -webkit-flex: 1;
+ /* Let children stack vertically. */
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+}
+
+.layer-tree.panel .details-section.layer-children > .content {
+ position: relative;
+ display: block;
+ /* Use all available vertical space. */
+ -webkit-flex: 1;
+}
+
+.layer-tree.panel .details-section.layer-children .group {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+}
+
+.layer-tree.panel .data-grid {
+ position: relative;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ /* Turn off the default borders, we want to snap to edges. */
+ border: none;
+}
+
+.layer-tree.panel .data-grid table.data {
+ background-size: 100% 44px;
+}
+
+.layer-tree.panel .data-container {
+ position: absolute;
+ /* Leave room for the data grid header. */
+ top: 16px;
+ /* Use all remaining vertical space in the container. */
+ bottom: 0;
+ /* Let the inline table content scroll, independently of the header. */
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.layer-tree.panel .data-container tr {
+ height: 22px;
+}
+
+.layer-tree.panel .data-container td > div {
+ display: -webkit-flex;
+ width: 100%;
+ height: 100%;
+ -webkit-align-items: center;
+ -webkit-justify-content: flex-end;
+}
+
+/* Customizing the DataGrid "node" cell. */
+
+.layer-tree.panel .data-container .name-column {
+ padding-right: 0;
+}
+
+.layer-tree.panel .data-container .name-column .icon {
+ vertical-align: top;
+ width: 16px;
+ height: 16px;
+ content: url(../Images/DOMElement.svg);
+}
+
+.layer-tree.panel .data-container tr.reflection .name-column .icon {
+ content: url(../Images/Reflection.svg);
+}
+
+.layer-tree.panel .data-container tr.pseudo-element .name-column .icon {
+ content: url(../Images/PseudoElement.svg);
+}
+
+.layer-tree.panel .data-container .name-column .label {
+ -webkit-flex: 1;
+ padding: 0 4px;
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.layer-tree.panel .data-container tr:hover .name-column .label {
+ padding-right: 0;
+}
+
+.layer-tree.panel .data-container .name-column .pseudo-element,
+.layer-tree.panel .data-container .name-column .reflection {
+ color: rgb(128, 128, 128);
+}
+
+.layer-tree.panel .data-container tr.selected .name-column .pseudo-element,
+.layer-tree.panel .data-container tr.selected .name-column .reflection {
+ color: rgba(255, 255, 255, 0.75);
+}
+
+.layer-tree.panel .data-container .go-to-arrow {
+ display: none;
+}
+
+.layer-tree.panel .data-container tr:hover .go-to-arrow {
+ display: block;
+}
+
+.layer-tree.panel .data-container tbody > tr.even {
+ background-color: white;
+}
+
+.layer-tree.panel .data-container tbody > tr.odd {
+ background-color: rgb(243, 246, 250);
+}
+
+/* Bottom bar */
+
+.layer-tree.panel .bottom-bar {
+ position: relative;
+ height: 22px;
+ /* Let it stack its content as horizontal boxes. */
+ display: -webkit-flex;
+}
+
+.layer-tree.panel .bottom-bar > div {
+ padding: 4px;
+ box-sizing: border-box;
+
+ font-family: 'Lucida Grande', sans-serif;
+ font-size: 11px;
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+
+ /* Ensure any overflowing text is trimmed. */
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ /* Let all boxes have the same width. */
+ display: -webkit-flex;
+ -webkit-flex: 1;
+}
+
+.layer-tree.panel .layers-memory-label {
+ -webkit-justify-content: flex-end;
+}
+
+/* popover */
+
+.layer-tree-popover {
+ font-family: 'Lucida Grande', sans-serif;
+ font-size: 11px;
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+
+ padding: 5px;
+}
+
+.layer-tree-popover p {
+ margin: 0;
+}
+
+.layer-tree-popover ul {
+ list-style-type: none;
+ margin: 10px 0 0 0;
+ padding-left: 10px;
+}
+
+.layer-tree-popover li {
+ line-height: 1.3em;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayerTreeSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayerTreeSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,436 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayerTreeSidebarPanel = function() {
+ WebInspector.DOMDetailsSidebarPanel.call(this, "layer-tree", WebInspector.UIString("Layers"), WebInspector.UIString("Layer"), "Images/NavigationItemLayers.svg", "3");
+
+ this._dataGridNodesByLayerId = {};
+
+ this.element.classList.add(WebInspector.LayerTreeSidebarPanel.StyleClassName);
+
+ WebInspector.showShadowDOMSetting.addEventListener(WebInspector.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+
+ window.addEventListener("resize", this._windowResized.bind(this));
+
+ // Add a container that will host all sections as a vertical stack.
+ this._container = this.element.appendChild(document.createElement("div"));
+ this._container.className = "box-container";
+
+ this._buildLayerInfoSection();
+ this._buildDataGridSection();
+ this._buildBottomBar();
+};
+
+WebInspector.LayerTreeSidebarPanel.StyleClassName = "layer-tree";
+
+WebInspector.LayerTreeSidebarPanel.prototype = {
+ constructor: WebInspector.LayerTreeSidebarPanel,
+
+ // DetailsSidebarPanel Overrides.
+
+ shown: function()
+ {
+ WebInspector.layerTreeManager.addEventListener(WebInspector.LayerTreeManager.Event.LayerTreeDidChange, this._layerTreeDidChange, this);
+
+ console.assert(this.parentSidebar);
+
+ this.needsRefresh();
+
+ WebInspector.DOMDetailsSidebarPanel.prototype.shown.call(this);
+ },
+
+ hidden: function()
+ {
+ WebInspector.layerTreeManager.removeEventListener(WebInspector.LayerTreeManager.Event.LayerTreeDidChange, this._layerTreeDidChange, this);
+
+ WebInspector.DOMDetailsSidebarPanel.prototype.hidden.call(this);
+ },
+
+ refresh: function()
+ {
+ if (!this.domNode)
+ return;
+
+ WebInspector.layerTreeManager.layersForNode(this.domNode, function(layerForNode, childLayers) {
+ this._unfilteredChildLayers = childLayers;
+ this._updateDisplayWithLayers(layerForNode, childLayers);
+ }.bind(this));
+ },
+
+ // DOMDetailsSidebarPanel Overrides
+
+ supportsDOMNode: function(nodeToInspect)
+ {
+ return WebInspector.layerTreeManager.supported && nodeToInspect.nodeType() === Node.ELEMENT_NODE;
+ },
+
+ // Private
+
+ _layerTreeDidChange: function(event)
+ {
+ this.needsRefresh();
+ },
+
+ _showShadowDOMSettingChanged: function(event)
+ {
+ if (this.selected)
+ this._updateDisplayWithLayers(this._layerForNode, this._unfilteredChildLayers);
+ },
+
+ _windowResized: function(event)
+ {
+ if (this._popover && this._popover.visible)
+ this._updatePopoverForSelectedNode();
+ },
+
+ _buildLayerInfoSection: function()
+ {
+ var rows = this._layerInfoRows = {};
+ var rowsArray = [];
+
+ rowsArray.push(rows["Width"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width")));
+ rowsArray.push(rows["Height"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height")));
+ rowsArray.push(rows["Paints"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Paints")));
+ rowsArray.push(rows["Memory"] = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Memory")));
+
+ this._layerInfoGroup = new WebInspector.DetailsSectionGroup(rowsArray);
+
+ var emptyRow = new WebInspector.DetailsSectionRow(WebInspector.UIString("No Layer Available"));
+ emptyRow.showEmptyMessage();
+ this._noLayerInformationGroup = new WebInspector.DetailsSectionGroup([emptyRow]);
+
+ this._layerInfoSection = new WebInspector.DetailsSection("layer-info", WebInspector.UIString("Layer Info"), [this._noLayerInformationGroup]);
+
+ this._container.appendChild(this._layerInfoSection.element);
+ },
+
+ _buildDataGridSection: function()
+ {
+ this._dataGrid = new WebInspector.LayerTreeDataGrid;
+
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._selectedDataGridNodeChanged, this);
+
+ var element = this._dataGrid.element;
+ element.addEventListener("focus", this._dataGridGainedFocus.bind(this), false);
+ element.addEventListener("blur", this._dataGridLostFocus.bind(this), false);
+ element.addEventListener("click", this._dataGridWasClicked.bind(this), false);
+
+ this._childLayersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Child Layers"));
+ var group = new WebInspector.DetailsSectionGroup([this._childLayersRow]);
+ var section = new WebInspector.DetailsSection("layer-children", WebInspector.UIString("Child Layers"), [group], null, true);
+
+ // Display it in the container with a class name so we can easily style it differently to other sections,
+ // this specific section is meant to scale to fill the space available vertically.
+ var element = this._container.appendChild(section.element);
+ element.classList.add(section.identifier);
+ },
+
+ _buildBottomBar: function()
+ {
+ var bottomBar = this._container.appendChild(document.createElement("div"));
+ bottomBar.className = "bottom-bar";
+
+ this._layersCountLabel = bottomBar.appendChild(document.createElement("div"));
+ this._layersCountLabel.className = "layers-count-label";
+
+ this._layersMemoryLabel = bottomBar.appendChild(document.createElement("div"));
+ this._layersMemoryLabel.className = "layers-memory-label";
+ },
+
+ _sortDataGrid: function()
+ {
+ var dataGrid = this._dataGrid;
+
+ var nodes = dataGrid.children.slice();
+ var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
+ var sortDirection = dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function comparator(a, b)
+ {
+ var item1 = a.layer[sortColumnIdentifier] || 0;
+ var item2 = b.layer[sortColumnIdentifier] || 0;
+ return sortDirection * (item1 - item2);
+ };
+
+ nodes.sort(comparator);
+
+ dataGrid.setChildren(nodes);
+
+ this._updatePopoverForSelectedNode();
+ },
+
+ _selectedDataGridNodeChanged: function()
+ {
+ if (this._dataGrid.selectedNode) {
+ this._highlightSelectedNode();
+ this._showPopoverForSelectedNode();
+ } else {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ this._hidePopover();
+ }
+ },
+
+ _dataGridGainedFocus: function(event)
+ {
+ this._highlightSelectedNode();
+ this._showPopoverForSelectedNode();
+ },
+
+ _dataGridLostFocus: function(event)
+ {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ this._hidePopover();
+ },
+
+ _dataGridWasClicked: function(event)
+ {
+ if (this._dataGrid.selectedNode && event.target.parentNode.classList.contains("filler"))
+ this._dataGrid.selectedNode.deselect();
+ },
+
+ _highlightSelectedNode: function()
+ {
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return;
+
+ var layer = dataGridNode.layer;
+ if (layer.isGeneratedContent || layer.isReflection || layer.isAnonymous)
+ WebInspector.domTreeManager.highlightRect(layer.bounds, true);
+ else
+ WebInspector.domTreeManager.highlightDOMNode(layer.nodeId);
+ },
+
+ _updateDisplayWithLayers: function(layerForNode, childLayers)
+ {
+ if (!WebInspector.showShadowDOMSetting.value) {
+ childLayers = childLayers.filter(function(layer) {
+ return !layer.isInShadowTree;
+ });
+ }
+
+ this._updateLayerInfoSection(layerForNode);
+ this._updateDataGrid(layerForNode, childLayers);
+ this._updateMetrics(layerForNode, childLayers);
+
+ this._layerForNode = layerForNode;
+ this._childLayers = childLayers;
+ },
+
+ _updateLayerInfoSection: function(layer)
+ {
+ const emDash = "\u2014";
+
+ this._layerInfoSection.groups = layer ? [this._layerInfoGroup] : [this._noLayerInformationGroup];
+
+ if (!layer)
+ return;
+
+ this._layerInfoRows["Memory"].value = Number.bytesToString(layer.memory);
+ this._layerInfoRows["Width"].value = layer.compositedBounds.width + "px";
+ this._layerInfoRows["Height"].value = layer.compositedBounds.height + "px";
+ this._layerInfoRows["Paints"].value = layer.paintCount + "";
+ },
+
+ _updateDataGrid: function(layerForNode, childLayers)
+ {
+ var dataGrid = this._dataGrid;
+
+ var mutations = WebInspector.layerTreeManager.layerTreeMutations(this._childLayers, childLayers);
+
+ mutations.removals.forEach(function(layer) {
+ var node = this._dataGridNodesByLayerId[layer.layerId];
+ if (node) {
+ dataGrid.removeChild(node);
+ delete this._dataGridNodesByLayerId[layer.layerId];
+ }
+ }.bind(this));
+
+ mutations.additions.forEach(function(layer) {
+ var node = this._dataGridNodeForLayer(layer);
+ if (node)
+ dataGrid.appendChild(node);
+ }.bind(this));
+
+ mutations.preserved.forEach(function(layer) {
+ var node = this._dataGridNodesByLayerId[layer.layerId];
+ if (node)
+ node.layer = layer;
+ }.bind(this));
+
+ this._sortDataGrid();
+
+ this._childLayersRow.dataGrid = !isEmptyObject(childLayers) ? this._dataGrid : null;
+ },
+
+ _dataGridNodeForLayer: function(layer)
+ {
+ var node = new WebInspector.LayerTreeDataGridNode(layer);
+
+ this._dataGridNodesByLayerId[layer.layerId] = node;
+
+ return node;
+ },
+
+ _updateMetrics: function(layerForNode, childLayers)
+ {
+ var layerCount = 0;
+ var totalMemory = 0;
+
+ if (layerForNode) {
+ layerCount++;
+ totalMemory += layerForNode.memory || 0;
+ }
+
+ childLayers.forEach(function(layer) {
+ layerCount++;
+ totalMemory += layer.memory || 0;
+ });
+
+ this._layersCountLabel.textContent = WebInspector.UIString("Layer count: %d").format(layerCount);
+ this._layersMemoryLabel.textContent = WebInspector.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
+ },
+
+ _showPopoverForSelectedNode: function()
+ {
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return;
+
+ this._contentForPopover(dataGridNode.layer, function(content) {
+ if (dataGridNode === this._dataGrid.selectedNode)
+ this._updatePopoverForSelectedNode(content);
+ }.bind(this));
+ },
+
+ _updatePopoverForSelectedNode: function(content)
+ {
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return;
+
+ var popover = this._popover;
+ if (!popover)
+ popover = this._popover = new WebInspector.Popover;
+
+ var targetFrame = WebInspector.Rect.rectFromClientRect(dataGridNode.element.getBoundingClientRect());
+
+ if (content)
+ popover.content = content;
+
+ popover.present(targetFrame.pad(2), [WebInspector.RectEdge.MIN_X]);
+ },
+
+ _hidePopover: function()
+ {
+ if (this._popover)
+ this._popover.dismiss();
+ },
+
+ _contentForPopover: function(layer, callback)
+ {
+ var content = document.createElement("div");
+ content.className = "layer-tree-popover";
+
+ content.appendChild(document.createElement("p")).textContent = WebInspector.UIString("Reasons for compositing:");
+
+ var list = content.appendChild(document.createElement("ul"));
+
+ WebInspector.layerTreeManager.reasonsForCompositingLayer(layer, function(compositingReasons) {
+ if (isEmptyObject(compositingReasons)) {
+ callback(content);
+ return;
+ }
+
+ this._populateListOfCompositingReasons(list, compositingReasons);
+
+ callback(content);
+ }.bind(this));
+
+ return content;
+ },
+
+ _populateListOfCompositingReasons: function(list, compositingReasons)
+ {
+ function addReason(reason)
+ {
+ list.appendChild(document.createElement("li")).textContent = reason;
+ }
+
+ if (compositingReasons.transform3D)
+ addReason(WebInspector.UIString("Element has a 3D transform"));
+ if (compositingReasons.video)
+ addReason(WebInspector.UIString("Element is <video>"));
+ if (compositingReasons.canvas)
+ addReason(WebInspector.UIString("Element is <canvas>"));
+ if (compositingReasons.plugin)
+ addReason(WebInspector.UIString("Element is a plug-in"));
+ if (compositingReasons.iFrame)
+ addReason(WebInspector.UIString("Element is <iframe>"));
+ if (compositingReasons.backfaceVisibilityHidden)
+ addReason(WebInspector.UIString("Element has “backface-visibility: hidden” style"));
+ if (compositingReasons.clipsCompositingDescendants)
+ addReason(WebInspector.UIString("Element clips compositing descendants"));
+ if (compositingReasons.animation)
+ addReason(WebInspector.UIString("Element is animated"));
+ if (compositingReasons.filters)
+ addReason(WebInspector.UIString("Element has CSS filters applied"));
+ if (compositingReasons.positionFixed)
+ addReason(WebInspector.UIString("Element has “position: fixed” style"));
+ if (compositingReasons.positionSticky)
+ addReason(WebInspector.UIString("Element has “position: sticky” style"));
+ if (compositingReasons.overflowScrollingTouch)
+ addReason(WebInspector.UIString("Element has “-webkit-overflow-scrolling: touch” style"));
+ if (compositingReasons.stacking)
+ addReason(WebInspector.UIString("Element establishes a stacking context"));
+ if (compositingReasons.overlap)
+ addReason(WebInspector.UIString("Element overlaps other compositing element"));
+ if (compositingReasons.negativeZIndexChildren)
+ addReason(WebInspector.UIString("Element has children with a negative z-index"));
+ if (compositingReasons.transformWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element has a 2D transform and composited descendants"));
+ if (compositingReasons.opacityWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element has opacity applied and composited descendants"));
+ if (compositingReasons.maskWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element is masked and composited descendants"));
+ if (compositingReasons.reflectionWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element has a reflection and composited descendants"));
+ if (compositingReasons.filterWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element has CSS filters applied and composited descendants"));
+ if (compositingReasons.blendingWithCompositedDescendants)
+ addReason(WebInspector.UIString("Element has CSS blending applied and composited descendants"));
+ if (compositingReasons.perspective)
+ addReason(WebInspector.UIString("Element has perspective applied"));
+ if (compositingReasons.preserve3D)
+ addReason(WebInspector.UIString("Element has “transform-style: preserve-3d” style"));
+ if (compositingReasons.root)
+ addReason(WebInspector.UIString("Element is the root element"));
+ if (compositingReasons.blending)
+ addReason(WebInspector.UIString("Element has “blend-mode” style"));
+ }
+};
+
+WebInspector.LayerTreeSidebarPanel.prototype.__proto__ = WebInspector.DOMDetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
+{
+ WebInspector.TimelineDataGrid.call(this, treeOutline, columns, delegate, editCallback, deleteCallback);
+
+ this._showingHighlight = false;
+
+ this.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._layoutDataGridSelectedNodeChanged, this);
+}
+
+WebInspector.LayoutTimelineDataGrid.prototype = {
+ constructor: WebInspector.LayoutTimelineDataGrid,
+
+ // Protected
+
+ reset: function()
+ {
+ WebInspector.TimelineDataGrid.prototype.reset.call(this);
+
+ this._hideHighlightIfNeeded();
+ },
+
+ callFramePopoverAnchorElement: function()
+ {
+ return this.selectedNode.elementWithColumnIdentifier("initiatorCallFrame");
+ },
+
+ hidden: function()
+ {
+ WebInspector.TimelineDataGrid.prototype.hidden.call(this);
+
+ this._hideHighlightIfNeeded();
+ },
+
+ // Private
+
+ _layoutDataGridSelectedNodeChanged: function(event)
+ {
+ if (!this.selectedNode) {
+ this._hideHighlightIfNeeded();
+ return;
+ }
+
+ var record = this.selectedNode.record;
+ const contentColor = {r: 111, g: 168, b: 220, a: 0.66};
+ const outlineColor = {r: 255, g: 229, b: 153, a: 0.66};
+
+ var quad = record.quad;
+ if (quad && DOMAgent.highlightQuad) {
+ DOMAgent.highlightQuad(quad.toProtocol(), contentColor, outlineColor);
+ this._showingHighlight = true;
+ return;
+ }
+
+ // COMPATIBILITY (iOS 6): iOS 6 included Rect information instead of Quad information. Fallback to highlighting the rect.
+ var rect = record.rect;
+ if (rect) {
+ DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, contentColor, outlineColor);
+ this._showingHighlight = true;
+ return;
+ }
+ },
+
+ _hideHighlightIfNeeded: function()
+ {
+ if (this._showingHighlight) {
+ DOMAgent.hideHighlight();
+ this._showingHighlight = false;
+ }
+ }
+}
+
+WebInspector.LayoutTimelineDataGrid.prototype.__proto__ = WebInspector.TimelineDataGrid.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineDataGridNode = function(layoutTimelineRecord, baseStartTime)
+{
+ WebInspector.TimelineDataGridNode.call(this, false, null);
+
+ this._record = layoutTimelineRecord;
+ this._baseStartTime = baseStartTime || 0;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.LayoutTimelineDataGridNode);
+
+WebInspector.LayoutTimelineDataGridNode.IconStyleClassName = "icon";
+WebInspector.LayoutTimelineDataGridNode.SubtitleStyleClassName = "subtitle";
+
+WebInspector.LayoutTimelineDataGridNode.prototype = {
+ constructor: WebInspector.LayoutTimelineDataGridNode,
+ __proto__: WebInspector.TimelineDataGridNode.prototype,
+
+ // Public
+
+ get record()
+ {
+ return this._record;
+ },
+
+ get records()
+ {
+ return [this._record];
+ },
+
+ get data()
+ {
+ return this._record;
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ const emptyValuePlaceholderString = "\u2014";
+ var value = this.data[columnIdentifier];
+
+ switch (columnIdentifier) {
+ case "eventType":
+ return WebInspector.LayoutTimelineRecord.EventType.displayName(value);
+
+ case "width":
+ case "height":
+ return isNaN(value) ? emptyValuePlaceholderString : WebInspector.UIString("%fpx").format(value);
+
+ case "area":
+ return isNaN(value) ? emptyValuePlaceholderString : WebInspector.UIString("%fpx²").format(value);
+
+ case "startTime":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
+
+ case "duration":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
+ }
+
+ return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-overview-graph.layout > .timeline-record-bar {
+ margin-top: 8px;
+ height: 20px;
+}
+
+.timeline-overview-graph.layout > .timeline-record-bar > .segment {
+ border-radius: 2px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineOverviewGraphjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineOverviewGraph.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineOverviewGraph = function(recording)
+{
+ WebInspector.TimelineOverviewGraph.call(this, recording);
+
+ this.element.classList.add(WebInspector.LayoutTimelineOverviewGraph.StyleClassName);
+
+ this._layoutTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Layout);
+ this._layoutTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._layoutTimelineRecordAdded, this);
+
+ this._timelineRecordBars = [];
+
+ this.reset();
+};
+
+WebInspector.LayoutTimelineOverviewGraph.StyleClassName = "layout";
+
+WebInspector.LayoutTimelineOverviewGraph.prototype = {
+ constructor: WebInspector.LayoutTimelineOverviewGraph,
+ __proto__: WebInspector.TimelineOverviewGraph.prototype,
+
+ // Public
+
+ reset: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
+
+ this._timelineRecordBarMap = new Map;
+
+ this.element.removeChildren();
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
+
+ var visibleWidth = this.element.offsetWidth;
+ var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
+
+ var recordBarIndex = 0;
+
+ function createBar(records, renderMode)
+ {
+ var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
+ if (!timelineRecordBar)
+ timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
+ timelineRecordBar.renderMode = renderMode;
+ timelineRecordBar.records = records;
+ timelineRecordBar.refresh(this);
+ if (!timelineRecordBar.element.parentNode)
+ this.element.appendChild(timelineRecordBar.element);
+ ++recordBarIndex;
+ }
+
+ WebInspector.TimelineRecordBar.createCombinedBars(this._layoutTimeline.records, secondsPerPixel, this, createBar.bind(this));
+
+ // Remove the remaining unused TimelineRecordBars.
+ for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
+ this._timelineRecordBars[recordBarIndex].records = null;
+ this._timelineRecordBars[recordBarIndex].element.remove();
+ }
+ },
+
+ // Private
+
+ _layoutTimelineRecordAdded: function(event)
+ {
+ this.needsLayout();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-view.layout > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.timeline-view.layout > .data-grid .eventType-column {
+ border-right: none;
+}
+
+.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.layout .item .subtitle {
+ display: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLayoutTimelineViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LayoutTimelineView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,194 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LayoutTimelineView = function(recording)
+{
+ WebInspector.TimelineView.call(this);
+
+ this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
+ this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
+ this.navigationSidebarTreeOutline.element.classList.add(WebInspector.LayoutTimelineView.TreeOutlineStyleClassName);
+
+ var columns = {eventType: {}, initiatorCallFrame: {}, width: {}, height: {}, startTime: {}, duration: {}};
+
+ columns.eventType.title = WebInspector.UIString("Type");
+ columns.eventType.width = "15%";
+ columns.eventType.scopeBar = WebInspector.TimelineDataGrid.createColumnScopeBar("layout", WebInspector.LayoutTimelineRecord.EventType);
+ columns.eventType.hidden = true;
+
+ columns.initiatorCallFrame.title = WebInspector.UIString("Initiator");
+ columns.initiatorCallFrame.width = "25%";
+
+ columns.width.title = WebInspector.UIString("Width");
+ columns.width.width = "8%";
+
+ columns.height.title = WebInspector.UIString("Height");
+ columns.height.width = "8%";
+
+ columns.startTime.title = WebInspector.UIString("Start Time");
+ columns.startTime.width = "8%";
+ columns.startTime.aligned = "right";
+ columns.startTime.sort = "ascending";
+
+ columns.duration.title = WebInspector.UIString("Duration");
+ columns.duration.width = "8%";
+ columns.duration.aligned = "right";
+
+ for (var column in columns)
+ columns[column].sortable = true;
+
+ this._dataGrid = new WebInspector.LayoutTimelineDataGrid(this.navigationSidebarTreeOutline, columns);
+ this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+
+ this.element.classList.add(WebInspector.LayoutTimelineView.StyleClassName);
+ this.element.appendChild(this._dataGrid.element);
+
+ var layoutTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Layout);
+ layoutTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._layoutTimelineRecordAdded, this);
+
+ this._pendingRecords = [];
+};
+
+WebInspector.LayoutTimelineView.StyleClassName = "layout";
+WebInspector.LayoutTimelineView.TreeOutlineStyleClassName = "layout";
+
+WebInspector.LayoutTimelineView.prototype = {
+ constructor: WebInspector.LayoutTimelineView,
+ __proto__: WebInspector.TimelineView.prototype,
+
+ // Public
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ return WebInspector.UIString("Records");
+ },
+
+ shown: function()
+ {
+ WebInspector.TimelineView.prototype.shown.call(this);
+
+ this._dataGrid.shown();
+ },
+
+ hidden: function()
+ {
+ this._dataGrid.hidden();
+
+ WebInspector.TimelineView.prototype.hidden.call(this);
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineView.prototype.updateLayout.call(this);
+
+ this._dataGrid.updateLayout();
+
+ this._processPendingRecords();
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
+ },
+
+ reset: function()
+ {
+ WebInspector.TimelineView.prototype.reset.call(this);
+
+ this._dataGrid.reset();
+ },
+
+ // Protected
+
+ treeElementPathComponentSelected: function(event)
+ {
+ var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
+ if (!dataGridNode)
+ return;
+ dataGridNode.revealAndSelect();
+ },
+
+ // Private
+
+ _processPendingRecords: function()
+ {
+ if (!this._pendingRecords.length)
+ return;
+
+ for (var layoutTimelineRecord of this._pendingRecords) {
+ var treeElement = new WebInspector.TimelineRecordTreeElement(layoutTimelineRecord, WebInspector.SourceCodeLocation.NameStyle.Short);
+ var dataGridNode = new WebInspector.LayoutTimelineDataGridNode(layoutTimelineRecord, this.zeroTime);
+
+ this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
+ }
+
+ this._pendingRecords = [];
+ },
+
+ _layoutTimelineRecordAdded: function(event)
+ {
+ var layoutTimelineRecord = event.data.record;
+ console.assert(layoutTimelineRecord instanceof WebInspector.LayoutTimelineRecord);
+
+ this._pendingRecords.push(layoutTimelineRecord);
+
+ this.needsLayout();
+ },
+
+ _dataGridFiltersDidChange: function(event)
+ {
+ WebInspector.timelineSidebarPanel.updateFilter();
+ },
+
+ _dataGridNodeSelected: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (this._dataGrid.shouldIgnoreSelectionEvent())
+ return;
+
+ if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+ return;
+
+ if (treeElement instanceof WebInspector.FolderTreeElement)
+ return;
+
+ if (!(treeElement instanceof WebInspector.TimelineRecordTreeElement)) {
+ console.error("Unknown tree element selected.");
+ return;
+ }
+
+ if (!treeElement.record.sourceCodeLocation) {
+ WebInspector.timelineSidebarPanel.showTimelineView(WebInspector.TimelineRecord.Type.Layout);
+ return;
+ }
+
+ WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.record.sourceCodeLocation);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyBottomUpProfileDataGridTreejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyBottomUpProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyBottomUpProfileDataGridTree.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyBottomUpProfileDataGridTree.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyBottomUpProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyBottomUpProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,265 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North Inc. All Rights Reserved.
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.
+ */
+
+// Bottom Up Profiling shows the entire callstack backwards:
+// The root node is a representation of each individual function called, and each child of that node represents
+// a reverse-callstack showing how many of those calls came from it. So, unlike top-down, the statistics in
+// each child still represent the root node. We have to be particularly careful of recursion with this mode
+// because a root node can represent itself AND an ancestor.
+
+WebInspector.LegacyBottomUpProfileDataGridNode = function(profileNode, owningTree)
+{
+ WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, this._willHaveChildren(profileNode));
+
+ this._remainingNodeInfos = [];
+}
+
+WebInspector.LegacyBottomUpProfileDataGridNode.prototype = {
+ _takePropertiesFromProfileDataGridNode: function(profileDataGridNode)
+ {
+ this._save();
+
+ this.selfTime = profileDataGridNode.selfTime;
+ this.totalTime = profileDataGridNode.totalTime;
+ this.numberOfCalls = profileDataGridNode.numberOfCalls;
+ },
+
+ // When focusing, we keep just the members of the callstack.
+ _keepOnlyChild: function(child)
+ {
+ this._save();
+
+ this.removeChildren();
+ this.appendChild(child);
+ },
+
+ _exclude: function(aCallUID)
+ {
+ if (this._remainingNodeInfos)
+ this._populate();
+
+ this._save();
+
+ var children = this.children;
+ var index = this.children.length;
+
+ while (index--)
+ children[index]._exclude(aCallUID);
+
+ var child = this.childrenByCallUID[aCallUID];
+
+ if (child)
+ this._merge(child, true);
+ },
+
+ _restore: function()
+ {
+ WebInspector.LegacyProfileDataGridNode.prototype._restore();
+
+ if (!this.children.length)
+ this.hasChildren = this._willHaveChildren();
+ },
+
+ _merge: function(child, shouldAbsorb)
+ {
+ this.selfTime -= child.selfTime;
+
+ WebInspector.LegacyProfileDataGridNode.prototype._merge.call(this, child, shouldAbsorb);
+ },
+
+ _sharedPopulate: function()
+ {
+ var remainingNodeInfos = this._remainingNodeInfos;
+ var count = remainingNodeInfos.length;
+
+ for (var index = 0; index < count; ++index) {
+ var nodeInfo = remainingNodeInfos[index];
+ var ancestor = nodeInfo.ancestor;
+ var focusNode = nodeInfo.focusNode;
+ var child = this.findChild(ancestor);
+
+ // If we already have this child, then merge the data together.
+ if (child) {
+ var totalTimeAccountedFor = nodeInfo.totalTimeAccountedFor;
+
+ child.selfTime += focusNode.selfTime;
+ child.numberOfCalls += focusNode.numberOfCalls;
+
+ if (!totalTimeAccountedFor)
+ child.totalTime += focusNode.totalTime;
+ } else {
+ // If not, add it as a true ancestor.
+ // In heavy mode, we take our visual identity from ancestor node...
+ child = new WebInspector.LegacyBottomUpProfileDataGridNode(ancestor, this.tree, false, this.showTimeAsPercent);
+
+ if (ancestor !== focusNode) {
+ // but the actual statistics from the "root" node (bottom of the callstack).
+ child.selfTime = focusNode.selfTime;
+ child.totalTime = focusNode.totalTime;
+ child.numberOfCalls = focusNode.numberOfCalls;
+ }
+
+ this.appendChild(child);
+ }
+
+ var parent = ancestor.parent;
+ if (parent && parent.parent) {
+ nodeInfo.ancestor = parent;
+ child._remainingNodeInfos.push(nodeInfo);
+ }
+ }
+
+ delete this._remainingNodeInfos;
+ },
+
+ _willHaveChildren: function(profileNode)
+ {
+ profileNode = profileNode || this.profileNode;
+ // In bottom up mode, our parents are our children since we display an inverted tree.
+ // However, we don't want to show the very top parent since it is redundant.
+ return !!(profileNode.parent && profileNode.parent.parent);
+ }
+}
+
+WebInspector.LegacyBottomUpProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
+
+WebInspector.LegacyBottomUpProfileDataGridTree = function(profileNode)
+{
+ WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
+
+ // Iterate each node in pre-order.
+ var profileNodeUIDs = 0;
+ var profileNodeGroups = [[], [profileNode]];
+ var visitedProfileNodesForCallUID = {};
+
+ this._remainingNodeInfos = [];
+
+ for (var profileNodeGroupIndex = 0; profileNodeGroupIndex < profileNodeGroups.length; ++profileNodeGroupIndex) {
+ var parentProfileNodes = profileNodeGroups[profileNodeGroupIndex];
+ var profileNodes = profileNodeGroups[++profileNodeGroupIndex];
+ var count = profileNodes.length;
+
+ for (var index = 0; index < count; ++index) {
+ var profileNode = profileNodes[index];
+
+ if (!profileNode.UID)
+ profileNode.UID = ++profileNodeUIDs;
+
+ if (profileNode.head && profileNode !== profileNode.head) {
+ // The total time of this ancestor is accounted for if we're in any form of recursive cycle.
+ var visitedNodes = visitedProfileNodesForCallUID[profileNode.callUID];
+ var totalTimeAccountedFor = false;
+
+ if (!visitedNodes) {
+ visitedNodes = {};
+ visitedProfileNodesForCallUID[profileNode.callUID] = visitedNodes;
+ } else {
+ // The total time for this node has already been accounted for iff one of it's parents has already been visited.
+ // We can do this check in this style because we are traversing the tree in pre-order.
+ var parentCount = parentProfileNodes.length;
+ for (var parentIndex = 0; parentIndex < parentCount; ++parentIndex) {
+ if (visitedNodes[parentProfileNodes[parentIndex].UID]) {
+ totalTimeAccountedFor = true;
+ break;
+ }
+ }
+ }
+
+ visitedNodes[profileNode.UID] = true;
+
+ this._remainingNodeInfos.push({ ancestor:profileNode, focusNode:profileNode, totalTimeAccountedFor:totalTimeAccountedFor });
+ }
+
+ var children = profileNode.children;
+ if (children.length) {
+ profileNodeGroups.push(parentProfileNodes.concat([profileNode]));
+ profileNodeGroups.push(children);
+ }
+ }
+ }
+
+ // Populate the top level nodes.
+ WebInspector.LegacyBottomUpProfileDataGridNode.prototype._populate.call(this);
+
+ return this;
+}
+
+WebInspector.LegacyBottomUpProfileDataGridTree.prototype = {
+ // When focusing, we keep the entire callstack up to this ancestor.
+ focus: function(profileDataGridNode)
+ {
+ if (!profileDataGridNode)
+ return;
+
+ this._save();
+
+ var currentNode = profileDataGridNode;
+ var focusNode = profileDataGridNode;
+
+ while (currentNode.parent && (currentNode instanceof WebInspector.LegacyProfileDataGridNode)) {
+ currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode);
+
+ focusNode = currentNode;
+ currentNode = currentNode.parent;
+
+ if (currentNode instanceof WebInspector.LegacyProfileDataGridNode)
+ currentNode._keepOnlyChild(focusNode);
+ }
+
+ this.children = [focusNode];
+ this.totalTime = profileDataGridNode.totalTime;
+ },
+
+ exclude: function(profileDataGridNode)
+ {
+ if (!profileDataGridNode)
+ return;
+
+ this._save();
+
+ var excludedCallUID = profileDataGridNode.callUID;
+ var excludedTopLevelChild = this.childrenByCallUID[excludedCallUID];
+
+ // If we have a top level node that is excluded, get rid of it completely (not keeping children),
+ // since bottom up data relies entirely on the root node.
+ if (excludedTopLevelChild)
+ this.children.remove(excludedTopLevelChild);
+
+ var children = this.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ children[index]._exclude(excludedCallUID);
+
+ if (this.lastComparator)
+ this.sort(this.lastComparator, true);
+ },
+
+ _sharedPopulate: WebInspector.LegacyBottomUpProfileDataGridNode.prototype._sharedPopulate
+}
+
+WebInspector.LegacyBottomUpProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
+
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyJavaScriptProfileObject = function(title, id, recording)
+{
+ WebInspector.LegacyProfileObject.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, title, id, recording);
+};
+
+WebInspector.LegacyJavaScriptProfileObject.prototype = {
+ constructor: WebInspector.LegacyJavaScriptProfileObject
+};
+
+WebInspector.LegacyJavaScriptProfileObject.prototype.__proto__ = WebInspector.LegacyProfileObject.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileTypejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileTypejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileType.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileType.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileType.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileType.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyJavaScriptProfileType = function()
+{
+ WebInspector.LegacyProfileType.call(this, WebInspector.LegacyJavaScriptProfileType.TypeId, WebInspector.UIString("Collect JavaScript Profile"));
+ this._recording = false;
+ WebInspector.LegacyJavaScriptProfileType.instance = this;
+}
+
+WebInspector.LegacyJavaScriptProfileType.TypeId = "CPU";
+
+WebInspector.LegacyJavaScriptProfileType.prototype = {
+ get buttonTooltip()
+ {
+ return this._recording ? WebInspector.UIString("Stop JavaScript profiling.") : WebInspector.UIString("Start JavaScript profiling.");
+ },
+
+ buttonClicked: function()
+ {
+ if (this._recording) {
+ this.stopRecordingProfile();
+ WebInspector.networkManager.enableResourceTracking();
+ } else {
+ WebInspector.networkManager.disableResourceTracking();
+ this.startRecordingProfile();
+ }
+ },
+
+ get treeItemTitle()
+ {
+ return WebInspector.UIString("JAVASCRIPT PROFILES");
+ },
+
+ get description()
+ {
+ return WebInspector.UIString("JavaScript profiles show where the execution time is spent in your page's JavaScript functions.");
+ },
+
+ isRecordingProfile: function()
+ {
+ return this._recording;
+ },
+
+ startRecordingProfile: function()
+ {
+ this._recording = true;
+ ProfilerAgent.start();
+ },
+
+ stopRecordingProfile: function()
+ {
+ this._recording = false;
+ ProfilerAgent.stop();
+ },
+
+ setRecordingProfile: function(isProfiling)
+ {
+ this._recording = isProfiling;
+ },
+
+ createSidebarTreeElementForProfile: function(profile)
+ {
+ return new WebInspector.LegacyProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
+ },
+
+ createView: function(profile)
+ {
+ return new WebInspector.LegacyJavaScriptProfileView(profile);
+ }
+}
+
+WebInspector.LegacyJavaScriptProfileType.prototype.__proto__ = WebInspector.LegacyProfileType.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.profile-view > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ outline: none;
+ border: none;
+}
+
+.profile-view .data-grid th.average-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.average-column {
+ text-align: right;
+}
+
+.profile-view .data-grid th.self-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.self-column {
+ text-align: right;
+}
+
+.profile-view .data-grid th.total-column {
+ text-align: center;
+}
+
+.profile-view .data-grid td.total-column {
+ text-align: right;
+}
+
+.profile-view .data-grid .calls-column {
+ text-align: center;
+}
+
+.profile-node-file {
+ float: right;
+ color: gray;
+ margin-top: -1px;
+}
+
+.data-grid tr.selected .profile-node-file {
+ color: rgb(33%, 33%, 33%);
+}
+
+.data-grid:focus tr.selected .profile-node-file {
+ color: white;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyJavaScriptProfileViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyJavaScriptProfileViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyJavaScriptProfileView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyJavaScriptProfileView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,458 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyJavaScriptProfileView = function(profile)
+{
+ console.assert(profile instanceof WebInspector.LegacyJavaScriptProfileObject);
+
+ WebInspector.LegacyProfileView.call(this, profile, "javascript-profiler-show-time-as-percent");
+
+ this._showTreeBottomUpSetting = new WebInspector.Setting("javascript-profiler-show-tree-bottom-up", true);
+
+ this._showTreeBottomUpNavigationItem = new WebInspector.ActivateButtonNavigationItem("show-tree-bottom-up-navigation-item", WebInspector.UIString("Invert call tree"), WebInspector.UIString("Normal call tree"), "Images/BottomUpTree.svg", 16, 16);
+ this._showTreeBottomUpNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleBottomUpView, this);
+ this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
+
+ this._viewType = new WebInspector.Setting("javascript-profiler-view", WebInspector.LegacyJavaScriptProfileView._TypeHeavy);
+}
+
+WebInspector.LegacyJavaScriptProfileView._TypeTree = "Tree";
+WebInspector.LegacyJavaScriptProfileView._TypeHeavy = "Heavy";
+
+WebInspector.LegacyJavaScriptProfileView.prototype = {
+ constructor: WebInspector.LegacyJavaScriptProfileView,
+
+ updateLayout: function()
+ {
+ if (this.dataGrid)
+ this.dataGrid.updateLayout();
+ },
+
+ get recordingTitle()
+ {
+ return WebInspector.UIString("Recording JavaScript Profile\u2026");
+ },
+
+ displayProfile: function()
+ {
+ var columns = { "self": { title: WebInspector.UIString("Self"), width: "72px", sort: "descending", sortable: true },
+ "total": { title: WebInspector.UIString("Total"), width: "72px", sortable: true },
+ "average": { title: WebInspector.UIString("Average"), width: "72px", sortable: true },
+ "calls": { title: WebInspector.UIString("Calls"), width: "54px", sortable: true },
+ "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } };
+
+ this.dataGrid = new WebInspector.DataGrid(columns);
+ this.dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortData, this);
+
+ this.element.appendChild(this.dataGrid.element);
+ this.dataGrid.updateLayout();
+
+ function profileCallback(error, profile)
+ {
+ if (error)
+ return;
+
+ if (!profile.head) {
+ // Profiling was tentatively terminated with the "Clear all profiles." button.
+ return;
+ }
+ this.profile.head = profile.head;
+ this._assignParentsInProfile();
+ this._changeView();
+ }
+
+ // COMPATIBILITY (iOS 6): getCPUProfile use to be called getProfile.
+ if (ProfilerAgent.getProfile)
+ ProfilerAgent.getProfile(this.profile.type, this.profile.id, profileCallback.bind(this));
+ else
+ ProfilerAgent.getCPUProfile(this.profile.id, profileCallback.bind(this));
+ },
+
+ get navigationItems()
+ {
+ return [this._showTreeBottomUpNavigationItem, this.showTimeAsPercentNavigationItem];
+ },
+
+ get bottomUpProfileDataGridTree()
+ {
+ if (!this._bottomUpProfileDataGridTree)
+ this._bottomUpProfileDataGridTree = new WebInspector.LegacyBottomUpProfileDataGridTree(this.profile.head);
+ return this._bottomUpProfileDataGridTree;
+ },
+
+ get topDownProfileDataGridTree()
+ {
+ if (!this._topDownProfileDataGridTree)
+ this._topDownProfileDataGridTree = new WebInspector.LegacyTopDownProfileDataGridTree(this.profile.head);
+ return this._topDownProfileDataGridTree;
+ },
+
+ willHide: function()
+ {
+ this._currentSearchResultIndex = -1;
+ },
+
+ refresh: function()
+ {
+ var selectedProfileNode = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.profileNode : null;
+
+ this.dataGrid.removeChildren();
+
+ var children = this.profileDataGridTree.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ this.dataGrid.appendChild(children[index]);
+
+ if (selectedProfileNode)
+ selectedProfileNode.selected = true;
+ },
+
+ refreshVisibleData: function()
+ {
+ var child = this.dataGrid.children[0];
+ while (child) {
+ child.refresh(this.showTimeAsPercent.value);
+ child = child.traverseNextNode(false, null, true);
+ }
+ },
+
+ searchCanceled: function()
+ {
+ if (this._searchResults) {
+ for (var i = 0; i < this._searchResults.length; ++i) {
+ var profileNode = this._searchResults[i].profileNode;
+
+ delete profileNode._searchMatchedSelfColumn;
+ delete profileNode._searchMatchedTotalColumn;
+ delete profileNode._searchMatchedCallsColumn;
+ delete profileNode._searchMatchedFunctionColumn;
+
+ profileNode.refresh();
+ }
+ }
+
+ delete this._searchFinishedCallback;
+ this._currentSearchResultIndex = -1;
+ this._searchResults = [];
+ },
+
+ performSearch: function(query, finishedCallback)
+ {
+ // Call searchCanceled since it will reset everything we need before doing a new search.
+ this.searchCanceled();
+
+ query = query.trim();
+
+ if (!query.length)
+ return;
+
+ this._searchFinishedCallback = finishedCallback;
+
+ var greaterThan = query.charAt(0) === ">";
+ var lessThan = query.charAt(0) === "<";
+ var equalTo = (query.charAt(0) === "=" || ((greaterThan || lessThan) && query.charAt(1) === "="));
+ var percentUnits = (query.lastIndexOf("%") === (query.length - 1));
+ var millisecondsUnits = (query.length > 2 && query.lastIndexOf("ms") === (query.length - 2));
+ var secondsUnits = (!millisecondsUnits && query.lastIndexOf("s") === (query.length - 1));
+
+ var queryNumber = parseFloat(query);
+ if (greaterThan || lessThan || equalTo) {
+ if (equalTo && (greaterThan || lessThan))
+ queryNumber = parseFloat(query.substring(2));
+ else
+ queryNumber = parseFloat(query.substring(1));
+ }
+
+ var queryNumberMilliseconds = (secondsUnits ? (queryNumber * 1000) : queryNumber);
+
+ // Make equalTo implicitly true if it wasn't specified there is no other operator.
+ if (!isNaN(queryNumber) && !(greaterThan || lessThan))
+ equalTo = true;
+
+ function matchesQuery(/*ProfileDataGridNode*/ profileDataGridNode)
+ {
+ delete profileDataGridNode._searchMatchedSelfColumn;
+ delete profileDataGridNode._searchMatchedTotalColumn;
+ delete profileDataGridNode._searchMatchedAverageColumn;
+ delete profileDataGridNode._searchMatchedCallsColumn;
+ delete profileDataGridNode._searchMatchedFunctionColumn;
+
+ if (percentUnits) {
+ if (lessThan) {
+ if (profileDataGridNode.selfPercent < queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent < queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ } else if (greaterThan) {
+ if (profileDataGridNode.selfPercent > queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent > queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+
+ if (equalTo) {
+ if (profileDataGridNode.selfPercent == queryNumber)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalPercent == queryNumber)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averagePercent < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+ } else if (millisecondsUnits || secondsUnits) {
+ if (lessThan) {
+ if (profileDataGridNode.selfTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime < queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ } else if (greaterThan) {
+ if (profileDataGridNode.selfTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime > queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+
+ if (equalTo) {
+ if (profileDataGridNode.selfTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedSelfColumn = true;
+ if (profileDataGridNode.totalTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedTotalColumn = true;
+ if (profileDataGridNode.averageTime == queryNumberMilliseconds)
+ profileDataGridNode._searchMatchedAverageColumn = true;
+ }
+ } else {
+ if (equalTo && profileDataGridNode.numberOfCalls == queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ if (greaterThan && profileDataGridNode.numberOfCalls > queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ if (lessThan && profileDataGridNode.numberOfCalls < queryNumber)
+ profileDataGridNode._searchMatchedCallsColumn = true;
+ }
+
+ if (profileDataGridNode.functionName.hasSubstring(query, true) || profileDataGridNode.url.hasSubstring(query, true))
+ profileDataGridNode._searchMatchedFunctionColumn = true;
+
+ if (profileDataGridNode._searchMatchedSelfColumn ||
+ profileDataGridNode._searchMatchedTotalColumn ||
+ profileDataGridNode._searchMatchedAverageColumn ||
+ profileDataGridNode._searchMatchedCallsColumn ||
+ profileDataGridNode._searchMatchedFunctionColumn)
+ {
+ profileDataGridNode.refresh();
+ return true;
+ }
+
+ return false;
+ }
+
+ var current = this.profileDataGridTree.children[0];
+
+ while (current) {
+ if (matchesQuery(current)) {
+ this._searchResults.push({ profileNode: current });
+ }
+
+ current = current.traverseNextNode(false, null, false);
+ }
+
+ finishedCallback(this, this._searchResults.length);
+ },
+
+ jumpToFirstSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ this._currentSearchResultIndex = 0;
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToLastSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ this._currentSearchResultIndex = (this._searchResults.length - 1);
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToNextSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ if (++this._currentSearchResultIndex >= this._searchResults.length)
+ this._currentSearchResultIndex = 0;
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ jumpToPreviousSearchResult: function()
+ {
+ if (!this._searchResults || !this._searchResults.length)
+ return;
+ if (--this._currentSearchResultIndex < 0)
+ this._currentSearchResultIndex = (this._searchResults.length - 1);
+ this._jumpToSearchResult(this._currentSearchResultIndex);
+ },
+
+ showingFirstSearchResult: function()
+ {
+ return (this._currentSearchResultIndex === 0);
+ },
+
+ showingLastSearchResult: function()
+ {
+ return (this._searchResults && this._currentSearchResultIndex === (this._searchResults.length - 1));
+ },
+
+ _jumpToSearchResult: function(index)
+ {
+ var searchResult = this._searchResults[index];
+ if (!searchResult)
+ return;
+
+ var profileNode = searchResult.profileNode;
+ profileNode.revealAndSelect();
+ },
+
+ _toggleBottomUpView: function(event)
+ {
+ this._showTreeBottomUpSetting.value = !this._showTreeBottomUpSetting.value;
+ this._showTreeBottomUpNavigationItem.activated = this._showTreeBottomUpSetting.value;
+ this._changeView();
+ },
+
+ _changeView: function()
+ {
+ if (!this.profile)
+ return;
+
+ if (!this._showTreeBottomUpSetting.value) {
+ this.profileDataGridTree = this.topDownProfileDataGridTree;
+ this._sortProfile();
+ this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeTree;
+ } else {
+ this.profileDataGridTree = this.bottomUpProfileDataGridTree;
+ this._sortProfile();
+ this._viewType.value = WebInspector.LegacyJavaScriptProfileView._TypeHeavy;
+ }
+
+ if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
+ return;
+
+ // The current search needs to be performed again. First negate out previous match
+ // count by calling the search finished callback with a negative number of matches.
+ // Then perform the search again the with same query and callback.
+ this._searchFinishedCallback(this, -this._searchResults.length);
+ this.performSearch(this.currentQuery, this._searchFinishedCallback);
+ },
+
+ toggleTimeDisplay: function(event)
+ {
+ WebInspector.LegacyProfileView.prototype.toggleTimeDisplay.call(this, event);
+ this.showTimeAsPercent.value = !this.showTimeAsPercent.value;
+ this.refreshVisibleData();
+ },
+
+ _focusClicked: function(event)
+ {
+ if (!this.dataGrid.selectedNode)
+ return;
+
+ this.profileDataGridTree.focus(this.dataGrid.selectedNode);
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _excludeClicked: function(event)
+ {
+ var selectedNode = this.dataGrid.selectedNode;
+
+ if (!selectedNode)
+ return;
+
+ selectedNode.deselect();
+
+ this.profileDataGridTree.exclude(selectedNode);
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _resetClicked: function(event)
+ {
+ this.profileDataGridTree.restore();
+ this.refresh();
+ this.refreshVisibleData();
+ },
+
+ _sortData: function(event)
+ {
+ this._sortProfile(this.profile);
+ },
+
+ _sortProfile: function()
+ {
+ var sortAscending = this.dataGrid.sortOrder === "ascending";
+ var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
+ var sortProperty = {
+ "average": "averageTime",
+ "self": "selfTime",
+ "total": "totalTime",
+ "calls": "numberOfCalls",
+ "function": "functionName"
+ }[sortColumnIdentifier];
+
+ this.profileDataGridTree.sort(WebInspector.LegacyProfileDataGridTree.propertyComparator(sortProperty, sortAscending));
+
+ this.refresh();
+ },
+
+ _assignParentsInProfile: function()
+ {
+ var head = this.profile.head;
+ head.parent = null;
+ head.head = null;
+ var nodesToTraverse = [ { parent: head, children: head.children } ];
+ while (nodesToTraverse.length > 0) {
+ var pair = nodesToTraverse.shift();
+ var parent = pair.parent;
+ var children = pair.children;
+ var length = children.length;
+ for (var i = 0; i < length; ++i) {
+ children[i].head = head;
+ children[i].parent = parent;
+ if (children[i].children.length > 0)
+ nodesToTraverse.push({ parent: children[i], children: children[i].children });
+ }
+ }
+ }
+}
+
+WebInspector.LegacyJavaScriptProfileView.prototype.__proto__ = WebInspector.LegacyProfileView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileDataGridTreejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileDataGridTree.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileDataGridTree.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,399 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyProfileDataGridNode = function(profileNode, owningTree, hasChildren, showTimeAsPercent)
+{
+ this.profileNode = profileNode;
+
+ WebInspector.DataGridNode.call(this, null, hasChildren);
+
+ this.addEventListener("populate", this._populate, this);
+
+ this.tree = owningTree;
+
+ this.childrenByCallUID = {};
+ this.lastComparator = null;
+
+ this.callUID = profileNode.callUID;
+ this.selfTime = profileNode.selfTime;
+ this.totalTime = profileNode.totalTime;
+ this.functionName = profileNode.functionName;
+ this.numberOfCalls = profileNode.numberOfCalls;
+ this.url = profileNode.url;
+
+ this._showTimeAsPercent = showTimeAsPercent || false;
+}
+
+WebInspector.LegacyProfileDataGridNode.prototype = {
+ get data()
+ {
+ function formatMilliseconds(time)
+ {
+ return Number.secondsToString(time / 1000, true);
+ }
+
+ var data = {};
+
+ data["function"] = this.functionName;
+ data["calls"] = this.numberOfCalls;
+
+ if (this._showTimeAsPercent) {
+ data["self"] = WebInspector.UIString("%.2f %%").format(this.selfPercent);
+ data["total"] = WebInspector.UIString("%.2f %%").format(this.totalPercent);
+ data["average"] = WebInspector.UIString("%.2f %%").format(this.averagePercent);
+ } else {
+ data["self"] = formatMilliseconds(this.selfTime);
+ data["total"] = formatMilliseconds(this.totalTime);
+ data["average"] = formatMilliseconds(this.averageTime);
+ }
+
+ return data;
+ },
+
+ get showTimeAsPercent()
+ {
+ return this._showTimeAsPercent;
+ },
+
+ refresh: function(showTimeAsPercent)
+ {
+ this._showTimeAsPercent = showTimeAsPercent;
+
+ WebInspector.DataGridNode.prototype.refresh.call(this);
+ },
+
+ createCell: function(columnIdentifier)
+ {
+ var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
+
+ if (columnIdentifier === "self" && this._searchMatchedSelfColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "total" && this._searchMatchedTotalColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "average" && this._searchMatchedAverageColumn)
+ cell.classList.add("highlight");
+ else if (columnIdentifier === "calls" && this._searchMatchedCallsColumn)
+ cell.classList.add("highlight");
+
+ if (columnIdentifier !== "function")
+ return cell;
+
+ if (this.profileNode._searchMatchedFunctionColumn)
+ cell.classList.add("highlight");
+
+ if (this.profileNode.url) {
+ // FIXME(62725): profileNode should reference a debugger location.
+ var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
+ var urlElement = this._linkifyLocation(this.profileNode.url, lineNumber, "profile-node-file");
+ urlElement.style.maxWidth = "75%";
+ cell.insertBefore(urlElement, cell.firstChild);
+ }
+
+ return cell;
+ },
+
+ sort: function(comparator, force)
+ {
+ var gridNodeGroups = [[this]];
+
+ for (var gridNodeGroupIndex = 0; gridNodeGroupIndex < gridNodeGroups.length; ++gridNodeGroupIndex) {
+ var gridNodes = gridNodeGroups[gridNodeGroupIndex];
+ var count = gridNodes.length;
+
+ for (var index = 0; index < count; ++index) {
+ var gridNode = gridNodes[index];
+
+ // If the grid node is collapsed, then don't sort children (save operation for later).
+ // If the grid node has the same sorting as previously, then there is no point in sorting it again.
+ if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {
+ if (gridNode.children.length)
+ gridNode.shouldRefreshChildren = true;
+ continue;
+ }
+
+ gridNode.lastComparator = comparator;
+
+ var children = gridNode.children;
+ var childCount = children.length;
+
+ if (childCount) {
+ children.sort(comparator);
+
+ for (var childIndex = 0; childIndex < childCount; ++childIndex)
+ children[childIndex]._recalculateSiblings(childIndex);
+
+ gridNodeGroups.push(children);
+ }
+ }
+ }
+ },
+
+ insertChild: function(profileDataGridNode, index)
+ {
+ WebInspector.DataGridNode.prototype.insertChild.call(this, profileDataGridNode, index);
+
+ this.childrenByCallUID[profileDataGridNode.callUID] = profileDataGridNode;
+ },
+
+ removeChild: function(profileDataGridNode)
+ {
+ WebInspector.DataGridNode.prototype.removeChild.call(this, profileDataGridNode);
+
+ delete this.childrenByCallUID[profileDataGridNode.callUID];
+ },
+
+ removeChildren: function(profileDataGridNode)
+ {
+ WebInspector.DataGridNode.prototype.removeChildren.call(this);
+
+ this.childrenByCallUID = {};
+ },
+
+ findChild: function(node)
+ {
+ if (!node)
+ return null;
+ return this.childrenByCallUID[node.callUID];
+ },
+
+ get averageTime()
+ {
+ return this.selfTime / Math.max(1, this.numberOfCalls);
+ },
+
+ get averagePercent()
+ {
+ return this.averageTime / this.tree.totalTime * 100.0;
+ },
+
+ get selfPercent()
+ {
+ return this.selfTime / this.tree.totalTime * 100.0;
+ },
+
+ get totalPercent()
+ {
+ return this.totalTime / this.tree.totalTime * 100.0;
+ },
+
+ get _parent()
+ {
+ return this.parent !== this.dataGrid ? this.parent : this.tree;
+ },
+
+ _populate: function(event)
+ {
+ this._sharedPopulate();
+
+ if (this._parent) {
+ var currentComparator = this._parent.lastComparator;
+
+ if (currentComparator)
+ this.sort(currentComparator, true);
+ }
+
+ if (this.removeEventListener)
+ this.removeEventListener("populate", this._populate, this);
+ },
+
+ // When focusing and collapsing we modify lots of nodes in the tree.
+ // This allows us to restore them all to their original state when we revert.
+ _save: function()
+ {
+ if (this._savedChildren)
+ return;
+
+ this._savedSelfTime = this.selfTime;
+ this._savedTotalTime = this.totalTime;
+ this._savedNumberOfCalls = this.numberOfCalls;
+
+ this._savedChildren = this.children.slice();
+ },
+
+ // When focusing and collapsing we modify lots of nodes in the tree.
+ // This allows us to restore them all to their original state when we revert.
+ _restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.selfTime = this._savedSelfTime;
+ this.totalTime = this._savedTotalTime;
+ this.numberOfCalls = this._savedNumberOfCalls;
+
+ this.removeChildren();
+
+ var children = this._savedChildren;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ children[index]._restore();
+ this.appendChild(children[index]);
+ }
+ },
+
+ _merge: function(child, shouldAbsorb)
+ {
+ this.selfTime += child.selfTime;
+
+ if (!shouldAbsorb) {
+ this.totalTime += child.totalTime;
+ this.numberOfCalls += child.numberOfCalls;
+ }
+
+ var children = this.children.slice();
+
+ this.removeChildren();
+
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ if (!shouldAbsorb || children[index] !== child)
+ this.appendChild(children[index]);
+ }
+
+ children = child.children.slice();
+ count = children.length;
+
+ for (var index = 0; index < count; ++index) {
+ var orphanedChild = children[index],
+ existingChild = this.childrenByCallUID[orphanedChild.callUID];
+
+ if (existingChild)
+ existingChild._merge(orphanedChild, false);
+ else
+ this.appendChild(orphanedChild);
+ }
+ },
+
+ _linkifyLocation: function(url, lineNumber, className)
+ {
+ // FIXME: CPUProfileNode's need columnNumbers.
+ return WebInspector.linkifyLocation(url, lineNumber, 0, className);
+ }
+}
+
+WebInspector.LegacyProfileDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype;
+
+WebInspector.LegacyProfileDataGridTree = function(profileNode)
+{
+ this.tree = this;
+ this.children = [];
+
+ this.totalTime = profileNode.totalTime;
+ this.lastComparator = null;
+
+ this.childrenByCallUID = {};
+}
+
+WebInspector.LegacyProfileDataGridTree.prototype = {
+ get expanded()
+ {
+ return true;
+ },
+
+ appendChild: function(child)
+ {
+ this.insertChild(child, this.children.length);
+ },
+
+ insertChild: function(child, index)
+ {
+ this.children.splice(index, 0, child);
+ this.childrenByCallUID[child.callUID] = child;
+ },
+
+ removeChildren: function()
+ {
+ this.children = [];
+ this.childrenByCallUID = {};
+ },
+
+ findChild: WebInspector.LegacyProfileDataGridNode.prototype.findChild,
+ sort: WebInspector.LegacyProfileDataGridNode.prototype.sort,
+
+ _save: function()
+ {
+ if (this._savedChildren)
+ return;
+
+ this._savedTotalTime = this.totalTime;
+ this._savedChildren = this.children.slice();
+ },
+
+ restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.children = this._savedChildren;
+ this.totalTime = this._savedTotalTime;
+
+ var children = this.children;
+ var count = children.length;
+
+ for (var index = 0; index < count; ++index)
+ children[index]._restore();
+
+ this._savedChildren = null;
+ }
+}
+
+WebInspector.LegacyProfileDataGridTree.propertyComparators = [{}, {}];
+
+WebInspector.LegacyProfileDataGridTree.propertyComparator = function(property, isAscending)
+{
+ var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
+
+ if (!comparator) {
+ if (isAscending) {
+ comparator = function(lhs, rhs)
+ {
+ if (lhs[property] < rhs[property])
+ return -1;
+
+ if (lhs[property] > rhs[property])
+ return 1;
+
+ return 0;
+ };
+ } else {
+ comparator = function(lhs, rhs)
+ {
+ if (lhs[property] > rhs[property])
+ return -1;
+
+ if (lhs[property] < rhs[property])
+ return 1;
+
+ return 0;
+ };
+ }
+
+ this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
+ }
+
+ return comparator;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileObjectjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileObjectjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileObject.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileObject.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileObject.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileObject.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileObject = function(type, title, id, isRecording)
+{
+ WebInspector.Object.call(this);
+
+ console.assert(type);
+ console.assert(title);
+ console.assert(id);
+
+ this._type = type;
+ this._title = title;
+ this._id = id;
+ this._isRecording = isRecording || false;
+};
+
+WebInspector.LegacyProfileObject.Event = {
+ FinshedRecording: "profile-object-finished-recording"
+};
+
+WebInspector.LegacyProfileObject.prototype = {
+ constructor: WebInspector.LegacyProfileObject,
+
+ get type()
+ {
+ return this._type;
+ },
+
+ set type(type)
+ {
+ this._type = type;
+ },
+
+ get title()
+ {
+ return this._title;
+ },
+
+ set title(title)
+ {
+ this._title = title;
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ set id(id)
+ {
+ this._id = id;
+ },
+
+ get recording()
+ {
+ return this._isRecording;
+ },
+
+ set recording(flag)
+ {
+ if (this._isRecording === flag)
+ return;
+
+ this._isRecording = flag;
+ if (!flag)
+ this.dispatchEventToListeners(WebInspector.LegacyProfileObject.Event.FinshedRecording);
+ }
+};
+
+WebInspector.LegacyProfileObject.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileTypejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileTypejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileType.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileType.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileType.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileType.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 Apple Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyProfileType = function(id, name)
+{
+ this._id = id;
+ this._name = name;
+}
+
+WebInspector.LegacyProfileType.URLRegExp = /webkit-profile:\/\/(.+)\/(.+)#([0-9]+)/;
+WebInspector.LegacyProfileType.ProfileScheme = "webkit-profile";
+
+WebInspector.LegacyProfileType.prototype = {
+ get buttonTooltip()
+ {
+ return "";
+ },
+
+ get id()
+ {
+ return this._id;
+ },
+
+ get treeItemTitle()
+ {
+ return this._name;
+ },
+
+ get name()
+ {
+ return this._name;
+ },
+
+ buttonClicked: function()
+ {
+ },
+
+ viewForProfile: function(profile)
+ {
+ if (!profile._profileView)
+ profile._profileView = this.createView(profile);
+ return profile._profileView;
+ },
+
+ reset: function()
+ {
+ },
+
+ get description()
+ {
+ return "";
+ },
+
+ // Must be implemented by subclasses.
+ createView: function(profile)
+ {
+ throw new Error("Needs implemented.");
+ },
+
+ // Must be implemented by subclasses.
+ createSidebarTreeElementForProfile: function(profile)
+ {
+ throw new Error("Needs implemented.");
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.recording-profile-view {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+
+ display: -webkit-flex;
+ -webkit-flex-flow: row nowrap;
+ -webkit-justify-content: center;
+ -webkit-align-content: center;
+ -webkit-align-items: center;
+
+ background-color: rgb(232, 232, 232);
+}
+
+.recording-profile-view > .indeterminate-progress-spinner {
+ position: static;
+ margin: 0;
+}
+
+.recording-profile-view > span {
+ font-family: 'Lucida Grande', Helvetica, sans-serif;
+ font-size: 14px;
+
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ color: rgb(60, 60, 60);
+
+ padding-left: 10px;
+
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyProfileViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyProfileViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyProfileView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyProfileView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LegacyProfileView = function(profile, settingId)
+{
+ WebInspector.ContentView.call(this, profile);
+
+ this._profile = profile;
+
+ this.element.classList.add("profile-view");
+
+ this.showTimeAsPercent = new WebInspector.Setting(settingId, true);
+ this.showTimeAsPercentNavigationItem = new WebInspector.ActivateButtonNavigationItem("selector-profiler-show-time-as-percent-navigation-item", WebInspector.UIString("Show times as percentages"), WebInspector.UIString("Show times as absolute times"), "Images/Percent.svg", 16, 16);
+ this.showTimeAsPercentNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggleTimeDisplay, this);
+ this.showTimeAsPercentNavigationItem.activated = this.showTimeAsPercent.value;
+
+ if (profile.recording) {
+ this._showRecordingMessage();
+ profile.addEventListener(WebInspector.LegacyProfileObject.Event.FinshedRecording, this._profileFinishedRecording, this);
+ } else
+ this.displayProfile();
+};
+
+WebInspector.LegacyProfileView.prototype = {
+ constructor: WebInspector.LegacyProfileView,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this.showTimeAsPercentNavigationItem];
+ },
+
+ get allowedNavigationSidebarPanels()
+ {
+ return ["instrument"];
+ },
+
+ get profile()
+ {
+ return this._profile;
+ },
+
+ set profile(profile)
+ {
+ this._profile = profile;
+ },
+
+ toggleTimeDisplay: function(event)
+ {
+ this.showTimeAsPercentNavigationItem.activated = !this.showTimeAsPercentNavigationItem.activated;
+ },
+
+ displayProfile: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ get recordingTitle()
+ {
+ return WebInspector.UIString("Recording\u2026");
+ },
+
+ // Private
+
+ _profileFinishedRecording: function()
+ {
+ this._hideRecordingMessage();
+ this.displayProfile();
+ },
+
+ _showRecordingMessage: function()
+ {
+ this._recordingMessageContainer = this.element.appendChild(document.createElement("div"));
+ this._recordingMessageContainer.className = "recording-profile-view";
+ this._recordingMessageContainer.appendChild(new WebInspector.IndeterminateProgressSpinner().element);
+ this._recordingMessageContainer.appendChild(document.createElement("span")).textContent = this.recordingTitle;
+ },
+
+ _hideRecordingMessage: function()
+ {
+ if (this._recordingMessageContainer)
+ this._recordingMessageContainer.remove();
+ }
+};
+
+WebInspector.LegacyProfileView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyTopDownProfileDataGridTreejsfromrev164541trunkSourceWebInspectorUIUserInterfaceLegacyTopDownProfileDataGridTreejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyTopDownProfileDataGridTree.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LegacyTopDownProfileDataGridTree.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyTopDownProfileDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyTopDownProfileDataGridTree.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2009 280 North Inc. 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 APPLE INC. ``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 APPLE INC. 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.LegacyTopDownProfileDataGridNode = function(profileNode, owningTree)
+{
+ var hasChildren = (profileNode.children && profileNode.children.length);
+
+ WebInspector.LegacyProfileDataGridNode.call(this, profileNode, owningTree, hasChildren);
+
+ this._remainingChildren = profileNode.children;
+}
+
+WebInspector.LegacyTopDownProfileDataGridNode.prototype = {
+ _sharedPopulate: function()
+ {
+ var children = this._remainingChildren;
+ var childrenLength = children.length;
+
+ for (var i = 0; i < childrenLength; ++i)
+ this.appendChild(new WebInspector.LegacyTopDownProfileDataGridNode(children[i], this.tree, false, this.showTimeAsPercent));
+
+ this._remainingChildren = null;
+ },
+
+ _exclude: function(aCallUID)
+ {
+ if (this._remainingChildren)
+ this._populate();
+
+ this._save();
+
+ var children = this.children;
+ var index = this.children.length;
+
+ while (index--)
+ children[index]._exclude(aCallUID);
+
+ var child = this.childrenByCallUID[aCallUID];
+
+ if (child)
+ this._merge(child, true);
+ }
+}
+
+WebInspector.LegacyTopDownProfileDataGridNode.prototype.__proto__ = WebInspector.LegacyProfileDataGridNode.prototype;
+
+WebInspector.LegacyTopDownProfileDataGridTree = function(profileNode)
+{
+ WebInspector.LegacyProfileDataGridTree.call(this, profileNode);
+
+ this._remainingChildren = profileNode.children;
+
+ WebInspector.LegacyTopDownProfileDataGridNode.prototype._populate.call(this);
+}
+
+WebInspector.LegacyTopDownProfileDataGridTree.prototype = {
+ focus: function(profileDataGrideNode)
+ {
+ if (!profileDataGrideNode)
+ return;
+
+ this._save();
+ profileDataGrideNode.savePosition();
+
+ this.children = [profileDataGrideNode];
+ this.totalTime = profileDataGrideNode.totalTime;
+ },
+
+ exclude: function(profileDataGrideNode)
+ {
+ if (!profileDataGrideNode)
+ return;
+
+ this._save();
+
+ var excludedCallUID = profileDataGrideNode.callUID;
+
+ WebInspector.LegacyTopDownProfileDataGridNode.prototype._exclude.call(this, excludedCallUID);
+
+ if (this.lastComparator)
+ this.sort(this.lastComparator, true);
+ },
+
+ restore: function()
+ {
+ if (!this._savedChildren)
+ return;
+
+ this.children[0].restorePosition();
+
+ WebInspector.LegacyProfileDataGridTree.prototype.restore.call(this);
+ },
+
+ _merge: WebInspector.LegacyTopDownProfileDataGridNode.prototype._merge,
+
+ _sharedPopulate: WebInspector.LegacyTopDownProfileDataGridNode.prototype._sharedPopulate
+}
+
+WebInspector.LegacyTopDownProfileDataGridTree.prototype.__proto__ = WebInspector.LegacyProfileDataGridTree.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLogContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,435 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.log {
+ overflow-y: overlay;
+ overflow-x: hidden;
+}
+
+.console-messages {
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+
+ word-wrap: break-word;
+
+ font-family: Menlo, monospace;
+ font-size: 11px;
+
+ min-height: 100%;
+}
+
+.console-messages > :first-child {
+ margin-top: auto;
+}
+
+.console-item {
+ border-top: 1px solid rgb(240, 240, 240);
+}
+
+.console-group.new-session .console-group-messages .console-item:first-child {
+ border-top: none;
+}
+
+.console-item.selected {
+ background-color: rgb(212, 212, 212);
+}
+
+.console-messages:focus .console-item.selected {
+ background-color: highlight;
+}
+
+.console-user-command-result.console-log-level::before {
+ background-image: url(../Images/UserInputResult.svg);
+}
+
+.console-message, .console-user-command {
+ position: relative;
+ padding: 2px 12px 2px 18px;
+ min-height: 16px;
+}
+
+.console-message::before, .console-user-command::before, .javascript-prompt::before, .console-group-title::before {
+ position: absolute;
+ display: block;
+ content: "";
+ left: 4px;
+ top: 8px;
+ width: 10px;
+ height: 10px;
+ margin-top: -5px;
+}
+
+.console-message .bubble {
+ display: inline-block;
+ height: 14px;
+ background-color: rgb(128, 151, 189);
+ vertical-align: middle;
+ white-space: nowrap;
+ padding: 1px 4px;
+ margin-top: -2px;
+ margin-right: 4px;
+ margin-left: -18px;
+ text-align: left;
+ font-size: 11px;
+ line-height: normal;
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: bold;
+ text-shadow: none;
+ color: white;
+ border-radius: 7px;
+
+ float: left;
+ margin-top: 0;
+ margin-left: 2px;
+}
+
+.console-message-text {
+ white-space: pre-wrap;
+}
+
+.console-message-text > span {
+ -webkit-user-select: text;
+}
+
+.console-group-title {
+ font-weight: bold;
+}
+
+.console-group-title::before {
+ background-image: -webkit-canvas(disclosure-triangle-small-open-normal);
+ background-size: 13px 13px;
+ top: 6px;
+ width: 13px;
+ height: 13px;
+ left: 3px;
+}
+
+.console-group.collapsed .console-group-title::before {
+ background-image: -webkit-canvas(disclosure-triangle-small-closed-normal);
+}
+
+.console-group.collapsed > .console-group-messages {
+ display: none;
+}
+
+.console-group {
+ position: relative;
+}
+
+.console-group.new-session {
+ border-top: 3px dashed rgb(240, 240, 240);
+}
+
+.console-error-level .console-message-text, .console-error-level .section .header .title {
+ color: red !important;
+}
+
+.console-debug-level .console-message-text {
+ color: blue;
+}
+
+.console-debug-level::before {
+ background-color: blue;
+}
+
+.console-error-level::before {
+ background-image: url(../Images/Error.svg);
+ background-size: 10px 10px;
+}
+
+.console-warning-level::before {
+ background-image: url(../Images/Warning.svg);
+ background-size: 10px 10px;
+}
+
+.console-user-command .console-message {
+ margin-left: -24px;
+ padding-right: 0;
+}
+
+.console-user-command::before {
+ background-image: url(../Images/UserInputPromptPrevious.svg);
+}
+
+.console-user-command > .console-message-text {
+ color: rgb(0, 128, 255);
+}
+
+.console-messages a {
+ color: rgb(33%, 33%, 33%);
+ cursor: pointer;
+}
+
+.console-messages a:hover {
+ color: rgb(15%, 15%, 15%);
+}
+
+.console-message-url {
+ float: right;
+ margin-left: 4px;
+ font-weight: normal;
+}
+
+.console-group-messages .section {
+ margin: 0 0 0 12px !important;
+}
+
+.console-group-messages .section .header {
+ padding: 0 8px 0 0;
+ background-image: none;
+ border: none;
+ min-height: 0;
+}
+
+.console-group-messages .section .header::before {
+ top: 2px;
+ left: 1px;
+}
+
+.console-group-messages .section .header .title {
+ color: black;
+ font-weight: normal;
+ line-height: normal;
+}
+
+.console-group-messages .section .properties li .info {
+ padding-top: 0;
+ padding-bottom: 0;
+ color: rgb(60%, 60%, 60%);
+}
+
+.console-group-messages .outline-disclosure {
+ outline: none;
+ padding-left: 0;
+}
+
+.console-group-messages .outline-disclosure > ol {
+ padding: 0 0 0 12px !important;
+}
+
+.console-group-messages .outline-disclosure, .console-group-messages .outline-disclosure ol {
+ font-size: inherit;
+ line-height: 12px;
+}
+
+.console-group-messages .outline-disclosure.single-node li {
+ padding-left: 2px;
+}
+
+.console-group-messages .outline-disclosure li .selection {
+ margin-left: -6px;
+ margin-right: -6px;
+}
+
+.console-group-messages .add-attribute {
+ display: none;
+}
+
+.console-formatted-object, .console-formatted-node {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ color: black;
+}
+
+.console-formatted-object .section, .console-formatted-node .section {
+ position: static;
+}
+
+.console-formatted-object .properties, .console-formatted-node .properties {
+ padding-left: 0 !important;
+}
+
+.console-formatted-number {
+ color: rgb(28, 0, 207);
+}
+
+.console-formatted-string, .console-formatted-regexp {
+ color: rgb(196, 26, 22);
+ white-space: pre;
+}
+
+.console-formatted-null, .console-formatted-undefined {
+ color: rgb(128, 128, 128);
+}
+
+.error-message {
+ color: red;
+}
+
+.auto-complete-text, .editing .auto-complete-text {
+ color: rgb(128, 128, 128) !important;
+ -webkit-user-modify: read-only;
+}
+
+.outline-disclosure li.hovered:not(.selected) .selection {
+ display: block;
+ left: 3px;
+ right: 3px;
+ background-color: rgba(56, 121, 217, 0.1);
+ border-radius: 5px;
+}
+
+.outline-disclosure li.highlighted .highlight {
+ background-color: rgb(255, 230, 179);
+ border-radius: 4px;
+ padding-bottom: 2px;
+ margin-bottom: -2px;
+}
+
+.outline-disclosure li.selected.highlighted .highlight {
+ background-color: transparent;
+ padding-bottom: 0;
+ margin-bottom: 0;
+}
+
+.outline-disclosure li .selection {
+ display: none;
+ position: absolute;
+ left: 0;
+ right: 0;
+ height: 15px;
+ z-index: -1;
+}
+
+.outline-disclosure li.selected .selection {
+ display: block;
+ background-color: rgb(212, 212, 212);
+}
+
+.outline-disclosure li.elements-drag-over .selection {
+ display: block;
+ margin-top: -2px;
+ border-top: 2px solid rgb(56, 121, 217);
+}
+
+.outline-disclosure ol:focus li.selected .selection {
+ background-color: rgb(56, 121, 217);
+}
+
+.outline-disclosure ol.search-match-not-found li.selected .selection {
+ border: 1px solid rgb(56, 121, 217);
+ background-color: white;
+}
+
+.outline-disclosure {
+ font-size: 11px;
+}
+
+.outline-disclosure > ol {
+ position: relative;
+ padding: 2px 6px !important;
+ margin: 0;
+ color: black;
+ cursor: default;
+ min-width: 100%;
+}
+
+.outline-disclosure, .outline-disclosure ol {
+ list-style-type: none;
+ -webkit-padding-start: 12px;
+ margin: 0;
+}
+
+.outline-disclosure li {
+ padding: 0 0 0 14px;
+ margin-top: 1px;
+ margin-bottom: 1px;
+ margin-left: -2px;
+ word-wrap: break-word;
+}
+
+.outline-disclosure li.parent {
+ margin-left: -12px
+}
+
+.outline-disclosure li .webkit-html-tag.close {
+ margin-left: -12px;
+}
+
+.outline-disclosure li.parent::before {
+ float: left;
+
+ content: "";
+
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
+ background-size: 8px 8px;
+ background-repeat: no-repeat;
+
+ width: 8px;
+ height: 8px;
+
+ margin-top: 2px;
+ padding-right: 2px;
+}
+
+.outline-disclosure li.parent.expanded::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
+}
+
+.outline-disclosure ol.children {
+ display: none;
+}
+
+.outline-disclosure ol.children.expanded {
+ display: block;
+}
+
+.webkit-html-fragment.shadow {
+ opacity: 0.6;
+}
+
+.console-item.filtered-out {
+ display: none;
+}
+
+.log-search-bar > input {
+ width: 150px;
+}
+
+.search-in-progress .console-item.filtered-out-by-search {
+ display: none;
+}
+
+.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted {
+ color: black;
+ background-color: rgba(235, 215, 38, 0.2);
+ border-bottom: 1px solid rgb(237, 202, 71);
+}
+
+.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted.selected {
+ background-color: rgba(235, 215, 38, 0.75);
+}
+
+/* @media reader currently blocked by: http://webkit.org/b/118096 */
+@media reader {
+ .console-user-command::before,
+ .console-messages:focus .console-item.selected .console-user-command::before,
+ .console-user-command-result.console-log-level::before,
+ .console-messages:focus .console-item.selected .console-user-command-result.console-log-level::before {
+ /* accessible label alternative for icon indicating console input/output/warning/error, etc. */
+ content: attr(data-labelprefix);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLogContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,947 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogContentView = function(representedObject)
+{
+ WebInspector.ContentView.call(this, representedObject);
+
+ this._nestingLevel = 0;
+ this._selectedMessages = [];
+
+ this.element.classList.add(WebInspector.LogContentView.StyleClassName);
+
+ this.messagesElement = document.createElement("div");
+ this.messagesElement.className = "console-messages";
+ this.messagesElement.tabIndex = 0;
+ this.messagesElement.setAttribute("role", "log");
+ this.messagesElement.addEventListener("mousedown", this._mousedown.bind(this));
+ this.messagesElement.addEventListener("focus", this._didFocus.bind(this));
+ this.messagesElement.addEventListener("blur", this._didBlur.bind(this));
+ this.messagesElement.addEventListener("keydown", this._keyDown.bind(this));
+ this.messagesElement.addEventListener("click", this._click.bind(this), true);
+ this.messagesElement.addEventListener("dragstart", this._ondragstart.bind(this), true);
+ this.element.appendChild(this.messagesElement);
+
+ this.prompt = WebInspector.quickConsole.prompt;
+
+ this._keyboardShortcutCommandA = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl, "A");
+ this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
+
+ this._logViewController = new WebInspector.JavaScriptLogViewController(this.messagesElement, this.element, this.prompt, this, "console-prompt-history");
+
+ this._searchBar = new WebInspector.SearchBar("log-search-bar", WebInspector.UIString("Filter Console Log"), this);
+ this._searchBar.addEventListener(WebInspector.SearchBar.Event.TextChanged, this._searchTextDidChange, this);
+
+ var scopeBarItems = [
+ new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.All, WebInspector.UIString("All"), true),
+ new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Errors, WebInspector.UIString("Errors")),
+ new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Warnings, WebInspector.UIString("Warnings")),
+ new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Logs, WebInspector.UIString("Logs"))
+ ];
+
+ this._scopeBar = new WebInspector.ScopeBar("log-scope-bar", scopeBarItems, scopeBarItems[0]);
+ this._scopeBar.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged, this._scopeBarSelectionDidChange, this);
+
+ this._clearLogNavigationItem = new WebInspector.ButtonNavigationItem("clear-log", WebInspector.UIString("Clear log (%s or %s)").format(this._logViewController.messagesClearKeyboardShortcut.displayName, this._logViewController.messagesAlternateClearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 16, 16);
+ this._clearLogNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearLog, this);
+
+ var toolTip = WebInspector.UIString("Show split console");
+ var altToolTip = WebInspector.UIString("Show full-height console");
+
+ this._toggleSplitNavigationItem = new WebInspector.ToggleButtonNavigationItem("split-toggle", toolTip, altToolTip, "Images/SplitToggleDown.svg", "Images/SplitToggleUp.svg", 16, 16);
+ this._toggleSplitNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleSplit, this);
+ this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole();
+
+ this.messagesElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false);
+
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._sessionsCleared, this);
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.SessionStarted, this._sessionStarted, this);
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, this._messageAdded, this);
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, this._previousMessageRepeatCountUpdated, this);
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._activeLogCleared, this);
+}
+
+WebInspector.LogContentView.Scopes = {
+ All: "log-all",
+ Errors: "log-errors",
+ Warnings: "log-warnings",
+ Logs: "log-logs"
+};
+
+WebInspector.LogContentView.StyleClassName = "log";
+WebInspector.LogContentView.ItemWrapperStyleClassName = "console-item";
+WebInspector.LogContentView.FilteredOutStyleClassName = "filtered-out";
+WebInspector.LogContentView.SelectedStyleClassName = "selected";
+WebInspector.LogContentView.SearchInProgressStyleClassName = "search-in-progress";
+WebInspector.LogContentView.FilteredOutBySearchStyleClassName = "filtered-out-by-search";
+WebInspector.LogContentView.HighlightedStyleClassName = "highlighted";
+
+WebInspector.LogContentView.prototype = {
+ constructor: WebInspector.LogContentView,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this._searchBar, this._scopeBar, this._clearLogNavigationItem, this._toggleSplitNavigationItem];
+ },
+
+ get scopeBar()
+ {
+ return this._scopeBar;
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.ContentView.prototype.updateLayout.call(this);
+
+ this._scrollElementHeight = this.messagesElement.getBoundingClientRect().height;
+ },
+
+ shown: function()
+ {
+ this._toggleSplitNavigationItem.toggled = WebInspector.isShowingSplitConsole();
+
+ this.prompt.focus();
+ },
+
+ get scrollableElements()
+ {
+ return [this.element];
+ },
+
+ get shouldKeepElementsScrolledToBottom()
+ {
+ return true;
+ },
+
+ get searchInProgress()
+ {
+ return this.messagesElement.classList.contains(WebInspector.LogContentView.SearchInProgressStyleClassName);
+ },
+
+ didClearMessages: function()
+ {
+ if (this._ignoreDidClearMessages)
+ return;
+ WebInspector.logManager.requestClearMessages();
+ },
+
+ didAppendConsoleMessage: function(message)
+ {
+ WebInspector.quickConsole.updateLayout();
+
+ // Nest the message.
+ if (message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup) {
+ var x = 16 * this._nestingLevel;
+ var messageElement = message.toMessageElement();
+ messageElement.style.left = x + "px";
+ messageElement.style.width = "calc(100% - " + x + "px)";
+ }
+
+ // Update the nesting level.
+ switch (message.type) {
+ case WebInspector.ConsoleMessage.MessageType.StartGroup:
+ case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
+ ++this._nestingLevel;
+ break;
+ case WebInspector.ConsoleMessage.MessageType.EndGroup:
+ --this._nestingLevel;
+ break;
+ }
+
+ this._clearFocusableChildren();
+
+ // Some results don't populate until further backend dispatches occur (like the DOM tree).
+ // We want to remove focusable children after those pending dispatches too.
+ InspectorBackend.runAfterPendingDispatches(this._clearFocusableChildren.bind(this));
+
+ // We only auto show the console if the message is a result.
+ // This is when the user evaluated something directly in the prompt.
+ if (message.type !== WebInspector.ConsoleMessage.MessageType.Result)
+ return;
+
+ if (!WebInspector.isShowingConsoleView())
+ WebInspector.showSplitConsole();
+
+ this._logViewController.scrollToBottom();
+ },
+
+ promptDidChangeHeight: function()
+ {
+ WebInspector.quickConsole.updateLayout();
+ },
+
+ get supportsSave()
+ {
+ return true;
+ },
+
+ get saveData()
+ {
+ return {url: "web-inspector:///Console.txt", content: this._formatMessagesAsData(false), forceSaveAs: true};
+ },
+
+ handleCopyEvent: function(event)
+ {
+ if (!this._selectedMessages.length)
+ return;
+
+ event.clipboardData.setData("text/plain", this._formatMessagesAsData(true));
+ event.stopPropagation();
+ event.preventDefault();
+ },
+
+ focusSearchBar: function()
+ {
+ this._searchBar.focus();
+ },
+
+ highlightPreviousSearchMatch: function()
+ {
+ if (!this.searchInProgress || isEmptyObject(this._searchMatches))
+ return;
+
+ var index = this._selectedSearchMatch ? this._searchMatches.indexOf(this._selectedSearchMatch) : this._searchMatches.length;
+ this._highlightSearchMatchAtIndex(index - 1);
+ },
+
+ highlightNextSearchMatch: function()
+ {
+ if (!this.searchInProgress || isEmptyObject(this._searchMatches))
+ return;
+
+ var index = this._selectedSearchMatch ? this._searchMatches.indexOf(this._selectedSearchMatch) + 1 : 0;
+ this._highlightSearchMatchAtIndex(index);
+ },
+
+ searchBarWantsToLoseFocus: function(searchBar)
+ {
+ if (this._selectedMessages.length)
+ this.messagesElement.focus();
+ else
+ this.prompt.focus();
+ },
+
+ searchBarDidActivate: function(searchBar)
+ {
+ if (!isEmptyObject(this._searchMatches))
+ this._highlightSearchMatchAtIndex(0);
+ this.prompt.focus();
+ },
+
+ // Private
+
+ _formatMessagesAsData: function(onlySelected)
+ {
+ var messages = this._allMessages();
+
+ if (onlySelected) {
+ messages = this._allMessages().filter(function(message) {
+ return message.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName);
+ });
+ }
+
+ var data = "";
+
+ var isPrefixOptional = messages.length <= 1 && onlySelected;
+ messages.forEach(function (messageElement, index) {
+ var messageObject = messageElement.message;
+ if (!messageObject)
+ messageObject = messageElement.command;
+ if (!messageObject)
+ return;
+
+ if (index > 0)
+ data += "\n";
+ data += messageObject.toClipboardString(isPrefixOptional);
+ });
+
+ return data;
+ },
+
+ _sessionsCleared: function(event)
+ {
+ this._ignoreDidClearMessages = true;
+ this._logViewController.clear();
+ this._ignoreDidClearMessages = false;
+ },
+
+ _sessionStarted: function(event)
+ {
+ this._logViewController.startNewSession();
+ },
+
+ _messageAdded: function(event)
+ {
+ var message = this._logViewController.appendConsoleMessage(event.data.message);
+ if (message.type !== WebInspector.ConsoleMessage.MessageType.EndGroup)
+ this._filterMessages([message.toMessageElement()]);
+ },
+
+ _previousMessageRepeatCountUpdated: function(event)
+ {
+ this._logViewController.updatePreviousMessageRepeatCount(event.data.count);
+ },
+
+ _handleContextMenuEvent: function(event)
+ {
+ if (!window.getSelection().isCollapsed) {
+ // If there is a selection, we want to show our normal context menu
+ // (with Copy, etc.), and not Clear Log.
+ return;
+ }
+
+ // We don't want to show the custom menu for links in the console.
+ if (event.target.enclosingNodeOrSelfWithNodeName("a"))
+ return;
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+ contextMenu.appendItem(WebInspector.UIString("Clear Log"), this._clearLog.bind(this));
+ contextMenu.show();
+ },
+
+ _mousedown: function(event)
+ {
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ if (event.defaultPrevented) {
+ // Default was prevented on the event, so this means something deeper (like a disclosure triangle)
+ // handled the mouse down. In this case we want to clear the selection and don't make a new selection.
+ this._clearMessagesSelection();
+ return;
+ }
+
+ if (!this._focused) {
+ this.messagesElement.focus();
+ if (this._selectedMessages.length)
+ return;
+ }
+
+ this._mouseDownWrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
+ this._mouseDownShiftKey = event.shiftKey;
+ this._mouseDownCommandKey = event.metaKey;
+ this._mouseMoveIsRowSelection = false;
+
+ window.addEventListener("mousemove", this);
+ window.addEventListener("mouseup", this);
+ },
+
+ _targetInMessageCanBeSelected: function(target, message)
+ {
+ if (target.enclosingNodeOrSelfWithNodeName("a"))
+ return false;
+ return true;
+ },
+
+ _mousemove: function(event)
+ {
+ var selection = window.getSelection();
+ var wrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
+
+ if (!wrapper) {
+ // No wrapper under the mouse, so look at the selection to try and find one.
+ if (!selection.isCollapsed) {
+ wrapper = selection.focusNode.parentNode.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
+ selection.removeAllRanges();
+ }
+
+ if (!wrapper)
+ return;
+ }
+
+ if (!selection.isCollapsed)
+ this._clearMessagesSelection();
+
+ if (wrapper === this._mouseDownWrapper && !this._mouseMoveIsRowSelection)
+ return;
+
+ selection.removeAllRanges();
+
+ if (!this._mouseMoveIsRowSelection)
+ this._updateMessagesSelection(this._mouseDownWrapper.messageElement, this._mouseDownCommandKey, this._mouseDownShiftKey);
+ this._updateMessagesSelection(wrapper.messageElement, false, true);
+
+ this._mouseMoveIsRowSelection = true;
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _mouseup: function(event)
+ {
+ window.removeEventListener("mousemove", this);
+ window.removeEventListener("mouseup", this);
+
+ var selection = window.getSelection();
+ var wrapper = event.target.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName);
+
+ if (wrapper && (selection.isCollapsed || event.shiftKey)) {
+ selection.removeAllRanges();
+
+ var message = wrapper.messageElement;
+ if (this._targetInMessageCanBeSelected(event.target, message)) {
+ var sameWrapper = wrapper === this._mouseDownWrapper;
+ this._mouseInteractionShouldPreventClickPropagation = !this._isMessageSelected(message);
+ this._updateMessagesSelection(message, sameWrapper ? this._mouseDownCommandKey : false, sameWrapper ? this._mouseDownShiftKey : true);
+ }
+ } else if (!selection.isCollapsed) {
+ // There is a text selection, clear the row selection.
+ this._clearMessagesSelection();
+ } else if (!this._mouseDownWrapper) {
+ // The mouse didn't hit a console item, so clear the row selection.
+ this._clearMessagesSelection();
+
+ // Focus the prompt. Focusing the prompt needs to happen after the click to work.
+ setTimeout(function () { this.prompt.focus() }.bind(this), 0);
+ }
+
+ delete this._mouseMoveIsRowSelection;
+ delete this._mouseDownWrapper;
+ delete this._mouseDownShiftKey;
+ delete this._mouseDownCommandKey;
+ },
+
+ _click: function(event)
+ {
+ if (!this._mouseInteractionShouldPreventClickPropagation)
+ return;
+
+ event.stopPropagation();
+ delete this._mouseInteractionShouldPreventClickPropagation;
+ },
+
+ _ondragstart: function(event)
+ {
+ if (event.target.enclosingNodeOrSelfWithClass(WebInspector.DOMTreeOutline.StyleClassName)) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ },
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mousemove":
+ this._mousemove(event);
+ break;
+ case "mouseup":
+ this._mouseup(event);
+ break;
+ }
+ },
+
+ _updateMessagesSelection: function(message, multipleSelection, rangeSelection)
+ {
+ var alreadySelectedMessage = this._selectedMessages.contains(message);
+ if (alreadySelectedMessage && this._selectedMessages.length && multipleSelection) {
+ message.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+ this._selectedMessages.remove(message);
+ return;
+ }
+
+ if (!multipleSelection && !rangeSelection)
+ this._clearMessagesSelection();
+
+ if (rangeSelection) {
+ var messages = this._visibleMessages();
+
+ var refIndex = this._referenceMessageForRangeSelection ? messages.indexOf(this._referenceMessageForRangeSelection) : 0;
+ var targetIndex = messages.indexOf(message);
+
+ var newRange = [Math.min(refIndex, targetIndex), Math.max(refIndex, targetIndex)];
+
+ if (this._selectionRange && this._selectionRange[0] === newRange[0] && this._selectionRange[1] === newRange[1])
+ return;
+
+ var startIndex = this._selectionRange ? Math.min(this._selectionRange[0], newRange[0]) : newRange[0];
+ var endIndex = this._selectionRange ? Math.max(this._selectionRange[1], newRange[1]) : newRange[1];
+
+ for (var i = startIndex; i <= endIndex; ++i) {
+ var messageInRange = messages[i];
+ if (i >= newRange[0] && i <= newRange[1] && !messageInRange.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName)) {
+ messageInRange.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
+ this._selectedMessages.push(messageInRange);
+ } else if (i < newRange[0] || i > newRange[1] && messageInRange.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName)) {
+ messageInRange.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+ this._selectedMessages.remove(messageInRange);
+ }
+ }
+
+ this._selectionRange = newRange;
+ } else {
+ message.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
+ this._selectedMessages.push(message);
+ }
+
+ if (!rangeSelection)
+ this._referenceMessageForRangeSelection = message;
+
+ if (!alreadySelectedMessage)
+ this._ensureMessageIsVisible(this._selectedMessages.lastValue);
+ },
+
+ _ensureMessageIsVisible: function(message)
+ {
+ if (!message)
+ return;
+
+ var y = this._positionForMessage(message).y;
+ if (y < 0) {
+ this.element.scrollTop += y;
+ return;
+ }
+
+ var nextMessage = this._nextMessage(message);
+ if (nextMessage) {
+ y = this._positionForMessage(nextMessage).y;
+ if (y > this._scrollElementHeight)
+ this.element.scrollTop += y - this._scrollElementHeight;
+ } else {
+ y += message.getBoundingClientRect().height;
+ if (y > this._scrollElementHeight)
+ this.element.scrollTop += y - this._scrollElementHeight;
+ }
+ },
+
+ _positionForMessage: function(message)
+ {
+ var pagePoint = window.webkitConvertPointFromNodeToPage(message, new WebKitPoint(0, 0));
+ return window.webkitConvertPointFromPageToNode(this.element, pagePoint);
+ },
+
+ _isMessageVisible: function(message)
+ {
+ var node = message.parentNode;
+
+ if (node.classList.contains(WebInspector.LogContentView.FilteredOutStyleClassName))
+ return false;
+
+ if (this.searchInProgress && node.classList.contains(WebInspector.LogContentView.FilteredOutBySearchStyleClassName))
+ return false;
+
+ if (message.classList.contains("console-group-title"))
+ node = node.parentNode.parentNode;
+
+ while (node && node !== this.messagesElement) {
+ if (node.classList.contains("collapsed"))
+ return false;
+ node = node.parentNode;
+ }
+
+ return true;
+ },
+
+ _isMessageSelected: function(message)
+ {
+ return message.parentNode.classList.contains(WebInspector.LogContentView.SelectedStyleClassName);
+ },
+
+ _clearMessagesSelection: function()
+ {
+ this._selectedMessages.forEach(function(message) {
+ message.parentNode.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+ });
+ this._selectedMessages = [];
+ delete this._referenceMessageForRangeSelection;
+ },
+
+ _selectAllMessages: function()
+ {
+ this._clearMessagesSelection();
+
+ var messages = this._visibleMessages();
+ for (var i = 0; i < messages.length; ++i) {
+ var message = messages[i];
+ message.parentNode.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
+ this._selectedMessages.push(message);
+ }
+ },
+
+ _allMessages: function()
+ {
+ return Array.prototype.slice.call(this.messagesElement.querySelectorAll(".console-message, .console-user-command"));
+ },
+
+ _unfilteredMessages: function()
+ {
+ return this._allMessages().filter(function(message) {
+ return !message.parentNode.classList.contains(WebInspector.LogContentView.FilteredOutStyleClassName);
+ });
+ },
+
+ _visibleMessages: function()
+ {
+ var unfilteredMessages = this._unfilteredMessages();
+
+ if (!this.searchInProgress)
+ return unfilteredMessages;
+
+ return unfilteredMessages.filter(function(message) {
+ return !message.parentNode.classList.contains(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
+ });
+ },
+
+ _activeLogCleared: function(event)
+ {
+ this._ignoreDidClearMessages = true;
+ this._logViewController.clear();
+ this._ignoreDidClearMessages = false;
+ },
+
+ _toggleSplit: function()
+ {
+ if (WebInspector.isShowingSplitConsole())
+ WebInspector.showFullHeightConsole();
+ else
+ WebInspector.showSplitConsole();
+ },
+
+ _clearLog: function()
+ {
+ this._logViewController.clear();
+ },
+
+ _scopeBarSelectionDidChange: function(event)
+ {
+ this._filterMessages(this._allMessages());
+ },
+
+ _filterMessages: function(messages)
+ {
+ var showsAll = this._scopeBar.item(WebInspector.LogContentView.Scopes.All).selected;
+ var showsErrors = this._scopeBar.item(WebInspector.LogContentView.Scopes.Errors).selected;
+ var showsWarnings = this._scopeBar.item(WebInspector.LogContentView.Scopes.Warnings).selected;
+ var showsLogs = this._scopeBar.item(WebInspector.LogContentView.Scopes.Logs).selected;
+
+ messages.forEach(function(message) {
+ var visible = showsAll || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult;
+ if (!visible) {
+ switch(message.message.level) {
+ case WebInspector.ConsoleMessage.MessageLevel.Warning:
+ visible = showsWarnings;
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Error:
+ visible = showsErrors;
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Log:
+ visible = showsLogs;
+ break;
+ }
+ }
+
+ var classList = message.parentNode.classList;
+ if (visible)
+ classList.remove(WebInspector.LogContentView.FilteredOutStyleClassName);
+ else {
+ this._selectedMessages.remove(message);
+ classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+ classList.add(WebInspector.LogContentView.FilteredOutStyleClassName);
+ }
+ }.bind(this));
+
+ this._performSearch();
+ },
+
+ _didFocus: function(event)
+ {
+ this._focused = true;
+ },
+
+ _didBlur: function(event)
+ {
+ this._focused = false;
+ },
+
+ _keyDown: function(event)
+ {
+ if (this._keyboardShortcutCommandA.matchesEvent(event))
+ this._commandAWasPressed(event);
+ else if (this._keyboardShortcutEsc.matchesEvent(event))
+ this._escapeWasPressed(event);
+ else if (event.keyIdentifier === "Up")
+ this._upArrowWasPressed(event);
+ else if (event.keyIdentifier === "Down")
+ this._downArrowWasPressed(event);
+ else if (event.keyIdentifier === "Left")
+ this._leftArrowWasPressed(event);
+ else if (event.keyIdentifier === "Right")
+ this._rightArrowWasPressed(event);
+ },
+
+ _commandAWasPressed: function(event)
+ {
+ this._selectAllMessages();
+ event.preventDefault();
+ },
+
+ _escapeWasPressed: function(event)
+ {
+ if (this._selectedMessages.length)
+ this._clearMessagesSelection();
+ else
+ this.prompt.focus();
+
+ event.preventDefault();
+ },
+
+ _upArrowWasPressed: function(event)
+ {
+ var messages = this._visibleMessages();
+
+ if (!this._selectedMessages.length) {
+ if (messages.length)
+ this._updateMessagesSelection(messages.lastValue, false, false);
+ return;
+ }
+
+ var lastMessage = this._selectedMessages.lastValue;
+ var previousMessage = this._previousMessage(lastMessage);
+ if (previousMessage)
+ this._updateMessagesSelection(previousMessage, false, event.shiftKey);
+ else if (!event.shiftKey) {
+ this._clearMessagesSelection();
+ this._updateMessagesSelection(messages[0], false, false);
+ }
+
+ event.preventDefault();
+ },
+
+ _downArrowWasPressed: function(event)
+ {
+ var messages = this._visibleMessages();
+
+ if (!this._selectedMessages.length) {
+ if (messages.length)
+ this._updateMessagesSelection(messages[0], false, false);
+ return;
+ }
+
+ var lastMessage = this._selectedMessages.lastValue;
+ var nextMessage = this._nextMessage(lastMessage);
+ if (nextMessage)
+ this._updateMessagesSelection(nextMessage, false, event.shiftKey);
+ else if (!event.shiftKey) {
+ this._clearMessagesSelection();
+ this._updateMessagesSelection(messages.lastValue, false, false);
+ }
+
+ event.preventDefault();
+ },
+
+ _leftArrowWasPressed: function(event)
+ {
+ if (this._selectedMessages.length !== 1)
+ return;
+
+ var currentMessage = this._selectedMessages[0];
+ if (currentMessage.classList.contains("console-group-title"))
+ currentMessage.parentNode.parentNode.classList.add("collapsed");
+ else {
+ var outlineTitle = currentMessage.querySelector("ol.outline-disclosure > li.parent");
+ if (outlineTitle) {
+ if (event.altKey)
+ outlineTitle.treeElement.collapseRecursively();
+ else
+ outlineTitle.treeElement.collapse();
+ } else {
+ var outlineSection = currentMessage.querySelector(".console-formatted-object > .section");
+ if (outlineSection)
+ outlineSection._section.collapse();
+ }
+ }
+ },
+
+ _rightArrowWasPressed: function(event)
+ {
+ if (this._selectedMessages.length !== 1)
+ return;
+
+ var currentMessage = this._selectedMessages[0];
+ if (currentMessage.classList.contains("console-group-title"))
+ currentMessage.parentNode.parentNode.classList.remove("collapsed");
+ else {
+ var outlineTitle = currentMessage.querySelector("ol.outline-disclosure > li.parent");
+ if (outlineTitle) {
+ outlineTitle.treeElement.onexpand = function() {
+ setTimeout(function () {
+ this._ensureMessageIsVisible(currentMessage);
+ this._clearFocusableChildren();
+ delete outlineTitle.treeElement.onexpand;
+ }.bind(this));
+ }.bind(this);
+
+ if (event.altKey)
+ outlineTitle.treeElement.expandRecursively();
+ else
+ outlineTitle.treeElement.expand();
+ } else {
+ var outlineSection = currentMessage.querySelector(".console-formatted-object > .section");
+ if (outlineSection) {
+ outlineSection._section.addEventListener(WebInspector.Section.Event.VisibleContentDidChange, this._propertiesSectionDidUpdateContent, this);
+ outlineSection._section.expand();
+ }
+ }
+ }
+ },
+
+ _propertiesSectionDidUpdateContent: function(event)
+ {
+ var section = event.target;
+ section.removeEventListener(WebInspector.Section.Event.VisibleContentDidChange, this._propertiesSectionDidUpdateContent, this);
+
+ var message = section.element.enclosingNodeOrSelfWithClass(WebInspector.LogContentView.ItemWrapperStyleClassName).messageElement;
+ if (!this._isMessageSelected(message))
+ return;
+
+ setTimeout(function () {
+ this._ensureMessageIsVisible(message);
+ this._clearFocusableChildren();
+ }.bind(this));
+ },
+
+ _previousMessage: function(message)
+ {
+ var messages = this._visibleMessages();
+ for (var i = messages.indexOf(message) - 1; i >= 0; --i) {
+ if (this._isMessageVisible(messages[i]))
+ return messages[i];
+ }
+ },
+
+ _nextMessage: function(message)
+ {
+ var messages = this._visibleMessages();
+ for (var i = messages.indexOf(message) + 1; i < messages.length; ++i) {
+ if (this._isMessageVisible(messages[i]))
+ return messages[i];
+ }
+ },
+
+ _clearFocusableChildren: function()
+ {
+ var focusableElements = this.messagesElement.querySelectorAll("[tabindex]");
+ for (var i = 0, count = focusableElements.length; i < count; ++i)
+ focusableElements[i].removeAttribute("tabindex");
+ },
+
+ _searchTextDidChange: function(event)
+ {
+ this._performSearch();
+ },
+
+ _performSearch: function()
+ {
+ if (!isEmptyObject(this._searchHighlightDOMChanges))
+ WebInspector.revertDomChanges(this._searchHighlightDOMChanges);
+
+ var searchTerms = this._searchBar.text;
+
+ if (searchTerms === "") {
+ delete this._selectedSearchMatch;
+ this._matchingSearchElements = [];
+ this.messagesElement.classList.remove(WebInspector.LogContentView.SearchInProgressStyleClassName);
+ return;
+ }
+
+ this.messagesElement.classList.add(WebInspector.LogContentView.SearchInProgressStyleClassName);
+
+ this._searchHighlightDOMChanges = [];
+ this._searchMatches = [];
+ this._selectedSearchMathIsValid = false;
+
+ var searchRegex = new RegExp(searchTerms.escapeForRegExp(), "gi");
+ this._unfilteredMessages().forEach(function(message) {
+ var matchRanges = [];
+ var text = message.textContent;
+ var match = searchRegex.exec(text);
+ while (match) {
+ matchRanges.push({ offset: match.index, length: match[0].length });
+ match = searchRegex.exec(text);
+ }
+
+ if (!isEmptyObject(matchRanges))
+ this._highlightRanges(message, matchRanges);
+
+ var classList = message.parentNode.classList;
+ if (!isEmptyObject(matchRanges) || message.command instanceof WebInspector.ConsoleCommand || message.message instanceof WebInspector.ConsoleCommandResult)
+ classList.remove(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
+ else
+ classList.add(WebInspector.LogContentView.FilteredOutBySearchStyleClassName);
+ }, this);
+
+ if (!this._selectedSearchMathIsValid && this._selectedSearchMatch) {
+ this._selectedSearchMatch.highlight.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+ delete this._selectedSearchMatch;
+ }
+ },
+
+ _highlightRanges: function(message, matchRanges)
+ {
+ var highlightedElements = WebInspector.highlightRangesWithStyleClass(message, matchRanges, WebInspector.LogContentView.HighlightedStyleClassName, this._searchHighlightDOMChanges);
+
+ console.assert(highlightedElements.length === matchRanges.length);
+
+ matchRanges.forEach(function (range, index) {
+ this._searchMatches.push({
+ message: message,
+ range: range,
+ highlight: highlightedElements[index]
+ });
+
+ if (this._selectedSearchMatch && !this._selectedSearchMathIsValid && this._selectedSearchMatch.message === message) {
+ this._selectedSearchMathIsValid = this._rangesOverlap(this._selectedSearchMatch.range, range);
+ if (this._selectedSearchMathIsValid) {
+ delete this._selectedSearchMatch;
+ this._highlightSearchMatchAtIndex(this._searchMatches.length - 1);
+ }
+ }
+ }, this);
+ },
+
+ _rangesOverlap: function(range1, range2)
+ {
+ return range1.offset <= range2.offset + range2.length && range2.offset <= range1.offset + range1.length;
+ },
+
+ _highlightSearchMatchAtIndex: function(index)
+ {
+ if (index >= this._searchMatches.length)
+ index = 0;
+ else if (index < 0)
+ index = this._searchMatches.length - 1;
+
+ if (this._selectedSearchMatch)
+ this._selectedSearchMatch.highlight.classList.remove(WebInspector.LogContentView.SelectedStyleClassName);
+
+ this._selectedSearchMatch = this._searchMatches[index];
+ this._selectedSearchMatch.highlight.classList.add(WebInspector.LogContentView.SelectedStyleClassName);
+
+ this._ensureMessageIsVisible(this._selectedSearchMatch.message);
+ }
+}
+
+WebInspector.LogContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogIconcssfromrev164541trunkSourceWebInspectorUIUserInterfaceLogIconcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LogIcon.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogIcon.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogIcon.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogIcon.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.log-icon .icon {
+ content: -webkit-image-set(url(../Images/Log.png) 1x, url(../Images/Log@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceLogTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/LogTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/LogTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.LogTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.LogObject);
+
+ WebInspector.GeneralTreeElement.call(this, WebInspector.LogTreeElement.StyleClassName, WebInspector.UIString("Console"), representedObject.startDate.toLocaleTimeString(), representedObject, false);
+
+ this._logObject = representedObject;
+
+ this.small = true;
+};
+
+WebInspector.LogTreeElement.StyleClassName = "log-icon";
+
+WebInspector.LogTreeElement.prototype = {
+ constructor: WebInspector.LogTreeElement,
+
+ // Public
+
+ get logObject()
+ {
+ return this._logObject;
+ }
+};
+
+WebInspector.LogTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsMaincssfromrev164541trunkSourceWebInspectorUIUserInterfaceMaincss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Main.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Main.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Main.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Main.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,257 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+* {
+ box-sizing: border-box;
+}
+
+body {
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ padding: 0;
+ margin: 0;
+
+ overflow: hidden;
+
+ -webkit-user-select: none;
+ -webkit-user-drag: none;
+
+ cursor: default;
+
+ -webkit-font-smoothing: subpixel-antialiased;
+
+ tab-size: 4; /* FIXME: This should be controlled by a setting. <rdar://problem/10593948> */
+}
+
+body.docked {
+ background-color: white;
+}
+
+body.docked.bottom {
+ border-top: 1px solid rgb(85, 85, 85);
+}
+
+body.docked.right {
+ border-left: 1px solid rgb(85, 85, 85);
+}
+
+#docked-resizer {
+ display: none;
+
+ z-index: 100;
+}
+
+body.docked #docked-resizer {
+ display: block;
+}
+
+body.docked.bottom #docked-resizer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+
+ cursor: row-resize;
+}
+
+body.docked.right #docked-resizer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 3px;
+
+ cursor: col-resize;
+}
+
+body.docked.bottom #toolbar {
+ cursor: row-resize;
+}
+
+body.docked.bottom #toolbar .item:not(.flexible-space) {
+ cursor: default;
+}
+
+#main {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ background-color: white;
+
+ /* The position and z-index are needed to make negative z-index work in the DOM tree. */
+ position: relative;
+ z-index: 0;
+}
+
+#navigation-sidebar {
+ width: 300px;
+}
+
+body.docked.right #navigation-sidebar.collapsed > .resizer {
+ pointer-events: none;
+}
+
+#content {
+ display: -webkit-flex;
+ -webkit-flex-direction: column;
+ -webkit-flex: 1;
+}
+
+#content-browser {
+ -webkit-flex: 1;
+}
+
+#split-content-browser {
+ border-top: 1px solid rgb(153, 153, 153);
+}
+
+#split-content-browser > .navigation-bar {
+ cursor: row-resize;
+
+ background-image: -webkit-linear-gradient(top, rgb(248, 248, 248), rgb(226, 226, 226));
+}
+
+#split-content-browser > .navigation-bar .item:not(.flexible-space) {
+ cursor: default;
+}
+
+#details-sidebar {
+ width: 300px;
+}
+
+.message-text-view {
+ display: -webkit-flex;
+ z-index: 1000;
+
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ padding-left: 20%;
+ padding-right: 20%;
+
+ -webkit-justify-content: center;
+ -webkit-align-items: center;
+
+ line-height: 20px;
+ white-space: pre-wrap;
+ text-align: center;
+
+ font-size: 18px;
+ font-weight: bold;
+ font-family: Lucida Grande, sans-serif;
+
+ color: rgb(75%, 75%, 75%);
+ background-color: white;
+}
+
+.message-text-view.error {
+ color: rgb(224, 16, 16);
+}
+
+.message-text-view.error::before {
+ display: inline-block;
+
+ width: 20px;
+ height: 20px;
+ margin-right: 4px;
+ vertical-align: bottom;
+
+ background-image: url(../Images/Error.svg);
+ background-size: 100% 100%;
+ content: "";
+}
+
+.go-to-link {
+ color: rgb(85, 85, 85) !important;
+ text-decoration: underline !important;
+ cursor: pointer;
+}
+
+.go-to-link:not(.dont-float) {
+ float: right;
+ margin-left: 5px;
+ max-width: 100%;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.go-to-arrow {
+ -webkit-appearance: none;
+
+ padding: 0;
+ margin: 0;
+ border: none;
+
+ background-color: transparent;
+ background-image: -webkit-canvas(go-to-arrow-normal);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 10px 10px;
+
+ width: 16px;
+ height: 16px;
+
+ /* Workaround: for text boxes overlapping float:right. Give go-to arrows a z-index to ensure they are clickable.
+ <rdar://problem/11536832> Cannot access content view from Instruments navigator if name of file is truncated */
+ position: relative;
+ z-index: 1;
+}
+
+.go-to-arrow:active {
+ background-image: -webkit-canvas(go-to-arrow-normal-active);
+}
+
+:focus .selected .go-to-arrow {
+ background-image: -webkit-canvas(go-to-arrow-selected);
+}
+
+:focus .selected .go-to-arrow:active {
+ background-image: -webkit-canvas(go-to-arrow-selected-active);
+}
+
+.display-location {
+ font-style: italic !important;
+}
+
+.hidden {
+ display: none !important;
+}
+
+.node-link {
+ text-decoration: underline;
+ cursor: pointer;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsMetricsStyleDetailsPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceMetricsStyleDetailsPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/MetricsStyleDetailsPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/MetricsStyleDetailsPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/MetricsStyleDetailsPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/MetricsStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.MetricsStyleDetailsPanel = function()
+{
+ WebInspector.StyleDetailsPanel.call(this, WebInspector.MetricsStyleDetailsPanel.StyleClassName, "metrics", WebInspector.UIString("Metrics"));
+
+ this._boxModelDiagramRow = new WebInspector.BoxModelDetailsSectionRow;
+
+ var boxModelGroup = new WebInspector.DetailsSectionGroup([this._boxModelDiagramRow]);
+ var boxModelSection = new WebInspector.DetailsSection("style-box-model", WebInspector.UIString("Box Model"), [boxModelGroup]);
+
+ this.element.appendChild(boxModelSection.element);
+};
+
+WebInspector.MetricsStyleDetailsPanel.StyleClassName = "metrics";
+
+WebInspector.MetricsStyleDetailsPanel.prototype = {
+ constructor: WebInspector.MetricsStyleDetailsPanel,
+
+ // Public
+
+ refresh: function()
+ {
+ this._boxModelDiagramRow.nodeStyles = this.nodeStyles;
+ }
+};
+
+WebInspector.MetricsStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationBarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceNavigationBarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NavigationBar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.navigation-bar {
+ display: -webkit-flex;
+ -webkit-justify-content: center;
+ -webkit-flex-wrap: wrap;
+
+ box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
+ border-bottom: 1px solid rgb(179, 179, 179);
+
+ height: 22px;
+
+ white-space: nowrap;
+ overflow: hidden;
+
+ outline: none;
+}
+
+.navigation-bar .item {
+ display: -webkit-flex;
+ -webkit-align-items: center;
+ -webkit-flex-wrap: wrap;
+
+ height: 21px;
+ outline: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceNavigationBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NavigationBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,451 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationBar = function(element, navigationItems, role, label) {
+ WebInspector.Object.call(this);
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(this.constructor.StyleClassName || WebInspector.NavigationBar.StyleClassName);
+ this._element.tabIndex = 0;
+
+ if (role)
+ this._element.setAttribute("role", role);
+ if (label)
+ this._element.setAttribute("aria-label", label);
+
+ this._element.addEventListener("focus", this._focus.bind(this), false);
+ this._element.addEventListener("blur", this._blur.bind(this), false);
+ this._element.addEventListener("keydown", this._keyDown.bind(this), false);
+ this._element.addEventListener("mousedown", this._mouseDown.bind(this), false);
+
+ document.addEventListener("load", this.updateLayout.bind(this), false);
+
+ this._styleElement = document.createElement("style");
+
+ this._navigationItems = [];
+
+ if (navigationItems) {
+ for (var i = 0; i < navigationItems.length; ++i)
+ this.addNavigationItem(navigationItems[i]);
+ }
+
+ document.head.appendChild(this._styleElement);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.NavigationBar);
+
+WebInspector.NavigationBar.StyleClassName = "navigation-bar";
+WebInspector.NavigationBar.CollapsedStyleClassName = "collapsed";
+
+WebInspector.NavigationBar.Event = {
+ NavigationItemSelected: "navigation-bar-navigation-item-selected"
+};
+
+WebInspector.NavigationBar.prototype = {
+ constructor: WebInspector.NavigationBar,
+
+ // Public
+
+ addNavigationItem: function(navigationItem, parentElement)
+ {
+ return this.insertNavigationItem(navigationItem, this._navigationItems.length, parentElement);
+ },
+
+ insertNavigationItem: function(navigationItem, index, parentElement)
+ {
+ console.assert(navigationItem instanceof WebInspector.NavigationItem);
+ if (!(navigationItem instanceof WebInspector.NavigationItem))
+ return;
+
+ if (navigationItem.parentNavigationBar)
+ navigationItem.parentNavigationBar.removeNavigationItem(navigationItem);
+
+ navigationItem._parentNavigationBar = this;
+
+ console.assert(index >= 0 && index <= this._navigationItems.length);
+ index = Math.max(0, Math.min(index, this._navigationItems.length));
+
+ this._navigationItems.splice(index, 0, navigationItem);
+
+ if (!parentElement)
+ parentElement = this._element;
+
+ var nextSibling = this._navigationItems[index + 1];
+ var nextSiblingElement = nextSibling ? nextSibling.element : null;
+ if (nextSiblingElement && nextSiblingElement.parentNode !== parentElement)
+ nextSiblingElement = null;
+
+ parentElement.insertBefore(navigationItem.element, nextSiblingElement);
+
+ this._minimumWidthNeedsRecalculation = true;
+ this._needsStyleUpdated = true;
+
+ this.updateLayoutSoon();
+
+ return navigationItem;
+ },
+
+ removeNavigationItem: function(navigationItemOrIdentifierOrIndex, index)
+ {
+ var navigationItem = this._findNavigationItem(navigationItemOrIdentifierOrIndex);
+ if (!navigationItem)
+ return;
+
+ navigationItem._parentNavigationBar = null;
+
+ if (this._selectedNavigationItem === navigationItem)
+ this.selectedNavigationItem = null;
+
+ this._navigationItems.remove(navigationItem);
+ navigationItem.element.remove();
+
+ this._minimumWidthNeedsRecalculation = true;
+ this._needsStyleUpdated = true;
+
+ this.updateLayoutSoon();
+
+ return navigationItem;
+ },
+
+ updateLayoutSoon: function()
+ {
+ if (this._updateLayoutTimeout)
+ return;
+
+ this._needsLayout = true;
+
+ function update()
+ {
+ delete this._updateLayoutTimeout;
+
+ if (this._needsLayout || this._needsStyleUpdated)
+ this.updateLayout();
+ }
+
+ this._updateLayoutTimeout = setTimeout(update.bind(this), 0);
+ },
+
+ updateLayout: function()
+ {
+ if (this._updateLayoutTimeout) {
+ clearTimeout(this._updateLayoutTimeout);
+ delete this._updateLayoutTimeout;
+ }
+
+ if (this._needsStyleUpdated)
+ this._updateStyle();
+
+ this._needsLayout = false;
+
+ if (typeof this.customUpdateLayout === "function") {
+ this.customUpdateLayout();
+ return;
+ }
+
+ // Remove the collapsed style class to test if the items can fit at full width.
+ this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ // Tell each navigation item to update to full width if needed.
+ for (var i = 0; i < this._navigationItems.length; ++i)
+ this._navigationItems[i].updateLayout(true);
+
+ var totalItemWidth = 0;
+ for (var i = 0; i < this._navigationItems.length; ++i) {
+ // Skip flexible space items since they can take up no space at the minimum width.
+ if (this._navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
+ continue;
+
+ totalItemWidth += this._navigationItems[i].element.offsetWidth;
+ }
+
+ var barWidth = this._element.offsetWidth;
+
+ // Add the collapsed class back if the items are wider than the bar.
+ if (totalItemWidth > barWidth)
+ this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ // Give each navigation item the opportunity to collapse further.
+ for (var i = 0; i < this._navigationItems.length; ++i)
+ this._navigationItems[i].updateLayout();
+ },
+
+ get selectedNavigationItem()
+ {
+ return this._selectedNavigationItem || null;
+ },
+
+ set selectedNavigationItem(navigationItemOrIdentifierOrIndex)
+ {
+ var navigationItem = this._findNavigationItem(navigationItemOrIdentifierOrIndex);
+
+ // Only radio navigation items can be selected.
+ if (!(navigationItem instanceof WebInspector.RadioButtonNavigationItem))
+ navigationItem = null;
+
+ if (this._selectedNavigationItem === navigationItem)
+ return;
+
+ if (this._selectedNavigationItem)
+ this._selectedNavigationItem.selected = false;
+
+ this._selectedNavigationItem = navigationItem || null;
+
+ if (this._selectedNavigationItem)
+ this._selectedNavigationItem.selected = true;
+
+ // When the mouse is down don't dispatch the selected event, it will be dispatched on mouse up.
+ // This prevents sending the event while the user is scrubbing the bar.
+ if (!this._mouseIsDown)
+ this.dispatchEventToListeners(WebInspector.NavigationBar.Event.NavigationItemSelected);
+ },
+
+ get navigationItems()
+ {
+ return this._navigationItems;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get minimumWidth()
+ {
+ if (typeof this._minimumWidth === "undefined" || this._minimumWidthNeedsRecalculation) {
+ this._minimumWidth = this._calculateMinimumWidth();
+ delete this._minimumWidthNeedsRecalculation;
+ }
+
+ return this._minimumWidth;
+ },
+
+ get sizesToFit()
+ {
+ // Can be overriden by subclasses.
+ return false;
+ },
+
+ // Private
+
+ _findNavigationItem: function(navigationItemOrIdentifierOrIndex)
+ {
+ var navigationItem = null;
+
+ if (navigationItemOrIdentifierOrIndex instanceof WebInspector.NavigationItem) {
+ if (this._navigationItems.contains(navigationItemOrIdentifierOrIndex))
+ navigationItem = navigationItemOrIdentifierOrIndex;
+ } else if (typeof navigationItemOrIdentifierOrIndex === "number") {
+ navigationItem = this._navigationItems[navigationItemOrIdentifierOrIndex];
+ } else if (typeof navigationItemOrIdentifierOrIndex === "string") {
+ for (var i = 0; i < this._navigationItems.length; ++i) {
+ if (this._navigationItems[i].identifier === navigationItemOrIdentifierOrIndex) {
+ navigationItem = this._navigationItems[i];
+ break;
+ }
+ }
+ }
+
+ return navigationItem;
+ },
+
+ _mouseDown: function(event)
+ {
+ // Only handle left mouse clicks.
+ if (event.button !== 0)
+ return;
+
+ // Remove the tabIndex so clicking the navigation bar does not give it focus.
+ // Only keep the tabIndex if already focused from keyboard navigation. This matches Xcode.
+ if (!this._focused)
+ this._element.removeAttribute("tabindex");
+
+ var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
+ if (!itemElement || !itemElement.navigationItem)
+ return;
+
+ this._previousSelectedNavigationItem = this.selectedNavigationItem;
+ this.selectedNavigationItem = itemElement.navigationItem;
+
+ this._mouseIsDown = true;
+
+ this._mouseMovedEventListener = this._mouseMoved.bind(this);
+ this._mouseUpEventListener = this._mouseUp.bind(this);
+
+ // Register these listeners on the document so we can track the mouse if it leaves the resizer.
+ document.addEventListener("mousemove", this._mouseMovedEventListener, false);
+ document.addEventListener("mouseup", this._mouseUpEventListener, false);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _mouseMoved: function(event)
+ {
+ console.assert(event.button === 0);
+ console.assert(this._mouseIsDown);
+ if (!this._mouseIsDown)
+ return;
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ var itemElement = event.target.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
+ if (!itemElement || !itemElement.navigationItem) {
+ // Find the element that is at the X position of the mouse, even when the mouse is no longer
+ // vertically in the navigation bar.
+ var element = document.elementFromPoint(event.pageX, this._element.totalOffsetTop);
+ if (!element)
+ return;
+
+ itemElement = element.enclosingNodeOrSelfWithClass(WebInspector.RadioButtonNavigationItem.StyleClassName);
+ if (!itemElement || !itemElement.navigationItem)
+ return;
+ }
+
+ if (this.selectedNavigationItem)
+ this.selectedNavigationItem.active = false;
+
+ this.selectedNavigationItem = itemElement.navigationItem;
+
+ this.selectedNavigationItem.active = true;
+ },
+
+ _mouseUp: function(event)
+ {
+ console.assert(event.button === 0);
+ console.assert(this._mouseIsDown);
+ if (!this._mouseIsDown)
+ return;
+
+ if (this.selectedNavigationItem)
+ this.selectedNavigationItem.active = false;
+
+ this._mouseIsDown = false;
+
+ document.removeEventListener("mousemove", this._mouseMovedEventListener, false);
+ document.removeEventListener("mouseup", this._mouseUpEventListener, false);
+
+ delete this._mouseMovedEventListener;
+ delete this._mouseUpEventListener;
+
+ // Restore the tabIndex so the navigation bar can be in the keyboard tab loop.
+ this._element.tabIndex = 0;
+
+ // Dispatch the selected event here since the selectedNavigationItem setter surpresses it
+ // while the mouse is down to prevent sending it while scrubbing the bar.
+ if (this._previousSelectedNavigationItem !== this.selectedNavigationItem)
+ this.dispatchEventToListeners(WebInspector.NavigationBar.Event.NavigationItemSelected);
+
+ delete this._previousSelectedNavigationItem;
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _keyDown: function(event)
+ {
+ if (!this._focused)
+ return;
+
+ if (event.keyIdentifier !== "Left" && event.keyIdentifier !== "Right")
+ return;
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ var selectedNavigationItemIndex = this._navigationItems.indexOf(this._selectedNavigationItem);
+
+ if (event.keyIdentifier === "Left") {
+ if (selectedNavigationItemIndex === -1)
+ selectedNavigationItemIndex = this._navigationItems.length;
+
+ do {
+ selectedNavigationItemIndex = Math.max(0, selectedNavigationItemIndex - 1);
+ } while (selectedNavigationItemIndex && !(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem));
+ } else if (event.keyIdentifier === "Right") {
+ do {
+ selectedNavigationItemIndex = Math.min(selectedNavigationItemIndex + 1, this._navigationItems.length - 1);
+ } while (selectedNavigationItemIndex < this._navigationItems.length - 1 && !(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem));
+ }
+
+ if (!(this._navigationItems[selectedNavigationItemIndex] instanceof WebInspector.RadioButtonNavigationItem))
+ return;
+
+ this.selectedNavigationItem = this._navigationItems[selectedNavigationItemIndex];
+ },
+
+ _focus: function(event)
+ {
+ this._focused = true;
+ },
+
+ _blur: function(event)
+ {
+ this._focused = false;
+ },
+
+ _updateStyle: function()
+ {
+ this._needsStyleUpdated = false;
+
+ var parentSelector = "." + (this.constructor.StyleClassName || WebInspector.NavigationBar.StyleClassName);
+
+ var styleText = "";
+ for (var i = 0; i < this._navigationItems.length; ++i) {
+ if (!this._navigationItems[i].generateStyleText)
+ continue;
+ if (styleText)
+ styleText += "\n";
+ styleText += this._navigationItems[i].generateStyleText(parentSelector);
+ }
+
+ this._styleElement.textContent = styleText;
+ },
+
+ _calculateMinimumWidth: function()
+ {
+ var wasCollapsed = this._element.classList.contains(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ // Add the collapsed style class to calculate the width of the items when they are collapsed.
+ if (!wasCollapsed)
+ this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ var totalItemWidth = 0;
+ for (var i = 0; i < this._navigationItems.length; ++i) {
+ // Skip flexible space items since they can take up no space at the minimum width.
+ if (this._navigationItems[i] instanceof WebInspector.FlexibleSpaceNavigationItem)
+ continue;
+ totalItemWidth += this._navigationItems[i].element.offsetWidth;
+ }
+
+ // Remove the collapsed style class if we were not collapsed before.
+ if (!wasCollapsed)
+ this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ return totalItemWidth;
+ }
+};
+
+WebInspector.NavigationBar.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationItem = function(identifier, role, label) {
+ WebInspector.Object.call(this);
+
+ this._identifier = identifier || null;
+
+ this._element = document.createElement("div");
+
+ if (role)
+ this._element.setAttribute("role", role);
+ if (label)
+ this._element.setAttribute("aria-label", label);
+
+ var classNames = this._classNames;
+ for (var i = 0; i < classNames.length; ++i)
+ this._element.classList.add(classNames[i]);
+
+ this._element.navigationItem = this;
+};
+
+WebInspector.NavigationItem.StyleClassName = "item";
+WebInspector.NavigationItem.HiddenStyleClassName = "hidden";
+
+
+WebInspector.NavigationItem.prototype = {
+ constructor: WebInspector.NavigationItem,
+
+ // Public
+
+ get identifier()
+ {
+ return this._identifier;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get parentNavigationBar()
+ {
+ return this._parentNavigationBar;
+ },
+
+ updateLayout: function(expandOnly)
+ {
+ // Implemented by subclasses.
+ },
+
+ get hidden()
+ {
+ return this._element.classList.contains(WebInspector.NavigationItem.HiddenStyleClassName);
+ },
+
+ set hidden(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.NavigationItem.HiddenStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.NavigationItem.HiddenStyleClassName);
+
+ if (this._parentNavigationBar)
+ this._parentNavigationBar.updateLayoutSoon();
+ },
+
+ // Private
+
+ get _classNames()
+ {
+ var classNames = [WebInspector.NavigationItem.StyleClassName];
+ if (this._identifier)
+ classNames.push(this._identifier);
+ if (this._additionalClassNames instanceof Array)
+ classNames = classNames.concat(this._additionalClassNames);
+ return classNames;
+ }
+}
+
+WebInspector.NavigationItem.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,357 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.navigation > .content {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 22px;
+
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.sidebar > .panel.navigation > .filter-bar {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+.sidebar > .panel.navigation > .overflow-shadow {
+ position: absolute;
+ bottom: 21px;
+ left: 0;
+ right: 0;
+ height: 5px;
+
+ pointer-events: none;
+
+ background-image: -webkit-radial-gradient(center, ellipse closest-side, rgba(0, 0, 0, 0.2) 25%, transparent),
+ -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0125), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.0125));
+ background-size: 125% 15px, 100% 1px;
+ background-position: top center, bottom center;
+ background-repeat: no-repeat;
+
+ opacity: 0;
+}
+
+.sidebar > .panel.navigation > .overflow-shadow.top {
+ top: 21px;
+ bottom: initial;
+ background-position: bottom center, top center;
+}
+
+.sidebar > .panel.navigation > .empty-content-placeholder {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 21px;
+
+ display: -webkit-flex;
+
+ -webkit-justify-content: center;
+ -webkit-align-items: center;
+}
+
+.sidebar > .panel.navigation > .empty-content-placeholder > .message {
+ display: inline-block;
+ white-space: nowrap;
+
+ font-family: "Lucida Grande", sans-serif;
+ font-size: 13px;
+
+ color: white;
+ background-color: rgba(0, 0, 0, 0.15);
+ text-shadow: rgba(0, 0, 0, 0.2) 0 1px 0;
+ box-shadow: inset rgba(0, 0, 0, 0.2) 0 1px 0, rgba(255, 255, 255, 0.4) 0 1px 0;
+
+ border-radius: 6px;
+ padding: 5px 15px 6px;
+}
+
+.navigation-sidebar-panel-content-tree-outline,
+.navigation-sidebar-panel-content-tree-outline .children {
+ position: relative;
+
+ padding: 0;
+ margin: 0;
+
+ outline: none;
+
+ list-style: none;
+
+ font-family: "Lucida Grande", "Helvetica", sans-serif;
+ font-size: 11px;
+}
+
+.navigation-sidebar-panel-content-tree-outline .children {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline .children.expanded {
+ display: block;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item {
+ position: relative;
+
+ height: 36px;
+ line-height: 34px;
+
+ /* The item depth padding style rules are generated by NavigationSidebarPanel.js.
+ Any changes to this padding needs to be changed there too. */
+
+ padding: 0 5px;
+
+ border-top: 1px solid transparent;
+
+ white-space: nowrap;
+}
+
+.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons > .children {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline > .children.hide-disclosure-buttons > .children {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline:not(.hide-disclosure-buttons) .item:not(.parent) .icon {
+ margin-left: 16px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons .item.small {
+ padding-left: 8px;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .disclosure-button {
+ display: none;
+
+ float: left;
+
+ width: 16px;
+ height: 100%;
+
+ border: 0;
+
+ background-color: transparent;
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-closed-normal);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 13px 13px;
+
+ -webkit-appearance: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline.hide-disclosure-buttons .item .disclosure-button {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.parent .disclosure-button {
+ display: block;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.selected .disclosure-button {
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-closed-selected) !important;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.expanded .disclosure-button {
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-normal);
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.selected.expanded .disclosure-button {
+ background-image: -webkit-canvas(navigation-sidebar-panel-disclosure-triangle-open-selected) !important;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .icon {
+ float: left;
+ position: relative;
+
+ width: 32px;
+ height: 32px;
+
+ margin-top: 1px;
+ margin-right: 3px;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .status {
+ float: right;
+
+ height: 16px;
+
+ margin-top: 9px;
+ margin-left: 4px;
+
+ line-height: 1em;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .status:empty {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.selected {
+ color: white;
+
+ border-top: 1px solid rgb(162, 177, 201);
+
+ background-image: -webkit-linear-gradient(top, rgb(175, 190, 213), rgb(130, 151, 182));
+ background-origin: padding;
+ background-clip: padding;
+}
+
+.navigation-sidebar-panel-content-tree-outline:focus .item.selected {
+ border-top: 1px solid rgb(148, 174, 193);
+ background-image: -webkit-linear-gradient(top, rgb(154, 180, 203), rgb(112, 139, 176));
+}
+
+body.window-inactive .navigation-sidebar-panel-content-tree-outline .item.selected {
+ border-top: 1px solid rgb(168, 168, 168);
+ background-image: -webkit-linear-gradient(top, rgb(194, 194, 194), rgb(158, 158, 158));
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .titles {
+ position: relative;
+ top: 5px;
+
+ line-height: 11px;
+
+ padding-bottom: 1px;
+
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .highlighted {
+ background-color: rgba(235, 215, 38, 0.2);
+ border-bottom: 1px solid rgb(237, 202, 71);
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .titles.no-subtitle {
+ top: 10px;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .title::after {
+ content: "\A"; /* Newline */
+ white-space: pre;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .subtitle {
+ font-size: 9px;
+ color: rgba(0, 0, 0, 0.7);
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.selected .subtitle {
+ color: rgba(255, 255, 255, 0.9);
+}
+
+.navigation-sidebar-panel-content-tree-outline .item .titles.no-subtitle .subtitle,
+.navigation-sidebar-panel-content-tree-outline .item .subtitle:empty {
+ display: none;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item,
+.navigation-sidebar-panel-content-tree-outline .children.small .item,
+.navigation-sidebar-panel-content-tree-outline .item.small {
+ height: 20px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small.two-line .item,
+.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item,
+.navigation-sidebar-panel-content-tree-outline .item.small.two-line {
+ height: 26px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item .icon,
+.navigation-sidebar-panel-content-tree-outline .children.small .item .icon,
+.navigation-sidebar-panel-content-tree-outline .item.small .icon {
+ width: 16px;
+ height: 16px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item .status,
+.navigation-sidebar-panel-content-tree-outline .children.small .item .status,
+.navigation-sidebar-panel-content-tree-outline .item.small .status {
+ margin-top: 1px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item .status .indeterminate-progress-spinner,
+.navigation-sidebar-panel-content-tree-outline .children.small .item .status .indeterminate-progress-spinner,
+.navigation-sidebar-panel-content-tree-outline .item.small .status .indeterminate-progress-spinner {
+ margin-top: 1px;
+ width: 14px;
+ height: 14px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item .titles,
+.navigation-sidebar-panel-content-tree-outline .children.small .item .titles,
+.navigation-sidebar-panel-content-tree-outline .item.small .titles {
+ top: 2px;
+ line-height: normal;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small.two-line .item .status,
+.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .status,
+.navigation-sidebar-panel-content-tree-outline .item.small.two-line .status {
+ margin-top: 4px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small.two-line .item .titles,
+.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .titles,
+.navigation-sidebar-panel-content-tree-outline .item.small.two-line .titles {
+ top: 0;
+ line-height: 11px;
+}
+
+.navigation-sidebar-panel-content-tree-outline .item.small.two-line .titles.no-subtitle {
+ top: 6px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small .item .subtitle,
+.navigation-sidebar-panel-content-tree-outline .children.small .item .subtitle,
+.navigation-sidebar-panel-content-tree-outline .item.small .subtitle {
+ font-size: inherit;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small.two-line .item .icon,
+.navigation-sidebar-panel-content-tree-outline .children.small.two-line .item .icon,
+.navigation-sidebar-panel-content-tree-outline .item.small.two-line .icon {
+ margin-top: 4px;
+}
+
+.navigation-sidebar-panel-content-tree-outline.small:not(.two-line) .item .title::after,
+.navigation-sidebar-panel-content-tree-outline .children.small:not(.two-line) .item .title::after,
+.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .title::after {
+ content: "";
+}
+
+.navigation-sidebar-panel-content-tree-outline.small:not(.two-line) .item .subtitle::before,
+.navigation-sidebar-panel-content-tree-outline .children.small:not(.two-line) .item .subtitle::before,
+.navigation-sidebar-panel-content-tree-outline .item.small:not(.two-line) .subtitle::before {
+ content: " — ";
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceNavigationSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NavigationSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,701 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NavigationSidebarPanel = function(identifier, displayName, image, keyboardShortcutKey, autoPruneOldTopLevelResourceTreeElements, autoHideToolbarItemWhenEmpty, wantsTopOverflowShadow, element, role, label) {
+ if (keyboardShortcutKey)
+ this._keyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, keyboardShortcutKey, this.toggle.bind(this));
+
+ if (this._keyboardShortcut) {
+ var showToolTip = WebInspector.UIString("Show the %s navigation sidebar (%s)").format(displayName, this._keyboardShortcut.displayName);
+ var hideToolTip = WebInspector.UIString("Hide the %s navigation sidebar (%s)").format(displayName, this._keyboardShortcut.displayName);
+ } else {
+ var showToolTip = WebInspector.UIString("Show the %s navigation sidebar").format(displayName);
+ var hideToolTip = WebInspector.UIString("Hide the %s navigation sidebar").format(displayName);
+ }
+
+ WebInspector.SidebarPanel.call(this, identifier, displayName, showToolTip, hideToolTip, image, element, role, label || displayName);
+
+ this.element.classList.add(WebInspector.NavigationSidebarPanel.StyleClassName);
+
+ this._autoHideToolbarItemWhenEmpty = autoHideToolbarItemWhenEmpty || false;
+
+ if (autoHideToolbarItemWhenEmpty)
+ this.toolbarItem.hidden = true;
+
+ this._visibleContentTreeOutlines = new Set;
+
+ this._contentElement = document.createElement("div");
+ this._contentElement.className = WebInspector.NavigationSidebarPanel.ContentElementStyleClassName;
+ this._contentElement.addEventListener("scroll", this._updateContentOverflowShadowVisibility.bind(this));
+ this.element.appendChild(this._contentElement);
+
+ this._contentTreeOutline = this.createContentTreeOutline(true);
+
+ this._filterBar = new WebInspector.FilterBar();
+ this._filterBar.addEventListener(WebInspector.FilterBar.Event.TextFilterDidChange, this._textFilterDidChange, this);
+ this.element.appendChild(this._filterBar.element);
+
+ this._bottomOverflowShadowElement = document.createElement("div");
+ this._bottomOverflowShadowElement.className = WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName;
+ this.element.appendChild(this._bottomOverflowShadowElement);
+
+ if (wantsTopOverflowShadow) {
+ this._topOverflowShadowElement = document.createElement("div");
+ this._topOverflowShadowElement.classList.add(WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName);
+ this._topOverflowShadowElement.classList.add(WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName);
+ this.element.appendChild(this._topOverflowShadowElement);
+ }
+
+ window.addEventListener("resize", this._updateContentOverflowShadowVisibility.bind(this));
+
+ this._filtersSetting = new WebInspector.Setting(identifier + "-navigation-sidebar-filters", {});
+ this._filterBar.filters = this._filtersSetting.value;
+
+ this._emptyContentPlaceholderElement = document.createElement("div");
+ this._emptyContentPlaceholderElement.className = WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName;
+
+ this._emptyContentPlaceholderMessageElement = document.createElement("div");
+ this._emptyContentPlaceholderMessageElement.className = WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName;
+ this._emptyContentPlaceholderElement.appendChild(this._emptyContentPlaceholderMessageElement);
+
+ this._generateStyleRulesIfNeeded();
+ this._generateDisclosureTrianglesIfNeeded();
+
+ if (autoPruneOldTopLevelResourceTreeElements) {
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._checkForOldResources, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._checkForOldResources, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved, this._checkForOldResources, this);
+ }
+};
+
+WebInspector.NavigationSidebarPanel.StyleClassName = "navigation";
+WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = "overflow-shadow";
+WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName = "top";
+WebInspector.NavigationSidebarPanel.ContentElementStyleClassName = "content";
+WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName = "hidden";
+WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName = "navigation-sidebar-panel-content-tree-outline";
+WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName = "hide-disclosure-buttons";
+WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderElementStyleClassName = "empty-content-placeholder";
+WebInspector.NavigationSidebarPanel.EmptyContentPlaceholderMessageElementStyleClassName = "message";
+WebInspector.NavigationSidebarPanel.DisclosureTriangleOpenCanvasIdentifier = "navigation-sidebar-panel-disclosure-triangle-open";
+WebInspector.NavigationSidebarPanel.DisclosureTriangleClosedCanvasIdentifier = "navigation-sidebar-panel-disclosure-triangle-closed";
+WebInspector.NavigationSidebarPanel.DisclosureTriangleNormalCanvasIdentifierSuffix = "-normal";
+WebInspector.NavigationSidebarPanel.DisclosureTriangleSelectedCanvasIdentifierSuffix = "-selected";
+
+WebInspector.NavigationSidebarPanel.prototype = {
+ constructor: WebInspector.NavigationSidebarPanel,
+
+ // Public
+
+ get contentElement()
+ {
+ return this._contentElement;
+ },
+
+ get contentTreeOutlineElement()
+ {
+ return this._contentTreeOutline.element;
+ },
+
+ get contentTreeOutline()
+ {
+ return this._contentTreeOutline;
+ },
+
+ set contentTreeOutline(newTreeOutline)
+ {
+ console.assert(newTreeOutline);
+ if (!newTreeOutline)
+ return;
+
+ if (this._contentTreeOutline)
+ this._contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+
+ this._contentTreeOutline = newTreeOutline;
+ this._contentTreeOutline.element.classList.remove(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+
+ this._visibleContentTreeOutlines.delete(this._contentTreeOutline);
+ this._visibleContentTreeOutlines.add(newTreeOutline);
+
+ this._updateFilter();
+ },
+
+ get contentTreeOutlineToAutoPrune()
+ {
+ return this._contentTreeOutline;
+ },
+
+ get filterBar()
+ {
+ return this._filterBar;
+ },
+
+ get restoringState()
+ {
+ return this._restoringState;
+ },
+
+ createContentTreeOutline: function(dontHideByDefault, suppressFiltering)
+ {
+ var contentTreeOutlineElement = document.createElement("ol");
+ contentTreeOutlineElement.className = WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName;
+ if (!dontHideByDefault)
+ contentTreeOutlineElement.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName);
+ this._contentElement.appendChild(contentTreeOutlineElement);
+
+ var contentTreeOutline = new TreeOutline(contentTreeOutlineElement);
+ contentTreeOutline.allowsRepeatSelection = true;
+
+ if (!suppressFiltering) {
+ contentTreeOutline.onadd = this._treeElementAddedOrChanged.bind(this);
+ contentTreeOutline.onchange = this._treeElementAddedOrChanged.bind(this);
+ contentTreeOutline.onexpand = this._treeElementExpandedOrCollapsed.bind(this);
+ contentTreeOutline.oncollapse = this._treeElementExpandedOrCollapsed.bind(this);
+ }
+
+ if (dontHideByDefault)
+ this._visibleContentTreeOutlines.add(contentTreeOutline);
+
+ return contentTreeOutline;
+ },
+
+ treeElementForRepresentedObject: function(representedObject)
+ {
+ return this._contentTreeOutline.getCachedTreeElement(representedObject);
+ },
+
+ showDefaultContentView: function()
+ {
+ // Implemneted by subclasses if needed to show a content view when no existing tree element is selected.
+ },
+
+ showContentViewForCurrentSelection: function()
+ {
+ // Reselect the selected tree element to cause the content view to be shown as well. <rdar://problem/10854727>
+ var selectedTreeElement = this._contentTreeOutline.selectedTreeElement;
+ if (selectedTreeElement)
+ selectedTreeElement.select();
+ },
+
+ saveStateToCookie: function(cookie)
+ {
+ console.assert(cookie);
+
+ // This does not save folder selections, which lack a represented object and content view.
+ var selectedTreeElement = null;
+ this._visibleContentTreeOutlines.forEach(function(outline) {
+ if (outline.selectedTreeElement)
+ selectedTreeElement = outline.selectedTreeElement;
+ });
+
+ if (!selectedTreeElement)
+ return;
+
+ if (this._isTreeElementWithoutRepresentedObject(selectedTreeElement))
+ return;
+
+ var representedObject = selectedTreeElement.representedObject;
+ cookie[WebInspector.TypeIdentifierCookieKey] = representedObject.constructor.TypeIdentifier;
+
+ if (representedObject.saveIdentityToCookie)
+ representedObject.saveIdentityToCookie(cookie);
+ else
+ console.error("Error: TreeElement.representedObject is missing a saveIdentityToCookie implementation. TreeElement.constructor: %s", selectedTreeElement.constructor);
+ },
+
+ // This can be supplemented by subclasses that admit a simpler strategy for static tree elements.
+ restoreStateFromCookie: function(cookie, relaxedMatchDelay)
+ {
+ this._pendingViewStateCookie = cookie;
+ this._restoringState = true;
+
+ // Check if any existing tree elements in any outline match the cookie.
+ this._checkOutlinesForPendingViewStateCookie();
+
+ if (this._finalAttemptToRestoreViewStateTimeout)
+ clearTimeout(this._finalAttemptToRestoreViewStateTimeout);
+
+ function finalAttemptToRestoreViewStateFromCookie()
+ {
+ delete this._finalAttemptToRestoreViewStateTimeout;
+
+ this._checkOutlinesForPendingViewStateCookie(true);
+
+ delete this._pendingViewStateCookie;
+ delete this._restoringState;
+ }
+
+ // If the specific tree element wasn't found, we may need to wait for the resources
+ // to be registered. We try one last time (match type only) after an arbitrary amount of timeout.
+ this._finalAttemptToRestoreViewStateTimeout = setTimeout(finalAttemptToRestoreViewStateFromCookie.bind(this), relaxedMatchDelay);
+ },
+
+ showEmptyContentPlaceholder: function(message, hideToolbarItem)
+ {
+ console.assert(message);
+
+ this._emptyContentPlaceholderMessageElement.textContent = message;
+ this.element.appendChild(this._emptyContentPlaceholderElement);
+
+ this._hideToolbarItemWhenEmpty = hideToolbarItem || false;
+ this._updateToolbarItemVisibility();
+ this._updateContentOverflowShadowVisibility();
+ },
+
+ hideEmptyContentPlaceholder: function()
+ {
+ if (this._emptyContentPlaceholderElement.parentNode)
+ this._emptyContentPlaceholderElement.parentNode.removeChild(this._emptyContentPlaceholderElement);
+
+ this._hideToolbarItemWhenEmpty = false;
+ this._updateToolbarItemVisibility();
+ this._updateContentOverflowShadowVisibility();
+ },
+
+ updateEmptyContentPlaceholder: function(message)
+ {
+ this._updateToolbarItemVisibility();
+
+ if (!this._contentTreeOutline.children.length) {
+ // No tree elements, so no results.
+ this.showEmptyContentPlaceholder(message);
+ } else if (!this._emptyFilterResults) {
+ // There are tree elements, and not all of them are hidden by the filter.
+ this.hideEmptyContentPlaceholder();
+ }
+ },
+
+ updateCustomContentOverflow: function()
+ {
+ // Implemented by subclasses if needed.
+ },
+
+ updateFilter: function()
+ {
+ this._updateFilter();
+ },
+
+ hasCustomFilters: function()
+ {
+ // Implemented by subclasses if needed.
+ return false;
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ // Implemented by subclasses if needed.
+ return true;
+ },
+
+ applyFiltersToTreeElement: function(treeElement)
+ {
+ if (!this._filterBar.hasActiveFilters() && !this.hasCustomFilters()) {
+ // No filters, so make everything visible.
+ treeElement.hidden = false;
+
+ // If this tree element was expanded during filtering, collapse it again.
+ if (treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
+ delete treeElement.__wasExpandedDuringFiltering;
+ treeElement.collapse();
+ }
+
+ return;
+ }
+
+ var filterableData = treeElement.filterableData || {};
+
+ var matchedBuiltInFilters = false;
+
+ var self = this;
+ function matchTextFilter(inputs)
+ {
+ if (!inputs || !self._textFilterRegex)
+ return true;
+
+ // Convert to a single item array if needed.
+ if (!(inputs instanceof Array))
+ inputs = [inputs];
+
+ // Loop over all the inputs and try to match them.
+ for (var input of inputs) {
+ if (!input)
+ continue;
+ if (self._textFilterRegex.test(input)) {
+ matchedBuiltInFilters = true;
+ return true;
+ }
+ }
+
+ // No inputs matched.
+ return false;
+ }
+
+ function makeVisible()
+ {
+ // Make this element visible.
+ treeElement.hidden = false;
+
+ // Make the ancestors visible and expand them.
+ var currentAncestor = treeElement.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ currentAncestor.hidden = false;
+
+ // Only expand if the built-in filters matched, not custom filters.
+ if (matchedBuiltInFilters && !currentAncestor.expanded) {
+ currentAncestor.__wasExpandedDuringFiltering = true;
+ currentAncestor.expand();
+ }
+
+ currentAncestor = currentAncestor.parent;
+ }
+ }
+
+ if (matchTextFilter(filterableData.text) && this.matchTreeElementAgainstCustomFilters(treeElement)) {
+ // Make this element visible since it matches.
+ makeVisible();
+
+ // If this tree element didn't match a built-in filter and was expanded earlier during filtering, collapse it again.
+ if (!matchedBuiltInFilters && treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
+ delete treeElement.__wasExpandedDuringFiltering;
+ treeElement.collapse();
+ }
+
+ return;
+ }
+
+ // Make this element invisible since it does not match.
+ treeElement.hidden = true;
+ },
+
+ show: function()
+ {
+ if (!this.parentSidebar)
+ return;
+
+ WebInspector.SidebarPanel.prototype.show.call(this);
+
+ this.contentTreeOutlineElement.focus();
+ },
+
+ shown: function()
+ {
+ WebInspector.SidebarPanel.prototype.shown.call(this);
+
+ this._updateContentOverflowShadowVisibility();
+
+ // Force the navigation item to be visible. This makes sure it is
+ // always visible when the panel is shown.
+ this.toolbarItem.hidden = false;
+ },
+
+ hidden: function()
+ {
+ WebInspector.SidebarPanel.prototype.hidden.call(this);
+
+ this._updateToolbarItemVisibility();
+ },
+
+ // Private
+
+ _updateContentOverflowShadowVisibility: function()
+ {
+ this.updateCustomContentOverflow();
+
+ var scrollHeight = this._contentElement.scrollHeight;
+ var offsetHeight = this._contentElement.offsetHeight;
+
+ if (scrollHeight < offsetHeight) {
+ if (this._topOverflowShadowElement)
+ this._topOverflowShadowElement.style.opacity = 0;
+ this._bottomOverflowShadowElement.style.opacity = 0;
+ return;
+ }
+
+ const edgeThreshold = 10;
+ var scrollTop = this._contentElement.scrollTop;
+
+ var topCoverage = Math.min(scrollTop, edgeThreshold);
+ var bottomCoverage = Math.max(0, (offsetHeight + scrollTop) - (scrollHeight - edgeThreshold));
+
+ if (this._topOverflowShadowElement)
+ this._topOverflowShadowElement.style.opacity = (topCoverage / edgeThreshold).toFixed(1);
+ this._bottomOverflowShadowElement.style.opacity = (1 - (bottomCoverage / edgeThreshold)).toFixed(1);
+ },
+
+ _updateToolbarItemVisibility: function()
+ {
+ // Hide the navigation item if requested or auto-hiding and we are not visible and we are empty.
+ var shouldHide = ((this._hideToolbarItemWhenEmpty || this._autoHideToolbarItemWhenEmpty) && !this.selected && !this._contentTreeOutline.children.length);
+ this.toolbarItem.hidden = shouldHide;
+ },
+
+ _checkForEmptyFilterResults: function()
+ {
+ // No tree elements, so don't touch the empty content placeholder.
+ if (!this._contentTreeOutline.children.length)
+ return;
+
+ // Iterate over all the top level tree elements. If any are visible, return early.
+ var currentTreeElement = this._contentTreeOutline.children[0];
+ while (currentTreeElement) {
+ if (!currentTreeElement.hidden) {
+ // Not hidden, so hide any empty content message.
+ this.hideEmptyContentPlaceholder();
+ this._emptyFilterResults = false;
+ return;
+ }
+
+ currentTreeElement = currentTreeElement.nextSibling;
+ }
+
+ // All top level tree elements are hidden, so filtering hid everything. Show a message.
+ this.showEmptyContentPlaceholder(WebInspector.UIString("No Filter Results"));
+ this._emptyFilterResults = true;
+ },
+
+ _textFilterDidChange: function()
+ {
+ this._updateFilter();
+ },
+
+ _updateFilter: function()
+ {
+ var filters = this._filterBar.filters;
+ this._textFilterRegex = simpleGlobStringToRegExp(filters.text, "i");
+ this._filtersSetting.value = filters;
+
+ // Don't populate if we don't have any active filters.
+ // We only need to populate when a filter needs to reveal.
+ var dontPopulate = !this._filterBar.hasActiveFilters();
+
+ // Update the whole tree.
+ var currentTreeElement = this._contentTreeOutline.children[0];
+ while (currentTreeElement && !currentTreeElement.root) {
+ this.applyFiltersToTreeElement(currentTreeElement);
+ currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, dontPopulate);
+ }
+
+ this._checkForEmptyFilterResults();
+ this._updateContentOverflowShadowVisibility();
+ },
+
+ _treeElementAddedOrChanged: function(treeElement)
+ {
+ // Don't populate if we don't have any active filters.
+ // We only need to populate when a filter needs to reveal.
+ var dontPopulate = !this._filterBar.hasActiveFilters();
+
+ // Apply the filters to the tree element and its descendants.
+ var currentTreeElement = treeElement;
+ while (currentTreeElement && !currentTreeElement.root) {
+ this.applyFiltersToTreeElement(currentTreeElement);
+ currentTreeElement = currentTreeElement.traverseNextTreeElement(false, treeElement, dontPopulate);
+ }
+
+ this._checkForEmptyFilterResults();
+ this._updateContentOverflowShadowVisibility();
+ this._checkElementsForPendingViewStateCookie(treeElement);
+ },
+
+ _treeElementExpandedOrCollapsed: function(treeElement)
+ {
+ this._updateContentOverflowShadowVisibility();
+ },
+
+ _generateStyleRulesIfNeeded: function()
+ {
+ if (WebInspector.NavigationSidebarPanel._styleElement)
+ return;
+
+ WebInspector.NavigationSidebarPanel._styleElement = document.createElement("style");
+
+ const maximumSidebarTreeDepth = 32;
+ const baseLeftPadding = 5; // Matches the padding in NavigationSidebarPanel.css for the item class. Keep in sync.
+ const depthPadding = 10;
+
+ var styleText = "";
+ var childrenSubstring = "";
+ for (var i = 1; i <= maximumSidebarTreeDepth; ++i) {
+ // Keep all the elements at the same depth once the maximum is reached.
+ childrenSubstring += i === maximumSidebarTreeDepth ? " .children" : " > .children";
+ styleText += "." + WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName + childrenSubstring + " > .item { ";
+ styleText += "padding-left: " + (baseLeftPadding + (depthPadding * i)) + "px; }\n";
+ }
+
+ WebInspector.NavigationSidebarPanel._styleElement.textContent = styleText;
+
+ document.head.appendChild(WebInspector.NavigationSidebarPanel._styleElement);
+ },
+
+ _generateDisclosureTrianglesIfNeeded: function()
+ {
+ if (WebInspector.NavigationSidebarPanel._generatedDisclosureTriangles)
+ return;
+
+ // Set this early instead of in _generateDisclosureTriangle because we don't want multiple panels that are
+ // created at the same time to duplicate the work (even though it would be harmless.)
+ WebInspector.NavigationSidebarPanel._generatedDisclosureTriangles = true;
+
+ var specifications = {};
+ specifications[WebInspector.NavigationSidebarPanel.DisclosureTriangleNormalCanvasIdentifierSuffix] = {
+ fillColor: [112, 126, 139],
+ shadowColor: [255, 255, 255, 0.8],
+ shadowOffsetX: 0,
+ shadowOffsetY: 1,
+ shadowBlur: 0
+ };
+
+ specifications[WebInspector.NavigationSidebarPanel.DisclosureTriangleSelectedCanvasIdentifierSuffix] = {
+ fillColor: [255, 255, 255],
+ shadowColor: [61, 91, 110, 0.8],
+ shadowOffsetX: 0,
+ shadowOffsetY: 1,
+ shadowBlur: 2
+ };
+
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, WebInspector.NavigationSidebarPanel.DisclosureTriangleOpenCanvasIdentifier);
+ generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, WebInspector.NavigationSidebarPanel.DisclosureTriangleClosedCanvasIdentifier);
+ },
+
+ _checkForOldResources: function(event)
+ {
+ if (this._checkForOldResourcesTimeoutIdentifier)
+ return;
+
+ function delayedWork()
+ {
+ delete this._checkForOldResourcesTimeoutIdentifier;
+
+ var contentTreeOutline = this.contentTreeOutlineToAutoPrune;
+
+ // Check all the ResourceTreeElements at the top level to make sure their Resource still has a parentFrame in the frame hierarchy.
+ // If the parentFrame is no longer in the frame hierarchy we know it was removed due to a navigation or some other page change and
+ // we should remove the issues for that resource.
+ for (var i = contentTreeOutline.children.length - 1; i >= 0; --i) {
+ var treeElement = contentTreeOutline.children[i];
+ if (!(treeElement instanceof WebInspector.ResourceTreeElement))
+ continue;
+
+ var resource = treeElement.resource;
+ if (!resource.parentFrame || resource.parentFrame.isDetached())
+ contentTreeOutline.removeChildAtIndex(i, true, true);
+ }
+
+ if (typeof this._updateEmptyContentPlaceholder === "function")
+ this._updateEmptyContentPlaceholder();
+ }
+
+ // Check on a delay to coalesce multiple calls to _checkForOldResources.
+ this._checkForOldResourcesTimeoutIdentifier = setTimeout(delayedWork.bind(this), 0);
+ },
+
+ _isTreeElementWithoutRepresentedObject: function(treeElement)
+ {
+ return treeElement instanceof WebInspector.FolderTreeElement
+ || treeElement instanceof WebInspector.DatabaseHostTreeElement
+ || typeof treeElement.representedObject === "string"
+ || treeElement.representedObject instanceof String;
+ },
+
+ _checkOutlinesForPendingViewStateCookie: function(matchTypeOnly)
+ {
+ if (!this._pendingViewStateCookie)
+ return;
+
+ var visibleTreeElements = [];
+ this._visibleContentTreeOutlines.forEach(function(outline) {
+ var currentTreeElement = outline.hasChildren ? outline.children[0] : null;
+ while (currentTreeElement) {
+ visibleTreeElements.push(currentTreeElement);
+ currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, false);
+ }
+ });
+
+ return this._checkElementsForPendingViewStateCookie(visibleTreeElements, matchTypeOnly);
+ },
+
+ _checkElementsForPendingViewStateCookie: function(treeElements, matchTypeOnly)
+ {
+ if (!this._pendingViewStateCookie)
+ return;
+
+ var cookie = this._pendingViewStateCookie;
+
+ function treeElementMatchesCookie(treeElement)
+ {
+ if (this._isTreeElementWithoutRepresentedObject(treeElement))
+ return false;
+
+ var representedObject = treeElement.representedObject;
+ if (!representedObject)
+ return false;
+
+ var typeIdentifier = cookie[WebInspector.TypeIdentifierCookieKey];
+ if (typeIdentifier !== representedObject.constructor.TypeIdentifier)
+ return false;
+
+ if (matchTypeOnly)
+ return true;
+
+ var candidateObjectCookie = {};
+ if (representedObject.saveIdentityToCookie)
+ representedObject.saveIdentityToCookie(candidateObjectCookie);
+
+ return Object.keys(candidateObjectCookie).every(function valuesMatchForKey(key) {
+ return candidateObjectCookie[key] === cookie[key];
+ });
+ }
+
+ if (!(treeElements instanceof Array))
+ treeElements = [treeElements];
+
+ var matchedElement = null;
+ treeElements.some(function(element) {
+ if (treeElementMatchesCookie.call(this, element)) {
+ matchedElement = element;
+ return true;
+ }
+ }, this);
+
+ if (matchedElement) {
+ matchedElement.revealAndSelect(true, false);
+
+ delete this._pendingViewStateCookie;
+
+ // Delay clearing the restoringState flag until the next runloop so listeners
+ // checking for it in this runloop still know state was being restored.
+ setTimeout(function() {
+ delete this._restoringState;
+ }.bind(this));
+
+ if (this._finalAttemptToRestoreViewStateTimeout) {
+ clearTimeout(this._finalAttemptToRestoreViewStateTimeout);
+ delete this._finalAttemptToRestoreViewStateTimeout;
+ }
+ }
+ }
+};
+
+WebInspector.NavigationSidebarPanel.prototype.__proto__ = WebInspector.SidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineOverviewGraphcssfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-overview-graph.network {
+ padding-top: 3px;
+}
+
+.timeline-overview-graph.network > .graph-row {
+ height: 5px;
+}
+
+.timeline-overview-graph.network > .graph-row > .timeline-record-bar {
+ height: 4px;
+ margin-top: 1px;
+}
+
+.timeline-overview-graph.network > .graph-row > .timeline-record-bar > .segment:not(.inactive) {
+ box-shadow: white 1px 0 0;
+}
+
+.timeline-overview-graph.network:nth-child(even) > .graph-row > .timeline-record-bar > .segment:not(.inactive) {
+ box-shadow: rgb(247, 247, 247) 1px 0 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineOverviewGraphjsfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkTimelineOverviewGraphjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineOverviewGraph.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+
+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimelineOverviewGraph = function(recording)
+{
+ WebInspector.TimelineOverviewGraph.call(this, recording);
+
+ this.element.classList.add(WebInspector.NetworkTimelineOverviewGraph.StyleClassName);
+
+ var networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
+ networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
+ networkTimeline.addEventListener(WebInspector.Timeline.Event.TimesUpdated, this.needsLayout, this);
+
+ this.reset();
+};
+
+WebInspector.NetworkTimelineOverviewGraph.StyleClassName = "network";
+WebInspector.NetworkTimelineOverviewGraph.GraphRowStyleClassName = "graph-row";
+WebInspector.NetworkTimelineOverviewGraph.BarStyleClassName = "bar";
+WebInspector.NetworkTimelineOverviewGraph.InactiveBarStyleClassName = "inactive";
+WebInspector.NetworkTimelineOverviewGraph.UnfinishedStyleClassName = "unfinished";
+WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount = 6;
+
+WebInspector.NetworkTimelineOverviewGraph.prototype = {
+ constructor: WebInspector.NetworkTimelineOverviewGraph,
+ __proto__: WebInspector.TimelineOverviewGraph.prototype,
+
+ // Public
+
+ reset: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
+
+ this._nextDumpRow = 0;
+ this._timelineRecordGridRows = [];
+
+ for (var i = 0; i < WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount; ++i)
+ this._timelineRecordGridRows.push([]);
+
+ this.element.removeChildren();
+
+ for (var rowRecords of this._timelineRecordGridRows) {
+ rowRecords.__element = document.createElement("div");
+ rowRecords.__element.className = WebInspector.NetworkTimelineOverviewGraph.GraphRowStyleClassName;
+ this.element.appendChild(rowRecords.__element);
+
+ rowRecords.__recordBars = [];
+ }
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
+
+ var visibleWidth = this.element.offsetWidth;
+ var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
+
+ var recordBarIndex = 0;
+
+ function createBar(rowElement, rowRecordBars, records, renderMode)
+ {
+ var timelineRecordBar = rowRecordBars[recordBarIndex];
+ if (!timelineRecordBar)
+ timelineRecordBar = rowRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
+ timelineRecordBar.renderMode = renderMode;
+ timelineRecordBar.records = records;
+ timelineRecordBar.refresh(this);
+ if (!timelineRecordBar.element.parentNode)
+ rowElement.appendChild(timelineRecordBar.element);
+ ++recordBarIndex;
+ }
+
+ for (var rowRecords of this._timelineRecordGridRows) {
+ var rowElement = rowRecords.__element;
+ var rowRecordBars = rowRecords.__recordBars;
+
+ recordBarIndex = 0;
+
+ WebInspector.TimelineRecordBar.createCombinedBars(rowRecords, secondsPerPixel, this, createBar.bind(this, rowElement, rowRecordBars));
+
+ // Remove the remaining unused TimelineRecordBars.
+ for (; recordBarIndex < rowRecordBars.length; ++recordBarIndex) {
+ rowRecordBars[recordBarIndex].records = null;
+ rowRecordBars[recordBarIndex].element.remove();
+ }
+ }
+ },
+
+ // Private
+
+ _networkTimelineRecordAdded: function(event)
+ {
+ var resourceTimelineRecord = event.data.record;
+ console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
+
+ function compareByStartTime(a, b)
+ {
+ return a.startTime - b.startTime;
+ }
+
+ // Try to find a row that has room and does not overlap a previous record.
+ var foundRowForRecord = false;
+ for (var i = 0; i < this._timelineRecordGridRows.length; ++i) {
+ var rowRecords = this._timelineRecordGridRows[i];
+ var lastRecord = rowRecords.lastValue;
+
+ if (!lastRecord || lastRecord.endTime + WebInspector.NetworkTimelineOverviewGraph.MinimumBarPaddingTime <= resourceTimelineRecord.startTime) {
+ insertObjectIntoSortedArray(resourceTimelineRecord, rowRecords, compareByStartTime);
+ this._nextDumpRow = i + 1;
+ foundRowForRecord = true;
+ break;
+ }
+ }
+
+ if (!foundRowForRecord) {
+ // Try to find a row that does not overlap a previous record's active time, but it can overlap the inactive time.
+ for (var i = 0; i < this._timelineRecordGridRows.length; ++i) {
+ var rowRecords = this._timelineRecordGridRows[i];
+ var lastRecord = rowRecords.lastValue;
+ console.assert(lastRecord);
+
+ if (lastRecord.activeStartTime + WebInspector.NetworkTimelineOverviewGraph.MinimumBarPaddingTime <= resourceTimelineRecord.startTime) {
+ insertObjectIntoSortedArray(resourceTimelineRecord, rowRecords, compareByStartTime);
+ this._nextDumpRow = i + 1;
+ foundRowForRecord = true;
+ break;
+ }
+ }
+ }
+
+ // We didn't find a empty spot, so dump into the designated dump row.
+ if (!foundRowForRecord) {
+ if (this._nextDumpRow >= WebInspector.NetworkTimelineOverviewGraph.MaximumRowCount)
+ this._nextDumpRow = 0;
+ insertObjectIntoSortedArray(resourceTimelineRecord, this._timelineRecordGridRows[this._nextDumpRow++], compareByStartTime);
+ }
+
+ this.needsLayout();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-view.network > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
+
+.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.network .item .subtitle {
+ display: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceNetworkTimelineViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/NetworkTimelineView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.NetworkTimelineView = function(recording)
+{
+ WebInspector.TimelineView.call(this);
+
+ this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
+ this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
+ this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NetworkTimelineView.TreeOutlineStyleClassName);
+
+ var columns = {domain: {}, type: {}, method: {}, scheme: {}, statusCode: {}, cached: {}, size: {}, transferSize: {}, requestSent: {}, latency: {}, duration: {}};
+
+ columns.domain.title = WebInspector.UIString("Domain");
+ columns.domain.width = "10%";
+
+ columns.type.title = WebInspector.UIString("Type");
+ columns.type.width = "8%";
+ columns.type.scopeBar = WebInspector.TimelineDataGrid.createColumnScopeBar("network", WebInspector.Resource.Type);
+
+ columns.method.title = WebInspector.UIString("Method");
+ columns.method.width = "6%";
+
+ columns.scheme.title = WebInspector.UIString("Scheme");
+ columns.scheme.width = "6%";
+
+ columns.statusCode.title = WebInspector.UIString("Status");
+ columns.statusCode.width = "6%";
+
+ columns.cached.title = WebInspector.UIString("Cached");
+ columns.cached.width = "6%";
+
+ columns.size.title = WebInspector.UIString("Size");
+ columns.size.width = "8%";
+ columns.size.aligned = "right";
+
+ columns.transferSize.title = WebInspector.UIString("Transfered");
+ columns.transferSize.width = "8%";
+ columns.transferSize.aligned = "right";
+
+ columns.requestSent.title = WebInspector.UIString("Start Time");
+ columns.requestSent.width = "9%";
+ columns.requestSent.aligned = "right";
+ columns.requestSent.sort = "ascending";
+
+ columns.latency.title = WebInspector.UIString("Latency");
+ columns.latency.width = "9%";
+ columns.latency.aligned = "right";
+
+ columns.duration.title = WebInspector.UIString("Duration");
+ columns.duration.width = "9%";
+ columns.duration.aligned = "right";
+
+ for (var column in columns)
+ columns[column].sortable = true;
+
+ this._dataGrid = new WebInspector.TimelineDataGrid(this.navigationSidebarTreeOutline, columns);
+ this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+
+ this.element.classList.add(WebInspector.NetworkTimelineView.StyleClassName);
+ this.element.appendChild(this._dataGrid.element);
+
+ var networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
+ networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
+
+ this._pendingRecords = [];
+};
+
+WebInspector.NetworkTimelineView.StyleClassName = "network";
+WebInspector.NetworkTimelineView.TreeOutlineStyleClassName = "network";
+
+WebInspector.NetworkTimelineView.prototype = {
+ constructor: WebInspector.NetworkTimelineView,
+ __proto__: WebInspector.TimelineView.prototype,
+
+ // Public
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ return WebInspector.UIString("Resources");
+ },
+
+ shown: function()
+ {
+ WebInspector.TimelineView.prototype.shown.call(this);
+
+ this._dataGrid.shown();
+ },
+
+ hidden: function()
+ {
+ this._dataGrid.hidden();
+
+ WebInspector.TimelineView.prototype.hidden.call(this);
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineView.prototype.updateLayout.call(this);
+
+ this._dataGrid.updateLayout();
+
+ this._processPendingRecords();
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
+ },
+
+ reset: function()
+ {
+ WebInspector.TimelineView.prototype.reset.call(this);
+
+ this._dataGrid.reset();
+ },
+
+ // Protected
+
+ treeElementPathComponentSelected: function(event)
+ {
+ var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
+ if (!dataGridNode)
+ return;
+ dataGridNode.revealAndSelect();
+ },
+
+ // Private
+
+ _processPendingRecords: function()
+ {
+ if (!this._pendingRecords.length)
+ return;
+
+ for (var resourceTimelineRecord of this._pendingRecords) {
+ // Skip the record if it already exists in the tree.
+ var treeElement = this.navigationSidebarTreeOutline.findTreeElement(resourceTimelineRecord.resource);
+ if (treeElement)
+ continue;
+
+ treeElement = new WebInspector.ResourceTreeElement(resourceTimelineRecord.resource);
+ var dataGridNode = new WebInspector.ResourceTimelineDataGridNode(resourceTimelineRecord, false, this);
+
+ this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
+ }
+
+ this._pendingRecords = [];
+ },
+
+ _networkTimelineRecordAdded: function(event)
+ {
+ var resourceTimelineRecord = event.data.record;
+ console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
+
+ this._pendingRecords.push(resourceTimelineRecord);
+
+ this.needsLayout();
+ },
+
+ _dataGridFiltersDidChange: function(event)
+ {
+ WebInspector.timelineSidebarPanel.updateFilter();
+ },
+
+ _dataGridNodeSelected: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (this._dataGrid.shouldIgnoreSelectionEvent())
+ return;
+
+ if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+ return;
+
+ if (treeElement instanceof WebInspector.FolderTreeElement)
+ return;
+
+ if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
+ WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
+ return;
+ }
+
+ console.error("Unknown tree element selected.");
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceObjectPropertiesSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ObjectPropertiesSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,347 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor)
+{
+ this.emptyPlaceholder = (emptyPlaceholder || WebInspector.UIString("No Properties"));
+ this.object = object;
+ this.ignoreHasOwnProperty = ignoreHasOwnProperty;
+ this.extraProperties = extraProperties;
+ this.treeElementConstructor = treeElementConstructor || WebInspector.ObjectPropertyTreeElement;
+ this.editable = true;
+
+ WebInspector.PropertiesSection.call(this, title, subtitle);
+}
+
+WebInspector.ObjectPropertiesSection.prototype = {
+ onpopulate: function()
+ {
+ this.update();
+ },
+
+ update: function()
+ {
+ var self = this;
+ function callback(properties)
+ {
+ if (!properties)
+ return;
+ self.updateProperties(properties);
+ }
+ if (this.ignoreHasOwnProperty)
+ this.object.getAllProperties(callback);
+ else
+ this.object.getOwnProperties(callback);
+ },
+
+ updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
+ {
+ if (!rootTreeElementConstructor)
+ rootTreeElementConstructor = this.treeElementConstructor;
+
+ if (!rootPropertyComparer)
+ rootPropertyComparer = WebInspector.ObjectPropertiesSection.CompareProperties;
+
+ if (this.extraProperties)
+ for (var i = 0; i < this.extraProperties.length; ++i)
+ properties.push(this.extraProperties[i]);
+
+ properties.sort(rootPropertyComparer);
+
+ this.propertiesTreeOutline.removeChildren();
+
+ for (var i = 0; i < properties.length; ++i) {
+ properties[i].parentObject = this.object;
+ this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));
+ }
+
+ if (!this.propertiesTreeOutline.children.length) {
+ var title = document.createElement("div");
+ title.className = "info";
+ title.textContent = this.emptyPlaceholder;
+ var infoElement = new TreeElement(title, null, false);
+ this.propertiesTreeOutline.appendChild(infoElement);
+ }
+ this.propertiesForTest = properties;
+
+ this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
+ }
+}
+
+WebInspector.ObjectPropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;
+
+WebInspector.ObjectPropertiesSection.CompareProperties = function(propertyA, propertyB)
+{
+ var a = propertyA.name;
+ var b = propertyB.name;
+ if (a === "__proto__")
+ return 1;
+ if (b === "__proto__")
+ return -1;
+
+ // if used elsewhere make sure to
+ // - convert a and b to strings (not needed here, properties are all strings)
+ // - check if a == b (not needed here, no two properties can be the same)
+
+ var diff = 0;
+ var chunk = /^\d+|^\D+/;
+ var chunka, chunkb, anum, bnum;
+ while (diff === 0) {
+ if (!a && b)
+ return -1;
+ if (!b && a)
+ return 1;
+ chunka = a.match(chunk)[0];
+ chunkb = b.match(chunk)[0];
+ anum = !isNaN(chunka);
+ bnum = !isNaN(chunkb);
+ if (anum && !bnum)
+ return -1;
+ if (bnum && !anum)
+ return 1;
+ if (anum && bnum) {
+ diff = chunka - chunkb;
+ if (diff === 0 && chunka.length !== chunkb.length) {
+ if (!+chunka && !+chunkb) // chunks are strings of all 0s (special case)
+ return chunka.length - chunkb.length;
+ else
+ return chunkb.length - chunka.length;
+ }
+ } else if (chunka !== chunkb)
+ return (chunka < chunkb) ? -1 : 1;
+ a = a.substring(chunka.length);
+ b = b.substring(chunkb.length);
+ }
+ return diff;
+}
+
+/**
+ * @constructor
+ * @extends {TreeElement}
+ */
+WebInspector.ObjectPropertyTreeElement = function(property)
+{
+ this.property = property;
+
+ // Pass an empty title, the title gets made later in onattach.
+ TreeElement.call(this, "", null, false);
+ this.toggleOnClick = true;
+ this.selectable = false;
+}
+
+WebInspector.ObjectPropertyTreeElement.prototype = {
+ onpopulate: function()
+ {
+ if (this.children.length && !this.shouldRefreshChildren)
+ return;
+
+ var callback = function(properties) {
+ this.removeChildren();
+ if (!properties)
+ return;
+
+ properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);
+ for (var i = 0; i < properties.length; ++i) {
+ this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
+ }
+ };
+ this.property.value.getOwnProperties(callback.bind(this));
+ },
+
+ ondblclick: function(event)
+ {
+ if (this.property.writable)
+ this.startEditing();
+ },
+
+ onattach: function()
+ {
+ this.update();
+ },
+
+ update: function()
+ {
+ this.nameElement = document.createElement("span");
+ this.nameElement.className = "name";
+ this.nameElement.textContent = this.property.name;
+ if (!this.property.enumerable && (!this.parent.root || !this.treeOutline.section.dontHighlightNonEnumerablePropertiesAtTopLevel))
+ this.nameElement.classList.add("dimmed");
+
+ var separatorElement = document.createElement("span");
+ separatorElement.className = "separator";
+ separatorElement.textContent = ": ";
+
+ this.valueElement = document.createElement("span");
+ this.valueElement.className = "value";
+
+ var description = this.property.value.description;
+ // Render \n as a nice unicode cr symbol.
+ if (this.property.wasThrown)
+ this.valueElement.textContent = "[Exception: " + description + "]";
+ else if (this.property.value.type === "string" && typeof description === "string") {
+ this.valueElement.textContent = "\"" + description.replace(/\n/g, "\u21B5") + "\"";
+ this.valueElement._originalTextContent = "\"" + description + "\"";
+ } else if (this.property.value.type === "function" && typeof description === "string") {
+ this.valueElement.textContent = /.*/.exec(description)[0].replace(/ +$/g, "");
+ this.valueElement._originalTextContent = description;
+ } else
+ this.valueElement.textContent = description;
+
+ if (this.property.value.type === "function")
+ this.valueElement.addEventListener("contextmenu", this._functionContextMenuEventFired.bind(this), false);
+
+ if (this.property.wasThrown)
+ this.valueElement.classList.add("error");
+ if (this.property.value.subtype)
+ this.valueElement.classList.add("console-formatted-" + this.property.value.subtype);
+ else if (this.property.value.type)
+ this.valueElement.classList.add("console-formatted-" + this.property.value.type);
+ if (this.property.value.subtype === "node")
+ this.valueElement.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), false);
+
+ this.listItemElement.removeChildren();
+
+ this.listItemElement.appendChild(this.nameElement);
+ this.listItemElement.appendChild(separatorElement);
+ this.listItemElement.appendChild(this.valueElement);
+ this.hasChildren = this.property.value.hasChildren && !this.property.wasThrown;
+ },
+
+ _contextMenuEventFired: function(event)
+ {
+ function selectNode(nodeId)
+ {
+ if (nodeId)
+ WebInspector.domTreeManager.inspectElement(nodeId);
+ }
+
+ function revealElement()
+ {
+ this.property.value.pushNodeToFrontend(selectNode);
+ }
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+ contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), revealElement.bind(this));
+ contextMenu.show();
+ },
+
+ _functionContextMenuEventFired: function(event)
+ {
+ function didGetLocation(error, response)
+ {
+ if (error) {
+ console.error(error);
+ return;
+ }
+ WebInspector.panels.scripts.showFunctionDefinition(response);
+ }
+
+ function revealFunction()
+ {
+ DebuggerAgent.getFunctionLocation(this.property.value.objectId, didGetLocation.bind(this));
+ }
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+ contextMenu.appendItem(WebInspector.UIString("Show function definition"), revealFunction.bind(this));
+ contextMenu.show();
+ },
+
+ updateSiblings: function()
+ {
+ if (this.parent.root)
+ this.treeOutline.section.update();
+ else
+ this.parent.shouldRefreshChildren = true;
+ },
+
+ startEditing: function()
+ {
+ if (WebInspector.isBeingEdited(this.valueElement) || !this.treeOutline.section.editable)
+ return;
+
+ var context = { expanded: this.expanded };
+
+ // Lie about our children to prevent expanding on double click and to collapse subproperties.
+ this.hasChildren = false;
+
+ this.listItemElement.classList.add("editing-sub-part");
+
+ // Edit original source.
+ if (typeof this.valueElement._originalTextContent === "string")
+ this.valueElement.textContent = this.valueElement._originalTextContent;
+
+ var config = new WebInspector.EditingConfig(this.editingCommitted.bind(this), this.editingCancelled.bind(this), context);
+ WebInspector.startEditing(this.valueElement, config);
+ },
+
+ editingEnded: function(context)
+ {
+ this.listItemElement.scrollLeft = 0;
+ this.listItemElement.classList.remove("editing-sub-part");
+ if (context.expanded)
+ this.expand();
+ },
+
+ editingCancelled: function(element, context)
+ {
+ this.update();
+ this.editingEnded(context);
+ },
+
+ editingCommitted: function(element, userInput, previousContent, context)
+ {
+ if (userInput === previousContent)
+ return this.editingCancelled(element, context); // nothing changed, so cancel
+
+ this.applyExpression(userInput, true);
+
+ this.editingEnded(context);
+ },
+
+ applyExpression: function(expression, updateInterface)
+ {
+ expression = expression.trim();
+ var expressionLength = expression.length;
+ function callback(error)
+ {
+ if (!updateInterface)
+ return;
+
+ if (error)
+ this.update();
+
+ if (!expressionLength) {
+ // The property was deleted, so remove this tree element.
+ this.parent.removeChild(this);
+ } else {
+ // Call updateSiblings since their value might be based on the value that just changed.
+ this.updateSiblings();
+ }
+ };
+ this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback.bind(this));
+ }
+}
+
+WebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-view.overview > .timeline-ruler {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.timeline-view.overview > .timeline-ruler > .header {
+ border-top: 1px solid rgb(200, 200, 200);
+ height: 23px;
+}
+
+.timeline-view.overview > .timeline-ruler > .event-markers {
+ top: 23px;
+}
+
+.timeline-view.overview > .data-grid {
+ position: absolute;
+ top: 23px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ border: none;
+}
+
+.timeline-view.overview > .data-grid table.header {
+ display: none;
+}
+
+.timeline-view.overview > .data-grid .data-container {
+ top: 0;
+}
+
+.timeline-view.overview > .data-grid td.graph-column {
+ padding: 2px 0;
+}
+
+.timeline-view.overview > .data-grid td.graph-column > div {
+ position: relative;
+ height: 16px;
+}
+
+.timeline-view.overview > .data-grid td.graph-column .timeline-record-bar {
+ top: 2px;
+}
+
+.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
+ box-shadow: white 0 0 0 1px;
+}
+
+.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
+ box-shadow: rgb(212, 212, 212) 0 0 0 1px;
+}
+
+.timeline-view.overview > .data-grid:focus tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment {
+ box-shadow: rgb(56, 121, 217) 0 0 0 1px;
+}
+
+.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
+ box-shadow: white 1px 0 0;
+}
+
+.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
+ box-shadow: rgb(212, 212, 212) 1px 0 0;
+}
+
+.timeline-view.overview > .data-grid:focus tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
+ box-shadow: rgb(56, 121, 217) 1px 0 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceOverviewTimelineViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/OverviewTimelineView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,352 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.OverviewTimelineView = function(recording)
+{
+ WebInspector.TimelineView.call(this);
+
+ this._recording = recording;
+
+ this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
+
+ var columns = {"graph": {width: "100%"}};
+
+ this._dataGrid = new WebInspector.DataGrid(columns);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+
+ this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(this._contentTreeOutline, this._dataGrid);
+
+ this._timelineRuler = new WebInspector.TimelineRuler;
+ this._timelineRuler.allowsClippedLabels = true;
+ this.element.appendChild(this._timelineRuler.element);
+
+ this._currentTimeMarker = new WebInspector.TimelineMarker(0, WebInspector.TimelineMarker.Type.CurrentTime);
+ this._timelineRuler.addMarker(this._currentTimeMarker);
+
+ this.element.classList.add(WebInspector.OverviewTimelineView.StyleClassName);
+ this.element.appendChild(this._dataGrid.element);
+
+ this._networkTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Network);
+ this._networkTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
+
+ recording.addEventListener(WebInspector.TimelineRecording.Event.SourceCodeTimelineAdded, this._sourceCodeTimelineAdded, this);
+
+ this._pendingRepresentedObjects = [];
+};
+
+WebInspector.OverviewTimelineView.StyleClassName = "overview";
+
+WebInspector.OverviewTimelineView.prototype = {
+ constructor: WebInspector.OverviewTimelineView,
+ __proto__: WebInspector.TimelineView.prototype,
+
+ // Public
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ return WebInspector.UIString("Timeline Events");
+ },
+
+ shown: function()
+ {
+ WebInspector.TimelineView.prototype.shown.call(this);
+
+ this._treeOutlineDataGridSynchronizer.synchronize();
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineView.prototype.updateLayout.call(this);
+
+ var oldZeroTime = this._timelineRuler.zeroTime;
+ var oldStartTime = this._timelineRuler.startTime;
+ var oldEndTime = this._timelineRuler.endTime;
+ var oldCurrentTime = this._currentTimeMarker.time;
+
+ this._timelineRuler.zeroTime = this.zeroTime;
+ this._timelineRuler.startTime = this.startTime;
+ this._timelineRuler.endTime = this.endTime;
+ this._currentTimeMarker.time = this.currentTime;
+
+ // The TimelineDataGridNode graphs are positioned with percentages, so they auto resize with the view.
+ // We only need to refresh the graphs when the any of the times change.
+ if (this.zeroTime !== oldZeroTime || this.startTime !== oldStartTime || this.endTime !== oldEndTime || this.currentTime !== oldCurrentTime) {
+ var dataGridNode = this._dataGrid.children[0];
+ while (dataGridNode) {
+ dataGridNode.refreshGraph();
+ dataGridNode = dataGridNode.traverseNextNode(true, null, true);
+ }
+ }
+
+ if (!this.currentTime !== oldCurrentTime) {
+ var selectedTreeElement = this.navigationSidebarTreeOutline.selectedTreeElement;
+ var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
+
+ // Check the filters again since the current time change might have revealed this node. Start and end time changes are handled by TimelineContentView.
+ WebInspector.timelineSidebarPanel.updateFilter();
+
+ if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
+ this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+ }
+
+ this._timelineRuler.updateLayout();
+
+ this._processPendingRepresentedObjects();
+ },
+
+ get selectionPathComponents()
+ {
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return null;
+
+ var pathComponents = [];
+
+ while (dataGridNode && !dataGridNode.root) {
+ var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
+ console.assert(treeElement);
+ if (!treeElement)
+ break;
+
+ if (treeElement.hidden)
+ return null;
+
+ var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
+ pathComponents.unshift(pathComponent);
+ dataGridNode = dataGridNode.parent;
+ }
+
+ return pathComponents;
+ },
+
+ // Protected
+
+ treeElementPathComponentSelected: function(event)
+ {
+ var dataGridNode = this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
+ if (!dataGridNode)
+ return;
+ dataGridNode.revealAndSelect();
+ },
+
+ // Private
+
+ _compareTreeElementsByDetails: function(a, b)
+ {
+ if (a instanceof WebInspector.SourceCodeTimelineTreeElement && b instanceof WebInspector.ResourceTreeElement)
+ return -1;
+
+ if (a instanceof WebInspector.ResourceTreeElement && b instanceof WebInspector.SourceCodeTimelineTreeElement)
+ return 1;
+
+ if (a instanceof WebInspector.SourceCodeTimelineTreeElement && b instanceof WebInspector.SourceCodeTimelineTreeElement) {
+ aTimeline = a.sourceCodeTimeline;
+ bTimeline = b.sourceCodeTimeline;
+
+ if (!aTimeline.sourceCodeLocation && !bTimeline.sourceCodeLocation) {
+ if (aTimeline.recordType !== bTimeline.recordType)
+ return aTimeline.recordType.localeCompare(bTimeline.recordType);
+
+ return a.mainTitle.localeCompare(b.mainTitle);
+ }
+
+ if (!aTimeline.sourceCodeLocation || !bTimeline.sourceCodeLocation)
+ return !!aTimeline.sourceCodeLocation - !!bTimeline.sourceCodeLocation;
+
+ if (aTimeline.sourceCodeLocation.lineNumber !== bTimeline.sourceCodeLocation.lineNumber)
+ return aTimeline.sourceCodeLocation.lineNumber - bTimeline.sourceCodeLocation.lineNumber;
+
+ return aTimeline.sourceCodeLocation.columnNumber - bTimeline.sourceCodeLocation.columnNumber;
+ }
+
+ // Fallback to comparing by start time for ResourceTreeElement or anything else.
+ return this._compareTreeElementsByStartTime(a, b);
+ },
+
+ _compareTreeElementsByStartTime: function(a, b)
+ {
+ function getStartTime(treeElement)
+ {
+ if (treeElement instanceof WebInspector.ResourceTreeElement)
+ return treeElement.resource.firstTimestamp;
+ if (treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)
+ return treeElement.sourceCodeTimeline.startTime;
+
+ console.error("Unknown tree element.");
+ return 0;
+ }
+
+ var result = getStartTime(a) - getStartTime(b);
+ if (result)
+ return result;
+
+ // Fallback to comparing titles.
+ return a.mainTitle.localeCompare(b.mainTitle);
+ },
+
+ _insertTreeElement: function(treeElement, parentTreeElement)
+ {
+ console.assert(treeElement);
+ console.assert(!treeElement.parent);
+ console.assert(parentTreeElement);
+
+ parentTreeElement.insertChild(treeElement, insertionIndexForObjectInListSortedByFunction(treeElement, parentTreeElement.children, this._compareTreeElementsByStartTime.bind(this)));
+ },
+
+ _addResourceToTreeIfNeeded: function(resource)
+ {
+ console.assert(resource);
+ if (!resource)
+ return null;
+
+ var treeElement = this.navigationSidebarTreeOutline.findTreeElement(resource);
+ if (treeElement)
+ return treeElement;
+
+ var parentFrame = resource.parentFrame;
+ if (!parentFrame)
+ return;
+
+ var expandedByDefault = false;
+ if (parentFrame.mainResource === resource || parentFrame.provisionalMainResource === resource) {
+ parentFrame = parentFrame.parentFrame;
+ expandedByDefault = !parentFrame; // Main frame expands by default.
+ }
+
+ var resourceTreeElement = new WebInspector.ResourceTreeElement(resource);
+ if (expandedByDefault)
+ resourceTreeElement.expand();
+
+ var resourceTimelineRecord = this._networkTimeline ? this._networkTimeline.recordForResource(resource) : null;
+ if (!resourceTimelineRecord)
+ resourceTimelineRecord = new WebInspector.ResourceTimelineRecord(resource);
+
+ var resourceDataGridNode = new WebInspector.ResourceTimelineDataGridNode(resourceTimelineRecord, true, this);
+ this._treeOutlineDataGridSynchronizer.associate(resourceTreeElement, resourceDataGridNode);
+
+ var parentTreeElement = this.navigationSidebarTreeOutline;
+ if (parentFrame) {
+ // Find the parent main resource, adding it if needed, to append this resource as a child.
+ var parentResource = parentFrame.provisionalMainResource || parentFrame.mainResource;
+
+ parentTreeElement = this._addResourceToTreeIfNeeded(parentResource);
+ console.assert(parentTreeElement);
+ if (!parentTreeElement)
+ return;
+ }
+
+ this._insertTreeElement(resourceTreeElement, parentTreeElement);
+
+ return resourceTreeElement;
+ },
+
+ _addSourceCodeTimeline: function(sourceCodeTimeline)
+ {
+ var parentTreeElement = sourceCodeTimeline.sourceCodeLocation ? this._addResourceToTreeIfNeeded(sourceCodeTimeline.sourceCode) : this.navigationSidebarTreeOutline;
+ console.assert(parentTreeElement);
+ if (!parentTreeElement)
+ return;
+
+ var sourceCodeTimelineTreeElement = new WebInspector.SourceCodeTimelineTreeElement(sourceCodeTimeline);
+ var sourceCodeTimelineDataGridNode = new WebInspector.SourceCodeTimelineTimelineDataGridNode(sourceCodeTimeline, this);
+
+ this._treeOutlineDataGridSynchronizer.associate(sourceCodeTimelineTreeElement, sourceCodeTimelineDataGridNode);
+ this._insertTreeElement(sourceCodeTimelineTreeElement, parentTreeElement);
+ },
+
+ _processPendingRepresentedObjects: function()
+ {
+ if (!this._pendingRepresentedObjects || !this._pendingRepresentedObjects.length)
+ return;
+
+ for (var representedObject of this._pendingRepresentedObjects) {
+ if (representedObject instanceof WebInspector.Resource)
+ this._addResourceToTreeIfNeeded(representedObject);
+ else if (representedObject instanceof WebInspector.SourceCodeTimeline)
+ this._addSourceCodeTimeline(representedObject);
+ else
+ console.error("Unknown represented object");
+ }
+
+ this._pendingRepresentedObjects = [];
+ },
+
+ _networkTimelineRecordAdded: function(event)
+ {
+ var resourceTimelineRecord = event.data.record;
+ console.assert(resourceTimelineRecord instanceof WebInspector.ResourceTimelineRecord);
+
+ this._pendingRepresentedObjects.push(resourceTimelineRecord.resource);
+
+ this.needsLayout();
+
+ // We don't expect to have any source code timelines yet. Those should be added with _sourceCodeTimelineAdded.
+ console.assert(!this._recording.sourceCodeTimelinesForSourceCode(resourceTimelineRecord.resource).length);
+ },
+
+ _sourceCodeTimelineAdded: function(event)
+ {
+ var sourceCodeTimeline = event.data.sourceCodeTimeline;
+ console.assert(sourceCodeTimeline);
+ if (!sourceCodeTimeline)
+ return;
+
+ this._pendingRepresentedObjects.push(sourceCodeTimeline);
+
+ this.needsLayout();
+ },
+
+ _dataGridNodeSelected: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+ return;
+
+ if (treeElement instanceof WebInspector.FolderTreeElement)
+ return;
+
+ if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
+ WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
+ return;
+ }
+
+ if (!(treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)) {
+ console.error("Unknown tree element selected.");
+ return;
+ }
+
+ if (!treeElement.sourceCodeTimeline.sourceCodeLocation) {
+ WebInspector.timelineSidebarPanel.showTimelineOverview();
+ return;
+ }
+
+ WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPathComponentIconscssfromrev164541trunkSourceWebInspectorUIUserInterfacePathComponentIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/PathComponentIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.source-code-icon .icon {
+ content: url(../Images/SourceCode.svg);
+}
+
+.dom-tree-icon .icon {
+ content: url(../Images/DOMTree.svg);
+}
+
+.request-icon .icon {
+ content: url(../Images/Request.svg);
+}
+
+.response-icon .icon {
+ content: url(../Images/Response.svg);
+}
+
+.dom-element-icon .icon {
+ content: url(../Images/DOMElement.svg);
+}
+
+.dom-text-node-icon .icon {
+ content: url(../Images/DOMTextNode.svg);
+}
+
+.dom-comment-icon .icon {
+ content: url(../Images/DOMComment.svg);
+}
+
+.dom-document-type-icon .icon {
+ content: url(../Images/DOMDocumentType.svg);
+}
+
+.dom-document-icon .icon {
+ content: url(../Images/DOMDocument.svg);
+}
+
+.dom-character-data-icon .icon {
+ content: url(../Images/DOMCharacterData.svg);
+}
+
+.dom-node-icon .icon {
+ content: url(../Images/DOMNode.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPopovercssfromrev164541trunkSourceWebInspectorUIUserInterfacePopovercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Popover.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Popover.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Popover.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Popover.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.popover {
+ position: absolute;
+ min-width: 20px;
+ min-height: 20px;
+ box-sizing: border-box;
+ pointer-events: none;
+}
+
+.popover.arrow-up {
+ padding: 16px 5px 5px 5px;
+}
+
+.popover.arrow-right {
+ padding: 5px 16px 5px 5px;
+}
+
+.popover.arrow-down {
+ padding: 5px 5px 16px 5px;
+}
+
+.popover.arrow-left {
+ padding: 5px 5px 5px 16px;
+}
+
+.popover.fade-out {
+ transition: opacity 350ms;
+ pointer-events: none;
+ opacity: 0;
+}
+
+.popover > .container {
+ position: absolute;
+ left: 5px;
+ top: 5px;
+ right: 5px;
+ bottom: 5px;
+
+ padding: 5px;
+
+ overflow-y: auto;
+ overflow-x: hidden;
+
+ pointer-events: auto;
+}
+
+.popover > .container.center {
+ display: -webkit-flex;
+ -webkit-justify-content: center;
+ -webkit-align-items: center;
+}
+
+.popover.arrow-up > .container {
+ top: 16px;
+}
+
+.popover.arrow-right > .container {
+ right: 16px;
+}
+
+.popover.arrow-down > .container {
+ bottom: 16px;
+}
+
+.popover.arrow-left > .container {
+ left: 16px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPopoverjsfromrev164541trunkSourceWebInspectorUIUserInterfacePopoverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Popover.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Popover.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,544 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Popover = function(delegate) {
+ WebInspector.Object.call(this);
+
+ this.delegate = delegate;
+ this._edge = null;
+ this._frame = new WebInspector.Rect;
+ this._content = null;
+ this._targetFrame = new WebInspector.Rect;
+ this._anchorPoint = new WebInspector.Point;
+ this._preferredEdges = null;
+
+ this._contentNeedsUpdate = false;
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.Popover.StyleClassName;
+ this._canvasId = "popover-" + (WebInspector.Popover.canvasId++);
+ this._element.style.backgroundImage = "-webkit-canvas(" + this._canvasId + ")";
+ this._element.addEventListener("transitionend", this, true);
+
+ this._container = this._element.appendChild(document.createElement("div"));
+ this._container.className = "container";
+};
+
+WebInspector.Popover.StyleClassName = "popover";
+WebInspector.Popover.FadeOutClassName = "fade-out";
+WebInspector.Popover.canvasId = 0;
+WebInspector.Popover.CornerRadius = 5;
+WebInspector.Popover.MinWidth = 40;
+WebInspector.Popover.MinHeight = 40;
+WebInspector.Popover.ShadowPadding = 5;
+WebInspector.Popover.ContentPadding = 5;
+WebInspector.Popover.AnchorSize = new WebInspector.Size(22, 11);
+WebInspector.Popover.ShadowEdgeInsets = new WebInspector.EdgeInsets(WebInspector.Popover.ShadowPadding);
+
+WebInspector.Popover.prototype = {
+ constructor: WebInspector.Popover,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ get visible()
+ {
+ return this._element.parentNode === document.body && !this._element.classList.contains(WebInspector.Popover.FadeOutClassName);
+ },
+
+ set frame(frame)
+ {
+ this._element.style.left = frame.minX() + "px";
+ this._element.style.top = frame.minY() + "px";
+ this._element.style.width = frame.size.width + "px";
+ this._element.style.height = frame.size.height + "px";
+ this._element.style.backgroundSize = frame.size.width + "px " + frame.size.height + "px";
+ this._frame = frame;
+ },
+
+ set content(content)
+ {
+ if (content === this._content)
+ return;
+
+ this._content = content;
+
+ this._contentNeedsUpdate = true;
+
+ if (this.visible)
+ this._update(true);
+ },
+
+ update: function()
+ {
+ if (!this.visible)
+ return;
+
+ var previouslyFocusedElement = document.activeElement;
+
+ this._contentNeedsUpdate = true;
+ this._update(true);
+
+ if (previouslyFocusedElement)
+ previouslyFocusedElement.focus();
+ },
+
+ /**
+ * @param {WebInspector.Rect} targetFrame
+ * @param {WebInspector.RectEdge}[] preferredEdges
+ */
+ present: function(targetFrame, preferredEdges)
+ {
+ this._targetFrame = targetFrame;
+ this._preferredEdges = preferredEdges;
+
+ if (!this._content)
+ return;
+
+ window.addEventListener("mousedown", this, true);
+ window.addEventListener("scroll", this, true);
+
+ this._update();
+ },
+
+ dismiss: function()
+ {
+ if (this._element.parentNode !== document.body)
+ return;
+
+ window.removeEventListener("mousedown", this, true);
+ window.removeEventListener("scroll", this, true);
+
+ this._element.classList.add(WebInspector.Popover.FadeOutClassName);
+
+ if (this.delegate && typeof this.delegate.willDismissPopover === "function")
+ this.delegate.willDismissPopover(this);
+ },
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mousedown":
+ case "scroll":
+ if (!this._element.contains(event.target))
+ this.dismiss();
+ break;
+ case "transitionend":
+ if (event.target === this._element) {
+ document.body.removeChild(this._element);
+ this._element.classList.remove(WebInspector.Popover.FadeOutClassName);
+ this._container.textContent = "";
+ if (this.delegate && typeof this.delegate.didDismissPopover === "function")
+ this.delegate.didDismissPopover(this);
+ break;
+ }
+ }
+ },
+
+ // Private
+
+ _update: function(shouldAnimate)
+ {
+ if (shouldAnimate)
+ var previousEdge = this._edge;
+
+ var targetFrame = this._targetFrame;
+ var preferredEdges = this._preferredEdges;
+
+ // Ensure our element is on display so that its metrics can be resolved
+ // or interrupt any pending transition to remove it from display.
+ if (this._element.parentNode !== document.body)
+ document.body.appendChild(this._element);
+ else
+ this._element.classList.remove(WebInspector.Popover.FadeOutClassName);
+
+ if (this._contentNeedsUpdate) {
+ // Reset CSS properties on element so that the element may be sized to fit its content.
+ this._element.style.removeProperty("left");
+ this._element.style.removeProperty("top");
+ this._element.style.removeProperty("width");
+ this._element.style.removeProperty("height");
+ if (this._edge !== null)
+ this._element.classList.remove(this._cssClassNameForEdge());
+
+ // Add the content in place of the wrapper to get the raw metrics.
+ this._element.replaceChild(this._content, this._container);
+
+ // Get the ideal size for the popover to fit its content.
+ var popoverBounds = this._element.getBoundingClientRect();
+ this._preferredSize = new WebInspector.Size(Math.ceil(popoverBounds.width), Math.ceil(popoverBounds.height));
+ }
+
+ // The frame of the window with a little inset to make sure we have room for shadows.
+ var containerFrame = new WebInspector.Rect(0, 0, window.innerWidth, window.innerHeight);
+ containerFrame = containerFrame.inset(WebInspector.Popover.ShadowEdgeInsets);
+
+ // Work out the metrics for all edges.
+ var metrics = new Array(preferredEdges.length);
+ for (var edgeName in WebInspector.RectEdge) {
+ var edge = WebInspector.RectEdge[edgeName];
+ var item = {
+ edge: edge,
+ metrics: this._bestMetricsForEdge(this._preferredSize, targetFrame, containerFrame, edge)
+ };
+ var preferredIndex = preferredEdges.indexOf(edge);
+ if (preferredIndex !== -1)
+ metrics[preferredIndex] = item;
+ else
+ metrics.push(item);
+ }
+
+ function area(size)
+ {
+ return size.width * size.height;
+ }
+
+ // Find if any of those fit better than the frame for the preferred edge.
+ var bestEdge = metrics[0].edge;
+ var bestMetrics = metrics[0].metrics;
+ for (var i = 1; i < metrics.length; i++) {
+ var itemMetrics = metrics[i].metrics;
+ if (area(itemMetrics.contentSize) > area(bestMetrics.contentSize)) {
+ bestEdge = metrics[i].edge;
+ bestMetrics = itemMetrics;
+ }
+ }
+
+ var anchorPoint;
+ var bestFrame = bestMetrics.frame.round();
+
+ this._edge = bestEdge;
+
+ if (bestFrame === WebInspector.Rect.ZERO_RECT) {
+ // The target for the popover is offscreen.
+ this.dismiss();
+ } else {
+ switch (bestEdge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ anchorPoint = new WebInspector.Point(bestFrame.size.width - WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());
+ break;
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ anchorPoint = new WebInspector.Point(WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());
+ break;
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), bestFrame.size.height - WebInspector.Popover.ShadowPadding);
+ break;
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), WebInspector.Popover.ShadowPadding);
+ break;
+ }
+
+ this._element.classList.add(this._cssClassNameForEdge());
+
+ if (shouldAnimate && this._edge === previousEdge)
+ this._animateFrame(bestFrame);
+ else {
+ this.frame = bestFrame;
+ this._setAnchorPoint(anchorPoint);
+ this._drawBackground();
+ }
+
+ // Make sure content is centered in case either of the dimension is smaller than the minimal bounds.
+ if (this._preferredSize.width < WebInspector.Popover.MinWidth || this._preferredSize.height < WebInspector.Popover.MinHeight)
+ this._container.classList.add("center");
+ else
+ this._container.classList.remove("center");
+ }
+
+ // Wrap the content in the container so that it's located correctly.
+ if (this._contentNeedsUpdate) {
+ this._container.textContent = "";
+ this._element.replaceChild(this._container, this._content);
+ this._container.appendChild(this._content);
+ }
+
+ this._contentNeedsUpdate = false;
+ },
+
+ _cssClassNameForEdge: function()
+ {
+ switch (this._edge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ return "arrow-right";
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ return "arrow-left";
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ return "arrow-down";
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ return "arrow-up";
+ }
+ console.error("Unknown edge.");
+ return "arrow-up";
+ },
+
+ _setAnchorPoint: function(anchorPoint) {
+ anchorPoint.x = Math.floor(anchorPoint.x);
+ anchorPoint.y = Math.floor(anchorPoint.y);
+ this._anchorPoint = anchorPoint;
+ },
+
+ _animateFrame: function(toFrame)
+ {
+ var startTime = Date.now();
+ var duration = 350;
+ var epsilon = 1 / (200 * duration);
+ var spline = new WebInspector.UnitBezier(0.25, 0.1, 0.25, 1);
+
+ var fromFrame = this._frame.copy();
+
+ var absoluteAnchorPoint = new WebInspector.Point(
+ fromFrame.minX() + this._anchorPoint.x,
+ fromFrame.minY() + this._anchorPoint.y
+ );
+
+ function animatedValue(from, to, progress)
+ {
+ return from + (to - from) * progress;
+ }
+
+ function drawBackground()
+ {
+ var progress = spline.solve(Math.min((Date.now() - startTime) / duration, 1), epsilon);
+
+ this.frame = new WebInspector.Rect(
+ animatedValue(fromFrame.minX(), toFrame.minX(), progress),
+ animatedValue(fromFrame.minY(), toFrame.minY(), progress),
+ animatedValue(fromFrame.size.width, toFrame.size.width, progress),
+ animatedValue(fromFrame.size.height, toFrame.size.height, progress)
+ ).round();
+
+ this._setAnchorPoint(new WebInspector.Point(
+ absoluteAnchorPoint.x - this._frame.minX(),
+ absoluteAnchorPoint.y - this._frame.minY()
+ ));
+
+ this._drawBackground();
+
+ if (progress < 1)
+ window.requestAnimationFrame(drawBackground.bind(this));
+ }
+
+ drawBackground.call(this);
+ },
+
+ _drawBackground: function()
+ {
+ var scaleFactor = window.devicePixelRatio;
+
+ var width = this._frame.size.width;
+ var height = this._frame.size.height;
+ var scaledWidth = width * scaleFactor;
+ var scaledHeight = height * scaleFactor;
+
+ // Create a scratch canvas so we can draw the popover that will later be drawn into
+ // the final context with a shadow.
+ var scratchCanvas = document.createElement("canvas");
+ scratchCanvas.width = scaledWidth;
+ scratchCanvas.height = scaledHeight;
+
+ var ctx = scratchCanvas.getContext("2d");
+ ctx.scale(scaleFactor, scaleFactor);
+
+ // Bounds of the path don't take into account the arrow, but really only the tight bounding box
+ // of the content contained within the frame.
+ var bounds;
+ var arrowHeight = WebInspector.Popover.AnchorSize.height;
+ switch (this._edge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ bounds = new WebInspector.Rect(0, 0, width - arrowHeight, height);
+ break;
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ bounds = new WebInspector.Rect(arrowHeight, 0, width - arrowHeight, height);
+ break;
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ bounds = new WebInspector.Rect(0, 0, width, height - arrowHeight);
+ break;
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ bounds = new WebInspector.Rect(0, arrowHeight, width, height - arrowHeight);
+ break;
+ }
+
+ bounds = bounds.inset(WebInspector.Popover.ShadowEdgeInsets);
+
+ // Clip the frame.
+ ctx.fillStyle = "black";
+ this._drawFrame(ctx, bounds, this._edge, this._anchorPoint);
+ ctx.clip();
+
+ // Gradient fill, top-to-bottom.
+ var fillGradient = ctx.createLinearGradient(0, 0, 0, height);
+ fillGradient.addColorStop(0, "rgba(255, 255, 255, 0.95)");
+ fillGradient.addColorStop(1, "rgba(235, 235, 235, 0.95)");
+ ctx.fillStyle = fillGradient;
+ ctx.fillRect(0, 0, width, height);
+
+ // Stroke.
+ ctx.strokeStyle = "rgba(0, 0, 0, 0.25)";
+ ctx.lineWidth = 2;
+ this._drawFrame(ctx, bounds, this._edge, this._anchorPoint);
+ ctx.stroke();
+
+ // Draw the popover into the final context with a drop shadow.
+ var finalContext = document.getCSSCanvasContext("2d", this._canvasId, scaledWidth, scaledHeight);
+
+ finalContext.clearRect(0, 0, scaledWidth, scaledHeight);
+
+ finalContext.shadowOffsetX = 1;
+ finalContext.shadowOffsetY = 1;
+ finalContext.shadowBlur = 5;
+ finalContext.shadowColor = "rgba(0, 0, 0, 0.5)";
+
+ finalContext.drawImage(scratchCanvas, 0, 0, scaledWidth, scaledHeight);
+ },
+
+ _bestMetricsForEdge: function(preferredSize, targetFrame, containerFrame, edge)
+ {
+ var x, y;
+ var width = preferredSize.width + (WebInspector.Popover.ShadowPadding * 2) + (WebInspector.Popover.ContentPadding * 2);
+ var height = preferredSize.height + (WebInspector.Popover.ShadowPadding * 2) + (WebInspector.Popover.ContentPadding * 2);
+ var arrowLength = WebInspector.Popover.AnchorSize.height;
+
+ switch (edge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ width += arrowLength;
+ x = targetFrame.origin.x - width + WebInspector.Popover.ShadowPadding;
+ y = targetFrame.origin.y - (height - targetFrame.size.height) / 2;
+ break;
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ width += arrowLength;
+ x = targetFrame.origin.x + targetFrame.size.width - WebInspector.Popover.ShadowPadding;
+ y = targetFrame.origin.y - (height - targetFrame.size.height) / 2;
+ break;
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ height += arrowLength;
+ x = targetFrame.origin.x - (width - targetFrame.size.width) / 2;
+ y = targetFrame.origin.y - height + WebInspector.Popover.ShadowPadding;
+ break;
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ height += arrowLength;
+ x = targetFrame.origin.x - (width - targetFrame.size.width) / 2;
+ y = targetFrame.origin.y + targetFrame.size.height - WebInspector.Popover.ShadowPadding;
+ break;
+ }
+
+ if (edge === WebInspector.RectEdge.MIN_X || edge === WebInspector.RectEdge.MAX_X) {
+ if (y < containerFrame.minY())
+ y = containerFrame.minY();
+ if (y + height > containerFrame.maxY())
+ y = containerFrame.maxY() - height;
+ } else {
+ if (x < containerFrame.minX())
+ x = containerFrame.minX();
+ if (x + width > containerFrame.maxX())
+ x = containerFrame.maxX() - width;
+ }
+
+ var preferredFrame = new WebInspector.Rect(x, y, width, height);
+ var bestFrame = preferredFrame.intersectionWithRect(containerFrame);
+
+ width = bestFrame.size.width - (WebInspector.Popover.ShadowPadding * 2);
+ height = bestFrame.size.height - (WebInspector.Popover.ShadowPadding * 2);
+
+ switch (edge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ width -= arrowLength;
+ break;
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ height -= arrowLength;
+ break;
+ }
+
+ return {
+ frame: bestFrame,
+ contentSize: new WebInspector.Size(width, height)
+ };
+ },
+
+ _drawFrame: function(ctx, bounds, anchorEdge)
+ {
+ var r = WebInspector.Popover.CornerRadius;
+ var arrowHalfLength = WebInspector.Popover.AnchorSize.width / 2;
+ var anchorPoint = this._anchorPoint;
+
+ ctx.beginPath();
+ switch (anchorEdge) {
+ case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.
+ ctx.moveTo(bounds.maxX(), bounds.minY() + r);
+ ctx.lineTo(bounds.maxX(), anchorPoint.y - arrowHalfLength);
+ ctx.lineTo(anchorPoint.x, anchorPoint.y);
+ ctx.lineTo(bounds.maxX(), anchorPoint.y + arrowHalfLength);
+ ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
+ ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
+ break;
+ case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.
+ ctx.moveTo(bounds.minX(), bounds.maxY() - r);
+ ctx.lineTo(bounds.minX(), anchorPoint.y + arrowHalfLength);
+ ctx.lineTo(anchorPoint.x, anchorPoint.y);
+ ctx.lineTo(bounds.minX(), anchorPoint.y - arrowHalfLength);
+ ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
+ break;
+ case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.
+ ctx.moveTo(bounds.maxX() - r, bounds.maxY());
+ ctx.lineTo(anchorPoint.x + arrowHalfLength, bounds.maxY());
+ ctx.lineTo(anchorPoint.x, anchorPoint.y);
+ ctx.lineTo(anchorPoint.x - arrowHalfLength, bounds.maxY());
+ ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
+ ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
+ break;
+ case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.
+ ctx.moveTo(bounds.minX() + r, bounds.minY());
+ ctx.lineTo(anchorPoint.x - arrowHalfLength, bounds.minY());
+ ctx.lineTo(anchorPoint.x, anchorPoint.y);
+ ctx.lineTo(anchorPoint.x + arrowHalfLength, bounds.minY());
+ ctx.arcTo(bounds.maxX(), bounds.minY(), bounds.maxX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.maxX(), bounds.maxY(), bounds.minX(), bounds.maxY(), r);
+ ctx.arcTo(bounds.minX(), bounds.maxY(), bounds.minX(), bounds.minY(), r);
+ ctx.arcTo(bounds.minX(), bounds.minY(), bounds.maxX(), bounds.minY(), r);
+ break;
+ }
+ ctx.closePath();
+ }
+
+};
+
+WebInspector.Popover.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+/*
+ * 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.
+ */
+
+.sidebar > .panel.probes > .navigation-bar {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+}
+
+.sidebar > .panel.probes > .content {
+ position: absolute;
+ top: 22px;
+}
+
+.details-section.probe-set .options > .probe-remove,
+.details-section.probe-set .options > .probe-clear-samples,
+.details-section.probe-set .options > .probe-add {
+ float: right;
+ height: 11px;
+ margin-top: 1px;
+ margin-left: 5px;
+ cursor: pointer;
+}
+
+.details-section.probe-set .options > .probe-clear-samples {
+ content: url(../Images/NavigationItemTrash.svg);
+ height: 13px;
+}
+
+.details-section.probe-set .options > .probe-remove {
+ content: url(../Images/Close.svg);
+}
+
+.details-section.probe-set .options > .probe-add {
+ content: url(../Images/Plus.svg);
+}
+
+.details-section.probe-set .options > input {
+ height: 12px;
+ width: 40px;
+ font-size: 10px;
+}
+
+.details-section.probe-set .options > a.go-to-link {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ display: block;
+}
+
+.panel.probes ::-webkit-scrollbar {
+ height: 5px;
+ width: 5px;
+}
+
+.panel.probes ::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
+ border-radius: 4px;
+ margin: 1px;
+}
+
+.panel.probes ::-webkit-scrollbar-thumb {
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
+}
+
+.panel.probes ::-webkit-scrollbar-corner {
+ opacity: 0;
+}
+
+.popover .probe-popover {
+ padding: 2px;
+ font-family: 'Lucida Grande', Helvetica, sans-serif;
+ font-size: 11px;
+ margin: 2px;
+}
+
+.popover .probe-popover input {
+ margin: 5px 0 0 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeDetailsSidebarPanel = function()
+{
+ WebInspector.DetailsSidebarPanel.call(this, "probe", WebInspector.UIString("Probes"), WebInspector.UIString("Probes"), "Images/NavigationItemProbes.pdf", "6");
+
+ WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetAdded, this);
+ WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetRemoved, this);
+
+ this._probeSetSections = new Map;
+ this._inspectedProbeSets = [];
+
+ // Initialize sidebar sections for probe sets that already exist.
+ for (var probeSet of WebInspector.probeManager.probeSets)
+ this._probeSetAdded(probeSet);
+};
+
+WebInspector.ProbeDetailsSidebarPanel.OffsetSectionsStyleClassName = "offset-sections";
+
+WebInspector.ProbeDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.ProbeDetailsSidebarPanel,
+ __proto__: WebInspector.DetailsSidebarPanel.prototype,
+
+ // Public
+
+ get inspectedProbeSets()
+ {
+ return this._inspectedProbeSets.slice();
+ },
+
+ set inspectedProbeSets(newProbeSets)
+ {
+ for (var probeSet of this._inspectedProbeSets) {
+ var removedSection = this._probeSetSections.get(probeSet);
+ this.element.removeChild(removedSection.element);
+ }
+
+ this._inspectedProbeSets = newProbeSets;
+
+ for (var probeSet of newProbeSets) {
+ var shownSection = this._probeSetSections.get(probeSet);
+ this.element.appendChild(shownSection.element);
+ }
+ },
+
+ inspect: function(objects)
+ {
+ if (!(objects instanceof Array))
+ objects = [objects];
+
+ this.inspectedProbeSets = objects.filter(function(object) {
+ return object instanceof WebInspector.ProbeSet;
+ });
+
+ return !!this._inspectedProbeSets.length;
+ },
+
+ // Private
+
+ _probeSetAdded: function(probeSetOrEvent)
+ {
+ var probeSet;
+ if (probeSetOrEvent instanceof WebInspector.ProbeSet)
+ probeSet = probeSetOrEvent;
+ else
+ probeSet = probeSetOrEvent.data.probeSet;
+ console.assert(!this._probeSetSections.has(probeSet), "New probe group ", probeSet, " already has its own sidebar.");
+
+ var newSection = new WebInspector.ProbeSetDetailsSection(probeSet);
+ this._probeSetSections.set(probeSet, newSection);
+ },
+
+
+ _probeSetRemoved: function(event)
+ {
+ var probeSet = event.data.probeSet;
+ console.assert(this._probeSetSections.has(probeSet), "Removed probe group ", probeSet, " doesn't have a sidebar.");
+
+ // First remove probe set from inspected list, then from mapping.
+ var inspectedProbeSets = this.inspectedProbeSets;
+ var index = inspectedProbeSets.indexOf(probeSet);
+ if (index !== -1) {
+ inspectedProbeSets.splice(index, 1);
+ this.inspectedProbeSets = inspectedProbeSets;
+ }
+ var removedSection = this._probeSetSections.get(probeSet);
+ this._probeSetSections.delete(probeSet);
+ removedSection.closed();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridcssfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * 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.
+ */
+
+.details-section.probe-set .data-grid .data-container tr.past-value td {
+ background-color: rgba(100, 100, 100, 0.2);
+ font-style: italic;
+ color: #777;
+}
+
+.details-section.probe-set .data-grid > .data-container td.unknown-value {
+ background-color: rgba(230, 230, 230, 0.8);
+ background-image: -webkit-repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(255, 255, 255, .5) 7px, rgba(255, 255, 255, .5) 14px);
+}
+
+.details-section.probe-set .data-grid .data-container tr.revealed.highlighted {
+ -webkit-animation-duration: 2s;
+ animation-timing-function: ease;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-animation-name: blink-frame-highlight;
+}
+
+@-webkit-keyframes blink-frame-highlight {
+ 0% {
+ background-color: rgba(144, 111, 199, 0.8);
+ }
+
+ 100% {
+ background-color: rgba(144, 111, 199, 0);
+ }
+}
+
+.details-section.probe-set .data-grid .data-container tr.separator {
+ border-bottom: 3px solid #555;
+}
+
+.details-section.probe-set .data-grid .data-container tr.separator {
+ border-bottom: 2px solid #666;
+}
+
+.details-section.probe-set .data-grid > .data-container tr.data-updated {
+ -webkit-animation-duration: 0.3s;
+ -webkit-animation-name: blink-probe-frame;
+}
+
+@-webkit-keyframes blink-probe-frame {
+ 0% {
+ background-color: rgba(144, 111, 199, 1);
+ }
+
+ 100% {
+ background-color: rgba(144, 111, 199, 0);
+ }
+}
+
+.details-section.probe-set .data-grid .data-container .selected .section * {
+ color: white;
+}
+
+.details-section.probe-set .data-grid .data-container .selected td.unknown-value {
+ color: black !important;
+}
+
+.details-section.probe-set .data-grid .data-container .section {
+ left: -6px;
+}
+
+.details-section.probe-set .data-grid th {
+ height: 21px;
+
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+ background-image: -webkit-linear-gradient(top, rgb(248, 248, 248), rgb(226, 226, 226));
+ background-size: 100% 100% !important;
+ background-position: center !important;
+ background-repeat: no-repeat !important;
+
+ box-shadow: inset rgba(255, 255, 255, 0.1) 0 1px 0;
+ border-bottom: 1px solid rgb(179, 179, 179) !important;
+}
+
+.details-section.probe-set .data-grid th:not(:last-child) {
+ border-right: 1px solid rgb(179, 179, 179);
+}
+
+.details-section.probe-set .data-grid th,
+.details-section.probe-set .data-grid td {
+ padding-left: 6px;
+ padding-right: 6px;
+}
+
+.details-section.probe-set .data-grid td {
+ padding-top: 2px;
+ padding-bottom: 2px;
+ line-height: 17px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,192 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataGrid = function(probeSet)
+{
+ console.assert(probeSet instanceof WebInspector.ProbeSet, "Invalid ProbeSet argument: ", probeSet);
+ this.probeSet = probeSet;
+
+ var columnsData = {};
+ for (var probe of probeSet.probes) {
+ var probeTitle = probe.expression || WebInspector.UIString("(uninitialized)");
+ columnsData[probe.id] = { title: probeTitle };
+ }
+ WebInspector.DataGrid.call(this, columnsData);
+
+ this._frameNodes = new Map;
+ this._nodesSinceLastNavigation = [];
+
+ this._listeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid instance listeners");
+ this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeAdded, this._setupProbe);
+ this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeRemoved, this._teardownProbe);
+ this._listeners.register(probeSet, WebInspector.ProbeSet.Event.SamplesCleared, this._setupData);
+ this._listeners.register(WebInspector.Probe, WebInspector.Probe.Event.ExpressionChanged, this._probeExpressionChanged)
+ this._listeners.install();
+
+ this._setupData();
+}
+
+WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName = "data-updated";
+WebInspector.ProbeSetDataGrid.PastFrameStyleClassName = "past-value";
+WebInspector.ProbeSetDataGrid.HighlightedFrameStyleClassName = "highlighted";
+
+WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration = 300; // milliseconds
+
+WebInspector.ProbeSetDataGrid.prototype = {
+ constructor: WebInspector.ProbeSetDataGrid,
+ __proto__: WebInspector.DataGrid.prototype,
+
+ // Public
+
+ closed: function()
+ {
+ for (var probe of this.probeSet)
+ this._teardownProbe(probe);
+
+ this._listeners.uninstall(true);
+ },
+
+ // Private
+
+ _setupProbe: function(event)
+ {
+ var probe = event.data;
+ this.insertColumn(probe.id, {title: probe.expression});
+
+ for (var frame of this._data.frames)
+ this._updateNodeForFrame(frame);
+ },
+
+ _teardownProbe: function(event)
+ {
+ var probe = event.data;
+ this.removeColumn(probe.id);
+
+ for (var frame of this._data.frames)
+ this._updateNodeForFrame(frame);
+ },
+
+ _setupData: function()
+ {
+ this._data = this.probeSet.dataTable;
+ for (var frame of this._data.frames)
+ this._updateNodeForFrame(frame);
+
+ this._dataListeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid data table listeners");
+ this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataFrameInserted);
+ this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.SeparatorInserted, this._dataSeparatorInserted);
+ this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.WillRemove, this._teardownData);
+ this._dataListeners.install();
+ },
+
+ _teardownData: function()
+ {
+ this._dataListeners.uninstall(true);
+ this.removeChildren();
+ this._frameNodes = new Map;
+ this._separators = new Map;
+ delete this._lastUpdatedFrame;
+ },
+
+ _updateNodeForFrame: function(frame)
+ {
+ console.assert(frame instanceof WebInspector.ProbeSetDataFrame, "Invalid ProbeSetDataFrame argument: ", frame);
+ var node = null;
+ if (this._frameNodes.has(frame)) {
+ node = this._frameNodes.get(frame);
+ node.frame = frame;
+ node.refresh();
+ } else {
+ node = new WebInspector.ProbeSetDataGridNode(this);
+ node.frame = frame;
+ this._frameNodes.set(frame, node);
+ node.createCells();
+
+ var sortFunction = function(a, b) {
+ return WebInspector.ProbeSetDataFrame.compare(a.frame, b.frame);
+ };
+ var insertionIndex = insertionIndexForObjectInListSortedByFunction(node, this.children, sortFunction);
+ if (insertionIndex === this.children.length)
+ this.appendChild(node);
+ else if (this.children[insertionIndex].frame.key === frame.key) {
+ this.removeChild(this.children[insertionIndex]);
+ this.insertChild(node, insertionIndex);
+ } else
+ this.insertChild(node, insertionIndex);
+ }
+ console.assert(node);
+
+ node.element.classList.add(WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName);
+ window.setTimeout(function() {
+ node.element.classList.remove(WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName);
+ }, WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration);
+
+ this._nodesSinceLastNavigation.push(node);
+ },
+
+ _updateNodeForSeparator: function(frame)
+ {
+ console.assert(this._frameNodes.has(frame), "Tried to add separator for unknown data frame: ", frame);
+ this._frameNodes.get(frame).updateCellsForSeparator(frame, this.probeSet);
+
+ for (var node of this._nodesSinceLastNavigation)
+ node.element.classList.add(WebInspector.ProbeSetDataGrid.PastFrameStyleClassName);
+
+ this._nodesSinceLastNavigation = [];
+ },
+
+ _dataFrameInserted: function(event)
+ {
+ var frame = event.data;
+ this._lastUpdatedFrame = frame;
+ this._updateNodeForFrame(frame);
+ },
+
+ _dataSeparatorInserted: function(event)
+ {
+ var frame = event.data;
+ this._updateNodeForSeparator(frame);
+ },
+
+ _probeExpressionChanged: function(event)
+ {
+ var probe = event.target;
+ if (probe.breakpoint !== this.probeSet.breakpoint)
+ return;
+
+ if (!this.columns.has(probe.id))
+ return;
+
+ var oldColumn = this.columns.get(probe.id);
+ this.removeColumn(probe.id);
+ var ordinal = oldColumn.get("ordinal");
+ var newColumn = {title: event.data.newValue};
+ this.insertColumn(probe.id, newColumn, ordinal);
+
+ for (var frame of this._data.frames)
+ this._updateNodeForFrame(frame);
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+/*
+ * Copyright (C) 2013 University of Washington. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. 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.ProbeSetDataGridNode = function(dataGrid)
+{
+ console.assert(dataGrid instanceof WebInspector.ProbeSetDataGrid, "Invalid ProbeSetDataGrid argument:", dataGrid);
+
+ WebInspector.DataGridNode.call(this, this.data);
+ this.dataGrid = dataGrid; // This is set to null in DataGridNode's constructor.
+ this._data = {};
+
+ this._element = document.createElement("tr");
+ this._element.dataGridNode = this;
+ this._element.classList.add("revealed");
+};
+
+WebInspector.ProbeSetDataGridNode.SeparatorStyleClassName = "separator";
+WebInspector.ProbeSetDataGridNode.UnknownValueStyleClassName = "unknown-value";
+
+WebInspector.ProbeSetDataGridNode.prototype = {
+ constructor: WebInspector.ProbeSetDataGridNode,
+ __proto__: WebInspector.DataGridNode.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get data()
+ {
+ return this._data;
+ },
+
+ set frame(value)
+ {
+ console.assert(value instanceof WebInspector.ProbeSetDataFrame, "Invalid ProbeSetDataFrame argument: ", value);
+ this._frame = value;
+
+ var data = {};
+ for (var probe of this.dataGrid.probeSet.probes) {
+ var sample = this.frame[probe.id];
+ if (!sample || !sample.object)
+ data[probe.id] = WebInspector.ProbeSetDataFrame.MissingValue;
+ else
+ data[probe.id] = sample.object;
+ }
+ this._data = data;
+ },
+
+ get frame()
+ {
+ return this._frame;
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ var sample = this.data[columnIdentifier];
+ if (sample === WebInspector.ProbeSetDataFrame.MissingValue) {
+ cell.classList.add(WebInspector.ProbeSetDataGridNode.UnknownValueStyleClassName);
+ return sample;
+ }
+
+ if (sample instanceof WebInspector.RemoteObject) {
+ switch (sample.type) {
+ case "function": // FIXME: is there a better way to visualize functions?
+ case "object":
+ return new WebInspector.ObjectPropertiesSection(sample, WebInspector.ProbeSet.SampleObjectTitle).element;
+ case "string":
+ case "number":
+ case "boolean":
+ case "undefined":
+ case "null":
+ return document.createTextNode(sample.value);
+ case "array":
+ // FIXME: reuse existing visualization of arrays here.
+ default: console.log("Don't know how to represent sample:", sample);
+ }
+ }
+
+ return sample;
+ },
+
+ updateCellsFromFrame: function(frame, probeSet)
+ {
+ },
+
+ updateCellsForSeparator: function(frame, probeSet)
+ {
+ this._element.classList.add(WebInspector.ProbeSetDataGridNode.SeparatorStyleClassName);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDetailsSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceProbeSetDetailsSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProbeSetDetailsSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,131 @@
</span><ins>+/*
+ * 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProbeSetDetailsSection = function(probeSet)
+{
+ console.assert(probeSet instanceof WebInspector.ProbeSet, "Invalid ProbeSet argument:", probeSet);
+
+ this._listeners = new WebInspector.EventListenerSet(this, "ProbeSetDetailsSection UI listeners");
+ this._probeSet = probeSet;
+
+ var optionsElement = document.createElement("div");
+ optionsElement.classList.add(WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName);
+
+ var removeProbeButton = optionsElement.createChild("img");
+ removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName);
+ removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
+ this._listeners.register(removeProbeButton, "click", this._removeButtonClicked);
+
+ var clearSamplesButton = optionsElement.createChild("img");
+ clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName);
+ clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
+ this._listeners.register(clearSamplesButton, "click", this._clearSamplesButtonClicked);
+
+ var addProbeButton = optionsElement.createChild("img");
+ addProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName);
+ this._listeners.register(addProbeButton, "click", this._addProbeButtonClicked);
+
+ var titleElement = this._probeSetPositionTextOrLink();
+ titleElement.classList.add(WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName);
+ optionsElement.appendChild(titleElement);
+
+ this._dataGrid = new WebInspector.ProbeSetDataGrid(probeSet);
+ this._dataGrid.element.classList.add("inline");
+ var singletonRow = new WebInspector.DetailsSectionRow;
+ singletonRow.element.appendChild(this._dataGrid.element);
+ var probeSectionGroup = new WebInspector.DetailsSectionGroup([singletonRow]);
+
+ var dummyTitle = "";
+ WebInspector.DetailsSection.call(this, "probe", dummyTitle, [probeSectionGroup], optionsElement);
+ this.element.classList.add(WebInspector.ProbeSetDetailsSection.StyleClassName);
+
+ this._listeners.install();
+};
+
+WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName = "probe-add";
+WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName = "dont-float";
+WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName = "enabled";
+WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName = "probe-popover";
+WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName = "probe-clear-samples";
+WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName = "probe-remove";
+WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName = "options";
+WebInspector.ProbeSetDetailsSection.StyleClassName = "probe-set";
+
+WebInspector.ProbeSetDetailsSection.prototype = {
+ __proto__: WebInspector.DetailsSection.prototype,
+ constructor: WebInspector.ProbeSetDetailsSection,
+
+ // Public
+
+ closed: function()
+ {
+ this._listeners.uninstall(true);
+ this.element.remove();
+ },
+
+ // Private
+
+ _probeSetPositionTextOrLink: function()
+ {
+ var breakpoint = this._probeSet.breakpoint;
+ return WebInspector.createSourceCodeLocationLink(breakpoint.sourceCodeLocation);
+ },
+
+ _addProbeButtonClicked: function(event)
+ {
+ function createProbeFromEnteredExpression(visiblePopover, event)
+ {
+ if (event.keyCode !== 13)
+ return;
+ var expression = event.target.value;
+ this._probeSet.createProbe(expression);
+ visiblePopover.dismiss();
+ }
+
+ var popover = new WebInspector.Popover;
+ var content = document.createElement("div");
+ content.classList.add(WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName);
+ content.createChild("div").textContent = WebInspector.UIString("Add New Probe Expression");
+ var textBox = content.createChild("input");
+ textBox.addEventListener("keypress", createProbeFromEnteredExpression.bind(this, popover));
+ textBox.addEventListener("click", function (event) {event.target.select()});
+ textBox.type = "text";
+ textBox.placeholder = WebInspector.UIString("Expression");
+ popover.content = content;
+ var target = WebInspector.Rect.rectFromClientRect(event.target.getBoundingClientRect());
+ popover.present(target, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+ textBox.select();
+ },
+
+ _removeButtonClicked: function(event)
+ {
+ this._probeSet.clear();
+ },
+
+ _clearSamplesButtonClicked: function(event)
+ {
+ this._probeSet.clearSamples();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProfileNodeDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceProfileNodeDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProfileNodeDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeDataGridNode = function(profileNode, baseStartTime, rangeStartTime, rangeEndTime)
+{
+ var hasChildren = !!profileNode.childNodes.length;
+
+ WebInspector.TimelineDataGridNode.call(this, false, null, hasChildren);
+
+ this._profileNode = profileNode;
+ this._baseStartTime = baseStartTime || 0;
+ this._rangeStartTime = rangeStartTime || 0;
+ this._rangeEndTime = typeof rangeEndTime === "number" ? rangeEndTime : Infinity;
+
+ this._data = this._profileNode.computeCallInfoForTimeRange(this._rangeStartTime, this._rangeEndTime);
+ this._data.location = this._profileNode.sourceCodeLocation;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ProfileNodeDataGridNode);
+
+WebInspector.ProfileNodeDataGridNode.IconStyleClassName = "icon";
+
+WebInspector.ProfileNodeDataGridNode.prototype = {
+ constructor: WebInspector.ProfileNodeDataGridNode,
+ __proto__: WebInspector.TimelineDataGridNode.prototype,
+
+ // Public
+
+ get profileNode()
+ {
+ return this._profileNode;
+ },
+
+ get records()
+ {
+ return null;
+ },
+
+ get baseStartTime()
+ {
+ return this._baseStartTime;
+ },
+
+ get rangeStartTime()
+ {
+ return this._rangeStartTime;
+ },
+
+ set rangeStartTime(x)
+ {
+ if (this._rangeStartTime === x)
+ return;
+
+ this._rangeStartTime = x;
+ this.needsRefresh();
+ },
+
+ get rangeEndTime()
+ {
+ return this._rangeEndTime;
+ },
+
+ set rangeEndTime(x)
+ {
+ if (this._rangeEndTime === x)
+ return;
+
+ this._rangeEndTime = x;
+ this.needsRefresh();
+ },
+
+ get data()
+ {
+ return this._data;
+ },
+
+ refresh: function()
+ {
+ this._data = this._profileNode.computeCallInfoForTimeRange(this._rangeStartTime, this._rangeEndTime);
+ this._data.location = this._profileNode.sourceCodeLocation;
+
+ WebInspector.TimelineDataGridNode.prototype.refresh.call(this);
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ const emptyValuePlaceholderString = "\u2014";
+ var value = this.data[columnIdentifier];
+
+ switch (columnIdentifier) {
+ case "startTime":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
+
+ case "selfTime":
+ case "totalTime":
+ case "averageTime":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
+ }
+
+ return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProfileNodeTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceProfileNodeTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ProfileNodeTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProfileNodeTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ProfileNodeTreeElement = function(profileNode, delegate)
+{
+ console.assert(profileNode);
+
+ this._profileNode = profileNode;
+ this._delegate = delegate || null;
+
+ var title = profileNode.functionName;
+ var subtitle = "";
+
+ if (!title) {
+ switch (profileNode.type) {
+ case WebInspector.ProfileNode.Type.Function:
+ title = WebInspector.UIString("(anonymous function)");
+ break;
+ case WebInspector.ProfileNode.Type.Program:
+ title = WebInspector.UIString("(program)");
+ break;
+ default:
+ title = WebInspector.UIString("(anonymous function)");
+ console.error("Unknown ProfileNode type: " + profileNode.type);
+ }
+ }
+
+ var sourceCodeLocation = this._profileNode.sourceCodeLocation;
+ if (sourceCodeLocation) {
+ subtitle = document.createElement("span");
+ sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent");
+ }
+
+ var className;
+
+ switch (this._profileNode.type) {
+ case WebInspector.ProfileNode.Type.Function:
+ className = WebInspector.CallFrameTreeElement.FunctionIconStyleClassName;
+ if (!sourceCodeLocation)
+ className = WebInspector.CallFrameTreeElement.NativeIconStyleClassName;
+ break;
+ case WebInspector.ProfileNode.Type.Program:
+ className = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
+ break;
+ }
+
+ console.assert(className);
+
+ // This is more than likely an event listener function with an "on" prefix and it is
+ // as long or longer than the shortest event listener name -- "oncut".
+ if (profileNode.functionName && profileNode.functionName.startsWith("on") && profileNode.functionName.length >= 5)
+ className = WebInspector.CallFrameTreeElement.EventListenerIconStyleClassName;
+
+ var hasChildren = !!profileNode.childNodes.length;
+
+ WebInspector.GeneralTreeElement.call(this, [className], title, subtitle, profileNode, hasChildren);
+
+ this.small = true;
+ this.shouldRefreshChildren = true;
+
+ if (sourceCodeLocation)
+ this.tooltipHandledSeparately = true;
+};
+
+WebInspector.ProfileNodeTreeElement.prototype = {
+ constructor: WebInspector.ProfileNodeTreeElement,
+ __proto__: WebInspector.GeneralTreeElement.prototype,
+
+ // Public
+
+ get profileNode()
+ {
+ return this._profileNode;
+ },
+
+ get filterableData()
+ {
+ var url = this._profileNode.sourceCodeLocation ? this._profileNode.sourceCodeLocation.sourceCode.url : "";
+ return {text: [this.mainTitle, url || ""]};
+ },
+
+ // Protected
+
+ onattach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+
+ console.assert(this.element);
+
+ if (!this.tooltipHandledSeparately)
+ return;
+
+ var tooltipPrefix = this.mainTitle + "\n";
+ this._profileNode.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
+ },
+
+ onpopulate: function()
+ {
+ if (!this.hasChildren || !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+
+ if (this._delegate && typeof this._delegate.populateProfileNodeTreeElement === "function") {
+ this._delegate.populateProfileNodeTreeElement(this);
+ return;
+ }
+
+ for (var childProfileNode of this._profileNode.childNodes) {
+ var childTreeElement = new WebInspector.ProfileNodeTreeElement(childProfileNode);
+ this.appendChild(childTreeElement);
+ }
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPropertiesSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfacePropertiesSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/PropertiesSection.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PropertiesSection.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.PropertiesSection = function(title, subtitle)
+{
+ this.propertiesElement = document.createElement("ol");
+ this.propertiesElement.className = "properties properties-tree";
+ this.propertiesElement.tabIndex = 0;
+ this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);
+ this.propertiesTreeOutline.section = this;
+
+ WebInspector.Section.call(this, title, subtitle);
+
+ this.element.appendChild(this.propertiesElement);
+}
+
+WebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolecssfromrev164541trunkSourceWebInspectorUIUserInterfaceQuickConsolecss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/QuickConsole.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.quick-console {
+ position: relative;
+
+ display: -webkit-flex;
+ -webkit-align-items: flex-end;
+
+ background-color: white;
+ border-top: 1px solid rgb(190, 190, 190);
+
+ outline: none;
+ overflow: hidden;
+
+ font-family: Menlo, monospace;
+ font-size: 11px;
+}
+
+.quick-console.showing-log {
+ border-top-color: rgb(240, 240, 240);
+}
+
+.quick-console > .console-prompt {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ -webkit-align-items: flex-start;
+
+ max-height: 150px;
+
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.quick-console > .console-prompt::before {
+ position: relative;
+ z-index: 1;
+
+ top: 5px;
+ left: 4px;
+
+ margin-right: 1px;
+
+ width: 10px;
+ height: 10px;
+
+ content: url(../Images/UserInputPrompt.svg);
+}
+
+.quick-console > .console-prompt > .CodeMirror {
+ margin: 4px 0 3px;
+}
+
+.quick-console > .navigation-bar {
+ background: transparent;
+ border: none;
+
+ height: 21px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejsfromrev164541trunkSourceWebInspectorUIUserInterfaceQuickConsolejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/QuickConsole.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,352 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.QuickConsole = function(element)
+{
+ WebInspector.Object.call(this);
+
+ this._toggleOrFocusKeyboardShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape, this._toggleOrFocus.bind(this));
+
+ var mainFrameExecutionContext = new WebInspector.ExecutionContext(WebInspector.QuickConsole.MainFrameContextExecutionIdentifier, WebInspector.UIString("Main Frame"), true, null);
+ this._mainFrameExecutionContextPathComponent = this._createExecutionContextPathComponent(mainFrameExecutionContext.name, mainFrameExecutionContext.identifier);
+ this._selectedExecutionContextPathComponent = this._mainFrameExecutionContextPathComponent;
+
+ this._otherExecutionContextPathComponents = [];
+ this._frameIdentifierToExecutionContextPathComponentMap = {};
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.QuickConsole.StyleClassName);
+
+ this.prompt = new WebInspector.ConsolePrompt(null, "text/javascript");
+ this.prompt.element.classList.add(WebInspector.QuickConsole.TextPromptStyleClassName);
+ this._element.appendChild(this.prompt.element);
+
+ this.prompt.shown();
+
+ this._navigationBar = new WebInspector.QuickConsoleNavigationBar;
+ this._element.appendChild(this._navigationBar.element);
+
+ this._executionContextSelectorItem = new WebInspector.HierarchicalPathNavigationItem;
+ this._executionContextSelectorItem.showSelectorArrows = true;
+ this._navigationBar.addNavigationItem(this._executionContextSelectorItem);
+
+ this._executionContextSelectorDivider = new WebInspector.DividerNavigationItem;
+ this._navigationBar.addNavigationItem(this._executionContextSelectorDivider);
+
+ this._rebuildExecutionContextPathComponents();
+
+ // COMPATIBILITY (iOS 6): Execution contexts did not exist, evaluation worked with frame ids.
+ if (WebInspector.ExecutionContext.supported()) {
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextsChanged, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ExecutionContextsCleared, this._frameExecutionContextsCleared, this);
+ } else {
+ WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameAdded, this);
+ WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasRemoved, this._frameRemoved, this);
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._frameMainResourceChanged, this);
+ }
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._debuggerActiveCallFrameDidChange, this);
+};
+
+WebInspector.QuickConsole.StyleClassName = "quick-console";
+WebInspector.QuickConsole.ShowingLogClassName = "showing-log";
+WebInspector.QuickConsole.NavigationBarContainerStyleClassName = "navigation-bar-container";
+WebInspector.QuickConsole.NavigationBarSpacerStyleClassName = "navigation-bar-spacer";
+WebInspector.QuickConsole.TextPromptStyleClassName = "text-prompt";
+
+WebInspector.QuickConsole.ToolbarSingleLineHeight = 21;
+WebInspector.QuickConsole.ToolbarPromptPadding = 4;
+WebInspector.QuickConsole.ToolbarTopBorder = 1;
+
+WebInspector.QuickConsole.MainFrameContextExecutionIdentifier = undefined;
+
+WebInspector.QuickConsole.Event = {
+ DidResize: "quick-console-did-resize"
+};
+
+WebInspector.QuickConsole.prototype = {
+ constructor: WebInspector.QuickConsole,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get navigationBar()
+ {
+ return this._navigationBar;
+ },
+
+ get executionContextIdentifier()
+ {
+ return this._selectedExecutionContextPathComponent._executionContextIdentifier;
+ },
+
+ updateLayout: function()
+ {
+ // A hard maximum size of 33% of the window.
+ const maximumAllowedHeight = Math.round(window.innerHeight * 0.33);
+ this.prompt.element.style.maxHeight = maximumAllowedHeight + "px";
+ },
+
+ consoleLogVisibilityChanged: function(visible)
+ {
+ if (visible)
+ this.element.classList.add(WebInspector.QuickConsole.ShowingLogClassName);
+ else
+ this.element.classList.remove(WebInspector.QuickConsole.ShowingLogClassName);
+
+ this.dispatchEventToListeners(WebInspector.QuickConsole.Event.DidResize);
+ },
+
+ // Private
+
+ _executionContextPathComponentsToDisplay: function()
+ {
+ // If we are in the debugger the console will use the active call frame, don't show the selector.
+ if (WebInspector.debuggerManager.activeCallFrame)
+ return [];
+
+ // If there is only the Main Frame, don't show the selector.
+ if (!this._otherExecutionContextPathComponents.length)
+ return [];
+
+ return [this._selectedExecutionContextPathComponent];
+ },
+
+ _rebuildExecutionContextPathComponents: function()
+ {
+ var components = this._executionContextPathComponentsToDisplay();
+ var isEmpty = !components.length;
+
+ this._executionContextSelectorItem.components = components;
+
+ this._executionContextSelectorItem.hidden = isEmpty;
+ this._executionContextSelectorDivider.hidden = isEmpty;
+ },
+
+ _framePageExecutionContextsChanged: function(event)
+ {
+ var frame = event.target;
+
+ var shouldAutomaticallySelect = this._restoreSelectedExecutionContextForFrame === frame;
+
+ var newExecutionContextPathComponent = this._insertExecutionContextPathComponentForFrame(frame, shouldAutomaticallySelect);
+
+ if (shouldAutomaticallySelect) {
+ delete this._restoreSelectedExecutionContextForFrame;
+ this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
+ this._rebuildExecutionContextPathComponents();
+ }
+ },
+
+ _frameExecutionContextsCleared: function(event)
+ {
+ var frame = event.target;
+
+ // If this frame is navigating and it is selected in the UI we want to reselect its new item after navigation.
+ if (event.data.committingProvisionalLoad && !this._restoreSelectedExecutionContextForFrame) {
+ var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
+ if (this._selectedExecutionContextPathComponent === executionContextPathComponent) {
+ this._restoreSelectedExecutionContextForFrame = frame;
+ // As a fail safe, if the frame never gets an execution context, clear the restore value.
+ setTimeout(function() { delete this._restoreSelectedExecutionContextForFrame; }.bind(this), 10);
+ }
+ }
+
+ this._removeExecutionContextPathComponentForFrame(frame);
+ },
+
+ _frameAdded: function(event)
+ {
+ var frame = event.data.frame;
+ this._insertExecutionContextPathComponentForFrame(frame);
+ },
+
+ _frameRemoved: function(event)
+ {
+ var frame = event.data.frame;
+ this._removeExecutionContextPathComponentForFrame(frame);
+ },
+
+ _frameMainResourceChanged: function(event)
+ {
+ var frame = event.target;
+ this._updateExecutionContextPathComponentForFrame(frame);
+ },
+
+ _createExecutionContextPathComponent: function(name, identifier)
+ {
+ var pathComponent = new WebInspector.HierarchicalPathComponent(name, "execution-context", identifier, true, true);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._pathComponentClicked, this);
+ pathComponent.truncatedDisplayNameLength = 50;
+ pathComponent._executionContextIdentifier = identifier;
+ return pathComponent;
+ },
+
+ _createExecutionContextPathComponentFromFrame: function(frame)
+ {
+ var name = frame.name ? frame.name + " \u2014 " + frame.mainResource.displayName : frame.mainResource.displayName;
+ var identifier = WebInspector.ExecutionContext.supported() ? frame.pageExecutionContext.id : frame.id;
+
+ var pathComponent = this._createExecutionContextPathComponent(name, identifier);
+ pathComponent._frame = frame;
+
+ return pathComponent;
+ },
+
+ _compareExecutionContextPathComponents: function(a, b)
+ {
+ // "Main Frame" always on top.
+ if (!a._frame)
+ return -1;
+ if (!b._frame)
+ return 1;
+
+ // Frames with a name above frames without a name.
+ if (a._frame.name && !b._frame.name)
+ return -1;
+ if (!a._frame.name && b._frame.name)
+ return 1;
+
+ return a.displayName.localeCompare(b.displayName);
+ },
+
+ _insertExecutionContextPathComponentForFrame: function(frame, skipRebuild)
+ {
+ if (frame.isMainFrame())
+ return;
+
+ console.assert(!this._frameIdentifierToExecutionContextPathComponentMap[frame.id]);
+ if (this._frameIdentifierToExecutionContextPathComponentMap[frame.id])
+ return;
+
+ var executionContextPathComponent = this._createExecutionContextPathComponentFromFrame(frame);
+
+ var index = insertionIndexForObjectInListSortedByFunction(executionContextPathComponent, this._otherExecutionContextPathComponents, this._compareExecutionContextPathComponents);
+
+ var prev = index > 0 ? this._otherExecutionContextPathComponents[index - 1] : this._mainFrameExecutionContextPathComponent;
+ var next = this._otherExecutionContextPathComponents[index] || null;
+ if (prev) {
+ prev.nextSibling = executionContextPathComponent;
+ executionContextPathComponent.previousSibling = prev;
+ }
+ if (next) {
+ next.previousSibling = executionContextPathComponent;
+ executionContextPathComponent.nextSibling = next;
+ }
+
+ this._otherExecutionContextPathComponents.splice(index, 0, executionContextPathComponent);
+ this._frameIdentifierToExecutionContextPathComponentMap[frame.id] = executionContextPathComponent;
+
+ if (!skipRebuild)
+ this._rebuildExecutionContextPathComponents();
+
+ return executionContextPathComponent;
+ },
+
+ _removeExecutionContextPathComponentForFrame: function(frame, skipRebuild)
+ {
+ if (frame.isMainFrame())
+ return;
+
+ var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
+ console.assert(executionContextPathComponent);
+ if (!executionContextPathComponent)
+ return;
+
+ executionContextPathComponent.removeEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ executionContextPathComponent.removeEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._pathComponentClicked, this);
+
+ var prev = executionContextPathComponent.previousSibling;
+ var next = executionContextPathComponent.nextSibling;
+ if (prev)
+ prev.nextSibling = next;
+ if (next)
+ next.previousSibling = prev;
+
+ if (this._selectedExecutionContextPathComponent === executionContextPathComponent)
+ this._selectedExecutionContextPathComponent = this._mainFrameExecutionContextPathComponent;
+
+ this._otherExecutionContextPathComponents.remove(executionContextPathComponent, true);
+ delete this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
+
+ if (!skipRebuild)
+ this._rebuildExecutionContextPathComponents();
+ },
+
+ _updateExecutionContextPathComponentForFrame: function(frame)
+ {
+ if (frame.isMainFrame())
+ return;
+
+ var executionContextPathComponent = this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
+ if (!executionContextPathComponent)
+ return;
+
+ var wasSelected = this._selectedExecutionContextPathComponent === executionContextPathComponent;
+
+ this._removeExecutionContextPathComponentForFrame(frame, true);
+ var newExecutionContextPathComponent = this._insertExecutionContextPathComponentForFrame(frame, true);
+
+ if (wasSelected)
+ this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
+
+ this._rebuildExecutionContextPathComponents();
+ },
+
+ _pathComponentSelected: function(event)
+ {
+ if (event.data.pathComponent === this._selectedExecutionContextPathComponent)
+ return;
+
+ this._selectedExecutionContextPathComponent = event.data.pathComponent;
+
+ this._rebuildExecutionContextPathComponents();
+ },
+
+ _pathComponentClicked: function(event)
+ {
+ this.prompt.focus();
+ },
+
+ _debuggerActiveCallFrameDidChange: function(event)
+ {
+ this._rebuildExecutionContextPathComponents();
+ },
+
+ _toggleOrFocus: function(event)
+ {
+ if (this.prompt.focused)
+ WebInspector.toggleSplitConsole();
+ else if (!WebInspector.isEditingAnyField() && !WebInspector.isEventTargetAnEditableField(event))
+ this.prompt.focus();
+ }
+};
+
+WebInspector.QuickConsole.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsQuickConsoleNavigationBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceQuickConsoleNavigationBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsoleNavigationBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/QuickConsoleNavigationBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsoleNavigationBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsoleNavigationBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.QuickConsoleNavigationBar = function(element, navigationItems)
+{
+ WebInspector.NavigationBar.call(this, element, navigationItems);
+};
+
+WebInspector.QuickConsoleNavigationBar.prototype = {
+ constructor: WebInspector.QuickConsoleNavigationBar,
+
+ get sizesToFit()
+ {
+ return true;
+ },
+
+ addNavigationItem: function(navigationItem)
+ {
+ // Add new navigation items to the left.
+ return this.insertNavigationItem(navigationItem, 0);
+ }
+};
+
+WebInspector.QuickConsoleNavigationBar.prototype.__proto__ = WebInspector.NavigationBar.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemcssfromrev164541trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.navigation-bar .item.radio.button:not(.text-only) {
+ width: 32px;
+}
+
+.navigation-bar.collapsed .item.radio.button:not(.text-only) {
+ width: 24px;
+}
+
+.navigation-bar .item.radio.button.text-only.selected {
+ background-repeat: no-repeat;
+ background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.09) 12%, rgba(0, 0, 0, 0.06) 12%, transparent), -webkit-linear-gradient(top, rgba(0, 0, 0, 0.45), transparent),
+ -webkit-linear-gradient(top, rgba(0, 0, 0, 0.45), transparent);
+ background-size: 100% 100%, 1px 100%, 1px 100%;
+ background-position: left top, left top, right top;
+
+ font-weight: bold;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceRadioButtonNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RadioButtonNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RadioButtonNavigationItem = function(identifier, toolTip, image, imageWidth, imageHeight) {
+ WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, null, "tab");
+};
+
+WebInspector.RadioButtonNavigationItem.StyleClassName = "radio";
+WebInspector.RadioButtonNavigationItem.ActiveStyleClassName = "active";
+WebInspector.RadioButtonNavigationItem.SelectedStyleClassName = "selected";
+
+WebInspector.RadioButtonNavigationItem.prototype = {
+ constructor: WebInspector.RadioButtonNavigationItem,
+
+ // Public
+
+ get selected()
+ {
+ return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
+ },
+
+ set selected(flag)
+ {
+ if (flag) {
+ this.element.classList.add(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
+ this.element.setAttribute("aria-selected", "true");
+ } else {
+ this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
+ this.element.setAttribute("aria-selected", "false");
+ }
+ },
+
+ get active()
+ {
+ return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
+ },
+
+ set active(flag)
+ {
+ if (flag)
+ this.element.classList.add(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
+ else
+ this.element.classList.remove(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
+ },
+
+ generateStyleText: function(parentSelector)
+ {
+ var classNames = this._classNames.join(".");
+
+ // Default state.
+ var styleText = parentSelector + " ." + classNames + " > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier() + "); background-size: " + this._imageWidth + "px " + this._imageHeight + "px; }\n";
+
+ // Selected state.
+ styleText += parentSelector + " ." + classNames + ".selected:not(.disabled) > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.Focus) + "); }\n";
+
+ // Selected and pressed state.
+ styleText += parentSelector + " ." + classNames + ".selected:not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.ActiveFocus) + "); }\n";
+
+ return styleText;
+ },
+
+ updateLayout: function(expandOnly)
+ {
+ if (expandOnly)
+ return;
+
+ var isSelected = this.selected;
+
+ if (!isSelected) {
+ this.element.classList.add(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
+ this.element.setAttribute("aria-selected", "true");
+ }
+
+ var selectedWidth = this.element.offsetWidth;
+ if (selectedWidth)
+ this.element.style.minWidth = selectedWidth + "px";
+
+ if (!isSelected) {
+ this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
+ this.element.setAttribute("aria-selected", "false");
+ }
+ },
+
+ // Private
+
+ _additionalClassNames: [WebInspector.RadioButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
+};
+
+WebInspector.RadioButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceClusterContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceClusterContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceClusterContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,272 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceClusterContentView = function(resource)
+{
+ WebInspector.ClusterContentView.call(this, resource);
+
+ this._resource = resource;
+ this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._resourceTypeDidChange, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._resourceLoadingDidFinish, this);
+
+ function createPathComponent(displayName, className, identifier)
+ {
+ var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ return pathComponent;
+ }
+
+ this._requestPathComponent = createPathComponent.call(this, WebInspector.UIString("Request"), WebInspector.ResourceClusterContentView.RequestIconStyleClassName, WebInspector.ResourceClusterContentView.RequestIdentifier);
+ this._responsePathComponent = createPathComponent.call(this, WebInspector.UIString("Response"), WebInspector.ResourceClusterContentView.ResponseIconStyleClassName, WebInspector.ResourceClusterContentView.ResponseIdentifier);
+
+ this._requestPathComponent.nextSibling = this._responsePathComponent;
+ this._responsePathComponent.previousSibling = this._requestPathComponent;
+
+ this._currentContentViewSetting = new WebInspector.Setting("resource-current-view-" + this._resource.url.hash, WebInspector.ResourceClusterContentView.ResponseIdentifier);
+};
+
+WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey = "resource-cluster-content-view-identifier";
+
+WebInspector.ResourceClusterContentView.RequestIconStyleClassName = "request-icon";
+WebInspector.ResourceClusterContentView.ResponseIconStyleClassName = "response-icon";
+WebInspector.ResourceClusterContentView.RequestIdentifier = "request";
+WebInspector.ResourceClusterContentView.ResponseIdentifier = "response";
+
+WebInspector.ResourceClusterContentView.prototype = {
+ constructor: WebInspector.ResourceClusterContentView,
+
+ // Public
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ get responseContentView()
+ {
+ if (this._responseContentView)
+ return this._responseContentView;
+
+ switch (this._resource.type) {
+ case WebInspector.Resource.Type.Document:
+ case WebInspector.Resource.Type.Script:
+ case WebInspector.Resource.Type.Stylesheet:
+ case WebInspector.Resource.Type.XHR:
+ this._responseContentView = new WebInspector.TextResourceContentView(this._resource);
+ break;
+
+ case WebInspector.Resource.Type.Image:
+ this._responseContentView = new WebInspector.ImageResourceContentView(this._resource);
+ break;
+
+ case WebInspector.Resource.Type.Font:
+ this._responseContentView = new WebInspector.FontResourceContentView(this._resource);
+ break;
+
+ default:
+ this._responseContentView = new WebInspector.GenericResourceContentView(this._resource);
+ break;
+ }
+
+ return this._responseContentView;
+ },
+
+ get requestContentView()
+ {
+ if (!this._canShowRequestContentView())
+ return null;
+
+ if (this._requestContentView)
+ return this._requestContentView;
+
+ this._requestContentView = new WebInspector.TextContentView(this._resource.requestData || "", this._resource.requestDataContentType);
+
+ return this._requestContentView;
+ },
+
+ get selectionPathComponents()
+ {
+ var currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView)
+ return [];
+
+ if (!this._canShowRequestContentView())
+ return currentContentView.selectionPathComponents;
+
+ // Append the current view's path components to the path component representing the current view.
+ var components = [this._pathComponentForContentView(currentContentView)];
+ return components.concat(currentContentView.selectionPathComponents);
+ },
+
+ shown: function()
+ {
+ WebInspector.ClusterContentView.prototype.shown.call(this);
+
+ if (this._shownInitialContent)
+ return;
+
+ this._showContentViewForIdentifier(this._currentContentViewSetting.value);
+ },
+
+ closed: function()
+ {
+ WebInspector.ClusterContentView.prototype.closed.call(this);
+
+ this._shownInitialContent = false;
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey] = this._currentContentViewSetting.value;
+ },
+
+ restoreFromCookie: function(cookie)
+ {
+ var contentView = this._showContentViewForIdentifier(cookie[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]);
+ if (typeof contentView.revealPosition === "function" && "lineNumber" in cookie && "columnNumber" in cookie)
+ contentView.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
+ },
+
+ showRequest: function()
+ {
+ this._shownInitialContent = true;
+
+ return this._showContentViewForIdentifier(WebInspector.ResourceClusterContentView.RequestIdentifier);
+ },
+
+ showResponse: function(positionToReveal, textRangeToSelect, forceUnformatted)
+ {
+ this._shownInitialContent = true;
+
+ if (!this._resource.finished) {
+ this._positionToReveal = positionToReveal;
+ this._textRangeToSelect = textRangeToSelect;
+ this._forceUnformatted = forceUnformatted;
+ }
+
+ var responseContentView = this._showContentViewForIdentifier(WebInspector.ResourceClusterContentView.ResponseIdentifier);
+ if (typeof responseContentView.revealPosition === "function")
+ responseContentView.revealPosition(positionToReveal, textRangeToSelect, forceUnformatted);
+ return responseContentView;
+ },
+
+ // Private
+
+ _canShowRequestContentView: function()
+ {
+ var requestData = this._resource.requestData;
+ if (!requestData)
+ return false;
+
+ var requestDataContentType = this._resource.requestDataContentType;
+ if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i))
+ return false;
+
+ return true;
+ },
+
+ _pathComponentForContentView: function(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView === this._requestContentView)
+ return this._requestPathComponent;
+ if (contentView === this._responseContentView)
+ return this._responsePathComponent;
+ console.error("Unknown contentView.");
+ return null;
+ },
+
+ _identifierForContentView: function(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView === this._requestContentView)
+ return WebInspector.ResourceClusterContentView.RequestIdentifier;
+ if (contentView === this._responseContentView)
+ return WebInspector.ResourceClusterContentView.ResponseIdentifier;
+ console.error("Unknown contentView.");
+ return null;
+ },
+
+ _showContentViewForIdentifier: function(identifier)
+ {
+ var contentViewToShow = null;
+
+ switch (identifier) {
+ case WebInspector.ResourceClusterContentView.RequestIdentifier:
+ contentViewToShow = this._canShowRequestContentView() ? this.requestContentView : null;
+ break;
+ case WebInspector.ResourceClusterContentView.ResponseIdentifier:
+ contentViewToShow = this.responseContentView;
+ break;
+ }
+
+ if (!contentViewToShow)
+ contentViewToShow = this.responseContentView;
+
+ console.assert(contentViewToShow);
+
+ this._currentContentViewSetting.value = this._identifierForContentView(contentViewToShow);
+
+ return this.contentViewContainer.showContentView(contentViewToShow);
+ },
+
+ _pathComponentSelected: function(event)
+ {
+ this._showContentViewForIdentifier(event.data.pathComponent.representedObject);
+ },
+
+ _resourceTypeDidChange: function(event)
+ {
+ // Since resource views are based on the type, we need to make a new content view and tell the container to replace this
+ // content view with the new one. Make a new ResourceContentView which will use the new resource type to make the correct
+ // concrete ResourceContentView subclass.
+
+ var currentResponseContentView = this._responseContentView;
+ if (!currentResponseContentView)
+ return;
+
+ delete this._responseContentView;
+
+ this.contentViewContainer.replaceContentView(currentResponseContentView, this.responseContentView);
+ },
+
+ _resourceLoadingDidFinish: function(event)
+ {
+ if ("_positionToReveal" in this) {
+ if (this._contentViewContainer.currentContentView === this._responseContentView)
+ this._responseContentView.revealPosition(this._positionToReveal, this._textRangeToSelect, this._forceUnformatted);
+
+ delete this._positionToReveal;
+ delete this._textRangeToSelect;
+ delete this._forceUnformatted;
+ }
+ }
+};
+
+WebInspector.ResourceClusterContentView.prototype.__proto__ = WebInspector.ClusterContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceContentView = function(resource, styleClassName)
+{
+ console.assert(resource);
+ console.assert(styleClassName);
+
+ WebInspector.ContentView.call(this, resource);
+
+ this._resource = resource;
+
+ this.element.classList.add(WebInspector.ResourceContentView.StyleClassName);
+ this.element.classList.add(styleClassName);
+
+ // Append a spinner while waiting for contentAvailable. The subclasses are responsible for removing
+ // the spinner before showing the resource content.
+ var spinner = new WebInspector.IndeterminateProgressSpinner;
+ this.element.appendChild(spinner.element);
+
+ this.element.addEventListener("click", this._mouseWasClicked.bind(this), false);
+
+ // Request content last so the spinner will always be removed in case the content is immediately available.
+ resource.requestContent(this._contentAvailable.bind(this));
+
+ if (!this.managesOwnIssues) {
+ WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
+
+ var issues = WebInspector.issueManager.issuesForSourceCode(resource);
+ for (var i = 0; i < issues.length; ++i)
+ this.addIssue(issues[i]);
+ }
+};
+
+WebInspector.ResourceContentView.StyleClassName = "resource";
+
+WebInspector.ResourceContentView.prototype = {
+ constructor: WebInspector.ResourceContentView,
+
+ // Public
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ contentAvailable: function(content, base64Encoded)
+ {
+ // Implemented by subclasses.
+ },
+
+ addIssue: function(issue)
+ {
+ // This generically shows only the last issue, subclasses can override for better handling.
+ this.element.removeChildren();
+ this.element.appendChild(WebInspector.createMessageTextView(issue.text, issue.level === WebInspector.IssueMessage.Level.Error));
+ },
+
+ closed: function()
+ {
+ if (!this.managesOwnIssues)
+ WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
+ },
+
+ // Private
+
+ _contentAvailable: function(resource, content, base64Encoded)
+ {
+ // Check for failed loads.
+ if (this.resource.failed) {
+ // Don't show an error message if there is already an error message showing (like one added by addIssue.)
+ if (this.element.querySelector(".message-text-view.error"))
+ return;
+
+ this.element.removeChildren();
+ this.element.appendChild(WebInspector.createMessageTextView(WebInspector.UIString("An error occurred trying to load the resource."), true));
+ return;
+ }
+
+ // Content is ready to show, call the public method now.
+ this.contentAvailable(content, base64Encoded);
+ },
+
+ _issueWasAdded: function(event)
+ {
+ console.assert(!this.managesOwnIssues);
+
+ var issue = event.data.issue;
+
+ // FIXME: Check more than just the issue URL (the document could have multiple resources with the same URL).
+ if (issue.url !== this.resource.url)
+ return;
+
+ this.addIssue(issue);
+ },
+
+ _mouseWasClicked: function(event)
+ {
+ WebInspector.handlePossibleLinkClick(event, this.resource.parentFrame);
+ }
+};
+
+WebInspector.ResourceContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,484 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceDetailsSidebarPanel = function() {
+ WebInspector.DetailsSidebarPanel.call(this, "resource-details", WebInspector.UIString("Resource"), WebInspector.UIString("Resource"), "Images/NavigationItemFile.svg", "1");
+
+ this.element.classList.add(WebInspector.ResourceDetailsSidebarPanel.StyleClassName);
+
+ this._resource = null;
+
+ this._typeMIMETypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("MIME Type"));
+ this._typeResourceTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Resource Type"));
+
+ this._typeSection = new WebInspector.DetailsSection("resource-type", WebInspector.UIString("Type"));
+ this._typeSection.groups = [new WebInspector.DetailsSectionGroup([this._typeMIMETypeRow, this._typeResourceTypeRow])];
+
+ this._locationFullURLRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Full URL"));
+ this._locationSchemeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Scheme"));
+ this._locationHostRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Host"));
+ this._locationPortRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Port"));
+ this._locationPathRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Path"));
+ this._locationQueryStringRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Query String"));
+ this._locationFragmentRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Fragment"));
+ this._locationFilenameRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Filename"));
+ this._initiatorRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Initiator"));
+
+ var firstGroup = [this._locationFullURLRow];
+ var secondGroup = [this._locationSchemeRow, this._locationHostRow, this._locationPortRow, this._locationPathRow,
+ this._locationQueryStringRow, this._locationFragmentRow, this._locationFilenameRow];
+ var thirdGroup = [this._initiatorRow];
+
+ this._fullURLGroup = new WebInspector.DetailsSectionGroup(firstGroup);
+ this._locationURLComponentsGroup = new WebInspector.DetailsSectionGroup(secondGroup);
+ this._initiatorGroup = new WebInspector.DetailsSectionGroup(thirdGroup);
+
+ this._locationSection = new WebInspector.DetailsSection("resource-location", WebInspector.UIString("Location"), [this._fullURLGroup, this._locationURLComponentsGroup, this._initiatorGroup]);
+
+ this._queryParametersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Query Parameters"));
+ this._queryParametersSection = new WebInspector.DetailsSection("resource-query-parameters", WebInspector.UIString("Query Parameters"));
+ this._queryParametersSection.groups = [new WebInspector.DetailsSectionGroup([this._queryParametersRow])];
+
+ this._requestDataSection = new WebInspector.DetailsSection("resource-request-data", WebInspector.UIString("Request Data"));
+
+ this._requestMethodRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Method"));
+ this._cachedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Cached"));
+
+ this._statusTextRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Status"));
+ this._statusCodeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Code"));
+
+ this._encodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Encoded"));
+ this._decodedSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Decoded"));
+ this._transferSizeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Transfered"));
+
+ this._compressedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Compressed"));
+ this._compressionRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Compression"));
+
+ var requestGroup = new WebInspector.DetailsSectionGroup([this._requestMethodRow, this._cachedRow]);
+ var statusGroup = new WebInspector.DetailsSectionGroup([this._statusTextRow, this._statusCodeRow]);
+ var sizeGroup = new WebInspector.DetailsSectionGroup([this._encodedSizeRow, this._decodedSizeRow, this._transferSizeRow]);
+ var compressionGroup = new WebInspector.DetailsSectionGroup([this._compressedRow, this._compressionRow]);
+
+ this._requestAndResponseSection = new WebInspector.DetailsSection("resource-request-response", WebInspector.UIString("Request & Response"), [requestGroup, statusGroup, sizeGroup, compressionGroup]);
+
+ this._requestHeadersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Request Headers"));
+ this._requestHeadersSection = new WebInspector.DetailsSection("resource-request-headers", WebInspector.UIString("Request Headers"));
+ this._requestHeadersSection.groups = [new WebInspector.DetailsSectionGroup([this._requestHeadersRow])];
+
+ this._responseHeadersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Response Headers"));
+ this._responseHeadersSection = new WebInspector.DetailsSection("resource-response-headers", WebInspector.UIString("Response Headers"));
+ this._responseHeadersSection.groups = [new WebInspector.DetailsSectionGroup([this._responseHeadersRow])];
+
+ // Rows for the "Image Size" section.
+ this._imageWidthRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Width"));
+ this._imageHeightRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Height"));
+
+ // "Image Size" section where we display intrinsic metrics for image resources.
+ this._imageSizeSection = new WebInspector.DetailsSection("resource-type", WebInspector.UIString("Image Size"));
+ this._imageSizeSection.groups = [new WebInspector.DetailsSectionGroup([this._imageWidthRow, this._imageHeightRow])];
+
+ this.element.appendChild(this._typeSection.element);
+ this.element.appendChild(this._locationSection.element);
+ this.element.appendChild(this._requestAndResponseSection.element);
+ this.element.appendChild(this._requestHeadersSection.element);
+ this.element.appendChild(this._responseHeadersSection.element);
+};
+
+WebInspector.ResourceDetailsSidebarPanel.StyleClassName = "resource";
+
+WebInspector.ResourceDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.ResourceDetailsSidebarPanel,
+
+ // Public
+
+ inspect: function(objects)
+ {
+ // Convert to a single item array if needed.
+ if (!(objects instanceof Array))
+ objects = [objects];
+
+ var resourceToInspect = null;
+
+ // Iterate over the objects to find a WebInspector.Resource to inspect.
+ for (var i = 0; i < objects.length; ++i) {
+ if (objects[i] instanceof WebInspector.Resource) {
+ resourceToInspect = objects[i];
+ break;
+ }
+
+ if (objects[i] instanceof WebInspector.Frame) {
+ resourceToInspect = objects[i].mainResource;
+ break;
+ }
+ }
+
+ this.resource = resourceToInspect;
+
+ return !!this._resource;
+ },
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ set resource(resource)
+ {
+ if (resource === this._resource)
+ return;
+
+ if (this._resource) {
+ this._resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._refreshURL, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.MIMETypeDidChange, this._refreshMIMEType, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._refreshResourceType, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.RequestHeadersDidChange, this._refreshRequestHeaders, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.ResponseReceived, this._refreshRequestAndResponse, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.CacheStatusDidChange, this._refreshRequestAndResponse, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.SizeDidChange, this._refreshDecodedSize, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._refreshTransferSize, this);
+ }
+
+ this._resource = resource;
+
+ if (this._resource) {
+ this._resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._refreshURL, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.MIMETypeDidChange, this._refreshMIMEType, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._refreshResourceType, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.RequestHeadersDidChange, this._refreshRequestHeaders, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.ResponseReceived, this._refreshRequestAndResponse, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.CacheStatusDidChange, this._refreshRequestAndResponse, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._refreshDecodedSize, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._refreshTransferSize, this);
+ }
+
+ this.needsRefresh();
+ },
+
+ refresh: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._refreshURL();
+ this._refreshMIMEType();
+ this._refreshResourceType();
+ this._refreshRequestAndResponse();
+ this._refreshDecodedSize();
+ this._refreshTransferSize();
+ this._refreshRequestHeaders();
+ this._refreshImageSizeSection();
+ this._refreshRequestDataSection();
+ },
+
+ // Private
+
+ _refreshURL: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._locationFullURLRow.value = this._resource.url.insertWordBreakCharacters();
+
+ var urlComponents = this._resource.urlComponents;
+ if (urlComponents.scheme) {
+ if (this._resource.initiatorSourceCodeLocation)
+ this._locationSection.groups = [this._fullURLGroup, this._locationURLComponentsGroup, this._initiatorGroup];
+ else
+ this._locationSection.groups = [this._fullURLGroup, this._locationURLComponentsGroup];
+
+ this._locationSchemeRow.value = urlComponents.scheme ? urlComponents.scheme : null;
+ this._locationHostRow.value = urlComponents.host ? urlComponents.host : null;
+ this._locationPortRow.value = urlComponents.port ? urlComponents.port : null;
+ this._locationPathRow.value = urlComponents.path ? urlComponents.path.insertWordBreakCharacters() : null;
+ this._locationQueryStringRow.value = urlComponents.queryString ? urlComponents.queryString.insertWordBreakCharacters() : null;
+ this._locationFragmentRow.value = urlComponents.fragment ? urlComponents.fragment.insertWordBreakCharacters() : null;
+ this._locationFilenameRow.value = urlComponents.lastPathComponent ? urlComponents.lastPathComponent.insertWordBreakCharacters() : null;
+ } else {
+ if (this._resource.initiatorSourceCodeLocation)
+ this._locationSection.groups = [this._fullURLGroup, this._initiatorGroup];
+ else
+ this._locationSection.groups = [this._fullURLGroup];
+ }
+
+ if (this._resource.initiatorSourceCodeLocation)
+ this._initiatorRow.value = WebInspector.createSourceCodeLocationLink(this._resource.initiatorSourceCodeLocation, true);
+
+ if (urlComponents.queryString) {
+ // Ensure the "Query Parameters" section is displayed, right after the "Request & Response" section.
+ this.element.insertBefore(this._queryParametersSection.element, this._requestAndResponseSection.element.nextSibling);
+
+ this._queryParametersRow.dataGrid = this._createNameValueDataGrid(parseQueryString(urlComponents.queryString, true));
+ } else {
+ // Hide the "Query Parameters" section if we don't have a query string.
+ var queryParametersSectionElement = this._queryParametersSection.element;
+ if (queryParametersSectionElement.parentNode)
+ queryParametersSectionElement.parentNode.removeChild(queryParametersSectionElement);
+ }
+ },
+
+ _refreshResourceType: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._typeResourceTypeRow.value = WebInspector.Resource.Type.displayName(this._resource.type);
+ },
+
+ _refreshMIMEType: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._typeMIMETypeRow.value = this._resource.mimeType;
+ },
+
+ _refreshRequestAndResponse: function()
+ {
+ var resource = this._resource;
+ if (!resource)
+ return;
+
+ // If we don't have a value, we set an em-dash to keep the row from hiding.
+ // This keeps the UI from shifting around as data comes in.
+ const emDash = "\u2014";
+
+ this._requestMethodRow.value = resource.requestMethod || emDash;
+
+ this._cachedRow.value = resource.cached ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+
+ this._statusCodeRow.value = resource.statusCode || emDash;
+ this._statusTextRow.value = resource.statusText || emDash;
+
+ this._refreshResponseHeaders();
+ this._refreshCompressed();
+ },
+
+ _valueForSize: function(size)
+ {
+ // If we don't have a value, we set an em-dash to keep the row from hiding.
+ // This keeps the UI from shifting around as data comes in.
+ const emDash = "\u2014";
+ return size > 0 ? Number.bytesToString(size) : emDash;
+ },
+
+ _refreshCompressed: function()
+ {
+ this._compressedRow.value = this._resource.compressed ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+ this._compressionRow.value = this._resource.compressed ? WebInspector.UIString("%.2f\u00d7").format(this._resource.size / this._resource.encodedSize) : null;
+ },
+
+ _refreshDecodedSize: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._encodedSizeRow.value = this._valueForSize(this._resource.encodedSize);
+ this._decodedSizeRow.value = this._valueForSize(this._resource.size);
+
+ this._refreshCompressed();
+ },
+
+ _refreshTransferSize: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._encodedSizeRow.value = this._valueForSize(this._resource.encodedSize);
+ this._transferSizeRow.value = this._valueForSize(this._resource.transferSize);
+
+ this._refreshCompressed();
+ },
+
+ _refreshRequestHeaders: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._requestHeadersRow.dataGrid = this._createNameValueDataGrid(this._resource.requestHeaders);
+ },
+
+ _refreshResponseHeaders: function()
+ {
+ if (!this._resource)
+ return;
+
+ this._responseHeadersRow.dataGrid = this._createNameValueDataGrid(this._resource.responseHeaders);
+ },
+
+ _createNameValueDataGrid: function(data)
+ {
+ if (!data || data instanceof Array ? !data.length : isEmptyObject(data))
+ return null;
+
+ var dataGrid = new WebInspector.DataGrid({
+ name: {title: WebInspector.UIString("Name"), width: "30%", sortable: true},
+ value: {title: WebInspector.UIString("Value"), sortable: true}
+ });
+
+ function addDataGridNode(nodeValue)
+ {
+ console.assert(typeof nodeValue.name === "string");
+ console.assert(!nodeValue.value || typeof nodeValue.value === "string");
+
+ var node = new WebInspector.DataGridNode({name: nodeValue.name, value: nodeValue.value || ""}, false);
+ node.selectable = true;
+ dataGrid.appendChild(node);
+ }
+
+ if (data instanceof Array) {
+ for (var i = 0; i < data.length; ++i)
+ addDataGridNode(data[i]);
+ } else {
+ for (var name in data)
+ addDataGridNode({name: name, value: data[name] || ""});
+ }
+
+ dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, sortDataGrid, this);
+
+ function sortDataGrid()
+ {
+ var nodes = dataGrid.children.slice();
+ var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
+ var sortDirection = dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function comparator(a, b)
+ {
+ var item1 = a.data[sortColumnIdentifier];
+ var item2 = b.data[sortColumnIdentifier];
+ return sortDirection * item1.localeCompare(item2);
+ }
+
+ nodes.sort(comparator);
+
+ dataGrid.removeChildren();
+ for (var i = 0; i < nodes.length; i++)
+ dataGrid.appendChild(nodes[i]);
+ }
+
+ return dataGrid;
+ },
+
+ _refreshImageSizeSection: function()
+ {
+ var resource = this._resource;
+
+ if (!resource)
+ return;
+
+ // Hide the section if we're not dealing with an image or if the load failed.
+ if (resource.type !== WebInspector.Resource.Type.Image || resource.failed) {
+ var imageSectionElement = this._imageSizeSection.element;
+ if (imageSectionElement.parentNode)
+ this.element.removeChild(imageSectionElement);
+ return;
+ }
+
+ // Ensure the section is displayed, right before the "Location" section.
+ this.element.insertBefore(this._imageSizeSection.element, this._locationSection.element);
+
+ // Get the metrics for this resource and fill in the metrics rows with that information.
+ resource.getImageSize(function(size) {
+ this._imageWidthRow.value = WebInspector.UIString("%fpx").format(size.width);
+ this._imageHeightRow.value = WebInspector.UIString("%fpx").format(size.height);
+ }.bind(this));
+ },
+
+ _goToRequestDataClicked: function()
+ {
+ WebInspector.resourceSidebarPanel.showResourceRequest(this._resource);
+ },
+
+ _refreshRequestDataSection: function()
+ {
+ var resource = this._resource;
+
+ if (!resource)
+ return;
+
+ // Hide the section if we're not dealing with a request with data.
+ var requestData = resource.requestData;
+ if (!requestData) {
+ this._requestDataSection.element.remove();
+ return;
+ }
+
+ // Ensure the section is displayed, right before the "Request Headers" section.
+ this.element.insertBefore(this._requestDataSection.element, this._requestHeadersSection.element);
+
+ var requestDataContentType = resource.requestDataContentType || "";
+ if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {
+ // Simple form data that should be parsable like a query string.
+ var parametersRow = new WebInspector.DetailsSectionDataGridRow(null, WebInspector.UIString("No Parameters"));
+ parametersRow.dataGrid = this._createNameValueDataGrid(parseQueryString(requestData, true));
+
+ this._requestDataSection.groups = [new WebInspector.DetailsSectionGroup([parametersRow])];
+ return;
+ }
+
+ // Not simple form data, so we can really only show the size and type here.
+ // FIXME: Add a go-to arrow here to show the data in the content browser.
+
+ var mimeTypeComponents = parseMIMEType(requestDataContentType);
+
+ var mimeType = mimeTypeComponents.type;
+ var boundary = mimeTypeComponents.boundary;
+ var encoding = mimeTypeComponents.encoding;
+
+ var rows = [];
+
+ var mimeTypeRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("MIME Type"));
+ mimeTypeRow.value = mimeType;
+ rows.push(mimeTypeRow);
+
+ if (boundary) {
+ var boundryRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Boundary"));
+ boundryRow.value = boundary;
+ rows.push(boundryRow);
+ }
+
+ if (encoding) {
+ var encodingRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Encoding"));
+ encodingRow.value = encoding;
+ rows.push(encodingRow);
+ }
+
+ var sizeValue = Number.bytesToString(requestData.length);
+
+ var dataValue = document.createDocumentFragment();
+
+ dataValue.appendChild(document.createTextNode(sizeValue));
+
+ var goToButton = dataValue.appendChild(WebInspector.createGoToArrowButton());
+ goToButton.addEventListener("click", this._goToRequestDataClicked.bind(this));
+
+ var dataRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Data"));
+ dataRow.value = dataValue;
+ rows.push(dataRow);
+
+ this._requestDataSection.groups = [new WebInspector.DetailsSectionGroup(rows)];
+ }
+};
+
+WebInspector.ResourceDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.resource-icon .icon {
+ content: -webkit-image-set(url(../Images/DocumentGeneric.png) 1x, url(../Images/DocumentGeneric@2x.png) 2x);
+}
+
+.resource-icon.resource-type-document .icon {
+ content: -webkit-image-set(url(../Images/DocumentMarkup.png) 1x, url(../Images/DocumentMarkup@2x.png) 2x);
+}
+
+.resource-icon.resource-type-image .icon {
+ content: -webkit-image-set(url(../Images/DocumentImage.png) 1x, url(../Images/DocumentImage@2x.png) 2x);
+}
+
+.resource-icon.resource-type-font .icon {
+ content: -webkit-image-set(url(../Images/DocumentFont.png) 1x, url(../Images/DocumentFont@2x.png) 2x);
+}
+
+.resource-icon.resource-type-stylesheet .icon {
+ content: -webkit-image-set(url(../Images/DocumentCSS.png) 1x, url(../Images/DocumentCSS@2x.png) 2x);
+}
+
+.resource-icon.resource-type-script .icon {
+ content: -webkit-image-set(url(../Images/DocumentJS.png) 1x, url(../Images/DocumentJS@2x.png) 2x);
+}
+
+.anonymous-script-icon .icon {
+ content: -webkit-image-set(url(../Images/ClippingJS.png) 1x, url(../Images/ClippingJS@2x.png) 2x);
+}
+
+.source-map-resource.resource-icon .icon {
+ content: -webkit-image-set(url(../Images/ClippingGeneric.png) 1x, url(../Images/ClippingGeneric@2x.png) 2x);
+}
+
+.source-map-resource.resource-icon.resource-type-stylesheet .icon {
+ content: -webkit-image-set(url(../Images/ClippingCSS.png) 1x, url(../Images/ClippingCSS@2x.png) 2x);
+}
+
+.source-map-resource.resource-icon.resource-type-script .icon {
+ content: -webkit-image-set(url(../Images/ClippingJS.png) 1x, url(../Images/ClippingJS@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.resource > .content,
+.sidebar > .panel.resource > .empty-content-placeholder {
+ top: 21px;
+}
+
+.sidebar > .panel.resource > .search-bar {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+
+ display: -webkit-flex;
+
+ box-shadow: inset rgba(255, 255, 255, 0.2) 0 1px 0;
+
+ height: 21px;
+
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.sidebar > .panel.resource > .search-bar > input[type="search"] {
+ display: -webkit-flex;
+ -webkit-flex: 1;
+
+ margin: 1px 6px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,839 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceSidebarPanel = function() {
+ WebInspector.NavigationSidebarPanel.call(this, "resource", WebInspector.UIString("Resources"), "Images/NavigationItemStorage.svg", "1", true, false, true);
+
+ var searchElement = document.createElement("div");
+ searchElement.classList.add("search-bar");
+ this.element.appendChild(searchElement);
+
+ this._inputElement = document.createElement("input");
+ this._inputElement.type = "search";
+ this._inputElement.spellcheck = false;
+ this._inputElement.addEventListener("search", this._searchFieldChanged.bind(this));
+ this._inputElement.addEventListener("input", this._searchFieldInput.bind(this));
+ this._inputElement.setAttribute("results", 5);
+ this._inputElement.setAttribute("autosave", "inspector-search");
+ this._inputElement.setAttribute("placeholder", WebInspector.UIString("Search Resource Content"));
+ searchElement.appendChild(this._inputElement);
+
+ this.filterBar.placeholder = WebInspector.UIString("Filter Resource List");
+
+ this._waitingForInitialMainFrame = true;
+ this._lastSearchedPageSetting = new WebInspector.Setting("last-searched-page", null);
+
+ this._searchQuerySetting = new WebInspector.Setting("search-sidebar-query", "");
+ this._inputElement.value = this._searchQuerySetting.value;
+
+ this._searchKeyboardShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, "F", this._focusSearchField.bind(this));
+
+ this._localStorageRootTreeElement = null;
+ this._sessionStorageRootTreeElement = null;
+
+ this._databaseRootTreeElement = null;
+ this._databaseHostTreeElementMap = {};
+
+ this._indexedDatabaseRootTreeElement = null;
+ this._indexedDatabaseHostTreeElementMap = {};
+
+ this._cookieStorageRootTreeElement = null;
+
+ this._applicationCacheRootTreeElement = null;
+ this._applicationCacheURLTreeElementMap = {};
+
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, this._cookieStorageObjectWasAdded, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, this._domStorageObjectWasAdded, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasInspected, this._domStorageObjectWasInspected, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasAdded, this._databaseWasAdded, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DatabaseWasInspected, this._databaseWasInspected, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.IndexedDatabaseWasAdded, this._indexedDatabaseWasAdded, this);
+ WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.Cleared, this._storageCleared, this);
+
+ WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestAdded, this._frameManifestAdded, this);
+ WebInspector.applicationCacheManager.addEventListener(WebInspector.ApplicationCacheManager.Event.FrameManifestRemoved, this._frameManifestRemoved, this);
+
+ WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
+ WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
+
+ WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptWasAdded, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptsCleared, this._scriptsCleared, this);
+
+ this._resourcesContentTreeOutline = this.contentTreeOutline;
+ this._searchContentTreeOutline = this.createContentTreeOutline();
+
+ this._resourcesContentTreeOutline.onselect = this._treeElementSelected.bind(this);
+ this._searchContentTreeOutline.onselect = this._treeElementSelected.bind(this);
+
+ this._resourcesContentTreeOutline.includeSourceMapResourceChildren = true;
+
+ if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
+ this._resourcesContentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
+};
+
+WebInspector.ResourceSidebarPanel.prototype = {
+ constructor: WebInspector.ResourceSidebarPanel,
+
+ // Public
+
+ get contentTreeOutlineToAutoPrune()
+ {
+ return this._searchContentTreeOutline;
+ },
+
+ showMainFrameDOMTree: function(nodeToSelect, preventFocusChange)
+ {
+ var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
+ contentView.showDOMTree(nodeToSelect, preventFocusChange);
+ WebInspector.contentBrowser.showContentView(contentView);
+ },
+
+ showMainFrameSourceCode: function()
+ {
+ var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
+ contentView.showSourceCode();
+ WebInspector.contentBrowser.showContentView(contentView);
+ },
+
+ showContentFlowDOMTree: function(contentFlow, nodeToSelect, preventFocusChange)
+ {
+ var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(contentFlow);
+ if (nodeToSelect)
+ contentView.selectAndRevealDOMNode(nodeToSelect, preventFocusChange);
+ WebInspector.contentBrowser.showContentView(contentView);
+ },
+
+ showSourceCodeForFrame: function(frameIdentifier, revealAndSelectTreeElement)
+ {
+ delete this._frameIdentifierToShowSourceCodeWhenAvailable;
+
+ // We can't show anything until we have the main frame in the sidebar.
+ // Otherwise the path components in the navigation bar would be missing.
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
+ if (!frame || !this._mainFrameTreeElement) {
+ this._frameIdentifierToShowSourceCodeWhenAvailable = frameIdentifier;
+ return;
+ }
+
+ var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(frame);
+ console.assert(contentView);
+ if (!contentView)
+ return;
+
+ contentView.showSourceCode();
+ WebInspector.contentBrowser.showContentView(contentView);
+
+ if (revealAndSelectTreeElement)
+ this.treeElementForRepresentedObject(frame).revealAndSelect(true, true, true, true);
+ },
+
+ showSourceCode: function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted)
+ {
+ console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
+ var representedObject = sourceCode;
+
+ if (representedObject instanceof WebInspector.Script) {
+ // A script represented by a resource should always show the resource.
+ representedObject = representedObject.resource || representedObject;
+ }
+
+ // A main resource is always represented by its parent frame.
+ if (representedObject instanceof WebInspector.Resource && representedObject.isMainResource())
+ representedObject = representedObject.parentFrame;
+
+ var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
+ WebInspector.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
+ },
+
+ showSourceCodeLocation: function(sourceCodeLocation)
+ {
+ this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition());
+ },
+
+ showOriginalUnformattedSourceCodeLocation: function(sourceCodeLocation)
+ {
+ this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), undefined, true);
+ },
+
+ showOriginalOrFormattedSourceCodeLocation: function(sourceCodeLocation)
+ {
+ this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition());
+ },
+
+ showSourceCodeTextRange: function(sourceCodeTextRange)
+ {
+ var textRangeToSelect = sourceCodeTextRange.displayTextRange;
+ this.showSourceCode(sourceCodeTextRange.displaySourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
+ },
+
+ showOriginalOrFormattedSourceCodeTextRange: function(sourceCodeTextRange)
+ {
+ var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
+ this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
+ },
+
+ showResource: function(resource)
+ {
+ WebInspector.contentBrowser.showContentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
+ },
+
+ showResourceRequest: function(resource)
+ {
+ var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
+
+ if (contentView instanceof WebInspector.FrameContentView)
+ var resourceContentView = contentView.showResource();
+ else if (contentView instanceof WebInspector.ResourceClusterContentView)
+ var resourceContentView = contentView;
+
+ console.assert(resourceContentView instanceof WebInspector.ResourceClusterContentView);
+ if (!(resourceContentView instanceof WebInspector.ResourceClusterContentView))
+ return;
+
+ resourceContentView.showRequest();
+
+ WebInspector.contentBrowser.showContentView(contentView);
+ },
+
+ treeElementForRepresentedObject: function(representedObject)
+ {
+ // A custom implementation is needed for this since the frames are populated lazily.
+
+ // The Frame is used as the representedObject instead of the main resource in our tree.
+ if (representedObject instanceof WebInspector.Resource && representedObject.parentFrame && representedObject.parentFrame.mainResource === representedObject)
+ representedObject = representedObject.parentFrame;
+
+ function isAncestor(ancestor, resourceOrFrame)
+ {
+ // SourceMapResources are descendants of another SourceCode object.
+ if (resourceOrFrame instanceof WebInspector.SourceMapResource) {
+ if (resourceOrFrame.sourceMap.originalSourceCode === ancestor)
+ return true;
+
+ // Not a direct ancestor, so check the ancestors of the parent SourceCode object.
+ resourceOrFrame = resourceOrFrame.sourceMap.originalSourceCode;
+ }
+
+ var currentFrame = resourceOrFrame.parentFrame;
+ while (currentFrame) {
+ if (currentFrame === ancestor)
+ return true;
+ currentFrame = currentFrame.parentFrame;
+ }
+
+ return false;
+ }
+
+ function getParent(resourceOrFrame)
+ {
+ // SourceMapResources are descendants of another SourceCode object.
+ if (resourceOrFrame instanceof WebInspector.SourceMapResource)
+ return resourceOrFrame.sourceMap.originalSourceCode;
+ return resourceOrFrame.parentFrame;
+ }
+
+ var treeElement = this._resourcesContentTreeOutline.findTreeElement(representedObject, isAncestor, getParent);
+ if (treeElement)
+ return treeElement;
+
+ // Only special case Script objects.
+ if (!(representedObject instanceof WebInspector.Script)) {
+ console.error("Didn't find a TreeElement for a representedObject associated with the ResourceSidebarPanel.");
+ return null;
+ }
+
+ // If the Script has a URL we should have found it earlier.
+ if (representedObject.url) {
+ console.error("Didn't find a ScriptTreeElement for a Script with a URL.");
+ return null;
+ }
+
+ // Since the Script does not have a URL we consider it an 'anonymous' script. These scripts happen from calls to
+ // window.eval() or browser features like Auto Fill and Reader. They are not normally added to the sidebar, but since
+ // we have a ScriptContentView asking for the tree element we will make a ScriptTreeElement on demand and add it.
+
+ if (!this._anonymousScriptsFolderTreeElement)
+ this._anonymousScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Anonymous Scripts"));
+
+ if (!this._anonymousScriptsFolderTreeElement.parent) {
+ var index = insertionIndexForObjectInListSortedByFunction(this._anonymousScriptsFolderTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
+ this._resourcesContentTreeOutline.insertChild(this._anonymousScriptsFolderTreeElement, index);
+ }
+
+ var scriptTreeElement = new WebInspector.ScriptTreeElement(representedObject);
+ this._anonymousScriptsFolderTreeElement.appendChild(scriptTreeElement);
+
+ return scriptTreeElement;
+ },
+
+ performSearch: function(searchTerm)
+ {
+ // Before performing a new search, clear the old search.
+ this._searchContentTreeOutline.removeChildren();
+
+ this._inputElement.value = searchTerm;
+ this._searchQuerySetting.value = searchTerm;
+ this._lastSearchedPageSetting.value = searchTerm && WebInspector.frameResourceManager.mainFrame ? WebInspector.frameResourceManager.mainFrame.url.hash : null;
+
+ this.hideEmptyContentPlaceholder();
+
+ searchTerm = searchTerm.trim();
+ if (!searchTerm.length) {
+ this.filterBar.placeholder = WebInspector.UIString("Filter Resource List");
+ this.contentTreeOutline = this._resourcesContentTreeOutline;
+ return;
+ }
+
+ this.filterBar.placeholder = WebInspector.UIString("Filter Search Results");
+ this.contentTreeOutline = this._searchContentTreeOutline;
+
+ var updateEmptyContentPlaceholderTimeout = null;
+
+ function updateEmptyContentPlaceholderSoon()
+ {
+ if (updateEmptyContentPlaceholderTimeout)
+ return;
+ updateEmptyContentPlaceholderTimeout = setTimeout(updateEmptyContentPlaceholder.bind(this), 100);
+ }
+
+ function updateEmptyContentPlaceholder()
+ {
+ if (updateEmptyContentPlaceholderTimeout) {
+ clearTimeout(updateEmptyContentPlaceholderTimeout);
+ updateEmptyContentPlaceholderTimeout = null;
+ }
+
+ this.updateEmptyContentPlaceholder(WebInspector.UIString("No Search Results"));
+ }
+
+ function resourcesCallback(error, result)
+ {
+ updateEmptyContentPlaceholderSoon.call(this);
+
+ if (error)
+ return;
+
+ for (var i = 0; i < result.length; ++i) {
+ var searchResult = result[i];
+ if (!searchResult.url || !searchResult.frameId)
+ continue;
+
+ function resourceCallback(url, error, resourceMatches)
+ {
+ updateEmptyContentPlaceholderSoon.call(this);
+
+ if (error || !resourceMatches || !resourceMatches.length)
+ return;
+
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(searchResult.frameId);
+ if (!frame)
+ return;
+
+ var resource = frame.url === url ? frame.mainResource : frame.resourceForURL(url);
+ if (!resource)
+ return;
+
+ var resourceTreeElement = this._searchTreeElementForResource(resource);
+
+ for (var i = 0; i < resourceMatches.length; ++i) {
+ var match = resourceMatches[i];
+
+ var lineMatch;
+ var searchRegex = new RegExp(searchTerm.escapeForRegExp(), "gi");
+ while ((searchRegex.lastIndex < match.lineContent.length) && (lineMatch = searchRegex.exec(match.lineContent))) {
+ var matchObject = new WebInspector.ResourceSearchMatchObject(resource, match.lineContent, searchTerm, new WebInspector.TextRange(match.lineNumber, lineMatch.index, match.lineNumber, searchRegex.lastIndex));
+ var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
+ resourceTreeElement.appendChild(matchTreeElement);
+ }
+ }
+
+ updateEmptyContentPlaceholder.call(this);
+ }
+
+ PageAgent.searchInResource(searchResult.frameId, searchResult.url, searchTerm, false, false, resourceCallback.bind(this, searchResult.url));
+ }
+ }
+
+ function domCallback(error, searchId, resultsCount)
+ {
+ updateEmptyContentPlaceholderSoon.call(this);
+
+ if (error || !resultsCount)
+ return;
+
+ this._domSearchIdentifier = searchId;
+
+ function domSearchResults(error, nodeIds)
+ {
+ updateEmptyContentPlaceholderSoon.call(this);
+
+ if (error)
+ return;
+
+ for (var i = 0; i < nodeIds.length; ++i) {
+ // If someone started a new search, then return early and stop showing seach results from the old query.
+ if (this._domSearchIdentifier !== searchId)
+ return;
+
+ var domNode = WebInspector.domTreeManager.nodeForId(nodeIds[i]);
+ if (!domNode || !domNode.ownerDocument)
+ continue;
+
+ // We do not display the document node when the search query is "/". We don't have anything to display in the content view for it.
+ if (domNode.nodeType() === Node.DOCUMENT_NODE)
+ continue;
+
+ // FIXME: Use this should use a frame to do resourceForURL, but DOMAgent does not provide a frameId.
+ var resource = WebInspector.frameResourceManager.resourceForURL(domNode.ownerDocument.documentURL);
+ if (!resource)
+ continue;
+
+ var resourceTreeElement = this._searchTreeElementForResource(resource);
+
+ var domNodeTitle = WebInspector.DOMSearchMatchObject.titleForDOMNode(domNode);
+ var searchRegex = new RegExp(searchTerm.escapeForRegExp(), "gi");
+
+ // Textual matches.
+ var lineMatch;
+ var didFindTextualMatch = false;
+ while ((searchRegex.lastIndex < domNodeTitle.length) && (lineMatch = searchRegex.exec(domNodeTitle))) {
+ var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, searchTerm, new WebInspector.TextRange(0, lineMatch.index, 0, searchRegex.lastIndex));
+ var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
+ resourceTreeElement.appendChild(matchTreeElement);
+ didFindTextualMatch = true;
+ }
+
+ // Non-textual matches are CSS Selector or XPath matches. In such cases, display the node entirely highlighted.
+ if (!didFindTextualMatch) {
+ var matchObject = new WebInspector.DOMSearchMatchObject(resource, domNode, domNodeTitle, domNodeTitle, new WebInspector.TextRange(0, 0, 0, domNodeTitle.length));
+ var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject);
+ resourceTreeElement.appendChild(matchTreeElement);
+ }
+
+ updateEmptyContentPlaceholder.call(this);
+ }
+ }
+
+ DOMAgent.getSearchResults(searchId, 0, resultsCount, domSearchResults.bind(this));
+ }
+
+ WebInspector.domTreeManager.requestDocument();
+
+ // FIXME: Should we be searching for regexes or just plain text?
+ PageAgent.searchInResources(searchTerm, false, false, resourcesCallback.bind(this));
+
+ if ("_domSearchIdentifier" in this) {
+ DOMAgent.discardSearchResults(this._domSearchIdentifier);
+ delete this._domSearchIdentifier;
+ }
+
+ DOMAgent.performSearch(searchTerm, domCallback.bind(this));
+ },
+
+ // Private
+
+ _searchFieldChanged: function(event)
+ {
+ this.performSearch(event.target.value);
+ },
+
+ _searchFieldInput: function(event)
+ {
+ // If the search field is cleared, immediately clear the search results tree outline.
+ if (!event.target.value.length && this.contentTreeOutline === this._searchContentTreeOutline)
+ this.performSearch("");
+ },
+
+ _searchTreeElementForResource: function(resource)
+ {
+ // FIXME: This should take a frame ID (if one is available) - so we can differentiate between multiple resources
+ // with the same URL.
+
+ var resourceTreeElement = this._searchContentTreeOutline.getCachedTreeElement(resource);
+ if (!resourceTreeElement) {
+ resourceTreeElement = new WebInspector.ResourceTreeElement(resource);
+ resourceTreeElement.hasChildren = true;
+ resourceTreeElement.expand();
+
+ this._searchContentTreeOutline.appendChild(resourceTreeElement);
+ }
+
+ return resourceTreeElement;
+ },
+
+ _focusSearchField: function(keyboardShortcut, event)
+ {
+ this.show();
+
+ this._inputElement.select();
+ },
+
+ _mainFrameDidChange: function(event)
+ {
+ if (this._mainFrameTreeElement) {
+ this._mainFrameTreeElement.frame.removeEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainFrameMainResourceDidChange, this);
+ this._resourcesContentTreeOutline.removeChild(this._mainFrameTreeElement);
+ this._mainFrameTreeElement = null;
+ }
+
+ var newFrame = WebInspector.frameResourceManager.mainFrame;
+ if (newFrame) {
+ newFrame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainFrameMainResourceDidChange, this);
+ this._mainFrameTreeElement = new WebInspector.FrameTreeElement(newFrame);
+ this._resourcesContentTreeOutline.insertChild(this._mainFrameTreeElement, 0);
+
+ // Select by default. Allow onselect if we aren't showing a content view.
+ if (!this._resourcesContentTreeOutline.selectedTreeElement)
+ this._mainFrameTreeElement.revealAndSelect(true, false, !!WebInspector.contentBrowser.currentContentView);
+
+ if (this._frameIdentifierToShowSourceCodeWhenAvailable)
+ this.showSourceCodeForFrame(this._frameIdentifierToShowSourceCodeWhenAvailable, true);
+ }
+
+ // We only care about the first time the main frame changes.
+ if (!this._waitingForInitialMainFrame)
+ return;
+
+ // Only if there is a main frame.
+ if (!newFrame)
+ return;
+
+ delete this._waitingForInitialMainFrame;
+
+ // Only if the last page searched is the same as the current page.
+ if (this._lastSearchedPageSetting.value !== newFrame.url.hash)
+ return;
+
+ // Search for whatever is in the input field. This was populated with the last used search term.
+ this.performSearch(this._inputElement.value);
+ },
+
+ _mainFrameMainResourceDidChange: function(event)
+ {
+ var currentContentView = WebInspector.contentBrowser.currentContentView;
+ var wasShowingResourceContentView = currentContentView instanceof WebInspector.ResourceContentView
+ || currentContentView instanceof WebInspector.FrameContentView || currentContentView instanceof WebInspector.ScriptContentView;
+
+ // Close all resource and frame content views since the main frame has navigated and all resources are cleared.
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ResourceClusterContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.FrameContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ScriptContentView);
+
+ function delayedWork()
+ {
+ // Show the main frame since there is no content view showing or we were showing a resource before.
+ // FIXME: We could try to select the same resource that was selected before in the case of a reload.
+ if (!WebInspector.contentBrowser.currentContentView || wasShowingResourceContentView)
+ this._mainFrameTreeElement.revealAndSelect(true, false);
+ }
+
+ // Delay this work because other listeners of this event might not have fired yet. So selecting the main frame
+ // before those listeners do their work might cause the content of the old page to show instead of the new page.
+ setTimeout(delayedWork.bind(this), 0);
+ },
+
+ _frameWasAdded: function(event)
+ {
+ if (!this._frameIdentifierToShowSourceCodeWhenAvailable)
+ return;
+
+ var frame = event.data.frame;
+ if (frame.id !== this._frameIdentifierToShowSourceCodeWhenAvailable)
+ return;
+
+ this.showSourceCodeForFrame(frame.id, true);
+ },
+
+ _scriptWasAdded: function(event)
+ {
+ var script = event.data.script;
+
+ // We don't add scripts without URLs here. Those scripts can quickly clutter the interface and
+ // are usually more transient. They will get added if/when they need to be shown in a content view.
+ if (!script.url)
+ return;
+
+ // Exclude inspector scripts.
+ if (script.url.indexOf("__WebInspector") === 0)
+ return;
+
+ // If the script URL matches a resource we can assume it is part of that resource and does not need added.
+ if (script.resource)
+ return;
+
+ var insertIntoTopLevel = false;
+
+ if (script.injected) {
+ if (!this._extensionScriptsFolderTreeElement)
+ this._extensionScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Extension Scripts"));
+ var parentFolderTreeElement = this._extensionScriptsFolderTreeElement;
+ } else {
+ if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
+ insertIntoTopLevel = true;
+ else {
+ if (!this._extraScriptsFolderTreeElement)
+ this._extraScriptsFolderTreeElement = new WebInspector.FolderTreeElement(WebInspector.UIString("Extra Scripts"));
+ var parentFolderTreeElement = this._extraScriptsFolderTreeElement;
+ }
+ }
+
+ var scriptTreeElement = new WebInspector.ScriptTreeElement(script);
+
+ if (insertIntoTopLevel) {
+ var index = insertionIndexForObjectInListSortedByFunction(scriptTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
+ this._resourcesContentTreeOutline.insertChild(scriptTreeElement, index);
+ } else {
+ if (!parentFolderTreeElement.parent) {
+ var index = insertionIndexForObjectInListSortedByFunction(parentFolderTreeElement, this._resourcesContentTreeOutline.children, this._compareTreeElements);
+ this._resourcesContentTreeOutline.insertChild(parentFolderTreeElement, index);
+ }
+
+ parentFolderTreeElement.appendChild(scriptTreeElement);
+ }
+ },
+
+ _scriptsCleared: function(event)
+ {
+ if (this._extensionScriptsFolderTreeElement) {
+ if (this._extensionScriptsFolderTreeElement.parent)
+ this._extensionScriptsFolderTreeElement.parent.removeChild(this._extensionScriptsFolderTreeElement);
+ this._extensionScriptsFolderTreeElement = null;
+ }
+
+ if (this._extraScriptsFolderTreeElement) {
+ if (this._extraScriptsFolderTreeElement.parent)
+ this._extraScriptsFolderTreeElement.parent.removeChild(this._extraScriptsFolderTreeElement);
+ this._extraScriptsFolderTreeElement = null;
+ }
+
+ if (this._anonymousScriptsFolderTreeElement) {
+ if (this._anonymousScriptsFolderTreeElement.parent)
+ this._anonymousScriptsFolderTreeElement.parent.removeChild(this._anonymousScriptsFolderTreeElement);
+ this._anonymousScriptsFolderTreeElement = null;
+ }
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (treeElement instanceof WebInspector.FolderTreeElement || treeElement instanceof WebInspector.DatabaseHostTreeElement ||
+ treeElement instanceof WebInspector.IndexedDatabaseHostTreeElement || treeElement instanceof WebInspector.IndexedDatabaseTreeElement)
+ return;
+
+ if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement ||
+ treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
+ treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
+ treeElement instanceof WebInspector.ContentFlowTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement ||
+ treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
+ WebInspector.contentBrowser.showContentViewForRepresentedObject(treeElement.representedObject);
+ return;
+ }
+
+ console.assert(treeElement instanceof WebInspector.SearchResultTreeElement);
+ if (!(treeElement instanceof WebInspector.SearchResultTreeElement))
+ return;
+
+ if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
+ this.showMainFrameDOMTree(treeElement.representedObject.domNode, true);
+ else if (treeElement.representedObject instanceof WebInspector.ResourceSearchMatchObject)
+ this.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
+ },
+
+ _domNodeWasInspected: function(event)
+ {
+ this.showMainFrameDOMTree(event.data.node);
+ },
+
+ _domStorageObjectWasAdded: function(event)
+ {
+ var domStorage = event.data.domStorage;
+ var storageElement = new WebInspector.DOMStorageTreeElement(domStorage);
+
+ if (domStorage.isLocalStorage())
+ this._localStorageRootTreeElement = this._addStorageChild(storageElement, this._localStorageRootTreeElement, WebInspector.UIString("Local Storage"));
+ else
+ this._sessionStorageRootTreeElement = this._addStorageChild(storageElement, this._sessionStorageRootTreeElement, WebInspector.UIString("Session Storage"));
+ },
+
+ _domStorageObjectWasInspected: function(event)
+ {
+ var domStorage = event.data.domStorage;
+ var treeElement = this.treeElementForRepresentedObject(domStorage);
+ treeElement.revealAndSelect(true);
+ },
+
+ _databaseWasAdded: function(event)
+ {
+ var database = event.data.database;
+
+ console.assert(database instanceof WebInspector.DatabaseObject);
+
+ if (!this._databaseHostTreeElementMap[database.host]) {
+ this._databaseHostTreeElementMap[database.host] = new WebInspector.DatabaseHostTreeElement(database.host);
+ this._databaseRootTreeElement = this._addStorageChild(this._databaseHostTreeElementMap[database.host], this._databaseRootTreeElement, WebInspector.UIString("Databases"));
+ }
+
+ var databaseElement = new WebInspector.DatabaseTreeElement(database);
+ this._databaseHostTreeElementMap[database.host].appendChild(databaseElement);
+ },
+
+ _databaseWasInspected: function(event)
+ {
+ var database = event.data.database;
+ var treeElement = this.treeElementForRepresentedObject(database);
+ treeElement.revealAndSelect(true);
+ },
+
+ _indexedDatabaseWasAdded: function(event)
+ {
+ var indexedDatabase = event.data.indexedDatabase;
+
+ console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
+
+ if (!this._indexedDatabaseHostTreeElementMap[indexedDatabase.host]) {
+ this._indexedDatabaseHostTreeElementMap[indexedDatabase.host] = new WebInspector.IndexedDatabaseHostTreeElement(indexedDatabase.host);
+ this._indexedDatabaseRootTreeElement = this._addStorageChild(this._indexedDatabaseHostTreeElementMap[indexedDatabase.host], this._indexedDatabaseRootTreeElement, WebInspector.UIString("Indexed Databases"));
+ }
+
+ var indexedDatabaseElement = new WebInspector.IndexedDatabaseTreeElement(indexedDatabase);
+ this._indexedDatabaseHostTreeElementMap[indexedDatabase.host].appendChild(indexedDatabaseElement);
+ },
+
+ _cookieStorageObjectWasAdded: function(event)
+ {
+ console.assert(event.data.cookieStorage instanceof WebInspector.CookieStorageObject);
+
+ var cookieElement = new WebInspector.CookieStorageTreeElement(event.data.cookieStorage);
+ this._cookieStorageRootTreeElement = this._addStorageChild(cookieElement, this._cookieStorageRootTreeElement, WebInspector.UIString("Cookies"));
+ },
+
+ _frameManifestAdded: function(event)
+ {
+ var frameManifest = event.data.frameManifest;
+ console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
+
+ var manifest = frameManifest.manifest;
+ var manifestURL = manifest.manifestURL;
+ if (!this._applicationCacheURLTreeElementMap[manifestURL]) {
+ this._applicationCacheURLTreeElementMap[manifestURL] = new WebInspector.ApplicationCacheManifestTreeElement(manifest);
+ this._applicationCacheRootTreeElement = this._addStorageChild(this._applicationCacheURLTreeElementMap[manifestURL], this._applicationCacheRootTreeElement, WebInspector.UIString("Application Cache"));
+ }
+
+ var frameCacheElement = new WebInspector.ApplicationCacheFrameTreeElement(frameManifest);
+ this._applicationCacheURLTreeElementMap[manifestURL].appendChild(frameCacheElement);
+ },
+
+ _frameManifestRemoved: function(event)
+ {
+ // FIXME: Implement this.
+ },
+
+ _compareTreeElements: function(a, b)
+ {
+ // Always sort the main frame element first.
+ if (a instanceof WebInspector.FrameTreeElement)
+ return -1;
+ if (b instanceof WebInspector.FrameTreeElement)
+ return 1;
+
+ console.assert(a.mainTitle);
+ console.assert(b.mainTitle);
+
+ return (a.mainTitle || "").localeCompare(b.mainTitle || "");
+ },
+
+ _addStorageChild: function(childElement, parentElement, folderName)
+ {
+ if (!parentElement) {
+ childElement.flattened = true;
+
+ this._resourcesContentTreeOutline.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
+
+ return childElement;
+ }
+
+ if (parentElement instanceof WebInspector.StorageTreeElement) {
+ console.assert(parentElement.flattened);
+
+ var previousOnlyChild = parentElement;
+ previousOnlyChild.flattened = false;
+ this._resourcesContentTreeOutline.removeChild(previousOnlyChild);
+
+ var folderElement = new WebInspector.FolderTreeElement(folderName, null, null);
+ this._resourcesContentTreeOutline.insertChild(folderElement, insertionIndexForObjectInListSortedByFunction(folderElement, this._resourcesContentTreeOutline.children, this._compareTreeElements));
+
+ folderElement.appendChild(previousOnlyChild);
+ folderElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, folderElement.children, this._compareTreeElements));
+
+ return folderElement;
+ }
+
+ console.assert(parentElement instanceof WebInspector.FolderTreeElement);
+ parentElement.insertChild(childElement, insertionIndexForObjectInListSortedByFunction(childElement, parentElement.children, this._compareTreeElements));
+
+ return parentElement;
+ },
+
+ _storageCleared: function(event)
+ {
+ // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
+ WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
+
+ if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
+ this._localStorageRootTreeElement.parent.removeChild(this._localStorageRootTreeElement);
+
+ if (this._sessionStorageRootTreeElement && this._sessionStorageRootTreeElement.parent)
+ this._sessionStorageRootTreeElement.parent.removeChild(this._sessionStorageRootTreeElement);
+
+ if (this._databaseRootTreeElement && this._databaseRootTreeElement.parent)
+ this._databaseRootTreeElement.parent.removeChild(this._databaseRootTreeElement);
+
+ if (this._indexedDatabaseRootTreeElement && this._indexedDatabaseRootTreeElement.parent)
+ this._indexedDatabaseRootTreeElement.parent.removeChild(this._indexedDatabaseRootTreeElement);
+
+ if (this._cookieStorageRootTreeElement && this._cookieStorageRootTreeElement.parent)
+ this._cookieStorageRootTreeElement.parent.removeChild(this._cookieStorageRootTreeElement);
+
+ if (this._applicationCacheRootTreeElement && this._applicationCacheRootTreeElement.parent)
+ this._applicationCacheRootTreeElement.parent.removeChild(this._applicationCacheRootTreeElement);
+
+ this._localStorageRootTreeElement = null;
+ this._sessionStorageRootTreeElement = null;
+ this._databaseRootTreeElement = null;
+ this._databaseHostTreeElementMap = {};
+ this._indexedDatabaseRootTreeElement = null;
+ this._indexedDatabaseHostTreeElementMap = {};
+ this._cookieStorageRootTreeElement = null;
+ this._applicationCacheRootTreeElement = null;
+ this._applicationCacheURLTreeElementMap = {};
+ }
+};
+
+WebInspector.ResourceSidebarPanel.prototype.__proto__ = WebInspector.NavigationSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,192 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineDataGridNode = function(resourceTimelineRecord, graphOnly, graphDataSource)
+{
+ WebInspector.TimelineDataGridNode.call(this, graphOnly, graphDataSource);
+
+ this._resource = resourceTimelineRecord.resource;
+ this._record = resourceTimelineRecord;
+
+ this._record.addEventListener(WebInspector.TimelineRecord.Event.Updated, graphOnly ? this._timelineRecordUpdated : this._needsRefresh, this);
+
+ if (!graphOnly) {
+ this._resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._needsRefresh, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._needsRefresh, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._needsRefresh, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.LoadingDidFail, this._needsRefresh, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.SizeDidChange, this._needsRefresh, this);
+ this._resource.addEventListener(WebInspector.Resource.Event.TransferSizeDidChange, this._needsRefresh, this);
+ }
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ResourceTimelineDataGridNode);
+
+WebInspector.ResourceTimelineDataGridNode.IconStyleClassName = "icon";
+WebInspector.ResourceTimelineDataGridNode.ErrorStyleClassName = "error";
+
+WebInspector.ResourceTimelineDataGridNode.prototype = {
+ constructor: WebInspector.ResourceTimelineDataGridNode,
+ __proto__: WebInspector.TimelineDataGridNode.prototype,
+
+ // Public
+
+ get records()
+ {
+ return [this._record];
+ },
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ get data()
+ {
+ if (this._cachedData)
+ return this._cachedData;
+
+ var resource = this._resource;
+ var data = {};
+
+ if (!this._graphOnly) {
+ var zeroTime = this.graphDataSource ? this.graphDataSource.zeroTime : 0;
+
+ data.name = WebInspector.displayNameForURL(resource.url, resource.urlComponents);
+ data.domain = WebInspector.displayNameForHost(resource.urlComponents.host);
+ data.scheme = resource.urlComponents.scheme ? resource.urlComponents.scheme.toUpperCase() : "";
+ data.method = resource.requestMethod;
+ data.type = resource.type;
+ data.statusCode = resource.statusCode;
+ data.cached = resource.cached;
+ data.size = resource.size;
+ data.transferSize = resource.transferSize;
+ data.requestSent = resource.requestSentTimestamp - zeroTime;
+ data.duration = resource.receiveDuration;
+ data.latency = resource.latency;
+ }
+
+ data.graph = this._record.startTime;
+
+ this._cachedData = data;
+ return data;
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ var resource = this._resource;
+
+ if (resource.failed || resource.canceled || resource.statusCode >= 400)
+ cell.classList.add(WebInspector.ResourceTimelineDataGridNode.ErrorStyleClassName);
+
+ const emptyValuePlaceholderString = "\u2014";
+ var value = this.data[columnIdentifier];
+
+ switch (columnIdentifier) {
+ case "name":
+ cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ cell.classList.add(resource.type);
+
+ var fragment = document.createDocumentFragment();
+
+ var goToButton = WebInspector.createGoToArrowButton();
+ goToButton.addEventListener("click", this._goToResource.bind(this));
+ fragment.appendChild(goToButton);
+
+ var icon = document.createElement("div");
+ icon.className = WebInspector.ResourceTimelineDataGridNode.IconStyleClassName;
+ fragment.appendChild(icon);
+
+ var text = document.createTextNode(value);
+ fragment.appendChild(text);
+
+ cell.title = resource.url;
+
+ return fragment;
+
+ case "type":
+ return WebInspector.Resource.Type.displayName(value);
+
+ case "statusCode":
+ cell.title = resource.statusText || "";
+ return value || emptyValuePlaceholderString;
+
+ case "cached":
+ return value ? WebInspector.UIString("Yes") : WebInspector.UIString("No");
+
+ case "domain":
+ return value || emptyValuePlaceholderString;
+
+ case "size":
+ case "transferSize":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.bytesToString(value, true);
+
+ case "requestSent":
+ case "latency":
+ case "duration":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
+ }
+
+ return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ },
+
+ refresh: function()
+ {
+ if (this._scheduledRefreshIdentifier) {
+ cancelAnimationFrame(this._scheduledRefreshIdentifier);
+ delete this._scheduledRefreshIdentifier;
+ }
+
+ delete this._cachedData;
+
+ WebInspector.TimelineDataGridNode.prototype.refresh.call(this);
+ },
+
+ // Private
+
+ _needsRefresh: function()
+ {
+ if (this.dataGrid instanceof WebInspector.TimelineDataGrid) {
+ this.dataGrid.dataGridNodeNeedsRefresh(this);
+ return;
+ }
+
+ if (this._scheduledRefreshIdentifier)
+ return;
+
+ this._scheduledRefreshIdentifier = requestAnimationFrame(this.refresh.bind(this));
+ },
+
+ _goToResource: function(event)
+ {
+ WebInspector.resourceSidebarPanel.showSourceCode(this._resource);
+ },
+
+ _timelineRecordUpdated: function(event)
+ {
+ if (this.isRecordVisible(this._record))
+ this.needsGraphRefresh();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTimelineDataGridNodePathComponentjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceTimelineDataGridNodePathComponentjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceTimelineDataGridNodePathComponent.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTimelineDataGridNodePathComponent = function(resourceTimelineDataGridNode) {
+ var resource = resourceTimelineDataGridNode.record.resource;
+ var classNames = [WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type];
+
+ WebInspector.HierarchicalPathComponent.call(this, resourceTimelineDataGridNode.data.name, classNames, resource);
+
+ this._resourceTimelineDataGridNode = resourceTimelineDataGridNode;
+};
+
+WebInspector.ResourceTimelineDataGridNodePathComponent.prototype = {
+ constructor: WebInspector.ResourceTimelineDataGridNodePathComponent,
+
+ // Public
+
+ get resourceTimelineDataGridNode()
+ {
+ return this._resourceTimelineDataGridNode;
+ },
+
+ get previousSibling()
+ {
+ if (!this._resourceTimelineDataGridNode.previousSibling)
+ return null;
+ return new WebInspector.ResourceTimelineDataGridNodePathComponent(this._resourceTimelineDataGridNode.previousSibling);
+ },
+
+ get nextSibling()
+ {
+ if (!this._resourceTimelineDataGridNode.nextSibling)
+ return null;
+ return new WebInspector.ResourceTimelineDataGridNodePathComponent(this._resourceTimelineDataGridNode.nextSibling);
+ }
+};
+
+WebInspector.ResourceTimelineDataGridNodePathComponent.prototype.__proto__ = WebInspector.HierarchicalPathComponent.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementcssfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceTreeElementcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.item.resource.failed {
+ color: rgb(224, 16, 16) !important;
+}
+
+.item.resource.failed .subtitle {
+ color: rgba(224, 16, 16, 0.7) !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceResourceTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ResourceTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,198 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ResourceTreeElement = function(resource, representedObject)
+{
+ console.assert(resource instanceof WebInspector.Resource);
+
+ WebInspector.SourceCodeTreeElement.call(this, resource, [WebInspector.ResourceTreeElement.StyleClassName, WebInspector.ResourceTreeElement.ResourceIconStyleClassName, resource.type], "", "", representedObject || resource, false);
+
+ this._updateResource(resource);
+};
+
+WebInspector.ResourceTreeElement.StyleClassName = "resource";
+WebInspector.ResourceTreeElement.ResourceIconStyleClassName = "resource-icon";
+WebInspector.ResourceTreeElement.FailedStyleClassName = "failed";
+
+WebInspector.ResourceTreeElement.compareResourceTreeElements = function(a, b)
+{
+ // Compare by type first to keep resources grouped by type when not sorted into folders.
+ var comparisonResult = a.resource.type.localeCompare(b.resource.type);
+ if (comparisonResult !== 0)
+ return comparisonResult;
+
+ // Compare async resource types by their first timestamp so they are in chronological order.
+ if (a.resource.type === WebInspector.Resource.Type.XHR || a.resource.type === WebInspector.Resource.Type.WebSocket)
+ return a.resource.firstTimestamp - b.resource.firstTimestamp || 0;
+
+ // Compare by subtitle when the types are the same. The subtitle is used to show the
+ // domain of the resource. This causes resources to group by domain. If the resource
+ // is on the same domain as the frame it will have an empty subtitle. This is good
+ // because empty string sorts first, so those will appear before external resources.
+ comparisonResult = a.subtitle.localeCompare(b.subtitle);
+ if (comparisonResult !== 0)
+ return comparisonResult;
+
+ // Compare by title when the subtitles are the same.
+ return a.mainTitle.localeCompare(b.mainTitle);
+}
+
+WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements = function(a, b)
+{
+ var aIsFolder = a instanceof WebInspector.FolderTreeElement;
+ var bIsFolder = b instanceof WebInspector.FolderTreeElement;
+
+ if (aIsFolder && !bIsFolder)
+ return -1;
+ if (!aIsFolder && bIsFolder)
+ return 1;
+ if (aIsFolder && bIsFolder)
+ return a.mainTitle.localeCompare(b.mainTitle);
+
+ return WebInspector.ResourceTreeElement.compareResourceTreeElements(a, b);
+}
+
+WebInspector.ResourceTreeElement.prototype = {
+ constructor: WebInspector.ResourceTreeElement,
+
+ // Public
+
+ get resource()
+ {
+ return this._resource;
+ },
+
+ get filterableData()
+ {
+ return {text: this._resource.url};
+ },
+
+ ondblclick: function()
+ {
+ InspectorFrontendHost.openInNewTab(this._resource.url);
+ },
+
+ // Protected (Used by FrameTreeElement)
+
+ _updateResource: function(resource)
+ {
+ console.assert(resource instanceof WebInspector.Resource);
+
+ // This method is for subclasses like FrameTreeElement who don't use a resource as the representedObject.
+ // This method should only be called once if the representedObject is a resource, since changing the resource
+ // without changing the representedObject is bad. If you need to change the resource, make a new ResourceTreeElement.
+ console.assert(!this._resource || !(this.representedObject instanceof WebInspector.Resource));
+
+ if (this._resource) {
+ this._resource.removeEventListener(WebInspector.Resource.Event.URLDidChange, this._urlDidChange, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.TypeDidChange, this._typeDidChange, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._updateStatus, this);
+ this._resource.removeEventListener(WebInspector.Resource.Event.LoadingDidFail, this._updateStatus, this);
+ }
+
+ this._updateSourceCode(resource);
+
+ this._resource = resource;
+
+ resource.addEventListener(WebInspector.Resource.Event.URLDidChange, this._urlDidChange, this);
+ resource.addEventListener(WebInspector.Resource.Event.TypeDidChange, this._typeDidChange, this);
+ resource.addEventListener(WebInspector.Resource.Event.LoadingDidFinish, this._updateStatus, this);
+ resource.addEventListener(WebInspector.Resource.Event.LoadingDidFail, this._updateStatus, this);
+
+ this._updateTitles();
+ this._updateStatus();
+ this._updateToolTip();
+ },
+
+ // Protected
+
+ _updateTitles: function()
+ {
+ var frame = this._resource.parentFrame;
+ var isMainResource = this._resource.isMainResource();
+ if (isMainResource && frame) {
+ // When the resource is a main resource, get the host from the current frame's parent frame instead of the current frame.
+ var parentResourceHost = frame.parentFrame ? frame.parentFrame.mainResource.urlComponents.host : null;
+ } else if (frame) {
+ // When the resource is a normal sub-resource, get the host from the current frame's main resource.
+ var parentResourceHost = frame.mainResource.urlComponents.host;
+ }
+
+ var urlComponents = this._resource.urlComponents;
+
+ var oldMainTitle = this.mainTitle;
+ this.mainTitle = WebInspector.displayNameForURL(this._resource.url, urlComponents);
+
+ // Show the host as the subtitle if it is different from the main resource or if this is the main frame's main resource.
+ var subtitle = parentResourceHost !== urlComponents.host || frame.isMainFrame() && isMainResource ? WebInspector.displayNameForHost(urlComponents.host) : null;
+ this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
+
+ if (oldMainTitle !== this.mainTitle)
+ this.callFirstAncestorFunction("descendantResourceTreeElementMainTitleDidChange", [this, oldMainTitle]);
+ },
+
+ // Private
+
+ _updateStatus: function()
+ {
+ if (this._resource.failed)
+ this.addClassName(WebInspector.ResourceTreeElement.FailedStyleClassName);
+ else
+ this.removeClassName(WebInspector.ResourceTreeElement.FailedStyleClassName);
+
+ if (this._resource.finished || this._resource.failed) {
+ // Remove the spinner and replace with a reload button in case it's the main frame's main resource.
+ var frame = this._resource.parentFrame;
+ if (this._resource.isMainResource() && frame && frame.isMainFrame() && this instanceof WebInspector.FrameTreeElement)
+ this.updateStatusForMainFrame();
+ else
+ this.status = null;
+ } else {
+ var spinner = new WebInspector.IndeterminateProgressSpinner;
+ this.status = spinner.element;
+ }
+ },
+
+ _updateToolTip: function()
+ {
+ this.tooltip = this._resource.url;
+ },
+
+ _urlDidChange: function(event)
+ {
+ this._updateTitles();
+ this._updateToolTip();
+ },
+
+ _typeDidChange: function(event)
+ {
+ this.removeClassName(event.data.oldType);
+ this.addClassName(this._resource.type);
+
+ this.callFirstAncestorFunction("descendantResourceTreeElementTypeDidChange", [this, event.data.oldType]);
+ }
+};
+
+WebInspector.ResourceTreeElement.prototype.__proto__ = WebInspector.SourceCodeTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.details.css-style .rules .label {
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+
+ color: rgb(60%, 60%, 60%);
+ text-shadow: white 0 1px 0;
+
+ padding: 0 10px;
+}
+
+.sidebar > .panel.details.css-style .rules .label .go-to-link {
+ color: inherit !important;
+}
+
+.sidebar > .panel.details.css-style .rules .label + .style-declaration-section {
+ margin-top: 5px;
+}
+
+.sidebar > .panel.details.css-style .rules .new-rule {
+ font-size: 12px;
+ font-family: "Lucida Grande", sans-serif;
+ font-weight: bold;
+
+ color: black;
+ text-shadow: white 0 1px 0;
+
+ padding: 5px 10px;
+
+ margin-bottom: 8px;
+ margin-top: -5px;
+
+ opacity: 0.5;
+}
+
+.sidebar > .panel.details.css-style .rules .new-rule img {
+ content: url(../Images/Plus.svg);
+
+ width: 13px;
+ height: 13px;
+
+ vertical-align: -2px;
+
+ margin-right: 6px;
+}
+
+.sidebar > .panel.details.css-style .rules .new-rule:hover {
+ opacity: 0.6;
+}
+
+.sidebar > .panel.details.css-style .rules .new-rule:active {
+ opacity: 0.7;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceRulesStyleDetailsPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/RulesStyleDetailsPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,273 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.RulesStyleDetailsPanel = function()
+{
+ WebInspector.StyleDetailsPanel.call(this, WebInspector.RulesStyleDetailsPanel.StyleClassName, "rules", WebInspector.UIString("Rules"));
+
+ this._sections = [];
+};
+
+WebInspector.RulesStyleDetailsPanel.StyleClassName = "rules";
+WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName = "label";
+WebInspector.RulesStyleDetailsPanel.NewRuleElementStyleClassName = "new-rule";
+
+WebInspector.RulesStyleDetailsPanel.prototype = {
+ constructor: WebInspector.RulesStyleDetailsPanel,
+
+ // Public
+
+ refresh: function(significantChange)
+ {
+ // We only need to do a rebuild on significant changes. Other changes are handled
+ // by the sections and text editors themselves.
+ if (!significantChange)
+ return;
+
+ var newSections = [];
+ var newDOMFragment = document.createDocumentFragment();
+
+ var previousMediaList = [];
+ var previousSection = null;
+ var previousFocusedSection = null;
+
+ function mediaListsEqual(a, b)
+ {
+ a = a || [];
+ b = b || [];
+
+ if (a.length !== b.length)
+ return false;
+
+ for (var i = 0; i < a.length; ++i) {
+ var aMedia = a[i];
+ var bMedia = b[i];
+
+ if (aMedia.type !== bMedia.type)
+ return false;
+
+ if (aMedia.text !== bMedia.text)
+ return false;
+
+ if (!aMedia.sourceCodeLocation && bMedia.sourceCodeLocation)
+ return false;
+
+ if (aMedia.sourceCodeLocation && !aMedia.sourceCodeLocation.isEqual(bMedia.sourceCodeLocation))
+ return false;
+ }
+
+ return true;
+ }
+
+ function filteredMediaList(mediaList)
+ {
+ if (!mediaList)
+ return [];
+
+ // Exclude the basic "screen" query since it's very common and just clutters things.
+ return mediaList.filter(function(media) {
+ return media.text !== "screen";
+ });
+ }
+
+ function appendStyleSection(style)
+ {
+ var section = style.__rulesSection;
+ if (section && section.focused && !previousFocusedSection)
+ previousFocusedSection = section;
+
+ if (!section) {
+ section = new WebInspector.CSSStyleDeclarationSection(style);
+ style.__rulesSection = section;
+ } else
+ section.refresh();
+
+ if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.Inspector) {
+ previousFocusedSection = section;
+ delete this._focusNextNewInspectorRule;
+ }
+
+ // Reset lastInGroup in case the order/grouping changed.
+ section.lastInGroup = false;
+
+ newDOMFragment.appendChild(section.element);
+ newSections.push(section);
+
+ previousSection = section;
+ }
+
+ function addNewRuleButton()
+ {
+ if (previousSection)
+ previousSection.lastInGroup = true;
+
+ var newRuleButton = document.createElement("div");
+ newRuleButton.className = WebInspector.RulesStyleDetailsPanel.NewRuleElementStyleClassName;
+ newRuleButton.addEventListener("click", this._newRuleClicked.bind(this));
+
+ newRuleButton.appendChild(document.createElement("img"));
+ newRuleButton.appendChild(document.createTextNode(WebInspector.UIString("New Rule")));
+
+ newDOMFragment.appendChild(newRuleButton);
+
+ addedNewRuleButton = true;
+ }
+
+ var pseudoElements = this.nodeStyles.pseudoElements;
+ for (var pseudoIdentifier in pseudoElements) {
+ var pseudoElement = pseudoElements[pseudoIdentifier];
+ for (var i = 0; i < pseudoElement.orderedStyles.length; ++i) {
+ var style = pseudoElement.orderedStyles[i];
+ appendStyleSection.call(this, style);
+ }
+
+ if (previousSection)
+ previousSection.lastInGroup = true;
+ }
+
+ var addedNewRuleButton = false;
+
+ var orderedStyles = this.nodeStyles.orderedStyles;
+ for (var i = 0; i < orderedStyles.length; ++i) {
+ var style = orderedStyles[i];
+
+ if (style.type === WebInspector.CSSStyleDeclaration.Type.Rule && !addedNewRuleButton)
+ addNewRuleButton.call(this);
+
+ if (previousSection && previousSection.style.node !== style.node) {
+ previousSection.lastInGroup = true;
+
+ var prefixElement = document.createElement("strong");
+ prefixElement.textContent = WebInspector.UIString("Inherited From: ");
+
+ var inheritedLabel = document.createElement("div");
+ inheritedLabel.className = WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName;
+ inheritedLabel.appendChild(prefixElement);
+ inheritedLabel.appendChild(WebInspector.linkifyNodeReference(style.node));
+ newDOMFragment.appendChild(inheritedLabel);
+ }
+
+ // Only include the media list if it is different from the previous media list shown.
+ var currentMediaList = filteredMediaList(style.ownerRule && style.ownerRule.mediaList);
+ if (!mediaListsEqual(previousMediaList, currentMediaList)) {
+ previousMediaList = currentMediaList;
+
+ // Break the section group even if the media list is empty. That way the user knows
+ // the previous displayed media list does not apply to the next section.
+ if (previousSection)
+ previousSection.lastInGroup = true;
+
+ for (var j = 0; j < currentMediaList.length; ++j) {
+ var media = currentMediaList[j];
+
+ var prefixElement = document.createElement("strong");
+ prefixElement.textContent = WebInspector.UIString("Media: ");
+
+ var mediaLabel = document.createElement("div");
+ mediaLabel.className = WebInspector.RulesStyleDetailsPanel.LabelElementStyleClassName;
+ mediaLabel.appendChild(prefixElement);
+ mediaLabel.appendChild(document.createTextNode(media.text));
+
+ if (media.sourceCodeLocation) {
+ mediaLabel.appendChild(document.createTextNode(" \u2014 "));
+ mediaLabel.appendChild(WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
+ }
+
+ newDOMFragment.appendChild(mediaLabel);
+ }
+ }
+
+ appendStyleSection.call(this, style);
+ }
+
+ if (!addedNewRuleButton)
+ addNewRuleButton.call(this);
+
+ if (previousSection)
+ previousSection.lastInGroup = true;
+
+ this.element.removeChildren();
+ this.element.appendChild(newDOMFragment);
+
+ this._sections = newSections;
+
+ for (var i = 0; i < this._sections.length; ++i)
+ this._sections[i].updateLayout();
+
+ if (previousFocusedSection) {
+ previousFocusedSection.focus();
+
+ function scrollToFocusedSection()
+ {
+ previousFocusedSection.element.scrollIntoViewIfNeeded(true);
+ }
+
+ // Do the scroll on a timeout since StyleDetailsPanel restores scroll position
+ // after the refresh, and we might not need to scroll after the restore.
+ setTimeout(scrollToFocusedSection, 0);
+ }
+ },
+
+ // Protected
+
+ shown: function()
+ {
+ WebInspector.StyleDetailsPanel.prototype.shown.call(this);
+
+ // Associate the style and section objects so they can be reused.
+ // Also update the layout in case we changed widths while hidden.
+ for (var i = 0; i < this._sections.length; ++i) {
+ var section = this._sections[i];
+ section.style.__rulesSection = section;
+ section.updateLayout();
+ }
+ },
+
+ hidden: function()
+ {
+ WebInspector.StyleDetailsPanel.prototype.hidden.call(this);
+
+ // Disconnect the style and section objects so they have a chance
+ // to release their objects when this panel is not visible.
+ for (var i = 0; i < this._sections.length; ++i)
+ delete this._sections[i].style.__rulesSection;
+ },
+
+ widthDidChange: function()
+ {
+ for (var i = 0; i < this._sections.length; ++i)
+ this._sections[i].updateLayout();
+ },
+
+ // Private
+
+ _newRuleClicked: function(event)
+ {
+ this._focusNextNewInspectorRule = true;
+ this.nodeStyles.addRule();
+ }
+};
+
+WebInspector.RulesStyleDetailsPanel.prototype.__proto__ = WebInspector.StyleDetailsPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeBarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeBarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeBar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.scope-bar {
+ font-family: Lucida Grande, sans-serif;
+ padding: 0 3px;
+ overflow: hidden;
+}
+
+.scope-bar > li {
+ display: inline-block;
+ margin: 0 2px;
+ padding: 0 8px 3px;
+ font-size: 11px;
+ font-weight: bold;
+ line-height: 12px;
+ color: rgb(46, 46, 46);
+ background-color: transparent;
+ border: 1px solid transparent;
+ border-radius: 9px;
+ text-align: center;
+
+ transition: 200ms ease-in-out;
+ transition-property: background-color, border-color;
+}
+
+.scope-bar > li.selected,
+.scope-bar > li:active {
+ transition-duration: 75ms;
+}
+
+.scope-bar > li:hover {
+ border-color: rgba(0, 0, 0, 0.15);
+}
+
+.scope-bar > li.selected {
+ background-color: rgba(0, 0, 0, 0.06);
+ border-color: rgba(0, 0, 0, 0.30);
+}
+
+.scope-bar > li:active {
+ background-color: rgba(0, 0, 0, 0.16);
+ border-color: rgba(0, 0, 0, 0.40);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeBar = function(identifier, items, defaultItem) {
+ WebInspector.NavigationItem.call(this, identifier);
+
+ this._element.classList.add(WebInspector.ScopeBar.StyleClassName);
+
+ this._items = items;
+ this._defaultItem = defaultItem;
+
+ this._itemsById = [];
+ this._populate();
+};
+
+WebInspector.ScopeBar.StyleClassName = "scope-bar";
+WebInspector.ScopeBar.Event = {
+ SelectionChanged: "scopebar-selection-did-change"
+};
+
+WebInspector.ScopeBar.prototype = {
+ constructor: WebInspector.ScopeBar,
+
+ // Public
+
+ get defaultItem()
+ {
+ return this._defaultItem;
+ },
+
+ item: function(id)
+ {
+ return this._itemsById[id];
+ },
+
+ get selectedItems()
+ {
+ return this._items.filter(function(item) {
+ return item.selected;
+ });
+ },
+
+ updateLayout: function(expandOnly)
+ {
+ if (expandOnly)
+ return;
+
+ for (var i = 0; i < this._items.length; ++i) {
+ var item = this._items[i];
+ var isSelected = item.selected;
+
+ if (!isSelected)
+ item.element.classList.add(WebInspector.ScopeBarItem.SelectedStyleClassName);
+
+ var selectedWidth = item.element.offsetWidth;
+ if (selectedWidth)
+ item.element.style.minWidth = selectedWidth + "px";
+
+ if (!isSelected)
+ item.element.classList.remove(WebInspector.ScopeBarItem.SelectedStyleClassName);
+ }
+ },
+
+ // Private
+
+ _populate: function()
+ {
+ var item;
+ for (var i = 0; i < this._items.length; ++i) {
+ item = this._items[i];
+ this._itemsById[item.id] = item;
+ this._element.appendChild(item.element);
+
+ item.addEventListener(WebInspector.ScopeBarItem.Event.SelectionChanged, this._itemSelectionDidChange, this);
+ }
+
+ if (!this.selectedItems.length && this._defaultItem)
+ this._defaultItem.selected = true;
+ },
+
+ _itemSelectionDidChange: function(event)
+ {
+ var sender = event.target;
+ var item;
+
+ // An exclusive item was selected, unselect everything else.
+ if (sender.isExclusive && sender.selected) {
+ for (var i = 0; i < this._items.length; ++i) {
+ item = this._items[i];
+ if (item !== sender)
+ item.selected = false;
+ }
+ } else {
+ var replacesCurrentSelection = !event.data.withModifier;
+ for (var i = 0; i < this._items.length; ++i) {
+ item = this._items[i];
+ if (item.isExclusive && item !== sender && sender.selected)
+ item.selected = false;
+ else if (sender.selected && replacesCurrentSelection && sender !== item)
+ item.selected = false;
+ }
+ }
+
+ // If nothing is selected anymore, select the default item.
+ if (!this.selectedItems.length && this._defaultItem)
+ this._defaultItem.selected = true;
+
+ this.dispatchEventToListeners(WebInspector.ScopeBar.Event.SelectionChanged);
+ }
+};
+
+WebInspector.ScopeBar.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeBarItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeBarItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeBarItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeBarItem = function(id, label, isExclusive) {
+ WebInspector.Object.call(this);
+
+ this.id = id;
+ this.label = label;
+ this.isExclusive = isExclusive;
+
+ this._selectedSetting = new WebInspector.Setting("scopebaritem-" + id, false);
+
+ this._markElementSelected(this._selectedSetting.value);
+};
+
+WebInspector.ScopeBarItem.SelectedStyleClassName = "selected";
+WebInspector.ScopeBarItem.Event = {
+ SelectionChanged: "scope-bar-item-selection-did-change"
+};
+
+WebInspector.ScopeBarItem.prototype = {
+ constructor: WebInspector.ScopeBarItem,
+
+ // Public
+
+ get element()
+ {
+ if (!this._element) {
+ this._element = document.createElement("li");
+ this._element.textContent = this.label;
+ this._element.addEventListener("click", this._clicked.bind(this), false);
+ }
+ return this._element;
+ },
+
+ get selected()
+ {
+ return this._selectedSetting.value;
+ },
+
+ set selected(selected)
+ {
+ this.setSelected(selected, false);
+ },
+
+ setSelected: function(selected, withModifier)
+ {
+ if (this._selectedSetting.value === selected)
+ return;
+
+ this._markElementSelected(selected);
+
+ this._selectedSetting.value = selected;
+
+ this.dispatchEventToListeners(WebInspector.ScopeBarItem.Event.SelectionChanged, {withModifier: withModifier});
+ },
+
+ // Private
+
+ _markElementSelected: function(selected)
+ {
+ if (selected)
+ this.element.classList.add(WebInspector.ScopeBarItem.SelectedStyleClassName);
+ else
+ this.element.classList.remove(WebInspector.ScopeBarItem.SelectedStyleClassName);
+ },
+
+ _clicked: function(event)
+ {
+ var withModifier = (event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey);
+ this.setSelected(!this.selected, withModifier);
+ }
+};
+
+WebInspector.ScopeBarItem.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeChainDetailsSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeChainDetailsSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,173 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScopeChainDetailsSidebarPanel = function() {
+ WebInspector.DetailsSidebarPanel.call(this, "scope-chain", WebInspector.UIString("Scope Chain"), WebInspector.UIString("Scope Chain"), "Images/NavigationItemVariable.svg", "5");
+
+ this._callFrame = null;
+
+ // Update on console prompt eval as objects in the scope chain may have changed.
+ WebInspector.runtimeManager.addEventListener(WebInspector.RuntimeManager.Event.DidEvaluate, this.needsRefresh, this);
+};
+
+WebInspector.ScopeChainDetailsSidebarPanel.prototype = {
+ constructor: WebInspector.ScopeChainDetailsSidebarPanel,
+
+ // Public
+
+ inspect: function(objects)
+ {
+ // Convert to a single item array if needed.
+ if (!(objects instanceof Array))
+ objects = [objects];
+
+ var callFrameToInspect = null;
+
+ // Iterate over the objects to find a WebInspector.CallFrame to inspect.
+ for (var i = 0; i < objects.length; ++i) {
+ if (!(objects[i] instanceof WebInspector.CallFrame))
+ continue;
+ callFrameToInspect = objects[i];
+ break;
+ }
+
+ this.callFrame = callFrameToInspect;
+
+ return !!this.callFrame;
+ },
+
+ get callFrame()
+ {
+ return this._callFrame;
+ },
+
+ set callFrame(callFrame)
+ {
+ if (callFrame === this._callFrame)
+ return;
+
+ this._callFrame = callFrame;
+
+ this.needsRefresh();
+ },
+
+ refresh: function()
+ {
+ var callFrame = this.callFrame;
+ if (!callFrame)
+ return;
+
+ var detailsSections = [];
+ var foundLocalScope = false;
+
+ var sectionCountByType = {};
+ for (var type in WebInspector.ScopeChainNode.Type)
+ sectionCountByType[WebInspector.ScopeChainNode.Type[type]] = 0;
+
+ var scopeChain = callFrame.scopeChain;
+ for (var i = 0; i < scopeChain.length; ++i) {
+ var scope = scopeChain[i];
+
+ var title = null;
+ var extraProperties = null;
+ var collapsedByDefault = false;
+ var dontHighlightNonEnumerableProperties = true;
+
+ ++sectionCountByType[scope.type];
+
+ switch (scope.type) {
+ case WebInspector.ScopeChainNode.Type.Local:
+ foundLocalScope = true;
+ collapsedByDefault = false;
+ dontHighlightNonEnumerableProperties = true;
+
+ title = WebInspector.UIString("Local Variables");
+
+ if (callFrame.thisObject)
+ extraProperties = [new WebInspector.RemoteObjectProperty("this", callFrame.thisObject)];
+ break;
+
+ case WebInspector.ScopeChainNode.Type.Closure:
+ title = WebInspector.UIString("Closure Variables");
+ dontHighlightNonEnumerableProperties = true;
+ collapsedByDefault = false;
+ break;
+
+ case WebInspector.ScopeChainNode.Type.Catch:
+ title = WebInspector.UIString("Catch Variables");
+ dontHighlightNonEnumerableProperties = true;
+ collapsedByDefault = false;
+ break;
+
+ case WebInspector.ScopeChainNode.Type.With:
+ title = WebInspector.UIString("With Object Properties");
+ collapsedByDefault = foundLocalScope;
+ dontHighlightNonEnumerableProperties = false;
+ break;
+
+ case WebInspector.ScopeChainNode.Type.Global:
+ title = WebInspector.UIString("Global Variables");
+ dontHighlightNonEnumerableProperties = false;
+ collapsedByDefault = true;
+ break;
+ }
+
+ var detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
+
+ var section = new WebInspector.ObjectPropertiesSection(scope.object, null, null, null, true, extraProperties, WebInspector.ScopeVariableTreeElement);
+ section.dontHighlightNonEnumerablePropertiesAtTopLevel = dontHighlightNonEnumerableProperties;
+ section.__propertyIdentifierPrefix = detailsSectionIdentifier;
+
+ var detailsSection = new WebInspector.DetailsSection(detailsSectionIdentifier, title, null, null, collapsedByDefault);
+ detailsSection.groups[0].rows = [new WebInspector.DetailsSectionPropertiesRow(section)];
+ detailsSections.push(detailsSection);
+ }
+
+ function delayedWork()
+ {
+ // Clear the timeout so we don't update the interface twice.
+ clearTimeout(timeout);
+
+ // Bail if the call frame changed while we were waiting for the async response.
+ if (this.callFrame !== callFrame)
+ return;
+
+ this.element.removeChildren();
+ for (var i = 0; i < detailsSections.length; ++i)
+ this.element.appendChild(detailsSections[i].element);
+ }
+
+ // We need a timeout in place in case there are long running, pending backend dispatches. This can happen
+ // if the debugger is paused in code that was executed from the console. The console will be waiting for
+ // the result of the execution and without a timeout we would never update the scope variables.
+ var timeout = setTimeout(delayedWork.bind(this), 50);
+
+ // Since ObjectPropertiesSection populates asynchronously, we want to wait to replace the existing content
+ // until after all the pending asynchronous requests are completed. This prevents severe flashing while stepping.
+ InspectorBackend.runAfterPendingDispatches(delayedWork.bind(this));
+ }
+};
+
+WebInspector.ScopeChainDetailsSidebarPanel.prototype.__proto__ = WebInspector.DetailsSidebarPanel.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeVariableTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScopeVariableTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScopeVariableTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeVariableTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2011 Google Inc. 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 APPLE INC. ``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 APPLE INC. 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.ScopeVariableTreeElement = function(property)
+{
+ WebInspector.ObjectPropertyTreeElement.call(this, property);
+};
+
+WebInspector.ScopeVariableTreeElement._expandedProperties = {};
+
+WebInspector.ScopeVariableTreeElement.prototype = {
+ constructor: WebInspector.ScopeVariableTreeElement,
+
+ // Public
+
+ onattach: function()
+ {
+ WebInspector.ObjectPropertyTreeElement.prototype.onattach.call(this);
+
+ if (this.hasChildren && this.constructor._expandedProperties.hasOwnProperty(this.propertyIdentifier))
+ this.expand();
+ },
+
+ onexpand: function()
+ {
+ this.constructor._expandedProperties[this.propertyIdentifier] = true;
+ },
+
+ oncollapse: function()
+ {
+ delete this.constructor._expandedProperties[this.propertyIdentifier];
+ },
+
+ get propertyIdentifier()
+ {
+ if ("_propertyIdentifier" in this)
+ return this._propertyIdentifier;
+
+ var section = this.treeOutline.section;
+ this._propertyIdentifier = (section.__propertyIdentifierPrefix ? section.__propertyIdentifierPrefix + "-" : "") + this.propertyPath;
+ return this._propertyIdentifier;
+ },
+
+ get propertyPath()
+ {
+ if ("_propertyPath" in this)
+ return this._propertyPath;
+
+ var current = this;
+ var result;
+
+ do {
+ if (current.property) {
+ if (result)
+ result = current.property.name + "." + result;
+ else
+ result = current.property.name;
+ }
+
+ current = current.parent;
+ } while (current && !current.root);
+
+ this._propertyPath = result;
+ return result;
+ }
+};
+
+WebInspector.ScopeVariableTreeElement.prototype.__proto__ = WebInspector.ObjectPropertyTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.script > .text-editor {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,225 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptContentView = function(script)
+{
+ WebInspector.ContentView.call(this, script);
+
+ this.element.classList.add(WebInspector.ScriptContentView.StyleClassName);
+
+ // Append a spinner while waiting for _contentWillPopulate.
+ var spinner = new WebInspector.IndeterminateProgressSpinner;
+ this.element.appendChild(spinner.element);
+
+ this._script = script;
+
+ // This view is only for standalone Scripts with no corresponding Resource. All other Scripts
+ // should be handled by TextResourceContentView via the Resource.
+ console.assert(!script.resource);
+ console.assert(script.range.startLine === 0);
+ console.assert(script.range.startColumn === 0);
+
+ this._textEditor = new WebInspector.SourceCodeTextEditor(script);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
+ this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate, this._contentWillPopulate, this);
+ this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate, this._contentDidPopulate, this);
+
+ var toolTip = WebInspector.UIString("Pretty print");
+ var activatedToolTip = WebInspector.UIString("Original formatting");
+ this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
+ this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
+ this._prettyPrintButtonNavigationItem.enabled = false; // Enabled when the text editor is populated with content.
+};
+
+WebInspector.ScriptContentView.StyleClassName = "script";
+
+WebInspector.ScriptContentView.prototype = {
+ constructor: WebInspector.ScriptContentView,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this._prettyPrintButtonNavigationItem];
+ },
+
+ get script()
+ {
+ return this._script;
+ },
+
+ get textEditor()
+ {
+ return this._textEditor;
+ },
+
+ get supplementalRepresentedObjects()
+ {
+ if (isNaN(this._textEditor.executionLineNumber))
+ return [];
+
+ // If the SourceCodeTextEditor has an executionLineNumber, we can assume
+ // it is always the active call frame.
+ return [WebInspector.debuggerManager.activeCallFrame];
+ },
+
+ revealPosition: function(position, textRangeToSelect, forceUnformatted)
+ {
+ this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
+ },
+
+ shown: function()
+ {
+ this._textEditor.shown();
+ },
+
+ hidden: function()
+ {
+ this._textEditor.hidden();
+ },
+
+ closed: function()
+ {
+ this._textEditor.close();
+ },
+
+ saveToCookie: function(cookie)
+ {
+ cookie.type = WebInspector.ContentViewCookieType.Resource;
+ cookie.url = this.representedObject.url;
+ },
+
+ restoreFromCookie: function(cookie)
+ {
+ if ("lineNumber" in cookie && "columnNumber" in cookie)
+ this.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber));
+ },
+
+ get supportsSave()
+ {
+ return true;
+ },
+
+ get saveData()
+ {
+ var url = this._script.url || "web-inspector:///" + encodeURI(this._script.displayName) + ".js";
+ return {url: url, content: this._textEditor.string};
+ },
+
+ get supportsSearch()
+ {
+ return true;
+ },
+
+ get numberOfSearchResults()
+ {
+ return this._textEditor.numberOfSearchResults;
+ },
+
+ get hasPerformedSearch()
+ {
+ return this._textEditor.currentSearchQuery !== null;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ this._textEditor.automaticallyRevealFirstSearchResult = reveal;
+ },
+
+ performSearch: function(query)
+ {
+ this._textEditor.performSearch(query);
+ },
+
+ searchCleared: function()
+ {
+ this._textEditor.searchCleared();
+ },
+
+ searchQueryWithSelection: function()
+ {
+ return this._textEditor.searchQueryWithSelection();
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealPreviousSearchResult(changeFocus);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealNextSearchResult(changeFocus);
+ },
+
+ updateLayout: function()
+ {
+ this._textEditor.updateLayout();
+ },
+
+ // Private
+
+ _contentWillPopulate: function(event)
+ {
+ if (this._textEditor.element.parentNode === this.element)
+ return;
+
+ // Allow editing any local file since edits can be saved and reloaded right from the Inspector.
+ if (this._script.urlComponents.scheme === "file")
+ this._textEditor.readOnly = false;
+
+ this.element.removeChildren();
+ this.element.appendChild(this._textEditor.element);
+ },
+
+ _contentDidPopulate: function(event)
+ {
+ this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
+ },
+
+ _togglePrettyPrint: function(event)
+ {
+ var activated = !this._prettyPrintButtonNavigationItem.activated;
+ this._textEditor.formatted = activated;
+ },
+
+ _textEditorFormattingDidChange: function(event)
+ {
+ this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
+ },
+
+ _executionLineNumberDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
+ },
+
+ _numberOfSearchResultsDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+ }
+};
+
+WebInspector.ScriptContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
+{
+ WebInspector.TimelineDataGrid.call(this, treeOutline, columns, delegate, editCallback, deleteCallback);
+}
+
+WebInspector.ScriptTimelineDataGrid.prototype = {
+ constructor: WebInspector.ScriptTimelineDataGrid,
+
+ // Protected
+
+ callFramePopoverAnchorElement: function()
+ {
+ return this.selectedNode.elementWithColumnIdentifier("location");
+ }
+}
+
+WebInspector.ScriptTimelineDataGrid.prototype.__proto__ = WebInspector.TimelineDataGrid.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineDataGridNode = function(scriptTimelineRecord, baseStartTime, rangeStartTime, rangeEndTime)
+{
+ WebInspector.TimelineDataGridNode.call(this, false, null);
+
+ this._record = scriptTimelineRecord;
+ this._baseStartTime = baseStartTime || 0;
+ this._rangeStartTime = rangeStartTime || 0;
+ this._rangeEndTime = typeof rangeEndTime === "number" ? rangeEndTime : Infinity;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.ScriptTimelineDataGridNode);
+
+WebInspector.ScriptTimelineDataGridNode.IconStyleClassName = "icon";
+
+WebInspector.ScriptTimelineDataGridNode.prototype = {
+ constructor: WebInspector.ScriptTimelineDataGridNode,
+ __proto__: WebInspector.TimelineDataGridNode.prototype,
+
+ // Public
+
+ get record()
+ {
+ return this._record;
+ },
+
+ get records()
+ {
+ return [this._record];
+ },
+
+ get baseStartTime()
+ {
+ return this._baseStartTime;
+ },
+
+ get rangeStartTime()
+ {
+ return this._rangeStartTime;
+ },
+
+ set rangeStartTime(x)
+ {
+ if (this._rangeStartTime === x)
+ return;
+
+ this._rangeStartTime = x;
+ this.needsRefresh();
+ },
+
+ get rangeEndTime()
+ {
+ return this._rangeEndTime;
+ },
+
+ set rangeEndTime(x)
+ {
+ if (this._rangeEndTime === x)
+ return;
+
+ this._rangeEndTime = x;
+ this.needsRefresh();
+ },
+
+ get data()
+ {
+ var startTime = Math.max(this._rangeStartTime, this._record.startTime);
+ var duration = Math.min(this._record.startTime + this._record.duration, this._rangeEndTime) - startTime;
+ var callFrameOrSourceCodeLocation = this._record.initiatorCallFrame || this._record.sourceCodeLocation;
+
+ return {eventType: this._record.eventType, startTime: startTime, selfTime: duration, totalTime: duration,
+ averageTime: duration, callCount: 1, location: callFrameOrSourceCodeLocation};
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ const emptyValuePlaceholderString = "\u2014";
+ var value = this.data[columnIdentifier];
+
+ switch (columnIdentifier) {
+ case "eventType":
+ return WebInspector.ScriptTimelineRecord.EventType.displayName(value, this._record.details);
+
+ case "startTime":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value - this._baseStartTime, true);
+
+ case "selfTime":
+ case "totalTime":
+ case "averageTime":
+ return isNaN(value) ? emptyValuePlaceholderString : Number.secondsToString(value, true);
+ }
+
+ return WebInspector.TimelineDataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineOverviewGraphcssfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-overview-graph.script > .timeline-record-bar {
+ margin-top: 8px;
+ height: 20px;
+}
+
+.timeline-overview-graph.script > .timeline-record-bar > .segment {
+ border-radius: 2px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineOverviewGraphjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineOverviewGraphjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineOverviewGraph.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineOverviewGraph = function(recording)
+{
+ WebInspector.TimelineOverviewGraph.call(this, recording);
+
+ this.element.classList.add(WebInspector.ScriptTimelineOverviewGraph.StyleClassName);
+
+ this._scriptTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Script);
+ this._scriptTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._scriptTimelineRecordAdded, this);
+
+ this._timelineRecordBars = [];
+
+ this.reset();
+};
+
+WebInspector.ScriptTimelineOverviewGraph.StyleClassName = "script";
+
+WebInspector.ScriptTimelineOverviewGraph.prototype = {
+ constructor: WebInspector.ScriptTimelineOverviewGraph,
+ __proto__: WebInspector.TimelineOverviewGraph.prototype,
+
+ // Public
+
+ reset: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.reset.call(this);
+
+ this._timelineRecordBarMap = new Map;
+
+ this.element.removeChildren();
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineOverviewGraph.prototype.updateLayout.call(this);
+
+ var visibleWidth = this.element.offsetWidth;
+ var secondsPerPixel = (this.endTime - this.startTime) / visibleWidth;
+
+ var recordBarIndex = 0;
+
+ function createBar(records, renderMode)
+ {
+ var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
+ if (!timelineRecordBar)
+ timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
+ timelineRecordBar.renderMode = renderMode;
+ timelineRecordBar.records = records;
+ timelineRecordBar.refresh(this);
+ if (!timelineRecordBar.element.parentNode)
+ this.element.appendChild(timelineRecordBar.element);
+ ++recordBarIndex;
+ }
+
+ WebInspector.TimelineRecordBar.createCombinedBars(this._scriptTimeline.records, secondsPerPixel, this, createBar.bind(this));
+
+ // Remove the remaining unused TimelineRecordBars.
+ for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
+ this._timelineRecordBars[recordBarIndex].records = null;
+ this._timelineRecordBars[recordBarIndex].element.remove();
+ }
+ },
+
+ // Private
+
+ _scriptTimelineRecordAdded: function(event)
+ {
+ this.needsLayout();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-view.script > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.timeline-view.script > .data-grid .eventType-column {
+ border-right: none;
+}
+
+.sidebar > .panel.timeline.timeline-content-view-showing .navigation-sidebar-panel-content-tree-outline.script .item .subtitle {
+ display: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTimelineViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTimelineView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,279 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTimelineView = function(recording)
+{
+ WebInspector.TimelineView.call(this);
+
+ this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
+ this.navigationSidebarTreeOutline.element.classList.add(WebInspector.ScriptTimelineView.TreeOutlineStyleClassName);
+
+ var columns = {location: {}, callCount: {}, startTime: {}, totalTime: {}, selfTime: {}, averageTime: {}};
+
+ columns.location.title = WebInspector.UIString("Location");
+ columns.location.width = "15%";
+
+ columns.callCount.title = WebInspector.UIString("Calls");
+ columns.callCount.width = "5%";
+ columns.callCount.aligned = "right";
+
+ columns.startTime.title = WebInspector.UIString("Start Time");
+ columns.startTime.width = "10%";
+ columns.startTime.aligned = "right";
+ columns.startTime.sort = "ascending";
+
+ columns.totalTime.title = WebInspector.UIString("Total Time");
+ columns.totalTime.width = "10%";
+ columns.totalTime.aligned = "right";
+
+ columns.selfTime.title = WebInspector.UIString("Self Time");
+ columns.selfTime.width = "10%";
+ columns.selfTime.aligned = "right";
+
+ columns.averageTime.title = WebInspector.UIString("Average Time");
+ columns.averageTime.width = "10%";
+ columns.averageTime.aligned = "right";
+
+ for (var column in columns)
+ columns[column].sortable = true;
+
+ this._dataGrid = new WebInspector.ScriptTimelineDataGrid(this.navigationSidebarTreeOutline, columns, this);
+ this._dataGrid.addEventListener(WebInspector.TimelineDataGrid.Event.FiltersDidChange, this._dataGridFiltersDidChange, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+
+ this.element.classList.add(WebInspector.ScriptTimelineView.StyleClassName);
+ this.element.appendChild(this._dataGrid.element);
+
+ var scriptTimeline = recording.timelines.get(WebInspector.TimelineRecord.Type.Script);
+ scriptTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._scriptTimelineRecordAdded, this);
+
+ this._pendingRecords = [];
+};
+
+WebInspector.ScriptTimelineView.StyleClassName = "script";
+WebInspector.ScriptTimelineView.TreeOutlineStyleClassName = "script";
+
+WebInspector.ScriptTimelineView.prototype = {
+ constructor: WebInspector.ScriptTimelineView,
+ __proto__: WebInspector.TimelineView.prototype,
+
+ // Public
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ return WebInspector.UIString("Records");
+ },
+
+ shown: function()
+ {
+ WebInspector.TimelineView.prototype.shown.call(this);
+
+ this._dataGrid.shown();
+ },
+
+ hidden: function()
+ {
+ this._dataGrid.hidden();
+
+ WebInspector.TimelineView.prototype.hidden.call(this);
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.TimelineView.prototype.updateLayout.call(this);
+
+ this._dataGrid.updateLayout();
+
+ if (this.startTime !== this._oldStartTime || this.endTime !== this._oldEndTime) {
+ var dataGridNode = this._dataGrid.children[0];
+ while (dataGridNode) {
+ dataGridNode.rangeStartTime = this.startTime;
+ dataGridNode.rangeEndTime = this.endTime;
+ if (dataGridNode.revealed)
+ dataGridNode.refreshIfNeeded();
+ dataGridNode = dataGridNode.traverseNextNode(false, null, true);
+ }
+
+ this._oldStartTime = this.startTime;
+ this._oldEndTime = this.endTime;
+ }
+
+ this._processPendingRecords();
+ },
+
+ get selectionPathComponents()
+ {
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return null;
+
+ var pathComponents = [];
+
+ while (dataGridNode && !dataGridNode.root) {
+ var treeElement = this._dataGrid.treeElementForDataGridNode(dataGridNode);
+ console.assert(treeElement);
+ if (!treeElement)
+ break;
+
+ if (treeElement.hidden)
+ return null;
+
+ var pathComponent = new WebInspector.GeneralTreeElementPathComponent(treeElement);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
+ pathComponents.unshift(pathComponent);
+ dataGridNode = dataGridNode.parent;
+ }
+
+ return pathComponents;
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ return this._dataGrid.treeElementMatchesActiveScopeFilters(treeElement);
+ },
+
+ reset: function()
+ {
+ WebInspector.TimelineView.prototype.reset.call(this);
+
+ this._dataGrid.reset();
+ },
+
+ // Protected
+
+ treeElementPathComponentSelected: function(event)
+ {
+ var dataGridNode = this._dataGrid.dataGridNodeForTreeElement(event.data.pathComponent.generalTreeElement);
+ if (!dataGridNode)
+ return;
+ dataGridNode.revealAndSelect();
+ },
+
+ dataGridNodeForTreeElement: function(treeElement)
+ {
+ if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
+ return new WebInspector.ProfileNodeDataGridNode(treeElement.profileNode, this.zeroTime, this.startTime, this.endTime);
+ return null;
+ },
+
+ populateProfileNodeTreeElement: function(treeElement)
+ {
+ var zeroTime = this.zeroTime;
+ var startTime = this.startTime;
+ var endTime = this.endTime;
+
+ for (var childProfileNode of treeElement.profileNode.childNodes) {
+ var profileNodeTreeElement = new WebInspector.ProfileNodeTreeElement(childProfileNode, this);
+ var profileNodeDataGridNode = new WebInspector.ProfileNodeDataGridNode(childProfileNode, zeroTime, startTime, endTime);
+ this._dataGrid.addRowInSortOrder(profileNodeTreeElement, profileNodeDataGridNode, treeElement);
+ }
+ },
+
+ // Private
+
+ _processPendingRecords: function()
+ {
+ if (!this._pendingRecords.length)
+ return;
+
+ for (var scriptTimelineRecord of this._pendingRecords) {
+ var rootNodes = [];
+ if (scriptTimelineRecord.profile) {
+ // FIXME: Support using the bottom-up tree once it is implemented.
+ rootNodes = scriptTimelineRecord.profile.topDownRootNodes;
+
+ // If there is only one node, promote its children. The TimelineRecordTreeElement already reflects the root
+ // node in this case (e.g. a "Load Event Dispatched" record with an "onload" root profile node).
+ // FIXME: Only do this for the top-down mode. Doing this for bottom-up would be incorrect.
+ if (rootNodes.length === 1)
+ rootNodes = rootNodes[0].childNodes;
+ }
+
+ var zeroTime = this.zeroTime;
+ var treeElement = new WebInspector.TimelineRecordTreeElement(scriptTimelineRecord, WebInspector.SourceCodeLocation.NameStyle.Short, rootNodes.length);
+ var dataGridNode = new WebInspector.ScriptTimelineDataGridNode(scriptTimelineRecord, zeroTime);
+
+ this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
+
+ var startTime = this.startTime;
+ var endTime = this.endTime;
+
+ for (var profileNode of rootNodes) {
+ var profileNodeTreeElement = new WebInspector.ProfileNodeTreeElement(profileNode, this);
+ var profileNodeDataGridNode = new WebInspector.ProfileNodeDataGridNode(profileNode, zeroTime, startTime, endTime);
+ this._dataGrid.addRowInSortOrder(profileNodeTreeElement, profileNodeDataGridNode, treeElement);
+ }
+ }
+
+ this._pendingRecords = [];
+ },
+
+ _scriptTimelineRecordAdded: function(event)
+ {
+ var scriptTimelineRecord = event.data.record;
+ console.assert(scriptTimelineRecord instanceof WebInspector.ScriptTimelineRecord);
+
+ this._pendingRecords.push(scriptTimelineRecord);
+
+ this.needsLayout();
+ },
+
+ _dataGridFiltersDidChange: function(event)
+ {
+ WebInspector.timelineSidebarPanel.updateFilter();
+ },
+
+ _dataGridNodeSelected: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (this._dataGrid.shouldIgnoreSelectionEvent())
+ return;
+
+ if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+ return;
+
+ if (treeElement instanceof WebInspector.FolderTreeElement)
+ return;
+
+ var sourceCodeLocation = null;
+ if (treeElement instanceof WebInspector.TimelineRecordTreeElement)
+ sourceCodeLocation = treeElement.record.sourceCodeLocation;
+ else if (treeElement instanceof WebInspector.ProfileNodeTreeElement)
+ sourceCodeLocation = treeElement.profileNode.sourceCodeLocation;
+ else
+ console.error("Unknown tree element selected.");
+
+ if (!sourceCodeLocation) {
+ WebInspector.timelineSidebarPanel.showTimelineView(WebInspector.TimelineRecord.Type.Script);
+ return;
+ }
+
+ WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceScriptTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ScriptTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ScriptTreeElement = function(script)
+{
+ console.assert(script instanceof WebInspector.Script);
+
+ WebInspector.SourceCodeTreeElement.call(this, script, WebInspector.ScriptTreeElement.StyleClassName, null, null, script, false);
+
+ this.mainTitle = script.displayName;
+
+ if (script.url) {
+ // Show the host as the subtitle if it is different from the main title.
+ var subtitle = WebInspector.displayNameForHost(script.urlComponents.host);
+ this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
+
+ this.tooltip = script.url;
+
+ this.addClassName(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ this.addClassName(WebInspector.Resource.Type.Script);
+ } else
+ this.addClassName(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
+
+ this._script = script;
+};
+
+WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName = "anonymous-script-icon";
+WebInspector.ScriptTreeElement.StyleClassName = "script";
+
+WebInspector.ScriptTreeElement.prototype = {
+ constructor: WebInspector.ScriptTreeElement,
+
+ // Public
+
+ get script()
+ {
+ return this._script;
+ }
+};
+
+WebInspector.ScriptTreeElement.prototype.__proto__ = WebInspector.SourceCodeTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchBarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceSearchBarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SearchBar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.search-bar > input[type="search"] {
+ margin: 1px 6px;
+
+ outline: none;
+
+ -webkit-appearance: none;
+
+ border: 1px solid rgba(0, 0, 0, 0.35);
+ border-radius: 10px;
+ background-color: rgba(255, 255, 255, 0.2);
+ box-shadow: inset rgba(0, 0, 0, 0.1) 0 1px 0;
+ background-clip: padding-box;
+
+ height: 19px;
+
+ transition: background-color 200ms ease-in-out;
+}
+
+.search-bar > input[type="search"]::-webkit-input-placeholder {
+ color: rgba(0, 0, 0, 0.35);
+}
+
+.search-bar > input[type="search"]:focus { background-color: white; }
+.search-bar > input[type="search"]:not(:placeholder-shown) { background-color: white; } /* Needs to be a separate rule. See http://webkit.org/b/118162 */
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSearchBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SearchBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SearchBar = function(identifier, placeholder, delegate) {
+ WebInspector.NavigationItem.call(this, identifier);
+
+ this.delegate = delegate;
+
+ this._element.classList.add(WebInspector.SearchBar.StyleClassName);
+
+ this._keyboardShortcutEsc = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Escape);
+ this._keyboardShortcutEnter = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Enter);
+
+ this._searchInput = this._element.appendChild(document.createElement("input"));
+ this._searchInput.type = "search";
+ this._searchInput.spellcheck = false;
+ this._searchInput.incremental = true;
+ this._searchInput.setAttribute("results", 5);
+ this._searchInput.setAttribute("autosave", identifier + "-autosave");
+ this._searchInput.setAttribute("placeholder", placeholder);
+ this._searchInput.addEventListener("search", this._handleSearchEvent.bind(this), false);
+ this._searchInput.addEventListener("keydown", this._handleKeydownEvent.bind(this), false);
+};
+
+WebInspector.SearchBar.StyleClassName = "search-bar";
+WebInspector.SearchBar.Event = {
+ TextChanged: "searchbar-text-did-change"
+};
+
+WebInspector.SearchBar.prototype = {
+ constructor: WebInspector.SearchBar,
+
+ // Public
+
+ get text()
+ {
+ return this._searchInput.value;
+ },
+
+ set text(newText)
+ {
+ this._searchInput.value = newText;
+ },
+
+ focus: function()
+ {
+ this._searchInput.focus();
+ this._searchInput.select();
+ },
+
+ // Private
+
+ _handleSearchEvent: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.SearchBar.Event.TextChanged);
+ },
+
+ _handleKeydownEvent: function(event)
+ {
+ if (this._keyboardShortcutEsc.matchesEvent(event)) {
+ if (this.delegate && typeof this.delegate.searchBarWantsToLoseFocus === "function") {
+ this.delegate.searchBarWantsToLoseFocus(this);
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ } else if (this._keyboardShortcutEnter.matchesEvent(event)) {
+ if (this.delegate && typeof this.delegate.searchBarDidActivate === "function") {
+ this.delegate.searchBarDidActivate(this);
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+ }
+};
+
+WebInspector.SearchBar.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceSearchIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SearchIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SearchIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.dom-match-element-icon .icon {
+ content: url(../Images/DOMElement.svg);
+}
+
+.dom-match-text-node-icon .icon {
+ content: url(../Images/DOMTextNode.svg);
+}
+
+.dom-match-comment-icon .icon {
+ content: url(../Images/DOMComment.svg);
+}
+
+.dom-match-document-type-icon .icon {
+ content: url(../Images/DOMDocumentType.svg);
+}
+
+.dom-match-character-data-icon .icon {
+ content: url(../Images/DOMCharacterData.svg);
+}
+
+.dom-match-node-icon .icon {
+ content: url(../Images/DOMNode.svg);
+}
+
+.resource-match-icon .icon {
+ content: url(../Images/ResultLine.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSearchResultTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSearchResultTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SearchResultTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SearchResultTreeElement = function(representedObject)
+{
+ console.assert(representedObject instanceof WebInspector.DOMSearchMatchObject || representedObject instanceof WebInspector.ResourceSearchMatchObject);
+
+ var title = WebInspector.SearchResultTreeElement.truncateAndHighlightTitle(representedObject.title, representedObject.searchTerm, representedObject.sourceCodeTextRange);
+
+ WebInspector.GeneralTreeElement.call(this, representedObject.className, title, null, representedObject, false);
+ this.small = true;
+};
+
+WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch = 15;
+WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch = 50;
+WebInspector.SearchResultTreeElement.HighlightedStyleClassName = "highlighted";
+
+WebInspector.SearchResultTreeElement.prototype = {
+ constructor: WebInspector.SearchResultTreeElement,
+
+ // Public
+
+ get filterableData()
+ {
+ return {text: this.representedObject.title};
+ }
+};
+
+WebInspector.SearchResultTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
+
+WebInspector.SearchResultTreeElement.truncateAndHighlightTitle = function(title, searchTerm, sourceCodeTextRange)
+{
+ // Use the original location, since those line/column offsets match the line text in title.
+ var textRange = sourceCodeTextRange.textRange;
+
+ var searchTermIndex = textRange.startColumn;
+
+ // We should only have one line text ranges, so make sure that is the case.
+ console.assert(textRange.startLine === textRange.endLine);
+
+ // Show some characters before the matching text (if there are enough) for context. TreeOutline takes care of the truncating
+ // at the end of the string.
+ var modifiedTitle = null;
+ if (searchTermIndex > WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch) {
+ modifiedTitle = "\u2026" + title.substring(searchTermIndex - WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch);
+ searchTermIndex = WebInspector.SearchResultTreeElement.CharactersToShowBeforeSearchMatch + 1;
+ } else
+ modifiedTitle = title;
+
+ // Truncate the tail of the title so the tooltip isn't so large.
+ modifiedTitle = modifiedTitle.trimEnd(searchTermIndex + searchTerm.length + WebInspector.SearchResultTreeElement.CharactersToShowAfterSearchMatch);
+
+ console.assert(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length).toLowerCase() === searchTerm.toLowerCase());
+
+ var highlightedTitle = document.createDocumentFragment();
+
+ highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(0, searchTermIndex)));
+
+ var highlightSpan = document.createElement("span");
+ highlightSpan.className = WebInspector.SearchResultTreeElement.HighlightedStyleClassName;
+ highlightSpan.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length)));
+ highlightedTitle.appendChild(highlightSpan);
+
+ highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex + searchTerm.length)));
+
+ return highlightedTitle;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSectioncssfromrev164541trunkSourceWebInspectorUIUserInterfaceSectioncss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Section.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Section.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Section.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Section.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.section {
+ position: relative;
+}
+
+.section .header {
+ color: black;
+ padding: 0 8px 0 18px;
+ min-height: 18px;
+ white-space: nowrap;
+ background-origin: padding;
+ background-clip: padding;
+}
+
+.section .header::before {
+ position: absolute;
+ top: 5px;
+ left: 7px;
+
+ width: 8px;
+ height: 8px;
+
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
+ background-size: 8px 8px;
+ background-repeat: no-repeat;
+
+ content: "";
+}
+
+.section.expanded .header::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
+}
+
+.section .header .title, .event-bar .header .title {
+ font-weight: normal;
+ word-wrap: break-word;
+ white-space: normal;
+ line-height: 18px;
+}
+
+.section .header .title.blank-title {
+ font-style: italic;
+}
+
+.section .header label, .event-bar .header label {
+ display: none;
+}
+
+.section.expanded .header label, .event-bar.expanded .header label {
+ display: inline;
+}
+
+.section .header .subtitle, .event-bar .header .subtitle {
+ float: right;
+ margin-left: 5px;
+ max-width: 55%;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.section .header .subtitle a {
+ color: inherit;
+}
+
+.section .properties, .event-bar .event-properties {
+ display: none;
+}
+
+.section.expanded .properties, .event-bar.expanded .event-properties {
+ display: block;
+ padding-left: 16px;
+}
+
+.section.expanded.no-header .properties {
+ padding-left: 0;
+}
+
+.section.no-affect .properties li {
+ opacity: 0.5;
+}
+
+.section.no-affect .properties li.editing {
+ opacity: 1.0;
+}
+
+.properties-tree {
+ margin: 0;
+ padding: 0 6px 2px;
+ list-style: none;
+ min-height: 18px;
+ outline: none;
+}
+
+.properties-tree li {
+ margin-left: 12px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ -webkit-user-select: text;
+ cursor: default;
+}
+
+.properties-tree li.parent {
+ margin-left: 1px;
+}
+
+.properties-tree li.parent::before {
+ float: left;
+
+ content: "";
+
+ background-image: -webkit-canvas(disclosure-triangle-tiny-closed-normal);
+ background-size: 8px 8px;
+ background-repeat: no-repeat;
+
+ width: 8px;
+ height: 8px;
+
+ margin-top: 3px;
+ padding-right: 2px;
+}
+
+.properties-tree li.parent.expanded::before {
+ background-image: -webkit-canvas(disclosure-triangle-tiny-open-normal);
+}
+
+.properties-tree li .info {
+ padding-top: 4px;
+ padding-bottom: 3px;
+}
+
+.properties-tree ol {
+ display: none;
+ margin: 0;
+ -webkit-padding-start: 12px;
+ list-style: none;
+}
+
+.properties-tree ol.expanded {
+ display: block;
+}
+
+.section .properties li.editing-sub-part {
+ padding: 3px 6px 8px 18px;
+ margin: -3px -6px -8px -6px;
+ text-overflow: clip;
+}
+
+.section .properties .name, .event-properties .name {
+ color: rgb(136, 19, 145);
+}
+
+.section .properties .dimmed {
+ opacity: 0.6;
+}
+
+.section .properties .value.error {
+ color: red;
+}
+
+.section .properties .number, .event-properties .number {
+ color: blue;
+}
+
+.section .properties .keyword, .event-properties .keyword {
+ color: rgb(136, 19, 79);
+}
+
+.section .properties .color, .event-properties .color {
+ color: rgb(118, 15, 21);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSectionjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSectionjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Section.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Section.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Section.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Section.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,227 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Section = function(title, subtitle)
+{
+ WebInspector.Object.call(this);
+
+ this.element = document.createElement("div");
+ this.element.className = "section";
+ this.element._section = this;
+
+ if (typeof title === "string" || title instanceof Node || typeof subtitle === "string") {
+ this.headerElement = document.createElement("div");
+ this.headerElement.className = "header";
+
+ this.titleElement = document.createElement("div");
+ this.titleElement.className = "title";
+
+ this.subtitleElement = document.createElement("div");
+ this.subtitleElement.className = "subtitle";
+
+ this.headerElement.appendChild(this.subtitleElement);
+ this.headerElement.appendChild(this.titleElement);
+
+ this.headerElement.addEventListener("click", this.handleClick.bind(this), false);
+ this.element.appendChild(this.headerElement);
+
+ this.title = title;
+ this.subtitle = subtitle;
+ } else
+ this.element.classList.add("no-header");
+
+ this._expanded = false;
+
+ if (!this.headerElement)
+ this.expand();
+};
+
+WebInspector.Section.Event = {
+ VisibleContentDidChange: "section-visible-content-did-change"
+};
+
+WebInspector.Section.prototype = {
+ get title()
+ {
+ return this._title;
+ },
+
+ set title(x)
+ {
+ if (this._title === x)
+ return;
+ this._title = x;
+
+ if (x instanceof Node) {
+ this.titleElement.removeChildren();
+ this.titleElement.appendChild(x);
+ } else
+ this.titleElement.textContent = x;
+ },
+
+ get subtitle()
+ {
+ return this._subtitle;
+ },
+
+ set subtitle(x)
+ {
+ if (this._subtitle === x)
+ return;
+ this._subtitle = x;
+ this.subtitleElement.textContent = x;
+ },
+
+ get subtitleAsTextForTest()
+ {
+ var result = this.subtitleElement.textContent;
+ var child = this.subtitleElement.querySelector("[data-uncopyable]");
+ if (child) {
+ var linkData = child.getAttribute("data-uncopyable");
+ if (linkData)
+ result += linkData;
+ }
+ return result;
+ },
+
+ get expanded()
+ {
+ return this._expanded;
+ },
+
+ set expanded(x)
+ {
+ if (x)
+ this.expand();
+ else
+ this.collapse();
+ },
+
+ get populated()
+ {
+ return this._populated;
+ },
+
+ set populated(x)
+ {
+ this._populated = x;
+ if (!x && this._expanded) {
+ this.onpopulate();
+ this._populated = true;
+ }
+ },
+
+ onpopulate: function()
+ {
+ // Overriden by subclasses.
+ },
+
+ get firstSibling()
+ {
+ var parent = this.element.parentElement;
+ if (!parent)
+ return null;
+
+ var childElement = parent.firstChild;
+ while (childElement) {
+ if (childElement._section)
+ return childElement._section;
+ childElement = childElement.nextSibling;
+ }
+
+ return null;
+ },
+
+ get lastSibling()
+ {
+ var parent = this.element.parentElement;
+ if (!parent)
+ return null;
+
+ var childElement = parent.lastChild;
+ while (childElement) {
+ if (childElement._section)
+ return childElement._section;
+ childElement = childElement.previousSibling;
+ }
+
+ return null;
+ },
+
+ get nextSibling()
+ {
+ var curElement = this.element;
+ do {
+ curElement = curElement.nextSibling;
+ } while (curElement && !curElement._section);
+
+ return curElement ? curElement._section : null;
+ },
+
+ get previousSibling()
+ {
+ var curElement = this.element;
+ do {
+ curElement = curElement.previousSibling;
+ } while (curElement && !curElement._section);
+
+ return curElement ? curElement._section : null;
+ },
+
+ expand: function()
+ {
+ if (this._expanded)
+ return;
+ this._expanded = true;
+ this.element.classList.add("expanded");
+
+ if (!this._populated) {
+ this.onpopulate();
+ this._populated = true;
+ } else
+ this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
+ },
+
+ collapse: function()
+ {
+ if (!this._expanded)
+ return;
+ this._expanded = false;
+ this.element.classList.remove("expanded");
+ },
+
+ toggleExpanded: function()
+ {
+ this.expanded = !this.expanded;
+ },
+
+ handleClick: function(e)
+ {
+ this.toggleExpanded();
+ e.stopPropagation();
+ }
+};
+
+WebInspector.Section.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSidebarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceSidebarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Sidebar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar {
+ position: relative;
+
+ background-color: rgb(227, 231, 235);
+}
+
+.sidebar.collapsed {
+ width: 0 !important;
+ border: none !important;
+}
+
+body.window-inactive .sidebar {
+ background-color: rgb(231, 231, 231);
+}
+
+.sidebar > .panel {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+
+ display: none;
+
+ overflow: hidden;
+
+ z-index: 0; /* Workaround so that scroll bars appear above position:sticky section headers. */
+}
+
+.sidebar > .panel.selected {
+ display: block;
+}
+
+.sidebar > .resizer {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 5px;
+
+ z-index: 100;
+
+ cursor: col-resize;
+}
+
+.sidebar.right > .resizer {
+ left: -3px;
+}
+
+.sidebar.left > .resizer {
+ right: -3px;
+}
+
+.sidebar.collapsed.right > .resizer {
+ left: -5px;
+}
+
+.sidebar.collapsed.left > .resizer {
+ right: -5px;
+}
+
+.sidebar.left {
+ border-right: 1px solid rgb(153, 153, 153);
+}
+
+.sidebar.right {
+ background-color: rgb(231, 231, 231);
+ border-left: 1px solid rgb(153, 153, 153);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSidebarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSidebarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Sidebar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,319 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Sidebar = function(element, side, sidebarPanels, role, label) {
+ WebInspector.Object.call(this);
+
+ console.assert(!side || side === WebInspector.Sidebar.Sides.Left || side === WebInspector.Sidebar.Sides.Right);
+ this._side = side || WebInspector.Sidebar.Sides.Left;
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.Sidebar.StyleClassName);
+ this._element.classList.add(WebInspector.Sidebar.CollapsedStyleClassName);
+ this._element.classList.add(this._side);
+
+ this._element.setAttribute("role", role || "group");
+ if (label)
+ this._element.setAttribute("aria-label", label);
+
+ this._resizeElement = document.createElement("div");
+ this._resizeElement.classList.add(WebInspector.Sidebar.ResizeElementStyleClassName);
+ this._resizeElement.addEventListener("mousedown", this._resizerMouseDown.bind(this), false);
+ this._resizeElement.addEventListener("dblclick", this._resizerDoubleClicked.bind(this), false);
+ this._element.insertBefore(this._resizeElement, this._element.firstChild);
+
+ this._sidebarPanels = [];
+
+ if (sidebarPanels) {
+ for (var i = 0; i < sidebarPanels.length; ++i)
+ this.addSidebarPanel(sidebarPanels[i]);
+ }
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Sidebar);
+
+WebInspector.Sidebar.StyleClassName = "sidebar";
+WebInspector.Sidebar.CollapsedStyleClassName = "collapsed";
+WebInspector.Sidebar.ResizeElementStyleClassName = "resizer";
+WebInspector.Sidebar.AbsoluteMinimumWidth = 200;
+
+WebInspector.Sidebar.Sides = {};
+WebInspector.Sidebar.Sides.Right = "right";
+WebInspector.Sidebar.Sides.Left = "left";
+
+WebInspector.Sidebar.Event = {
+ SidebarPanelSelected: "sidebar-sidebar-panel-selected",
+ CollapsedStateDidChange: "sidebar-sidebar-collapsed-state-did-change",
+ WidthDidChange: "sidebar-width-did-change",
+};
+
+WebInspector.Sidebar.prototype = {
+ constructor: WebInspector.Sidebar,
+
+ // Public
+
+ addSidebarPanel: function(sidebarPanel)
+ {
+ console.assert(sidebarPanel instanceof WebInspector.SidebarPanel);
+ if (!(sidebarPanel instanceof WebInspector.SidebarPanel))
+ return;
+
+ console.assert(!sidebarPanel.parentSidebar);
+ if (sidebarPanel.parentSidebar)
+ return;
+
+ sidebarPanel._parentSidebar = this;
+
+ this._sidebarPanels.push(sidebarPanel);
+ this._element.appendChild(sidebarPanel.element);
+
+ sidebarPanel.added();
+
+ return sidebarPanel;
+ },
+
+ removeSidebarPanel: function(sidebarPanelOrIdentifierOrIndex, index)
+ {
+ var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
+ if (!sidebarPanel)
+ return;
+
+ sidebarPanel.willRemove();
+
+ sidebarPanel._parentSidebar = null;
+
+ if (this._selectedSidebarPanel === sidebarPanel) {
+ var index = this._sidebarPanels.indexOf(sidebarPanel);
+ this.selectedSidebarPanel = this._sidebarPanels[index - 1] || this._sidebarPanels[index + 1];
+ }
+
+ this._sidebarPanels.remove(sidebarPanel);
+ this._element.removeChild(sidebarPanel.element);
+
+ sidebarPanel.removed();
+
+ return sidebarPanel;
+ },
+
+ get selectedSidebarPanel()
+ {
+ return this._selectedSidebarPanel || null;
+ },
+
+ set selectedSidebarPanel(sidebarPanelOrIdentifierOrIndex)
+ {
+ var sidebarPanel = this.findSidebarPanel(sidebarPanelOrIdentifierOrIndex);
+ if (this._selectedSidebarPanel === sidebarPanel)
+ return;
+
+ if (this._selectedSidebarPanel) {
+ var wasVisible = this._selectedSidebarPanel.visible;
+
+ this._selectedSidebarPanel.selected = false;
+
+ if (wasVisible) {
+ this._selectedSidebarPanel.hidden();
+ this._selectedSidebarPanel.visibilityDidChange();
+ }
+ }
+
+ this._selectedSidebarPanel = sidebarPanel || null;
+
+ if (this._selectedSidebarPanel) {
+ this._selectedSidebarPanel.selected = true;
+
+ if (this._selectedSidebarPanel.visible) {
+ this._selectedSidebarPanel.shown();
+ this._selectedSidebarPanel.visibilityDidChange();
+ }
+ }
+
+ this.dispatchEventToListeners(WebInspector.Sidebar.Event.SidebarPanelSelected);
+ },
+
+ get minimumWidth()
+ {
+ return WebInspector.Sidebar.AbsoluteMinimumWidth;
+ },
+
+ get maximumWidth()
+ {
+ // FIXME: This is kind of arbitrary and ideally would be a more complex calculation based on the
+ // available space for the sibling elements.
+ return Math.round(window.innerWidth / 3);
+ },
+
+ get width()
+ {
+ return this._element.offsetWidth;
+ },
+
+ set width(newWidth)
+ {
+ if (newWidth === this.width)
+ return;
+
+ newWidth = Math.max(this.minimumWidth, Math.min(newWidth, this.maximumWidth));
+
+ this._element.style.width = newWidth + "px";
+
+ if (!this.collapsed && this._selectedSidebarPanel)
+ this._selectedSidebarPanel.widthDidChange();
+
+ this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange);
+ },
+
+ get collapsed()
+ {
+ return this._element.classList.contains(WebInspector.Sidebar.CollapsedStyleClassName);
+ },
+
+ set collapsed(flag)
+ {
+ if (flag === this.collapsed)
+ return;
+
+ if (flag)
+ this._element.classList.add(WebInspector.Sidebar.CollapsedStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.Sidebar.CollapsedStyleClassName);
+
+ if (this._selectedSidebarPanel) {
+ if (this._selectedSidebarPanel.visible)
+ this._selectedSidebarPanel.shown();
+ else
+ this._selectedSidebarPanel.hidden();
+
+ this._selectedSidebarPanel.visibilityDidChange();
+
+ this._selectedSidebarPanel.widthDidChange();
+ }
+
+ this.dispatchEventToListeners(WebInspector.Sidebar.Event.CollapsedStateDidChange);
+ this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange);
+ },
+
+ get sidebarPanels()
+ {
+ return this._sidebarPanels;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get side()
+ {
+ return this._side;
+ },
+
+ findSidebarPanel: function(sidebarPanelOrIdentifierOrIndex)
+ {
+ var sidebarPanel = null;
+
+ if (sidebarPanelOrIdentifierOrIndex instanceof WebInspector.SidebarPanel) {
+ if (this._sidebarPanels.contains(sidebarPanelOrIdentifierOrIndex))
+ sidebarPanel = sidebarPanelOrIdentifierOrIndex;
+ } else if (typeof sidebarPanelOrIdentifierOrIndex === "number") {
+ sidebarPanel = this._sidebarPanels[sidebarPanelOrIdentifierOrIndex];
+ } else if (typeof sidebarPanelOrIdentifierOrIndex === "string") {
+ for (var i = 0; i < this._sidebarPanels.length; ++i) {
+ if (this._sidebarPanels[i].identifier === sidebarPanelOrIdentifierOrIndex) {
+ sidebarPanel = this._sidebarPanels[i];
+ break;
+ }
+ }
+ }
+
+ return sidebarPanel;
+ },
+
+ // Private
+
+ _navigationItemSelected: function(event)
+ {
+ this.selectedSidebarPanel = event.target.selectedNavigationItem ? event.target.selectedNavigationItem.identifier : null;
+ },
+
+ _resizerDoubleClicked: function(event)
+ {
+ this.collapsed = !this.collapsed;
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _resizerMouseDown: function(event)
+ {
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ document.body.style.cursor = "col-resize";
+
+ this._resizerMouseMovedEventListener = this._resizerMouseMoved.bind(this);
+ this._resizerMouseUpEventListener = this._resizerMouseUp.bind(this);
+
+ // Register these listeners on the document so we can track the mouse if it leaves the resizer.
+ document.addEventListener("mousemove", this._resizerMouseMovedEventListener, false);
+ document.addEventListener("mouseup", this._resizerMouseUpEventListener, false);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _resizerMouseMoved: function(event)
+ {
+ if (this._side === WebInspector.Sidebar.Sides.Left)
+ var newWidth = event.pageX - this._element.totalOffsetLeft;
+ else
+ var newWidth = this._element.totalOffsetLeft + this._element.offsetWidth - event.pageX;
+
+ this.width = newWidth;
+ this.collapsed = (newWidth < (this.minimumWidth / 2));
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _resizerMouseUp: function(event)
+ {
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ document.body.style.removeProperty("cursor");
+
+ document.removeEventListener("mousemove", this._resizerMouseMovedEventListener, false);
+ document.removeEventListener("mouseup", this._resizerMouseUpEventListener, false);
+
+ delete this._resizerMouseMovedEventListener;
+ delete this._resizerMouseUpEventListener;
+
+ event.preventDefault();
+ event.stopPropagation();
+ }
+};
+
+WebInspector.Sidebar.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,156 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SidebarPanel = function(identifier, displayName, showToolTip, hideToolTip, image, element, role, label) {
+ WebInspector.Object.call(this);
+
+ this._identifier = identifier;
+
+ this._toolbarItem = new WebInspector.ActivateButtonToolbarItem(identifier, showToolTip, hideToolTip, displayName, image, null, "tab");
+ this._toolbarItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this.toggle, this);
+ this._toolbarItem.enabled = false;
+
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.SidebarPanel.StyleClassName);
+ this._element.classList.add(identifier);
+
+ this._element.setAttribute("role", role || "group");
+ this._element.setAttribute("aria-label", label || displayName);
+
+};
+
+WebInspector.SidebarPanel.StyleClassName = "panel";
+WebInspector.SidebarPanel.SelectedStyleClassName = "selected";
+
+WebInspector.SidebarPanel.prototype = {
+ constructor: WebInspector.SidebarPanel,
+
+ // Public
+
+ get identifier()
+ {
+ return this._identifier;
+ },
+
+ get toolbarItem()
+ {
+ return this._toolbarItem;
+ },
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get visible()
+ {
+ return this.selected && this._parentSidebar && !this._parentSidebar.collapsed;
+ },
+
+ get selected()
+ {
+ return this._element.classList.contains(WebInspector.SidebarPanel.SelectedStyleClassName);
+ },
+
+ set selected(flag)
+ {
+ if (flag)
+ this._element.classList.add(WebInspector.SidebarPanel.SelectedStyleClassName);
+ else
+ this._element.classList.remove(WebInspector.SidebarPanel.SelectedStyleClassName);
+ },
+
+ get parentSidebar()
+ {
+ return this._parentSidebar;
+ },
+
+ show: function()
+ {
+ if (!this._parentSidebar)
+ return;
+
+ this._parentSidebar.collapsed = false;
+ this._parentSidebar.selectedSidebarPanel = this;
+ },
+
+ hide: function()
+ {
+ if (!this._parentSidebar)
+ return;
+
+ this._parentSidebar.collapsed = true;
+ this._parentSidebar.selectedSidebarPanel = null;
+ },
+
+ toggle: function()
+ {
+ if (this.visible)
+ this.hide();
+ else
+ this.show();
+ },
+
+ added: function()
+ {
+ console.assert(this._parentSidebar);
+ this._toolbarItem.enabled = true;
+ this._toolbarItem.activated = this.visible;
+ },
+
+ removed: function()
+ {
+ console.assert(!this._parentSidebar);
+ this._toolbarItem.enabled = false;
+ this._toolbarItem.activated = false;
+ },
+
+ willRemove: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ shown: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ hidden: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ widthDidChange: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ visibilityDidChange: function()
+ {
+ this._toolbarItem.activated = this.visible;
+ }
+};
+
+WebInspector.SidebarPanel.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSlidercssfromrev164541trunkSourceWebInspectorUIUserInterfaceSlidercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Slider.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Slider.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Slider.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Slider.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.slider {
+ position: relative;
+ height: 11px;
+ outline: 1px solid rgb(148, 148, 148);
+ border: 1px solid white;
+}
+
+.slider > img {
+ position: absolute;
+ left: -5px;
+ top: -5px;
+ width: 14px;
+ height: 17px;
+ content: -webkit-image-set(url(../Images/SliderThumb.png) 1x, url(../Images/SliderThumb@2x.png) 2x);
+}
+
+.slider > img.dragging {
+ content: -webkit-image-set(url(../Images/SliderThumbPressed.png) 1x, url(../Images/SliderThumbPressed@2x.png) 2x);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSliderjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSliderjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Slider.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Slider = function()
+{
+ this._element = document.createElement("div");
+ this._element.className = "slider";
+
+ this._knob = this._element.appendChild(document.createElement("img"));
+
+ this._value = 0;
+ this._knobX = 0;
+ this.__maxX = 0;
+
+ this._element.addEventListener("mousedown", this);
+};
+
+WebInspector.Slider.KnobWidth = 13;
+
+WebInspector.Slider.prototype = {
+ contructor: WebInspector.Slider,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get value()
+ {
+ return this._value;
+ },
+
+ set value(value)
+ {
+ value = Math.max(Math.min(value, 1), 0);
+
+ if (value === this._value)
+ return;
+
+ this._value = value;
+
+ this._knobX = Math.round(value * this._maxX);
+ this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)";
+
+ if (this.delegate && typeof this.delegate.sliderValueDidChange === "function")
+ this.delegate.sliderValueDidChange(this, value);
+ },
+
+ // Protected
+
+ handleEvent: function(event)
+ {
+ switch (event.type) {
+ case "mousedown":
+ this._handleMousedown(event);
+ break;
+ case "mousemove":
+ this._handleMousemove(event);
+ break;
+ case "mouseup":
+ this._handleMouseup(event);
+ break;
+ }
+ },
+
+ // Private
+
+ _handleMousedown: function(event)
+ {
+ if (event.target !== this._knob)
+ this.value = (this._localPointForEvent(event).x - 3) / this._maxX;
+
+ this._startKnobX = this._knobX;
+ this._startMouseX = this._localPointForEvent(event).x;
+
+ this._element.classList.add("dragging");
+
+ window.addEventListener("mousemove", this, true);
+ window.addEventListener("mouseup", this, true);
+ },
+
+ _handleMousemove: function(event)
+ {
+ var dx = this._localPointForEvent(event).x - this._startMouseX;
+ var x = Math.max(Math.min(this._startKnobX + dx, this._maxX), 0);
+
+ this.value = x / this._maxX;
+ },
+
+ _handleMouseup: function(event)
+ {
+ this._element.classList.remove("dragging");
+
+ window.removeEventListener("mousemove", this, true);
+ window.removeEventListener("mouseup", this, true);
+ },
+
+ _localPointForEvent: function(event)
+ {
+ // We convert all event coordinates from page coordinates to local coordinates such that the slider
+ // may be transformed using CSS Transforms and interaction works as expected.
+ return window.webkitConvertPointFromPageToNode(this._element, new WebKitPoint(event.pageX, event.pageY));
+ },
+
+ get _maxX()
+ {
+ if (this.__maxX == 0 && document.body.contains(this._element))
+ this.__maxX = this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2);
+
+ return this.__maxX;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorcssfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.source-code.text-editor > .CodeMirror .error {
+ background-color: rgb(255, 220, 208);
+}
+
+.source-code.text-editor > .CodeMirror .warning {
+ background-color: rgb(253, 249, 226);
+}
+
+.popover .debugger-popover-content {
+ font-family: monospace;
+ white-space: pre;
+}
+
+.popover .expandable {
+ min-width: 300px;
+ min-height: 250px;
+}
+
+.popover .debugger-popover-content .title {
+ font-weight: bold;
+ padding-left: 10px;
+
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.popover .debugger-popover-content .body {
+ border-top: 1px solid rgb(194, 194, 147);
+ overflow: auto;
+ margin-top: 5px;
+ padding-top: 5px;
+}
+
+.popover .debugger-popover-content.function .body {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+/* Custom styling for the hover menu attached to color tokens */
+
+.hover-menu.color {
+ padding-right: 15px;
+}
+
+.hover-menu.color > img {
+ width: 16px;
+ height: 16px;
+ content: -webkit-image-set(url(../Images/ColorIcon.png) 1x, url(../Images/ColorIcon@2x.png) 2x);
+
+ -webkit-transform: translateY(1px);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTextEditorjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTextEditor.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1359 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTextEditor = function(sourceCode)
+{
+ console.assert(sourceCode instanceof WebInspector.SourceCode);
+
+ this._sourceCode = sourceCode;
+ this._breakpointMap = {};
+ this._issuesLineNumberMap = {};
+ this._contentPopulated = false;
+ this._invalidLineNumbers = {0: true};
+ this._ignoreContentDidChange = 0;
+
+ WebInspector.TextEditor.call(this, null, null, this);
+
+ // FIXME: Currently this just jumps between resources and related source map resources. It doesn't "jump to symbol" yet.
+ this._updateTokenTrackingControllerState();
+
+ this.element.classList.add(WebInspector.SourceCodeTextEditor.StyleClassName);
+
+ if (this._supportsDebugging) {
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this);
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this);
+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
+ if (WebInspector.debuggerManager.activeCallFrame)
+ this._debuggerDidPause();
+
+ this._activeCallFrameDidChange();
+ }
+
+ WebInspector.issueManager.addEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
+
+ if (this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length > 0)
+ WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
+ else
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+
+ sourceCode.requestContent(this._contentAvailable.bind(this));
+
+ // FIXME: Cmd+L shorcut doesn't actually work.
+ new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Command, "L", this.showGoToLineDialog.bind(this), this.element);
+ new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, "G", this.showGoToLineDialog.bind(this), this.element);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.SourceCodeTextEditor);
+
+WebInspector.SourceCodeTextEditor.StyleClassName = "source-code";
+WebInspector.SourceCodeTextEditor.LineErrorStyleClassName = "error";
+WebInspector.SourceCodeTextEditor.LineWarningStyleClassName = "warning";
+WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName = "debugger-popover-content";
+WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName = "hovered-expression-highlight";
+WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken = 500;
+WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease = 1000;
+
+WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength = 500;
+
+WebInspector.SourceCodeTextEditor.Event = {
+ ContentWillPopulate: "source-code-text-editor-content-will-populate",
+ ContentDidPopulate: "source-code-text-editor-content-did-populate"
+};
+
+WebInspector.SourceCodeTextEditor.prototype = {
+ constructor: WebInspector.SourceCodeTextEditor,
+
+ // Public
+
+ get sourceCode()
+ {
+ return this._sourceCode;
+ },
+
+ hidden: function()
+ {
+ WebInspector.TextEditor.prototype.hidden.call(this);
+
+ this.tokenTrackingController.removeHighlightedRange();
+
+ this._dismissPopover();
+
+ this._dismissEditingController(true);
+ },
+
+ close: function()
+ {
+ if (this._supportsDebugging) {
+ WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.DisabledStateDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.AutoContinueDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._updateBreakpointStatus, this);
+ WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.LocationDidChange, this._updateBreakpointLocation, this);
+
+ WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointAdded, this._breakpointAdded, this);
+ WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.BreakpointRemoved, this._breakpointRemoved, this);
+ WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, this._activeCallFrameDidChange, this);
+
+ if (this._activeCallFrameSourceCodeLocation) {
+ this._activeCallFrameSourceCodeLocation.removeEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
+ delete this._activeCallFrameSourceCodeLocation;
+ }
+ }
+
+ WebInspector.issueManager.removeEventListener(WebInspector.IssueManager.Event.IssueWasAdded, this._issueWasAdded, this);
+
+ WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
+ this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+ },
+
+ canBeFormatted: function()
+ {
+ // Currently we assume that source map resources are formatted how the author wants it.
+ // We could allow source map resources to be formatted, we would then need to make
+ // SourceCodeLocation watch listen for mappedResource's formatting changes, and keep
+ // a formatted location alongside the regular mapped location.
+ if (this._sourceCode instanceof WebInspector.SourceMapResource)
+ return false;
+
+ return WebInspector.TextEditor.prototype.canBeFormatted.call(this);
+ },
+
+ customPerformSearch: function(query)
+ {
+ function searchResultCallback(error, matches)
+ {
+ // Bail if the query changed since we started.
+ if (this.currentSearchQuery !== query)
+ return;
+
+ if (error || !matches || !matches.length) {
+ // Report zero matches.
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
+ return;
+ }
+
+ var queryRegex = new RegExp(query.escapeForRegExp(), "gi");
+ var searchResults = [];
+
+ for (var i = 0; i < matches.length; ++i) {
+ var matchLineNumber = matches[i].lineNumber;
+ var line = this.line(matchLineNumber);
+
+ // Reset the last index to reuse the regex on a new line.
+ queryRegex.lastIndex = 0;
+
+ // Search the line and mark the ranges.
+ var lineMatch = null;
+ while (queryRegex.lastIndex + query.length <= line.length && (lineMatch = queryRegex.exec(line))) {
+ var resultTextRange = new WebInspector.TextRange(matchLineNumber, lineMatch.index, matchLineNumber, queryRegex.lastIndex);
+ searchResults.push(resultTextRange);
+ }
+ }
+
+ this.addSearchResults(searchResults);
+
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
+ }
+
+ if (this._sourceCode instanceof WebInspector.SourceMapResource)
+ return false;
+
+ if (this._sourceCode instanceof WebInspector.Resource)
+ PageAgent.searchInResource(this._sourceCode.parentFrame.id, this._sourceCode.url, query, false, false, searchResultCallback.bind(this));
+ else if (this._sourceCode instanceof WebInspector.Script)
+ DebuggerAgent.searchInContent(this._sourceCode.id, query, false, false, searchResultCallback.bind(this));
+ return true;
+ },
+
+ showGoToLineDialog: function()
+ {
+ if (!this._goToLineDialog) {
+ this._goToLineDialog = new WebInspector.GoToLineDialog;
+ this._goToLineDialog.delegate = this;
+ }
+
+ this._goToLineDialog.present(this.element);
+ },
+
+ isGoToLineDialogValueValid: function(goToLineDialog, lineNumber)
+ {
+ return !isNaN(lineNumber) && lineNumber > 0 && lineNumber <= this.lineCount;
+ },
+
+ goToLineDialogValueWasValidated: function(goToLineDialog, lineNumber)
+ {
+ var position = new WebInspector.SourceCodePosition(lineNumber - 1, 0);
+ var range = new WebInspector.TextRange(lineNumber - 1, 0, lineNumber, 0);
+ this.revealPosition(position, range, false, true);
+ },
+
+ goToLineDialogWasDismissed: function()
+ {
+ this.focus();
+ },
+
+ contentDidChange: function(replacedRanges, newRanges)
+ {
+ WebInspector.TextEditor.prototype.contentDidChange.call(this, replacedRanges, newRanges);
+
+ if (this._ignoreContentDidChange > 0)
+ return;
+
+ for (var range of newRanges)
+ this._updateEditableMarkers(range);
+ },
+
+ // Private
+
+ _unformattedLineInfoForEditorLineInfo: function(lineInfo)
+ {
+ if (this.formatterSourceMap)
+ return this.formatterSourceMap.formattedToOriginal(lineInfo.lineNumber, lineInfo.columnNumber);
+ return lineInfo;
+ },
+
+ _sourceCodeLocationForEditorPosition: function(position)
+ {
+ var lineInfo = {lineNumber: position.line, columnNumber: position.ch};
+ var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(lineInfo);
+ return this.sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
+ },
+
+ _editorLineInfoForSourceCodeLocation: function(sourceCodeLocation)
+ {
+ if (this._sourceCode instanceof WebInspector.SourceMapResource)
+ return {lineNumber: sourceCodeLocation.displayLineNumber, columnNumber: sourceCodeLocation.displayColumnNumber};
+ return {lineNumber: sourceCodeLocation.formattedLineNumber, columnNumber: sourceCodeLocation.formattedColumnNumber};
+ },
+
+ _breakpointForEditorLineInfo: function(lineInfo)
+ {
+ if (!this._breakpointMap[lineInfo.lineNumber])
+ return null;
+ return this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber];
+ },
+
+ _addBreakpointWithEditorLineInfo: function(breakpoint, lineInfo)
+ {
+ if (!this._breakpointMap[lineInfo.lineNumber])
+ this._breakpointMap[lineInfo.lineNumber] = {};
+
+ this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber] = breakpoint;
+ },
+
+ _removeBreakpointWithEditorLineInfo: function(breakpoint, lineInfo)
+ {
+ console.assert(breakpoint === this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber]);
+
+ delete this._breakpointMap[lineInfo.lineNumber][lineInfo.columnNumber];
+
+ if (isEmptyObject(this._breakpointMap[lineInfo.lineNumber]))
+ delete this._breakpointMap[lineInfo.lineNumber];
+ },
+
+ _contentWillPopulate: function(content)
+ {
+ this.dispatchEventToListeners(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate);
+
+ // We only do the rest of this work before the first populate.
+ if (this._contentPopulated)
+ return;
+
+ if (this._supportsDebugging) {
+ this._breakpointMap = {};
+
+ var breakpoints = WebInspector.debuggerManager.breakpointsForSourceCode(this._sourceCode);
+ for (var i = 0; i < breakpoints.length; ++i) {
+ var breakpoint = breakpoints[i];
+ console.assert(this._matchesBreakpoint(breakpoint));
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
+ this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
+ }
+ }
+
+ if (this._sourceCode instanceof WebInspector.Resource)
+ this.mimeType = this._sourceCode.syntheticMIMEType;
+ else if (this._sourceCode instanceof WebInspector.Script)
+ this.mimeType = "text/javascript";
+
+ // Automatically format the content if it looks minified and it can be formatted.
+ console.assert(!this.formatted);
+ if (this.canBeFormatted()) {
+ var lastNewlineIndex = 0;
+ while (true) {
+ var nextNewlineIndex = content.indexOf("\n", lastNewlineIndex);
+ if (nextNewlineIndex === -1) {
+ if (content.length - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength)
+ this.autoFormat = true;
+ break;
+ }
+
+ if (nextNewlineIndex - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength) {
+ this.autoFormat = true;
+ break;
+ }
+
+ lastNewlineIndex = nextNewlineIndex + 1;
+ }
+ }
+ },
+
+ _contentDidPopulate: function()
+ {
+ this._contentPopulated = true;
+
+ this.dispatchEventToListeners(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate);
+
+ // We add the issues each time content is populated. This is needed because lines might not exist
+ // if we tried added them before when the full content wasn't avaiable. (When populating with
+ // partial script content this can be called multiple times.)
+
+ this._issuesLineNumberMap = {};
+
+ var issues = WebInspector.issueManager.issuesForSourceCode(this._sourceCode);
+ for (var i = 0; i < issues.length; ++i) {
+ var issue = issues[i];
+ console.assert(this._matchesIssue(issue));
+ this._addIssue(issue);
+ }
+
+ this._updateEditableMarkers();
+ },
+
+ _populateWithContent: function(content)
+ {
+ content = content || "";
+
+ this._contentWillPopulate(content);
+ this.string = content;
+ this._contentDidPopulate();
+ },
+
+ _contentAvailable: function(sourceCode, content, base64Encoded)
+ {
+ console.assert(sourceCode === this._sourceCode);
+ console.assert(!base64Encoded);
+
+ // Abort if the full content populated while waiting for this async callback.
+ if (this._fullContentPopulated)
+ return;
+
+ this._fullContentPopulated = true;
+ this._invalidLineNumbers = {};
+
+ this._populateWithContent(content);
+ },
+
+ _updateBreakpointStatus: function(event)
+ {
+ console.assert(this._supportsDebugging);
+
+ if (!this._contentPopulated)
+ return;
+
+ var breakpoint = event.target;
+ if (!this._matchesBreakpoint(breakpoint))
+ return;
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
+ },
+
+ _updateBreakpointLocation: function(event)
+ {
+ console.assert(this._supportsDebugging);
+
+ if (!this._contentPopulated)
+ return;
+
+ var breakpoint = event.target;
+ if (!this._matchesBreakpoint(breakpoint))
+ return;
+
+ if (this._ignoreAllBreakpointLocationUpdates)
+ return;
+
+ if (breakpoint === this._ignoreLocationUpdateBreakpoint)
+ return;
+
+ var sourceCodeLocation = breakpoint.sourceCodeLocation;
+
+ if (this._sourceCode instanceof WebInspector.SourceMapResource) {
+ // Update our breakpoint location if the display location changed.
+ if (sourceCodeLocation.displaySourceCode !== this._sourceCode)
+ return;
+ var oldLineInfo = {lineNumber: event.data.oldDisplayLineNumber, columnNumber: event.data.oldDisplayColumnNumber};
+ var newLineInfo = {lineNumber: sourceCodeLocation.displayLineNumber, columnNumber: sourceCodeLocation.displayColumnNumber};
+ } else {
+ // Update our breakpoint location if the original location changed.
+ if (sourceCodeLocation.sourceCode !== this._sourceCode)
+ return;
+ var oldLineInfo = {lineNumber: event.data.oldFormattedLineNumber, columnNumber: event.data.oldFormattedColumnNumber};
+ var newLineInfo = {lineNumber: sourceCodeLocation.formattedLineNumber, columnNumber: sourceCodeLocation.formattedColumnNumber};
+ }
+
+ var existingBreakpoint = this._breakpointForEditorLineInfo(oldLineInfo);
+ if (!existingBreakpoint)
+ return;
+
+ console.assert(breakpoint === existingBreakpoint);
+
+ this.setBreakpointInfoForLineAndColumn(oldLineInfo.lineNumber, oldLineInfo.columnNumber, null);
+ this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
+
+ this._removeBreakpointWithEditorLineInfo(breakpoint, oldLineInfo);
+ this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo);
+ },
+
+ _breakpointAdded: function(event)
+ {
+ console.assert(this._supportsDebugging);
+
+ if (!this._contentPopulated)
+ return;
+
+ var breakpoint = event.data.breakpoint;
+ if (!this._matchesBreakpoint(breakpoint))
+ return;
+
+ if (breakpoint === this._ignoreBreakpointAddedBreakpoint)
+ return;
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
+ this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
+ },
+
+ _breakpointRemoved: function(event)
+ {
+ console.assert(this._supportsDebugging);
+
+ if (!this._contentPopulated)
+ return;
+
+ var breakpoint = event.data.breakpoint;
+ if (!this._matchesBreakpoint(breakpoint))
+ return;
+
+ if (breakpoint === this._ignoreBreakpointRemovedBreakpoint)
+ return;
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._removeBreakpointWithEditorLineInfo(breakpoint, lineInfo);
+ this.setBreakpointInfoForLineAndColumn(lineInfo.lineNumber, lineInfo.columnNumber, null);
+ },
+
+ _activeCallFrameDidChange: function()
+ {
+ console.assert(this._supportsDebugging);
+
+ if (this._activeCallFrameSourceCodeLocation) {
+ this._activeCallFrameSourceCodeLocation.removeEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
+ delete this._activeCallFrameSourceCodeLocation;
+ }
+
+ var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
+ if (!activeCallFrame || !this._matchesSourceCodeLocation(activeCallFrame.sourceCodeLocation)) {
+ this.executionLineNumber = NaN;
+ this.executionColumnNumber = NaN;
+ return;
+ }
+
+ this._dismissPopover();
+
+ this._activeCallFrameSourceCodeLocation = activeCallFrame.sourceCodeLocation;
+ this._activeCallFrameSourceCodeLocation.addEventListener(WebInspector.SourceCodeLocation.Event.LocationChanged, this._activeCallFrameSourceCodeLocationChanged, this);
+
+ // Don't return early if the line number didn't change. The execution state still
+ // could have changed (e.g. continuing in a loop with a breakpoint inside).
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(activeCallFrame.sourceCodeLocation);
+ this.executionLineNumber = lineInfo.lineNumber;
+ this.executionColumnNumber = lineInfo.columnNumber;
+
+ // If we have full content or this source code isn't a Resource we can return early.
+ // Script source code populates from the request started in the constructor.
+ if (this._fullContentPopulated || !(this._sourceCode instanceof WebInspector.Resource) || this._requestingScriptContent)
+ return;
+
+ // Since we are paused in the debugger we need to show some content, and since the Resource
+ // content hasn't populated yet we need to populate with content from the Scripts by URL.
+ // Document resources will attempt to populate the scripts as inline (in <script> tags.)
+ // Other resources are assumed to be full scripts (JavaScript resources).
+ if (this._sourceCode.type === WebInspector.Resource.Type.Document)
+ this._populateWithInlineScriptContent();
+ else
+ this._populateWithScriptContent();
+ },
+
+ _activeCallFrameSourceCodeLocationChanged: function(event)
+ {
+ console.assert(!isNaN(this.executionLineNumber));
+ if (isNaN(this.executionLineNumber))
+ return;
+
+ console.assert(WebInspector.debuggerManager.activeCallFrame);
+ console.assert(this._activeCallFrameSourceCodeLocation === WebInspector.debuggerManager.activeCallFrame.sourceCodeLocation);
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(this._activeCallFrameSourceCodeLocation);
+ this.executionLineNumber = lineInfo.lineNumber;
+ this.executionColumnNumber = lineInfo.columnNumber;
+ },
+
+ _populateWithInlineScriptContent: function()
+ {
+ console.assert(this._sourceCode instanceof WebInspector.Resource);
+ console.assert(!this._fullContentPopulated);
+ console.assert(!this._requestingScriptContent);
+
+ var scripts = this._sourceCode.scripts;
+ console.assert(scripts.length);
+ if (!scripts.length)
+ return;
+
+ var pendingRequestCount = scripts.length;
+
+ // If the number of scripts hasn't change since the last populate, then there is nothing to do.
+ if (this._inlineScriptContentPopulated === pendingRequestCount)
+ return;
+
+ this._inlineScriptContentPopulated = pendingRequestCount;
+
+ function scriptContentAvailable(error, content)
+ {
+ // Return early if we are still waiting for content from other scripts.
+ if (--pendingRequestCount)
+ return;
+
+ delete this._requestingScriptContent;
+
+ // Abort if the full content populated while waiting for these async callbacks.
+ if (this._fullContentPopulated)
+ return;
+
+ const scriptOpenTag = "<script>";
+ const scriptCloseTag = "</script>";
+
+ var content = "";
+ var lineNumber = 0;
+ var columnNumber = 0;
+
+ this._invalidLineNumbers = {};
+
+ for (var i = 0; i < scripts.length; ++i) {
+ // Fill the line gap with newline characters.
+ for (var newLinesCount = scripts[i].range.startLine - lineNumber; newLinesCount > 0; --newLinesCount) {
+ if (!columnNumber)
+ this._invalidLineNumbers[scripts[i].range.startLine - newLinesCount] = true;
+ columnNumber = 0;
+ content += "\n";
+ }
+
+ // Fill the column gap with space characters.
+ for (var spacesCount = scripts[i].range.startColumn - columnNumber - scriptOpenTag.length; spacesCount > 0; --spacesCount)
+ content += " ";
+
+ // Add script tags and content.
+ content += scriptOpenTag;
+ content += scripts[i].content;
+ content += scriptCloseTag;
+
+ lineNumber = scripts[i].range.endLine;
+ columnNumber = scripts[i].range.endColumn + scriptCloseTag.length;
+ }
+
+ this._populateWithContent(content);
+ }
+
+ this._requestingScriptContent = true;
+
+ var boundScriptContentAvailable = scriptContentAvailable.bind(this);
+ for (var i = 0; i < scripts.length; ++i)
+ scripts[i].requestContent(boundScriptContentAvailable);
+ },
+
+ _populateWithScriptContent: function()
+ {
+ console.assert(this._sourceCode instanceof WebInspector.Resource);
+ console.assert(!this._fullContentPopulated);
+ console.assert(!this._requestingScriptContent);
+
+ // We can assume this resource only has one script that starts at line/column 0.
+ var scripts = this._sourceCode.scripts;
+ console.assert(scripts.length === 1);
+ if (!scripts.length)
+ return;
+
+ console.assert(scripts[0].range.startLine === 0);
+ console.assert(scripts[0].range.startColumn === 0);
+
+ function scriptContentAvailable(error, content)
+ {
+ delete this._requestingScriptContent;
+
+ // Abort if the full content populated while waiting for this async callback.
+ if (this._fullContentPopulated)
+ return;
+
+ // This is the full content.
+ this._fullContentPopulated = true;
+
+ this._populateWithContent(content);
+ }
+
+ this._requestingScriptContent = true;
+
+ scripts[0].requestContent(scriptContentAvailable.bind(this));
+ },
+
+ _matchesSourceCodeLocation: function(sourceCodeLocation)
+ {
+ if (this._sourceCode instanceof WebInspector.SourceMapResource)
+ return sourceCodeLocation.displaySourceCode === this._sourceCode;
+ if (this._sourceCode instanceof WebInspector.Resource)
+ return sourceCodeLocation.sourceCode.url === this._sourceCode.url;
+ if (this._sourceCode instanceof WebInspector.Script)
+ return sourceCodeLocation.sourceCode === this._sourceCode;
+ return false;
+ },
+
+ _matchesBreakpoint: function(breakpoint)
+ {
+ console.assert(this._supportsDebugging);
+ if (this._sourceCode instanceof WebInspector.SourceMapResource)
+ return breakpoint.sourceCodeLocation.displaySourceCode === this._sourceCode;
+ if (this._sourceCode instanceof WebInspector.Resource)
+ return breakpoint.url === this._sourceCode.url;
+ if (this._sourceCode instanceof WebInspector.Script)
+ return breakpoint.url === this._sourceCode.url || breakpoint.scriptIdentifier === this._sourceCode.id;
+ return false;
+ },
+
+ _matchesIssue: function(issue)
+ {
+ if (this._sourceCode instanceof WebInspector.Resource)
+ return issue.url === this._sourceCode.url;
+ // FIXME: Support issues for Scripts based on id, not only by URL.
+ if (this._sourceCode instanceof WebInspector.Script)
+ return issue.url === this._sourceCode.url;
+ return false;
+ },
+
+ _issueWasAdded: function(event)
+ {
+ var issue = event.data.issue;
+ if (!this._matchesIssue(issue))
+ return;
+
+ this._addIssue(issue);
+ },
+
+ _addIssue: function(issue)
+ {
+ var lineNumberIssues = this._issuesLineNumberMap[issue.lineNumber];
+ if (!lineNumberIssues)
+ lineNumberIssues = this._issuesLineNumberMap[issue.lineNumber] = [];
+
+ lineNumberIssues.push(issue);
+
+ if (issue.level === WebInspector.IssueMessage.Level.Error)
+ this.addStyleClassToLine(issue.lineNumber, WebInspector.SourceCodeTextEditor.LineErrorStyleClassName);
+ else if (issue.level === WebInspector.IssueMessage.Level.Warning)
+ this.addStyleClassToLine(issue.lineNumber, WebInspector.SourceCodeTextEditor.LineWarningStyleClassName);
+ else
+ console.error("Unknown issue level");
+
+ // FIXME <rdar://problem/10854857>: Show the issue message on the line as a bubble.
+ },
+
+ _breakpointInfoForBreakpoint: function(breakpoint)
+ {
+ return {resolved: breakpoint.resolved, disabled: breakpoint.disabled, autoContinue: breakpoint.autoContinue};
+ },
+
+ get _supportsDebugging()
+ {
+ if (this._sourceCode instanceof WebInspector.Resource)
+ return this._sourceCode.type === WebInspector.Resource.Type.Document || this._sourceCode.type === WebInspector.Resource.Type.Script;
+ if (this._sourceCode instanceof WebInspector.Script)
+ return true;
+ return false;
+ },
+
+ // TextEditor Delegate
+
+ textEditorBaseURL: function(textEditor)
+ {
+ return this._sourceCode.url;
+ },
+
+ textEditorShouldHideLineNumber: function(textEditor, lineNumber)
+ {
+ return lineNumber in this._invalidLineNumbers;
+ },
+
+ textEditorGutterContextMenu: function(textEditor, lineNumber, columnNumber, editorBreakpoints, event)
+ {
+ if (!this._supportsDebugging)
+ return;
+
+ event.preventDefault();
+
+ var contextMenu = new WebInspector.ContextMenu(event);
+
+ // Paused. Add Continue to Here option only if we have a script identifier for the location.
+ if (WebInspector.debuggerManager.paused) {
+ var editorLineInfo = {lineNumber:lineNumber, columnNumber:columnNumber};
+ var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(editorLineInfo);
+ var sourceCodeLocation = this._sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
+
+ if (sourceCodeLocation.sourceCode instanceof WebInspector.Script)
+ var script = sourceCodeLocation.sourceCode;
+ else if (sourceCodeLocation.sourceCode instanceof WebInspector.Resource)
+ var script = sourceCodeLocation.sourceCode.scriptForLocation(sourceCodeLocation);
+
+ if (script) {
+ function continueToLocation()
+ {
+ WebInspector.debuggerManager.continueToLocation(script.id, sourceCodeLocation.lineNumber, sourceCodeLocation.columnNumber);
+ }
+
+ contextMenu.appendItem(WebInspector.UIString("Continue to Here"), continueToLocation);
+ contextMenu.appendSeparator();
+ }
+ }
+
+ var breakpoints = [];
+ for (var i = 0; i < editorBreakpoints.length; ++i) {
+ var lineInfo = editorBreakpoints[i];
+ var breakpoint = this._breakpointForEditorLineInfo(lineInfo);
+ console.assert(breakpoint);
+ if (breakpoint)
+ breakpoints.push(breakpoint);
+ }
+
+ // No breakpoints.
+ if (!breakpoints.length) {
+ function addBreakpoint()
+ {
+ var data = this.textEditorBreakpointAdded(this, lineNumber, columnNumber);
+ this.setBreakpointInfoForLineAndColumn(data.lineNumber, data.columnNumber, data.breakpointInfo);
+ }
+
+ contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), addBreakpoint.bind(this));
+ contextMenu.show();
+ return;
+ }
+
+ // Single breakpoint.
+ if (breakpoints.length === 1) {
+ var breakpoint = breakpoints[0];
+ function revealInSidebar()
+ {
+ WebInspector.debuggerSidebarPanel.show();
+ var treeElement = WebInspector.debuggerSidebarPanel.treeElementForRepresentedObject(breakpoint);
+ if (treeElement)
+ treeElement.revealAndSelect();
+ }
+
+ breakpoint.appendContextMenuItems(contextMenu, event.target);
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Reveal in Debugger Navigation Sidebar"), revealInSidebar);
+ contextMenu.show();
+ return;
+ }
+
+ // Multiple breakpoints.
+ var shouldDisable = false;
+ for (var i = 0; i < breakpoints.length; ++i) {
+ if (!breakpoints[i].disabled) {
+ shouldDisable = true;
+ break;
+ }
+ }
+
+ function removeBreakpoints()
+ {
+ for (var i = 0; i < breakpoints.length; ++i) {
+ var breakpoint = breakpoints[i];
+ if (WebInspector.debuggerManager.isBreakpointRemovable(breakpoint))
+ WebInspector.debuggerManager.removeBreakpoint(breakpoint);
+ }
+ }
+
+ function toggleBreakpoints()
+ {
+ for (var i = 0; i < breakpoints.length; ++i)
+ breakpoints[i].disabled = shouldDisable;
+ }
+
+ if (shouldDisable)
+ contextMenu.appendItem(WebInspector.UIString("Disable Breakpoints"), toggleBreakpoints.bind(this));
+ else
+ contextMenu.appendItem(WebInspector.UIString("Enable Breakpoints"), toggleBreakpoints.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Delete Breakpoints"), removeBreakpoints.bind(this));
+ contextMenu.show();
+ },
+
+ textEditorBreakpointAdded: function(textEditor, lineNumber, columnNumber)
+ {
+ if (!this._supportsDebugging)
+ return null;
+
+ var editorLineInfo = {lineNumber:lineNumber, columnNumber:columnNumber};
+ var unformattedLineInfo = this._unformattedLineInfoForEditorLineInfo(editorLineInfo);
+ var sourceCodeLocation = this._sourceCode.createSourceCodeLocation(unformattedLineInfo.lineNumber, unformattedLineInfo.columnNumber);
+ var breakpoint = new WebInspector.Breakpoint(sourceCodeLocation);
+
+ var lineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._addBreakpointWithEditorLineInfo(breakpoint, lineInfo);
+
+ this._ignoreBreakpointAddedBreakpoint = breakpoint;
+ WebInspector.debuggerManager.addBreakpoint(breakpoint);
+ delete this._ignoreBreakpointAddedBreakpoint;
+
+ // Return the more accurate location and breakpoint info.
+ return {
+ breakpointInfo: this._breakpointInfoForBreakpoint(breakpoint),
+ lineNumber: lineInfo.lineNumber,
+ columnNumber: lineInfo.columnNumber
+ };
+ },
+
+ textEditorBreakpointRemoved: function(textEditor, lineNumber, columnNumber)
+ {
+ console.assert(this._supportsDebugging);
+ if (!this._supportsDebugging)
+ return;
+
+ var lineInfo = {lineNumber: lineNumber, columnNumber: columnNumber};
+ var breakpoint = this._breakpointForEditorLineInfo(lineInfo);
+ console.assert(breakpoint);
+ if (!breakpoint)
+ return;
+
+ this._removeBreakpointWithEditorLineInfo(breakpoint, lineInfo);
+
+ this._ignoreBreakpointRemovedBreakpoint = breakpoint;
+ WebInspector.debuggerManager.removeBreakpoint(breakpoint);
+ delete this._ignoreBreakpointAddedBreakpoint;
+ },
+
+ textEditorBreakpointMoved: function(textEditor, oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)
+ {
+ console.assert(this._supportsDebugging);
+ if (!this._supportsDebugging)
+ return;
+
+ var oldLineInfo = {lineNumber: oldLineNumber, columnNumber: oldColumnNumber};
+ var breakpoint = this._breakpointForEditorLineInfo(oldLineInfo);
+ console.assert(breakpoint);
+ if (!breakpoint)
+ return;
+
+ this._removeBreakpointWithEditorLineInfo(breakpoint, oldLineInfo);
+
+ var newLineInfo = {lineNumber: newLineNumber, columnNumber: newColumnNumber};
+ var unformattedNewLineInfo = this._unformattedLineInfoForEditorLineInfo(newLineInfo);
+ this._ignoreLocationUpdateBreakpoint = breakpoint;
+ breakpoint.sourceCodeLocation.update(this._sourceCode, unformattedNewLineInfo.lineNumber, unformattedNewLineInfo.columnNumber);
+ delete this._ignoreLocationUpdateBreakpoint;
+
+ var accurateNewLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._addBreakpointWithEditorLineInfo(breakpoint, accurateNewLineInfo);
+
+ if (accurateNewLineInfo.lineNumber !== newLineInfo.lineNumber || accurateNewLineInfo.columnNumber !== newLineInfo.columnNumber)
+ this.updateBreakpointLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, accurateNewLineInfo.lineNumber, accurateNewLineInfo.columnNumber);
+ },
+
+ textEditorBreakpointClicked: function(textEditor, lineNumber, columnNumber)
+ {
+ console.assert(this._supportsDebugging);
+ if (!this._supportsDebugging)
+ return;
+
+ var breakpoint = this._breakpointForEditorLineInfo({lineNumber: lineNumber, columnNumber: columnNumber});
+ console.assert(breakpoint);
+ if (!breakpoint)
+ return;
+
+ breakpoint.cycleToNextMode();
+ },
+
+ textEditorUpdatedFormatting: function(textEditor)
+ {
+ this._ignoreAllBreakpointLocationUpdates = true;
+ this._sourceCode.formatterSourceMap = this.formatterSourceMap;
+ delete this._ignoreAllBreakpointLocationUpdates;
+
+ // Always put the source map on both the Script and Resource if both exist. For example,
+ // if this SourceCode is a Resource, then there might also be a Script. In the debugger,
+ // the backend identifies call frames with Script line and column information, and the
+ // Script needs the formatter source map to produce the proper display line and column.
+ if (this._sourceCode instanceof WebInspector.Resource && !(this._sourceCode instanceof WebInspector.SourceMapResource)) {
+ var scripts = this._sourceCode.scripts;
+ for (var i = 0; i < scripts.length; ++i)
+ scripts[i].formatterSourceMap = this.formatterSourceMap;
+ } else if (this._sourceCode instanceof WebInspector.Script) {
+ if (this._sourceCode.resource)
+ this._sourceCode.resource.formatterSourceMap = this.formatterSourceMap;
+ }
+
+ // Some breakpoints may have moved, some might not have. Just go through
+ // and remove and reinsert all the breakpoints.
+
+ var oldBreakpointMap = this._breakpointMap;
+ this._breakpointMap = {};
+
+ for (var lineNumber in oldBreakpointMap) {
+ for (var columnNumber in oldBreakpointMap[lineNumber]) {
+ var breakpoint = oldBreakpointMap[lineNumber][columnNumber];
+ var newLineInfo = this._editorLineInfoForSourceCodeLocation(breakpoint.sourceCodeLocation);
+ this._addBreakpointWithEditorLineInfo(breakpoint, newLineInfo);
+ this.setBreakpointInfoForLineAndColumn(lineNumber, columnNumber, null);
+ this.setBreakpointInfoForLineAndColumn(newLineInfo.lineNumber, newLineInfo.columnNumber, this._breakpointInfoForBreakpoint(breakpoint));
+ }
+ }
+ },
+
+ _debuggerDidPause: function(event)
+ {
+ this._updateTokenTrackingControllerState();
+ },
+
+ _debuggerDidResume: function(event)
+ {
+ this._updateTokenTrackingControllerState();
+ this._dismissPopover();
+ },
+
+ _sourceCodeSourceMapAdded: function(event)
+ {
+ WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._updateTokenTrackingControllerState, this);
+ this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this._sourceCodeSourceMapAdded, this);
+
+ this._updateTokenTrackingControllerState();
+ },
+
+ _updateTokenTrackingControllerState: function()
+ {
+ var mode = WebInspector.CodeMirrorTokenTrackingController.Mode.None;
+ if (WebInspector.debuggerManager.paused)
+ mode = WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression;
+ else if (this._hasColorMarkers())
+ mode = WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens;
+ else if ((this._sourceCode instanceof WebInspector.SourceMapResource || this._sourceCode.sourceMaps.length !== 0) && WebInspector.modifierKeys.metaKey && !WebInspector.modifierKeys.altKey && !WebInspector.modifierKeys.shiftKey)
+ mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
+
+ this.tokenTrackingController.enabled = mode !== WebInspector.CodeMirrorTokenTrackingController.Mode.None;
+
+ if (mode === this.tokenTrackingController.mode)
+ return;
+
+ switch (mode) {
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens:
+ this.tokenTrackingController.mouseOverDelayDuration = 0;
+ this.tokenTrackingController.mouseOutReleaseDelayDuration = 0;
+ break;
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens:
+ this.tokenTrackingController.mouseOverDelayDuration = 0;
+ this.tokenTrackingController.mouseOutReleaseDelayDuration = 0;
+ this.tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
+ this._dismissPopover();
+ break;
+ case WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression:
+ this.tokenTrackingController.mouseOverDelayDuration = WebInspector.SourceCodeTextEditor.DurationToMouseOverTokenToMakeHoveredToken;
+ this.tokenTrackingController.mouseOutReleaseDelayDuration = WebInspector.SourceCodeTextEditor.DurationToMouseOutOfHoveredTokenToRelease;
+ this.tokenTrackingController.classNameForHighlightedRange = WebInspector.SourceCodeTextEditor.HoveredExpressionHighlightStyleClassName;
+ break;
+ }
+
+ this.tokenTrackingController.mode = mode;
+ },
+
+ _hasColorMarkers: function()
+ {
+ for (var marker of this.markers) {
+ if (marker.type === WebInspector.TextMarker.Type.Color)
+ return true;
+ }
+ return false;
+ },
+
+ // CodeMirrorTokenTrackingController Delegate
+
+ tokenTrackingControllerCanReleaseHighlightedRange: function(tokenTrackingController, element)
+ {
+ if (!this._popover)
+ return true;
+
+ if (!window.getSelection().isCollapsed && this._popover.element.contains(window.getSelection().anchorNode))
+ return false;
+
+ return true;
+ },
+
+ tokenTrackingControllerHighlightedRangeReleased: function(tokenTrackingController)
+ {
+ if (!this._mouseIsOverPopover)
+ this._dismissPopover();
+ },
+
+ tokenTrackingControllerHighlightedRangeWasClicked: function(tokenTrackingController)
+ {
+ if (this.tokenTrackingController.mode !== WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens)
+ return;
+
+ // Links are handled by TextEditor.
+ if (/\blink\b/.test(this.tokenTrackingController.candidate.hoveredToken.type))
+ return;
+
+ var sourceCodeLocation = this._sourceCodeLocationForEditorPosition(this.tokenTrackingController.candidate.hoveredTokenRange.start);
+ if (this.sourceCode instanceof WebInspector.SourceMapResource)
+ WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
+ else
+ WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
+ },
+
+ tokenTrackingControllerNewHighlightCandidate: function(tokenTrackingController, candidate)
+ {
+ if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens) {
+ this.tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
+ return;
+ }
+
+ if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.JavaScriptExpression) {
+ this._tokenTrackingControllerHighlightedJavaScriptExpression(candidate);
+ return;
+ }
+
+ if (this.tokenTrackingController.mode === WebInspector.CodeMirrorTokenTrackingController.Mode.MarkedTokens) {
+ var markers = this.markersAtPosition(candidate.hoveredTokenRange.start);
+ if (markers.length > 0)
+ this._tokenTrackingControllerHighlightedMarkedExpression(candidate, markers);
+ else
+ this._dismissEditingController();
+ }
+ },
+
+ tokenTrackingControllerMouseOutOfHoveredMarker: function(tokenTrackingController, hoveredMarker)
+ {
+ this._dismissEditingController();
+ },
+
+ _tokenTrackingControllerHighlightedJavaScriptExpression: function(candidate)
+ {
+ console.assert(candidate.expression);
+
+ function populate(error, result, wasThrown)
+ {
+ if (error || wasThrown)
+ return;
+
+ if (candidate !== this.tokenTrackingController.candidate)
+ return;
+
+ var data = WebInspector.RemoteObject.fromPayload(result);
+ switch (data.type) {
+ case "function":
+ this._showPopoverForFunction(data);
+ break;
+ case "object":
+ this._showPopoverForObject(data);
+ break;
+ case "string":
+ this._showPopoverForString(data);
+ break;
+ case "number":
+ this._showPopoverForNumber(data);
+ break;
+ case "boolean":
+ this._showPopoverForBoolean(data);
+ break;
+ case "undefined":
+ this._showPopoverForUndefined(data);
+ break;
+ }
+ }
+
+ DebuggerAgent.evaluateOnCallFrame.invoke({callFrameId: WebInspector.debuggerManager.activeCallFrame.id, expression: candidate.expression, objectGroup: "popover", doNotPauseOnExceptionsAndMuteConsole: true}, populate.bind(this));
+ },
+
+ _showPopover: function(content)
+ {
+ console.assert(this.tokenTrackingController.candidate);
+
+ var candidate = this.tokenTrackingController.candidate;
+ if (!candidate)
+ return;
+
+ content.classList.add(WebInspector.SourceCodeTextEditor.PopoverDebuggerContentStyleClassName);
+
+ var rects = this.rectsForRange(candidate.hoveredTokenRange);
+ var bounds = WebInspector.Rect.unionOfRects(rects);
+
+ this._popover = this._popover || new WebInspector.Popover(this);
+ this._popover.content = content;
+ this._popover.present(bounds.pad(5), [WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MAX_X]);
+
+ this._trackPopoverEvents();
+
+ this.tokenTrackingController.highlightRange(candidate.expressionRange);
+ },
+
+ _showPopoverForFunction: function(data)
+ {
+ var candidate = this.tokenTrackingController.candidate;
+
+ function didGetDetails(error, response)
+ {
+ if (error) {
+ console.error(error);
+ this._dismissPopover();
+ return;
+ }
+
+ // Nothing to do if the token has changed since the time we
+ // asked for the function details from the backend.
+ if (candidate !== this.tokenTrackingController.candidate)
+ return;
+
+ var wrapper = document.createElement("div");
+ wrapper.className = "body console-formatted-function";
+ wrapper.textContent = data.description;
+
+ var content = document.createElement("div");
+ content.className = "function";
+
+ var title = content.appendChild(document.createElement("div"));
+ title.className = "title";
+ title.textContent = response.name || response.inferredName || response.displayName || WebInspector.UIString("(anonymous function)");
+
+ content.appendChild(wrapper);
+
+ this._showPopover(content);
+ }
+ DebuggerAgent.getFunctionDetails(data.objectId, didGetDetails.bind(this));
+ },
+
+ _showPopoverForObject: function(data)
+ {
+ if (data.subtype === "null") {
+ this._showPopoverForNull(data);
+ return;
+ }
+
+ var content = document.createElement("div");
+ content.className = "object expandable";
+
+ var titleElement = document.createElement("div");
+ titleElement.className = "title";
+ titleElement.textContent = data.description;
+ content.appendChild(titleElement);
+
+ var section = new WebInspector.ObjectPropertiesSection(data);
+ section.expanded = true;
+ section.element.classList.add("body");
+ content.appendChild(section.element);
+
+ this._showPopover(content);
+ },
+
+ _showPopoverForString: function(data)
+ {
+ var content = document.createElement("div");
+ content.className = "string console-formatted-string";
+ content.textContent = "\"" + data.description + "\"";
+
+ this._showPopover(content);
+ },
+
+ _showPopoverForNumber: function(data)
+ {
+ var content = document.createElement("span");
+ content.className = "number console-formatted-number";
+ content.textContent = data.description;
+
+ this._showPopover(content);
+ },
+
+ _showPopoverForBoolean: function(data)
+ {
+ var content = document.createElement("span");
+ content.className = "boolean console-formatted-boolean";
+ content.textContent = data.description;
+
+ this._showPopover(content);
+ },
+
+ _showPopoverForNull: function(data)
+ {
+ var content = document.createElement("span");
+ content.className = "boolean console-formatted-null";
+ content.textContent = data.description;
+
+ this._showPopover(content);
+ },
+
+ _showPopoverForUndefined: function(data)
+ {
+ var content = document.createElement("span");
+ content.className = "boolean console-formatted-undefined";
+ content.textContent = data.description;
+
+ this._showPopover(content);
+ },
+
+ willDismissPopover: function(popover)
+ {
+ this.tokenTrackingController.removeHighlightedRange();
+
+ RuntimeAgent.releaseObjectGroup("popover");
+ },
+
+ _dismissPopover: function()
+ {
+ if (!this._popover)
+ return;
+
+ this._popover.dismiss();
+
+ if (this._popoverEventHandler)
+ this._popoverEventHandler.stopTrackingEvents();
+ },
+
+ _trackPopoverEvents: function()
+ {
+ if (!this._popoverEventHandler) {
+ this._popoverEventHandler = new WebInspector.EventHandler(this, {
+ "mouseover": this._popoverMouseover,
+ "mouseout": this._popoverMouseout,
+ });
+ }
+
+ this._popoverEventHandler.trackEvents(this._popover.element);
+ },
+
+ _popoverMouseover: function(event)
+ {
+ this._mouseIsOverPopover = true;
+ },
+
+ _popoverMouseout: function(event)
+ {
+ this._mouseIsOverPopover = this._popover.element.contains(event.relatedTarget);
+ },
+
+ _updateEditableMarkers: function(range)
+ {
+ this.createColorMarkers(range);
+ this.createGradientMarkers(range);
+
+ this._updateTokenTrackingControllerState();
+ },
+
+ _tokenTrackingControllerHighlightedMarkedExpression: function(candidate, markers)
+ {
+ // Look for the outermost editable marker.
+ var editableMarker;
+ for (var marker of markers) {
+ if (!marker.range || (marker.type !== WebInspector.TextMarker.Type.Color && marker.type !== WebInspector.TextMarker.Type.Gradient))
+ continue;
+
+ if (!editableMarker || (marker.range.startLine < editableMarker.range.startLine || (marker.range.startLine === editableMarker.range.startLine && marker.range.startColumn < editableMarker.range.startColumn)))
+ editableMarker = marker;
+ }
+
+ if (!editableMarker) {
+ this.tokenTrackingController.hoveredMarker = null;
+ return;
+ }
+
+ if (this.tokenTrackingController.hoveredMarker === editableMarker)
+ return;
+
+ this._dismissEditingController();
+
+ this.tokenTrackingController.hoveredMarker = editableMarker;
+
+ this._editingController = this.editingControllerForMarker(editableMarker);
+
+ if (marker.type === WebInspector.TextMarker.Type.Color) {
+ var color = this._editingController.value;
+ if (!color || !color.valid) {
+ editableMarker.clear();
+ delete this._editingController;
+ return;
+ }
+ }
+
+ this._editingController.delegate = this;
+ this._editingController.presentHoverMenu();
+ },
+
+ _dismissEditingController: function(discrete)
+ {
+ if (this._editingController)
+ this._editingController.dismissHoverMenu(discrete);
+
+ this.tokenTrackingController.hoveredMarker = null;
+ delete this._editingController;
+ },
+
+ // CodeMirrorEditingController Delegate
+
+ editingControllerDidStartEditing: function(editingController)
+ {
+ // We can pause the token tracking controller during editing, it will be reset
+ // to the expected state by calling _updateEditableMarkers() in the
+ // editingControllerDidFinishEditing delegate.
+ this.tokenTrackingController.enabled = false;
+
+ // We clear the marker since we'll reset it after editing.
+ editingController.marker.clear();
+
+ // We ignore content changes made as a result of color editing.
+ this._ignoreContentDidChange++;
+ },
+
+ editingControllerDidFinishEditing: function(editingController)
+ {
+ this._updateEditableMarkers(editingController.range);
+
+ this._ignoreContentDidChange--;
+
+ delete this._editingController;
+ }
+};
+
+WebInspector.SourceCodeTextEditor.prototype.__proto__ = WebInspector.TextEditor.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTimelineTimelineDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTimelineDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTimelineDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimelineTimelineDataGridNode = function(sourceCodeTimeline, graphDataSource)
+{
+ WebInspector.TimelineDataGridNode.call(this, true, graphDataSource);
+
+ this._sourceCodeTimeline = sourceCodeTimeline;
+ this._sourceCodeTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._timelineRecordAdded, this);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.SourceCodeTimelineTimelineDataGridNode);
+
+WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype = {
+ constructor: WebInspector.SourceCodeTimelineTimelineDataGridNode,
+ __proto__: WebInspector.TimelineDataGridNode.prototype,
+
+ // Public
+
+ get records()
+ {
+ return this._sourceCodeTimeline.records;
+ },
+
+ get sourceCodeTimeline()
+ {
+ return this._sourceCodeTimeline;
+ },
+
+ get data()
+ {
+ return {graph: this._sourceCodeTimeline.startTime};
+ },
+
+ // Private
+
+ _timelineRecordAdded: function(event)
+ {
+ if (this.isRecordVisible(event.data.record))
+ this.needsGraphRefresh();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTimelineTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTimelineTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTimelineTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTimelineTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTimelineTreeElement = function(sourceCodeTimeline, subtitleNameStyle, includeTimerIdentifierInMainTitle)
+{
+ console.assert(sourceCodeTimeline);
+
+ this._sourceCodeTimeline = sourceCodeTimeline;
+
+ subtitleNameStyle = subtitleNameStyle || WebInspector.SourceCodeLocation.NameStyle.None;
+
+ WebInspector.TimelineRecordTreeElement.call(this, sourceCodeTimeline.records[0], subtitleNameStyle, includeTimerIdentifierInMainTitle, sourceCodeTimeline.sourceCodeLocation, sourceCodeTimeline);
+};
+
+WebInspector.SourceCodeTimelineTreeElement.prototype = {
+ constructor: WebInspector.SourceCodeTimelineTreeElement,
+ __proto__: WebInspector.TimelineRecordTreeElement.prototype,
+
+ // Public
+
+ record: undefined,
+
+ get sourceCodeTimeline()
+ {
+ return this._sourceCodeTimeline;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceCodeTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceCodeTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceCodeTreeElement = function(sourceCode, classNames, title, subtitle, representedObject, hasChildren)
+{
+ console.assert(sourceCode instanceof WebInspector.SourceCode);
+
+ WebInspector.GeneralTreeElement.call(this, classNames, title, subtitle, representedObject || sourceCode, hasChildren);
+
+ this.small = true;
+
+ this._updateSourceCode(sourceCode);
+};
+
+WebInspector.SourceCodeTreeElement.prototype = {
+ constructor: WebInspector.SourceCodeTreeElement,
+
+ // Public
+
+ updateSourceMapResources: function()
+ {
+ if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
+ return;
+
+ this.hasChildren = !!this._sourceCode.sourceMaps.length;
+ this.shouldRefreshChildren = this.hasChildren;
+
+ if (!this.hasChildren)
+ this.removeChildren();
+ },
+
+ // Overrides from TreeElement
+
+ onattach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+
+ this.updateSourceMapResources();
+ },
+
+ onpopulate: function()
+ {
+ if (!this.treeOutline || !this.treeOutline.includeSourceMapResourceChildren)
+ return;
+
+ if (!this.hasChildren || !this.shouldRefreshChildren)
+ return;
+
+ this.shouldRefreshChildren = false;
+
+ this.removeChildren();
+
+ function combineFolderChain(topFolder, bottomFolder)
+ {
+ console.assert(topFolder.children.length === 1);
+
+ var components = [];
+
+ for (var currentFolder = bottomFolder; currentFolder !== topFolder; currentFolder = currentFolder.parent)
+ components.push(currentFolder.mainTitle);
+ components.push(topFolder.mainTitle);
+
+ var folderName = components.reverse().join("/");
+ var newFolder = new WebInspector.FolderTreeElement(folderName);
+
+ var folderIndex = topFolder.parent.children.indexOf(topFolder);
+ topFolder.parent.insertChild(newFolder, folderIndex);
+ topFolder.parent.removeChild(topFolder);
+
+ var children = bottomFolder.children;
+ bottomFolder.removeChildren();
+ for (var i = 0; i < children.length; ++i)
+ newFolder.appendChild(children[i]);
+ }
+
+ function findAndCombineFolderChains(treeElement, previousSingleTreeElement)
+ {
+ if (!(treeElement instanceof WebInspector.FolderTreeElement)) {
+ if (previousSingleTreeElement && previousSingleTreeElement !== treeElement.parent)
+ combineFolderChain(previousSingleTreeElement, treeElement.parent);
+ return;
+ }
+
+ if (previousSingleTreeElement && treeElement.children.length !== 1) {
+ combineFolderChain(previousSingleTreeElement, treeElement);
+ previousSingleTreeElement = null;
+ }
+
+ if (!previousSingleTreeElement && treeElement.children.length === 1)
+ previousSingleTreeElement = treeElement;
+
+ for (var i = 0; i < treeElement.children.length; ++i)
+ findAndCombineFolderChains(treeElement.children[i], previousSingleTreeElement);
+ }
+
+ var sourceMaps = this._sourceCode.sourceMaps;
+ for (var i = 0; i < sourceMaps.length; ++i) {
+ var sourceMap = sourceMaps[i];
+ for (var j = 0; j < sourceMap.resources.length; ++j) {
+ var sourceMapResource = sourceMap.resources[j];
+ var relativeSubpath = sourceMapResource.sourceMapDisplaySubpath;
+ var folderTreeElement = this.createFoldersAsNeededForSubpath(relativeSubpath);
+ var sourceMapTreeElement = new WebInspector.SourceMapResourceTreeElement(sourceMapResource);
+ folderTreeElement.insertChild(sourceMapTreeElement, insertionIndexForObjectInListSortedByFunction(sourceMapTreeElement, folderTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements));
+ }
+ }
+
+ for (var i = 0; i < this.children.length; ++i)
+ findAndCombineFolderChains(this.children[i], null);
+ },
+
+ // Protected
+
+ createFoldersAsNeededForSubpath: function(subpath)
+ {
+ if (!subpath)
+ return this;
+
+ var components = subpath.split("/");
+ if (components.length === 1)
+ return this;
+
+ if (!this._subpathFolderTreeElementMap)
+ this._subpathFolderTreeElementMap = {};
+
+ var currentPath = "";
+ var currentFolderTreeElement = this;
+
+ for (var i = 0 ; i < components.length - 1; ++i) {
+ var componentName = components[i];
+ currentPath += (i ? "/" : "") + componentName;
+
+ var cachedFolder = this._subpathFolderTreeElementMap[currentPath];
+ if (cachedFolder) {
+ currentFolderTreeElement = cachedFolder;
+ continue;
+ }
+
+ var newFolder = new WebInspector.FolderTreeElement(componentName);
+ newFolder.__path = currentPath;
+ this._subpathFolderTreeElementMap[currentPath] = newFolder;
+
+ var index = insertionIndexForObjectInListSortedByFunction(newFolder, currentFolderTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements);
+ currentFolderTreeElement.insertChild(newFolder, index);
+ currentFolderTreeElement = newFolder;
+ }
+
+ return currentFolderTreeElement;
+ },
+
+ descendantResourceTreeElementTypeDidChange: function(childTreeElement, oldType)
+ {
+ // Called by descendant SourceMapResourceTreeElements.
+
+ console.assert(this.hasChildren);
+
+ var wasSelected = childTreeElement.selected;
+
+ var parentTreeElement = childTreeElement.parent;
+ parentTreeElement.removeChild(childTreeElement, true, true);
+ parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, WebInspector.ResourceTreeElement.compareFolderAndResourceTreeElements));
+
+ if (wasSelected)
+ childTreeElement.revealAndSelect(true, false, true, true);
+ },
+
+ // Protected (ResourceTreeElement calls this when its Resource changes dynamically for Frames)
+
+ _updateSourceCode: function(sourceCode)
+ {
+ console.assert(sourceCode instanceof WebInspector.SourceCode);
+
+ if (this._sourceCode === sourceCode)
+ return;
+
+ if (this._sourceCode)
+ this._sourceCode.removeEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this.updateSourceMapResources, this);
+
+ this._sourceCode = sourceCode;
+ this._sourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, this.updateSourceMapResources, this);
+
+ this.updateSourceMapResources();
+ }
+};
+
+WebInspector.SourceCodeTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceMapResourceTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSourceMapResourceTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SourceMapResourceTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SourceMapResourceTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceMapResourceTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceMapResourceTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SourceMapResourceTreeElement = function(sourceMapResource, representedObject)
+{
+ console.assert(sourceMapResource instanceof WebInspector.SourceMapResource);
+
+ WebInspector.ResourceTreeElement.call(this, sourceMapResource);
+
+ console.assert(this.resource === sourceMapResource);
+
+ this.addClassName(WebInspector.SourceMapResourceTreeElement.StyleClassName);
+};
+
+WebInspector.SourceMapResourceTreeElement.StyleClassName = "source-map-resource";
+
+WebInspector.SourceMapResourceTreeElement.prototype = {
+ constructor: WebInspector.SourceMapResourceTreeElement,
+
+ // Protected
+
+ onattach: function()
+ {
+ WebInspector.ResourceTreeElement.prototype.onattach.call(this);
+
+ // SourceMap resources must be loaded by the frontend, and only
+ // then do they get their type information. So force a load as
+ // soon as they are attached to the sidebar.
+ this.resource.requestContent(function() {});
+ },
+
+ _updateTitles: function()
+ {
+ var oldMainTitle = this.mainTitle;
+ this.mainTitle = this.resource.displayName;
+
+ // Show the host as the subtitle if it is different from the originalSourceCode's host.
+ var sourceMapHost = this.resource.urlComponents.host;
+ var originalHost = this.resource.sourceMap.originalSourceCode.urlComponents.host;
+ var subtitle = sourceMapHost !== originalHost ? WebInspector.displayNameForHost(sourceMapHost) : null;
+ this.subtitle = this.mainTitle !== subtitle ? subtitle : null;
+
+ if (oldMainTitle !== this.mainTitle)
+ this.callFirstAncestorFunction("descendantResourceTreeElementMainTitleDidChange", [this, oldMainTitle]);
+ }
+};
+
+WebInspector.SourceMapResourceTreeElement.prototype.__proto__ = WebInspector.ResourceTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsStorageTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceStorageTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/StorageTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StorageTreeElement = function(classNames, title, representedObject)
+{
+ WebInspector.GeneralTreeElement.call(this, classNames, title, null, representedObject, false);
+
+ this.small = true;
+ this.flattened = false;
+};
+
+WebInspector.StorageTreeElement.prototype = {
+ constructor: WebInspector.StorageTreeElement,
+
+ // Public
+
+ get flattened()
+ {
+ return this._flattened;
+ },
+
+ set flattened(flattened)
+ {
+ if (this._flattened === flattened)
+ return;
+
+ this._flattened = flattened;
+ if (!this._flattened) {
+ this.mainTitle = this.name;
+ this.subtitle = this.secondaryName;
+ this._updateChildrenTitles();
+ return;
+ }
+
+ this.mainTitle = this.categoryName;
+ this.subtitle = this.name;
+ this._updateChildrenTitles();
+ },
+
+ // Private
+
+ _updateChildrenTitles: function()
+ {
+ for (var i = 0; i < this.children.length; ++i) {
+ if (typeof this.children[i].updateTitles === "function")
+ this.children[i].updateTitles();
+ }
+ }
+};
+
+WebInspector.StorageTreeElement.prototype.__proto__ = WebInspector.GeneralTreeElement.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsStyleDetailsPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceStyleDetailsPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/StyleDetailsPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.StyleDetailsPanel = function(className, identifier, label)
+{
+ this._element = document.createElement("div");
+ this._element.className = className;
+
+ // Add this offset-sections class name so the sticky headers don't overlap the navigation bar.
+ this.element.classList.add(WebInspector.StyleDetailsPanel.OffsetSectionsStyleClassName);
+
+ this._navigationItem = new WebInspector.RadioButtonNavigationItem(identifier, label);
+
+ this._nodeStyles = null;
+ this._visible = false;
+};
+
+WebInspector.StyleDetailsPanel.OffsetSectionsStyleClassName = "offset-sections";
+
+WebInspector.StyleDetailsPanel.prototype = {
+ constructor: WebInspector.StyleDetailsPanel,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get navigationItem()
+ {
+ return this._navigationItem;
+ },
+
+ get nodeStyles()
+ {
+ return this._nodeStyles;
+ },
+
+ shown: function()
+ {
+ if (this._visible)
+ return;
+
+ this._visible = true;
+
+ this._refreshNodeStyles();
+ },
+
+ hidden: function()
+ {
+ this._visible = false;
+ },
+
+ widthDidChange: function()
+ {
+ // Implemented by subclasses.
+ },
+
+ markAsNeedsRefresh: function(domNode)
+ {
+ console.assert(domNode);
+ if (!domNode)
+ return;
+
+ if (!this._nodeStyles || this._nodeStyles.node !== domNode) {
+ if (this._nodeStyles) {
+ this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
+ this._nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
+ }
+
+ this._nodeStyles = WebInspector.cssStyleManager.stylesForNode(domNode);
+
+ console.assert(this._nodeStyles);
+ if (!this._nodeStyles)
+ return;
+
+ this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);
+ this._nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);
+
+ this._forceSignificantChange = true;
+ }
+
+ if (this._visible)
+ this._refreshNodeStyles();
+ },
+
+ refresh: function(significantChange)
+ {
+ // Implemented by subclasses.
+ },
+
+ // Private
+
+ get _initialScrollOffset()
+ {
+ if (!WebInspector.cssStyleManager.canForcePseudoClasses())
+ return 0;
+ return this.nodeStyles.node.enabledPseudoClasses.length ? 0 : WebInspector.CSSStyleDetailsSidebarPanel.NoForcedPseudoClassesScrollOffset;
+ },
+
+ _refreshNodeStyles: function()
+ {
+ if (!this._nodeStyles)
+ return;
+ this._nodeStyles.refresh();
+ },
+
+ _refreshPreservingScrollPosition: function(significantChange)
+ {
+ significantChange = this._forceSignificantChange || significantChange || false;
+ delete this._forceSignificantChange;
+
+ var previousScrollTop = this._initialScrollOffset;
+
+ // Only remember the scroll position if the previous node is the same as this one.
+ if (this.element.parentNode && this._previousRefreshNodeIdentifier === this._nodeStyles.node.id)
+ previousScrollTop = this.element.parentNode.scrollTop;
+
+ this.refresh(significantChange);
+
+ this._previousRefreshNodeIdentifier = this._nodeStyles.node.id;
+
+ if (this.element.parentNode)
+ this.element.parentNode.scrollTop = previousScrollTop;
+ },
+
+ _nodeStylesRefreshed: function(event)
+ {
+ if (this._visible)
+ this._refreshPreservingScrollPosition(event.data.significantChange);
+ },
+
+ _nodeStylesNeedsRefreshed: function(event)
+ {
+ if (this._visible)
+ this._refreshNodeStyles();
+ }
+};
+
+WebInspector.StyleDetailsPanel.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsStyleRuleIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceStyleRuleIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/StyleRuleIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/StyleRuleIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/StyleRuleIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StyleRuleIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.author-style-rule-icon .icon {
+ content: url(../Images/StyleRuleAuthor.svg);
+}
+
+.user-style-rule-icon .icon {
+ content: url(../Images/StyleRuleUser.svg);
+}
+
+.user-agent-style-rule-icon .icon {
+ content: url(../Images/StyleRuleUserAgent.svg);
+}
+
+.inspector-style-rule-icon .icon {
+ content: url(../Images/StyleRuleInspector.svg);
+}
+
+.inherited-style-rule-icon .icon {
+ content: url(../Images/StyleRuleInherited.svg);
+}
+
+.inherited-element-style-rule-icon .icon {
+ content: url(../Images/StyleRuleInheritedElement.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingDefaultThemecssfromrev164541trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingDefaultThemecss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingDefaultTheme.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+/* These styles match Xcode 4's Default theme. */
+
+.cm-s-default,
+.syntax-highlighted {
+ color: black;
+
+ font-family: Menlo, monospace;
+ font-size: 11px;
+}
+
+.cm-s-default .cm-comment,
+.syntax-highlighted .css-comment,
+.syntax-highlighted .javascript-comment,
+.syntax-highlighted .html-comment {
+ color: rgb(0, 116, 0);
+}
+
+.cm-s-default .cm-tag,
+.cm-s-default .cm-atom,
+.cm-s-default .cm-keyword,
+.cm-s-default .cm-m-css.cm-meta,
+.cm-s-default .cm-m-css.cm-property,
+.cm-s-default .cm-m-css.cm-string-2,
+.cm-s-default .cm-m-javascript.cm-builtin,
+.syntax-highlighted .css-keyword,
+.syntax-highlighted .css-property,
+.syntax-highlighted .css-at-rule,
+.syntax-highlighted .css-important,
+.syntax-highlighted .javascript-keyword,
+.syntax-highlighted .html-tag {
+ color: rgb(170, 13, 145);
+}
+
+.cm-s-default .cm-number,
+.cm-s-default .cm-m-css.cm-atom,
+.syntax-highlighted .css-number,
+.syntax-highlighted .javascript-number {
+ color: rgb(28, 0, 207);
+}
+
+.cm-s-default .cm-def,
+.cm-s-default .cm-bracket,
+.cm-s-default .cm-operator,
+.cm-s-default .cm-qualifier,
+.cm-s-default .cm-variable,
+.cm-s-default .cm-variable-2,
+.cm-s-default .cm-variable-3,
+.cm-s-default .cm-m-css.cm-tag,
+.cm-s-default .cm-m-css.cm-builtin,
+.syntax-highlighted .css-selector,
+.syntax-highlighted .javascript-ident {
+ color: inherit;
+}
+
+.cm-s-default .cm-string,
+.syntax-highlighted .css-string,
+.syntax-highlighted .javascript-string,
+.syntax-highlighted .javascript-regexp,
+.syntax-highlighted .html-attribute-value {
+ color: rgb(196, 26, 22);
+}
+
+.cm-s-default .cm-m-xml.cm-meta,
+.syntax-highlighted .html-doctype {
+ color: rgb(192, 192, 192);
+}
+
+.cm-s-default .cm-m-xml.cm-attribute,
+.syntax-highlighted .html-attribute-name {
+ color: rgb(131, 108, 40);
+}
+
+.syntax-highlighted a {
+ color: rgb(14, 14, 255);
+}
+
+.cm-s-default .cm-link,
+.syntax-highlighted a {
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.cm-s-default .cm-link:hover,
+.syntax-highlighted a:hover {
+ text-decoration: underline;
+}
+
+.supports-find-banner.showing-find-banner.syntax-highlighted .search-result,
+.supports-find-banner.showing-find-banner .syntax-highlighted .search-result {
+ background-color: rgba(235, 215, 38, 0.2);
+ border-bottom: 1px solid rgb(237, 202, 71);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingSupportjsfromrev164541trunkSourceWebInspectorUIUserInterfaceSyntaxHighlightingSupportjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/SyntaxHighlightingSupport.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.SyntaxHighlightedStyleClassName = "syntax-highlighted";
+
+WebInspector.syntaxHighlightStringAsDocumentFragment = function(string, mimeType, baseURL)
+{
+ var resultFragment = document.createDocumentFragment();
+
+ function appendText(text, style)
+ {
+ if (!style) {
+ resultFragment.appendChild(document.createTextNode(text));
+ return;
+ }
+
+ var span = document.createElement("span");
+ span.className = "cm-" + style;
+ span.textContent = text;
+
+ resultFragment.appendChild(span);
+ }
+
+ mimeType = parseMIMEType(mimeType).type;
+
+ CodeMirror.runMode(string, mimeType, appendText);
+
+ return resultFragment;
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTextContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.text > .text-editor {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTextContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,172 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextContentView = function(string, mimeType)
+{
+ WebInspector.ContentView.call(this, string);
+
+ this.element.classList.add(WebInspector.TextContentView.StyleClassName);
+
+ this._textEditor = new WebInspector.TextEditor;
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
+
+ this.element.appendChild(this._textEditor.element);
+
+ this._textEditor.readOnly = true;
+ this._textEditor.mimeType = mimeType;
+ this._textEditor.string = string;
+
+ var toolTip = WebInspector.UIString("Pretty print");
+ var activatedToolTip = WebInspector.UIString("Original formatting");
+ this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
+ this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
+ this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
+};
+
+WebInspector.TextContentView.StyleClassName = "text";
+
+WebInspector.TextContentView.prototype = {
+ constructor: WebInspector.TextContentView,
+
+ // Public
+
+ get textEditor()
+ {
+ return this._textEditor;
+ },
+
+ get navigationItems()
+ {
+ return [this._prettyPrintButtonNavigationItem];
+ },
+
+ revealPosition: function(position, textRangeToSelect, forceUnformatted)
+ {
+ this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
+ },
+
+ shown: function()
+ {
+ WebInspector.ResourceContentView.prototype.shown.call(this);
+
+ this._textEditor.shown();
+ },
+
+ hidden: function()
+ {
+ WebInspector.ResourceContentView.prototype.hidden.call(this);
+
+ this._textEditor.hidden();
+ },
+
+ closed: function()
+ {
+ WebInspector.ContentView.prototype.closed.call(this);
+
+ this._textEditor.close();
+ },
+
+ get supportsSave()
+ {
+ return true;
+ },
+
+ get saveData()
+ {
+ var url = "web-inspector:///" + encodeURI(WebInspector.UIString("Untitled")) + ".txt";
+ return {url: url, content: this._textEditor.string, forceSaveAs: true};
+ },
+
+ get supportsSearch()
+ {
+ return true;
+ },
+
+ get numberOfSearchResults()
+ {
+ return this._textEditor.numberOfSearchResults;
+ },
+
+ get hasPerformedSearch()
+ {
+ return this._textEditor.currentSearchQuery !== null;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ this._textEditor.automaticallyRevealFirstSearchResult = reveal;
+ },
+
+ performSearch: function(query)
+ {
+ this._textEditor.performSearch(query);
+ },
+
+ searchCleared: function()
+ {
+ this._textEditor.searchCleared();
+ },
+
+ searchQueryWithSelection: function()
+ {
+ return this._textEditor.searchQueryWithSelection();
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealPreviousSearchResult(changeFocus);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealNextSearchResult(changeFocus);
+ },
+
+ updateLayout: function()
+ {
+ this._textEditor.updateLayout();
+ },
+
+ // Private
+
+ _togglePrettyPrint: function(event)
+ {
+ var activated = !this._prettyPrintButtonNavigationItem.activated;
+ this._textEditor.formatted = activated;
+ },
+
+ _textEditorFormattingDidChange: function(event)
+ {
+ this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
+ },
+
+ _numberOfSearchResultsDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+ }
+};
+
+WebInspector.TextContentView.prototype.__proto__ = WebInspector.ContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextEditorcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTextEditorcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextEditor.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,168 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.text-editor {
+ position: relative;
+
+ overflow: hidden;
+}
+
+.text-editor > .CodeMirror {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: auto;
+}
+
+.text-editor > .CodeMirror .has-breakpoint:not(.breakpoint-disabled) .CodeMirror-linenumber {
+ color: white;
+}
+
+.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber {
+ color: transparent;
+}
+
+.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: -7px;
+
+ content: "";
+
+ z-index: -2;
+
+ border-image-source: -webkit-image-set(url(../Images/BreakpointInactive.png) 1x, url(../Images/BreakpointInactive@2x.png) 2x);
+ border-image-slice: 3 7 3 3 fill;
+ border-width: 3px 7px 3px 3px;
+}
+
+.text-editor > .CodeMirror .breakpoint-resolved .CodeMirror-linenumber::before {
+ border-image-source: -webkit-image-set(url(../Images/Breakpoint.png) 1x, url(../Images/Breakpoint@2x.png) 2x);
+}
+
+.text-editor > .CodeMirror .breakpoint-auto-continue:not(.breakpoint-disabled) .CodeMirror-linenumber::before {
+ opacity: 0.6;
+}
+
+.text-editor > .CodeMirror .breakpoint-disabled .CodeMirror-linenumber::before {
+ opacity: 0.35;
+}
+
+.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber::before {
+ content: "•••";
+ color: white;
+ line-height: 6px;
+ text-align: center;
+ text-indent: -1px;
+}
+
+.text-editor > .CodeMirror .execution-line .CodeMirror-linenumber::after {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: -9px;
+ width: 9px;
+
+ content: "";
+
+ z-index: -1;
+
+ background-image: -webkit-image-set(url(../Images/InstructionPointer.png) 1x, url(../Images/InstructionPointer@2x.png) 2x);
+ background-size: 9px 100%;
+ background-repeat: no-repeat;
+}
+
+.text-editor > .CodeMirror .execution-line {
+ background-color: rgb(217, 234, 208) !important;
+}
+
+.text-editor .bouncy-highlight {
+ position: absolute;
+ z-index: 100;
+
+ box-shadow: inset rgb(250, 232, 140) 0 -1px 0, rgba(211, 197, 96, 1) 0 1px 1px, rgba(0, 0, 0, 0.33) 0 1px 2px 1px;
+ text-shadow: white 0 0 2px;
+
+ background: -webkit-linear-gradient(top, rgb(250, 237, 108), rgb(242, 220, 100));
+ border-radius: 7px;
+
+ padding: 2px 4px;
+ margin-top: -2px;
+ margin-left: -4px;
+
+ -webkit-user-select: none;
+ pointer-events: none;
+
+ -webkit-animation-name: text-editor-bouncy;
+ -webkit-animation-duration: 750ms;
+ -webkit-animation-timing-function: ease-in-out;
+
+ opacity: 0;
+}
+
+@-webkit-keyframes text-editor-bouncy {
+ 0% {
+ -webkit-transform: scale(1);
+ opacity: 1;
+ }
+
+ 12.5% {
+ -webkit-transform: scale(1.25);
+ }
+
+ 25% {
+ -webkit-transform: scale(1);
+ }
+
+ 62.5% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0;
+ }
+}
+
+.text-editor > .CodeMirror .highlighted {
+ -webkit-animation: "text-editor-highlight-fadeout" 2s;
+}
+
+@-webkit-keyframes text-editor-highlight-fadeout {
+ from { background-color: highlight; }
+}
+
+.text-editor > .CodeMirror .hovered-expression-highlight {
+ -webkit-animation: "text-editor-hovered-expression-highlight-fadeout" 2s;
+ background-color: rgba(0, 0, 0, 0.1);
+}
+
+@-webkit-keyframes text-editor-hovered-expression-highlight-fadeout {
+ from { background-color: highlight; }
+ to { background-color: rgba(0, 0, 0, 0.1); }
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextEditorjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTextEditorjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextEditor.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1338 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextEditor = function(element, mimeType, delegate)
+{
+ WebInspector.Object.call(this);
+
+ var text = (element ? element.textContent : "");
+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.TextEditor.StyleClassName);
+ this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
+
+ this._codeMirror = CodeMirror(this.element, {
+ readOnly: true,
+ indentWithTabs: true,
+ indentUnit: 4,
+ lineNumbers: true,
+ lineWrapping: true,
+ matchBrackets: true,
+ autoCloseBrackets: true
+ });
+
+ this._codeMirror.on("change", this._contentChanged.bind(this));
+ this._codeMirror.on("gutterClick", this._gutterMouseDown.bind(this));
+ this._codeMirror.on("gutterContextMenu", this._gutterContextMenu.bind(this));
+ this._codeMirror.getScrollerElement().addEventListener("click", this._openClickedLinks.bind(this), true);
+
+ this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
+ this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
+
+ this._initialStringNotSet = true;
+
+ this.mimeType = mimeType;
+
+ this._breakpoints = {};
+ this._executionLineNumber = NaN;
+ this._executionColumnNumber = NaN;
+
+ this._searchQuery = null;
+ this._searchResults = [];
+ this._currentSearchResultIndex = -1;
+ this._ignoreCodeMirrorContentDidChangeEvent = 0;
+
+ this._formatted = false;
+ this._formatterSourceMap = null;
+
+ this._delegate = delegate || null;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.TextEditor);
+
+WebInspector.TextEditor.StyleClassName = "text-editor";
+WebInspector.TextEditor.HighlightedStyleClassName = "highlighted";
+WebInspector.TextEditor.SearchResultStyleClassName = "search-result";
+WebInspector.TextEditor.HasBreakpointStyleClassName = "has-breakpoint";
+WebInspector.TextEditor.BreakpointResolvedStyleClassName = "breakpoint-resolved";
+WebInspector.TextEditor.BreakpointAutoContinueStyleClassName = "breakpoint-auto-continue";
+WebInspector.TextEditor.BreakpointDisabledStyleClassName = "breakpoint-disabled";
+WebInspector.TextEditor.MultipleBreakpointsStyleClassName = "multiple-breakpoints";
+WebInspector.TextEditor.ExecutionLineStyleClassName = "execution-line";
+WebInspector.TextEditor.BouncyHighlightStyleClassName = "bouncy-highlight";
+WebInspector.TextEditor.NumberOfFindsPerSearchBatch = 10;
+WebInspector.TextEditor.HighlightAnimationDuration = 2000;
+
+WebInspector.TextEditor.Event = {
+ ExecutionLineNumberDidChange: "text-editor-execution-line-number-did-change",
+ NumberOfSearchResultsDidChange: "text-editor-number-of-search-results-did-change",
+ ContentDidChange: "text-editor-content-did-change",
+ FormattingDidChange: "text-editor-formatting-did-change"
+};
+
+WebInspector.TextEditor.prototype = {
+ constructor: WebInspector.TextEditor,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get string()
+ {
+ return this._codeMirror.getValue();
+ },
+
+ set string(newString)
+ {
+ function update()
+ {
+ this._codeMirror.setValue(newString);
+
+ if (this._initialStringNotSet) {
+ this._codeMirror.clearHistory();
+ this._codeMirror.markClean();
+ delete this._initialStringNotSet;
+ }
+
+ // Automatically format the content.
+ if (this._autoFormat) {
+ console.assert(!this.formatted);
+ this.formatted = true;
+ delete this._autoFormat;
+ }
+
+ // Update the execution line now that we might have content for that line.
+ this._updateExecutionLine();
+
+ // Set the breakpoint styles now that we might have content for those lines.
+ for (var lineNumber in this._breakpoints)
+ this._setBreakpointStylesOnLine(lineNumber);
+
+ // Try revealing the pending line now that we might have content with enough lines.
+ this._revealPendingPositionIfPossible();
+ }
+
+ this._ignoreCodeMirrorContentDidChangeEvent++;
+ this._codeMirror.operation(update.bind(this));
+ this._ignoreCodeMirrorContentDidChangeEvent--;
+ console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
+ },
+
+ get readOnly()
+ {
+ return this._codeMirror.getOption("readOnly") || false;
+ },
+
+ set readOnly(readOnly)
+ {
+ this._codeMirror.setOption("readOnly", readOnly);
+ },
+
+ get formatted()
+ {
+ return this._formatted;
+ },
+
+ set formatted(formatted)
+ {
+ if (this._formatted === formatted)
+ return;
+
+ console.assert(!formatted || this.canBeFormatted());
+ if (formatted && !this.canBeFormatted())
+ return;
+
+ this._ignoreCodeMirrorContentDidChangeEvent++;
+ this._prettyPrint(formatted);
+ this._ignoreCodeMirrorContentDidChangeEvent--;
+ console.assert(this._ignoreCodeMirrorContentDidChangeEvent >= 0);
+
+ this._formatted = formatted;
+
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
+ },
+
+ set autoFormat(auto)
+ {
+ this._autoFormat = auto;
+ },
+
+ hasFormatter: function()
+ {
+ const supportedModes = {
+ "javascript": true,
+ "css": true,
+ };
+
+ var mode = this._codeMirror.getMode();
+ return mode.name in supportedModes;
+ },
+
+ canBeFormatted: function()
+ {
+ // Can be overriden by subclasses.
+ return this.hasFormatter();
+ },
+
+ get selectedTextRange()
+ {
+ var start = this._codeMirror.getCursor(true);
+ var end = this._codeMirror.getCursor(false);
+ return this._textRangeFromCodeMirrorPosition(start, end);
+ },
+
+ set selectedTextRange(textRange)
+ {
+ var position = this._codeMirrorPositionFromTextRange(textRange);
+ this._codeMirror.setSelection(position.start, position.end);
+ },
+
+ get mimeType()
+ {
+ return this._mimeType;
+ },
+
+ set mimeType(newMIMEType)
+ {
+ newMIMEType = parseMIMEType(newMIMEType).type;
+
+ this._mimeType = newMIMEType;
+ this._codeMirror.setOption("mode", newMIMEType);
+ },
+
+ get executionLineNumber()
+ {
+ return this._executionLineNumber;
+ },
+
+ set executionLineNumber(lineNumber)
+ {
+ // Only return early if there isn't a line handle and that isn't changing.
+ if (!this._executionLineHandle && isNaN(lineNumber))
+ return;
+
+ this._executionLineNumber = lineNumber;
+ this._updateExecutionLine();
+
+ // Still dispatch the event even if the number didn't change. The execution state still
+ // could have changed (e.g. continuing in a loop with a breakpoint inside).
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange);
+ },
+
+ get executionColumnNumber()
+ {
+ return this._executionColumnNumber;
+ },
+
+ set executionColumnNumber(columnNumber)
+ {
+ this._executionColumnNumber = columnNumber;
+ },
+
+ get formatterSourceMap()
+ {
+ return this._formatterSourceMap;
+ },
+
+ get tokenTrackingController()
+ {
+ return this._tokenTrackingController;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ set delegate(newDelegate)
+ {
+ this._delegate = newDelegate || null;
+ },
+
+ get numberOfSearchResults()
+ {
+ return this._searchResults.length;
+ },
+
+ get currentSearchQuery()
+ {
+ return this._searchQuery;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ this._automaticallyRevealFirstSearchResult = reveal;
+
+ // If we haven't shown a search result yet, reveal one now.
+ if (this._automaticallyRevealFirstSearchResult && this._searchResults.length > 0) {
+ if (this._currentSearchResultIndex === -1)
+ this._revealFirstSearchResultAfterCursor();
+ }
+ },
+
+ performSearch: function(query)
+ {
+ if (this._searchQuery === query)
+ return;
+
+ this.searchCleared();
+
+ this._searchQuery = query;
+
+ // Allow subclasses to handle the searching if they have a better way.
+ // If we are formatted, just use CodeMirror's search.
+ if (typeof this.customPerformSearch === "function" && !this.formatted) {
+ if (this.customPerformSearch(query))
+ return;
+ }
+
+ // Go down the slow patch for all other text content.
+ var searchCursor = this._codeMirror.getSearchCursor(query, {line: 0, ch: 0}, true);
+ var boundBatchSearch = batchSearch.bind(this);
+ var numberOfSearchResultsDidChangeTimeout = null;
+
+ function reportNumberOfSearchResultsDidChange()
+ {
+ if (numberOfSearchResultsDidChangeTimeout) {
+ clearTimeout(numberOfSearchResultsDidChangeTimeout);
+ numberOfSearchResultsDidChangeTimeout = null;
+ }
+
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
+ }
+
+ function batchSearch()
+ {
+ // Bail if the query changed since we started.
+ if (this._searchQuery !== query)
+ return;
+
+ var newSearchResults = [];
+ var foundResult = false;
+ for (var i = 0; i < WebInspector.TextEditor.NumberOfFindsPerSearchBatch && (foundResult = searchCursor.findNext()); ++i) {
+ var textRange = this._textRangeFromCodeMirrorPosition(searchCursor.from(), searchCursor.to());
+ newSearchResults.push(textRange);
+ }
+
+ this.addSearchResults(newSearchResults);
+
+ // Don't report immediately, coalesce updates so they come in no faster than half a second.
+ if (!numberOfSearchResultsDidChangeTimeout)
+ numberOfSearchResultsDidChangeTimeout = setTimeout(reportNumberOfSearchResultsDidChange.bind(this), 500);
+
+ if (foundResult) {
+ // More lines to search, set a timeout so we don't block the UI long.
+ setTimeout(boundBatchSearch, 50);
+ } else {
+ // Report immediately now that we are finished, canceling any pending update.
+ reportNumberOfSearchResultsDidChange.call(this);
+ }
+ }
+
+ // Start the search.
+ boundBatchSearch();
+ },
+
+ addSearchResults: function(textRanges)
+ {
+ console.assert(textRanges);
+ if (!textRanges || !textRanges.length)
+ return;
+
+ function markRanges()
+ {
+ for (var i = 0; i < textRanges.length; ++i) {
+ var position = this._codeMirrorPositionFromTextRange(textRanges[i]);
+ var mark = this._codeMirror.markText(position.start, position.end, {className: WebInspector.TextEditor.SearchResultStyleClassName});
+ this._searchResults.push(mark);
+ }
+
+ // If we haven't shown a search result yet, reveal one now.
+ if (this._automaticallyRevealFirstSearchResult) {
+ if (this._currentSearchResultIndex === -1)
+ this._revealFirstSearchResultAfterCursor();
+ }
+ }
+
+ this._codeMirror.operation(markRanges.bind(this));
+ },
+
+ searchCleared: function()
+ {
+ function clearResults() {
+ for (var i = 0; i < this._searchResults.length; ++i)
+ this._searchResults[i].clear();
+ }
+
+ this._codeMirror.operation(clearResults.bind(this));
+
+ this._searchQuery = null;
+ this._searchResults = [];
+ this._currentSearchResultIndex = -1;
+ },
+
+ searchQueryWithSelection: function()
+ {
+ if (!this._codeMirror.somethingSelected())
+ return null;
+
+ return this._codeMirror.getSelection();
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ if (!this._searchResults.length)
+ return;
+
+ if (this._currentSearchResultIndex === -1 || this._cursorDoesNotMatchLastRevealedSearchResult()) {
+ this._revealFirstSearchResultBeforeCursor(changeFocus);
+ return;
+ }
+
+ if (this._currentSearchResultIndex > 0)
+ --this._currentSearchResultIndex;
+ else
+ this._currentSearchResultIndex = this._searchResults.length - 1;
+
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, -1);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ if (!this._searchResults.length)
+ return;
+
+ if (this._currentSearchResultIndex === -1 || this._cursorDoesNotMatchLastRevealedSearchResult()) {
+ this._revealFirstSearchResultAfterCursor(changeFocus);
+ return;
+ }
+
+ if (this._currentSearchResultIndex + 1 < this._searchResults.length)
+ ++this._currentSearchResultIndex;
+ else
+ this._currentSearchResultIndex = 0;
+
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, 1);
+ },
+
+ line: function(lineNumber)
+ {
+ return this._codeMirror.getLine(lineNumber);
+ },
+
+ revealPosition: function(position, textRangeToSelect, forceUnformatted, noHighlight)
+ {
+ console.assert(position === undefined || position instanceof WebInspector.SourceCodePosition, "revealPosition called without a SourceCodePosition");
+ if (!(position instanceof WebInspector.SourceCodePosition))
+ return;
+
+ var lineHandle = this._codeMirror.getLineHandle(position.lineNumber);
+ if (!lineHandle || !this._visible || this._initialStringNotSet) {
+ // If we can't get a line handle or are not visible then we wait to do the reveal.
+ this._positionToReveal = position;
+ this._textRangeToSelect = textRangeToSelect;
+ this._forceUnformatted = forceUnformatted;
+ return;
+ }
+
+ // Delete now that the reveal is happening.
+ delete this._positionToReveal;
+ delete this._textRangeToSelect;
+ delete this._forceUnformatted;
+
+ // If we need to unformat, reveal the line after a wait.
+ // Otherwise the line highlight doesn't work properly.
+ if (this._formatted && forceUnformatted) {
+ this.formatted = false;
+ setTimeout(this.revealPosition.bind(this), 0, position, textRangeToSelect);
+ return;
+ }
+
+ if (!textRangeToSelect)
+ textRangeToSelect = new WebInspector.TextRange(position.lineNumber, position.columnNumber, position.lineNumber, position.columnNumber);
+
+ function removeStyleClass()
+ {
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.HighlightedStyleClassName);
+ }
+
+ function revealAndHighlightLine()
+ {
+ // If the line is not visible, reveal it as the center line in the editor.
+ var position = this._codeMirrorPositionFromTextRange(textRangeToSelect);
+ if (!this._isPositionVisible(position.start))
+ this._scrollIntoViewCentered(position.start);
+
+ this.selectedTextRange = textRangeToSelect;
+
+ if (noHighlight)
+ return;
+
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.HighlightedStyleClassName);
+
+ // Use a timeout instead of a webkitAnimationEnd event listener because the line element might
+ // be removed if the user scrolls during the animation. In that case webkitAnimationEnd isn't
+ // fired, and the line would highlight again the next time it scrolls into view.
+ setTimeout(removeStyleClass.bind(this), WebInspector.TextEditor.HighlightAnimationDuration);
+ }
+
+ this._codeMirror.operation(revealAndHighlightLine.bind(this));
+ },
+
+ updateLayout: function(force)
+ {
+ this._codeMirror.refresh();
+ },
+
+ shown: function()
+ {
+ this._visible = true;
+
+ // Refresh since our size might have changed.
+ this._codeMirror.refresh();
+
+ // Try revealing the pending line now that we are visible.
+ // This needs to be done as a separate operation from the refresh
+ // so that the scrollInfo coordinates are correct.
+ this._revealPendingPositionIfPossible();
+ },
+
+ hidden: function()
+ {
+ this._visible = false;
+ },
+
+ setBreakpointInfoForLineAndColumn: function(lineNumber, columnNumber, breakpointInfo)
+ {
+ if (this._ignoreSetBreakpointInfoCalls)
+ return;
+
+ if (breakpointInfo)
+ this._addBreakpointToLineAndColumnWithInfo(lineNumber, columnNumber, breakpointInfo);
+ else
+ this._removeBreakpointFromLineAndColumn(lineNumber, columnNumber);
+ },
+
+ updateBreakpointLineAndColumn: function(oldLineNumber, oldColumnNumber, newLineNumber, newColumnNumber)
+ {
+ console.assert(this._breakpoints[oldLineNumber]);
+ if (!this._breakpoints[oldLineNumber])
+ return;
+
+ console.assert(this._breakpoints[oldLineNumber][oldColumnNumber]);
+ if (!this._breakpoints[oldLineNumber][oldColumnNumber])
+ return;
+
+ var breakpointInfo = this._breakpoints[oldLineNumber][oldColumnNumber];
+ this._removeBreakpointFromLineAndColumn(oldLineNumber, oldColumnNumber);
+ this._addBreakpointToLineAndColumnWithInfo(newLineNumber, newColumnNumber, breakpointInfo);
+ },
+
+ addStyleClassToLine: function(lineNumber, styleClassName)
+ {
+ var lineHandle = this._codeMirror.getLineHandle(lineNumber);
+ console.assert(lineHandle);
+ if (!lineHandle)
+ return;
+
+ return this._codeMirror.addLineClass(lineHandle, "wrap", styleClassName);
+ },
+
+ removeStyleClassFromLine: function(lineNumber, styleClassName)
+ {
+ var lineHandle = this._codeMirror.getLineHandle(lineNumber);
+ console.assert(lineHandle);
+ if (!lineHandle)
+ return;
+
+ return this._codeMirror.removeLineClass(lineHandle, "wrap", styleClassName);
+ },
+
+ toggleStyleClassForLine: function(lineNumber, styleClassName)
+ {
+ var lineHandle = this._codeMirror.getLineHandle(lineNumber);
+ console.assert(lineHandle);
+ if (!lineHandle)
+ return;
+
+ return this._codeMirror.toggleLineClass(lineHandle, "wrap", styleClassName);
+ },
+
+ get lineCount()
+ {
+ return this._codeMirror.lineCount();
+ },
+
+ focus: function()
+ {
+ this._codeMirror.focus();
+ },
+
+ contentDidChange: function(replacedRanges, newRanges)
+ {
+ // Implemented by subclasses.
+ },
+
+ rectsForRange: function(range)
+ {
+ return this._codeMirror.rectsForRange(range);
+ },
+
+ get markers()
+ {
+ return this._codeMirror.getAllMarks().map(function(codeMirrorTextMarker) {
+ return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
+ });
+ },
+
+ markersAtPosition: function(position)
+ {
+ return this._codeMirror.findMarksAt(position).map(function(codeMirrorTextMarker) {
+ return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
+ });
+ },
+
+ createColorMarkers: function(range)
+ {
+ return this._codeMirror.createColorMarkers(range);
+ },
+
+ createGradientMarkers: function(range)
+ {
+ return this._codeMirror.createGradientMarkers(range);
+ },
+
+ editingControllerForMarker: function(editableMarker)
+ {
+ switch (editableMarker.type) {
+ case WebInspector.TextMarker.Type.Color:
+ return new WebInspector.CodeMirrorColorEditingController(this._codeMirror, editableMarker);
+ case WebInspector.TextMarker.Type.Gradient:
+ return new WebInspector.CodeMirrorGradientEditingController(this._codeMirror, editableMarker);
+ default:
+ return new WebInspector.CodeMirrorEditingController(this._codeMirror, editableMarker);
+ }
+ },
+
+ // Private
+
+ _contentChanged: function(codeMirror, change)
+ {
+ if (this._ignoreCodeMirrorContentDidChangeEvent > 0)
+ return;
+
+ var replacedRanges = [];
+ var newRanges = [];
+ while (change) {
+ replacedRanges.push(new WebInspector.TextRange(
+ change.from.line,
+ change.from.ch,
+ change.to.line,
+ change.to.ch
+ ));
+ newRanges.push(new WebInspector.TextRange(
+ change.from.line,
+ change.from.ch,
+ change.from.line + change.text.length - 1,
+ change.text.length === 1 ? change.from.ch + change.text[0].length : change.text.lastValue.length
+ ));
+ change = change.next;
+ }
+ this.contentDidChange(replacedRanges, newRanges);
+
+ if (this._formatted) {
+ this._formatterSourceMap = null;
+ this._formatted = false;
+
+ if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function")
+ this._delegate.textEditorUpdatedFormatting(this);
+
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange);
+ }
+
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.ContentDidChange);
+ },
+
+ _textRangeFromCodeMirrorPosition: function(start, end)
+ {
+ console.assert(start);
+ console.assert(end);
+
+ return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch);
+ },
+
+ _codeMirrorPositionFromTextRange: function(textRange)
+ {
+ console.assert(textRange);
+
+ var start = {line: textRange.startLine, ch: textRange.startColumn};
+ var end = {line: textRange.endLine, ch: textRange.endColumn};
+ return {start: start, end: end};
+ },
+
+ _revealPendingPositionIfPossible: function()
+ {
+ // Nothing to do if we don't have a pending position.
+ if (!this._positionToReveal)
+ return;
+
+ // Don't try to reveal unless we are visible.
+ if (!this._visible)
+ return;
+
+ this.revealPosition(this._positionToReveal, this._textRangeToSelect, this._forceUnformatted);
+ },
+
+ _revealSearchResult: function(result, changeFocus, directionInCaseOfRevalidation)
+ {
+ var position = result.find();
+
+ // Check for a valid position, it might have been removed from editing by the user.
+ // If the position is invalide, revalidate all positions reveal as needed.
+ if (!position) {
+ this._revalidateSearchResults(directionInCaseOfRevalidation);
+ return;
+ }
+
+ // If the line is not visible, reveal it as the center line in the editor.
+ if (!this._isPositionVisible(position.from))
+ this._scrollIntoViewCentered(position.from);
+
+ // Update the text selection to select the search result.
+ this.selectedTextRange = this._textRangeFromCodeMirrorPosition(position.from, position.to);
+
+ // Remove the automatically reveal state now that we have revealed a search result.
+ this._automaticallyRevealFirstSearchResult = false;
+
+ // Focus the editor if requested.
+ if (changeFocus)
+ this._codeMirror.focus();
+
+ // Remove the bouncy highlight if it is still around. The animation will not
+ // start unless we remove it and add it back to the document.
+ if (this._bouncyHighlightElement)
+ this._bouncyHighlightElement.remove();
+
+ // Create the bouncy highlight.
+ this._bouncyHighlightElement = document.createElement("div");
+ this._bouncyHighlightElement.className = WebInspector.TextEditor.BouncyHighlightStyleClassName;
+
+ // Collect info for the bouncy highlight.
+ var textContent = this._codeMirror.getSelection();
+ var coordinates = this._codeMirror.cursorCoords(true, "page");
+
+ // Adjust the coordinates to be based in the text editor's space.
+ var textEditorRect = this._element.getBoundingClientRect();
+ coordinates.top -= textEditorRect.top;
+ coordinates.left -= textEditorRect.left;
+
+ // Position and show the bouncy highlight.
+ this._bouncyHighlightElement.textContent = textContent;
+ this._bouncyHighlightElement.style.top = coordinates.top + "px";
+ this._bouncyHighlightElement.style.left = coordinates.left + "px";
+ this._element.appendChild(this._bouncyHighlightElement);
+
+ function animationEnded()
+ {
+ if (!this._bouncyHighlightElement)
+ return;
+
+ this._bouncyHighlightElement.remove();
+ delete this._bouncyHighlightElement;
+ }
+
+ // Listen for the end of the animation so we can remove the element.
+ this._bouncyHighlightElement.addEventListener("webkitAnimationEnd", animationEnded.bind(this));
+ },
+
+ _binarySearchInsertionIndexInSearchResults: function(object, comparator)
+ {
+ // It is possible that markers in the search results array may have been deleted.
+ // In those cases the comparator will return "null" and we immediately stop
+ // the binary search and return null. The search results list needs to be updated.
+ var array = this._searchResults;
+
+ var first = 0;
+ var last = array.length - 1;
+
+ while (first <= last) {
+ var mid = (first + last) >> 1;
+ var c = comparator(object, array[mid]);
+ if (c === null)
+ return null;
+ if (c > 0)
+ first = mid + 1;
+ else if (c < 0)
+ last = mid - 1;
+ else
+ return mid;
+ }
+
+ return first - 1;
+ },
+
+ _revealFirstSearchResultBeforeCursor: function(changeFocus)
+ {
+ console.assert(this._searchResults.length);
+
+ var currentCursorPosition = this._codeMirror.getCursor("start");
+ if (currentCursorPosition.line === 0 && currentCursorPosition.ch === 0) {
+ this._currentSearchResultIndex = this._searchResults.length - 1;
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, -1);
+ return;
+ }
+
+ var index = this._binarySearchInsertionIndexInSearchResults(currentCursorPosition, function(current, searchResult) {
+ var searchResultMarker = searchResult.find();
+ if (!searchResultMarker)
+ return null;
+ return WebInspector.compareCodeMirrorPositions(current, searchResultMarker.from);
+ });
+
+ if (index === null) {
+ this._revalidateSearchResults(-1);
+ return;
+ }
+
+ this._currentSearchResultIndex = index;
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus);
+ },
+
+ _revealFirstSearchResultAfterCursor: function(changeFocus)
+ {
+ console.assert(this._searchResults.length);
+
+ var currentCursorPosition = this._codeMirror.getCursor("start");
+ if (currentCursorPosition.line === 0 && currentCursorPosition.ch === 0) {
+ this._currentSearchResultIndex = 0;
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus, 1);
+ return;
+ }
+
+ var index = this._binarySearchInsertionIndexInSearchResults(currentCursorPosition, function(current, searchResult) {
+ var searchResultMarker = searchResult.find();
+ if (!searchResultMarker)
+ return null;
+ return WebInspector.compareCodeMirrorPositions(current, searchResultMarker.from);
+ });
+
+ if (index === null) {
+ this._revalidateSearchResults(1);
+ return;
+ }
+
+ if (index + 1 < this._searchResults.length)
+ ++index;
+ else
+ index = 0;
+
+ this._currentSearchResultIndex = index;
+ this._revealSearchResult(this._searchResults[this._currentSearchResultIndex], changeFocus);
+ },
+
+ _cursorDoesNotMatchLastRevealedSearchResult: function()
+ {
+ console.assert(this._currentSearchResultIndex !== -1);
+ console.assert(this._searchResults.length);
+
+ var lastRevealedSearchResultMarker = this._searchResults[this._currentSearchResultIndex].find();
+ if (!lastRevealedSearchResultMarker)
+ return true;
+
+ var currentCursorPosition = this._codeMirror.getCursor("start");
+ var lastRevealedSearchResultPosition = lastRevealedSearchResultMarker.from;
+
+ return WebInspector.compareCodeMirrorPositions(currentCursorPosition, lastRevealedSearchResultPosition) !== 0;
+ },
+
+ _revalidateSearchResults: function(direction)
+ {
+ console.assert(direction !== undefined);
+
+ this._currentSearchResultIndex = -1;
+
+ var updatedSearchResults = [];
+ for (var i = 0; i < this._searchResults.length; ++i) {
+ if (this._searchResults[i].find())
+ updatedSearchResults.push(this._searchResults[i]);
+ }
+
+ console.assert(updatedSearchResults.length !== this._searchResults.length);
+
+ this._searchResults = updatedSearchResults;
+ this.dispatchEventToListeners(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange);
+
+ if (this._searchResults.length) {
+ if (direction > 0)
+ this._revealFirstSearchResultAfterCursor();
+ else
+ this._revealFirstSearchResultBeforeCursor();
+ }
+ },
+
+ _updateExecutionLine: function()
+ {
+ function update()
+ {
+ if (this._executionLineHandle)
+ this._codeMirror.removeLineClass(this._executionLineHandle, "wrap", WebInspector.TextEditor.ExecutionLineStyleClassName);
+
+ this._executionLineHandle = !isNaN(this._executionLineNumber) ? this._codeMirror.getLineHandle(this._executionLineNumber) : null;
+
+ if (this._executionLineHandle)
+ this._codeMirror.addLineClass(this._executionLineHandle, "wrap", WebInspector.TextEditor.ExecutionLineStyleClassName);
+ }
+
+ this._codeMirror.operation(update.bind(this));
+ },
+
+ _setBreakpointStylesOnLine: function(lineNumber)
+ {
+ var columnBreakpoints = this._breakpoints[lineNumber];
+ console.assert(columnBreakpoints);
+ if (!columnBreakpoints)
+ return;
+
+ var allDisabled = true;
+ var allResolved = true;
+ var allAutoContinue = true;
+ var multiple = Object.keys(columnBreakpoints).length > 1;
+ for (var columnNumber in columnBreakpoints) {
+ var breakpointInfo = columnBreakpoints[columnNumber];
+ if (!breakpointInfo.disabled)
+ allDisabled = false;
+ if (!breakpointInfo.resolved)
+ allResolved = false;
+ if (!breakpointInfo.autoContinue)
+ allAutoContinue = false;
+ }
+
+ function updateStyles()
+ {
+ // We might not have a line if the content isn't fully populated yet.
+ // This will be called again when the content is available.
+ var lineHandle = this._codeMirror.getLineHandle(lineNumber);
+ if (!lineHandle)
+ return;
+
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName);
+
+ if (allResolved)
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
+ else
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
+
+ if (allDisabled)
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
+ else
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
+
+ if (allAutoContinue)
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
+ else
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
+
+ if (multiple)
+ this._codeMirror.addLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
+ else
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
+ }
+
+ this._codeMirror.operation(updateStyles.bind(this));
+ },
+
+ _addBreakpointToLineAndColumnWithInfo: function(lineNumber, columnNumber, breakpointInfo)
+ {
+ if (!this._breakpoints[lineNumber])
+ this._breakpoints[lineNumber] = {};
+ this._breakpoints[lineNumber][columnNumber] = breakpointInfo;
+
+ this._setBreakpointStylesOnLine(lineNumber);
+ },
+
+ _removeBreakpointFromLineAndColumn: function(lineNumber, columnNumber)
+ {
+ console.assert(columnNumber in this._breakpoints[lineNumber]);
+ delete this._breakpoints[lineNumber][columnNumber];
+
+ // There are still breakpoints on the line. Update the breakpoint style.
+ if (!isEmptyObject(this._breakpoints[lineNumber])) {
+ this._setBreakpointStylesOnLine(lineNumber);
+ return;
+ }
+
+ delete this._breakpoints[lineNumber];
+
+ function updateStyles()
+ {
+ var lineHandle = this._codeMirror.getLineHandle(lineNumber);
+ if (!lineHandle)
+ return;
+
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName);
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointResolvedStyleClassName);
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointDisabledStyleClassName);
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.BreakpointAutoContinueStyleClassName);
+ this._codeMirror.removeLineClass(lineHandle, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName);
+ }
+
+ this._codeMirror.operation(updateStyles.bind(this));
+ },
+
+ _allColumnBreakpointInfoForLine: function(lineNumber)
+ {
+ return this._breakpoints[lineNumber];
+ },
+
+ _setColumnBreakpointInfoForLine: function(lineNumber, columnBreakpointInfo)
+ {
+ console.assert(columnBreakpointInfo);
+ this._breakpoints[lineNumber] = columnBreakpointInfo;
+ this._setBreakpointStylesOnLine(lineNumber);
+ },
+
+ _gutterMouseDown: function(codeMirror, lineNumber, gutterElement, event)
+ {
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ if (!this._codeMirror.hasLineClass(lineNumber, "wrap", WebInspector.TextEditor.HasBreakpointStyleClassName)) {
+ console.assert(!(lineNumber in this._breakpoints));
+
+ // No breakpoint, add a new one.
+ if (this._delegate && typeof this._delegate.textEditorBreakpointAdded === "function") {
+ var data = this._delegate.textEditorBreakpointAdded(this, lineNumber, 0);
+ if (data) {
+ var breakpointInfo = data.breakpointInfo;
+ if (breakpointInfo)
+ this._addBreakpointToLineAndColumnWithInfo(data.lineNumber, data.columnNumber, breakpointInfo);
+ }
+ }
+
+ return;
+ }
+
+ console.assert(lineNumber in this._breakpoints);
+
+ if (this._codeMirror.hasLineClass(lineNumber, "wrap", WebInspector.TextEditor.MultipleBreakpointsStyleClassName)) {
+ console.assert(!isEmptyObject(this._breakpoints[lineNumber]));
+ return;
+ }
+
+ // Single existing breakpoint, start tracking it for dragging.
+ console.assert(Object.keys(this._breakpoints[lineNumber]).length === 1);
+ var columnNumber = Object.keys(this._breakpoints[lineNumber])[0];
+ this._draggingBreakpointInfo = this._breakpoints[lineNumber][columnNumber];
+ this._lineNumberWithMousedDownBreakpoint = lineNumber;
+ this._lineNumberWithDraggedBreakpoint = lineNumber;
+ this._columnNumberWithMousedDownBreakpoint = columnNumber;
+ this._columnNumberWithDraggedBreakpoint = columnNumber;
+
+ this._documentMouseMovedEventListener = this._documentMouseMoved.bind(this);
+ this._documentMouseUpEventListener = this._documentMouseUp.bind(this);
+
+ // Register these listeners on the document so we can track the mouse if it leaves the gutter.
+ document.addEventListener("mousemove", this._documentMouseMovedEventListener, true);
+ document.addEventListener("mouseup", this._documentMouseUpEventListener, true);
+ },
+
+ _gutterContextMenu: function(codeMirror, lineNumber, gutterElement, event)
+ {
+ if (this._delegate && typeof this._delegate.textEditorGutterContextMenu === "function") {
+ var breakpoints = [];
+ for (var columnNumber in this._breakpoints[lineNumber])
+ breakpoints.push({lineNumber:lineNumber, columnNumber:columnNumber});
+
+ this._delegate.textEditorGutterContextMenu(this, lineNumber, 0, breakpoints, event);
+ }
+ },
+
+ _documentMouseMoved: function(event)
+ {
+ console.assert("_lineNumberWithMousedDownBreakpoint" in this);
+ if (!("_lineNumberWithMousedDownBreakpoint" in this))
+ return;
+
+ event.preventDefault();
+
+ var lineNumber;
+ var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
+
+ // CodeMirror's coordsChar returns a position even if it is outside the bounds. Nullify the position
+ // if the event is outside the bounds of the gutter so we will remove the breakpoint.
+ var gutterBounds = this._codeMirror.getGutterElement().getBoundingClientRect();
+ if (event.pageX < gutterBounds.left || event.pageX > gutterBounds.right || event.pageY < gutterBounds.top || event.pageY > gutterBounds.bottom)
+ position = null;
+
+ // If we have a position and it has a line then use it.
+ if (position && "line" in position)
+ lineNumber = position.line;
+
+ // The _lineNumberWithDraggedBreakpoint property can be undefined if the user drags
+ // outside of the gutter. The lineNumber variable can be undefined for the same reason.
+
+ if (lineNumber === this._lineNumberWithDraggedBreakpoint)
+ return;
+
+ // Record that the mouse dragged some so when mouse up fires we know to do the
+ // work of removing and moving the breakpoint.
+ this._mouseDragged = true;
+
+ if ("_lineNumberWithDraggedBreakpoint" in this) {
+ // We have a line that is currently showing the dragged breakpoint. Remove that breakpoint
+ // and restore the previous one (if any.)
+ if (this._previousColumnBreakpointInfo)
+ this._setColumnBreakpointInfoForLine(this._lineNumberWithDraggedBreakpoint, this._previousColumnBreakpointInfo);
+ else
+ this._removeBreakpointFromLineAndColumn(this._lineNumberWithDraggedBreakpoint, this._columnNumberWithDraggedBreakpoint);
+
+ delete this._previousColumnBreakpointInfo;
+ delete this._lineNumberWithDraggedBreakpoint;
+ delete this._columnNumberWithDraggedBreakpoint;
+ }
+
+ if (lineNumber !== undefined) {
+ // We have a new line that will now show the dragged breakpoint.
+ var newColumnBreakpoints = {};
+ var columnNumber = (lineNumber === this._lineNumberWithMousedDownBreakpoint ? this._columnNumberWithDraggedBreakpoint : 0);
+ newColumnBreakpoints[columnNumber] = this._draggingBreakpointInfo;
+ this._previousColumnBreakpointInfo = this._allColumnBreakpointInfoForLine(lineNumber);
+ this._setColumnBreakpointInfoForLine(lineNumber, newColumnBreakpoints);
+ this._lineNumberWithDraggedBreakpoint = lineNumber;
+ this._columnNumberWithDraggedBreakpoint = columnNumber;
+ }
+ },
+
+ _documentMouseUp: function(event)
+ {
+ console.assert("_lineNumberWithMousedDownBreakpoint" in this);
+ if (!("_lineNumberWithMousedDownBreakpoint" in this))
+ return;
+
+ event.preventDefault();
+
+ document.removeEventListener("mousemove", this._documentMouseMovedEventListener, true);
+ document.removeEventListener("mouseup", this._documentMouseUpEventListener, true);
+
+ const delegateImplementsBreakpointClicked = this._delegate && typeof this._delegate.textEditorBreakpointClicked === "function";
+ const delegateImplementsBreakpointRemoved = this._delegate && typeof this._delegate.textEditorBreakpointRemoved === "function";
+ const delegateImplementsBreakpointMoved = this._delegate && typeof this._delegate.textEditorBreakpointMoved === "function";
+
+ if (this._mouseDragged) {
+ if (!("_lineNumberWithDraggedBreakpoint" in this)) {
+ // The breakpoint was dragged off the gutter, remove it.
+ if (delegateImplementsBreakpointRemoved) {
+ this._ignoreSetBreakpointInfoCalls = true;
+ this._delegate.textEditorBreakpointRemoved(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint);
+ delete this._ignoreSetBreakpointInfoCalls;
+ }
+ } else if (this._lineNumberWithMousedDownBreakpoint !== this._lineNumberWithDraggedBreakpoint) {
+ // The dragged breakpoint was moved to a new line.
+
+ // If there is are breakpoints already at the drop line, tell the delegate to remove them.
+ // We have already updated the breakpoint info internally, so when the delegate removes the breakpoints
+ // and tells us to clear the breakpoint info, we can ignore those calls.
+ if (this._previousColumnBreakpointInfo && delegateImplementsBreakpointRemoved) {
+ this._ignoreSetBreakpointInfoCalls = true;
+ for (var columnNumber in this._previousColumnBreakpointInfo)
+ this._delegate.textEditorBreakpointRemoved(this, this._lineNumberWithDraggedBreakpoint, columnNumber);
+ delete this._ignoreSetBreakpointInfoCalls;
+ }
+
+ // Tell the delegate to move the breakpoint from one line to another.
+ if (delegateImplementsBreakpointMoved) {
+ this._ignoreSetBreakpointInfoCalls = true;
+ this._delegate.textEditorBreakpointMoved(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint, this._lineNumberWithDraggedBreakpoint, this._columnNumberWithDraggedBreakpoint);
+ delete this._ignoreSetBreakpointInfoCalls;
+ }
+ }
+ } else {
+ // Toggle the disabled state of the breakpoint.
+ console.assert(this._lineNumberWithMousedDownBreakpoint in this._breakpoints);
+ console.assert(this._columnNumberWithMousedDownBreakpoint in this._breakpoints[this._lineNumberWithMousedDownBreakpoint]);
+ if (this._lineNumberWithMousedDownBreakpoint in this._breakpoints && this._columnNumberWithMousedDownBreakpoint in this._breakpoints[this._lineNumberWithMousedDownBreakpoint] && delegateImplementsBreakpointClicked)
+ this._delegate.textEditorBreakpointClicked(this, this._lineNumberWithMousedDownBreakpoint, this._columnNumberWithMousedDownBreakpoint);
+ }
+
+ delete this._documentMouseMovedEventListener;
+ delete this._documentMouseUpEventListener;
+ delete this._lineNumberWithMousedDownBreakpoint;
+ delete this._lineNumberWithDraggedBreakpoint;
+ delete this._columnNumberWithMousedDownBreakpoint;
+ delete this._columnNumberWithDraggedBreakpoint;
+ delete this._previousColumnBreakpointInfo;
+ delete this._mouseDragged;
+ },
+
+ _openClickedLinks: function(event)
+ {
+ // Get the position in the text and the token at that position.
+ var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
+ var tokenInfo = this._codeMirror.getTokenAt(position);
+ if (!tokenInfo || !tokenInfo.type || !tokenInfo.string)
+ return;
+
+ // If the token is not a link, then ignore it.
+ if (!/\blink\b/.test(tokenInfo.type))
+ return;
+
+ // The token string is the URL we should open. It might be a relative URL.
+ var url = tokenInfo.string;
+
+ // Get the base URL.
+ var baseURL = "";
+ if (this._delegate && typeof this._delegate.textEditorBaseURL === "function")
+ baseURL = this._delegate.textEditorBaseURL(this);
+
+ // Open the link after resolving the absolute URL from the base URL.
+ WebInspector.openURL(absoluteURL(url, baseURL));
+
+ // Stop processing the event.
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _isPositionVisible: function(position)
+ {
+ var scrollInfo = this._codeMirror.getScrollInfo();
+ var visibleRangeStart = scrollInfo.top;
+ var visibleRangeEnd = visibleRangeStart + scrollInfo.clientHeight;
+ var coords = this._codeMirror.charCoords(position, "local");
+
+ return coords.top >= visibleRangeStart && coords.bottom <= visibleRangeEnd;
+ },
+
+ _scrollIntoViewCentered: function(position)
+ {
+ var scrollInfo = this._codeMirror.getScrollInfo();
+ var lineHeight = Math.ceil(this._codeMirror.defaultTextHeight());
+ var margin = Math.floor((scrollInfo.clientHeight - lineHeight) / 2);
+ this._codeMirror.scrollIntoView(position, margin);
+ },
+
+ _prettyPrint: function(pretty)
+ {
+ function prettyPrintAndUpdateEditor()
+ {
+ const start = {line: 0, ch: 0};
+ const end = {line: this._codeMirror.lineCount() - 1};
+
+ var oldSelectionAnchor = this._codeMirror.getCursor("anchor");
+ var oldSelectionHead = this._codeMirror.getCursor("head");
+ var newSelectionAnchor, newSelectionHead;
+ var newExecutionLocation = null;
+
+ if (pretty) {
+ // <rdar://problem/10593948> Provide a way to change the tab width in the Web Inspector
+ const indentString = " ";
+ var originalLineEndings = [];
+ var formattedLineEndings = [];
+ var mapping = {original: [0], formatted: [0]};
+ var builder = new FormatterContentBuilder(mapping, originalLineEndings, formattedLineEndings, 0, 0, indentString);
+ var formatter = new Formatter(this._codeMirror, builder);
+ formatter.format(start, end);
+
+ this._formatterSourceMap = WebInspector.FormatterSourceMap.fromBuilder(builder);
+
+ this._codeMirror.setValue(builder.formattedContent);
+
+ if (this._positionToReveal) {
+ var newRevealPosition = this._formatterSourceMap.originalToFormatted(this._positionToReveal.lineNumber, this._positionToReveal.columnNumber);
+ this._positionToReveal = new WebInspector.SourceCodePosition(newRevealPosition.lineNumber, newRevealPosition.columnNumber);
+ }
+
+ if (this._textRangeToSelect) {
+ var mappedRevealSelectionStart = this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.startLine, this._textRangeToSelect.startColumn);
+ var mappedRevealSelectionEnd = this._formatterSourceMap.originalToFormatted(this._textRangeToSelect.endLine, this._textRangeToSelect.endColumn);
+ this._textRangeToSelect = new WebInspector.TextRange(mappedRevealSelectionStart.lineNumber, mappedRevealSelectionStart.columnNumber, mappedRevealSelectionEnd.lineNumber, mappedRevealSelectionEnd.columnNumber);
+ }
+
+ if (!isNaN(this._executionLineNumber)) {
+ console.assert(!isNaN(this._executionColumnNumber));
+ newExecutionLocation = this._formatterSourceMap.originalToFormatted(this._executionLineNumber, this._executionColumnNumber);
+ }
+
+ var mappedAnchorLocation = this._formatterSourceMap.originalToFormatted(oldSelectionAnchor.line, oldSelectionAnchor.ch);
+ var mappedHeadLocation = this._formatterSourceMap.originalToFormatted(oldSelectionHead.line, oldSelectionHead.ch);
+ newSelectionAnchor = {line:mappedAnchorLocation.lineNumber, ch:mappedAnchorLocation.columnNumber};
+ newSelectionHead = {line:mappedHeadLocation.lineNumber, ch:mappedHeadLocation.columnNumber};
+ } else {
+ this._codeMirror.undo();
+
+ if (this._positionToReveal) {
+ var newRevealPosition = this._formatterSourceMap.formattedToOriginal(this._positionToReveal.lineNumber, this._positionToReveal.columnNumber);
+ this._positionToReveal = new WebInspector.SourceCodePosition(newRevealPosition.lineNumber, newRevealPosition.columnNumber);
+ }
+
+ if (this._textRangeToSelect) {
+ var mappedRevealSelectionStart = this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.startLine, this._textRangeToSelect.startColumn);
+ var mappedRevealSelectionEnd = this._formatterSourceMap.formattedToOriginal(this._textRangeToSelect.endLine, this._textRangeToSelect.endColumn);
+ this._textRangeToSelect = new WebInspector.TextRange(mappedRevealSelectionStart.lineNumber, mappedRevealSelectionStart.columnNumber, mappedRevealSelectionEnd.lineNumber, mappedRevealSelectionEnd.columnNumber);
+ }
+
+ if (!isNaN(this._executionLineNumber)) {
+ console.assert(!isNaN(this._executionColumnNumber));
+ newExecutionLocation = this._formatterSourceMap.formattedToOriginal(this._executionLineNumber, this._executionColumnNumber);
+ }
+
+ var mappedAnchorLocation = this._formatterSourceMap.formattedToOriginal(oldSelectionAnchor.line, oldSelectionAnchor.ch);
+ var mappedHeadLocation = this._formatterSourceMap.formattedToOriginal(oldSelectionHead.line, oldSelectionHead.ch);
+ newSelectionAnchor = {line:mappedAnchorLocation.lineNumber, ch:mappedAnchorLocation.columnNumber};
+ newSelectionHead = {line:mappedHeadLocation.lineNumber, ch:mappedHeadLocation.columnNumber};
+
+ this._formatterSourceMap = null;
+ }
+
+ this._scrollIntoViewCentered(newSelectionAnchor);
+ this._codeMirror.setSelection(newSelectionAnchor, newSelectionHead);
+
+ if (newExecutionLocation) {
+ delete this._executionLineHandle;
+ this.executionColumnNumber = newExecutionLocation.columnNumber;
+ this.executionLineNumber = newExecutionLocation.lineNumber;
+ }
+
+ // FIXME: <rdar://problem/13129955> FindBanner: New searches should not lose search position (start from current selection/caret)
+ if (this.currentSearchQuery) {
+ var searchQuery = this.currentSearchQuery;
+ this.searchCleared();
+ // Set timeout so that this happens after the current CodeMirror operation.
+ // The editor has to update for the value and selection changes.
+ setTimeout(function(query) {
+ this.performSearch(searchQuery);
+ }.bind(this), 0);
+ }
+
+ if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function")
+ this._delegate.textEditorUpdatedFormatting(this);
+ }
+
+ this._codeMirror.operation(prettyPrintAndUpdateEditor.bind(this));
+ }
+};
+
+WebInspector.TextEditor.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextResourceContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.resource.text > .text-editor {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextResourceContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTextResourceContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TextResourceContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,243 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TextResourceContentView = function(resource)
+{
+ WebInspector.ResourceContentView.call(this, resource, WebInspector.TextResourceContentView.StyleClassName);
+
+ resource.addEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._sourceCodeContentDidChange, this);
+
+ this._textEditor = new WebInspector.SourceCodeTextEditor(resource);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.NumberOfSearchResultsDidChange, this._numberOfSearchResultsDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.ContentDidChange, this._textEditorContentDidChange, this);
+ this._textEditor.addEventListener(WebInspector.TextEditor.Event.FormattingDidChange, this._textEditorFormattingDidChange, this);
+ this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentWillPopulate, this._contentWillPopulate, this);
+ this._textEditor.addEventListener(WebInspector.SourceCodeTextEditor.Event.ContentDidPopulate, this._contentDidPopulate, this);
+
+ WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetAdded, this._probeSetsChanged, this);
+ WebInspector.probeManager.addEventListener(WebInspector.ProbeManager.Event.ProbeSetRemoved, this._probeSetsChanged, this);
+
+ var toolTip = WebInspector.UIString("Pretty print");
+ var activatedToolTip = WebInspector.UIString("Original formatting");
+ this._prettyPrintButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("pretty-print", toolTip, activatedToolTip, "Images/NavigationItemCurleyBraces.svg", 16, 16);
+ this._prettyPrintButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._togglePrettyPrint, this);
+ this._prettyPrintButtonNavigationItem.enabled = false; // Enabled when the text editor is populated with content.
+};
+
+WebInspector.TextResourceContentView.StyleClassName = "text";
+
+WebInspector.TextResourceContentView.prototype = {
+ constructor: WebInspector.TextResourceContentView,
+
+ // Public
+
+ get navigationItems()
+ {
+ return [this._prettyPrintButtonNavigationItem];
+ },
+
+ get managesOwnIssues()
+ {
+ // SourceCodeTextEditor manages the issues, we don't need ResourceContentView doing it.
+ return true;
+ },
+
+ get textEditor()
+ {
+ return this._textEditor;
+ },
+
+ get supplementalRepresentedObjects()
+ {
+ var objects = WebInspector.probeManager.probeSets.filter(function(probeSet) {
+ return this._resource.url === probeSet.breakpoint.url;
+ }.bind(this));
+
+ // If the SourceCodeTextEditor has an executionLineNumber, we can assume
+ // it is always the active call frame.
+ if (!isNaN(this._textEditor.executionLineNumber))
+ objects.push(WebInspector.debuggerManager.activeCallFrame);
+
+ return objects;
+ },
+
+ revealPosition: function(position, textRangeToSelect, forceUnformatted)
+ {
+ this._textEditor.revealPosition(position, textRangeToSelect, forceUnformatted);
+ },
+
+ shown: function()
+ {
+ WebInspector.ResourceContentView.prototype.shown.call(this);
+
+ this._textEditor.shown();
+ },
+
+ hidden: function()
+ {
+ WebInspector.ResourceContentView.prototype.hidden.call(this);
+
+ this._textEditor.hidden();
+ },
+
+ closed: function()
+ {
+ WebInspector.ResourceContentView.prototype.closed.call(this);
+
+ this.resource.removeEventListener(WebInspector.SourceCode.Event.ContentDidChange, this._sourceCodeContentDidChange, this);
+
+ this._textEditor.close();
+ },
+
+ get supportsSave()
+ {
+ return true;
+ },
+
+ get saveData()
+ {
+ return {url: this.resource.url, content: this._textEditor.string};
+ },
+
+ get supportsSearch()
+ {
+ return true;
+ },
+
+ get numberOfSearchResults()
+ {
+ return this._textEditor.numberOfSearchResults;
+ },
+
+ get hasPerformedSearch()
+ {
+ return this._textEditor.currentSearchQuery !== null;
+ },
+
+ set automaticallyRevealFirstSearchResult(reveal)
+ {
+ this._textEditor.automaticallyRevealFirstSearchResult = reveal;
+ },
+
+ performSearch: function(query)
+ {
+ this._textEditor.performSearch(query);
+ },
+
+ searchCleared: function()
+ {
+ this._textEditor.searchCleared();
+ },
+
+ searchQueryWithSelection: function()
+ {
+ return this._textEditor.searchQueryWithSelection();
+ },
+
+ revealPreviousSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealPreviousSearchResult(changeFocus);
+ },
+
+ revealNextSearchResult: function(changeFocus)
+ {
+ this._textEditor.revealNextSearchResult(changeFocus);
+ },
+
+ updateLayout: function()
+ {
+ this._textEditor.updateLayout();
+ },
+
+ // Private
+
+ _contentWillPopulate: function(event)
+ {
+ if (this._textEditor.element.parentNode === this.element)
+ return;
+
+ // Check the MIME-type for CSS since Resource.Type.Stylesheet also includes XSL, which we can't edit yet.
+ if (this.resource.type === WebInspector.Resource.Type.Stylesheet && this.resource.syntheticMIMEType === "text/css")
+ this._textEditor.readOnly = false;
+
+ // Allow editing any local file since edits can be saved and reloaded right from the Inspector.
+ if (this.resource.urlComponents.scheme === "file")
+ this._textEditor.readOnly = false;
+
+ this.element.removeChildren();
+ this.element.appendChild(this._textEditor.element);
+ },
+
+ _contentDidPopulate: function(event)
+ {
+ this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
+ },
+
+ _togglePrettyPrint: function(event)
+ {
+ var activated = !this._prettyPrintButtonNavigationItem.activated;
+ this._textEditor.formatted = activated;
+ },
+
+ _textEditorFormattingDidChange: function(event)
+ {
+ this._prettyPrintButtonNavigationItem.activated = this._textEditor.formatted;
+ },
+
+ _sourceCodeContentDidChange: function(event)
+ {
+ if (this._ignoreSourceCodeContentDidChangeEvent)
+ return;
+
+ this._textEditor.string = this.resource.currentRevision.content;
+ },
+
+ _textEditorContentDidChange: function(event)
+ {
+ this._ignoreSourceCodeContentDidChangeEvent = true;
+ WebInspector.branchManager.currentBranch.revisionForRepresentedObject(this.resource).content = this._textEditor.string;
+ delete this._ignoreSourceCodeContentDidChangeEvent;
+ },
+
+ _executionLineNumberDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
+ },
+
+ _numberOfSearchResultsDidChange: function(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NumberOfSearchResultsDidChange);
+ },
+
+ _probeSetsChanged: function(event)
+ {
+ var breakpoint = event.data.probeSet.breakpoint;
+ if (breakpoint.sourceCodeLocation.sourceCode === this.resource)
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange);
+ }
+};
+
+WebInspector.TextResourceContentView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineContentViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.content-view.timeline > .timeline-overview {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 130px;
+}
+
+.content-view.timeline > .view-container {
+ position: absolute;
+ top: 130px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: hidden;
+}
+
+.content-view.timeline > .view-container > .timeline-view > .data-grid td {
+ height: 16px;
+ line-height: 16px;
+}
+
+.content-view.timeline > .view-container > .timeline-view > .data-grid table.data {
+ background-image: -webkit-linear-gradient(top, white, white 50%, rgb(243, 243, 243) 50%, rgb(243, 243, 243));
+ background-size: 100% 40px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineContentViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,427 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineContentView = function(recording)
+{
+ WebInspector.ContentView.call(this, recording);
+
+ this._recording = recording;
+
+ this.element.classList.add(WebInspector.TimelineContentView.StyleClassName);
+
+ this._discreteTimelineOverviewGraphMap = new Map;
+ this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimelineOverviewGraph(recording));
+ this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.LayoutTimelineOverviewGraph(recording));
+ this._discreteTimelineOverviewGraphMap.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.ScriptTimelineOverviewGraph(recording));
+
+ this._timelineOverview = new WebInspector.TimelineOverview(this._discreteTimelineOverviewGraphMap);
+ this._timelineOverview.addEventListener(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
+ this.element.appendChild(this._timelineOverview.element);
+
+ this._viewContainer = document.createElement("div");
+ this._viewContainer.classList.add(WebInspector.TimelineContentView.ViewContainerStyleClassName);
+ this.element.appendChild(this._viewContainer);
+
+ this._clearTimelineNavigationItem = new WebInspector.ButtonNavigationItem("clear-timeline", WebInspector.UIString("Clear Timeline"), "Images/NavigationItemTrash.svg", 16, 16);
+ this._clearTimelineNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearTimeline, this);
+
+ this._overviewTimelineView = new WebInspector.OverviewTimelineView(recording);
+
+ this._discreteTimelineViewMap = new Map;
+ this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Network, new WebInspector.NetworkTimelineView(recording));
+ this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Layout, new WebInspector.LayoutTimelineView(recording));
+ this._discreteTimelineViewMap.set(WebInspector.TimelineRecord.Type.Script, new WebInspector.ScriptTimelineView(recording));
+
+ function createPathComponent(displayName, className, representedObject)
+ {
+ var pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, representedObject);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ return pathComponent;
+ }
+
+ this._pathComponentMap = new Map;
+ this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Network, createPathComponent.call(this, WebInspector.UIString("Network Requests"), WebInspector.TimelineSidebarPanel.NetworkIconStyleClass, WebInspector.TimelineRecord.Type.Network));
+ this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Layout, createPathComponent.call(this, WebInspector.UIString("Layout & Rendering"), WebInspector.TimelineSidebarPanel.ColorsIconStyleClass, WebInspector.TimelineRecord.Type.Layout));
+ this._pathComponentMap.set(WebInspector.TimelineRecord.Type.Script, createPathComponent.call(this, WebInspector.UIString("JavaScript & Events"), WebInspector.TimelineSidebarPanel.ScriptIconStyleClass, WebInspector.TimelineRecord.Type.Script));
+
+ var previousPathComponent = null;
+ for (var pathComponent of this._pathComponentMap.values()) {
+ if (previousPathComponent) {
+ previousPathComponent.nextSibling = pathComponent;
+ pathComponent.previousSibling = previousPathComponent;
+ }
+
+ previousPathComponent = pathComponent;
+ }
+
+ this._currentTimelineView = null;
+ this._currentTimelineViewIdentifier = null;
+
+ this._updating = false;
+ this._currentTime = NaN;
+ this._lastUpdateTimestamp = NaN;
+ this._startTimeNeedsReset = true;
+
+ recording.addEventListener(WebInspector.TimelineRecording.Event.Reset, this._recordingReset, this);
+
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStarted, this._recordingStarted, this);
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
+
+ this.showOverviewTimelineView();
+};
+
+WebInspector.TimelineContentView.StyleClassName = "timeline";
+WebInspector.TimelineContentView.ViewContainerStyleClassName = "view-container";
+
+WebInspector.TimelineContentView.prototype = {
+ constructor: WebInspector.TimelineContentView,
+ __proto__: WebInspector.ContentView.prototype,
+
+ // Public
+
+ showOverviewTimelineView: function()
+ {
+ this._showTimelineView(this._overviewTimelineView);
+ },
+
+ showTimelineView: function(identifier)
+ {
+ console.assert(this._discreteTimelineViewMap.has(identifier));
+ if (!this._discreteTimelineViewMap.has(identifier))
+ return;
+
+ this._showTimelineView(this._discreteTimelineViewMap.get(identifier), identifier);
+ },
+
+ get allowedNavigationSidebarPanels()
+ {
+ return ["timeline"];
+ },
+
+ get supportsSplitContentBrowser()
+ {
+ // The layout of the overview and split content browser don't work well.
+ return false;
+ },
+
+ get selectionPathComponents()
+ {
+ var pathComponents = this._currentTimelineViewIdentifier ? [this._pathComponentMap.get(this._currentTimelineViewIdentifier)] : [];
+ pathComponents = pathComponents.concat(this._currentTimelineView.selectionPathComponents || []);
+ return pathComponents;
+ },
+
+ get navigationItems()
+ {
+ return [this._clearTimelineNavigationItem];
+ },
+
+ shown: function()
+ {
+ if (!this._currentTimelineView)
+ return;
+
+ this._currentTimelineView.shown();
+ },
+
+ hidden: function()
+ {
+ if (!this._currentTimelineView)
+ return;
+
+ this._currentTimelineView.hidden();
+ },
+
+ updateLayout: function()
+ {
+ this._timelineOverview.updateLayout();
+
+ if (!this._currentTimelineView)
+ return;
+
+ this._currentTimelineView.updateLayout();
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ if (this._currentTimelineView && !this._currentTimelineView.matchTreeElementAgainstCustomFilters(treeElement))
+ return false;
+
+ var startTime = this._timelineOverview.selectionStartTime;
+ var endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
+ var currentTime = this._currentTime || this._recording.startTime;
+
+ function checkTimeBounds(itemStartTime, itemEndTime)
+ {
+ itemStartTime = itemStartTime || currentTime;
+ itemEndTime = itemEndTime || currentTime;
+
+ return startTime <= itemEndTime && itemStartTime <= endTime;
+ }
+
+ if (treeElement instanceof WebInspector.ResourceTreeElement) {
+ var resource = treeElement.resource;
+ return checkTimeBounds(resource.requestSentTimestamp, resource.finishedOrFailedTimestamp);
+ }
+
+ if (treeElement instanceof WebInspector.SourceCodeTimelineTreeElement) {
+ var sourceCodeTimeline = treeElement.sourceCodeTimeline;
+
+ // Do a quick check of the timeline bounds before we check each record.
+ if (!checkTimeBounds(sourceCodeTimeline.startTime, sourceCodeTimeline.endTime))
+ return false;
+
+ for (var record of sourceCodeTimeline.records) {
+ if (checkTimeBounds(record.startTime, record.endTime))
+ return true;
+ }
+
+ return false;
+ }
+
+ if (treeElement instanceof WebInspector.ProfileNodeTreeElement) {
+ var profileNode = treeElement.profileNode;
+ for (var call of profileNode.calls) {
+ if (checkTimeBounds(call.startTime, call.endTime))
+ return true;
+ }
+
+ return false;
+ }
+
+ if (treeElement instanceof WebInspector.TimelineRecordTreeElement) {
+ var record = treeElement.record;
+ return checkTimeBounds(record.startTime, record.endTime);
+ }
+
+ console.error("Unknown TreeElement, can't filter by time.");
+ return true;
+ },
+
+ // Private
+
+ _pathComponentSelected: function(event)
+ {
+ WebInspector.timelineSidebarPanel.showTimelineView(event.data.pathComponent.representedObject);
+ },
+
+ _timelineViewSelectionPathComponentsDidChange: function()
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _showTimelineView: function(timelineView, identifier)
+ {
+ console.assert(timelineView instanceof WebInspector.TimelineView);
+
+ if (this._currentTimelineView === timelineView)
+ return;
+
+ if (this._currentTimelineView) {
+ this._currentTimelineView.removeEventListener(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange, this._timelineViewSelectionPathComponentsDidChange, this);
+
+ this._currentTimelineView.hidden();
+ this._currentTimelineView.element.remove();
+ }
+
+ this._currentTimelineView = timelineView;
+ this._currentTimelineViewIdentifier = identifier || null;
+
+ WebInspector.timelineSidebarPanel.contentTreeOutline = timelineView && timelineView.navigationSidebarTreeOutline;
+ WebInspector.timelineSidebarPanel.contentTreeOutlineLabel = timelineView && timelineView.navigationSidebarTreeOutlineLabel;
+
+ if (this._currentTimelineView) {
+ this._currentTimelineView.addEventListener(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange, this._timelineViewSelectionPathComponentsDidChange, this);
+
+ this._viewContainer.appendChild(this._currentTimelineView.element);
+
+ this._currentTimelineView.startTime = this._timelineOverview.selectionStartTime;
+ this._currentTimelineView.endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
+ this._currentTimelineView.currentTime = this._currentTime;
+
+ this._currentTimelineView.shown();
+ this._currentTimelineView.updateLayout();
+ }
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ },
+
+ _update: function(timestamp)
+ {
+ if (this._waitingToResetCurrentTime) {
+ requestAnimationFrame(this._updateCallback);
+ return;
+ }
+
+ var startTime = this._recording.startTime;
+ var currentTime = this._currentTime || startTime;
+ var endTime = this._recording.endTime;
+ var timespanSinceLastUpdate = (timestamp - this._lastUpdateTimestamp) / 1000 || 0;
+
+ currentTime += timespanSinceLastUpdate;
+
+ this._updateTimes(startTime, currentTime, endTime);
+
+ // Only stop updating if the current time is greater than the end time.
+ if (!this._updating && currentTime >= endTime) {
+ this._lastUpdateTimestamp = NaN;
+ return;
+ }
+
+ this._lastUpdateTimestamp = timestamp;
+
+ requestAnimationFrame(this._updateCallback);
+ },
+
+ _updateTimes: function(startTime, currentTime, endTime)
+ {
+ if (this._startTimeNeedsReset && !isNaN(startTime)) {
+ var selectionOffset = this._timelineOverview.selectionStartTime - this._timelineOverview.startTime;
+
+ this._timelineOverview.startTime = startTime;
+ this._timelineOverview.selectionStartTime = startTime + selectionOffset;
+
+ this._overviewTimelineView.zeroTime = startTime;
+ for (var timelineView of this._discreteTimelineViewMap.values())
+ timelineView.zeroTime = startTime;
+
+ delete this._startTimeNeedsReset;
+ }
+
+ this._timelineOverview.endTime = Math.max(endTime, currentTime);
+
+ this._currentTime = currentTime;
+ this._timelineOverview.currentTime = currentTime;
+ this._currentTimelineView.currentTime = currentTime;
+
+ // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
+ this._timelineOverview.updateLayoutIfNeeded();
+ this._currentTimelineView.updateLayoutIfNeeded();
+ },
+
+ _startUpdatingCurrentTime: function()
+ {
+ console.assert(!this._updating);
+ if (this._updating)
+ return;
+
+ if (!isNaN(this._currentTime)) {
+ // We have a current time already, so we likely need to jump into the future to a better current time.
+ // This happens when you stop and later restart recording.
+ this._waitingToResetCurrentTime = true;
+ this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+ }
+
+ this._updating = true;
+
+ if (!this._updateCallback)
+ this._updateCallback = this._update.bind(this);
+
+ requestAnimationFrame(this._updateCallback);
+ },
+
+ _stopUpdatingCurrentTime: function()
+ {
+ console.assert(this._updating);
+ this._updating = false;
+ },
+
+ _recordingStarted: function(event)
+ {
+ this._startUpdatingCurrentTime();
+ },
+
+ _recordingStopped: function(event)
+ {
+ this._stopUpdatingCurrentTime();
+ },
+
+ _recordingTimesUpdated: function(event)
+ {
+ if (!this._waitingToResetCurrentTime)
+ return;
+
+ // Make the current time be the start time of the last added record. This is the best way
+ // currently to jump to the right period of time after recording starts.
+ // FIXME: If no activity is happening we can sit for a while until a record is added.
+ // We might want to have the backend send a "start" record to get current time moving.
+
+ for (var timeline of this._recording.timelines.values()) {
+ var lastRecord = timeline.records.lastValue;
+ if (!lastRecord)
+ continue;
+ this._currentTime = Math.max(this._currentTime, lastRecord.startTime);
+ }
+
+ this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+ delete this._waitingToResetCurrentTime;
+ },
+
+ _clearTimeline: function(event)
+ {
+ this._recording.reset();
+ },
+
+ _recordingReset: function(event)
+ {
+ this._currentTime = NaN;
+
+ if (!this._updating) {
+ // Force the time ruler and views to reset to 0.
+ this._startTimeNeedsReset = true;
+ this._updateTimes(0, 0, 0);
+ }
+
+ this._lastUpdateTimestamp = NaN;
+ this._startTimeNeedsReset = true;
+
+ this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+ delete this._waitingToResetCurrentTime;
+
+ this._overviewTimelineView.reset();
+ for (var timelineView of this._discreteTimelineViewMap.values())
+ timelineView.reset();
+
+ for (var timelineOverviewGraph of this._discreteTimelineOverviewGraphMap.values())
+ timelineOverviewGraph.reset();
+ },
+
+ _timeRangeSelectionChanged: function(event)
+ {
+ this._currentTimelineView.startTime = this._timelineOverview.selectionStartTime;
+ this._currentTimelineView.endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
+
+ // Delay until the next frame to stay in sync with the current timeline view's time-based layout changes.
+ requestAnimationFrame(function() {
+ var selectedTreeElement = this._currentTimelineView && this._currentTimelineView.navigationSidebarTreeOutline ? this._currentTimelineView.navigationSidebarTreeOutline.selectedTreeElement : null;
+ var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
+
+ WebInspector.timelineSidebarPanel.updateFilter();
+
+ if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ }.bind(this));
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineDataGridcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,273 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.data-grid.timeline {
+ border: none;
+}
+
+.data-grid.timeline table {
+ font-size: 11px;
+}
+
+.data-grid.timeline th {
+ height: 22px;
+
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+
+ background-image: none;
+ background-color: white;
+
+ border-top: 1px solid rgb(179, 179, 179) !important;
+ border-bottom: 1px solid rgb(179, 179, 179) !important;
+}
+
+.data-grid.timeline th:not(:last-child) {
+ border-right: 1px solid rgb(179, 179, 179);
+}
+
+.data-grid.timeline th.sortable:active {
+ background-image: none !important;
+ background-color: rgb(210, 210, 210);
+}
+
+.data-grid.timeline th.sort-ascending,
+.data-grid.timeline th.sort-descending {
+ background-image: none !important;
+ background-color: rgb(230, 230, 230);
+}
+
+.data-grid.timeline .data-container {
+ top: 23px;
+}
+
+.data-grid.timeline th,
+.data-grid.timeline td {
+ padding-left: 6px;
+ padding-right: 6px;
+}
+
+.data-grid.timeline td:last-child {
+ padding-right: 12px;
+}
+
+.data-grid.timeline td {
+ padding-top: 2px;
+ padding-bottom: 2px;
+ line-height: 17px;
+}
+
+.data-grid.timeline td:not(:last-child) {
+ border-right: 1px solid rgb(179, 179, 179);
+}
+
+.data-grid.timeline:focus tr.selected td:not(:last-child) {
+ border-right-color: rgb(53, 109, 189);
+}
+
+.data-grid.timeline th.sort-ascending > div:first-child,
+.data-grid.timeline th.sort-descending > div:first-child {
+ padding-right: 13px;
+}
+
+.data-grid.timeline th.sort-ascending > div:first-child::after,
+.data-grid.timeline th.sort-descending > div:first-child::after {
+ top: 1px;
+}
+
+.data-grid.timeline td.error {
+ color: rgb(224, 16, 16);
+}
+
+.data-grid.timeline tr.selected td.error {
+ color: inherit;
+}
+
+.data-grid.timeline td .icon {
+ display: inline-block;
+ vertical-align: top;
+
+ width: 16px;
+ height: 16px;
+
+ margin-right: 2px;
+}
+
+.data-grid.timeline td .go-to-arrow {
+ float: right;
+
+ visibility: hidden;
+
+ margin-left: 2px;
+}
+
+.data-grid.timeline tr.selected .go-to-arrow,
+.data-grid.timeline tr:hover .go-to-arrow {
+ visibility: visible;
+}
+
+.data-grid.timeline td .subtitle {
+ color: rgba(0, 0, 0, 0.7);
+}
+
+.data-grid.timeline td .subtitle::before {
+ content: " — ";
+}
+
+.data-grid.timeline:focus tr.selected td .subtitle {
+ color: rgba(255, 255, 255, 0.9);
+}
+
+.data-grid.timeline > .navigation-bar-container {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 32px;
+
+ pointer-events: none;
+ visibility: hidden;
+}
+
+.data-grid.timeline:hover > .navigation-bar-container {
+ pointer-events: all;
+ visibility: visible;
+}
+
+.data-grid.timeline > .navigation-bar-container > .navigation-bar {
+ position: absolute;
+ top: 10px;
+ left: 0;
+ right: 0;
+ height: 22px;
+
+ border-bottom: none;
+ border-top: 1px solid rgb(200, 200, 200);
+ box-shadow: none;
+
+ background-color: white;
+}
+
+.timeline-data-grid-tree-outline {
+ position: relative;
+ padding: 0;
+ margin: 0;
+ outline: none;
+ list-style: none;
+ font-family: "Lucida Grande", "Helvetica", sans-serif;
+ font-size: 11px;
+}
+
+.timeline-data-grid-tree-outline .item {
+ position: relative;
+ height: 36px;
+ line-height: 34px;
+ padding: 0 5px;
+ border-top: 1px solid transparent;
+ white-space: nowrap;
+}
+
+.timeline-data-grid-tree-outline > .children,
+.timeline-data-grid-tree-outline .disclosure-button,
+.timeline-data-grid-tree-outline .item .status {
+ display: none;
+}
+
+.timeline-data-grid-tree-outline .item .icon {
+ float: left;
+ width: 32px;
+ height: 32px;
+ margin-top: 1px;
+ margin-right: 3px;
+}
+
+.timeline-data-grid-tree-outline .item:hover {
+ color: white;
+ border-radius: 4px;
+ box-shadow: inset rgb(87, 152, 206) 0 1px 0;
+ background: -webkit-linear-gradient(top, rgb(110, 167, 216), rgb(36, 114, 181));
+ background-origin: padding-box;
+ background-clip: padding-box;
+ text-shadow: rgb(51, 88, 123) 0 1px 0;
+ -webkit-text-stroke: 0.4px;
+}
+
+.timeline-data-grid-tree-outline .item .titles {
+ position: relative;
+ top: 5px;
+ line-height: 11px;
+ padding-bottom: 1px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.timeline-data-grid-tree-outline .item .title::after {
+ content: "\A"; /* Newline */
+ white-space: pre;
+}
+
+.timeline-data-grid-tree-outline .item .subtitle {
+ font-size: 9px;
+ color: rgba(0, 0, 0, 0.7);
+}
+
+.timeline-data-grid-tree-outline .item:hover .subtitle {
+ color: white;
+}
+
+.timeline-data-grid-tree-outline .item .subtitle:empty {
+ display: none;
+}
+
+.timeline-data-grid-tree-outline .item.small {
+ height: 20px;
+}
+
+.timeline-data-grid-tree-outline .item.small .icon {
+ width: 16px;
+ height: 16px;
+}
+
+.timeline-data-grid-tree-outline .item.small .status {
+ margin-top: 1px;
+}
+
+.timeline-data-grid-tree-outline .item.small .titles {
+ top: 2px;
+ line-height: normal;
+}
+
+.timeline-data-grid-tree-outline .item.small .subtitle {
+ font-size: inherit;
+}
+
+.timeline-data-grid-tree-outline .item.small:not(.two-line) .title::after {
+ content: "";
+}
+
+.timeline-data-grid-tree-outline .item.small:not(.two-line) .subtitle::before {
+ content: " — ";
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineDataGridjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineDataGrid.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,481 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineDataGrid = function(treeOutline, columns, delegate, editCallback, deleteCallback)
+{
+ WebInspector.DataGrid.call(this, columns, editCallback, deleteCallback);
+
+ this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(treeOutline, this, delegate);
+
+ this.element.classList.add(WebInspector.TimelineDataGrid.StyleClassName);
+
+ this._filterableColumns = [];
+
+ // Check if any of the cells can be filtered.
+ for (var identifier in columns) {
+ var scopeBar = columns[identifier].scopeBar;
+ if (!scopeBar)
+ continue;
+ this._filterableColumns.push(identifier);
+ scopeBar.columnIdenfifier = identifier;
+ scopeBar.addEventListener(WebInspector.ScopeBar.Event.SelectionChanged, this._scopeBarSelectedItemsDidChange, this);
+ }
+
+ if (this._filterableColumns.length > 1) {
+ console.error("Creating a TimelineDataGrid with more than one filterable column is not yet supported.");
+ return;
+ }
+
+ if (this._filterableColumns.length) {
+ var items = [new WebInspector.FlexibleSpaceNavigationItem, this.columns.get(this._filterableColumns[0]).get("scopeBar"), new WebInspector.FlexibleSpaceNavigationItem];
+ this._navigationBar = new WebInspector.NavigationBar(null, items);
+ var container = this.element.appendChild(document.createElement("div"));
+ container.className = "navigation-bar-container";
+ container.appendChild(this._navigationBar.element);
+ }
+
+ this.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridSelectedNodeChanged, this);
+ this.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sort, this);
+
+ window.addEventListener("resize", this._windowResized.bind(this));
+}
+
+WebInspector.TimelineDataGrid.StyleClassName = "timeline";
+WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout = 250;
+WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout = 500;
+
+WebInspector.TimelineDataGrid.Event = {
+ FiltersDidChange: "timelinedatagrid-filters-did-change"
+};
+
+WebInspector.TimelineDataGrid.createColumnScopeBar = function(prefix, dictionary)
+{
+ prefix = prefix + "-timeline-data-grid-";
+
+ var keys = Object.keys(dictionary).filter(function(key) {
+ return typeof dictionary[key] === "string" || dictionary[key] instanceof String;
+ });
+
+ var scopeBarItems = keys.map(function(key) {
+ var value = dictionary[key];
+ var id = prefix + value;
+ var label = dictionary.displayName(value, true);
+ var item = new WebInspector.ScopeBarItem(id, label);
+ item.value = value;
+ return item;
+ });
+
+ scopeBarItems.unshift(new WebInspector.ScopeBarItem(prefix + "type-all", WebInspector.UIString("All"), true));
+
+ return new WebInspector.ScopeBar(prefix + "scope-bar", scopeBarItems, scopeBarItems[0]);
+};
+
+WebInspector.TimelineDataGrid.prototype = {
+ constructor: WebInspector.TimelineDataGrid,
+ __proto__: WebInspector.DataGrid.prototype,
+
+ // Public
+
+ reset: function()
+ {
+ // May be overridden by subclasses. If so, they should call the superclass.
+
+ this._hidePopover();
+ },
+
+ shown: function()
+ {
+ // May be overridden by subclasses. If so, they should call the superclass.
+
+ this._treeOutlineDataGridSynchronizer.synchronize();
+ },
+
+ hidden: function()
+ {
+ // May be overridden by subclasses. If so, they should call the superclass.
+
+ this._hidePopover();
+ },
+
+ treeElementForDataGridNode: function(dataGridNode)
+ {
+ return this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
+ },
+
+ dataGridNodeForTreeElement: function(treeElement)
+ {
+ return this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(treeElement);
+ },
+
+ callFramePopoverAnchorElement: function()
+ {
+ // Implemented by subclasses.
+ return null;
+ },
+
+ updateLayout: function()
+ {
+ WebInspector.DataGrid.prototype.updateLayout.call(this);
+
+ if (this._navigationBar)
+ this._navigationBar.updateLayout();
+ },
+
+ treeElementMatchesActiveScopeFilters: function(treeElement)
+ {
+ var dataGridNode = this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(treeElement);
+ console.assert(dataGridNode);
+
+ for (var identifier of this._filterableColumns) {
+ var scopeBar = this.columns.get(identifier).scopeBar;
+ if (!scopeBar || scopeBar.defaultItem.selected)
+ continue;
+
+ var value = dataGridNode.data[identifier];
+ var matchesFilter = scopeBar.selectedItems.some(function(scopeBarItem) {
+ return scopeBarItem.value === value;
+ });
+
+ if (!matchesFilter)
+ return false;
+ }
+
+ return true;
+ },
+
+ addRowInSortOrder: function(treeElement, dataGridNode, parentElement)
+ {
+ this._treeOutlineDataGridSynchronizer.associate(treeElement, dataGridNode);
+
+ parentElement = parentElement || this._treeOutlineDataGridSynchronizer.treeOutline;
+ parentNode = parentElement.root ? this : this._treeOutlineDataGridSynchronizer.dataGridNodeForTreeElement(parentElement);
+
+ console.assert(parentNode);
+
+ if (this.sortColumnIdentifier) {
+ var insertionIndex = insertionIndexForObjectInListSortedByFunction(dataGridNode, parentNode.children, this._sortComparator.bind(this));
+
+ // Insert into the parent, which will cause the synchronizer to insert into the data grid.
+ parentElement.insertChild(treeElement, insertionIndex);
+ } else {
+ // Append to the parent, which will cause the synchronizer to append to the data grid.
+ parentElement.appendChild(treeElement);
+ }
+ },
+
+ shouldIgnoreSelectionEvent: function()
+ {
+ return this._ignoreSelectionEvent || false;
+ },
+
+ // Protected
+
+ dataGridNodeNeedsRefresh: function(dataGridNode)
+ {
+ if (!this._dirtyDataGridNodes)
+ this._dirtyDataGridNodes = new Set;
+ this._dirtyDataGridNodes.add(dataGridNode);
+
+ if (this._scheduledDataGridNodeRefreshIdentifier)
+ return;
+
+ this._scheduledDataGridNodeRefreshIdentifier = requestAnimationFrame(this._refreshDirtyDataGridNodes.bind(this));
+ },
+
+ // Private
+
+ _refreshDirtyDataGridNodes: function()
+ {
+ if (this._scheduledDataGridNodeRefreshIdentifier) {
+ cancelAnimationFrame(this._scheduledDataGridNodeRefreshIdentifier);
+ delete this._scheduledDataGridNodeRefreshIdentifier;
+ }
+
+ if (!this._dirtyDataGridNodes)
+ return;
+
+ var selectedNode = this.selectedNode;
+ var sortComparator = this._sortComparator.bind(this);
+ var treeOutline = this._treeOutlineDataGridSynchronizer.treeOutline;
+
+ this._treeOutlineDataGridSynchronizer.enabled = false;
+
+ for (var dataGridNode of this._dirtyDataGridNodes) {
+ dataGridNode.refresh();
+
+ if (!this.sortColumnIdentifier)
+ continue;
+
+ if (dataGridNode === selectedNode)
+ this._ignoreSelectionEvent = true;
+
+ var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
+ console.assert(treeElement);
+
+ treeOutline.removeChild(treeElement);
+ this.removeChild(dataGridNode);
+
+ var insertionIndex = insertionIndexForObjectInListSortedByFunction(dataGridNode, this.children, sortComparator);
+ treeOutline.insertChild(treeElement, insertionIndex);
+ this.insertChild(dataGridNode, insertionIndex);
+
+ // Adding the tree element back to the tree outline subjects it to filters.
+ // Make sure we keep the hidden state in-sync while the synchronizer is disabled.
+ dataGridNode.element.classList.toggle("hidden", treeElement.hidden);
+
+ if (dataGridNode === selectedNode) {
+ selectedNode.revealAndSelect();
+ delete this._ignoreSelectionEvent;
+ }
+ }
+
+ this._treeOutlineDataGridSynchronizer.enabled = true;
+
+ delete this._dirtyDataGridNodes;
+ },
+
+ _sort: function()
+ {
+ var sortColumnIdentifier = this.sortColumnIdentifier;
+ if (!sortColumnIdentifier)
+ return;
+
+ var selectedNode = this.selectedNode;
+ this._ignoreSelectionEvent = true;
+
+ this._treeOutlineDataGridSynchronizer.enabled = false;
+
+ var treeOutline = this._treeOutlineDataGridSynchronizer.treeOutline;
+ if (treeOutline.selectedTreeElement)
+ treeOutline.selectedTreeElement.deselect(true);
+
+ // Collect parent nodes that need their children sorted. So this in two phases since
+ // traverseNextNode would get confused if we sort the tree while traversing it.
+ var parentDataGridNodes = [this];
+ var currentDataGridNode = this.children[0];
+ while (currentDataGridNode) {
+ if (currentDataGridNode.children.length)
+ parentDataGridNodes.push(currentDataGridNode);
+ currentDataGridNode = currentDataGridNode.traverseNextNode(false, null, true);
+ }
+
+ // Sort the children of collected parent nodes.
+ for (var parentDataGridNode of parentDataGridNodes) {
+ var parentTreeElement = parentDataGridNode === this ? treeOutline : this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(parentDataGridNode);
+ console.assert(parentTreeElement);
+
+ var childDataGridNodes = parentDataGridNode.children.slice();
+
+ parentDataGridNode.removeChildren();
+ parentTreeElement.removeChildren();
+
+ childDataGridNodes.sort(this._sortComparator.bind(this));
+
+ for (var dataGridNode of childDataGridNodes) {
+ var treeElement = this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode(dataGridNode);
+ console.assert(treeElement);
+
+ parentTreeElement.appendChild(treeElement);
+ parentDataGridNode.appendChild(dataGridNode);
+
+ // Adding the tree element back to the tree outline subjects it to filters.
+ // Make sure we keep the hidden state in-sync while the synchronizer is disabled.
+ dataGridNode.element.classList.toggle("hidden", treeElement.hidden);
+ }
+ }
+
+ this._treeOutlineDataGridSynchronizer.enabled = true;
+
+ if (selectedNode)
+ selectedNode.revealAndSelect();
+
+ delete this._ignoreSelectionEvent;
+ },
+
+ _sortComparator: function(node1, node2)
+ {
+ var sortColumnIdentifier = this.sortColumnIdentifier;
+ if (!sortColumnIdentifier)
+ return 0;
+
+ var sortDirection = this.sortOrder === "ascending" ? 1 : -1;
+
+ var value1 = node1.data[sortColumnIdentifier];
+ var value2 = node2.data[sortColumnIdentifier];
+
+ if (typeof value1 === "number" && typeof value2 === "number") {
+ if (isNaN(value1) && isNaN(value2))
+ return 0;
+ if (isNaN(value1))
+ return -sortDirection;
+ if (isNaN(value2))
+ return sortDirection;
+ return (value1 - value2) * sortDirection;
+ }
+
+ if (typeof value1 === "string" && typeof value2 === "string")
+ return value1.localeCompare(value2) * sortDirection;
+
+ if (value1 instanceof WebInspector.CallFrame || value2 instanceof WebInspector.CallFrame) {
+ // Sort by function name if available, then fall back to the source code object.
+ value1 = value1 && value1.functionName ? value1.functionName : (value1 && value1.sourceCodeLocation ? value1.sourceCodeLocation.sourceCode : "");
+ value2 = value2 && value2.functionName ? value2.functionName : (value2 && value2.sourceCodeLocation ? value2.sourceCodeLocation.sourceCode : "");
+ }
+
+ if (value1 instanceof WebInspector.SourceCode || value2 instanceof WebInspector.SourceCode) {
+ value1 = value1 ? value1.displayName || "" : "";
+ value2 = value2 ? value2.displayName || "" : "";
+ }
+
+ // For everything else (mostly booleans).
+ return (value1 < value2 ? -1 : (value1 > value2 ? 1 : 0)) * sortDirection;
+ },
+
+ _scopeBarSelectedItemsDidChange: function(event)
+ {
+ var columnIdentifier = event.target.columnIdenfifier;
+ this.dispatchEventToListeners(WebInspector.TimelineDataGrid.Event.FiltersDidChange, {columnIdentifier: columnIdentifier});
+ },
+
+ _dataGridSelectedNodeChanged: function(event)
+ {
+ if (!this.selectedNode) {
+ this._hidePopover();
+ return;
+ }
+
+ var record = this.selectedNode.record;
+ if (!record || !record.callFrames || !record.callFrames.length) {
+ this._hidePopover();
+ return;
+ }
+
+ this._showPopoverForSelectedNodeSoon();
+ },
+
+ _windowResized: function(event)
+ {
+ if (this._popover && this._popover.visible)
+ this._updatePopoverForSelectedNode(false);
+ },
+
+ _showPopoverForSelectedNodeSoon: function()
+ {
+ if (this._showPopoverTimeout)
+ return;
+
+ function delayedWork()
+ {
+ if (!this._popover)
+ this._popover = new WebInspector.Popover;
+
+ this._updatePopoverForSelectedNode(true);
+ }
+
+ this._showPopoverTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout);
+ },
+
+ _hidePopover: function()
+ {
+ if (this._showPopoverTimeout) {
+ clearTimeout(this._showPopoverTimeout);
+ delete this._showPopoverTimeout;
+ }
+
+ if (this._popover)
+ this._popover.dismiss();
+
+ function delayedWork()
+ {
+ if (this._popoverCallStackTreeOutline)
+ this._popoverCallStackTreeOutline.removeChildren();
+ }
+
+ if (this._hidePopoverContentClearTimeout)
+ clearTimeout(this._hidePopoverContentClearTimeout);
+ this._hidePopoverContentClearTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout);
+ },
+
+ _updatePopoverForSelectedNode: function(updateContent)
+ {
+ if (!this._popover || !this.selectedNode)
+ return;
+
+ var targetPopoverElement = this.callFramePopoverAnchorElement();
+ console.assert(targetPopoverElement, "TimelineDataGrid subclass should always return a valid element from callFramePopoverAnchorElement.");
+ if (!targetPopoverElement)
+ return;
+
+ var targetFrame = WebInspector.Rect.rectFromClientRect(targetPopoverElement.getBoundingClientRect());
+
+ // The element might be hidden if it does not have a width and height.
+ if (!targetFrame.size.width && !targetFrame.size.height)
+ return;
+
+ if (this._hidePopoverContentClearTimeout) {
+ clearTimeout(this._hidePopoverContentClearTimeout);
+ delete this._hidePopoverContentClearTimeout;
+ }
+
+ if (updateContent)
+ this._popover.content = this._createPopoverContent();
+
+ this._popover.present(targetFrame.pad(2), [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+ },
+
+ _createPopoverContent: function()
+ {
+ if (!this._popoverCallStackTreeOutline) {
+ var contentElement = document.createElement("ol");
+ contentElement.classList.add("timeline-data-grid-tree-outline");
+ this._popoverCallStackTreeOutline = new TreeOutline(contentElement);
+ this._popoverCallStackTreeOutline.onselect = this._popoverCallStackTreeElementSelected.bind(this);
+ } else
+ this._popoverCallStackTreeOutline.removeChildren();
+
+ var callFrames = this.selectedNode.record.callFrames;
+ for (var i = 0 ; i < callFrames.length; ++i) {
+ var callFrameTreeElement = new WebInspector.CallFrameTreeElement(callFrames[i]);
+ this._popoverCallStackTreeOutline.appendChild(callFrameTreeElement);
+ }
+
+ var content = document.createElement("div");
+ content.className = "timeline-data-grid-popover";
+ content.appendChild(this._popoverCallStackTreeOutline.element);
+ return content;
+ },
+
+ _popoverCallStackTreeElementSelected: function(treeElement, selectedByUser)
+ {
+ this._popover.dismiss();
+
+ console.assert(treeElement instanceof WebInspector.CallFrameTreeElement, "TreeElements in TimelineDataGrid popover should always be CallFrameTreeElements");
+ var callFrame = treeElement.callFrame;
+ if (!callFrame.sourceCodeLocation)
+ return;
+
+ WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineDataGridNodejsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineDataGridNodejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineDataGridNode.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,346 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineDataGridNode = function(graphOnly, graphDataSource, hasChildren)
+{
+ WebInspector.DataGridNode.call(this, {}, hasChildren);
+
+ this._graphOnly = graphOnly || false;
+ this._graphDataSource = graphDataSource || null;
+
+ if (graphDataSource) {
+ this._graphContainerElement = document.createElement("div");
+ this._timelineRecordBars = [];
+ }
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.TimelineDataGridNode);
+
+WebInspector.TimelineDataGridNode.prototype = {
+ constructor: WebInspector.TimelineDataGridNode,
+ __proto__: WebInspector.DataGridNode.prototype,
+
+ // Public
+
+ get records()
+ {
+ // Implemented by subclasses.
+ return [];
+ },
+
+ get graphDataSource()
+ {
+ return this._graphDataSource;
+ },
+
+ get data()
+ {
+ if (!this._graphDataSource)
+ return {};
+
+ var records = this.records || [];
+ return {graph: records.length ? records[0].startTime : 0};
+ },
+
+ collapse: function()
+ {
+ WebInspector.DataGridNode.prototype.collapse.call(this);
+
+ if (!this._graphDataSource || !this.revealed)
+ return;
+
+ // Refresh to show child bars in our graph now that we collapsed.
+ this.refreshGraph();
+ },
+
+ expand: function()
+ {
+ WebInspector.DataGridNode.prototype.expand.call(this);
+
+ if (!this._graphDataSource || !this.revealed)
+ return;
+
+ // Refresh to remove child bars from our graph now that we expanded.
+ this.refreshGraph();
+
+ // Refresh child graphs since they haven't been updating while we were collapsed.
+ var childNode = this.children[0];
+ while (childNode) {
+ if (childNode instanceof WebInspector.TimelineDataGridNode)
+ childNode.refreshGraph();
+ childNode = childNode.traverseNextNode(true, this);
+ }
+ },
+
+ createCellContent: function(columnIdentifier, cell)
+ {
+ if (columnIdentifier === "graph" && this._graphDataSource) {
+ this.needsGraphRefresh();
+ return this._graphContainerElement;
+ }
+
+ var value = this.data[columnIdentifier];
+ if (!value)
+ return "\u2014";
+
+ if (value instanceof WebInspector.SourceCodeLocation) {
+ if (value.sourceCode instanceof WebInspector.Resource) {
+ cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ cell.classList.add(value.sourceCode.type);
+ } else if (value.sourceCode instanceof WebInspector.Script) {
+ if (value.sourceCode.url) {
+ cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ cell.classList.add(WebInspector.Resource.Type.Script);
+ } else
+ cell.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
+ } else
+ console.error("Unknown SourceCode subclass.");
+
+ // Give the whole cell a tooltip and keep it up to date.
+ value.populateLiveDisplayLocationTooltip(cell);
+
+ var fragment = document.createDocumentFragment();
+
+ var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(value, false, true);
+ fragment.appendChild(goToArrowButtonLink);
+
+ var icon = document.createElement("div");
+ icon.className = WebInspector.ScriptTimelineDataGridNode.IconStyleClassName;
+ fragment.appendChild(icon);
+
+ var titleElement = document.createElement("span");
+ value.populateLiveDisplayLocationString(titleElement, "textContent");
+ fragment.appendChild(titleElement);
+
+ return fragment;
+ }
+
+ if (value instanceof WebInspector.CallFrame) {
+ var callFrame = value;
+
+ var isAnonymousFunction = false;
+ var functionName = callFrame.functionName;
+ if (!functionName) {
+ functionName = WebInspector.UIString("(anonymous function)");
+ isAnonymousFunction = true;
+ }
+
+ cell.classList.add(WebInspector.CallFrameTreeElement.FunctionIconStyleClassName);
+
+ var fragment = document.createDocumentFragment();
+
+ if (callFrame.sourceCodeLocation && callFrame.sourceCodeLocation.sourceCode) {
+ // Give the whole cell a tooltip and keep it up to date.
+ callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(cell);
+
+ var goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(callFrame.sourceCodeLocation, false, true);
+ fragment.appendChild(goToArrowButtonLink);
+
+ var icon = document.createElement("div");
+ icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
+ fragment.appendChild(icon);
+
+ if (isAnonymousFunction) {
+ // For anonymous functions we show the resource or script icon and name.
+ if (callFrame.sourceCodeLocation.sourceCode instanceof WebInspector.Resource) {
+ cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ cell.classList.add(callFrame.sourceCodeLocation.sourceCode.type);
+ } else if (callFrame.sourceCodeLocation.sourceCode instanceof WebInspector.Script) {
+ if (callFrame.sourceCodeLocation.sourceCode.url) {
+ cell.classList.add(WebInspector.ResourceTreeElement.ResourceIconStyleClassName);
+ cell.classList.add(WebInspector.Resource.Type.Script);
+ } else
+ cell.classList.add(WebInspector.ScriptTreeElement.AnonymousScriptIconStyleClassName);
+ } else
+ console.error("Unknown SourceCode subclass.");
+
+ var titleElement = document.createElement("span");
+ callFrame.sourceCodeLocation.populateLiveDisplayLocationString(titleElement, "textContent");
+
+ fragment.appendChild(titleElement);
+ } else {
+ // Show the function name and icon.
+ cell.classList.add(WebInspector.CallFrameTreeElement.FunctionIconStyleClassName);
+
+ fragment.appendChild(document.createTextNode(functionName));
+
+ var subtitleElement = document.createElement("span");
+ subtitleElement.className = WebInspector.LayoutTimelineDataGridNode.SubtitleStyleClassName;
+ callFrame.sourceCodeLocation.populateLiveDisplayLocationString(subtitleElement, "textContent");
+
+ fragment.appendChild(subtitleElement);
+ }
+
+ return fragment;
+ }
+
+ var icon = document.createElement("div");
+ icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
+ fragment.appendChild(icon);
+
+ fragment.appendChild(document.createTextNode(functionName));
+
+ return fragment;
+ }
+
+ return WebInspector.DataGridNode.prototype.createCellContent.call(this, columnIdentifier, cell);
+ },
+
+ refresh: function()
+ {
+ if (this._graphDataSource && this._graphOnly) {
+ this.needsGraphRefresh();
+ return;
+ }
+
+ WebInspector.DataGridNode.prototype.refresh.call(this);
+ },
+
+ refreshGraph: function()
+ {
+ if (!this._graphDataSource)
+ return;
+
+ if (this._scheduledGraphRefreshIdentifier) {
+ cancelAnimationFrame(this._scheduledGraphRefreshIdentifier);
+ delete this._scheduledGraphRefreshIdentifier;
+ }
+
+ // We are not visible, but an ancestor will draw our graph.
+ // They need notified by using our needsGraphRefresh.
+ console.assert(this.revealed);
+ if (!this.revealed)
+ return;
+
+ var startTime = this._graphDataSource.startTime;
+ var currentTime = this._graphDataSource.currentTime;
+ var endTime = this._graphDataSource.endTime;
+ var duration = endTime - startTime;
+ var visibleWidth = this._graphContainerElement.offsetWidth;
+ var secondsPerPixel = duration / visibleWidth;
+ var recordBarIndex = 0;
+
+ function createBar(records, renderMode)
+ {
+ var timelineRecordBar = this._timelineRecordBars[recordBarIndex];
+ if (!timelineRecordBar)
+ timelineRecordBar = this._timelineRecordBars[recordBarIndex] = new WebInspector.TimelineRecordBar;
+ timelineRecordBar.renderMode = renderMode;
+ timelineRecordBar.records = records;
+ timelineRecordBar.refresh(this._graphDataSource);
+ if (!timelineRecordBar.element.parentNode)
+ this._graphContainerElement.appendChild(timelineRecordBar.element);
+ ++recordBarIndex;
+ }
+
+ var boundCreateBar = createBar.bind(this);
+
+ if (this.expanded) {
+ // When expanded just use the records for this node.
+ WebInspector.TimelineRecordBar.createCombinedBars(this.records, secondsPerPixel, this._graphDataSource, boundCreateBar);
+ } else {
+ // When collapsed use the records for this node and its descendants.
+ // To share bars better, group records by type.
+
+ var recordTypeMap = new Map;
+
+ function collectRecordsByType(records)
+ {
+ for (var record of records) {
+ var typedRecords = recordTypeMap.get(record.type);
+ if (!typedRecords) {
+ typedRecords = [];
+ recordTypeMap.set(record.type, typedRecords);
+ }
+
+ typedRecords.push(record);
+ }
+ }
+
+ collectRecordsByType(this.records);
+
+ var childNode = this.children[0];
+ while (childNode) {
+ if (childNode instanceof WebInspector.TimelineDataGridNode)
+ collectRecordsByType(childNode.records);
+ childNode = childNode.traverseNextNode(false, this);
+ }
+
+ for (var records of recordTypeMap.values())
+ WebInspector.TimelineRecordBar.createCombinedBars(records, secondsPerPixel, this._graphDataSource, boundCreateBar);
+ }
+
+ // Remove the remaining unused TimelineRecordBars.
+ for (; recordBarIndex < this._timelineRecordBars.length; ++recordBarIndex) {
+ this._timelineRecordBars[recordBarIndex].records = null;
+ this._timelineRecordBars[recordBarIndex].element.remove();
+ }
+ },
+
+ needsGraphRefresh: function()
+ {
+ if (!this.revealed) {
+ // We are not visible, but an ancestor will be drawing our graph.
+ // Notify the next visible ancestor that their graph needs to refresh.
+ var ancestor = this;
+ while (ancestor && !ancestor.root) {
+ if (ancestor.revealed && ancestor instanceof WebInspector.TimelineDataGridNode) {
+ ancestor.needsGraphRefresh();
+ return;
+ }
+
+ ancestor = ancestor.parent;
+ }
+
+ return;
+ }
+
+ if (!this._graphDataSource || this._scheduledGraphRefreshIdentifier)
+ return;
+
+ this._scheduledGraphRefreshIdentifier = requestAnimationFrame(this.refreshGraph.bind(this));
+ },
+
+ // Protected
+
+ isRecordVisible: function(record)
+ {
+ if (!this._graphDataSource)
+ return false;
+
+ if (isNaN(record.startTime))
+ return false;
+
+ // If this bar is completely before the bounds of the graph, not visible.
+ if (record.endTime < this.graphDataSource.startTime)
+ return false;
+
+ // If this record is completely after the current time or end time, not visible.
+ if (record.startTime > this.graphDataSource.currentTime || record.startTime > this.graphDataSource.endTime)
+ return false;
+
+ return true;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineIconscss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineIcons.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.network-icon .icon {
+ content: -webkit-image-set(url(../Images/Network.png) 1x, url(../Images/Network@2x.png) 2x);
+}
+
+.network-icon.large .icon {
+ content: -webkit-image-set(url(../Images/NetworkLarge.png) 1x, url(../Images/NetworkLarge@2x.png) 2x);
+}
+
+.colors-icon .icon {
+ content: -webkit-image-set(url(../Images/Colors.png) 1x, url(../Images/Colors@2x.png) 2x);
+}
+
+.colors-icon.large .icon {
+ content: -webkit-image-set(url(../Images/ColorsLarge.png) 1x, url(../Images/ColorsLarge@2x.png) 2x);
+}
+
+.script-icon .icon {
+ content: -webkit-image-set(url(../Images/Script.png) 1x, url(../Images/Script@2x.png) 2x);
+}
+
+.script-icon.large .icon {
+ content: -webkit-image-set(url(../Images/ScriptLarge.png) 1x, url(../Images/ScriptLarge@2x.png) 2x);
+}
+
+.stopwatch-icon .icon {
+ content: -webkit-image-set(url(../Images/Stopwatch.png) 1x, url(../Images/Stopwatch@2x.png) 2x);
+}
+
+.profile-icon .icon {
+ content: -webkit-image-set(url(../Images/Profile.png) 1x, url(../Images/Profile@2x.png) 2x);
+}
+
+.style-record .icon {
+ content: url(../Images/TimelineRecordStyle.svg);
+}
+
+.layout-record .icon {
+ content: url(../Images/TimelineRecordLayout.svg);
+}
+
+.paint-record .icon {
+ content: url(../Images/TimelineRecordPaint.svg);
+}
+
+.evaluated-record .icon {
+ content: url(../Images/TimelineRecordScriptEvaluated.svg);
+}
+
+.event-record .icon {
+ content: url(../Images/TimelineRecordEvent.svg);
+}
+
+.timer-record .icon {
+ content: url(../Images/TimelineRecordTimer.svg);
+}
+
+.animation-record .icon {
+ content: url(../Images/TimelineRecordAnimation.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineOverviewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-overview > .scroll-container {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 16px;
+ overflow-x: auto;
+ overflow-y: hidden;
+ opacity: 0;
+}
+
+.timeline-overview:hover > .scroll-container {
+ opacity: 0.75;
+}
+
+.timeline-overview > .scroll-container:hover {
+ opacity: 1;
+}
+
+.timeline-overview > .timeline-ruler {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+
+.timeline-overview > .graphs-container {
+ position: absolute;
+ top: 22px;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+
+.timeline-overview > .graphs-container > .timeline-overview-graph {
+ height: 36px;
+}
+
+.timeline-overview > .graphs-container > .timeline-overview-graph:nth-child(even) {
+ background-color: rgb(247, 247, 247);
+ background-clip: padding-box;
+}
+
+.timeline-overview > .graphs-container > .timeline-overview-graph:not(:first-child) {
+ border-top: 1px solid rgba(0, 0, 0, 0.09);
+}
+
+.timeline-overview > .scroll-container > .scroll-width-sizer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 1px;
+ visibility: hidden;
+ pointer-events: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineOverviewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineOverview.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,346 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineOverview = function(timelineOverviewGraphsMap)
+{
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.TimelineOverview.StyleClassName;
+ this._element.addEventListener("wheel", this._handleWheelEvent.bind(this));
+
+ this._graphsContainer = document.createElement("div");
+ this._graphsContainer.className = WebInspector.TimelineOverview.GraphsContainerStyleClassName;
+ this._element.appendChild(this._graphsContainer);
+
+ this._timelineOverviewGraphsMap = timelineOverviewGraphsMap;
+
+ for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values())
+ this._graphsContainer.appendChild(timelineOverviewGraph.element);
+
+ this._timelineRuler = new WebInspector.TimelineRuler;
+ this._timelineRuler.allowsClippedLabels = true;
+ this._timelineRuler.allowsTimeRangeSelection = true;
+ this._timelineRuler.addEventListener(WebInspector.TimelineRuler.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
+ this._element.appendChild(this._timelineRuler.element);
+
+ this._currentTimeMarker = new WebInspector.TimelineMarker(0, WebInspector.TimelineMarker.Type.CurrentTime);
+ this._timelineRuler.addMarker(this._currentTimeMarker);
+
+ this._scrollContainer = document.createElement("div");
+ this._scrollContainer.className = WebInspector.TimelineOverview.ScrollContainerStyleClassName;
+ this._scrollContainer.addEventListener("scroll", this._handleScrollEvent.bind(this));
+ this._element.appendChild(this._scrollContainer);
+
+ this._scrollWidthSizer = document.createElement("div");
+ this._scrollWidthSizer.className = WebInspector.TimelineOverview.ScrollWidthSizerStyleClassName;
+ this._scrollContainer.appendChild(this._scrollWidthSizer);
+
+ this._secondsPerPixelSetting = new WebInspector.Setting("timeline-overview-seconds-per-pixel", 0.01);
+ this._selectionStartTimeSetting = new WebInspector.Setting("timeline-overview-selection-start-time", 0);
+ this._selectionDurationSetting = new WebInspector.Setting("timeline-overview-selection-duration", 5);
+
+ this._startTime = 0;
+ this._currentTime = 0;
+ this._endTime = 0;
+ this._secondsPerPixel = this._secondsPerPixelSetting.value;
+ this._scrollStartTime = 0;
+
+ this.selectionStartTime = this._selectionStartTimeSetting.value;
+ this.selectionDuration = this._selectionDurationSetting.value;
+};
+
+WebInspector.TimelineOverview.StyleClassName = "timeline-overview";
+WebInspector.TimelineOverview.GraphsContainerStyleClassName = "graphs-container";
+WebInspector.TimelineOverview.ScrollContainerStyleClassName = "scroll-container";
+WebInspector.TimelineOverview.ScrollWidthSizerStyleClassName = "scroll-width-sizer";
+WebInspector.TimelineOverview.MinimumSecondsPerPixel = 0.001;
+WebInspector.TimelineOverview.ScrollDeltaDenominator = 500;
+
+WebInspector.TimelineOverview.Event = {
+ TimeRangeSelectionChanged: "timeline-overview-time-range-selection-changed"
+};
+
+WebInspector.TimelineOverview.prototype = {
+ constructor: WebInspector.TimelineOverview,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ set startTime(x)
+ {
+ if (this._startTime === x)
+ return;
+
+ this._startTime = x || 0;
+
+ this._needsLayout();
+ },
+
+ get currentTime()
+ {
+ return this._currentTime;
+ },
+
+ set currentTime(x)
+ {
+ if (this._currentTime === x)
+ return;
+
+ this._currentTime = x || 0;
+ this._revealCurrentTime = true;
+
+ this._needsLayout();
+ },
+
+ get secondsPerPixel()
+ {
+ return this._secondsPerPixel;
+ },
+
+ set secondsPerPixel(x)
+ {
+ x = Math.max(WebInspector.TimelineOverview.MinimumSecondsPerPixel, x);
+
+ if (this._secondsPerPixel === x)
+ return;
+
+ this._secondsPerPixel = x;
+ this._secondsPerPixelSetting.value = x;
+
+ this._needsLayout();
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ set endTime(x)
+ {
+ if (this._endTime === x)
+ return;
+
+ this._endTime = x || 0;
+
+ this._needsLayout();
+ },
+
+ get scrollStartTime()
+ {
+ return this._scrollStartTime;
+ },
+
+ set scrollStartTime(x)
+ {
+ if (this._scrollStartTime === x)
+ return;
+
+ this._scrollStartTime = x || 0;
+
+ this._needsLayout();
+ },
+
+ get visibleDuration()
+ {
+ return this._scrollContainer.offsetWidth * this._secondsPerPixel;
+ },
+
+ get selectionStartTime()
+ {
+ return this._timelineRuler.selectionStartTime;
+ },
+
+ set selectionStartTime(x)
+ {
+ x = x || 0;
+
+ var selectionDuration = this.selectionDuration;
+ this._timelineRuler.selectionStartTime = x;
+ this._timelineRuler.selectionEndTime = x + selectionDuration;
+ },
+
+ get selectionDuration()
+ {
+ return this._timelineRuler.selectionEndTime - this._timelineRuler.selectionStartTime;
+ },
+
+ set selectionDuration(x)
+ {
+ x = Math.max(WebInspector.TimelineRuler.MinimumSelectionTimeRange, x);
+ this._timelineRuler.selectionEndTime = this._timelineRuler.selectionStartTime + x;
+ },
+
+ addMarker: function(marker)
+ {
+ this._timelineRuler.addMarker(marker);
+ },
+
+ revealMarker: function(marker)
+ {
+ this.scrollStartTime = marker.time - (this.visibleDuration / 2);
+ },
+
+ updateLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
+ delete this._scheduledLayoutUpdateIdentifier;
+ }
+
+ // Calculate the required width based on the duration and seconds per pixel.
+ var duration = this._endTime - this._startTime;
+ var newWidth = Math.ceil(duration / this._secondsPerPixel);
+
+ // Update all relevant elements to the new required width.
+ this._updateElementWidth(this._scrollWidthSizer, newWidth);
+
+ this._currentTimeMarker.time = this._currentTime;
+
+ if (this._revealCurrentTime) {
+ this.revealMarker(this._currentTimeMarker);
+ delete this._revealCurrentTime;
+ }
+
+ // Clamp the scroll start time to match what the scroll bar would allow.
+ var scrollStartTime = Math.min(this._scrollStartTime, this._endTime - this.visibleDuration);
+ scrollStartTime = Math.max(this._startTime, scrollStartTime);
+
+ this._timelineRuler.zeroTime = this._startTime;
+ this._timelineRuler.startTime = scrollStartTime;
+ this._timelineRuler.secondsPerPixel = this._secondsPerPixel;
+
+ if (!this._dontUpdateScrollLeft) {
+ this._ignoreNextScrollEvent = true;
+ this._scrollContainer.scrollLeft = Math.ceil((scrollStartTime - this._startTime) / this._secondsPerPixel);
+ }
+
+ this._timelineRuler.updateLayout();
+
+ for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values()) {
+ timelineOverviewGraph.zeroTime = this._startTime;
+ timelineOverviewGraph.startTime = scrollStartTime;
+ timelineOverviewGraph.currentTime = this._currentTime;
+ timelineOverviewGraph.endTime = scrollStartTime + this.visibleDuration;
+ timelineOverviewGraph.updateLayout();
+ }
+ },
+
+ updateLayoutIfNeeded: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier) {
+ this.updateLayout();
+ return;
+ }
+
+ this._timelineRuler.updateLayoutIfNeeded();
+
+ for (var timelineOverviewGraph of this._timelineOverviewGraphsMap.values())
+ timelineOverviewGraph.updateLayoutIfNeeded();
+ },
+
+ // Private
+
+ _updateElementWidth: function(element, newWidth)
+ {
+ var currentWidth = parseInt(element.style.width);
+ if (currentWidth !== newWidth)
+ element.style.width = newWidth + "px";
+ },
+
+ _needsLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+ this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
+ },
+
+ _handleScrollEvent: function(event)
+ {
+ if (this._ignoreNextScrollEvent) {
+ delete this._ignoreNextScrollEvent;
+ return;
+ }
+
+ this._dontUpdateScrollLeft = true;
+
+ var scrollOffset = this._scrollContainer.scrollLeft;
+ this.scrollStartTime = this._startTime + (scrollOffset * this._secondsPerPixel);
+
+ // Force layout so we can update with the scroll position synchronously.
+ this.updateLayoutIfNeeded();
+
+ delete this._dontUpdateScrollLeft;
+ },
+
+ _handleWheelEvent: function(event)
+ {
+ // Ignore cloned events that come our way, we already handled the original.
+ if (event.__cloned)
+ return;
+
+ // Require twice the vertical delta to overcome horizontal scrolling. This prevents most
+ // cases of inadvertent zooming for slightly diagonal scrolls.
+ if (Math.abs(event.deltaX) >= Math.abs(event.deltaY) * 0.5) {
+ // Clone the event to dispatch it on the scroll container. Mark it as cloned so we don't get into a loop.
+ var newWheelEvent = new event.constructor(event.type, event);
+ newWheelEvent.__cloned = true;
+
+ this._scrollContainer.dispatchEvent(newWheelEvent);
+ return;
+ }
+
+ // Remember the mouse position in time.
+ var mouseOffset = event.pageX - this._element.totalOffsetLeft;
+ var mousePositionTime = this._scrollStartTime + (mouseOffset * this._secondsPerPixel);
+ var deviceDirection = event.webkitDirectionInvertedFromDevice ? 1 : -1;
+
+ this.secondsPerPixel += event.deltaY * (this._secondsPerPixel / WebInspector.TimelineOverview.ScrollDeltaDenominator) * deviceDirection;
+
+ // Center the zoom around the mouse based on the remembered mouse position time.
+ this.scrollStartTime = mousePositionTime - (mouseOffset * this._secondsPerPixel);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _timeRangeSelectionChanged: function(event)
+ {
+ this._selectionStartTimeSetting.value = this.selectionStartTime - this._startTime;
+ this._selectionDurationSetting.value = this.selectionDuration;
+
+ this.dispatchEventToListeners(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineOverviewGraphjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineOverviewGraph.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineOverviewGraph = function(recording)
+{
+ WebInspector.Object.call(this);
+
+ this.element = document.createElement("div");
+ this.element.classList.add(WebInspector.TimelineOverviewGraph.StyleClassName);
+
+ this._zeroTime = 0;
+ this._startTime = 0;
+ this._endTime = 5;
+ this._currentTime = 0;
+};
+
+WebInspector.TimelineOverviewGraph.StyleClassName = "timeline-overview-graph";
+
+WebInspector.TimelineOverviewGraph.prototype = {
+ constructor: WebInspector.TimelineOverviewGraph,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get zeroTime()
+ {
+ return this._zeroTime;
+ },
+
+ set zeroTime(x)
+ {
+ if (this._zeroTime === x)
+ return;
+
+ this._zeroTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ set startTime(x)
+ {
+ if (this._startTime === x)
+ return;
+
+ this._startTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ set endTime(x)
+ {
+ if (this._endTime === x)
+ return;
+
+ this._endTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get currentTime()
+ {
+ return this._currentTime;
+ },
+
+ set currentTime(x)
+ {
+ if (this._currentTime === x)
+ return;
+
+ var oldCurrentTime = this._currentTime;
+
+ this._currentTime = x || 0;
+
+ if ((this._startTime <= oldCurrentTime && oldCurrentTime <= this._endTime) || (this._startTime <= this._currentTime && this._currentTime <= this._endTime))
+ this.needsLayout();
+ },
+
+ reset: function()
+ {
+ // Implemented by sub-classes if needed.
+ },
+
+ updateLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
+ delete this._scheduledLayoutUpdateIdentifier;
+ }
+
+ // Implemented by sub-classes if needed.
+ },
+
+ updateLayoutIfNeeded: function()
+ {
+ if (!this._scheduledLayoutUpdateIdentifier)
+ return;
+ this.updateLayout();
+ },
+
+ // Protected
+
+ needsLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+
+ this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-record-bar {
+ position: absolute;
+ height: 12px;
+}
+
+.timeline-record-bar > .segment {
+ position: absolute;
+ height: 100%;
+ background-color: rgb(225, 225, 225);
+ border: 1px solid rgb(200, 200, 200);
+ border-radius: 3px;
+ min-width: 4px;
+ z-index: 1;
+}
+
+.timeline-record-bar:not(.has-inactive-segment) > .segment {
+ left: 0;
+ width: 100%;
+}
+
+.timeline-record-bar > .segment.inactive {
+ z-index: 0;
+}
+
+.timeline-record-bar > .segment.inactive,
+.timeline-record-bar.unfinished > .segment {
+ border-top-right-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+ border-right: none;
+}
+
+.timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
+ border-top-left-radius: 0 !important;
+ border-bottom-left-radius: 0 !important;
+}
+
+:focus .selected .timeline-record-bar > .segment {
+ background-color: white !important;
+ border: none !important;
+}
+
+:focus .selected .timeline-record-bar > .segment.inactive {
+ background-color: rgb(196, 215, 242) !important;
+}
+
+:focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive) {
+ border-left: 1px solid rgba(56, 121, 217, 0.7) !important;
+}
+
+.timeline-record-bar.timeline-record-type-network > .segment {
+ background-color: rgb(120, 176, 225);
+ border-color: rgb(61, 147, 200);
+}
+
+.timeline-record-bar.timeline-record-type-network > .segment.inactive {
+ background-color: rgb(167, 204, 237);
+ border-color: rgb(127, 185, 220);
+}
+
+.timeline-record-bar.timeline-record-type-layout > .segment {
+ background-color: rgb(234, 153, 153);
+ border-color: rgb(212, 108, 108);
+}
+
+.timeline-record-bar.timeline-record-type-script > .segment {
+ background-color: rgb(190, 148, 233);
+ border-color: rgb(153, 113, 185);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRecordBarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRecordBar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,346 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecordBar = function(records, renderMode)
+{
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.classList.add(WebInspector.TimelineRecordBar.StyleClassName);
+
+ this.renderMode = renderMode;
+ this.records = records;
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.TimelineRecordBar);
+
+WebInspector.TimelineRecordBar.StyleClassName = "timeline-record-bar";
+WebInspector.TimelineRecordBar.BarSegmentStyleClassName = "segment";
+WebInspector.TimelineRecordBar.InactiveStyleClassName = "inactive";
+WebInspector.TimelineRecordBar.UnfinishedStyleClassName = "unfinished";
+WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName = "has-inactive-segment";
+WebInspector.TimelineRecordBar.MinimumWidthPixels = 4;
+WebInspector.TimelineRecordBar.MinimumMarginPixels = 1;
+
+WebInspector.TimelineRecordBar.RenderMode = {
+ Normal: "timeline-record-bar-normal-render-mode",
+ InactiveOnly: "timeline-record-bar-inactive-only-render-mode",
+ ActiveOnly: "timeline-record-bar-active-only-render-mode"
+};
+
+WebInspector.TimelineRecordBar.createCombinedBars = function(records, secondsPerPixel, graphDataSource, createBarCallback)
+{
+ if (!records.length)
+ return;
+
+ var startTime = graphDataSource.startTime;
+ var currentTime = graphDataSource.currentTime;
+ var endTime = graphDataSource.endTime;
+
+ var visibleRecords = [];
+ var usesActiveStartTime = false;
+ var lastRecordType = null;
+
+ // FIXME: Do a binary search for records that fall inside start and current time.
+
+ for (var record of records) {
+ if (isNaN(record.startTime))
+ continue;
+
+ // If this bar is completely before the bounds of the graph, skip this record.
+ if (record.endTime < startTime)
+ continue;
+
+ // If this record is completely after the current time or end time, break out now.
+ // Records are sorted, so all records after this will be beyond the current or end time too.
+ if (record.startTime > currentTime || record.startTime > endTime)
+ break;
+
+ if (record.usesActiveStartTime)
+ usesActiveStartTime = true;
+
+ // If one record uses active time the rest are assumed to use it.
+ console.assert(record.usesActiveStartTime === usesActiveStartTime);
+
+ // Only a single record type is supported right now.
+ console.assert(!lastRecordType || record.type === lastRecordType);
+
+ visibleRecords.push(record);
+
+ lastRecordType = record.type;
+ }
+
+ if (!visibleRecords.length)
+ return;
+
+ if (visibleRecords.length === 1) {
+ createBarCallback(visibleRecords, WebInspector.TimelineRecordBar.RenderMode.Normal);
+ return;
+ }
+
+ function compareByActiveStartTime(a, b)
+ {
+ return a.activeStartTime - b.activeStartTime;
+ }
+
+ var minimumDuration = secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;
+ var minimumMargin = secondsPerPixel * WebInspector.TimelineRecordBar.MinimumMarginPixels;
+
+ if (usesActiveStartTime) {
+ var inactiveStartTime = NaN;
+ var inactiveEndTime = NaN;
+ var inactiveRecords = [];
+
+ for (var record of visibleRecords) {
+ // Check if the previous record is far enough away to create the inactive bar.
+ if (!isNaN(inactiveStartTime) && inactiveStartTime + Math.max(inactiveEndTime - inactiveStartTime, minimumDuration) + minimumMargin <= record.startTime) {
+ createBarCallback(inactiveRecords, WebInspector.TimelineRecordBar.RenderMode.InactiveOnly);
+ inactiveRecords = [];
+ inactiveStartTime = NaN;
+ inactiveEndTime = NaN;
+ }
+
+ // If this is a new bar, peg the start time.
+ if (isNaN(inactiveStartTime))
+ inactiveStartTime = record.startTime;
+
+ // Update the end time to be the maximum we encounter. inactiveEndTime might be NaN, so "|| 0" to prevent Math.max from returning NaN.
+ inactiveEndTime = Math.max(inactiveEndTime || 0, record.activeStartTime);
+
+ inactiveRecords.push(record);
+ }
+
+ // Create the inactive bar for the last record if needed.
+ if (!isNaN(inactiveStartTime))
+ createBarCallback(inactiveRecords, WebInspector.TimelineRecordBar.RenderMode.InactiveOnly);
+
+ visibleRecords.sort(compareByActiveStartTime);
+ }
+
+ lastRecordType = null;
+
+ var activeStartTime = NaN;
+ var activeEndTime = NaN;
+ var activeRecords = [];
+
+ var startTimeProperty = usesActiveStartTime ? "activeStartTime" : "startTime";
+
+ for (var record of visibleRecords) {
+ // Check if the previous record is far enough away to create the active bar. We also create it now if the current record has no active state time.
+ if (!isNaN(activeStartTime) && (activeStartTime + Math.max(activeEndTime - activeStartTime, minimumDuration) + minimumMargin <= record[startTimeProperty]
+ || (isNaN(record[startTimeProperty]) && !isNaN(activeEndTime)))) {
+ createBarCallback(activeRecords, WebInspector.TimelineRecordBar.RenderMode.ActiveOnly);
+ activeRecords = [];
+ activeStartTime = NaN;
+ activeEndTime = NaN;
+ }
+
+ if (isNaN(record[startTimeProperty]))
+ continue;
+
+ // If this is a new bar, peg the start time.
+ if (isNaN(activeStartTime))
+ activeStartTime = record[startTimeProperty];
+
+ // Update the end time to be the maximum we encounter. activeEndTime might be NaN, so "|| 0" to prevent Math.max from returning NaN.
+ if (!isNaN(record.endTime))
+ activeEndTime = Math.max(activeEndTime || 0, record.endTime);
+
+ activeRecords.push(record);
+ }
+
+ // Create the active bar for the last record if needed.
+ if (!isNaN(activeStartTime))
+ createBarCallback(activeRecords, WebInspector.TimelineRecordBar.RenderMode.ActiveOnly);
+};
+
+WebInspector.TimelineRecordBar.prototype = {
+ constructor: WebInspector.TimelineRecordBar,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get renderMode()
+ {
+ return this._renderMode;
+ },
+
+ set renderMode(renderMode)
+ {
+ this._renderMode = renderMode || WebInspector.TimelineRecordBar.RenderMode.Normal;
+ },
+
+ get records()
+ {
+ return this._records;
+ },
+
+ set records(records)
+ {
+ if (this._records && this._records.length)
+ this._element.classList.remove(this._records[0].type);
+
+ records = records || [];
+
+ if (!(records instanceof Array))
+ records = [records];
+
+ this._records = records;
+
+ // Assume all records are the same type.
+ if (this._records.length)
+ this._element.classList.add(this._records[0].type);
+ },
+
+ refresh: function(graphDataSource)
+ {
+ if (!this._records || !this._records.length)
+ return false;
+
+ var firstRecord = this._records[0];
+ var barStartTime = firstRecord.startTime;
+
+ // If this bar has no time info, return early.
+ if (isNaN(barStartTime))
+ return false;
+
+ var graphStartTime = graphDataSource.startTime;
+ var graphEndTime = graphDataSource.endTime;
+ var graphCurrentTime = graphDataSource.currentTime;
+
+ var barEndTime = this._records.reduce(function(previousValue, currentValue) { return Math.max(previousValue, currentValue.endTime); }, 0);
+
+ // If this bar is completely after the current time, return early.
+ if (barStartTime > graphCurrentTime)
+ return false;
+
+ // If this bar is completely before or after the bounds of the graph, return early.
+ if (barEndTime < graphStartTime || barStartTime > graphEndTime)
+ return false;
+
+ var barUnfinished = isNaN(barEndTime) || barEndTime >= graphCurrentTime;
+ if (barUnfinished)
+ barEndTime = graphCurrentTime;
+
+ var graphDuration = graphEndTime - graphStartTime;
+
+ this._element.classList.toggle(WebInspector.TimelineRecordBar.UnfinishedStyleClassName, barUnfinished);
+
+ var newBarLeftPosition = (barStartTime - graphStartTime) / graphDuration;
+ this._updateElementPosition(this._element, newBarLeftPosition, "left");
+
+ var newBarWidth = ((barEndTime - graphStartTime) / graphDuration) - newBarLeftPosition;
+ this._updateElementPosition(this._element, newBarWidth, "width");
+
+ if (!this._activeBarElement && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
+ this._activeBarElement = document.createElement("div");
+ this._activeBarElement.classList.add(WebInspector.TimelineRecordBar.BarSegmentStyleClassName);
+ }
+
+ if (!firstRecord.usesActiveStartTime) {
+ this._element.classList.remove(WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName);
+
+ if (this._inactiveBarElement)
+ this._inactiveBarElement.remove();
+
+ if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
+ if (this._activeBarElement)
+ this._activeBarElement.remove();
+
+ return false;
+ }
+
+ // If this TimelineRecordBar is reused and had an inactive bar previously, clean it up.
+ this._activeBarElement.style.removeProperty("left");
+ this._activeBarElement.style.removeProperty("width");
+
+ if (!this._activeBarElement.parentNode)
+ this._element.appendChild(this._activeBarElement);
+
+ return true;
+ }
+
+ this._element.classList.add(WebInspector.TimelineRecordBar.HasInactiveSegmentStyleClassName);
+
+ // Find the earliest active start time for active only rendering, and the latest for the other modes.
+ // This matches the values that TimelineRecordBar.createCombinedBars uses when combining.
+ if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.ActiveOnly)
+ var barActiveStartTime = this._records.reduce(function(previousValue, currentValue) { return Math.min(previousValue, currentValue.activeStartTime); }, Infinity);
+ else
+ var barActiveStartTime = this._records.reduce(function(previousValue, currentValue) { return Math.max(previousValue, currentValue.activeStartTime); }, 0);
+
+ var barDuration = barEndTime - barStartTime;
+
+ var inactiveUnfinished = isNaN(barActiveStartTime) || barActiveStartTime >= graphCurrentTime;
+ this._element.classList.toggle(WebInspector.TimelineRecordBar.UnfinishedStyleClassName, inactiveUnfinished);
+
+ if (inactiveUnfinished)
+ barActiveStartTime = graphCurrentTime;
+
+ var middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
+
+ if (this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
+ if (!this._inactiveBarElement) {
+ this._inactiveBarElement = document.createElement("div");
+ this._inactiveBarElement.classList.add(WebInspector.TimelineRecordBar.BarSegmentStyleClassName);
+ this._inactiveBarElement.classList.add(WebInspector.TimelineRecordBar.InactiveStyleClassName);
+ }
+
+ this._updateElementPosition(this._inactiveBarElement, 1 - middlePercentage, "right");
+ this._updateElementPosition(this._inactiveBarElement, middlePercentage, "width");
+
+ if (!this._inactiveBarElement.parentNode)
+ this._element.insertBefore(this._inactiveBarElement, this._element.firstChild);
+ }
+
+ if (!inactiveUnfinished && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.InactiveOnly) {
+ this._updateElementPosition(this._activeBarElement, middlePercentage, "left");
+ this._updateElementPosition(this._activeBarElement, 1 - middlePercentage, "width");
+
+ if (!this._activeBarElement.parentNode)
+ this._element.appendChild(this._activeBarElement);
+ } else if (this._activeBarElement)
+ this._activeBarElement.remove();
+
+ return true;
+ },
+
+ // Private
+
+ _updateElementPosition: function(element, newPosition, property)
+ {
+ newPosition *= 100;
+ newPosition = newPosition.toFixed(2);
+
+ var currentPosition = parseFloat(element.style[property]).toFixed(2);
+ if (currentPosition !== newPosition)
+ element.style[property] = newPosition + "%";
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRecordTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRecordTreeElement.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,146 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRecordTreeElement = function(timelineRecord, subtitleNameStyle, includeTimerIdentifierInMainTitle, sourceCodeLocation, representedObject)
+{
+ console.assert(timelineRecord);
+
+ this._record = timelineRecord;
+ this._sourceCodeLocation = sourceCodeLocation || timelineRecord.sourceCodeLocation || null;
+
+ var title = "";
+ var subtitle = "";
+
+ if (this._sourceCodeLocation) {
+ subtitle = document.createElement("span");
+
+ if (subtitleNameStyle !== WebInspector.SourceCodeLocation.NameStyle.None)
+ this._sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent", null, subtitleNameStyle);
+ else
+ this._sourceCodeLocation.populateLiveDisplayLocationString(subtitle, "textContent", null, WebInspector.SourceCodeLocation.NameStyle.None, WebInspector.UIString("line "));
+ }
+
+ var iconStyleClass = null;
+
+ switch (timelineRecord.type) {
+ case WebInspector.TimelineRecord.Type.Layout:
+ title = WebInspector.LayoutTimelineRecord.EventType.displayName(timelineRecord.eventType);
+
+ switch (timelineRecord.eventType) {
+ case WebInspector.LayoutTimelineRecord.EventType.InvalidateStyles:
+ case WebInspector.LayoutTimelineRecord.EventType.RecalculateStyles:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass;
+ break;
+ case WebInspector.LayoutTimelineRecord.EventType.InvalidateLayout:
+ case WebInspector.LayoutTimelineRecord.EventType.Layout:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass;
+ break;
+ case WebInspector.LayoutTimelineRecord.EventType.Paint:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
+ break;
+ default:
+ console.error("Unknown LayoutTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
+ }
+
+ break;
+
+ case WebInspector.TimelineRecord.Type.Script:
+ title = WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeTimerIdentifierInMainTitle);
+
+ switch (timelineRecord.eventType) {
+ case WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass;
+ break;
+ case WebInspector.ScriptTimelineRecord.EventType.EventDispatched:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass;
+ break;
+ case WebInspector.ScriptTimelineRecord.EventType.TimerFired:
+ case WebInspector.ScriptTimelineRecord.EventType.TimerInstalled:
+ case WebInspector.ScriptTimelineRecord.EventType.TimerRemoved:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass;
+ break;
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameFired:
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameRequested:
+ case WebInspector.ScriptTimelineRecord.EventType.AnimationFrameCanceled:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass;
+ break;
+ default:
+ console.error("Unknown ScriptTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
+ }
+
+ break;
+
+ default:
+ console.error("Unknown TimelineRecord type: " + timelineRecord.type, timelineRecord);
+ }
+
+ WebInspector.GeneralTreeElement.call(this, [iconStyleClass], title, subtitle, representedObject || timelineRecord, false);
+
+ this.small = true;
+
+ if (this._sourceCodeLocation)
+ this.tooltipHandledSeparately = true;
+};
+
+WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass = "style-record";
+WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass = "layout-record";
+WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass = "paint-record";
+WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass = "evaluated-record";
+WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass = "event-record";
+WebInspector.TimelineRecordTreeElement.TimerRecordIconStyleClass = "timer-record";
+WebInspector.TimelineRecordTreeElement.AnimationRecordIconStyleClass = "animation-record";
+
+WebInspector.TimelineRecordTreeElement.prototype = {
+ constructor: WebInspector.TimelineRecordTreeElement,
+ __proto__: WebInspector.GeneralTreeElement.prototype,
+
+ // Public
+
+ get record()
+ {
+ return this._record;
+ },
+
+ get filterableData()
+ {
+ var url = this._sourceCodeLocation ? this._sourceCodeLocation.sourceCode.url : "";
+ return {text: [this.mainTitle, url || "", this._record.details || ""]};
+ },
+
+ // Protected
+
+ onattach: function()
+ {
+ WebInspector.GeneralTreeElement.prototype.onattach.call(this);
+
+ console.assert(this.element);
+
+ if (!this.tooltipHandledSeparately)
+ return;
+
+ var tooltipPrefix = this.mainTitle + "\n";
+ this._sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulercssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRulercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,176 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-ruler {
+ position: relative;
+ pointer-events: none;
+}
+
+.timeline-ruler.allows-time-range-selection {
+ pointer-events: all;
+}
+
+.timeline-ruler > * {
+ pointer-events: none;
+}
+
+.timeline-ruler > .header {
+ border-bottom: 1px solid rgb(200, 200, 200);
+
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 22px;
+}
+
+.timeline-ruler > .header > .divider {
+ position: absolute;
+ width: 1px;
+ top: 0;
+ bottom: 0;
+ -webkit-transform: translateX(-1px);
+ background-image: -webkit-linear-gradient(bottom, rgba(200, 200, 200, 1), rgba(200, 200, 200, 0) 85%);
+}
+
+.timeline-ruler > .header > .divider > .label {
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ font-size: 9px;
+ font-family: "Lucida Grande", sans-serif;
+ color: rgb(128, 128, 128);
+ white-space: nowrap;
+}
+
+.timeline-ruler > .markers {
+ position: absolute;
+ top: 22px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 10;
+}
+
+.timeline-ruler > .markers > .divider {
+ position: absolute;
+ width: 1px;
+ top: 1px;
+ bottom: 0;
+ -webkit-transform: translateX(-1px);
+ background-color: rgba(0, 0, 0, 0.05);
+}
+
+.timeline-ruler > .markers > .marker {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+
+ -webkit-transform: translateX(-1px);
+
+ border-left-width: 1px;
+ border-left-style: dashed;
+ border-left-color: rgba(128, 128, 128, 0.5);
+}
+
+.timeline-ruler > .markers > .marker.current-time {
+ border-left-color: red;
+ border-left-style: solid;
+}
+
+.timeline-ruler > .markers > .marker.current-time::before {
+ position: absolute;
+ top: -5px;
+ left: -5px;
+
+ width: 9px;
+ height: 9px;
+ border-radius: 5px;
+
+ background-color: red;
+
+ content: "";
+}
+
+.timeline-ruler > .markers > .marker.load-event {
+ border-left-color: rgba(255, 0, 0, 0.5);
+}
+
+.timeline-ruler > .markers > .marker.dom-content-event {
+ border-left-color: rgba(0, 0, 255, 0.5);
+}
+
+.timeline-ruler > .markers > .marker.timestamp {
+ border-left-color: rgba(0, 110, 0, 0.5);
+}
+
+.timeline-ruler > .selection-drag {
+ position: absolute;
+ top: 0;
+ height: 22px;
+ cursor: -webkit-grab;
+ pointer-events: all;
+}
+
+.timeline-ruler > .selection-drag:active {
+ cursor: -webkit-grabbing;
+}
+
+.timeline-ruler > .selection-handle {
+ position: absolute;
+ top: 0;
+ width: 8px;
+ height: 21px;
+ border-radius: 5px;
+ background-color: rgb(164, 164, 164);
+ border: 1px solid white;
+ cursor: col-resize;
+ pointer-events: all;
+ z-index: 15;
+}
+
+.timeline-ruler > .selection-handle.left {
+ -webkit-transform: translateX(-4px);
+}
+
+.timeline-ruler > .selection-handle.right {
+ -webkit-transform: translateX(4px);
+}
+
+.timeline-ruler > .shaded-area {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.1);
+ z-index: 15;
+}
+
+.timeline-ruler > .shaded-area.left {
+ left: 0;
+}
+
+.timeline-ruler > .shaded-area.right {
+ right: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineRulerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineRuler.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,753 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineRuler = function()
+{
+ WebInspector.Object.call(this);
+
+ this._element = document.createElement("div");
+ this._element.className = WebInspector.TimelineRuler.StyleClassName;
+
+ this._headerElement = document.createElement("div");
+ this._headerElement.className = WebInspector.TimelineRuler.HeaderElementStyleClassName;
+ this._element.appendChild(this._headerElement);
+
+ this._markersElement = document.createElement("div");
+ this._markersElement.className = WebInspector.TimelineRuler.MarkersElementStyleClassName;
+ this._element.appendChild(this._markersElement);
+
+ this._zeroTime = 0;
+ this._startTime = 0;
+ this._endTime = 0;
+ this._duration = NaN;
+ this._secondsPerPixel = 0;
+ this._selectionStartTime = 0;
+ this._selectionEndTime = Infinity;
+ this._endTimePinned = false;
+ this._allowsClippedLabels = false;
+ this._allowsTimeRangeSelection = false;
+
+ this._markerElementMap = new Map;
+}
+
+WebInspector.TimelineRuler.MinimumLeftDividerSpacing = 48;
+WebInspector.TimelineRuler.MinimumDividerSpacing = 64;
+
+WebInspector.TimelineRuler.StyleClassName = "timeline-ruler";
+WebInspector.TimelineRuler.AllowsTimeRangeSelectionStyleClassName = "allows-time-range-selection";
+WebInspector.TimelineRuler.HeaderElementStyleClassName = "header";
+WebInspector.TimelineRuler.DividerElementStyleClassName = "divider";
+WebInspector.TimelineRuler.DividerLabelElementStyleClassName = "label";
+
+WebInspector.TimelineRuler.MarkersElementStyleClassName = "markers";
+WebInspector.TimelineRuler.BaseMarkerElementStyleClassName = "marker";
+WebInspector.TimelineRuler.ShadedAreaElementStyleClassName = "shaded-area";
+WebInspector.TimelineRuler.SelectionDragElementStyleClassName = "selection-drag";
+WebInspector.TimelineRuler.SelectionHandleElementStyleClassName = "selection-handle";
+WebInspector.TimelineRuler.LeftSelectionElementStyleClassName = "left";
+WebInspector.TimelineRuler.RightSelectionElementStyleClassName = "right";
+WebInspector.TimelineRuler.MinimumSelectionTimeRange = 0.01;
+
+WebInspector.TimelineRuler.Event = {
+ TimeRangeSelectionChanged: "time-ruler-time-range-selection-changed"
+};
+
+WebInspector.TimelineRuler.prototype = {
+ constructor: WebInspector.TimelineRuler,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get allowsClippedLabels()
+ {
+ return this._allowsClippedLabels
+ },
+
+ set allowsClippedLabels(x)
+ {
+ if (this._allowsClippedLabels === x)
+ return;
+
+ this._allowsClippedLabels = x || false;
+
+ this._needsLayout();
+ },
+
+ get allowsTimeRangeSelection()
+ {
+ return this._allowsTimeRangeSelection;
+ },
+
+ set allowsTimeRangeSelection(x)
+ {
+ if (this._allowsTimeRangeSelection === x)
+ return;
+
+ this._allowsTimeRangeSelection = x || false;
+
+ if (x) {
+ this._mouseDownEventListener = this._handleMouseDown.bind(this);
+ this._element.addEventListener("mousedown", this._mouseDownEventListener);
+
+ this._leftShadedAreaElement = document.createElement("div");
+ this._leftShadedAreaElement.classList.add(WebInspector.TimelineRuler.ShadedAreaElementStyleClassName);
+ this._leftShadedAreaElement.classList.add(WebInspector.TimelineRuler.LeftSelectionElementStyleClassName);
+
+ this._rightShadedAreaElement = document.createElement("div");
+ this._rightShadedAreaElement.classList.add(WebInspector.TimelineRuler.ShadedAreaElementStyleClassName);
+ this._rightShadedAreaElement.classList.add(WebInspector.TimelineRuler.RightSelectionElementStyleClassName);
+
+ this._leftSelectionHandleElement = document.createElement("div");
+ this._leftSelectionHandleElement.classList.add(WebInspector.TimelineRuler.SelectionHandleElementStyleClassName);
+ this._leftSelectionHandleElement.classList.add(WebInspector.TimelineRuler.LeftSelectionElementStyleClassName);
+ this._leftSelectionHandleElement.addEventListener("mousedown", this._handleSelectionHandleMouseDown.bind(this));
+
+ this._rightSelectionHandleElement = document.createElement("div");
+ this._rightSelectionHandleElement.classList.add(WebInspector.TimelineRuler.SelectionHandleElementStyleClassName);
+ this._rightSelectionHandleElement.classList.add(WebInspector.TimelineRuler.RightSelectionElementStyleClassName);
+ this._rightSelectionHandleElement.addEventListener("mousedown", this._handleSelectionHandleMouseDown.bind(this));
+
+ this._selectionDragElement = document.createElement("div");
+ this._selectionDragElement.classList.add(WebInspector.TimelineRuler.SelectionDragElementStyleClassName);
+
+ this._needsSelectionLayout();
+ } else {
+ this._element.removeEventListener("mousedown", this._mouseDownEventListener);
+ delete this._mouseDownEventListener;
+
+ this._leftShadedAreaElement.remove();
+ this._rightShadedAreaElement.remove();
+ this._leftSelectionHandleElement.remove();
+ this._rightSelectionHandleElement.remove();
+ this._selectionDragElement.remove();
+
+ delete this._leftShadedAreaElement;
+ delete this._rightShadedAreaElement;
+ delete this._leftSelectionHandleElement;
+ delete this._rightSelectionHandleElement;
+ delete this._selectionDragElement;
+ }
+ },
+
+ get zeroTime()
+ {
+ return this._zeroTime;
+ },
+
+ set zeroTime(x)
+ {
+ if (this._zeroTime === x)
+ return;
+
+ this._zeroTime = x || 0;
+
+ this._needsLayout();
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ set startTime(x)
+ {
+ if (this._startTime === x)
+ return;
+
+ this._startTime = x || 0;
+
+ if (!isNaN(this._duration))
+ this._endTime = this._startTime + this._duration;
+
+ this._needsLayout();
+ },
+
+ get duration()
+ {
+ if (!isNaN(this._duration))
+ return this._duration;
+ return this.endTime - this.startTime;
+ },
+
+ set duration(x)
+ {
+ if (this._duration === x)
+ return;
+
+ this._duration = x || NaN;
+
+ if (!isNaN(this._duration)) {
+ this._endTime = this._startTime + this._duration;
+ this._endTimePinned = true;
+ } else
+ this._endTimePinned = false;
+
+ this._needsLayout();
+ },
+
+ get endTime()
+ {
+ if (!this._endTimePinned && this._scheduledLayoutUpdateIdentifier)
+ this._recalculate();
+ return this._endTime;
+ },
+
+ set endTime(x)
+ {
+ if (this._endTime === x)
+ return;
+
+ this._endTime = x || 0;
+ this._endTimePinned = true;
+
+ this._needsLayout();
+ },
+
+ get secondsPerPixel()
+ {
+ if (this._scheduledLayoutUpdateIdentifier)
+ this._recalculate();
+ return this._secondsPerPixel;
+ },
+
+ set secondsPerPixel(x)
+ {
+ if (this._secondsPerPixel === x)
+ return;
+
+ this._secondsPerPixel = x || 0;
+ this._endTimePinned = false;
+ this._currentSliceTime = 0;
+
+ this._needsLayout();
+ },
+
+ get selectionStartTime()
+ {
+ return this._selectionStartTime;
+ },
+
+ set selectionStartTime(x)
+ {
+ if (this._selectionStartTime === x)
+ return;
+
+ this._selectionStartTime = x || 0;
+ this._timeRangeSelectionChanged = true;
+
+ this._needsSelectionLayout();
+ },
+
+ get selectionEndTime()
+ {
+ return this._selectionEndTime;
+ },
+
+ set selectionEndTime(x)
+ {
+ if (this._selectionEndTime === x)
+ return;
+
+ this._selectionEndTime = x || 0;
+ this._timeRangeSelectionChanged = true;
+
+ this._needsSelectionLayout();
+ },
+
+ addMarker: function(marker)
+ {
+ console.assert(marker instanceof WebInspector.TimelineMarker);
+
+ if (this._markerElementMap.has(marker))
+ return;
+
+ marker.addEventListener(WebInspector.TimelineMarker.Event.TimeChanged, this._timelineMarkerTimeChanged, this);
+
+ var markerElement = document.createElement("div");
+ markerElement.classList.add(WebInspector.TimelineRuler.BaseMarkerElementStyleClassName);
+ markerElement.classList.add(marker.type);
+
+ this._markerElementMap.set(marker, markerElement);
+
+ this._needsMarkerLayout();
+ },
+
+ elementForMarker: function(marker)
+ {
+ return this._markerElementMap.get(marker) || null;
+ },
+
+ updateLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
+ delete this._scheduledLayoutUpdateIdentifier;
+ }
+
+ var visibleWidth = this._recalculate();
+ if (visibleWidth <= 0)
+ return;
+
+ var duration = this.duration;
+
+ var pixelsPerSecond = visibleWidth / duration;
+
+ // Calculate a divider count based on the maximum allowed divider density.
+ var dividerCount = Math.round(visibleWidth / WebInspector.TimelineRuler.MinimumDividerSpacing);
+
+ if (this._endTimePinned || !this._currentSliceTime) {
+ // Calculate the slice time based on the rough divider count and the time span.
+ var sliceTime = duration / dividerCount;
+
+ // Snap the slice time to a nearest number (e.g. 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, etc.)
+ sliceTime = Math.pow(10, Math.ceil(Math.log(sliceTime) / Math.LN10));
+ if (sliceTime * pixelsPerSecond >= 5 * WebInspector.TimelineRuler.MinimumDividerSpacing)
+ sliceTime = sliceTime / 5;
+ if (sliceTime * pixelsPerSecond >= 2 * WebInspector.TimelineRuler.MinimumDividerSpacing)
+ sliceTime = sliceTime / 2;
+
+ this._currentSliceTime = sliceTime;
+ } else {
+ // Reuse the last slice time since the time duration does not scale to fit when the end time isn't pinned.
+ var sliceTime = this._currentSliceTime;
+ }
+
+ var firstDividerTime = (Math.ceil((this._startTime - this._zeroTime) / sliceTime) * sliceTime) + this._zeroTime;
+ var lastDividerTime = this._endTime;
+
+ // Calculate the divider count now based on the final slice time.
+ dividerCount = Math.ceil((lastDividerTime - firstDividerTime) / sliceTime);
+
+ // Make an extra divider in case the last one is partially visible.
+ if (!this._endTimePinned)
+ ++dividerCount;
+
+ var markerDividers = this._markersElement.querySelectorAll("." + WebInspector.TimelineRuler.DividerElementStyleClassName);
+
+ var dividerElement = this._headerElement.firstChild;
+
+ for (var i = 0; i <= dividerCount; ++i) {
+ if (!dividerElement) {
+ dividerElement = document.createElement("div");
+ dividerElement.className = WebInspector.TimelineRuler.DividerElementStyleClassName;
+ this._headerElement.appendChild(dividerElement);
+
+ var labelElement = document.createElement("div");
+ labelElement.className = WebInspector.TimelineRuler.DividerLabelElementStyleClassName;
+ dividerElement._labelElement = labelElement;
+ dividerElement.appendChild(labelElement);
+ }
+
+ var markerDividerElement = markerDividers[i];
+ if (!markerDividerElement) {
+ markerDividerElement = document.createElement("div");
+ markerDividerElement.className = WebInspector.TimelineRuler.DividerElementStyleClassName;
+ this._markersElement.appendChild(markerDividerElement);
+ }
+
+ var dividerTime = firstDividerTime + (sliceTime * i);
+
+ var newLeftPosition = (dividerTime - this._startTime) / duration;
+
+ if (!this._allowsClippedLabels) {
+ // Don't allow dividers under 0% where they will be completely hidden.
+ if (newLeftPosition < 0)
+ continue;
+
+ // When over 100% it is time to stop making/updating dividers.
+ if (newLeftPosition > 1)
+ break;
+
+ // Don't allow the left-most divider spacing to be so tight it clips.
+ if ((newLeftPosition * visibleWidth) < WebInspector.TimelineRuler.MinimumLeftDividerSpacing)
+ continue;
+ }
+
+ this._updatePositionOfElement(dividerElement, newLeftPosition, visibleWidth);
+ this._updatePositionOfElement(markerDividerElement, newLeftPosition, visibleWidth);
+
+ dividerElement._labelElement.textContent = isNaN(dividerTime) ? "" : Number.secondsToString(dividerTime - this._zeroTime, true);
+ dividerElement = dividerElement.nextSibling;
+ }
+
+ // Remove extra dividers.
+ while (dividerElement) {
+ var nextDividerElement = dividerElement.nextSibling;
+ dividerElement.remove();
+ dividerElement = nextDividerElement;
+ }
+
+ for (; i < markerDividers.length; ++i)
+ markerDividers[i].remove();
+
+ this._updateMarkers(visibleWidth, duration);
+ this._updateSelection(visibleWidth, duration);
+ },
+
+ updateLayoutIfNeeded: function()
+ {
+ // If there is a main layout scheduled we can just update layout and return, since that
+ // will update markers and the selection at the same time.
+ if (this._scheduledLayoutUpdateIdentifier) {
+ this.updateLayout();
+ return;
+ }
+
+ var visibleWidth = this._element.clientWidth;
+ if (visibleWidth <= 0)
+ return;
+
+ if (this._scheduledMarkerLayoutUpdateIdentifier)
+ this._updateMarkers(visibleWidth, this.duration);
+
+ if (this._scheduledSelectionLayoutUpdateIdentifier)
+ this._updateSelection(visibleWidth, this.duration);
+ },
+
+ // Private
+
+ _needsLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+
+ if (this._scheduledMarkerLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledMarkerLayoutUpdateIdentifier);
+ delete this._scheduledMarkerLayoutUpdateIdentifier;
+ }
+
+ if (this._scheduledSelectionLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledSelectionLayoutUpdateIdentifier);
+ delete this._scheduledSelectionLayoutUpdateIdentifier;
+ }
+
+ this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
+ },
+
+ _needsMarkerLayout: function()
+ {
+ // If layout is scheduled, abort since markers will be updated when layout happens.
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+
+ if (this._scheduledMarkerLayoutUpdateIdentifier)
+ return;
+
+ function update()
+ {
+ delete this._scheduledMarkerLayoutUpdateIdentifier;
+
+ var visibleWidth = this._element.clientWidth;
+ if (visibleWidth <= 0)
+ return;
+
+ this._updateMarkers(visibleWidth, this.duration);
+ }
+
+ this._scheduledMarkerLayoutUpdateIdentifier = requestAnimationFrame(update.bind(this));
+ },
+
+ _needsSelectionLayout: function()
+ {
+ if (!this._allowsTimeRangeSelection)
+ return;
+
+ // If layout is scheduled, abort since the selection will be updated when layout happens.
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+
+ if (this._scheduledSelectionLayoutUpdateIdentifier)
+ return;
+
+ function update()
+ {
+ delete this._scheduledSelectionLayoutUpdateIdentifier;
+
+ var visibleWidth = this._element.clientWidth;
+ if (visibleWidth <= 0)
+ return;
+
+ this._updateSelection(visibleWidth, this.duration);
+ }
+
+ this._scheduledSelectionLayoutUpdateIdentifier = requestAnimationFrame(update.bind(this));
+ },
+
+ _recalculate: function()
+ {
+ var visibleWidth = this._element.clientWidth;
+ if (visibleWidth <= 0)
+ return 0;
+
+ if (this._endTimePinned)
+ var duration = this._endTime - this._startTime;
+ else
+ var duration = visibleWidth * this._secondsPerPixel;
+
+ this._secondsPerPixel = duration / visibleWidth;
+
+ if (!this._endTimePinned)
+ this._endTime = this._startTime + (visibleWidth * this._secondsPerPixel);
+
+ return visibleWidth;
+ },
+
+ _updatePositionOfElement: function(element, newPosition, visibleWidth, property)
+ {
+ property = property || "left";
+
+ newPosition *= this._endTimePinned ? 100 : visibleWidth;
+ newPosition = newPosition.toFixed(2);
+
+ var currentPosition = parseFloat(element.style[property]).toFixed(2);
+ if (currentPosition !== newPosition)
+ element.style[property] = newPosition + (this._endTimePinned ? "%" : "px");
+ },
+
+ _updateMarkers: function(visibleWidth, duration)
+ {
+ if (this._scheduledMarkerLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledMarkerLayoutUpdateIdentifier);
+ delete this._scheduledMarkerLayoutUpdateIdentifier;
+ }
+
+ this._markerElementMap.forEach(function(markerElement, marker) {
+ var newLeftPosition = (marker.time - this._startTime) / duration;
+
+ this._updatePositionOfElement(markerElement, newLeftPosition, visibleWidth);
+
+ if (!markerElement.parentNode)
+ this._markersElement.appendChild(markerElement);
+ }, this);
+ },
+
+ _updateSelection: function(visibleWidth, duration)
+ {
+ if (this._scheduledSelectionLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledSelectionLayoutUpdateIdentifier);
+ delete this._scheduledSelectionLayoutUpdateIdentifier;
+ }
+
+ this._element.classList.toggle(WebInspector.TimelineRuler.AllowsTimeRangeSelectionStyleClassName, this._allowsTimeRangeSelection);
+
+ if (!this._allowsTimeRangeSelection)
+ return;
+
+ var newLeftPosition = Math.max(0, (this._selectionStartTime - this._startTime) / duration);
+ this._updatePositionOfElement(this._leftShadedAreaElement, newLeftPosition, visibleWidth, "width");
+ this._updatePositionOfElement(this._leftSelectionHandleElement, newLeftPosition, visibleWidth, "left");
+ this._updatePositionOfElement(this._selectionDragElement, newLeftPosition, visibleWidth, "left");
+
+ var newRightPosition = 1 - Math.min((this._selectionEndTime - this._startTime) / duration, 1);
+ this._updatePositionOfElement(this._rightShadedAreaElement, newRightPosition, visibleWidth, "width");
+ this._updatePositionOfElement(this._rightSelectionHandleElement, newRightPosition, visibleWidth, "right");
+ this._updatePositionOfElement(this._selectionDragElement, newRightPosition, visibleWidth, "right");
+
+ if (!this._selectionDragElement.parentNode) {
+ this._element.appendChild(this._selectionDragElement);
+ this._element.appendChild(this._leftShadedAreaElement);
+ this._element.appendChild(this._leftSelectionHandleElement);
+ this._element.appendChild(this._rightShadedAreaElement);
+ this._element.appendChild(this._rightSelectionHandleElement);
+ }
+
+ if (this._timeRangeSelectionChanged)
+ this._dispatchTimeRangeSelectionChangedEvent();
+ },
+
+ _dispatchTimeRangeSelectionChangedEvent: function()
+ {
+ delete this._timeRangeSelectionChanged;
+
+ if (this._suppressTimeRangeSelectionChangedEvent)
+ return;
+
+ this.dispatchEventToListeners(WebInspector.TimelineRuler.Event.TimeRangeSelectionChanged);
+ },
+
+ _timelineMarkerTimeChanged: function()
+ {
+ this._needsMarkerLayout();
+ },
+
+ _handleMouseDown: function(event)
+ {
+ // Only handle left mouse clicks.
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ this._selectionIsMove = event.target === this._selectionDragElement;
+ this._suppressTimeRangeSelectionChangedEvent = !this._selectionIsMove;
+
+ if (this._selectionIsMove)
+ this._lastMousePosition = event.pageX;
+ else
+ this._mouseDownPosition = event.pageX - this._element.totalOffsetLeft;
+
+ this._mouseMoveEventListener = this._handleMouseMove.bind(this);
+ this._mouseUpEventListener = this._handleMouseUp.bind(this);
+
+ // Register these listeners on the document so we can track the mouse if it leaves the ruler.
+ document.addEventListener("mousemove", this._mouseMoveEventListener);
+ document.addEventListener("mouseup", this._mouseUpEventListener);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _handleMouseMove: function(event)
+ {
+ console.assert(event.button === 0);
+
+ if (this._selectionIsMove) {
+ var currentMousePosition = event.pageX;
+
+ var offsetTime = (currentMousePosition - this._lastMousePosition) * this.secondsPerPixel;
+ var selectionDuration = this.selectionEndTime - this.selectionStartTime;
+
+ this.selectionStartTime = Math.max(this.startTime, Math.min(this.selectionStartTime + offsetTime, this.endTime - selectionDuration));
+ this.selectionEndTime = this.selectionStartTime + selectionDuration;
+
+ this._lastMousePosition = currentMousePosition;
+ } else {
+ var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
+
+ this.selectionStartTime = Math.max(this.startTime, this.startTime + (Math.min(currentMousePosition, this._mouseDownPosition) * this.secondsPerPixel));
+ this.selectionEndTime = Math.min(this.startTime + (Math.max(currentMousePosition, this._mouseDownPosition) * this.secondsPerPixel), this.endTime);
+ }
+
+ this._updateSelection(this._element.clientWidth, this.duration);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _handleMouseUp: function(event)
+ {
+ console.assert(event.button === 0);
+
+ if (!this._selectionIsMove && this.selectionEndTime - this.selectionStartTime < WebInspector.TimelineRuler.MinimumSelectionTimeRange) {
+ // The section is smaller than allowed, grow in the direction of the drag to meet the minumum.
+ var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
+ if (currentMousePosition > this._mouseDownPosition) {
+ this.selectionEndTime = Math.min(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, this.endTime);
+ this.selectionStartTime = this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange;
+ } else {
+ this.selectionStartTime = Math.max(this.startTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange);
+ this.selectionEndTime = this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange
+ }
+ }
+
+ delete this._suppressTimeRangeSelectionChangedEvent;
+
+ this._dispatchTimeRangeSelectionChangedEvent();
+
+ document.removeEventListener("mousemove", this._mouseMoveEventListener);
+ document.removeEventListener("mouseup", this._mouseUpEventListener);
+
+ delete this._mouseMovedEventListener;
+ delete this._mouseUpEventListener;
+ delete this._mouseDownPosition;
+ delete this._lastMousePosition;
+ delete this._selectionIsMove;
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _handleSelectionHandleMouseDown: function(event)
+ {
+ // Only handle left mouse clicks.
+ if (event.button !== 0 || event.ctrlKey)
+ return;
+
+ this._dragHandleIsStartTime = event.target === this._leftSelectionHandleElement;
+ this._mouseDownPosition = event.pageX - this._element.totalOffsetLeft;
+
+ this._selectionHandleMouseMoveEventListener = this._handleSelectionHandleMouseMove.bind(this);
+ this._selectionHandleMouseUpEventListener = this._handleSelectionHandleMouseUp.bind(this);
+
+ // Register these listeners on the document so we can track the mouse if it leaves the ruler.
+ document.addEventListener("mousemove", this._selectionHandleMouseMoveEventListener);
+ document.addEventListener("mouseup", this._selectionHandleMouseUpEventListener);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _handleSelectionHandleMouseMove: function(event)
+ {
+ console.assert(event.button === 0);
+
+ var currentMousePosition = event.pageX - this._element.totalOffsetLeft;
+ var currentTime = this.startTime + (currentMousePosition * this.secondsPerPixel);
+
+ if (event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
+ // Resize the selection on both sides when the Option keys is held down.
+ if (this._dragHandleIsStartTime) {
+ var timeDifference = currentTime - this.selectionStartTime;
+ this.selectionStartTime = Math.max(this.startTime, Math.min(currentTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
+ this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, this.selectionEndTime - timeDifference), this.endTime);
+ } else {
+ var timeDifference = currentTime - this.selectionEndTime;
+ this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, currentTime), this.endTime);
+ this.selectionStartTime = Math.max(this.startTime, Math.min(this.selectionStartTime - timeDifference, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
+ }
+ } else {
+ // Resize the selection on side being dragged.
+ if (this._dragHandleIsStartTime)
+ this.selectionStartTime = Math.max(this.startTime, Math.min(currentTime, this.selectionEndTime - WebInspector.TimelineRuler.MinimumSelectionTimeRange));
+ else
+ this.selectionEndTime = Math.min(Math.max(this.selectionStartTime + WebInspector.TimelineRuler.MinimumSelectionTimeRange, currentTime), this.endTime);
+ }
+
+ this._updateSelection(this._element.clientWidth, this.duration);
+
+ event.preventDefault();
+ event.stopPropagation();
+ },
+
+ _handleSelectionHandleMouseUp: function(event)
+ {
+ console.assert(event.button === 0);
+
+ document.removeEventListener("mousemove", this._selectionHandleMouseMoveEventListener);
+ document.removeEventListener("mouseup", this._selectionHandleMouseUpEventListener);
+
+ delete this._selectionHandleMouseMoveEventListener;
+ delete this._selectionHandleMouseUpEventListener;
+ delete this._dragHandleIsStartTime;
+ delete this._mouseDownPosition;
+
+ event.preventDefault();
+ event.stopPropagation();
+ }
+}
+
+WebInspector.TimelineRuler.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPanelcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPanelcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,207 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.sidebar > .panel.timeline > .status-bar {
+ position: absolute;
+ top: 0;
+ left: 5px;
+ right: 0;
+ height: 22px;
+ border-bottom: 1px solid rgb(179, 179, 179);
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 21px;
+ height: 21px;
+ padding: 0;
+ border: none;
+ outline: none;
+ color: transparent;
+ overflow: hidden;
+
+ -webkit-appearance: none;
+
+ background-color: transparent;
+ background-image: -webkit-image-set(url(../Images/RecordingStopped.png) 1x, url(../Images/RecordingStopped@2x.png) 2x);
+ background-repeat: no-repeat;
+ background-size: 21px 21px;
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph.recording {
+ background-image: -webkit-image-set(url(../Images/Recording.png) 1x, url(../Images/Recording@2x.png) 2x);
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph:hover {
+ background-image: -webkit-image-set(url(../Images/RecordingHovered.png) 1x, url(../Images/RecordingHovered@2x.png) 2x);
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph.recording:hover {
+ background-image: -webkit-image-set(url(../Images/RecordingStopped.png) 1x, url(../Images/RecordingStopped@2x.png) 2x);
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph.forced {
+ background-image: -webkit-image-set(url(../Images/RecordingStopped.png) 1x, url(../Images/RecordingStopped@2x.png) 2x) !important;
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-glyph.recording.forced {
+ background-image: -webkit-image-set(url(../Images/Recording.png) 1x, url(../Images/Recording@2x.png) 2x) !important;
+}
+
+.sidebar > .panel.timeline > .status-bar > .record-status {
+ position: absolute;
+ top: 0;
+ right: 21px;
+ left: 21px;
+
+ text-align: center;
+
+ line-height: 20px;
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+ font-weight: bold;
+
+ color: rgb(76, 76, 76);
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+}
+
+.sidebar > .panel.timeline > .title-bar {
+ position: absolute;
+ left: 0;
+ right: 0;
+
+ height: 22px;
+
+ border-bottom: 1px solid rgb(179, 179, 179);
+ background-image: -webkit-linear-gradient(top, rgb(238, 240, 244), rgb(224, 226, 230));
+
+ color: rgb(57, 57, 57);
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ font-size: 11px;
+ font-family: "Lucida Grande", sans-serif;
+ font-weight: bold;
+
+ padding: 4px 9px;
+
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.sidebar > .panel.timeline > .title-bar.timelines {
+ top: 22px;
+}
+
+.sidebar > .panel.timeline > .title-bar.timeline-events {
+ height: 23px;
+ border-top: 1px solid rgb(179, 179, 179);
+ top: 152px;
+}
+
+.sidebar > .panel.timeline > .timelines-content {
+ position: absolute;
+ top: 44px;
+ height: 108px;
+ left: 0;
+ right: 0;
+
+ overflow: hidden;
+}
+
+.sidebar > .panel.timeline > .timelines-content .close-button {
+ margin-top: 2px;
+ width: 12px;
+ height: 12px;
+
+ content: -webkit-image-set(url(../Images/CloseTimeline.png) 1x, url(../Images/CloseTimeline@2x.png) 2x);
+
+ visibility: hidden;
+}
+
+.sidebar > .panel.timeline > .timelines-content li.item .icon {
+ width: 24px;
+ height: 24px;
+ margin-top: 5px;
+}
+
+.sidebar > .panel.timeline > .timelines-content li.item.selected .close-button {
+ visibility: visible;
+}
+
+.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):nth-child(even) {
+ background-color: rgba(0, 0, 0, 0.03);
+ background-clip: padding-box;
+}
+
+.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):not(:first-child) {
+ border-top: 1px solid rgba(0, 0, 0, 0.09);
+}
+
+.sidebar > .panel.timeline > .timelines-content li.item.selected + li.item {
+ border-top-color: rgb(120, 139, 168);
+}
+
+.sidebar > .panel.timeline > .timelines-content :focus li.item.selected + li.item {
+ border-top-color: rgb(107, 130, 164);
+}
+
+.sidebar > .panel.timeline > .timelines-content .close-button:active {
+ opacity: 0.8;
+}
+
+.sidebar > .panel.timeline > .content,
+.sidebar > .panel.timeline > .empty-content-placeholder {
+ top: 175px;
+}
+
+.sidebar > .panel.timeline.timeline-content-view-showing > .content {
+ /* This hides the scrollbar. The view shows a scrollbar, we don't need two. */
+ padding-right: 16px;
+ right: -16px;
+}
+
+.sidebar > .panel.timeline > .content > .stripe-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ min-height: 100%;
+
+ background-image: -webkit-linear-gradient(top, transparent, transparent 50%, rgba(0, 0, 0, 0.03) 50%, rgba(0, 0, 0, 0.03));
+ background-size: 100% 40px;
+
+ pointer-events: none;
+ display: none;
+}
+
+.sidebar > .panel.timeline.timeline-content-view-showing > .content > .stripe-background {
+ display: block;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPaneljs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,354 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineSidebarPanel = function()
+{
+ WebInspector.NavigationSidebarPanel.call(this, "timeline", WebInspector.UIString("Timelines"), "Images/NavigationItemStopwatch.svg", "2");
+
+ this._timelineEventsTitleBarElement = document.createElement("div");
+ this._timelineEventsTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TitleBarStyleClass);
+ this._timelineEventsTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelineEventsTitleBarStyleClass);
+ this.element.insertBefore(this._timelineEventsTitleBarElement, this.element.firstChild);
+
+ this.contentTreeOutlineLabel = "";
+
+ this._timelinesContentContainer = document.createElement("div");
+ this._timelinesContentContainer.classList.add(WebInspector.TimelineSidebarPanel.TimelinesContentContainerStyleClass);
+ this.element.insertBefore(this._timelinesContentContainer, this.element.firstChild);
+
+ this._timelinesTreeOutline = this.createContentTreeOutline(true, true);
+ this._timelinesTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
+ this._timelinesTreeOutline.onselect = this._timelinesTreeElementSelected.bind(this);
+ this._timelinesContentContainer.appendChild(this._timelinesTreeOutline.element);
+
+ var timelinesTitleBarElement = document.createElement("div");
+ timelinesTitleBarElement.textContent = WebInspector.UIString("Timelines");
+ timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TitleBarStyleClass);
+ timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass);
+ this.element.insertBefore(timelinesTitleBarElement, this.element.firstChild);
+
+ var statusBarElement = document.createElement("div");
+ statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.StatusBarStyleClass);
+ this.element.insertBefore(statusBarElement, this.element.firstChild);
+
+ this._recordGlyphElement = document.createElement("div");
+ this._recordGlyphElement.className = WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass;
+ this._recordGlyphElement.addEventListener("mouseover", this._recordGlyphMousedOver.bind(this));
+ this._recordGlyphElement.addEventListener("mouseout", this._recordGlyphMousedOut.bind(this));
+ this._recordGlyphElement.addEventListener("click", this._recordGlyphClicked.bind(this));
+ statusBarElement.appendChild(this._recordGlyphElement);
+
+ this._recordStatusElement = document.createElement("div");
+ this._recordStatusElement.className = WebInspector.TimelineSidebarPanel.RecordStatusStyleClass;
+ statusBarElement.appendChild(this._recordStatusElement);
+
+ function createTimelineTreeElement(label, iconClass, identifier)
+ {
+ var treeElement = new WebInspector.GeneralTreeElement([iconClass, WebInspector.TimelineSidebarPanel.LargeIconStyleClass], label, null, identifier);
+ var closeButton = document.createElement("img");
+ closeButton.classList.add(WebInspector.TimelineSidebarPanel.CloseButtonStyleClass);
+ closeButton.addEventListener("click", this.showTimelineOverview.bind(this));
+ treeElement.status = closeButton;
+ return treeElement;
+ }
+
+ this._timelineTreeElementMap = new Map;
+ this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Network, createTimelineTreeElement.call(this, WebInspector.UIString("Network Requests"), WebInspector.TimelineSidebarPanel.NetworkIconStyleClass, WebInspector.TimelineRecord.Type.Network));
+ this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Layout, createTimelineTreeElement.call(this, WebInspector.UIString("Layout & Rendering"), WebInspector.TimelineSidebarPanel.ColorsIconStyleClass, WebInspector.TimelineRecord.Type.Layout));
+ this._timelineTreeElementMap.set(WebInspector.TimelineRecord.Type.Script, createTimelineTreeElement.call(this, WebInspector.UIString("JavaScript & Events"), WebInspector.TimelineSidebarPanel.ScriptIconStyleClass, WebInspector.TimelineRecord.Type.Script));
+
+ for (var timelineTreeElement of this._timelineTreeElementMap.values())
+ this._timelinesTreeOutline.appendChild(timelineTreeElement);
+
+ this._timelineOverviewTreeElement = new WebInspector.GeneralTreeElement(WebInspector.TimelineSidebarPanel.StopwatchIconStyleClass, WebInspector.UIString("Timelines"), null, WebInspector.timelineManager.recording);
+ this._timelineOverviewTreeElement.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.showTimelineOverview, this);
+
+ this._stripeBackgroundElement = document.createElement("div");
+ this._stripeBackgroundElement.className = WebInspector.TimelineSidebarPanel.StripeBackgroundStyleClass;
+ this.contentElement.insertBefore(this._stripeBackgroundElement, this.contentElement.firstChild);
+
+ WebInspector.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStarted, this._recordingStarted, this);
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
+
+ function delayedWork()
+ {
+ // Prime the creation of the singleton TimelineContentCiew since it needs to listen for events.
+ // It needs to be delayed since TimelineContentView depends on WebInspector.timelineSidebarPanel existing.
+ this._timelineContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.timelineManager.recording);
+ }
+
+ setTimeout(delayedWork.bind(this), 0);
+};
+
+WebInspector.TimelineSidebarPanel.StatusBarStyleClass = "status-bar";
+WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass = "record-glyph";
+WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass = "recording";
+WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass = "forced";
+WebInspector.TimelineSidebarPanel.RecordStatusStyleClass = "record-status";
+WebInspector.TimelineSidebarPanel.TitleBarStyleClass = "title-bar";
+WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass = "timelines";
+WebInspector.TimelineSidebarPanel.TimelineEventsTitleBarStyleClass = "timeline-events";
+WebInspector.TimelineSidebarPanel.TimelinesContentContainerStyleClass = "timelines-content";
+WebInspector.TimelineSidebarPanel.StripeBackgroundStyleClass = "stripe-background";
+WebInspector.TimelineSidebarPanel.CloseButtonStyleClass = "close-button";
+WebInspector.TimelineSidebarPanel.LargeIconStyleClass = "large";
+WebInspector.TimelineSidebarPanel.StopwatchIconStyleClass = "stopwatch-icon";
+WebInspector.TimelineSidebarPanel.NetworkIconStyleClass = "network-icon";
+WebInspector.TimelineSidebarPanel.ColorsIconStyleClass = "colors-icon";
+WebInspector.TimelineSidebarPanel.ScriptIconStyleClass = "script-icon";
+WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass = "timeline-content-view-showing";
+WebInspector.TimelineSidebarPanel.ShowingTimelineContentViewCookieKey = "timeline-sidebar-panel-showing-timeline-content-view";
+WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey = "timeline-sidebar-panel-selected-timeline-view-identifier";
+WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue = "overview";
+
+WebInspector.TimelineSidebarPanel.prototype = {
+ constructor: WebInspector.TimelineSidebarPanel,
+ __proto__: WebInspector.NavigationSidebarPanel.prototype,
+
+ // Public
+
+ showDefaultContentView: function()
+ {
+ WebInspector.contentBrowser.showContentView(this._timelineContentView);
+ },
+
+ treeElementForRepresentedObject: function(representedObject)
+ {
+ if (representedObject instanceof WebInspector.TimelineRecording)
+ return this._timelineOverviewTreeElement;
+
+ // The main resource is used as the representedObject instead of Frame in our tree.
+ if (representedObject instanceof WebInspector.Frame)
+ representedObject = representedObject.mainResource;
+
+ var foundTreeElement = this.contentTreeOutline.getCachedTreeElement(representedObject);
+ if (foundTreeElement)
+ return foundTreeElement;
+
+ // Look for TreeElements loosely based on represented objects that can contain the represented
+ // object we are really looking for. This allows a SourceCodeTimelineTreeElement or a
+ // TimelineRecordTreeElement to stay selected when the Resource it represents is showing.
+
+ function looselyCompareRepresentedObjects(candidateTreeElement)
+ {
+ if (!candidateTreeElement)
+ return false;
+
+ var candidateRepresentedObject = candidateTreeElement.representedObject;
+ if (candidateRepresentedObject instanceof WebInspector.SourceCodeTimeline) {
+ if (candidateRepresentedObject.sourceCode === representedObject)
+ return true;
+ return false;
+ }
+
+ if (candidateRepresentedObject instanceof WebInspector.TimelineRecord) {
+ if (!candidateRepresentedObject.sourceCodeLocation)
+ return false;
+ if (candidateRepresentedObject.sourceCodeLocation.sourceCode === representedObject)
+ return true;
+ return false;
+ }
+
+ console.error("Unknown TreeElement");
+ return false;
+ }
+
+ // Check the selected tree element first so we don't need to do a longer search and it is
+ // likely to be the best candidate for the current view.
+ if (looselyCompareRepresentedObjects(this.contentTreeOutline.selectedTreeElement))
+ return this.contentTreeOutline.selectedTreeElement;
+
+ var currentTreeElement = this._contentTreeOutline.children[0];
+ while (currentTreeElement && !currentTreeElement.root) {
+ if (looselyCompareRepresentedObjects(currentTreeElement))
+ return currentTreeElement;
+ currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, false);
+ }
+
+ return null;
+ },
+
+ get contentTreeOutlineLabel()
+ {
+ return this._timelineEventsTitleBarElement.textContent;
+ },
+
+ set contentTreeOutlineLabel(label)
+ {
+ label = label || WebInspector.UIString("Timeline Events");
+
+ this._timelineEventsTitleBarElement.textContent = label;
+ this.filterBar.placeholder = WebInspector.UIString("Filter %s").format(label);
+ },
+
+ showTimelineOverview: function()
+ {
+ if (this._timelinesTreeOutline.selectedTreeElement)
+ this._timelinesTreeOutline.selectedTreeElement.deselect();
+
+ this._timelineContentView.showOverviewTimelineView();
+ WebInspector.contentBrowser.showContentView(this._timelineContentView);
+ },
+
+ showTimelineView: function(identifier)
+ {
+ console.assert(this._timelineTreeElementMap.has(identifier));
+ if (!this._timelineTreeElementMap.has(identifier))
+ return;
+
+ this._timelineTreeElementMap.get(identifier).select(true, false, true, true);
+
+ this._timelineContentView.showTimelineView(identifier);
+ WebInspector.contentBrowser.showContentView(this._timelineContentView);
+ },
+
+ // Protected
+
+ updateCustomContentOverflow: function()
+ {
+ if (!this._stripeBackgroundElement)
+ return;
+
+ var contentHeight = this.contentTreeOutline.element.offsetHeight;
+ var currentHeight = parseInt(this._stripeBackgroundElement.style.height);
+ if (currentHeight !== contentHeight)
+ this._stripeBackgroundElement.style.height = contentHeight + "px";
+ },
+
+ hasCustomFilters: function()
+ {
+ return true;
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ if (!this._timelineContentView)
+ return true;
+
+ return this._timelineContentView.matchTreeElementAgainstCustomFilters(treeElement);
+ },
+
+ canShowDifferentContentView: function()
+ {
+ return !this.restoringState || !this._restoredShowingTimelineContentView;
+ },
+
+ saveStateToCookie: function(cookie)
+ {
+ console.assert(cookie);
+
+ cookie[WebInspector.timelineSidebarPanel.ShowingTimelineContentViewCookieKey] = WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineContentView;
+
+ var selectedTreeElement = this._timelinesTreeOutline.selectedTreeElement;
+ if (selectedTreeElement)
+ cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey] = selectedTreeElement.representedObject;
+ else
+ cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey] = WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue;
+
+ WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie.call(this, cookie);
+ },
+
+ restoreStateFromCookie: function(cookie, relaxedMatchDelay)
+ {
+ console.assert(cookie);
+
+ // The _timelineContentView is not ready on initial load, so delay the restore.
+ // This matches the delayed work in the WebInspector.TimelineSidebarPanel constructor.
+ if (!this._timelineContentView) {
+ setTimeout(this.restoreStateFromCookie.bind(this, cookie, relaxedMatchDelay), 0);
+ return;
+ }
+
+ this._restoredShowingTimelineContentView = cookie[WebInspector.timelineSidebarPanel.ShowingTimelineContentViewCookieKey];
+
+ var selectedTimelineViewIdentifier = cookie[WebInspector.TimelineSidebarPanel.SelectedTimelineViewIdentifierCookieKey];
+ if (selectedTimelineViewIdentifier === WebInspector.TimelineSidebarPanel.OverviewTimelineIdentifierCookieValue)
+ this.showTimelineOverview();
+ else
+ this.showTimelineView(selectedTimelineViewIdentifier);
+
+ WebInspector.NavigationSidebarPanel.prototype.restoreStateFromCookie.call(this, cookie, relaxedMatchDelay);
+ },
+
+ // Private
+
+ _timelinesTreeElementSelected: function(treeElement, selectedByUser)
+ {
+ console.assert(this._timelineTreeElementMap.get(treeElement.representedObject) === treeElement);
+ this.showTimelineView(treeElement.representedObject);
+ },
+
+ _contentBrowserCurrentContentViewDidChange: function(event)
+ {
+ if (WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineContentView)
+ this.element.classList.add(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
+ else
+ this.element.classList.remove(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
+ },
+
+ _recordingStarted: function(event)
+ {
+ this._recordStatusElement.textContent = WebInspector.UIString("Recording");
+ this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
+ },
+
+ _recordingStopped: function(event)
+ {
+ this._recordStatusElement.textContent = "";
+ this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
+ },
+
+ _recordGlyphMousedOver: function(event)
+ {
+ this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+ if (WebInspector.timelineManager.recordingEnabled)
+ this._recordStatusElement.textContent = WebInspector.UIString("Stop Recording");
+ else
+ this._recordStatusElement.textContent = WebInspector.UIString("Start Recording");
+ },
+
+ _recordGlyphMousedOut: function(event)
+ {
+ this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+ if (WebInspector.timelineManager.recordingEnabled)
+ this._recordStatusElement.textContent = WebInspector.UIString("Recording");
+ else
+ this._recordStatusElement.textContent = "";
+ },
+
+ _recordGlyphClicked: function(event)
+ {
+ // Add forced class to prevent the glyph from showing a confusing status after click.
+ this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+ if (WebInspector.timelineManager.recordingEnabled)
+ WebInspector.timelineManager.stopRecording();
+ else
+ WebInspector.timelineManager.startRecording();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewcssfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineViewcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineView.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.timeline-view {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTimelineViewjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TimelineView.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TimelineView = function()
+{
+ WebInspector.Object.call(this);
+
+ this._contentTreeOutline = WebInspector.timelineSidebarPanel.createContentTreeOutline();
+
+ this.element = document.createElement("div");
+ this.element.classList.add(WebInspector.TimelineView.StyleClassName);
+
+ this._zeroTime = 0;
+ this._startTime = 0;
+ this._endTime = 5;
+ this._currentTime = 0;
+};
+
+WebInspector.TimelineView.StyleClassName = "timeline-view";
+
+WebInspector.TimelineView.Event = {
+ SelectionPathComponentsDidChange: "timeline-view-selection-path-components-did-change"
+};
+
+WebInspector.TimelineView.prototype = {
+ constructor: WebInspector.TimelineView,
+ __proto__: WebInspector.Object.prototype,
+
+ // Public
+
+ get navigationSidebarTreeOutline()
+ {
+ return this._contentTreeOutline;
+ },
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ // Implemented by sub-classes if needed.
+ return null;
+ },
+
+ get selectionPathComponents()
+ {
+ if (!this._contentTreeOutline.selectedTreeElement || this._contentTreeOutline.selectedTreeElement.hidden)
+ return null;
+
+ var pathComponent = new WebInspector.GeneralTreeElementPathComponent(this._contentTreeOutline.selectedTreeElement);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this.treeElementPathComponentSelected, this);
+ return [pathComponent];
+ },
+
+ get zeroTime()
+ {
+ return this._zeroTime;
+ },
+
+ set zeroTime(x)
+ {
+ if (this._zeroTime === x)
+ return;
+
+ this._zeroTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get startTime()
+ {
+ return this._startTime;
+ },
+
+ set startTime(x)
+ {
+ if (this._startTime === x)
+ return;
+
+ this._startTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get endTime()
+ {
+ return this._endTime;
+ },
+
+ set endTime(x)
+ {
+ if (this._endTime === x)
+ return;
+
+ this._endTime = x || 0;
+
+ this.needsLayout();
+ },
+
+ get currentTime()
+ {
+ return this._currentTime;
+ },
+
+ set currentTime(x)
+ {
+ if (this._currentTime === x)
+ return;
+
+ var oldCurrentTime = this._currentTime;
+
+ this._currentTime = x || 0;
+
+ function checkIfLayoutIsNeeded(currentTime)
+ {
+ // Include some wiggle room since the current time markers can be clipped off the ends a bit and still partially visible.
+ const wiggleTime = 0.05; // 50ms
+ return this._startTime - wiggleTime <= currentTime && currentTime <= this._endTime + wiggleTime;
+ }
+
+ if (checkIfLayoutIsNeeded.call(this, oldCurrentTime) || checkIfLayoutIsNeeded.call(this, this._currentTime))
+ this.needsLayout();
+ },
+
+ get visible()
+ {
+ return this._visible;
+ },
+
+ reset: function()
+ {
+ this._contentTreeOutline.removeChildren();
+ },
+
+ shown: function()
+ {
+ this._visible = true;
+
+ // Implemented by sub-classes if needed.
+ },
+
+ hidden: function()
+ {
+ // Implemented by sub-classes if needed.
+
+ this._visible = false;
+ },
+
+ matchTreeElementAgainstCustomFilters: function(treeElement)
+ {
+ // Implemented by sub-classes if needed.
+ return true;
+ },
+
+ updateLayout: function()
+ {
+ if (this._scheduledLayoutUpdateIdentifier) {
+ cancelAnimationFrame(this._scheduledLayoutUpdateIdentifier);
+ delete this._scheduledLayoutUpdateIdentifier;
+ }
+
+ // Implemented by sub-classes if needed.
+ },
+
+ updateLayoutIfNeeded: function()
+ {
+ if (!this._scheduledLayoutUpdateIdentifier)
+ return;
+ this.updateLayout();
+ },
+
+ // Protected
+
+ treeElementPathComponentSelected: function(event)
+ {
+ // Implemented by sub-classes if needed.
+ },
+
+ needsLayout: function()
+ {
+ if (!this._visible)
+ return;
+
+ if (this._scheduledLayoutUpdateIdentifier)
+ return;
+
+ this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this));
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsToggleButtonNavigationItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceToggleButtonNavigationItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ToggleButtonNavigationItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ToggleButtonNavigationItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, suppressEmboss) {
+ WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, defaultImage, imageWidth, imageHeight, suppressEmboss);
+
+ this._toggled = false;
+ this._defaultImage = defaultImage;
+ this._alternateImage = alternateImage;
+ this._defaultToolTip = defaultToolTip;
+ this._alternateToolTip = alternateToolTip || defaultToolTip;
+};
+
+WebInspector.ToggleButtonNavigationItem.StyleClassName = "toggle";
+
+WebInspector.ToggleButtonNavigationItem.prototype = {
+ constructor: WebInspector.ToggleButtonNavigationItem,
+
+ // Public
+
+ get defaultToolTip()
+ {
+ return this._defaultToolTip;
+ },
+
+ get alternateToolTip()
+ {
+ return this._alternateToolTip;
+ },
+
+ set alternateToolTip(toolTip)
+ {
+ this._alternateToolTip = toolTip;
+
+ if (this._toggled)
+ this.toolTip = this._alternateToolTip;
+ },
+
+ get defaultImage()
+ {
+ return this._defaultImage;
+ },
+
+ get alternateImage()
+ {
+ return this._alternateImage;
+ },
+
+ set alternateImage(image)
+ {
+ this._alternateImage = image;
+
+ if (this._toggled)
+ this.image = this._alternateImage;
+ },
+
+ get toggled()
+ {
+ return this._toggled;
+ },
+
+ set toggled(flag)
+ {
+ flag = flag || false;
+
+ if (this._toggled === flag)
+ return;
+
+ this._toggled = flag;
+
+ if (this._toggled) {
+ this.toolTip = this._alternateToolTip;
+ this.image = this._alternateImage;
+ } else {
+ this.toolTip = this._defaultToolTip;
+ this.image = this._defaultImage;
+ }
+ },
+
+ // Private
+
+ _additionalClassNames: [WebInspector.ToggleButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
+
+ // The image isn't cacheable because it dynamically changes and the same canvas identifier is reused.
+ // FIXME: We could try overriding _canvasIdentifier() to return different identifiers. If we did that
+ // we would also need to override generateStyleText() to use the different identifiers.
+ _imageCacheable: false
+};
+
+WebInspector.ToggleButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsToggleControlToolbarItemjsfromrev164541trunkSourceWebInspectorUIUserInterfaceToggleControlToolbarItemjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/ToggleControlToolbarItem.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.ToggleControlToolbarItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight) {
+ WebInspector.ToggleButtonNavigationItem.call(this, identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, false);
+};
+
+WebInspector.ToggleControlToolbarItem.StyleClassName = "toggle";
+
+WebInspector.ToggleControlToolbarItem.prototype = {
+ constructor: WebInspector.ToggleControlToolbarItem,
+
+ // Private
+
+ _additionalClassNames: [WebInspector.ToggleControlToolbarItem.StyleClassName, WebInspector.ControlToolbarItem.StyleClassName]
+};
+
+WebInspector.ToggleControlToolbarItem.prototype.__proto__ = WebInspector.ToggleButtonNavigationItem.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsToolbarcssfromrev164541trunkSourceWebInspectorUIUserInterfaceToolbarcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Toolbar.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.toolbar {
+ display: -webkit-flex;
+
+ white-space: nowrap;
+ overflow: hidden;
+
+ border-bottom: 1px solid rgb(85, 85, 85);
+
+ outline: none;
+}
+
+.toolbar.icon-and-label-vertical {
+ height: 56px;
+}
+
+.toolbar.icon-and-label-vertical.small-size {
+ height: 48px;
+}
+
+.toolbar.icon-and-label-horizontal,
+.toolbar.icon-only {
+ height: 40px;
+}
+
+.toolbar.icon-and-label-horizontal.small-size,
+.toolbar.icon-only.small-size,
+.toolbar.label-only {
+ height: 32px;
+}
+
+body.docked .toolbar {
+ background-image: -webkit-linear-gradient(top, rgb(216, 216, 216), rgb(190, 190, 190));
+ box-shadow: inset rgba(255, 255, 255, 0.1) 0 1px 0, inset rgba(0, 0, 0, 0.02) 0 -1px 0;
+}
+
+body:not(.docked) .toolbar .item.button > .label {
+ /* We need to disable sub-pixel antialiasing in the toolbar when not docked because the
+ toolbar is transparent and so is the WebView. */
+ -webkit-font-smoothing: antialiased;
+
+ /* Compensate for the text not being sub-pixel antialiased by adding a small stroke. */
+ -webkit-text-stroke: 0.2px;
+}
+
+body.window-inactive .toolbar {
+ border-bottom: 1px solid rgb(128, 128, 128);
+}
+
+.toolbar .control-section {
+ display: -webkit-flex;
+
+ -webkit-flex-direction: column;
+ -webkit-align-items: center;
+ -webkit-justify-content: center;
+
+ padding-left: 6px;
+ padding-right: 6px;
+
+ min-width: -webkit-min-content;
+}
+
+.toolbar.icon-and-label-horizontal.small-size .control-section,
+.toolbar.icon-only.small-size .control-section,
+.toolbar.label-only .control-section {
+ -webkit-flex-direction: row;
+}
+
+.toolbar .item-section {
+ display: -webkit-flex;
+ min-width: -webkit-min-content;
+}
+
+.toolbar .item-section:not(.center) {
+ -webkit-flex: 1;
+}
+
+.toolbar .item-section.left {
+ -webkit-justify-content: flex-start;
+ margin-right: 12px;
+}
+
+.toolbar .item-section.center {
+ -webkit-flex: 2;
+ -webkit-justify-content: center;
+}
+
+.toolbar .item-section.right {
+ -webkit-justify-content: flex-end;
+ margin-left: 12px;
+ margin-right: 12px;
+}
+
+.toolbar .item {
+ display: -webkit-flex;
+ outline: none;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsToolbarjsfromrev164541trunkSourceWebInspectorUIUserInterfaceToolbarjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/Toolbar.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Toolbar.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,240 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.Toolbar = function(element, navigationItems) {
+ WebInspector.NavigationBar.call(this, element, navigationItems, "toolbar");
+
+ this.displayMode = WebInspector.Toolbar.DisplayMode.IconAndLabelVertical;
+ this.sizeMode = WebInspector.Toolbar.SizeMode.Normal;
+
+ this._controlSectionElement = document.createElement("div");
+ this._controlSectionElement.className = WebInspector.Toolbar.ControlSectionStyleClassName;
+ this._element.appendChild(this._controlSectionElement);
+
+ this._leftSectionElement = document.createElement("div");
+ this._leftSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.LeftItemSectionStyleClassName;
+ this._leftSectionElement.setAttribute("role", "tablist");
+ this._element.appendChild(this._leftSectionElement);
+
+ this._centerSectionElement = document.createElement("div");
+ this._centerSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.CenterItemSectionStyleClassName;
+ this._element.appendChild(this._centerSectionElement);
+
+ this._rightSectionElement = document.createElement("div");
+ this._rightSectionElement.className = WebInspector.Toolbar.ItemSectionStyleClassName + " " + WebInspector.Toolbar.RightItemSectionStyleClassName;
+ this._rightSectionElement.setAttribute("role", "tablist");
+ this._element.appendChild(this._rightSectionElement);
+
+ this._element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), false);
+};
+
+WebInspector.Object.addConstructorFunctions(WebInspector.Toolbar);
+
+WebInspector.Toolbar.StyleClassName = "toolbar";
+WebInspector.Toolbar.ControlSectionStyleClassName = "control-section";
+WebInspector.Toolbar.ItemSectionStyleClassName = "item-section";
+WebInspector.Toolbar.LeftItemSectionStyleClassName = "left";
+WebInspector.Toolbar.CenterItemSectionStyleClassName = "center";
+WebInspector.Toolbar.RightItemSectionStyleClassName = "right";
+WebInspector.Toolbar.TotalSectionMargins = 12 * 3;
+
+WebInspector.Toolbar.Event = {
+ DisplayModeDidChange: "toolbar-display-mode-did-change",
+ SizeModeDidChange: "toolbar-size-mode-did-change"
+};
+
+WebInspector.Toolbar.Section = {
+ Control: "control",
+ Left: "left",
+ Center: "center",
+ Right: "right"
+};
+
+WebInspector.Toolbar.DisplayMode = {
+ IconAndLabelVertical: "icon-and-label-vertical",
+ IconAndLabelHorizontal: "icon-and-label-horizontal",
+ IconOnly: "icon-only",
+ LabelOnly: "label-only"
+};
+
+WebInspector.Toolbar.SizeMode = {
+ Normal: "normal-size",
+ Small: "small-size"
+};
+
+WebInspector.Toolbar.prototype = {
+ constructor: WebInspector.Toolbar,
+
+ // Public
+
+ get displayMode()
+ {
+ return this._displayMode;
+ },
+
+ set displayMode(mode)
+ {
+ if (mode === this._displayMode)
+ return;
+
+ if (this._displayMode)
+ this._element.classList.remove(this._displayMode);
+
+ // Revert the forced icon-only mode if it was applied.
+ if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal)
+ this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconOnly);
+
+ this._displayMode = mode;
+
+ this._element.classList.add(mode);
+
+ this.updateLayout();
+
+ this.dispatchEventToListeners(WebInspector.Toolbar.Event.DisplayModeDidChange);
+ },
+
+ get sizeMode()
+ {
+ return this._sizeMode;
+ },
+
+ set sizeMode(mode)
+ {
+ if (mode === this._sizeMode)
+ return;
+
+ if (this._sizeMode)
+ this._element.classList.remove(this._sizeMode);
+
+ this._sizeMode = mode;
+
+ this._element.classList.add(mode);
+
+ this.updateLayout();
+
+ this.dispatchEventToListeners(WebInspector.Toolbar.Event.SizeModeDidChange);
+ },
+
+ customUpdateLayout: function()
+ {
+ // Bail early if our sections are not created yet. This means we are being called during construction.
+ if (!this._leftSectionElement || !this._centerSectionElement || !this._rightSectionElement)
+ return;
+
+ // Remove the collapsed style class to test if the items can fit at full width.
+ this._element.classList.remove(WebInspector.NavigationBar.CollapsedStyleClassName);
+
+ // Revert the forced icon-only mode if it was applied.
+ if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal) {
+ this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconOnly);
+ this._element.classList.add(WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
+ }
+
+ function isOverflowingToolbar()
+ {
+ var controlSectionWidth = this._controlSectionElement.offsetWidth;
+ var leftSectionWidth = this._leftSectionElement.offsetWidth;
+ var rightSectionWidth = this._rightSectionElement.offsetWidth;
+ var centerSectionWidth = this._centerSectionElement.offsetWidth;
+
+ // Add one to the actual toolbar width to allow some slop. This wasn't needed when sub-pixel layout was on,
+ // but that was disabled in: http://webkit.org/b/149209
+ var toolbarWidth = this.element.offsetWidth + 1;
+
+ return controlSectionWidth + leftSectionWidth + centerSectionWidth + rightSectionWidth + WebInspector.Toolbar.TotalSectionMargins > toolbarWidth;
+ }
+
+ // Only the horizontal display mode supports collapsing labels.
+ // If any sections are overflowing the toolbar then force the display mode to be icon only.
+ if (this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal && isOverflowingToolbar.call(this)) {
+ this._element.classList.remove(WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
+ this._element.classList.add(WebInspector.Toolbar.DisplayMode.IconOnly);
+ }
+
+ if (!isOverflowingToolbar.call(this))
+ return;
+
+ this._element.classList.add(WebInspector.NavigationBar.CollapsedStyleClassName);
+ },
+
+ addToolbarItem: function(toolbarItem, sectionIdentifier)
+ {
+ var sectionElement;
+
+ switch (sectionIdentifier) {
+ case WebInspector.Toolbar.Section.Control:
+ sectionElement = this._controlSectionElement;
+ break;
+
+ case WebInspector.Toolbar.Section.Left:
+ sectionElement = this._leftSectionElement;
+ break;
+
+ default:
+ case WebInspector.Toolbar.Section.Center:
+ sectionElement = this._centerSectionElement;
+ break;
+
+ case WebInspector.Toolbar.Section.Right:
+ sectionElement = this._rightSectionElement;
+ break;
+ }
+
+ console.assert(sectionElement);
+
+ this.addNavigationItem(toolbarItem, sectionElement);
+ },
+
+ // Private
+
+ _handleContextMenuEvent: function(event)
+ {
+ var contextMenu = new WebInspector.ContextMenu(event);
+
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Icon and Text (Vertical)"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconAndLabelVertical), this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelVertical);
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Icon and Text (Horizontal)"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal), this._displayMode === WebInspector.Toolbar.DisplayMode.IconAndLabelHorizontal);
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Icon Only"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.IconOnly), this._displayMode === WebInspector.Toolbar.DisplayMode.IconOnly);
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Text Only"), this._changeDisplayMode.bind(this, WebInspector.Toolbar.DisplayMode.LabelOnly), this._displayMode === WebInspector.Toolbar.DisplayMode.LabelOnly);
+
+ if (this._displayMode !== WebInspector.Toolbar.DisplayMode.LabelOnly) {
+ contextMenu.appendSeparator();
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Small Icons"), this._toggleSmallIcons.bind(this), this._sizeMode === WebInspector.Toolbar.SizeMode.Small);
+ }
+
+ contextMenu.show();
+ },
+
+ _changeDisplayMode: function(displayMode)
+ {
+ this.displayMode = displayMode;
+ },
+
+ _toggleSmallIcons: function()
+ {
+ this.sizeMode = this._sizeMode === WebInspector.Toolbar.SizeMode.Normal ? WebInspector.Toolbar.SizeMode.Small : WebInspector.Toolbar.SizeMode.Normal;
+ }
+};
+
+WebInspector.Toolbar.prototype.__proto__ = WebInspector.NavigationBar.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeElementStatusButtoncssfromrev164541trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtoncss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.css (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.css) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.css        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+.item > .status > .status-button {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+}
+
+.item > .status > .status-button > svg * {
+ fill: rgb(112, 126, 139);
+}
+
+.item.selected > .status > .status-button > svg * {
+ fill: white;
+}
+
+.item.selected > .status > .status-button:active > svg * {
+ fill: rgba(255, 255, 255, 0.75);
+}
+
+.item > .status > .status-button.disabled > svg * {
+ fill: rgba(112, 126, 139, 0.5) !important;
+}
+
+.item.selected > .status > .status-button.disabled > svg * {
+ fill: rgba(255, 255, 255, 0.5) !important;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeElementStatusButtonjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTreeElementStatusButtonjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TreeElementStatusButton.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TreeElementStatusButton = function(element) {
+ WebInspector.Object.call(this);
+
+ console.assert(element);
+
+ this._element = element;
+ this._element.classList.add(WebInspector.TreeElementStatusButton.StyleClassName);
+ this._element.addEventListener("click", this._clicked.bind(this));
+};
+
+WebInspector.TreeElementStatusButton.StyleClassName = "status-button";
+WebInspector.TreeElementStatusButton.DisabledStyleClassName = "disabled";
+
+WebInspector.TreeElementStatusButton.Event = {
+ Clicked: "status-button-clicked"
+};
+
+WebInspector.TreeElementStatusButton.prototype = {
+ constructor: WebInspector.TreeElementStatusButton,
+
+ // Public
+
+ get element()
+ {
+ return this._element;
+ },
+
+ get hidden()
+ {
+ return !this._element.classList.contains(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
+ },
+
+ set hidden(flag)
+ {
+ if (flag)
+ this._element.classList.remove("hidden");
+ else
+ this._element.classList.add("hidden");
+ },
+
+ get enabled()
+ {
+ return !this._element.classList.contains(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
+ },
+
+ set enabled(flag)
+ {
+ if (flag)
+ this._element.classList.remove(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
+ else
+ this._element.classList.add(WebInspector.TreeElementStatusButton.DisabledStyleClassName);
+ },
+
+ // Private
+
+ _clicked: function(event)
+ {
+ if (!this.enabled)
+ return;
+
+ event.stopPropagation();
+
+ this.dispatchEventToListeners(WebInspector.TreeElementStatusButton.Event.Clicked, event);
+ }
+};
+
+WebInspector.TreeElementStatusButton.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejsfromrev164541trunkSourceWebInspectorUIUserInterfaceTreeOutlinejs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TreeOutline.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,1094 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2013 Apple Inc. 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+/**
+ * @constructor
+ */
+function TreeOutline(listNode)
+{
+ WebInspector.Object.call(this);
+
+ this.element = listNode;
+
+ /**
+ * @type {Array.<TreeElement>}
+ */
+ this.children = [];
+ this.selectedTreeElement = null;
+ this._childrenListNode = listNode;
+ this._childrenListNode.removeChildren();
+ this._knownTreeElements = [];
+ this._treeElementsExpandedState = [];
+ this.expandTreeElementsWhenArrowing = false;
+ this.allowsRepeatSelection = false;
+ this.root = true;
+ this.hasChildren = false;
+ this.expanded = true;
+ this.selected = false;
+ this.treeOutline = this;
+
+ this._childrenListNode.tabIndex = 0;
+ this._childrenListNode.addEventListener("keydown", this._treeKeyDown.bind(this), true);
+}
+
+TreeOutline._knownTreeElementNextIdentifier = 1;
+TreeOutline.prototype.constructor = TreeOutline;
+
+TreeOutline.prototype.appendChild = function(child)
+{
+ if (!child)
+ throw("child can't be undefined or null");
+
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild) {
+ lastChild.nextSibling = child;
+ child.previousSibling = lastChild;
+ } else {
+ child.previousSibling = null;
+ child.nextSibling = null;
+ }
+
+ var isFirstChild = !this.children.length;
+
+ this.children.push(child);
+ this.hasChildren = true;
+ child.parent = this;
+ child.treeOutline = this.treeOutline;
+ child.treeOutline._rememberTreeElement(child);
+
+ var current = child.children[0];
+ while (current) {
+ current.treeOutline = this.treeOutline;
+ current.treeOutline._rememberTreeElement(current);
+ current = current.traverseNextTreeElement(false, child, true);
+ }
+
+ if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)
+ child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];
+
+ if (this._childrenListNode)
+ child._attach();
+
+ if (this.treeOutline.onadd)
+ this.treeOutline.onadd(child);
+
+ if (isFirstChild && this.expanded)
+ this.expand();
+}
+
+TreeOutline.prototype.insertChild = function(child, index)
+{
+ if (!child)
+ throw("child can't be undefined or null");
+
+ var previousChild = (index > 0 ? this.children[index - 1] : null);
+ if (previousChild) {
+ previousChild.nextSibling = child;
+ child.previousSibling = previousChild;
+ } else {
+ child.previousSibling = null;
+ }
+
+ var nextChild = this.children[index];
+ if (nextChild) {
+ nextChild.previousSibling = child;
+ child.nextSibling = nextChild;
+ } else {
+ child.nextSibling = null;
+ }
+
+ var isFirstChild = !this.children.length;
+
+ this.children.splice(index, 0, child);
+ this.hasChildren = true;
+ child.parent = this;
+ child.treeOutline = this.treeOutline;
+ child.treeOutline._rememberTreeElement(child);
+
+ var current = child.children[0];
+ while (current) {
+ current.treeOutline = this.treeOutline;
+ current.treeOutline._rememberTreeElement(current);
+ current = current.traverseNextTreeElement(false, child, true);
+ }
+
+ if (child.hasChildren && child.treeOutline._treeElementsExpandedState[child.identifier] !== undefined)
+ child.expanded = child.treeOutline._treeElementsExpandedState[child.identifier];
+
+ if (this._childrenListNode)
+ child._attach();
+
+ if (this.treeOutline.onadd)
+ this.treeOutline.onadd(child);
+
+ if (isFirstChild && this.expanded)
+ this.expand();
+}
+
+TreeOutline.prototype.removeChildAtIndex = function(childIndex, suppressOnDeselect, suppressSelectSibling)
+{
+ if (childIndex < 0 || childIndex >= this.children.length)
+ throw("childIndex out of range");
+
+ var child = this.children[childIndex];
+ this.children.splice(childIndex, 1);
+
+ var parent = child.parent;
+ if (child.deselect(suppressOnDeselect)) {
+ if (child.previousSibling && !suppressSelectSibling)
+ child.previousSibling.select(true, false);
+ else if (child.nextSibling && !suppressSelectSibling)
+ child.nextSibling.select(true, false);
+ else if (!suppressSelectSibling)
+ parent.select(true, false);
+ }
+
+ if (child.previousSibling)
+ child.previousSibling.nextSibling = child.nextSibling;
+ if (child.nextSibling)
+ child.nextSibling.previousSibling = child.previousSibling;
+
+ if (child.treeOutline) {
+ child.treeOutline._forgetTreeElement(child);
+ child.treeOutline._forgetChildrenRecursive(child);
+ }
+
+ child._detach();
+ child.treeOutline = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+
+ if (this.treeOutline && this.treeOutline.onremove)
+ this.treeOutline.onremove(child);
+}
+
+TreeOutline.prototype.removeChild = function(child, suppressOnDeselect, suppressSelectSibling)
+{
+ if (!child)
+ throw("child can't be undefined or null");
+
+ var childIndex = this.children.indexOf(child);
+ if (childIndex === -1)
+ throw("child not found in this node's children");
+
+ this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling);
+}
+
+TreeOutline.prototype.removeChildren = function(suppressOnDeselect)
+{
+ var treeOutline = this.treeOutline;
+
+ for (var i = 0; i < this.children.length; ++i) {
+ var child = this.children[i];
+ child.deselect(suppressOnDeselect);
+
+ if (child.treeOutline) {
+ child.treeOutline._forgetTreeElement(child);
+ child.treeOutline._forgetChildrenRecursive(child);
+ }
+
+ child._detach();
+ child.treeOutline = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+
+ if (treeOutline && treeOutline.onremove)
+ treeOutline.onremove(child);
+ }
+
+ this.children = [];
+}
+
+TreeOutline.prototype.removeChildrenRecursive = function(suppressOnDeselect)
+{
+ var childrenToRemove = this.children;
+
+ var treeOutline = this.treeOutline;
+
+ var child = this.children[0];
+ while (child) {
+ if (child.children.length)
+ childrenToRemove = childrenToRemove.concat(child.children);
+ child = child.traverseNextTreeElement(false, this, true);
+ }
+
+ for (var i = 0; i < childrenToRemove.length; ++i) {
+ child = childrenToRemove[i];
+ child.deselect(suppressOnDeselect);
+
+ if (child.treeOutline)
+ child.treeOutline._forgetTreeElement(child);
+
+ child._detach();
+ child.children = [];
+ child.treeOutline = null;
+ child.parent = null;
+ child.nextSibling = null;
+ child.previousSibling = null;
+
+ if (treeOutline && treeOutline.onremove)
+ treeOutline.onremove(child);
+ }
+
+ this.children = [];
+}
+
+TreeOutline.prototype._rememberTreeElement = function(element)
+{
+ if (!this._knownTreeElements[element.identifier])
+ this._knownTreeElements[element.identifier] = [];
+
+ // check if the element is already known
+ var elements = this._knownTreeElements[element.identifier];
+ if (elements.indexOf(element) !== -1)
+ return;
+
+ // add the element
+ elements.push(element);
+}
+
+TreeOutline.prototype._forgetTreeElement = function(element)
+{
+ if (this.selectedTreeElement === element)
+ this.selectedTreeElement = null;
+ if (this._knownTreeElements[element.identifier])
+ this._knownTreeElements[element.identifier].remove(element, true);
+}
+
+TreeOutline.prototype._forgetChildrenRecursive = function(parentElement)
+{
+ var child = parentElement.children[0];
+ while (child) {
+ this._forgetTreeElement(child);
+ child = child.traverseNextTreeElement(false, parentElement, true);
+ }
+}
+
+TreeOutline.prototype.getCachedTreeElement = function(representedObject)
+{
+ if (!representedObject)
+ return null;
+
+ if (representedObject.__treeElementIdentifier) {
+ // If this representedObject has a tree element identifier, and it is a known TreeElement
+ // in our tree we can just return that tree element.
+ var elements = this._knownTreeElements[representedObject.__treeElementIdentifier];
+ if (elements) {
+ for (var i = 0; i < elements.length; ++i)
+ if (elements[i].representedObject === representedObject)
+ return elements[i];
+ }
+ }
+ return null;
+}
+
+TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor, getParent)
+{
+ if (!representedObject)
+ return null;
+
+ var cachedElement = this.getCachedTreeElement(representedObject);
+ if (cachedElement)
+ return cachedElement;
+
+ // The representedObject isn't known, so we start at the top of the tree and work down to find the first
+ // tree element that represents representedObject or one of its ancestors.
+ var item;
+ var found = false;
+ for (var i = 0; i < this.children.length; ++i) {
+ item = this.children[i];
+ if (item.representedObject === representedObject || (isAncestor && isAncestor(item.representedObject, representedObject))) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ return null;
+
+ // Make sure the item that we found is connected to the root of the tree.
+ // Build up a list of representedObject's ancestors that aren't already in our tree.
+ var ancestors = [];
+ var currentObject = representedObject;
+ while (currentObject) {
+ ancestors.unshift(currentObject);
+ if (currentObject === item.representedObject)
+ break;
+ currentObject = getParent(currentObject);
+ }
+
+ // For each of those ancestors we populate them to fill in the tree.
+ for (var i = 0; i < ancestors.length; ++i) {
+ // Make sure we don't call findTreeElement with the same representedObject
+ // again, to prevent infinite recursion.
+ if (ancestors[i] === representedObject)
+ continue;
+ // FIXME: we could do something faster than findTreeElement since we will know the next
+ // ancestor exists in the tree.
+ item = this.findTreeElement(ancestors[i], isAncestor, getParent);
+ if (item)
+ item.onpopulate();
+ }
+
+ return this.getCachedTreeElement(representedObject);
+}
+
+TreeOutline.prototype._treeElementDidChange = function(treeElement)
+{
+ if (treeElement.treeOutline !== this)
+ return;
+
+ if (this.onchange)
+ this.onchange(treeElement);
+}
+
+TreeOutline.prototype.treeElementFromPoint = function(x, y)
+{
+ var node = this._childrenListNode.ownerDocument.elementFromPoint(x, y);
+ if (!node)
+ return null;
+
+ var listNode = node.enclosingNodeOrSelfWithNodeNameInArray(["ol", "li"]);
+ if (listNode)
+ return listNode.parentTreeElement || listNode.treeElement;
+ return null;
+}
+
+TreeOutline.prototype._treeKeyDown = function(event)
+{
+ if (event.target !== this._childrenListNode)
+ return;
+
+ if (!this.selectedTreeElement || event.shiftKey || event.metaKey || event.ctrlKey)
+ return;
+
+ var handled = false;
+ var nextSelectedElement;
+ if (event.keyIdentifier === "Up" && !event.altKey) {
+ nextSelectedElement = this.selectedTreeElement.traversePreviousTreeElement(true);
+ while (nextSelectedElement && !nextSelectedElement.selectable)
+ nextSelectedElement = nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);
+ handled = nextSelectedElement ? true : false;
+ } else if (event.keyIdentifier === "Down" && !event.altKey) {
+ nextSelectedElement = this.selectedTreeElement.traverseNextTreeElement(true);
+ while (nextSelectedElement && !nextSelectedElement.selectable)
+ nextSelectedElement = nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);
+ handled = nextSelectedElement ? true : false;
+ } else if (event.keyIdentifier === "Left") {
+ if (this.selectedTreeElement.expanded) {
+ if (event.altKey)
+ this.selectedTreeElement.collapseRecursively();
+ else
+ this.selectedTreeElement.collapse();
+ handled = true;
+ } else if (this.selectedTreeElement.parent && !this.selectedTreeElement.parent.root) {
+ handled = true;
+ if (this.selectedTreeElement.parent.selectable) {
+ nextSelectedElement = this.selectedTreeElement.parent;
+ while (nextSelectedElement && !nextSelectedElement.selectable)
+ nextSelectedElement = nextSelectedElement.parent;
+ handled = nextSelectedElement ? true : false;
+ } else if (this.selectedTreeElement.parent)
+ this.selectedTreeElement.parent.collapse();
+ }
+ } else if (event.keyIdentifier === "Right") {
+ if (!this.selectedTreeElement.revealed()) {
+ this.selectedTreeElement.reveal();
+ handled = true;
+ } else if (this.selectedTreeElement.hasChildren) {
+ handled = true;
+ if (this.selectedTreeElement.expanded) {
+ nextSelectedElement = this.selectedTreeElement.children[0];
+ while (nextSelectedElement && !nextSelectedElement.selectable)
+ nextSelectedElement = nextSelectedElement.nextSibling;
+ handled = nextSelectedElement ? true : false;
+ } else {
+ if (event.altKey)
+ this.selectedTreeElement.expandRecursively();
+ else
+ this.selectedTreeElement.expand();
+ }
+ }
+ } else if (event.keyCode === 8 /* Backspace */ || event.keyCode === 46 /* Delete */) {
+ if (this.selectedTreeElement.ondelete)
+ handled = this.selectedTreeElement.ondelete();
+ if (!handled && this.treeOutline.ondelete)
+ handled = this.treeOutline.ondelete(this.selectedTreeElement);
+ } else if (isEnterKey(event)) {
+ if (this.selectedTreeElement.onenter)
+ handled = this.selectedTreeElement.onenter();
+ if (!handled && this.treeOutline.onenter)
+ handled = this.treeOutline.onenter(this.selectedTreeElement);
+ } else if (event.keyIdentifier === "U+0020" /* Space */) {
+ if (this.selectedTreeElement.onspace)
+ handled = this.selectedTreeElement.onspace();
+ if (!handled && this.treeOutline.onspace)
+ handled = this.treeOutline.onspace(this.selectedTreeElement);
+ }
+
+ if (nextSelectedElement) {
+ nextSelectedElement.reveal();
+ nextSelectedElement.select(false, true);
+ }
+
+ if (handled) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+}
+
+TreeOutline.prototype.expand = function()
+{
+ // this is the root, do nothing
+}
+
+TreeOutline.prototype.collapse = function()
+{
+ // this is the root, do nothing
+}
+
+TreeOutline.prototype.revealed = function()
+{
+ return true;
+}
+
+TreeOutline.prototype.reveal = function()
+{
+ // this is the root, do nothing
+}
+
+TreeOutline.prototype.select = function()
+{
+ // this is the root, do nothing
+}
+
+/**
+ * @param {boolean=} omitFocus
+ */
+TreeOutline.prototype.revealAndSelect = function(omitFocus)
+{
+ // this is the root, do nothing
+}
+
+TreeOutline.prototype.__proto__ = WebInspector.Object.prototype;
+
+/**
+ * @constructor
+ * @param {Object=} representedObject
+ * @param {boolean=} hasChildren
+ */
+function TreeElement(title, representedObject, hasChildren)
+{
+ WebInspector.Object.call(this);
+
+ this._title = title;
+ this.representedObject = (representedObject || {});
+
+ if (this.representedObject.__treeElementIdentifier)
+ this.identifier = this.representedObject.__treeElementIdentifier;
+ else {
+ this.identifier = TreeOutline._knownTreeElementNextIdentifier++;
+ this.representedObject.__treeElementIdentifier = this.identifier;
+ }
+
+ this._hidden = false;
+ this._selectable = true;
+ this.expanded = false;
+ this.selected = false;
+ this.hasChildren = hasChildren;
+ this.children = [];
+ this.treeOutline = null;
+ this.parent = null;
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this._listItemNode = null;
+}
+
+TreeElement.prototype = {
+ constructor: TreeElement,
+
+ arrowToggleWidth: 10,
+
+ get selectable() {
+ if (this._hidden)
+ return false;
+ return this._selectable;
+ },
+
+ set selectable(x) {
+ this._selectable = x;
+ },
+
+ get listItemElement() {
+ return this._listItemNode;
+ },
+
+ get childrenListElement() {
+ return this._childrenListNode;
+ },
+
+ get title() {
+ return this._title;
+ },
+
+ set title(x) {
+ this._title = x;
+ this._setListItemNodeContent();
+ this.didChange();
+ },
+
+ get titleHTML() {
+ return this._titleHTML;
+ },
+
+ set titleHTML(x) {
+ this._titleHTML = x;
+ this._setListItemNodeContent();
+ this.didChange();
+ },
+
+ get tooltip() {
+ return this._tooltip;
+ },
+
+ set tooltip(x) {
+ this._tooltip = x;
+ if (this._listItemNode)
+ this._listItemNode.title = x ? x : "";
+ this.didChange();
+ },
+
+ get hasChildren() {
+ return this._hasChildren;
+ },
+
+ set hasChildren(x) {
+ if (this._hasChildren === x)
+ return;
+
+ this._hasChildren = x;
+
+ if (!this._listItemNode)
+ return;
+
+ if (x)
+ this._listItemNode.classList.add("parent");
+ else {
+ this._listItemNode.classList.remove("parent");
+ this.collapse();
+ }
+
+ this.didChange();
+ },
+
+ get hidden() {
+ return this._hidden;
+ },
+
+ set hidden(x) {
+ if (this._hidden === x)
+ return;
+
+ this._hidden = x;
+
+ if (x) {
+ if (this._listItemNode)
+ this._listItemNode.classList.add("hidden");
+ if (this._childrenListNode)
+ this._childrenListNode.classList.add("hidden");
+ } else {
+ if (this._listItemNode)
+ this._listItemNode.classList.remove("hidden");
+ if (this._childrenListNode)
+ this._childrenListNode.classList.remove("hidden");
+ }
+
+ if (this.treeOutline && this.treeOutline.onhidden)
+ this.treeOutline.onhidden(this, x);
+ },
+
+ get shouldRefreshChildren() {
+ return this._shouldRefreshChildren;
+ },
+
+ set shouldRefreshChildren(x) {
+ this._shouldRefreshChildren = x;
+ if (x && this.expanded)
+ this.expand();
+ },
+
+ _fireDidChange: function()
+ {
+ delete this._didChangeTimeoutIdentifier;
+
+ if (this.treeOutline)
+ this.treeOutline._treeElementDidChange(this);
+ },
+
+ didChange: function()
+ {
+ if (!this.treeOutline)
+ return;
+
+ // Prevent telling the TreeOutline multiple times in a row by delaying it with a timeout.
+ if (!this._didChangeTimeoutIdentifier)
+ this._didChangeTimeoutIdentifier = setTimeout(this._fireDidChange.bind(this), 0);
+ },
+
+ _setListItemNodeContent: function()
+ {
+ if (!this._listItemNode)
+ return;
+
+ if (!this._titleHTML && !this._title)
+ this._listItemNode.removeChildren();
+ else if (typeof this._titleHTML === "string")
+ this._listItemNode.innerHTML = this._titleHTML;
+ else if (typeof this._title === "string")
+ this._listItemNode.textContent = this._title;
+ else {
+ this._listItemNode.removeChildren();
+ if (this._title.parentNode)
+ this._title.parentNode.removeChild(this._title);
+ this._listItemNode.appendChild(this._title);
+ }
+ }
+}
+
+TreeElement.prototype.appendChild = TreeOutline.prototype.appendChild;
+TreeElement.prototype.insertChild = TreeOutline.prototype.insertChild;
+TreeElement.prototype.removeChild = TreeOutline.prototype.removeChild;
+TreeElement.prototype.removeChildAtIndex = TreeOutline.prototype.removeChildAtIndex;
+TreeElement.prototype.removeChildren = TreeOutline.prototype.removeChildren;
+TreeElement.prototype.removeChildrenRecursive = TreeOutline.prototype.removeChildrenRecursive;
+
+TreeElement.prototype._attach = function()
+{
+ if (!this._listItemNode || this.parent._shouldRefreshChildren) {
+ if (this._listItemNode && this._listItemNode.parentNode)
+ this._listItemNode.parentNode.removeChild(this._listItemNode);
+
+ this._listItemNode = this.treeOutline._childrenListNode.ownerDocument.createElement("li");
+ this._listItemNode.treeElement = this;
+ this._setListItemNodeContent();
+ this._listItemNode.title = this._tooltip ? this._tooltip : "";
+
+ if (this.hidden)
+ this._listItemNode.classList.add("hidden");
+ if (this.hasChildren)
+ this._listItemNode.classList.add("parent");
+ if (this.expanded)
+ this._listItemNode.classList.add("expanded");
+ if (this.selected)
+ this._listItemNode.classList.add("selected");
+
+ this._listItemNode.addEventListener("mousedown", TreeElement.treeElementMouseDown, false);
+ this._listItemNode.addEventListener("click", TreeElement.treeElementToggled, false);
+ this._listItemNode.addEventListener("dblclick", TreeElement.treeElementDoubleClicked, false);
+
+ if (this.onattach)
+ this.onattach(this);
+ }
+
+ var nextSibling = null;
+ if (this.nextSibling && this.nextSibling._listItemNode && this.nextSibling._listItemNode.parentNode === this.parent._childrenListNode)
+ nextSibling = this.nextSibling._listItemNode;
+ this.parent._childrenListNode.insertBefore(this._listItemNode, nextSibling);
+ if (this._childrenListNode)
+ this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);
+ if (this.selected)
+ this.select();
+ if (this.expanded)
+ this.expand();
+}
+
+TreeElement.prototype._detach = function()
+{
+ if (this.ondetach)
+ this.ondetach(this);
+ if (this._listItemNode && this._listItemNode.parentNode)
+ this._listItemNode.parentNode.removeChild(this._listItemNode);
+ if (this._childrenListNode && this._childrenListNode.parentNode)
+ this._childrenListNode.parentNode.removeChild(this._childrenListNode);
+}
+
+TreeElement.treeElementMouseDown = function(event)
+{
+ var element = event.currentTarget;
+ if (!element || !element.treeElement || !element.treeElement.selectable)
+ return;
+
+ if (element.treeElement.isEventWithinDisclosureTriangle(event)) {
+ event.preventDefault();
+ return;
+ }
+
+ element.treeElement.selectOnMouseDown(event);
+}
+
+TreeElement.treeElementToggled = function(event)
+{
+ var element = event.currentTarget;
+ if (!element || !element.treeElement)
+ return;
+
+ var toggleOnClick = element.treeElement.toggleOnClick && !element.treeElement.selectable;
+ var isInTriangle = element.treeElement.isEventWithinDisclosureTriangle(event);
+ if (!toggleOnClick && !isInTriangle)
+ return;
+
+ if (element.treeElement.expanded) {
+ if (event.altKey)
+ element.treeElement.collapseRecursively();
+ else
+ element.treeElement.collapse();
+ } else {
+ if (event.altKey)
+ element.treeElement.expandRecursively();
+ else
+ element.treeElement.expand();
+ }
+ event.stopPropagation();
+}
+
+TreeElement.treeElementDoubleClicked = function(event)
+{
+ var element = event.currentTarget;
+ if (!element || !element.treeElement)
+ return;
+
+ if (element.treeElement.isEventWithinDisclosureTriangle(event))
+ return;
+
+ if (element.treeElement.ondblclick)
+ element.treeElement.ondblclick.call(element.treeElement, event);
+ else if (element.treeElement.hasChildren && !element.treeElement.expanded)
+ element.treeElement.expand();
+}
+
+TreeElement.prototype.collapse = function()
+{
+ if (this._listItemNode)
+ this._listItemNode.classList.remove("expanded");
+ if (this._childrenListNode)
+ this._childrenListNode.classList.remove("expanded");
+
+ this.expanded = false;
+ if (this.treeOutline)
+ this.treeOutline._treeElementsExpandedState[this.identifier] = false;
+
+ if (this.oncollapse)
+ this.oncollapse(this);
+
+ if (this.treeOutline && this.treeOutline.oncollapse)
+ this.treeOutline.oncollapse(this);
+}
+
+TreeElement.prototype.collapseRecursively = function()
+{
+ var item = this;
+ while (item) {
+ if (item.expanded)
+ item.collapse();
+ item = item.traverseNextTreeElement(false, this, true);
+ }
+}
+
+TreeElement.prototype.expand = function()
+{
+ if (this.expanded && !this._shouldRefreshChildren && this._childrenListNode)
+ return;
+
+ // Set this before onpopulate. Since onpopulate can add elements and call onadd, this makes
+ // sure the expanded flag is true before calling those functions. This prevents the possibility
+ // of an infinite loop if onpopulate or onadd were to call expand.
+
+ this.expanded = true;
+ if (this.treeOutline)
+ this.treeOutline._treeElementsExpandedState[this.identifier] = true;
+
+ // If there are no children, return. We will be expanded once we have children.
+ if (!this.hasChildren)
+ return;
+
+ if (this.treeOutline && (!this._childrenListNode || this._shouldRefreshChildren)) {
+ if (this._childrenListNode && this._childrenListNode.parentNode)
+ this._childrenListNode.parentNode.removeChild(this._childrenListNode);
+
+ this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol");
+ this._childrenListNode.parentTreeElement = this;
+ this._childrenListNode.classList.add("children");
+
+ if (this.hidden)
+ this._childrenListNode.classList.add("hidden");
+
+ this.onpopulate();
+
+ for (var i = 0; i < this.children.length; ++i)
+ this.children[i]._attach();
+
+ delete this._shouldRefreshChildren;
+ }
+
+ if (this._listItemNode) {
+ this._listItemNode.classList.add("expanded");
+ if (this._childrenListNode && this._childrenListNode.parentNode != this._listItemNode.parentNode)
+ this.parent._childrenListNode.insertBefore(this._childrenListNode, this._listItemNode.nextSibling);
+ }
+
+ if (this._childrenListNode)
+ this._childrenListNode.classList.add("expanded");
+
+ if (this.onexpand)
+ this.onexpand(this);
+
+ if (this.treeOutline && this.treeOutline.onexpand)
+ this.treeOutline.onexpand(this);
+}
+
+TreeElement.prototype.expandRecursively = function(maxDepth)
+{
+ var item = this;
+ var info = {};
+ var depth = 0;
+
+ // The Inspector uses TreeOutlines to represents object properties, so recursive expansion
+ // in some case can be infinite, since JavaScript objects can hold circular references.
+ // So default to a recursion cap of 3 levels, since that gives fairly good results.
+ if (typeof maxDepth === "undefined" || typeof maxDepth === "null")
+ maxDepth = 3;
+
+ while (item) {
+ if (depth < maxDepth)
+ item.expand();
+ item = item.traverseNextTreeElement(false, this, (depth >= maxDepth), info);
+ depth += info.depthChange;
+ }
+}
+
+TreeElement.prototype.hasAncestor = function(ancestor) {
+ if (!ancestor)
+ return false;
+
+ var currentNode = this.parent;
+ while (currentNode) {
+ if (ancestor === currentNode)
+ return true;
+ currentNode = currentNode.parent;
+ }
+
+ return false;
+}
+
+TreeElement.prototype.reveal = function()
+{
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded)
+ currentAncestor.expand();
+ currentAncestor = currentAncestor.parent;
+ }
+
+ if (this.onreveal)
+ this.onreveal(this);
+}
+
+TreeElement.prototype.revealed = function()
+{
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded)
+ return false;
+ currentAncestor = currentAncestor.parent;
+ }
+
+ return true;
+}
+
+TreeElement.prototype.selectOnMouseDown = function(event)
+{
+ this.select(false, true);
+}
+
+/**
+ * @param {boolean=} omitFocus
+ * @param {boolean=} selectedByUser
+ */
+TreeElement.prototype.select = function(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect)
+{
+ if (!this.treeOutline || !this.selectable)
+ return;
+
+ if (this.selected && !this.treeOutline.allowsRepeatSelection)
+ return;
+
+ if (!omitFocus)
+ this.treeOutline._childrenListNode.focus();
+
+ // Focusing on another node may detach "this" from tree.
+ if (!this.treeOutline)
+ return;
+
+ this.treeOutline.processingSelectionChange = true;
+
+ if (!this.selected) {
+ if (this.treeOutline.selectedTreeElement)
+ this.treeOutline.selectedTreeElement.deselect(suppressOnDeselect);
+
+ this.selected = true;
+ this.treeOutline.selectedTreeElement = this;
+
+ if (this._listItemNode)
+ this._listItemNode.classList.add("selected");
+ }
+
+ if (this.onselect && !suppressOnSelect)
+ this.onselect(this, selectedByUser);
+
+ if (this.treeOutline.onselect && !suppressOnSelect)
+ this.treeOutline.onselect(this, selectedByUser);
+
+ delete this.treeOutline.processingSelectionChange;
+}
+
+/**
+ * @param {boolean=} omitFocus
+ */
+TreeElement.prototype.revealAndSelect = function(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect)
+{
+ this.reveal();
+ this.select(omitFocus, selectedByUser, suppressOnSelect, suppressOnDeselect);
+}
+
+/**
+ * @param {boolean=} suppressOnDeselect
+ */
+TreeElement.prototype.deselect = function(suppressOnDeselect)
+{
+ if (!this.treeOutline || this.treeOutline.selectedTreeElement !== this || !this.selected)
+ return false;
+
+ this.selected = false;
+ this.treeOutline.selectedTreeElement = null;
+
+ if (this._listItemNode)
+ this._listItemNode.classList.remove("selected");
+
+ if (this.ondeselect && !suppressOnDeselect)
+ this.ondeselect(this);
+
+ if (this.treeOutline.ondeselect && !suppressOnDeselect)
+ this.treeOutline.ondeselect(this);
+
+ return true;
+}
+
+TreeElement.prototype.onpopulate = function()
+{
+ // Overriden by subclasses.
+}
+
+/**
+ * @param {boolean} skipUnrevealed
+ * @param {(TreeOutline|TreeElement)=} stayWithin
+ * @param {boolean=} dontPopulate
+ * @param {Object=} info
+ * @return {TreeElement}
+ */
+TreeElement.prototype.traverseNextTreeElement = function(skipUnrevealed, stayWithin, dontPopulate, info)
+{
+ if (!dontPopulate && this.hasChildren)
+ this.onpopulate.call(this); // FIXME: This shouldn't need to use call, but this is working around a JSC bug. https://webkit.org/b/74811
+
+ if (info)
+ info.depthChange = 0;
+
+ var element = skipUnrevealed ? (this.revealed() ? this.children[0] : null) : this.children[0];
+ if (element && (!skipUnrevealed || (skipUnrevealed && this.expanded))) {
+ if (info)
+ info.depthChange = 1;
+ return element;
+ }
+
+ if (this === stayWithin)
+ return null;
+
+ element = skipUnrevealed ? (this.revealed() ? this.nextSibling : null) : this.nextSibling;
+ if (element)
+ return element;
+
+ element = this;
+ while (element && !element.root && !(skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling) && element.parent !== stayWithin) {
+ if (info)
+ info.depthChange -= 1;
+ element = element.parent;
+ }
+
+ if (!element)
+ return null;
+
+ return (skipUnrevealed ? (element.revealed() ? element.nextSibling : null) : element.nextSibling);
+}
+
+/**
+ * @param {boolean} skipUnrevealed
+ * @param {boolean=} dontPopulate
+ * @return {TreeElement}
+ */
+TreeElement.prototype.traversePreviousTreeElement = function(skipUnrevealed, dontPopulate)
+{
+ var element = skipUnrevealed ? (this.revealed() ? this.previousSibling : null) : this.previousSibling;
+ if (!dontPopulate && element && element.hasChildren)
+ element.onpopulate();
+
+ while (element && (skipUnrevealed ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1])) {
+ if (!dontPopulate && element.hasChildren)
+ element.onpopulate();
+ element = (skipUnrevealed ? (element.revealed() && element.expanded ? element.children[element.children.length - 1] : null) : element.children[element.children.length - 1]);
+ }
+
+ if (element)
+ return element;
+
+ if (!this.parent || this.parent.root)
+ return null;
+
+ return this.parent;
+}
+
+TreeElement.prototype.isEventWithinDisclosureTriangle = function(event)
+{
+ // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)
+ var computedLeftPadding = window.getComputedStyle(this._listItemNode).getPropertyCSSValue("padding-left").getFloatValue(CSSPrimitiveValue.CSS_PX);
+ var left = this._listItemNode.totalOffsetLeft + computedLeftPadding;
+ return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
+}
+
+TreeElement.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlineDataGridSynchronizerjsfromrev164541trunkSourceWebInspectorUIUserInterfaceTreeOutlineDataGridSynchronizerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutlineDataGridSynchronizer.js (from rev 164541, trunk/Source/WebInspectorUI/UserInterface/TreeOutlineDataGridSynchronizer.js) (0 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutlineDataGridSynchronizer.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutlineDataGridSynchronizer.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -0,0 +1,298 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.TreeOutlineDataGridSynchronizer = function(treeOutline, dataGrid, delegate)
+{
+ WebInspector.Object.call(this);
+
+ this._treeOutline = treeOutline;
+ this._dataGrid = dataGrid;
+ this._delegate = delegate || null;
+ this._enabled = true;
+
+ this._treeOutline.element.parentNode.addEventListener("scroll", this._treeOutlineScrolled.bind(this));
+ this._dataGrid.scrollContainer.addEventListener("scroll", this._dataGridScrolled.bind(this));
+
+ this._treeOutline.__dataGridNode = this._dataGrid;
+
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.ExpandedNode, this._dataGridNodeExpanded, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.CollapsedNode, this._dataGridNodeCollapsed, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+
+ // FIXME: This is a hack. TreeOutline should just dispatch events via WebInspector.Object.
+ var existingOnAdd = treeOutline.onadd;
+ var existingOnRemove = treeOutline.onremove;
+ var existingOnExpand = treeOutline.onexpand;
+ var existingOnCollapse = treeOutline.oncollapse;
+ var existingOnHidden = treeOutline.onhidden;
+ var existingOnSelect = treeOutline.onselect;
+
+ treeOutline.onadd = function(element) {
+ this._treeElementAdded(element);
+ if (existingOnAdd)
+ existingOnAdd.call(treeOutline, element);
+ }.bind(this);
+
+ treeOutline.onremove = function(element) {
+ this._treeElementRemoved(element);
+ if (existingOnRemove)
+ existingOnRemove.call(treeOutline, element);
+ }.bind(this);
+
+ treeOutline.onexpand = function(element) {
+ this._treeElementExpanded(element);
+ if (existingOnExpand)
+ existingOnExpand.call(treeOutline, element);
+ }.bind(this);
+
+ treeOutline.oncollapse = function(element) {
+ this._treeElementCollapsed(element);
+ if (existingOnCollapse)
+ existingOnCollapse.call(treeOutline, element);
+ }.bind(this);
+
+ treeOutline.onhidden = function(element, hidden) {
+ this._treeElementHiddenChanged(element, hidden);
+ if (existingOnHidden)
+ existingOnHidden.call(treeOutline, element, hidden);
+ }.bind(this);
+
+ treeOutline.onselect = function(element, selectedByUser) {
+ this._treeElementSelected(element, selectedByUser);
+ if (existingOnSelect)
+ existingOnSelect.call(treeOutline, element, selectedByUser);
+ }.bind(this);
+}
+
+WebInspector.TreeOutlineDataGridSynchronizer.prototype = {
+ constructor: WebInspector.TreeOutlineDataGridSynchronizer,
+ __proto__: WebInspector.Object,
+
+ // Public
+
+ get treeOutline()
+ {
+ return this._treeOutline;
+ },
+
+ get dataGrid()
+ {
+ return this._dataGrid;
+ },
+
+ get delegate()
+ {
+ return this._delegate;
+ },
+
+ get enabled()
+ {
+ return this._enabled;
+ },
+
+ set enabled(x)
+ {
+ this._enabled = x || false;
+ },
+
+ associate: function(treeElement, dataGridNode)
+ {
+ console.assert(treeElement);
+ console.assert(dataGridNode);
+
+ treeElement.__dataGridNode = dataGridNode;
+ dataGridNode.__treeElement = treeElement;
+ },
+
+ synchronize: function()
+ {
+ this._dataGrid.scrollContainer.scrollTop = this._treeOutline.element.parentNode.scrollTop;
+ if (this._treeOutline.selectedTreeElement)
+ this._treeOutline.selectedTreeElement.__dataGridNode.select(true);
+ else if (this._dataGrid.selectedNode)
+ this._dataGrid.selectedNode.deselect(true);
+ },
+
+ treeElementForDataGridNode: function(dataGridNode)
+ {
+ return dataGridNode.__treeElement || null;
+ },
+
+ dataGridNodeForTreeElement: function(treeElement)
+ {
+ if (treeElement.__dataGridNode)
+ return treeElement.__dataGridNode;
+
+ if (typeof this._delegate.dataGridNodeForTreeElement === "function") {
+ var dataGridNode = this._delegate.dataGridNodeForTreeElement(treeElement);
+ if (dataGridNode)
+ this.associate(treeElement, dataGridNode);
+ return dataGridNode;
+ }
+
+ return null;
+ },
+
+ // Private
+
+ _treeOutlineScrolled: function(event)
+ {
+ if (!this._enabled)
+ return;
+
+ if (this._ignoreNextTreeOutlineScrollEvent) {
+ delete this._ignoreNextTreeOutlineScrollEvent;
+ return;
+ }
+
+ this._ignoreNextDataGridScrollEvent = true;
+ this._dataGrid.scrollContainer.scrollTop = this._treeOutline.element.parentNode.scrollTop;
+ },
+
+ _dataGridScrolled: function(event)
+ {
+ if (!this._enabled)
+ return;
+
+ if (this._ignoreNextDataGridScrollEvent) {
+ delete this._ignoreNextDataGridScrollEvent;
+ return;
+ }
+
+ this._ignoreNextTreeOutlineScrollEvent = true;
+ this._treeOutline.element.parentNode.scrollTop = this._dataGrid.scrollContainer.scrollTop;
+ },
+
+ _dataGridNodeSelected: function(event)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = this._dataGrid.selectedNode;
+ if (dataGridNode)
+ dataGridNode.__treeElement.select(true, true, true, true);
+ },
+
+ _dataGridNodeExpanded: function(event)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = event.data.dataGridNode;
+ console.assert(dataGridNode);
+
+ if (!dataGridNode.__treeElement.expanded)
+ dataGridNode.__treeElement.expand();
+ },
+
+ _dataGridNodeCollapsed: function(event)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = event.data.dataGridNode;
+ console.assert(dataGridNode);
+
+ if (dataGridNode.__treeElement.expanded)
+ dataGridNode.__treeElement.collapse();
+ },
+
+ _treeElementSelected: function(treeElement, selectedByUser)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = treeElement.__dataGridNode;
+ console.assert(dataGridNode);
+
+ dataGridNode.select(true);
+ },
+
+ _treeElementAdded: function(treeElement)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = this.dataGridNodeForTreeElement(treeElement);
+ console.assert(dataGridNode);
+
+ var parentDataGridNode = treeElement.parent.__dataGridNode;
+ console.assert(dataGridNode);
+
+ var childIndex = treeElement.parent.children.indexOf(treeElement);
+ console.assert(childIndex !== -1);
+
+ parentDataGridNode.insertChild(dataGridNode, childIndex);
+ },
+
+ _treeElementRemoved: function(treeElement)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = treeElement.__dataGridNode;
+ console.assert(dataGridNode);
+
+ if (dataGridNode.parent)
+ dataGridNode.parent.removeChild(dataGridNode);
+ },
+
+ _treeElementExpanded: function(treeElement)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = treeElement.__dataGridNode;
+ console.assert(dataGridNode);
+
+ if (!dataGridNode.expanded)
+ dataGridNode.expand();
+ },
+
+ _treeElementCollapsed: function(treeElement)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = treeElement.__dataGridNode;
+ console.assert(dataGridNode);
+
+ if (dataGridNode.expanded)
+ dataGridNode.collapse();
+ },
+
+ _treeElementHiddenChanged: function(treeElement, hidden)
+ {
+ if (!this._enabled)
+ return;
+
+ var dataGridNode = treeElement.__dataGridNode;
+ console.assert(dataGridNode);
+
+ dataGridNode.element.classList.toggle("hidden", hidden);
+ }
+}
+
+WebInspector.TreeOutlineDataGridSynchronizer.prototype.__proto__ = WebInspector.Object.prototype;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceWebInspectorjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/WebInspector.js (164542 => 164543)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/WebInspector.js        2014-02-22 17:31:15 UTC (rev 164542)
+++ trunk/Source/WebInspectorUI/UserInterface/WebInspector.js        2014-02-22 17:33:44 UTC (rev 164543)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
- */
-
-const WebInspector = {}; // Namespace
</del></span></pre>
</div>
</div>
</body>
</html>