| Index: chrome_linux/resources/inspector/ElementsPanel.js
|
| ===================================================================
|
| --- chrome_linux/resources/inspector/ElementsPanel.js (revision 229864)
|
| +++ chrome_linux/resources/inspector/ElementsPanel.js (working copy)
|
| @@ -65,7 +65,7 @@
|
| WebInspector.CSSNamedFlowView.OversetTypeMessageMap={empty:"empty",fit:"fit",overset:"overset"}
|
| WebInspector.CSSNamedFlowView.prototype={_createFlowTreeOutline:function(rootDOMNode)
|
| {if(!rootDOMNode)
|
| -return null;var treeOutline=new WebInspector.ElementsTreeOutline(false,false);treeOutline.element.addStyleClass("named-flow-element");treeOutline.setVisible(true);treeOutline.rootDOMNode=rootDOMNode;treeOutline.wireToDomAgent();WebInspector.domAgent.removeEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,treeOutline._elementsTreeUpdater._documentUpdated,treeOutline._elementsTreeUpdater);return treeOutline;},_insertContentNode:function(contentNodeId,index)
|
| +return null;var treeOutline=new WebInspector.ElementsTreeOutline(false,false,true);treeOutline.element.addStyleClass("named-flow-element");treeOutline.setVisible(true);treeOutline.rootDOMNode=rootDOMNode;treeOutline.wireToDomAgent();WebInspector.domAgent.removeEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,treeOutline._elementsTreeUpdater._documentUpdated,treeOutline._elementsTreeUpdater);return treeOutline;},_insertContentNode:function(contentNodeId,index)
|
| {var treeOutline=this._createFlowTreeOutline(WebInspector.domAgent.nodeForId(contentNodeId));var treeItem=new TreeElement(treeOutline.element,treeOutline);if(index===undefined){this._contentTreeItem.appendChild(treeItem);return;}
|
| this._contentTreeItem.insertChild(treeItem,index);},_insertRegion:function(region,index)
|
| {var treeOutline=this._createFlowTreeOutline(WebInspector.domAgent.nodeForId(region.nodeId));treeOutline.element.addStyleClass("region-"+region.regionOverset);var treeItem=new TreeElement(treeOutline.element,treeOutline);var oversetText=WebInspector.UIString(WebInspector.CSSNamedFlowView.OversetTypeMessageMap[region.regionOverset]);treeItem.tooltip=WebInspector.UIString("Region is %s.",oversetText);if(index===undefined){this._regionsTreeItem.appendChild(treeItem);return;}
|
| @@ -157,10 +157,10 @@
|
| value="\u2012";else if(name==="position"&&value==="auto")
|
| value="\u2012";value=value.replace(/px$/,"");value=Number.toFixedIfFloating(value);var element=document.createElement("div");element.className=side;element.textContent=value;element.addEventListener("dblclick",this.startEditing.bind(this,element,name,propertyName,style),false);return element;}
|
| function getContentAreaWidthPx(style)
|
| -{var width=style.getPropertyValue("width").replace(/px$/,"");if(!isNaN(width)&&style.getPropertyValue("box-sizing")==="border-box"){var borderBox=self._getBox(style,"border");var paddingBox=self._getBox(style,"padding");width=width-borderBox.left-borderBox.right-paddingBox.left-paddingBox.right;}
|
| +{var width=style.getPropertyValue("width").replace(/px$/,"");if(style.getPropertyValue("box-sizing")==="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 Number.toFixedIfFloating(width);}
|
| function getContentAreaHeightPx(style)
|
| -{var height=style.getPropertyValue("height").replace(/px$/,"");if(!isNaN(height)&&style.getPropertyValue("box-sizing")==="border-box"){var borderBox=self._getBox(style,"border");var paddingBox=self._getBox(style,"padding");height=height-borderBox.top-borderBox.bottom-paddingBox.top-paddingBox.bottom;}
|
| +{var height=style.getPropertyValue("height").replace(/px$/,"");if(style.getPropertyValue("box-sizing")==="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 Number.toFixedIfFloating(height);}
|
| 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};var noPaddingDisplayType={"table-column":true,"table-column-group":true,"table-footer-group":true,"table-header-group":true,"table-row":true,"table-row-group":true};var noPositionType={"static":true};var boxes=["content","padding","border","margin","position"];var boxColors=[WebInspector.Color.PageHighlight.Content,WebInspector.Color.PageHighlight.Padding,WebInspector.Color.PageHighlight.Border,WebInspector.Color.PageHighlight.Margin,WebInspector.Color.fromRGBA([0,0,0,0])];var boxLabels=[WebInspector.UIString("content"),WebInspector.UIString("padding"),WebInspector.UIString("border"),WebInspector.UIString("margin"),WebInspector.UIString("position")];var previousBox=null;this._boxElements=[];for(var i=0;i<boxes.length;++i){var name=boxes[i];if(name==="margin"&&noMarginDisplayType[style.getPropertyValue("display")])
|
| continue;if(name==="padding"&&noPaddingDisplayType[style.getPropertyValue("display")])
|
| @@ -198,19 +198,7 @@
|
| if(commitEditor){self.dispatchEventToListeners("metrics edited");self.update();}};var allProperties=this.inlineStyle.allProperties;for(var i=0;i<allProperties.length;++i){var property=allProperties[i];if(property.name!==context.styleProperty||property.inactive)
|
| continue;this.previousPropertyDataCandidate=property;property.setValue(userInput,commitEditor,true,callback);return;}
|
| this.inlineStyle.appendProperty(context.styleProperty,userInput,callback);},editingCommitted:function(element,userInput,previousContent,context)
|
| -{this.editingEnded(element,context);this._applyUserInput(element,userInput,previousContent,context,true);},__proto__:WebInspector.SidebarPane.prototype};WebInspector.PlatformFontsSidebarPane=function()
|
| -{WebInspector.SidebarPane.call(this,WebInspector.UIString("Fonts"));this.element.addStyleClass("platform-fonts");WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified,this._onNodeChange.bind(this));WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._onNodeChange.bind(this));WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified,this._onNodeChange.bind(this));var cssFontSection=this.element.createChild("div","stats-section monospace");var cssFontPrefix=cssFontSection.createChild("span","webkit-css-property");cssFontPrefix.textContent="font-family";cssFontSection.createTextChild(":");this._cssFontValue=cssFontSection.createChild("span","css-font-value");this._fontStatsSection=this.element.createChild("div","stats-section");}
|
| -WebInspector.PlatformFontsSidebarPane.prototype={_onNodeChange:function()
|
| -{if(this._innerUpdateTimeout)
|
| -return;this._innerUpdateTimeout=setTimeout(this._innerUpdate.bind(this),100);},update:function(node)
|
| -{if(!node){delete this._node;return;}
|
| -this._node=node;this._innerUpdate();},_innerUpdate:function()
|
| -{if(this._innerUpdateTimeout){clearTimeout(this._innerUpdateTimeout);delete this._innerUpdateTimeout;}
|
| -if(!this._node)
|
| -return;WebInspector.cssModel.getPlatformFontsForNode(this._node.id,this._refreshUI.bind(this,this._node));},_refreshUI:function(node,cssFamilyName,platformFonts)
|
| -{if(this._node!==node)
|
| -return;this._cssFontValue.textContent=cssFamilyName+";";this._fontStatsSection.removeChildren();if(!platformFonts||!platformFonts.length)
|
| -return;platformFonts.sort(function(a,b){return b.glyphCount-a.glyphCount;});for(var i=0;i<platformFonts.length;++i){var fontStatElement=this._fontStatsSection.createChild("div","font-stats-item");var fontNameElement=fontStatElement.createChild("span","font-name");fontNameElement.textContent=platformFonts[i].familyName;var fontDelimeterElement=fontStatElement.createChild("span","delimeter");fontDelimeterElement.textContent="\u2014";var fontUsageElement=fontStatElement.createChild("span","font-usage");var usage=platformFonts[i].glyphCount;fontUsageElement.textContent=usage===1?WebInspector.UIString("%d glyph",usage):WebInspector.UIString("%d glyphs",usage);}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.PropertiesSidebarPane=function()
|
| +{this.editingEnded(element,context);this._applyUserInput(element,userInput,previousContent,context,true);},__proto__:WebInspector.SidebarPane.prototype};WebInspector.PropertiesSidebarPane=function()
|
| {WebInspector.SidebarPane.call(this,WebInspector.UIString("Properties"));}
|
| WebInspector.PropertiesSidebarPane._objectGroupName="properties-sidebar-pane";WebInspector.PropertiesSidebarPane.prototype={update:function(node)
|
| {var body=this.bodyElement;if(!node){body.removeChildren();this.sections=[];return;}
|
| @@ -635,7 +623,7 @@
|
| if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.section().navigable){this._navigateToSource(event.target);return;}
|
| this.startEditing(event.target);},_navigateToSource:function(element)
|
| {console.assert(this.section().navigable);var propertyNameClicked=element===this.nameElement;var uiLocation=this.property.uiLocation(propertyNameClicked);if(!uiLocation)
|
| -return;WebInspector.showPanel("scripts").showUILocation(uiLocation);},_isNameElement:function(element)
|
| +return;WebInspector.showPanel("scripts").showUISourceCode(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber);},_isNameElement:function(element)
|
| {return element.enclosingNodeOrSelfWithClass("webkit-css-property")===this.nameElement;},_isValueElement:function(element)
|
| {return!!element.enclosingNodeOrSelfWithClass("value");},startEditing:function(selectElement)
|
| {if(this.parent.isShorthand)
|
| @@ -761,13 +749,10 @@
|
| return false;word=word.toLowerCase();return this._cssCompletions.keySet().hasOwnProperty(word);},_buildPropertyCompletions:function(proxyElement,wordRange,force,completionsReadyCallback)
|
| {var prefix=wordRange.toString().toLowerCase();if(!prefix&&!force&&(this._isEditingName||proxyElement.textContent.length)){completionsReadyCallback([]);return;}
|
| var results=this._cssCompletions.startsWith(prefix);var selectedIndex=this._cssCompletions.mostUsedOf(results);completionsReadyCallback(results,selectedIndex);},__proto__:WebInspector.TextPrompt.prototype};WebInspector.ElementsPanel=function()
|
| -{WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbList.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS("textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const minimumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContentHeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.setSidebarElementConstraints(Preferences.minElementsSidebarWidth,Preferences.minElementsSidebarHeight);this.splitView.setMainElementConstraints(minimumContentWidthPercent,minimumContentHeightPercent);this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Resized,this._updateTreeOutlineVisibleWidth.bind(this));this.contentElement=this.splitView.mainElement;this.contentElement.id="elements-content";this.contentElement.addStyleClass("outline-disclosure");this.contentElement.addStyleClass("source-code");if(!WebInspector.settings.domWordWrap.get())
|
| -this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMenuEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutline(true,true,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeChanged,this);this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated,this._updateBreadcrumbIfNeeded,this);this.crumbsElement=document.createElement("div");this.crumbsElement.className="crumbs";this.crumbsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsElement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bind(this),false);this.sidebarPanes={};this.sidebarPanes.platformFonts=new WebInspector.PlatformFontsSidebarPane();this.sidebarPanes.computedStyle=new WebInspector.ComputedStyleSidebarPane();this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this));this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListeners=new WebInspector.EventListenersSidebarPane();this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateStyles.bind(this,false));this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPanes.platformFonts.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updatePlatformFonts.bind(this));this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this));this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateEventListeners.bind(this));this.sidebarPanes.styles.addEventListener("style edited",this._stylesPaneEdited,this);this.sidebarPanes.styles.addEventListener("style property toggled",this._stylesPaneEdited,this);this.sidebarPanes.metrics.addEventListener("metrics edited",this._metricsPaneEdited,this);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._popoverHelper=new WebInspector.PopoverHelper(this.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(0);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));if(WebInspector.domAgent.existingDocument())
|
| +{WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbList.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS("textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const minimumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContentHeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.setSidebarElementConstraints(Preferences.minElementsSidebarWidth,Preferences.minElementsSidebarHeight);this.splitView.setMainElementConstraints(minimumContentWidthPercent,minimumContentHeightPercent);this.contentElement=this.splitView.mainElement;this.contentElement.id="elements-content";this.contentElement.addStyleClass("outline-disclosure");this.contentElement.addStyleClass("source-code");if(!WebInspector.settings.domWordWrap.get())
|
| +this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMenuEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutline(true,true,false,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeChanged,this);this.crumbsElement=document.createElement("div");this.crumbsElement.className="crumbs";this.crumbsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsElement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bind(this),false);this.sidebarPanes={};this.sidebarPanes.computedStyle=new WebInspector.ComputedStyleSidebarPane();this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this));this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListeners=new WebInspector.EventListenersSidebarPane();this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateStyles.bind(this,false));this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this));this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateEventListeners.bind(this));this.sidebarPanes.styles.addEventListener("style edited",this._stylesPaneEdited,this);this.sidebarPanes.styles.addEventListener("style property toggled",this._stylesPaneEdited,this);this.sidebarPanes.metrics.addEventListener("metrics edited",this._metricsPaneEdited,this);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._popoverHelper=new WebInspector.PopoverHelper(this.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(0);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified,this._updateBreadcrumbIfNeeded,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._updateBreadcrumbIfNeeded,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved,this._nodeRemoved,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));if(WebInspector.domAgent.existingDocument())
|
| this._documentUpdated(WebInspector.domAgent.existingDocument());}
|
| -WebInspector.ElementsPanel.prototype={_updateTreeOutlineVisibleWidth:function()
|
| -{if(!this.treeOutline)
|
| -return;var width=this.splitView.element.offsetWidth;if(this.splitView.isVertical())
|
| -width-=this.splitView.sidebarWidth();this.treeOutline.setVisibleWidth(width);},get statusBarItems()
|
| +WebInspector.ElementsPanel.prototype={get statusBarItems()
|
| {return[this.crumbsElement];},defaultFocusedElement:function()
|
| {return this.treeOutline.element;},statusBarResized:function()
|
| {this.updateBreadcrumbSizes();},wasShown:function()
|
| @@ -786,7 +771,7 @@
|
| this._selectedPathOnReset=this._lastValidSelectedNode.path();this.updateBreadcrumb(false);this._updateSidebars();if(selectedNode){ConsoleAgent.addInspectedNode(selectedNode.id);this._lastValidSelectedNode=selectedNode;}
|
| WebInspector.notifications.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged);},_updateSidebars:function()
|
| {for(var pane in this.sidebarPanes)
|
| -this.sidebarPanes[pane].needsUpdate=true;this.updateStyles(true);this.updateMetrics();this.updatePlatformFonts();this.updateProperties();this.updateEventListeners();},_reset:function()
|
| +this.sidebarPanes[pane].needsUpdate=true;this.updateStyles(true);this.updateMetrics();this.updateProperties();this.updateEventListeners();},_reset:function()
|
| {delete this.currentQuery;},_documentUpdatedEvent:function(event)
|
| {this._documentUpdated(event.data);},_documentUpdated:function(inspectedRootDocument)
|
| {this._reset();this.searchCanceled();this.treeOutline.rootDOMNode=inspectedRootDocument;if(!inspectedRootDocument){if(this.isShowing())
|
| @@ -854,14 +839,17 @@
|
| return;var treeElement=this.treeOutline.findTreeElement(searchResult);if(treeElement)
|
| treeElement.hideSearchHighlights();},selectedDOMNode:function()
|
| {return this.treeOutline.selectedDOMNode();},selectDOMNode:function(node,focus)
|
| -{this.treeOutline.selectDOMNode(node,focus);},_updateBreadcrumbIfNeeded:function(event)
|
| -{var nodes=(event.data||[]);if(!nodes.length)
|
| -return;var crumbs=this.crumbsElement;for(var crumb=crumbs.firstChild;crumb;crumb=crumb.nextSibling){if(nodes.indexOf(crumb.representedObject)!==-1){this.updateBreadcrumb(true);return;}}},_stylesPaneEdited:function()
|
| -{this.sidebarPanes.metrics.needsUpdate=true;this.updateMetrics();this.sidebarPanes.platformFonts.needsUpdate=true;this.updatePlatformFonts();},_metricsPaneEdited:function()
|
| +{this.treeOutline.selectDOMNode(node,focus);},_nodeRemoved:function(event)
|
| +{if(!this.isShowing())
|
| +return;var crumbs=this.crumbsElement;for(var crumb=crumbs.firstChild;crumb;crumb=crumb.nextSibling){if(crumb.representedObject===event.data.node){this.updateBreadcrumb(true);return;}}},_stylesPaneEdited:function()
|
| +{this.sidebarPanes.metrics.needsUpdate=true;this.updateMetrics();},_metricsPaneEdited:function()
|
| {this.sidebarPanes.styles.needsUpdate=true;this.updateStyles(true);},_mouseMovedInCrumbs:function(event)
|
| {var nodeUnderMouse=document.elementFromPoint(event.pageX,event.pageY);var crumbElement=nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb");WebInspector.domAgent.highlightDOMNode(crumbElement?crumbElement.representedObject.id:0);if("_mouseOutOfCrumbsTimeout"in this){clearTimeout(this._mouseOutOfCrumbsTimeout);delete this._mouseOutOfCrumbsTimeout;}},_mouseMovedOutOfCrumbs:function(event)
|
| {var nodeUnderMouse=document.elementFromPoint(event.pageX,event.pageY);if(nodeUnderMouse&&nodeUnderMouse.isDescendant(this.crumbsElement))
|
| -return;WebInspector.domAgent.hideDOMNodeHighlight();this._mouseOutOfCrumbsTimeout=setTimeout(this.updateBreadcrumbSizes.bind(this),1000);},updateBreadcrumb:function(forceUpdate)
|
| +return;WebInspector.domAgent.hideDOMNodeHighlight();this._mouseOutOfCrumbsTimeout=setTimeout(this.updateBreadcrumbSizes.bind(this),1000);},_updateBreadcrumbIfNeeded:function(event)
|
| +{var name=event.data.name;if(name!=="class"&&name!=="id")
|
| +return;var node=(event.data.node);var crumbs=this.crumbsElement;var crumb=crumbs.firstChild;while(crumb){if(crumb.representedObject===node){this.updateBreadcrumb(true);break;}
|
| +crumb=crumb.nextSibling;}},updateBreadcrumb:function(forceUpdate)
|
| {if(!this.isShowing())
|
| return;var crumbs=this.crumbsElement;var handled=false;var crumb=crumbs.firstChild;while(crumb){if(crumb.representedObject===this.selectedDOMNode()){crumb.addStyleClass("selected");handled=true;}else{crumb.removeStyleClass("selected");}
|
| crumb=crumb.nextSibling;}
|
| @@ -872,7 +860,8 @@
|
| panel.updateBreadcrumbSizes(crumb);}else
|
| panel.selectDOMNode(crumb.representedObject,true);event.preventDefault();}
|
| for(var current=this.selectedDOMNode();current;current=current.parentNode){if(current.nodeType()===Node.DOCUMENT_NODE)
|
| -continue;crumb=document.createElement("span");crumb.className="crumb";crumb.representedObject=current;crumb.addEventListener("mousedown",selectCrumbFunction,false);var crumbTitle="";switch(current.nodeType()){case Node.ELEMENT_NODE:WebInspector.DOMPresentationUtils.decorateNodeLabel(current,crumb);break;case Node.TEXT_NODE:crumbTitle=WebInspector.UIString("(text)");break;case Node.COMMENT_NODE:crumbTitle="<!-->";break;case Node.DOCUMENT_TYPE_NODE:crumbTitle="<!DOCTYPE>";break;default:crumbTitle=current.nodeNameInCorrectCase();}
|
| +continue;crumb=document.createElement("span");crumb.className="crumb";crumb.representedObject=current;crumb.addEventListener("mousedown",selectCrumbFunction,false);var crumbTitle;switch(current.nodeType()){case Node.ELEMENT_NODE:WebInspector.DOMPresentationUtils.decorateNodeLabel(current,crumb);break;case Node.TEXT_NODE:crumbTitle=WebInspector.UIString("(text)");break
|
| +case Node.COMMENT_NODE:crumbTitle="<!-->";break;case Node.DOCUMENT_TYPE_NODE:crumbTitle="<!DOCTYPE>";break;default:crumbTitle=current.nodeNameInCorrectCase();}
|
| if(!crumb.childNodes.length){var nameElement=document.createElement("span");nameElement.textContent=crumbTitle;crumb.appendChild(nameElement);crumb.title=crumbTitle;}
|
| if(current===this.selectedDOMNode())
|
| crumb.addStyleClass("selected");if(!crumbs.childNodes.length)
|
| @@ -933,9 +922,7 @@
|
| {var stylesSidebarPane=this.sidebarPanes.styles;var computedStylePane=this.sidebarPanes.computedStyle;if((!stylesSidebarPane.isShowing()&&!computedStylePane.isShowing())||!stylesSidebarPane.needsUpdate)
|
| return;stylesSidebarPane.update(this.selectedDOMNode(),forceUpdate);stylesSidebarPane.needsUpdate=false;},updateMetrics:function()
|
| {var metricsSidebarPane=this.sidebarPanes.metrics;if(!metricsSidebarPane.isShowing()||!metricsSidebarPane.needsUpdate)
|
| -return;metricsSidebarPane.update(this.selectedDOMNode());metricsSidebarPane.needsUpdate=false;},updatePlatformFonts:function()
|
| -{var platformFontsSidebar=this.sidebarPanes.platformFonts;if(!platformFontsSidebar.isShowing()||!platformFontsSidebar.needsUpdate)
|
| -return;platformFontsSidebar.update(this.selectedDOMNode());platformFontsSidebar.needsUpdate=false;},updateProperties:function()
|
| +return;metricsSidebarPane.update(this.selectedDOMNode());metricsSidebarPane.needsUpdate=false;},updateProperties:function()
|
| {var propertiesSidebarPane=this.sidebarPanes.properties;if(!propertiesSidebarPane.isShowing()||!propertiesSidebarPane.needsUpdate)
|
| return;propertiesSidebarPane.update(this.selectedDOMNode());propertiesSidebarPane.needsUpdate=false;},updateEventListeners:function()
|
| {var eventListenersSidebarPane=this.sidebarPanes.eventListeners;if(!eventListenersSidebarPane.isShowing()||!eventListenersSidebarPane.needsUpdate)
|
| @@ -953,23 +940,20 @@
|
| {WebInspector.inspectorView.setCurrentPanel(this);var node=WebInspector.domAgent.nodeForId(nodeId);if(!node)
|
| return;while(!WebInspector.ElementsTreeOutline.showShadowDOM()&&node&&node.isInShadowTree())
|
| node=node.parentNode;WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);this.selectDOMNode(node,true);},appendApplicableItems:function(event,contextMenu,target)
|
| -{function selectNode(nodeId)
|
| +{if(!(target instanceof WebInspector.RemoteObject))
|
| +return;var remoteObject=(target);if(remoteObject.subtype!=="node")
|
| +return;function selectNode(nodeId)
|
| {if(nodeId)
|
| WebInspector.domAgent.inspectElement(nodeId);}
|
| -function revealElement(remoteObject)
|
| +function revealElement()
|
| {remoteObject.pushNodeToFrontend(selectNode);}
|
| -var commandCallback;if(target instanceof WebInspector.RemoteObject){var remoteObject=(target);if(remoteObject.subtype==="node")
|
| -commandCallback=revealElement.bind(this,remoteObject);}else if(target instanceof WebInspector.DOMNode){var domNode=(target);if(domNode.id)
|
| -commandCallback=WebInspector.domAgent.inspectElement.bind(WebInspector.domAgent,domNode.id);}
|
| -if(!commandCallback)
|
| -return;if(this.treeOutline.element.isAncestor(event.target))
|
| -return;contextMenu.appendItem(WebInspector.useLowerCaseMenuTitles()?"Reveal in Elements panel":"Reveal in Elements Panel",commandCallback);},_sidebarContextMenuEventFired:function(event)
|
| +contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"Reveal in Elements panel":"Reveal in Elements Panel"),revealElement.bind(this));},_sidebarContextMenuEventFired:function(event)
|
| {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.show();},_dockSideChanged:function()
|
| {var dockSide=WebInspector.dockController.dockSide();var vertically=dockSide===WebInspector.DockController.State.DockedToRight&&WebInspector.settings.splitVerticallyWhenDockedToRight.get();this._splitVertically(vertically);},_showShadowDOMChanged:function()
|
| {this.treeOutline.update();},_splitVertically:function(vertically)
|
| {if(this.sidebarPaneView&&vertically===!this.splitView.isVertical())
|
| return;if(this.sidebarPaneView)
|
| -this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var computedPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedPane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill");var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.bodyElement.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.show(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(expandComputed);this.sidebarPanes.platformFonts.show(computedPane.bodyElement);if(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sidebarPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expandComputed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var compositePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePane.element.addStyleClass("composite");compositePane.element.addStyleClass("fill");var expandComposite=compositePane.expand.bind(compositePane);var splitView=new WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(compositePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());splitView.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.sidebarPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.secondElement());computedPane.setExpandCallback(expandComposite);this.sidebarPaneView.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.properties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);}else{this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var stylesPane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());stylesPane.element.addStyleClass("composite");stylesPane.element.addStyleClass("fill");var expandStyles=stylesPane.expand.bind(stylesPane);stylesPane.bodyElement.addStyleClass("metrics-and-styles");this.sidebarPanes.styles.show(stylesPane.bodyElement);this.sidebarPanes.styles.setExpandCallback(expandStyles);this.sidebarPanes.metrics.setExpandCallback(expandStyles);stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);function showMetrics(pane,beforeElement)
|
| +this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var computedPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedPane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill");var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.bodyElement.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.show(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(expandComputed);if(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sidebarPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expandComputed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var compositePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePane.element.addStyleClass("composite");compositePane.element.addStyleClass("fill");var expandComposite=compositePane.expand.bind(compositePane);var splitView=new WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(compositePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());splitView.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.sidebarPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.secondElement());computedPane.setExpandCallback(expandComposite);this.sidebarPaneView.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.properties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);}else{this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var stylesPane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());stylesPane.element.addStyleClass("composite");stylesPane.element.addStyleClass("fill");var expandStyles=stylesPane.expand.bind(stylesPane);stylesPane.bodyElement.addStyleClass("metrics-and-styles");this.sidebarPanes.styles.show(stylesPane.bodyElement);this.sidebarPanes.styles.setExpandCallback(expandStyles);this.sidebarPanes.metrics.setExpandCallback(expandStyles);stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);function showMetrics(pane,beforeElement)
|
| {this.sidebarPanes.metrics.show(pane.bodyElement,beforeElement);}
|
| function tabSelected(event)
|
| {var tabId=(event.data.tabId);if(tabId===computedPane.title())
|
|
|